:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --text: #15181e;
  --muted: #5d6573;
  --faint: #8b93a1;
  --border: #e3e6eb;
  --border-strong: #cfd4dc;
  --accent: #2f5bea;
  --accent-hover: #2449c4;
  --accent-soft: #e9eefd;
  --accent-text: #ffffff;
  --ok: #18794e;
  --ok-soft: #e3f4ea;
  --warn: #9a5b00;
  --warn-soft: #fdf1dc;
  --bad: #c4321f;
  --bad-soft: #fde7e3;
  --info: #2f5bea;
  --info-soft: #e9eefd;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --radius: 10px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a20;
    --surface-2: #1f232b;
    --text: #e8eaee;
    --muted: #a3aab6;
    --faint: #737b88;
    --border: #2a2f39;
    --border-strong: #3a404c;
    --accent: #6d8dff;
    --accent-hover: #8aa3ff;
    --accent-soft: #1e2645;
    --accent-text: #0b0f1d;
    --ok: #4fc58a;
    --ok-soft: #12291e;
    --warn: #e7b25a;
    --warn-soft: #2e2311;
    --bad: #ff7b6b;
    --bad-soft: #36160f;
    --info: #8aa3ff;
    --info-soft: #1e2645;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 22px; line-height: 1.25; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 15px; margin: 0; }
h3 { font-size: 13px; margin: 0; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.link { color: var(--accent); }
.link:hover { text-decoration: underline; }

/* ---- layout: sidebar + content ---- */
.layout { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; flex-direction: column; gap: 14px;
  padding: 16px 12px 12px; background: var(--surface); border-right: 1px solid var(--border);
}
.content { min-width: 0; }
.main { max-width: 1180px; margin: 0 auto; padding: 28px 32px 80px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; white-space: nowrap; }
.brand-mark {
  flex: none; width: 24px; height: 24px; border-radius: 7px; background: var(--accent);
  background-image: linear-gradient(var(--accent-text), var(--accent-text)), linear-gradient(var(--accent-text), var(--accent-text)), linear-gradient(var(--accent-text), var(--accent-text));
  background-size: 12px 2px, 12px 2px, 8px 2px;
  background-position: 6px 7px, 6px 11px, 6px 15px;
  background-repeat: no-repeat;
}
.sb-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px; }
.mock-badge { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }
.sb-new { width: 100%; }
.sb-nav, .sb-foot { display: grid; gap: 1px; }
.sb-nav a, .sb-foot > a, .sb-client {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--muted); font-weight: 520; min-width: 0;
}
.sb-nav a:hover, .sb-foot > a:hover, .sb-client:hover { background: var(--surface-2); color: var(--text); }
.sb-nav a.on, .sb-foot > a.on, .sb-client.on { background: var(--accent-soft); color: var(--text); }
.sb-nav svg, .sb-foot svg { width: 16px; height: 16px; flex: none; }
.sb-badge { margin-left: auto; font-size: 11px; font-weight: 700; min-width: 18px; padding: 0 6px; border-radius: 999px; text-align: center; background: var(--surface-2); color: var(--muted); }
.sb-badge.bad { background: var(--bad); color: #fff; }
.sb-section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; align-content: start; flex: 1; min-height: 0; min-width: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 -4px; padding: 0 4px; }
.sb-h { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px 2px; font-size: 11.5px; font-weight: 650; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.sb-add { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; font-size: 15px; line-height: 1; color: var(--muted); display: grid; place-items: center; }
.sb-add:hover { color: var(--accent); border-color: var(--accent); }
.sb-filter { min-height: 30px; padding: 4px 10px; font-size: 13px; margin: 2px 0 4px; }
.sb-clients { display: grid; gap: 1px; }
.sb-client .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.sb-empty { padding: 6px 10px; font-size: 12.5px; color: var(--faint); }
.sb-unassigned { margin-top: 6px; border-top: 1px solid var(--border); padding-top: 6px; }
.sb-unassigned summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; color: var(--muted); font-weight: 520; }
.sb-unassigned summary::-webkit-details-marker { display: none; }
.sb-unassigned summary::before { content: "▸"; font-size: 10px; transition: transform .12s; }
.sb-unassigned[open] summary::before { transform: rotate(90deg); }
.sb-unassigned summary:hover { background: var(--surface-2); color: var(--text); }
.sb-count { margin-left: auto; font-size: 11.5px; color: var(--faint); font-weight: 600; }
.sb-unassigned a { display: block; padding: 5px 10px 5px 28px; border-radius: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-unassigned a:hover, .sb-unassigned a.on { background: var(--surface-2); color: var(--text); }
.sb-unassigned a.all { color: var(--accent); }
.sb-foot { border-top: 1px solid var(--border); padding-top: 8px; flex: none; background: var(--surface); }
.sb-me { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 4px 0; }
.sb-who { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 4px 6px; border-radius: 8px; }
.sb-who:hover { background: var(--surface-2); }
.sb-name { font-size: 13px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.bell { position: relative; width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.bell:hover { background: var(--surface-2); color: var(--text); }
.bell svg { width: 18px; height: 18px; }
.bell-dot { position: absolute; top: 4px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
.mobilebar { display: none; }
.scrim { display: none; }

.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu-body {
  position: absolute; left: 0; bottom: 44px; min-width: 220px; padding: 6px; z-index: 30;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.menu-body a { display: block; padding: 8px 10px; border-radius: 6px; }
.menu-body a:hover { background: var(--surface-2); }
.menu-who { padding: 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; font-size: 13px; }
.avatar {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  background: var(--accent-soft); color: var(--accent); font-weight: 650; font-size: 11.5px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---- buttons & inputs ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 8px; white-space: nowrap;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 550; cursor: pointer; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.field { display: grid; gap: 6px; }
.field > span { font-weight: 550; font-size: 13px; }
.field .hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.input, .select, .textarea {
  width: 100%; min-height: 36px; padding: 7px 10px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--surface);
  outline: none; transition: border-color .12s, box-shadow .12s;
}
.textarea { resize: vertical; min-height: 140px; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field.error .input, .field.error .textarea, .field.error .select { border-color: var(--bad); }
.field-error { color: var(--bad); font-size: 12.5px; }
.field-warn { color: var(--warn); font-size: 12.5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); flex-wrap: wrap; }
.seg button, .seg a {
  border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 550;
  display: inline-flex; align-items: center; gap: 6px;
}
.seg .on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.count { font-size: 11.5px; padding: 0 6px; border-radius: 999px; background: var(--border); color: var(--muted); font-weight: 600; min-width: 18px; text-align: center; }
.seg .on .count { background: var(--accent-soft); color: var(--accent); }

/* ---- cards & layout ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-b { padding: 18px; }
.card-h { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.stack { display: grid; gap: 16px; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty h2 { color: var(--text); margin-bottom: 6px; }
.banner { padding: 12px 14px; border-radius: var(--radius); border: 1px solid; display: flex; gap: 10px; align-items: flex-start; }
.banner.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--text); }
.banner.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.banner.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); }

/* ---- pills ---- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.plain::before { display: none; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.type-tag { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.type-tag.offer { color: var(--warn); }

/* ---- post list ---- */
.list-tools { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.day-label { font-size: 12.5px; font-weight: 650; color: var(--muted); margin: 18px 4px 8px; text-transform: uppercase; letter-spacing: .04em; }
.day-label:first-child { margin-top: 0; }
.posts { display: grid; gap: 8px; }
.post-row {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); transition: border-color .12s, transform .12s;
}
.post-row:hover { border-color: var(--border-strong); }
.thumb { width: 64px; height: 48px; border-radius: 6px; background: var(--surface-2); object-fit: cover; display: grid; place-items: center; color: var(--faint); font-size: 11px; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-main { min-width: 0; }
.post-title { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-meta { color: var(--muted); font-size: 12.5px; display: flex; gap: 6px 12px; flex-wrap: wrap; margin-top: 2px; }
.post-side { display: grid; justify-items: end; gap: 4px; text-align: right; }
.post-when { font-size: 13px; font-weight: 550; }

/* ---- calendar ---- */
.cal-head { display: flex; align-items: center; gap: 8px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cal-dow { padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--muted); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cal-day { min-width: 0; min-height: 112px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.cal-day.other { background: var(--surface-2); }
.cal-day.other .cal-n { color: var(--faint); }
.cal-day.today .cal-n { background: var(--accent); color: var(--accent-text); }
.cal-n { font-size: 12px; font-weight: 600; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.cal-item { font-size: 12px; padding: 3px 6px; border-radius: 5px; background: var(--accent-soft); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--accent); }
.cal-item.state-published { background: var(--ok-soft); border-left-color: var(--ok); }
.cal-item.state-attention { background: var(--bad-soft); border-left-color: var(--bad); }
.cal-item.state-in_review, .cal-item.state-draft { background: var(--surface-2); border-left-color: var(--faint); }
.cal-add { margin-top: auto; font-size: 12px; color: var(--faint); opacity: 0; }
.cal-day:hover .cal-add { opacity: 1; }
.cal-add:hover { color: var(--accent); }

/* ---- composer ---- */
.composer { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.composer .side { position: sticky; top: 20px; display: grid; gap: 16px; }
.section { padding: 18px; display: grid; gap: 14px; }
.section + .section { border-top: 1px solid var(--border); }
.counter { font-size: 12px; color: var(--faint); text-align: right; }
.counter.over { color: var(--bad); font-weight: 600; }

.drop {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted);
  cursor: pointer; transition: border-color .12s, background .12s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop strong { color: var(--text); }
.image-chip { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); }
.image-chip img { width: 96px; height: 72px; object-fit: cover; border-radius: 6px; }

.loc-picker { border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; }
.loc-tools { display: flex; gap: 8px; padding: 8px; border-bottom: 1px solid var(--border); background: var(--surface-2); align-items: center; flex-wrap: wrap; }
.loc-tools .input { flex: 1; min-width: 160px; }
.loc-list { max-height: 320px; overflow: auto; }
.loc-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--border); }
.loc-item:last-child { border-bottom: 0; }
.loc-item:hover { background: var(--surface-2); }
.loc-item input { margin-top: 3px; accent-color: var(--accent); }
.loc-item .addr { color: var(--muted); font-size: 12.5px; }
.loc-group { padding: 6px 12px; font-size: 11.5px; font-weight: 650; color: var(--muted); background: var(--surface-2); text-transform: uppercase; letter-spacing: .04em; position: sticky; top: 0; }

.when-opts { display: grid; gap: 8px; }
.radio-card { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-card input { accent-color: var(--accent); margin-top: 3px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12.5px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--accent); }

.actions-bar {
  position: sticky; bottom: 0; z-index: 5; margin-top: 16px; padding: 12px 18px;
  display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap;
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}

/* Google-style post preview */
.gpreview { overflow: hidden; }
.gpreview-h { display: flex; gap: 10px; align-items: center; padding: 14px 14px 10px; }
.gpreview-logo { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; color: var(--muted); font-size: 13px; }
.gpreview-name { font-weight: 600; font-size: 13.5px; }
.gpreview-img { aspect-ratio: 4 / 3; background: var(--surface-2); display: grid; place-items: center; color: var(--faint); font-size: 12px; }
.gpreview-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gpreview-b { padding: 12px 14px 16px; display: grid; gap: 8px; }
.gpreview-offer { font-weight: 650; font-size: 16px; }
.gpreview-dates { font-size: 12.5px; color: var(--muted); }
.gpreview-text { white-space: pre-wrap; word-break: break-word; font-size: 13.5px; }
.gpreview-text.clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.gpreview-coupon { border: 1.5px dashed var(--border-strong); border-radius: 8px; padding: 8px; text-align: center; font-size: 12.5px; }
.gpreview-coupon b { display: block; font-size: 15px; letter-spacing: .06em; }
.gpreview-cta { color: var(--accent); font-weight: 600; font-size: 14px; padding-top: 4px; }

/* ---- detail ---- */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.t td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t .err { color: var(--bad); font-size: 12.5px; margin-top: 2px; max-width: 520px; }
.t .note { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; display: flex; }
.progress span { display: block; height: 100%; }
.progress .p-ok { background: var(--ok); }
.progress .p-bad { background: var(--bad); }
.progress .p-run { background: var(--accent); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.timeline { display: grid; gap: 10px; font-size: 13px; }
.timeline div { display: grid; gap: 1px; }
.timeline .faint { font-size: 12px; }

/* ---- settings ---- */
.conn { display: flex; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); align-items: center; flex-wrap: wrap; }
.conn:last-child { border-bottom: 0; }

/* ---- sign in ---- */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.signin .card { max-width: 400px; width: 100%; padding: 32px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.signin .brand-mark { width: 44px; height: 44px; border-radius: 12px; background-size: 22px 3px, 22px 3px, 14px 3px; background-position: 11px 13px, 11px 20px, 11px 27px; }
.gbtn { display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); font-weight: 600; }
.gbtn:hover { background: var(--surface-2); }

/* ---- toast & misc ---- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  padding: 10px 16px; border-radius: 10px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); font-weight: 550; max-width: calc(100vw - 32px);
}
.toast.bad { background: var(--bad); color: #fff; }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { height: 72px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 1100px) {
  .composer, .detail { grid-template-columns: 1fr; }
  .composer .side { position: static; }
}
/* ---- client logos ---- */
.logo { flex: none; display: inline-grid; place-items: center; overflow: hidden; border-radius: 6px; font-weight: 700; color: #fff; background: var(--c, #64748b); font-size: 10px; width: 22px; height: 22px; }
.logo img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.logo.md { width: 32px; height: 32px; border-radius: 8px; font-size: 13px; }
.logo.lg { width: 52px; height: 52px; border-radius: 12px; font-size: 20px; }
.logo.xs { width: 16px; height: 16px; border-radius: 4px; font-size: 8px; }
.logo.ghost { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--border-strong); }
.logos { display: inline-flex; align-items: center; gap: 4px; }
.client-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 550; color: var(--text); }
.client-chip:hover { color: var(--accent); }

/* ---- client page ---- */
.client-head { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.client-head h1 { margin: 0; }
.client-head .sub { color: var(--muted); margin-top: 3px; display: flex; gap: 6px 14px; flex-wrap: wrap; }
.client-head .btn-row { margin-left: auto; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 12px; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.saved { margin-bottom: 16px; }
.saved .btn-row { margin-left: auto; }
.search { max-width: 280px; min-height: 32px; padding: 5px 10px; }

.vtable { width: 100%; border-collapse: collapse; }
.vtable th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: bottom; }
.vtable th code { font-weight: 500; }
.vtable td { padding: 6px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.vtable tr:last-child td { border-bottom: 0; }
.vtable td.profile { min-width: 200px; }
.vtable .cell { min-width: 140px; min-height: 32px; padding: 5px 8px; }
.vtable .cell.changed { border-color: var(--accent); background: var(--accent-soft); }
.vtable .cell::placeholder { color: var(--faint); }
.vtable .cell.need { border-color: color-mix(in srgb, var(--warn) 60%, transparent); }
.th-var { display: inline-flex; align-items: center; gap: 4px; }
.th-var button { border: 0; background: transparent; color: var(--faint); cursor: pointer; padding: 0 2px; font-size: 14px; line-height: 1; }
.th-var button:hover { color: var(--bad); }
code, .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; padding: 1px 5px; border-radius: 5px; background: var(--surface-2); color: var(--text); }
.sticky-save { position: sticky; bottom: 16px; margin-top: 14px; display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 10px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--accent); box-shadow: var(--shadow-lg); flex-wrap: wrap; }

/* ---- overview ---- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { padding: 14px 16px; display: grid; gap: 2px; }
.stat b { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat span { color: var(--muted); font-size: 12.5px; }
.stat.bad b { color: var(--bad); }
.stat.warn b { color: var(--warn); }
a.stat:hover { border-color: var(--border-strong); }
.ctable td { vertical-align: middle; }
.ctable tr.row-link { cursor: pointer; }
.ctable tr.row-link:hover td { background: var(--surface-2); }
.cname { display: flex; align-items: center; gap: 10px; font-weight: 600; }

/* ---- composer additions ---- */
.client-pick { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.client-pick .select { max-width: 340px; }
.var-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--muted); }
.var-chip { font: 500 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 5px 8px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; color: var(--text); }
.var-chip:hover { border-color: var(--accent); color: var(--accent); }
.var-chip.custom { border-style: dashed; }
mark.var { background: color-mix(in srgb, var(--accent) 16%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
mark.var.missing { background: var(--bad-soft); color: var(--bad); }
.notes-banner { white-space: pre-wrap; }
.loc-group { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; z-index: 1; text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--text); }
.loc-group .caret { font-size: 10px; color: var(--faint); transition: transform .12s; }
.loc-group.open .caret { transform: rotate(90deg); }
.loc-group .gcount { color: var(--muted); font-weight: 500; }
.loc-group .btn { margin-left: auto; height: 24px; font-size: 12px; padding: 0 8px; }
.preview-as { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; justify-content: space-between; }
.preview-as .select { max-width: 220px; min-height: 30px; padding: 4px 8px; font-size: 12.5px; }
.gpreview-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.ttext { color: var(--muted); font-size: 12.5px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; max-width: 520px; }

/* ---- dialogs ---- */
dialog { border: 0; padding: 0; color: var(--text); background: var(--surface); }
dialog::backdrop { background: rgba(10, 14, 24, .45); }
.modal { width: min(560px, calc(100vw - 32px)); border-radius: 14px; box-shadow: var(--shadow-lg); }
.modal form { display: grid; }
.modal-h { padding: 18px 20px 4px; }
.modal-h p { margin: 4px 0 0; color: var(--muted); }
.modal-b { padding: 14px 20px; display: grid; gap: 14px; max-height: min(64vh, 620px); overflow: auto; }
.modal-f { padding: 12px 20px 18px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--border); }
.sheet { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(400px, 100vw); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.sheet[open] { display: flex; flex-direction: column; }
.sheet-h { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.sheet-b { overflow: auto; flex: 1; }
.notif { display: grid; gap: 3px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.notif:hover { background: var(--surface-2); }
.notif.unread { box-shadow: inset 3px 0 0 var(--bad); }
.notif b { font-size: 13.5px; }
.notif span { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.notif-foot { padding: 14px 18px; display: grid; gap: 10px; font-size: 12.5px; color: var(--muted); }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .18s; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(10, 14, 24, .35); }
  .mobilebar { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; top: 0; z-index: 20; height: 52px; padding: 0 8px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
  .mobilebar svg { width: 20px; height: 20px; }
  .main { padding: 20px 16px 80px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .grid2 { grid-template-columns: 1fr; }
  .post-row { grid-template-columns: 48px 1fr; }
  .thumb { width: 48px; height: 40px; }
  .post-side { grid-column: 1 / -1; justify-items: start; text-align: left; grid-auto-flow: column; justify-content: start; gap: 10px; align-items: center; }
  .cal-day { min-height: 72px; }
  .cal-item { font-size: 0; padding: 0; height: 6px; border-left-width: 0; }
  .client-head .btn-row { margin-left: 0; }
  .ctable .hide-m { display: none; }
}
.nowrap { white-space: nowrap; }
