/* DailyCut Studio dashboard. Brand "Il taglio" (assets/brand_dailycut/BRAND.md): paper, ink and ONE red.
   Square corners, thin lines, no shadows. The pages' own colours only appear on their own avatars/previews. */
:root {
  color-scheme: light;
  --bg: #F4F1EA;            /* carta */
  --surface: #FFFFFF;       /* cards, inputs */
  --surface-2: #ECE7DD;     /* hover, wells */
  --surface-3: #E4DED2;     /* sabbia */
  --line: rgba(18, 18, 18, 0.14);
  --line-2: rgba(18, 18, 18, 0.32);
  --ink: #121212;           /* inchiostro */
  --ink-2: #5F5A52;         /* grafite */
  --ink-3: #7A7468;
  --accent: #FF4A1C;        /* rosso taglio: never body text */
  --accent-ink: #121212;    /* text on red */
  --accent-soft: rgba(255, 74, 28, 0.12);
  --red-text: #9A3412;
  --bad: #9A3412; --bad-line: #C2410C;
  --ok: #2F8A47;
  --side-bg: #121212; --side-ink: #F4F1EA; --side-muted: #C9C3B7; --side-hover: #1F1E1C;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a;
  --grid: #E4DED2; --axis: #B9B1A3;
  --shadow-lg: 0 18px 60px rgba(18, 18, 18, 0.22);
  --b: 1.5px;
  --side: 240px;
  --tabbar: 0px;
  --display: "Space Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121212; --surface: #1A1918; --surface-2: #232220; --surface-3: #2E2C29;
    --line: rgba(244, 241, 234, 0.12); --line-2: rgba(244, 241, 234, 0.3);
    --ink: #F4F1EA; --ink-2: #C9C3B7; --ink-3: #8F887B;
    --accent-soft: rgba(255, 74, 28, 0.16); --bad: #F0A07E; --bad-line: #E2683A; --ok: #5DBB76;
    --side-bg: #0B0B0B; --side-hover: #1A1918;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70;
    --grid: #2E2C29; --axis: #4A4741;
    --shadow-lg: 0 18px 60px rgba(0, 0, 0, 0.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121212; --surface: #1A1918; --surface-2: #232220; --surface-3: #2E2C29;
  --line: rgba(244, 241, 234, 0.12); --line-2: rgba(244, 241, 234, 0.3);
  --ink: #F4F1EA; --ink-2: #C9C3B7; --ink-3: #8F887B;
  --accent-soft: rgba(255, 74, 28, 0.16); --bad: #F0A07E; --bad-line: #E2683A; --ok: #5DBB76;
  --side-bg: #0B0B0B; --side-hover: #1A1918;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70;
  --grid: #2E2C29; --axis: #4A4741;
  --shadow-lg: 0 18px 60px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
html { scrollbar-gutter: stable; }
body.locked { overflow: hidden; }
a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent); }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: var(--b) solid var(--line-2); border-radius: 0;
  padding: 9px 11px; width: 100%; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
input:disabled, select:disabled, textarea:disabled { color: var(--ink-3); background: var(--surface-2); border-color: var(--line); }
input.bad { border-color: var(--bad-line); }
input[type="checkbox"] { width: auto; accent-color: var(--ink); }
textarea { resize: vertical; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; }
h1 { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; }
h2 { font-family: var(--display); font-size: 21px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
h3 { font-family: var(--display); font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0; }
.muted { color: var(--ink-2); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); }
.err { color: var(--bad); }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row { display: flex; align-items: center; }
.row.wrap, .wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.gap-s { gap: 8px; }
.grow { flex: 1; min-width: 0; }
.w100 { width: 100%; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ic { flex: none; }
.pad { padding: 22px; position: relative; }

/* ---------------------------------------------------------------- layout */
.app { min-height: 100vh; }
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side); padding: 20px 0 16px; display: flex; flex-direction: column; gap: 22px;
  background: var(--side-bg); color: var(--side-ink); overflow-y: auto; z-index: 10;
}
.main { margin-left: var(--side); padding: 32px 40px 96px; max-width: 1260px; display: flex; flex-direction: column; gap: 20px; }
.topbar, .tabbar { display: none; }

.logo { display: flex; align-items: center; gap: 10px; padding: 0 20px; }
.logo img { width: 30px; height: 30px; display: block; }
.wm { display: flex; flex-direction: column; line-height: 1; }
.wm b { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: -0.05em; }
.wm b i { font-style: normal; color: var(--accent); }
.wm small { font-family: var(--mono); font-weight: 500; font-size: 8.5px; letter-spacing: .42em; margin-top: 4px; opacity: .75; }
.logo.big { padding: 0; }
.logo.big img { width: 44px; height: 44px; }
.logo.big .wm b { font-size: 28px; }
.logo.big .wm small { font-size: 10px; }

.nav { display: flex; flex-direction: column; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 20px; color: var(--side-muted); font-weight: 500; text-decoration: none;
  border-left: 3px solid transparent;
}
.nav a:hover { background: var(--side-hover); color: var(--side-ink); }
.nav a.on { color: var(--side-ink); border-left-color: var(--accent); background: var(--side-hover); font-weight: 600; }
.nav a.on .ic { color: var(--accent); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 14px; }
.farm { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid rgba(244,241,234,.16); color: var(--side-ink); font-size: 12.5px; font-weight: 500; text-decoration: none; }
.farm:hover { background: var(--side-hover); }
.farm small { width: 100%; padding-left: 16px; color: var(--side-muted); }
.side .icon-btn { color: var(--side-muted); }
.side .icon-btn:hover { background: var(--side-hover); color: var(--side-ink); }
.act-side { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid rgba(244,241,234,.16); background: none; color: var(--side-ink); font-weight: 500; font-size: 13px; text-align: left; }
.act-side:hover { background: var(--side-hover); }
.act-n { display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px; font-family: var(--mono); font-size: 11px; background: var(--accent); color: var(--accent-ink); }
.act-n .spin { border-width: 1.5px; }
.act-n.bad { background: transparent; color: var(--bad); border: 1px solid var(--bad-line); }
.side .act-n.bad { color: #F0A07E; }

.led { width: 8px; height: 8px; flex: none; background: var(--ink-3); }
.led.ok { background: var(--ok); }
.led.busy { background: var(--accent); animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: .35; } }
.led.bad { background: var(--bad); }
.led.off { background: var(--ink-3); opacity: .6; }

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: var(--b) solid var(--ink); position: relative; margin-bottom: 10px; }
.head::after { content: ""; position: absolute; left: 0; right: 0; bottom: -11px; height: 8px; background: repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 12px); opacity: .35; }
.head p { margin-top: 4px; max-width: 640px; }
.head-a { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.preview-bar { display: flex; gap: 8px; align-items: center; padding: 9px 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-size: 12.5px; font-weight: 500; }

/* which page the view shows */
.pswitch { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: -4px; }
.pswitch-l { font-family: var(--mono); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); margin-right: 4px; }
.pswitch button { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.pswitch button:hover { border-color: var(--ink); color: var(--ink); }
.pswitch button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pg-dot { width: 9px; height: 9px; flex: none; display: inline-block; }

/* ---------------------------------------------------------------- pieces */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px;
  border: var(--b) solid var(--ink); background: transparent; color: var(--ink); font-weight: 600; white-space: nowrap; text-decoration: none;
  transition: background .12s, color .12s, transform .05s;
}
.btn:hover:not(:disabled) { background: var(--ink); color: var(--bg); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover:not(:disabled) { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-accent { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: transparent; border-color: var(--bad-line); color: var(--bad); }
.btn-danger:hover:not(:disabled) { background: var(--bad-line); color: #fff; }
/* disabled = neutral, never a muddy red block */
.btn:disabled { background: transparent; border-color: var(--line-2); color: var(--ink-3); }
.btn-primary:disabled, .btn-accent:disabled { background: var(--surface-2); border-color: var(--surface-2); color: var(--ink-3); }
.btn-ghost:disabled { border-color: transparent; opacity: .55; }
.btn[aria-busy="true"] { color: var(--ink-2); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; gap: 5px; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border: 0; background: none; color: var(--ink-2); flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.linkbtn { border: 0; background: none; color: var(--ink-2); font-size: 13px; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:hover { color: var(--ink); }

.spin { width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; flex: none; opacity: .8; vertical-align: -2px; }
.spin.sm { width: 11px; height: 11px; border-width: 1.5px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; gap: 10px; color: var(--ink-2); padding: 18px 2px; }
.login .loading { justify-content: center; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; font-size: 12px; font-weight: 600; white-space: nowrap; border: var(--b) solid transparent; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pill-sym { font-size: 11px; line-height: 1; }
.pill-good { background: var(--surface-3); color: var(--ink); }
.pill-accent { background: var(--ink); color: var(--bg); }
.pill-info { border-color: var(--ink); color: var(--ink); }
.pill-warn { border-color: var(--accent); color: var(--ink); background: var(--accent-soft); }
.pill-bad { border-color: var(--bad-line); color: var(--bad); }
.pill-muted { border-color: var(--line-2); color: var(--ink-2); }

.card { background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; flex-wrap: wrap; }
.card-h p { margin-top: 2px; }
.card-b { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 22px 12px; }
.empty-i { width: 42px; height: 42px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); margin-bottom: 4px; }
.empty p { max-width: 380px; font-size: 13px; }
.empty-a { margin-top: 8px; }
.errbox { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--bad-line); color: var(--bad); background: var(--surface); font-size: 13px; }
.note { display: flex; gap: 8px; align-items: flex-start; padding: 9px 11px; background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; }
.note .ic { margin-top: 1px; }
.stale { color: var(--bad); }
.stale-note, .fresh { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--ink-2); }
.stale-note .ic, .fresh .ic { margin-top: 2px; }
.fresh { padding: 9px 12px; border: 1px solid var(--line); background: var(--surface); }
.fresh.stale { border-color: var(--bad-line); color: var(--ink); }
.fresh.stale .ic, .stale-note .ic { color: var(--bad); }
.sk { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.4s ease infinite; }
.sk-card { aspect-ratio: 4 / 6.2; }
.sk-row { height: 58px; margin-bottom: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

.seg { display: inline-flex; padding: 0; border: var(--b) solid var(--ink); gap: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg.wrap { flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 13px; font-weight: 600; font-size: 13px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--ink); color: var(--bg); }
.seg button.on .count { background: var(--accent); color: var(--accent-ink); }
.count { font-size: 11.5px; padding: 0 6px; background: var(--surface-3); color: var(--ink-2); font-family: var(--mono); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px; border: 1px solid var(--line-2); background: var(--surface); font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.chip:hover { color: var(--ink); border-color: var(--ink); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.static { cursor: default; height: 24px; background: var(--surface-2); border-color: transparent; color: var(--ink-2); }

.switch { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.switch button { width: 38px; height: 22px; border: 0; background: var(--surface-3); position: relative; padding: 0; transition: background .15s; flex: none; }
.switch button i { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff; transition: transform .15s; }
.switch button.on { background: var(--ink); }
.switch button.on i { background: var(--accent); transform: translateX(16px); }
.switch.dis { opacity: .55; cursor: default; }
.check { width: 24px; height: 24px; display: grid; place-items: center; border: var(--b) solid var(--ink); background: var(--surface); padding: 0; color: var(--bg); }
.check.on { background: var(--ink); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-l { font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.field-h { font-size: 12px; color: var(--ink-3); }
.form { display: flex; flex-direction: column; gap: 14px; }
.emoji-in { width: 64px; text-align: center; font-size: 18px; }
.autotext { overflow: hidden; min-height: 60px; line-height: 1.5; }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; padding-top: 2px; }
.list p { margin-top: 1px; }
.time { font-family: var(--mono); font-weight: 500; min-width: 96px; font-size: 12.5px; }
.ptag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); font-weight: 500; white-space: nowrap; }

/* ---------------------------------------------------------------- kpis */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); padding: 16px 18px; min-width: 0; text-align: left; display: block; width: 100%; }
button.kpi:hover { border-color: var(--ink); }
.kpi-l { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; }
.kpi-v { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi-v-s { font-size: 18px; letter-spacing: -0.01em; padding: 8px 0 4px; }
.kpi-n { color: var(--ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 4px; align-items: center; }
.kpi-n.stale { color: var(--bad); }
.kpi-warn { border-top: 3px solid var(--accent); }

/* ---------------------------------------------------------------- contents */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.search { display: flex; align-items: center; gap: 8px; margin-left: auto; min-width: 240px; position: relative; }
.search > .ic { position: absolute; left: 10px; color: var(--ink-3); }
.search input { padding-left: 32px; padding-right: 34px; }
.search .icon-btn { position: absolute; right: 2px; width: 30px; height: 30px; }
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 14px; }
.post { border: 1px solid var(--line); background: var(--surface); position: relative; display: flex; flex-direction: column; min-width: 0; transition: border-color .12s; }
.post:hover { border-color: var(--ink); }
.post.sel { border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.post.is-old .thumb { opacity: .75; }
.post-open { border: 0; background: none; padding: 0; text-align: left; display: flex; flex-direction: column; flex: 1; min-width: 0; }
.post-b, .mini-b { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; align-items: flex-start; }
.post-b > .row { align-self: stretch; }
.post-b b, .mini-b b { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.post-b .row > .muted, .post-b .views { white-space: nowrap; flex: none; }
.post-b .ptag { min-width: 0; overflow: hidden; text-overflow: ellipsis; display: inline-block; }
.post-b .ptag .pg-dot { margin-right: 6px; vertical-align: 0; }
.post-a { display: flex; gap: 4px; align-items: center; justify-content: space-between; padding: 0 8px 8px; }
.post-a > .btn, .post-a > .menu:first-child .btn { flex: 1; }
.post-check { position: absolute; top: 8px; right: 8px; }
.views { display: inline-flex; gap: 4px; align-items: center; color: var(--ink-2); font-family: var(--mono); font-size: 11.5px; }
.mini { border: 1px solid var(--line); background: var(--surface); padding: 0; text-align: left; overflow: hidden; display: flex; flex-direction: column; transition: border-color .12s; scroll-snap-align: start; }
.mini:hover { border-color: var(--ink); }
.mini-b b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.thumb { position: relative; aspect-ratio: 4 / 5; background: var(--surface-2); overflow: hidden; width: 100%; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--ink-3); }
.thumb-ph.big { aspect-ratio: 9 / 16; display: flex; flex-direction: column; gap: 8px; justify-content: center; align-items: center; background: var(--surface-2); }
.thumb-k { position: absolute; left: 0; top: 0; display: inline-flex; gap: 4px; align-items: center; padding: 4px 8px; font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: #F4F1EA; background: #121212; }
.thumb-n { position: absolute; right: 0; top: 0; padding: 4px 8px; font-family: var(--mono); font-size: 10.5px; font-weight: 500; color: #121212; background: #FF4A1C; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: 152px; gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.more { align-self: center; }
.old { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.old-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border: 0; background: none; padding: 6px 0; text-align: left; }
.bulkbar, .savebar.page {
  position: fixed; left: calc(var(--side) + 24px); right: 24px; bottom: calc(16px + var(--tabbar)); z-index: 35; max-width: 1180px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; background: var(--ink); color: var(--bg); border-left: 4px solid var(--accent);
}
.bulkbar .btn, .savebar.page .btn { border-color: var(--bg); color: var(--bg); }
.bulkbar .btn:hover:not(:disabled), .savebar.page .btn:hover:not(:disabled) { background: var(--bg); color: var(--ink); }
.bulkbar .btn-danger { border-color: #F0A07E; color: #F0A07E; }
.bulkbar .btn:disabled, .savebar.page .btn:disabled { border-color: rgba(244,241,234,.25); color: rgba(244,241,234,.45); background: transparent; }
.savebar.page .btn-primary:not(:disabled) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.bulkbar .linkbtn, .savebar.page small { color: inherit; opacity: .8; margin-left: 10px; }
.savebar.page small { display: block; margin: 2px 0 0; }

/* overview */
.todo > li { align-items: center; }
.todo-t { border: 0; padding: 0; background: none; width: 52px; flex: none; }
.todo-t .thumb-k, .todo-t .thumb-n { display: none; }
.todo-b { border: 0; background: none; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.todo-b b { font-weight: 600; font-size: 13.5px; line-height: 1.3; }

/* ---------------------------------------------------------------- overlay / drawer / modal / menu */
.overlay { position: fixed; inset: 0; background: rgba(10,10,10,.42); z-index: 50; display: flex; justify-content: flex-end; animation: fade .15s; }
.overlay.center { justify-content: center; align-items: center; padding: 16px; z-index: 70; }
@keyframes fade { from { opacity: 0; } }
.drawer { width: min(560px, 100%); height: 100%; background: var(--surface); box-shadow: var(--shadow-lg); overflow-y: auto; position: relative; animation: slide .2s ease-out; display: flex; flex-direction: column; }
.drawer.wide { width: min(980px, 100%); }
.drawer.narrow { width: min(440px, 100%); }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.drawer-x { position: absolute; right: 12px; top: 12px; z-index: 2; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); box-shadow: var(--shadow-lg); animation: pop .15s ease-out; border-top: 4px solid var(--ink); }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 0; gap: 12px; }
.modal-h h3 { font-size: 17px; }
.modal-b { padding: 12px 18px 4px; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 14px 18px 16px; flex-wrap: wrap; }

.menu { position: relative; display: inline-flex; }
.menu-bg { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 60; min-width: 250px; background: var(--surface); border: var(--b) solid var(--ink); display: flex; flex-direction: column; padding: 4px 0; animation: pop .12s ease-out; }
.menu-t { display: none; }
.menu-pop button { display: flex; align-items: flex-start; gap: 10px; padding: 9px 14px; border: 0; background: none; text-align: left; font-weight: 500; }
.menu-pop button:hover:not(:disabled) { background: var(--surface-2); }
.menu-pop button .ic { margin-top: 1px; color: var(--ink-2); }
.menu-pop button small { display: block; color: var(--ink-3); font-size: 12px; font-weight: 400; margin-top: 1px; }
.menu-pop button.danger { color: var(--bad); }
.menu-pop button.danger .ic { color: var(--bad); }
.menu-pop button:disabled { opacity: .5; }

.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 90; width: max-content; max-width: min(560px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: center; padding: 11px 12px 11px 15px; background: var(--ink); color: var(--bg); border-left: 3px solid var(--accent); font-weight: 500; animation: pop .15s; }
.toast .ic { color: var(--accent); }
.toast-bad { border-left-color: #F0A07E; }
.toast-bad .ic { color: #F0A07E; }
.toast-a { border: 1px solid rgba(244,241,234,.5); background: none; color: inherit; padding: 4px 10px; font-weight: 600; font-size: 12.5px; flex: none; }
:root[data-theme="dark"] .toast-a { border-color: rgba(18,18,18,.4); }
.toast-a:hover { background: var(--bg); color: var(--ink); }

/* ---------------------------------------------------------------- activity panel */
.tray { display: flex; flex-direction: column; gap: 14px; padding-bottom: 20px; }
.tray-h { display: flex; gap: 12px; align-items: flex-start; padding: 18px 18px 0; position: sticky; top: 0; background: var(--surface); z-index: 2; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.tray-f, .tray-pad { padding: 0 18px; }
.tray-t { display: flex; gap: 8px; align-items: center; font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); padding: 0 18px 6px; }
.jobs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tray .jobs { padding: 0 18px; }
.job { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--line); }
.job:first-child { border-top: 0; }
.job > .grow { display: flex; flex-direction: column; gap: 4px; }
.job b { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.job-i { width: 30px; height: 30px; display: grid; place-items: center; background: var(--surface-2); flex: none; color: var(--ink-2); }
.job-running .job-i { background: var(--ink); color: var(--bg); }
.job-failed .job-i { color: var(--bad); }
.job .row .btn-sm { margin-left: -11px; }
.trace { margin: 4px 0 0; padding: 8px 10px; background: var(--surface-2); font-family: var(--mono); font-size: 11px; white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; }

/* ---------------------------------------------------------------- post detail */
.detail { display: flex; flex-direction: column; min-height: 100%; }
.detail-top { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 6px; padding: 10px 12px 10px 22px; background: var(--surface); border-bottom: 1px solid var(--line); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 24px; padding: 20px 22px 28px; flex: 1; align-items: start; }
.detail-media { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 10px; }
.detail-media video { width: 100%; background: #000; display: block; aspect-ratio: 9 / 16; }
.detail-info { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.status-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.vers { width: 100%; }
.vers button { flex: 1; justify-content: center; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; background: var(--surface-2); align-items: center; }
.actions .menu { margin-left: auto; }
.viewer { display: flex; flex-direction: column; gap: 8px; }
.slides { position: relative; background: #000; touch-action: pan-y; }
.slides img { width: 100%; display: block; aspect-ratio: 4 / 5; object-fit: contain; }
.sl-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; display: grid; place-items: center; background: rgba(244,241,234,.92); color: #121212; }
.sl-nav.l { left: 8px; } .sl-nav.r { right: 8px; }
.sl-n { position: absolute; top: 8px; right: 8px; font-family: var(--mono); font-size: 11px; color: #F4F1EA; background: rgba(18,18,18,.75); padding: 3px 7px; }
.thumbs { display: grid; grid-auto-flow: column; grid-auto-columns: 46px; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.thumbs button { border: 2px solid transparent; padding: 0; background: none; opacity: .65; }
.thumbs button.on { border-color: var(--ink); opacity: 1; }
.thumbs img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.textbox { display: flex; flex-direction: column; gap: 6px; }
.textbox pre { margin: 0; white-space: pre-wrap; word-break: break-word; font: inherit; font-size: 13px; padding: 10px 12px; background: var(--surface-2); max-height: 240px; overflow: auto; cursor: text; }
.textbox.changed pre, .textbox.changed textarea { box-shadow: inset 3px 0 0 var(--accent); }
.tag-mod { font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; padding: 1px 6px; background: var(--accent); color: var(--accent-ink); }
.titles { margin: 6px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 5px; }
.titles .t-cover { list-style: none; margin-left: -22px; }
.slides-ed { display: flex; flex-direction: column; gap: 8px; }
.sl-list { display: flex; flex-direction: column; gap: 10px; }
.sl-row { display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding: 10px; border: 1px solid var(--line); }
.sl-row.changed { box-shadow: inset 3px 0 0 var(--accent); }
.sl-img { position: relative; }
.sl-img img, .sl-img .ph { width: 76px; aspect-ratio: 4 / 5; object-fit: cover; display: flex; background: var(--surface-2); flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ink-3); font-size: 11px; text-align: center; }
.sl-img.ph { width: 76px; aspect-ratio: 4 / 5; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-3); font-size: 11px; }
.sl-k { position: absolute; left: 0; bottom: 0; font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; background: #121212; color: #F4F1EA; padding: 2px 5px; }
.sl-f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sl-f input, .sl-f textarea { padding: 7px 9px; font-size: 13px; }
.kicker-in { font-family: var(--mono); font-size: 11px !important; letter-spacing: .12em; text-transform: uppercase; }
.pm { display: flex; flex-direction: column; gap: 6px; }
.pm-row { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 9px 12px; background: var(--surface-2); font-size: 13px; }
.pm-p { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; }
.tech summary { cursor: pointer; font-family: var(--mono); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); padding: 4px 0; }
.tech[open] summary { margin-bottom: 8px; }
.tech .facts { margin-bottom: 8px; }
.savebar { position: sticky; bottom: 0; z-index: 4; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 22px calc(12px + env(safe-area-inset-bottom)); background: var(--ink); color: var(--bg); border-left: 4px solid var(--accent); }
.savebar > .grow { display: flex; flex-direction: column; }
.savebar small { opacity: .8; }
.savebar .err { color: #F0A07E; }
.savebar .btn { border-color: var(--bg); color: var(--bg); }
.savebar .btn:hover:not(:disabled) { background: var(--bg); color: var(--ink); }
.savebar .btn-primary:not(:disabled) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.savebar .btn:disabled { border-color: rgba(244,241,234,.25); color: rgba(244,241,234,.45); background: transparent; }
:root[data-theme="dark"] .savebar .btn:disabled, :root[data-theme="dark"] .bulkbar .btn:disabled { border-color: rgba(18,18,18,.25); color: rgba(18,18,18,.45); }

/* ---------------------------------------------------------------- create */
.steps { display: flex; flex-direction: column; gap: 22px; }
.steps h4 { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-weight: 500; font-size: 11px; color: var(--ink-2); margin-bottom: 12px; text-transform: uppercase; letter-spacing: .2em; }
.stepn { width: 22px; height: 22px; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-size: 11px; letter-spacing: 0; }
.pick-pages { display: flex; flex-wrap: wrap; gap: 10px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border: 1px solid var(--line-2); background: var(--surface); text-align: left; }
.pick span { display: flex; flex-direction: column; }
.pick:hover, .fmt:hover, .idea:hover { border-color: var(--ink); }
.pick.on, .fmt.on, .idea.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink), inset 4px 0 0 var(--accent); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; font-size: 17px; flex: none; }
.avatar.sm { width: 24px; height: 24px; font-size: 13px; }
.avatar.lg { width: 44px; height: 44px; font-size: 22px; }
.formats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.fmt { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--line-2); background: var(--surface); text-align: left; }
.fmt b, .pick b, .idea b { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; font-size: 15px; }
.fmt-i { width: 36px; height: 36px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); margin-bottom: 2px; }
.fmt.on .fmt-i { background: var(--ink); color: var(--bg); }
.fmt-m { display: flex; justify-content: space-between; color: var(--ink-2); font-family: var(--mono); font-size: 11px; margin-top: auto; padding-top: 6px; }
.fmt-m span { display: inline-flex; gap: 4px; align-items: center; }
.ideas { display: flex; flex-direction: column; gap: 8px; }
.idea { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 12px; border: 1px solid var(--line-2); background: var(--surface); }
.idea > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.idea-c { width: 24px; height: 24px; display: grid; place-items: center; flex: none; background: var(--surface-2); font-size: 12px; font-weight: 600; }
.idea.on .idea-c { background: var(--ink); color: var(--bg); }
.sent { border: var(--b) solid var(--ink); border-left-width: 4px; border-left-color: var(--accent); }

/* ---------------------------------------------------------------- plan */
.hours { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; margin-top: 4px; }
.hour { position: relative; }
.hour-b { width: 100%; height: 74px; border: 1px dashed var(--line-2); background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-3); padding: 4px 2px; }
.hour-b:hover { background: var(--surface-2); color: var(--ink); }
.hour-h { font-family: var(--mono); font-size: 12px; font-weight: 500; }
.hour-m { font-size: 10.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.hour-off { font-size: 16px; line-height: 15px; }
.hour.on .hour-b { border: var(--b) solid var(--ink); color: var(--bg); background: var(--ink); }
.hour-a { position: absolute; top: -7px; right: -5px; width: 22px; height: 22px; border: 1px solid var(--line-2); background: var(--surface); display: grid; place-items: center; color: var(--ink-3); padding: 0; }
.hour-a.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.inline-save { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface-2); border-left: 3px solid var(--accent); flex-wrap: wrap; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; }
.day { display: flex; flex-direction: column; gap: 6px; min-width: 0; scroll-snap-align: start; }
.day-h { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 8px; background: var(--surface-2); text-transform: capitalize; }
.day.today .day-h { background: var(--ink); color: var(--bg); box-shadow: inset 0 -3px 0 var(--accent); }
.day.past { opacity: .92; }
.day-e { padding: 4px 8px; }
.ev { display: flex; gap: 6px; align-items: flex-start; padding: 7px 8px; border: 1px solid var(--line); background: var(--surface); text-align: left; font-size: 12.5px; min-width: 0; }
button.ev:hover { border-color: var(--ink); }
.ev .grow { display: flex; flex-direction: column; gap: 1px; }
.ev small { font-size: 11px; }
.ev .pg-dot { margin-top: 4px; width: 7px; height: 7px; }
.ev-t { font-size: 11px; color: var(--ink-2); padding-top: 1px; }
.ev.plan { border-style: dashed; background: transparent; color: var(--ink-2); }
.ev.plan .ic { color: var(--accent); margin-top: 2px; }

/* ---------------------------------------------------------------- charts */
.chart { position: relative; width: 100%; }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i, .sw { width: 10px; height: 10px; display: inline-block; margin-right: 5px; vertical-align: -1px; }
.tip { position: absolute; width: 220px; padding: 9px 11px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); pointer-events: none; font-size: 12.5px; display: flex; flex-direction: column; gap: 3px; z-index: 5; }
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar-l { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; gap: 8px; }
.hbar-l b { font-variant-numeric: tabular-nums; }
.hbar-t { height: 8px; background: var(--surface-2); overflow: hidden; }
.hbar-t div { height: 100%; background: var(--ink); min-width: 4px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-family: var(--mono); font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); font-size: 10.5px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th button { border: 0; background: none; padding: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; display: inline-flex; gap: 4px; align-items: center; }
.table th.on { color: var(--ink); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.link { cursor: pointer; }
.table tr.link:hover td { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .grow-n { display: block; font-size: 11px; }
.t-cap { min-width: 260px; max-width: 440px; }
.t-post { display: flex; gap: 10px; align-items: center; }
.t-post img, .t-ph { width: 36px; height: 45px; object-fit: cover; flex: none; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-3); }
.t-post small { display: block; margin-top: 2px; }
.table-note { padding: 10px 12px 14px; }

/* ---------------------------------------------------------------- factory / pages */
.machines, .pages-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.now { display: flex; gap: 8px; align-items: center; padding: 8px 10px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 13px; border-left: 3px solid var(--accent); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 13px; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 28px; height: 28px; border: 2px solid transparent; }
.swatches button.on { border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--surface); }
/* wake / night times: light rows, plain words */
.ptimes { display: flex; flex-direction: column; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ptimes-sum { display: flex; gap: 8px; align-items: center; padding: 10px 0; font-weight: 500; }
.ptimes-sum .ic { color: var(--ink-2); }
.prow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px dashed var(--line); flex-wrap: wrap; min-height: 48px; }
.prow input[type="time"] { width: auto; padding: 5px 8px; font-family: var(--mono); font-size: 13px; }
.prow.end { justify-content: flex-end; }

/* ---------------------------------------------------------------- login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.acct { display: flex; gap: 6px; align-items: center; padding: 9px 11px; background: var(--surface-2); font-size: 13px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- tablet */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .hours { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .week { grid-template-columns: repeat(7, minmax(170px, 1fr)); }
  .detail-grid { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); }
}

/* ---------------------------------------------------------------- phone */
@media (max-width: 820px) {
  :root { --tabbar: calc(62px + env(safe-area-inset-bottom)); }
  .side { display: none; }
  .main { margin-left: 0; padding: 14px 16px calc(96px + env(safe-area-inset-bottom)); gap: 14px; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 20; align-items: center; justify-content: space-between; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px 16px;
    background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
  .topbar .logo { padding: 0; }
  .topbar .wm small { display: none; }
  .top-farm { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border: 1px solid var(--line-2); font-family: var(--mono); font-size: 12px; text-decoration: none; color: var(--ink); }
  .act-top { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border: var(--b) solid var(--ink); background: var(--surface); }
  .act-top .act-n { padding: 0 5px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; border: 0; background: none; color: var(--ink-3); font-size: 10.5px; font-weight: 600; text-decoration: none; }
  .tabbar .on { color: var(--ink); box-shadow: inset 0 3px 0 var(--accent); }
  .sheet-bg { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.35); display: flex; align-items: flex-end; }
  .sheet { width: 100%; background: var(--surface); padding: 10px 10px calc(84px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; animation: up .18s ease-out; }
  @keyframes up { from { transform: translateY(30px); opacity: 0; } }
  .sheet a, .sheet button { display: flex; align-items: center; gap: 12px; padding: 13px 12px; border: 0; background: none; color: var(--ink); font-weight: 550; font-size: 15px; text-align: left; text-decoration: none; }
  .sheet a:active, .sheet button:active { background: var(--surface-2); }
  h1 { font-size: 23px; }
  .head { padding-bottom: 12px; }
  .head p { font-size: 13px; }
  .pswitch { flex-wrap: nowrap; overflow-x: auto; margin: -2px -16px 0; padding: 0 16px 2px; scrollbar-width: none; }
  .pswitch-l { display: none; }
  .kpi-v { font-size: 24px; }
  .kpi { padding: 12px; }
  .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .post-b { padding: 9px 10px 10px; }
  .post-a { padding: 0 6px 6px; }
  .post .pill { font-size: 11px; padding: 0 6px; }
  .search { margin-left: 0; width: 100%; min-width: 0; }
  .toolbar .seg { width: 100%; }
  .toolbar .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
  .chip { flex: none; }
  .drawer, .drawer.wide, .drawer.narrow { width: 100%; }
  .detail-top { padding: 8px 8px 8px 16px; }
  .detail-grid { grid-template-columns: 1fr; padding: 14px 16px 24px; gap: 16px; }
  .detail-media { position: static; max-width: 380px; width: 100%; margin: 0 auto; }
  .actions { padding: 10px; }
  .actions > .btn { flex: 1 1 auto; }
  .savebar { padding-left: 16px; padding-right: 16px; }
  .bulkbar, .savebar.page { left: 8px; right: 8px; bottom: calc(var(--tabbar) + 8px); }
  .hours { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .week { grid-template-columns: repeat(7, minmax(78%, 1fr)); margin: 0 -18px; padding: 0 18px 4px; scroll-padding: 0 18px; }
  .formats { grid-template-columns: 1fr; }
  .fmt { display: grid; grid-template-columns: 36px 1fr; column-gap: 12px; row-gap: 2px; padding: 12px; }
  .fmt-i { grid-row: span 3; margin: 0; }
  .fmt-m { justify-content: flex-start; gap: 14px; padding-top: 2px; }
  .t-cap { min-width: 200px; }
  .machines, .pages-grid { grid-template-columns: 1fr; }
  .toasts { bottom: calc(var(--tabbar) + 12px); }
  .head-a { width: 100%; }
  .menu-bg { display: block; position: fixed; inset: 0; z-index: 59; background: rgba(0,0,0,.35); }
  .menu-pop { position: fixed; left: 0; right: 0; bottom: 0; top: auto; min-width: 0; border: 0; border-top: 4px solid var(--ink); padding: 6px 0 calc(10px + env(safe-area-inset-bottom)); animation: up .18s ease-out; }
  .menu-t { display: block; padding: 10px 16px 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); }
  .menu-pop button { padding: 13px 16px; font-size: 15px; }
  .sl-row { grid-template-columns: 64px 1fr; padding: 8px; }
  .sl-img img, .sl-img .ph, .sl-img.ph { width: 64px; }
  .list > li { gap: 10px; }
  .time { min-width: 82px; }
}
@media (max-width: 380px) { .posts { grid-template-columns: 1fr 1fr; } .strip { grid-auto-columns: 132px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
