/* ============================================================================
   harmon-e V1.1 — the coss UI look, as ONE LAYER on top of ui.css
   ----------------------------------------------------------------------------
   Loaded from index.html right after shared/ui.css. Delete that one <link> and
   the app is back on the V1 look; nothing in ui.css or the views was changed
   to make this work. The frozen V1 copy is in _versions/V1/ (README there).

   Stage 2 of the V1.1 plan (2026-11-10): tokens + the shared components. It
   changes how things LOOK, never where they are or what they do:
     · same token names, new values (translucent borders, navy-tinted greys)
     · Inter for the interface, Tilt Warp kept for page titles and the logo
     · buttons, inputs, search, filters, menus, tabs, tables, pills, cards,
       panels, dialogs, toast, banner restyled to the coss shapes
   Layout properties (flex, width, position) are left alone on purpose, so the
   phone rules in ui.css keep working. Where a phone rule sets a visual
   property this file also sets, the phone rule is repeated at the bottom.

   Design reference: the "harmon-e × coss UI" canvas → UI Standard v2.
   ========================================================================= */


/* ============ TOKENS ====================================================== */
:root {
  --bg:            #F5F6FA;
  --surface:       #FFFFFF;
  --surface-2:     #F7F8FB;
  --surface-3:     #EEF0F5;
  --border:        rgba(13, 15, 36, .09);
  --border-strong: rgba(13, 15, 36, .15);
  --text-faint:    #656A86;   /* was #7A7F99 (3.9:1) — now 5.3:1 on white */
  --accent-tint:   #EEF0FC;

  --frame:   rgba(13, 15, 36, .035);   /* the tinted edge around tables and kanban columns */
  --ring:    rgba(31, 47, 196, .24);   /* soft focus ring */
  --sh-xs:   0 1px 2px rgba(13, 15, 36, .05);
  --hl:      inset 0 1px 0 rgba(255, 255, 255, .18);   /* highlight on filled buttons */

  --shadow-card: 0 1px 2px rgba(13, 15, 36, .05);
  --shadow-lift: 0 10px 28px -6px rgba(13, 15, 36, .16), 0 2px 6px rgba(13, 15, 36, .06);
  --shadow-pop:  0 24px 60px -12px rgba(13, 15, 36, .30), 0 4px 12px rgba(13, 15, 36, .08);

  --radius: 8px;
  --font-ui:      "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Tilt Warp", ui-rounded, "Inter", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #0A0B1A;
    --surface:       #13152C;
    --surface-2:     #181A33;
    --surface-3:     #20233F;
    --border:        rgba(255, 255, 255, .075);
    --border-strong: rgba(255, 255, 255, .12);
    --text-faint:    #8C91B4;
    --frame: rgba(255, 255, 255, .025);
    --ring:  rgba(140, 155, 255, .28);
    --sh-xs: 0 1px 2px rgba(0, 0, 0, .35);
    --hl:    inset 0 1px 0 rgba(255, 255, 255, .22);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-lift: 0 12px 30px -6px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .4);
    --shadow-pop:  0 24px 60px -12px rgba(0, 0, 0, .75), 0 4px 12px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="black"],
:root[data-theme="dark"] {
  --bg:            #0A0B1A;
  --surface:       #13152C;
  --surface-2:     #181A33;
  --surface-3:     #20233F;
  --border:        rgba(255, 255, 255, .075);
  --border-strong: rgba(255, 255, 255, .12);
  --text-faint:    #8C91B4;
  --frame: rgba(255, 255, 255, .025);
  --ring:  rgba(140, 155, 255, .28);
  --sh-xs: 0 1px 2px rgba(0, 0, 0, .35);
  --hl:    inset 0 1px 0 rgba(255, 255, 255, .22);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-lift: 0 12px 30px -6px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .4);
  --shadow-pop:  0 24px 60px -12px rgba(0, 0, 0, .75), 0 4px 12px rgba(0, 0, 0, .5);
}
/* True Black: Dark's colours on #000; cards get a hairline instead of a fill. */
:root[data-theme="black"] {
  --bg:            #000000;
  --surface:       #050506;
  --surface-2:     #0B0B10;
  --surface-3:     #15151C;
  --border:        rgba(255, 255, 255, .11);
  --border-strong: rgba(255, 255, 255, .16);
  --accent-tint:   #12163A;
  --frame: rgba(255, 255, 255, .03);
  --sh-xs: none;
  --shadow-card: none;
  --shadow-lift: 0 0 0 1px rgba(255, 255, 255, .16), 0 12px 30px -6px rgba(0, 0, 0, .9);
  --shadow-pop:  0 0 0 1px rgba(255, 255, 255, .16), 0 24px 60px -12px rgba(0, 0, 0, .95);
}
/* System + dark device = True Black (same rule as ui.css, 2026-10-11m). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg:            #000000;
    --surface:       #050506;
    --surface-2:     #0B0B10;
    --surface-3:     #15151C;
    --border:        rgba(255, 255, 255, .11);
    --border-strong: rgba(255, 255, 255, .16);
    --accent-tint:   #12163A;
    --frame: rgba(255, 255, 255, .03);
    --sh-xs: none;
    --shadow-card: none;
    --shadow-lift: 0 0 0 1px rgba(255, 255, 255, .16), 0 12px 30px -6px rgba(0, 0, 0, .9);
    --shadow-pop:  0 0 0 1px rgba(255, 255, 255, .16), 0 24px 60px -12px rgba(0, 0, 0, .95);
  }
}


/* ============ BASE ======================================================= */
body { font-feature-settings: "cv11", "ss01"; }
.mono { font-size: .94em; }
:where(button, a, [tabindex], .card, .chip, .seg-btn, .menu-item, select):focus-visible {
  outline: 2px solid color-mix(in srgb, var(--focus) 70%, transparent); outline-offset: 2px;
}
.page-title, .gate-title, .wk-hero h1 { font-family: var(--font-display); font-weight: 400; }
.page-title { font-size: 22px; letter-spacing: 0; }


/* ============ BUTTONS ==================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 6px 11px; font-size: 13.5px; font-weight: 500; line-height: 1.35; color: var(--text);
  box-shadow: var(--sh-xs);
}
/* ⚠ Required: the `display` above would otherwise beat [hidden] (same trap
   as ui.css §12) and un-hide every hidden button in the app. */
.btn[hidden] { display: none; }
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg);
  box-shadow: var(--hl), 0 1px 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover);
  box-shadow: var(--hl), 0 1px 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-muted); padding: 6px 9px; }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); border-color: transparent; }
.btn-sm { padding: 4px 9px; font-size: 13px; gap: 5px; }
.btn-danger { background: var(--surface); color: var(--s-na); border-color: var(--border-strong); }
.btn-danger:hover { background: var(--s-na-bg); border-color: color-mix(in srgb, var(--s-na) 45%, transparent); color: var(--s-na); }
.helpbtn, .bellbtn, .setbtn { padding: 6px 7px; }


/* ============ MENU ======================================================= */
.menu-pop { background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-lift); padding: 4px; }
.menu-item { border-radius: 6px; padding: 6px 8px; font-size: 13.5px; }
.menu-item:hover { background: var(--surface-3); }
.menu-sep { margin: 4px -4px; }
.menu-label { font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-faint); padding: 6px 8px 4px; }


/* ============ TABS — segmented, raised white pill ======================== */
.seg, .views, .themeseg {
  background: var(--surface-3); border: 1px solid var(--border); border-radius: 10px; padding: 2px; gap: 2px;
}
.seg-btn, .viewbtn, .themeopt {
  border-radius: 7px; padding: 4px 10px; font-size: 13px; font-weight: 500; color: var(--text-muted);
}
.seg-btn:hover, .viewbtn:hover { background: transparent; color: var(--text); }
.seg-btn.on, .viewbtn.on, .seg-btn[aria-selected="true"], .themeopt.on {
  background: var(--surface); color: var(--text);
  box-shadow: 0 1px 2px rgba(13, 15, 36, .08), 0 0 0 1px var(--border);
}
.seg-ghost { background: var(--surface); border-radius: 7px; box-shadow: 0 1px 2px rgba(13, 15, 36, .08), 0 0 0 1px var(--border); }
.seg-btn b, .seg-btn .n { font-family: var(--font-ui); font-weight: 500; font-size: 11.5px; color: var(--text-faint); opacity: 1; }
.seg-btn.on b, .seg-btn.on .n { color: var(--text-muted); }
.seg-btn.warn:not(.on) { color: var(--warn); }

/* Chips (Home panel filters) read as a small segmented control. */
.chip { background: transparent; border-color: transparent; border-radius: 7px; padding: 3px 9px; font-size: 12.5px; font-weight: 500; }
.chip:hover { border-color: transparent; color: var(--text); }
.chip.on { background: var(--surface); color: var(--text); border-color: transparent;
  box-shadow: 0 1px 2px rgba(13, 15, 36, .08), 0 0 0 1px var(--border); }
.chip .n { font-family: var(--font-ui); }

/* Top-bar surface tabs (until the Stage 3 sidebar replaces them) — desktop only,
   the phone sheet keeps its own look. */
@media (min-width: 761px) {
  .surfnav { background: var(--surface-3); border-radius: 10px; }
  .surfbtn { border-radius: 7px; padding: 4px 11px; font-weight: 500; }
  .surfbtn.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(13, 15, 36, .08), 0 0 0 1px var(--border); }
  .navmenu .menu-item.on { color: var(--text); font-weight: 600; }
}


/* ============ SEARCH + FILTERS + INPUTS ================================== */
.search {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--sh-xs); font-family: var(--font-ui); font-size: 13.5px; padding: 6px 26px 6px 30px;
}
.search::placeholder { font-size: 13px; }
.search:focus { border-color: color-mix(in srgb, var(--accent) 65%, transparent); box-shadow: 0 0 0 3px var(--ring); outline: none; }
select.filter {
  -webkit-appearance: none; appearance: none;
  background-color: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--sh-xs); font-size: 13.5px; padding: 6px 28px 6px 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237A7F99' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}
select.filter:focus { border-color: color-mix(in srgb, var(--accent) 65%, transparent); box-shadow: 0 0 0 3px var(--ring); outline: none; }
.inp {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--sh-xs); padding: 6px 9px; font-size: 13.5px;
}
.inp:focus { border-color: color-mix(in srgb, var(--accent) 65%, transparent); box-shadow: 0 0 0 3px var(--ring); }
.inp.dirty { border-color: color-mix(in srgb, var(--accent) 65%, transparent); background: var(--accent-tint); }


/* ============ TABLES — rows in a frame =================================== */
table.list {
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  box-shadow: 0 0 0 4px var(--frame), 0 0 0 5px var(--border);
}
table.list th {
  font-size: 12.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-muted);
  background: var(--surface);
}
table.list td { font-size: 13.5px; }
table.list tbody tr:hover { background: var(--surface-2); }
.listwrap { --listwrap-pad: 14px; }


/* ============ PILLS, TAGS, BADGES ======================================== */
.pill, .status-pill, .tag, .badge {
  text-transform: none; letter-spacing: 0; font-weight: 500; border-radius: 6px;
}
.pill { font-size: 12px; padding: 2px 7px; }
.status-pill { font-size: 12px; padding: var(--statuspill-pad, 3px 8px); }
.tag { font-size: 11.5px; padding: 1px 6px; border: 0; }
.badge { font-size: 11.5px; padding: 1px 6px; }


/* ============ PANELS, CARDS, KANBAN ====================================== */
.panel { border-radius: 14px; box-shadow: var(--sh-xs); }
.panel-head { padding: 10px 14px; }
.panel-title { font-size: 13.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text); }

.col { background: var(--frame); border-radius: 14px; }
.col-head { border-top: 0; border-bottom: 0; border-radius: 14px 14px 0 0; padding: 10px 12px 6px; }
.col-title { font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text); }
.col-title::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--cc); margin-right: 7px; vertical-align: 1px; }
.col-count { font-family: var(--font-ui); background: transparent; color: var(--text-faint); }
.col-body { padding: 4px 6px 8px; }

/* No coloured left edge on cards: the colour moves to a dot before the code. */
.card { border-left: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; box-shadow: var(--sh-xs); }
.card:hover { border-left-color: var(--border-strong); }
.card-hc::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--cc, transparent); margin-right: 6px; vertical-align: 1px; }
.card-title { font-weight: 550; }
.avatar { font-family: var(--font-ui); font-weight: 600; background: var(--accent-tint); color: var(--accent); }

.metric-label, .avfilter-label, .cal-dow, .cal-side h3 { letter-spacing: 0; text-transform: none; font-size: 12.5px; color: var(--text-muted); }
.metric-value { font-weight: 600; font-variant-numeric: tabular-nums; }


/* ============ DETAIL CARD + DIALOG ======================================= */
.detail { border: 1px solid var(--border); border-radius: 14px; }
.detail-head { border-top-width: 3px; border-radius: 13px 13px 0 0; }
.detail-title { font-weight: 600; }
.modal { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.modal-head { border-bottom: 0; padding: 20px 22px 6px; }
.modal-title { font-size: 17px; font-weight: 600; }
.modal-eyebrow { letter-spacing: 0; text-transform: none; font-size: 12.5px; font-weight: 500; }
.modal-body { padding: 10px 22px 18px; }
.modal-foot { background: var(--surface-2); padding: 12px 22px; }

.fkey { font-size: 12.5px; letter-spacing: 0; text-transform: none; color: var(--text-muted); }
.fval { font-size: 13.5px; }
.section-label {
  font-size: 13.5px; letter-spacing: 0; text-transform: none; font-weight: 600;
  border-bottom-width: 1px; padding-bottom: 6px;
}
.tail .tail-lbl { letter-spacing: 0; text-transform: none; font-size: 12.5px; color: var(--text-muted); }


/* ============ FEEDBACK ==================================================== */
.toast {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lift); font-weight: 500;
}
.banner {
  border: 1px solid color-mix(in srgb, var(--s-na) 40%, transparent); border-left-width: 1px;
  border-radius: 12px; box-shadow: var(--shadow-lift);
}
.banner.warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.banner .why { border-radius: 8px; }
.banner button { border-radius: 6px; }
.notice { border: 0; border-radius: 10px; }
div.warn { border-radius: 10px; }
.empty-title { font-weight: 600; color: var(--text); font-size: 15px; }


/* ============ STAGE 3 — SIDEBAR + PAGE PANEL (2026-11-10) ================
   Computers only. #appnav and .appmain are in index.html; core.js
   (paintAppNav) fills the sidebar. On phones nothing here applies: the
   sidebar stays hidden, .appmain stays display:contents, and the bottom tab
   bar + More sheet work exactly as on V1.

   States, as classes on <html>:
     (none)        full sidebar, 232px
     .nav-rail     compact, icons only, 56px
     .nav-hidden   gone; .nav-peek floats it back in over the page
     .nav-anim     added after first paint — motion only from then on

   HOW IT MOVES. The sidebar is a fixed layer on the left; the page panel's
   left margin is the sidebar's width (--nav-w). Hide = the layer slides out
   and the margin closes. Compact = the width shrinks and the names fade;
   the icons never move, because their centre (28px) is the middle of the
   56px rail. Peek = the same layer slides back in, over the page, as a
   floating card. Reduced motion: ui.css switches every transition off. */
.topbar { box-shadow: none; }

@media (min-width: 761px) {
  :root { --nav-w: 232px; --nav-full: 232px; --nav-t: 260ms; }
  html.nav-rail { --nav-w: 56px; }
  html.nav-hidden { --nav-w: 0px; }

  body { background: var(--bg); }

  #appnav, #appnav[hidden] {
    display: flex; flex-direction: column; gap: 10px;
    position: fixed; z-index: 45; left: 0; top: 0; bottom: 0;
    width: var(--nav-w); padding: 12px 10px 10px; overflow: hidden;
    background: var(--bg);
  }
  .appmain {
    display: flex !important; flex-direction: column; flex: 1 1 auto; min-width: 0; min-height: 0;
    margin: 6px 6px 6px max(6px, var(--nav-w)); background: var(--surface);
    border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--sh-xs); overflow: hidden;
  }

  /* hidden: a floating card parked just off the left edge */
  html.nav-hidden #appnav {
    width: var(--nav-full); top: 6px; bottom: 6px;
    background: var(--surface); border: 1px solid var(--border); border-left: 0;
    border-radius: 0 14px 14px 0; box-shadow: var(--shadow-pop);
    transform: translateX(calc(-100% - 24px)); visibility: hidden;
  }
  html.nav-hidden.nav-peek #appnav,
  html.nav-hidden #appnav:focus-within { transform: none; visibility: visible; }

  /* motion */
  html.nav-anim #appnav {
    transition: width var(--nav-t) var(--ease-out), transform var(--nav-t) var(--ease-out),
                visibility 0s linear var(--nav-t);
  }
  html.nav-anim.nav-peek #appnav, html.nav-anim #appnav:focus-within {
    transition: width var(--nav-t) var(--ease-out), transform var(--nav-t) var(--ease-out), visibility 0s;
  }
  html.nav-anim .appmain { transition: margin-left var(--nav-t) var(--ease-out); }

  /* The top bar sits inside the page panel: no logo, no tabs. */
  .topbar { height: 48px; padding: 0 10px; background: transparent; gap: 10px; }
  .topbar > .brand { display: none; }
  .topbar > .surfnav { display: none !important; }
  .topbar > #userChip { display: none; }   /* Home shows the role under the greeting */
  .navside[hidden] { display: inline-flex; padding: 6px 7px; }
  .v11-crumb[hidden] { display: inline; font-size: 13.5px; font-weight: 550; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

  /* sidebar pieces — fixed sizes, so nothing reflows while the width animates */
  .nv-head { position: relative; display: flex; align-items: center; height: 34px; padding: 0 10px; flex: none; }
  .nv-brand { position: relative; height: 24px; display: flex; align-items: center; }
  .nv-brand .brand-logo { height: 18px; transition: opacity 160ms var(--ease-out); }
  .nv-mark { position: absolute; left: -4px; top: 0; width: 24px; height: 24px; opacity: 0; transition: opacity 160ms var(--ease-out); }
  .nv-body { display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; scrollbar-width: none; }
  .nv-body::-webkit-scrollbar { display: none; }
  .nv-group { display: flex; flex-direction: column; gap: 1px; }
  .nv-sec { position: relative; display: flex; align-items: center; height: 22px; padding: 0 10px; font-size: 12px; font-weight: 500; color: var(--text-faint); white-space: nowrap; }
  .nv-sec > span { transition: opacity 160ms var(--ease-out); }
  .nv-sec::after { content: ""; position: absolute; left: 8px; width: 20px; top: 50%; height: 1px; background: var(--border-strong); opacity: 0; transition: opacity 160ms var(--ease-out); }
  .nv-item {
    display: flex; align-items: center; gap: 9px; width: 100%; height: 30px; padding: 0 10px; flex: none;
    border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); overflow: hidden;
    font: inherit; font-size: 13.5px; font-weight: 450; text-align: left; white-space: nowrap; cursor: pointer;
    transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
  }
  .nv-item:hover { background: var(--surface-3); color: var(--text); }
  .nv-item.on { background: var(--surface); color: var(--text); font-weight: 550; box-shadow: var(--sh-xs), 0 0 0 1px var(--border); }
  html.nav-hidden .nv-item.on { background: var(--surface-3); box-shadow: none; }
  .nv-ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
  .nv-label { overflow: hidden; text-overflow: ellipsis; min-width: 0; transition: opacity 160ms var(--ease-out); }
  .nv-foot { display: flex; flex-direction: column; gap: 1px; padding-top: 8px; border-top: 1px solid var(--border); flex: none; }
  .nv-rail-out { display: none; }

  /* compact: same layout, names faded out, logo swapped for the swirl */
  html.nav-rail .nv-label, html.nav-rail .nv-sec > span, html.nav-rail .nv-brand .brand-logo { opacity: 0; }
  html.nav-rail .nv-mark, html.nav-rail .nv-sec::after { opacity: 1; }
  html.nav-rail .nv-rail-in { display: none; }
  html.nav-rail .nv-rail-out { display: inline; }
}


/* ============ STAGE 4 — DATA PAGES FILL THE SCREEN (2026-11-10) ===========
   Content Library, Live and Grids: as many rows as fit. Computers only — the
   phone rules in ui.css (channel row, phone lists, two-day grid) stay as they
   are.

   Every selector here starts with :root. The view stylesheets load AFTER this
   file (lazily, the first time a page opens), so at equal specificity they
   would win; :root lifts these one step above them without !important.

   What changes:
     · the page's filter row becomes one slim bar on a tinted strip
     · tables run edge to edge, 31px rows, header stays put while scrolling
     · Library's channel list is a slim list, not a column of cards
     · Grids loses its outer padding; the grid and the "to schedule" panel
       sit flush, the panel docked on the right with a hairline between */
@media (min-width: 761px) {

  /* ── shared: dense tables ── */
  :root .v-library, :root .v-live { --listwrap-pad: 0; --th-pad: 7px 10px; --td-pad: 6px 10px; }
  :root .v-library .listwrap, :root .v-live .listwrap { --listwrap-pad: 0; }   /* stage 2 sets it on .listwrap itself */
  :root .v-library table.list, :root .v-live table.list {
    border: 0; border-radius: 0; box-shadow: none; background: var(--surface);
  }
  :root .v-library table.list th, :root .v-live table.list th {
    font-size: 12px; background: var(--surface); border-bottom: 0; box-shadow: inset 0 -1px 0 var(--border);
  }
  :root .v-library table.list td, :root .v-live table.list td { font-size: 13px; line-height: 1.4; }
  :root .v-library table.list th:first-child, :root .v-library table.list td:first-child,
  :root .v-live table.list th:first-child, :root .v-live table.list td:first-child { padding-left: 16px; }
  :root .v-library table.list tbody tr:hover, :root .v-live table.list tbody tr:hover { background: var(--surface-2); }
  :root .v-library .status-pill, :root .v-live .status-pill { padding: 1px 7px; font-size: 11.5px; }
  :root .v-library .pill, :root .v-live .pill { padding: 1px 6px; font-size: 11.5px; }

  /* ── Content Library ── */
  :root .v-library .sidebar {
    flex: 0 0 196px; padding: 10px 8px; background: var(--surface); border-right: 1px solid var(--border);
  }
  :root .v-library .sb-head { font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; padding: 0 8px 6px; }
  :root .v-library .ch { border: 0; border-radius: 7px; padding: 5px 8px; margin-bottom: 1px; font-size: 13px; }
  :root .v-library .ch:hover { background: var(--surface-3); }
  :root .v-library .ch.on { background: var(--surface-3); color: var(--text); font-weight: 550; }
  :root .v-library .ch .ct { font-family: var(--font-ui); font-size: 11.5px; color: var(--text-faint); opacity: 1; }
  :root .v-library .filterbar {
    gap: 6px; padding: 6px 12px 6px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  }
  :root .v-library .filterbar .search, :root .v-library .filterbar select.filter { padding-top: 4px; padding-bottom: 4px; font-size: 13px; }
  :root .v-library .count { font-size: 12.5px; }
  :root .v-library .count b { font-family: var(--font-ui); font-weight: 600; }

  /* ── Live ── */
  :root .v-live .live-head { gap: 0; padding: 0; border-bottom: 1px solid var(--border); background: var(--surface-2); }
  :root .v-live .live-head .pagetabs { margin: 0; padding: 8px 12px 0 16px; }
  :root .v-live .filterbar { gap: 6px; padding: 6px 12px 6px 16px; }
  :root .v-live .filterbar .search, :root .v-live .filterbar select.filter { padding-top: 4px; padding-bottom: 4px; font-size: 13px; }
  :root .v-live .daterange { border-radius: var(--radius); background: var(--surface); box-shadow: var(--sh-xs); }
  :root .v-live .dr-label { font-size: 12.5px; letter-spacing: 0; text-transform: none; color: var(--text-muted); }
  :root .v-live .warnbar { margin: 0 12px 8px 16px; }
  :root .v-live .lanes { padding: 10px 12px; }
  :root .v-live .lane { border-radius: 14px; background: var(--frame); }
  :root .v-live .livecard { border-radius: 10px; box-shadow: var(--sh-xs); }
  :root .v-live tr.containerrow td:first-child { border-left: 0; box-shadow: inset 2px 0 0 var(--tag-season); }

  /* ── Grids ── */
  :root .gr-page { padding: 0; }
  :root .gr-bar {
    gap: 8px; margin: 0; padding: 6px 12px 6px 16px; flex: none;
    background: var(--surface-2); border-bottom: 1px solid var(--border);
  }
  :root .gr-main { gap: 0; grid-template-columns: minmax(0, 1fr) 300px; }
  :root .gr-grid { border: 0; border-radius: 0; }
  :root .gr-head { background: var(--surface); border-bottom: 1px solid var(--border); }
  :root .gr-dayhead { font-size: 12.5px; padding: 7px 8px; }
  :root .gr-dayhead b { font-weight: 600; }
  :root .gr-dayhead.today { background: var(--accent-tint); }
  :root .gr-time { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-faint); }
  :root .gr-block { border-radius: 6px; }
  :root .gr-side {
    border: 0; border-left: 1px solid var(--border); border-radius: 0;
    padding: 10px 12px; gap: 8px; background: var(--surface);
  }
  /* .gr-item keeps its grid colour (gray when none) — Evann 2026-11-09, grids.css. */
  :root .gr-item { border-radius: 8px; padding: 6px 9px; }
  :root .gr-evchip { border-radius: 8px; }
  /* ── review on real data, 2026-11-10 ── */
  /* One line per row: long titles and descriptions end in "…" instead of
     wrapping to five lines. The whole value is one click away in the card. */
  :root .v-library table.list td, :root .v-live table.list td {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px;
  }
  :root .v-library table.list td.preview { max-width: 460px; }
  /* Filters wrap onto a second line rather than running off the right edge. */
  :root .v-library .filterbar { flex-wrap: wrap; overflow-x: visible; }
  /* Live board lanes: same column style as the Prep Board. */
  :root .v-live .lane-head { background: transparent; border-bottom: 0; padding: 9px 12px 5px; }
  :root .v-live .lane-name { font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--text); }
  :root .v-live .lane-name::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    background: var(--cc); margin-right: 7px; vertical-align: 1px; }
  :root .v-live .lane-count { font-size: 12px; color: var(--text-faint); opacity: 1; }
  :root .v-live .lane-body { padding: 4px 6px 8px; }
  /* Grids: slimmer time columns give the seven days ~20px more. */
  :root .gr-head, :root .gr-body { grid-template-columns: 64px repeat(7, minmax(96px, 1fr)) 64px; }
  :root .gr-time { padding-right: 6px; white-space: nowrap; }
  :root .gr-times-r .gr-time { padding-left: 6px; }
}


/* ============ COMPACT SIDEBAR LABEL (2026-11-10) =========================
   core.js draws .nv-tip beside the hovered icon when the sidebar is compact. */
.nv-tip {
  position: fixed; z-index: 70; transform: translate(-4px, -50%); pointer-events: none;
  padding: 4px 8px; border-radius: 6px; white-space: nowrap;
  background: var(--text); color: var(--bg); font-size: 12.5px; font-weight: 500;
  box-shadow: var(--shadow-lift); opacity: 0;
  transition: opacity var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.nv-tip.on { opacity: 1; transform: translate(0, -50%); }


/* ============ STAGE 5 — CARDS OPEN AS A SIDE SHEET (2026-11-10) ===========
   Every record card in the app is the shared .detail panel: Prep Board and
   task-board cards, Library records and file issues, Live events. On a
   computer it now slides in from the right, full height, over a dimmed page,
   instead of popping up in the middle. Width still comes from each page's
   --detail-w (board 700, tasks 620, live 860, library 960), so nothing inside
   a card reflows. Decision dialogs (.modal: Mark complete, Push programs…)
   stay centred — those are a question, not a record.
   Phones keep their full-screen card (ui.css). */
@media (min-width: 761px) {
  :root .scrim { background: rgba(5, 8, 36, .32); z-index: 46; }   /* above the sidebar (45), under the sheet (50) */
  :root .detail {
    top: 6px; right: 6px; bottom: 6px; left: auto;
    width: min(var(--detail-w, 620px), calc(100vw - 12px));
    max-height: none; border-radius: 14px;
    transform: translateX(calc(100% + 24px));
    transition: transform var(--dur-3) var(--ease-out), opacity var(--dur-2) var(--ease-out);
  }
  :root .detail.open { transform: none; }
  :root .detail-head { border-radius: 13px 13px 0 0; }
  :root .detail-foot { background: var(--surface-2); border-radius: 0 0 13px 13px; }
}

/* ============ PHONE — repeat what ui.css's phone rules set ================
   This file loads later, so any phone rule it would otherwise undo is
   restated here. */
@media (max-width: 760px) {
  .detail, .modal { border-radius: 0; border-left: 0; border-right: 0; }
  .menu-pop:not(.surfnav .menu-pop) { border-radius: 12px; }
  .menu-pop .menu-item { padding: 11px 12px; font-size: 14px; }
  .surfnav { border-radius: 14px 14px 0 0 !important; }
  .surfnav .surfbtn { padding: 12px 14px; font-size: 15px; }
}


/* ============ STAGE 6 — PHONES (2026-11-10) ===============================
   Phones are still for reading (UI-STANDARD §9): bottom tab bar, More sheet,
   create buttons hidden, filters folded. What V1.1 changes:
     · More opens the SAME sidebar as a computer (#appnav) as a bottom sheet,
       so Content / Scheduling / Boards / Company / Tools read the same
       everywhere. The V1 tab list (.surfnav) stays in the page but unused.
     · cards (.detail) slide up as a sheet with a handle instead of
       replacing the page
     · tab bar, day headings and the Live / Grids phone lists in the V1.1 look */
@media (max-width: 760px) {
  /* More sheet */
  body.nav-open .surfnav { display: none !important; }
  body.nav-open #appnav, body.nav-open #appnav[hidden] {
    display: flex; flex-direction: column; position: fixed; z-index: 75;
    left: 0; right: 0; bottom: calc(56px + env(safe-area-inset-bottom));
    max-height: 74dvh; overflow-y: auto; overscroll-behavior: contain;
    padding: 6px 10px 12px; background: var(--surface);
    border: 1px solid var(--border); border-bottom: 0; border-radius: 16px 16px 0 0;
    box-shadow: var(--shadow-pop); animation: nv-sheet-in var(--dur-3) var(--ease-out);
  }
  body.nav-open #appnav::before {
    content: ""; flex: none; width: 36px; height: 4px; margin: 4px auto 6px;
    border-radius: 999px; background: var(--border-strong);
  }
  #appnav .nv-head, #appnav .nv-foot { display: none; }
  #appnav .nv-body { display: flex; flex-direction: column; gap: 4px; }
  #appnav .nv-group { display: flex; flex-direction: column; }
  #appnav .nv-sec { padding: 10px 10px 4px; font-size: 12px; font-weight: 500; color: var(--text-faint); }
  #appnav .nv-item {
    display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 10px;
    border: 0; border-radius: 10px; background: transparent; color: var(--text);
    font: inherit; font-size: 15px; text-align: left; -webkit-tap-highlight-color: transparent;
  }
  #appnav .nv-item:active { background: var(--surface-3); }
  #appnav .nv-item.on { background: var(--surface-3); font-weight: 600; }
  #appnav .nv-ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; color: var(--text-muted); }
  #appnav .nv-item.on .nv-ico { color: var(--accent); }

  /* bottom tab bar */
  #mtabs { background: var(--surface); border-top: 1px solid var(--border); }
  .mtab { font-size: 11px; font-weight: 500; letter-spacing: 0; color: var(--text-muted); }
  .mtab.on { color: var(--accent); }
  .mtab svg { stroke-width: 1.75; }
  .mtab.on svg { stroke-width: 2.1; }

  /* top bar */
  .topbar { background: var(--surface); border-bottom: 1px solid var(--border); }

  /* cards: a sheet from the bottom, with a handle */
  :root .detail {
    top: calc(env(safe-area-inset-top) + 14px); bottom: 0; height: auto; max-height: none;
    padding-top: 0; border: 1px solid var(--border); border-bottom: 0; border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    transition: transform var(--dur-3) var(--ease-out), opacity var(--dur-2) var(--ease-out);
  }
  :root .detail.open { transform: none; }
  :root .detail::before {
    content: ""; flex: none; width: 36px; height: 4px; margin: 8px auto 0;
    border-radius: 999px; background: var(--border-strong);
  }
  :root .detail-head { border-radius: 0; }

  /* Live and Grids phone lists */
  :root .lv-mday, :root .gr-mday {
    font-size: 12.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-muted);
    background: var(--surface-2); padding: 8px 16px;
  }
  :root .lv-mrow { padding: 11px 16px; gap: 5px; }
  :root .lv-mprog { font-size: 14.5px; font-weight: 500; }
  :root .lv-mmeta { font-size: 12.5px; }
  :root .gr-mrow { padding: 9px 16px; grid-template-columns: 64px 1fr; }
  :root .gr-mtime { font-family: var(--font-mono); font-size: 12px; }
  :root .gr-mtoday { letter-spacing: 0; font-weight: 600; }
}
@keyframes nv-sheet-in { from { transform: translateY(24px); opacity: 0; } }

