/* GlatAI Social console — design system (D19). Accent comes from ACCENT_COLOR (inline :root var). */
@font-face { font-family: Inter; src: url(/static/fonts/Inter-Variable.ttf) format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Almarai; src: url(/static/fonts/Almarai-Regular.ttf); font-weight: 400; font-display: swap; }
@font-face { font-family: Almarai; src: url(/static/fonts/Almarai-Bold.ttf); font-weight: 700; font-display: swap; }
@font-face { font-family: Almarai; src: url(/static/fonts/Almarai-ExtraBold.ttf); font-weight: 800; font-display: swap; }

:root {
  --accent: #0F766E; --accent-ink: #fff;
  --bg: #F5F6F8; --panel: #FFFFFF; --panel-2: #F9FAFB; --line: #E6E8EC; --line-2: #EEF0F3;
  --ink: #111827; --ink-2: #374151; --muted: #5F6673; --faint: #6B7280;
  --ok: #047857; --ok-bg: #ECFDF5; --warn: #B45309; --warn-bg: #FFFBEB; --bad: #B91C1C; --bad-bg: #FEF2F2;
  --info: #1D4ED8; --info-bg: #EFF6FF; --violet: #6D28D9; --violet-bg: #F5F3FF;
  --radius: 14px; --radius-s: 9px; --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --shadow-l: 0 10px 30px -12px rgba(16,24,40,.25); --side: 252px;
  --font: Inter, Almarai, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B0F14; --panel: #121821; --panel-2: #0F141B; --line: #1F2833; --line-2: #19212B;
    --ink: #E6EAF0; --ink-2: #C3CBD5; --muted: #8A96A6; --faint: #808B9A;
    --ok-bg: #0B2A22; --warn-bg: #2A2110; --bad-bg: #2C1414; --info-bg: #0F1E36; --violet-bg: #1D1633;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-l: 0 10px 30px -12px rgba(0,0,0,.7);
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14.5px/1.55 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
h2 { font-size: 16px; font-weight: 650; margin: 0 0 12px; letter-spacing: -.01em; }
h3 { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 18px 0 8px; }
.icon { flex: none; vertical-align: -3px; }
[dir=auto], textarea, pre, .ar { font-family: Almarai, var(--font); }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--panel); border-inline-end: 1px solid var(--line);
        padding: 18px 12px 24px; display: flex; flex-direction: column; gap: 4px; }
.brandmark { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.brandmark .mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800;
                   background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #7C3AED)); box-shadow: var(--shadow-l); }
.brandmark .name { font-weight: 700; font-size: 15px; line-height: 1.15; } .brandmark .co { font-size: 12px; color: var(--muted); }
.brandmark img { width: 34px; height: 34px; border-radius: 10px; object-fit: contain; background: #fff; }
.navlabel { font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--panel-2); text-decoration: none; color: var(--ink); }
.nav a.on { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
.nav .dot { width: 9px; height: 9px; border-radius: 3px; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.nav .sub { margin: 2px 0 6px 19px; padding-inline-start: 10px; border-inline-start: 1px solid var(--line); }
.nav .sub a { padding: 5px 10px; font-size: 13.5px; }
.nav .count { margin-inline-start: auto; font-size: 11.5px; font-weight: 600; padding: 0 7px; border-radius: 99px; background: var(--warn-bg); color: var(--warn); }
.side .foot { margin-top: auto; padding: 14px 8px 0; font-size: 12px; color: var(--faint); }
.mainwrap { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 12px 28px;
          background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-2); }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; flex: 1; min-width: 0; }
.crumbs a { color: var(--muted); } .crumbs .icon { color: var(--faint); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12.5px;
          background: color-mix(in srgb, var(--accent) 16%, var(--panel)); color: var(--accent); }
.usermenu { display: flex; align-items: center; gap: 10px; } .usermenu .who { text-align: end; line-height: 1.2; font-size: 12.5px; }
.usermenu .who b { display: block; font-size: 13px; color: var(--ink); }
.bell { position: relative; color: var(--muted); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; }
.bell:hover { background: var(--panel); } .bell .pip { position: absolute; top: 6px; inset-inline-end: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); border: 2px solid var(--bg); }
main { padding: 26px 28px 70px; max-width: 1320px; width: 100%; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.pagehead p { margin: 4px 0 0; color: var(--muted); }
.menu-toggle { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; } .side { position: fixed; z-index: 20; width: 270px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-l); }
  body.nav-open .side { transform: none; } .menu-toggle { display: grid; } main { padding: 18px 16px 60px; } .topbar { padding: 10px 16px; }
  .usermenu .who { display: none; }
}

/* ---- surfaces ---- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.card + .card { margin-top: 16px; } .card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .gauto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.split { display: grid; grid-template-columns: minmax(300px, 440px) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .split { grid-template-columns: 1fr; } }
.stack-l > * + * { margin-top: 16px; }

/* KPI tiles */
.kpi { display: flex; gap: 14px; align-items: center; }
.kpi .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.kpi .v { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; } .kpi .l { color: var(--muted); font-size: 13px; }
.t-warn .ico { background: var(--warn-bg); color: var(--warn); } .t-ok .ico { background: var(--ok-bg); color: var(--ok); }
.t-info .ico { background: var(--info-bg); color: var(--info); } .t-bad .ico { background: var(--bad-bg); color: var(--bad); }
.t-violet .ico { background: var(--violet-bg); color: var(--violet); }

/* brand cards */
.brandcard { position: relative; overflow: hidden; }
.brandcard .stripe { position: absolute; inset: 0 0 auto 0; height: 4px; }
.brandcard .top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.brandcard .logo { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 16px; }
.brandcard h2 { margin: 0; font-size: 16px; } .brandcard .mode { font-size: 12.5px; color: var(--muted); }
.progress { height: 7px; border-radius: 99px; background: var(--line-2); overflow: hidden; display: flex; }
.progress span { display: block; height: 100%; } .p-ok { background: var(--ok); } .p-warn { background: #F59E0B; } .p-info { background: #60A5FA; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-inline-end: 5px; }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: var(--radius-s); border: 1px solid var(--line);
       background: var(--panel); color: var(--ink-2); font: 500 13.5px var(--font); cursor: pointer; text-decoration: none; white-space: nowrap;
       transition: background .12s, border-color .12s, transform .05s; }
.btn:hover { background: var(--panel-2); text-decoration: none; border-color: color-mix(in srgb, var(--ink) 18%, var(--line)); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; } .btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; } .btn.ghost:hover { background: var(--panel-2); }
.btn.s { padding: 5px 10px; font-size: 12.5px; } .btn[disabled] { opacity: .5; cursor: not-allowed; }
button.link { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 0; display: inline-flex; gap: 6px; align-items: center; }
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin: 12px 0 5px; }
input, select, textarea { width: 100%; font: 14px var(--font); color: var(--ink); background: var(--panel); border: 1px solid var(--line);
                          border-radius: var(--radius-s); padding: 9px 11px; outline: none; transition: border-color .12s, box-shadow .12s; }
textarea { font-family: Almarai, var(--font); line-height: 1.7; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
input[type=checkbox] { width: auto; accent-color: var(--accent); } input[type=number] { width: 84px; }
input[readonly], textarea[readonly] { background: var(--panel-2); color: var(--ink-2); }
.inline { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; } .inline label { margin: 0; }
.formrow { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; } .formrow > div { flex: 1; min-width: 140px; }
.help { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sticky-actions { position: sticky; top: 64px; z-index: 3; }

/* badges & states */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600;
         background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.b-ok, .badge.approved, .badge.done, .badge.published, .badge.scheduled, .badge.produced { background: var(--ok-bg); color: var(--ok); }
.b-warn, .badge.pending_approval, .badge.queued, .badge.draft, .badge.planned, .badge.partial { background: var(--warn-bg); color: var(--warn); }
.b-bad, .badge.rejected, .badge.failed, .badge.needs_human, .badge.prohibited, .badge.missing { background: var(--bad-bg); color: var(--bad); }
.b-info, .badge.running, .badge.compliance_review { background: var(--info-bg); color: var(--info); }
.badge.f-post { background: var(--info-bg); color: var(--info); } .badge.f-reel { background: var(--violet-bg); color: var(--violet); }
.badge.f-story { background: #FDF2F8; color: #BE185D; } .badge.skipped, .badge.cancelled { background: var(--line-2); color: var(--faint); }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; } .nowrap { white-space: nowrap; } .error { color: var(--bad); }
.alert { display: flex; gap: 10px; padding: 11px 13px; border-radius: 11px; font-size: 13.5px; margin-bottom: 12px; }
.alert.warn { background: var(--warn-bg); color: var(--warn); } .alert.bad { background: var(--bad-bg); color: var(--bad); }
.alert.info { background: var(--info-bg); color: var(--info); } .alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert pre { color: var(--ink-2); }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); } .empty .icon { color: var(--faint); margin-bottom: 8px; }

/* tables */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th { text-align: start; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
            padding: 10px 14px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; } .table tr.click:hover td { background: var(--panel-2); cursor: pointer; }
.table tr.dim td { opacity: .5; }
.thumb { width: 52px; height: 65px; object-fit: cover; border-radius: 8px; display: block; box-shadow: var(--shadow); background: var(--line-2); }
.thumb.ph { display: grid; place-items: center; color: var(--faint); }
.cell-title { font-weight: 600; color: var(--ink); max-width: 520px; } .cell-sub { color: var(--muted); font-size: 12.5px; max-width: 520px; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
@media (max-width: 1100px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding: 14px 16px; border-inline-end: 1px solid var(--line-2); }
.step:last-child { border-inline-end: 0; }
.step .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12.5px;
           background: var(--line-2); color: var(--muted); margin-bottom: 8px; }
.step.done .n { background: var(--ok); color: #fff; } .step.now .n { background: var(--accent); color: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.step b { display: block; font-size: 13.5px; } .step .s { color: var(--muted); font-size: 12.5px; margin: 2px 0 10px; }
.step form { margin: 0; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.cal .dow { padding: 8px 10px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.cal .day { min-height: 118px; padding: 8px; border-inline-end: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.cal .day:nth-child(7n) { border-inline-end: 0; } .cal .day.out { background: var(--panel-2); }
.cal .day .d { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; } .cal .day.today .d { color: var(--accent); }
.chip { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 8px; margin-bottom: 4px; font-size: 12px; color: var(--ink-2);
        background: var(--panel-2); border: 1px solid var(--line-2); text-decoration: none; overflow: hidden; }
.chip:hover { border-color: var(--accent); text-decoration: none; }
.chip img { width: 22px; height: 28px; object-fit: cover; border-radius: 4px; flex: none; }
.chip .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .chip.dim { opacity: .45; }
.chip .st { width: 7px; height: 7px; border-radius: 50%; flex: none; margin-inline-start: auto; }
@media (max-width: 900px) { .cal, .week { display: none; } }

/* media panel */
.mediabox img, .mediabox video { width: 100%; display: block; border-radius: 12px; background: #000; }
.mediabox .alt { display: flex; gap: 8px; margin-top: 10px; }
.drop { border: 1.5px dashed var(--line); border-radius: 12px; padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }
.drop input { border: 0; padding: 8px 0; background: transparent; }

/* tabs & toggles */
.tabs { display: inline-flex; padding: 3px; gap: 2px; background: var(--line-2); border-radius: 10px; }
.tabs a { padding: 5px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 13px; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.tabs a.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; } .timeline li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line-2); font-size: 13px; }
.timeline li:last-child { border-bottom: 0; } .timeline .when { color: var(--faint); width: 128px; flex: none; }

/* jobs */
.job { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px; background: var(--panel-2); border: 1px solid var(--line-2);
       font-size: 13px; margin-top: 8px; flex-wrap: wrap; }
.job .spin { animation: spin 1s linear infinite; color: var(--info); } @keyframes spin { to { transform: rotate(360deg); } }
.job .grow { flex: 1; min-width: 160px; }

pre { white-space: pre-wrap; margin: 6px 0; font-size: 13px; }
details > summary { cursor: pointer; } details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; } details.menu > summary::-webkit-details-marker { display: none; }
details.menu[open] > .pop { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 10; width: 340px; }
.pop { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-l); padding: 14px; }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login .hero { background: radial-gradient(1200px 600px at 10% 10%, color-mix(in srgb, var(--accent) 70%, #7C3AED) 0%, var(--accent) 40%, #0B1320 100%);
               color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login .hero h1 { font-size: 40px; line-height: 1.1; letter-spacing: -.03em; max-width: 520px; }
.login .hero p { opacity: .85; max-width: 460px; font-size: 16px; }
.login .hero .feat { display: grid; gap: 10px; margin-top: 26px; } .login .hero .feat div { display: flex; gap: 10px; align-items: center; opacity: .92; }
.login .form { display: grid; place-items: center; padding: 40px; } .login .box { width: 100%; max-width: 380px; }
.gbtn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 12px; border-radius: 11px; border: 1px solid var(--line);
        background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.gbtn:hover { text-decoration: none; border-color: var(--accent); }
@media (max-width: 900px) { .login { grid-template-columns: 1fr; } .login .hero { padding: 32px; } .login .hero h1 { font-size: 30px; } }

/* knowledge health matrix */
details.area > summary.areahead { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer;
  list-style: none; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
details.area > summary.areahead::-webkit-details-marker { display: none; }
details.area > summary.areahead .t { color: var(--ink); }
details.area[open] > summary.areahead { border-bottom: 1px solid var(--line-2); }
.matrix td:first-child { width: 58%; }
details.howto { margin-top: 4px; } details.howto > summary { color: var(--accent); cursor: pointer; width: max-content; }
details.howto > div { margin-top: 6px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); }
details.howto p { margin: 0 0 6px; }
.show-s { display: none; }
.compare { overflow-x: auto; }
.compare th:first-child, .compare td:first-child { position: sticky; inset-inline-start: 0; background: var(--panel); z-index: 1; min-width: 260px; }
.compare td.cell { text-align: center; }
@media (max-width: 720px) { .hide-s { display: none; } .show-s { display: block; } .matrix td:first-child { width: auto; } }
.compare .table { table-layout: fixed; min-width: 640px; }
.compare .table th:first-child, .compare .table td:first-child { width: 44%; }
/* cards side by side in a grid line up: the stacking gap applies to cards in a column only */
.grid > .card + .card, .split > .card + .card { margin-top: 0; }

/* status dots (calendar, legend) */
.st-planned { background: var(--line); } .st-draft, .st-compliance_review { background: #A3A3A3; }
.st-pending_approval { background: #F59E0B; } .st-needs_human { background: #EA580C; }
.st-approved { background: var(--ok); } .st-scheduled { background: #2563EB; } .st-publishing { background: #7C3AED; }
.st-published { background: #059669; box-shadow: 0 0 0 2px color-mix(in srgb, #059669 30%, transparent); }
.st-failed, .st-rejected { background: var(--bad); } .st-cancelled { background: var(--faint); }
/* toast after an action */
.toast { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 10px 14px; border-radius: 12px;
  background: var(--ok-bg, #ECFDF5); color: var(--ok); font-weight: 600; transition: opacity .6s; }
.toast .btn { margin-inline-start: auto; } .toast.fade { opacity: 0; pointer-events: none; }
/* review queue */
.queuebar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.queuebar .small { flex: 1; text-align: center; }
kbd { font: 600 11px ui-monospace, Menlo, monospace; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--panel-2); }
/* quick-look drawer */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--panel); border-inline-start: 1px solid var(--line);
  box-shadow: -12px 0 40px rgba(0,0,0,.12); transform: translateX(105%); transition: transform .2s ease; z-index: 30; overflow-y: auto; }
.drawer.open { transform: none; } .drawer-in { padding: 16px; } .drawer-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
/* platform previews */
.pv { margin: 0 auto; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #fff; color: #111; max-width: 360px; }
.pv-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 13px; }
.pv-avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #F58529, #DD2A7B, #8134AF); }
.pv-plat { margin-inline-start: auto; font-size: 11px; color: #777; }
.pv-media { position: relative; background: #111; aspect-ratio: 4 / 5; display: grid; place-items: center; }
.pv-media img, .pv-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-tall .pv-media { aspect-ratio: 9 / 16; }
.pv-empty { color: #aaa; text-align: center; }
.pv-overlay { position: absolute; left: 12px; right: 52px; bottom: 14px; color: #fff; font-size: 12.5px; line-height: 1.4;
  text-shadow: 0 1px 3px rgba(0,0,0,.6); white-space: pre-line; }
.pv-bars { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; gap: 4px; }
.pv-bars span { flex: 1; height: 2px; background: rgba(255,255,255,.6); border-radius: 2px; }
.pv-actions { padding: 8px 12px 0; font-size: 18px; }
.pv-caption { padding: 6px 12px 12px; font-size: 13px; line-height: 1.45; white-space: pre-line; }
.pv-caption .pv-full { display: none; } .pv-caption.open .pv-full { display: inline; } .pv-caption.open .pv-short { display: none; }
.pv-caption a { color: #888; }
.pv-tiktok { background: #000; color: #fff; border-color: #222; } .pv-tiktok .pv-plat { color: #aaa; }
.pv-tiktok .pv-avatar { background: linear-gradient(135deg, #25F4EE, #FE2C55); }
.pv-meta { text-align: center; margin-top: 8px; } .text-bad { color: var(--bad); font-weight: 600; }
/* publishing calendar */
.drop.over { outline: 2px dashed var(--accent); outline-offset: -3px; background: color-mix(in srgb, var(--accent) 6%, transparent); }
.chip.dragging { opacity: .4; } .chip[draggable="true"] { cursor: grab; }
.chip.clash { box-shadow: inset 0 0 0 1.5px #EA580C; }
.chip .tm { font-weight: 700; margin-inline-end: 2px; }
.offer-band { font-size: 10.5px; font-weight: 600; color: #7C2D12; background: #FFEDD5; border-radius: 4px; padding: 1px 6px; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week { display: grid; grid-template-columns: 56px repeat(7, minmax(110px, 1fr)); min-width: 860px; }
.wk-h { padding: 8px; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: var(--panel); }
.wk-h.today { color: var(--accent); }
.wk-hr { font-size: 11px; color: var(--faint); padding: 6px 6px 0; border-top: 1px solid var(--line-2); }
.slot { min-height: 40px; padding: 3px; border-top: 1px solid var(--line-2); border-inline-start: 1px solid var(--line-2); }
@media print { .side, .topbar, .actions, form, .help, #drawer, .toast { display: none !important; } .shell { display: block; } .card { break-inside: avoid; box-shadow: none; } }

/* bulk bar */
.bulkbar { position: sticky; bottom: 12px; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0;
  padding: 10px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 8px 30px rgba(0,0,0,.12); }
.bulkbar .inline input { padding: 5px 8px; }
td.sel, th.sel { width: 30px; padding-inline-end: 0; }

.diff del, del { background: #FEE2E2; color: #991B1B; text-decoration: line-through; border-radius: 3px; padding: 0 2px; }
.diff ins, ins { background: #DCFCE7; color: #166534; text-decoration: none; border-radius: 3px; padding: 0 2px; }

[hidden] { display: none !important; }

:root[data-theme="dark"] {
  --bg: #0B0F14; --panel: #121821; --panel-2: #0F141B; --line: #1F2833; --line-2: #19212B;
  --ink: #E6EAF0; --ink-2: #C3CBD5; --muted: #8A96A6; --faint: #808B9A;
  --ok-bg: #0B2A22; --warn-bg: #2A2110; --bad-bg: #2C1414; --info-bg: #0F1E36; --violet-bg: #1D1633;
  --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-l: 0 10px 30px -12px rgba(0,0,0,.7);
}
/* top bar search, brand switcher, command palette */
.topsearch { margin-inline-start: auto; } .topsearch input { width: 220px; padding: 6px 10px; border-radius: 10px; }
.brandswitch { width: auto; padding: 6px 8px; border-radius: 10px; }
.topsearch + .brandswitch, .topsearch ~ .bell { margin-inline-start: 0; }
.palette { position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .35); display: grid; place-items: start center; padding-top: 12vh; }
.palette-box { width: min(560px, 92vw); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-l); overflow: hidden; }
.palette-box input { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 14px 16px; font-size: 16px; }
#palette-list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow: auto; }
#palette-list li { padding: 8px 12px; border-radius: 10px; cursor: pointer; } #palette-list li.on, #palette-list li:hover { background: var(--panel-2); color: var(--accent); }
.weekstrip { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }

/* accessibility pass (UI review 8 Oct) */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }  /* they have their own ring */
tr[data-href] { cursor: pointer; } tr[data-href]:focus-visible { outline-offset: -2px; background: var(--panel-2); }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 100; padding: 8px 14px; border-radius: 9px; background: var(--panel); box-shadow: var(--shadow-l); font-weight: 600; }
.skip:focus { top: 8px; }
main:focus { outline: none; }
.areatabs { display: flex; flex-wrap: wrap; gap: 4px; margin: -6px 0 18px; padding: 0; background: none; border-radius: 0; border-bottom: 1px solid var(--line); }
.areatabs a { border-radius: 0; padding: 8px 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); }
.areatabs a:hover { color: var(--ink); text-decoration: none; }
.areatabs a.on { background: none; box-shadow: none; color: var(--accent); border-bottom-color: var(--accent); }
.toast.bad { background: var(--warn-bg); color: var(--warn); }
#toasts:empty { display: none; }
#livetoasts { position: fixed; inset-inline-end: 16px; bottom: 16px; z-index: 60; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); }
#livetoasts .toast { margin: 0; box-shadow: var(--shadow-l); }
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink); box-shadow: var(--shadow-l); width: min(380px, 92vw); padding: 18px; }
dialog::backdrop { background: rgba(15, 23, 42, .35); }
dialog label { display: block; margin-bottom: 10px; }
/* status is never colour alone: held and failed states also differ in shape */
.st-needs_human, .st-failed, .st-rejected { border-radius: 2px !important; }
.st-planned { box-shadow: inset 0 0 0 1.5px var(--muted); background: transparent; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* phones (UI review must-item: mobile agenda and approval view) */
.agenda { display: none; }
.ag-day { margin: 0; padding: 12px 14px 6px; font-size: 12px; border-top: 1px solid var(--line-2); }
.ag-day:first-child { border-top: 0; } .ag-day.today { color: var(--accent); }
.ag-list { list-style: none; margin: 0; padding: 0 8px 8px; }
.ag-item { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 10px; }
.ag-item.moved { background: var(--ok-bg); }
.ag-link { flex: 1; min-width: 0; display: flex; gap: 10px; align-items: flex-start; color: var(--ink); padding: 6px 0; min-height: 44px; }
.ag-link:hover { text-decoration: none; }
.ag-link img, .ag-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; background: var(--line-2); }
.ag-body { min-width: 0; font-size: 13px; } .ag-title { display: block; color: var(--ink-2); margin: 2px 0 4px; overflow-wrap: anywhere; }
.ag-offer { padding: 4px 6px; color: var(--violet); }
.ag-move { flex: none; min-height: 36px; }
@media (max-width: 900px) {
  .agenda { display: block; }
  .crumbs { overflow: hidden; white-space: nowrap; justify-content: flex-end; }  /* keep the last crumbs visible */
  .topbar { gap: 8px; }
}
@media (max-width: 720px) {
  h1 { font-size: 20px; }
  .btn, summary.btn { min-height: 40px; }
  /* list tables become cards */
  .table.stack thead { display: none; }
  .table.stack tr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
  .table.stack td { padding: 0; border: 0; white-space: normal; }
  .table.stack td:not(.sel) { grid-column: 2; }
  .table.stack td.sel { grid-row: 1 / span 4; align-self: start; padding-top: 2px; }
  /* the decision stays under the thumb on the post page */
  .sticky-actions.decide { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 15; margin: 0 !important; border-radius: 16px 16px 0 0;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px rgba(0,0,0,.12); }
  .sticky-actions.decide .why { display: none; }
  .sticky-actions.decide > .actions { flex-wrap: nowrap; }
  .sticky-actions.decide .actions .actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 6px; }
  .sticky-actions.decide .actions .actions > * { min-width: 0; }
  .sticky-actions.decide .btn { width: 100%; justify-content: center; padding-inline-start: 8px; padding-inline-end: 8px; }
  .sticky-actions.decide details.menu[open] > .pop { position: fixed; left: 8px; right: 8px; bottom: calc(76px + env(safe-area-inset-bottom)); top: auto; width: auto; }
  body.has-decide main { padding-bottom: 110px; }
  .sticky-actions.decide .show-s { display: inline-flex; }
  .queuebar { flex-wrap: wrap; } .queuebar .small { order: -1; flex-basis: 100%; }
}

/* what was checked (UX review 8 Oct) */
.checklist { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 6px; }
.checklist li { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border-radius: 9px; }
.checklist li.ok { padding: 2px 8px; }
.checklist li.ok .ck-icon { color: var(--ok); }
.checklist li.soft { background: var(--warn-bg); } .checklist li.soft .ck-icon { color: var(--warn); }
.checklist li.legal { background: var(--warn-bg); outline: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.checklist li.legal .ck-icon { color: var(--warn); }
.checklist li.hard { background: var(--bad-bg); } .checklist li.hard .ck-icon { color: var(--bad); }
.ck-icon { flex: none; margin-top: 2px; }
.checks h3 { margin-top: 14px; }
/* breadcrumbs never collide with the search box (UX-08): search moves to / and Ctrl/Cmd K on mid widths */
.crumbs { overflow: hidden; white-space: nowrap; }
@media (max-width: 1000px) { .topsearch { display: none; } }

.claimpick { display: grid; gap: 4px; max-height: 220px; overflow-y: auto; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-s); }
.claimpick label { display: flex; gap: 8px; align-items: flex-start; }

.staging-banner { position: sticky; top: 0; z-index: 90; background: repeating-linear-gradient(45deg, #B45309, #B45309 12px, #92400E 12px, #92400E 24px);
  color: #fff; font-weight: 700; text-align: center; padding: 4px 8px; font-size: 12.5px; letter-spacing: .04em; }
