/* NITRATE - coming-soon dossier.
 * Sits beside the Sheet but reads differently on purpose: the Sheet is an inventory
 * record of something we hold, this is a case for acquiring something we do not.
 * Colours come only from tokens.css. --accent is reserved for the one action.
 */

.cs-panel{
  position:fixed; inset:0 0 0 auto; width:min(760px,100%);
  background:var(--panel); border-left:1px solid var(--rule);
  display:flex; flex-direction:column; z-index:60;
  box-shadow:-24px 0 48px -24px rgba(0,0,0,.45);
}
.cs-panel[hidden]{display:none}

.cs-bar{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:10px 16px; border-bottom:1px solid var(--rule); background:var(--panel-2);
  flex:0 0 auto;
}
.cs-eyebrow{
  font-family:ui-monospace,Menlo,Consolas,monospace; font-size:10px;
  letter-spacing:.16em; color:var(--accent); font-weight:700;
}
.cs-close{
  font:inherit; font-size:11px; letter-spacing:.1em; text-transform:uppercase;
  background:var(--ground); color:var(--ink-2);
  border:1px solid var(--rule); border-radius:2px; padding:5px 10px; cursor:pointer;
}
.cs-close:hover{color:var(--ink); outline:1px solid var(--rule)}
.cs-body{overflow-y:auto; padding:0 0 40px; flex:1 1 auto}

/* hero ------------------------------------------------------------------- */
.cs-hero{display:flex; gap:18px; padding:20px 18px; position:relative; overflow:hidden}
.cs-hero.has-shot::before{
  content:''; position:absolute; inset:0;
  background-image:var(--shot); background-size:cover; background-position:center 22%;
  opacity:.16; filter:saturate(.7);
}
.cs-hero.has-shot::after{
  content:''; position:absolute; inset:0;
  background:linear-gradient(180deg,transparent,var(--panel) 88%);
}
.cs-art{position:relative; z-index:1; flex:0 0 132px}
.cs-art img{width:132px; border-radius:2px; border:1px solid var(--rule); display:block}
.cs-head{position:relative; z-index:1; min-width:0; flex:1 1 auto}
.cs-title{font-size:26px; font-weight:800; letter-spacing:-.02em; line-height:1.08; margin:0 0 4px}
.cs-tag{margin:0 0 10px; font-size:13px; font-style:italic; color:var(--muted); max-width:44ch}

.cs-when{display:flex; align-items:baseline; gap:8px; flex-wrap:wrap; margin:10px 0 12px}
.cs-days{
  font-family:ui-monospace,Menlo,monospace; font-variant-numeric:tabular-nums;
  font-size:32px; font-weight:700; color:var(--accent); line-height:1;
}
.cs-days-l{font-size:11px; letter-spacing:.12em; text-transform:uppercase; color:var(--muted)}
.cs-rel{
  font-family:ui-monospace,Menlo,monospace; font-size:11px; color:var(--ink-2);
  margin-left:auto;
}

.cs-chips{display:flex; flex-wrap:wrap; gap:5px}
.cs-chip{
  font-family:ui-monospace,Menlo,monospace; font-size:10.5px;
  padding:2px 7px; border:1px solid var(--rule); border-radius:2px;
  color:var(--ink-2); background:var(--ground);
}
.cs-chip-score{color:var(--ink)}

/* the action ------------------------------------------------------------- */
.cs-action{
  margin:6px 18px 18px; padding:14px 16px;
  border:1px solid var(--rule); border-radius:3px; background:var(--ground);
}
.cs-action.is-have{opacity:.85}
.cs-state{
  font-family:ui-monospace,Menlo,monospace; font-size:11px; letter-spacing:.12em;
  font-weight:700; color:var(--ink);
}
.cs-action.is-pending .cs-state{color:var(--warn)}
.cs-action.is-have .cs-state{color:var(--ok)}

.cs-queue{
  font:inherit; font-size:13px; font-weight:650; letter-spacing:.02em;
  background:var(--accent); color:var(--accent-ink);
  border:1px solid var(--accent); border-radius:2px;
  padding:9px 18px; cursor:pointer;
}
.cs-queue:hover:not(:disabled){filter:brightness(1.08)}
.cs-queue:disabled{opacity:.6; cursor:default}
.cs-note{margin:8px 0 0; font-size:12.5px; color:var(--ink-2); max-width:60ch}
.cs-note.is-bad{color:var(--crit)}

.cs-rules{margin-top:12px; padding-top:10px; border-top:1px solid var(--rule)}
.cs-rules-h{
  font-family:ui-monospace,Menlo,monospace; font-size:9.5px; letter-spacing:.14em;
  color:var(--muted); display:block; margin-bottom:6px;
}
.cs-rules-b{display:flex; flex-wrap:wrap; gap:4px}
.cs-rule{
  font-family:ui-monospace,Menlo,monospace; font-size:10px;
  padding:2px 6px; border:1px solid var(--rule); border-radius:2px; color:var(--muted);
}
.cs-rule.ok{color:var(--ink-2)}
.cs-rule.pref{color:var(--ok); border-color:color-mix(in srgb,var(--ok) 45%,transparent)}
.cs-rule.no{color:var(--crit); border-color:color-mix(in srgb,var(--crit) 35%,transparent)}

/* body ------------------------------------------------------------------- */
.cs-h{
  font-family:ui-monospace,Menlo,monospace; font-size:10px; letter-spacing:.16em;
  color:var(--muted); font-weight:700; margin:20px 18px 8px;
  padding-bottom:6px; border-bottom:1px solid var(--rule);
}
.cs-prose{margin:0 18px; font-size:13.5px; line-height:1.62; color:var(--ink-2); max-width:66ch}

.cs-facts{margin:0 18px}
.cs-row{display:flex; gap:14px; padding:5px 0; border-bottom:1px solid color-mix(in srgb,var(--rule) 50%,transparent)}
.cs-k{
  flex:0 0 108px; font-family:ui-monospace,Menlo,monospace; font-size:10px;
  letter-spacing:.1em; color:var(--muted); padding-top:2px;
}
.cs-v{font-size:13px; color:var(--ink-2)}

.cs-cast{display:flex; gap:10px; overflow-x:auto; padding:2px 18px 6px}
.cs-actor{flex:0 0 92px; display:flex; flex-direction:column; gap:3px}
.cs-face{
  width:92px; height:132px; border-radius:2px; overflow:hidden;
  background:var(--panel-2); border:1px solid var(--rule);
}
.cs-face img{width:100%; height:100%; object-fit:cover; display:block}
.cs-actor-n{font-size:11.5px; color:var(--ink); font-weight:600; line-height:1.25}
.cs-actor-c{font-size:10.5px; color:var(--muted); line-height:1.25}

.cs-links{display:flex; gap:8px; flex-wrap:wrap; margin:18px 18px 0}
.cs-link{
  font-family:ui-monospace,Menlo,monospace; font-size:11px;
  padding:4px 9px; border:1px solid var(--rule); border-radius:2px;
  color:var(--ink-2); text-decoration:none;
}
.cs-link:hover{color:var(--accent); outline:1px solid var(--rule)}

.cs-loading{padding:40px 18px; color:var(--muted); font-size:13px}

:where(.cs-panel) :focus-visible{outline:2px solid var(--accent); outline-offset:2px}
@media (prefers-reduced-motion:reduce){.cs-panel{transition:none}}
@media (max-width:820px){
  .cs-panel{width:100%}
  .cs-hero{flex-direction:column}
  .cs-art,.cs-art img{width:108px}
}

/* ==========================================================================
   THE DOSSIER IN THE HAND  (<= 760px, the house mobile tier — MOBILE_SPEC §1;
   it was written at 720 and is folded here, which is the only change to it)
   This panel is already full-bleed below 820px, so nothing here is a
   re-layout.  What it is: the controls, and the figures.
     - QUEUE IT is the whole reason the panel exists and it stood 36px high.
     - the close cross, and the four external links at the foot, stood at 25px
       on a surface that covers the entire screen — the close is the only way
       out and it was the smallest thing on it.
     - the fact table is a 108px label column against a 390px screen, which
       leaves 232px for a studio list.  The rows stack instead: label over
       value, which is what a fact table becomes when it runs out of width.
     - the mono figures were 9.5-10.5px throughout, a desk size.
   ========================================================================== */
@media (max-width:760px){
  /* 🔴 THE PANEL IS FIXED AND IT TOUCHES ALL FOUR EDGES (spec §4.4).  It is
     z-60 and covers the shell's tab bar, so it owes the HARDWARE insets
     itself: without this the close cross and the eyebrow sit under the notch
     on a 14/15/16 Pro, and in landscape the whole dossier runs under the
     rounded corner.  env() is 0 in every desktop browser and 0 in the
     screenshot harness, so this costs nothing anywhere it is not needed.
     ⛔ It does NOT add --shell-tabbar: the panel is over the bar, not under
     it, and the body's own bottom padding below already carries the inset. */
  .cs-panel{
    padding-top:var(--safe-t, 0px);
    padding-left:var(--safe-l, 0px);
    padding-right:var(--safe-r, 0px);
  }

  .cs-bar{padding:9px 14px}
  .cs-eyebrow{font-size:11px}
  .cs-close{min-height:44px; padding:6px 14px; font-size:12px}

  .cs-hero{gap:14px; padding:16px 14px}
  .cs-title{font-size:23px}
  .cs-tag{font-size:12.5px}
  .cs-days{font-size:34px}
  .cs-days-l{font-size:11px}
  .cs-rel{font-size:11px; margin-left:0}
  .cs-chip{font-size:11px; padding:3px 8px}

  .cs-action{margin:6px 14px 16px; padding:14px}
  .cs-state{font-size:12px}
  .cs-queue{min-height:48px; width:100%; font-size:14px; padding:10px 18px}
  .cs-note{font-size:12.5px}
  .cs-rules-h{font-size:11px}
  .cs-rule{font-size:11px; padding:3px 7px}

  .cs-h{margin:18px 14px 8px; font-size:11px}
  .cs-prose{margin:0 14px; font-size:13px}

  /* the fact table stacks: at 390px a 108px label column is a third of the
     screen spent on the word STUDIO */
  .cs-facts{margin:0 14px}
  .cs-row{display:block; padding:8px 0}
  .cs-k{display:block; flex:none; font-size:11px; padding-top:0; margin-bottom:2px}
  .cs-v{display:block; font-size:13px}

  .cs-cast{padding:2px 14px 6px}
  .cs-actor-n{font-size:12px}
  .cs-actor-c{font-size:11px}

  .cs-links{margin:16px 14px 0; gap:8px}
  .cs-link{min-height:44px; display:inline-flex; align-items:center; padding:6px 12px; font-size:12px}

  .cs-trailer{margin:0 14px}
  .cs-play{min-height:48px; font-size:14px; padding:10px 20px}
  .cs-loading{padding:32px 14px}
  /* the dossier is z-60 and covers the shell's bottom bar, so it owes the
     hardware inset, not the bar */
  .cs-body{padding-bottom:calc(40px + env(safe-area-inset-bottom, 0px))}
}

/* trailer — click to play, so the panel never phones YouTube unasked */
.cs-trailer{
  margin:0 18px; aspect-ratio:16/9; border:1px solid var(--rule); border-radius:3px;
  background-size:cover; background-position:center; overflow:hidden;
  display:flex; align-items:center; justify-content:center; position:relative;
}
.cs-trailer::after{content:''; position:absolute; inset:0; background:rgba(0,0,0,.34)}
.cs-trailer iframe{width:100%; height:100%; border:0; position:relative; z-index:2}
.cs-play{
  position:relative; z-index:3; font:inherit; font-size:13.5px; font-weight:650;
  background:var(--accent); color:var(--accent-ink); border:1px solid var(--accent);
  border-radius:2px; padding:10px 20px; cursor:pointer;
}
.cs-play:hover{filter:brightness(1.08)}
.cs-esc{margin:8px 18px 0}
