/* Eleni Studio v2 — calm editorial UI. Light + dark tokens. */
:root {
  --bg: #f6f1e8; --bg-2: #efe8db; --panel: #fffdf8; --panel-2: #fbf7ef; --ink: #2b2620; --ink-2: #4a423a;
  --muted: #7a6f62; --line: #e4dccd; --line-2: #d6cbb7;
  --olive: #6b7247; --olive-ink: #fff; --olive-soft: #e9ebdc; --olive-hover: #5c6239;
  --terra: #b5643f; --terra-soft: #f6e3d9; --gold: #b8954a; --gold-ink: #8a6a26; --gold-soft: #f4ead2;
  --blue: #4a6a85; --blue-soft: #e3e9ef;
  --sidebar: #f1ebdf; --hover: rgba(43, 38, 32, .05); --scrim: rgba(28, 24, 20, .45);
  --shadow: 0 1px 2px rgba(43, 38, 32, .05), 0 8px 24px rgba(43, 38, 32, .08);
  --radius: 8px; --radius-lg: 12px;
  --serif: 'Cormorant Garamond', Georgia, serif; --sans: 'DM Sans', system-ui, -apple-system, sans-serif;
  --focus: 0 0 0 2px var(--panel), 0 0 0 4px var(--olive);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1b1a; --bg-2: #222120; --panel: #242321; --panel-2: #2a2927; --ink: #efe9df; --ink-2: #d6cfc3;
    --muted: #a39a8d; --line: #353330; --line-2: #45423d;
    --olive: #a9b07f; --olive-ink: #1c1b1a; --olive-soft: #343727; --olive-hover: #bcc392;
    --terra: #e0906b; --terra-soft: #3d2a21; --gold: #d8b66c; --gold-ink: #d8b66c; --gold-soft: #3a3222;
    --blue: #93b2cc; --blue-soft: #26303a;
    --sidebar: #181716; --hover: rgba(255, 255, 255, .05); --scrim: rgba(0, 0, 0, .6);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1c1b1a; --bg-2: #222120; --panel: #242321; --panel-2: #2a2927; --ink: #efe9df; --ink-2: #d6cfc3;
  --muted: #a39a8d; --line: #353330; --line-2: #45423d;
  --olive: #a9b07f; --olive-ink: #1c1b1a; --olive-soft: #343727; --olive-hover: #bcc392;
  --terra: #e0906b; --terra-soft: #3d2a21; --gold: #d8b66c; --gold-ink: #d8b66c; --gold-soft: #3a3222;
  --blue: #93b2cc; --blue-soft: #26303a;
  --sidebar: #181716; --hover: rgba(255, 255, 255, .05); --scrim: rgba(0, 0, 0, .6);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; }
h1 { font: 600 2.1rem var(--serif); letter-spacing: -.01em; }
h2 { font: 600 1.45rem var(--serif); }
h3 { font: 600 1.2rem var(--serif); }
h4 { font: 600 14px var(--sans); }
p { margin: 0 0 .6em; }
code { font-size: .9em; background: var(--bg-2); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: var(--terra); }
.grow { flex: 1; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--panel); padding: 8px 12px; border-radius: 6px; }
.skip:focus { left: 8px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.ic { flex: none; vertical-align: middle; }
.row-start, .row-end, .row-between { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-end { justify-content: flex-end; }
.row-between { justify-content: space-between; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--olive); flex: none; }

/* ---------- buttons + inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 500 14px/1.2 var(--sans);
  border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); padding: 8px 14px; border-radius: var(--radius);
  cursor: pointer; white-space: nowrap; text-decoration: none; min-height: 36px; transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--muted); background: var(--panel-2); }
.btn.primary { background: var(--olive); border-color: var(--olive); color: var(--olive-ink); }
.btn.primary:hover { background: var(--olive-hover); border-color: var(--olive-hover); }
.btn.big { min-height: 44px; font-size: 15px; }
.btn.small { padding: 5px 10px; font-size: 13px; min-height: 30px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--hover); }
.btn.ghost.active { background: var(--olive-soft); color: var(--ink); }
.btn.danger { color: var(--terra); }
.btn.danger-solid { background: var(--terra); border-color: var(--terra); color: #fff; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius); border: 0;
  background: transparent; color: var(--ink-2); cursor: pointer; flex: none; position: relative; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn.sm { width: 30px; height: 30px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--olive); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-btn.danger { color: var(--terra); }
input, textarea, select { font: 14px var(--sans); color: var(--ink); background: var(--panel); border: 1px solid var(--line-2);
  border-radius: var(--radius); padding: 8px 10px; width: 100%; min-height: 36px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--olive); box-shadow: 0 0 0 3px var(--olive-soft); }
input:disabled, textarea:disabled, select:disabled { opacity: .65; }
textarea { resize: vertical; line-height: 1.5; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; min-height: 0; accent-color: var(--olive); margin: 0; }
input[type="color"] { padding: 2px; width: 48px; height: 36px; }
input[type="range"] { padding: 0; border: 0; accent-color: var(--olive); }
input[type="range"]:focus { box-shadow: none; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
label > input:not([type=checkbox]):not([type=color]), label > textarea, label > select, label > .input-with-btn { margin-top: 4px; color: var(--ink); }
label.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
label.inline select { width: auto; margin: 0; }
.check { display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: 14px; cursor: pointer; }
.input-with-btn { display: flex; gap: 6px; }
.switch { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 14px; cursor: pointer; margin: 8px 0; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .sw { width: 36px; height: 20px; border-radius: 999px; background: var(--line-2); position: relative; flex: none; transition: background .15s; }
.switch .sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .sw { background: var(--olive); }
.switch input:checked + .sw::after { transform: translateX(16px); }
.switch input:focus-visible + .sw { box-shadow: var(--focus); }
.switch input:disabled + .sw { opacity: .5; }

/* chips + badges */
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); white-space: nowrap; }
.chip.st-approved, .chip.st-pending { background: var(--blue-soft); color: var(--blue); }
.chip.st-publishing, .chip.st-processing { background: var(--gold-soft); color: var(--gold-ink); }
.chip.st-posted { background: var(--olive-soft); color: var(--olive); }
.chip.st-partial, .chip.st-failed { background: var(--terra-soft); color: var(--terra); }
.chip.st-draft { background: var(--bg-2); color: var(--muted); }
.badge { margin-left: auto; font-size: 12px; font-weight: 600; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--olive); color: var(--olive-ink); display: inline-grid; place-items: center; }
.badge + .badge { margin-left: 4px; }
.badge.bad { background: var(--terra); color: #fff; }
.badge.soft { background: var(--bg-2); color: var(--ink-2); }
.count { font-size: 12px; color: var(--muted); font-weight: 500; }
.count.bad { color: var(--terra); font-weight: 700; }
.count.over, .over { color: var(--terra) !important; font-weight: 600; }
.tagchip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--tc) 45%, transparent); background: color-mix(in srgb, var(--tc) 14%, transparent); color: var(--ink); }
.tag-x { border: 0; background: none; color: inherit; padding: 0; cursor: pointer; display: inline-grid; place-items: center; }
.typebadge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 500; padding: 1px 7px; border-radius: 6px; background: var(--bg-2); color: var(--ink-2); }
.notice { font-size: 13.5px; background: var(--gold-soft); color: var(--ink); border-radius: var(--radius); padding: 9px 12px; margin: 10px 0; display: flex; gap: 8px; align-items: flex-start; }
.notice.soft { background: var(--bg-2); }
.notice.bad { background: var(--terra-soft); display: block; }
.notice.good { background: var(--olive-soft); }
.notice ul { margin: 4px 0 0; padding-left: 18px; }

/* avatars */
.avatar { --s: 32px; position: relative; width: var(--s); height: var(--s); flex: none; display: inline-block; }
.avatar-img { width: 100%; height: 100%; border-radius: 50%; background: linear-gradient(135deg, #8a8f63, #6b7247); color: #f6f1e8;
  display: grid; place-items: center; font: 600 calc(var(--s) * .36) var(--serif); letter-spacing: .02em; }
.avatar.dim .avatar-img { filter: grayscale(1); opacity: .45; }
.net-badge { position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 50%; color: #fff; display: grid; place-items: center; border: 2px solid var(--panel); }
.avatar.dim .net-badge { filter: grayscale(.6); opacity: .7; }
.avstack { display: inline-flex; }
.avstack .avatar + .avatar { margin-left: -8px; }
.avstack .avatar-img { box-shadow: 0 0 0 2px var(--panel); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 32px 28px; text-align: center; }
.login-card label { text-align: left; }
.login-card .btn { width: 100%; margin-top: 16px; }
.logo-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--olive); color: var(--olive-ink); display: inline-grid; place-items: center; font: 600 20px var(--serif); flex: none; }
.login-card .logo-mark { width: 48px; height: 48px; font-size: 28px; margin-bottom: 12px; border-radius: 12px; }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.app.collapsed { grid-template-columns: 68px minmax(0, 1fr); }
.mobilebar { display: none; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--sidebar); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 14px 12px; gap: 6px; }
.sb-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 8px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 1.35rem var(--serif); white-space: nowrap; }
.brand em { color: var(--olive); font-style: italic; }
.btn.new { width: 100%; min-height: 42px; font-size: 15px; font-weight: 600; background: var(--olive); color: var(--olive-ink); border-color: var(--olive); margin: 4px 0 10px; }
.btn.new:hover { background: var(--olive-hover); }
.sb-nav { display: flex; flex-direction: column; gap: 2px; }
.sb-nav a, .sb-ch { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--radius); text-decoration: none; color: var(--ink-2); font-weight: 500; min-height: 40px; }
.sb-nav a:hover, .sb-ch:hover { background: var(--hover); color: var(--ink); }
.sb-nav a.on, .sb-ch.on { background: var(--panel); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.sb-nav a.on .ic { color: var(--olive); }
.sb-sec { margin: 14px 0 6px; display: flex; flex-direction: column; gap: 2px; }
.sb-h { display: flex; justify-content: space-between; align-items: center; padding: 0 10px 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.sb-manage { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--olive); text-decoration: none; }
.sb-ch { padding: 6px 10px; }
.sb-chname { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.sb-chname span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.sb-chname small { color: var(--muted); font-size: 12px; font-weight: 400; }
.sb-nav2 { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.sb-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 4px 0; border-top: 1px solid var(--line); margin-top: 8px; }
.sb-acct { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sb-acct .sb-label { display: flex; flex-direction: column; line-height: 1.2; font-size: 13.5px; }
.sb-acct small { color: var(--muted); font-size: 12px; }
.sb-foot-btns { display: flex; }
.app.collapsed .sb-label, .app.collapsed .sb-ch .badge, .app.collapsed .sb-nav .badge { display: none; }
.app.collapsed .sidebar { padding: 14px 8px; align-items: center; }
.app.collapsed .sb-top { flex-direction: column; gap: 8px; }
.app.collapsed .btn.new { width: 44px; padding: 0; }
.app.collapsed .sb-nav a, .app.collapsed .sb-ch { justify-content: center; padding: 8px; }
.app.collapsed .sb-foot { flex-direction: column; }
.app.collapsed .sb-foot-btns { flex-direction: column; }
.sidebar-scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 39; }

.view { min-width: 0; padding: 24px 32px 80px; outline: none; }
.page { max-width: 1440px; margin: 0 auto; }
.page[data-page="publish/list"], .page[data-page="home"] { max-width: 1080px; }
.page-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.loading { display: grid; place-items: center; padding: 60px 0; }
.spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--olive); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 56px 20px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty h2 { color: var(--ink); margin: 6px 0 0; }
.empty.small { padding: 26px 12px; }
.empty .ic { color: var(--line-2); }

/* segmented control + tabs */
.seg { display: inline-flex; background: var(--bg-2); border-radius: var(--radius); padding: 3px; gap: 2px; }
.seg a, .seg button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 6px; text-decoration: none; color: var(--muted); font: 500 14px var(--sans); border: 0; background: none; cursor: pointer; min-height: 32px; }
.seg.small button { padding: 4px 10px; font-size: 13px; min-height: 28px; }
.seg .on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.list-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; padding: 10px 12px; font: 500 14.5px var(--sans); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; min-height: 44px; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); border-bottom-color: var(--olive); }
.search { position: relative; display: flex; align-items: center; margin: 6px 0; }
.search .ic { position: absolute; left: 10px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 32px; width: 230px; min-height: 34px; margin: 0; }
.filters { display: flex; gap: 4px; flex-wrap: wrap; margin: 6px 0; }
.filters .btn { min-height: 34px; padding: 6px 10px; }

/* ---------- post cards (list) ---------- */
.daygroup { margin-bottom: 26px; }
.dayhead { font: 600 1.15rem var(--serif); margin: 0 0 10px; display: flex; align-items: baseline; gap: 10px; }
.list-selall { margin: -6px 0 10px; }
.list-selall .check { font-size: 13px; color: var(--muted); }
.pcard { display: grid; grid-template-columns: 112px minmax(0, 1fr) 40px; gap: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; transition: border-color .15s, box-shadow .15s; }
.pcard:hover { border-color: var(--line-2); }
.pcard.selected { border-color: var(--olive); box-shadow: 0 0 0 1px var(--olive); }
.pc-when { padding: 14px 10px 14px 14px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.pc-check { margin: 0 0 2px; padding: 4px; margin-left: -4px; cursor: pointer; }
.pc-time { display: flex; flex-direction: column; line-height: 1.2; }
.pc-time b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pc-time small { font-size: 12px; color: var(--muted); }
.pc-main { padding: 12px 14px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 30px; }
.pc-acct { font-weight: 600; font-size: 14px; }
.pc-types, .pc-tags { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.pc-body { display: flex; gap: 14px; cursor: pointer; }
.pc-text { flex: 1; min-width: 0; }
.pc-label { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.pc-text p { margin: 0; white-space: pre-line; word-break: break-word; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pcard.expanded .clamp { -webkit-line-clamp: unset; display: block; }
.pc-media { position: relative; flex: none; }
.thumb { position: relative; display: block; width: 76px; height: 96px; border-radius: 6px; overflow: hidden; background: #111; flex: none; }
.thumb video, .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .play { position: absolute; inset: 0; margin: auto; width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; padding-left: 2px; }
.thumb.missing { display: grid; place-items: center; background: var(--bg-2); color: var(--muted); }
.more-count { position: absolute; right: 4px; top: 4px; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 999px; }
.pc-targets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tchip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--bg-2); }
.tchip.st-posted { background: var(--olive-soft); color: var(--olive); }
.tchip.st-failed { background: var(--terra-soft); color: var(--terra); }
.tchip.st-processing { background: var(--gold-soft); color: var(--gold-ink); }
.tchip a { display: inline-flex; }
.pc-err { flex-basis: 100%; }
.pc-foot { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); padding-top: 8px; flex-wrap: wrap; }
.pc-note { border: 0; border-left: 1px solid var(--line); background: none; color: var(--muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; padding-top: 14px; font-size: 12px; font-weight: 600; border-radius: 0 var(--radius) var(--radius) 0; }
.pc-note:hover { background: var(--hover); color: var(--ink); }
.pc-note.has { color: var(--olive); }
.pcard.st-failed .pc-when, .pcard.st-partial .pc-when { box-shadow: inset 3px 0 0 var(--terra); }
.bulkbar { position: sticky; bottom: 16px; z-index: 20; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: var(--radius-lg); box-shadow: var(--shadow); margin-top: 12px; }
.bulkbar .btn { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 35%, transparent); }
.bulkbar .btn:hover { background: color-mix(in srgb, var(--bg) 12%, transparent); }
.bulkbar .btn.danger { color: #f2b49a; }
.bulkbar .icon-btn { color: var(--bg); }

/* ---------- home ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 26px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; display: flex; flex-direction: column; gap: 4px; }
.stat b { font: 600 2rem var(--serif); line-height: 1.1; }
a.stat:hover { border-color: var(--line-2); }
.stat.bad b { color: var(--terra); }
.meter { display: block; height: 8px; border-radius: 999px; background: var(--bg-2); overflow: hidden; margin: 8px 0 2px; }
.meter i { display: block; height: 100%; background: var(--olive); border-radius: inherit; }
.home-sec { margin-bottom: 28px; }
.home-sec h2 { display: flex; align-items: center; gap: 8px; }

/* ---------- calendar ---------- */
.cal-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-nav { display: flex; align-items: center; gap: 4px; }
.cal-title { margin: 0 0 0 8px; font-size: 1.35rem; white-space: nowrap; }
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.nodate { width: 250px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.nodate header { display: flex; align-items: center; justify-content: space-between; }
.nodate h3 { margin: 0; }
.nd-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.nd-list .ev { position: static; }
.legend { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lg { display: inline-flex; align-items: center; gap: 4px; }
.lg::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--evc); }
.wk { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.wk-head { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: var(--panel); }
.wk-dh { padding: 8px 8px 6px; display: flex; flex-direction: column; align-items: center; gap: 0; border-left: 1px solid var(--line); line-height: 1.2; }
.wk-dh span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.wk-dh b { font: 600 1.35rem var(--serif); }
.wk-dh small { font-size: 11px; color: var(--muted); min-height: 14px; }
.wk-dh.today b { background: var(--olive); color: var(--olive-ink); border-radius: 999px; min-width: 32px; padding: 0 6px; text-align: center; }
.wk-dh.nopost { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--gold-soft) 6px 7px); }
.wk-dh.nopost small { color: var(--gold-ink); font-weight: 600; }
.wk-scroll { height: calc(100vh - 260px); min-height: 420px; overflow-y: auto; position: relative; }
.wk-grid { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); position: relative; }
.wk-hours { position: relative; }
.wk-hours span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wk-col { position: relative; border-left: 1px solid var(--line); }
.wk-col.today { background: color-mix(in srgb, var(--olive) 5%, transparent); }
.wk-cell { height: 64px; border-top: 1px solid var(--line); position: relative; }
.wk-cell:first-child { border-top: 0; }
.wk-cell.past { background: color-mix(in srgb, var(--bg-2) 55%, transparent); }
.cell-plus { position: absolute; inset: 2px; border: 1px dashed transparent; border-radius: 6px; background: none; color: var(--olive); cursor: pointer; opacity: 0;
  display: flex; align-items: flex-start; justify-content: center; gap: 4px; font: 600 12px var(--sans); padding-top: 4px; }
.wk-cell:hover .cell-plus, .cell-plus:focus-visible { opacity: 1; border-color: var(--olive); background: var(--olive-soft); }
.is-dragging .cell-plus { display: none; }
.slotline { position: absolute; left: 0; right: 0; height: 0; border-top: 1.5px dashed var(--c); opacity: .55; pointer-events: none; z-index: 1; }
.nowline { position: absolute; left: -1px; right: 0; height: 2px; background: var(--terra); z-index: 4; pointer-events: none; }
.nowline::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--terra); }
.ev-pos { position: absolute; z-index: 3; }
.ev { --evc: var(--muted); background: var(--panel); border: 1px solid var(--line-2); border-left: 3px solid var(--evc); border-radius: 6px; padding: 4px 6px; cursor: pointer; font-size: 12px; line-height: 1.3; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.05); min-height: 60px; }
.ev:hover { box-shadow: var(--shadow); z-index: 5; }
.ev[draggable="true"] { cursor: grab; }
.ev.locked { cursor: pointer; }
.ev.dragging { opacity: .4; }
.ev.compact { min-height: 0; padding: 3px 6px; }
.st-draft { --evc: #9b9184; } .st-approved { --evc: var(--blue); } .st-publishing { --evc: var(--gold); }
.st-posted, .st-partial { --evc: var(--olive); } .st-failed { --evc: var(--terra); }
.st-partial { --evc: var(--terra); }
.ev.st-draft { background: repeating-linear-gradient(135deg, var(--panel) 0 8px, var(--panel-2) 8px 10px); }
.ev-top { display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; }
.ev-top b { font-variant-numeric: tabular-nums; }
.ev-nets { display: inline-flex; gap: 2px; }
.net-dot { width: 16px; height: 16px; border-radius: 4px; background: var(--c); color: #fff; display: inline-grid; place-items: center; }
.ev-type { color: var(--muted); display: inline-flex; }
.ev-st { margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 10.5px; font-weight: 600; color: var(--evc); text-transform: uppercase; letter-spacing: .03em; }
.ev-body { display: flex; gap: 6px; margin-top: 3px; }
.ev-body p { flex: 1; margin: 0; max-height: 2.6em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink-2); word-break: break-word; }
.ev-body .thumb { width: 30px; height: 38px; border-radius: 4px; }
.ev-body .thumb .play { width: 16px; height: 16px; }
.ev-body .thumb .play .ic { width: 8px; height: 8px; }
.drop-ind { position: absolute; left: 2px; right: 2px; height: 0; border-top: 2px solid var(--olive); z-index: 6; pointer-events: none; }
.drop-ind span { position: absolute; top: -11px; left: 4px; background: var(--olive); color: var(--olive-ink); font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; }
.drop-ind.bad { border-color: var(--terra); }
.drop-ind.bad span { background: var(--terra); color: #fff; }
.mo { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mo-head, .mo-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mo-head span { padding: 8px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); }
.mo-day { min-height: 128px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); padding: 4px; display: flex; flex-direction: column; gap: 3px; position: relative; }
.mo-day:nth-child(7n+1) { border-left: 0; }
.mo-day.other { background: color-mix(in srgb, var(--bg-2) 60%, transparent); }
.mo-day.other .mo-dh b { color: var(--muted); }
.mo-day.past { background: color-mix(in srgb, var(--bg-2) 40%, transparent); }
.mo-day.today .mo-dh b { background: var(--olive); color: var(--olive-ink); border-radius: 999px; padding: 0 7px; }
.mo-day.nopost { background: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--gold-soft) 70%, transparent) 6px 7px); }
.mo-day.over { box-shadow: inset 0 0 0 2px var(--olive); background: var(--olive-soft); }
.mo-dh { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 0 2px; min-height: 26px; }
.mo-plus { opacity: 0; border: 0; background: var(--olive-soft); color: var(--olive); border-radius: 6px; width: 24px; height: 24px; display: grid; place-items: center; cursor: pointer; }
.mo-day:hover .mo-plus, .mo-plus:focus-visible { opacity: 1; }
.mo-more { text-align: left; font-size: 12px; }
.mo-empty { color: var(--gold-ink); font-size: 11px; margin-top: auto; }
.agenda { display: flex; flex-direction: column; gap: 12px; }
.ag-day { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.ag-day.today { border-color: var(--olive); }
.ag-day h3 { display: flex; justify-content: space-between; align-items: center; font: 600 15px var(--sans); margin: 0; }
.ag-day .ev { min-height: 0; }
.ag-empty { margin: 0; }

/* ---------- drawer, menu, dialogs, toasts ---------- */
.drawer-wrap { position: fixed; inset: 0; z-index: 60; }
.drawer-back { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity .2s; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .2s ease; box-shadow: var(--shadow); }
.drawer.wide { width: min(560px, 100vw); }
.drawer-wrap.open .drawer { transform: none; }
.drawer-wrap.open .drawer-back { opacity: 1; }
.drawer header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer header h3 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px; }
.note-item { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; }
.note-item p { white-space: pre-wrap; margin: 0 0 4px; }
.note-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.note-form { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.det-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 10px; }
.det-head h4 { font: 600 1.2rem var(--serif); margin: 0 0 4px; }
.det-thumb { width: 72px; height: 96px; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; }
.sec-h { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.target-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.target-list li { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); flex-wrap: wrap; }
.timeline { list-style: none; padding: 0 0 0 4px; margin: 0; }
.timeline li { display: flex; gap: 12px; padding: 0 0 14px; position: relative; }
.timeline li::before { content: ''; position: absolute; left: 4px; top: 12px; bottom: -2px; width: 1px; background: var(--line-2); }
.timeline li:last-child::before { display: none; }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); margin-top: 6px; flex: none; position: relative; z-index: 1; }
.tl-posted .tl-dot, .tl-approved .tl-dot { background: var(--olive); }
.tl-failed .tl-dot { background: var(--terra); }
.tl-rescheduled .tl-dot, .tl-reschedule .tl-dot { background: var(--blue); }
.sticky-foot { position: sticky; bottom: -16px; background: var(--panel); padding: 12px 0; border-top: 1px solid var(--line); margin-top: 12px; }
.menu { position: fixed; z-index: 1000; min-width: 200px; max-width: min(360px, calc(100vw - 16px)); max-height: 60vh; overflow: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; color: var(--ink); padding: 8px 10px; border-radius: 6px; font: 14px var(--sans); cursor: pointer; min-height: 36px; }
.menu button:hover, .menu button:focus-visible { background: var(--hover); box-shadow: none; }
.menu button.danger { color: var(--terra); }
.menu button:disabled { color: var(--muted); cursor: default; background: none; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.menu-h { font-size: 12px; color: var(--muted); padding: 6px 10px 2px; font-weight: 600; }
.mcheck { width: 16px; display: inline-grid; place-items: center; color: var(--olive); flex: none; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 36px); gap: 2px; padding: 4px; }
.menu .emoji-grid button { width: 36px; height: 36px; padding: 0; justify-content: center; font-size: 20px; }
dialog.confirm { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; width: min(420px, calc(100vw - 32px)); background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
dialog.confirm::backdrop { background: var(--scrim); }
dialog.confirm h3 { margin-bottom: 8px; }
dialog.confirm p { color: var(--ink-2); }
dialog.confirm .row-end { margin-top: 16px; }
#toasts { inset: auto auto 20px 50%; transform: translateX(-50%); margin: 0; border: 0; padding: 0; background: transparent; overflow: visible; display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: calc(100vw - 32px); }
#toasts:not(:popover-open) { display: none; }
.toast { display: flex; align-items: center; gap: 12px; background: var(--ink); color: var(--bg); padding: 10px 10px 10px 16px; border-radius: var(--radius); box-shadow: var(--shadow); font-size: 14px; animation: toastIn .18s ease; }
.toast.bad { background: var(--terra); color: #fff; }
.toast-act { border: 0; background: none; color: var(--olive-soft); font: 600 14px var(--sans); cursor: pointer; text-decoration: underline; padding: 4px; }
.toast.bad .toast-act { color: #fff; }
.toast-x { border: 0; background: none; color: inherit; opacity: .7; cursor: pointer; display: grid; place-items: center; padding: 4px; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }

/* ---------- composer ---------- */
dialog.composer { border: 0; padding: 0; width: min(1240px, calc(100vw - 32px)); height: min(860px, calc(100vh - 32px)); max-height: none; max-width: none;
  border-radius: var(--radius-lg); background: var(--panel); color: var(--ink); box-shadow: var(--shadow); overflow: hidden; }
dialog.composer::backdrop { background: var(--scrim); }
.cz { display: grid; grid-template-columns: minmax(0, 1fr) 380px; height: 100%; }
.composer.no-preview .cz { grid-template-columns: minmax(0, 1fr); }
.composer.no-preview .cz-preview { display: none; }
.cz-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.cz-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.cz-head h2 { margin: 0; font-size: 1.5rem; }
.cz-scroll { flex: 1; overflow-y: auto; padding: 16px 20px 24px; }
.cz-channels { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ch-toggle { border: 0; background: none; padding: 3px; border-radius: 50%; cursor: pointer; position: relative; display: flex; flex-direction: column; align-items: center; }
.ch-toggle .avatar { transition: transform .12s; }
.ch-toggle.on .avatar-img { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--olive); }
.ch-toggle:hover .avatar { transform: translateY(-1px); }
.ch-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.err-dot { position: absolute; top: 0; right: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--terra); border: 2px solid var(--panel); }
.cz-chhint { margin-left: 6px; }
.cz-label { border: 0; background: transparent; padding: 10px 0 4px; font: 600 1.25rem var(--serif); min-height: 0; }
.cz-label:focus { box-shadow: none; border-bottom: 1px solid var(--olive); border-radius: 0; }
.cz-editor { border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--panel); margin-top: 8px; transition: border-color .15s, box-shadow .15s; }
.cz-editor:focus-within { border-color: var(--olive); box-shadow: 0 0 0 3px var(--olive-soft); }
.cz-editor.filedrop { border-style: dashed; border-color: var(--olive); background: var(--olive-soft); }
#czMain { border: 0; box-shadow: none; min-height: 150px; font-size: 15px; padding: 14px; resize: vertical; background: transparent; }
.cz-mediarow { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 14px 12px; }
.mthumb { position: relative; width: 84px; height: 108px; border-radius: 6px; cursor: grab; }
.mthumb .thumb { width: 100%; height: 100%; }
.mthumb .num { position: absolute; top: 4px; left: 4px; background: var(--olive); color: var(--olive-ink); border-radius: 999px; min-width: 20px; height: 20px; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.mthumb .dur { position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; border-radius: 4px; padding: 0 4px; }
.mthumb .x { position: absolute; top: 4px; right: 4px; border: 0; background: rgba(0,0,0,.65); color: #fff; border-radius: 999px; width: 22px; height: 22px; display: grid; place-items: center; cursor: pointer; }
.alt-btn { position: absolute; right: 4px; bottom: 4px; border: 0; background: rgba(0,0,0,.65); color: #fff; font: 700 10px var(--sans); border-radius: 4px; padding: 2px 5px; cursor: pointer; }
.alt-btn.has { background: var(--olive); color: var(--olive-ink); }
.mthumb.dragging { opacity: .4; }
.mthumb.drop-before { box-shadow: -4px 0 0 var(--olive); }
.mthumb.drop-after { box-shadow: 4px 0 0 var(--olive); }
.dropzone { width: 150px; height: 108px; border: 1.5px dashed var(--line-2); border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; font-size: 12.5px; color: var(--muted); cursor: pointer; margin: 0; padding: 8px; }
.dropzone:hover { border-color: var(--olive); color: var(--ink); background: var(--olive-soft); }
.cz-toolbar { display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.cz-counters { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ctr { display: inline-flex; align-items: center; gap: 4px; }
.upl { display: grid; grid-template-columns: minmax(0, 1fr) 140px 120px; gap: 10px; align-items: center; font-size: 13px; padding: 4px 14px; }
.upl span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upl .bar { height: 6px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.upl .bar i { display: block; height: 100%; background: var(--olive); transition: width .2s; }
.upl.bad { color: var(--terra); }
.upl.bad .bar i { background: var(--terra); }
.cz-lib { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin-top: 8px; background: var(--panel-2); }
.libgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; max-height: 300px; overflow: auto; margin-top: 8px; }
.libtile { position: relative; border: 2px solid transparent; border-radius: 8px; padding: 0; background: none; cursor: pointer; text-align: left; color: var(--ink); }
.libtile .thumb { width: 100%; height: auto; aspect-ratio: 9/14; }
.libtile .cap { display: block; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 2px; }
.libtile.sel { border-color: var(--olive); }
.libtile .num { position: absolute; top: 4px; left: 4px; background: var(--olive); color: var(--olive-ink); border-radius: 999px; width: 22px; height: 22px; display: grid; place-items: center; font-size: 12px; font-weight: 700; z-index: 1; }
.cz-linkrow { display: flex; gap: 6px; margin-top: 8px; }
.cz-nets { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); }
.cz-nettabs { display: flex; align-items: center; gap: 4px; padding: 8px 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cz-nettabs > .muted { margin-right: 8px; padding-bottom: 8px; }
.nettab { position: relative; display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; font: 500 14px var(--sans); }
.nettab.on { color: var(--ink); border-bottom-color: var(--olive); }
.nettab .err-dot { position: static; width: 8px; height: 8px; border: 0; }
.cz-pane { padding: 6px 14px 14px; }
.pane-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.ai-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--olive-soft); color: var(--olive); font-weight: 500; }
.ai-pill.soft { background: var(--bg-2); color: var(--muted); }
.tt-acct { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.tt-acct img { border-radius: 50%; }
.custom { margin-top: 6px; }
.toggles { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 4px 0; }
.legal a { color: var(--olive); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cover { display: grid; grid-template-columns: minmax(0, 1fr) 54px; gap: 12px; align-items: end; margin-top: 4px; }
.cover-v { width: 54px; height: 96px; object-fit: cover; border-radius: 6px; background: #000; }
.cover label span[data-coverval] { float: right; }
.cz-meta { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.cz-tagsrow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cz-checks { margin-top: 10px; }
.chk { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 4px; }
.chk li { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; padding: 6px 10px; border-radius: 6px; }
.chk li .ic { margin-top: 2px; }
.chk.e li { background: var(--terra-soft); color: var(--terra); }
.chk.w li { background: var(--gold-soft); color: var(--gold-ink); }
.chk-ok { display: flex; gap: 6px; align-items: center; color: var(--olive); font-size: 14px; }
.cz-when { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.when-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--ink); margin: 0; }
.when-row input { width: auto; margin: 0 !important; }
.quick { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.when-sum { display: flex; align-items: center; gap: 6px; margin: 0; }
.cz-foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.another { font-size: 13.5px; }
.foot-hint { margin-right: 4px; }
.when-btn { gap: 8px; }
.when-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.when-txt small { font-size: 11px; color: var(--muted); }
.when-txt b { font-weight: 600; font-size: 13px; }
.cz-preview { border-left: 1px solid var(--line); background: var(--bg); display: flex; flex-direction: column; min-height: 0; }
.pv-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; }
.pv-head h3 { margin: 0; }
.pv-close { display: none; }
.pv-tabs { display: flex; gap: 4px; padding: 0 16px 8px; }
.pv-tabs button { border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: var(--radius); width: 38px; height: 34px; display: grid; place-items: center; cursor: pointer; }
.pv-tabs button.on { color: var(--ink); border-color: var(--olive); box-shadow: inset 0 0 0 1px var(--olive); }
.pv-stage { flex: 1; overflow-y: auto; padding: 6px 16px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pv-empty { margin-top: 40px; }
.pv-note { max-width: 300px; text-align: center; }

/* phone mockups (always use platform colours, not the app theme) */
.phone { width: 290px; aspect-ratio: 9 / 19; background: #000; border-radius: 38px; padding: 9px; position: relative; box-shadow: 0 0 0 1px #3a3a3a, 0 10px 30px rgba(0,0,0,.25); flex: none; }
.notch { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: 84px; height: 22px; background: #000; border-radius: 999px; z-index: 5; }
.screen { position: relative; width: 100%; height: 100%; border-radius: 30px; overflow: hidden; font: 12.5px/1.35 -apple-system, 'Helvetica Neue', 'DM Sans', sans-serif; color: #fff; background: #000; }
.screen.light { background: #fff; color: #111; overflow-y: auto; scrollbar-width: none; }
.screen .fill, .screen > .pv-ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pv-ph { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: #222; color: #aaa; font-size: 12px; }
.screen.light .pv-ph { background: #f1f1f1; color: #888; }
.pv-m { display: block; }
.pv-tag { color: #9fc1ff; }
.screen.light .pv-tag { color: #00376b; }
.pv-av { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #8a8f63, #6b7247); color: #f6f1e8; display: inline-grid; place-items: center; font: 600 12px Georgia, serif; flex: none; }
.pv-av.img { object-fit: cover; padding: 0; }
.dim { opacity: .75; } .strong { font-weight: 600; }
.ai-lbl { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; color: #555; }
.ai-lbl.on-dark { color: #fff; background: rgba(255,255,255,.18); border-radius: 4px; padding: 2px 6px; margin: 4px 4px 0 0; font-weight: 500; backdrop-filter: blur(6px); }
.pv-top { position: absolute; top: 40px; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 0 14px; font-size: 16px; z-index: 2; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.pv-top.center { justify-content: center; gap: 14px; font-size: 14px; }
.pv-top.center .ic { position: absolute; right: 14px; }
.pv-rail { position: absolute; right: 8px; bottom: 90px; display: flex; flex-direction: column; gap: 14px; align-items: center; z-index: 2; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.pv-rail span { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.pv-rail small { font-size: 10px; }
.tt-av { position: relative; margin-bottom: 6px; }
.tt-av .pv-av { width: 40px; height: 40px; border: 1.5px solid #fff; }
.tt-av i { position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); width: 18px; height: 18px; border-radius: 50%; background: #fe2c55; color: #fff; font: 700 13px/18px sans-serif; text-align: center; font-style: normal; }
.pv-bottom { position: absolute; left: 0; right: 56px; bottom: 0; padding: 60px 12px 18px; background: linear-gradient(transparent, rgba(0,0,0,.55)); z-index: 2; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.pv-bottom p { margin: 4px 0 0; word-break: break-word; }
.pv-bottom .who { display: flex; align-items: center; gap: 8px; }
.pv-bottom .who .pv-av { width: 28px; height: 28px; }
.follow { border: 1px solid rgba(255,255,255,.8); border-radius: 6px; padding: 1px 8px; font-size: 11.5px; font-weight: 600; }
.follow.white { background: #fff; color: #111; border-color: #fff; border-radius: 999px; padding: 3px 10px; }
.music { font-size: 11.5px; display: flex; align-items: center; gap: 4px; }
.yt-title { font-size: 13.5px; font-weight: 500; }
.ig-bar { display: flex; justify-content: space-between; align-items: center; padding: 40px 12px 8px; }
.ig-logo { font: italic 600 20px Georgia, serif; }
.ig-bar span { display: flex; gap: 14px; }
.ig-hd { display: flex; align-items: center; gap: 8px; padding: 6px 10px; }
.ig-hd .who { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.ring { padding: 2px; border-radius: 50%; background: linear-gradient(45deg, #f9ce34, #ee2a7b, #6228d7); display: inline-flex; }
.ring .pv-av { border: 2px solid #fff; width: 30px; height: 30px; }
.ig-media { position: relative; background: #eee; }
.ig-media.r45 { aspect-ratio: 4 / 5; }
.ig-media .pv-m, .ig-media .pv-ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pv-count { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.pv-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(255,255,255,.85); color: #111; display: grid; place-items: center; cursor: pointer; z-index: 2; }
.pv-arrow.l { left: 6px; } .pv-arrow.r { right: 6px; }
.ig-act { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 8px 10px 4px; }
.ig-act > span { display: flex; gap: 12px; }
.ig-act > span:last-child { justify-content: flex-end; }
.pv-dots { display: flex; gap: 4px; justify-content: center; }
.pv-dots span { width: 6px; height: 6px; border-radius: 50%; background: #c7c7c7; }
.pv-dots span.on { background: #0095f6; }
.ig-cap, .ig-fc { padding: 2px 12px; word-break: break-word; }
.ig-cap .muted { color: #737373; }
.ig-fc { color: #444; }
.ig-time { padding: 4px 12px 16px; font-size: 10.5px; color: #737373; }
.story-bars { position: absolute; top: 36px; left: 10px; right: 10px; display: flex; gap: 3px; z-index: 3; }
.story-bars span { flex: 1; height: 2px; border-radius: 2px; background: rgba(255,255,255,.35); }
.story-bars span.done, .story-bars span.on { background: #fff; }
.story-hd { position: absolute; top: 46px; left: 10px; right: 10px; display: flex; align-items: center; gap: 6px; z-index: 3; flex-wrap: wrap; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.story-hd .ai-lbl { margin: 0; }
.story-tap { position: absolute; top: 80px; bottom: 70px; width: 40%; border: 0; background: transparent; z-index: 2; cursor: pointer; }
.story-tap.l { left: 0; } .story-tap.r { right: 0; }
.story-ft { position: absolute; left: 10px; right: 10px; bottom: 16px; display: flex; align-items: center; gap: 10px; z-index: 3; }
.story-ft .msg { flex: 1; border: 1px solid rgba(255,255,255,.7); border-radius: 999px; padding: 7px 12px; font-size: 12px; }
.screen.pin { padding-bottom: 12px; }
.pin-bar { display: flex; align-items: center; padding: 40px 12px 8px; }
.pin-media { margin: 0 8px; border-radius: 22px; overflow: hidden; background: #eee; max-height: 360px; }
.pin-media .pv-m { width: 100%; max-height: 360px; object-fit: cover; }
.pin-media .pv-ph { height: 260px; }
.pin-act { display: flex; align-items: center; gap: 14px; padding: 10px 14px; }
.pin-save { background: #e60023; color: #fff; font-weight: 700; border-radius: 999px; padding: 8px 14px; }
.pin-link { margin: 0 14px; font-size: 11.5px; color: #111; text-decoration: underline; display: flex; gap: 4px; align-items: center; }
.pin-title { margin: 4px 14px; font: 600 16px/1.25 -apple-system, sans-serif; color: #111; }
.pin-desc { margin: 0 14px 8px; color: #333; font-size: 12px; }
.pin-desc .muted { color: #767676; }
.pin-who { display: flex; align-items: center; gap: 8px; margin: 6px 14px; }

/* ---------- other pages ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-bottom: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.ch-card { display: flex; flex-direction: column; gap: 8px; }
.ch-card p { margin: 0; }
.ch-title { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
tbody tr:last-child td { border-bottom: 0; }
th { font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: var(--panel-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.media-link { margin-bottom: 8px; }
.media-link input { flex: 1; min-width: 200px; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; border-radius: var(--radius); }
.mgrid.filedrop { outline: 2px dashed var(--olive); outline-offset: 6px; }
.mcard { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.mcard .thumb { width: 100%; height: auto; aspect-ratio: 4 / 5; border-radius: 0; }
.mcard figcaption { padding: 8px 10px 4px; display: flex; flex-direction: column; min-width: 0; }
.mname { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcard-act { display: flex; gap: 4px; padding: 0 6px 8px; }
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.set-card.wide { grid-column: 1 / -1; }
.set-card h3 { margin-bottom: 4px; }
.slot-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.slot-row input[type=time] { width: 120px; }
.slot-row select { width: 150px; }
.days { display: flex; gap: 4px; flex-wrap: wrap; }
.daychip { margin: 0; cursor: pointer; }
.daychip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.daychip span { display: inline-grid; place-items: center; min-width: 40px; height: 32px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--muted); font-size: 12.5px; font-weight: 500; }
.daychip input:checked + span { background: var(--olive-soft); border-color: var(--olive); color: var(--ink); }
.daychip input:focus-visible + span { box-shadow: var(--focus); }
.set-card .row-start { margin-top: 10px; }
.chan-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--line); }
.chan-row .switch { width: 190px; }
.chan-row form { margin: 0 !important; }
.chan-row input { flex: 1; min-width: 200px; }
.crud-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.crud-row label { margin: 0; min-width: 140px; }
.crud-row.new { border-bottom: 0; }
.crud-act { display: flex; gap: 6px; padding-bottom: 2px; }

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  .app, .app.collapsed { grid-template-columns: minmax(0, 1fr); }
  .mobilebar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); }
  .mobilebar .brand { flex: 1; font-size: 1.2rem; }
  .mobilebar .icon-btn { width: 44px; height: 44px; }
  .mobilebar .btn { min-height: 40px; }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .2s ease; }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow); }
  .app.collapsed .sb-label { display: inline; }
  .app.collapsed .sidebar { align-items: stretch; }
  .sb-collapse { display: none; }
  .sb-nav a, .sb-ch { min-height: 44px; }
  .view { padding: 16px 16px 90px; }
  h1 { font-size: 1.7rem; }
  .page-head { margin-bottom: 12px; }
  .page-head .seg { order: 3; width: 100%; }
  .page-head [data-newpost], .page-head [data-new] { display: none; }
  .page-head .seg a { flex: 1; justify-content: center; }
  .list-tools { gap: 4px; }
  .search { width: 100%; }
  .search input { width: 100%; min-height: 44px; }
  .tab { min-height: 44px; padding: 10px; }
  .btn, .icon-btn { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .icon-btn.sm { width: 40px; height: 40px; }
  .btn.small { min-height: 40px; }
  .pcard { grid-template-columns: minmax(0, 1fr) 44px; }
  .pc-when { grid-column: 1 / -1; flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; gap: 10px; }
  .pc-time { flex-direction: row; gap: 6px; align-items: baseline; }
  .pc-main { grid-column: 1; }
  .pc-note { grid-column: 2; grid-row: 2; }
  .thumb { width: 64px; height: 80px; }
  .cal-tools { gap: 6px; }
  .cal-title { font-size: 1.1rem; margin-left: 4px; }
  .cal-wrap { grid-template-columns: minmax(0, 1fr); }
  .nodate { width: auto; position: static; max-height: none; }
  .mo-day { min-height: 72px; padding: 2px; }
  .mo-day .ev.compact .ev-top b, .mo-day .ev.compact .ev-st, .mo-day .ev.compact .ev-type { display: none; }
  .mo-day .ev.compact { padding: 2px; border-left-width: 3px; }
  .mo-plus { opacity: 1; }
  .mo-empty { display: none; }
  .set-grid { grid-template-columns: minmax(0, 1fr); }
  .row2 { grid-template-columns: minmax(0, 1fr); }
  .upl { grid-template-columns: minmax(0, 1fr) 80px; }
  .upl span:last-child { display: none; }
  dialog.composer { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
  .cz, .composer.no-preview .cz { grid-template-columns: minmax(0, 1fr); }
  .cz-preview { position: absolute; inset: 0; z-index: 10; border-left: 0; }
  .pv-close { display: grid; }
  .cz-head { padding: 10px 12px; }
  .cz-head h2 { font-size: 1.25rem; }
  .cz-scroll { padding: 12px 14px 20px; }
  .cz-foot { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .foot-hint { display: none; }
  .cz-foot .grow { display: none; }
  .cz-foot .btn { flex: 1; }
  .cz-foot .another { flex-basis: 100%; }
  .bulkbar { bottom: 8px; }
  .drawer, .drawer.wide { width: 100vw; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.thumb .vph { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, #2a2724, #3a3530); }
.cz-meta .link-btn { align-self: flex-start; }
.cz-head h2 { white-space: nowrap; }

/* =====================================================================
   Page: Home (v2 dashboard) — public/js/pages/home.js
   ===================================================================== */
.spin.sm { width: 14px; height: 14px; border-width: 2px; display: inline-block; vertical-align: -2px; }
.loading.small { padding: 24px 0; }
.hm-head { align-items: flex-end; }
.hm-date { margin: 4px 0 0; }
.hm-quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.hm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.hm-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hm-ch { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.hm-ch h2 { margin: 0; font-size: 1.35rem; }
.hm-ch .link-btn { text-decoration: none; font-weight: 500; white-space: nowrap; }
.hm-ch .link-btn:hover { text-decoration: underline; }
.hm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.hm-row { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding: 8px 0; }
.hm-row:first-child, .hm-flag:first-child { border-top: 0; padding-top: 0; }
.hm-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; border: 0; background: none; color: inherit; font: inherit; text-align: left; padding: 2px; border-radius: var(--radius); cursor: pointer; }
.hm-open:hover .hm-title { color: var(--olive); }
.hm-thumb.thumb { width: 44px; height: 56px; border-radius: 6px; }
.hm-thumb .play { width: 20px; height: 20px; }
.hm-thumb .play .ic { width: 9px; height: 9px; }
.hm-txt { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hm-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.hm-meta b { font-weight: 600; font-variant-numeric: tabular-nums; }
.hm-err { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hm-side { display: flex; align-items: center; gap: 6px; flex: none; }
.hm-flag { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding: 10px 0; }
.hm-flag .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hm-flag .meter { margin: 6px 0 0; }
.hm-more { padding: 8px 0 0; }
.hm-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); color: var(--ink-2); flex: none; }
.hm-ico.bad { background: var(--terra-soft); color: var(--terra); }
.hm-ico.gold { background: var(--gold-soft); color: var(--gold-ink); }
.meter.warn i { background: var(--terra); }
.hm-goal { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.hm-big { font: 600 2.4rem/1 var(--serif); font-variant-numeric: tabular-nums; }
.hm-big .muted { font-size: 1.4rem; }
.hm-goal-note { margin: 0; }
.hm-days { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.hm-day { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 2px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel-2); line-height: 1.2; }
.hm-dw { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.hm-day b { font: 600 1.15rem var(--serif); }
.hm-dn { font-size: 12px; font-weight: 600; min-width: 20px; text-align: center; border-radius: 999px; padding: 0 5px; }
.hm-day.has { border-color: color-mix(in srgb, var(--olive) 45%, transparent); background: var(--olive-soft); }
.hm-day.has .hm-dn { background: var(--olive); color: var(--olive-ink); }
.hm-day.free { border-style: dashed; border-color: var(--gold); background: repeating-linear-gradient(135deg, transparent 0 6px, var(--gold-soft) 6px 7px); }
.hm-day.free .hm-dn { color: var(--gold-ink); }
.hm-day.past { opacity: .6; }
.hm-day.today { box-shadow: 0 0 0 2px var(--olive); }
.hm-comcount { display: flex; align-items: center; gap: 14px; text-decoration: none; padding: 4px 0; }
.hm-comcount > span { display: flex; flex-direction: column; gap: 2px; }
.hm-comcount:hover b:not(.hm-big) { color: var(--olive); }
@media (max-width: 860px) {
  .hm-grid { grid-template-columns: minmax(0, 1fr); }
  .hm-quick .btn { flex: 1 1 auto; }
  .hm-side .chip { display: none; }
}

/* =====================================================================
   Page: Ideas (Create board) — public/js/pages/ideas.js
   ===================================================================== */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--bg-2); border: 1px solid transparent; border-radius: var(--radius-lg); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 160px; transition: border-color .15s, background .15s; }
.kcol.over { border-color: var(--olive); background: color-mix(in srgb, var(--olive-soft) 70%, var(--bg-2)); }
.kcol-h { display: flex; align-items: center; gap: 8px; padding: 0 2px; }
.kcol-h h2 { margin: 0; font: 600 14px var(--sans); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.kcol-list { display: flex; flex-direction: column; gap: 8px; min-height: 24px; }
.kcol-add { border: 1px dashed var(--line-2); background: none; color: var(--muted); border-radius: var(--radius); padding: 8px; font: 500 13px var(--sans); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; }
.kcol-add:hover { color: var(--ink); border-color: var(--olive); background: var(--panel); }
.kdrop { height: 3px; border-radius: 3px; background: var(--olive); margin: -2px 0; }
.idea { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.idea[draggable="true"] { cursor: grab; }
.idea:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.idea.dragging { opacity: .4; }
.idea-media .thumb { width: 100%; height: auto; aspect-ratio: 16 / 10; border-radius: 0; }
.idea-media { position: relative; }
.idea-main { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.idea-top { display: flex; align-items: flex-start; gap: 4px; }
.idea-top h3 { flex: 1; margin: 2px 0 0; font: 600 15px/1.35 var(--sans); word-break: break-word; }
.idea-top .icon-btn { margin: -4px -6px 0 0; }
.idea-main p { margin: 0; font-size: 13.5px; color: var(--ink-2); white-space: pre-line; word-break: break-word; }
.idea-foot { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.idea-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.idea.gal .idea-media .thumb { aspect-ratio: 4 / 5; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.tpl { display: flex; flex-direction: column; gap: 8px; }
.tpl h3 { margin: 0; }
.tpl-body { flex: 1; margin: 0; white-space: pre-line; font-size: 13.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.idea-form .idm-row { display: flex; gap: 8px; flex-wrap: wrap; }
.idm { position: relative; }
.idm .thumb { width: 76px; height: 96px; }
.idm .x { position: absolute; top: 4px; right: 4px; border: 0; background: rgba(0,0,0,.65); color: #fff; border-radius: 999px; width: 22px; height: 22px; display: grid; place-items: center; cursor: pointer; }
.idm-add { width: 110px; height: 96px; }
.tagrow { display: flex; gap: 6px; flex-wrap: wrap; }
.tagtoggle { display: inline-flex; align-items: center; gap: 4px; font: 500 13px var(--sans); padding: 4px 10px; border-radius: 999px; cursor: pointer; color: var(--ink-2); background: transparent; border: 1px solid color-mix(in srgb, var(--tc) 45%, transparent); min-height: 30px; }
.tagtoggle.on { background: color-mix(in srgb, var(--tc) 18%, transparent); color: var(--ink); border-color: var(--tc); }
.idea-form .sticky-foot { flex-wrap: wrap; }
@media (max-width: 860px) {
  .kanban { grid-template-columns: repeat(4, 82vw); scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 8px; scroll-padding: 0 16px; }
  .kcol { scroll-snap-align: start; }
  .page-head .id-new { display: none; }
  .idea-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

/* =====================================================================
   Page: Comments (Community inbox) — public/js/pages/comments.js
   ===================================================================== */
.cm-tools .badge { margin-left: 4px; }
.cm-src { display: inline-flex; align-items: center; gap: 4px; }
.inbox { display: grid; grid-template-columns: 330px minmax(0, 1fr); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); min-height: 520px; overflow: hidden; }
.ib-list { border-right: 1px solid var(--line); overflow-y: auto; max-height: calc(100vh - 220px); }
.ib-post { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: left; padding: 10px 12px; cursor: pointer; }
.ib-post:hover { background: var(--hover); }
.ib-post.on { background: var(--olive-soft); box-shadow: inset 3px 0 0 var(--olive); }
.ib-post .badge { margin-left: 0; flex: none; }
.ib-thumb.thumb { width: 48px; height: 60px; border-radius: 6px; }
.ib-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ib-cap { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.ib-txt .muted { display: inline-flex; align-items: center; gap: 3px; }
.ib-thread { min-width: 0; overflow-y: auto; max-height: calc(100vh - 220px); }
.ib-th { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 1; }
.ib-th-txt { min-width: 0; flex: 1; }
.ib-th-txt p { margin: 0 0 4px; }
.ib-th-txt a { color: var(--olive); }
.ib-back { display: none; }
.cm-list { list-style: none; margin: 0; padding: 4px 16px 16px; }
.cm { padding: 12px 0; border-bottom: 1px solid var(--line); }
.cm:last-child { border-bottom: 0; }
.cm-row { display: flex; gap: 10px; }
.cm-av { width: 34px; height: 34px; border-radius: 50%; background: var(--bg-2); color: var(--ink-2); display: grid; place-items: center; font: 600 14px var(--sans); flex: none; }
.cm-av.sm { width: 26px; height: 26px; font-size: 12px; }
.cm-body { flex: 1; min-width: 0; }
.cm-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cm-meta b { font-size: 14px; }
.cm-text { margin: 2px 0 4px; white-space: pre-wrap; word-break: break-word; }
.cm-act { display: flex; align-items: center; gap: 14px; }
.cm-act .muted { display: inline-flex; align-items: center; gap: 4px; }
.link-btn.muted-link { color: var(--muted); }
.cm.is-hidden > .cm-row .cm-text { opacity: .55; font-style: italic; }
.cm-replies { list-style: none; margin: 8px 0 0 44px; padding: 0 0 0 12px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.cm-reply { margin: 10px 0 0 44px; display: flex; flex-direction: column; gap: 6px; }
.cm-reply .row-end { flex-wrap: wrap; }
@media (max-width: 860px) {
  .inbox { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .ib-list, .ib-thread { max-height: none; border-right: 0; }
  .inbox .ib-thread { display: none; }
  .inbox.show-thread .ib-thread { display: block; }
  .inbox.show-thread .ib-list { display: none; }
  .ib-back { display: inline-grid; margin: -6px 0 0 -8px; }
  .ib-th { padding: 10px 12px; }
  .cm-list { padding: 0 12px 12px; }
  .cm-replies { margin-left: 22px; }
  .cm-reply { margin-left: 0; }
  .cm-src { display: none; }
}

/* =====================================================================
   Page: Insights — public/js/pages/insights.js
   ===================================================================== */
.ins-period { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.ins-custom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ins-custom input { width: auto; margin: 0 0 0 4px; }
.ins-range { display: flex; align-items: center; gap: 6px; margin: 4px 0 16px; }
.ins-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.ins-card b { font-variant-numeric: tabular-nums; }
.ins-chg { font-weight: 600; font-variant-numeric: tabular-nums; }
.ins-chg.up { color: var(--olive); }
.ins-chg.down { color: var(--terra); }
.ins-chg.flat { color: var(--muted); }
.ins-sec { margin-bottom: 22px; }
.ins-sec h2 { margin: 0 0 10px; }
.ins-sec header h2 { margin: 0; }
.ins-chart { width: 100%; height: auto; display: block; margin-top: 8px; }
.ins-chart .grid { stroke: var(--line); stroke-width: 1; }
.ins-chart .axis { fill: var(--muted); font: 11px var(--sans); }
.ins-chart .fill { fill: var(--olive); }
.ins-chart .hit { fill: transparent; }
.ins-chart .bar:hover .fill { fill: var(--olive-hover); }
.ins-chart .bar:hover .hit { fill: var(--hover); }
.ins-top { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.ins-tp { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.ins-tp-media { position: relative; display: block; }
.ins-tp-media .thumb { width: 100%; height: auto; aspect-ratio: 1 / 1; border-radius: 0; }
.ins-rank { position: absolute; top: 8px; left: 8px; background: var(--panel); color: var(--ink); font: 600 13px var(--sans); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; box-shadow: var(--shadow); }
.ins-tp-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.ins-tp-body p { margin: 0; font-size: 13.5px; }
.ins-tp-stats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ins-tp-stats li { display: inline-flex; align-items: center; gap: 3px; }
.ins-table td { vertical-align: middle; }
.th-sort { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; white-space: nowrap; }
.th-sort:hover { color: var(--ink); }
th[aria-sort="ascending"] .th-sort, th[aria-sort="descending"] .th-sort { color: var(--ink); }
.ins-post { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.ins-mini.thumb { width: 36px; height: 45px; border-radius: 4px; }
.ins-cap { font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ins-best { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.heat-wrap { overflow-x: auto; }
.heat { display: grid; grid-template-columns: 34px repeat(24, minmax(14px, 1fr)); gap: 3px; min-width: 420px; align-items: center; }
.heat .hh { font-size: 11px; color: var(--muted); height: 16px; }
.heat .hd { font-size: 12px; color: var(--muted); }
.hc { height: 22px; border-radius: 4px; background: color-mix(in srgb, var(--olive) var(--a), var(--panel)); }
.hc.none { background: var(--bg-2); }
.heat-legend { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.heat-legend i { width: 16px; height: 12px; border-radius: 3px; background: color-mix(in srgb, var(--olive) var(--a), var(--panel)); }
.ins-connect { align-items: center; }
.ins-fb-h { margin-top: 18px; }
@media (max-width: 1100px) {
  .ins-top { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .ins-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ins-cards .stat b { font-size: 1.6rem; }
  .ins-period .seg { width: 100%; overflow-x: auto; }
  .ins-period .seg button { flex: 1; justify-content: center; white-space: nowrap; padding: 6px 8px; }
  .ins-top { grid-template-columns: repeat(5, 62vw); overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 6px; }
  .ins-tp { scroll-snap-align: start; }
}
