:root {
  --ink: #111318; --muted: #6b7079; --line: #ececee; --soft: #f7f7f8; --accent: #0a66c2;
  --primary: #b9f081; --primary-hover: #a8e76c; --primary-edge: #a2dc68; --primary-ink: #111318; --primary-soft: #f5fcee; /* lime buttons take dark text; white would be unreadable */
  --story: #a15c07; --story-bg: #fdf3e1; --work: #1d4ed8; --work-bg: #e8effd; --tips: #047857; --tips-bg: #e3f6ee;
  --danger: #b42318; --hover: #f1f2f4; --active: #eceef1;
  /* one scale for corners; Admin settings → Design system shows every token */
  --r-xs: 4px; --r-sm: 6px; --r: 8px; --r-lg: 12px; --r-xl: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* While the editor, a pop-up, a confirm or the phone sidebar is open, the page behind it stays put; the gutter keeps the layout from jumping */
html { scrollbar-gutter: stable; }
html:has(#drawer:not([hidden]), #modal:not([hidden]), #dialog:not([hidden]), body.side-open) { overflow: hidden; }
.drawer .body, .modal .scroll { overscroll-behavior: contain; }
body { margin: 0; background: #fff; color: var(--ink); font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
h1 { font-size: 20px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.muted { color: var(--muted); margin: 0; }
.label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
/* Chinese and Korean (General settings → Language). Inter has no CJK glyphs, so name the system fonts that do; otherwise Windows can
   fall back to a serif. Latin stays in Inter. Tracking and caps are for Latin: CJK reads cramped with them, and needs 12px in small labels. */
html:lang(zh) body { font-family: Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, sans-serif; }
html:lang(ko) body { font-family: Inter, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif; }
:is(html:lang(zh), html:lang(ko)) :is(h1, .wz-body h3) { letter-spacing: 0; }
:is(html:lang(zh), html:lang(ko)) :is(.label, .sheet th, .sheet tr.week td, .pop-title) { font-size: 12px; letter-spacing: .02em; text-transform: none; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { border: 1px solid var(--line); border-radius: var(--r); padding: 6px 10px; background: #fff; outline: none; }
input:focus, select:focus, textarea:focus { border-color: #c9ccd2; }
/* One chevron for selects and suggestion inputs, sitting inside the 10px side padding */
select, input[data-combo] { appearance: none; padding-right: 30px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%236b7079' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E") no-repeat right 10px center / 12px; }
select { cursor: pointer; }
input, select { height: 34px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; border: 1px solid var(--line); background: #fff; border-radius: var(--r); padding: 0 14px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover, .btn.is-hover { background: var(--soft); }
.btn.primary, .btn.blue { background: var(--primary); border-color: var(--primary-edge); color: var(--primary-ink); }
.btn.primary:hover, .btn.blue:hover, .btn.primary.is-hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.ghost { border-color: transparent; }
.btn.danger { color: var(--danger); }
.btn.destroy { background: #e5484d; border-color: #e5484d; color: #fff; font-weight: 600; }
.btn.destroy:hover:not(:disabled), .btn.destroy.is-hover { background: #d93d42; border-color: #d93d42; }
.btn:disabled { opacity: .45; cursor: default; }
/* .is-hover shows the hover look in Admin → Design system */

.top, .tabs, .start, .schedule, main { max-width: 1120px; margin: 0 auto; padding: 0 32px; }
.top { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; padding-bottom: 20px; gap: 16px; }
.brand { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.stats { display: flex; gap: 6px; }
.stat { display: inline-block; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 999px; color: var(--muted); background: var(--hover); white-space: nowrap; }
.stat b { color: var(--ink); font-weight: 600; }
.stat.ready { color: var(--work); background: var(--work-bg); }
.stat.posted { color: var(--tips); background: var(--tips-bg); }
.stat.hold { color: var(--danger); background: #fdecea; }
.stat.ready b, .stat.posted b { color: inherit; }
.when-line { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.account { display: flex; align-items: center; gap: 10px; }
.account img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.account a { color: var(--muted); text-decoration: none; font-size: 13px; }
.account a:hover { color: var(--ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; display: inline-block; }

.schedule { display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; max-width: 1056px; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--r); }
.next { display: flex; flex-direction: column; min-width: 220px; }
.next strong { font-size: 18px; font-weight: 600; }
.warn { color: var(--danger); }
.queue-actions { display: flex; gap: 8px; align-items: center; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.day input { position: absolute; opacity: 0; pointer-events: none; }
.day span { display: inline-block; min-width: 46px; text-align: center; padding: 6px 0; border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); cursor: pointer; font-weight: 500; }
.day input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.day input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.field-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.schedule-form { display: flex; flex-direction: column; gap: 22px; padding-top: 20px; padding-bottom: 22px; }
/* Native scrollbars take no space; app.js draws a thin overlay thumb only while something scrolls */
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }
.scroll-thumb { position: fixed; z-index: 70; background: rgba(17,19,24,.32); border-radius: 999px; pointer-events: none; opacity: 0; transition: opacity .3s; }
.scroll-thumb.on { opacity: 1; transition: none; }
.menu { position: fixed; z-index: 60; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 8px 24px rgba(17,19,24,.08); padding: 4px; max-height: 240px; overflow-y: auto; }
.menu-item { padding: 7px 10px; border-radius: var(--r-sm); cursor: pointer; }
.menu-item:hover, .menu-item.active { background: var(--soft); }
.menu-item.selected { font-weight: 600; }
.skip { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
button.link { border: none; background: none; padding: 0; border-radius: var(--r-xs); color: var(--accent); cursor: pointer; font-size: inherit; }
input:disabled, select:disabled, textarea:disabled { background-color: var(--soft); color: var(--muted); }
.preview .comment { display: flex; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--line); font-size: 13px; }
.preview .comment img, .preview .comment .avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--soft); }
.preview .comment b { display: block; font-weight: 600; }
.preview .comment span { white-space: pre-wrap; word-break: break-word; }


main { padding-bottom: 80px; }
.signoff-lines { display: flex; flex-direction: column; gap: 22px; margin: 22px 0 8px; }
.signoff-lines .field { gap: 8px; }
.signoff-pf { display: inline-flex; align-items: center; gap: 6px; }
.signoff-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.signoff-row select { height: 30px; width: 150px; font-size: 13px; }
.admin-note { display: block; width: 100%; box-sizing: border-box; min-height: 360px; margin-top: 10px; padding: 12px 14px; line-height: 1.55; resize: vertical; font: inherit; }
.sheet-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 10px; }
.view-toggle { display: inline-flex; gap: 2px; padding: 3px; background: var(--soft); border: 1px solid var(--line); border-radius: var(--r); }
.view-toggle button { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border: 1px solid transparent; border-radius: var(--r-sm); background: none; color: var(--muted); font-weight: 500; cursor: pointer; }
.view-toggle button:hover { color: var(--ink); }
.view-toggle button.on { background: #fff; border-color: var(--line); color: var(--ink); box-shadow: 0 1px 2px rgba(17,19,24,.06); }
.view-toggle .count { font-size: 12px; color: var(--muted); }
.sheet-wrap { border: 1px solid var(--line); border-radius: var(--r); overflow: auto; }
.sheet { width: 100%; border-collapse: separate; border-spacing: 0; }
.sheet th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; background: #fbfbfc; border-bottom: 1px solid var(--line); }
.sheet td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
/* sheet-style column rules; the drag handle and # read as one column */
.sheet th:nth-child(n+3), .sheet tr.row td:nth-child(n+3) { border-left: 1px solid var(--line); }
.sheet tbody tr:last-child td { border-bottom: none; }
.sheet tr.row { cursor: pointer; }
.sheet tr.row:hover td { background: var(--soft); }
.sheet tr.row.open td { background: var(--active); }
.sheet tr.row.dragging { opacity: .35; }
.sheet tr.row.over td { box-shadow: inset 0 2px 0 var(--ink); }
.sheet tr.week td { padding: 8px 12px; background: #fff; font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.c { text-align: center; }
.num { color: var(--muted); width: 36px; font-variant-numeric: tabular-nums; }
.handle { width: 20px; color: #c2c5cb; cursor: grab; user-select: none; }
.title-cell { font-weight: 500; }
.when { color: var(--muted); font-size: 13px; white-space: nowrap; }
.when.scheduled { color: var(--ink); }
.when-badge { margin-left: 8px; }
.when.posted { color: #16a34a; }
.when.failed { color: var(--danger); }
.when.locked { color: var(--accent); }
.sheet tr.row.done td { color: var(--muted); }
/* checkboxes: solid switch green with a white check when ticked */
input[type=checkbox] { appearance: none; width: 16px; height: 16px; padding: 0; margin: 0; flex: none; border: 1.5px solid #c2c5cb; border-radius: var(--r-xs); background: #fff no-repeat center / 12px; cursor: pointer; vertical-align: middle; }
input[type=checkbox]:checked { background-color: #6fbf3a; border-color: #6fbf3a; background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 20 20%27 fill=%27none%27 stroke=%27%23fff%27 stroke-width=%272.6%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M4.5 10.5l3.5 3.5 7-8%27/%3E%3C/svg%3E"); }
input[type=checkbox]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=checkbox]:disabled { opacity: .5; cursor: default; }

/* every badge, status chip and pill (.pill .badge .stat .chip) shares this shape: 12px / 500, 2px 9px, fully round */
.pill { display: inline-block; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 999px; }
.pill.Story { color: var(--story); background: var(--story-bg); }
.pill.Work { color: var(--work); background: var(--work-bg); }
.pill.Tips { color: var(--tips); background: var(--tips-bg); }

/* The post editor: a centred pop-up over the dimmed sheet (full screen on a phone) */
.drawer { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(760px, calc(100vw - 48px)); height: min(900px, calc(100vh - 48px)); background: #fff; border-radius: var(--r-xl); box-shadow: 0 24px 64px rgba(17,19,24,.18); display: flex; flex-direction: column; overflow: hidden; z-index: 10; animation: pop-in .16s ease-out; }
@keyframes pop-in { from { opacity: 0; transform: translate(-50%, -48%) scale(.98); } }
@media (max-width: 760px) { .drawer { inset: 0; transform: none; width: auto; height: auto; border-radius: 0; animation: fade-in .15s ease-out; } }
.drawer header { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.drawer .body { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.drawer footer { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.drawer footer .spacer { flex: 1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.drawer textarea.content { min-height: 440px; resize: vertical; line-height: 1.55; }
.count { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.count .over { color: var(--danger); }
.status { font-size: 13px; padding: 10px 12px; border-radius: var(--r); background: var(--soft); }
.status.err { background: #fdecea; color: #8a1c12; }

.media { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.thumb { position: relative; aspect-ratio: 4/5; border-radius: var(--r); overflow: hidden; background: var(--soft); border: 1px solid var(--line); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: none; background: rgba(255,255,255,.92); cursor: pointer; font-size: 13px; line-height: 22px; padding: 0; }
.thumb .tag { position: absolute; left: 4px; bottom: 4px; font-size: 10px; background: rgba(255,255,255,.92); border-radius: var(--r-xs); padding: 1px 5px; }
.thumb[draggable=true] { cursor: grab; }
.thumb.dragging { opacity: .4; }
.thumb.drop-before { box-shadow: -4px 0 0 var(--primary-edge); }
.thumb.drop-after { box-shadow: 4px 0 0 var(--primary-edge); }
.media-actions { display: flex; gap: 8px; }

.modal { position: fixed; inset: 0; background: rgba(17,19,24,.32); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 24px; animation: fade-in .15s ease-out; }
/* Same dim layer behind the drawer; hidden while a pop-up already dims the page */
.scrim { display: none; position: fixed; inset: 0; z-index: 9; background: rgba(17,19,24,.32); animation: fade-in .15s ease-out; }
body:has(#drawer:not([hidden])):not(:has(#modal:not([hidden]))) .scrim { display: block; }
@keyframes fade-in { from { opacity: 0; } }
.sheet-card { background: #fff; border-radius: var(--r-xl); width: min(860px, 100%); max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; }
.sheet-card header { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.title-ic { display: inline-flex; align-items: center; gap: 8px; }
.title-ic svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.sheet-card .scroll { overflow-y: auto; padding: 16px 20px; }
.sheet-card footer { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; align-items: center; }
.library { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.library .thumb { cursor: pointer; }
.library .thumb.on { outline: 2px solid var(--ink); outline-offset: 1px; }
.folder { grid-column: 1 / -1; font-size: 12px; color: var(--muted); padding-top: 8px; }

.preview { width: min(555px, 100%); margin: 0 auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; overflow: hidden; }
.preview .who { display: flex; gap: 10px; padding: 12px 16px; align-items: center; }
.preview .who img, .preview .who .avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--soft); }
.preview .who b { display: block; font-weight: 600; }
.preview .who span { font-size: 12px; color: var(--muted); }
.preview .text { padding: 0 16px 12px; white-space: pre-wrap; word-wrap: break-word; }
.preview .more { color: var(--muted); cursor: pointer; }
.preview .pv-link { color: #0a66c2; font-weight: 600; } /* LinkedIn's link blue, for mentions and hashtags */
.preview .grid { display: grid; gap: 2px; }
.preview .grid img, .preview .grid video { width: 100%; height: auto; object-fit: cover; display: block; }
.preview .bar { display: flex; justify-content: space-around; border-top: 1px solid var(--line); padding: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }

/* Toast: every message (saved, created, deleted, problems) slides up from the bottom in brand green, then back down */
.toast { position: fixed; bottom: 20px; left: 50%; z-index: 90; display: flex; align-items: center; gap: 6px; max-width: min(360px, calc(100vw - 32px)); padding: 7px 12px; border-radius: var(--r); background: var(--primary); border: 1px solid var(--primary-edge); color: var(--primary-ink); font-size: 13px; font-weight: 500; line-height: 1.4; box-shadow: 0 6px 18px rgba(17,19,24,.12); transform: translate(-50%, calc(100% + 28px)); opacity: 0; pointer-events: none; transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .2s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast svg { width: 15px; height: 15px; flex: none; }
.toast.ds-static { position: static; transform: none; opacity: 1; pointer-events: auto; box-shadow: none; display: inline-flex; }
@media (prefers-reduced-motion: reduce) { .toast { transition: opacity .2s ease; } }
.setup { font-size: 13px; color: var(--muted); }
.setup ol { padding-left: 18px; margin: 8px 0; }
.setup code { background: var(--soft); padding: 1px 5px; border-radius: var(--r-xs); }

@media (max-width: 760px) {
  .top, .tabs, .start, .schedule, main { padding-left: 16px; padding-right: 16px; }
  .start { margin-left: 16px; margin-right: 16px; }
  .queue-actions { flex-wrap: wrap; }
  .settings-card .field-row { grid-template-columns: 1fr; }
  .auth { margin-top: 48px; }
  .schedule { margin-left: 16px; margin-right: 16px; }
}

/* AI polish */
.field-head { display: flex; justify-content: space-between; align-items: center; }
.ai-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 11px; font-size: 12px; font-weight: 500; cursor: pointer; }
.ai-btn span[aria-hidden] { color: var(--accent); }
.ai-btn:hover { background: var(--soft); }
.ai-btn:disabled { opacity: .6; cursor: default; }
.ai-card { margin-top: 6px; border: 1px solid var(--line); border-radius: var(--r); background: var(--soft); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; animation: fade-in .15s ease-out; }
.ai-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.ai-head .over { color: var(--danger); }
.ai-text { white-space: pre-wrap; line-height: 1.55; max-height: 360px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
.ai-actions { display: flex; gap: 8px; align-items: center; }
.ai-actions .spacer { flex: 1; }
.ig-comments { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ig-comments li { display: flex; align-items: center; gap: 6px; }
.ig-comments .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ig-comments .btn { height: 28px; padding: 0 10px; font-size: 13px; }
.ai-wait { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; padding: 4px 0; }
.spin { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* AI at work: a lime orb with a ring sweeping around it, over a short line on what shapes the result */
.ai-busy { width: min(380px, 100%); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 32px 28px 28px; }
.ai-busy b { font-size: 16px; font-weight: 600; margin-top: 10px; }
.ai-busy p { margin: 0; font-size: 13px; line-height: 1.55; }
.ai-orb { position: relative; width: 56px; height: 56px; border-radius: 50%; background: var(--primary-soft); color: #3b7a12; display: inline-flex; align-items: center; justify-content: center; }
.ai-orb svg { width: 24px; height: 24px; animation: ai-breathe 1.6s ease-in-out infinite; }
.ai-orb::before { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--primary-edge); border-top-color: transparent; border-right-color: transparent; animation: spin 1s linear infinite; }
@keyframes ai-breathe { 50% { transform: scale(.82); opacity: .7; } }
@media (prefers-reduced-motion: reduce) { .ai-orb svg { animation: none; } .ai-orb::before { animation-duration: 2.4s; } }
.ai-done { margin-top: 6px; font-size: 13px; color: var(--muted); }
.ready-box { pointer-events: none; }

.btn.icon { display: inline-flex; align-items: center; justify-content: center; padding: 0; width: 34px; color: var(--muted); }
.btn.icon:hover, .btn.icon.is-hover { color: var(--ink); }
.btn.icon svg { width: 18px; height: 18px; display: block; }
.who-name { font-weight: 500; }
.empty-row { text-align: center; padding: 28px 12px !important; }

/* Pinned date and per-post toggles in the post panel */
.invite-link { display: flex; gap: 8px; }
.invite-link input { flex: 1; min-width: 0; }
.pin-row { display: flex; gap: 8px 12px; flex-wrap: wrap; }
.pin-row select[data-pin=mode] { width: calc(50% - 6px); } /* one column of the fields grid above, so it lines up with Pillar etc. */
.pin-row input[data-pin=date], .pin-row select[data-pin=hour] { flex: 1 1 120px; min-width: 0; }
.hint { font-size: 12px; }
.checks { display: flex; flex-direction: column; gap: 6px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--ink); }

/* Platform settings and admin */
.settings-card { width: min(820px, 100%); height: min(680px, 90vh); }
.settings-card .schedule-form { gap: 0; padding-top: 0; }
.set { display: flex; flex-direction: column; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.set:last-child { border-bottom: none; }
.set h3 { margin: 0; font-size: 14px; font-weight: 600; }
.set textarea, .wz-body textarea { resize: vertical; line-height: 1.5; }
.conn-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.conn-row img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.conn-row .spacer { flex: 1; }
.examples { display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }

/* Login, setup and invite */
.auth-page { background: var(--soft); }
.auth .logo { margin-bottom: 4px; font-size: 20px; }
.cap-row { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.auth { max-width: 400px; margin: 12vh auto 0; padding: 32px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); display: flex; flex-direction: column; gap: 8px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.auth-form .btn { height: 36px; }
@media (max-width: 760px) { .auth { margin: 24px 16px; } }
/* privacy and data-deletion pages: the login card, wider, for reading */
.auth.doc { max-width: 640px; margin-top: 6vh; }
.doc h2 { font-size: 18px; margin: 8px 0 0; }
.doc h3 { font-size: 14px; margin: 12px 0 0; }
.doc p, .doc ul { margin: 0; }
.doc ul { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.doc a, .auth-links a { color: var(--accent); }
.auth-links { font-size: 12px; text-align: center; }
.ai-left { font-size: 12px; color: var(--muted); margin-left: 8px; }

/* ---------- app shell: sidebar + page ---------- */
:root { --side: 260px; --rail: 56px; --side-bg: #fcfcfd; }
.app { display: flex; min-height: 100vh; }
.page { flex: 1; min-width: 0; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: none; border-radius: var(--r); background: transparent; color: var(--muted); cursor: pointer; padding: 0; flex: none; position: relative; }
.icon-btn:hover, .icon-btn.is-hover { background: var(--hover); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.sm { width: 24px; height: 24px; border-radius: var(--r-sm); }
.icon-btn.sm svg { width: 16px; height: 16px; }
.menu-btn { display: none; }

.side { position: sticky; top: 0; height: 100vh; width: var(--side); flex: none; display: flex; flex-direction: column; background: var(--side-bg); border-right: 1px solid var(--line); transition: width .18s ease; z-index: 8; }
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 10px 16px; gap: 8px; }
.side-actions { display: flex; align-items: center; gap: 2px; }
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); min-width: 0; }
.word { font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.add-platform { margin: 4px 8px 4px; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px; border: none; border-radius: var(--r); background: none; cursor: pointer; font-weight: 500; color: var(--ink); }
.add-platform:hover { background: var(--hover); }
.add-platform .ic svg { width: 16px; height: 16px; display: block; color: var(--muted); }
.side-nav { flex: 1; overflow-y: auto; padding: 4px 8px 12px; }
.group { margin-top: 10px; }
body:not(.collapsed) .group:first-child { margin-top: 0; } /* keeps the gap under Add platform equal to the one above it */
.group-head { display: flex; align-items: center; gap: 7px; padding: 0 4px 0 8px; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.group-head .grow { flex: 1; }
.pf { width: 18px; height: 18px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 700; flex: none; letter-spacing: -0.02em; }
.pf.big { width: 36px; height: 36px; border-radius: 9px; font-size: 15px; }
.pf svg { width: 62%; height: 62%; display: block; }
.pf.linkedin { background: none; color: #0a66c2; }
.pf.linkedin svg { width: 100%; height: 100%; }
.pf.threads { background: #111318; }
.pf.instagram { background: linear-gradient(135deg, #f9a825, #e1306c 55%, #833ab4); }
.pf.tiktok { background: #111318; }
.tab { display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 4px 0 8px; border-radius: var(--r); cursor: pointer; color: var(--ink); user-select: none; }
.tab:hover { background: var(--hover); }
.tab.active { background: var(--active); font-weight: 500; }
.tab-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.tab-name input { width: 100%; height: 26px; padding: 2px 6px; font-size: 14px; border-radius: var(--r-sm); border-color: var(--accent); }
.tab .more { opacity: 0; }
.tab:hover .more, .tab.active .more, .tab .more:focus-visible, .tab .more[aria-expanded=true] { opacity: 1; }
.av { width: 22px; height: 22px; border-radius: 50%; background: #dfe1e5; color: #3d424b; font-size: 10px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex: none; position: relative; }
.av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.av.lg { width: 30px; height: 30px; font-size: 12px; }
.tab-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.tab-dot.paused { background: #c2c5cb; }
.side-empty { padding: 8px 12px; font-size: 13px; color: var(--muted); }

.side-foot { border-top: 1px solid var(--line); padding: 10px 8px 8px; display: flex; align-items: center; gap: 4px; }
.me { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 6px 8px; border: none; background: none; border-radius: var(--r); cursor: pointer; text-align: left; }
.me:hover, .me[aria-expanded=true] { background: var(--hover); }
.me-av { background: var(--primary); color: var(--primary-ink); }
.me-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.me-caret { margin-left: auto; display: flex; color: var(--muted); }
.me-caret svg { width: 16px; height: 16px; }
.badge { display: inline-block; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 999px; background: var(--work-bg); color: var(--work); flex: none; }
.bell .count { position: absolute; top: 1px; right: 0; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 999px; background: #e5484d; color: #fff; font-size: 9.5px; font-weight: 700; line-height: 15px; text-align: center; }

/* collapsed: an icon rail */
body.collapsed .side { width: var(--rail); }
body.collapsed .side-top { flex-direction: column; padding: 8px 0 8px; gap: 10px; }
body.collapsed .side-actions { flex-direction: column; gap: 4px; }
body.collapsed .side-top .logo { display: none; }
body.collapsed .word, body.collapsed .label-text, body.collapsed .group-head span:not(.pf), body.collapsed .group-head .icon-btn,
body.collapsed .tab-name, body.collapsed .tab .more, body.collapsed .tab-dot, body.collapsed .me-name, body.collapsed .me .badge, body.collapsed .me-caret, body.collapsed .side-empty { display: none; }
body.collapsed .add-platform { margin: 4px 10px 8px; width: 36px; padding: 0; justify-content: center; }
body.collapsed .side-nav { padding: 4px 0; }
body.collapsed .group { display: flex; flex-direction: column; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
body.collapsed .group:first-child { border-top: none; padding-top: 0; }
body.collapsed .group-head { padding: 0 0 4px; }
body.collapsed .tab { width: 38px; height: 38px; padding: 0; justify-content: center; }
body.collapsed .tab .av { width: 28px; height: 28px; font-size: 11px; }
body.collapsed .side-foot { flex-direction: column-reverse; padding: 8px 0 8px; }
body.collapsed .me { flex: none; padding: 4px; }

/* pop-over menus (tab ⋯, profile, bell) */
.pop { position: fixed; z-index: 65; min-width: 220px; max-width: 340px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 12px 32px rgba(17,19,24,.12); padding: 5px; animation: fade-in .12s ease-out; }
.pop .item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 10px; border: none; background: none; border-radius: var(--r-sm); cursor: pointer; text-align: left; font-size: 14px; color: var(--ink); text-decoration: none; }
.pop .item:hover, .pop .item:focus-visible { background: var(--soft); outline: none; }
.pop .item svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.pop .item.danger, .pop .item.danger svg { color: var(--danger); }
.pop .sep { height: 1px; background: var(--line); margin: 5px 2px; }
.pop .pop-head { padding: 8px 10px 6px; font-size: 12px; color: var(--muted); }
.pop .pop-head b { display: block; color: var(--ink); font-size: 14px; font-weight: 600; }
.credit-bar { height: 4px; border-radius: 999px; background: var(--line); margin-top: 6px; overflow: hidden; }
.credit-bar i { display: block; height: 100%; background: var(--accent); }
.pop.alerts { width: 340px; max-height: 440px; overflow-y: auto; padding: 0; }
.alerts .pop-head { position: sticky; top: 0; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; }
.alert { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.alert:last-child { border-bottom: none; }
/* Empty bell: the page empty state, shrunk to fit the pop-up */
/* New post pop-up: the editor's Post and Media sections, shorter */
.np-content { min-height: 180px; resize: vertical; line-height: 1.55; }
.label .optional { margin-left: 6px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); opacity: .8; }
.pop-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 22px 16px 20px; }
.pop-empty .empty-ic { margin-bottom: 6px; border: none; box-shadow: none; background: var(--hover); }
.pop-empty b { font-size: 14px; font-weight: 600; }
.pop-empty .muted { font-size: 13px; }
.alert.unread { background: #f5f9ff; }
.alert b { display: block; font-weight: 600; }
.alert .meta { font-size: 12px; color: var(--muted); }
.alert p { margin: 4px 0 0; white-space: pre-wrap; color: #3d424b; max-height: 4.6em; overflow: hidden; }

/* main panel bits */
.platform-line { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 500; width: 100%; }
.schedule, .setup-card { max-width: min(1056px, calc(100% - 64px)); }
.setup-card { margin: 0 auto 16px; padding: 16px 20px; border: 1px solid var(--primary-edge); border-radius: var(--r); background: var(--primary-soft); display: flex; flex-direction: column; gap: 12px; }
.setup-card .steps { display: flex; gap: 10px; flex-wrap: wrap; }
.setup-card .setup-step { border-color: #d6eebe; }
.setup-step { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.setup-step.done { color: var(--muted); }
.tick { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #c2c5cb; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.tick.on { background: var(--primary); border-color: var(--primary-edge); color: var(--primary-ink); }
.tick svg { width: 11px; height: 11px; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 14vh 24px; }
.empty h2 { margin: 4px 0 0; font-size: 16px; font-weight: 600; }
.empty p { margin: -4px 0 6px; font-size: 14px; }
.empty-ic { width: 44px; height: 44px; border-radius: var(--r-lg); background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(17,19,24,.05); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.empty-ic svg { width: 20px; height: 20px; }

/* add-platform wizard */
.wizard { width: min(580px, 100%); }
.stepper { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.stepper .st { display: flex; align-items: center; gap: 6px; }
.stepper .st i { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 11px; font-weight: 600; }
.stepper .st.now { color: var(--ink); font-weight: 600; }
.stepper .st.now i { background: var(--primary); border-color: var(--primary-edge); color: var(--primary-ink); }
.stepper .st.past i { background: var(--soft); color: var(--ink); }
.stepper .st.skipped i { background: var(--soft); color: var(--muted); }
.stepper .bar { width: 12px; height: 1px; background: var(--line); }
.wz-body { display: flex; flex-direction: column; gap: 16px; }
.wz-body h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.wz-body p { margin: 0; }
.platforms { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pf-card { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; cursor: pointer; text-align: left; }
.pf-card:hover:not(:disabled) { border-color: var(--primary-edge); }
.pf-card:disabled { cursor: default; opacity: .55; }
.pf-card b { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.pf-card .added { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px 2px 7px; border-radius: 999px; background: #eefbe2; color: #3b7a12; font-size: 12px; font-weight: 500; }
.pf-card .added svg { width: 10px; height: 10px; }
.pf-card small { color: var(--muted); font-size: 12px; }
.note { font-size: 13px; color: var(--muted); background: var(--soft); border-radius: var(--r); padding: 10px 12px; }
/* Post fields step: tap a chip to add or drop a column; the strip below previews the post list's header */
.wz-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wz-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px 0 11px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; transition: background .12s, border-color .12s; }
.wz-chip svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.wz-chip:hover { border-color: var(--primary-edge); }
.wz-chip.on { background: var(--primary-soft); border-color: var(--primary-edge); font-weight: 500; }
.wz-chip.on svg { color: #3b7a12; }
.wz-cols { display: flex; flex-direction: column; gap: 6px; }
.wz-cols-row { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border-radius: var(--r); background: var(--soft); }
.wz-cols-row span { padding: 3px 8px; border-radius: 6px; font-size: 12px; color: var(--muted); }
.wz-cols-row span.pick { background: #fff; color: var(--ink); font-weight: 500; box-shadow: 0 0 0 1px var(--line); }
.wz-done { display: flex; flex-direction: column; gap: 12px; }
.wz-done .row { display: flex; gap: 10px; align-items: flex-start; }
.wz-done .row span.muted { font-size: 12px; display: block; }
.waiting { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.sheet-card footer .spacer { flex: 1; }

/* admin + settings sheets */
.invite { display: grid; grid-template-columns: 1fr 120px 110px auto; gap: 8px; }
.invite:has([name=cap][hidden]) { grid-template-columns: 1fr 120px auto; }
.invite [hidden] { display: none; }
.people { width: 100%; border-collapse: collapse; font-size: 13px; }
.people td { padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.people tr:last-child td { border-bottom: none; }
.people .who { display: flex; align-items: center; gap: 9px; }
.people .who small { display: block; color: var(--muted); }
.people input { width: 72px; height: 30px; padding: 4px 8px; }
.role-pick { display: inline-flex; align-items: center; gap: 3px; border: 0; cursor: pointer; font-family: inherit; line-height: inherit; height: auto; }
.role-pick svg { width: 12px; height: 12px; }
.people .rm-cell { width: 1%; padding-right: 0; text-align: right; }
.pill.invited { color: #92400e; background: #fef3c7; }
.pill.active { color: var(--tips); background: var(--tips-bg); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 999px; background: var(--hover); }
.toggles { display: flex; flex-direction: column; gap: 8px; }
.toggles label { display: flex; align-items: center; gap: 9px; }
.top-layer { z-index: 40; }

/* round expand handle on the collapsed rail's right edge; shows while the rail is hovered */
.edge-toggle { position: absolute; top: 60px; right: -12px; z-index: 9; width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: #b4b8bf; box-shadow: 0 1px 3px rgba(17,19,24,.08); display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .15s ease, color .15s ease; }
.edge-toggle svg { width: 14px; height: 14px; }
body.collapsed .side:hover .edge-toggle, body.collapsed .edge-toggle:focus-visible { opacity: 1; pointer-events: auto; }
body:not(.collapsed) .edge-toggle { visibility: hidden; }
.edge-toggle:hover { color: var(--muted); border-color: #d5d7dc; }

@media (max-width: 760px) {
  .edge-toggle { display: none; }
  .menu-btn { display: inline-flex; }
  .schedule, .setup-card { max-width: none; }
  .setup-card { margin: 0 16px 16px; }
  .top { justify-content: flex-start; flex-wrap: wrap; row-gap: 10px; }
  .top .account { margin-left: auto; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-100%); transition: transform .2s ease; z-index: 50; }
  body.collapsed .side { width: min(300px, 86vw); }
  body.side-open .side { transform: none; box-shadow: 12px 0 40px rgba(17,19,24,.12); }
  .side-scrim { position: fixed; inset: 0; background: rgba(17,19,24,.32); z-index: 49; display: none; }
  body.side-open .side-scrim { display: block; }
  #collapse { display: none; }
  .setup-card { margin-left: 16px; margin-right: 16px; }
  .platforms, .invite { grid-template-columns: 1fr; }
  .account > div { display: none; }
}

/* ---------- post fields ---------- */
.pill.c-gray { color: #5f5e5b; background: #f1f1ef; }
.pill.c-brown { color: #8a5a44; background: #f4eeee; }
.pill.c-orange { color: #b8620b; background: #fbecdd; }
.pill.c-yellow { color: #9a6c16; background: #fbf3db; }
.pill.c-green { color: #3b7553; background: #edf3ec; }
.pill.c-blue { color: #2a6b90; background: #e7f3f8; }
.pill.c-purple { color: #7b519d; background: #f6f3f9; }
.pill.c-pink { color: #a83f76; background: #faf1f5; }
.pill.c-red { color: #b8403b; background: #fdebec; }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(17,19,24,.08); padding: 0; flex: none; cursor: pointer; display: inline-block; }
.dot.c-gray { background: #d3d3d0; } .dot.c-brown { background: #c9a796; } .dot.c-orange { background: #f0b27a; } .dot.c-yellow { background: #edd38a; } .dot.c-green { background: #9fc6a6; }
.dot.c-blue { background: #92c3dd; } .dot.c-purple { background: #c6add9; } .dot.c-pink { background: #e7a9c8; } .dot.c-red { background: #ef9d9a; }

/* table: the handle, # and Title stay put while wide tables scroll sideways */
.sheet { min-width: max-content; }
.sheet .handle, .sheet .handle-h { position: sticky; left: 0; z-index: 1; width: 28px; min-width: 28px; }
.sheet .num, .sheet .num-h { position: sticky; left: 28px; z-index: 1; width: 44px; min-width: 44px; }
.sheet .title-cell, .sheet .title-h { position: sticky; left: 72px; z-index: 1; min-width: 220px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; box-shadow: 1px 0 0 var(--line); }
.sheet td.handle, .sheet td.num, .sheet td.title-cell { background: #fff; }
.sheet th.handle-h, .sheet th.num-h, .sheet th.title-h { background: #fbfbfc; }
.sheet tr.week .sticky { position: sticky; left: 12px; }
.fcell { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcell.t-checkbox, .fcol.t-checkbox { width: 80px; max-width: 80px; text-align: center; }
.fcell.t-number { text-align: right; font-variant-numeric: tabular-nums; max-width: 100px; }
.fcell.t-date { max-width: 96px; color: var(--muted); }
.fcell.t-multi { max-width: 200px; }
.fcell .pill + .pill { margin-left: 2px; }
.fcell a { color: var(--accent); text-decoration: none; }
.cell-check svg { width: 14px; height: 14px; color: #3b7553; vertical-align: middle; }
.sheet th.fcol { cursor: grab; user-select: none; }
.sheet th.fcol .grip { color: #c2c5cb; margin-right: 8px; font-size: 14px; line-height: 1; font-weight: 400; letter-spacing: 0; vertical-align: -1px; } /* same dots as the row handle */
.sheet th.fcol.dragging { opacity: .4; }
.sheet th.drop-before { box-shadow: inset 2px 0 0 var(--primary-edge); }
.sheet th.drop-after { box-shadow: inset -2px 0 0 var(--primary-edge); }

/* Editors: field inputs */
button.multi { display: flex; align-items: center; gap: 4px; overflow: hidden; min-height: 34px; width: 100%; padding: 5px 30px 5px 10px; border: 1px solid var(--line); border-radius: var(--r); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%236b7079' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E") no-repeat right 10px center / 12px; cursor: pointer; text-align: left; white-space: nowrap; }
button.multi:disabled { background-color: var(--soft); cursor: default; }
.fields-grid { row-gap: 14px; }
.pop.multi-pop { max-height: 300px; overflow-y: auto; }
.pop .opt { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: var(--r-sm); cursor: pointer; }
.pop .opt:hover { background: var(--soft); }
.pop-empty { margin: 6px 8px; font-size: 13px; }
.pop-title { margin: 6px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pop .item:disabled { opacity: .45; cursor: default; }
.pop .item-note { margin-left: auto; font-size: 12px; }
.pop.add-col { max-height: 420px; overflow-y: auto; min-width: 260px; }

/* settings: a rail of tabs on the left */
.settings-card .set-wrap { flex: 1; min-height: 0; display: flex; }
.set-nav { width: 180px; flex: none; padding: 12px 8px; border-right: 1px solid var(--line); background: var(--side-bg); display: flex; flex-direction: column; gap: 2px; }
.set-tab { display: flex; align-items: center; gap: 9px; padding: 7px 10px; white-space: nowrap; border: none; background: none; border-radius: var(--r); cursor: pointer; color: var(--ink); font-size: 14px; text-align: left; }
.set-tab svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.set-tab:hover { background: var(--hover); }
.set-tab.on { background: var(--active); font-weight: 600; }
.set-tab.on svg { color: var(--ink); }
.settings-card .set-panels { flex: 1; min-width: 0; }
/* branch rows under a tab (Admin → Design system): a trunk under the tab's icon, a rounded elbow into each row */
.set-nav { overflow-y: auto; }
.set-tab.parent-on svg { color: var(--ink); }
.set-chev { margin-left: auto; display: flex; } /* Design system's branches open below it */
.set-tab .set-chev svg { width: 14px; height: 14px; transition: transform .15s; }
.set-chev { margin-right: -4px; padding: 2px; border-radius: var(--r-xs); }
.set-chev:hover { background: var(--active); }
.set-tab[aria-expanded=false] .set-chev svg { transform: rotate(-90deg); }
.set-sub { display: flex; flex-direction: column; gap: 2px; }
.set-tab.sub { position: relative; margin-left: 30px; color: var(--muted); }
.set-tab.sub:hover, .set-tab.sub.on { color: var(--ink); }
.set-tab.sub::before { content: ""; position: absolute; left: -12px; top: -2px; width: 8px; height: calc(50% + 2px); border-left: 1.5px solid #d5d8dd; border-bottom: 1.5px solid #d5d8dd; border-bottom-left-radius: 6px; }
.set-tab.sub:not(:last-child)::after { content: ""; position: absolute; left: -12px; top: 50%; bottom: -2px; border-left: 1.5px solid #d5d8dd; }
.set-panel > .set:last-child, .set[data-ds] { border-bottom: none; }
.danger-zone h3 { color: var(--danger); }
.foot-note { font-size: 12px; }

/* the Post fields list */
.pf-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.pf-row { border-bottom: 1px solid var(--line); }
.pf-head { display: flex; align-items: center; gap: 10px; padding: 9px 12px; min-height: 44px; cursor: pointer; }
.pf-head:hover { background: var(--soft); }
.pf-row.fixed .pf-head { cursor: default; color: var(--muted); background: #fbfbfc; }
.pf-row.fixed b { font-weight: 500; }
.pf-ic svg { width: 16px; height: 16px; display: block; color: var(--muted); }
.pf-head b { font-weight: 600; font-size: 14px; }
.pf-head .spacer { flex: 1; }
.pf-type { font-size: 12px; }
.pf-chev svg { width: 14px; height: 14px; display: block; color: #9aa0a8; transition: transform .15s ease; }
.pf-row.open .pf-chev svg { transform: rotate(90deg); }
.pf-body { display: flex; flex-direction: column; gap: 14px; padding: 4px 12px 16px 38px; }
.pf-opts { display: flex; flex-direction: column; gap: 6px; }
.pf-opt { display: flex; align-items: center; gap: 6px; }
.pf-opt input { flex: 1; min-width: 0; height: 32px; padding: 4px 8px; }
.pf-opt .icon-btn:disabled { opacity: .3; cursor: default; background: none; }
.pf-add { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.pf-add .btn { display: inline-flex; align-items: center; gap: 6px; }
.pf-add .btn svg { width: 16px; height: 16px; }
button.link.danger { color: var(--danger); font-size: 13px; }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { width: 26px; height: 15px; border-radius: 999px; background: #d5d8dd; position: relative; transition: background .15s ease; flex: none; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: #fff; transition: transform .15s ease; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.switch input:checked + i { background: #6fbf3a; }
.switch input:checked + i::after { transform: translateX(11px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Admin settings → Design system */
.ds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ds-swatch, .ds-radius { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.ds-swatch span { height: 44px; border-radius: var(--r); border: 1px solid var(--line); margin-bottom: 6px; }
.ds-radius span { height: 44px; border: 1.5px solid var(--primary-edge); background: var(--primary-soft); margin-bottom: 6px; }
.ds-swatch b, .ds-radius b { font-weight: 600; }
.ds-swatch small, .ds-radius small, .ds-row small, .ds-space small, .ds-icons small { font-size: 12px; color: var(--muted); }
.ds-rows { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-lg); }
.ds-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.ds-row:last-child { border-bottom: none; }
.ds-space { display: flex; align-items: flex-end; gap: 20px; }
.ds-space div { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ds-space span { background: var(--primary); border: 1px solid var(--primary-edge); border-radius: 2px; }
.ds-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.ds-icons div { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px 8px; border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.ds-icons svg { width: 18px; height: 18px; color: var(--ink); }
.ds-icons small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ds-variant { display: flex; flex-direction: column; gap: 8px; }
.ds-variant-head { display: flex; align-items: baseline; gap: 10px; font-size: 13px; }
.ds-variant-head code { font: 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--muted); }
.ds-inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ds-input { display: flex; flex-direction: column; gap: 14px; padding: 16px 14px 12px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.ds-input.tall { grid-row: span 2; }
.ds-input.tall .field, .ds-input.tall textarea { flex: 1; }
.ds-input-name { margin-top: auto; text-align: center; font-size: 10px; }
.ds-states { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.ds-state { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 10px; min-height: 92px; padding: 16px 4px 10px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.ds-state .label { font-size: 10px; }
.ds-ptab { border-bottom: none; }
.ds-none { height: 34px; display: flex; align-items: center; color: #c2c5cb; font-size: 16px; }

@media (max-width: 760px) {
  .settings-card .set-wrap { flex-direction: column; }
  .set-nav { width: auto; flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--line); padding: 8px; }
  .set-tab { flex: none; }
  .set-sub { flex-direction: row; }
  .ds-states { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ds-inputs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .set-tab.sub { margin-left: 0; }
  .set-tab.sub::before, .set-tab.sub::after { display: none; }
  .pf-head { flex-wrap: wrap; }
  .pf-body { padding-left: 12px; }
  .sheet .title-cell, .sheet .title-h { min-width: 160px; }
}

/* collapsed rail keeps only the expand control up top; account avatars read as the app's green */
body.collapsed #bell { display: none; }
.tab .av { background: var(--primary-soft); border: 1px solid var(--primary-edge); color: #3b7a12; }
.people .av { background: var(--primary); color: var(--primary-ink); } /* same as your own avatar in the sidebar */
.save-note { display: inline-flex; align-items: center; gap: 6px; }
.save-note svg { width: 14px; height: 14px; flex: none; }
.save-note .spin { width: 12px; height: 12px; border-width: 1.5px; }
.save-note.saved svg { color: #16a34a; }
.save-note.saved { color: var(--ink); }
.save-note.error { color: var(--danger); }

/* ---------- Plan / Stats tabs and the Stats view (Admin → Design system → Tabs and Data show each part) ---------- */
.views { max-width: 1120px; margin: 0 auto 16px; padding: 0 32px; }
/* Primary tab: the page's top-level views, an underline strip on a full-width hairline */
.ptabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); }
.ptabs button { position: relative; border: 0; background: none; height: 38px; padding: 0 2px; font-weight: 500; color: var(--muted); cursor: pointer; }
.ptabs button::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: transparent; }
.ptabs button:hover, .ptabs button.is-hover { color: var(--ink); }
.ptabs button:hover::after, .ptabs button.is-hover::after { background: #d5d8dd; }
.ptabs button[aria-selected=true] { color: var(--ink); font-weight: 600; }
.ptabs button[aria-selected=true]::after { background: var(--ink); }
.ptabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--r-sm); }
.stats-view { max-width: 1120px; margin: 0 auto; padding: 0 32px 40px; display: flex; flex-direction: column; gap: 16px; }
.stats-head { display: flex; align-items: center; gap: 12px; }
.stats-head .note { flex: 1; margin: 0; }
.stats-head .btn .spin { width: 12px; height: 12px; border-width: 1.5px; }
.stats-empty { padding: 10vh 24px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.kpi { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi b { font-size: 24px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpis.sm { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.kpi.sm { padding: 10px 12px; }
.kpi.sm span { font-size: 12px; }
.kpi.sm b { font-size: 18px; }
.stats-table .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats-table th:nth-child(2), .stats-table tr.row td:nth-child(2) { border-left: 1px solid var(--line); }
.stats-table .post-h, .stats-table .post-cell { position: sticky; left: 0; z-index: 1; min-width: 220px; max-width: 340px; box-shadow: 1px 0 0 var(--line); }
.stats-table .post-cell { background: #fff; }
.stats-table .post-h { background: #fbfbfc; }
.stats-table .post-cell b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-table .post-cell .muted { font-size: 12px; }
.bar-cell { display: inline-flex; align-items: center; gap: 10px; }
.bar { width: 72px; height: 6px; border-radius: 3px; background: var(--work-bg); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; background: var(--work); }
/* How it did, at the top of a posted post's panel */
.perf { display: flex; flex-direction: column; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.perf h3 { margin: 0; font-size: 14px; font-weight: 600; }
.stat-inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat-inputs input { width: 100%; font-variant-numeric: tabular-nums; }
.insight p { margin: 0; line-height: 1.55; }
.insight ul { margin: 0; padding-left: 18px; line-height: 1.55; }
/* Admin → Apps: numbered setup steps that tick when done */
.app-card h3 .pill { margin-left: 4px; }
.steps-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.steps-list li { display: grid; grid-template-columns: 18px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.steps-list li:first-child { border-top: none; padding-top: 4px; }
.steps-list li > div { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.steps-list b { font-weight: 600; }
.steps-list p { margin: -6px 0 0; font-size: 13px; }
.steps-list .tick { font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 1px; }
.steps-list .switch { white-space: normal; }
.app-keys { display: flex; flex-direction: column; gap: 10px; }
.app-keys input { width: 100%; }
@media (max-width: 760px) {
  .views, .stats-view { padding-left: 16px; padding-right: 16px; }
  .stats-head { flex-wrap: wrap; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-table .post-h, .stats-table .post-cell { min-width: 150px; max-width: 180px; }
  .app-keys .field-row { grid-template-columns: 1fr; }
}
