/* Heat Transfer Detective: the case file and the call on the left, the case board (field photo + desk) on the right,
 * inside the practice shell's stage. */
.htd { position: absolute; inset: 0; display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 12px; padding: 8px 12px; }
.htd-panel { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; padding: 2px; }

/* the case file */
.htd-file { padding: 8px 14px 10px; border-radius: var(--tlg-radius-lg, 14px); border: 2px solid #d8b98a; background: #fdf6e8; color: #2b1d0e;
  box-shadow: inset 0 0 0 4px #fffaf0; }
.htd-file-k { margin: 0 0 4px; font-size: 16px; font-weight: 800; text-transform: uppercase; letter-spacing: var(--tlg-tracking-caps, .08em); color: #9a3412; }
.htd-file-g { margin: 4px 0 0; font-size: 18px; font-weight: 700; line-height: 1.35; }
html[data-theme="dark"] .htd-file { background: #2a2016; color: #f6ead6; border-color: #7a5a32; box-shadow: inset 0 0 0 4px #33281c; }
html[data-theme="dark"] .htd-file-k { color: #ffb58a; }

/* the call */
.htd-field { border: 0; margin: 0; padding: 0; min-width: 0; }
.htd-field legend { padding: 0; margin: 0 0 6px; font-size: 16px; font-weight: 800; color: var(--tlg-text, #172c38); }
.htd-mechs, .htd-dirs { display: grid; gap: 8px; }
.htd-card { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 6px 14px; font: inherit; font-size: 19px; font-weight: 800; text-align: left; cursor: pointer;
  border-radius: 12px; color: var(--tlg-text, #172c38); background: var(--tlg-surface, #fff); border: 2px solid var(--tlg-border, #a5b6c1);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .1); touch-action: manipulation; }
.htd-card svg { flex: none; width: 46px; height: 46px; }
.htd-card--dir { min-height: 52px; }
.htd-card--dir svg { width: 48px; height: 24px; }
.htd-card:hover:not(:disabled) { border-color: #9a3412; }
.htd-card[aria-pressed="true"] { border-color: #9a3412; border-width: 3px; background: #fff1e6; box-shadow: inset 0 0 0 2px #ffd2b3; }
.htd-card[aria-pressed="true"]::after { content: '✓ my call'; margin-left: auto; font-size: 16px; font-weight: 800; color: #9a3412; }
html[data-theme="dark"] .htd-card[aria-pressed="true"] { background: #3a2216; box-shadow: inset 0 0 0 2px #7a3a1a; }
html[data-theme="dark"] .htd-card[aria-pressed="true"]::after, html[data-theme="dark"] .htd-card:hover:not(:disabled) { color: #ffb58a; }
.htd-note { margin: 6px 0 0; font-size: 16px; color: var(--tlg-text-muted, #4b5d68); }

.htd-price { display: flex; align-items: center; gap: 8px; }
.htd-num { width: 180px; height: 54px; font: inherit; font-size: 28px; font-weight: 800; text-align: right; padding: 0 12px; border-radius: 10px;
  border: 2px solid var(--tlg-border, #a5b6c1); background: var(--tlg-surface, #fff); color: var(--tlg-text, #172c38); font-variant-numeric: tabular-nums;
  -moz-appearance: textfield; appearance: textfield; }
.htd-num::-webkit-outer-spin-button, .htd-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.htd-num:focus { border-color: #9a3412; }
.htd-unit { font-size: 24px; font-weight: 800; }
.htd-formula { margin: 8px 0 0; font-size: 18px; font-weight: 700; font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--tlg-text-muted, #4b5d68); }

.htd :focus-visible { outline: 3px solid #b16a08; outline-offset: 2px; }
.htd button:disabled, .htd input:disabled { cursor: default; }
.htd.is-locked .htd-card:not([aria-pressed="true"]) { opacity: .7; }
.htd-msg { margin: 0; min-height: 1.2em; font-size: 16px; font-weight: 700; color: var(--tlg-danger, #b42318); }
html[data-theme="dark"] .htd-msg { color: #ffb4a8; }
.htd-about { font-size: 16px; line-height: 1.4; }
.htd-about summary { cursor: pointer; font-weight: 700; }
.htd-about p { margin: 4px 0 0; }

/* the case board */
.htd-view { position: relative; min-width: 0; min-height: 0; display: flex; align-items: flex-start; justify-content: center; }
.htd-scene { position: relative; width: 100%; aspect-ratio: 720 / 620; border-radius: var(--tlg-radius-lg, 14px); overflow: hidden; border: var(--tlg-border-width, 1px) solid var(--tlg-border, #a5b6c1); user-select: none; -webkit-user-select: none; }
.htd-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.htd-cork { fill: url(#htd-g-cork); }
.htd-desk { fill: url(#htd-g-desk); }
html[data-theme="dark"] .htd-cork { fill: url(#htd-g-cork-d); }
html[data-theme="dark"] .htd-desk { fill: url(#htd-g-desk-d); }

.htd-t { font-family: var(--tlg-font-body, system-ui, sans-serif); fill: #1d2b33; }
.htd-t-plaque { font-size: 22px; font-weight: 800; fill: #f6e7b8; letter-spacing: .06em; }
.htd-t-plaque--r { fill: #cfe0ea; letter-spacing: .02em; }
.htd-t-cap { font-size: 17px; font-weight: 700; fill: #2b1d0e; font-style: italic; }
html[data-theme="dark"] .htd-t-cap { fill: #f2dfc2; }
.htd-t-notek { font-size: 18px; font-weight: 800; fill: #6b4a1f; letter-spacing: .02em; }
.htd-t-note { font-size: 26px; font-weight: 800; fill: #1b2a4a; font-family: 'Segoe Print', 'Bradley Hand', var(--tlg-font-body, system-ui), sans-serif; }
.htd-t-note.is-empty { font-size: 20px; fill: #7a6a52; font-style: italic; }
.htd-t-cam { font-size: 18px; font-weight: 900; fill: #ffffff; letter-spacing: .08em; }
.htd-t-camoff { font-size: 17px; font-weight: 700; fill: #7fa6bf; }
.htd-t-sign { font-size: 18px; font-weight: 800; fill: #1d2b33; }
.htd-t-meterk { font-size: 17px; font-weight: 700; fill: #cfe0ea; }
.htd-t-title { font-size: 30px; font-weight: 900; fill: #f6e7b8; letter-spacing: .06em; }
.htd-letter { font-size: 30px; font-weight: 900; }
.htd-lcd { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 26px; font-weight: 700; fill: #9dffb5; }
.htd-lcd--sm { font-size: 22px; }
.htd-lcd.is-on { fill: #ffe27a; }
.htd-pill rect { fill: rgba(255, 255, 255, .94); stroke: #1d2b33; stroke-width: 1.5; }
.htd-pill text { font-family: var(--tlg-font-body, system-ui, sans-serif); font-size: 17px; font-weight: 800; fill: #1d2b33; }
.htd-pill--scan rect { fill: #2a1640; stroke: #ffb000; stroke-width: 2; }
.htd-pill--scan text { fill: #ffffff; }
.htd-pill--tag rect { fill: #ffb000; stroke: #2a1640; }
.htd-pill--tag text { fill: #2a1640; }
.htd-star { fill: #ffffff; opacity: .85; }
.htd-camscreen { fill: #0f2230; }
.htd-yours path { stroke: #1d2b33; fill: none; }
.htd-yours rect { fill: #ffffff; stroke: #1d2b33; stroke-width: 3; }

/* the thermal scan (after Check, practice only) */
.htd-scanframe { fill: none; stroke: #ffb000; stroke-width: 6; stroke-dasharray: 18 10; }
.htd-scan { animation: htd-in .5s ease-out both; }
.htd-scan .htd-pill { animation: htd-in .5s .5s ease-out both; }
.htd-in2 { animation: htd-in .8s .4s ease-out both; }
.htd-flow { fill: none; stroke-width: 10; stroke-linecap: round; stroke-dasharray: 0 20; animation: htd-dash 1s linear infinite; }
.htd-flow--hot { stroke: #e8501f; }
.htd-flow--cool { stroke: #2f7fd0; }
.htd-flow--cond { stroke: #ff6a1a; }
.htd-ray { fill: none; stroke: #ffb000; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 46 12; animation: htd-dash2 .9s linear infinite; }
.htd-ray--ir { stroke: #ff5a3c; }
.htd-jig { transform-box: fill-box; transform-origin: center; animation: htd-jig .22s ease-in-out infinite alternate; }
@keyframes htd-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes htd-dash { to { stroke-dashoffset: -20; } }
@keyframes htd-dash2 { to { stroke-dashoffset: -58; } }
@keyframes htd-jig { from { transform: translate(-1.8px, 1px); } to { transform: translate(1.8px, -1px); } }

/* ambient life in the photos (not a cue: flames flicker and steam drifts in every case) */
.htd-flicker { transform-box: fill-box; transform-origin: 50% 100%; animation: htd-flick .45s ease-in-out infinite alternate; }
.htd-steam { animation: htd-steam 2.4s ease-in-out infinite; }
.htd-twinkle { animation: htd-twinkle 2.2s ease-in-out infinite alternate; }
@keyframes htd-flick { from { transform: scaleY(.9) scaleX(1.03); } to { transform: scaleY(1.06) scaleX(.97); } }
@keyframes htd-steam { 0% { opacity: 0; transform: translateY(6px); } 40% { opacity: .75; } 100% { opacity: 0; transform: translateY(-14px); } }
@keyframes htd-twinkle { from { opacity: .35; } to { opacity: 1; } }

/* reveal badge (over the plaque) */
.htd-badge { position: absolute; left: 2%; right: 2%; top: 1.2%; padding: 7px 12px; border-radius: 10px; font-size: 17px; font-weight: 700; line-height: 1.3; pointer-events: none;
  background: rgba(255, 255, 255, .97); color: #10202c; border: 3px solid #1d6b40; box-shadow: 0 3px 8px rgba(0, 0, 0, .25); animation: htd-pop .25s ease-out; }
.htd-badge.is-bad { border-color: #b42318; }
@keyframes htd-pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }

/* briefing + start */
.htd-example-svg { display: block; width: 100%; height: auto; max-height: 460px; border-radius: 10px; }
.htd-start-svg { display: block; width: 100%; height: 100%; }

.htd-static *, .htd-static { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .htd *, .htd-badge, .htd-start-svg *, .htd-example-svg * { animation: none !important; }
}
@media (max-width: 1100px) { .htd { grid-template-columns: 300px minmax(0, 1fr); } }
@media (max-width: 900px) {
  .htd { position: static; grid-template-columns: 1fr; }
  .htd-panel { overflow: visible; }
  .htd-view { display: block; order: -1; }
  .htd-scene { width: 100% !important; }
}
.htd-pill--name rect { fill: #24354a; stroke: #0b1119; } .htd-pill--name text { fill: #f6e7b8; }
