/* css/tab-videos.css - "How this tab works" chip + video sheet (C157, voiced guide C164, js/tab-videos.js).
   Uses the app's tokens (brand/tokens.css), so dark and light both follow the app. Remove this file and js/tab-videos.js
   (two lines in index.html) to take the feature out. */

/* ---------------------------------------------------------------- the chip */
.tv-chip { display: flex; align-items: center; gap: 2px; width: max-content; max-width: 100%; margin: 2px 0 14px;
  border-radius: 999px; background: var(--surface, #161D30); border: 1px solid var(--border-strong, rgba(244,239,228,.15));
  box-shadow: var(--shadow-1, none); animation: tv-in .28s var(--ease, ease-out) both; }
.tv-chip.tv-home { margin: 6px 0 12px; }
/* wide screens: on Home it sits at the right end of the greeting line instead of taking a row of its own */
@media (min-width: 1000px) { .tv-chip.tv-home { margin: -42px 0 12px auto; } }
.tv-chip.tv-area { margin: 2px 0 14px; }
.tv-open { display: inline-flex; align-items: center; gap: 9px; min-height: 38px; padding: 4px 12px 4px 4px; border: 0; background: none;
  font: inherit; font-size: 14px; color: var(--text, #F4EFE4); cursor: pointer; border-radius: 999px; min-width: 0; text-align: left; }
.tv-open .tv-l { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-open .tv-l b { font-weight: 800; }
.tv-open .tv-c { font-style: normal; }
.tv-play { position: relative; flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent, #F5B83D); color: var(--accent-ink, #1A1406); box-shadow: 0 2px 0 var(--accent-deep, #B07D12); }
.tv-play > svg { margin-left: 2px; }
/* watched: a small check on the play button */
.tv-tick { position: absolute; right: -4px; bottom: -4px; display: grid; place-items: center; width: 15px; height: 15px; border-radius: 50%;
  background: var(--good, #4CC38A); color: #06210F; box-shadow: 0 0 0 2px var(--surface, #161D30); }
.tv-tick svg { margin: 0; }
.tv-len { flex: none; font-size: 13px; font-weight: 700; color: var(--text-3, #8F98AE); font-variant-numeric: tabular-nums; }
.tv-snd { flex: none; display: inline-grid; place-items: center; margin-left: -3px; color: var(--accent-text, #F5B83D); }
.tv-x { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; margin-right: 3px; border: 0; border-radius: 50%;
  background: none; color: var(--text-3, #8F98AE); cursor: pointer; }
.tv-open:hover .tv-play { background: var(--accent-2, #FFCB62); }
.tv-chip:hover { border-color: color-mix(in srgb, var(--accent, #F5B83D) 55%, transparent); }
.tv-x:hover { background: var(--surface-2, #1F2840); color: var(--text, #F4EFE4); }
.tv-open:focus-visible, .tv-x:focus-visible, .tv-undo:focus-visible, .tv-close:focus-visible, .tv-btn:focus-visible, .tv-cb:focus-visible, .tv-big:focus-visible,
.tv-sound:focus-visible, .tv-up:focus-visible, .tv-seek:focus-visible, .tv-hpbtn:focus-visible, .tv-hpmini:focus-visible, .tv-tr summary:focus-visible { outline: 2px solid var(--accent, #F5B83D); outline-offset: 2px; }
.tv-open:active .tv-play { transform: translateY(1px); box-shadow: 0 1px 0 var(--accent-deep, #B07D12); }
/* the first time a tab is seen: one soft ring around the play button and a brief glow on the chip (no autoplay, no repeat) */
.tv-chip.tv-pulse { animation: tv-in .28s var(--ease, ease-out) both, tv-glow 1.8s ease-out .5s 1 both; }
.tv-chip.tv-pulse .tv-play::after { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent, #F5B83D) 70%, transparent); animation: tv-ring 1.8s ease-out .5s 1 both; }
/* the note after hiding it */
.tv-chip.tv-note { gap: 10px; padding: 6px 6px 6px 14px; min-height: 40px; font-size: 13.5px; color: var(--text-2, #B9BFCF); }
.tv-note-t b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid currentColor; font-size: 12px; line-height: 1; }
.tv-undo { border: 0; background: var(--surface-2, #1F2840); color: var(--text, #F4EFE4); font: inherit; font-size: 13px; font-weight: 800; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.tv-chip.tv-going { opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .25s; }
@media (pointer: coarse) { .tv-open { min-height: 42px; } .tv-x { width: 40px; height: 40px; } }
@media (max-width: 380px) { .tv-open { font-size: 13.5px; gap: 8px; } }
/* narrow phones: "Meet your guide" is enough; the rest comes back from 440px up */
@media (max-width: 439px) { .tv-chip .tv-rest, .tv-chip .tv-c { display: none; } }

/* ---------------------------------------------------------------- the video sheet */
.tv-sheet { position: fixed; inset: 0; z-index: 1300; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(5, 8, 16, .74); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: tv-fade .18s ease-out backwards; }
.tv-card { position: relative; width: min(1080px, 100%); max-height: 100%; overflow: auto; overscroll-behavior: contain; outline: none;
  background: var(--surface, #161D30); color: var(--text, #F4EFE4); border: 1px solid var(--border-strong, rgba(244,239,228,.15));
  border-radius: 22px; padding: 14px 18px 18px; box-shadow: var(--shadow-3, 0 26px 70px rgba(0,0,0,.6)); animation: tv-pop .22s var(--ease, ease-out) backwards; }
.tv-head { display: flex; align-items: center; gap: 12px; padding: 0 0 12px 4px; }
.tv-ht { flex: 1; min-width: 0; }
.tv-ht h2 { margin: 0; font-size: 19px; line-height: 1.25; font-weight: 800; }
.tv-ht span { display: block; margin-top: 2px; font-size: 13px; color: var(--text-3, #8F98AE); }
.tv-close { flex: none; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 0;
  background: var(--surface-2, #1F2840); color: var(--text, #F4EFE4); cursor: pointer; }
.tv-close:hover { background: var(--surface-3, #2A3452); }
.tv-frame { position: relative; border-radius: 14px; overflow: hidden; background: #0A0E1A; aspect-ratio: 16 / 9; }
.tv-video { display: block; width: 100%; height: 100%; background: #0A0E1A; object-fit: contain; cursor: pointer; }
.tv-video::cue { font: 700 1.05em/1.35 Manrope, system-ui, sans-serif; color: #fff; background: rgba(8, 11, 22, .82); }
.tv-frame.is-err::after { content: "The video could not load. The steps are below."; position: absolute; inset: 0 0 auto 0; padding: 12px 16px;
  background: rgba(10,14,26,.9); color: #F4EFE4; font-size: 14px; font-weight: 700; text-align: center; }
/* the big play button on a paused picture */
.tv-big { position: absolute; left: 50%; top: 50%; width: 78px; height: 78px; margin: -39px 0 0 -39px; display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--accent, #F5B83D); color: var(--accent-ink, #1A1406); box-shadow: 0 4px 0 var(--accent-deep, #B07D12), 0 12px 30px rgba(0,0,0,.45); }
.tv-big svg { margin-left: 4px; }
.tv-big[hidden], .tv-sound[hidden], .tv-up[hidden] { display: none; }
.tv-big:hover, .tv-sound:hover { background: var(--accent-2, #FFCB62); }
/* played muted because the browser refused sound: one clear way to turn it on */
.tv-sound { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 22px 0 18px;
  border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-size: 16px; font-weight: 800; white-space: nowrap;
  background: var(--accent, #F5B83D); color: var(--accent-ink, #1A1406); box-shadow: 0 3px 0 var(--accent-deep, #B07D12), 0 10px 28px rgba(0,0,0,.45); animation: tv-nudge 2.4s ease-in-out 1s 2; }
/* waiting for data */
.tv-sheet.is-wait .tv-frame::before { content: ""; position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; z-index: 2; pointer-events: none;
  border: 3px solid rgba(255,255,255,.25); border-top-color: var(--accent, #F5B83D); animation: tv-spin .8s linear infinite; }
/* end card */
.tv-end { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 12px; background: rgba(8, 11, 22, .72); }
.tv-end[hidden] { display: none; }
.tv-end-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.tv-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 14px; border: 0; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 800; background: var(--accent, #F5B83D); color: var(--accent-ink, #1A1406); box-shadow: 0 3px 0 var(--accent-deep, #B07D12); }
.tv-btn-2 { background: #2A3452; color: #F4EFE4; box-shadow: 0 3px 0 #121827; }
/* the one quiet upgrade line (Free only): no fill, no icon, no repeat */
.tv-up { border: 0; background: none; color: rgba(244, 239, 228, .82); font: inherit; font-size: 14px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; padding: 8px 12px; border-radius: 10px; cursor: pointer; }
.tv-up:hover { color: #fff; }
/* controls under the picture (never over the captions) */
.tv-bar { display: flex; align-items: center; gap: 4px; margin-top: 10px; padding: 4px 6px; border-radius: 14px; background: var(--surface-2, #1F2840); }
.tv-cb { flex: none; display: inline-grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 12px; background: none; color: var(--text, #F4EFE4); cursor: pointer; }
.tv-cb:hover { background: var(--surface-3, #2A3452); }
.tv-cb.is-off { color: var(--text-3, #8F98AE); }
.tv-cc[aria-pressed="true"] { color: var(--accent-text, #F5B83D); box-shadow: inset 0 -3px 0 var(--accent, #F5B83D); }
.tv-cc[aria-pressed="false"] { color: var(--text-3, #8F98AE); }
.tv-pp { color: var(--accent-text, #F5B83D); }
.tv-time { flex: none; min-width: 80px; text-align: center; font-size: 13px; font-weight: 700; color: var(--text-2, #B9BFCF); font-variant-numeric: tabular-nums; }
.tv-seek { --p: 0%; flex: 1 1 auto; min-width: 0; height: 30px; margin: 0 4px; background: none; cursor: pointer; -webkit-appearance: none; appearance: none; }
.tv-seek::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(to right, var(--accent, #F5B83D) var(--p), var(--surface-3, #2A3452) var(--p)); }
.tv-seek::-moz-range-track { height: 6px; border-radius: 6px; background: var(--surface-3, #2A3452); }
.tv-seek::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--accent, #F5B83D); }
.tv-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; border: 0; background: var(--accent, #F5B83D); box-shadow: 0 0 0 3px var(--surface-2, #1F2840); }
.tv-seek::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; border: 0; background: var(--accent, #F5B83D); box-shadow: 0 0 0 3px var(--surface-2, #1F2840); }
.tv-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tv-tr { margin-top: 12px; border-radius: 12px; background: var(--surface-2, #1F2840); }
.tv-tr summary { cursor: pointer; padding: 12px 14px; font-size: 14px; font-weight: 800; color: var(--text-2, #B9BFCF); list-style: none; display: flex; align-items: center; gap: 8px; border-radius: 12px; }
.tv-tr summary::-webkit-details-marker { display: none; }
.tv-tr summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: -3px 0 0 auto; transition: transform .15s; }
.tv-tr[open] summary::after { transform: rotate(-135deg); margin-top: 3px; }
.tv-tr ol { margin: 0; padding: 0 16px 4px 36px; font-size: 14.5px; line-height: 1.5; color: var(--text, #F4EFE4); }
.tv-tr li { margin: 0 0 6px; padding-left: 2px; }
.tv-tr li::marker { color: var(--accent-text, #F5B83D); font-weight: 800; }
.tv-m { margin: 6px 14px 0; padding: 10px 0 14px; border-top: 1px solid var(--border, rgba(244,239,228,.08)); font-size: 13.5px; color: var(--text-2, #B9BFCF); }

/* phones held upright: the 9:16 cut, filling the screen */
.tv-sheet.is-up { padding: 0; align-items: stretch; }
.tv-sheet.is-up .tv-card { width: 100%; max-height: none; height: 100%; border-radius: 0; border: 0; padding: max(10px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom)); }
.tv-sheet.is-up .tv-head { padding-bottom: 8px; }
.tv-sheet.is-up .tv-ht h2 { font-size: 17px; }
.tv-sheet.is-up .tv-frame { aspect-ratio: 9 / 16; width: min(100%, calc((100dvh - 204px) * 9 / 16)); margin: 0 auto; }
.tv-sheet.is-up .tv-bar { margin-top: 8px; }
.tv-sheet.is-up .tv-time { min-width: 0; font-size: 12px; }
.tv-sheet.is-up .tv-cb { width: 40px; }
.tv-sheet.is-up .tv-sound { bottom: 14px; }
@media (max-width: 700px) and (orientation: landscape) { .tv-sheet { padding: 8px; } .tv-card { padding: 8px 10px 10px; } .tv-frame { max-height: calc(100dvh - 130px); aspect-ratio: auto; } .tv-head { padding-bottom: 6px; } .tv-bar { margin-top: 6px; } }
@media (max-width: 380px) { .tv-sheet.is-up .tv-time { display: none; } }

.tv-sheet.is-out { opacity: 0; transition: opacity .16s; }
.tv-sheet.no-anim, .tv-sheet.no-anim .tv-card, .tv-sheet.no-anim .tv-sound { animation: none; }

/* ---------------------------------------------------------------- inside Help */
.tv-hpbtn { display: inline-flex; align-items: center; gap: 9px; margin: 4px 0 12px; min-height: 40px; padding: 4px 14px 4px 4px; border-radius: 999px;
  border: 1px solid var(--border-strong, rgba(244,239,228,.15)); background: var(--surface-2, #1F2840); color: var(--text, #F4EFE4); font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; }
#hp-root .tv-hpbtn, #hp-root .tv-hpmini { width: auto; max-width: 100%; align-self: flex-start; justify-content: flex-start; text-align: left; white-space: nowrap; line-height: 1.2; }
.tv-hpbtn .tv-len { margin-left: 2px; }
.tv-hprow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 14px; }
.tv-hprow-t { width: 100%; font-size: 13px; font-weight: 700; color: var(--text-3, #8F98AE); }
.tv-hpmini { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 3px 12px 3px 3px; border-radius: 999px; border: 1px solid var(--border-strong, rgba(244,239,228,.15));
  background: var(--surface-2, #1F2840); color: var(--text, #F4EFE4); font: inherit; font-size: 13.5px; font-weight: 800; cursor: pointer; }
.tv-hpmini .tv-play { width: 28px; height: 28px; }
.tv-hpbtn:hover, .tv-hpmini:hover { border-color: color-mix(in srgb, var(--accent, #F5B83D) 55%, transparent); }

@keyframes tv-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes tv-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tv-pop { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes tv-ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent, #F5B83D) 70%, transparent); } 100% { box-shadow: 0 0 0 16px transparent; } }
@keyframes tv-glow { 0%, 100% { border-color: var(--border-strong, rgba(244,239,228,.15)); } 30% { border-color: var(--accent, #F5B83D); } }
@keyframes tv-spin { to { transform: rotate(360deg); } }
@keyframes tv-nudge { 0%, 100% { transform: translateX(-50%); } 50% { transform: translateX(-50%) translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .tv-chip, .tv-chip.tv-pulse, .tv-chip.tv-pulse .tv-play::after, .tv-sheet, .tv-card, .tv-sound { animation: none !important; } .tv-chip.tv-going { transition: none; } .tv-sheet.is-wait .tv-frame::before { animation: none; } }
:root[data-motion="off"] .tv-chip, :root[data-motion="off"] .tv-chip.tv-pulse, :root[data-motion="off"] .tv-chip.tv-pulse .tv-play::after, :root[data-motion="off"] .tv-sheet, :root[data-motion="off"] .tv-card, :root[data-motion="off"] .tv-sound { animation: none !important; }
