/* CRM design system. Tokens first; components below. --accent is set per business at runtime. */
:root {
  --accent: #2b59ff;
  --accent-soft: color-mix(in srgb, var(--accent) 10%, white);
  --accent-ink: color-mix(in srgb, var(--accent) 80%, black);
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --border: #e3e7f0;
  --border-strong: #cdd4e2;
  --ink: #101010;
  --ink-2: #2d323c;
  --muted: #5d6474;
  --faint: #98a0b1;
  --good: #16a34a;
  --good-soft: #dcfce7;
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --bad: #dc2626;
  --bad-soft: #fee2e2;
  --info-soft: #e8ecf5;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, .15);
  --sidebar-w: 232px;
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --display: 'Unbounded', 'Manrope', system-ui, sans-serif;
  --cloud: #e8ecf5;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0 0 8px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
::selection { background: var(--accent-soft); }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 24px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 20; }
.topbar .search { flex: 1; max-width: 420px; }
.content { padding: 24px; flex: 1; min-width: 0; }
.content.flush { padding: 0; }
.menu-btn { display: none; }

.biz-switch { margin: 12px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); display: flex; align-items: center; gap: 10px; cursor: pointer; background: var(--surface); text-align: left; font: inherit; color: inherit; width: calc(100% - 24px); }
.biz-switch:hover { background: var(--surface-2); }
.biz-switch.static { cursor: default; }
.biz-switch.static:hover { background: var(--surface); }
.biz-mark.has-logo { background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.biz-mark.has-logo img { width: 100%; height: 100%; object-fit: contain; }
.biz-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.biz-name { font-weight: 600; font-size: 13px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.biz-sub { font-size: 11.5px; color: var(--muted); }

.nav { padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 1px; }
.nav-group { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent-ink); }
.nav a .count { margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; border-radius: 99px; padding: 0 7px; line-height: 18px; }
.nav svg { width: 17px; height: 17px; flex: none; }
.sidebar-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.user-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }

/* ---------- page header ---------- */
.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; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }

/* ---------- cards + grids ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { font-size: 14px; }
.card-body { padding: 16px; }
.card-body.tight { padding: 8px 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 600; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }

/* KPI tiles */
.kpi { padding: 16px; }
.kpi .label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi .value { font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.kpi.dark .label, .kpi.dark .hint { color: #cbd5e1; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); }
.btn.danger { color: var(--bad); border-color: #fecaca; }
.btn.danger:hover { background: var(--bad-soft); }
.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.icon { width: 34px; padding: 0; }
.btn.sm.icon { width: 28px; }
.btn svg { width: 16px; height: 16px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label, .label-text { font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
.field .help { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; outline: none; transition: border-color .12s, box-shadow .12s; }
textarea.input { height: auto; min-height: 90px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.sm { height: 28px; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.search-input { position: relative; }
.search-input svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--faint); }
.search-input .input { padding-left: 32px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.table .check-col { width: 36px; }

/* ---------- badges, tags, avatars ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border); white-space: nowrap; }
.badge.good { background: var(--good-soft); color: #166534; border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: #92400e; border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: #991b1b; border-color: transparent; }
.badge.info { background: var(--info-soft); color: #3730a3; border-color: transparent; }
.badge.accent { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 5px; font-size: 12px; font-weight: 550; color: var(--ink-2); background: color-mix(in srgb, var(--tag, #64748b) 12%, white); border: 1px solid color-mix(in srgb, var(--tag, #64748b) 25%, white); }
.tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--tag, #64748b); }
.tag button { border: 0; background: none; padding: 0 0 0 2px; cursor: pointer; color: var(--muted); font-size: 14px; line-height: 1; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-weight: 650; font-size: 12px; flex: none; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; flex: none; }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item.clickable { cursor: pointer; }
.list-item.clickable:hover { background: var(--surface-2); }

/* timeline */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.tl-item:last-child { border-bottom: 0; }
.tl-icon { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; color: var(--muted); }
.tl-icon svg { width: 14px; height: 14px; }
.tl-title { font-weight: 550; }
.tl-meta { font-size: 12px; color: var(--muted); }
.tl-body { margin-top: 4px; white-space: pre-wrap; color: var(--ink-2); background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button, .tabs a { border: 0; background: none; font: inherit; font-weight: 550; color: var(--muted); padding: 9px 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.tabs .active { color: var(--ink); border-bottom-color: var(--accent); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px; gap: 2px; }
.seg button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 550; color: var(--muted); padding: 4px 10px; border-radius: 4px; cursor: pointer; }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- empty + loading ---------- */
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; font-size: 15px; }
.empty .btn { margin-top: 12px; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.skeleton { background: linear-gradient(90deg, #eef0f3 0%, #f6f7f9 50%, #eef0f3 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 6px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- modal, toast, menu ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .4); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .12s; }
.modal { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; animation: pop .14s; }
.modal.wide { max-width: 820px; }
.modal.xl { max-width: 1100px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(6px) scale(.98); opacity: 0; } }
.toasts { position: fixed; bottom: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow-lg); font-size: 13.5px; max-width: 360px; animation: pop .14s; }
.toast.bad { background: var(--bad); }
.toast.good { background: #166534; }
.menu { position: absolute; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 4px; min-width: 200px; z-index: 150; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 8px; text-align: left; border: 0; background: none; font: inherit; color: var(--ink); padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.menu button:hover, .menu a:hover { background: var(--surface-2); text-decoration: none; }
.menu .sep { height: 1px; background: var(--border); margin: 4px 0; }

.banner { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.banner.warn { background: var(--warn-soft); color: #78350f; }
.banner.info { background: var(--info-soft); color: #312e81; }
.banner.bad { background: var(--bad-soft); color: #7f1d1d; }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* ---------- kanban ---------- */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.k-col { flex: 0 0 272px; background: #eef0f3; border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 230px); }
.k-col-head { padding: 10px 12px; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.k-col-head .sum { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 12px; }
.k-col-body { padding: 0 8px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.k-col-body.drop { background: var(--accent-soft); border-radius: 8px; }
.k-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; cursor: grab; box-shadow: var(--shadow); }
.k-card:active { cursor: grabbing; }
.k-card.dragging { opacity: .4; }
.k-card .t { font-weight: 600; font-size: 13px; }
.k-card .s { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- email builder ---------- */
.builder { display: grid; grid-template-columns: 200px 1fr 300px; gap: 16px; align-items: start; }
.palette .p-item { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px dashed var(--border-strong); border-radius: 8px; background: var(--surface); cursor: grab; font-weight: 550; margin-bottom: 8px; }
.canvas { background: #eceef2; border-radius: var(--radius); padding: 24px 16px; min-height: 480px; }
.canvas-inner { max-width: 600px; margin: 0 auto; background: #fff; border-radius: 8px; min-height: 400px; padding: 12px 0; }
.blk { position: relative; padding: 4px 32px; border: 2px solid transparent; cursor: pointer; }
.blk:hover { border-color: color-mix(in srgb, var(--accent) 35%, white); }
.blk.selected { border-color: var(--accent); }
.blk .blk-tools { position: absolute; right: 4px; top: 4px; display: none; gap: 2px; }
.blk:hover .blk-tools, .blk.selected .blk-tools { display: flex; }
.drop-line { height: 4px; margin: 0 32px; border-radius: 2px; background: var(--accent); }
.preview-frame { width: 100%; border: 0; background: #fff; border-radius: 8px; min-height: 560px; }

/* ---------- automation builder ---------- */
.flow { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 24px 8px; }
.flow-node { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; cursor: pointer; }
.flow-node:hover { border-color: var(--accent); }
.flow-node.trigger { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, white); }
.flow-node .k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.flow-link { width: 2px; height: 22px; background: var(--border-strong); }
.flow-add { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.flow-add:hover { border-color: var(--accent); color: var(--accent); }
.flow-branches { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; }
.flow-branch { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 8px; display: flex; flex-direction: column; align-items: center; }
.flow-branch .bl { font-size: 12px; font-weight: 600; margin-bottom: 6px; }

/* ---------- conversations ---------- */
.inbox { display: grid; grid-template-columns: 340px 1fr; height: calc(100vh - 56px); }
.inbox-list { border-right: 1px solid var(--border); background: var(--surface); overflow-y: auto; }
.inbox-thread { display: flex; flex-direction: column; min-width: 0; }
.bubble { max-width: 680px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); white-space: pre-wrap; }
.bubble.out { align-self: flex-end; background: var(--accent-soft); border-color: transparent; }

/* ---------- charts (simple CSS/SVG) ---------- */
.hbar { display: grid; grid-template-columns: 140px 1fr 70px; gap: 10px; align-items: center; font-size: 13px; padding: 4px 0; }
.spark { width: 100%; height: 120px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .builder { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 90; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .18s; box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar { transform: none; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .inbox { grid-template-columns: 1fr; }
  .inbox.has-thread .inbox-list { display: none; }
  .inbox:not(.has-thread) .inbox-thread { display: none; }
}
@media (max-width: 520px) {
  .topbar > .btn:last-child, .topbar > .spacer { display: none; }
  .topbar .search { max-width: none; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .kpi .value { font-size: 22px; }
}

/* ---------- charts (js/charts.js) ---------- */
:root { --ch-1: var(--accent); --ch-2: #0fa3a3; --ch-3: #e8a33d; --ch-4: #8b5cf6; --ch-5: #e8604c; --ch-6: #8a93a6; }
.ch-wrap { width: 100%; }
.ch { width: 100%; height: auto; display: block; overflow: visible; }
.ch-grid { stroke: var(--border); stroke-dasharray: 2 4; }
.ch-base { stroke: var(--border-strong); }
.ch-tick { fill: var(--muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.ch-bar { fill: color-mix(in srgb, var(--accent) 38%, var(--surface)); transition: fill .15s; }
.ch-bar:hover, .ch-bar-now { fill: var(--accent); }
.ch-area { fill: color-mix(in srgb, var(--accent) 12%, transparent); }
.ch-line { fill: none; stroke: var(--accent); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.ch-line.s2 { stroke: var(--ch-2); }
.ch-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.ch-dot.s2 { fill: var(--ch-2); }
.ch-hit { fill: transparent; }
.ch-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.ch-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ch-key { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); display: inline-block; flex: none; }
.ch-key.s2 { background: var(--ch-2); }
.ch-donut-wrap { display: grid; grid-template-columns: 150px 1fr; gap: 20px; align-items: center; }
.ch-donut { width: 150px; height: 150px; }
.ch-donut-track { fill: none; stroke: var(--surface-2); stroke-width: 18; }
.ch-seg { fill: none; stroke-width: 18; }
.ch-donut-n { font: 700 20px var(--font); fill: var(--ink); }
.ch-donut-l { font: 11px var(--font); fill: var(--muted); }
.ch-dlegend { display: grid; gap: 8px; font-size: 13px; min-width: 0; }
.ch-dlegend .row { gap: 8px; }
.c1 { stroke: var(--ch-1); } .c2 { stroke: var(--ch-2); } .c3 { stroke: var(--ch-3); } .c4 { stroke: var(--ch-4); } .c5 { stroke: var(--ch-5); } .c6 { stroke: var(--ch-6); }
.ch-key.c1 { background: var(--ch-1); } .ch-key.c2 { background: var(--ch-2); } .ch-key.c3 { background: var(--ch-3); } .ch-key.c4 { background: var(--ch-4); } .ch-key.c5 { background: var(--ch-5); } .ch-key.c6 { background: var(--ch-6); }
.ch-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.ch-head .big { font: 600 22px var(--display); letter-spacing: -.01em; }
@media (max-width: 560px) { .ch-donut-wrap { grid-template-columns: 1fr; justify-items: center; } .ch-dlegend { width: 100%; } }
