/* ════════════════════════════════════════════════════════════════════
   AK Class — design system (under AK Solutions)
   Black and white primary palette with a deep teal accent (#196263),
   a light cyan tint (#a8f8f9), and a mid teal (#3cacae) for support.
   ════════════════════════════════════════════════════════════════════ */

:root {
  color-scheme: light;

  /* ── Surfaces — pure neutrals, three layers of depth ──────────────── */
  --canvas: #fafafa; /* app background */
  --surface: #ffffff; /* panels, cards */
  --surface-sunken: #f3f3f3; /* insets, sidebar, fills */
  --surface-hover: #ededed;

  /* ── Ink ──────────────────────────────────────────────────────────── */
  --ink-strong: #0a0a0a; /* headings, near-black */
  --ink: #1d1d1d; /* body text */
  --muted: #5e5e5e; /* secondary text (AA on surface) */
  --faint: #8a8a8a; /* meta, tertiary */
  --line: #e5e5e5; /* hairlines */
  --line-strong: #d4d4d4; /* stronger dividers, control borders */

  /* ── Accent — deep teal (brand) ───────────────────────────────────── */
  --accent: #196263;
  --accent-hover: #134a4b;
  --accent-press: #0f3a3b;
  --accent-mid: #3cacae; /* mid teal — secondary support */
  --accent-tint: #e8fafa; /* very light wash */
  --accent-tint-2: #a8f8f9; /* brand cyan — selection, soft fills */
  --on-accent: #ffffff;

  /* ── Dark surface — landing CTA, footer (mainly black) ────────────── */
  --ink-surface: #0a0a0a;
  --ink-surface-2: #1d1d1d;
  --on-ink: #ffffff;
  --on-ink-faint: #b0b0b0;

  /* ── Feedback ─────────────────────────────────────────────────────── */
  --success: #196263;
  --success-tint: #e8fafa;
  --danger: #b3261e;
  --danger-tint: #fdecea;
  --warning: #8a6b1f;
  --warning-tint: #fbf4dd;

  /* ── Focus ────────────────────────────────────────────────────────── */
  --ring: rgba(25, 98, 99, 0.34);

  /* ── Typography ───────────────────────────────────────────────────── */
  --font-display: "Bricolage Grotesque", "Hanken Grotesk", Georgia, serif;
  --font-sans:
    "Hanken Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* ── Radii ────────────────────────────────────────────────────────── */
  --r-xs: 6px;
  --r-sm: 9px;
  --r-md: 13px;
  --r-lg: 18px;
  --r-pill: 999px;

  /* ── Elevation — neutral, single light source from above ──────────── */
  --shadow-xs: 0 1px 2px rgba(10, 10, 10, 0.06);
  --shadow-sm:
    0 1px 2px rgba(10, 10, 10, 0.05), 0 3px 8px -3px rgba(10, 10, 10, 0.07);
  --shadow-md:
    0 1px 2px rgba(10, 10, 10, 0.05), 0 14px 30px -10px rgba(10, 10, 10, 0.13);
  --shadow-lg:
    0 2px 4px rgba(10, 10, 10, 0.06), 0 28px 56px -16px rgba(10, 10, 10, 0.2);

  /* ── Motion ───────────────────────────────────────────────────────── */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  /* ── Z-index scale ────────────────────────────────────────────────── */
  --z-appbar: 30;
  --z-scrim: 40;
  --z-sidebar: 50;
  --z-skip: 60;
  --z-grain: 1;
}

/* ── Dark mode tokens ─────────────────────────────────────────────────
   Applied when html[data-theme="dark"] OR the OS prefers dark and no
   explicit preference has been set (data-theme="light" opts out). */
:root[data-theme="dark"],
:root[data-theme="dark"] body {
  color-scheme: dark;
}
:root[data-theme="dark"] {
  --canvas: #0a0a0a;
  --surface: #161616;
  --surface-sunken: #1f1f1f;
  --surface-hover: #262626;

  --ink-strong: #fafafa;
  --ink: #e3e3e3;
  --muted: #9a9a9a;
  --faint: #6e6e6e;
  --line: #2a2a2a;
  --line-strong: #3a3a3a;

  --accent: #3cacae;
  --accent-hover: #4ec3c5;
  --accent-press: #5ed8da;
  --accent-mid: #a8f8f9;
  --accent-tint: rgba(60, 172, 174, 0.1);
  --accent-tint-2: rgba(60, 172, 174, 0.22);
  --on-accent: #0a0a0a;

  --ink-surface: #000000;
  --ink-surface-2: #1a1a1a;
  --on-ink: #fafafa;
  --on-ink-faint: #9a9a9a;

  --success: #4ec3c5;
  --success-tint: rgba(60, 172, 174, 0.14);
  --danger: #ff6b62;
  --danger-tint: rgba(255, 107, 98, 0.14);
  --warning: #d4a74f;
  --warning-tint: rgba(212, 167, 79, 0.14);

  --ring: rgba(60, 172, 174, 0.4);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 3px 8px -3px rgba(0, 0, 0, 0.55);
  --shadow-md:
    0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 30px -10px rgba(0, 0, 0, 0.6);
  --shadow-lg:
    0 2px 4px rgba(0, 0, 0, 0.45), 0 28px 56px -16px rgba(0, 0, 0, 0.7);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --canvas: #0a0a0a;
    --surface: #161616;
    --surface-sunken: #1f1f1f;
    --surface-hover: #262626;

    --ink-strong: #fafafa;
    --ink: #e3e3e3;
    --muted: #9a9a9a;
    --faint: #6e6e6e;
    --line: #2a2a2a;
    --line-strong: #3a3a3a;

    --accent: #3cacae;
    --accent-hover: #4ec3c5;
    --accent-press: #5ed8da;
    --accent-mid: #a8f8f9;
    --accent-tint: rgba(60, 172, 174, 0.1);
    --accent-tint-2: rgba(60, 172, 174, 0.22);
    --on-accent: #0a0a0a;

    --ink-surface: #000000;
    --ink-surface-2: #1a1a1a;
    --on-ink: #fafafa;
    --on-ink-faint: #9a9a9a;

    --success: #4ec3c5;
    --success-tint: rgba(60, 172, 174, 0.14);
    --danger: #ff6b62;
    --danger-tint: rgba(255, 107, 98, 0.14);
    --warning: #d4a74f;
    --warning-tint: rgba(212, 167, 79, 0.14);

    --ring: rgba(60, 172, 174, 0.4);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm:
      0 1px 2px rgba(0, 0, 0, 0.4), 0 3px 8px -3px rgba(0, 0, 0, 0.55);
    --shadow-md:
      0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 30px -10px rgba(0, 0, 0, 0.6);
    --shadow-lg:
      0 2px 4px rgba(0, 0, 0, 0.45), 0 28px 56px -16px rgba(0, 0, 0, 0.7);
  }
}

* {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  background: var(--canvas);
  scroll-behavior: smooth;
  scroll-padding-top: 60px;
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  font-feature-settings: "cv05", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Grain removed — was creating a thin band above the topbar on some browsers */

/* Solid header backdrops switch with theme */
:root[data-theme="dark"] {
  --topbar-bg: var(--surface);
  --appbar-bg: var(--canvas);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --topbar-bg: var(--surface);
    --appbar-bg: var(--canvas);
  }
}

/* Brand-mark switches in dark mode — default PNG is black, invert to render white.
   Exclude the footer mark, which already uses the white PNG. */
:root[data-theme="dark"] img.brand-mark:not(.brand-mark--keep),
:root[data-theme="dark"] img.auth-mark,
:root[data-theme="dark"] img.mockup-avatar,
:root[data-theme="dark"] img.chat-welcome-mark {
  filter: invert(1);
}
:root[data-theme="dark"] .sitefooter img.brand-mark {
  filter: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) img.brand-mark:not(.brand-mark--keep),
  :root:not([data-theme="light"]) img.auth-mark,
  :root:not([data-theme="light"]) img.mockup-avatar,
  :root:not([data-theme="light"]) img.chat-welcome-mark {
    filter: invert(1);
  }
  :root:not([data-theme="light"]) .sitefooter img.brand-mark {
    filter: none;
  }
}

::selection {
  background: var(--accent-tint-2);
  color: var(--accent-press);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--ink-strong);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 140ms var(--ease-out);
}
a:hover {
  color: var(--accent-hover);
}

p {
  margin: 0 0 0.85em;
}
strong {
  font-weight: 650;
  color: var(--ink-strong);
}
small,
.small {
  color: var(--muted);
  font-size: 13px;
}

code {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: 1.5px 6px;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

/* ─── Buttons ───────────────────────────────────────────────────────── */
button,
.button-link {
  appearance: none;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  color: var(--on-accent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  max-width: 100%;
  padding: 9px 17px;
  font: inherit;
  font-weight: 600;
  letter-spacing: -0.003em;
  white-space: nowrap;
  transition:
    background 150ms var(--ease-out),
    border-color 150ms var(--ease-out),
    color 150ms var(--ease-out),
    box-shadow 150ms var(--ease-out),
    transform 110ms var(--ease-out);
}

button:not(.channel-toggle):not(.tab-btn):hover,
.button-link:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--on-accent);
}

button:not(.channel-toggle):not(.tab-btn):active,
.button-link:active {
  background: var(--accent-press);
  border-color: var(--accent-press);
  transform: scale(0.974);
  transition-duration: 90ms;
}

button:disabled,
button[aria-disabled="true"],
.button-link[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}
button:disabled:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.button-secondary {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink-strong);
}
.button-secondary:hover {
  background: var(--surface-sunken);
  border-color: var(--accent);
  color: var(--accent-press);
}
.button-secondary:active {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--accent-press);
}

.small-button {
  min-height: 32px;
  padding: 5px 11px;
  font-size: 13.5px;
}

/* Inline / ghost buttons — quiet text actions inside lists & rows */
.inline-form {
  display: inline;
}
.inline-form button {
  background: transparent;
  border-color: transparent;
  color: var(--accent);
  min-height: 0;
  padding: 4px 7px;
  border-radius: var(--r-xs);
  font-weight: 600;
}
.inline-form button:hover {
  background: var(--accent-tint);
  border-color: transparent;
  color: var(--accent-press);
}
.inline-form button:active {
  transform: scale(0.96);
}

/* ─── Forms ─────────────────────────────────────────────────────────── */
input,
select,
textarea {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font: inherit;
  font-size: 14.5px;
  background: var(--surface);
  color: var(--ink-strong);
  transition:
    border-color 140ms var(--ease-out),
    box-shadow 140ms var(--ease-out),
    background 140ms var(--ease-out);
}
input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

input:hover:not(:focus),
select:hover:not(:focus),
textarea:hover:not(:focus) {
  border-color: oklch(0.8 0.01 82);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

textarea {
  resize: vertical;
  min-height: 84px;
  line-height: 1.5;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.5 1.75 6 6.25l4.5-4.5' stroke='%23737067' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}

input[type="file"] {
  appearance: auto;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  width: auto;
  min-width: 0;
  font-size: 13.5px;
}
input[type="file"]::file-selector-button {
  appearance: none;
  margin-right: 11px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xs);
  background: var(--surface-sunken);
  color: var(--ink-strong);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 140ms var(--ease-out),
    border-color 140ms var(--ease-out);
}
input[type="file"]::file-selector-button:hover {
  background: var(--accent-tint);
  border-color: var(--accent);
  color: var(--accent-press);
}

label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.002em;
  margin-bottom: 5px;
  color: var(--ink-strong);
}

/* Toggle — checkbox styled as a sliding switch */
input[type="checkbox"],
input[type="radio"] {
  flex: 0 0 auto;
  min-width: 0;
  padding: 0;
  width: auto;
}
input[type="radio"] {
  accent-color: var(--accent);
}
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 44px;
  height: 24px;
  min-width: 44px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background-color: var(--line-strong);
  background-image: radial-gradient(
    circle 8px at 12px 50%,
    #fff 99%,
    transparent 100%
  );
  background-repeat: no-repeat;
  background-position: 0 0;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition:
    background-color 170ms var(--ease-out),
    background-position 220ms var(--ease-out);
}
input[type="checkbox"]:checked {
  background-color: var(--accent);
  background-position: 20px 0;
}
input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}
input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.helptext {
  color: var(--muted);
  display: block;
  font-size: 12.5px;
  margin-top: 4px;
}
.helptext ul {
  margin: 4px 0 0;
  padding-left: 17px;
}

ul.errorlist {
  display: grid;
  gap: 2px;
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
}
ul.errorlist li {
  color: var(--danger);
  font-size: 12.5px;
  font-weight: 600;
}

.field-error {
  color: var(--danger);
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}

/* ─── Tables ────────────────────────────────────────────────────────── */
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 100%;
}
th,
td {
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}
thead th {
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: var(--surface-sunken);
  border-bottom-color: var(--line-strong);
}
tbody tr {
  transition: background 130ms var(--ease-out);
}
tbody tr:hover {
  background: var(--surface-sunken);
}
tbody tr:last-child td {
  border-bottom: 0;
}
td {
  font-size: 14px;
  color: var(--ink);
}
td strong {
  color: var(--ink-strong);
}
.row-actions {
  white-space: nowrap;
}
.row-actions a {
  font-weight: 600;
}
.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}
.panel .table-wrap {
  box-shadow: none;
}
td:has(.stat-value),
.num,
.tabular {
  font-variant-numeric: tabular-nums;
}

/* ─── Page frame & marketing top bar ────────────────────────────────── */
.topbar {
  background: var(--topbar-bg, var(--surface));
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
  margin: 0;
  padding: 0 30px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-appbar);
}
/* Push marketing pages down so content isn't hidden behind the fixed topbar.
   Body bg matches topbar so the strip above first-section content is invisible. */
body:not(.app-body) {
  padding-top: 60px;
  background: var(--surface);
}
/* Drop the main padding-top on non-app pages so content sits flush with the
   topbar's bottom border. Each page's content (auth-panel, error-panel,
   landing sections) carries its own breathing room via its own margin. */
body:not(.app-body) .page { padding-top: 0; }

.brand {
  color: var(--ink-strong);
  display: inline-flex;
  align-items: center;
  gap: 11px;
}
.brand-mark {
  display: block;
  flex: 0 0 auto;
  border-radius: 8px;
}
.brand-name {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.topbar nav a:hover .brand-name {
  color: inherit;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}
.topbar nav a {
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: var(--r-xs);
  transition:
    color 140ms var(--ease-out),
    background 140ms var(--ease-out);
}
.topbar nav a:hover {
  color: var(--ink-strong);
  background: var(--surface-sunken);
}
.topbar nav .inline-form button {
  font-size: 14px;
  padding: 8px 12px;
}

.page {
  padding: 32px 30px 56px;
}
.landing-body .page {
  max-width: none;
  padding: 0;
}
.narrow {
  max-width: 760px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 24px;
}
.page-head h1 {
  margin: 0 0 6px;
  font-size: clamp(28px, 4vw, 36px);
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.page-head p {
  margin: 0;
  color: var(--muted);
}

.page-lede {
  color: var(--muted);
  margin: 0 0 26px;
  font-size: 15.5px;
  max-width: 68ch;
}

.actions,
.hero-actions,
.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.quick-actions {
  margin-bottom: 22px;
}
.quick-actions .inline-form button {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink-strong);
  min-height: 38px;
  padding: 8px 15px;
  font-size: 14px;
  border-radius: var(--r-sm);
}
.quick-actions .inline-form button:hover {
  background: var(--surface-sunken);
  border-color: var(--accent);
  color: var(--accent-press);
}

.eyebrow,
.section-kicker {
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
  margin: 0 0 11px;
  text-transform: uppercase;
}

/* ─── Flash messages ────────────────────────────────────────────────── */
.messages {
  display: grid;
  gap: 9px;
  margin-bottom: 22px;
}
.message {
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-xs);
  color: var(--ink);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 11px 14px;
  font-size: 14px;
  transition:
    opacity 280ms var(--ease-out),
    transform 280ms var(--ease-out);
}
.message.success {
  background: var(--success-tint);
  border-color: oklch(0.82 0.05 162);
  color: var(--success);
}
.message.error {
  background: var(--danger-tint);
  border-color: oklch(0.83 0.06 32);
  color: var(--danger);
}
.message > span {
  flex: 1;
  min-width: 0;
}
.message > span strong {
  color: inherit;
}
@starting-style {
  .message {
    opacity: 0;
    transform: translateY(-6px);
  }
}
.message-close {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  min-height: 0;
  opacity: 0.55;
  padding: 0 2px;
}
.message-close:hover {
  background: transparent;
  opacity: 1;
  transform: none;
}

/* ─── Panels ────────────────────────────────────────────────────────── */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  padding: 22px 24px;
}
.panel h2,
.panel h3 {
  color: var(--ink-strong);
  margin-top: 0;
  letter-spacing: -0.018em;
}
.panel h2 {
  font-size: 17.5px;
  line-height: 1.3;
  margin-bottom: 4px;
}
.panel h3 {
  font-size: 14.5px;
}
.panel > h2 + p.small,
.panel > h2 + p.page-lede {
  margin-top: 0;
}

.panel-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 16px;
}
.panel-head h2 {
  margin: 0;
}
.panel-head a {
  font-size: 13px;
  font-weight: 600;
}
.panel-head .small {
  font-size: 13px;
}

.layout-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
  align-items: start;
}
.dashboard-columns {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.dashboard-column,
.admin-side-stack {
  align-content: start;
  display: grid;
  gap: 20px;
  min-width: 0;
}
.layout-two > *,
.stat-row > *,
.dashboard-columns > *,
.chat-layout > *,
.landing-grid > *,
.landing-story > *,
.landing-steps > * {
  min-width: 0;
}

.integration-box {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* ─── Stat strip — hairline-divided figures, not metric cards ───────── */
.stat-row {
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.stat-row.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.stat {
  background: var(--surface);
  min-width: 0;
  padding: 16px 18px 17px;
}
.stat-label {
  color: var(--muted);
  display: block;
  font-size: 12.5px;
  font-weight: 600;
}
.stat-value {
  align-items: baseline;
  color: var(--ink-strong);
  display: flex;
  flex-wrap: wrap;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  gap: 5px;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-top: 7px;
}
.stat-value .unit {
  color: var(--faint);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
}
.stat-value .dot {
  align-self: center;
}

/* ─── Status dot & pill ─────────────────────────────────────────────── */
.dot {
  border-radius: 50%;
  display: inline-block;
  height: 8px;
  width: 8px;
  margin-right: 6px;
  flex: 0 0 auto;
}
.dot-ok {
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-tint);
}
.dot-off {
  background: var(--faint);
  box-shadow: 0 0 0 3px var(--surface-sunken);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0 3px 3px 0;
  padding: 3px 10px;
  white-space: nowrap;
}
.status-pill.ok {
  background: var(--success-tint);
  border-color: oklch(0.85 0.05 162);
  color: var(--success);
}
.status-pill.danger {
  background: var(--danger-tint);
  border-color: oklch(0.86 0.06 32);
  color: var(--danger);
}
.status-pill.muted {
  background: var(--surface-sunken);
  border-color: var(--line-strong);
  color: var(--muted);
}

/* ─── Lists ─────────────────────────────────────────────────────────── */
.list-stack {
  display: grid;
  gap: 10px;
}
.panel .list-stack {
  margin-top: 4px;
}
.list-item {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  min-width: 0;
  padding: 13px 15px;
  background: var(--surface);
}
.list-item p {
  margin: 5px 0 0;
}
.list-item p.small {
  font-size: 13px;
}
.list-item > strong {
  color: var(--ink-strong);
}
.list-item-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 2px;
}

.list-link {
  display: block;
  text-decoration: none;
  color: var(--ink);
  transition:
    background 140ms var(--ease-out),
    border-color 140ms var(--ease-out),
    transform 110ms var(--ease-out),
    box-shadow 140ms var(--ease-out);
}
.list-link:hover {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.list-link:active {
  transform: scale(0.992);
}
.list-link strong {
  color: var(--ink-strong);
}

.empty-inline {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.empty-state-block {
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  color: var(--muted);
  padding: 44px 28px;
  text-align: center;
  background: var(--surface-sunken);
}
.empty-state-block strong {
  color: var(--ink-strong);
  display: block;
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: -0.015em;
  margin-bottom: 7px;
}
.empty-state-block p {
  margin: 0 auto;
  max-width: 46ch;
}

/* ─── Detail list ───────────────────────────────────────────────────── */
.detail-list {
  display: grid;
  gap: 1px;
  background: var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.detail-list > div {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  background: var(--surface);
  padding: 9px 12px;
}
.detail-list dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.detail-list dd {
  color: var(--ink-strong);
  font-weight: 600;
  font-size: 13.5px;
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ─── Copy row ──────────────────────────────────────────────────────── */
.copy-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
  margin-bottom: 14px;
}
.copy-row input {
  font-size: 13.5px;
  background: var(--surface-sunken);
}

.avatar-current {
  display: grid;
  gap: 6px;
}
.avatar-current-label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.avatar-preview {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
}

/* ─── Form layout ───────────────────────────────────────────────────── */
.form-stack {
  display: grid;
  gap: 15px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.form-stack p,
.form-grid p,
.auth-panel form p {
  margin: 0;
  min-width: 0;
  align-content: start;
  display: grid;
  gap: 0;
}
.form-grid p:has(textarea),
.form-grid p:has(input[type="checkbox"]),
.form-grid button {
  grid-column: 1 / -1;
}
.form-stack p:has(input[type="checkbox"]):not(:has(input[type="file"])),
.form-grid p:has(input[type="checkbox"]):not(:has(input[type="file"])),
.auth-panel form p:has(input[type="checkbox"]):not(:has(input[type="file"])) {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  row-gap: 2px;
  background: none;
  border: none;
  padding: 0;
  min-height: unset;
}
.form-stack
  p:has(input[type="checkbox"]):not(:has(input[type="file"]))
  input[type="checkbox"],
.form-grid
  p:has(input[type="checkbox"]):not(:has(input[type="file"]))
  input[type="checkbox"],
.auth-panel
  form
  p:has(input[type="checkbox"]):not(:has(input[type="file"]))
  input[type="checkbox"] {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
}
.form-stack p:has(input[type="checkbox"]):not(:has(input[type="file"])) label,
.form-grid p:has(input[type="checkbox"]):not(:has(input[type="file"])) label,
.auth-panel
  form
  p:has(input[type="checkbox"]):not(:has(input[type="file"]))
  label {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-strong);
}
.form-stack
  p:has(input[type="checkbox"]):not(:has(input[type="file"]))
  .helptext,
.form-grid
  p:has(input[type="checkbox"]):not(:has(input[type="file"]))
  .helptext,
.auth-panel
  form
  p:has(input[type="checkbox"]):not(:has(input[type="file"]))
  .helptext {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  margin-top: 0;
}

/* File input wrapper (incl. Django ClearableFileInput "Currently/Clear/Change") */
.form-stack p:has(input[type="file"]) input[type="file"],
.form-grid p:has(input[type="file"]) input[type="file"],
.auth-panel form p:has(input[type="file"]) input[type="file"] {
  display: block;
  width: auto;
  max-width: 100%;
  margin-top: 4px;
}
.form-stack p:has(ul.errorlist) input,
.form-stack p:has(ul.errorlist) select,
.form-stack p:has(ul.errorlist) textarea,
.form-grid p:has(ul.errorlist) input,
.form-grid p:has(ul.errorlist) select,
.form-grid p:has(ul.errorlist) textarea,
.auth-panel form p:has(ul.errorlist) input {
  border-color: var(--danger);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-strong);
}

.compact-form {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(100px, 1fr) auto;
  gap: 8px;
}

/* Fieldsets — long admin forms */
.form-fieldset {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin: 0;
  padding: 18px 18px 6px;
}
.form-fieldset legend {
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  padding: 2px 9px;
  text-transform: uppercase;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
}

/* ─── Unsaved-changes modal ─────────────────────────────────────────── */
.unsaved-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.48);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 24px;
  animation: modal-fade-in 180ms var(--ease-out) both;
}
.unsaved-modal[hidden] {
  display: none;
}
@keyframes modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.unsaved-modal-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  max-width: 380px;
  width: 100%;
  padding: 28px 28px 24px;
  animation: modal-box-in 220ms var(--ease-out) both;
}
@keyframes modal-box-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.unsaved-modal-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-sm);
  background: var(--warning-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.unsaved-modal-box h2 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-strong);
  margin: 0 0 8px;
}
.unsaved-modal-box p {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0 0 22px;
}
.unsaved-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.button-danger {
  appearance: none;
  background: var(--danger);
  border: 1px solid var(--danger);
  border-radius: var(--r-sm);
  color: #fff;
  cursor: pointer;
  font: 600 13.5px/1 var(--font-sans);
  min-height: 36px;
  padding: 8px 16px;
  transition:
    background 140ms var(--ease-out),
    border-color 140ms var(--ease-out);
}
.button-danger:hover {
  background: oklch(0.44 0.13 28);
  border-color: oklch(0.44 0.13 28);
}

/* ─── Error pages (404 / 500) ───────────────────────────────────────── */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72vh;
  padding: 60px 24px;
  text-align: center;
}
.error-page-inner {
  max-width: 440px;
  margin: 0 auto;
}
.error-badge {
  width: 60px;
  height: 60px;
  border-radius: var(--r-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
  border: 1px solid var(--line);
  background: var(--surface-sunken);
}
.error-badge--warn {
  background: var(--warning-tint);
  border-color: oklch(0.87 0.06 70);
}
.error-num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(88px, 18vw, 148px);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.88;
  color: var(--line-strong);
  -webkit-text-stroke: 1.5px var(--line-strong);
  paint-order: stroke fill;
  margin: 0 0 28px;
}
.error-heading {
  font-family: var(--font-display);
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 700;
  letter-spacing: -0.024em;
  color: var(--ink-strong);
  margin: 0 0 12px;
}
.error-body {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 auto 28px;
  max-width: 38ch;
}

/* ─── Pagination ────────────────────────────────────────────────────── */
.pagination {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: 18px;
}
.pagination-status {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.is-disabled {
  cursor: not-allowed;
  opacity: 0.4;
  pointer-events: none;
}

/* ─── Channel blocks (channels page) ────────────────────────────────── */
.channel-block {
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  padding: 22px 24px;
  transition:
    box-shadow 200ms var(--ease-out),
    border-color 200ms var(--ease-out);
}
.channel-block:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}
.channel-block-logo {
  flex-shrink: 0;
  padding-top: 3px;
}
.channel-block-body {
  flex: 1;
  min-width: 0;
}
.channel-block p {
  margin-bottom: 0;
}
.channel-block-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}
.channel-block-head > div {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.channel-block-head h2 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.018em;
  margin: 0;
}
.channel-wa-item {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}
.channel-wa-item > div {
  flex: 1;
  min-width: 0;
}

/* Channel toggle switch */
.channel-toggle {
  -webkit-appearance: none;
  appearance: none;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  gap: 7px;
  padding: 0;
}
.channel-toggle-track {
  background: var(--line-strong);
  border-radius: var(--r-pill);
  display: inline-block;
  height: 22px;
  position: relative;
  transition: background 180ms var(--ease-out);
  width: 40px;
}
.channel-toggle-thumb {
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(10, 10, 10, 0.3);
  height: 16px;
  left: 3px;
  position: absolute;
  top: 3px;
  transition: transform 200ms var(--ease-out);
  width: 16px;
}
.channel-toggle.is-on .channel-toggle-track {
  background: var(--accent);
}
.channel-toggle.is-on .channel-toggle-thumb {
  transform: translateX(18px);
}
.channel-toggle-label {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  user-select: none;
}
.channel-toggle.is-on .channel-toggle-label {
  color: var(--accent);
}
.channel-toggle:hover .channel-toggle-track {
  filter: brightness(0.88);
}
.channel-toggle:active .channel-toggle-thumb {
  transform: scaleX(1.2);
}
.channel-toggle.is-on:active .channel-toggle-thumb {
  transform: scaleX(1.2) translateX(15px);
}

/* ─── Conversation filter pills ──────────────────────────────────────── */
.chat-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.chat-search {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}
.chat-search input[type="search"] {
  flex: 1;
}
.channel-filter {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
}
.ch-btn {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 500;
  gap: 5px;
  padding: 5px 12px 5px 9px;
  text-decoration: none;
  transition:
    background 140ms var(--ease-out),
    color 140ms var(--ease-out),
    border-color 140ms var(--ease-out),
    transform 120ms var(--ease-out);
}
.ch-btn:hover {
  background: var(--surface-sunken);
  border-color: var(--line-strong);
  color: var(--ink);
}
.ch-btn:active {
  transform: scale(0.96);
}
.ch-btn.active {
  background: var(--accent-tint);
  border-color: var(--accent-tint-2);
  color: var(--accent-press);
}
.ch-btn svg {
  flex-shrink: 0;
}
.ch-btn--telegram.active {
  background: oklch(0.96 0.02 220);
  border-color: oklch(0.87 0.04 220);
  color: oklch(0.42 0.1 220);
}
.ch-btn--whatsapp.active {
  background: oklch(0.96 0.04 155);
  border-color: oklch(0.86 0.07 155);
  color: oklch(0.38 0.1 155);
}

/* Conversation list channel icon */
.convo-meta {
  align-items: center;
  display: flex;
  gap: 6px;
}
.convo-channel-icon {
  flex-shrink: 0;
  border-radius: 50%;
}

/* ─── App shell ─────────────────────────────────────────────────────── */
.app-body {
  background: var(--canvas);
}

.app-shell {
  min-height: 100dvh;
}

.sidebar {
  background: var(--surface-sunken);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow-y: auto;
  position: fixed;
  top: 0;
  left: 0;
  width: 252px;
  z-index: var(--z-sidebar);
}
.app-content { margin-left: 252px; }
.sidebar .brand {
  padding: 22px 20px 16px;
  flex-shrink: 0;
}
.sidebar .brand-name {
  color: var(--accent);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 1px;
  padding: 6px 14px;
}
.sidebar-nav a {
  align-items: center;
  border-radius: var(--r-sm);
  color: var(--muted);
  display: flex;
  gap: 11px;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 12px;
  transition:
    background 140ms var(--ease-out),
    color 140ms var(--ease-out);
}
.sidebar-nav a svg {
  flex: 0 0 auto;
  opacity: 0.7;
  transition: opacity 140ms var(--ease-out);
}
.sidebar-nav a:hover {
  background: var(--surface-hover);
  color: var(--ink-strong);
}
.sidebar-nav a:hover svg {
  opacity: 0.9;
}
.sidebar-nav a.is-active {
  background: var(--accent-tint);
  color: var(--accent-press);
}
.sidebar-nav a.is-active svg {
  opacity: 1;
  color: var(--accent);
}

.sidebar-section {
  color: var(--faint);
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin: 18px 0 5px 12px;
  text-transform: uppercase;
}
.sidebar-section:first-child {
  margin-top: 4px;
}

.sidebar-foot {
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 16px;
  flex-shrink: 0;
}
.sidebar-user {
  min-width: 0;
}
.sidebar-user-name {
  color: var(--ink-strong);
  display: block;
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user-meta {
  color: var(--faint);
  display: block;
  font-size: 12px;
}

/* ─── Theme toggle button ───────────────────────────────────────────── */
.theme-toggle {
  appearance: none;
  -webkit-appearance: none;
  align-items: center;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  flex-shrink: 0;
  height: 32px;
  justify-content: center;
  min-height: 0;
  padding: 0;
  transform: none !important;
  transition:
    background 140ms var(--ease-out),
    color 140ms var(--ease-out),
    border-color 140ms var(--ease-out);
  width: 32px;
}
.theme-toggle:hover {
  background: var(--surface-hover);
  color: var(--ink);
  border-color: var(--line-strong);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.theme-toggle svg {
  display: block;
  width: 16px;
  height: 16px;
}
.theme-toggle .icon-sun {
  display: none;
}
.theme-toggle .icon-moon {
  display: block;
}
:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}
:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: block;
  }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: none;
  }
}
.topbar .theme-toggle {
  margin-left: 8px;
}

.app-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-bar {
  align-items: center;
  background: var(--appbar-bg, var(--canvas));
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 14px;
  height: 66px;
  padding: 0 30px;
  position: fixed;
  top: 0;
  left: 252px;
  right: 0;
  z-index: var(--z-appbar);
}
/* Compensate for the fixed app-bar so the page content starts below it */
.app-content { padding-top: 66px; }
@media (max-width: 860px) {
  .app-bar { left: 0; }
}
.app-bar-head {
  flex: 1;
  min-width: 0;
}
.app-bar-title {
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.15;
  margin: 0;
}
.app-bar-sub {
  color: var(--muted);
  font-size: 13px;
  margin: 2px 0 0;
}
.app-bar-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.app-bar-actions .button-link {
  min-height: 38px;
  padding: 8px 14px;
  font-size: 14px;
}

.sidebar-scrim {
  background: rgba(10, 10, 10, 0.5);
  display: none;
  inset: 0;
  position: fixed;
  z-index: var(--z-scrim);
  backdrop-filter: blur(1px);
}
.app-shell.sidebar-open .sidebar-scrim {
  display: block;
}

/* ─── Onboarding checklist ──────────────────────────────────────────── */
.checklist-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}
.checklist-head {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px 14px;
}
.checklist-head .eyebrow {
  margin-bottom: 6px;
}
.checklist-head h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.018em;
}
.checklist-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.progress {
  background: var(--line);
  height: 4px;
  width: 100%;
}
.progress-fill {
  background: var(--accent);
  height: 100%;
  transition: width 700ms var(--ease-out);
}
.checklist {
  display: grid;
  padding: 8px 14px 14px;
  gap: 2px;
}
.checklist-item {
  align-items: center;
  display: flex;
  gap: 13px;
  padding: 11px 8px;
  border-radius: var(--r-sm);
  transition: background 140ms var(--ease-out);
}
.checklist-item:hover {
  background: var(--surface-sunken);
}
.checklist-check {
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  color: var(--on-accent);
  display: flex;
  flex-shrink: 0;
  height: 22px;
  width: 22px;
  justify-content: center;
  transition:
    background 200ms var(--ease-out),
    border-color 200ms var(--ease-out);
}
.checklist-check svg {
  display: block;
  height: 11px;
  width: 11px;
}
.checklist-item.is-done .checklist-check {
  background: var(--accent);
  border-color: var(--accent);
}
.checklist-body {
  min-width: 0;
  flex: 1;
}
.checklist-label {
  display: block;
  font-weight: 650;
  font-size: 14px;
  color: var(--ink-strong);
}
.checklist-item.is-done .checklist-label {
  color: var(--muted);
}
.checklist-hint {
  color: var(--muted);
  font-size: 13px;
  margin: 1px 0 0;
}
.checklist-state {
  color: var(--success);
  font-size: 12px;
  font-weight: 600;
}

/* ─── Auth & utility panels ─────────────────────────────────────────── */
.auth-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  max-width: 460px;
  margin: 64px auto;
  padding: 36px 36px 32px;
}
.auth-mark {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  margin-bottom: 20px;
}
.auth-panel h1 {
  color: var(--ink-strong);
  font-size: 27px;
  letter-spacing: -0.026em;
  margin: 0 0 20px;
}
.auth-panel .eyebrow {
  margin-bottom: 8px;
}
.auth-panel form {
  margin-bottom: 18px;
}
.auth-panel form button {
  width: 100%;
  margin-top: 3px;
}
.auth-note {
  color: var(--muted);
  margin-bottom: 0;
  font-size: 14px;
}
.auth-note a {
  font-weight: 600;
}

.auth-panel.is-centered {
  text-align: center;
}
.auth-panel.is-centered .auth-mark {
  margin-left: auto;
  margin-right: auto;
}
.auth-panel.is-centered .hero-actions {
  justify-content: center;
  margin-top: 22px;
}
.auth-panel.is-centered h1 {
  margin-bottom: 12px;
}

/* ─── Landing ───────────────────────────────────────────────────────── */
.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.86fr);
  gap: 64px;
  align-items: center;
  padding: 96px 7vw 96px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.hero-copy {
  max-width: 740px;
}
.hero-copy .eyebrow {
  margin-bottom: 16px;
}
.hero-title {
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: clamp(40px, 5.6vw, 70px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.038em;
  margin: 0;
  text-wrap: balance;
}
.hero-lede {
  color: var(--muted);
  font-size: 19px;
  line-height: 1.5;
  max-width: 54ch;
  margin: 26px 0 30px;
  text-wrap: pretty;
}
.hero-actions .button-link {
  min-height: 48px;
  padding: 13px 22px;
  font-size: 15.5px;
}
.hero-aside {
  color: var(--faint);
  font-size: 13px;
  margin: 18px 0 0;
}

/* Hero mockup — a calm composition of the actual product */
.hero-mockup {
  position: relative;
  min-width: 0;
}
.mockup-frame {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
  transform: rotate(-1deg);
  animation: mockup-float-frame 6.5s ease-in-out infinite;
  will-change: transform;
}
.mockup-head {
  align-items: center;
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  padding: 14px 16px;
}
.mockup-avatar {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  flex-shrink: 0;
}
.mockup-head > div {
  flex: 1;
  min-width: 0;
}
.mockup-head strong {
  color: var(--ink-strong);
  display: block;
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: -0.012em;
  line-height: 1.2;
}
.mockup-head span {
  color: var(--muted);
  display: block;
  font-size: 12px;
}
.mockup-status {
  align-items: center;
  color: var(--success);
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
}
.mockup-body {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 300px;
  padding: 20px 18px;
}
.mockup-bubble {
  border-radius: var(--r-md);
  font-size: 13.5px;
  line-height: 1.45;
  max-width: 80%;
  padding: 10px 13px;
}
.mockup-bubble.from-bot {
  align-self: flex-start;
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
  color: var(--ink);
}
.mockup-bubble.from-visitor {
  align-self: flex-end;
  background: var(--accent);
  border-bottom-right-radius: 6px;
  color: var(--on-accent);
}
.mockup-typing {
  align-self: flex-start;
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
  border-radius: var(--r-md);
  padding: 12px 14px;
}
.mockup-tag {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  bottom: -22px;
  box-shadow: var(--shadow-sm);
  color: var(--muted);
  display: inline-flex;
  font-size: 12.5px;
  gap: 8px;
  padding: 8px 14px;
  position: absolute;
  right: 22px;
  transform: rotate(1.4deg);
  animation: mockup-float-tag 6.5s ease-in-out infinite;
  animation-delay: -1.1s;
  will-change: transform;
}
.mockup-tag strong {
  color: var(--ink-strong);
  font-weight: 650;
}

@keyframes mockup-float-frame {
  0%,
  100% {
    transform: rotate(-1deg) translateY(0);
  }
  50% {
    transform: rotate(-1deg) translateY(-9px);
  }
}
@keyframes mockup-float-tag {
  0%,
  100% {
    transform: rotate(1.4deg) translateY(0);
  }
  50% {
    transform: rotate(1.4deg) translateY(-14px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .mockup-frame,
  .mockup-tag {
    animation: none;
  }
}

/* Features — asymmetric zigzag with composed product vignettes */
.landing-features {
  padding: 70px 7vw 88px;
  background: var(--canvas);
  border-bottom: 1px solid var(--line);
}
.section-head {
  max-width: 720px;
  margin: 0 auto 48px;
  text-align: center;
}
.section-head h2 {
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 42px);
  font-weight: 600;
  letter-spacing: -0.032em;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}

.feature-row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 72px;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  padding: 64px 0;
}
.landing-features .feature-row:nth-of-type(even) {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}
.landing-features .feature-row:nth-of-type(even) .feature-copy {
  order: 2;
}
.landing-features .feature-row:nth-of-type(even) .feature-visual {
  order: 1;
}
.feature-copy h3 {
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: clamp(22px, 2.7vw, 30px);
  font-weight: 600;
  letter-spacing: -0.026em;
  line-height: 1.15;
  margin: 0 0 14px;
  text-wrap: balance;
}
.feature-copy p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  margin: 0;
  max-width: 48ch;
}
.feature-visual {
  display: flex;
  justify-content: center;
  min-width: 0;
}

/* Vignettes — composed UI snapshots of the actual product */
.vignette {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  padding: 18px;
  width: 100%;
  max-width: 380px;
}
.vignette-docs header {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}
.vignette-docs header strong {
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: -0.012em;
}
.vignette-docs header span {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.vignette-docs ul {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.vignette-docs li {
  align-items: center;
  background: var(--surface-sunken);
  border-radius: var(--r-xs);
  display: grid;
  gap: 10px;
  grid-template-columns: auto 1fr auto;
  padding: 10px 11px;
}
.vignette-doc-icon {
  align-items: center;
  background: var(--accent-tint);
  border-radius: 6px;
  color: var(--accent-press);
  display: inline-flex;
  font-size: 10px;
  font-weight: 700;
  height: 30px;
  justify-content: center;
  letter-spacing: 0.06em;
  width: 38px;
}
.vignette-docs li > div strong {
  color: var(--ink-strong);
  display: block;
  font-size: 13px;
  font-weight: 600;
}
.vignette-docs li > div span {
  color: var(--muted);
  display: block;
  font-size: 11.5px;
}
.vignette-docs .status-pill {
  font-size: 10.5px;
  padding: 2px 8px;
}

.vignette-stack {
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: 380px;
}
.vignette-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  padding: 18px;
}
.vignette-label {
  color: var(--accent);
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.vignette-tone strong {
  color: var(--ink-strong);
  display: block;
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: -0.018em;
}
.vignette-tone span {
  color: var(--muted);
  font-size: 13px;
}
.vignette-announce {
  background: var(--accent-tint);
  border-color: var(--accent-tint-2);
}
.vignette-announce .vignette-label {
  color: var(--accent-press);
}
.vignette-announce > strong {
  color: var(--ink-strong);
  display: block;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: -0.016em;
}
.vignette-announce p {
  color: var(--ink);
  font-size: 13.5px;
  margin: 6px 0 0;
}

.vignette-channels {
  background: var(--line);
  display: grid;
  gap: 1px;
  overflow: hidden;
  padding: 0;
}
.vignette-channel {
  align-items: center;
  background: var(--surface);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 16px;
}
.vignette-channel strong {
  color: var(--ink-strong);
  display: block;
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: -0.012em;
}
.vignette-channel span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* Steps — sticky aside + hairline-divided process */
.landing-steps {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 64px;
  grid-template-columns: minmax(0, 0.84fr) minmax(0, 1.16fr);
  padding: 70px 7vw 100px;
}
.steps-head {
  align-self: start;
  position: sticky;
  top: 96px;
}
.steps-head h2 {
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 14px;
  text-wrap: balance;
}
.steps-head p {
  color: var(--muted);
  margin: 0;
  max-width: 38ch;
}
.steps-list {
  display: grid;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}
.steps-list li {
  align-items: baseline;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 28px;
  grid-template-columns: 84px 1fr;
  padding: 32px 0;
}
.steps-list li:first-child {
  border-top: 0;
  padding-top: 0;
}
.step-num {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 30px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}
.steps-list h3 {
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.024em;
  margin: 0 0 8px;
}
.steps-list p {
  color: var(--muted);
  margin: 0;
  max-width: 56ch;
}

/* Final CTA — theme-aware, centered, compact */
.landing-final {
  background: var(--canvas);
  color: var(--ink);
  border-top: 1px solid var(--line);
  padding: 64px 6vw 80px;
}
.landing-final-inner {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.landing-final-mark {
  width: 44px;
  height: 44px;
  display: block;
  margin-bottom: 4px;
  opacity: 0.92;
}
.landing-final .eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0;
}
.landing-final h2 {
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1.12;
  margin: 0;
  max-width: 22ch;
  text-wrap: balance;
}
.landing-final-lede {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
  max-width: 48ch;
  margin: 2px 0 6px;
}
.landing-final .hero-actions {
  margin-top: 6px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.landing-final .button-link {
  font-size: 14px;
  min-height: 40px;
  padding: 10px 20px;
}

/* ─── Section anchors in topbar — only on landing ───────────────────── */
.topbar-anchor {
  padding: 8px 12px;
  font-weight: 500;
}

/* ─── Topbar CTAs (Login outlined / Signup filled) ──────────────────── */
.topbar-cta {
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.003em;
  padding: 7px 14px;
  transition:
    background 140ms var(--ease-out),
    border-color 140ms var(--ease-out),
    color 140ms var(--ease-out);
}
.topbar nav a.topbar-cta--secondary {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink-strong);
}
.topbar nav a.topbar-cta--secondary:hover {
  background: var(--surface-sunken);
  border-color: var(--accent);
  color: var(--accent);
}
.topbar nav a.topbar-cta--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}
.topbar nav a.topbar-cta--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #ffffff;
}
@media (max-width: 920px) {
  .topbar-cta {
    width: 100%;
    text-align: center;
  }
}

/* ─── Harmonized floats — vignettes & final mark ────────────────────── */
@keyframes vignette-float-a {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-9px);
  }
}
@keyframes vignette-float-b {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}
@keyframes vignette-float-c {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}
@keyframes mark-breathe {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-4px) scale(1.03);
  }
}
.vignette-docs {
  animation: vignette-float-a 7s ease-in-out infinite;
  animation-delay: -1.4s;
  will-change: transform;
}
.vignette-stack {
  animation: vignette-float-b 7s ease-in-out infinite;
  animation-delay: -3.2s;
  will-change: transform;
}
.vignette-channels {
  animation: vignette-float-c 7s ease-in-out infinite;
  animation-delay: -2.1s;
  will-change: transform;
}
.landing-final-mark {
  animation: mark-breathe 5.5s ease-in-out infinite;
  will-change: transform;
}
@media (prefers-reduced-motion: reduce) {
  .vignette-docs,
  .vignette-stack,
  .vignette-channels,
  .landing-final-mark {
    animation: none;
  }
}
@media (max-width: 920px) {
  .vignette-docs,
  .vignette-stack,
  .vignette-channels {
    animation: none;
  }
}

/* ─── Section head supports a lede paragraph ────────────────────────── */
.section-head .section-lede {
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.6;
  margin: 14px auto 0;
  max-width: 56ch;
}

/* ─── About ─────────────────────────────────────────────────────────── */
.landing-about {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 70px 7vw 104px;
}
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 56px;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
}
.about-copy p {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.7;
  margin: 0 0 16px;
  max-width: 60ch;
}
.about-copy p:last-child {
  margin-bottom: 0;
}
.about-copy a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.about-aside {
  margin-top: 24px !important;
  font-size: 14px !important;
  color: var(--muted) !important;
}
.about-stats {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.about-stat {
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px 22px;
}
.about-stat-num {
  display: block;
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1;
}
.about-stat-label {
  display: block;
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 6px;
}

/* ─── Pricing ───────────────────────────────────────────────────────── */
.landing-pricing {
  background: var(--canvas);
  padding: 70px 7vw 104px;
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  max-width: 1100px;
  margin: 0 auto;
}
.pricing-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 26px 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  transition:
    border-color 180ms var(--ease-out),
    box-shadow 180ms var(--ease-out),
    transform 180ms var(--ease-out);
}
.pricing-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}
.pricing-card--featured {
  border-color: var(--accent);
  box-shadow:
    0 1px 2px rgba(10, 10, 10, 0.05),
    0 18px 36px -16px rgba(25, 98, 99, 0.22);
}
.pricing-card--featured:hover {
  border-color: var(--accent);
}
.pricing-badge {
  position: absolute;
  top: -11px;
  left: 26px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: var(--r-pill);
}
.pricing-head h3 {
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.018em;
  margin: 0 0 4px;
}
.pricing-tag {
  color: var(--muted);
  font-size: 13.5px;
  margin: 0;
}
.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.pricing-amt {
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}
.pricing-unit {
  color: var(--muted);
  font-size: 13.5px;
}
.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.pricing-features li {
  color: var(--ink);
  font-size: 14px;
  padding-left: 22px;
  position: relative;
}
.pricing-features li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 7px;
  width: 12px;
  height: 7px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}
.pricing-card .button-link {
  width: 100%;
  min-height: 42px;
}

/* ─── FAQ ───────────────────────────────────────────────────────────── */
.landing-faq {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 70px 7vw 104px;
}
.faq-list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--canvas);
  transition:
    border-color 160ms var(--ease-out),
    background 160ms var(--ease-out);
}
.faq-item:hover {
  border-color: var(--line-strong);
}
.faq-item[open] {
  background: var(--surface);
  border-color: var(--line-strong);
}
.faq-item summary {
  cursor: pointer;
  color: var(--ink-strong);
  font-weight: 600;
  font-size: 15px;
  list-style: none;
  padding: 16px 22px 16px 18px;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 200ms var(--ease-out);
  flex-shrink: 0;
}
.faq-item[open] summary::after {
  transform: rotate(-135deg);
}
.faq-item p {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.65;
  margin: 0;
  padding: 0 22px 18px;
}

/* ─── Contact ───────────────────────────────────────────────────────── */
.landing-contact {
  background: var(--canvas);
  padding: 70px 7vw 104px;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 1100px;
  margin: 0 auto;
}
.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition:
    border-color 180ms var(--ease-out),
    box-shadow 180ms var(--ease-out);
}
.contact-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.contact-card-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.contact-card-value {
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  word-break: break-word;
}
.contact-card-value:hover {
  color: var(--accent);
}
.contact-card-hint {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 4px 0 0;
}

/* Landing responsive — collapse pricing/contact/about grids on narrow */
@media (max-width: 920px) {
  .landing-about,
  .landing-pricing,
  .landing-faq,
  .landing-contact {
    padding-top: 72px;
    padding-bottom: 72px;
  }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

/* ─── Chat — conversations workspace ────────────────────────────────── */
.chat-layout {
  display: grid;
  grid-template-columns: 332px 1fr;
  gap: 20px;
  min-height: 640px;
}
.conversation-list,
.thread,
.public-chat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.conversation-list {
  overflow: auto;
}
.conversation-link {
  display: block;
  padding: 14px 16px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  transition: background 140ms var(--ease-out);
}
.conversation-link strong {
  color: var(--ink-strong);
  font-weight: 650;
}
.conversation-link span {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 3px;
}
.conversation-link:hover {
  background: var(--surface-sunken);
}
.conversation-link.active {
  background: var(--accent-tint);
}
.conversation-list .pagination {
  padding: 12px 16px;
  margin: 0;
}

.thread {
  display: flex;
  flex-direction: column;
  min-height: 640px;
}
.thread-head {
  border-bottom: 1px solid var(--line);
  padding: 16px 20px;
}
.thread-head h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.018em;
}
.thread-head span {
  color: var(--muted);
  font-size: 13px;
}

.message-list {
  flex: 1;
  overflow: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.bubble {
  max-width: min(680px, 84%);
  border-radius: var(--r-md);
  padding: 11px 14px;
  font-size: 14.5px;
  line-height: 1.5;
}
.bubble p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bubble small {
  display: block;
  margin-top: 5px;
  font-size: 11.5px;
  opacity: 0.8;
}
.bubble.inbound,
.bubble.from-bot {
  align-self: flex-start;
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-bottom-left-radius: var(--r-xs);
  color: var(--ink);
}
.bubble.outbound,
.bubble.from-visitor {
  align-self: flex-end;
  background: var(--accent);
  border-bottom-right-radius: var(--r-xs);
  color: var(--on-accent);
}
.bubble.outbound small,
.bubble.from-visitor small {
  color: var(--on-accent);
}
.bubble.system {
  align-self: center;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
}
.bubble.is-error {
  align-self: flex-start;
  background: var(--danger-tint);
  border: 1px solid oklch(0.86 0.06 32);
  color: var(--danger);
}
.bubble.is-error .small-button {
  margin-top: 9px;
  background: var(--danger);
  border-color: var(--danger);
}
.bubble.is-error .small-button:hover {
  background: oklch(0.45 0.13 28);
  border-color: oklch(0.45 0.13 28);
}
.bubble.is-typing {
  padding: 13px 15px;
}

.empty-state {
  color: var(--muted);
  padding: 28px 22px;
  text-align: center;
  font-size: 14px;
  margin: auto;
}

/* Typing indicator */
.typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
  animation: typing-bounce 1.2s infinite ease-in-out;
}
.typing span:nth-child(2) {
  animation-delay: 0.15s;
}
.typing span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes typing-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

/* ─── Public student page ───────────────────────────────────────────── */
.public-shell {
  max-width: 760px;
  margin: 0 auto;
}
.bot-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.bot-profile img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
}
.bot-profile h1 {
  margin: 0 0 3px;
  font-size: 25px;
  letter-spacing: -0.026em;
}
.bot-profile p {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 14.5px;
}
.bot-profile span {
  color: var(--faint);
  font-size: 13px;
}

.public-chat {
  min-height: 560px;
  display: flex;
  flex-direction: column;
}
.public-chat .message-list {
  padding: 22px;
}

/* Composed welcome — first impression of an empty chat */
.chat-welcome {
  margin: auto;
  max-width: 420px;
  text-align: center;
  padding: 20px;
}
.chat-welcome-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  margin: 0 auto 16px;
  display: block;
}
.chat-welcome h2 {
  font-size: 19px;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: var(--ink-strong);
}
.chat-welcome p {
  color: var(--muted);
  margin: 0 0 18px;
  font-size: 14px;
}
.chat-starters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.chat-starter {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  color: var(--ink-strong);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  min-height: 0;
  padding: 7px 14px;
}
.chat-starter:hover {
  background: var(--accent-tint);
  border-color: var(--accent);
  color: var(--accent-press);
}

.chat-form {
  border-top: 1px solid var(--line);
  padding: 14px;
  background: var(--surface);
  border-radius: 0 0 var(--r-md) var(--r-md);
}
.chat-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}
.chat-input-row button {
  min-height: 44px;
}
.chat-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 2px 0;
}
.chat-hint {
  color: var(--faint);
  font-size: 12px;
}
.char-count {
  color: var(--faint);
  font-size: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.char-count.is-limit {
  color: var(--danger);
  font-weight: 700;
}
.chat-textarea {
  resize: none;
  overflow-y: auto;
  max-height: 140px;
  min-height: 44px;
  line-height: 1.45;
}

/* ─── Announcements ─────────────────────────────────────────────────── */
.announcements {
  display: grid;
  gap: 11px;
  margin-bottom: 22px;
}
.announcement {
  background: var(--accent-tint);
  border: 1px solid var(--accent-tint-2);
  border-radius: var(--r-md);
  padding: 14px 18px;
}
.announcement strong {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-press);
}
.announcement p {
  color: var(--ink);
  margin: 0;
  font-size: 14px;
}

/* ─── Footer ────────────────────────────────────────────────────────── */
.sitefooter {
  background: var(--ink-surface);
  border-top: 1px solid var(--ink-surface-2);
  color: var(--on-ink-faint);
  padding: 46px 30px;
}
.sitefooter-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sitefooter-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.sitefooter .brand-name {
  color: var(--accent-mid);
  font-size: 17px;
}
.sitefooter-tag {
  margin: 4px 0 0;
  color: var(--on-ink);
  font-size: 14.5px;
}
.sitefooter-legal {
  margin: 0;
  font-size: 12.5px;
  color: var(--on-ink-faint);
  letter-spacing: 0.01em;
}

/* ─── Accessibility ─────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: 12px;
  top: -56px;
  z-index: var(--z-skip);
  background: var(--ink-strong);
  color: var(--on-accent);
  padding: 10px 16px;
  border-radius: var(--r-sm);
  font-weight: 600;
  transition: top 180ms var(--ease-out);
}
.skip-link:focus {
  top: 12px;
  color: var(--on-accent);
}

a:focus-visible,
button:focus-visible,
.button-link:focus-visible,
.nav-toggle:focus-visible,
.conversation-link:focus-visible,
.list-link:focus-visible,
.chat-starter:focus-visible,
.message-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 42px;
  min-height: 38px;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line-strong);
}
.nav-toggle span {
  display: block;
  width: 17px;
  height: 2px;
  margin: 0 auto;
  background: var(--ink-strong);
  border-radius: 2px;
}
.nav-toggle:hover {
  background: var(--surface-sunken);
  border-color: var(--accent);
  transform: none;
}

/* ─── Entrance motion ───────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  #main > * {
    animation: rise 520ms var(--ease-out) backwards;
  }
  #main > *:nth-child(1) {
    animation-delay: 0ms;
  }
  #main > *:nth-child(2) {
    animation-delay: 55ms;
  }
  #main > *:nth-child(3) {
    animation-delay: 110ms;
  }
  #main > *:nth-child(4) {
    animation-delay: 165ms;
  }
  #main > *:nth-child(5) {
    animation-delay: 210ms;
  }
  #main > *:nth-child(6) {
    animation-delay: 250ms;
  }
  #main > *:nth-child(n + 7) {
    animation-delay: 290ms;
  }

  .landing-body #main > section {
    animation: rise 620ms var(--ease-out) backwards;
  }

  .checklist-item {
    animation: rise 440ms var(--ease-out) backwards;
  }
  .checklist-item:nth-child(1) {
    animation-delay: 60ms;
  }
  .checklist-item:nth-child(2) {
    animation-delay: 110ms;
  }
  .checklist-item:nth-child(3) {
    animation-delay: 160ms;
  }
  .checklist-item:nth-child(4) {
    animation-delay: 210ms;
  }
  .checklist-item:nth-child(5) {
    animation-delay: 260ms;
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* ─── System-wide animations ────────────────────────────────────────── */

/* Bubble entrance — each chat message fades up from its side */
@media (prefers-reduced-motion: no-preference) {
  .bubble {
    animation: bubble-in 300ms var(--ease-out) backwards;
  }
  @keyframes bubble-in {
    from {
      opacity: 0;
      transform: translateY(6px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Stagger chat bubbles by index */
  .message-list .bubble:nth-child(1) {
    animation-delay: 0ms;
  }
  .message-list .bubble:nth-child(2) {
    animation-delay: 30ms;
  }
  .message-list .bubble:nth-child(3) {
    animation-delay: 60ms;
  }
  .message-list .bubble:nth-child(4) {
    animation-delay: 90ms;
  }
  .message-list .bubble:nth-child(5) {
    animation-delay: 110ms;
  }
  .message-list .bubble:nth-child(n + 6) {
    animation-delay: 130ms;
  }

  /* Conversation sidebar items stagger */
  .conversation-link {
    animation: rise 360ms var(--ease-out) backwards;
  }
  .conversation-link:nth-child(1) {
    animation-delay: 30ms;
  }
  .conversation-link:nth-child(2) {
    animation-delay: 70ms;
  }
  .conversation-link:nth-child(3) {
    animation-delay: 110ms;
  }
  .conversation-link:nth-child(4) {
    animation-delay: 140ms;
  }
  .conversation-link:nth-child(5) {
    animation-delay: 165ms;
  }
  .conversation-link:nth-child(n + 6) {
    animation-delay: 185ms;
  }

  /* Channel blocks stagger */
  .channel-block {
    animation: rise 420ms var(--ease-out) backwards;
  }
  .channel-block:nth-of-type(1) {
    animation-delay: 0ms;
  }
  .channel-block:nth-of-type(2) {
    animation-delay: 60ms;
  }
  .section.layout-two .channel-block:nth-of-type(1) {
    animation-delay: 80ms;
  }
  .section.layout-two .channel-block:nth-of-type(2) {
    animation-delay: 130ms;
  }

  /* Channel filter pills pop in */
  .ch-btn {
    animation: pill-in 260ms var(--ease-out) backwards;
  }
  .ch-btn:nth-child(1) {
    animation-delay: 80ms;
  }
  .ch-btn:nth-child(2) {
    animation-delay: 115ms;
  }
  .ch-btn:nth-child(3) {
    animation-delay: 145ms;
  }
  .ch-btn:nth-child(4) {
    animation-delay: 172ms;
  }
  @keyframes pill-in {
    from {
      opacity: 0;
      transform: scale(0.88);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }

  /* Sidebar nav links slide in from left */
  .sidebar-nav a {
    animation: slide-right 380ms var(--ease-out) backwards;
  }
  .sidebar-nav a:nth-child(1) {
    animation-delay: 0ms;
  }
  .sidebar-nav a:nth-child(2) {
    animation-delay: 35ms;
  }
  .sidebar-nav a:nth-child(3) {
    animation-delay: 70ms;
  }
  .sidebar-nav a:nth-child(4) {
    animation-delay: 105ms;
  }
  .sidebar-nav a:nth-child(5) {
    animation-delay: 135ms;
  }
  .sidebar-nav a:nth-child(6) {
    animation-delay: 162ms;
  }
  @keyframes slide-right {
    from {
      opacity: 0;
      transform: translateX(-8px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  /* Stat cards pop */
  .stat-card {
    animation: rise 400ms var(--ease-out) backwards;
  }

  /* Landing hero mockup tilts in */
  .hero-mockup {
    animation: mockup-in 700ms var(--ease-out) 120ms backwards;
  }
  @keyframes mockup-in {
    from {
      opacity: 0;
      transform: rotate(-3deg) translateY(18px);
    }
    to {
      opacity: 1;
      transform: rotate(-1deg) translateY(0);
    }
  }

  /* Landing typing dots pulse */
  .typing span {
    animation: dot-bounce 1.2s ease-in-out infinite;
    display: inline-block;
  }
  .typing span:nth-child(2) {
    animation-delay: 0.18s;
  }
  .typing span:nth-child(3) {
    animation-delay: 0.36s;
  }
  @keyframes dot-bounce {
    0%,
    60%,
    100% {
      transform: translateY(0);
    }
    30% {
      transform: translateY(-5px);
    }
  }

  /* Status pill "ok" pulses its dot once on load */
  .dot.dot-ok {
    animation: dot-pulse 2s var(--ease-out) 600ms 1 forwards;
  }
  @keyframes dot-pulse {
    0% {
      box-shadow: 0 0 0 0 var(--success);
    }
    60% {
      box-shadow: 0 0 0 6px oklch(0.505 0.088 162 / 0);
    }
    100% {
      box-shadow: 0 0 0 0 transparent;
    }
  }
}

@media (hover: hover) and (pointer: fine) {
  button:not(.channel-toggle):not(.tab-btn):hover,
  .button-link:hover {
    transform: translateY(-1px);
  }
  button:not(.channel-toggle):not(.tab-btn):active,
  .button-link:active {
    transform: translateY(0) scale(0.974);
  }
  .list-link:hover {
    transform: translateY(-1px);
  }

  /* Panels lift on hover */
  .panel:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--line-strong);
    transition:
      box-shadow 220ms var(--ease-out),
      border-color 220ms var(--ease-out);
  }
}

/* ─── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 1040px) {
  .landing-hero {
    grid-template-columns: 1fr;
    gap: 56px;
    padding: 72px 6vw 88px;
  }
  .hero-mockup {
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
  }
  .landing-steps {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .steps-head {
    position: static;
  }
  .feature-row,
  .landing-features .feature-row:nth-of-type(even) {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 52px 0;
  }
  .landing-features .feature-row:nth-of-type(even) .feature-copy,
  .landing-features .feature-row:nth-of-type(even) .feature-visual {
    order: 0;
  }
  .feature-visual {
    justify-content: flex-start;
  }
}

@media (max-width: 920px) {
  .landing-features,
  .landing-steps,
  .landing-final {
    padding-top: 72px;
    padding-bottom: 72px;
  }
  .mockup-tag {
    right: 8px;
  }
}

@media (max-width: 860px) {
  .sidebar {
    height: 100dvh;
    left: 0;
    position: fixed;
    top: 0;
    transform: translateX(-100%);
    transition: transform 320ms var(--ease-drawer);
    width: 268px;
    box-shadow: var(--shadow-lg);
  }
  .app-content { margin-left: 0; }
  .app-shell.sidebar-open .sidebar {
    transform: none;
  }
  .nav-toggle {
    display: inline-flex;
  }

  .topbar {
    padding: 10px 16px;
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .topbar nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }
  .topbar.nav-open nav {
    display: flex;
  }
  .topbar nav a {
    padding: 10px 10px;
  }
  .topbar nav .inline-form,
  .topbar nav .inline-form button {
    display: block;
    width: 100%;
    text-align: left;
  }

  .app-bar {
    padding: 11px 16px;
  }
  .app-bar-title {
    font-size: 18px;
  }

  .page {
    padding: 20px 16px 44px;
  }
  .page-head {
    flex-direction: column;
    gap: 14px;
  }
  .bot-profile {
    gap: 13px;
  }

  .layout-two,
  .dashboard-columns,
  .chat-layout {
    grid-template-columns: 1fr;
  }
  .stat-row,
  .stat-row.cols-3 {
    grid-template-columns: 1fr 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .compact-form {
    grid-template-columns: 1fr;
  }

  .conversation-list {
    max-height: 340px;
  }
  .thread {
    min-height: 480px;
  }

  .panel {
    padding: 18px;
  }
  .auth-panel {
    margin: 32px auto;
    padding: 28px 22px;
  }

  .table-wrap table {
    min-width: 620px;
  }
  th,
  td {
    padding: 10px;
  }

  .hero-copy h1 {
    font-size: clamp(36px, 11vw, 52px);
  }
  .hero-lede {
    font-size: 17px;
  }
}

@media (max-width: 460px) {
  .stat-row,
  .stat-row.cols-3 {
    grid-template-columns: 1fr;
  }
  .mockup-frame {
    transform: none;
    animation: none;
  }
  .mockup-tag {
    display: none;
  }
  .landing-hero {
    padding: 56px 5vw 72px;
  }
  .landing-features,
  .landing-steps {
    padding-left: 5vw;
    padding-right: 5vw;
  }
}

/* ─── Tab navigation ────────────────────────────────────────────────── */
.tab-nav {
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 2px;
  margin-bottom: 26px;
}
.tab-btn {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: var(--r-xs) var(--r-xs) 0 0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: -1px;
  min-height: 0;
  padding: 9px 16px 11px;
  transition:
    color 140ms var(--ease-out),
    background 140ms var(--ease-out),
    border-color 140ms var(--ease-out);
  transform: none !important;
}
.tab-btn:hover {
  background: var(--surface-hover);
  color: var(--ink);
  border-bottom-color: var(--line-strong);
}
.tab-btn[aria-selected="true"] {
  color: var(--ink-strong);
  border-bottom-color: var(--accent);
  background: none;
}
.tab-panel[hidden],
[role="tabpanel"][hidden] {
  display: none;
}

/* ─── Preview mode banner ───────────────────────────────────────────── */
.preview-bar {
  background: var(--ink-strong);
  color: var(--on-accent);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 8px 20px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 200;
}
.preview-bar a {
  color: inherit;
  opacity: 0.75;
  text-decoration: underline;
  margin-left: 10px;
}
.preview-bar a:hover {
  opacity: 1;
}

/* ─── Top questions ──────────────────────────────────────────────────── */
.top-q-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.top-q-item {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 20px 1fr auto;
  padding: 9px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.top-q-item:last-child {
  border-bottom: none;
}
.top-q-rank {
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.top-q-text {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top-q-count {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ─── Toast notifications ───────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: min(380px, calc(100vw - 48px));
}
.toast {
  pointer-events: all;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px 13px 16px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  font-size: 13.5px;
  line-height: 1.45;
  animation: toast-in 280ms var(--ease-out) both;
}
.toast--success {
  background: #0a0a0a;
  color: #fafafa;
  border: 1px solid #2a2a2a;
}
:root[data-theme="dark"] .toast--success {
  background: #1d1d1d;
  border-color: #3a3a3a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .toast--success {
    background: #1d1d1d;
    border-color: #3a3a3a;
  }
}
.toast--error {
  background: var(--danger);
  color: #ffffff;
  border: 1px solid #8a1d17;
}
.toast-icon {
  flex-shrink: 0;
  margin-top: 1px;
  opacity: 0.9;
}
.toast-text {
  flex: 1;
}
.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  opacity: 0.55;
  padding: 0 2px;
  min-height: 0;
  box-shadow: none;
  transform: none !important;
}
.toast-close:hover {
  opacity: 1;
  transform: none !important;
}
.toast--out {
  animation: toast-out 260ms var(--ease-in-out) both;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(6px) scale(0.97);
  }
}

/* ─── Usage warning banner ──────────────────────────────────────────── */
.usage-warning {
  background: var(--warning-tint);
  border: 1px solid var(--warning);
  border-radius: var(--r-md);
  color: var(--warning);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  margin-bottom: 22px;
  font-size: 13.5px;
}
.usage-warning svg {
  flex-shrink: 0;
}
.usage-warning strong {
  font-weight: 700;
}
.usage-warning a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
}
.usage-warning a:hover {
  opacity: 0.75;
}

/* ─── Avatar fallback (initials) ────────────────────────────────────── */
.avatar-fallback {
  align-items: center;
  background: var(--accent-tint-2);
  border: 1px solid var(--accent-tint-2);
  border-radius: var(--r-md);
  color: var(--accent-press);
  display: flex;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  height: 64px;
  justify-content: center;
  letter-spacing: -0.01em;
  width: 64px;
  flex-shrink: 0;
}
.avatar-fallback.sm {
  font-size: 14px;
  height: 36px;
  width: 36px;
  border-radius: var(--r-sm);
}

/* ─── Dashboard bot tester ──────────────────────────────────────────── */
.bot-tester {
  display: flex;
  flex-direction: column;
  min-height: 360px;
}
.bot-tester-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
  max-height: 340px;
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  margin-bottom: 12px;
}
.bot-tester-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.bot-tester-form textarea {
  min-height: 40px;
  max-height: 100px;
  resize: none;
}

/* ─── Confirm dialog (pre-publish blocker) ──────────────────────────── */
.confirm-dialog {
  background: rgba(10, 10, 10, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  inset: 0;
  position: fixed;
  z-index: 85;
  padding: 20px;
  animation: modal-fade-in 180ms var(--ease-out) both;
}
.confirm-dialog[hidden] {
  display: none;
}
.confirm-dialog-box {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  max-width: 400px;
  padding: 28px 28px 24px;
  width: 100%;
  animation: confirm-in 260ms var(--ease-out) both;
}
.confirm-dialog-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  background: var(--warning-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.confirm-dialog-box h2 {
  font-size: 17px;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.confirm-dialog-box p {
  color: var(--muted);
  font-size: 13.5px;
  margin: 0 0 22px;
}
.confirm-dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
@keyframes confirm-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ─── Reduced motion ────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
