/* Hear It First player. Reads the room's own tokens; override the --hif-* values per room if names differ. */
.hif {
  --hif-bg: var(--ink-2, #151F1E);
  --hif-bg-2: var(--ink-3, #1D2A28);
  --hif-text: var(--paper, #E9EBE7);
  --hif-muted: var(--mist, #8C9A98);
  --hif-accent: var(--signal, #1FB2AA);
  --hif-accent-2: var(--signal-2, #4FDDD3);
  --hif-line: var(--line, rgba(233,235,231,.10));
  --hif-soft: var(--signal-soft, rgba(31,178,170,.13));
  --hif-display: var(--font-display, inherit);
  --hif-mono: var(--font-mono, ui-monospace, Menlo, monospace);
  background: var(--hif-bg); color: var(--hif-text); border: 1px solid var(--hif-line);
  border-radius: var(--radius, 14px); padding: 18px 18px 16px; text-align: left; position: relative;
}
.hif[hidden] { display: none; }
.hif-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.hif-eyebrow { font-family: var(--hif-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--hif-accent-2); font-weight: 600; }
.hif-flow { font-family: var(--hif-mono); font-size: 11px; letter-spacing: .06em; color: var(--hif-muted); }
.hif-flow i { font-style: normal; color: var(--hif-accent); padding: 0 2px; }
.hif.is-heard .hif-eyebrow::after { content: " · heard"; color: var(--hif-muted); font-weight: 500; }
.hif-title { font-family: var(--hif-display); font-size: 19px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
.hif-sub { margin: 4px 0 0; color: var(--hif-muted); font-size: 14px; line-height: 1.45; }
.hif-player { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.hif-play { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--hif-accent); color: #fff; display: grid; place-items: center; cursor: pointer; transition: transform .15s ease, background .15s ease; }
.hif-play:hover { background: var(--hif-accent-2); color: var(--ink, #0E1413); }
.hif-play:active { transform: scale(.95); }
.hif-play svg { width: 22px; height: 22px; }
.hif-play:focus-visible, .hif button:focus-visible, .hif-tl:focus-visible, .hif summary:focus-visible { outline: 2px solid var(--hif-accent-2); outline-offset: 2px; }
.hif-bar { flex: 1 1 auto; min-width: 0; }
.hif-rail { position: relative; height: 6px; border-radius: 6px; background: var(--hif-bg-2); }
.hif-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 6px; background: var(--hif-accent); pointer-events: none; }
.hif-tick { position: absolute; top: -3px; width: 2px; height: 12px; margin-left: -1px; background: var(--hif-text); opacity: .45; border-radius: 1px; pointer-events: none; }
.hif-seek { position: absolute; inset: -10px 0; width: 100%; height: 26px; margin: 0; opacity: 0; cursor: pointer; }
.hif-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-family: var(--hif-mono); font-size: 12px; color: var(--hif-muted); }
.hif-speed { border: 1px solid var(--hif-line); background: transparent; color: var(--hif-text); border-radius: 20px; padding: 2px 10px; font-family: var(--hif-mono); font-size: 12px; cursor: pointer; }
.hif-chapters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.hif-chapters button { border: 1px solid var(--hif-line); background: transparent; color: var(--hif-muted); border-radius: 20px; padding: 4px 12px; font-size: 13px; cursor: pointer; }
.hif-chapters button.on { color: var(--hif-text); border-color: var(--hif-accent); background: var(--hif-soft); }
.hif-resume { margin: 10px 0 0; font-size: 13px; color: var(--hif-muted); }
.hif-resume button { background: none; border: 0; padding: 0; color: var(--hif-accent-2); text-decoration: underline; cursor: pointer; font-size: inherit; }
.hif-line { margin-top: 14px; padding: 12px 14px; border-left: 3px solid var(--hif-accent); background: var(--hif-soft); border-radius: 0 10px 10px 0; }
.hif-k { font-family: var(--hif-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--hif-accent-2); font-weight: 600; margin-top: 8px; }
.hif-k:first-child { margin-top: 0; }
.hif-line q { display: block; margin-top: 3px; font-size: 15.5px; line-height: 1.45; color: var(--hif-text); quotes: "\201C" "\201D"; }
.hif-line q.hif-alt { font-size: 14.5px; color: var(--hif-muted); }
.hif-say { margin: 10px 0 0; font-size: 13px; color: var(--hif-muted); }
.hif details { margin: 12px 0 0; border-top: 1px solid var(--hif-line); padding: 10px 0 0; }
.hif summary { display: block; text-align: left; cursor: pointer; font-family: var(--hif-mono); font-weight: 600; font-size: 12px; line-height: 1.6; letter-spacing: .08em; text-transform: uppercase; color: var(--hif-accent-2); list-style: none; padding: 2px 0; }
.hif summary::after, .hif details[open] summary::after { content: none; }
.hif summary::-webkit-details-marker { display: none; }
.hif summary::before { content: "+ "; }
.hif details[open] > summary::before { content: "– "; }
.hif-moves ol { margin: 10px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.5; }
.hif-moves li { margin-bottom: 6px; }
.hif-moves li b { color: var(--hif-accent-2); font-weight: 600; margin-right: 4px; }
.hif-lines { list-style: none; margin: 10px 0 0; padding: 0 4px 0 0; max-height: 320px; overflow-y: auto; scroll-behavior: smooth; font-size: 14px; line-height: 1.5; }
.hif-tsec { font-family: var(--hif-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--hif-muted); margin: 12px 0 4px; }
.hif-tsec:first-child { margin-top: 2px; }
.hif-tl { display: grid; grid-template-columns: 74px 1fr; gap: 8px; padding: 5px 8px; border-radius: 8px; cursor: pointer; color: var(--hif-muted); transition: background .15s ease, color .15s ease; }
.hif-tl b { font-weight: 600; color: var(--hif-text); font-size: 13px; }
.hif-tl:hover { background: var(--hif-bg-2); }
.hif-tl.on { background: var(--hif-soft); color: var(--hif-text); }
.hif-practice { display: inline-block; margin-top: 14px; font-weight: 600; color: var(--hif-accent-2); }
.hif-compact .hif-title { font-size: 18px; }
@media (max-width: 520px) { .hif { padding: 16px 14px 14px; } .hif-tl { grid-template-columns: 1fr; gap: 0; } .hif-flow { display: none; } }
@media (prefers-reduced-motion: reduce) { .hif-lines { scroll-behavior: auto; } .hif-play { transition: none; } }

/* light pages (body.paper / light cards): use the deeper accent for small text */
body.paper .hif, .paper-section .hif { --hif-accent-2: var(--signal, #1FB2AA); }
