/* Food Facts Daily dashboard. Brand: basil #1E6B4A, Bricolage Grotesque (display) + Geist (text). */
@font-face { font-family: "Bricolage Grotesque"; src: url("/static/fonts/bricolage-latin.woff2") format("woff2"); font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/static/fonts/geist-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #f6f7f4; --surface: #ffffff; --surface-2: #fbfbf9; --sunk: #eef0eb; --hover: #f1f3ee;
  --ink: #14201a; --ink-2: #48544d; --ink-3: #75807a; --line: #e2e6de; --line-2: #d3d9cf;
  --basil: #1e6b4a; --basil-hi: #17573c; --basil-ink: #fff; --basil-wash: #e5efe8; --basil-line: #c3dccb;
  --ok: #1e7a4c; --ok-wash: #e3f2e8; --warn: #9a5b00; --warn-wash: #fbf0dc; --bad: #c0362c; --bad-wash: #fbe7e4;
  --info: #3451b2; --info-wash: #e8edfb; --violet: #6a4bb5; --violet-wash: #efeafb;
  --shadow: 0 1px 2px rgba(20, 32, 26, .04), 0 1px 1px rgba(20, 32, 26, .03);
  --shadow-lg: 0 10px 30px -12px rgba(20, 32, 26, .25), 0 2px 6px rgba(20, 32, 26, .06);
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --text: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --r: 12px; --r-sm: 8px; --side: 244px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c110e; --surface: #131a16; --surface-2: #101612; --sunk: #19221d; --hover: #1a241f;
    --ink: #e6ece7; --ink-2: #a9b4ad; --ink-3: #7d8982; --line: #222c26; --line-2: #2d3a33;
    --basil: #6cc699; --basil-hi: #8fd8b2; --basil-ink: #0b1510; --basil-wash: #17271e; --basil-line: #2a4a38;
    --ok: #6cc699; --ok-wash: #15281d; --warn: #e3a64a; --warn-wash: #2a2010; --bad: #f08070; --bad-wash: #2c1614;
    --info: #8ea7f2; --info-wash: #161d33; --violet: #b29cf0; --violet-wash: #211a33;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 12px 32px -12px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c110e; --surface: #131a16; --surface-2: #101612; --sunk: #19221d; --hover: #1a241f;
  --ink: #e6ece7; --ink-2: #a9b4ad; --ink-3: #7d8982; --line: #222c26; --line-2: #2d3a33;
  --basil: #6cc699; --basil-hi: #8fd8b2; --basil-ink: #0b1510; --basil-wash: #17271e; --basil-line: #2a4a38;
  --ok: #6cc699; --ok-wash: #15281d; --warn: #e3a64a; --warn-wash: #2a2010; --bad: #f08070; --bad-wash: #2c1614;
  --info: #8ea7f2; --info-wash: #161d33; --violet: #b29cf0; --violet-wash: #211a33;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 12px 32px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--text); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--basil); }
img, svg, video { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--basil); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -.02em; font-weight: 650; }
h1 { font-size: 24px; line-height: 1.15; font-variation-settings: "opsz" 48; }
h2 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; font-variation-settings: "opsz" 24; }
h3 { font-size: 14px; font-weight: 600; letter-spacing: -.005em; }
p { margin: 0 0 .8em; }
code, .mono { font-family: var(--mono); font-size: 12px; }
code { background: var(--sunk); padding: 1px 6px; border-radius: 5px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); } .ink2 { color: var(--ink-2); }
.small { font-size: 12.5px; } .tiny { font-size: 11.5px; }
.nowrap { white-space: nowrap; } .ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; } .row.wrap { flex-wrap: wrap; } .row.top { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.grow { flex: 1; min-width: 0; } .gap-l { gap: 16px; } .gap-s { gap: 4px; }
.stack > * + * { margin-top: 16px; }
.hide { display: none !important; }

/* ---------- 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(--surface-2); border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 16px; font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: -.03em; font-variation-settings: "opsz" 32; }
.brand svg { width: 26px; height: 26px; flex: none; }
.brand svg { color: var(--basil); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 500; }
.nav a svg { width: 17px; height: 17px; flex: none; color: var(--ink-3); }
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }
.nav a.on svg { color: var(--basil); }
.nav .count { margin-left: auto; font-size: 11px; font-weight: 600; background: var(--bad-wash); color: var(--bad); padding: 0 7px; border-radius: 99px; line-height: 18px; }
.side-label { font-size: 11px; font-weight: 600; color: var(--ink-3); padding: 18px 10px 6px; letter-spacing: .02em; display: flex; align-items: center; }
.side-label a { margin-left: auto; color: var(--ink-3); } .side-label a:hover { color: var(--basil); }
.side-label svg { width: 15px; height: 15px; }
.nav a .av { width: 20px; height: 20px; }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; padding-left: 8px; }
.side-foot .who { font-weight: 600; font-size: 13px; }
.iconbtn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; padding: 0; }
.iconbtn:hover { background: var(--hover); color: var(--ink); }
.iconbtn svg { width: 17px; height: 17px; }
.main { min-width: 0; }
.topbar { display: none; }
.content { max-width: 1320px; margin: 0 auto; padding: 26px 32px 80px; }
.head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head .sub { color: var(--ink-3); margin-top: 4px; font-size: 13.5px; }
.head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.banner { display: flex; gap: 10px; align-items: center; padding: 9px 14px; border-radius: 10px; margin-bottom: 18px; font-size: 13px; border: 1px solid; }
.banner svg { width: 16px; height: 16px; flex: none; }
.banner.warn { background: var(--warn-wash); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.banner.bad { background: var(--bad-wash); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.banner.ok { background: var(--ok-wash); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 50; max-width: 420px; box-shadow: var(--shadow-lg); animation: toast 4.5s ease forwards; }
@keyframes toast { 0% { opacity: 0; transform: translateY(8px); } 6%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(8px); visibility: hidden; } }
.toast.bad { animation-duration: 9s; }

/* ---------- cards, tiles ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px 0; }
.card-h .more { margin-left: auto; font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.card-h .more:hover { color: var(--basil); }
.card-b { padding: 14px 16px 16px; }
.card-b.flush { padding: 8px 0 4px; }
.grid { display: grid; gap: 16px; }
.grid > *, .stack > *, .accts > * { min-width: 0; }
html, body { overflow-x: hidden; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split { grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); align-items: start; }
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.tile { padding: 14px 16px 15px; border-right: 1px solid var(--line); min-width: 0; }
.tile:last-child { border-right: 0; }
.tile .k { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; font-weight: 500; }
.tile .k svg { width: 14px; height: 14px; }
.tile .v { font-family: var(--display); font-size: 28px; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 4px; font-variation-settings: "opsz" 48; }
.tile .v.bad { color: var(--bad); } .tile .v.warn { color: var(--warn); }
.tile .d { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
a.tile:hover { background: var(--hover); color: inherit; }

/* ---------- account avatars + cards ---------- */
.av { width: 36px; height: 36px; border-radius: 50%; flex: none; object-fit: cover; background: var(--acc, var(--basil)); display: grid; place-items: center; color: #fff; font-family: var(--display); font-weight: 700; font-size: 14px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06); }
.av.lg { width: 64px; height: 64px; font-size: 24px; } .av.sm { width: 24px; height: 24px; font-size: 11px; } .av.xs { width: 18px; height: 18px; font-size: 9px; }
.accts { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 12px; }
.acct { position: relative; padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.acct::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--acc); }
.acct:hover { border-color: var(--line-2); box-shadow: var(--shadow-lg); color: inherit; }
.acct.off { opacity: .55; }
.acct .name { font-weight: 600; font-size: 14px; letter-spacing: -.01em; }
.acct .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.acct .stats b { display: block; font-family: var(--display); font-size: 19px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.acct .stats span { font-size: 11.5px; color: var(--ink-3); }
.acct .foot { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
.spark { width: 100%; height: 34px; }
.spark path { fill: color-mix(in srgb, var(--acc, var(--basil)) 14%, transparent); stroke: none; }
.spark polyline { fill: none; stroke: var(--acc, var(--basil)); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark.empty line { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.role { line-height: 14px; display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; padding: 1px 6px; border-radius: 5px; background: var(--sunk); color: var(--ink-2); }
.role.main { background: var(--basil-wash); color: var(--basil); }

/* ---------- platform + status ---------- */
.pf { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--sunk); color: var(--ink); flex: none; position: relative; }
.pf svg { width: 13px; height: 13px; }
.pf.lg { width: 34px; height: 34px; border-radius: 9px; } .pf.lg svg { width: 18px; height: 18px; }
.pf .st { position: absolute; right: -2px; bottom: -2px; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--surface); box-sizing: content-box; }
.st.ok, .dot.ok { background: var(--ok); } .st.warn, .dot.warn { background: var(--warn); } .st.bad, .dot.bad { background: var(--bad); } .st.off, .dot.off { background: var(--ink-3); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.chans { display: flex; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 8px 2px 7px; border-radius: 99px; background: var(--sunk); color: var(--ink-2); white-space: nowrap; line-height: 16px; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.pill.plain::before { display: none; }
.pill.queued { background: var(--info-wash); color: var(--info); }
.pill.posted { background: var(--ok-wash); color: var(--ok); }
.pill.failed { background: var(--bad-wash); color: var(--bad); }
.pill.sent { background: var(--warn-wash); color: var(--warn); }
.pill.publishing { background: var(--violet-wash); color: var(--violet); }
.pill.publishing::before { animation: pulse 1.2s ease-in-out infinite; }
.pill.skipped, .pill.expired { color: var(--ink-3); }
@keyframes pulse { 50% { opacity: .25; } }
.mode { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--ink-2); white-space: nowrap; }

/* ---------- lists / tables ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-top: 1px solid var(--line); min-width: 0; }
.list li:first-child { border-top: 0; }
.list li:hover { background: var(--hover); }
.list .when { width: 78px; flex: none; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.empty { padding: 26px 16px; text-align: center; color: var(--ink-3); font-size: 13px; }
.empty svg { width: 22px; height: 22px; margin: 0 auto 8px; color: var(--ink-3); opacity: .7; }
.tbl-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
.t th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.t th.r, .t td.r { text-align: right; }
.t th[data-sort] { cursor: pointer; user-select: none; }
.t th[data-sort]:hover { color: var(--ink); }
.t th[aria-sort="ascending"]::after { content: " ↑"; } .t th[aria-sort="descending"]::after { content: " ↓"; }
.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: var(--hover); }
.t td.num, .t td.r { font-variant-numeric: tabular-nums; }
.t input[type="checkbox"] { width: 15px; height: 15px; }
.attn { list-style: none; margin: 0; padding: 0; }
.attn li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 16px; border-top: 1px solid var(--line); }
.attn li:first-child { border-top: 0; }
.attn .ic { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.attn .ic svg { width: 15px; height: 15px; }
.attn .bad .ic { background: var(--bad-wash); color: var(--bad); } .attn .warn .ic { background: var(--warn-wash); color: var(--warn); }
.attn .kind { font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.attn .ttl { font-weight: 600; }
.attn .txt { font-size: 12.5px; color: var(--ink-2); word-break: break-word; }

/* ---------- forms + buttons ---------- */
.btn { font: 500 13px/1 var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap; box-shadow: var(--shadow); transition: background .12s, border-color .12s; }
.btn:hover { background: var(--hover); color: var(--ink); }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--basil); border-color: var(--basil); color: var(--basil-ink); }
.btn.primary:hover { background: var(--basil-hi); border-color: var(--basil-hi); color: var(--basil-ink); }
.btn.danger { color: var(--bad); } .btn.danger:hover { background: var(--bad-wash); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }
.btn.sm { height: 27px; padding: 0 9px; font-size: 12.5px; border-radius: 7px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
form.inline { display: inline; }
label.f { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin: 14px 0 6px; }
.card-b > label.f:first-child, form > label.f:first-child { margin-top: 0; }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 5px; }
input[type="text"], input[type="password"], input[type="url"], input[type="search"], input[type="datetime-local"], input:not([type]), select, textarea {
  font: 13.5px/1.4 var(--text); width: 100%; padding: 7px 10px; min-height: 34px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); color: var(--ink); transition: border-color .12s, box-shadow .12s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--basil); box-shadow: 0 0 0 3px color-mix(in srgb, var(--basil) 18%, transparent); }
textarea { min-height: 120px; resize: vertical; }
input[type="color"] { width: 44px; height: 34px; padding: 2px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); }
input[type="checkbox"] { accent-color: var(--basil); width: 16px; height: 16px; margin: 0; }
.check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; margin: 8px 0; cursor: pointer; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.seg { display: inline-flex; background: var(--sunk); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a, .seg button { font: 500 12.5px/1 var(--text); padding: 6px 10px; border-radius: 7px; color: var(--ink-2); border: 0; background: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg a:hover { color: var(--ink); }
.seg a.on, .seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }
.seg > a > svg { width: 14px; height: 14px; }
.seg .av, .seg .pf { width: 16px; height: 16px; font-size: 8px; } .seg .pf svg { width: 10px; height: 10px; }
details.more > summary { cursor: pointer; list-style: none; font-weight: 500; color: var(--ink-2); font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "›"; display: inline-block; transition: transform .15s; font-size: 16px; line-height: 1; }
details.more[open] > summary::before { transform: rotate(90deg); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 9px 12px 10px; color: var(--ink-3); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-color: var(--basil); }
.tab { display: none; } .tab.on { display: block; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ax { fill: var(--ink-3); font: 11px var(--text); font-variant-numeric: tabular-nums; }
.chart .area { fill: color-mix(in srgb, var(--acc, var(--basil)) 13%, transparent); }
.chart .line { fill: none; stroke: var(--acc, var(--basil)); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dot { fill: var(--acc, var(--basil)); stroke: var(--surface); stroke-width: 2; }
.tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; box-shadow: var(--shadow-lg); font-size: 12px; white-space: nowrap; transform: translate(-50%, -110%); z-index: 3; }
.tip b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.tip span { color: var(--ink-3); }
.bar-row { display: grid; grid-template-columns: 140px 1fr 56px; align-items: center; gap: 10px; font-size: 12.5px; padding: 4px 0; }
.bar-row .bar { height: 8px; background: var(--sunk); border-radius: 4px; overflow: hidden; }
.bar-row .bar i { display: block; height: 100%; background: var(--basil); border-radius: 4px; }
.meter { height: 6px; background: var(--sunk); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--basil); border-radius: 3px; }
.meter.warn i { background: var(--warn); } .meter.bad i { background: var(--bad); }

/* ---------- calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.cal .day { border-right: 1px solid var(--line); min-height: 420px; display: flex; flex-direction: column; min-width: 0; }
.cal .day:last-child { border-right: 0; }
.cal .dh { padding: 10px 10px 8px; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; gap: 6px; background: var(--surface-2); position: sticky; top: 0; }
.cal .dh b { font-family: var(--display); font-size: 18px; font-weight: 650; letter-spacing: -.02em; }
.cal .dh span { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.cal .dh .n { margin-left: auto; font-size: 11px; color: var(--ink-3); }
.cal .day.today .dh b { color: var(--basil); }
.cal .day.today .dh { box-shadow: inset 0 2px 0 var(--basil); }
.cal .day.past { background: color-mix(in srgb, var(--sunk) 40%, transparent); }
.cal .slots { padding: 6px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cal .day.drop .slots { background: var(--basil-wash); outline: 2px dashed var(--basil-line); outline-offset: -4px; }
.ev { position: relative; display: block; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--acc); border-radius: 7px; padding: 6px 7px 6px 8px; font-size: 12px; box-shadow: var(--shadow); cursor: grab; }
.ev:hover { border-color: var(--line-2); border-left-color: var(--acc); color: inherit; box-shadow: var(--shadow-lg); }
.ev.dragging { opacity: .4; }
.ev .t { display: flex; align-items: center; gap: 5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ev .t .pf { width: 17px; height: 17px; border-radius: 5px; } .ev .t .pf svg { width: 10px; height: 10px; }
.ev .h { color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 3px; line-height: 1.35; }
.ev .a { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.ev.posted, .ev.skipped, .ev.expired { cursor: pointer; opacity: .75; }
.ev .pill { padding: 0 6px; font-size: 10.5px; margin-left: auto; }
.ev input { position: absolute; top: 7px; right: 7px; width: 14px; height: 14px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.bulkbar { position: sticky; bottom: 16px; z-index: 5; display: none; align-items: center; gap: 8px; margin: 14px auto 0; width: max-content; max-width: 100%; padding: 8px 10px 8px 16px; background: var(--ink); color: var(--bg); border-radius: 12px; box-shadow: var(--shadow-lg); flex-wrap: wrap; }
.bulkbar.on { display: flex; }
.bulkbar .btn { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 25%, transparent); box-shadow: none; }
.bulkbar .btn:hover { background: color-mix(in srgb, var(--bg) 12%, transparent); }

/* ---------- library ---------- */
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.vid { overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, border-color .15s; }
.vid:hover { box-shadow: var(--shadow-lg); border-color: var(--line-2); color: inherit; }
.vid .poster { position: relative; aspect-ratio: 9 / 13; background: #0b0f0d; overflow: hidden; }
.vid .poster > img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.vid:hover .poster > img { transform: scale(1.03); }
.vid .poster .av { box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.vid .poster .badges { position: absolute; left: 8px; right: 8px; top: 8px; display: flex; gap: 6px; align-items: center; }
.vid .poster .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 5px; font-variant-numeric: tabular-nums; }
.vid .poster .tag { background: rgba(0, 0, 0, .6); color: #fff; font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 5px; text-transform: capitalize; backdrop-filter: blur(6px); }
.vid .poster .tag.warn { background: var(--warn); }
.vid .meta { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.vid .ttl { font-weight: 600; font-size: 13.5px; line-height: 1.3; letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vid .foot { margin-top: auto; display: flex; align-items: center; gap: 6px; padding-top: 4px; font-size: 12px; color: var(--ink-3); }
.player { width: 100%; max-width: 340px; aspect-ratio: 9 / 16; background: #000; border-radius: 14px; box-shadow: var(--shadow-lg); }
.script p { margin: 0 0 10px; line-height: 1.55; }
.script .hookline { font-family: var(--display); font-size: 18px; font-weight: 650; letter-spacing: -.02em; line-height: 1.25; margin-bottom: 14px; }
.src { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.src li { counter-increment: s; padding: 9px 0 9px 28px; position: relative; border-top: 1px solid var(--line); font-size: 13px; }
.src li:first-child { border-top: 0; }
.src li::before { content: counter(s); position: absolute; left: 0; top: 10px; width: 18px; height: 18px; border-radius: 50%; background: var(--sunk); font-size: 11px; font-weight: 600; display: grid; place-items: center; color: var(--ink-2); }
.src a { color: var(--basil); word-break: break-all; font-size: 12px; }
.chan-pick { display: grid; gap: 8px; }
.chan-pick .grp { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.chan-pick .grp.disabled { opacity: .5; }
.chan-pick .opts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; }
.chan-pick .opts label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }

/* ---------- account page ---------- */
.hero { display: flex; gap: 18px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.hero .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--ink-3); font-size: 13px; }
.channels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chan { padding: 16px; }
.chan .top { display: flex; gap: 12px; align-items: center; }
.chan .state { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); }
.chan .nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 2px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.chan .nums b { display: block; font-family: var(--display); font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.chan .nums span { font-size: 11.5px; color: var(--ink-3); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; font-size: 13px; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; min-width: 0; word-break: break-word; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background:
  radial-gradient(1200px 500px at 50% -10%, var(--basil-wash), transparent 70%), var(--bg); }
.login .card { width: 100%; max-width: 380px; padding: 28px; }
.login .brand { padding: 0 0 18px; font-size: 18px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile:nth-child(3n) { border-right: 0; }
  .tile:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .cal { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cal .day { border-bottom: 1px solid var(--line); min-height: 220px; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: 280px; transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .side { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 30; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
  .topbar .brand { padding: 0; font-size: 15px; }
  .topbar .brand svg { width: 22px; height: 22px; }
  .content { padding: 18px 16px 70px; }
  .g2, .g3, .channels, .fgrid, #pkg-grid, #post-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .player { margin: 0 auto; max-width: 300px; }
  .cal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .head .actions { margin-left: 0; width: 100%; }
}
@media (max-width: 560px) {
  h1 { font-size: 21px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { border-right: 1px solid var(--line) !important; border-bottom: 1px solid var(--line); }
  .tile:nth-child(2n) { border-right: 0 !important; }
  .tile:nth-last-child(-n+2) { border-bottom: 0; }
  .tile .v { font-size: 23px; }
  .cal { grid-template-columns: minmax(0, 1fr); }
  .cal .day { min-height: 0; }
  .cal .day.emptyday .slots { display: none; }
  .lib { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .accts { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dd { margin-bottom: 8px; }
  .bar-row { grid-template-columns: 96px 1fr 48px; }
  .list .when { width: 64px; }
  .t .hide-sm, .hide-sm { display: none; }
  .chan .nums { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
/* channel profile links (2026-11-06) */
a.ext { color: inherit; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 2px; }
a.ext:hover { text-decoration-color: currentColor; }
a.pfl { display: inline-flex; border-radius: 6px; }
a.pfl:hover .pf { outline: 2px solid var(--line-2); }
.acct > .cover { position: absolute; inset: 0; z-index: 0; }
.acct .chans, .acct .chans a { position: relative; z-index: 1; }
.acct .chans { pointer-events: none; } .acct .chans a { pointer-events: auto; }

/* Watching page (2026-11-08) */
.note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 10px; font-size: 13px; background: var(--sunk); color: var(--ink-2); }
.note svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.note.warn { background: var(--warn-wash, var(--sunk)); color: var(--warn, var(--ink)); }
details.inline { display: inline-block; position: relative; vertical-align: middle; }
details.inline > summary { list-style: none; cursor: pointer; }
details.inline > summary::-webkit-details-marker { display: none; }
details.inline[open] > form { position: absolute; right: 0; z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 14px; text-align: left; }
details.inline form label { display: block; font-size: 12px; color: var(--ink-3); }
details.inline form input:not([type=checkbox]), details.inline form select { width: 100%; }
.tiny.ok { color: var(--ok); }
