  :root {
    --bg: #0d0f12;
    --panel: #14171c;
    --panel2: #1a1e25;
    --border: #262b33;
    --text: #e8eaed;
    --muted: #8b929e;
    --accent: #6a8ff5;
    --ok: #48a179;
    --bad: #e8646a;
    --warn: #f1a55b;
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  body {
    background: var(--bg);
    color: var(--text);
    font: 14px/1.45 -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  }
  button { font: inherit; color: inherit; background: var(--panel2); border: 1px solid var(--border); border-radius: 7px; padding: 5px 11px; cursor: pointer; }
  button:hover { border-color: #3a4250; }
  input, select { font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; }
  input:focus { outline: none; border-color: var(--accent); }
  a { color: var(--accent); text-decoration: none; }
  a:hover { text-decoration: underline; }

  header {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 14px 22px; background: rgba(13,15,18,.92); backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--border);
  }
  .brand h1 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: .2px; }
  .brand .sub { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1.4px; }
  .viewtoggle { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
  .viewtoggle button { border: none; border-radius: 0; background: transparent; padding: 6px 14px; color: var(--muted); }
  .viewtoggle button.active { background: var(--panel2); color: var(--text); }
  .counts { display: flex; gap: 6px; flex-wrap: wrap; }
  .countchip { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; background: var(--panel); }
  .countchip b { color: var(--text); font-weight: 600; margin-left: 4px; }
  .spacer { flex: 1; }
  .synced { font-size: 12px; color: var(--muted); }

  main { padding: 20px 22px 80px; max-width: 1500px; margin: 0 auto; }

  footer {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
    display: flex; align-items: center; gap: 10px;
    padding: 8px 22px; background: rgba(13,15,18,.94); backdrop-filter: blur(6px);
    border-top: 1px solid var(--border); overflow-x: auto; white-space: nowrap;
  }
  .ftlabel { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); flex: none; }

  /* ---- spreadsheet ---- */
  .tablewrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
  table { border-collapse: collapse; width: 100%; min-width: 1050px; }
  th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); }
  td { padding: 8px 12px; border-bottom: 1px solid #1d222a; vertical-align: middle; }
  tr.grouphead td { background: var(--panel2); font-weight: 650; font-size: 12.5px; padding: 7px 12px; border-bottom: 1px solid var(--border); color: var(--text); }
  tr.grouphead .gcount { color: var(--muted); font-weight: 400; margin-left: 8px; }
  tr.grouphead .ghadd { margin-left: 12px; font-size: 11px; font-weight: 500; padding: 2px 9px; border: 1px dashed var(--border); border-radius: 999px; color: var(--muted); background: none; cursor: pointer; vertical-align: 1px; }
  tr.grouphead .ghadd:hover { border-style: solid; border-color: var(--accent); color: var(--accent); }
  tr.taskrow:hover td { background: #171b21; }
  tr.taskrow.leaving { opacity: 0; transform: translateX(30px); transition: all .25s ease; }
  tr.taskrow td { transition: background .1s; }
  td.empty { color: var(--muted); font-style: italic; padding: 10px 12px; }

  .tracker { display: flex; align-items: center; gap: 3px; }
  /* WCAG 2.5.8: 24px transparent hit host; the 15px circle is drawn by ::before so the visual is unchanged.
     negative margin absorbs the extra so the tracker row keeps its footprint. */
  .tick { position: relative; width: 24px; height: 24px; border: 0; background: none; padding: 0; margin: -4px; cursor: pointer; flex: none; }
  .tick::before { content: ''; position: absolute; top: 50%; left: 50%; width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid #3a4250; background: transparent; transform: translate(-50%, -50%); transition: transform .1s; }
  .tick.done::before { background: var(--ok); border-color: var(--ok); }
  .tick.filmtick::before { border-color: #5b6575; }
  .tick:hover::before { border-color: var(--accent); transform: translate(-50%, -50%) scale(1.15); }
  .tickline { width: 7px; height: 1.5px; background: #2c333d; flex: none; }

  .tname { cursor: pointer; border-radius: 5px; padding: 2px 4px; }
  .tname:hover { background: #1d232c; }
  .linkout { color: var(--muted); font-size: 12px; margin-left: 5px; text-decoration: none; }
  .linkout:hover { color: var(--accent); text-decoration: none; }

  .chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 10px; border-radius: 999px; border: 1px solid; cursor: pointer; white-space: nowrap; }
  .chip .dot { width: 7px; height: 7px; border-radius: 50%; }
  .chip.none { color: var(--muted); border-color: var(--border); border-style: dashed; }
  .prichip { display: inline-block; font-size: 10.5px; color: var(--warn); border: 1px solid var(--warn); border-radius: 4px; padding: 0 5px; margin-left: 7px; vertical-align: 1px; }

  .cellval { display: inline-flex; align-items: center; gap: 6px; max-width: 190px; }
  .cellval .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; display: inline-block; }
  .pencil { background: none; border: none; padding: 0 2px; color: var(--muted); font-size: 12px; cursor: pointer; opacity: .5; }
  tr:hover .pencil { opacity: 1; }
  .addtext { color: var(--muted); cursor: pointer; font-size: 12.5px; }
  .addtext:hover { color: var(--text); }

  input.datein { color-scheme: dark; font-size: 12.5px; padding: 3px 6px; }
  .shootbadge { display: inline-block; margin-top: 4px; font-size: 11px; color: var(--ok); border: 1px solid var(--ok); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }

  .markfilmed { background: #1f2a22; border-color: #2f4a38; color: #7dd8a2; font-size: 12px; padding: 3px 10px; }
  .markfilmed:hover { border-color: var(--ok); }

  tr.rejhead td { color: var(--muted); cursor: pointer; background: var(--panel); }
  tr.rejhead td:hover { color: var(--text); }
  tr.rejected td { color: var(--muted); }

  .newrow td { background: var(--panel2); }
  .newrow input { width: 280px; }

  .edit-input { width: 95%; min-width: 120px; }

  /* ---- dropdown ---- */
  .dropdown { position: fixed; z-index: 280; background: var(--panel2); border: 1px solid var(--border); border-radius: 9px; padding: 5px; box-shadow: 0 10px 30px rgba(0,0,0,.5); min-width: 160px; }
  .dropdown button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: none; border-radius: 6px; padding: 6px 9px; }
  .dropdown button:hover { background: #242a34; }
  .dropdown .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
  .dropdown button.clear { color: var(--muted); }

  /* ---- ideas board ---- */
  .ideasgrid { columns: 3 320px; column-gap: 16px; }
  .ideacard { break-inside: avoid; margin: 0 0 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); padding: 14px 16px; }
  .ideahead { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); margin-bottom: 8px; flex-wrap: wrap; }
  .ideahead .spacer { flex: 1; }
  .srcbadge { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; border: 1px solid; border-radius: 4px; padding: 1px 6px; flex: none; }
  .srcbadge.asana { color: #f2848b; border-color: #f2848b55; }
  .srcbadge.slack { color: #8fd0a8; border-color: #8fd0a855; }
  .ideatitle { font-weight: 650; font-size: 14.5px; line-height: 1.4; margin: 2px 0 6px; overflow-wrap: anywhere; white-space: pre-wrap; }
  .ideacommentary { font-size: 13px; margin: 2px 0 6px; overflow-wrap: anywhere; white-space: pre-wrap; }
  .ideachips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
  .ideafoot { margin-top: 10px; font-size: 12px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
  .syncchip { font-size: 11px; color: var(--ok); border: 1px solid var(--ok); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
  .syncchip:hover { text-decoration: none; filter: brightness(1.2); }
  .unsyncx { background: none; border: none; color: var(--muted); font-size: 15px; padding: 0 3px; line-height: 1; }
  .unsyncx:hover { color: var(--bad); }
  .syncnow { font-size: 11.5px; padding: 2px 9px; border-color: var(--accent); color: var(--accent); }
  .linkrow, .filerow { font-size: 12.5px; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .embed { border: 1px solid var(--border); border-radius: 9px; overflow: hidden; margin: 8px 0 2px; background: var(--panel2); }
  .embed.skel { height: 74px; background: linear-gradient(100deg, var(--panel2) 40%, #232933 50%, var(--panel2) 60%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
  @keyframes shimmer { to { background-position: -200% 0; } }
  .embed a.embedlink { display: block; color: inherit; }
  .embed a.embedlink:hover { text-decoration: none; background: #1d232c; }
  .embed img { width: 100%; max-height: 220px; object-fit: cover; display: block; }
  .embedbody { padding: 9px 11px; }
  .embedtitle { font-weight: 600; font-size: 13px; line-height: 1.35; }
  .embeddesc, .embedquote { color: var(--muted); font-size: 12px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .embedquote { font-style: italic; color: var(--text); -webkit-line-clamp: 5; }
  .embedmeta { color: var(--muted); font-size: 11px; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .embedplatform { font-weight: 700; font-size: 15px; letter-spacing: .3px; }
  .ideabanner { display: flex; align-items: center; gap: 14px; border: 1px solid var(--warn); color: var(--warn); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: 13px; flex-wrap: wrap; }
  .ideabanner button { border-color: var(--warn); color: var(--warn); }
  .setupnotice { border: 1px dashed var(--border); border-radius: 12px; padding: 14px 18px; margin-bottom: 16px; color: var(--muted); font-size: 13px; }
  .setupnotice .suhead { color: var(--text); font-weight: 650; margin-bottom: 6px; }
  .setupnotice ol { margin: 6px 0; padding-left: 20px; }
  .setupnotice li { margin: 3px 0; }
  .errstrip { border: 1px solid var(--bad); color: var(--bad); border-radius: 10px; padding: 8px 12px; margin-bottom: 16px; font-size: 12.5px; }

  /* ---- inspiration board ---- */
  .inspobar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
  .inspobar select, .inspobar input { padding: 5px 8px; font-size: 13px; }
  .inspobar input.minviews { width: 84px; }
  .inspobar input.numflt { width: 74px; }
  .inspobar input.vsearch { width: 180px; }
  .inspobar label.ckflt { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
  .inspobar .showcount { font-size: 12px; color: var(--muted); }
  .inspobar .clrflt { font-size: 12px; padding: 3px 10px; border-color: var(--warn); color: var(--warn); }
  .inspobar .bulkbtn { font-size: 12.5px; }
  .inspobar .stopbtn { font-size: 12.5px; border-color: var(--bad); color: var(--bad); }
  .savedchips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
  .savedchips .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
  .savedchip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 6px 3px 11px; border-radius: 999px; border: 1px solid var(--border); background: none; color: var(--text); }
  .savedchip:hover { border-color: var(--accent); }
  .savedchip .sx { background: none; border: none; color: var(--muted); font-size: 13px; padding: 0 2px; line-height: 1; }
  .savedchip .sx:hover { color: var(--bad); }
  .nichechips { display: flex; gap: 6px; flex-wrap: wrap; }
  .nichechip { font-size: 12px; padding: 3px 11px; border-radius: 999px; border: 1px solid var(--border); background: none; color: var(--muted); }
  .nichechip.on { border-color: var(--accent); color: var(--accent); background: rgba(106,143,245,.1); }
  .addchbtn { border-color: var(--accent); color: var(--accent); font-weight: 600; }
  .chstrip { display: flex; gap: 10px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 4px; }
  .crcard { flex: none; display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); padding: 8px 12px; cursor: pointer; min-width: 150px; }
  .crcard:hover { border-color: #3a4250; }
  .crcard.on { border-color: var(--accent); background: rgba(106,143,245,.08); }
  .crcard .crtop { display: flex; align-items: center; gap: 6px; }
  .crcard .crname { font-weight: 600; font-size: 13px; }
  .crcard .crmeta { font-size: 11px; color: var(--muted); }
  .crcard .rmch { background: none; border: none; color: var(--muted); font-size: 14px; padding: 0 2px; margin-left: auto; }
  .crcard .rmch:hover { color: var(--bad); }
  .crnote { font-size: 10.5px; color: var(--warn); display: flex; align-items: center; gap: 4px; }
  .crnote .rmch { margin-left: 0; font-size: 12px; }
  .video-crop { position: relative; width: 100%; aspect-ratio: 9/16; max-height: 72vh; overflow: hidden; border-radius: 10px; background: #000; }
  .video-crop iframe { position: absolute; left: 0; width: 100%; border: none; background: #000; }
  /* assignee avatars (Asana members) */
  .avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; overflow: hidden; font-size: 10px; font-weight: 700; color: #fff; background: #333; vertical-align: middle; flex: none; line-height: 1; }
  .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .avatar.none { background: none; border: 1px dashed var(--border); color: var(--muted); font-weight: 400; }
  .assigncell { text-align: center; }
  .assignav { cursor: pointer; }
  .assignav:hover { outline: 2px solid var(--accent); outline-offset: 1px; }
  .assignpop { position: fixed; z-index: 400; background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 34px rgba(0,0,0,.5); padding: 6px; width: 216px; max-height: 300px; overflow-y: auto; }
  .assignpop-h { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; padding: 4px 8px 6px; }
  .assignpop-list { display: flex; flex-direction: column; gap: 1px; }
  .assignloading { color: var(--muted); font-size: 12px; padding: 8px; }
  .assignopt { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: none; color: var(--text); font-size: 13px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
  .assignopt:hover { background: var(--panel); }
  .assignopt.cur { color: var(--accent); }

  /* themed shoot-date picker */
  .setdate { background: none; border: 1px dashed var(--border); color: var(--muted); font-size: 11px; border-radius: 999px; padding: 3px 11px; cursor: pointer; white-space: nowrap; }
  .setdate:hover { border-color: var(--accent); color: var(--accent); }
  .datepop { position: fixed; z-index: 400; background: var(--panel2); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.55); padding: 10px; width: 236px; }
  .dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
  .dp-title { font-size: 13px; font-weight: 600; }
  .dp-nav { background: none; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); width: 26px; height: 26px; cursor: pointer; font-size: 15px; line-height: 1; }
  .dp-nav:hover { color: var(--text); border-color: var(--accent); }
  .dp-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 3px; }
  .dp-wd { text-align: center; font-size: 10px; color: var(--muted); }
  .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
  .dp-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: none; border: none; border-radius: 7px; color: var(--text); font-size: 12.5px; cursor: pointer; padding: 0; }
  .dp-day:hover { background: var(--panel); }
  .dp-day.empty { visibility: hidden; cursor: default; }
  .dp-day.today { outline: 1px solid var(--accent); outline-offset: -1px; }
  .dp-day.sel { background: var(--accent); color: #0d0f12; font-weight: 700; }

  /* themed pick buttons + dropdown menu (locations / members / dates / time) */
  .cellpick { display: inline-flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--border); color: var(--text); font-size: 13px; padding: 5px 10px; border-radius: 7px; cursor: pointer; text-align: left; white-space: nowrap; max-width: 100%; overflow: hidden; }
  .pickname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cellpick:hover { border-color: var(--accent); }
  .cellpick.ph { color: var(--muted); }
  .cellpick.full { width: 100%; padding: 8px 10px; }
  .menupop { position: fixed; z-index: 400; background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 34px rgba(0,0,0,.5); padding: 6px; width: 244px; max-height: 320px; overflow-y: auto; }
  .menupop-h { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; padding: 4px 8px 6px; }
  .menupop-list { display: flex; flex-direction: column; gap: 1px; }
  .menuopt { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: none; border: none; color: var(--text); font-size: 13px; padding: 7px 8px; border-radius: 6px; cursor: pointer; }
  .menuopt:hover { background: var(--panel); }
  .menuopt.cur { color: var(--accent); }
  .menuopt-txt { display: flex; flex-direction: column; min-width: 0; }
  .menuopt-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .menuopt-sub { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .menupop-new { display: flex; gap: 6px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
  .menupop-new input { flex: 1; min-width: 0; padding: 6px 8px; }
  .menuadd { border: 1px solid var(--accent); color: var(--accent); background: none; border-radius: 6px; width: 30px; cursor: pointer; }

  /* call-sheet card fill bar + nav user chip / icon button */
  .csfill { margin-top: 12px; }
  .csfill-track { height: 6px; background: var(--panel); border-radius: 999px; overflow: hidden; }
  .csfill-bar { height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s; }
  .csfill-bar.over { background: var(--bad); }
  .csfill-lbl { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-top: 5px; }
  .userchip { display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px 3px 4px; border-radius: 999px; }
  .userchip-name { font-size: 13px; }
  .iconbtn { font-size: 15px; line-height: 1; padding: 5px 10px; }
  /* a11y: consistent visible keyboard focus + honor reduced-motion */
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  }
  /* WCAG 2.5.8 target size — give small controls a >=24px hit box. The icon buttons are transparent
     (no bg/border) so min-size + centering changes nothing visible; .csvlink/.csvrm/.csbmove use padding
     + negative margin so surrounding layout doesn't shift. Checkboxes get transparent padding. */
  .rmch, .irm, .x, .csvrm, .csbmove { min-width: 24px; min-height: 24px; display: inline-flex; align-items: center; justify-content: center; }
  .csvlink { display: inline-block; padding: 4px 0; margin: -4px 0; }
  .csbmove, .csvrm { margin-top: -3px; margin-bottom: -3px; }
  /* native checkboxes ignore padding, so they can't reach 24px without appearance:none — draw a compact
     16px box inside a 24px hit host (checkmark on :checked). Themed to match the app's dark controls. */
  input[type="checkbox"] { -webkit-appearance: none; appearance: none; width: 24px; height: 24px; margin: 0; padding: 0; border: 0; background: none; position: relative; cursor: pointer; flex: none; vertical-align: middle; }
  input[type="checkbox"]::before { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 16px; height: 16px; border: 1.5px solid #3a4250; border-radius: 4px; background: var(--panel2); box-sizing: border-box; }
  input[type="checkbox"]:checked::before { background: var(--accent); border-color: var(--accent); }
  input[type="checkbox"]:checked::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-62%, -72%) rotate(45deg); width: 4px; height: 8px; border: solid #0d0f12; border-width: 0 2px 2px 0; }

  /* Asana sign-in overlay (production) */
  .signinoverlay { position: fixed; inset: 0; z-index: 1000; background: var(--bg); display: flex; align-items: center; justify-content: center; }
  .signinbox { text-align: center; padding: 40px; max-width: 420px; }
  .signinbrand { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
  .signinsub { color: var(--muted); margin-bottom: 26px; line-height: 1.5; }
  .signinbtn { display: inline-block; background: var(--accent); color: #0d0f12; font-weight: 700; padding: 11px 24px; border-radius: 10px; text-decoration: none; }
  .signinbtn:hover { filter: brightness(1.08); }
  .signinerr { color: var(--bad); margin-top: 18px; font-size: 13px; }

  /* inspiration grid — real CSS grid (row-major, aligned tracks) so a taller card (e.g. promoted "✓ Idea")
     never reflows the others the way CSS multi-column masonry did; one extra column at 1280–1500px */
  .vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
  @media (min-width: 1280px) and (max-width: 1500px) { .vgrid { grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); } }
  .vcard { margin: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); overflow: hidden; }
  .anbadge { font-size: 9.5px; font-weight: 700; color: var(--ok); border: 1px solid var(--ok); border-radius: 999px; padding: 0 7px; flex: none; }
  .outbadge.gl { border-color: var(--accent); color: var(--accent); background: rgba(106,143,245,.12); }
  .vtile { position: relative; display: block; width: 100%; aspect-ratio: 9/12; background: #191d24 center/cover no-repeat; border: none; cursor: pointer; padding: 0; border-radius: 0; }
  .vtile .playov { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.18); transition: background .15s; }
  .vtile:hover .playov { background: rgba(0,0,0,.32); }
  .vtile .playov span { width: 46px; height: 46px; border-radius: 50%; background: rgba(13,15,18,.75); border: 1px solid rgba(255,255,255,.35); color: #fff; font-size: 18px; display: flex; align-items: center; justify-content: center; padding-left: 4px; }
  .vbody { padding: 12px 14px 14px; }
  .vhead { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
  .platbadge { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; border: 1px solid; border-radius: 4px; padding: 1px 6px; flex: none; }
  .platbadge.instagram { color: #e37bd0; border-color: #e37bd055; }
  .platbadge.tiktok { color: #4ecde6; border-color: #4ecde655; }
  .vauthor { font-weight: 600; color: var(--text); }
  .vniche { font-size: 10.5px; border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; }
  .vmetrics { display: flex; gap: 8px 10px; font-size: 12px; color: var(--muted); margin: 8px 0 2px; flex-wrap: wrap; }
  .vgrid .vmetrics { gap: 6px 9px; font-size: 11.5px; }
  .vgrid .vmetrics .stats { display: flex; gap: 9px; flex: 1 1 100%; }
  .vmetrics b { color: var(--text); font-weight: 600; }
  .outbadge { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 9px; border: 1px solid var(--border); color: var(--muted); }
  .outbadge.hot { border-color: var(--warn); color: var(--warn); background: rgba(241,165,91,.1); }
  .vcaption { font-size: 12.5px; margin-top: 7px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
  .vfoot { margin-top: 9px; font-size: 12px; }
  .vactions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; }
  .vactions button { font-size: 12px; padding: 3px 10px; }
  .vactions .toidea { border-color: var(--ok); color: #7dd8a2; background: #1f2a22; }
  .ideadonechip { font-size: 11.5px; color: var(--ok); border: 1px solid var(--ok); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
  .ideadonechip:hover { text-decoration: none; filter: brightness(1.2); }

  /* ---- shared dynamic overlays (video popup / transcript / why-viral / channels) ---- */
  .ovl { position: fixed; inset: 0; z-index: 320; background: rgba(0,0,0,.62); display: flex; align-items: center; justify-content: center; padding: 20px; }
  .ovl .modal { max-height: 90vh; overflow-y: auto; }
  .ovl.slideover { justify-content: flex-end; padding: 0; }
  .ovl.slideover .modal { width: min(440px, 94vw); height: 100%; max-height: none; border-radius: 0; border-top: none; border-bottom: none; border-right: none; }
  .ovlhead { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
  .ovlhead h2 { margin: 0; font-size: 16px; flex: 1; }
  .ovlhead .x { background: none; border: none; color: var(--muted); font-size: 17px; padding: 0 4px; }
  .ovlhead .x:hover { color: var(--text); }
  .vpop { width: min(860px, 94vw); display: flex; gap: 18px; flex-wrap: wrap; }
  .vpop .playerbox { flex: 1 1 300px; min-width: 260px; }
  .vpop .playerbox iframe { width: 100%; aspect-ratio: 9/16; max-height: 72vh; border: none; border-radius: 10px; background: #000; }
  .vpop .playerbox video { width: 100%; aspect-ratio: 9/16; max-height: 72vh; border-radius: 10px; background: #000; }
  .vpop .playerbox .video-crop iframe { max-height: none; border-radius: 0; } /* let the cropped iframe oversize so top+bottom chrome actually clips */
  .vpop .vpside { flex: 1 1 260px; min-width: 240px; font-size: 13px; }
  /* narrow: player + side stack, so shrink the video enough that the metrics land above the fold */
  @media (max-width: 560px) {
    .vpop { gap: 10px; }
    .vpop .playerbox video, .vpop .playerbox iframe, .vpop .playerbox .video-crop { max-height: 46vh; }
  }
  .vpop .fallbackrow { margin-top: 8px; font-size: 12px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; color: var(--muted); }
  .transbody { white-space: pre-wrap; font-size: 13px; line-height: 1.6; max-height: 55vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; background: var(--panel); }
  .viralbody { white-space: pre-wrap; font-size: 13px; line-height: 1.6; }
  .chrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #1d222a; font-size: 13px; }
  .chrow:last-child { border-bottom: none; }
  .chrow .chname { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .chrow .chmeta { color: var(--muted); font-size: 12px; flex: none; }
  .chrow .rmch { background: none; border: none; color: var(--muted); font-size: 15px; padding: 0 4px; }
  .chrow .rmch:hover { color: var(--bad); }

  /* ---- tracked-video workspace (wide popup: player + tabs + action rail) ---- */
  .vpop.vwide { width: min(1040px, 96vw); }
  .vpop.vwide .vpside { flex: 1 1 420px; min-width: 300px; }
  .vwshead { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
  .vwshead .spacer { flex: 1; }
  .vwshead .x { background: none; border: none; color: var(--muted); font-size: 17px; padding: 0 4px; }
  .vwshead .x:hover { color: var(--text); }
  .vsummary { border: 1px solid var(--border); border-radius: 8px; background: var(--panel); padding: 10px 12px; margin: 12px 0; font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
  .vtabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-top: 10px; }
  .vtab { background: none; border: none; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); padding: 6px 9px; font-size: 12.5px; }
  .vtab:hover { color: var(--text); border-color: var(--border); }
  .vtab.on { color: var(--text); border-bottom-color: var(--accent); }
  .vtabbody { font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 34vh; overflow-y: auto; padding: 12px 2px 4px; }
  .vtabbody.empty { color: var(--muted); white-space: normal; }
  .wcchip { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; margin-left: 8px; }
  .vcapblock { margin-top: 10px; }
  .vcapblock .vcaption { -webkit-line-clamp: unset; display: block; }
  .vrail { display: flex; flex-direction: column; gap: 3px; margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
  .vrailrow { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; background: none; border: 1px solid transparent; border-radius: 8px; padding: 7px 9px; color: var(--text); font-size: 13px; }
  .vrailrow:hover:not(:disabled) { background: var(--panel2); border-color: var(--border); }
  .vrailrow:disabled { opacity: .4; cursor: not-allowed; }
  .vrailrow .kkey { flex: none; width: 20px; height: 20px; border: 1px solid var(--border); border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--muted); }
  .vrailrow.done { color: var(--ok); }
  .vrailrow.done .kkey { color: var(--ok); border-color: var(--ok); }
  .vrailrow.danger:hover:not(:disabled) { border-color: var(--bad); color: var(--bad); }

  /* ---- call sheet view ---- */
  .callwrap { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
  .callcards { flex: 2 1 620px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
  .callcard { border: 1px solid var(--border); border-radius: 12px; background: var(--panel); padding: 18px 20px; }
  .callcard header.ch { position: static; display: flex; align-items: baseline; gap: 12px; padding: 0 0 12px; background: none; border-bottom: 1px solid var(--border); backdrop-filter: none; }
  .callcard h2 { margin: 0; font-size: 15px; letter-spacing: .4px; }
  .callcard .ch .spacer { flex: 1; }
  .callrow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #1d222a; }
  .callrow:last-child { border-bottom: none; }
  .callrow .num { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); }
  .callrow .cname { font-weight: 600; flex: 1 1 200px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .callrow .links { display: flex; gap: 12px; font-size: 12px; flex: none; }
  .callrow label.filmedbox { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; flex: none; }
  .unsched { flex: 1 1 260px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); padding: 16px 18px; }
  .unsched h3 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
  .unschedrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid #1d222a; }
  .unschedrow:last-child { border-bottom: none; }
  .unschedrow .un { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .emptymsg { color: var(--muted); font-style: italic; padding: 30px; text-align: center; border: 1px dashed var(--border); border-radius: 12px; }
  .print-footer { display: none; }
  /* call-sheet list cards + sheet detail (Slice 1) */
  .callsheetgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
  .cscard { cursor: pointer; }
  .cscard:hover { border-color: #3a4250; }
  .cscard h2 { margin: 0 0 8px; font-size: 15px; }
  .calchip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--accent); border: 1px solid rgba(106,143,245,.4); background: rgba(106,143,245,.1); border-radius: 999px; padding: 3px 10px; cursor: pointer; white-space: nowrap; line-height: 1.15; }
  .calchip:hover { background: rgba(106,143,245,.2); border-color: var(--accent); }
  /* planner tick-to-assign floating bar */
  #assignbar { position: fixed; left: 50%; bottom: 54px; transform: translateX(-50%); z-index: 190; display: flex; align-items: center; gap: 10px; background: var(--panel2); border: 1px solid var(--accent); border-radius: 12px; padding: 8px 14px; box-shadow: 0 10px 34px rgba(0,0,0,.55); }
  #assignbar[hidden] { display: none; }
  #assignbar .abcount { font-weight: 600; font-size: 13px; }
  #assignbar select { font-size: 13px; }
  #assignbar .abassign { border-color: var(--accent); color: var(--accent); font-weight: 600; }
  #assignbar .abclear { color: var(--muted); }
  body.standalone-sheet footer { display: none; } /* keep the top nav so you can always navigate away from a sheet */
  /* call-sheet cards + detail + pickers (Slice 1) */
  .cscard { display: block; text-decoration: none; color: var(--text); border: 1px solid var(--border); border-radius: 12px; background: var(--panel); padding: 16px 18px; }
  .cscard-label { color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
  .cscard-loc { font-size: 12.5px; margin-bottom: 8px; }
  .cscard-meta { display: flex; gap: 10px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
  .cscard-meta .cssynced { color: var(--accent); }
  .cscard-names { display: flex; flex-wrap: wrap; gap: 4px 6px; }
  .csname { font-size: 11px; background: var(--panel2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .csname.more { color: var(--muted); }
  td.selcell { width: 26px; text-align: center; }
  .csdetail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
  .csdetail-head h2 { margin: 0; font-size: 17px; flex: 1; }
  .csback { color: var(--muted); }
  .csvid-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
  .csvid-head h3 { margin: 0; font-size: 14px; flex: 1; }
  .csvidlist { display: flex; flex-direction: column; gap: 6px; }
  .csvidrow { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
  .csvname { flex: 1; font-size: 13px; }
  .csvstage { font-size: 11px; color: var(--muted); }
  .csvrm { color: var(--muted); font-size: 12px; }
  .csform { display: flex; flex-direction: column; gap: 12px; margin: 14px 0 18px; }
  .csform label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
  .csform input { padding: 8px 10px; font-size: 13px; }
  .csradio { display: flex; align-items: center; gap: 14px; font-size: 13px; }
  .csradio .cslabel { font-size: 12px; color: var(--muted); }
  .csfilter { width: 100%; padding: 8px 10px; margin: 6px 0 10px; }
  .cspicklist { max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
  .cspickrow { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
  .cspickrow:hover { background: var(--panel); }
  .cspname { flex: 1; font-size: 13px; }
  .cspstage { font-size: 11px; color: var(--muted); }
  /* call-sheet detail: editable header + tables (Slice 2) */
  .csedit { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 20px; }
  .csedit-f { display: flex; flex-direction: column; gap: 4px; }
  .csedit-f .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
  .csedit-f input { padding: 8px 10px; font-size: 13px; }
  .cstable-wrap { overflow-x: auto; }
  .cstable { width: 100%; border-collapse: collapse; font-size: 13px; }
  .cstable th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; padding: 6px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
  .cstable td { padding: 6px 10px; border-bottom: 1px solid #1d222a; vertical-align: middle; }
  .cstable input { padding: 6px 8px; font-size: 12.5px; }
  /* Slice 4: calendar sync + offline */
  .cssyncbtn { border-color: var(--accent); color: var(--accent); }
  .cssyncbtn:disabled { opacity: .5; cursor: not-allowed; color: var(--muted); border-color: var(--border); }
  .csgcalnote { font-size: 11px; color: var(--warn); cursor: help; }
  .offlinebanner { background: rgba(241,165,91,.12); border: 1px solid var(--warn); color: var(--warn); border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; font-size: 12.5px; }
  /* offline: freeze every mutating control in the Call Sheets view but keep Back + Print (and its sheet) live */
  body.offline #callView input, body.offline #callView select, body.offline #callView textarea,
  body.offline #callView button { opacity: .5; pointer-events: none; }
  body.offline #callView .csdetail-head button { opacity: 1; pointer-events: auto; }
  body.offline #callView .cssyncbtn { opacity: .5; pointer-events: none; }
  @media (max-width: 620px) {
    .csdetail-head { flex-wrap: wrap; }
    .csdetail-head h2 { flex-basis: 100%; font-size: 15px; }
    .cstable { font-size: 12px; }
    .cstable th, .cstable td { padding: 5px 7px; }
  }
  .cscrew { max-width: 640px; margin-bottom: 22px; }
  .cscrew td input { width: 100%; box-sizing: border-box; }
  .cscrew td:nth-child(2) input { width: 110px; }
  .csvideos .csn { min-width: 200px; }
  .csvlink { color: var(--accent); cursor: pointer; text-decoration: none; }
  .csvlink:hover { text-decoration: underline; }
  .csvlink.off { color: var(--muted); cursor: default; }
  .csscript { text-align: center; font-size: 15px; }
  .csprops { width: 140px; }
  .csfilm { text-align: center; }
  .csgroup td { background: var(--panel); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 5px 10px; font-weight: 600; }
  tr.csdone td { opacity: .55; }
  tr.csdone .csvlink { text-decoration: line-through; }
  .csfoot { white-space: nowrap; }
  .csfootchip { color: var(--accent); font-size: 12px; }
  .cspath { font-size: 11.5px; color: var(--muted); }
  .csattach { font-size: 12px; color: var(--accent); border-color: var(--accent); }
  .csvrm { color: var(--muted); font-size: 11.5px; margin-left: 6px; }
  .csrm-cell { text-align: center; }
  .csshade-h { margin: 16px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
  .csshade-row { display: flex; gap: 8px; margin-bottom: 8px; }
  .csshade-row .csfilter { flex: 1; margin: 0; }
  .csshade-info { display: flex; flex-direction: column; gap: 2px; flex: 1; }
  .csshade-note { font-size: 12px; color: var(--muted); margin-top: 14px; }

  /* ---- schedule editor (Slice 3) ---- */
  .csched-empty { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
  .csgen { border-color: var(--accent); color: var(--accent); font-weight: 600; }
  .csched-table { width: 100%; border-collapse: collapse; font-size: 13px; }
  .csched-table > tbody > tr > td { padding: 8px 10px; border-bottom: 1px solid #1d222a; vertical-align: top; }
  .csched-time { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; width: 92px; }
  .csched-time b { color: var(--text); font-weight: 600; }
  .csched-row.videos > td { background: rgba(106,143,245,.04); }
  .csched-row.bufferrow td, .csched-row.endrow td { color: var(--muted); font-style: italic; }
  .csched-row.endrow td { font-style: normal; font-weight: 650; color: var(--text); border-top: 2px solid var(--border); }
  .csbhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .csbtitle { flex: 1; min-width: 120px; font-size: 13px; font-weight: 600; padding: 0 8px; }
  .csbkind { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 7px; }
  .csbmin { width: 128px; display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); }
  .csbmin input { width: 48px; padding: 4px 6px; font-size: 12.5px; }
  .csbmove { color: var(--muted); font-size: 12px; padding: 2px 7px; }
  .csbmove:disabled { opacity: .3; cursor: default; }
  .csbrm { color: var(--muted); font-size: 12px; }
  .csbrm:hover { border-color: var(--bad); color: var(--bad); }
  .csbnote { width: 100%; margin-top: 6px; padding: 5px 8px; font-size: 12px; }
  .csbitems { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
  .csbitem { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
  .csbitem .isc { color: var(--ok); width: 12px; flex: none; }
  .csbitem .isc.no { color: var(--muted); }
  .csbitem .itx { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .csbitem .irm { background: none; border: none; color: var(--muted); font-size: 13px; padding: 0 3px; line-height: 1; cursor: pointer; }
  .csbitem .irm:hover { color: var(--bad); }
  .cstray { border: 1px dashed var(--border); border-radius: 10px; padding: 10px 12px; margin-top: 12px; }
  .cstray .trhead { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 8px; }
  .cstrayrow { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12.5px; flex-wrap: wrap; }
  .cstrayrow .tnm { flex: 1; min-width: 120px; }
  .cstrayrow select { font-size: 12px; padding: 3px 6px; }
  .csaddblock { display: inline-flex; gap: 6px; }
  .csaddblock button { font-size: 12px; }

  /* ---- A4 call-sheet print (Slice 3) ---- */
  .csprint { display: none; }
  /* public view-only call sheet: render the printable sheet on screen as a white document, hide app chrome */
  body.viewonly .viewtoggle, body.viewonly #userchip, body.viewonly #btnRefresh, body.viewonly #synced, body.viewonly footer { display: none; }
  .viewbar { display: flex; align-items: center; gap: 14px; max-width: 820px; margin: 8px auto 0; }
  .viewbar-l { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
  .csprint.onscreen { display: block; max-width: 820px; margin: 12px auto 40px; background: #fff; padding: 36px 42px; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
  @media print {
    @page { size: A4; margin: 14mm; }
    body.csprinting { background: #fff; }
    body.csprinting * { visibility: hidden; }
    body.csprinting .csprint, body.csprinting .csprint * { visibility: visible; }
    body.csprinting .csprint {
      display: block !important; position: absolute; left: 0; top: 0; width: 100%;
      color: #000; background: #fff; font-family: -apple-system, "Helvetica Neue", Arial, sans-serif;
    }
  }
  .csprint h1 { font-size: 22px; margin: 0 0 2px; color: #000; }
  .csprint .cs-session { font-size: 13px; margin-bottom: 16px; color: #000; }
  .csprint h2.cs-sech { font-size: 12px; margin: 16px 0 5px; text-transform: uppercase; letter-spacing: 1px; color: #000; }
  .csprint table { width: 100%; min-width: 0; border-collapse: collapse; margin: 0; font-size: 12px; color: #000; }
  .csprint th, .csprint td { border: 1px solid #000; padding: 5px 8px; text-align: left; vertical-align: top; }
  .csprint th { background: #eee; font-weight: 700; }
  .csprint td.cs-tcell { white-space: nowrap; width: 118px; font-variant-numeric: tabular-nums; }
  .csprint .cs-btitle { font-weight: 700; }
  .csprint ul { margin: 3px 0 0 16px; padding: 0; }
  .csprint .cs-rec { font-style: italic; }
  .csprint .cs-set { margin-top: 3px; }
  .csprint .cs-foot { margin-top: 22px; padding-top: 8px; border-top: 1px solid #000; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: #000; }

  /* ---- modal ---- */
  #modalwrap, #ideawrap { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; }
  #modalwrap[hidden], #ideawrap[hidden] { display: none; }
  .modal { background: var(--panel2); border: 1px solid var(--border); border-radius: 14px; padding: 22px 24px; width: min(480px, 92vw); box-shadow: 0 20px 60px rgba(0,0,0,.6); }
  .modal h2 { margin: 0 0 4px; font-size: 16px; }
  .modal .mtask { color: var(--muted); font-size: 13px; margin-bottom: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .modal input.footin { width: 100%; padding: 8px 10px; margin-bottom: 6px; }
  .softwarn { color: var(--warn); font-size: 12px; min-height: 16px; margin-bottom: 4px; }
  .verifyline { display: flex; align-items: center; gap: 10px; min-height: 28px; margin-bottom: 12px; font-size: 12.5px; }
  .verifyok { color: var(--ok); }
  .verifybad { color: var(--muted); }
  .mbtns { display: flex; justify-content: flex-end; gap: 10px; }
  .mbtns .confirm { background: #1f2a22; border-color: var(--ok); color: #7dd8a2; }
  .mbtns .confirm:disabled { opacity: .4; cursor: not-allowed; }

  /* ---- script doc button ---- */
  .docbtn { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border-radius: 6px; color: var(--accent); border: 1px solid var(--accent); background: transparent; margin-right: 7px; vertical-align: middle; flex: none; }
  .docbtn:hover { border-color: var(--accent); filter: brightness(1.15); }
  .docbtn.has { background: var(--accent); color: #0d0f12; }

  /* ---- ticket workspace (editor + info pane) ---- */
  #editorwrap { position: fixed; inset: 0; z-index: 250; background: rgba(0,0,0,.72); display: flex; flex-direction: row; }
  #editorwrap[hidden] { display: none; }
  .wsmain { display: flex; flex-direction: column; flex: 1 1 62%; min-width: 0; }
  .wsside { flex: 0 0 37%; min-width: 0; overflow-y: auto; background: var(--panel); border-left: 1px solid var(--border); padding: 16px 18px 40px; }
  @media (max-width: 1080px) {
    #editorwrap { flex-direction: column; }
    .wsmain { flex: 1 1 auto; min-height: 0; }
    .wsside { flex: 0 0 auto; max-height: 46vh; border-left: none; border-top: 1px solid var(--border); }
  }
  .wsloading, .wserr { color: var(--muted); font-size: 13px; padding: 20px 4px; }
  .wserr { color: var(--bad); }
  .wshead { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 4px; }
  .wsname { flex: 1; font-weight: 650; font-size: 16px; line-height: 1.35; cursor: text; border-radius: 5px; padding: 2px 4px; overflow-wrap: anywhere; }
  .wsname:hover { background: #1d232c; }
  .wshead .wsbtn { flex: none; background: none; border: 1px solid var(--border); color: var(--muted); font-size: 12px; padding: 3px 8px; }
  .wshead .wsbtn:hover { color: var(--text); border-color: #3a4250; }
  .wssub { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
  .wssec { margin: 14px 0; }
  .wslabel { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 7px; }
  .wsrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
  .wsrow .k { color: var(--muted); font-size: 12px; min-width: 62px; }
  .wsrow .v { font-size: 13px; overflow-wrap: anywhere; }
  .stagepill { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--accent); color: var(--accent); background: rgba(106,143,245,.1); cursor: pointer; }
  .stagepill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
  .wschips { display: flex; gap: 7px; flex-wrap: wrap; }
  .wsembed { margin-top: 8px; }
  .wsactions { display: flex; gap: 8px; align-items: center; margin: 14px 0; }
  .approvebtn { background: #1f2a22; border-color: #2f4a38; color: #7dd8a2; font-weight: 600; }
  .approvebtn:hover { border-color: var(--ok); }
  .archivebtn { background: none; border-color: var(--border); color: var(--muted); font-size: 13px; padding: 5px 9px; }
  .archivebtn:hover { color: var(--bad); border-color: var(--bad); }
  .wscomments { display: flex; flex-direction: column; gap: 12px; }
  .wscomment .cwho { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
  .wscomment .cwho b { color: var(--text); font-weight: 600; }
  .wscomment .ctext { font-size: 13px; overflow-wrap: anywhere; white-space: pre-wrap; }
  .wscbox { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; }
  .wscbox textarea { flex: 1; resize: vertical; min-height: 38px; font: inherit; background: var(--panel2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; }
  .wscbox textarea:focus { outline: none; border-color: var(--accent); }
  .wscompleted { text-decoration: line-through; opacity: .6; }

  /* ---- new-idea form ---- */
  .ideaform { display: flex; flex-direction: column; gap: 11px; margin: 6px 0 16px; }
  .ideaform label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
  .ideaform input, .ideaform select { width: 100%; padding: 7px 9px; color-scheme: dark; }
  /* Discover-channels section (Manage-channels modal) */
  .dischead { margin: 20px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 16px; }
  .disctabs { margin-bottom: 12px; }
  .discpanel { display: flex; flex-direction: column; gap: 8px; }
  .discrow2 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .discin { flex: 1; min-width: 160px; padding: 7px 9px; color-scheme: dark; }
  .discta { width: 100%; padding: 7px 9px; color-scheme: dark; resize: vertical; }
  .discpsel { padding: 7px 9px; color-scheme: dark; }
  .monbtn { flex: none; border-color: var(--accent); color: var(--accent); font-size: 12px; padding: 3px 10px; }
  .monbtn:hover { filter: brightness(1.15); }
  .monbtn:disabled { opacity: .5; cursor: default; }
  .discloading { color: var(--muted); font-size: 12px; font-style: italic; }
  .discsug { margin-top: 4px; }
  .discsugcat { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
  .ideatoolbar { display: flex; align-items: center; margin-bottom: 16px; }
  .newideabtn { border-color: var(--accent); color: var(--accent); font-weight: 600; padding: 6px 14px; }
  .newideabtn:hover { filter: brightness(1.15); }
  .ideaactions { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
  .imgprev { display: flex; align-items: center; gap: 8px; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
  .imgprev img { width: 54px; height: 54px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); flex: none; }
  .imgprev .rm { background: none; border: none; color: var(--muted); font-size: 16px; padding: 0 4px; cursor: pointer; margin-left: auto; }
  .imgprev .rm:hover { color: var(--bad); }

  /* ---- workspace attachments ---- */
  .wsatts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
  .wsatt img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
  .wsatt img:hover { border-color: var(--accent); }
  .wsattfile { font-size: 12.5px; margin: 4px 0; }

  /* ---- ideas-mode workspace: info pane only, as a centered popup (ideas are pre-script) ---- */
  #editorwrap.ideasmode { align-items: center; justify-content: center; padding: 24px; }
  #editorwrap.ideasmode .wsmain { display: none; }
  #editorwrap.ideasmode .wsside { flex: 0 0 auto; width: min(560px, 92vw); max-height: 86vh; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.55); }
  /* two-pane media layout for an Ideas ticket with a video inspo: hero video left, details right */
  #editorwrap.ideasmode .wsside.twopane { width: min(900px, 94vw); display: grid; grid-template-columns: 320px 1fr; gap: 0 30px; align-items: start; }
  .wspane-left { min-width: 0; }
  .wspane-right { min-width: 0; }
  .wspane-right > :first-child { margin-top: 0; }
  @media (max-width: 620px) { #editorwrap.ideasmode .wsside.twopane { grid-template-columns: 1fr; gap: 0; } }

  /* ---- script editor (Google-Docs-like) ---- */
  .edbar { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; padding: 9px 16px; background: var(--panel2); border-bottom: 1px solid var(--border); }
  .edbar button { padding: 4px 9px; font-size: 13px; }
  .edbar button.on { border-color: var(--accent); color: var(--accent); }
  .edtask { font-weight: 650; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: 6px; }
  .edsep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; flex: none; }
  .edscroll { flex: 1; overflow-y: auto; padding: 26px 16px 40px; }
  .edpage { background: #000; color: #fff; caret-color: #fff; max-width: 820px; margin: 0 auto; min-height: calc(100vh - 230px); padding: 60px 72px; border-radius: 4px; box-shadow: 0 10px 44px rgba(0,0,0,.55); font-family: "Courier New", Courier, monospace; font-size: 16px; line-height: 1.7; outline: none; word-wrap: break-word; }
  .edpage h1 { font-size: 26px; margin: .65em 0 .3em; line-height: 1.25; }
  .edpage h2 { font-size: 20px; margin: .65em 0 .3em; line-height: 1.3; }
  .edpage a { color: var(--accent); }
  .edpage hr { border: none; border-top: 1px solid #3a3d43; margin: 14px 0; }
  /* a loaded \n right after a block element would render as a phantom blank line; hide it (the br still saves as \n — bytes unchanged) */
  .edpage :is(h1, h2, ul, ol, hr) + br { display: none; }
  .edpage ul, .edpage ol { margin: 6px 0; padding-left: 26px; }
  .lt-mark { border-bottom: 2px dotted #d3382f; cursor: pointer; }
  .lt-mark.gram { border-bottom-color: #1a63d4; }
  .edfoot { display: flex; align-items: center; gap: 14px; padding: 10px 18px; background: var(--panel2); border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
  /* script studio: generate / compare / copy scripts */
  .studiogrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 6px; }
  .studiocol { border: 1px solid var(--border); border-radius: 10px; background: var(--panel); display: flex; flex-direction: column; min-width: 0; max-height: 62vh; }
  .studiocolhead { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 10px; border-bottom: 1px solid var(--border); }
  .studiocoltitle { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-right: auto; }
  .studiobtn { font-size: 12px; padding: 3px 9px; }
  .studiobtn.primary { border-color: var(--accent); color: var(--accent); }
  .studiobody { padding: 10px 12px; overflow-y: auto; white-space: pre-wrap; font-size: 13px; line-height: 1.55; font-family: "Courier New", Courier, monospace; }
  .studiohint { color: var(--muted); font-style: italic; font-family: system-ui, -apple-system, sans-serif; }
  @media (max-width: 760px) { .studiogrid { grid-template-columns: 1fr; } .studiocol { max-height: 40vh; } }
  #edstate.dirty { color: var(--warn); }
  #edstate.saved { color: var(--ok); }
  #edrecheck { border-color: var(--warn); color: var(--warn); font-size: 12px; padding: 2px 9px; }
  #edsave { border-color: var(--accent); color: var(--accent); }
  #edsave:disabled { opacity: .5; cursor: not-allowed; }

  /* ---- grammar popover ---- */
  #ltpop { position: fixed; z-index: 270; background: #fff; color: #1c1e21; border: 1px solid #d5d9df; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.35); padding: 12px 14px; width: 290px; font-size: 13px; }
  #ltpop[hidden] { display: none; }
  #ltpop .cat { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: #8b929e; margin-bottom: 4px; }
  #ltpop .msg { margin-bottom: 9px; line-height: 1.45; }
  #ltpop button.rep { background: #eef3fe; border: 1px solid #c9d8f7; color: #1a63d4; margin: 0 6px 6px 0; padding: 3px 10px; border-radius: 6px; }
  #ltpop button.rep:hover { border-color: #1a63d4; }
  #ltpop button.dis { background: none; border: none; color: #8b929e; padding: 2px 0; display: block; }

  /* ---- Ask BenHeath.AI drawer ---- */
  #askdrawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 94vw); z-index: 260; background: var(--panel); border-left: 1px solid var(--border); display: flex; flex-direction: column; box-shadow: -12px 0 40px rgba(0,0,0,.45); }
  #askdrawer[hidden] { display: none; }
  #editorwrap.withdrawer .edscroll { padding-right: min(400px, 94vw); } /* re-center the page in the space left of the drawer */
  #editorwrap.withdrawer .wsside { display: none; } /* the fixed Ask drawer sits over the side pane — hide it while Ask is open (restored on close) */
  .askhead { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--border); font-weight: 650; }
  .askhead .x { background: none; border: none; color: var(--muted); font-size: 17px; padding: 0 4px; }
  .askhead .x:hover { color: var(--text); }
  .askhist { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 18px; }
  .askentry .askqline { font-weight: 650; margin-bottom: 4px; }
  .askentry .aska p { margin: 6px 0; font-size: 13.5px; }
  .asksrc { border-top: 1px dashed var(--border); margin-top: 9px; padding-top: 8px; font-size: 12px; }
  .asksrc .srchead { text-transform: uppercase; letter-spacing: 1px; font-size: 10.5px; color: var(--muted); margin-bottom: 5px; }
  .asksrc a { display: block; margin-top: 4px; }
  .asksnip { color: var(--muted); margin: 2px 0 6px; }
  .askinsert { margin-top: 8px; font-size: 12px; border-color: var(--accent); color: var(--accent); }
  #askdrawer.standalone .askinsert { display: none; }
  .quotachip { font-size: 11px; font-weight: 400; border: 1px solid var(--warn); color: var(--warn); border-radius: 999px; padding: 1px 8px; }
  .asknotice { margin: 0 16px 10px; padding: 8px 10px; border: 1px solid var(--warn); color: var(--warn); border-radius: 8px; font-size: 12.5px; }
  .askinput { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); align-items: flex-end; }
  .askinput textarea { flex: 1; resize: none; font: inherit; background: var(--panel2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
  .askinput textarea:focus { outline: none; border-color: var(--accent); }
  .spin { display: inline-block; width: 11px; height: 11px; border: 2px solid rgba(255,255,255,.25); border-top-color: var(--text); border-radius: 50%; animation: rot .8s linear infinite; vertical-align: -1px; }
  @keyframes rot { to { transform: rotate(360deg); } }

  /* ---- ideas suggestions strip + nav badge + hooks slideover ---- */
  .navbadge { display: inline-block; min-width: 15px; margin-left: 6px; padding: 0 5px; font-size: 10px; font-weight: 700; line-height: 15px; text-align: center; color: #0d0f12; background: var(--accent); border-radius: 999px; vertical-align: 1px; }
  .suggstrip { border: 1px solid var(--accent); border-radius: 12px; background: rgba(106,143,245,.06); padding: 12px 14px; margin-bottom: 18px; }
  .suggstriphead { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
  .suggtitle { font-weight: 650; font-size: 13px; }
  .suggcount { font-size: 11px; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 1px 8px; }
  .suggcards { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
  .suggcard { flex: 0 0 262px; display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); padding: 12px 14px; }
  .suggtext { font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
  .suggmeta { font-size: 12px; }
  .suggacts { display: flex; gap: 8px; margin-top: auto; }
  .suggaccept { flex: 1; background: #1f2a22; border-color: #2f4a38; color: #7dd8a2; font-size: 12.5px; }
  .suggaccept:hover { border-color: var(--ok); }
  .suggdismiss { font-size: 12.5px; color: var(--muted); }
  .suggdismiss:hover { color: var(--bad); border-color: var(--bad); }
  .hookrow { border-bottom: 1px solid #1d222a; padding: 12px 0; }
  .hookrow:last-child { border-bottom: none; }
  .hooktext { font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
  .hookmeta { font-size: 12px; margin-top: 6px; }
  .hookacts { display: flex; gap: 8px; margin-top: 8px; }
  .hookacts button { font-size: 12px; padding: 3px 10px; }
  .hookacts button.danger { color: var(--muted); }
  .hookacts button.danger:hover { color: var(--bad); border-color: var(--bad); }

  /* ---- toasts ---- */
  #toasts { position: fixed; right: 18px; bottom: 18px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
  .toast { background: var(--panel2); border: 1px solid var(--ok); color: var(--text); border-radius: 10px; padding: 10px 16px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.5); max-width: 360px; animation: toastin .2s ease; }
  .toast.err { border-color: var(--bad); }
  .toast.action { display: flex; align-items: center; gap: 8px; }
  .toastbtn { flex: none; font-size: 12px; padding: 2px 9px; border-color: var(--accent); color: var(--accent); }
  @keyframes toastin { from { opacity: 0; transform: translateY(8px); } }

  /* ---- print: only the chosen call sheet card ---- */
  @media print {
    body.printing { background: #fff; }
    body.printing * { visibility: hidden; }
    body.printing .print-target, body.printing .print-target * { visibility: visible; }
    body.printing .print-target { position: absolute; top: 0; left: 0; width: 100%; border: none; background: #fff; color: #000; font-family: -apple-system, "Helvetica Neue", Arial, sans-serif; }
    body.printing .print-target h2, body.printing .print-target .cname, body.printing .print-target .num, body.printing .print-target a { color: #000 !important; }
    body.printing .print-target .chip { color: #000 !important; border-color: #000 !important; background: none !important; }
    body.printing .print-target .chip .dot { background: #000 !important; }
    body.printing .print-target .callrow { border-bottom: 1px solid #ccc; }
    body.printing .print-target header.ch { border-bottom: 2px solid #000; }
    body.printing .print-target button, body.printing .print-target label.filmedbox { display: none !important; }
    body.printing .print-target .print-footer { display: block; visibility: visible; margin-top: 24px; padding-top: 8px; border-top: 1px solid #000; font-size: 10px; color: #000; letter-spacing: 2px; text-transform: uppercase; }
  }