:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --surface-3: #e7eaef;
  --border: #e2e5ea;
  --border-strong: #cdd2da;
  --text: #15181e;
  --text-2: #565f6e;
  --text-3: #8b93a1;
  --accent: #3a56d4;
  --accent-hover: #2f48bb;
  --accent-soft: #e9edfd;
  --accent-text: #2f48bb;
  --ok: #1d7f47;
  --ok-soft: #e2f4e9;
  --warn: #9a5b00;
  --warn-soft: #fdf1d8;
  --err: #c0302b;
  --err-soft: #fce8e7;
  --info: #1b65b5;
  --info-soft: #e3effb;
  --violet: #6d3fc0;
  --violet-soft: #efe8fb;
  --ig: #d62976;
  --ig-soft: #fce7f1;
  --yt: #e3241b;
  --yt-soft: #fde8e7;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 18px 48px rgba(16, 24, 40, 0.18);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a20;
    --surface-2: #1e222a;
    --surface-3: #272c35;
    --border: #2a2f39;
    --border-strong: #3a404c;
    --text: #eceef2;
    --text-2: #a8afbc;
    --text-3: #747c8a;
    --accent: #6f86ff;
    --accent-hover: #8597ff;
    --accent-soft: #232b4a;
    --accent-text: #9aa9ff;
    --ok: #4cc583;
    --ok-soft: #173326;
    --warn: #e4a73a;
    --warn-soft: #362812;
    --err: #ff6b63;
    --err-soft: #3a1b1a;
    --info: #63a8f2;
    --info-soft: #162a40;
    --violet: #b08cf5;
    --violet-soft: #2a2140;
    --ig: #f0609e;
    --ig-soft: #3a1a2a;
    --yt: #ff5a52;
    --yt-soft: #3a1b1a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 620; }
h3 { font-size: 14px; font-weight: 620; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; word-break: break-all; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
::selection { background: var(--accent-soft); }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 18px 12px; display: flex; flex-direction: column; gap: 2px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px 18px; font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), #8a4fd8); display: grid; place-items: center; color: #fff; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: var(--text-2); font-weight: 520; text-decoration: none;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--accent-soft); color: var(--accent-text); }
.nav-item .count { margin-left: auto; font-size: 11.5px; font-weight: 650; background: var(--surface-3); color: var(--text-2); border-radius: 999px; padding: 0 7px; line-height: 18px; }
.nav-item.active .count { background: var(--accent); color: #fff; }
.nav-item .count.alert { background: var(--err); color: #fff; }
.sidebar-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-3); }
.sidebar-foot .acct { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.main { padding: 26px 32px 80px; min-width: 0; }
.page { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head p { color: var(--text-2); margin-top: 4px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.tight { gap: 6px; }
.stack.loose { gap: 20px; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 620; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pre { white-space: pre-wrap; word-break: break-word; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-head { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-body { padding: 16px 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.section-title { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 13px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 560; cursor: pointer;
  white-space: nowrap; text-decoration: none; transition: background 0.12s, border-color 0.12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--err); }
.btn-danger:hover { background: var(--err-soft); border-color: var(--err); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; gap: 5px; }
.btn-lg { height: 40px; padding: 0 18px; font-size: 14.5px; }
.btn-icon { width: 30px; padding: 0; }
.btn-icon.btn-sm { width: 26px; }
.btn .spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- forms ---------- */
label.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-weight: 580; font-size: 13px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.field-hint { font-size: 12px; color: var(--text-3); font-weight: 400; }
.input, .select, .textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 10px; outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.input, .select { height: 36px; }
.textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.sm, .select.sm { height: 30px; font-size: 13px; padding: 4px 8px; }
.textarea.sm { min-height: 60px; font-size: 13px; padding: 6px 8px; }
.counter { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; font-weight: 450; }
.counter.over { color: var(--err); font-weight: 650; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button {
  border: 0; background: transparent; color: var(--text-2); font: inherit; font-weight: 560; font-size: 13px;
  padding: 5px 11px; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.seg button:hover:not(:disabled) { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg button:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- badges & pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 620; white-space: nowrap; background: var(--surface-2); color: var(--text-2);
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent-text); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: currentColor; flex: none; }
.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ---------- notices ---------- */
.notice { display: flex; gap: 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); align-items: flex-start; }
.notice > svg { flex: none; margin-top: 1px; }
.notice.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.notice.warn > svg { color: var(--warn); }
.notice.err { background: var(--err-soft); border-color: color-mix(in srgb, var(--err) 30%, transparent); }
.notice.err > svg { color: var(--err); }
.notice.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.notice.info > svg { color: var(--info); }
.notice.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.notice.ok > svg { color: var(--ok); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tabs button {
  border: 0; background: none; font: inherit; color: var(--text-2); font-weight: 560; padding: 9px 12px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; display: inline-flex; gap: 7px; align-items: center;
}
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--accent-text); border-bottom-color: var(--accent); }
.tabs .count { font-size: 11px; background: var(--surface-3); border-radius: 999px; padding: 0 6px; line-height: 17px; color: var(--text-2); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-weight: 600; color: var(--text-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 10px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface);
}
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover, .table th.sorted { color: var(--text); }
.table td { padding: 10px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }

/* ---------- media ---------- */
.thumb { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: var(--surface-3); flex: none; position: relative; overflow: hidden; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb.sm { width: 40px; height: 40px; border-radius: 7px; }
.thumb.lg { width: 72px; height: 72px; }
.thumb .kind { position: absolute; right: 3px; bottom: 3px; background: rgba(0, 0, 0, 0.62); color: #fff; border-radius: 5px; padding: 1px 4px; font-size: 10px; display: flex; align-items: center; gap: 2px; }
.thumb-empty { display: grid; place-items: center; color: var(--text-3); }

.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 26px; text-align: center;
  color: var(--text-2); background: var(--surface); cursor: pointer; transition: border-color 0.12s, background 0.12s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.dropzone .big { font-weight: 620; color: var(--text); font-size: 14.5px; margin-top: 8px; }
.media-strip { display: flex; gap: 10px; flex-wrap: wrap; }
.media-tile { position: relative; width: 112px; height: 112px; border-radius: 10px; overflow: hidden; background: var(--surface-3); border: 1px solid var(--border); }
.media-tile img, .media-tile video { width: 100%; height: 100%; object-fit: cover; }
.media-tile .tile-actions { position: absolute; top: 5px; right: 5px; display: flex; gap: 4px; opacity: 0; transition: opacity 0.12s; }
.media-tile:hover .tile-actions { opacity: 1; }
.media-tile .tile-actions button { width: 24px; height: 24px; border-radius: 6px; border: 0; background: rgba(0, 0, 0, 0.65); color: #fff; display: grid; place-items: center; cursor: pointer; }
.media-tile .tile-meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.7)); color: #fff; font-size: 10.5px; display: flex; justify-content: space-between; }
.media-tile .order { position: absolute; top: 5px; left: 5px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0, 0, 0, 0.65); color: #fff; font-size: 11px; font-weight: 650; display: grid; place-items: center; }
.media-tile.uploading::after { content: ''; position: absolute; inset: 0; background: rgba(255, 255, 255, 0.55); }
.progress { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.2s; }

/* ---------- platform marks ---------- */
.pf { display: inline-grid; place-items: center; border-radius: 6px; color: #fff; flex: none; }
.pf.instagram { background: linear-gradient(45deg, #f9b233 0%, #e4405f 45%, #c13584 70%, #833ab4 100%); }
.pf.youtube { background: var(--yt); }
.pf.linkedin { background: #0a66c2; }
.avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--surface-3); flex: none; display: inline-grid; place-items: center; font-weight: 650; color: var(--text-2); font-size: 12px; overflow: hidden; }
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.avatar-wrap { position: relative; display: inline-flex; }
.avatar-wrap .pf { position: absolute; right: -4px; bottom: -3px; border: 2px solid var(--surface); }

/* ---------- destination picker ---------- */
.dest { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); transition: border-color 0.12s, background 0.12s; }
.dest.on { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.dest-head { display: flex; align-items: center; gap: 10px; }
.dest-head .check { margin-left: auto; }
.switch { position: relative; display: inline-block; width: 36px; height: 21px; flex: none; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px; transition: background 0.15s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; width: 17px; height: 17px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(15px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- stat tiles ---------- */
.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.stat .label { font-size: 12.5px; color: var(--text-2); font-weight: 520; display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 26px; font-weight: 680; letter-spacing: -0.02em; line-height: 1.15; }
.stat .delta { font-size: 12px; font-weight: 600; }
.stat .delta.up { color: var(--ok); }
.stat .delta.down { color: var(--err); }
.stat .sub { font-size: 12px; color: var(--text-3); }
.metric { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ---------- post rows ---------- */
.post-row { display: flex; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.post-row:last-child { border-bottom: 0; }
.post-row .when { width: 108px; flex: none; }
.post-row .when .t { font-weight: 650; font-variant-numeric: tabular-nums; }
.post-row .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.post-row .actions { display: flex; gap: 6px; flex: none; flex-wrap: wrap; justify-content: flex-end; max-width: 300px; }
.target-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px 2px 3px; font-size: 12px; background: var(--surface); }
.target-chip .st { font-weight: 600; }
.target-err { font-size: 12.5px; color: var(--err); background: var(--err-soft); padding: 6px 10px; border-radius: 8px; }
.target-note { font-size: 12.5px; color: var(--warn); background: var(--warn-soft); padding: 6px 10px; border-radius: 8px; }

/* ---------- calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--border); border-top: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cal-dow { padding: 8px 10px; font-size: 11.5px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); }
.cal-day { min-height: 118px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; background: var(--surface); position: relative; }
.cal-day.other { background: var(--surface-2); }
.cal-day.other .num { color: var(--text-3); }
.cal-day.today .num { background: var(--accent); color: #fff; }
.cal-day.drop { background: var(--accent-soft); }
.cal-day .num { font-size: 12px; font-weight: 620; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); }
.cal-day .add { position: absolute; top: 5px; right: 5px; opacity: 0; }
.cal-day:hover .add { opacity: 1; }
.cal-post { display: flex; align-items: center; gap: 5px; padding: 3px 6px; border-radius: 6px; font-size: 11.5px; cursor: pointer; background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--info); min-width: 0; }
.cal-post:hover { border-color: var(--border-strong); }
.cal-post.published { border-left-color: var(--ok); }
.cal-post.failed, .cal-post.partial { border-left-color: var(--err); }
.cal-post.draft { border-left-color: var(--text-3); opacity: 0.85; }
.cal-post.publishing { border-left-color: var(--violet); }
.cal-post .tm { font-weight: 650; font-variant-numeric: tabular-nums; flex: none; }
.cal-post .tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.cal-more { font-size: 11.5px; color: var(--text-3); padding: 0 4px; }

/* ---------- modal / drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10, 12, 16, 0.45); display: grid; place-items: center; z-index: 50; padding: 24px; animation: fade 0.12s ease-out; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.modal.wide { width: min(980px, 100%); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; position: sticky; bottom: 0; background: var(--surface); }
@keyframes fade { from { opacity: 0; } }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 80; max-width: min(420px, calc(100vw - 40px)); }
.toast { background: var(--text); color: var(--bg); padding: 11px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; animation: rise 0.18s ease-out; }
.toast.err { background: var(--err); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* ---------- empty / loading ---------- */
.empty { padding: 44px 20px; text-align: center; color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .icon { width: 46px; height: 46px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; color: var(--text-3); }
.empty h3 { color: var(--text); }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.loading { padding: 40px; display: grid; place-items: center; color: var(--text-3); }

/* ---------- compose ---------- */
.compose { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.compose-side { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 16px; }
.preview-phone { border-radius: 18px; border: 1px solid var(--border); background: var(--surface); overflow: hidden; }
.preview-phone .ph-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-weight: 620; font-size: 13px; }
.preview-phone .ph-media { background: #000; aspect-ratio: 1 / 1; display: grid; place-items: center; overflow: hidden; position: relative; }
.preview-phone .ph-media.tall { aspect-ratio: 9 / 16; max-height: 460px; }
.preview-phone .ph-media.portrait { aspect-ratio: 4 / 5; }
.preview-phone .ph-media img, .preview-phone .ph-media video { width: 100%; height: 100%; object-fit: cover; }
.preview-phone .ph-media.contain img, .preview-phone .ph-media.contain video { object-fit: contain; }
.preview-phone .ph-caption { padding: 10px 12px 14px; font-size: 13px; white-space: pre-wrap; word-break: break-word; max-height: 160px; overflow: auto; }
.preview-yt { border-radius: 12px; border: 1px solid var(--border); background: var(--surface); overflow: hidden; }
.preview-yt .yt-media { aspect-ratio: 16 / 9; background: #000; display: grid; place-items: center; overflow: hidden; }
.preview-yt .yt-media img, .preview-yt .yt-media video { width: 100%; height: 100%; object-fit: contain; }
.preview-yt .yt-title { padding: 10px 12px 2px; font-weight: 640; font-size: 14px; line-height: 1.35; }
.preview-yt .yt-sub { padding: 0 12px 12px; font-size: 12px; color: var(--text-2); }
.carousel-dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 4px; }
.carousel-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.55); }
.carousel-dots span.on { background: #fff; }
.ph-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.85); color: #111; display: grid; place-items: center; cursor: pointer; }
.ph-nav.l { left: 8px; }
.ph-nav.r { right: 8px; }

/* ---------- comments ---------- */
.inbox { display: grid; grid-template-columns: 400px minmax(0, 1fr); min-height: 560px; }
.inbox-list { border-right: 1px solid var(--border); overflow: auto; max-height: calc(100vh - 230px); }
.inbox-item { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; align-items: flex-start; }
.inbox-item:hover { background: var(--surface-2); }
.inbox-item.on { background: var(--accent-soft); }
.inbox-item.unread .who::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 6px; vertical-align: middle; }
.inbox-detail { padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; overflow: auto; max-height: calc(100vh - 230px); }
.bubble { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.bubble.mine { background: var(--accent-soft); }
.thread { display: flex; flex-direction: column; gap: 10px; padding-left: 18px; border-left: 2px solid var(--border); margin-left: 14px; }

/* ---------- setup steps ---------- */
.steps { counter-reset: step; display: flex; flex-direction: column; gap: 12px; padding: 0; margin: 0; list-style: none; }
.steps > li { counter-increment: step; position: relative; padding-left: 36px; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 12px; display: grid; place-items: center; }
.steps > li.done::before { content: '✓'; background: var(--ok-soft); color: var(--ok); }
.steps ul { margin: 6px 0 0; padding-left: 18px; color: var(--text-2); }
.steps ul li { margin: 3px 0; }
.kbd { font-family: var(--mono); font-size: 12px; background: var(--surface-2); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; }
.copy-box { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 6px 6px 10px; }
.copy-box code { border: 0; background: none; padding: 0; flex: 1; }

/* ---------- bulk ---------- */
.bulk-table td { vertical-align: top; }
.bulk-table .input, .bulk-table .select, .bulk-table .textarea { font-size: 13px; }
.bulk-table .textarea { min-height: 64px; }
.fmt-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.fmt-pill { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); border-radius: 999px; font: inherit; font-size: 11.5px; font-weight: 580; padding: 2px 8px; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.fmt-pill.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.fmt-pill:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- charts ---------- */
.chart { position: relative; transition: opacity 0.15s; }
.bars { display: flex; flex-direction: column; gap: 2px; }
.bar-row { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; align-items: center; font-size: 12.5px; padding: 4px 8px; border-radius: 6px; cursor: default; color: inherit; text-decoration: none; }
.bar-row:hover, .bar-row:focus-visible { background: var(--surface-2); outline: none; text-decoration: none; }
.bar-label { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--text-2); }
.bar-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar-fill { height: 16px; border-radius: 0 4px 4px 0; background: var(--accent); min-width: 2px; flex: none; transition: filter 0.12s; }
.bar-row:hover .bar-fill, .bar-row:focus-visible .bar-fill { filter: brightness(1.15); }
.bar-value { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 8px 10px; font-size: 12px; min-width: 180px; max-width: 280px; }
.chart-tip .v { font-size: 15px; font-weight: 680; color: var(--text); }
.chart-tip .k { color: var(--text-2); }
.chart-tip .key { display: inline-block; width: 12px; height: 2px; background: var(--accent); vertical-align: middle; margin-right: 6px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .compose { grid-template-columns: minmax(0, 1fr); }
  .compose-side { position: static; }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .inbox-list { border-right: 0; border-bottom: 1px solid var(--border); max-height: 340px; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 10px; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand { padding: 4px 8px; width: 100%; }
  .sidebar-foot { display: none; }
  .nav-item span.lbl { display: none; }
  .main { padding: 18px 16px 60px; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .post-row { flex-wrap: wrap; }
  .post-row .actions { max-width: none; justify-content: flex-start; }
  .bar-row { grid-template-columns: 120px minmax(0, 1fr); }
  .cal-day { min-height: 80px; }
}
.btn.disabled { opacity: 0.5; cursor: not-allowed; }
.demo-banner { max-width: 1240px; margin: 0 auto 18px; display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 10px; background: var(--violet-soft); color: var(--violet); font-size: 13px; border: 1px solid color-mix(in srgb, var(--violet) 30%, transparent); }
.demo-banner span { color: var(--text); }
.preview-li { border-radius: 12px; border: 1px solid var(--border); background: var(--surface); overflow: hidden; }
.preview-li .li-head { display: flex; gap: 8px; align-items: center; padding: 12px 12px 6px; }
.preview-li .li-text { padding: 4px 12px 10px; font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.preview-li .li-more { color: var(--text-3); }
.preview-li .li-media { display: grid; gap: 2px; background: var(--surface-3); }
.preview-li .li-media.two { grid-template-columns: 1fr 1fr; }
.preview-li .li-media img, .preview-li .li-media video { width: 100%; max-height: 420px; object-fit: cover; }
.preview-li .li-media.two img { aspect-ratio: 1 / 1; }
