/* Design tokens. --brand / --brand-2 are injected per white-label brand. */
:root {
  --bg: #f7f7f8;
  --panel: #ffffff;
  --panel-2: #fafafa;
  --sunken: #f2f2f4;
  --ink: #18181b;
  --ink-2: #3f3f46;
  --mute: #71717a;
  --faint: #a1a1aa;
  --line: #e7e7ea;
  --line-2: #f0f0f2;
  --good: #047857; --good-bg: #ecfdf5;
  --warn: #b45309; --warn-bg: #fffbeb;
  --bad: #b91c1c; --bad-bg: #fef2f2;
  --shadow-sm: 0 1px 2px rgba(24, 24, 27, .04);
  --shadow: 0 1px 2px rgba(24, 24, 27, .04), 0 8px 24px -12px rgba(24, 24, 27, .08);
  --shadow-lg: 0 24px 60px -20px rgba(24, 24, 27, .35);
  --radius: 14px;
  --radius-sm: 10px;
  --brand-soft: color-mix(in srgb, var(--brand) 9%, transparent);
  --brand-softer: color-mix(in srgb, var(--brand) 5%, transparent);
  --brand-ink: color-mix(in srgb, var(--brand) 82%, var(--ink));
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0c0e; --panel: #151518; --panel-2: #1a1a1e; --sunken: #111114; --ink: #f4f4f5; --ink-2: #d4d4d8; --mute: #a1a1aa; --faint: #71717a;
    --line: #27272a; --line-2: #1f1f23; --good: #34d399; --good-bg: #052e22; --warn: #fbbf24; --warn-bg: #2b1d05; --bad: #f87171; --bad-bg: #2d0f0f;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.8);
    --brand-ink: color-mix(in srgb, var(--brand) 55%, white); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0c0e; --panel: #151518; --panel-2: #1a1a1e; --sunken: #111114; --ink: #f4f4f5; --ink-2: #d4d4d8; --mute: #a1a1aa; --faint: #71717a;
  --line: #27272a; --line-2: #1f1f23; --good: #34d399; --good-bg: #052e22; --warn: #fbbf24; --warn-bg: #2b1d05; --bad: #f87171; --bad-bg: #2d0f0f;
  --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.8);
  --brand-ink: color-mix(in srgb, var(--brand) 55%, white); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { font: 14px/1.6 Poppins, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: 21px; font-weight: 650; }
h2 { font-size: 15px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.ico { flex: none; }
::selection { background: var(--brand-soft); }

/* ── Frame ─────────────────────────────────────────────────────────────── */
.frame { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin; }
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; font-weight: 650; font-size: 15px; letter-spacing: -.01em; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; overflow: hidden; box-shadow: inset 0 -1px 0 rgba(0,0,0,.15); }
.logo-mark img { width: 100%; height: 100%; object-fit: cover; }
.search-btn { display: flex; align-items: center; gap: 8px; white-space: nowrap; margin: 0 4px 10px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); color: var(--mute); cursor: pointer; font-size: 13px; }
.search-btn:hover { border-color: var(--faint); }
.search-btn kbd { margin-left: auto; font: 11px ui-monospace, monospace; border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; background: var(--panel); }
.nav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); padding: 14px 10px 5px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 500; transition: background .15s var(--ease), color .15s; }
.nav a .ico { color: var(--faint); transition: color .15s; }
.nav a:hover { background: var(--sunken); text-decoration: none; }
.nav a:hover .ico { color: var(--ink-2); }
.nav a.on { background: var(--brand-soft); color: var(--brand-ink); }
.nav a.on .ico { color: var(--brand); }
.nav a .count { margin-left: auto; background: var(--brand); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 7px; font-weight: 600; }
.nav a .new { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--brand-ink); background: var(--brand-soft); border-radius: 5px; padding: 0 5px; }
.side-foot { margin-top: auto; padding: 12px 6px 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 16px 32px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(10px); position: sticky; top: 0; z-index: 5; }
.topbar .grow { flex: 1; min-width: 0; }
.topbar .sub { color: var(--mute); font-size: 13px; }
.content { padding: 28px 32px 64px; max-width: 1320px; animation: enter .25s var(--ease); }
.btn.menu-btn { display: none; }
.banner { display: flex; align-items: center; gap: 12px; padding: 10px 32px; background: var(--brand-soft); color: var(--brand-ink); font-weight: 500; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.banner.warn { background: var(--warn-bg); color: var(--warn); }

@media (max-width: 860px) {
  .frame { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: 272px; z-index: 30; transform: translateX(-100%); transition: transform .22s var(--ease); }
  .side.open { transform: none; box-shadow: var(--shadow-lg); }
  .backdrop { position: fixed; inset: 0; z-index: 29; background: rgba(9, 9, 11, .4); animation: fade .15s ease; }
  .btn.menu-btn { display: inline-flex; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; }
  .content { padding: 18px 16px 96px; }
  .banner { padding: 10px 16px; }
  .hide-sm { display: none; }
}

/* ── Primitives ────────────────────────────────────────────────────────── */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card.lift { transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s; }
.card.lift:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 25%, var(--line)); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); min-height: 52px; }
.card-h .grow { flex: 1; }
.card-b { padding: 18px; }
.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) { .g4:has(> .stat) { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g4 > .stat .v { font-size: 24px; } .g4 > .stat .d { font-size: 11px; } }
.split { display: grid; gap: 16px; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; }
@media (max-width: 960px) { .split { grid-template-columns: minmax(0, 1fr); } }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.nowrap { flex-wrap: nowrap; }
.stack { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.muted { color: var(--mute); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.tnum { font-variant-numeric: tabular-nums; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 8px 0 12px; }
.section-title h2 { font-size: 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 8px 14px; border-radius: 9px; font-weight: 550; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, transform .08s; box-shadow: var(--shadow-sm); }
.btn:hover { background: var(--panel-2); border-color: var(--faint); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: transparent; color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.1), inset 0 1px 0 rgba(255,255,255,.12); }
.btn.primary:hover { filter: brightness(1.08); background: var(--brand); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--sunken); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 11px 20px; font-size: 15px; border-radius: 11px; }
.btn.icon { padding: 7px; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.ai { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 50%, #06b6d4)); border: 0; color: #fff; }
.btn.ai:hover { filter: brightness(1.08); }
.btn.wrap { white-space: normal; text-align: left; }

.field { display: grid; gap: 6px; }
.field > span { font-weight: 550; font-size: 13px; color: var(--ink-2); }
.field small { color: var(--mute); }
.input, select.input, textarea.input { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); outline: none; transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: var(--faint); }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea.input { min-height: 90px; resize: vertical; line-height: 1.5; }
.check { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.check input { accent-color: var(--brand); width: 16px; height: 16px; }

/* Toggle switch: <label class="switch"><input type=checkbox><i></i></label> */
.switch { position: relative; display: inline-flex; width: 36px; height: 20px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; background: var(--line); border-radius: 99px; transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s var(--ease); }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Segmented control */
.seg { display: inline-flex; background: var(--sunken); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; font-weight: 550; font-size: 13px; color: var(--mute); cursor: pointer; }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm); }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 550; background: var(--sunken); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.pill.wrap { white-space: normal; }
.pill.brand { background: var(--brand-soft); color: var(--brand-ink); border-color: transparent; }
.pill.good { background: var(--good-bg); color: var(--good); border-color: transparent; }
.pill.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); cursor: pointer; font-weight: 500; transition: all .15s; }
.chip:hover { border-color: var(--faint); }
.chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); }

.stat { padding: 18px; }
.stat .k { color: var(--mute); font-size: 12.5px; font-weight: 550; }
.stat .v { font-size: 28px; font-weight: 650; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.stat .d { font-size: 12.5px; margin-top: 2px; }
.up { color: var(--good); } .down { color: var(--bad); }

table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 12px; font-weight: 550; color: var(--mute); padding: 10px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--panel-2); }
.t td { padding: 12px 18px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: var(--brand-softer); }
.t tr:last-child td { border-bottom: 0; }
.scroll-x { overflow-x: auto; }

.empty { padding: 44px 16px; text-align: center; color: var(--mute); display: grid; gap: 10px; justify-items: center; }
.empty .big { width: 48px; height: 48px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 22px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-weight: 650; font-size: 12px; flex: none; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 12px; font-weight: 550; color: var(--mute); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-color: var(--brand); }

/* Overlays */
.overlay { position: fixed; inset: 0; background: rgba(9, 9, 11, .45); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s ease; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--shadow-lg); animation: pop .2s var(--ease); }
.modal.wide { width: min(880px, 100%); }
.modal-h { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line-2); gap: 8px; }
.modal-h h2 { flex: 1; }
.modal-b { padding: 20px; display: grid; gap: 14px; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--panel); padding: 11px 16px; border-radius: 12px; z-index: 70; box-shadow: var(--shadow-lg); animation: rise .25s var(--ease); max-width: calc(100vw - 32px); display: flex; gap: 12px; align-items: center; font-weight: 500; }
.toast.err { background: var(--bad); color: #fff; }
.toast button { background: none; border: 0; color: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--panel); z-index: 40; box-shadow: var(--shadow-lg); overflow-y: auto; animation: slide .22s var(--ease); border-left: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 10px); } }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
@keyframes enter { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 56px; display: grid; place-items: center; color: var(--mute); }
.skeleton { background: linear-gradient(90deg, var(--sunken), var(--line-2), var(--sunken)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Health ring & bars */
.ring { --v: 0; --c: var(--good); width: 46px; height: 46px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--v) * 1%), var(--line) 0); display: grid; place-items: center; flex: none; }
.ring::before { content: attr(data-v); width: 37px; height: 37px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font-weight: 650; font-size: 13px; }
.bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .4s var(--ease); }
.bar.warn > i { background: var(--warn); } .bar.bad > i { background: var(--bad); }

/* Kanban */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { background: var(--sunken); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 230px); transition: border-color .15s, box-shadow .15s; }
.col.drop { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.col-h { padding: 12px 14px; display: flex; gap: 6px; align-items: baseline; }
.col-b { padding: 0 8px 8px; display: grid; gap: 8px; overflow-y: auto; min-height: 60px; }
.deal { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; cursor: grab; box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s; }
.deal:hover { box-shadow: var(--shadow); }
.deal.dragging { opacity: .5; }

/* Inbox */
.inbox { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: calc(100vh - 160px); min-height: 480px; overflow: hidden; }
.inbox-list { border-right: 1px solid var(--line); overflow-y: auto; }
.conv { padding: 12px 16px; border-bottom: 1px solid var(--line-2); cursor: pointer; display: grid; gap: 2px; }
.conv:hover { background: var(--panel-2); }
.conv.on { background: var(--brand-soft); }
.conv.unread .name { font-weight: 700; }
.thread { display: flex; flex-direction: column; min-width: 0; }
.msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: var(--panel-2); }
.msg { max-width: min(560px, 80%); padding: 9px 14px; border-radius: 16px; white-space: pre-wrap; word-wrap: break-word; }
.msg.in { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg.out { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 6px; }
.msg.out.ai { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #06b6d4)); }
.msg.draft { align-self: flex-end; background: var(--warn-bg); border: 1px dashed var(--warn); color: var(--ink); }
.msg-meta { font-size: 11px; opacity: .75; margin-top: 4px; }
.composer { border-top: 1px solid var(--line); padding: 10px; display: grid; gap: 8px; background: var(--panel); }
@media (max-width: 860px) { .inbox { grid-template-columns: minmax(0, 1fr); height: auto; } .inbox.has-thread .inbox-list { display: none; } .inbox:not(.has-thread) .thread { display: none; } .msgs { min-height: 50vh; } }

/* Automations */
.flow { display: grid; gap: 0; justify-items: stretch; max-width: 660px; }
.node { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; box-shadow: var(--shadow-sm); }
.node.trigger { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); background: var(--brand-softer); }
.node-h { display: flex; align-items: center; gap: 8px; }
.node-h .grow { flex: 1; font-weight: 600; }
.link { width: 2px; height: 18px; background: var(--line); margin: 0 auto; }

/* Calendar */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 140px; display: grid; gap: 6px; align-content: start; }
.day.today { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.appt { background: var(--brand-soft); border-left: 3px solid var(--brand); padding: 6px 8px; border-radius: 7px; font-size: 12px; cursor: pointer; }
.appt.cancelled, .appt.no_show { opacity: .5; text-decoration: line-through; }
@media (max-width: 900px) { .week { grid-template-columns: minmax(0, 1fr); } .day { min-height: 0; } }

/* Editors with live preview (sites, emails) */
.editor { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 16px; align-items: start; }
.block-card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.block-card .card-h { padding: 10px 12px; min-height: 0; }
.preview { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; height: calc(100vh - 190px); min-height: 480px; box-shadow: var(--shadow); position: sticky; top: 84px; }
.preview iframe { width: 100%; height: 100%; border: 0; }
@media (max-width: 1000px) { .editor { grid-template-columns: minmax(0, 1fr); } .preview { position: static; height: 560px; } }

/* AI bar: "tell the AI what to change" */
.aibar { display: flex; gap: 8px; align-items: center; padding: 8px 8px 8px 12px; border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line)); border-radius: 12px; background: linear-gradient(135deg, var(--brand-softer), color-mix(in srgb, #06b6d4 5%, transparent)); }
.aibar .ico { color: var(--brand); }
.aibar input { flex: 1; border: 0; background: transparent; outline: none; min-width: 0; padding: 4px 0; }

/* Charts */
.chart { width: 100%; height: 180px; display: block; }
.chart .grid-l { stroke: var(--line-2); }
.chart .a1 { fill: var(--brand); }
.chart .a2 { fill: var(--brand-2); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--mute); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* Command palette */
.cmdk { position: fixed; inset: 0; z-index: 60; background: rgba(9,9,11,.4); backdrop-filter: blur(2px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; animation: fade .12s ease; }
.cmdk-box { width: min(620px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .18s var(--ease); }
.cmdk-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.cmdk-in input { flex: 1; border: 0; outline: none; background: transparent; font-size: 16px; }
.cmdk-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.cmdk-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; cursor: pointer; color: var(--ink-2); }
.cmdk-item.on { background: var(--brand-soft); color: var(--brand-ink); }
.cmdk-item .ico { color: var(--faint); }
.cmdk-item.on .ico { color: var(--brand); }
.cmdk-group { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); padding: 10px 10px 4px; font-weight: 600; }

/* AI Employee dock */
.ai-fab { position: fixed; right: 22px; bottom: 22px; z-index: 35; display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 999px; border: 0; color: #fff; cursor: pointer; font-weight: 600; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 50%, #06b6d4)); box-shadow: 0 10px 30px -8px color-mix(in srgb, var(--brand) 70%, transparent); transition: transform .18s var(--ease); }
.ai-fab:hover { transform: translateY(-2px); }
.ai-panel { position: fixed; right: 22px; bottom: 22px; z-index: 36; width: min(420px, calc(100vw - 32px)); height: min(600px, calc(100vh - 44px)); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; animation: pop .2s var(--ease); }
.ai-head { padding: 14px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line-2); }
.ai-orb { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--brand) 60%, white), var(--brand) 55%, #6d28d9); flex: none; }
.ai-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--panel-2); }
.ai-msg { max-width: 88%; padding: 9px 13px; border-radius: 14px; white-space: pre-wrap; }
.ai-msg.me { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 5px; }
.ai-msg.bot { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.ai-suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; background: var(--panel-2); }
.ai-suggest button { font-size: 12px; padding: 4px 10px; }
.ai-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line-2); }
@media (max-width: 860px) { .ai-fab span { display: none; } .ai-fab { padding: 14px; right: 16px; bottom: 16px; } .ai-panel { right: 8px; bottom: 8px; left: 8px; width: auto; } }

/* Onboarding interview */
.interview { max-width: 760px; margin: 0 auto; }
.iv-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.iv-q { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.iv-q .bubble { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; border-top-left-radius: 5px; padding: 14px 16px; font-size: 16px; font-weight: 500; box-shadow: var(--shadow-sm); animation: enter .3s var(--ease); }
.iv-answer { margin-left: 46px; display: grid; gap: 12px; animation: enter .35s var(--ease); }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.choice { border: 1px solid var(--line); background: var(--panel); border-radius: 11px; padding: 11px 13px; cursor: pointer; text-align: left; font-weight: 500; transition: all .15s; }
.choice:hover { border-color: var(--faint); }
.choice.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); box-shadow: 0 0 0 1px var(--brand); }
.style-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.style-card { border: 2px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer; background: var(--panel); transition: border-color .15s, transform .15s; padding: 0; text-align: left; }
.style-card:hover { transform: translateY(-2px); }
.style-card.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.style-card .thumb { height: 230px; overflow: hidden; position: relative; background: #f5f5f5; }
.style-card iframe { width: 200%; height: 460px; border: 0; transform: scale(.5); transform-origin: 0 0; pointer-events: none; display: block; }
.style-card .lbl { padding: 10px 12px; border-top: 1px solid var(--line); }
.dropzone { border: 2px dashed var(--line); border-radius: 14px; padding: 24px; text-align: center; color: var(--mute); cursor: pointer; transition: border-color .15s, background .15s; display: grid; gap: 6px; justify-items: center; }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-softer); color: var(--brand-ink); }
.file-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
@media (max-width: 700px) { .iv-answer { margin-left: 0; } .style-grid { grid-template-columns: minmax(0, 1fr); } }

/* Social & ads */
.post { display: grid; gap: 10px; padding: 16px; }
.post-body { white-space: pre-wrap; }
.net { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: #fff; font-size: 11px; font-weight: 700; flex: none; }
.serp { font-family: Arial, sans-serif; padding: 16px; background: #fff; color: #202124; border-radius: 12px; border: 1px solid #e5e7eb; }
.serp .sp { font-size: 12px; font-weight: 700; } .serp .u { font-size: 12px; color: #4d5156; } .serp .h { color: #1a0dab; font-size: 19px; line-height: 1.3; margin: 4px 0; } .serp .d { font-size: 14px; color: #4d5156; }
.fbad { background: #fff; color: #050505; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; font-family: Helvetica, Arial, sans-serif; }
.fbad .img { aspect-ratio: 1.91; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 40%, #f59e0b)); display: grid; place-items: center; color: #fff; padding: 20px; text-align: center; font-weight: 600; }

/* Plans */
.plan { padding: 22px; display: grid; gap: 14px; align-content: start; position: relative; }
.plan.hot { border: 2px solid var(--brand); box-shadow: 0 16px 40px -20px color-mix(in srgb, var(--brand) 60%, transparent); }
.plan .amt { font-size: 38px; font-weight: 700; letter-spacing: -.04em; }
.plan ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; color: var(--ink-2); }
.plan li { display: flex; gap: 8px; align-items: flex-start; }
.plan li .ico { color: var(--brand); margin-top: 2px; }
.plan .ribbon { position: absolute; top: -11px; left: 22px; }

/* Auth & marketing */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1000px 520px at 15% -10%, var(--brand-soft), transparent), radial-gradient(800px 400px at 100% 110%, color-mix(in srgb, #06b6d4 8%, transparent), transparent), var(--bg); }
.auth .card { width: min(420px, 100%); padding: 30px; display: grid; gap: 16px; box-shadow: var(--shadow-lg); }
.auth .card.wide { width: min(760px, 100%); }
.auth .logo { padding: 0; justify-content: center; font-size: 18px; }
.err { color: var(--bad); font-size: 13px; }

.mk { background: var(--panel); color: var(--ink); }
.mk-nav { display: flex; align-items: center; gap: 8px; max-width: 1160px; margin: 0 auto; padding: 16px 20px; position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--panel) 85%, transparent); backdrop-filter: blur(10px); }
.mk-nav .grow { flex: 1; }
.mk-nav .links a { color: var(--ink-2); font-weight: 500; padding: 6px 10px; }
.mk-hero { max-width: 1160px; margin: 0 auto; padding: 64px 20px 48px; display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.mk-hero h1 { font-size: clamp(36px, 5.4vw, 62px); line-height: 1.02; letter-spacing: -.045em; font-weight: 700; }
.mk-hero h1 em { font-style: normal; background: linear-gradient(135deg, var(--brand), #06b6d4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mk-hero p.lead { font-size: 18px; color: var(--ink-2); margin: 20px 0 28px; max-width: 560px; line-height: 1.6; }
.mk-sec { max-width: 1160px; margin: 0 auto; padding: 64px 20px; }
.mk-sec > h2 { font-size: clamp(26px, 3.2vw, 38px); letter-spacing: -.03em; margin-bottom: 10px; }
.mk-sec > p.sub { color: var(--mute); font-size: 17px; margin-bottom: 32px; max-width: 700px; }
.edge { padding: 22px; display: grid; gap: 10px; align-content: start; }
.edge .n { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.edge h3 { font-size: 16px; }
.edge p { color: var(--ink-2); }
.cmp td:nth-child(2), .cmp th:nth-child(2) { background: var(--brand-softer); font-weight: 600; }
.cmp td { font-size: 14px; }
.savings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 800px) { .savings { grid-template-columns: minmax(0, 1fr); } }
.mock { border-radius: 18px; border: 1px solid var(--line); box-shadow: var(--shadow-lg); background: var(--panel); overflow: hidden; }
.mock-bar { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
@media (max-width: 900px) { .mk-hero { grid-template-columns: minmax(0, 1fr); padding-top: 28px; } .mk-nav .links { display: none; } }

.brand-preview { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: grid; grid-template-columns: 150px minmax(0, 1fr); min-height: 260px; }
.brand-preview .bp-side { background: var(--panel); border-right: 1px solid var(--line); padding: 12px; display: grid; gap: 6px; align-content: start; }
.brand-preview .bp-main { background: var(--bg); padding: 16px; display: grid; gap: 10px; align-content: start; }
.swatch { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); padding: 0; cursor: pointer; }


/* ══ Top-navigation layout ══════════════════════════════════════════════
   A horizontal header with dropdown menus, a roomy page header, and
   centred content. On phones the menu becomes a full-width sheet. */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.appbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: saturate(1.5) blur(14px); border-bottom: 1px solid var(--line); }
.appbar-in { max-width: 1760px; margin: 0 auto; padding: 10px 28px; display: flex; align-items: center; gap: 14px; min-height: 64px; }
.brandlink { color: inherit; text-decoration: none !important; }
.brandlink .logo { padding: 0; font-size: 16px; font-weight: 600; }
.appnav { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
.navlink { display: inline-flex; align-items: center; gap: 4px; padding: 8px 12px; border-radius: 999px; border: 0; background: none; color: var(--ink-2); font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; text-decoration: none !important; font-size: 14px; }
.navlink:hover { background: var(--sunken); color: var(--ink); }
.navlink.on { background: var(--ink); color: var(--panel); }
.navlink .chev { transition: transform .2s var(--ease); opacity: .7; }
.navlink .chev.up { transform: rotate(180deg); }
.menu { position: relative; }
.dropdown { position: absolute; top: calc(100% + 8px); left: 0; min-width: 290px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 8px; z-index: 30; animation: pop .16s var(--ease); display: grid; gap: 2px; }
.dropdown.right { left: auto; right: 0; min-width: 250px; }
.dropdown a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 11px; color: var(--ink-2); text-decoration: none !important; }
.dropdown a:hover, .dropdown a.on { background: var(--sunken); color: var(--ink); }
.dropdown a b { display: block; font-weight: 500; color: var(--ink); }
.dd-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.dd-desc { display: block; font-size: 12px; color: var(--mute); }
.dd-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 8px 10px 4px; }
.dd-user { padding: 8px 10px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; display: grid; }
.dd-foot { border-top: 1px solid var(--line-2); margin-top: 4px; border-radius: 0 0 11px 11px !important; }
.dropdown .new { font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--brand-ink); background: var(--brand-soft); border-radius: 5px; padding: 1px 6px; }
.switch-btn { display: inline-flex; align-items: center; gap: 8px; max-width: 220px; padding: 5px 10px 5px 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); cursor: pointer; font-weight: 500; color: var(--ink-2); }
.switch-btn:hover { border-color: var(--faint); }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.iconbtn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--mute); cursor: pointer; font-size: 13px; }
.iconbtn:hover { color: var(--ink); border-color: var(--faint); }
.iconbtn kbd { font: 11px ui-monospace, monospace; border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; background: var(--panel-2); }
.avatar-btn { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; }
.avatar-btn .avatar { width: 36px; height: 36px; font-size: 13px; background: var(--brand); color: #fff; }
.menu-toggle { display: none; padding: 8px; }

.pagehead { background: linear-gradient(180deg, var(--panel), var(--bg)); border-bottom: 1px solid var(--line-2); }
.pagehead-in { max-width: 1320px; margin: 0 auto; padding: 30px 28px 24px; display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.pagehead h1 { font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-ink); margin-bottom: 6px; }
.app > .content { width: 100%; max-width: 1320px; margin: 0 auto; padding: 26px 28px 80px; flex: 1; }
.app > .banner { justify-content: center; }
.app > .banner > * { max-width: 1264px; }

.sheet { border-top: 1px solid var(--line); background: var(--panel); padding: 10px 16px 18px; max-height: calc(100vh - 64px); overflow-y: auto; display: grid; gap: 4px; animation: enter .2s var(--ease); }
.sheet a { display: flex; align-items: center; gap: 12px; padding: 10px 10px; border-radius: 11px; color: var(--ink-2); font-weight: 500; text-decoration: none !important; }
.sheet a .ico { color: var(--brand); }
.sheet a.on, .sheet a:hover { background: var(--sunken); color: var(--ink); }
.sheet-group { display: grid; gap: 2px; padding-top: 6px; }
.sheet-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 8px 10px 2px; }

@media (max-width: 1440px) {
  .appbar-in { gap: 8px; padding: 10px 20px; }
  .appnav { margin-left: 2px; }
  .switch-btn .ellipsis { max-width: 120px; }
  .appnav .navlink { padding: 8px 10px; }
  .iconbtn.search kbd, .iconbtn.search span, .iconbtn .hide-sm { display: none; }
}
@media (max-width: 1320px) { .appnav .navlink { padding: 8px 8px; font-size: 13.5px; } .appnav .navlink svg { margin-left: -2px; } }
.appbar.compact .appnav { display: none; }
.appbar.compact .menu-toggle { display: inline-flex; }
@media (max-width: 920px) {
  .appnav, .switcher { display: none; }
  .menu-toggle { display: inline-flex; }
  .appbar-in { padding: 10px 16px; min-height: 58px; }
  .pagehead-in { padding: 20px 16px 16px; }
  .pagehead h1 { font-size: 24px; }
  .app > .content { padding: 18px 16px 96px; }
}
@media (max-width: 520px) {
  .appbar-in { gap: 8px; }
  .brandlink { min-width: 0; flex: 1 1 auto; }
  .brandlink .logo span { max-width: 150px; }
  .appbar-in > .grow { display: none; }
  .iconbtn { padding: 7px; }
  .avatar-btn .avatar { width: 32px; height: 32px; }
}

/* ══ Gradient theme ═══════════════════════════════════════════════════════
   One brand-driven gradient (brand → violet → accent) used sparingly:
   page headers, primary actions, the active nav item and key figures. */
:root {
  --violet: #0891b2;
  --grad: linear-gradient(120deg, var(--brand) 0%, color-mix(in srgb, var(--brand) 30%, #06b6d4) 52%, color-mix(in srgb, var(--brand) 15%, #2563eb) 100%);
  --grad-soft: linear-gradient(120deg, color-mix(in srgb, var(--brand) 9%, var(--panel)), color-mix(in srgb, var(--violet) 7%, var(--panel)));
}
body { background: radial-gradient(1200px 600px at 100% -200px, color-mix(in srgb, var(--violet) 7%, transparent), transparent), radial-gradient(900px 500px at -10% 0%, color-mix(in srgb, var(--brand) 6%, transparent), transparent), var(--bg); background-attachment: fixed; }

.pagehead { background: var(--grad); border-bottom: 0; position: relative; overflow: hidden; }
.pagehead::after { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 220px at 85% 0%, rgba(255,255,255,.22), transparent), radial-gradient(400px 200px at 10% 120%, rgba(255,255,255,.12), transparent); pointer-events: none; }
.pagehead-in { position: relative; z-index: 1; padding-bottom: 64px; }
.pagehead h1 { color: #fff; }
.pagehead .eyebrow { color: rgba(255,255,255,.8); }
.pagehead .btn { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.28); color: #fff; box-shadow: none; backdrop-filter: blur(6px); }
.pagehead .btn:hover { background: rgba(255,255,255,.26); }
.app > .content { position: relative; margin-top: -44px; }

.btn.primary { background: var(--grad); border: 0; }
.btn.primary:hover { background: var(--grad); filter: brightness(1.08) saturate(1.05); }
.navlink.on { background: var(--grad); color: #fff; box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--brand) 70%, transparent); }
.avatar-btn .avatar { background: var(--grad); }
.logo-mark { background: var(--grad); }
.ai-fab, .btn.ai { background: var(--grad); }
.bar > i { background: var(--grad); }

.card { box-shadow: 0 1px 2px rgba(24,24,27,.04), 0 12px 32px -20px rgba(24,24,27,.18); }
.grad-card { background: var(--grad); color: #fff; border: 0; }
.grad-card .k, .grad-card .d { color: rgba(255,255,255,.85) !important; }
.grad-card .v { color: #fff; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .v { background: linear-gradient(120deg, var(--ink), color-mix(in srgb, var(--ink) 60%, var(--brand))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad-card .v { background: none; -webkit-background-clip: initial; color: #fff; }
.card.lift:hover { border-color: transparent; box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 35%, transparent), 0 18px 40px -22px color-mix(in srgb, var(--brand) 55%, transparent); }
.dd-ico { background: var(--grad-soft); }
.auth { background: radial-gradient(900px 500px at 10% -10%, color-mix(in srgb, var(--brand) 22%, transparent), transparent), radial-gradient(800px 500px at 110% 110%, color-mix(in srgb, var(--violet) 20%, transparent), transparent), var(--bg); }
.mk-hero h1 em { background: var(--grad); -webkit-background-clip: text; background-clip: text; }
@media (max-width: 920px) { .pagehead-in { padding-bottom: 54px; } .app > .content { margin-top: -38px; } }

/* ── v4: team & permissions, dashboards, chat preview, academy ─────────── */
.grad-soft { background: var(--grad-soft); }
.savebar { position: sticky; bottom: 0; display: flex; align-items: center; gap: 12px; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 35%); z-index: 2; }
.good-t { color: var(--good); } .bad-t { color: var(--bad); } .warn-t { color: var(--warn); font-weight: 700; width: 15px; text-align: center; }
.faint { color: var(--faint); }
.pill.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
table.perm td.c, table.perm th.c { text-align: center; width: 64px; padding-left: 4px; padding-right: 4px; font-size: 12px; }
table.perm td:first-child { white-space: nowrap; }
table.perm input { accent-color: var(--brand); width: 16px; height: 16px; cursor: pointer; }
table.perm tr.grp td { background: var(--sunken); font-weight: 650; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--mute); }
table.t tr.total td { background: var(--sunken); }
.chip input { accent-color: var(--brand); margin: 0; }
.codebox { display: flex; align-items: center; gap: 10px; background: #0f172a; color: #a5f3fc; border-radius: 12px; padding: 12px 14px; }
.codebox code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font-size: 13px; }
.howto { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.steps li { display: flex; align-items: center; gap: 10px; color: var(--mute); }
.steps li::before { content: ''; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.steps li.done { color: var(--ink); }
.steps li.done::before { background: var(--good); border-color: var(--good); box-shadow: inset 0 0 0 3px var(--panel); }
.rank { width: 26px; height: 26px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.bar.light { background: rgba(255,255,255,.25); } .bar.light > i { background: #fff; }

/* Dashboards: a 4-column grid; widgets span 1–4 columns. */
.dash { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.dw { position: relative; min-width: 0; } .dw.s1 { grid-column: span 1; } .dw.s2 { grid-column: span 2; } .dw.s3 { grid-column: span 3; } .dw.s4 { grid-column: span 4; }
.dw-card { height: 100%; }
.dw-card .skeleton { height: 64px; margin-top: 12px; }
.dw.editing .dw-card { outline: 2px dashed color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 3px; }
.dw-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; background: var(--panel); padding: 4px; border-radius: 10px; box-shadow: var(--shadow); z-index: 3; }
@media (max-width: 1100px) { .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dw.s3, .dw.s4 { grid-column: span 2; } }
@media (max-width: 700px) { .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dw.s2, .dw.s3, .dw.s4 { grid-column: span 2; } }

/* Website chat preview */
.wc-stage { position: relative; height: 560px; border-radius: 16px; border: 1px solid var(--line); overflow: hidden; background: repeating-linear-gradient(135deg, var(--sunken) 0 14px, var(--panel) 14px 28px); }
.wc-panel { position: absolute; bottom: 86px; width: min(330px, calc(100% - 32px)); background: #fff; color: #0f172a; border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.25); overflow: hidden; font-family: system-ui, sans-serif; font-size: 14px; }
.wc-panel.right, .wc-btn.right, .wc-tip.right { right: 16px; } .wc-panel.left, .wc-btn.left, .wc-tip.left { left: 16px; }
.wc-head { color: #fff; padding: 14px 16px; display: flex; gap: 10px; align-items: center; }
.wc-head b { display: block; } .wc-head small { opacity: .85; }
.wc-av { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.22); display: grid; place-items: center; font-weight: 700; }
.wc-x { margin-left: auto; border: 0; background: rgba(255,255,255,.16); color: #fff; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; }
.wc-msgs { background: #f8fafc; padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 180px; }
.wc-msgs div { max-width: 84%; padding: 8px 12px; border-radius: 14px; }
.wc-msgs .ai { align-self: flex-start; background: #fff; border: 1px solid #e2e8f0; } .wc-msgs .me { align-self: flex-end; color: #fff; }
.wc-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px; background: #f8fafc; }
.wc-quick span { border: 1px solid; border-radius: 99px; padding: 4px 10px; font-size: 12px; font-weight: 600; background: #fff; }
.wc-input { display: flex; justify-content: space-between; padding: 13px 14px; border-top: 1px solid #e2e8f0; color: #94a3b8; }
.wc-btn { position: absolute; bottom: 16px; height: 52px; min-width: 52px; padding: 0 18px 0 14px; border: 0; border-radius: 26px; color: #fff; display: flex; align-items: center; gap: 8px; font-weight: 600; box-shadow: 0 10px 28px rgba(0,0,0,.22); cursor: pointer; }
.wc-tip { position: absolute; bottom: 82px; max-width: 240px; background: #fff; color: #0f172a; border-radius: 12px; padding: 10px 12px; box-shadow: 0 10px 28px rgba(0,0,0,.18); font-size: 13px; }

/* Academy & video player */
.academy-hero { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.academy-hero .btn { background: #fff; color: var(--ink); border: 0; }
.lesson { padding: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; overflow: hidden; }
.thumb { position: relative; aspect-ratio: 16 / 9; background: var(--grad); display: grid; place-items: center; }
.thumb.sm { width: 76px; flex: none; border-radius: 10px; }
.thumb .play { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.95); color: var(--brand); display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.thumb.sm .play { width: 28px; height: 28px; }
.thumb .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(15,23,42,.7); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px; }
.thumb .seen { position: absolute; left: 8px; top: 8px; background: var(--good); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; display: flex; align-items: center; gap: 4px; }
.lesson-row { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: var(--panel); cursor: pointer; font: inherit; color: inherit; text-align: left; }
.lesson-row:hover { border-color: var(--brand); }
.player canvas { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 12px; display: block; background: #f4f5fb; cursor: pointer; }
.player-bar { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.player-track { position: relative; flex: 1; min-width: 140px; height: 8px; background: var(--line); border-radius: 99px; }
.player-track > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--grad); border-radius: 99px; }
.player-track > button { position: absolute; top: -4px; width: 4px; height: 16px; border: 0; padding: 0; background: var(--panel); border-radius: 2px; cursor: pointer; transform: translateX(-2px); }
.player-chapters { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.academy-hero .btn { white-space: normal; text-align: left; max-width: 100%; }
@media (max-width: 700px) { .hours-row > span:first-child { width: 100% !important; font-weight: 600; } }

/* ── Drag-and-drop builder ─────────────────────────────────────────────── */
.builder { display: grid; grid-template-columns: 190px minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.bld-palette, .bld-inspector { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow: auto; }
.bld-palette { padding: 8px; display: grid; gap: 4px; }
.bld-group { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); padding: 8px 6px 2px; }
.bld-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); cursor: grab; font: inherit; font-size: 13px; color: var(--ink); text-align: left; }
.bld-item:hover { border-color: var(--brand); background: var(--brand-softer); }
.bld-item:active { cursor: grabbing; }
.bld-canvas { min-height: 420px; background: var(--sunken); border: 1px dashed var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; align-content: start; }
.bld-empty { display: grid; place-items: center; gap: 8px; min-height: 280px; color: var(--mute); border-radius: 12px; border: 2px dashed transparent; text-align: center; padding: 20px; }
.bld-empty.over { border-color: var(--brand); background: var(--brand-softer); color: var(--brand-ink); }
.bld-block { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.bld-block:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.bld-block.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.bld-tools { display: flex; align-items: center; gap: 2px; padding: 4px 6px 4px 10px; border-bottom: 1px solid var(--line-2); font-size: 12px; color: var(--mute); }
.bld-tools b { flex: 1; font-weight: 600; }
.bld-handle { cursor: grab; margin-right: 6px; font-size: 15px; }
.bld-preview { padding: 16px 18px; pointer-events: none; }
.bld-drop { height: 4px; border-radius: 4px; background: var(--grad); box-shadow: 0 0 0 3px var(--brand-soft); }
.bld-inspector .field > span { font-size: 12px; }
.bld-item-edit { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--sunken); }
.bld-design summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; max-height: 200px; overflow: auto; }
.media-grid button { padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; background: none; aspect-ratio: 1; }
.media-grid img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 1150px) { .builder { grid-template-columns: 170px minmax(0, 1fr); } .bld-inspector { grid-column: 1 / -1; position: static; max-height: none; } }
@media (max-width: 700px) { .builder { grid-template-columns: minmax(0, 1fr); } .bld-palette { position: static; display: flex; overflow-x: auto; max-height: none; } .bld-group { display: none; } .bld-item { flex: none; } }
/* Site block previews on the canvas */
.site-canvas { background: #fff; color: #0f172a; }
.sp-h1 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.sp-h2 { font-size: 19px; font-weight: 650; margin-bottom: 6px; }
.sp-sub { color: #475569; margin: 6px 0 12px; }
.sp-p p { margin: 0 0 8px; color: #334155; }
.sp-btn { display: inline-block; background: var(--grad); color: #fff; border-radius: 9px; padding: 8px 16px; font-weight: 600; font-size: 13px; }
.sp-hero { text-align: center; padding: 18px 8px; background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 10%, transparent), transparent); border-radius: 10px; }
.sp-hero.img { display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px; text-align: left; align-items: center; }
.sp-hero img { width: 100%; border-radius: 10px; }
.sp-eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); font-weight: 700; margin-bottom: 4px; }
.sp-grid { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 10px; }
.sp-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px; display: grid; gap: 4px; }
.sp-card.featured { border: 2px solid var(--brand); }
.sp-big { font-size: 24px; font-weight: 700; }
.sp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sp-checks { margin: 0; padding-left: 20px; } .sp-checks li::marker { content: '✓  '; color: var(--brand); }
.sp-placeholder { display: grid; place-items: center; gap: 6px; height: 120px; border: 2px dashed #cbd5e1; border-radius: 10px; color: #64748b; font-size: 13px; }
.sp-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; } .sp-gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; }
.sp-quote { font-style: italic; font-size: 17px; }
.sp-faq { padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 8px; margin-top: 6px; }
.sp-form { display: grid; gap: 6px; max-width: 360px; } .sp-input { border: 1px solid #cbd5e1; border-radius: 8px; padding: 8px 10px; color: #94a3b8; font-size: 13px; text-transform: capitalize; }
.sp-count span { display: inline-block; background: #f1f5f9; border-radius: 8px; padding: 6px 10px; font-weight: 700; font-size: 18px; margin: 0 4px; }
.sp-coupon { border: 2px dashed var(--brand); border-radius: 12px; padding: 14px; text-align: center; }
.sp-code { font: 700 20px ui-monospace, Consolas, monospace; letter-spacing: .1em; color: var(--brand); margin-top: 6px; }
.sp-spacer { background: repeating-linear-gradient(45deg, #f1f5f9 0 6px, transparent 6px 12px); border-radius: 6px; }
/* Social calendar */
.soc-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.soc-dow { font-size: 12px; font-weight: 650; color: var(--mute); text-align: center; padding: 4px; }
.soc-day { min-height: 118px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; transition: border-color .15s, background .15s; }
.soc-day.past { background: var(--sunken); opacity: .75; }
.soc-day.today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.soc-day.over { background: var(--brand-soft); border-color: var(--brand); }
.soc-date { font-size: 12px; font-weight: 650; color: var(--mute); }
.soc-post { display: grid; gap: 2px; text-align: left; border: 1px solid var(--line); border-left: 3px solid var(--faint); border-radius: 7px; background: var(--panel-2, var(--panel)); padding: 4px 6px; font: inherit; font-size: 11.5px; color: var(--ink); cursor: grab; min-width: 0; }
.soc-post.scheduled { border-left-color: var(--brand); } .soc-post.published { border-left-color: var(--good); cursor: pointer; } .soc-post.failed { border-left-color: var(--bad); }
.soc-post .net { transform: scale(.8); }
@media (max-width: 800px) { .soc-cal { grid-template-columns: repeat(7, minmax(88px, 1fr)); overflow-x: auto; } }
/* Bell, help panel */
.iconbtn.bell { position: relative; }
.iconbtn .badge { position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--panel); }
.notif-panel { width: min(380px, calc(100vw - 24px)); padding: 0; }
.notif-list { max-height: 440px; overflow: auto; }
.notif { display: flex; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line-2); background: none; font: inherit; color: inherit; cursor: pointer; align-items: flex-start; }
.notif:hover { background: var(--sunken); } .notif.unread { background: var(--brand-softer); }
.notif .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-top: 6px; flex: none; }
.block { display: block; } .ellipsis2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.side-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--panel); border-left: 1px solid var(--line); box-shadow: -20px 0 50px -20px rgba(15,23,42,.35); z-index: 60; display: flex; flex-direction: column; animation: slidein .2s var(--ease); }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
.side-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 6px; }
.side-body { flex: 1; overflow: auto; padding: 8px 14px 16px; display: flex; flex-direction: column; }
.side-body > .stack { flex: 1; }
.help-row { display: grid; gap: 2px; text-align: left; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel); font: inherit; color: inherit; cursor: pointer; }
.help-row:hover { border-color: var(--brand); }
.md h3, .md h4 { margin: 12px 0 6px; } .md p { margin: 0 0 8px; } .md ol, .md ul { margin: 0 0 8px; padding-left: 20px; } .md li { margin-bottom: 4px; }
.thread { display: grid; gap: 8px; }
.tmsg { padding: 10px 12px; border-radius: 12px; background: var(--sunken); }
.tmsg.staff { background: var(--brand-soft); } .tmsg.system { background: transparent; border: 1px dashed var(--line); font-size: 13px; }
/* Auth, signup, security */
.ok-note { background: var(--brand-soft); color: var(--brand-ink); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.code-input { text-align: center; font-size: 26px; letter-spacing: .35em; padding: 12px; }
.legal-links { text-align: center; margin: 4px 0 0; } .legal-links a { color: var(--mute); }
.steps-row { list-style: none; display: flex; justify-content: center; gap: 18px; padding: 0; margin: 0; flex-wrap: wrap; font-size: 13px; color: var(--mute); }
.steps-row li { display: flex; align-items: center; gap: 6px; } .steps-row span { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.steps-row li.on { color: var(--ink); font-weight: 600; } .steps-row li.on span { background: var(--grad); border-color: transparent; color: #fff; }
.steps-row li.done span { background: var(--good); border-color: var(--good); color: #fff; }
.plan-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.plan-card { display: grid; gap: 6px; text-align: left; padding: 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--panel); cursor: pointer; font: inherit; color: inherit; }
.plan-card.on { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.plan-price { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.qr svg { width: 168px; height: 168px; display: block; background: #fff; border-radius: 10px; padding: 6px; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; } .codes span { background: var(--sunken); border-radius: 6px; padding: 4px 8px; text-align: center; }
/* Point of sale */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.pos-tile { --tile: var(--brand); display: grid; gap: 4px; align-content: start; min-height: 96px; text-align: left; padding: 12px; border-radius: 14px; border: 1px solid var(--line); border-top: 4px solid var(--tile); background: var(--panel); cursor: pointer; font: inherit; color: inherit; transition: transform .08s, box-shadow .15s; touch-action: manipulation; }
.pos-tile:active { transform: scale(.97); } .pos-tile:hover { box-shadow: var(--shadow); } .pos-tile[disabled] { opacity: .45; }
.pos-tile span { font-weight: 650; }
.pos-cart { position: sticky; top: 84px; }
.pos-line .qty span { min-width: 22px; text-align: center; font-weight: 650; }
.totals { display: grid; gap: 4px; border-top: 1px solid var(--line-2); padding-top: 10px; } .totals > div { display: flex; justify-content: space-between; }
.totals .grand { font-size: 22px; font-weight: 700; margin-top: 4px; }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .pay-grid .btn { justify-content: center; }
.keypad-display { font-size: 34px; font-weight: 700; text-align: center; letter-spacing: -.02em; padding: 8px 0; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .keypad button { font: 600 22px inherit; font-family: inherit; padding: 16px 0; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; color: var(--ink); touch-action: manipulation; } .keypad button:active { background: var(--sunken); }
.pos-done { width: 72px; height: 72px; border-radius: 50%; background: var(--good); color: #fff; display: grid; place-items: center; margin: 0 auto; } .pos-done.tap { background: var(--grad); }
.qr.big svg { width: 240px; height: 240px; margin: 0 auto; }
.pos-tile { position: relative; }
.pos-count { position: absolute; top: -9px; right: -7px; box-shadow: 0 2px 6px rgba(15,23,42,.25); min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--brand); color: #fff; font: 700 13px/24px Poppins, sans-serif; text-align: center; font-style: normal; }
.pos-count.static { position: static; background: #fff; color: var(--brand); }
.pos-bar { display: none; }
@media (max-width: 900px) {
  .pos { grid-template-columns: minmax(0, 1fr); } .pos-cart { position: static; scroll-margin-top: 70px; }
  .pos-bar { display: flex; align-items: center; gap: 12px; position: fixed; left: 12px; right: 84px; bottom: 16px; z-index: 34; padding: 14px 18px; border: 0; border-radius: 16px; background: var(--grad); color: #fff; font: 600 15px Poppins, sans-serif; box-shadow: var(--shadow-lg); cursor: pointer; }
  .app > .content:has(.pos-bar) { padding-bottom: 110px; }
}
.review.private { border-left: 4px solid var(--warn); } .reply { background: var(--sunken); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
/* Video studio */
.video-edit { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.video-stage { background: #000; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.video-stage canvas { width: 100%; height: auto; display: block; }
.video-stage.vertical { max-width: 360px; margin: 0 auto; }
.scene-edit { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--sunken); }
@media (max-width: 1000px) { .video-edit { grid-template-columns: minmax(0, 1fr); } }
.fee-row { display: grid; grid-template-columns: minmax(160px, 1fr) 2fr; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-2); align-items: baseline; }
.fee-row:last-child { border-bottom: 0; }
@media (max-width: 700px) { .fee-row { grid-template-columns: 1fr; gap: 2px; } }

/* ══ Conversations: every channel in one place ════════════════════════════ */
.chb { display: inline-grid; place-items: center; flex: none; border-radius: 7px; background: var(--c); color: #fff; font-weight: 700; line-height: 1; letter-spacing: -.02em; font-family: Poppins, sans-serif; }
.chb .ico { width: 58%; height: 58%; }
.stars-sm { color: #f59e0b; letter-spacing: 1px; font-size: 13px; } .stars-sm span { opacity: .28; }
.cx { display: grid; grid-template-columns: 216px 350px minmax(0, 1fr); height: calc(100vh - 176px); min-height: 520px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-sm); }
.cx-rail { border-right: 1px solid var(--line); padding: 10px 8px; overflow-y: auto; background: var(--panel-2); display: flex; flex-direction: column; gap: 1px; }
.cx-rail-h { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 12px 10px 4px; }
.cx-view { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 10px; border: 0; border-radius: 10px; background: none; color: var(--ink-2); font: 500 13.5px Poppins, sans-serif; text-align: left; cursor: pointer; }
.cx-view:hover { background: var(--sunken); } .cx-view.on { background: var(--brand-soft); color: var(--ink); font-weight: 600; }
.cx-view.muted { color: var(--faint); margin-top: 4px; }
.cx-n { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.cx-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: none; margin: 0 5px; }
.cx-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.cx-list-h { padding: 10px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.cx-rail-select { display: none; width: auto; max-width: 46%; }
.cx-bulk { gap: 6px; }
.cx-rows { overflow-y: auto; flex: 1; }
.cx-row { display: grid; grid-template-columns: 0 40px minmax(0, 1fr); gap: 10px; padding: 11px 12px; border-bottom: 1px solid var(--line-2); cursor: pointer; position: relative; }
.cx-row:hover, .cx-row.checked, .cx-rows:has(.checked) .cx-row { grid-template-columns: 18px 40px minmax(0, 1fr); }
.cx-row:hover { background: var(--panel-2); } .cx-row.on { background: var(--brand-soft); } .cx-row.on::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--brand); }
.cx-check { overflow: hidden; display: flex; align-items: center; } .cx-check input { width: 16px; height: 16px; }
.cx-av { position: relative; width: 40px; height: 40px; } .cx-av .avatar { width: 40px; height: 40px; font-size: 14px; }
.cx-av .chb { position: absolute; right: -4px; bottom: -3px; box-shadow: 0 0 0 2px var(--panel); }
.cx-main { min-width: 0; display: grid; gap: 2px; }
.cx-name { font-weight: 500; } .cx-row.unread .cx-name { font-weight: 700; } .cx-row.unread .muted.ellipsis { color: var(--ink-2); }
.cx-sub { color: var(--ink-2); }
.cx-tags { gap: 4px; margin-top: 3px; } .cx-tags:empty { display: none; } .cx-tags .pill { font-size: 11px; padding: 1px 8px; }
.avatar.xs { width: 20px; height: 20px; font-size: 9px; } .avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.cx-thread { display: grid; grid-template-columns: minmax(0, 1fr) 270px; min-width: 0; min-height: 0; }
.cx-thread.cx-empty { display: grid; place-items: center; grid-template-columns: 1fr; }
.cx-conv { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.cx-th { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cx-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; } .cx-actions .input { width: auto; max-width: 170px; }
.cx-back { display: none; }
.cx-summary { margin: 10px 14px 0; padding: 10px 14px; border-radius: 12px; background: var(--brand-soft); display: grid; gap: 4px; font-size: 14px; }
.cx-labels { padding: 8px 14px 0; gap: 6px; } .pill-x { border: 0; background: none; margin-left: 4px; cursor: pointer; color: inherit; opacity: .6; padding: 0; font-size: 14px; line-height: 1; } .pill-x:hover { opacity: 1; }
.cx-msgs { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; background: var(--panel-2); }
.cx-day { text-align: center; font-size: 12px; color: var(--faint); margin: 6px 0; } .cx-day span { background: var(--panel); border: 1px solid var(--line); padding: 3px 12px; border-radius: 999px; }
.cx-bubble .pre, .cx-note .pre, .cx-event .pre { white-space: pre-wrap; word-wrap: break-word; }
.msg.out.automation { background: color-mix(in srgb, var(--brand) 70%, #475569); }
.cx-media { display: block; max-width: 240px; max-height: 240px; border-radius: 10px; margin-top: 6px; }
.cx-note { align-self: flex-end; max-width: min(560px, 80%); background: #fef9c3; color: #713f12; border: 1px solid #fde68a; border-radius: 14px; padding: 9px 14px; }
.cx-event { align-self: center; display: flex; gap: 12px; align-items: flex-start; width: min(560px, 92%); padding: 10px 14px; border: 1px dashed var(--line); border-radius: 14px; background: var(--panel); }
.cx-composer { border-top: 1px solid var(--line); padding: 10px 14px 12px; display: grid; gap: 8px; background: var(--panel); }
.cx-composer.note { background: #fefce8; } .cx-composer.note textarea { background: #fffef5; }
.cx-composer textarea { resize: vertical; min-height: 64px; max-height: 40vh; }
.cx-pop { position: absolute; left: 8px; bottom: calc(100% + 4px); z-index: 5; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 4px; display: grid; min-width: 240px; }
.cx-pop button { text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 8px; cursor: pointer; font: 14px Poppins, sans-serif; color: var(--ink); } .cx-pop button:hover, .cx-pop button:focus { background: var(--sunken); }
.cx-side { border-left: 1px solid var(--line); padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.cx-side-h { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.cx-other { gap: 8px; padding: 5px 0; color: var(--ink-2); text-decoration: none !important; }
.cx-ch { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
.cx-url { display: block; max-width: 460px; padding: 4px 8px; background: var(--sunken); border-radius: 6px; }
.linkbtn { border: 0; background: none; color: var(--brand); cursor: pointer; padding: 0; font: inherit; }
.app > .content:has(> .cx) { max-width: 1680px; }
@media (max-width: 1480px) { .cx-thread { grid-template-columns: minmax(0, 1fr); } .cx-side { display: none; } }
@media (max-width: 1220px) { .cx { grid-template-columns: 330px minmax(0, 1fr); } .cx-rail { display: none; } .cx-rail-select { display: block; } }
@media (max-width: 900px) {
  .cx { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 150px); border-radius: 14px; }
  .cx.has-thread .cx-list { display: none; } .cx:not(.has-thread) .cx-thread { display: none; }
  .cx-back { display: inline-flex; } .cx-actions { width: 100%; } .cx-actions .input { flex: 1; max-width: none; }
  .cx-row, .cx-row:hover { grid-template-columns: 0 40px minmax(0, 1fr); } .cx-rows:has(.checked) .cx-row { grid-template-columns: 18px 40px minmax(0, 1fr); }
}
:root[data-theme="dark"] .cx-note { background: #422006; color: #fef3c7; border-color: #713f12; }
:root[data-theme="dark"] .cx-composer.note, :root[data-theme="dark"] .cx-composer.note textarea { background: #1c1917; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cx-note { background: #422006; color: #fef3c7; border-color: #713f12; } :root:not([data-theme="light"]) .cx-composer.note, :root:not([data-theme="light"]) .cx-composer.note textarea { background: #1c1917; } }

.nav-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; line-height: 1; }

/* Header: Help and Search are icons (with labels for screen readers); Home is the house icon. */
.appbar .iconbtn .hide-sm, .iconbtn.search span, .iconbtn.search kbd { display: none; }
.navlink.home-link { padding: 8px 10px; } .navlink.home-link .ico { display: block; }
.cx-th > .grow { flex: 1 1 220px; min-width: 180px; }
.cx-th .cx-actions { flex: 0 1 auto; }
@media (max-width: 900px) {
  .cx { height: auto; min-height: 0; overflow: visible; }
  .cx-list, .cx-thread, .cx-conv { min-height: 0; }
  .cx-rows { max-height: none; overflow: visible; }
  .cx-msgs { min-height: 52vh; max-height: 64vh; padding: 12px; }
  .cx-th { padding: 8px 10px; gap: 6px; }
  .cx-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .cx-actions .input { width: 100%; max-width: none; }
  .cx-composer { position: sticky; bottom: 0; z-index: 2; padding: 8px 10px 10px; box-shadow: 0 -6px 16px -12px rgba(15,23,42,.35); }
  .cx-composer select.input.sm { width: auto; max-width: 52%; }
  .cx-composer > .small.muted:last-child { display: none; }
}

/* ══ Data tables ═══════════════════════════════════════════════════════════ */
.dt { display: grid; gap: 10px; min-width: 0; }
.dt-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dt-tools { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; justify-content: center; }
.dt-search { width: 200px; margin-left: auto; }
.dt-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.dt-table th.dt-sortable { cursor: pointer; user-select: none; } .dt-table th.dt-sortable:hover { color: var(--ink); }
.dt-arrow { margin-left: 6px; font-size: 10px; opacity: .45; }
.dt-table td { padding: 10px 14px; } .dt-table th { padding: 10px 14px; }
.dt-table tr.clickable { cursor: pointer; } .dt-table tr.clickable:hover td { background: var(--brand-softer, var(--panel-2)); }
.dt-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.dt-cols { min-width: 220px; max-height: 320px; overflow-y: auto; padding: 8px 12px; }
.dropdown button[role="menuitem"] { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 11px; color: var(--ink-2); border: 0; background: none; font: inherit; text-align: left; cursor: pointer; width: 100%; }
.dropdown button[role="menuitem"]:hover { background: var(--sunken); color: var(--ink); }
@media (max-width: 700px) { .dt-tools { justify-content: flex-start; order: 3; flex-basis: 100%; } .dt-search { width: 100%; margin-left: 0; order: 2; } }

/* ══ Projects ═════════════════════════════════════════════════════════════ */
.pm-sub { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pm-tabs { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 4px; overflow-x: auto; }
.pm-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 10px; color: var(--ink-2); font-weight: 500; font-size: 14px; white-space: nowrap; text-decoration: none !important; }
.pm-tabs a:hover { background: var(--sunken); } .pm-tabs a.on { background: var(--grad); color: #fff; }
.pm-timer { margin-left: auto; display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.pm-dot { width: 9px; height: 9px; border-radius: 50%; background: #ef4444; flex: none; display: inline-block; }
.pm-timer .pm-dot { animation: pm-pulse 1.4s infinite; }
@keyframes pm-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .pm-timer .pm-dot { animation: none; } }
.tnum { font-variant-numeric: tabular-nums; }
.pm-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.pm-stat { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); text-align: left; cursor: pointer; font: inherit; color: inherit; }
.pm-stat.on { outline: 2px solid var(--brand); }
.pm-stat-ic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; font-weight: 800; font-size: 18px; flex: none; }
.pm-stat-k { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--mute); }
.pm-stat-v { font-size: 22px; }
.pm-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; align-items: end; }
.pm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.pm-card { --pc: var(--brand); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--panel); display: flex; flex-direction: column; box-shadow: var(--shadow-sm); }
.pm-card header { display: flex; align-items: center; gap: 8px; padding: 14px 16px; background: linear-gradient(120deg, var(--pc), color-mix(in srgb, var(--pc) 55%, #0891b2)); color: #fff; }
.pm-card header a { color: #fff; font-weight: 600; font-size: 17px; text-decoration: none !important; }
.pm-act { border: 0; background: rgba(255,255,255,.16); color: #fff; font: 500 13px Poppins, sans-serif; padding: 5px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; } .pm-act:hover { background: rgba(255,255,255,.28); }
.pm-card-b { display: grid; gap: 6px; padding: 14px 16px; color: var(--ink-2); font-size: 14px; text-decoration: none !important; flex: 1; }
.pm-card-b > div { display: flex; align-items: center; gap: 8px; } .pm-card-b .ico { color: var(--mute); flex: none; }
.pm-card footer { padding: 10px 16px 14px; border-top: 1px solid var(--line-2); display: grid; gap: 8px; }
.pm-progress { height: 6px; border-radius: 999px; background: var(--sunken); overflow: hidden; } .pm-progress.lg { height: 9px; }
.pm-progress i { display: block; height: 100%; background: var(--grad); border-radius: inherit; }
.pm-avs { display: inline-flex; } .pm-avs .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--panel); } .pm-avs .avatar:first-child { margin-left: 0; }
.pm-pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); white-space: nowrap; }
.pm-pill.solid { background: var(--c); color: #fff; }
.pm-ref { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; color: #be123c; font-weight: 600; }
.pm-status-sel { width: auto; min-width: 130px; border-color: color-mix(in srgb, var(--c) 45%, var(--line)); color: var(--c); font-weight: 600; }
.dt-table tr.pm-done td { opacity: .62; }
.pm-board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.pm-col { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px; min-height: 180px; display: flex; flex-direction: column; gap: 8px; transition: outline-color .15s; outline: 2px dashed transparent; }
.pm-col.over { outline-color: var(--brand); background: var(--brand-soft); }
.pm-col h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 2px 4px; } .pm-col h3 .muted { margin-left: auto; font-weight: 500; }
.pm-col-b { display: grid; gap: 8px; align-content: start; flex: 1; }
.pm-col-empty { border: 1px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center; }
.pm-drag { position: relative; } .pm-drag[draggable="true"] { cursor: grab; }
.pm-mini { display: grid; gap: 6px; width: 100%; padding: 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); text-align: left; font: inherit; color: var(--ink); cursor: pointer; text-decoration: none !important; box-shadow: var(--shadow-sm); }
.pm-mini:hover { border-color: var(--brand); }
.pm-move { position: absolute; top: 6px; right: 6px; opacity: 0; width: 26px; height: 26px; cursor: pointer; }
@media (hover: none) { .pm-move { opacity: 1; width: 110px; height: auto; position: static; margin-top: 6px; font: 12px Poppins, sans-serif; border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: var(--panel); color: var(--ink); } }
.pm-head { --pc: var(--brand); border-top: 4px solid var(--pc); }
.pm-count { text-align: left; font: inherit; color: inherit; cursor: pointer; display: grid; gap: 2px; }
.pm-drawer { width: min(640px, 100vw); padding: 20px; }
.pm-title { font-size: 19px; font-weight: 600; border-color: transparent; padding-left: 4px; } .pm-title:hover, .pm-title:focus { border-color: var(--line); }
.pm-comment { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.pm-plan { padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
@media (max-width: 1100px) { .pm-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .pm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pm-timer { margin-left: 0; width: 100%; } .pm-board { grid-template-columns: repeat(5, 78vw); scroll-snap-type: x mandatory; } .pm-col { scroll-snap-align: start; } }
.pm-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; min-width: 0; }
.pm-card header { align-items: flex-start; }
@media (max-width: 640px) { .card-h { flex-wrap: wrap; row-gap: 8px; } .card-h > h2.grow { flex-basis: 100%; } }

/* Uploaded or platform logos sit on white, uncropped (the mark is not a filled square). */
.logo-mark.has-img { background: #fff; box-shadow: 0 0 0 1px rgba(15,23,42,.08); }
.logo-mark.has-img img { object-fit: contain; }
