/* video_in_app_1021: the one player sheet and its entry points (static/v3/video.js). Colours are tokens; the player itself
   is a dark stage like every video player, so the video's own colours read true in light and dark mode. */

/* "▶ How this works" — a quiet link in a screen's header or at the top of a sheet */
.vid-how-row { display:flex; justify-content:flex-end; margin:calc(-1 * var(--space-2)) 0 var(--space-2); }
.vid-how-sheet { justify-content:flex-start; align-self:stretch; width:100%; margin:0 0 var(--space-2); }
.vid-how { display:inline-flex; align-items:center; gap:6px; min-height:44px; padding:0 var(--space-3); border:1px solid var(--border);
  border-radius:var(--radius-pill); background:var(--surface); color:var(--accent); font:inherit; font-size:var(--text-sm); font-weight:600;
  cursor:pointer; -webkit-tap-highlight-color:transparent; }
.vid-how svg { width:14px; height:14px; flex:none; }
.vid-how-dur { color:var(--muted); font-weight:500; font-variant-numeric:tabular-nums; }
.vid-how:hover { background:var(--surface-2); }
.vid-how:focus-visible,.vid-tour-open:focus-visible,.vid-dismiss:focus-visible,.vid-landing-open:focus-visible,.vid-help-item:focus-visible,
.vid-close:focus-visible,.vid-play:focus-visible,.vid-cc:focus-visible { outline:3px solid var(--focus); outline-offset:2px; }

/* poster thumbnails */
.vid-thumb { position:relative; display:block; flex:none; overflow:hidden; border-radius:var(--radius-sm); background:var(--hs-card-2); aspect-ratio:9/16; }
.vid-thumb img { display:block; width:100%; height:100%; object-fit:cover; }
.vid-thumb-sm { width:64px; }
.vid-thumb-wide { aspect-ratio:16/9; }
.vid-thumb-play { position:absolute; left:50%; top:50%; width:36px; height:36px; margin:-18px 0 0 -18px; border-radius:50%;
  background:var(--hs-scrim); color:var(--hs-on-accent); display:grid; place-items:center; }
.vid-thumb-play svg { width:18px; height:18px; margin-left:2px; }
.vid-thumb-dur { position:absolute; right:4px; bottom:4px; padding:1px 5px; border-radius:6px; background:var(--hs-scrim); color:var(--hs-on-accent);
  font-size:var(--text-2xs); font-weight:600; font-variant-numeric:tabular-nums; line-height:1.4; }

/* Today: the tour card (new members, until dismissed) */
.vid-tour-card { position:relative; display:flex; align-items:stretch; padding:0; margin-bottom:var(--space-4); overflow:hidden; }
.vid-tour-open { flex:1; display:flex; align-items:center; gap:var(--space-4); min-height:44px; padding:var(--space-4); padding-right:56px;
  border:0; background:none; color:var(--ink); font:inherit; text-align:left; cursor:pointer; }
.vid-tour-open .vid-thumb-sm { width:72px; }
.vid-tour-text { display:flex; flex-direction:column; gap:4px; min-width:0; }
.vid-tour-text strong { font-size:var(--text-md); }
.vid-tour-text > span { color:var(--muted); font-size:var(--text-sm); }
.vid-tour-text .vid-tour-cta { display:inline-flex; align-items:center; gap:6px; margin-top:4px; color:var(--accent); font-weight:600; }
.vid-tour-cta svg { width:14px; height:14px; }
.vid-dismiss { position:absolute; top:6px; right:6px; width:44px; height:44px; display:grid; place-items:center; border:0; border-radius:50%;
  background:none; color:var(--muted); cursor:pointer; }
.vid-dismiss:hover { background:var(--surface-2); }
/* In the Today grid it sits right under the account card; on the two-column layout it takes the account column's second row. */
.home-grid > .vid-tour-card { margin-bottom:0; }
@media (min-width:1200px) {
  /* Keep the tour row at its content height; the tall Markets column can grow the positions row instead. */
  .home-grid:has(> .vid-tour-card) { grid-template-rows:auto auto 1fr; }
  .home-grid > .vid-tour-card { grid-column:1; grid-row:2; }
  .home-grid:has(> .vid-tour-card) > #v3-positions { grid-row:3; margin-top:var(--space-2); }
  .home-grid:has(> .vid-tour-card) > .home-market { grid-row:1 / span 3; }
}

/* Account › Help & videos */
.vid-help-intro { margin:0 0 var(--space-4); }
.vid-help-list { list-style:none; margin:0; padding:0; display:grid; gap:var(--space-3); }
.vid-help-item { width:100%; display:flex; align-items:center; gap:var(--space-4); min-height:44px; padding:var(--space-3);
  border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); color:var(--ink); font:inherit; text-align:left; cursor:pointer; }
.vid-help-item:hover { background:var(--surface-2); }
.vid-help-text { display:flex; flex-direction:column; gap:4px; min-width:0; }
.vid-help-text strong { font-size:var(--text-md); }
.vid-help-text > span { color:var(--muted); font-size:var(--text-sm); }
.vid-help-text .vid-help-dur { font-size:var(--text-xs); font-variant-numeric:tabular-nums; }
@media (min-width:1024px) { .vid-help-list { grid-template-columns:repeat(2,minmax(0,1fr)); } }

/* signed-out sign-in page: the Demo-account tour */
.vid-landing { max-width:440px; margin:var(--space-5) auto 0; padding:var(--space-5); }
.vid-landing h2 { margin:0 0 var(--space-2); font-size:var(--text-md); }
.vid-landing p { margin:0 0 var(--space-4); font-size:var(--text-sm); }
.vid-landing-open { display:block; width:100%; padding:0; border:0; background:none; cursor:pointer; border-radius:var(--radius-sm); }
.vid-landing-open .vid-thumb { width:min(100%,240px); margin:0 auto; }
.vid-landing-open .vid-thumb-wide { width:100%; }
.vid-landing-open .vid-thumb-play { width:64px; height:64px; margin:-32px 0 0 -32px; }
.vid-landing-open .vid-thumb-play svg { width:30px; height:30px; margin-left:3px; }

/* the player: full screen on phones, a centred modal from 1024 px */
dialog.vid-sheet { position:fixed; inset:0; width:100vw; max-width:100vw; height:100vh; height:100dvh; max-height:100dvh; margin:0; padding:0;
  border:0; border-radius:0; background:var(--hs-page); color:var(--hs-on-accent); display:flex; flex-direction:column; overflow:hidden; }
dialog.vid-sheet:not([open]) { display:none; }
dialog.vid-sheet::backdrop { background:var(--hs-scrim); }
.vid-head { display:flex; align-items:center; gap:var(--space-3); padding:max(var(--space-2), env(safe-area-inset-top)) var(--space-2) var(--space-2) var(--space-4);
  background:var(--hs-card-2); flex:none; }
.vid-head h2 { flex:1; min-width:0; margin:0; font-size:var(--text-md); color:var(--hs-on-accent); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.vid-dur { color:var(--hs-text-2); font-size:var(--text-sm); font-variant-numeric:tabular-nums; }
.vid-close { width:44px; height:44px; flex:none; display:grid; place-items:center; border:0; border-radius:50%; background:var(--hs-rule); color:var(--hs-on-accent); cursor:pointer; }
.vid-stage { position:relative; flex:1; min-height:0; display:flex; align-items:center; justify-content:center; background:var(--hs-page); }
.vid-stage video { display:block; width:100%; height:100%; max-height:100%; object-fit:contain; background:var(--hs-page); }
.vid-play { position:absolute; left:50%; top:50%; width:76px; height:76px; margin:-38px 0 0 -38px; display:grid; place-items:center; border:0; border-radius:50%;
  background:var(--hs-scrim); color:var(--hs-on-accent); cursor:pointer; box-shadow:0 0 0 2px transparent; }
.vid-play svg { width:34px; height:34px; margin-left:4px; }
.vid-play[hidden] { display:none; }
.vid-foot { display:flex; align-items:center; gap:var(--space-3); padding:var(--space-2) var(--space-4) max(var(--space-2), env(safe-area-inset-bottom)); background:var(--hs-card-2); flex:none; }
.vid-line { flex:1; min-width:0; margin:0; color:var(--hs-text-2); font-size:var(--text-sm); }
.vid-cc { min-height:44px; flex:none; background:transparent; color:var(--hs-on-accent); border:1px solid var(--hs-edge); font-size:var(--text-sm); }
.vid-cc[aria-pressed="true"] { background:var(--hs-card); color:var(--hs-text); border-color:var(--hs-card); }
.vid-status { margin:0; padding:0 var(--space-4); color:var(--hs-on-accent); background:var(--hs-card-2); font-size:var(--text-sm); }
.vid-status:empty { display:none; }
.vid-stage video::cue { font-size:110%; background:var(--hs-scrim); }
@media (max-width:420px) { .vid-line { display:none; } .vid-foot { justify-content:flex-end; } }
@media (min-width:1024px) {
  dialog.vid-sheet { inset:auto; position:fixed; top:50%; left:50%; transform:translate(-50%,-50%); height:auto; max-height:92vh;
    border-radius:var(--radius-lg); box-shadow:0 24px 80px var(--hs-shadow); }
  dialog.vid-wide { width:min(1040px,90vw); }
  dialog.vid-wide .vid-stage { flex:none; aspect-ratio:16/9; }
  /* explicit sizes: an auto-width modal around a 9:16 video resolves differently per engine before the video's metadata loads */
  dialog.vid-tall { --vid-h:min(78vh,900px); width:max(380px, calc(var(--vid-h) * 9 / 16)); }
  dialog.vid-tall .vid-stage { flex:none; width:100%; height:var(--vid-h); }
}
