/* Light theme. Neutral grays, one indigo accent, soft elevation. */
:root {
  color-scheme: light;
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f9fafb; --surface-3: #f2f4f7;
  --line: #eaecf0; --line-2: #d0d5dd;
  --ink: #101828; --ink-2: #475467; --ink-3: #667085; --ink-4: #98a2b3;
  --accent: #4f46e5; --accent-hover: #4338ca; --accent-ink: #fff; --accent-soft: #eef2ff; --accent-line: #c7d2fe;
  --ok: #067647; --ok-soft: #ecfdf3; --ok-line: #abefc6;
  --bad: #b42318; --bad-soft: #fef3f2; --bad-line: #fecdca;
  --warn: #b54708; --warn-soft: #fffaeb; --warn-line: #fedf89;
  --info: #175cd3; --info-soft: #eff8ff; --info-line: #b2ddff;
  --radius: 12px; --radius-sm: 8px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 24px -6px rgba(16, 24, 40, .10), 0 4px 8px -4px rgba(16, 24, 40, .05);
  --ring: 0 0 0 4px rgba(79, 70, 229, .14);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, Consolas, monospace;
  --sidebar: 248px; --top: 60px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14.5px/1.55 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: var(--accent); text-decoration: none; font-weight: 500; }
a:hover { color: var(--accent-hover); }
h1 { font-size: 1.6rem; font-weight: 650; margin: 0; letter-spacing: -.02em; line-height: 1.25; }
h2 { font-size: 1.25rem; font-weight: 650; margin: 0 0 14px; letter-spacing: -.01em; }
h3 { font-size: 1rem; font-weight: 600; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; letter-spacing: -.005em; }
p { margin: 0 0 12px; }
hr { border: 0; border-top: 1px solid var(--line); }
code { font-family: var(--mono); font-size: .84em; background: var(--surface-3); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; color: var(--ink); word-break: break-all; }
pre { font-family: var(--mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; }
small, .small { font-size: .82rem; }
.muted { color: var(--ink-3); }
.center { text-align: center; }
.text-bad { color: var(--bad); } .text-ok { color: var(--ok); } .text-warn { color: var(--warn); }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; gap: 8px 12px; }
.indent { padding-left: 26px; }
.icon { flex: none; vertical-align: -.2em; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
  padding: 9px 16px; border-radius: var(--radius-sm); font: 600 .9rem/1.2 var(--font); cursor: pointer; text-decoration: none !important; white-space: nowrap;
  box-shadow: var(--shadow-xs); transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
.btn:hover { background: var(--surface-2); color: var(--ink); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn-ghost { background: var(--surface); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: #912018; border-color: #912018; color: #fff; }
.btn-sm { padding: 7px 12px; font-size: .84rem; }
.btn-lg { padding: 12px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.linklike:hover { color: var(--accent-hover); }
.linklike.small { font-size: .82rem; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink-3); cursor: pointer; }
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }

/* Forms */
.form { display: grid; gap: 16px; }
.form + p { margin-top: 18px; }
label { display: grid; gap: 6px; align-content: start; font-weight: 500; font-size: .875rem; color: var(--ink-2); }
label small { font-weight: 400; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
  font: 400 .93rem/1.4 var(--font); box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--ink-4); }
select { appearance: none; padding-right: 36px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-line); box-shadow: var(--ring); }
input:disabled, input[readonly] { background: var(--surface-2); color: var(--ink-2); }
label.check { display: flex; align-items: center; gap: 9px; font-weight: 400; color: var(--ink); cursor: pointer; }
label.check input { width: 16px; height: 16px; accent-color: var(--accent); flex: none; margin: 0; }
.consent { margin-top: 6px; background: var(--surface-2); border: 1px solid var(--line); padding: 10px 12px; border-radius: var(--radius-sm); }
details { margin: 4px 0 12px; }
details summary { cursor: pointer; color: var(--ink-2); font-size: .88rem; font-weight: 500; margin-bottom: 8px; }
details summary:hover { color: var(--ink); }
.grid2 { display: grid; gap: 14px; }
.grid2.gap { gap: 20px; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.grid3 { display: grid; gap: 20px; }
@media (min-width: 900px) { .grid3 { grid-template-columns: repeat(3, 1fr); } }

/* Alerts & badges */
.alert { padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid; font-size: .9rem; font-weight: 500; }
.alert a { color: inherit; text-decoration: underline; }
.alert-success { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.alert-error { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.alert-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.alert.small { padding: 8px 12px; margin: 8px 0 0; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px; border-radius: 99px; font-size: .75rem; font-weight: 600; text-transform: capitalize;
  white-space: nowrap; border: 1px solid; line-height: 1.5; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.badge-bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.badge-info { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.badge-muted { background: var(--surface-2); color: var(--ink-2); border-color: var(--line); }
.badge-muted::before { background: var(--ink-4); }
.tag { display: inline-block; font-size: .7rem; background: var(--accent-soft); color: var(--accent); padding: 1px 7px; border-radius: 6px; font-weight: 600; vertical-align: middle; border: 1px solid var(--accent-line); }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 7px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); font-size: .86rem; font-weight: 500; box-shadow: var(--shadow-xs); }
.pico { display: inline-grid; place-items: center; width: var(--ps); height: var(--ps); border-radius: 28%; background: var(--pc); color: #fff;
  font: 700 calc(var(--ps) * .42)/1 var(--font); flex: none; letter-spacing: -.03em; }

/* Shell */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: rgba(255, 255, 255, .9); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); font-size: 1.05rem; letter-spacing: -.015em; text-decoration: none !important; }
.brand:hover { color: var(--ink); }
.brand.center { display: flex; justify-content: center; margin-bottom: 24px; font-size: 1.15rem; }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: #fff;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 55%, #4338ca 100%); box-shadow: 0 1px 2px rgba(67, 56, 202, .3), inset 0 1px 0 rgba(255, 255, 255, .18); }
.topbar-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.avatar-initials { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none; background: var(--accent-soft); color: var(--accent);
  font-size: .78rem; font-weight: 700; letter-spacing: .02em; border: 1px solid var(--accent-line); }
.topbar-right > .avatar-initials { display: none; }
.nav-toggle { display: inline-grid; place-items: center; background: none; border: 0; color: var(--ink-2); cursor: pointer; padding: 6px; border-radius: var(--radius-sm); }
.nav-toggle:hover { background: var(--surface-3); }
.shell { display: flex; min-height: calc(100vh - var(--top)); }
.sidebar { position: fixed; top: var(--top); bottom: 0; left: 0; width: var(--sidebar); background: var(--surface); border-right: 1px solid var(--line);
  padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; transform: translateX(-100%); transition: transform .2s ease; z-index: 25; overflow-y: auto; }
body.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(16, 24, 40, .35); }
.nav-label { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-4); padding: 14px 12px 6px; }
.nav-label:first-child { padding-top: 2px; }
.sidebar a { position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 500; font-size: .9rem; text-decoration: none; }
.sidebar a .icon { color: var(--ink-4); }
.sidebar a:hover { background: var(--surface-2); color: var(--ink); }
.sidebar a:hover .icon { color: var(--ink-3); }
.sidebar a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sidebar a.active .icon { color: var(--accent); }
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 2px 0 4px; }
.me-text { display: grid; min-width: 0; flex: 1; line-height: 1.35; }
.me-text b { font-size: .86rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text small { color: var(--ink-3); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { flex: 1; min-width: 0; padding: 20px 16px 100px; max-width: 1200px; margin: 0 auto; width: 100%; }
.hide-sm { display: none; }
@media (min-width: 960px) {
  .nav-toggle { display: none; }
  .sidebar { transform: none; position: sticky; height: calc(100vh - var(--top)); flex: none; }
  .topbar { padding: 0 20px; }
  .topbar-right > .avatar-initials { display: inline-grid; }
  .content { padding: 32px 40px 56px; }
  .hide-sm { display: inline-flex; }
  .bottomnav { display: none !important; }
}
.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-around; background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.bottomnav a { display: grid; justify-items: center; gap: 2px; color: var(--ink-3); text-decoration: none; min-width: 56px; padding-top: 2px; }
.bottomnav a span { display: grid; place-items: center; }
.bottomnav a small { font-size: .68rem; font-weight: 600; }
.bottomnav a.active { color: var(--accent); }
.bottomnav a.fab span { background: var(--accent); color: var(--accent-ink); width: 42px; height: 42px; border-radius: 50%; margin-top: -18px; box-shadow: var(--shadow-lg); border: 3px solid var(--surface); }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { display: flex; align-items: center; gap: 10px; }
.page-head + p.muted, .page-head + .muted { margin-top: -14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; min-width: 0; }
.card.flush { padding: 4px 0; }
.card.danger { border-color: var(--bad-line); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; }
.card-head h3 { margin: 0; }
.card-head > a { font-size: .86rem; }
.empty { text-align: center; padding: 48px 16px; color: var(--ink-3); background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.card .empty { border: 0; padding: 32px 16px; }
.empty p { margin-bottom: 14px; }
.empty.big { padding: 80px 16px; border: 0; background: none; }
.empty-code { font-size: 4.5rem; font-weight: 700; color: var(--line-2); letter-spacing: -.04em; }
.onboarding { background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%); border-color: var(--accent-line); }
.onboarding ol { margin: 0; padding-left: 20px; line-height: 2.1; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 20px; }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(4, 1fr); } .kpis.k6 { grid-template-columns: repeat(6, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; }
.kpi small { display: block; color: var(--ink-3); font-weight: 500; font-size: .84rem; margin-bottom: 6px; }
.kpi b { font-size: 1.75rem; font-weight: 650; letter-spacing: -.025em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi .delta { display: inline-block; font-size: .74rem; font-weight: 600; margin-left: 6px; padding: 1px 7px; border-radius: 99px; vertical-align: 4px; }
.delta.up { color: var(--ok); background: var(--ok-soft); } .delta.down { color: var(--bad); background: var(--bad-soft); }

/* Post rows */
.post-row { display: flex; align-items: center; gap: 14px; padding: 12px 8px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none !important; font-weight: 400; border-radius: var(--radius-sm); }
.card.flush .post-row { padding: 14px 20px; border-radius: 0; }
.post-row:last-child { border-bottom: 0; }
.post-row:hover { background: var(--surface-2); color: var(--ink); }
.thumb { width: 52px; height: 52px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-3); flex: none; position: relative; display: grid; place-items: center; border: 1px solid var(--line); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb-text { color: var(--ink-4); font-weight: 600; }
.play { position: absolute; inset: auto 5px 5px auto; display: grid; place-items: center; width: 20px; height: 20px; color: #fff; background: rgba(16, 24, 40, .6); border-radius: 50%; backdrop-filter: blur(4px); }
.post-main { flex: 1; min-width: 0; }
.post-cap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.post-meta { display: flex; gap: 8px; align-items: center; font-size: .8rem; margin-top: 4px; flex-wrap: wrap; }
.post-targets { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; max-width: 120px; }
.tgt { position: relative; }
.tgt::after { content: ''; position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--surface); background: var(--ink-4); }
.tgt-published::after { background: #12b76a; } .tgt-failed::after { background: #f04438; }
.tgt-waiting::after, .tgt-processing::after { background: #2e90fa; }
.tgt-cancelled { opacity: .4; }

/* Tabs (underline) and segmented range */
.tabs { display: flex; gap: 22px; overflow-x: auto; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 2px 1px 11px; margin-bottom: -1px; color: var(--ink-3); font-weight: 600; font-size: .88rem; white-space: nowrap; text-decoration: none; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 20px 0; font-size: .88rem; }
.range { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-xs); background: var(--surface); }
.range a { padding: 7px 13px; color: var(--ink-2); font-weight: 600; font-size: .84rem; text-decoration: none; border-left: 1px solid var(--line-2); }
.range a:first-child { border-left: 0; }
.range a:hover { background: var(--surface-2); color: var(--ink); }
.range a.active { background: var(--surface-3); color: var(--ink); }

/* Accounts */
.provider-grid { display: grid; gap: 20px; }
@media (min-width: 900px) { .provider-grid { grid-template-columns: 1fr 1fr; } }
.acct { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.acct-main { flex: 1; min-width: 140px; display: grid; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--surface-3); flex: none; border: 1px solid var(--line); }
.avatar.sm { width: 26px; height: 26px; }
.avatar.ph { display: grid; place-items: center; font-weight: 600; color: var(--ink-3); }

/* Media */
.dropzone { border: 1.5px dashed var(--line-2); border-radius: var(--radius); padding: 28px 16px; text-align: center; display: grid; justify-items: center; gap: 4px;
  background: var(--surface); margin-bottom: 20px; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover { border-color: var(--accent-line); background: #fcfcff; }
.dropzone b { font-weight: 600; }
.dz-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--surface-3); color: var(--ink-2); margin-bottom: 6px; border: 6px solid var(--surface-2); box-sizing: content-box; }
.dropzone.compact { padding: 18px 16px; margin: 14px 0 0; }
.dropzone.compact .dz-icon { width: 34px; height: 34px; border-width: 4px; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.upload-list { display: grid; gap: 8px; margin-top: 10px; text-align: left; width: 100%; max-width: 560px; }
.upload-list:empty { display: none; }
.up-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: .84rem; background: var(--surface); border: 1px solid var(--line); padding: 10px 12px; border-radius: var(--radius-sm); }
.up-row .bar { grid-column: 1 / -1; height: 6px; background: var(--surface-3); border-radius: 9px; overflow: hidden; }
.up-row .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; border-radius: 9px; }
.up-row .st { grid-column: 1 / -1; color: var(--ink-3); }
.up-row.ok .bar i { background: #12b76a; } .up-row.err { border-color: var(--bad-line); } .up-row.err .st { color: var(--bad); } .up-row.err .bar i { background: #f04438; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.media-grid.small { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 10px 0 16px; }
.media-item { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: grid; box-shadow: var(--shadow); transition: box-shadow .15s; }
.media-item:hover { box-shadow: var(--shadow-lg); }
.media-item img, .media-item video { width: 100%; aspect-ratio: 1; object-fit: cover; background: #0c111d; display: block; }
.media-item figcaption { padding: 10px 12px 12px; display: grid; gap: 6px; font-size: .85rem; }
.media-item figcaption .trunc { font-weight: 500; }
.media-item figcaption .row { margin-top: 2px; gap: 6px; flex-wrap: nowrap; }
.media-item figcaption .btn-sm { padding: 6px 10px; font-size: .8rem; }
.media-item figcaption .row form:last-child:not(:first-child) { margin-left: auto; }
.media-item .gone { aspect-ratio: 1; display: grid; place-items: center; color: var(--ink-3); font-size: .8rem; background: var(--surface-2); }
.lib-item { position: relative; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--surface-3); aspect-ratio: 1; box-shadow: var(--shadow-xs); }
.lib-item:hover { border-color: var(--accent-line); }
.lib-item img, .lib-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-item.on { border-color: var(--accent); box-shadow: var(--ring); }
.lib-item.on::after { content: '✓'; position: absolute; top: 5px; left: 5px; background: var(--accent); color: var(--accent-ink); width: 20px; height: 20px; border-radius: 50%; font-size: .72rem; font-weight: 700; display: grid; place-items: center; }

/* Compose */
.selected-media { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.selected-media:empty { display: none; }
.sel-item { position: relative; width: 112px; height: 112px; flex: none; border-radius: 10px; overflow: hidden; background: #0c111d; box-shadow: var(--shadow); }
.sel-item img, .sel-item video { width: 100%; height: 100%; object-fit: cover; }
.sel-n { position: absolute; top: 6px; left: 6px; background: rgba(16, 24, 40, .65); color: #fff; font-size: .72rem; font-weight: 600; border-radius: 6px; padding: 1px 7px; }
.sel-actions { position: absolute; top: 5px; right: 5px; display: flex; gap: 3px; }
.sel-actions button { border: 0; background: rgba(16, 24, 40, .65); color: #fff; border-radius: 6px; width: 24px; height: 24px; cursor: pointer; font-size: .7rem; }
.sel-actions button:hover { background: rgba(16, 24, 40, .85); }
.counters { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.counters span { font-size: .76rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; color: var(--ink-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.counters span.over { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.acct-pick { display: grid; gap: 10px; }
@media (min-width: 640px) { .acct-pick { grid-template-columns: 1fr 1fr; } }
.pick { display: block; cursor: pointer; font-weight: 400; color: var(--ink); }
.pick input { position: absolute; opacity: 0; }
.pick-body { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 40px 12px 14px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-xs); transition: border-color .15s, background .15s; }
.pick-body::after { content: ''; position: absolute; right: 14px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 5px; border: 1px solid var(--line-2); background: var(--surface); }
.pick:hover .pick-body { border-color: var(--accent-line); }
.pick-body span { display: grid; min-width: 0; }
.pick input:checked + .pick-body { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.pick input:checked + .pick-body::after { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center/11px no-repeat; border-color: var(--accent); }
.pick input:focus-visible + .pick-body { box-shadow: var(--ring); }
.pick.disabled { opacity: .55; cursor: not-allowed; }
.pcard h3 { margin-bottom: 10px; }
.tiktok-box { display: grid; gap: 12px; }
[data-tt-disclosure].need { outline: 1px dashed var(--warn); border-radius: 8px; padding: 6px 6px 6px 26px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 14px; box-shadow: var(--shadow-xs); background: var(--surface); }
.seg label { display: flex; flex-direction: row; align-items: center; gap: 7px; padding: 8px 16px; cursor: pointer; font-weight: 600; color: var(--ink-2); border-left: 1px solid var(--line-2); }
.seg label:first-child { border-left: 0; }
.seg label input { accent-color: var(--accent); margin: 0; }
.seg label:has(input:checked) { background: var(--accent-soft); color: var(--accent); }
.submit-bar { position: sticky; bottom: 76px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 12px 18px; box-shadow: var(--shadow-lg); z-index: 5; }
@media (min-width: 960px) { .submit-bar { bottom: 20px; } }

/* Post detail */
.caption-view { white-space: normal; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px; overflow-wrap: anywhere; }
.target { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.target:last-child { border-bottom: 0; }
.target-main { flex: 1; display: grid; min-width: 0; }
.target-error { overflow-wrap: anywhere; margin-top: 4px; }
.target-side { display: grid; justify-items: end; gap: 6px; }
.target-side a { display: inline-flex; align-items: center; gap: 4px; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 -20px; }
.card.flush .table-wrap { margin: 0; }
table.t { width: 100%; border-collapse: collapse; font-size: .875rem; }
table.t th { text-align: left; font-size: .75rem; letter-spacing: .02em; color: var(--ink-3); font-weight: 600; padding: 10px 20px; background: var(--surface-2); border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); white-space: nowrap; }
.card.flush table.t th { border-top: 0; }
table.t td.nw, table.t th.nw { white-space: nowrap; }
table.t td { padding: 12px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td { background: var(--surface-2); }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t .err { color: var(--bad); max-width: 380px; overflow-wrap: anywhere; font-size: .82rem; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.filters input, .filters select { width: auto; min-width: 150px; padding: 8px 10px; }
.filters select { padding-right: 34px; }

/* Charts (inline SVG from Svg.php) */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--ink-3); font: 11px var(--font); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--line); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .8rem; color: var(--ink-2); margin-top: 8px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 140px) 1fr auto; gap: 8px 12px; align-items: center; font-size: .86rem; }
.hbar .track { height: 8px; background: var(--surface-3); border-radius: 9px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: 9px; }
.hbar .v { font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 500; }
.funnel { display: grid; gap: 10px; }
.funnel .step { display: grid; grid-template-columns: 1fr auto; font-size: .88rem; gap: 4px; }
.funnel .step .track { grid-column: 1 / -1; height: 24px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.funnel .step .track i { display: block; height: 100%; background: linear-gradient(90deg, #6366f1, #4f46e5); border-radius: 6px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; font-size: .9rem; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; overflow-wrap: anywhere; font-weight: 500; }
.checklist { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; }
.checklist .ok { color: var(--ok); } .checklist .bad { color: var(--bad); } .checklist .warn { color: var(--warn); }
.copy { display: flex; gap: 6px; } .copy input { font-family: var(--mono); font-size: .82rem !important; }
.platform-card .help, .card > .help { font-size: .86rem; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; }

/* Public / auth */
.auth-body { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 500px at 50% -10%, #e0e7ff 0%, rgba(224, 231, 255, 0) 60%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 32px 28px; box-shadow: var(--shadow-lg); margin: auto 0 20px; }
.auth-card.wide { max-width: 640px; }
.auth-card h2 { text-align: center; font-size: 1.35rem; margin-bottom: 20px; }
.auth-card h3 { margin-top: 20px; }
.public-foot { display: flex; gap: 18px; font-size: .84rem; margin-top: auto; padding-top: 16px; }
.public-foot a { color: var(--ink-3); }
.public-foot a:hover { color: var(--ink); }
.hero { width: 100%; max-width: 1000px; padding: 32px 8px 32px; }
.hero h1 { font-size: clamp(2.4rem, 7vw, 4.2rem); font-weight: 700; line-height: 1.04; letter-spacing: -.04em; margin: 64px 0 18px; }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 580px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0; }
.hero-platforms { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.features { width: 100%; max-width: 1000px; display: grid; gap: 16px; padding: 0 8px 48px; }
@media (min-width: 800px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.feature b { font-weight: 600; }
.feature p { color: var(--ink-2); margin: 6px 0 0; }

/* Legal pages (Terms, Privacy) */
.legal-links { display: flex; gap: 14px; padding: 0 6px 12px; font-size: .78rem; }
.legal-links a { color: var(--ink-3); font-weight: 500; }
.legal-links a:hover { color: var(--ink); }
.legal-top { width: 100%; max-width: 1120px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 8px 0; }
.legal-nav { display: flex; align-items: center; gap: 18px; font-size: .9rem; }
.legal-nav a:not(.btn) { color: var(--ink-2); }
.legal-nav a.active { color: var(--accent); font-weight: 600; }
.legal { width: 100%; max-width: 1120px; padding: 40px 8px 48px; }
.legal-head { margin-bottom: 32px; }
.legal-head h1 { font-size: clamp(2rem, 5vw, 2.6rem); letter-spacing: -.03em; margin-bottom: 6px; }
.legal-kicker { color: var(--accent); font-weight: 600; font-size: .85rem; margin-bottom: 8px; }
.legal-body { display: grid; gap: 28px; align-items: start; }
@media (min-width: 960px) { .legal-body { grid-template-columns: 240px minmax(0, 1fr); gap: 40px; } .legal-toc { position: sticky; top: 24px; } }
.legal-toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); font-size: .86rem; }
.legal-toc b { display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 8px; }
.legal-toc ol { margin: 0; padding-left: 20px; display: grid; gap: 5px; color: var(--ink-4); }
.legal-toc a { color: var(--ink-2); font-weight: 500; }
.legal-toc a:hover { color: var(--accent); }
.legal-doc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 22px; font-size: .96rem; line-height: 1.7; color: var(--ink-2); min-width: 0; }
@media (min-width: 720px) { .legal-doc { padding: 40px 48px; } }
.legal-doc section { padding-top: 26px; margin-top: 26px; border-top: 1px solid var(--line); scroll-margin-top: 20px; }
.legal-doc h2 { color: var(--ink); font-size: 1.2rem; margin-bottom: 12px; }
.legal-doc h3 { color: var(--ink); font-size: 1rem; margin: 20px 0 8px; }
.legal-doc b { color: var(--ink); font-weight: 600; }
.legal-doc ul, .legal-doc ol { padding-left: 22px; margin: 0 0 14px; }
.legal-doc li { margin-bottom: 6px; }
.legal-doc li ul { margin: 8px 0 4px; }
.legal-lead { font-size: 1.05rem; color: var(--ink); margin: 0; }
.legal-callout { background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--radius-sm); padding: 12px 16px; color: var(--ink); }
.legal-table { margin: 4px 0 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.legal-table table.t th { border-top: 0; padding: 10px 14px; }
.legal-table table.t td { padding: 10px 14px; vertical-align: top; font-size: .88rem; line-height: 1.5; }
.legal-table table.t tbody tr:hover td { background: none; }
