/* Transparency Tycoon chrome, on pv tokens. Game colors (tiles, buildings, people) live in art.js and are drawn on the
   canvas; the panels here are a warm clinic cream with teal title strips, declared once as --app-* below.
   Layout: the world fills the page; the top bar, toolbar, ticker, minimap, windows and title screen float above. */

[hidden] { display: none !important; }

/* The HUD face: IBM Plex Mono Medium and SemiBold (SIL OFL, hud/fonts/OFL.txt), served from the app's own folder */
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url(hud/fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 600; font-style: normal; font-display: swap; src: url(hud/fonts/ibm-plex-mono-latin-600-normal.woff2) format("woff2"); }
.ht-legacy { width: min(520px, calc(100% - 32px)); max-height: 90dvh; overflow: auto; margin: auto; padding: 24px; border: 1px solid var(--pv-stroke); color: var(--pv-text); }
.ht-legacy h2 { font-size: 20px; line-height: 1.3; }
.ht-legacy .pv-btn { min-height: 44px; font-size: 14px; }
.ht-legacy::backdrop { background: rgb(0 0 0 / 40%); }
.ht-legacy p { margin-block: 16px; }

:root {
  --app-cream: #fbf8f1;       /* panel body */
  --app-cream-2: #f1ece0;     /* wells, rows */
  --app-line: #ddd5c4;        /* dividers */
  --app-ink: #1f2a30;         /* text: 14:1 on cream */
  --app-ink-2: #4d5a61;       /* secondary text */
  --app-teal: #16696D;        /* brand teal: title strips, primary */
  --app-teal-2: #0f5256;      /* pressed */
  --app-mint: #3fd0c4;        /* focus ring on dark, active marks */
  --app-coral: #e8644f;       /* alerts, bad */
  --app-gold: #f2b53a;        /* stars, warnings */
  --app-green: #2f9a5b;       /* good */
  --app-night: #0e1a22;       /* title screen veil */
  --app-pixel-cyan: #26faee;  /* the wordmark's TYCOON, and the Continue button */
  --app-pixel-ink: #01303a;   /* the wordmark's outline: 11:1 on the cyan */
  --app-shadow: 0 10px 30px rgba(10, 30, 30, 0.28);
  --app-glass: rgba(249, 248, 246, 0.2);   /* HUD panels: frosted, the world shows through */
  --app-chip: rgba(249, 248, 246, 0.9);    /* HUD chips and tool tiles */
  --app-chip-line: #e7e2d9;                /* chip borders and dividers */
  --app-hud-ink: #1a3a39;                  /* HUD text: 11:1 on a chip */
  --app-toast: rgba(248, 242, 224, 0.9);   /* alerts */
  --app-hud-font: "IBM Plex Mono", var(--pv-mono);
  --pv-card: var(--app-cream); --pv-stroke: var(--app-line); --pv-text: var(--app-ink); --pv-text-2: var(--app-ink-2);
}
body { background: var(--app-night); }
:focus-visible { outline: 2px solid var(--app-mint); outline-offset: 2px; }

.ht-app { background: var(--app-night); font-family: var(--pv-font); color: var(--app-ink); user-select: none; -webkit-user-select: none; }
#world { cursor: grab; touch-action: none; }
#world.ht-c-build { cursor: crosshair; }
#world.ht-c-drag { cursor: grabbing; }
#world:focus-visible { outline: 2px solid var(--app-mint); outline-offset: -2px; }

/* The HUD, after the Community Play frame "Proposed updates to UI": frosted glass panels holding cream chips, all in
   IBM Plex Mono. Two panels across the top (the hospital and its vitals; the date and the speeds), alerts under the
   clock, tool tiles bottom left, the minimap bottom right. */
.ht-top {
  position: absolute; z-index: 6; top: 16px; left: 16px; right: calc(16px + var(--tq-play-exit, 0px)); display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
  gap: 6px 12px; pointer-events: none; font: 500 13px/1.1 var(--app-hud-font); letter-spacing: 0.01em; color: var(--app-hud-ink);
}
.ht-top > * { pointer-events: auto; }
.ht-top > .ht-top-left { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; max-width: 100%; pointer-events: none; }
.ht-top-left > * { pointer-events: auto; }
/* The guided start's list of first jobs, under the hospital's name */
.ht-guide { width: 290px; max-width: 100%; padding: 10px 12px; background: var(--app-toast); border-radius: 10px; -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px); font: 500 12px/1.35 var(--app-hud-font); letter-spacing: 0.01em; color: var(--app-hud-ink); }
.ht-guide[hidden] { display: none; }
.ht-guide .hd { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 7px; font-weight: 600; font-size: 10.5px; letter-spacing: 0.07em; text-transform: uppercase; }
.ht-guide ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.ht-guide li { display: grid; grid-template-columns: 17px 1fr; gap: 7px; align-items: start; opacity: 0.6; }
.ht-guide li.now { opacity: 1; font-weight: 600; }
.ht-guide li.done > span:last-child { text-decoration: line-through; }
.ht-guide .mk { width: 17px; height: 17px; border-radius: 50%; border: 1.5px solid currentColor; display: flex; align-items: center; justify-content: center; font-size: 9.5px; font-weight: 600; line-height: 1; }
.ht-guide li.done .mk, .ht-guide li.now .mk { background: var(--app-hud-ink); border-color: var(--app-hud-ink); color: var(--app-cream); }
.ht-guide small { display: block; margin-top: 3px; font-size: 11.5px; font-weight: 500; }
@media (max-width: 900px) { .ht-guide li:not(.now) { display: none; } }
/* The button the job in hand needs (main.js guideGlow) */
.ht-glow { outline: 3px solid var(--app-gold); outline-offset: 2px; animation: ht-glow 1.1s ease-in-out infinite; }
@keyframes ht-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(242, 181, 58, 0.75); } 50% { box-shadow: 0 0 0 9px rgba(242, 181, 58, 0); } }
@media (prefers-reduced-motion: reduce) { .ht-glow { animation: none; } }
/* Getting started's arrow (main.js pointAt): a gold arrow with what to do bobs toward the glowing button */
.ht-pointer { position: fixed; z-index: 60; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 2px; transform: translate(-50%, -100%); }
.ht-pointer[data-dir="up"] { transform: translate(-50%, 0); flex-direction: column-reverse; }
.ht-pointer[hidden] { display: none; }
.ht-pointer svg { display: block; fill: var(--app-gold); stroke: var(--app-ink); stroke-width: 1.5; stroke-linejoin: round; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35)); animation: ht-bob-down 0.9s ease-in-out infinite; }
.ht-pointer[data-dir="up"] svg { transform: rotate(180deg); animation-name: ht-bob-up; }
.ht-pointer-label { display: none; padding: 3px 9px; border-radius: 999px; background: var(--app-gold); color: var(--app-ink); font: 700 12px/1.2 var(--app-hud-font); white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); }
.ht-pointer.has-label .ht-pointer-label { display: block; }
@keyframes ht-bob-down { 0%, 100% { transform: translateY(-6px); } 50% { transform: translateY(0); } }
@keyframes ht-bob-up { 0%, 100% { transform: rotate(180deg) translateY(-6px); } 50% { transform: rotate(180deg) translateY(0); } }
@media (prefers-reduced-motion: reduce) { .ht-pointer svg { animation: none; } .ht-pointer[data-dir="up"] svg { transform: rotate(180deg); } }
/* Coaching on a guided game's first contract talk */
.tk-coach { display: flex; gap: 8px; align-items: flex-start; margin: 10px 16px 0; padding: 8px 12px; border-radius: 10px; background: #fff7e0; border: 1px solid #f0dc9c; font: 400 0.8rem/1.4 var(--pv-font); color: var(--app-ink); }
.tk-coach svg { flex: none; width: 15px; height: 15px; margin-top: 2px; }
.ht-glass { background: var(--app-glass); border-radius: 10px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.ht-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; padding: 8px 12px; max-width: 100%; }
.ht-name { color: #fff; text-decoration: none; border-radius: 6px; min-width: 0; max-width: 100%; }
.ht-name h1 { font: 500 16px/1.1 var(--app-hud-font); letter-spacing: 0.01em; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(26, 58, 57, 0.45); }
.ht-vitals { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ht-hchip {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 8px 0 5px; border-radius: 7px; border: 1.5px solid var(--app-chip-line);
  background: var(--app-chip); color: var(--app-hud-ink); font: 500 13px/1.1 var(--app-hud-font); letter-spacing: 0.01em; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ht-hchip.ht-tight { padding-left: 2px; }
/* each icon sits where the frame puts it: the art is trimmed, so the slack is margin */
#v-patients img { margin-left: 1px; } #v-wait img { margin: 0 1px 0 2px; } #v-mood img { margin: 0 1px; }
#v-rating img, #v-cash img { margin-left: 1px; } #v-date img { margin: 0 3px 0 2px; }
.ht-hchip img, .ht-speed img, .ht-ico img, .ht-ticker img { display: block; flex: none; image-rendering: auto; }
button.ht-hchip { cursor: pointer; transition: background 0.12s, transform 0.12s; }
button.ht-hchip:hover { background: #fff; transform: translateY(-1px); }
#v-cash.ht-neg, #touch-vitals.ht-neg { color: var(--app-coral); }
/* the board's clock: only on screen while cash is below zero */
.ht-hchip.ht-boardclock { max-width: 100%; box-shadow: 0 1px 3px rgba(26, 58, 57, 0.25); }
.ht-hchip.ht-boardclock > span { overflow: hidden; text-overflow: ellipsis; }
.ht-hchip.ht-boardclock { background: #fbe4df; border-color: var(--app-coral); color: #8f2f1f; font-weight: 600; }
button.ht-hchip.ht-boardclock:hover { background: #fdeeea; }
.ht-hchip.ht-boardclock.ht-watch, button.ht-hchip.ht-boardclock.ht-watch:hover { background: #fff3d6; border-color: #d99a2b; color: #7a5200; }
.ht-hchip.ht-boardclock.ht-urgent { background: var(--app-coral); color: #fff; animation: ht-boardpulse 1.2s ease-in-out infinite; }
@keyframes ht-boardpulse { 50% { box-shadow: 0 0 0 4px rgba(232, 100, 79, 0.35); } }
@media (prefers-reduced-motion: reduce) { .ht-hchip.ht-boardclock.ht-urgent { animation: none; } }
.ht-warn { color: #a33a28; font-weight: 600; }
.ht-selfpct { font: 600 0.82rem var(--pv-font); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ht-note.bad { color: #a33a28; }
.ht-top-right { position: relative; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; margin-left: auto; max-width: 100%; pointer-events: none; }
.ht-top-right > * { pointer-events: auto; }
.ht-clock { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 6px; padding: 8px 12px; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.ht-hchip.ht-date { cursor: default; text-decoration: none; }
.ht-speeds { display: inline-flex; width: 160px; height: 28px; border: 1.5px solid var(--app-chip-line); border-radius: 7px; overflow: hidden; background: var(--app-chip); }
.ht-speed {
  flex: 1 1 0; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--app-hud-ink); font: 500 13px/1 var(--app-hud-font); letter-spacing: 0.01em;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.ht-sound { cursor: pointer; }
.ht-sound svg { display: block; width: 15px; height: 15px; }
.ht-sound[aria-pressed="false"] { opacity: 0.6; }
.ht-speed + .ht-speed { border-left: 1.5px solid var(--app-chip-line); }
.ht-speed:hover { background: #fff; }
.ht-speed[aria-pressed="true"] { background: var(--app-chip-line); box-shadow: inset 0 -2px 0 var(--app-hud-ink); }

/* Alerts: the latest one as a toast under the clock; a card (Contract talks, a new version) stacks beneath it */
.ht-notices { position: absolute; top: calc(100% + 16px); right: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; width: max-content; max-width: min(520px, calc(100vw - 32px)); pointer-events: none; }   /* out of flow, so a long alert never pushes the clock to a second row */
.ht-notices > * { max-width: 100%; }
.ht-talkcta { width: min(480px, calc(100vw - 32px)); }
.ht-notices > * { pointer-events: auto; }
.ht-ticker {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--app-toast); border-radius: 10px;
  -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px); color: var(--app-hud-ink);
}
.ht-ticker-open {
  display: flex; align-items: center; gap: 10px; min-width: 0; border: 0; background: transparent; color: inherit; text-align: left;
  font: 500 13px/1.25 var(--app-hud-font); letter-spacing: 0.01em; cursor: pointer; border-radius: 6px;
}
.ht-ticker-close { flex: none; display: flex; align-items: center; justify-content: center; width: 18px; height: 18px; border: 0; background: transparent; cursor: pointer; opacity: 0.6; border-radius: 6px; }
.ht-ticker-close:hover { opacity: 1; }
/* a tip: its line keeps the full width; Show me and any link sit on a row beneath, lined up with the text */
.ht-ticker.has-acts { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "open close" "acts acts"; row-gap: 7px; column-gap: 12px; align-items: start; }
.ht-ticker.has-acts .ht-ticker-open { grid-area: open; }
.ht-ticker.has-acts .ht-ticker-close { grid-area: close; }
.ht-ticker-acts { grid-area: acts; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; padding-left: 30px; }
.ht-ticker-acts[hidden], .ht-ticker-show[hidden], .ht-ticker-link[hidden] { display: none; }
.ht-ticker-show { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 9px; border: 0; border-radius: 999px; background: var(--app-teal); color: #fff; font: 600 12px/1 var(--app-hud-font); letter-spacing: 0.02em; cursor: pointer; box-shadow: 0 1px 2px rgba(2, 54, 61, 0.25); transition: filter 0.15s ease, transform 0.15s ease; }
.ht-ticker-show:hover { filter: brightness(1.12); }
.ht-ticker-show:active { transform: translateY(1px); }
.ht-ticker-show:focus-visible { outline: 2px solid var(--app-gold); outline-offset: 2px; }
.ht-ticker-show i, .ht-ticker-show svg { width: 11px; height: 11px; flex: none; }
.ht-ticker-link { font: 600 12px/1.2 var(--app-hud-font); color: var(--app-teal); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.ht-guide .ht-guide-x { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; opacity: 0.7; padding: 0 2px; }
.ht-guide .ht-guide-x:hover { opacity: 1; }
.ht-guide .hd .rt { display: inline-flex; align-items: center; gap: 10px; }
.ht-guide .ht-guide-skip { text-transform: uppercase; letter-spacing: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; pointer-events: auto; }
/* the stack: newest on top, three at most; a line fades out when dismissed or when its time is up */
.ht-tickers { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none; }
.ht-tickers:empty { display: none; }
.ht-tickers > .ht-ticker { pointer-events: auto; max-width: 100%; transition: opacity 0.2s ease, transform 0.2s ease; }
.ht-ticker.out { opacity: 0; transform: translateY(-4px); }
.ht-ticker.ht-flash { animation: ht-flash 0.9s ease; }
@keyframes ht-flash { 0% { transform: translateY(-6px); background: #fff; } 100% { transform: none; } }
/* The day-one Contract talks call to action (.ht-cta is the title screen's button) */
.ht-talkcta {
  display: flex; gap: 10px 12px; align-items: center; flex-wrap: wrap; padding: 10px; background: var(--app-toast); border: 1.5px solid var(--app-chip-line); border-radius: 10px;
  -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px); font: 500 12px/1.35 var(--app-hud-font); letter-spacing: 0.01em; color: var(--app-hud-ink); animation: ht-pop 0.25s ease-out;
}
.ht-talkcta[hidden] { display: none; }
.ht-talkcta > svg { flex: none; width: 16px; height: 16px; color: var(--app-hud-ink); }
.ht-talkcta > span { flex: 1 1 200px; }
.ht-talkcta > span b { font-weight: 600; }
.ht-talkcta .pv-btn { font-family: inherit; }
.ht-hint {
  position: absolute; z-index: 6; left: 16px; bottom: 88px; padding: 6px 10px; border-radius: 7px;
  background: rgba(26, 58, 57, 0.86); color: #fff; font: 500 12px/1.1 var(--app-hud-font); letter-spacing: 0.01em; pointer-events: none; white-space: nowrap;
}
.ht-hint kbd { font: 500 11px var(--app-hud-font); padding: 1px 5px; border-radius: 4px; background: rgba(255,255,255,0.15); margin: 0 2px; }
/* The placement card while a room is in hand (main.js placePanel): the Getting started panel's frosted cream */
.ht-place { position: absolute; z-index: 6; left: 16px; bottom: 88px; width: max-content; min-width: 280px; max-width: calc(100vw - 32px); padding: 10px 12px 9px; border-radius: 10px;
  background: var(--app-toast); -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px); box-shadow: 0 4px 14px rgba(10, 30, 30, 0.18);
  font: 500 12px/1.3 var(--app-hud-font); letter-spacing: 0.01em; color: var(--app-hud-ink); }
.ht-place[hidden], .ht-place .menu[hidden] { display: none; }
.ht-place .top { display: flex; align-items: center; gap: 9px; }
.ht-place .th { flex: none; width: 40px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: var(--app-chip); border: 1px solid var(--app-chip-line); overflow: hidden; }
.ht-place .th canvas { width: 40px; height: 30px; }
.ht-place .n { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ht-place .c { font-weight: 600; font-variant-numeric: tabular-nums; }
.ht-place .ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.ht-dims .ht-step b { min-width: 26px; }
.ht-step { display: inline-flex; align-items: center; border: 1.5px solid var(--app-chip-line); border-radius: 8px; background: var(--app-chip); }
.ht-dims { display: inline-flex; align-items: center; gap: 5px; }
.ht-dims .x { font-weight: 600; opacity: 0.6; }
.ht-step b { min-width: 52px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.ht-step button, .ht-place .door { height: 30px; border: 0; background: transparent; color: var(--app-hud-ink); font: 600 15px/1 var(--app-hud-font); cursor: pointer; }
.ht-step button { width: 32px; border-radius: 6px; }
.ht-step button:hover:not([disabled]), .ht-place .door:hover { background: rgba(22, 105, 109, 0.12); }
.ht-step button[disabled] { opacity: 0.3; cursor: default; }
.ht-place .door { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border: 1.5px solid var(--app-chip-line); border-radius: 8px; background: var(--app-chip); font-size: 12px; font-weight: 500; }
.ht-place .door b { font-weight: 600; }
.ht-place .menu { display: inline-flex; align-items: center; margin-left: auto; height: 30px; padding: 0 10px; border: 1.5px solid var(--app-chip-line); border-radius: 8px; background: var(--app-chip); color: var(--app-hud-ink); font: 600 12px/1 var(--app-hud-font); cursor: pointer; }
.ht-win.ht-tucked { display: none; }
.ht-place .door svg { width: 13px; height: 13px; opacity: 0.75; }
.ht-place .how { white-space: nowrap; margin-top: 8px; padding-top: 7px; border-top: 1px solid rgba(26, 58, 57, 0.12); font-size: 10.5px; color: rgba(26, 58, 57, 0.72); }
.ht-place kbd { font: 600 10px var(--app-hud-font); padding: 0 4px; margin: 0 1px; border-radius: 3px; border: 1px solid rgba(26, 58, 57, 0.25); background: rgba(255, 255, 255, 0.6); }

/* Toolbar: a glass panel of chip tiles, the icon over its label */
.ht-toolbar {
  position: absolute; z-index: 6; left: 16px; bottom: 16px; display: flex; gap: 6px; align-items: center; padding: 8px 10px;
  max-width: calc(100% - 260px); overflow-x: auto; scrollbar-width: none;
}
.ht-tool {
  flex: none; display: flex; flex-direction: column; align-items: center; justify-content: space-between; min-width: 60px; height: 46px; padding: 4px 6px;
  border: 1.5px solid var(--app-chip-line); border-radius: 7px; background: var(--app-chip); color: var(--app-hud-ink);
  font: 500 11px/1.1 var(--app-hud-font); letter-spacing: 0.01em; white-space: nowrap; cursor: pointer; transition: background 0.12s, transform 0.12s;
}
.ht-ico { display: flex; align-items: center; justify-content: center; height: 23px; }
.ht-tool:hover { background: #fff; transform: translateY(-1px); }
.ht-tool[aria-pressed="true"] { background: #fff; border-color: var(--app-hud-ink); }
/* View and floor share one tile, split by a line; the floor half is quiet until there is a second floor */
.ht-pair { flex: none; display: flex; width: 136px; height: 46px; border: 1.5px solid var(--app-chip-line); border-radius: 7px; background: var(--app-chip); overflow: hidden; }
.ht-pair .ht-tool { flex: 1 1 0; min-width: 0; height: 100%; border: 0; border-radius: 0; background: transparent; transform: none; }
.ht-pair .ht-tool:hover { background: #fff; }
.ht-pair .ht-tool + .ht-tool { border-left: 1.5px solid var(--app-chip-line); }
.ht-pair .ht-tool.ht-one .ht-ico, .ht-pair .ht-tool.ht-one > span:last-child { opacity: 0.5; }
.ht-sep { flex: none; width: 1px; height: 40px; background: var(--app-chip-line); opacity: 0.35; margin: 0 2px; }
.ht-floor-build { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; margin-bottom: 10px; border-radius: 10px; background: var(--app-cream-2); }
.ht-floor-build .pv-btn { flex: none; }
.ht-floor-build .pv-btn:disabled { opacity: 0.5; cursor: default; }

/* Minimap */
.ht-mini { position: absolute; z-index: 5; right: 16px; bottom: 16px; padding: 6px; }
#minimap { display: block; width: 200px; height: 103px; border-radius: 8px; background: #1f3a24; cursor: pointer; }
.ht-zoom { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 4px; }
.ht-zbtn {
  width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--app-chip-line); background: var(--app-chip); color: var(--app-hud-ink);
  font: 500 14px/1 var(--app-hud-font); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.ht-zbtn:hover { background: #fff; }

/* Windows */
.ht-windows { position: absolute; inset: 0; z-index: 7; pointer-events: none; }
.ht-win {
  position: absolute; pointer-events: auto; width: 340px; max-width: calc(100vw - 24px); max-height: calc(100vh - 190px); display: flex; flex-direction: column;
  background: var(--app-cream); border: 1px solid var(--app-line); border-radius: 14px; box-shadow: var(--app-shadow); overflow: hidden;
  animation: ht-pop 0.16s ease-out;
}
.ht-win.ht-wide { width: 520px; }
@keyframes ht-pop { from { transform: scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }
.ht-win-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; background: var(--app-teal); color: #fff; cursor: move; touch-action: none; }
.ht-win-head svg { width: 18px; height: 18px; }
.ht-win-art { display: block; flex: none; height: 20px; width: auto; }
.ht-win-head h2 { flex: 1; margin: 0; font: 500 15px/1.1 var(--app-hud-font); letter-spacing: 0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ht-win-x { width: 28px; height: 28px; border-radius: 8px; border: 0; background: rgba(255,255,255,0.14); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ht-win-x:hover { background: rgba(255,255,255,0.28); }
.ht-win-x svg { width: 14px; height: 14px; }
.ht-win-body { padding: 12px; overflow-y: auto; font-size: 0.82rem; line-height: 1.4; }
.ht-win-body h3 { margin: 12px 0 6px; font: 600 0.72rem var(--pv-font); letter-spacing: 0.06em; text-transform: uppercase; color: var(--app-ink-2); }
.ht-win-body h3:first-child { margin-top: 0; }

/* Build menu */
.ht-tabs { display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }
.ht-tab { flex: 1; padding: 7px 8px; border-radius: 9px; border: 1px solid var(--app-line); background: var(--app-cream-2); color: var(--app-ink); font: 600 0.76rem var(--pv-font); cursor: pointer; }
.ht-tab[aria-pressed="true"] { background: var(--app-teal); border-color: var(--app-teal); color: #fff; }
/* Settings: the ways to carry a picked-up person, each a picture over its name */
.ht-carry .ht-tab { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px 7px; }
.ht-carry canvas { width: 72px; height: 92px; border-radius: 7px; background: #e8e2d4; }
.ht-carry .ht-tab[aria-pressed="true"] canvas { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85); }
.ht-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ht-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 8px; border-radius: 11px; border: 1px solid var(--app-line);
  background: #fff; color: var(--app-ink); cursor: pointer; font: 500 0.72rem/1.2 var(--pv-font); text-align: center;
}
.ht-item:hover { border-color: var(--app-teal); box-shadow: 0 2px 8px rgba(22, 105, 109, 0.18); }
.ht-item[aria-pressed="true"] { border-color: var(--app-teal); background: #e7f4f3; }
.ht-item[data-poor="true"] { opacity: 0.55; }
.ht-item canvas { width: 100%; max-width: 92px; height: auto; aspect-ratio: 4 / 3; }
.ht-item .ht-cost { font: 600 0.74rem var(--pv-font); color: var(--app-teal); font-variant-numeric: tabular-nums; }
/* Hospital and Finances: the rating beside its chart, small charts, cards, chips */
.ht-hero { display: flex; gap: 12px; align-items: stretch; }
.ht-hero-l { flex: none; width: 148px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px; border-radius: 11px; background: var(--app-cream-2); }
.ht-hero-l .ht-big { font-size: 2.6rem; }
.ht-hero-l .ht-note { margin: 0; }
.ht-hero .ht-chart { flex: 1 1 0; min-width: 0; }
.ht-chart.ht-chart-s { height: 132px; }
.ht-grade { margin-top: 6px; padding: 2px 9px; border-radius: 999px; background: var(--app-teal); color: #fff; font: 600 0.74rem var(--pv-font); }
.ht-grade[data-g="fair"] { background: #b8801f; } .ht-grade[data-g="poor"], .ht-grade[data-g="failing"] { background: #c2493b; }
.ht-trend { font: 600 0.74rem var(--pv-font); color: var(--app-ink-2); font-variant-numeric: tabular-nums; }
.ht-trend[data-d="up"] { color: #2e7d4f; } .ht-trend[data-d="down"] { color: #c2493b; }
.ht-goal-card { padding: 8px 12px 10px; border-radius: 11px; background: var(--app-cream-2); }
.ht-goal-hd { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 2px; color: var(--app-ink-2); }
.ht-chip { display: inline-block; padding: 2px 9px; border-radius: 999px; background: #fff; border: 1px solid var(--app-line); color: var(--app-ink); font: 500 0.72rem var(--pv-font); white-space: nowrap; }
.ht-chip.up { background: #e6f3ea; border-color: #bcdcc6; color: #23633d; } .ht-chip.down { background: #fbe9e6; border-color: #f0c4bd; color: #9a3528; }
.ht-moves { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ht-moves > div { display: flex; flex-wrap: wrap; gap: 5px; align-content: flex-start; }
.ht-moves b { flex: 0 0 100%; font-weight: 600; color: var(--app-ink-2); font-size: 0.74rem; }
.ht-campus.ht-campus-s { margin-bottom: 0; }
/* The toolbar's Undo: a drawn arrow where the others have a picture; dim with nothing to take back */
.ht-ico-txt { font: 600 1.15rem/1 var(--pv-font); color: var(--app-hud-ink, #1f2a30); }
#undo-btn:disabled img { opacity: 0.45; filter: grayscale(0.6); }
/* Guides / Tips: the goal on a card, then two lists of rows */
.ht-gt h3 { margin: 14px 0 6px; }
.ht-gt-goal, .ht-gt-row { display: grid; grid-template-columns: 20px 1fr; gap: 9px; align-items: start; padding: 9px 11px; border-radius: 10px; background: #efe9da; border: 1px solid var(--app-line); color: var(--app-ink); font: 500 0.8rem/1.4 var(--pv-font); text-align: left; }
.ht-gt-goal { padding-bottom: 11px; }
/* what each part of the goal is and what moves it, with where it stands now */
.ht-gt-how { display: grid; gap: 6px; margin-bottom: 4px; }
.ht-gt-how > div { padding: 8px 11px; border-radius: 10px; background: var(--app-cream-2); border: 1px solid var(--app-line); font-size: 0.78rem; color: var(--app-ink-2); }
.ht-gt-how b { color: var(--app-ink); font-weight: 600; }
.ht-gt-how .now { float: right; margin-left: 8px; font-weight: 600; font-variant-numeric: tabular-nums; color: #8f2f1f; }
.ht-gt-how .now.ok { color: #1d5e37; }
.ht-gt-how p { margin: 3px 0 0; font-size: 0.74rem; line-height: 1.35; clear: both; }
.ht-gt-goal img { margin-top: 1px; }
.ht-gt-sub { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 2px 6px; color: var(--app-ink-2); font: 600 0.68rem var(--pv-font); letter-spacing: 0.05em; text-transform: uppercase; }
.ht-gt-sub .pv-btn { margin-left: 6px; padding: 2px 9px; font-size: 0.7rem; text-transform: none; letter-spacing: 0; }
.ht-gt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ht-gt-row { width: 100%; }
.ht-gt-row .mk { width: 19px; height: 19px; border-radius: 50%; border: 1.5px solid var(--app-ink-2); color: var(--app-ink-2); display: flex; align-items: center; justify-content: center; font: 700 0.66rem/1 var(--pv-font); }
.ht-gt-row.done { color: var(--app-ink-2); }
.ht-gt-row.done > span:last-child { text-decoration: line-through; }
.ht-gt-row.done .mk, .ht-gt-row.now .mk { background: var(--app-teal); border-color: var(--app-teal); color: #fff; }
.ht-gt-row.now { font-weight: 600; background: #fff; }
.ht-gt-row.tip { cursor: pointer; }
.ht-gt-row.tip:hover { background: #fff; border-color: var(--app-teal); }
.ht-gt-row.tip .mk { border-color: var(--app-gold, #c98a14); color: var(--app-gold, #c98a14); }
.ht-gt-row small { display: block; margin-top: 2px; font-size: 0.72rem; font-weight: 500; color: var(--app-ink-2); }
.ht-tool:disabled { opacity: 0.45; cursor: default; transform: none; }
/* Settings: rows of buttons, and two toggles side by side */
.ht-keys kbd { align-self: start; }
.ht-opt-row { display: flex; flex-wrap: wrap; gap: 6px; }
.ht-opt-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ht-win section[hidden] { display: none; }
.ht-win section > h3:first-child { margin-top: 2px; }
/* Build, Building: the campus model and its tags, then the action cards */
.ht-campus { margin-bottom: 10px; border-radius: 11px; overflow: hidden; border: 1px solid var(--app-line); background: #7db85c; }
.ht-campus canvas { display: block; width: 100%; height: auto; }
.ht-campus-tags { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 6px 10px; background: var(--app-cream-2); color: var(--app-ink-2); font-size: 0.74rem; }
.ht-campus-tags b { color: var(--app-ink); font-weight: 600; }
.ht-bld canvas { max-width: none; border-radius: 8px; background: #7db85c; }
.ht-desc { margin-top: 10px; padding: 8px 10px; border-radius: 9px; background: var(--app-cream-2); color: var(--app-ink-2); min-height: 2.6em; }

/* Rows, bars, chips */
.ht-rows { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.ht-rows > span:nth-child(odd) { color: var(--app-ink-2); }
.ht-rows > span:nth-child(even) { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.ht-bar-row { display: grid; grid-template-columns: 82px 1fr 34px; align-items: center; gap: 8px; margin: 4px 0; }
.ht-bar-row .lbl { color: var(--app-ink-2); }
.ht-bar-row .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--app-ink-2); font-size: 0.74rem; }
.ht-meter { height: 9px; border-radius: 999px; background: var(--app-cream-2); border: 1px solid var(--app-line); overflow: hidden; }
.ht-meter > i { display: block; height: 100%; border-radius: 999px; background: var(--app-green); transition: width 0.3s; }
.ht-meter.mid > i { background: var(--app-gold); }
.ht-meter.low > i { background: var(--app-coral); }
.ht-status { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px; background: #e5f3ea; color: #1d5e37; font-weight: 600; margin-bottom: 10px; }
.ht-status.bad { background: #fde8e4; color: #9a2e1d; }
.ht-status svg { width: 16px; height: 16px; }
.ht-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.ht-chip { padding: 3px 8px; border-radius: 999px; border: 1px solid var(--app-line); background: #fff; font-size: 0.72rem; color: var(--app-ink-2); }
.ht-chip.done { background: #e5f3ea; border-color: #b9dcc6; color: #1d5e37; text-decoration: line-through; }
.ht-chip.now { background: var(--app-teal); border-color: var(--app-teal); color: #fff; }
.ht-thoughts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ht-thoughts li { padding: 6px 9px; border-radius: 9px; background: #fff; border: 1px solid var(--app-line); }
.ht-thoughts li.good { border-left: 3px solid var(--app-green); }
.ht-thoughts li.bad { border-left: 3px solid var(--app-coral); }
.ht-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.ht-actions .pv-btn svg { width: 15px; height: 15px; }
.ht-head-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.ht-head-row canvas { width: 96px; height: 72px; flex: none; border-radius: 10px; background: linear-gradient(#e3f1e0, #cfe6c9); border: 1px solid var(--app-line); }
.ht-head-row .who { font-weight: 600; font-size: 0.95rem; }
.ht-head-row .sub { color: var(--app-ink-2); }
.ht-price { display: grid; grid-template-columns: 1fr 86px; gap: 8px; align-items: center; }
.ht-price input[type=range] { width: 100%; accent-color: var(--app-teal); }
.ht-price .pv-input { width: 100%; font-variant-numeric: tabular-nums; }
.ht-note { color: var(--app-ink-2); font-size: 0.74rem; margin-top: 4px; }

/* Lists of people and news */
.ht-list { display: flex; flex-direction: column; gap: 4px; }
.ht-li {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--app-line);
  background: #fff; text-align: left; cursor: pointer; font: 400 0.78rem/1.3 var(--pv-font); color: var(--app-ink);
}
.ht-li:hover { border-color: var(--app-teal); }
.ht-li .a { font-weight: 600; }
.ht-li .b { color: var(--app-ink-2); grid-column: 1 / -1; font-size: 0.74rem; }
/* alerts carry a category icon (HT.alertCat): it sits left of the date and the text */
#mlist .ht-li { grid-template-columns: 24px 1fr; }
#mlist .ht-li .ic { grid-row: 1 / span 2; width: 22px; height: 22px; object-fit: contain; align-self: center; }
#mlist .ht-li .b { grid-column: 2; }
.ht-ticker-open img { width: 20px; height: 18px; object-fit: contain; }
.ht-li .c { display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.ht-li[data-kind="bad"] { border-left: 3px solid var(--app-coral); }
.ht-li[data-kind="good"], .ht-li[data-kind="goal"] { border-left: 3px solid var(--app-green); }
.ht-li[data-kind="warn"], .ht-li[data-kind="tip"] { border-left: 3px solid var(--app-gold); }
.ht-empty { padding: 14px; text-align: center; color: var(--app-ink-2); border: 1px dashed var(--app-line); border-radius: 10px; background: transparent; font-size: inherit; }   /* the shared pv-empty, in the game's own chrome */

/* Staff hiring cards */
.ht-hire { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 10px; align-items: center; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--app-line); background: #fff; margin-bottom: 6px; }
.ht-hire .n { font-weight: 600; grid-column: 2; }
.ht-hire .d { grid-column: 2; color: var(--app-ink-2); font-size: 0.74rem; }
.ht-hire .pv-btn { grid-row: 1 / span 2; grid-column: 3; }
.ht-pic { display: block; grid-row: 1 / span 2; grid-column: 1; background-repeat: no-repeat; background-position: 0 0; image-rendering: pixelated; }
.ht-pics { display: flex; gap: 2px; grid-row: 1 / span 2; grid-column: 1; }
.ht-li.ht-li-pic { grid-template-columns: auto 1fr auto; column-gap: 10px; }
.ht-li.ht-li-pic .b { grid-column: 2 / -1; }

/* Ledger and charts */
.ht-ledger { display: grid; grid-template-columns: 1fr auto auto; gap: 3px 14px; font-variant-numeric: tabular-nums; }
.ht-ledger .h { font: 600 0.68rem var(--pv-font); text-transform: uppercase; letter-spacing: 0.05em; color: var(--app-ink-2); text-align: right; }
.ht-ledger .h:first-child { text-align: left; }
.ht-ledger .r { text-align: right; }
.ht-ledger .neg { color: var(--app-coral); }
.ht-ledger .tot { border-top: 1px solid var(--app-line); padding-top: 4px; font-weight: 600; }
.ht-chart { width: 100%; height: 200px; display: block; border-radius: 10px; background: #fff; border: 1px solid var(--app-line); }
.ht-big { font: 500 2.2rem/1 var(--pv-font); letter-spacing: -0.02em; color: var(--app-teal); font-variant-numeric: tabular-nums; }
.ht-goal { margin: 6px 0; }
.ht-goal .t { display: flex; justify-content: space-between; color: var(--app-ink-2); }
.ht-goal .t b { color: var(--app-ink); font-variant-numeric: tabular-nums; }
.ht-toggle { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 9px; background: var(--app-cream-2); cursor: pointer; }
.ht-toggle input { width: 18px; height: 18px; accent-color: var(--app-teal); }
.ht-loan { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ht-keys { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
.ht-keys kbd { font: 500 0.72rem var(--pv-mono); padding: 1px 6px; border: 1px solid var(--app-line); border-bottom-width: 2px; border-radius: 5px; background: #fff; white-space: nowrap; }

/* Title screen */
.ht-title {
  position: absolute; inset: 0; z-index: 9; display: flex; align-items: safe center; justify-content: center; overflow-y: auto; padding: 28px 16px 24px;
  background: radial-gradient(ellipse at 50% 40%, rgba(14, 26, 34, 0.15), rgba(14, 26, 34, 0.75));
}
.ht-app[data-screen="title"] .ht-top, .ht-app[data-screen="title"] .ht-toolbar, .ht-app[data-screen="title"] .ht-hint,
.ht-app[data-screen="title"] .ht-mini, .ht-app[data-screen="title"] .ht-windows { display: none; }   /* the wordmark is the title */
.ht-app[data-screen="game"] .ht-title { display: none; }
.ht-title-inner { width: min(1040px, 100%); text-align: center; color: #fff; }
.ht-word { display: flex; flex-direction: column; align-items: center; line-height: 0.92; margin-bottom: 12px; filter: drop-shadow(0 6px 18px rgba(0,0,0,0.45)); }
.ht-word span { font-family: var(--pv-font-display, var(--pv-font)); font-weight: 600; letter-spacing: -0.03em; }
.ht-word-a { font-size: clamp(2.4rem, 7vw, 4.6rem); color: #fff; animation: ht-drop 0.7s cubic-bezier(.2,1.4,.4,1) both; }
.ht-word-b { font-size: clamp(3rem, 10vw, 6.6rem); color: var(--app-gold); -webkit-text-stroke: 2px #8a5a10; animation: ht-drop 0.7s 0.12s cubic-bezier(.2,1.4,.4,1) both; }
.ht-wordmark { display: block; width: min(600px, 88vw); height: auto; animation: ht-drop 0.7s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes ht-drop { from { transform: translateY(-40px) scale(1.1); opacity: 0; } to { transform: none; opacity: 1; } }
.ht-tag { margin: 0 auto 18px; max-width: 560px; font-size: 1.02rem; color: rgba(255,255,255,0.92); text-shadow: 0 2px 6px rgba(0,0,0,0.5); }
.ht-pick { margin: 18px 0 10px; font: 600 0.78rem var(--pv-font); letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.85); }
.ht-scen { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ht-card {
  display: flex; flex-direction: column; gap: 5px; padding: 12px 14px; border-radius: 16px; text-align: left; cursor: pointer;
  background: color-mix(in srgb, var(--app-cream) 96%, transparent); border: 2px solid transparent; color: var(--app-ink); box-shadow: var(--app-shadow);
  font: 400 0.8rem/1.4 var(--pv-font); transition: transform 0.15s, border-color 0.15s; animation: ht-drop 0.6s both;
}
.ht-card:hover, .ht-card:focus-visible { transform: translateY(-4px); border-color: var(--app-gold); }
.ht-card .hd { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.ht-card .nm { font: 600 1.02rem var(--pv-font); }
.ht-card .bl { color: var(--app-ink-2); }
.ht-card .df { align-self: flex-start; padding: 2px 8px; border-radius: 999px; font: 600 0.68rem var(--pv-font); text-transform: uppercase; letter-spacing: 0.05em; background: var(--app-cream-2); color: var(--app-teal); }
.ht-card .gl { color: var(--app-ink); font-size: 0.74rem; border-top: 1px solid var(--app-line); padding-top: 6px; margin-top: auto; font-variant-numeric: tabular-nums; }
.ht-card .sv { padding: 2px 8px; border-radius: 999px; font: 600 0.68rem var(--pv-font); text-transform: uppercase; letter-spacing: 0.05em; background: #e3f1e0; color: var(--app-green); }
/* Free play: one line under the cards, a button that reads like a sentence */
.ht-free-wrap { margin: 10px 0 0; }
.ht-free { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.35); background: rgba(14, 26, 34, 0.35); color: rgba(255,255,255,0.9); font: 400 0.8rem/1.3 var(--pv-font); cursor: pointer; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.ht-free:hover, .ht-free:focus-visible { border-color: var(--app-gold); color: #fff; }
.ht-free svg { width: 14px; height: 14px; flex: none; }
.ht-free b { font-weight: 600; }
.ht-free .tx { text-align: left; }
.ht-free .sv { color: #9fe3a5; font-weight: 600; }
.ht-cta { display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; border-radius: 8px; border: 3px solid var(--app-pixel-ink); background: var(--app-pixel-cyan); color: var(--app-pixel-ink); font: 700 1rem var(--pv-font); cursor: pointer; box-shadow: 0 4px 0 var(--app-pixel-ink), var(--app-shadow); }
.ht-cta:hover { background: #7dfcf5; }
.ht-cta:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--app-pixel-ink), var(--app-shadow); }
.ht-cta:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.ht-cta svg { width: 18px; height: 18px; }
.ht-foot { margin-top: 14px; font-size: 0.76rem; color: rgba(255,255,255,0.7); }

/* End card */
.ht-modal { position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; background: rgba(10, 20, 26, 0.55); padding: 16px; }
.ht-modal-card { width: min(420px, 100%); padding: 24px; border-radius: 18px; background: var(--app-cream); text-align: center; box-shadow: var(--app-shadow); animation: ht-pop 0.25s ease-out; }
.ht-modal-card h2 { margin: 8px 0; font: 600 1.4rem var(--pv-font); }
/* High scores: on the end card, and each scenario card's top score */
.ht-board { margin-top: 12px; text-align: left; }
.ht-board .yours { text-align: center; font: 600 0.9rem var(--pv-font); margin-bottom: 8px; }
.ht-board table { width: 100%; border-collapse: collapse; font: 400 0.78rem var(--pv-font); font-variant-numeric: tabular-nums; }
.ht-board th { font: 600 0.66rem var(--pv-font); text-transform: uppercase; letter-spacing: 0.05em; color: var(--app-ink-2); text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--app-line); cursor: help; }
.ht-board td { padding: 4px 6px; border-bottom: 1px solid var(--app-cream-2); }
.ht-board .n { text-align: right; }
.ht-board tr.you td { background: #fff7e0; font-weight: 600; }
.ht-card .hs { color: var(--app-teal); font-weight: 600; font-size: 0.72rem; }
.ht-board .d { color: var(--app-ink-2); white-space: nowrap; }
.ht-end-actions { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }
/* Share your score: the card as a picture, and where to post it */
/* Built by Turquoise, under the title screen's controls line */
.ht-built { display: inline-flex; gap: 7px; align-items: center; margin-top: 10px; font-size: 0.76rem; color: rgba(255,255,255,0.8); text-decoration: none; }
.ht-built img { display: block; height: 18px; width: auto; }
.ht-built:hover { color: #fff; }
.ht-talkcta a, .tk-packs .hd a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
/* The saved games of a scenario */
.ht-slots-card { width: min(460px, 100%); }
/* Naming the hospital: on the way into a new game, and again in Settings */
.ht-name-field { display: grid; gap: 6px; text-align: left; font-size: 0.8rem; font-weight: 600; color: var(--app-ink-2); }
.ht-name-field .pv-input { width: 100%; font-size: 1rem; font-weight: 500; }
.ht-name-card .ht-note { margin: 8px 0 0; text-align: left; }
.ht-name-card .ht-note.ht-diff { margin: 0 0 14px; }
.ht-rename { display: flex; gap: 8px; align-items: center; }
.ht-rename label { font-weight: 600; color: var(--app-ink-2); }
.ht-rename .pv-input { flex: 1 1 0; min-width: 0; }
.ht-slots-sub { margin: 0 0 12px; color: var(--app-ink-2); font-size: 0.85rem; }
.ht-slots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: min(52vh, 420px); overflow-y: auto; text-align: left; }
.ht-slots li { display: flex; gap: 6px; align-items: stretch; }
.ht-slot { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 12px; border-radius: 10px; border: 2px solid var(--app-line); background: #fff; color: var(--app-ink); font: 400 0.8rem/1.3 var(--pv-font); cursor: pointer; text-align: left; }
.ht-slot:hover, .ht-slot:focus-visible { border-color: var(--app-gold); }
.ht-slot .nm { font-weight: 600; font-size: 0.92rem; }
.ht-slot .st { grid-column: 1 / -1; color: var(--app-ink-2); font-variant-numeric: tabular-nums; }
.ht-slot .at { grid-row: 1; grid-column: 2; color: var(--app-ink-2); font-size: 0.72rem; align-self: center; }
.ht-slot-del { flex: none; width: 40px; border-radius: 10px; border: 2px solid var(--app-line); background: #fff; color: var(--app-ink-2); cursor: pointer; display: grid; place-items: center; }
.ht-slot-del svg { width: 18px; height: 18px; }
.ht-slot-del:hover, .ht-slot-del:focus-visible { border-color: var(--app-red, #c0392b); color: var(--app-red, #c0392b); }
.ht-slot-del.armed { background: var(--app-red, #c0392b); border-color: var(--app-red, #c0392b); color: #fff; }

/* Narrow screens: the top panels wrap, the toolbar scrolls, the minimap sits above it */
@media (max-width: 900px) {
  .ht-top { top: 10px; left: 10px; right: calc(10px + var(--tq-play-exit, 0px)); }
  .ht-bar, .ht-clock { padding: 8px 10px; }
  .ht-scen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ht-toolbar { left: 10px; bottom: 10px; max-width: calc(100% - 116px); padding: 8px 10px; }   /* stops short of the Sandbox menu button */
  .ht-notices, .ht-talkcta { max-width: calc(100vw - 20px); }
  .ht-hint { display: none; }
  .ht-place { left: 10px; bottom: 84px; max-width: calc(100vw - 20px); }

  .ht-mini { right: 10px; bottom: 84px; }
  #minimap { width: 160px; height: 83px; }
}
@media (max-width: 560px) {
  .ht-place .how { display: none; }
  .ht-place .door .w { display: none; }
  .ht-place .ctl { gap: 6px; }
  .ht-step button { width: 28px; }
  .ht-scen { grid-template-columns: 1fr; }
  .ht-mini { display: none; }
  .ht-win { left: 12px !important; right: 12px; width: auto; top: auto !important; bottom: 82px; max-height: 55vh; }
}

/* Board report: the memo, KPI tiles and payer contracts */
.ht-memo { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 10px; background: #fff7e0; border: 1px solid #f0dca0; color: var(--app-ink); }
.ht-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ht-kpi { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: #fff; border: 1px solid var(--app-line); }
.ht-kpi .v { font: 500 1.25rem var(--pv-font); color: var(--app-teal); font-variant-numeric: tabular-nums; }
.ht-kpi .l { font-size: 0.72rem; color: var(--app-ink-2); }
.ht-kpi.bad .v { color: var(--app-coral); }
.ht-payer { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--app-line); background: #fff; margin-bottom: 6px; }
.ht-payer .n { font-weight: 600; }
.ht-payer .r { text-align: right; font-weight: 600; color: var(--app-teal); font-variant-numeric: tabular-nums; }
.ht-payer .m { grid-column: 1 / -1; color: var(--app-ink-2); font-size: 0.74rem; }
.ht-payer .b { grid-column: 1 / -1; display: flex; gap: 6px; margin-top: 4px; }
.ht-payer.out { opacity: 0.7; border-style: dashed; }
.ht-payer.out .r { color: var(--app-coral); }
@media (max-width: 560px) { .ht-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* A contract waiting for talks: a badge on the Board tool with the count, pulsing until the player opens it */
.ht-tool { position: relative; }
.ht-tool.ht-due::after { content: attr(data-due); position: absolute; top: 1px; right: 3px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 999px; background: var(--app-coral); color: #fff; font: 600 10px/15px var(--app-hud-font); text-align: center; box-shadow: 0 0 0 2px var(--app-cream); animation: ht-due 1.6s ease-in-out infinite; }
@keyframes ht-due { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@media (prefers-reduced-motion: reduce) { .ht-tool.ht-due::after { animation: none; } }

/* Contract talks (talks.js): a wide modal card over the paused hospital. tk- prefixes; the chrome is the window chrome. */
.ht-talks { align-items: center; background: rgba(10, 20, 26, 0.8); backdrop-filter: blur(4px) saturate(0.6); -webkit-backdrop-filter: blur(4px) saturate(0.6); }
.tk-talking .ht-windows { visibility: hidden; }   /* open windows wait behind the talks and come back when they close */
.tk-card { width: min(780px, 100%); max-height: calc(100% - 16px); overflow: auto; border-radius: 18px; background: var(--app-cream); box-shadow: var(--app-shadow); animation: ht-pop 0.25s ease-out; font-size: 0.82rem; line-height: 1.4; text-align: left; }
.tk-head { display: grid; grid-template-columns: 84px 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; background: var(--app-teal); color: #fff; border-radius: 18px 18px 0 0; }
.tk-head-deb { grid-template-columns: 84px 1fr; }
.tk-face { width: 84px; height: 84px; border-radius: 14px; image-rendering: pixelated; background: var(--app-teal-2); display: block; }
.tk-head .who { font: 600 1.05rem var(--pv-font); }
.tk-head .who .t { font-weight: 400; opacity: 0.85; font-size: 0.9rem; }
.tk-head .sub { opacity: 0.85; font-size: 0.78rem; }
.tk-head .say { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,0.12); font-style: italic; }
.tk-clock { text-align: right; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.tk-round { font: 600 0.74rem var(--pv-font); text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.9; }
.tk-days { font: 500 1.6rem/1 var(--pv-font); font-variant-numeric: tabular-nums; }
.tk-trust { width: 170px; cursor: help; }
.tk-trust .lbl { display: flex; justify-content: space-between; font-size: 0.72rem; opacity: 0.9; margin-bottom: 3px; }
.tk-trust .ht-meter { background: rgba(255,255,255,0.18); border-color: transparent; }
.tk-body { display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px; padding: 14px 16px; }
.tk-col { border-radius: 14px; padding: 10px 10px 6px; min-width: 0; }
.tk-yours { background: #e3f0ef; border: 2px solid var(--app-teal); }
.tk-theirs { background: var(--app-cream-2); border: 2px dashed #b9ae98; }
.tk-side { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 8px; }
.tk-side .who { display: flex; align-items: center; gap: 8px; }
.tk-side .who b { display: block; font: 700 0.78rem var(--pv-font); letter-spacing: 0.06em; text-transform: uppercase; }
.tk-side .who small { display: block; font-size: 0.72rem; color: var(--app-ink-2); }
.tk-yours .tk-side .who b { color: var(--app-teal); }
.tk-yours .tk-side .who svg { width: 22px; height: 22px; padding: 4px; border-radius: 8px; background: var(--app-teal); color: #fff; }
.tk-theirs .tk-side .who b { color: var(--app-ink); }
.tk-face-sm { width: 30px; height: 30px; border-radius: 8px; image-rendering: pixelated; }
.tk-side .worth { text-align: right; font: 700 0.85rem var(--pv-font); color: var(--app-green); font-variant-numeric: tabular-nums; cursor: help; }
.tk-side .worth small { display: block; font: 500 0.66rem var(--pv-font); color: var(--app-ink-2); }
.tk-side .worth.dim { color: var(--app-ink); }
.tk-market { padding: 0 16px 12px; }
/* The round tracker above the panels */
.tk-rounds { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 12px 16px 0; padding: 8px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--app-line); }
.tk-rounds > b { font: 700 1.05rem var(--pv-font); color: var(--app-teal); white-space: nowrap; }
.tk-rounds > b small { font: 600 0.78rem var(--pv-font); color: var(--app-ink-2); }
.tk-rounds ol { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; flex: 1 1 220px; }
.tk-rounds li { flex: 1; }
.tk-rounds li span { display: block; text-align: center; padding: 3px 0; border-radius: 6px; font: 600 0.72rem var(--pv-font); background: var(--app-cream-2); color: var(--app-ink-2); }
.tk-rounds li.done span { background: #b9d9d6; color: var(--app-teal-2); }
.tk-rounds li.now span { background: var(--app-teal); color: #fff; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--app-teal); }
.tk-rounds li.dl span { background: #fbe3dc; color: #a33a28; }
.tk-rounds li.dl.now span { background: var(--app-coral); color: #fff; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--app-coral); }
.tk-rounds .note { color: var(--app-ink-2); font-size: 0.76rem; }
.tk-rounds.last { border-color: var(--app-coral); }
.tk-rounds.last > b { color: #a33a28; }
.tk-stage { display: flex; gap: 12px; align-items: stretch; justify-content: center; width: min(1130px, 100%); max-height: calc(100% - 16px); min-height: 0; }
.tk-main { flex: 0 1 780px; min-width: 0; display: flex; min-height: 0; }
.tk-main .tk-card { max-height: none; }
@media (max-width: 1139px) { .tk-stage { width: min(780px, 100%); } }
/* The reply popup after a send */
.tk-reply-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(10, 20, 26, 0.35); z-index: 2; }
.tk-reply { width: min(400px, 100%); padding: 16px; border-radius: 16px; background: var(--app-cream); box-shadow: var(--app-shadow); animation: ht-pop 0.2s ease-out; font-size: 0.82rem; }
.tk-reply .hd { display: flex; gap: 10px; align-items: flex-start; }
.tk-reply .hd .tk-face-sm { width: 40px; height: 40px; flex: none; }
.tk-reply .eyebrow { font: 700 0.7rem var(--pv-font); letter-spacing: 0.06em; text-transform: uppercase; color: var(--app-teal); }
.tk-reply q { display: block; margin-top: 2px; color: var(--app-ink); font-style: italic; }
.tk-moves { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; }
.tk-moves li { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 6px 10px; border-radius: 10px; background: #fff; border: 1px solid var(--app-line); border-left-width: 4px; }
.tk-moves li.up { border-left-color: var(--app-green); }
.tk-moves li.down { border-left-color: var(--app-coral); }
.tk-moves .k { color: var(--app-ink-2); }
.tk-moves .v { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tk-moves li.wide .v { grid-column: 1 / -1; text-align: left; white-space: normal; overflow-wrap: anywhere; }   /* the package list is a sentence: under its label, wrapping */
.tk-moves .v s { color: var(--app-ink-2); }
.tk-moves .v svg { width: 12px; height: 12px; vertical-align: -1px; }
.tk-moves .dir { grid-column: 1 / -1; font: 600 0.66rem var(--pv-font); text-transform: uppercase; letter-spacing: 0.05em; }
.tk-moves li.up .dir { color: var(--app-green); }
.tk-moves li.down .dir { color: #b8432f; }
.tk-held { margin-top: 12px; padding: 8px 10px; border-radius: 10px; background: var(--app-cream-2); color: var(--app-ink-2); }
.tk-reply-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; color: var(--app-ink-2); font-variant-numeric: tabular-nums; }
.tk-reply-stats s { margin: 0 4px; }
.tk-reply-stats b { color: var(--app-ink); }
.tk-reply-stats b.good { color: var(--app-green); }
.tk-reply-stats b.bad { color: #b8432f; }
.tk-reply .ft { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; }
.tk-reply .ht-note.bad { color: #b8432f; }
.tk-market .tk-intel { margin-top: 0; }
.tk-term { display: grid; grid-template-columns: 104px 1fr 56px; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 10px; background: #fff; border: 1px solid var(--app-line); margin-bottom: 5px; }
.tk-term .k { color: var(--app-ink-2); }
.tk-term .k small { display: block; font-size: 0.68rem; opacity: 0.85; }
.tk-term input[type=range] { width: 100%; accent-color: var(--app-teal); }
.tk-term .v { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.tk-seg { display: inline-flex; border: 1px solid var(--app-line); border-radius: 8px; overflow: hidden; background: var(--app-cream-2); }
.tk-seg button { min-width: 34px; height: 26px; border: 0; background: transparent; color: var(--app-ink-2); font: 600 0.72rem var(--pv-font); cursor: pointer; padding: 0 7px; }
.tk-seg button + button { border-left: 1px solid var(--app-line); }
.tk-seg button[aria-pressed="true"] { background: var(--app-teal); color: #fff; }
.tk-sw { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.tk-sw input { width: 18px; height: 18px; accent-color: var(--app-teal); }
.tk-theirs .tk-term { grid-template-columns: 1fr auto; }
.tk-theirs .tk-term .v { color: var(--app-ink); }
.tk-theirs .tk-term.moved { border-color: #f0dca0; background: #fff7e0; }
.tk-theirs .tk-term.moved .v::after { content: ' moved'; font: 600 0.62rem var(--pv-font); color: #9a6b00; text-transform: uppercase; letter-spacing: 0.05em; margin-left: 6px; }
.tk-theirs .sum { margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: var(--app-cream-2); color: var(--app-ink-2); }
.tk-theirs .sum b { color: var(--app-ink); font-variant-numeric: tabular-nums; }
/* Standard Service Packages: one row on the card, the per-package detail in a pop-up over it */
.tk-yours .tk-term.tk-ssp { grid-template-columns: 1fr auto 40px; gap: 2px 6px; }
.tk-ssp .k { white-space: nowrap; }
@media (max-height: 960px) { .tk-yours:has(.tk-ssp) .tk-term { padding-top: 4px; padding-bottom: 4px; margin-bottom: 4px; } .tk-body:has(.tk-ssp) { padding-top: 9px; padding-bottom: 8px; } }   /* a seventh row: tighten so the card still fits a laptop */
.tk-ssp .s { grid-column: 1 / -1; font-size: 0.68rem; color: var(--app-ink-2); opacity: 0.85; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-opt { display: inline-block; margin-left: 4px; padding: 0 6px; border: 1px solid var(--app-teal); border-radius: 999px; color: var(--app-teal); font: 600 0.66rem/1.5 var(--pv-font); vertical-align: 1px; }
.tk-packs { width: min(680px, 100%); max-height: 100%; overflow-y: auto; padding: 16px; border-radius: 16px; background: var(--app-cream); box-shadow: var(--app-shadow); animation: ht-pop 0.2s ease-out; font-size: 0.82rem; }
.tk-packs .hd { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.tk-packs .hd h3 { margin: 0; font: 700 1.05rem var(--pv-font); color: var(--app-ink); }
.tk-packs .hd p { margin: 4px 0 0; color: var(--app-ink-2); }
.tk-packs .ht-win-x { flex: none; background: var(--app-cream-2); color: var(--app-ink-2); }
.tk-packs .ht-win-x:hover { background: var(--app-line); }
.tk-pk { display: grid; grid-template-columns: 22px 170px 1fr 64px; gap: 10px; align-items: center; min-height: 46px; padding: 6px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--app-line); margin-bottom: 5px; }
.tk-pk.all { grid-template-columns: 202px 1fr 64px; border-color: var(--app-teal); margin-bottom: 10px; }
.tk-pk input[type=checkbox] { width: 16px; height: 16px; margin: 0; accent-color: var(--app-teal); cursor: pointer; }
.tk-pk input[type=range] { width: 100%; min-width: 0; accent-color: var(--app-teal); }
.tk-pk .n b { display: block; color: var(--app-ink); font-weight: 600; }
.tk-pk .n small { display: block; font-size: 0.68rem; color: var(--app-ink-2); font-variant-numeric: tabular-nums; }
.tk-pk .c { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--app-ink-2); }
.tk-pk .c .tk-seg { flex: none; }
.tk-pk .c .tk-seg button { padding: 0 9px; }
.tk-pk .c .tk-seg button:disabled { cursor: default; }
.tk-pk .v { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--app-ink); }
.tk-pk.off .n, .tk-pk.off .c, .tk-pk.off .v { opacity: 0.5; }
.tk-pk.na { opacity: 0.5; }
.tk-packs .ft { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }
.tk-packs .ft .them { color: #8a6d00; font-weight: 600; }
.tk-packs .ft .b { display: flex; gap: 8px; flex: none; }
@media (max-width: 620px) {
  .tk-pk { grid-template-columns: 22px 1fr 56px; }
  .tk-pk .c { grid-column: 2 / -1; grid-row: 2; flex-wrap: wrap; }
  .tk-pk.all { grid-template-columns: 1fr 56px; }
  .tk-pk.all input[type=range] { grid-column: 1 / -1; grid-row: 2; }
  .tk-packs .ft { flex-direction: column; align-items: stretch; }
  .tk-packs .ft .b { justify-content: flex-end; }
}
.tk-intel { margin-top: 10px; padding: 8px 10px; border-radius: 10px; border: 1px dashed var(--app-line); }
.tk-intel h4 { margin: 0 0 4px; font: 600 0.68rem var(--pv-font); text-transform: uppercase; letter-spacing: 0.05em; color: var(--app-ink-2); }
.tk-intel .row { display: flex; justify-content: space-between; gap: 8px; font-variant-numeric: tabular-nums; padding: 1px 0; }
.tk-intel .row.med { font-weight: 600; border-top: 1px solid var(--app-line); margin-top: 3px; padding-top: 3px; }
.tk-intel .row.you { color: var(--app-teal); font-weight: 600; }
.tk-intel .row.them { color: var(--app-ink); font-weight: 600; }
.tk-intel .row.dim { color: var(--app-ink-2); }
.tk-intel-4 .row { display: grid; grid-template-columns: 1fr 64px 72px 64px; gap: 6px; }
.tk-intel-4 .row > span:not(:first-child) { text-align: right; }
.tk-intel-src { margin: 6px 0 0; font-size: 0.72rem; color: var(--app-ink-2); }
.tk-intel-4 .row.hd { font: 600 0.66rem var(--pv-font); text-transform: uppercase; letter-spacing: 0.05em; color: var(--app-ink-2); }
.tk-intel-4 .row.hd span[data-tip] { cursor: help; }
.tk-foot { display: flex; flex-direction: column; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--app-line); }
.tk-foot .row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
/* the buttons stay in reach when a long proposal (packages, a long opening line) makes the card scroll */
@media (min-width: 761px) and (min-height: 640px) { .tk-main .tk-foot { position: sticky; bottom: 0; z-index: 1; background: var(--app-cream); } }
.tk-foot .row.acts { justify-content: flex-end; }
.tk-foot .ht-note { margin: 0 auto 0 0; }
.tk-foot .ht-note.bad { color: var(--app-coral); font-weight: 600; }
.tk-tactic { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--app-line); background: #fff; color: var(--app-ink); font: 600 0.74rem var(--pv-font); cursor: pointer; }
.tk-tactic svg { width: 15px; height: 15px; color: var(--app-teal); }
.tk-tactic.risky svg { color: var(--app-coral); }
.tk-tactic:hover:not(:disabled) { border-color: var(--app-teal); }
.tk-tactic:disabled { opacity: 0.5; cursor: default; text-decoration: line-through; }
.tk-walk { color: var(--app-coral); }
.tk-x { background: var(--app-cream-2); color: var(--app-ink-2); border: 1px solid var(--app-line); margin-left: 4px; }
.tk-x:hover { background: #fff; }
/* the debrief */
.tk-deb { padding: 16px; }
.tk-deb .top { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; margin-bottom: 12px; }
.tk-grade { width: 72px; height: 72px; border-radius: 18px; display: flex; align-items: center; justify-content: center; font: 600 2.2rem var(--pv-font); color: #fff; background: var(--app-green); }
.tk-grade.tk-g-C { background: var(--app-gold); }
.tk-grade.tk-g-D, .tk-grade.tk-g-F { background: var(--app-coral); }
.tk-deb .eyebrow { font: 600 0.7rem var(--pv-font); text-transform: uppercase; letter-spacing: 0.06em; color: var(--app-ink-2); }
.tk-deb .headline { font: 600 1.15rem var(--pv-font); margin: 2px 0; }
.tk-deb .ht-kpis { margin-bottom: 10px; }
.tk-reveal { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.tk-reveal > div { padding: 8px 10px; border-radius: 10px; background: #fff; border: 1px solid var(--app-line); color: var(--app-ink-2); }
.tk-reveal .k { font-size: 0.7rem; color: var(--app-ink-2); text-transform: uppercase; letter-spacing: 0.05em; }
.tk-reveal .v { font: 600 1.1rem var(--pv-font); color: var(--app-teal); }
.tk-lesson { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; background: #fff7e0; border: 1px solid #f0dca0; margin-bottom: 6px; }
.tk-lesson svg { width: 18px; height: 18px; color: #9a6b00; flex: none; margin-top: 2px; }
.tk-effects { margin-top: 10px; color: var(--app-ink-2); }
.tk-effects b { color: var(--app-ink); }
.tk-deb .ht-end-actions { justify-content: flex-end; }
/* The Board window's call to action: a line per contract that is due or mid-talk, right under the memo */
.ht-due-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: #e5f3ea; border: 1px solid #b9dcc6; color: #1d5e37; }
.ht-due-row.open { background: #fff7e0; border-color: #f0dca0; color: #9a6b00; }
.ht-due-row.urgent, .ht-due-row.out { background: #fde8e4; border-color: #f0c3ba; color: #9a2e1d; }
.ht-due-row svg { width: 16px; height: 16px; flex: none; }
.ht-due-row span { flex: 1; }
.ht-due-row b { color: var(--app-ink); }
/* The Board window's contracts desk: the mix chart, the timeline and a card per commercial payer with its rep */
.ht-mix, .ht-timeline { height: auto; margin-bottom: 8px; }
.ht-ctr { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--app-line); background: #fff; margin-bottom: 6px; }
.ht-ctr.can { cursor: pointer; }
.ht-ctr.can:hover { border-color: var(--app-teal); box-shadow: 0 2px 8px rgba(22, 105, 109, 0.18); }
.ht-ctr.due { border-color: #b9dcc6; }
.ht-ctr.urgent { border-color: #f0c3ba; }
.ht-ctr.out { border-style: dashed; }
.ht-ctr-face { width: 48px; height: 48px; border-radius: 10px; image-rendering: pixelated; display: block; align-self: start; }
.ht-ctr .main { min-width: 0; }
.ht-ctr .top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ht-ctr .n { font-weight: 600; font-size: 0.88rem; }
.ht-st { padding: 2px 8px; border-radius: 999px; font: 600 0.66rem var(--pv-font); letter-spacing: 0.02em; background: var(--app-cream-2); color: var(--app-ink-2); cursor: help; white-space: nowrap; }
.ht-st.due { background: #e5f3ea; color: #1d5e37; }
.ht-st.open { background: #fff7e0; color: #9a6b00; }
.ht-st.urgent, .ht-st.out { background: #fde8e4; color: #9a2e1d; }
.ht-ctr .rep { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: var(--app-ink-2); font-size: 0.74rem; margin-top: 2px; }
.ht-ctr .rep .tr { display: inline-flex; gap: 6px; align-items: center; cursor: help; }
.ht-ctr .rep .ht-meter { width: 64px; height: 7px; }
.ht-ctr .terms { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.ht-ctr .terms .ht-chip { cursor: help; }
.ht-ctr .sub { color: var(--app-ink-2); font-size: 0.74rem; margin-top: 4px; font-variant-numeric: tabular-nums; }
.ht-ctr .pv-btn { white-space: nowrap; }
@media (max-width: 760px) {
  .ht-talks { padding-bottom: 76px; }   /* clear of the Sandbox menu button */
  .tk-body { grid-template-columns: 1fr; }
  .tk-head { grid-template-columns: 64px 1fr; }
  .tk-face { width: 64px; height: 64px; }
  .tk-clock { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; text-align: left; }
}

/* Tooltips, after the frame: a dark label with a white hairline, in the HUD's type */
.pv-tip.text { background: #0c2424; border: 1px solid #fff; border-radius: 7px; padding: 8px 10px; color: #fff; font: 500 12px/1.3 var(--app-hud-font); letter-spacing: 0.01em; box-shadow: none; }

/* The hospital's name turns into the way out while the pointer is on it (frame "On hover") */
.ht-name { display: grid; }
.ht-name h1, .ht-name::after { grid-area: 1 / 1; }
.ht-name::after { content: "\2190  Leave Game"; visibility: hidden; font: 500 16px/1.1 var(--app-hud-font); letter-spacing: 0.01em; color: #fff; white-space: nowrap; text-shadow: 0 1px 2px rgba(26, 58, 57, 0.45); }
.ht-name:hover h1, .ht-name:focus-visible h1 { visibility: hidden; }
.ht-name:hover::after, .ht-name:focus-visible::after { visibility: visible; }
/* Finances: four tiles, what is due, the loan as a bar, the books split into in and out */
.ht-kpis.ht-k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ht-k4 .ht-kpi .v { font-size: 1.05rem; }
.ht-short { color: var(--app-coral); font-weight: 600; }
.ht-loanbar { height: 8px; border-radius: 999px; background: var(--app-cream-2); overflow: hidden; margin-bottom: 8px; }
.ht-loanbar i { display: block; height: 100%; border-radius: 999px; background: var(--app-teal); transition: width 0.2s; }
.ht-loan .pv-btn:disabled { opacity: 0.5; cursor: default; }
.ht-ledger .g { grid-column: 1 / -1; margin-top: 4px; font: 600 0.68rem var(--pv-font); text-transform: uppercase; letter-spacing: 0.05em; color: var(--app-teal); }
@media (max-width: 560px) { .ht-kpis.ht-k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Board notices: each has a cross that clears it; the satisfaction tile is a button to the hospital rating */
.ht-memo > span, .ht-due-row > span { flex: 1 1 auto; min-width: 0; }
.ht-clear { flex: none; display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin: -2px -4px -2px 0; border: 0; border-radius: 6px; background: transparent; color: inherit; opacity: 0.55; cursor: pointer; }
.ht-clear:hover, .ht-clear:focus-visible { opacity: 1; background: rgba(0, 0, 0, 0.07); }
.ht-clear svg { width: 12px; height: 12px; }
button.ht-kpi { text-align: left; font: inherit; cursor: pointer; }
button.ht-kpi:hover { border-color: var(--app-teal); }
.ht-kpi .v { display: flex; align-items: center; gap: 6px; }

/* Finances: Export claims, under the books */
.ht-export { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.ht-export .ht-note { margin: 0; }
.ht-export .pv-btn:disabled { opacity: 0.5; cursor: default; }

.tk-walkline { cursor: help; border-bottom: 1px dotted currentColor; }

/* Contract talks, one table: a row per term, your control, their position (a button that takes it as yours) */
.tk-deal { margin: 12px 16px; border: 1px solid var(--app-line); border-radius: 14px; background: #fff; overflow: hidden; font-size: 0.8rem; }
.tk-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) minmax(150px, 0.55fr); gap: 12px; align-items: center; padding: 7px 12px; border-top: 1px solid var(--app-line); }
.tk-row:first-child { border-top: 0; }
.tk-row .k { color: var(--app-ink-2); }
.tk-row .k small { display: block; font-size: 0.68rem; opacity: 0.85; font-variant-numeric: tabular-nums; }
.tk-row .y { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tk-row .y input[type=range] { flex: 1; min-width: 0; accent-color: var(--app-teal); }
.tk-row .y .u { color: var(--app-ink-2); font-size: 0.72rem; margin-left: -4px; }
.tk-row .v { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-row .y input[type=range] + .v { min-width: 44px; text-align: right; }
.tk-row > .t { text-align: right; font-variant-numeric: tabular-nums; }
.tk-take { justify-self: stretch; padding: 4px 10px; border: 1px dashed #b9ae98; border-radius: 8px; background: var(--app-cream-2); color: var(--app-ink); font: 600 0.8rem var(--pv-font); font-variant-numeric: tabular-nums; text-align: right; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-take:hover { border-style: solid; border-color: var(--app-teal); background: #e3f0ef; }
.tk-take.moved { border-color: #f0dca0; background: #fff7e0; }
/* the deadline: your side is locked at the last proposal sent */
.tk-take-off { border-style: solid; cursor: default; text-align: center; }
.tk-take-off:hover { border-color: #b9ae98; background: var(--app-cream-2); }
.tk-locked .tk-row > .y { opacity: 0.55; }
.tk-locked .tk-row.tk-hd > .y, .tk-locked .tk-row.tk-tot > .y { opacity: 1; }
.tk-locked input, .tk-locked .tk-seg button, .tk-locked .tk-sw { cursor: not-allowed; }
.tk-take.moved::before { content: 'moved '; font: 600 0.62rem var(--pv-font); color: #9a6b00; text-transform: uppercase; letter-spacing: 0.05em; }
.tk-row.same .tk-take { border: 1px solid #b9dcc6; background: #e5f3ea; color: #1d5e37; }
.tk-row.same .tk-take::after { content: ' \2713'; }
.tk-hd { background: var(--app-cream-2); font: 700 0.72rem var(--pv-font); letter-spacing: 0.06em; text-transform: uppercase; color: var(--app-ink); }
.tk-hd .y { color: var(--app-teal); gap: 6px; }
.tk-hd .y svg { width: 14px; height: 14px; }
.tk-hd .t { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.tk-tot { background: var(--app-cream-2); }
.tk-tot .t { padding-right: 11px; }
.tk-tot .worth { color: var(--app-green); }
.tk-notes { margin: -4px 16px 12px; color: var(--app-ink-2); font-size: 0.76rem; }
.tk-notes b { color: var(--app-ink); }
.tk-hd .tk-face-sm { width: 22px; height: 22px; border-radius: 6px; flex: none; }
@media (max-width: 560px) {
  .tk-deal { margin: 10px 10px; }
  .tk-row { grid-template-columns: 66px minmax(0, 1fr) 92px; gap: 6px; padding: 6px 8px; }
  .tk-row .y { gap: 6px; }
  .tk-row .y .u { display: none; }
  .tk-row .tk-seg button { min-width: 0; padding: 0 6px; }
  .tk-take { padding: 4px 6px; }
  .tk-hd { font-size: 0.62rem; letter-spacing: 0.03em; }
}
