  :root {
    --bg: #f5f6f8; --panel: #ffffff; --panel2: #f1f3f6; --border: #e4e7ec;
    --text: #171a21; --dim: #667085; --accent: #2563eb; --accent-soft: rgba(37,99,235,.08);
    --winner: #047857; --good: #16a34a; --testing: #64748b; --under: #dc2626; --warn: #d97706;
    --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.04);
  }
  * { box-sizing: border-box; margin: 0; }
  body { background: var(--bg); color: var(--text); font: 14px/1.45 -apple-system, 'Segoe UI', Roboto, sans-serif; }
  .hidden { display: none !important; }

  /* login */
  #login { max-width: 320px; margin: 18vh auto; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 28px; }
  #login h1 { font-size: 18px; margin-bottom: 18px; }
  #login input { width: 100%; margin-bottom: 10px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel2); color: var(--text); font-size: 14px; }
  #login button { width: 100%; padding: 10px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }
  #loginErr { color: var(--under); font-size: 12px; margin-bottom: 8px; min-height: 15px; }

  /* app bar */
  header { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 16px; background: rgba(255,255,255,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--border); }
  header h1 { font-size: 16px; margin-right: 8px; }
  header .spacer { flex: 1; }
  select, .search { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel2); color: var(--text); font-size: 13px; }
  .search { width: 180px; }
  #logout { background: none; border: 1px solid var(--border); color: var(--dim); border-radius: 8px; padding: 7px 12px; cursor: pointer; }
  #meta { color: var(--dim); font-size: 12px; padding: 8px 16px 0; }

  /* tabs + hooks BI */
  .tabs { display: flex; align-items: center; gap: 4px; padding: 10px 16px 0; }
  .tab { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--dim); font-size: 14px; font-weight: 600; padding: 6px 12px; cursor: pointer; }
  .tab.active { color: var(--text); border-bottom-color: var(--accent); }
  #hooks { padding: 12px 16px 40px; }
  .hookNote { color: var(--dim); font-size: 12px; margin-bottom: 12px; max-width: 900px; line-height: 1.5; }
  table.hooks { width: 100%; border-collapse: collapse; font-size: 13px; }
  table.hooks th { text-align: left; color: var(--dim); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
  table.hooks td { padding: 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
  table.hooks tr.hookRow { cursor: pointer; }
  table.hooks tr.hookRow:hover { background: var(--panel); }
  table.hooks tr.thin { opacity: .45; }
  .rate { display: flex; align-items: center; gap: 6px; min-width: 108px; }
  .rate .bar { flex: 1; height: 6px; border-radius: 3px; background: var(--panel2); overflow: hidden; }
  .rate .bar i { display: block; height: 100%; }
  .rate b { font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; font-weight: 600; }
  .verdict { font-size: 11px; color: var(--dim); }
  .drill { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; margin: 6px 0 14px; padding: 12px; }
  .drillCols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
  .drillCol h4 { font-size: 12px; margin-bottom: 8px; font-weight: 700; }
  .hookItem { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
  .hookItem img { width: 44px; height: 58px; object-fit: cover; border-radius: 5px; flex-shrink: 0; cursor: pointer; background: var(--panel2); }
  .hookItem .fw { font-size: 12px; color: var(--text); line-height: 1.35; }
  .hookItem .sub { font-size: 11px; color: var(--dim); margin-top: 2px; }
  .splitCards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 18px 0 24px; }
  .splitCard { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
  .splitCard h4 { font-size: 12px; color: var(--dim); font-weight: 600; margin-bottom: 8px; }
  .splitCard .big { font-size: 22px; font-weight: 700; }

  /* grid */
  #grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; padding: 14px 16px 40px; }
  .concept-head { grid-column: 1 / -1; font-size: 14px; font-weight: 700; color: var(--dim); margin-top: 10px; }
  .card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
  .media { position: relative; aspect-ratio: 9/12; max-height: 340px; background: #000; cursor: pointer; display: flex; align-items: center; justify-content: center; }
  .media img, .media video { width: 100%; height: 100%; object-fit: contain; }
  .media .play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 42px; color: rgba(255,255,255,.85); text-shadow: 0 2px 10px rgba(0,0,0,.6); }
  .body { padding: 12px 14px 14px; }
  .name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .row { display: flex; align-items: center; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
  .badge { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
  .badge.winner { background: #d1fae5; color: #047857; }
  .badge.good { background: #dcfce7; color: #16a34a; }
  .badge.breakeven { background: #e0f2fe; color: #0369a1; }
  .badge.promising { background: #ede9fe; color: #6d28d9; }
  .badge.testing { background: #f1f5f9; color: #475569; }
  .badge.underperformer { background: #fee2e2; color: #b91c1c; }
  .trend { font-size: 12px; }
  .concept { font-size: 11px; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; }
  .metrics { display: flex; gap: 0; margin-top: 10px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
  .bandLbl { font-size: 9px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; margin: 8px 0 -6px 2px; }
  .metrics.period { border-color: rgba(37,99,235,.45); }
  .metrics.period .metric { background: var(--accent-soft); }
  input[type="date"] { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel2); color: var(--text); font-size: 12px; color-scheme: light; }
  .metric { flex: 1; text-align: center; padding: 7px 2px; background: var(--panel2); }
  .metric + .metric { border-left: 1px solid var(--border); }
  .metric b { display: block; font-size: 13px; }
  .metric span { font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .04em; }
  .themes { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 5px; }
  .chip { font-size: 10px; color: var(--dim); background: var(--panel2); border: 1px solid var(--border); padding: 2px 7px; border-radius: 999px; }
  .foot { margin-top: 9px; display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--dim); font-size: 11px; }
  /* share link */
  .shareBtn { border: 1px solid var(--border); background: var(--panel2); color: var(--dim); font-size: 11px;
    padding: 3px 8px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
  .shareBtn:hover { color: var(--text); border-color: var(--accent); }
  .shareBtn.done { color: var(--good); border-color: var(--good); }
  #shareBanner { background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
    padding: 10px 14px; margin-bottom: 14px; font-size: 12px; color: var(--dim); }
  #shareBanner b { color: var(--text); }
  .expand { cursor: pointer; color: var(--accent); background: none; border: 0; font-size: 12px; padding: 0; }
  table.ads { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 11px; }
  table.ads th { text-align: left; color: var(--dim); font-weight: 500; padding: 3px 4px; border-bottom: 1px solid var(--border); }
  table.ads td { padding: 3px 4px; border-bottom: 1px solid var(--border); white-space: nowrap; }
  table.ads td.n { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
  .status-ACTIVE { color: var(--good); } .status-PAUSED { color: var(--warn); }
  table.ads td.acctHead { padding: 6px 4px 3px; font-size: 10px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); }
  .commentsWrap { margin-top: 8px; max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--panel2); }
  .comment { padding: 7px 10px; border-bottom: 1px solid var(--border); font-size: 12px; }
  .comment:last-child { border-bottom: 0; }
  .comment .meta { color: var(--dim); font-size: 10px; margin-bottom: 2px; }
  #empty { grid-column: 1/-1; text-align: center; color: var(--dim); padding: 60px 0; }
  .chartsWrap { margin-top: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel2); padding: 10px 12px; }
  .bc { position: relative; margin-bottom: 10px; }
  .bc:last-child { margin-bottom: 0; }
  .bcHead { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 3px; }
  .bcHead .lbl { font-size: 11px; font-weight: 700; letter-spacing: .03em; }
  .bcHead .st { font-size: 10px; color: var(--dim); }
  .bcHead .st b { color: var(--text); font-weight: 600; }
  .bcBody { position: relative; }
  .bcBody svg { display: block; width: 100%; height: 72px; }
  .bcY { position: absolute; left: 2px; font-size: 9px; color: var(--dim); pointer-events: none; background: rgba(255,255,255,.85); padding: 0 3px; border-radius: 3px; }
  .bcDates { display: flex; justify-content: space-between; font-size: 9px; color: var(--dim); margin-top: 2px; }
  .bcTip { position: absolute; top: -4px; transform: translate(-50%, -100%); background: #111827; color: #fff; border: 1px solid #111827; border-radius: 6px; padding: 4px 8px; font-size: 10px; white-space: nowrap; pointer-events: none; z-index: 9; display: none; }
  .bcTip b { font-size: 11px; }

  /* ---- folders ---- */
  #folderBar { display: flex; gap: 6px; align-items: center; padding: 8px 16px 0; overflow-x: auto; }
  .fchip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
    border-radius: 999px; border: 1px solid var(--border); background: var(--panel2); color: var(--dim);
    font-size: 12px; cursor: pointer; white-space: nowrap; }
  .fchip:hover { color: var(--text); }
  .fchip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
  .fchip .n { font-size: 10px; opacity: .75; }
  .fchip.add { border-style: dashed; }
  #folderHead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px 0; }
  #folderHead .fname { font-size: 15px; font-weight: 600; }
  #folderHead .fsub { color: var(--dim); font-size: 11px; }
  #folderHead .warn { color: var(--warn); }

  /* ---- buttons ---- */
  .btn { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel2);
    color: var(--text); font-size: 12px; cursor: pointer; }
  .btn:hover { border-color: var(--accent); }
  .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
  .btn.danger { background: var(--under); border-color: var(--under); color: #fff; font-weight: 600; }
  .btn.ghost { background: transparent; color: var(--dim); }

  /* ---- selection ---- */
  .pick { position: absolute; top: 8px; left: 8px; z-index: 2; display: flex; padding: 4px;
    border-radius: 8px; background: rgba(255,255,255,.85); backdrop-filter: blur(3px); cursor: pointer; }
  .pick input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; margin: 0; }
  .card.picked { outline: 2px solid var(--accent); outline-offset: -2px; }
  #selBar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 20;
    display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px;
    background: var(--panel); border: 1px solid var(--border); box-shadow: 0 8px 30px rgba(16,24,40,.18); }
  #selCount { font-size: 12px; color: var(--dim); margin-right: 4px; }
  #selCount b { color: var(--text); }

  /* ---- toasts ---- */
  #toasts { position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%); z-index: 40;
    display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
  .toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 90vw;
    padding: 9px 14px; border-radius: 10px; font-size: 12px; background: var(--panel);
    border: 1px solid var(--border); color: var(--text); box-shadow: 0 8px 30px rgba(16,24,40,.18);
    transition: opacity .2s, transform .2s; }
  .toast.ok { border-color: var(--winner); }
  .toast.err { border-color: var(--under); }
  .toast.out { opacity: 0; transform: translateY(6px); }
  .toastBtn { border: 0; background: none; color: var(--accent); font-size: 12px; font-weight: 600; cursor: pointer; }

  /* ---- modal (native <dialog>: focus trap, Esc and inert background come free) ---- */
  .modal { border: 0; padding: 0; background: transparent; color: var(--text); max-width: 100vw; max-height: 100vh; }
  .modal::backdrop { background: rgba(16,24,40,.45); backdrop-filter: blur(2px); }
  .modalBox { width: min(460px, 92vw); background: var(--panel); border: 1px solid var(--border);
    border-radius: 14px; padding: 20px; }
  .modalTitle { font-size: 16px; margin-bottom: 12px; }
  .modalBody { font-size: 13px; color: var(--text); }
  .modalNote { color: var(--dim); font-size: 12px; margin-bottom: 12px; line-height: 1.5; }
  .modalFoot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
  .modalBox input[type=text] { width: 100%; padding: 10px 12px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--panel2); color: var(--text); font-size: 14px; }
  .linkInput { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px !important; }
  .fopt { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%;
    padding: 10px 12px; margin-bottom: 6px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--panel2); color: var(--text); font-size: 13px; cursor: pointer; text-align: left; }
  .fopt:hover { border-color: var(--accent); }
  .fopt .meta { color: var(--dim); font-size: 11px; }
  .fopt.new { border-style: dashed; color: var(--accent); }
  .foptList { max-height: 46vh; overflow-y: auto; }

  /* ---- focus (the file had none) ---- */
  :where(button, a, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px;
  }


  /* ---- Catalogue: admin-only faceted browse. The reading of the numbers lives at /board. ---- */
  #catalogue { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 16px; padding: 12px 16px 96px; align-items: start; }
  #catalogue .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
  .catRail { position: sticky; top: 8px; max-height: calc(100vh - 24px); overflow-y: auto; background: var(--panel);
             border: 1px solid var(--border); border-radius: 12px; padding: 10px; font-size: 12px; }
  .catActive { display: flex; flex-wrap: wrap; gap: 4px; padding-bottom: 8px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
  .catChip { background: var(--accent); color: #fff; border: 0; border-radius: 999px; padding: 3px 8px; font-size: 11px; cursor: pointer; }
  .catRailLegend { color: var(--dim); font-size: 10px; margin-bottom: 8px; }
  .catRailLegend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin: 0 2px 0 6px; }
  .catGroup { color: var(--dim); font-size: 10px; letter-spacing: .08em; margin: 12px 0 4px; }
  .catFacet { margin-bottom: 8px; }
  .catFacetLabel { color: var(--text); font-weight: 600; font-size: 11px; margin-bottom: 3px; opacity: .8; }
  .catVal { display: flex; align-items: center; gap: 6px; width: 100%; background: none; border: 0; color: var(--text);
            padding: 3px 4px; border-radius: 6px; cursor: pointer; text-align: left; font-size: 12px; }
  .catVal:hover { background: var(--panel2); }
  .catVal.on { background: var(--accent-soft); }
  .catBox { color: var(--dim); flex: 0 0 auto; }
  .catValName { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .catValN { color: var(--dim); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
  .catDual { display: flex; flex-direction: column; gap: 1px; width: 34px; flex: 0 0 auto; }
  .catDualTrack { height: 3px; background: var(--panel2); border-radius: 2px; overflow: hidden; display: block; }
  .catDualTrack i { display: block; height: 100%; }
  .catViews { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
  .catNote { color: var(--dim); font-size: 11px; margin-left: 8px; }
  .catEmpty { color: var(--dim); padding: 24px; text-align: center; font-size: 13px; }
  .catTable td.num, .catTable th.num { text-align: right; font-variant-numeric: tabular-nums; }
  .catTable tr.thin { opacity: .45; }
  .catRead .warn { color: var(--warn); }
  .catGap.hot { color: var(--winner); opacity: .9; background: rgba(4,120,87,.06); border-style: dashed; }
  .catStrip { display: flex; flex-direction: column; gap: 3px; margin: 6px 0 2px; font-size: 10px; }
  .catStripNone { color: var(--dim); font-style: italic; }
  .catStripRow { display: flex; gap: 6px; align-items: baseline; }
  .catStripRow > span { color: var(--dim); flex: 0 0 34px; text-transform: uppercase; letter-spacing: .04em; font-size: 9px; }
  .catStripRow > div { display: flex; flex-wrap: wrap; gap: 3px; }
  .catTag { background: var(--panel2); border: 1px solid var(--border); color: var(--text); border-radius: 4px;
            padding: 1px 5px; font-size: 10px; cursor: pointer; line-height: 1.5; }
  .catTag:hover { border-color: var(--accent); color: var(--accent); }
  .catTag.flat { cursor: default; color: var(--dim); }

  /* ---- card v2 (light): media → head → chips → dates → KPIs → ads → curves → themes → actions ---- */
  .media .tierTag { position: absolute; top: 8px; right: 8px; z-index: 2; box-shadow: 0 1px 3px rgba(16,24,40,.25); }
  .media .durPill { position: absolute; bottom: 8px; right: 8px; z-index: 2; font-size: 11px; font-weight: 600; color: #fff; background: rgba(17,24,39,.72); padding: 2px 7px; border-radius: 999px; }
  .cardHead { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
  .cardHead .name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; font-size: 13.5px; }
  .cardHead .trend { flex: 0 0 auto; font-size: 11px; font-weight: 600; margin-top: 1px; white-space: nowrap; }
  .chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
  .dates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: var(--panel2); }
  .dates .date span { display: block; font-size: 9.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; }
  .dates .date b { display: block; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
  .dates .date i { display: block; font-style: normal; font-size: 10px; color: var(--dim); }
  .cap { font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; margin: 10px 0 4px; font-weight: 600; }
  .cap.accent { color: var(--accent); }
  .kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .kpi { text-align: center; padding: 7px 2px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
  .kpi b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
  .kpi span { font-size: 9.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; }
  .kpis.period .kpi { background: var(--accent-soft); border-color: rgba(37,99,235,.35); }
  .adsLine { display: flex; align-items: center; gap: 6px; margin-top: 9px; font-size: 12px; color: var(--text); }
  .adsLine .dotA { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; flex: 0 0 auto; }
  .adsLine .dotA.on { background: var(--good); box-shadow: 0 0 0 3px rgba(22,163,74,.15); }
  .adsLine .muted { color: var(--dim); }
  .curves .cap { margin-top: 10px; }
  .cardActions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 11px; padding-top: 9px; border-top: 1px solid var(--border); }
  .act { border: 1px solid var(--border); background: var(--panel); color: var(--text); font-size: 11.5px; padding: 4px 9px; border-radius: 8px; cursor: pointer; }
  .act:hover { border-color: var(--accent); color: var(--accent); }
  .act.open { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
  .cardActions .spacer { flex: 1; }
  .panels > .panel { margin-top: 8px; }
  .panels .chartsWrap, .panels .commentsWrap, .panels .adsWrap { margin-top: 0; }

  /* ---- Days tab: videos by upload / launch day, one table per editor ---- */
  #days { padding: 12px 16px 96px; overflow-x: auto; }
  .daysNote { font-size: 12px; color: var(--dim); margin-bottom: 10px; }
  .dayBlock { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
  .dayHead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--panel2); }
  .dayHead h3 { font-size: 14px; font-weight: 700; }
  .daySum { font-size: 12px; color: var(--dim); }
  .daySum b { color: var(--text); font-weight: 600; }
  .edHead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; padding: 8px 14px 4px; font-size: 12.5px; font-weight: 700; }
  .edHead .daySum { font-weight: 400; }
  table.dayTable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
  table.dayTable th { text-align: left; color: var(--dim); font-weight: 500; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; padding: 6px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
  table.dayTable td { padding: 6px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
  table.dayTable tr.dayRow:last-child td, table.dayTable tr.dayDetail td { border-bottom: 0; }
  table.dayTable th.num, table.dayTable td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
  table.dayTable td.th { width: 52px; }
  .rowThumb { width: 44px; height: 58px; border-radius: 6px; background: #000; object-fit: cover; display: block; cursor: pointer; }
  .rowThumbEmpty { width: 44px; height: 58px; border-radius: 6px; background: var(--panel2); display: block; }
  table.dayTable td.nm { max-width: 260px; }
  table.dayTable .rname { font-weight: 600; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  table.dayTable .rsub { font-size: 10.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  table.dayTable .rtrend { font-size: 10.5px; margin-left: 4px; }
  table.dayTable .ago { color: var(--dim); font-size: 10.5px; margin-left: 4px; }
  tr.dayRow.picked td { background: var(--accent-soft); }
  tr.dayDetail td { background: var(--panel2); padding: 10px 14px; }
  .dayDetail .card { max-width: 480px; }
  .seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-left: 12px; }
  .seg button { border: 0; background: var(--panel); color: var(--dim); font-size: 12px; padding: 5px 10px; cursor: pointer; }
  .seg button.on { background: var(--accent); color: #fff; }
  @media (max-width: 720px) {
    header { padding: 10px 12px; gap: 6px; }
    header h1 { display: none; }
    .search { width: 100%; order: -1; }
    header select { flex: 1 1 44%; min-width: 0; }
    #grid { grid-template-columns: 1fr; padding: 12px 12px 96px; }
    #days { padding: 12px 12px 96px; }
    .dayDetail .card { max-width: none; }
    .dayBlock { overflow-x: auto; }
    table.dayTable { min-width: 760px; }
    .tabs, #folderBar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .modal { align-items: flex-end; }
    .modalBox { width: 100vw; border-radius: 14px 14px 0 0; }
    #catalogue { grid-template-columns: 1fr; padding: 12px 12px 96px; }
    .catRail { position: static; max-height: 260px; }
    #selBar { left: 8px; right: 8px; transform: none; flex-wrap: wrap; justify-content: center; }
    #toasts { bottom: 96px; }
    .shareBtn, .expand, .fchip, .btn { min-height: 34px; }
    .pick input { width: 20px; height: 20px; }
  }
  @media (prefers-reduced-motion: reduce) {
    .toast { transition: none; }
  }

  /* ---- Access tab (admin): users table + grants ---- */
  #access { max-width: 1100px; }
  .accHead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
  .accHead h2 { font-size: 15px; margin: 0; }
  .accNote { font-size: 12px; color: var(--dim); max-width: 720px; line-height: 1.45; }
  table.accTable { width: 100%; border-collapse: collapse; font-size: 12.5px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
  table.accTable th { text-align: left; color: var(--dim); font-weight: 500; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--panel2); }
  table.accTable td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
  table.accTable tr:last-child td { border-bottom: 0; }
  table.accTable tr.off td { opacity: .55; }
  table.accTable .uname { font-weight: 600; }
  table.accTable .usub { font-size: 10.5px; color: var(--dim); white-space: nowrap; }
  table.accTable select, table.accTable input[type=text] { font-size: 12px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--text); }
  table.accTable input[type=text] { width: 150px; }
  .grants { display: flex; flex-wrap: wrap; gap: 4px 10px; max-width: 360px; }
  .grants label { font-size: 12px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
  .grants label.all { font-weight: 600; }
  .grants label.own { color: var(--dim); cursor: default; }
  .accActions { display: flex; gap: 6px; flex-wrap: wrap; }
  .accActions .btn { font-size: 11.5px; padding: 4px 8px; }
  .accActions .btn.save { visibility: hidden; }
  tr.dirty .accActions .btn.save { visibility: visible; }
  .accForm { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; align-items: end; margin-top: 16px; padding: 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; }
  .accForm label { font-size: 11px; color: var(--dim); display: block; margin-bottom: 3px; }
  .accForm input, .accForm select { width: 100%; font-size: 12.5px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--text); }
  @media (max-width: 720px) { #access { overflow-x: auto; } table.accTable { min-width: 820px; } }

  /* ---- paged loading ---- */
  .more { grid-column: 1 / -1; text-align: center; padding: 18px 0 8px; color: var(--dim); font-size: 12px; }
  .more button { font-size: 12.5px; padding: 7px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); color: var(--text); cursor: pointer; }
  .more button:hover { border-color: var(--accent); color: var(--accent); }
  .more.busy button { opacity: .5; pointer-events: none; }
  #meta.busy::after { content: ' · loading…'; color: var(--accent); }
  .panel .loading { color: var(--dim); font-size: 12px; padding: 8px 0; }
