/* AI CallFlow — design tokens, reset and shared components.
   Hand-written, no build step. Brand colours come from Site settings (injected in partials/head). */

/* ============================================================ tokens */
:root {
  --brand: #10B981;
  --brand-2: #34D399;
  --ink: #04150F;

  --bg: #F4F6FB;
  --surface: #FFFFFF;
  --surface-2: #F8F9FD;
  --surface-3: #EEF1F7;
  --border: #E3E7F0;
  --border-strong: #D2D8E4;
  --text: #0E1428;
  --text-2: #3F4863;
  --muted: #69718C;
  --muted-2: #9AA2B8;

  --green: #16A34A;  --green-bg: #E7F7EE;  --green-line: #BFE8CF;
  --red: #E5484D;    --red-bg: #FDECEC;    --red-line: #F6C6C8;
  --amber: #C27803;  --amber-bg: #FEF4E2;  --amber-line: #F7DBA8;
  --orange: #E2590F; --orange-bg: #FFEDE1; --orange-line: #F8CDB0;
  --blue: #2563EB;   --blue-bg: #EAF1FE;   --blue-line: #C5D7FB;
  --violet: #7C3AED; --violet-bg: #F2EBFE; --violet-line: #DCCBFB;
  --teal: #0D9488;   --teal-bg: #E1F5F2;   --teal-line: #A9E4DC;
  --mint: #34D399;   --mint-bg: #E8FAF1;   --mint-line: #B7EDD5;
  --gray: #5B6478;   --gray-bg: #EFF1F5;   --gray-line: #DDE1E9;

  --brand-soft: color-mix(in srgb, var(--brand) 9%, #fff);
  --brand-soft-2: color-mix(in srgb, var(--brand) 16%, #fff);
  --brand-line: color-mix(in srgb, var(--brand) 28%, #fff);
  --brand-strong: color-mix(in srgb, var(--brand) 82%, #000);
  --accent-soft: color-mix(in srgb, var(--brand-2) 12%, #fff);
  --grad: linear-gradient(135deg, var(--brand) 0%, color-mix(in srgb, var(--brand) 45%, var(--brand-2)) 58%, var(--brand-2) 125%);
  --grad-soft: linear-gradient(135deg, color-mix(in srgb, var(--brand) 10%, #fff), color-mix(in srgb, var(--brand-2) 10%, #fff));

  --r-sm: 8px;
  --r: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --sh-1: 0 1px 2px rgba(16, 24, 48, .05);
  --sh-2: 0 1px 2px rgba(16, 24, 48, .04), 0 8px 24px -10px rgba(16, 24, 48, .12);
  --sh-3: 0 24px 60px -18px rgba(16, 24, 48, .28);
  --ring: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);

  --font: "Plus Jakarta Sans", "Hind Siliguri", "Noto Sans Bengali", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-bn: "Hind Siliguri", "Noto Sans Bengali", "Plus Jakarta Sans", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

[data-theme="dark"] {
  /* Sampled from the SKO control panel: a teal-leaning green ground with cards a clear
     step lighter, washed with a diagonal gradient rather than filled flat. */
  --bg: #03201C;
  --surface: #093430;
  --surface-2: #062924;
  --surface-3: #0D3E38;
  --border: #104A42;
  --border-strong: #17635A;
  --text: #E6F4F0;
  --text-2: #B0D3CA;
  --muted: #7AA69C;
  --muted-2: #4E786F;

  --green: #4ADE80;  --green-bg: rgba(74, 222, 128, .13);  --green-line: rgba(74, 222, 128, .3);
  --red: #F87171;    --red-bg: rgba(248, 113, 113, .12);   --red-line: rgba(248, 113, 113, .3);
  --amber: #FBBF24;  --amber-bg: rgba(251, 191, 36, .12);  --amber-line: rgba(251, 191, 36, .28);
  --orange: #FB923C; --orange-bg: rgba(251, 146, 60, .13); --orange-line: rgba(251, 146, 60, .3);
  --blue: #60A5FA;   --blue-bg: rgba(96, 165, 250, .13);   --blue-line: rgba(96, 165, 250, .3);
  --violet: #A78BFA; --violet-bg: rgba(167, 139, 250, .14); --violet-line: rgba(167, 139, 250, .3);
  --teal: #2DD4BF;   --teal-bg: rgba(45, 212, 191, .13);   --teal-line: rgba(45, 212, 191, .3);
  --mint: #A7F3D0;   --mint-bg: rgba(167, 243, 208, .12);  --mint-line: rgba(167, 243, 208, .26);
  --gray: #9DBCAE;   --gray-bg: rgba(157, 188, 174, .1);   --gray-line: rgba(157, 188, 174, .22);

  --brand-soft: color-mix(in srgb, var(--brand) 16%, #093430);
  --brand-soft-2: color-mix(in srgb, var(--brand) 26%, #093430);
  --brand-line: color-mix(in srgb, var(--brand) 45%, #093430);
  --brand-strong: color-mix(in srgb, var(--brand) 70%, #fff);
  --accent-soft: color-mix(in srgb, var(--brand-2) 16%, #093430);
  --grad-soft: linear-gradient(135deg, color-mix(in srgb, var(--brand) 18%, #0A3733), color-mix(in srgb, var(--brand-2) 14%, #0A3733));

  /* Panels sit on the ground as a gentle wash rather than a flat block. */
  --panel: linear-gradient(150deg, #0F453E 0%, #0A3733 46%, #072C28 100%);
  --panel-2: linear-gradient(150deg, #0D3E38 0%, #06251F 100%);

  --sh-1: 0 1px 2px rgba(0, 0, 0, .35);
  --sh-2: 0 1px 2px rgba(0, 0, 0, .35), 0 14px 34px -16px rgba(0, 0, 0, .7);
  --sh-3: 0 30px 70px -20px rgba(0, 0, 0, .75);
  color-scheme: dark;
}

/* The gradient wash only exists in the dark theme; light stays flat and paper-like. */
[data-theme="dark"] .card,
[data-theme="dark"] .stat:not(.stat-hero),
[data-theme="dark"] .post,
[data-theme="dark"] .content-card,
[data-theme="dark"] .creative-card { background: var(--panel); }
[data-theme="dark"] .card-foot,
[data-theme="dark"] .card-footer,
[data-theme="dark"] .form-actions { background: rgba(3, 32, 28, .55); }
[data-theme="dark"] body { background-image: radial-gradient(1100px 540px at 78% -14%, rgba(20, 184, 166, .18), transparent 62%); background-attachment: fixed; }
[data-theme="dark"] .topbar { background: color-mix(in srgb, #03201C 86%, transparent); }

/* ============================================================ reset & type */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.55; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
:lang(bn) body, [lang="bn"] { font-family: var(--font-bn); }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-strong); }
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.25; letter-spacing: -.012em; font-weight: 700; color: var(--text); }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
code, kbd, pre { font-family: var(--mono); font-size: .92em; }
code { background: var(--surface-3); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; color: var(--text-2); word-break: break-word; }
kbd { background: var(--surface); border: 1px solid var(--border-strong); border-bottom-width: 2px; padding: 0 6px; border-radius: 6px; font-size: 11px; color: var(--muted); }
::selection { background: color-mix(in srgb, var(--brand) 22%, transparent); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

/* ============================================================ icons */
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }
.icon-xs { width: 13px; height: 13px; }
.icon-lg { width: 22px; height: 22px; }
.icon-xl { width: 28px; height: 28px; }

/* ============================================================ utilities */
.flex { display: flex; } .inline-flex { display: inline-flex; } .grid { display: grid; }
.items-center { align-items: center; } .items-start { align-items: flex-start; } .items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; } .justify-center { justify-content: center; } .justify-end { justify-content: flex-end; }
.wrap { flex-wrap: wrap; } .flex-1, .grow { flex: 1 1 auto; min-width: 0; } .shrink-0 { flex-shrink: 0; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-5 { gap: 20px; } .gap-6 { gap: 24px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-5 { margin-top: 20px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.ml-auto { margin-left: auto; }
.text-xs { font-size: 12px; } .text-sm { font-size: 13px; } .text-md { font-size: 15px; } .text-lg { font-size: 17px; } .text-xl { font-size: 20px; }
.text-center { text-align: center; } .text-right { text-align: right; }
.strong { font-weight: 650; color: var(--text); } .semibold { font-weight: 600; }
.muted { color: var(--muted); } .muted-2 { color: var(--muted-2); } .text-2 { color: var(--text-2); }
.text-brand { color: var(--brand); } .text-green { color: var(--green); } .text-red { color: var(--red); } .text-amber { color: var(--amber); } .text-blue { color: var(--blue); } .text-violet { color: var(--violet); } .text-orange { color: var(--orange); } .text-teal { color: var(--teal); } .text-mint { color: var(--mint); }
.mono { font-family: var(--mono); font-size: .92em; }
.tabular { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.w-full { width: 100%; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cols-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: minmax(0, 1fr); } .hide-sm { display: none !important; } }
@media (min-width: 721px) { .show-sm { display: none !important; } }

/* ============================================================ buttons */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--text); --btn-bd: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 15px;
  border-radius: var(--r); border: 1px solid var(--btn-bd); background: var(--btn-bg); color: var(--btn-fg);
  font-size: 13.5px; font-weight: 600; line-height: 1; white-space: nowrap; cursor: pointer; user-select: none;
  box-shadow: var(--sh-1); transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .15s;
}
.btn:hover { color: var(--btn-fg); border-color: color-mix(in srgb, var(--btn-bd) 70%, var(--text) 30%); background: color-mix(in srgb, var(--btn-bg) 94%, var(--text) 6%); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { --btn-bg: var(--brand); --btn-fg: #fff; --btn-bd: var(--brand); box-shadow: 0 1px 2px rgba(16, 24, 48, .12), inset 0 1px 0 rgba(255, 255, 255, .16); }
.btn-primary:hover { --btn-bg: var(--brand-strong); --btn-bd: var(--brand-strong); color: #fff; background: var(--brand-strong); }
.btn-grad { --btn-fg: #fff; background: var(--grad); border: 0; color: #fff; box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--brand) 70%, transparent); }
.btn-grad:hover { color: #fff; filter: brightness(1.06); background: var(--grad); }
.btn-soft { --btn-bg: var(--brand-soft); --btn-fg: var(--brand); --btn-bd: transparent; box-shadow: none; }
.btn-soft:hover { --btn-bg: var(--brand-soft-2); color: var(--brand); background: var(--brand-soft-2); }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; --btn-fg: var(--text-2); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--text); }
.btn-danger { --btn-bg: var(--red); --btn-fg: #fff; --btn-bd: var(--red); }
.btn-danger:hover { color: #fff; background: color-mix(in srgb, var(--red) 88%, #000); }
.btn-danger-ghost { --btn-bg: transparent; --btn-bd: transparent; --btn-fg: var(--red); box-shadow: none; }
.btn-danger-ghost:hover { background: var(--red-bg); border-color: transparent; color: var(--red); }
.btn-success { --btn-bg: var(--green); --btn-fg: #fff; --btn-bd: var(--green); }
.btn-success:hover { color: #fff; background: color-mix(in srgb, var(--green) 88%, #000); }
.btn-dark { --btn-bg: var(--ink); --btn-fg: #fff; --btn-bd: var(--ink); }
.btn-dark:hover { color: #fff; background: color-mix(in srgb, var(--ink) 85%, #fff); }
.btn-glass { --btn-bg: rgba(255, 255, 255, .08); --btn-fg: #fff; --btn-bd: rgba(255, 255, 255, .18); box-shadow: none; backdrop-filter: blur(8px); }
.btn-glass:hover { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .3); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; gap: 6px; }
.btn-sm .icon { width: 14px; height: 14px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 14.5px; }
.btn-xl { height: 52px; padding: 0 26px; font-size: 15.5px; border-radius: 12px; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-block { width: 100%; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-color: var(--btn-fg) transparent var(--btn-fg) transparent; animation: spin .7s linear infinite; }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================ forms */
.label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.req { color: var(--red); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-size: 14px; transition: border-color .15s, box-shadow .15s; box-shadow: var(--sh-1);
}
.textarea { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; min-height: 44px; }
.textarea.mono { font-family: var(--mono); font-size: 12.5px; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239AA2B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; cursor: pointer; }
.input:hover, .select:hover, .textarea:hover { border-color: color-mix(in srgb, var(--border-strong) 60%, var(--muted) 40%); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input[readonly], .textarea[readonly] { background: var(--surface-2); color: var(--text-2); }
.input-sm { height: 34px; font-size: 13px; }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
.input-icon > .input { padding-left: 34px; }
.input-group { display: flex; align-items: stretch; }
.input-group .addon { display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid var(--border-strong); border-right: 0; border-radius: var(--r) 0 0 var(--r); background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 600; }
.input-group .input { border-radius: 0 var(--r) var(--r) 0; }
.field { min-width: 0; }
.field.is-invalid .input, .field.is-invalid .select, .field.is-invalid .textarea { border-color: var(--red); }
.error-text { margin-top: 6px; font-size: 12.5px; color: var(--red); font-weight: 500; }
.hint { margin-top: 6px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px 16px; }
.form-grid > * { grid-column: span 12; }
.form-grid > .span-2 { grid-column: span 2; } .form-grid > .span-3 { grid-column: span 3; } .form-grid > .span-4 { grid-column: span 4; }
.form-grid > .span-5 { grid-column: span 5; } .form-grid > .span-6 { grid-column: span 6; } .form-grid > .span-7 { grid-column: span 7; }
.form-grid > .span-8 { grid-column: span 8; } .form-grid > .span-9 { grid-column: span 9; }
@media (max-width: 720px) { .form-grid > [class*="span-"] { grid-column: span 12; } }
.form-section { padding-top: 10px; margin-top: 4px; border-top: 1px dashed var(--border); }
.form-grid > .form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.form-section h3 { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.form-section h3::before { content: ""; width: 4px; height: 16px; border-radius: 4px; background: var(--grad); }
.form-section p { margin-top: 4px; font-size: 13px; color: var(--muted); max-width: 720px; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); position: sticky; bottom: 0; z-index: 2; }

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.check input, input.check { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text-2); user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--border-strong); transition: background .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease); }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }
.switch-sm .track { width: 32px; height: 18px; }
.switch-sm .track::after { width: 12px; height: 12px; }
.switch-sm input:checked + .track::after { transform: translateX(14px); }

.pill-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-picker label { position: relative; cursor: pointer; }
.pill-picker input { position: absolute; opacity: 0; }
.pill-picker span { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--text-2); transition: all .15s; }
.pill-picker input:checked + span { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); }
.pill-picker input:checked + span::before { content: "✓"; font-size: 12px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.perm-grid label { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); cursor: pointer; font-size: 12.5px; color: var(--muted); line-height: 1.4; transition: border-color .15s, background .15s; }
.perm-grid label:hover { border-color: var(--border-strong); }
.perm-grid label:has(input:checked) { border-color: var(--brand-line); background: var(--brand-soft); }
.perm-grid input { margin-top: 2px; accent-color: var(--brand); }
.color-field { display: flex; gap: 8px; }
.color-field input[type="color"] { width: 44px; height: 40px; padding: 3px; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface); cursor: pointer; }
.upload { display: flex; align-items: center; gap: 14px; }
.upload-preview { width: 64px; height: 64px; border-radius: 12px; border: 1px dashed var(--border-strong); background: var(--surface-2); display: grid; place-items: center; overflow: hidden; color: var(--muted-2); flex: none; }
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-meta { display: flex; flex-direction: column; gap: 6px; font-size: 13px; min-width: 0; }
.repeater { display: flex; flex-direction: column; gap: 8px; }
.repeater-row { display: flex; gap: 8px; align-items: center; }
.repeater-add { align-self: flex-start; }
.params-table { width: 100%; border-collapse: collapse; }
.params-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 0 6px 6px; }
.params-table td { padding: 4px; }
.reveal-wrap { position: relative; }
.reveal-wrap .input { padding-right: 44px; }
.reveal-wrap .btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.copy-field { display: flex; gap: 8px; }
.copy-field .input { font-family: var(--mono); font-size: 12.5px; }

/* segmented control */
.segmented { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-3); border: 1px solid var(--border); gap: 2px; }
.segmented button, .segmented a { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.segmented button:hover, .segmented a:hover { color: var(--text); }
.segmented .is-active { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }

/* ============================================================ cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); min-width: 0; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 20px; border-bottom: 1px solid var(--border); min-height: 56px; }
.card-header.plain { border-bottom: 0; padding-bottom: 4px; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 700; color: var(--text); }
.card-title .icon { color: var(--muted); }
.card-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 20px; }
.card-body.tight { padding: 16px; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.card-link { transition: border-color .15s, box-shadow .15s, transform .15s; }
.card-link:hover { border-color: var(--brand-line); box-shadow: var(--sh-2); }

/* ============================================================ badges & chips */
.badge {
  --b-fg: var(--gray); --b-bg: var(--gray-bg); --b-line: var(--gray-line);
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; line-height: 1; color: var(--b-fg); background: var(--b-bg); border: 1px solid var(--b-line); white-space: nowrap; vertical-align: middle;
}
.badge .icon { width: 12px; height: 12px; }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-lg { height: 26px; padding: 0 11px; font-size: 12.5px; }
.badge-green { --b-fg: var(--green); --b-bg: var(--green-bg); --b-line: var(--green-line); }
.badge-red { --b-fg: var(--red); --b-bg: var(--red-bg); --b-line: var(--red-line); }
.badge-amber { --b-fg: var(--amber); --b-bg: var(--amber-bg); --b-line: var(--amber-line); }
.badge-orange { --b-fg: var(--orange); --b-bg: var(--orange-bg); --b-line: var(--orange-line); }
.badge-blue { --b-fg: var(--blue); --b-bg: var(--blue-bg); --b-line: var(--blue-line); }
.badge-violet { --b-fg: var(--violet); --b-bg: var(--violet-bg); --b-line: var(--violet-line); }
.badge-brand { --b-fg: var(--brand); --b-bg: var(--brand-soft); --b-line: var(--brand-line); }
.badge-teal { --b-fg: var(--teal); --b-bg: var(--teal-bg); --b-line: var(--teal-line); }
.badge-mint { --b-fg: var(--mint); --b-bg: var(--mint-bg); --b-line: var(--mint-line); }
.badge-gray { --b-fg: var(--gray); --b-bg: var(--gray-bg); --b-line: var(--gray-line); }
.badge-solid { color: #fff; background: var(--brand); border-color: var(--brand); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 8px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.chip .icon { width: 13px; height: 13px; }
.chip-soft { background: var(--surface-2); height: 22px; font-size: 11.5px; padding: 0 7px; }

/* live dot */
.dot-live { position: relative; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--green); flex: none; }
.dot-live::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--green); opacity: 0; animation: pulse-ring 1.8s var(--ease) infinite; }
.dot-off { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted-2); flex: none; }
.dot-warn { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); flex: none; }
@keyframes pulse-ring { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }

/* voice waveform */
.wave { display: inline-flex; align-items: center; gap: 3px; height: 22px; }
.wave i { display: block; width: 3px; height: 100%; border-radius: 3px; background: currentColor; transform-origin: center; animation: wave 1.1s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: -.9s; } .wave i:nth-child(3) { animation-delay: -.7s; } .wave i:nth-child(4) { animation-delay: -.5s; } .wave i:nth-child(5) { animation-delay: -.3s; }
.wave i:nth-child(6) { animation-delay: -.15s; } .wave i:nth-child(7) { animation-delay: -.05s; }
.wave.is-idle i { animation: none; transform: scaleY(.25); opacity: .5; }
@keyframes wave { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }

/* ============================================================ avatars */
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--grad-soft); color: var(--brand); font-size: 12.5px; font-weight: 700; overflow: hidden; flex: none; border: 1px solid var(--brand-line); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 44px; height: 44px; font-size: 15px; }
.avatar-xl { width: 64px; height: 64px; font-size: 20px; }
.avatar-square { border-radius: 9px; }
.avatar-agent { background: var(--grad); color: #fff; border: 0; }

/* ============================================================ tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { position: sticky; top: 0; z-index: 1; text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); padding: 11px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th a { display: inline-flex; align-items: center; gap: 4px; color: inherit; }
.table th a:hover { color: var(--text); }
.table th.is-sorted { color: var(--text); }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-2); }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 70%, var(--brand-soft) 30%); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num, .table th.num { text-align: right; }
.table .center, .table th.center { text-align: center; }
.table-compact td { padding: 10px 16px; font-size: 13px; }
.table-compact th { padding: 9px 16px; }
.col-check { width: 44px; }
.col-actions { width: 1%; white-space: nowrap; text-align: right; }
.row-actions { display: flex; justify-content: flex-end; align-items: center; gap: 2px; }
.inline-form { display: inline; }
.cell-title { display: block; font-weight: 650; color: var(--text); }
a.cell-title:hover { color: var(--brand); }
.cell-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.table-thumb { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; border: 1px solid var(--border); background: var(--surface-2); }
tr.is-link { cursor: pointer; }

/* ============================================================ alerts */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: var(--r); border: 1px solid var(--gray-line); background: var(--gray-bg); color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
.alert > .icon { margin-top: 1px; color: var(--muted); }
.alert-title { font-weight: 700; color: var(--text); margin-bottom: 2px; }
.alert-brand { background: var(--brand-soft); border-color: var(--brand-line); } .alert-brand > .icon { color: var(--brand); }
.alert-success { background: var(--green-bg); border-color: var(--green-line); } .alert-success > .icon { color: var(--green); }
.alert-warning { background: var(--amber-bg); border-color: var(--amber-line); } .alert-warning > .icon { color: var(--amber); }
.alert-danger { background: var(--red-bg); border-color: var(--red-line); } .alert-danger > .icon { color: var(--red); }

/* ============================================================ meters */
.meter { position: relative; height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter > span { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--grad); transition: width .6s var(--ease); }
.meter.warn > span { background: var(--amber); }
.meter.full > span { background: var(--red); }

/* ============================================================ empty state */
.empty { text-align: center; padding: 56px 24px; }
.empty-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center; background: var(--grad-soft); color: var(--brand); border: 1px solid var(--brand-line); }
.empty-icon .icon { width: 24px; height: 24px; }
.empty h3 { font-size: 16px; }
.empty p { margin: 6px auto 0; max-width: 440px; color: var(--muted); font-size: 13.5px; }

/* ============================================================ pagination */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.pagination-links { display: flex; gap: 4px; }
.pagination-links a, .pagination-links span { display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px; font-weight: 600; color: var(--text-2); border: 1px solid transparent; }
.pagination-links a:hover { background: var(--surface-3); color: var(--text); }
.pagination-links .is-active { background: var(--brand); color: #fff; }
.pagination-links .is-disabled { color: var(--muted-2); }

/* ============================================================ dropdowns */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; min-width: 230px; padding: 6px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--sh-3); opacity: 0; transform: translateY(-4px) scale(.98); transform-origin: top right; pointer-events: none; transition: opacity .15s, transform .15s var(--ease); }
.dropdown-menu.left { left: 0; right: auto; transform-origin: top left; }
.dropdown.is-open > .dropdown-menu { opacity: 1; transform: none; pointer-events: auto; }
.dropdown-label { padding: 8px 10px 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted-2); }
.dropdown-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--text-2); text-align: left; }
.dropdown-item:hover { background: var(--surface-3); color: var(--text); }
.dropdown-item .icon { color: var(--muted); }
.dropdown-item.danger { color: var(--red); } .dropdown-item.danger .icon { color: var(--red); }
.dropdown-sep { height: 1px; margin: 6px 4px; background: var(--border); }

/* ============================================================ modals */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; background: rgba(8, 11, 24, .45); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .18s; overflow-y: auto; }
.modal.is-open { opacity: 1; pointer-events: auto; }
.modal-dialog { width: 100%; max-width: 480px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--sh-3); transform: translateY(8px) scale(.98); transition: transform .2s var(--ease); }
.modal.is-open .modal-dialog { transform: none; }
.modal-lg .modal-dialog { max-width: 720px; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 6px; }
.modal-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--red-bg); color: var(--red); margin-bottom: 12px; }
.modal-title { font-size: 16px; font-weight: 700; color: var(--text); }
.modal-body { padding: 10px 20px 18px; color: var(--text-2); font-size: 13.5px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 16px 16px; }

/* command palette */
.cmdk .modal-dialog { max-width: 560px; overflow: hidden; }
.cmdk-input { width: 100%; height: 54px; padding: 0 20px; border: 0; border-bottom: 1px solid var(--border); background: transparent; font-size: 15px; outline: none; }
.cmdk-list { max-height: 56vh; overflow-y: auto; padding: 6px; }
.cmdk-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 9px; color: var(--text-2); font-weight: 500; }
.cmdk-item small { font-size: 11.5px; color: var(--muted-2); }
.cmdk-item.is-active, .cmdk-item:hover { background: var(--brand-soft); color: var(--brand); }

/* ============================================================ toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 40px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--sh-3); font-size: 13.5px; color: var(--text); animation: toast-in .25s var(--ease); }
.toast > div { flex: 1; line-height: 1.45; }
.toast > .icon { margin-top: 1px; }
.toast-success > .icon { color: var(--green); } .toast-error > .icon { color: var(--red); } .toast-info > .icon { color: var(--blue); }
.toast button { color: var(--muted-2); padding: 2px; border-radius: 6px; }
.toast button:hover { color: var(--text); background: var(--surface-3); }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: all .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============================================================ code */
.code-block { border-radius: var(--r-lg); background: #04150F; border: 1px solid #0E3A2C; overflow: hidden; }
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; border-bottom: 1px solid #0E3A2C; color: #8FB3A3; font-size: 12px; font-weight: 600; }
.code-block pre, pre.code { margin: 0; padding: 16px; overflow-x: auto; color: #D6EEE2; font-size: 12.5px; line-height: 1.7; background: #04150F; }
.copy-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 6px; color: #A9CEBB; font-size: 12px; font-weight: 600; }
.copy-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }

/* key-value list */
.kv { display: grid; grid-template-columns: minmax(110px, auto) minmax(0, 1fr); gap: 10px 16px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text); font-weight: 550; min-width: 0; overflow-wrap: anywhere; }

/* prose (markdown pages & docs) */
.prose { color: var(--text-2); font-size: 15px; line-height: 1.75; }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: 22px; margin-top: 1.8em; color: var(--text); }
.prose h3 { font-size: 17px; margin-top: 1.5em; color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose blockquote { margin: 0; padding: 12px 16px; border-left: 3px solid var(--brand); background: var(--brand-soft); border-radius: 0 10px 10px 0; color: var(--text-2); }
.prose pre { position: relative; padding: 16px; border-radius: 12px; background: #04150F; color: #D6EEE2; overflow-x: auto; font-size: 13px; line-height: 1.65; }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 9px 12px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); color: var(--text); font-weight: 650; }
.prose hr { margin: 2em 0; }
.prose .copy-btn { position: absolute; top: 8px; right: 8px; }

@media print {
  .no-print, .site-header, .site-footer, .sidebar, .topbar, .toasts { display: none !important; }
  body { background: #fff; }
}
