:root {
  color-scheme: light;
  --canvas: #fafafa;
  --surface: #ffffff;
  --surface-sunken: #f3f3f3;
  --surface-hover: #ededed;
  --ink-strong: #0a0a0a;
  --ink: #1d1d1d;
  --muted: #5e5e5e;
  --faint: #8a8a8a;
  --line: #e5e5e5;
  --line-strong: #d4d4d4;
  --accent: #196263;
  --accent-hover: #134a4b;
  --accent-press: #0f3a3b;
  --accent-mid: #3cacae;
  --accent-tint: #e8fafa;
  --accent-tint-2: #a8f8f9;
  --on-accent: #ffffff;
  --ink-surface: #0a0a0a;
  --success: #196263;
  --success-tint: #e8fafa;
  --danger: #b3261e;
  --danger-tint: #fdecea;
  --warning: #8a6b1f;
  --warning-tint: #fbf4dd;
  --font-display: "Bricolage Grotesque", "Hanken Grotesk", Georgia, serif;
  --font-sans: "Hanken Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r-xs: 6px;
  --r-sm: 9px;
  --r-md: 13px;
  --r-lg: 18px;
  --r-pill: 999px;
  --ring: rgba(25, 98, 99, 0.34);
  --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);
  --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);
}

: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;
  --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;
    --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;
  scroll-behavior: smooth;
  scroll-padding-top: 60px;
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
}

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

body:not(.app-body) {
  padding-top: 60px;
  background: var(--surface);
}

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

h1,
h2,
h3,
h4 {
  color: var(--ink-strong);
  font-family: var(--font-display);
  line-height: 1.1;
  margin-top: 0;
}

p {
  margin: 0 0 0.85em;
}

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

a:hover {
  color: var(--accent-hover);
}

strong {
  color: var(--ink-strong);
  font-weight: 700;
}

small,
.small {
  color: var(--muted);
  font-size: 13px;
}

code {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: 2px 6px;
}

img.brand-mark {
  display: block;
  object-fit: contain;
}

:root[data-theme="dark"] img.brand-mark:not(.brand-mark--keep) {
  filter: invert(1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) img.brand-mark:not(.brand-mark--keep) {
    filter: invert(1);
  }
}

.skip-link {
  background: var(--ink-strong);
  border-radius: var(--r-sm);
  color: var(--surface);
  left: 16px;
  padding: 9px 12px;
  position: fixed;
  top: 12px;
  transform: translateY(-160%);
  z-index: 100;
}

.skip-link:focus {
  transform: translateY(0);
}

button,
.button-link {
  align-items: center;
  appearance: none;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 700;
  gap: 8px;
  justify-content: center;
  min-height: 40px;
  max-width: 100%;
  padding: 9px 17px;
  transition:
    background 150ms var(--ease-out),
    border-color 150ms var(--ease-out),
    color 150ms var(--ease-out),
    box-shadow 150ms var(--ease-out),
    filter 150ms var(--ease-out),
    transform 110ms var(--ease-out);
  white-space: nowrap;
  width: auto;
}

button:hover,
.button-link:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #ffffff;
}

button:active,
.button-link:active {
  background: var(--accent-press);
  border-color: var(--accent-press);
  transform: scale(0.974);
}

button:disabled,
button[aria-disabled="true"],
.button-link[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.button-secondary,
button.button-secondary,
.button-link.button-secondary {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink-strong);
}

.button-secondary:hover,
button.button-secondary:hover,
.button-link.button-secondary:hover {
  background: var(--surface-sunken);
  border-color: var(--accent);
  color: var(--accent-press);
}

.button-danger,
button.button-danger,
.button-link.button-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #ffffff;
}

.button-danger:hover,
button.button-danger:hover,
.button-link.button-danger:hover {
  background: #8a1d17;
  border-color: #8a1d17;
  color: #ffffff;
}

.small-button,
.button-compact {
  font-size: 13px;
  min-height: 32px;
  padding: 6px 11px;
}

label {
  color: var(--ink-strong);
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 5px;
}

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

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

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

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

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  padding-right: 36px;
}

input[type="file"] {
  background: transparent;
  border: 0;
  padding: 0;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
}

.helptext,
.field-help {
  color: var(--muted);
  display: block;
  font-size: 12.5px;
  line-height: 1.35;
  margin-top: 5px;
}

ul.errorlist,
.form-error-list,
.field-error-list {
  background: var(--danger-tint);
  border: 1px solid rgba(179, 38, 30, 0.35);
  border-radius: var(--r-sm);
  color: var(--danger);
  display: grid;
  font-size: 12.5px;
  gap: 4px;
  list-style: none;
  margin: 6px 0 0;
  padding: 8px 10px;
}

.form-stack,
.admin-form-stack,
.section-stack {
  display: grid;
  gap: 14px;
}

.form-stack > p {
  display: grid;
  gap: 6px;
  margin: 0;
}

.form-actions,
.admin-form-actions,
.app-modal-actions,
.thread-error-modal-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

table {
  background: var(--surface);
  border-collapse: collapse;
  width: 100%;
}

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: auto;
}

th,
td {
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-sunken);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: var(--surface-hover);
}

.topbar {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  height: 60px;
  justify-content: space-between;
  left: 0;
  padding: 0 30px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 60;
}

.brand,
.app-brand,
.sitefooter-brand {
  align-items: center;
  color: var(--ink-strong);
  display: inline-flex;
  gap: 10px;
  min-width: 0;
}

.brand:hover,
.app-brand:hover {
  color: var(--ink-strong);
}

.brand-name {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
}

.topbar nav {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
}

.topbar nav a,
.topbar nav button {
  flex: 0 0 auto;
}

.topbar-anchor {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 10px;
}

.topbar-anchor:hover {
  color: var(--ink-strong);
}

.topbar-cta {
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 700;
  min-height: 36px;
  padding: 8px 15px;
}

.topbar-cta--secondary {
  border: 1px solid var(--line-strong);
  color: var(--ink-strong);
}

.topbar-cta--secondary:hover {
  background: var(--surface-sunken);
  color: var(--ink-strong);
}

.topbar nav a.topbar-cta--primary {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #ffffff;
}

.topbar nav a.topbar-cta--primary:hover {
  background: var(--accent-hover);
  color: #ffffff;
}

.theme-toggle {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  color: var(--ink-strong);
  display: inline-flex;
  height: 32px;
  justify-content: center;
  min-height: 32px;
  padding: 0;
  width: 32px;
}

.theme-toggle:hover {
  background: var(--surface-sunken);
  border-color: var(--line-strong);
  color: var(--ink-strong);
}

.theme-toggle svg {
  height: 16px;
  width: 16px;
}

.icon-sun {
  display: none;
}

:root[data-theme="dark"] .icon-moon {
  display: none;
}

:root[data-theme="dark"] .icon-sun {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-moon {
    display: none;
  }

  :root:not([data-theme="light"]) .icon-sun {
    display: block;
  }
}

.nav-toggle {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  display: none;
  height: 38px;
  min-height: 38px;
  padding: 8px;
  width: 42px;
}

.nav-toggle span {
  background: currentColor;
  border-radius: var(--r-pill);
  display: block;
  height: 2px;
  width: 16px;
}

.nav-toggle span + span {
  margin-top: 4px;
}

.public-main {
  background: var(--surface);
  min-height: 60vh;
}

.auth-page .public-main {
  background: var(--canvas);
  display: grid;
  min-height: calc(100vh - 60px);
  place-items: center;
  padding: 40px 20px 76px;
}

.auth-layout {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  max-width: 980px;
  overflow: hidden;
  width: 100%;
}

.auth-hero {
  background: var(--surface-sunken);
  border-right: 1px solid var(--line);
  padding: 40px;
}

.auth-hero h1 {
  font-size: 36px;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.auth-hero-list {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
}

.auth-hero-list li {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 13px 14px;
}

.auth-hero-list span {
  color: var(--muted);
  display: block;
  font-size: 13.5px;
  margin-top: 4px;
}

.auth-panel {
  padding: 34px 30px;
}

.auth-panel h2 {
  font-size: 26px;
  margin-bottom: 4px;
}

.sitefooter {
  background: var(--ink-surface);
  color: #ffffff;
  padding: 36px 6vw;
}

.sitefooter-inner {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1180px;
}

.sitefooter .brand-name,
.sitefooter p {
  color: #ffffff;
}

.sitefooter p {
  margin: 0;
}

.sitefooter-tag,
.sitefooter-legal {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.app-shell {
  background: var(--canvas);
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar-scrim {
  display: none;
}

.app-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 18px;
  grid-column: 1;
  grid-row: 1;
  height: 100vh;
  padding: 18px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.app-sidebar .app-brand {
  padding: 4px 2px 12px;
}

.app-nav {
  display: grid;
  gap: 4px;
  min-height: 0;
  overflow: auto;
}

.sidebar-section {
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin: 12px 8px 4px;
  text-transform: uppercase;
}

.app-nav-link {
  align-items: center;
  border-radius: var(--r-sm);
  color: var(--muted);
  display: flex;
  font-size: 14px;
  font-weight: 700;
  gap: 10px;
  padding: 10px 11px;
}

.app-nav-link:hover {
  background: var(--surface-sunken);
  color: var(--ink-strong);
}

.app-nav-link.is-active {
  background: var(--accent-tint);
  color: var(--accent-press);
}

.nav-icon {
  align-items: center;
  color: currentColor;
  display: inline-flex;
  flex: 0 0 auto;
  height: 18px;
  justify-content: center;
  opacity: 0.76;
  width: 18px;
}

.nav-icon svg {
  display: block;
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
  width: 18px;
}

.app-nav-link:hover .nav-icon,
.app-nav-link.is-active .nav-icon {
  opacity: 1;
}

.app-sidebar-footer {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
}

.sidebar-user {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.sidebar-user-name {
  color: var(--ink-strong);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-meta {
  color: var(--muted);
  font-size: 12.5px;
}

.sidebar-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.app-main {
  display: flex;
  flex-direction: column;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.app-topbar {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  min-height: 64px;
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.app-bar-head {
  min-width: 0;
}

.app-bar-title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0;
}

.app-bar-title:empty {
  display: none;
}

.app-bar-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin: 3px 0 0;
  max-width: 80ch;
}

.app-bar-actions {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.app-bar-actions form {
  margin: 0;
}

.app-bar-breadcrumb {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 3px;
}

/* Shared form field (templates/_field.html) */
.form-field {
  min-width: 0;
}

.form-field .field-help {
  margin-bottom: 0;
}

/* Stepper (wizard archetype) */
.stepper {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}

.stepper-step {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
}

.stepper-step + .stepper-step::before {
  background: var(--line-strong);
  content: "";
  height: 1px;
  width: 26px;
}

.stepper-num {
  align-items: center;
  background: var(--surface-sunken);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.stepper-step.is-current {
  color: var(--ink-strong);
}

.stepper-step.is-current .stepper-num {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.stepper-step.is-complete {
  color: var(--ink);
}

.stepper-step.is-complete .stepper-num {
  background: var(--accent-tint);
  border-color: var(--accent);
  color: var(--accent-press);
}

/* Progress bar (live monitor) */
.progress {
  background: var(--surface-sunken);
  border-radius: var(--r-pill);
  height: 10px;
  overflow: hidden;
  width: 100%;
}

.progress-bar {
  background: var(--accent);
  border-radius: var(--r-pill);
  height: 100%;
  transition: width 240ms var(--ease-out);
}

.progress-caption {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  margin: 8px 0 0;
}

/* Status pill semantic variants */
.status-pill--running {
  background: var(--accent-tint);
  color: var(--accent-press);
}

.status-pill--completed {
  background: var(--success-tint);
  color: var(--success);
}

.status-pill--failed {
  background: var(--danger-tint);
  color: var(--danger);
}

.status-pill--draft {
  background: var(--surface-sunken);
  color: var(--muted);
}

/* Campaign monitor hero */
.campaign-monitor-hero {
  display: grid;
  gap: 16px;
}

.campaign-monitor-status {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.campaign-monitor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.campaign-monitor-actions form {
  margin: 0;
}

/* ── AK Class flow components ─────────────────────────────────────────── */
.page-lede {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 18px;
  max-width: 80ch;
}

.actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Getting-started checklist */
.checklist-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.checklist-panel .progress {
  margin: 14px 0 6px;
}

.checklist {
  display: grid;
  gap: 4px;
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.checklist-item {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  padding: 12px 0;
}

.checklist-item:first-child {
  border-top: 0;
}

.checklist-check {
  align-items: center;
  background: var(--surface-sunken);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  color: var(--on-accent);
  display: inline-flex;
  flex: 0 0 auto;
  height: 22px;
  justify-content: center;
  width: 22px;
}

.checklist-item.is-done .checklist-check {
  background: var(--accent);
  border-color: var(--accent);
}

.checklist-check svg {
  height: 12px;
  width: 12px;
}

.checklist-body {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
}

.checklist-label {
  font-weight: 700;
}

.checklist-item.is-done .checklist-label {
  color: var(--muted);
}

.checklist-hint {
  color: var(--muted);
  font-size: 12.5px;
}

.checklist-state {
  color: var(--success);
  font-size: 12px;
  font-weight: 800;
}

/* Channel-style cards (Numbers) */
.channel-list {
  display: grid;
  gap: 14px;
}

.channel-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 16px;
  padding: 18px;
}

.channel-block-logo {
  align-items: center;
  background: var(--accent-tint);
  border: 1px solid rgba(25, 98, 99, 0.18);
  border-radius: var(--r-md);
  color: var(--accent-press);
  display: inline-flex;
  flex: 0 0 auto;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.channel-block-body {
  display: grid;
  gap: 12px;
  min-width: 0;
  width: 100%;
}

.channel-block-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.channel-block-head > div {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.channel-block-head h2 {
  font-size: 19px;
  margin: 0;
}

/* On/off toggle */
.channel-toggle {
  align-items: center;
  background: none;
  border: 0;
  box-shadow: none;
  cursor: pointer;
  display: inline-flex;
  gap: 9px;
  padding: 0;
}

.channel-toggle-track {
  background: var(--surface-sunken);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  display: inline-block;
  height: 26px;
  position: relative;
  transition: background 160ms var(--ease-out);
  width: 46px;
}

.channel-toggle-thumb {
  background: var(--surface);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
  height: 20px;
  left: 3px;
  position: absolute;
  top: 2px;
  transition: left 160ms var(--ease-out);
  width: 20px;
}

.channel-toggle.is-on .channel-toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}

.channel-toggle.is-on .channel-toggle-thumb {
  left: 23px;
}

.channel-toggle-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.channel-toggle:hover .channel-toggle-track {
  filter: brightness(0.88);
}

/* Tabs */
.tab-nav {
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 4px;
  margin: 0 0 18px;
}

.tab-btn {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  box-shadow: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: -1px;
  padding: 10px 14px;
}

.tab-btn:hover {
  color: var(--ink-strong);
}

.tab-btn[aria-selected="true"] {
  border-bottom-color: var(--accent);
  color: var(--ink-strong);
}

.app-content {
  flex: 1;
  min-width: 0;
  padding: 22px;
}

.page-stack {
  display: grid;
  gap: 16px;
}

.page-header {
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 20px 22px;
}

.page-header h1 {
  font-size: 30px;
  letter-spacing: -0.02em;
  margin: 0;
}

.page-header p {
  color: var(--muted);
  margin: 8px 0 0;
  max-width: 70ch;
}

.page-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.page-actions form {
  margin: 0;
}

.panel,
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}

.panel-title {
  font-size: 18px;
  margin: 0 0 6px;
}

.panel-subtitle {
  color: var(--muted);
  font-size: 13.5px;
  margin: 0 0 14px;
}

.panel-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.content-grid {
  display: grid;
  gap: 16px;
}

.content-grid-aside {
  align-items: start;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.75fr);
}

.content-grid-2 {
  align-items: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid {
  display: grid;
  gap: 12px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.kpi-grid,
.stat-row,
.meta-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.kpi,
.stat,
.meta-item {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
}

.kpi-label,
.stat-label,
.meta-item-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.kpi-value,
.stat-value,
.meta-item-value {
  color: var(--ink-strong);
  display: block;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 8px;
  word-break: break-word;
}

.unit {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 13px;
  margin-left: 5px;
}

.action-card-grid,
.list-stack {
  display: grid;
  gap: 10px;
}

.action-card,
.list-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  display: grid;
  gap: 7px;
  padding: 14px;
}

.action-card:hover,
.list-link:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  color: var(--ink-strong);
}

.action-card h3 {
  font-size: 16px;
  margin: 0;
}

.action-card p {
  color: var(--muted);
  font-size: 13.5px;
  margin: 0;
}

.info-banner,
.usage-warning {
  background: var(--warning-tint);
  border: 1px solid rgba(138, 107, 31, 0.35);
  border-radius: var(--r-md);
  color: var(--warning);
  padding: 13px 15px;
}

.info-banner {
  background: var(--accent-tint);
  border-color: rgba(25, 98, 99, 0.24);
  color: var(--ink);
}

.info-banner-warm {
  background: var(--warning-tint);
  border-color: rgba(138, 107, 31, 0.35);
}

.info-list {
  color: var(--muted);
  display: grid;
  font-size: 13.5px;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.chip-row,
.inline-actions,
.table-actions-inline {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip,
.status-pill,
.status-boolean {
  align-items: center;
  background: var(--accent-tint);
  border-radius: var(--r-pill);
  color: var(--accent-press);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
  padding: 4px 9px;
  white-space: nowrap;
}

.chip-muted,
.status-boolean.is-false {
  background: var(--surface-sunken);
  color: var(--muted);
}

.status-boolean.is-true {
  background: var(--success-tint);
  color: var(--success);
}

.status-boolean::before {
  background: currentColor;
  border-radius: var(--r-pill);
  content: "";
  height: 7px;
  width: 7px;
}

.dot {
  background: currentColor;
  border-radius: var(--r-pill);
  display: inline-block;
  height: 8px;
  width: 8px;
}

.dot-ok {
  color: var(--success);
}

.dot-off {
  color: var(--faint);
}

.empty-state,
.empty-state-block,
.empty-inline {
  background: var(--surface-sunken);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  color: var(--muted);
  padding: 22px;
  text-align: center;
}

.empty-state-block {
  display: grid;
  gap: 8px;
}

.empty-state-block strong {
  display: block;
  font-size: 16px;
}

.empty-state-spaced {
  margin: 14px;
}

.table-action-link {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--ink-strong);
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  justify-content: center;
  min-height: 34px;
  padding: 7px 11px;
}

.table-action-link:hover {
  background: var(--surface-sunken);
  color: var(--accent-press);
}

.table-action-link-danger {
  border-color: rgba(179, 38, 30, 0.35);
  color: var(--danger);
}

.table-inline-form {
  margin: 0;
}

.inline-form {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.inline-form button {
  min-width: 96px;
}

.inline-switch-stack {
  display: grid;
  gap: 9px;
}

.field-label {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.number-workspace-panel {
  display: grid;
  gap: 14px;
}

.number-card-list {
  display: grid;
  gap: 14px;
}

.number-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.number-card-header {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 18px;
}

.number-card-title h3 {
  font-size: 20px;
  margin: 0;
}

.number-card-meta,
.number-status-strip {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.number-card-meta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.number-status-strip {
  justify-content: flex-end;
  max-width: 58%;
}

.number-card-body {
  background: var(--surface-sunken);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  padding: 12px;
}

.number-card-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  display: grid;
  gap: 12px;
  padding: 14px;
}

.number-section-head h4 {
  font-size: 16px;
  margin: 0;
}

.number-section-head p {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 0;
}

.number-settings-form,
.number-credential-form {
  display: grid;
  gap: 12px;
}

.number-toggle-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.number-form-actions {
  display: flex;
  justify-content: flex-end;
}

.number-form-actions button {
  min-width: 132px;
}

.number-login-details {
  display: grid;
  gap: 12px;
}

.number-login-details summary {
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--ink-strong);
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 800;
  justify-content: space-between;
  list-style: none;
  padding: 9px 11px;
}

.number-login-details summary::-webkit-details-marker {
  display: none;
}

.number-login-details summary::after {
  color: var(--muted);
  content: "+";
  font-size: 16px;
  line-height: 1;
}

.number-login-details[open] summary::after {
  content: "-";
}

.number-credential-form {
  margin-top: 12px;
}

.number-readonly-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.number-readonly-grid div {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  display: grid;
  gap: 3px;
  padding: 10px;
}

.number-readonly-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.number-hero {
  align-items: center;
}

.number-console {
  display: grid;
  gap: 14px;
}

.number-console-head {
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 18px 20px;
}

.number-console-head h2 {
  font-size: 24px;
  margin: 0;
}

.number-console-head p {
  color: var(--muted);
  margin: 0;
  max-width: 54ch;
}

.number-console-head .section-kicker {
  margin-bottom: 6px;
}

.number-console-list {
  display: grid;
  gap: 14px;
}

.number-console-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.number-console-card-head {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 18px 20px;
}

.number-identity {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 0;
}

.number-identity h3 {
  font-size: 20px;
  margin: 0;
}

.number-icon {
  align-items: center;
  background: var(--accent-tint);
  border: 1px solid rgba(25, 98, 99, 0.18);
  border-radius: var(--r-md);
  color: var(--accent-press);
  display: inline-flex;
  flex: 0 0 auto;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.number-icon svg {
  display: block;
  fill: none;
  height: 21px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 21px;
}

.number-workflow-grid {
  background: var(--surface-sunken);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  padding: 12px;
}

.number-workflow-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  display: grid;
  gap: 14px;
  padding: 15px;
}

.number-routing-card {
  grid-row: span 2;
}

.number-workflow-head {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.number-workflow-head h4 {
  font-size: 17px;
  margin: 0;
}

.number-workflow-head p {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 0;
}

.number-workflow-label,
.context-count,
.filter-active-dot {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--muted);
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  white-space: nowrap;
}

.number-workflow-label.is-ok {
  background: var(--success-tint);
  color: var(--success);
}

.number-workflow-label.is-muted {
  background: var(--surface-sunken);
  color: var(--muted);
}

.number-toggle-grid-large {
  grid-template-columns: repeat(2, minmax(160px, 1fr));
}

.number-access-summary {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.number-access-summary div {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
}

.number-access-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.number-access-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-layout {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
}

.admin-user-layout-single {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
}

.admin-user-main,
.admin-user-sidebar,
.admin-number-stack,
.admin-form-stack {
  display: grid;
  gap: 14px;
}

.admin-section-head,
.admin-subcard-head,
.admin-number-head,
.admin-summary-hero-main {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.admin-summary-eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-summary-name {
  font-size: 26px;
  margin: 6px 0 0;
}

.admin-summary-copy {
  color: var(--muted);
  margin: 6px 0 0;
}

.admin-form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-form-field {
  min-width: 0;
}

.admin-form-field-span-2,
.admin-form-field-checkbox {
  grid-column: span 2;
}

.admin-form-field-checkbox {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
}

.admin-switch-wrap {
  position: relative;
}

.admin-switch-wrap input[type="checkbox"] {
  opacity: 0;
  pointer-events: none;
  position: absolute;
}

.admin-switch-ui {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 13px;
  grid-template-columns: auto minmax(0, 1fr);
  margin-bottom: 0;
}

.admin-switch-track {
  background: var(--line-strong);
  border-radius: var(--r-pill);
  box-shadow: inset 0 1px 4px rgba(10, 10, 10, 0.14);
  display: block;
  height: 28px;
  padding: 3px;
  transition:
    background 160ms var(--ease-out),
    filter 160ms var(--ease-out);
  width: 50px;
}

.admin-switch-ui:hover .admin-switch-track {
  filter: brightness(0.88);
}

.admin-switch-thumb {
  background: #ffffff;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-xs);
  display: block;
  height: 22px;
  transform: translateX(0);
  transition: transform 170ms var(--ease-out);
  width: 22px;
}

.admin-switch-wrap input[type="checkbox"]:checked + .admin-switch-ui .admin-switch-track {
  background: var(--accent);
}

.admin-switch-wrap input[type="checkbox"]:checked + .admin-switch-ui .admin-switch-thumb {
  transform: translateX(22px);
}

.admin-switch-wrap input[type="checkbox"]:focus-visible + .admin-switch-ui .admin-switch-track {
  box-shadow: 0 0 0 3px var(--ring);
}

.admin-switch-title {
  color: var(--ink-strong);
  display: block;
  font-size: 14px;
  font-weight: 800;
}

.admin-switch-description {
  color: var(--muted);
  display: block;
  font-size: 12.5px;
  line-height: 1.35;
  margin-top: 2px;
}

.admin-number-meta {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 12px;
  padding: 12px;
}

.admin-number-meta div,
.details-list div {
  display: grid;
  gap: 4px;
}

.admin-number-meta span,
.details-list span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.admin-subcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
}

.admin-note-list,
.details-list {
  display: grid;
  gap: 9px;
}

.messenger {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr) minmax(250px, 300px);
  height: 100%;
  min-height: 0;
}

.inbox-page .app-main {
  height: 100vh;
  overflow: hidden;
}

.inbox-page .app-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 10px;
}

.inbox-page .page-stack {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.messenger-list,
.thread-panel,
.details-panel {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 0;
}

.messenger-list {
  gap: 10px;
  padding: 12px;
}

.messenger-list-header,
.thread-header,
.message-error-heading,
.note-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.messenger-list-header h2,
.thread-title {
  font-size: 21px;
  margin: 0;
}

.inbox-header-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.inbox-header-actions .button-link {
  font-size: 13px;
  min-height: 34px;
  padding: 7px 11px;
}

.messenger-filter {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  display: grid;
  gap: 7px;
  padding: 10px;
}

.messenger-filter label {
  margin: 0;
}

.messenger-filter select {
  min-height: 38px;
}

.messenger-filter button {
  min-height: 36px;
  padding: 7px 12px;
}

.conversation-list {
  display: grid;
  gap: 8px;
  margin-top: 2px;
  overflow: auto;
  padding-right: 2px;
}

.conversation-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--ink);
  display: grid;
  gap: 10px;
  grid-template-columns: 36px minmax(0, 1fr);
  padding: 10px;
}

.conversation-card:hover,
.conversation-card.is-active {
  background: var(--accent-tint);
  border-color: var(--accent);
  color: var(--ink);
}

.conversation-avatar,
.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;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.avatar-fallback {
  font-size: 22px;
  height: 64px;
  width: 64px;
}

.avatar-fallback.sm {
  border-radius: var(--r-sm);
  font-size: 14px;
  height: 36px;
  width: 36px;
}

.conversation-main {
  min-width: 0;
}

.conversation-top,
.conversation-bottom {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.conversation-title {
  font-family: var(--font-sans);
  font-size: 14px;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-preview {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unread-badge {
  background: var(--accent);
  border-radius: var(--r-pill);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  min-width: 20px;
  padding: 1px 6px;
  text-align: center;
}

.thread-panel {
  overflow: hidden;
  padding: 0;
}

.thread-header {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
}

.thread-header-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.thread-header-actions form,
.note-delete-form {
  margin: 0;
}

.thread-menu {
  position: relative;
}

.thread-menu summary {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--ink-strong);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
  min-height: 34px;
  padding: 7px 11px;
}

.thread-menu summary::-webkit-details-marker {
  display: none;
}

.thread-menu-popover {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  min-width: 156px;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 35;
}

.thread-menu-popover button {
  width: 100%;
}

.thread-messages {
  background: var(--surface-sunken);
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  padding: 12px;
}

.message-row {
  display: flex;
}

.message-row.inbound {
  justify-content: flex-start;
}

.message-row.outbound {
  justify-content: flex-end;
}

.message-row.system {
  justify-content: center;
}

.message-bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  max-width: min(72%, 620px);
  padding: 9px 11px;
}

.message-row.outbound .message-bubble {
  background: var(--accent-tint);
  border-color: rgba(25, 98, 99, 0.22);
}

.message-row.system .message-bubble {
  background: var(--surface-hover);
}

.message-text {
  font-size: 13.5px;
  line-height: 1.4;
  white-space: pre-line;
  word-break: break-word;
}

.message-meta {
  color: var(--muted);
  display: flex;
  font-size: 11.5px;
  gap: 8px;
  justify-content: space-between;
  margin-top: 6px;
}

.message-warning-indicator {
  align-items: center;
  background: var(--danger-tint);
  border: 1px solid rgba(179, 38, 30, 0.35);
  border-radius: var(--r-pill);
  color: var(--danger);
  display: inline-flex;
  font-weight: 800;
  gap: 6px;
  padding: 3px 8px;
}

.message-warning-indicator-icon {
  background: currentColor;
  border-radius: var(--r-pill);
  height: 8px;
  width: 8px;
}

.message-template-header,
.message-media-title,
.message-error-title,
.message-list-title {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.message-template-footer,
.message-error,
.error-help-text {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.message-actions-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.message-action-chip,
.message-media-card,
.note-item,
.message-error-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 8px 9px;
}

.message-media-preview,
.message-video-player {
  background: var(--ink-surface);
  border-radius: var(--r-sm);
  display: block;
  max-height: 280px;
  object-fit: cover;
  width: min(100%, 280px);
}

.message-audio-player {
  display: block;
  margin-top: 8px;
  width: min(100%, 280px);
}

.message-media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.message-media-link {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--ink-strong);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
}

.thread-composer {
  align-items: end;
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
  padding: 12px 14px;
}

.thread-composer textarea {
  max-height: 180px;
  min-height: 40px;
  overflow-y: hidden;
  resize: none;
}

.composer-actions {
  align-items: end;
  display: flex;
  gap: 8px;
}

.icon-button {
  height: 40px;
  min-width: 40px;
  padding: 0;
  width: 40px;
}

.icon-button svg {
  height: 18px;
  width: 18px;
}

.is-recording {
  background: var(--danger);
  border-color: var(--danger);
}

.details-panel {
  gap: 10px;
  overflow: auto;
  padding: 10px;
}

.details-panel section,
.details-card {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px;
}

.details-card-head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.details-card h4,
.details-disclosure summary {
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  margin: 0;
}

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

.details-compact-form button {
  min-width: 74px;
}

.details-panel textarea {
  min-height: 88px;
}

.details-disclosure summary {
  cursor: pointer;
  list-style: none;
}

.details-disclosure summary::-webkit-details-marker {
  display: none;
}

.details-disclosure summary::after {
  color: var(--muted);
  content: "+";
  float: right;
  font-family: var(--font-sans);
}

.details-disclosure[open] summary::after {
  content: "-";
}

.details-disclosure .advanced-tool-buttons {
  margin-top: 12px;
}

.advanced-tool-buttons {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}

.inbox-workbench {
  grid-template-columns: minmax(260px, 310px) minmax(430px, 1fr) minmax(270px, 330px);
}

.inbox-rail,
.conversation-stage,
.conversation-context {
  border-radius: var(--r-lg);
}

.inbox-rail {
  background: var(--surface);
}

.inbox-rail-header {
  border-bottom: 1px solid var(--line);
  margin: -12px -12px 0;
  padding: 13px 12px 12px;
}

.inbox-filter-panel {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}

.inbox-filter-panel summary {
  align-items: center;
  color: var(--ink-strong);
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 800;
  justify-content: space-between;
  list-style: none;
  padding: 10px 12px;
}

.inbox-filter-panel summary::-webkit-details-marker {
  display: none;
}

.inbox-filter-panel summary::after {
  color: var(--muted);
  content: "+";
  font-size: 16px;
  line-height: 1;
  margin-left: 8px;
}

.inbox-filter-panel[open] summary::after {
  content: "-";
}

.inbox-filter-panel .messenger-filter {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.filter-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
}

.filter-actions .button-link,
.filter-actions button {
  min-height: 36px;
  width: 100%;
}

.inbox-thread-list {
  gap: 7px;
}

.conversation-stage {
  background: var(--surface);
}

.conversation-stage-header {
  background: var(--surface);
  min-height: 70px;
}

.conversation-stage-title {
  align-items: center;
  display: flex;
  gap: 11px;
  min-width: 0;
}

.conversation-avatar-sm {
  border-radius: var(--r-sm);
  font-size: 14px;
  height: 38px;
  width: 38px;
}

.conversation-messages {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0)),
    var(--surface-sunken);
  padding: 16px;
}

:root[data-theme="dark"] .conversation-messages {
  background: var(--surface-sunken);
}

.conversation-empty {
  align-self: center;
  display: grid;
  gap: 7px;
  justify-self: center;
  max-width: 360px;
}

.conversation-context {
  background: var(--surface);
  gap: 10px;
}

.context-profile-card {
  align-items: center;
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 13px;
}

.context-profile-card h3 {
  font-size: 17px;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-profile-card p,
.context-profile-card span {
  color: var(--muted);
  display: block;
  font-size: 12.5px;
  margin: 2px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-section {
  display: block;
}

.context-section summary {
  align-items: center;
  color: var(--ink-strong);
  cursor: pointer;
  display: flex;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  gap: 10px;
  justify-content: space-between;
  list-style: none;
}

.context-section summary::-webkit-details-marker {
  display: none;
}

.context-section summary::after {
  color: var(--muted);
  content: "+";
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1;
}

.context-section[open] summary::after {
  content: "-";
}

.context-section[open] > :not(summary) {
  margin-top: 10px;
}

.context-help {
  color: var(--muted);
  font-size: 12.5px;
  margin: 0 0 10px;
}

.note-compose-form {
  display: grid;
}

.note-compose-form button {
  justify-self: end;
}

.interactive-item-row {
  align-items: start;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 8px;
}

#rowsContainer .interactive-item-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

.app-modal,
.thread-error-modal {
  background: transparent;
  border: 0;
  border-radius: var(--r-lg);
  color: var(--ink);
  max-width: calc(100vw - 28px);
  padding: 0;
  width: min(760px, 92vw);
}

.thread-error-modal {
  width: min(440px, calc(100vw - 28px));
}

.app-modal::backdrop,
.thread-error-modal::backdrop {
  background: rgba(10, 10, 10, 0.48);
}

.app-modal-header,
.app-modal-body,
.thread-error-modal-card {
  background: var(--surface);
  border-color: var(--line);
}

.app-modal-header {
  align-items: center;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
}

.app-modal-body {
  border: 1px solid var(--line);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  padding: 14px;
}

.app-modal-body-bottom-space {
  padding-bottom: 22px;
}

.app-modal-close {
  min-height: 32px;
  min-width: 32px;
  padding: 0;
}

.thread-error-modal-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.thread-error-modal-shell {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 22px;
}

.thread-error-modal-icon {
  align-items: center;
  background: var(--danger-tint);
  border-radius: var(--r-md);
  color: var(--danger);
  display: flex;
  font-weight: 900;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.thread-error-modal-eyebrow {
  color: var(--danger);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.thread-error-modal-title {
  font-size: 19px;
  margin: 7px 0 0;
}

.thread-error-modal-body {
  color: var(--muted);
  font-size: 13.5px;
  margin: 8px 0 0;
}

.thread-error-modal-actions {
  border-top: 1px solid var(--line);
  padding: 14px 22px 20px;
}

.pre-block {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink);
  margin: 0;
  overflow: auto;
  padding: 11px;
  white-space: pre-wrap;
}

.top-q-list {
  display: grid;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.top-q-item {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  padding: 9px 4px;
}

.top-q-item:last-child {
  border-bottom: 0;
}

.top-q-rank {
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}

.top-q-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-q-count {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.landing-body .public-main {
  overflow: hidden;
}

.landing-body section {
  padding: 40px 6vw 88px;
}

.landing-hero {
  align-items: center;
  background: var(--surface);
  display: grid;
  gap: 64px;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 460px);
  min-height: calc(100vh - 60px);
  padding-bottom: 72px;
}

.hero-copy {
  max-width: 660px;
}

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

.hero-title {
  font-size: 64px;
  letter-spacing: -0.025em;
  margin: 0 0 18px;
}

.hero-lede,
.section-lede,
.landing-final-lede {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero-aside,
.about-aside {
  color: var(--muted);
  font-size: 13px;
  margin-top: 14px;
}

.hero-mockup {
  position: relative;
}

.mockup-frame {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.mockup-head {
  align-items: center;
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 14px;
}

.mockup-avatar {
  height: 36px;
  width: 36px;
}

.mockup-head span,
.mockup-status {
  color: var(--muted);
  display: block;
  font-size: 12px;
}

.mockup-status {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.mockup-body {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.mockup-bubble {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  font-size: 14px;
  max-width: 86%;
  padding: 10px 12px;
}

.from-visitor {
  background: var(--surface-sunken);
}

.from-bot {
  background: var(--accent-tint);
  border-color: rgba(25, 98, 99, 0.24);
  justify-self: end;
}

.mockup-typing {
  background: var(--surface-sunken);
  border-radius: var(--r-pill);
  justify-self: start;
  padding: 10px 12px;
}

.typing span {
  background: var(--faint);
  border-radius: var(--r-pill);
  display: inline-block;
  height: 6px;
  margin-right: 4px;
  width: 6px;
}

.mockup-tag {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-md);
  color: var(--muted);
  display: inline-flex;
  gap: 8px;
  padding: 10px 14px;
  position: absolute;
  right: 16px;
  top: -24px;
}

.section-head {
  margin: 0 auto 32px;
  max-width: 720px;
  text-align: center;
}

.section-head h2,
.steps-head h2,
.landing-final h2 {
  font-size: 42px;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.feature-row {
  align-items: center;
  display: grid;
  gap: 48px;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1fr);
  margin: 0 auto;
  max-width: 1120px;
  padding: 44px 0;
}

.landing-features .feature-row:nth-of-type(even) .feature-copy {
  order: 2;
}

.feature-copy h3 {
  font-size: 30px;
  margin-bottom: 10px;
}

.feature-copy p {
  color: var(--muted);
  font-size: 16px;
}

.vignette,
.vignette-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 18px;
}

.vignette header,
.vignette-channel,
.vignette-docs li {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px 0;
}

.vignette header {
  padding-top: 0;
}

.vignette-docs ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.vignette-doc-icon {
  background: var(--surface-sunken);
  border-radius: var(--r-xs);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding: 6px;
}

.vignette-stack {
  display: grid;
  gap: 14px;
}

.vignette-label {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.landing-steps {
  background: var(--canvas);
  display: grid;
  gap: 52px;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1fr);
}

.steps-head {
  align-self: start;
  position: sticky;
  top: 88px;
}

.steps-list {
  counter-reset: steps;
  display: grid;
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.steps-list li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  display: grid;
  gap: 16px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 22px;
}

.step-num {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
}

.landing-about,
.landing-pricing,
.landing-contact {
  background: var(--surface);
}

.about-grid {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  margin: 0 auto;
  max-width: 1120px;
}

.about-copy p {
  color: var(--muted);
  font-size: 16px;
}

.about-stats {
  display: grid;
  gap: 12px;
}

.about-stat,
.pricing-card,
.contact-card,
.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
}

.about-stat-num {
  color: var(--accent);
  display: block;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
}

.about-stat-label {
  color: var(--muted);
  display: block;
  margin-top: 4px;
}

.pricing-grid,
.contact-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 auto;
  max-width: 1120px;
}

.pricing-card {
  display: grid;
  gap: 18px;
  position: relative;
}

.pricing-card--featured {
  border-color: var(--accent);
  box-shadow: 0 20px 50px rgba(60, 172, 174, 0.16);
}

.pricing-badge {
  background: var(--accent-tint);
  border-radius: var(--r-pill);
  color: var(--accent-press);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 10px;
  position: absolute;
  right: 18px;
  top: 18px;
}

.pricing-price {
  align-items: baseline;
  display: flex;
  gap: 8px;
}

.pricing-amt {
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
}

.pricing-unit,
.pricing-tag,
.contact-card-hint {
  color: var(--muted);
}

.pricing-features {
  display: grid;
  gap: 9px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pricing-features li {
  color: var(--ink);
  padding-left: 23px;
  position: relative;
}

.pricing-features li::before {
  color: var(--accent);
  content: "\2713";
  font-weight: 900;
  left: 0;
  position: absolute;
}

.landing-faq {
  background: var(--canvas);
}

.faq-list {
  display: grid;
  gap: 10px;
  margin: 0 auto;
  max-width: 820px;
}

.faq-item summary {
  color: var(--ink-strong);
  cursor: pointer;
  font-weight: 800;
  list-style: none;
  padding-right: 28px;
  position: relative;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "^";
  position: absolute;
  right: 0;
  top: 0;
  transform: rotate(180deg);
  transition: transform 160ms var(--ease-out);
}

.faq-item[open] summary::after {
  transform: rotate(0);
}

.faq-item p {
  color: var(--muted);
  margin: 12px 0 0;
}

.contact-card {
  display: grid;
  gap: 8px;
}

.contact-card-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.contact-card-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.landing-final {
  background: var(--canvas);
  padding-top: 40px;
  padding-bottom: 80px;
  text-align: center;
}

.landing-final-inner {
  margin: 0 auto;
  max-width: 720px;
}

.landing-final-mark {
  height: 54px;
  margin: 0 auto 18px;
  width: 54px;
}

.landing-final .hero-actions {
  justify-content: center;
}

#toast-container {
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 48px));
  pointer-events: none;
  position: fixed;
  right: 24px;
  z-index: 90;
}

.toast {
  align-items: flex-start;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  display: flex;
  font-size: 13.5px;
  gap: 10px;
  line-height: 1.45;
  padding: 13px 14px 13px 16px;
  pointer-events: all;
}

.toast--success {
  background: var(--ink-strong);
  border: 1px solid var(--line-strong);
  color: var(--surface);
}

.toast--error {
  background: var(--danger);
  border: 1px solid rgba(0, 0, 0, 0.15);
  color: #ffffff;
}

.toast-text {
  flex: 1;
}

.toast-close {
  background: transparent;
  border: 0;
  color: inherit;
  font-size: 18px;
  min-height: 0;
  opacity: 0.65;
  padding: 0;
}

.toast-close:hover {
  background: transparent;
  opacity: 1;
}

.toast--out {
  opacity: 0;
  transform: translateY(6px) scale(0.98);
}

.confirm-dialog {
  align-items: center;
  background: rgba(10, 10, 10, 0.45);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 85;
}

.confirm-dialog[hidden],
.modal[hidden],
[role="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: 420px;
  padding: 28px 28px 24px;
  width: 100%;
}

.confirm-dialog-icon {
  align-items: center;
  background: var(--warning-tint);
  border-radius: var(--r-sm);
  color: var(--warning);
  display: flex;
  font-weight: 900;
  height: 40px;
  justify-content: center;
  margin-bottom: 16px;
  width: 40px;
}

.confirm-dialog-box h2 {
  font-size: 20px;
  margin: 0 0 8px;
}

.confirm-dialog-box p {
  color: var(--muted);
  font-size: 13.5px;
}

.confirm-dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
}

.mt-8 {
  margin-top: 8px;
}

.mt-10 {
  margin-top: 10px;
}

.mb-12 {
  margin-bottom: 12px;
}

@media (prefers-reduced-motion: no-preference) and (min-width: 921px) {
  .mockup-frame {
    animation: float-soft 6.5s ease-in-out infinite;
  }

  .mockup-tag {
    animation: float-tag 6.5s ease-in-out -1.1s infinite;
  }

  .landing-final-mark {
    animation: breathe 5.5s ease-in-out infinite;
  }

  .typing span {
    animation: typing-dot 1.2s ease-in-out infinite;
  }

  .typing span:nth-child(2) {
    animation-delay: 0.18s;
  }

  .typing span:nth-child(3) {
    animation-delay: 0.36s;
  }

  @keyframes float-soft {
    0%,
    100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-14px);
    }
  }

  @keyframes float-tag {
    0%,
    100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(7px);
    }
  }

  @keyframes breathe {
    0%,
    100% {
      transform: translateY(0) scale(1);
    }
    50% {
      transform: translateY(4px) scale(1.03);
    }
  }

  @keyframes typing-dot {
    0%,
    60%,
    100% {
      transform: translateY(0);
    }
    30% {
      transform: translateY(-5px);
    }
  }
}

@media (hover: hover) and (pointer: fine) {
  button:not(.theme-toggle):not(.nav-toggle):not(.channel-toggle):not(.tab-btn):hover,
  .button-link:hover {
    transform: translateY(-1px);
  }

  button:not(.theme-toggle):not(.nav-toggle):not(.channel-toggle):not(.tab-btn):active,
  .button-link:active {
    transform: translateY(0) scale(0.974);
  }
}

@media (max-width: 1100px) {
  .messenger {
    grid-template-columns: minmax(270px, 320px) minmax(0, 1fr);
  }

  .details-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 920px) {
  .topbar {
    padding: 0 16px;
  }

  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
  }

  .topbar nav {
    align-items: stretch;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: none;
    flex-direction: column;
    gap: 2px;
    left: 0;
    padding: 10px 16px 16px;
    position: absolute;
    right: 0;
    top: 60px;
  }

  .topbar.nav-open nav {
    display: flex;
  }

  .topbar nav a,
  .topbar nav button {
    justify-content: flex-start;
    width: 100%;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    box-shadow: var(--shadow-lg);
    left: 0;
    position: fixed;
    top: 0;
    transform: translateX(-100%);
    transition: transform 320ms var(--ease-drawer);
    width: 268px;
  }

  .app-shell.sidebar-open .app-sidebar {
    transform: none;
  }

  .sidebar-scrim {
    background: rgba(10, 10, 10, 0.36);
    display: none;
    inset: 0;
    position: fixed;
    z-index: 40;
  }

  .app-shell.sidebar-open .sidebar-scrim {
    display: block;
  }

  .app-topbar {
    padding: 11px 16px;
  }

  .app-content {
    padding: 16px;
  }

  .page-header,
  .admin-section-head,
  .admin-subcard-head,
  .admin-number-head,
  .admin-summary-hero-main {
    flex-direction: column;
  }

  .content-grid-aside,
  .content-grid-2,
  .number-card-body,
  .number-workflow-grid,
  .admin-user-layout,
  .admin-user-layout-single,
  .messenger,
  .landing-hero,
  .landing-steps,
  .feature-row,
  .landing-features .feature-row:nth-of-type(even),
  .about-grid,
  .pricing-grid,
  .contact-grid,
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .number-console-head,
  .number-console-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .number-card-header {
    flex-direction: column;
  }

  .number-status-strip {
    justify-content: flex-start;
    max-width: none;
  }

  .number-credential-form,
  .number-toggle-grid-large,
  .number-access-summary,
  .details-compact-form {
    grid-template-columns: 1fr;
  }

  .number-form-actions,
  .details-compact-form button {
    width: 100%;
  }

  .number-form-actions button {
    width: 100%;
  }

  .landing-features .feature-row:nth-of-type(even) .feature-copy {
    order: 0;
  }

  .hero-title {
    font-size: 48px;
  }

  .section-head h2,
  .steps-head h2,
  .landing-final h2 {
    font-size: 34px;
  }

  .steps-head {
    position: static;
  }

  .auth-hero {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 28px;
  }

  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .admin-form-field-span-2,
  .admin-form-field-checkbox {
    grid-column: span 1;
  }

  .inbox-page .app-main,
  .inbox-page .app-content {
    height: auto;
    overflow: visible;
  }

  .messenger-list {
    max-height: 50vh;
  }

  .thread-panel {
    min-height: 62vh;
  }

  .thread-composer,
  .inline-form,
  .interactive-item-row,
  #rowsContainer .interactive-item-row {
    grid-template-columns: 1fr;
  }

  .composer-actions,
  .form-actions,
  .admin-form-actions,
  .page-actions {
    justify-content: stretch;
  }

  .composer-actions button,
  .form-actions button,
  .form-actions .button-link,
  .admin-form-actions button,
  .admin-form-actions .button-link,
  .page-actions .button-link,
  .page-actions button {
    width: 100%;
  }

  .app-topbar {
    flex-wrap: wrap;
    gap: 10px 12px;
    padding: 11px 16px;
  }

  .app-bar-head {
    flex: 1 1 60%;
  }

  .app-bar-actions {
    flex-basis: 100%;
    justify-content: flex-start;
  }

  .sitefooter-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .landing-body section {
    padding-left: 20px;
    padding-right: 20px;
  }

  .landing-hero {
    gap: 36px;
    min-height: auto;
    padding-top: 48px;
  }

  .hero-title {
    font-size: 40px;
  }

  .hero-lede,
  .section-lede,
  .landing-final-lede {
    font-size: 16px;
  }

  .mockup-tag {
    display: none;
  }

  .message-bubble {
    max-width: 92%;
  }

  #toast-container {
    bottom: 16px;
    right: 16px;
    max-width: calc(100vw - 32px);
  }
}

/* Flat workspace revamp for Inbox and My numbers */
.numbers-page-header {
  align-items: flex-end;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 4px 2px 18px;
}

.numbers-page-header h1 {
  font-size: 34px;
  margin: 4px 0 0;
}

.numbers-page-header p {
  color: var(--muted);
  margin: 8px 0 0;
  max-width: 68ch;
}

/* My numbers — directory list */
.number-directory {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.number-directory-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 16px 18px;
}

.number-directory-head h2 {
  font-size: 20px;
  margin: 0;
}

.number-directory-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.number-directory-list {
  display: grid;
}

.number-directory-row {
  align-items: center;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 16px 18px;
}

.number-directory-row + .number-directory-row {
  border-top: 1px solid var(--line);
}

.number-identity-text {
  min-width: 0;
}

.number-directory-row .number-status-strip {
  justify-content: flex-end;
}

.number-directory-actions {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

/* My numbers — manage detail */
.number-detail {
  display: grid;
  gap: 16px;
}

.number-detail-status {
  margin: -4px 0 16px;
}

.number-detail-form {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.field-block {
  display: grid;
  gap: 6px;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
}

.number-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
}

.number-credential-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.number-form-actions {
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  padding-top: 16px;
}

.number-access-line {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
  padding: 14px 0;
}

.number-access-line div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.number-access-line span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.number-access-line strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.number-readonly-grid {
  display: grid;
  gap: 0;
  margin-top: 4px;
}

.number-readonly-grid div {
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 11px 0 0;
}

.number-readonly-grid div:first-child {
  border-top: 0;
}

.number-readonly-grid span {
  color: var(--muted);
}

.back-link {
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover {
  color: var(--accent);
}

.back-link::before {
  content: "\2190";
  margin-right: 5px;
}

.inbox-page .app-content {
  background: var(--surface-sunken);
  padding: 12px;
}

.inbox-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr) minmax(280px, 340px);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.inbox-nav,
.inbox-thread-area,
.inbox-inspector {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.inbox-nav {
  border-right: 1px solid var(--line);
}

.inbox-nav-header {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 18px;
}

.inbox-nav-heading h1 {
  font-size: 25px;
  margin: 0;
}

.inbox-nav-heading span {
  color: var(--muted);
  display: block;
  font-weight: 700;
  margin-top: 4px;
}

.inbox-nav-header-actions {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

.inbox-nav-tools {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding: 12px 14px;
}

.inbox-nav-tools > .button-link {
  justify-content: center;
  width: 100%;
}

.inbox-filter-strip {
  display: grid;
}

.inbox-filter-strip summary {
  align-items: center;
  color: var(--ink-strong);
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 800;
  justify-content: space-between;
  list-style: none;
  padding: 2px 0;
}

.inbox-filter-strip summary::-webkit-details-marker {
  display: none;
}

.inbox-filter-strip summary::after {
  color: var(--muted);
  content: "+";
  font-size: 16px;
  line-height: 1;
  margin-left: 8px;
}

.inbox-filter-strip[open] summary::after {
  content: "-";
}

.inbox-shell .messenger-filter {
  background: transparent;
  border: 0;
  border-radius: 0;
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding: 10px 0 0;
}

.inbox-shell .conversation-list {
  display: block;
  margin: 0;
  overflow: auto;
  padding: 8px;
}

.inbox-shell .conversation-card {
  background: transparent;
  border: 0;
  border-radius: 10px;
  box-shadow: none;
  margin: 0 0 4px;
  padding: 11px;
}

.inbox-shell .conversation-card:hover,
.inbox-shell .conversation-card.is-active {
  background: var(--accent-tint);
  box-shadow: inset 3px 0 0 var(--accent);
}

.inbox-thread-area {
  background: var(--surface);
}

.thread-toolbar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 74px;
  padding: 14px 18px;
}

.inbox-thread-area .thread-title {
  font-size: 22px;
}

.thread-status-form {
  align-items: center;
  display: flex;
  gap: 8px;
}

.thread-status-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.thread-status-form select {
  background-color: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--ink-strong);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  min-height: 36px;
  padding: 6px 30px 6px 11px;
}

.thread-status-form select:focus-visible {
  border-color: var(--accent);
  outline: 2px solid var(--accent-tint-2);
  outline-offset: 1px;
}

.inbox-thread-area .conversation-messages {
  flex: 1;
  padding: 18px;
}

.inbox-thread-area .thread-composer {
  padding: 12px 16px;
}

.inbox-inspector {
  border-left: 1px solid var(--line);
  overflow: auto;
}

.inspector-profile,
.inspector-section {
  border-bottom: 1px solid var(--line);
  padding: 18px;
}

.inspector-profile {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr);
}

.inspector-profile h2 {
  font-size: 20px;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector-profile p,
.inspector-profile span {
  color: var(--muted);
  display: block;
  margin: 3px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector-section {
  display: grid;
  gap: 10px;
}

.inspector-section-head,
.inspector-tools summary {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.inspector-section h3,
.inspector-tools summary {
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  margin: 0;
}

.inspector-tools summary {
  cursor: pointer;
  list-style: none;
}

.inspector-tools summary::-webkit-details-marker {
  display: none;
}

.inspector-tools summary::after {
  color: var(--muted);
  content: "+";
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1;
}

.inspector-tools[open] summary::after {
  content: "-";
}

.inspector-tools[open] > :not(summary) {
  margin-top: 10px;
}

.inbox-inspector .note-item {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 0;
}

.inbox-inspector .empty-state,
.inbox-inspector .empty-state-block {
  background: transparent;
  border: 0;
  padding: 10px 0;
}

@media (max-width: 1280px) {
  .inbox-shell {
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  }

  .inbox-inspector {
    border-left: 0;
    border-top: 1px solid var(--line);
    grid-column: 1 / -1;
    max-height: 340px;
  }
}

@media (max-width: 980px) {
  .numbers-page-header,
  .number-directory-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .number-directory-row {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .number-directory-row .number-status-strip,
  .number-directory-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .inbox-page .app-content {
    padding: 10px;
  }

  .inbox-shell {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .inbox-nav {
    border-bottom: 1px solid var(--line);
    border-right: 0;
  }

  .inbox-shell .conversation-list {
    max-height: 44vh;
  }

  .inbox-thread-area {
    min-height: 65vh;
  }

  .thread-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .inbox-inspector {
    max-height: none;
  }

  .details-compact-form,
  .number-credential-grid,
  .number-access-line {
    grid-template-columns: 1fr;
  }

  .number-form-actions {
    justify-content: stretch;
  }

  .number-form-actions button {
    width: 100%;
  }

  .inbox-nav-header {
    align-items: stretch;
    flex-direction: column;
  }

  .inbox-nav-header-actions {
    width: 100%;
  }

  .inbox-nav-header-actions .button-link {
    flex: 1;
    justify-content: center;
  }

  .thread-status-form {
    width: 100%;
  }

  .thread-status-form select {
    flex: 1;
  }
}

/* AK Connect content cleanup v7: flatter app pages, no nested card stacks */
.app-body:not(.inbox-page) .app-content {
  background: var(--surface);
  padding: clamp(18px, 2vw, 30px);
}

.app-body:not(.inbox-page) .page-stack {
  gap: 24px;
}

.app-body .page-lede {
  background: transparent;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  margin: -4px 0 2px;
  max-width: 86ch;
  padding: 2px 0 2px 12px;
}

.app-body .panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.app-body .panel + .panel,
.app-body .section-stack > .panel + .panel {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.app-body .content-grid > .panel,
.app-body .content-grid > aside.panel {
  min-width: 0;
}

.app-body .content-grid-aside > aside.panel {
  border-left: 1px solid var(--line);
  padding-left: 22px;
}

.app-body .panel-title {
  font-size: 21px;
  margin-bottom: 6px;
}

.app-body .panel-subtitle {
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 16px;
  max-width: 76ch;
}

.app-body .panel-head {
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
  padding-bottom: 14px;
}

.app-body .table-wrap {
  background: transparent;
  border: 0;
  border-radius: 0;
  border-top: 1px solid var(--line);
  box-shadow: none;
  margin-top: 14px;
  overflow: auto;
}

.app-body table {
  background: transparent;
}

.app-body th {
  background: transparent;
  border-bottom: 1px solid var(--line-strong);
  padding: 13px 16px;
}

.app-body td {
  padding: 14px 16px;
}

.app-body tbody tr:hover {
  background: var(--surface-sunken);
}

.app-body .empty-state,
.app-body .empty-state-block,
.app-body .empty-inline {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  padding: 26px 0;
}

.app-body td .empty-state-block {
  align-items: center;
  justify-items: center;
  min-height: 110px;
  text-align: center;
}

.app-body .stat-row {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  gap: 0;
}

.app-body .stat,
.app-body .kpi,
.app-body .meta-item {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 16px 18px;
}

.app-body .stat + .stat,
.app-body .kpi + .kpi,
.app-body .meta-item + .meta-item {
  border-left: 1px solid var(--line);
}

.app-body .action-card,
.app-body .list-item {
  background: transparent;
  border: 0;
  border-radius: 0;
  border-top: 1px solid var(--line);
  box-shadow: none;
  padding: 13px 0;
}

.app-body .action-card:hover,
.app-body .list-link:hover {
  background: transparent;
  box-shadow: none;
  color: var(--accent);
}

.overview-actions-panel {
  align-self: stretch;
}

.overview-action-list {
  display: grid;
  gap: 10px;
}

.overview-action-button {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink-strong);
  display: grid;
  gap: 3px;
  min-height: 64px;
  padding: 12px 14px;
}

.overview-action-button strong {
  font-size: 15px;
}

.overview-action-button span {
  color: var(--muted);
}

.overview-action-button:hover {
  background: var(--surface-sunken);
  border-color: var(--accent);
  color: var(--accent-press);
  transform: translateY(-1px);
}

.overview-action-button:focus-visible {
  border-color: var(--accent);
  outline: 2px solid var(--accent-tint-2);
  outline-offset: 2px;
}

.app-body .channel-list {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  gap: 0;
}

.app-body .channel-block {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 20px 0;
}

.app-body .channel-block + .channel-block {
  border-top: 1px solid var(--line);
}

.app-body .channel-block-logo,
.app-body .number-icon,
.app-body .conversation-avatar,
.app-body .avatar-fallback {
  border-radius: 10px;
}

.app-body .form-shell {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.app-body .info-banner,
.app-body .usage-warning {
  border-radius: 10px;
  box-shadow: none;
}

.app-body .stepper {
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
  padding-bottom: 14px;
}

/* Inbox rebuild: full workspace, rail + thread + inspector with no outer card */
.inbox-page .app-content {
  background: var(--surface);
  padding: 0;
}

.inbox-page .page-stack {
  gap: 0;
}

.inbox-workspace {
  background: transparent;
  border: 0;
  border-radius: 0;
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr) minmax(280px, 330px);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.inbox-roster,
.inbox-conversation,
.conversation-inspector {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.inbox-roster {
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.inbox-nav-header {
  align-items: flex-start;
  border-bottom: 0;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
  padding: 20px 20px 12px;
}

.inbox-nav-heading h1 {
  font-size: 28px;
  margin: 0;
}

.inbox-nav-heading span {
  color: var(--muted);
  display: block;
  font-weight: 700;
  margin-top: 5px;
}

.inbox-nav-header-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1.2fr;
  width: 100%;
}

.inbox-nav-header-actions .button-link {
  justify-content: center;
  min-width: 0;
}

.inbox-nav-tools {
  border-bottom: 1px solid var(--line);
  padding: 0 20px 14px;
}

.inbox-filter-strip summary {
  padding: 4px 0;
}

.inbox-workspace .messenger-filter {
  background: transparent;
  border: 0;
  border-radius: 0;
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding: 12px 0 0;
}

.inbox-workspace .conversation-list {
  display: block;
  margin: 0;
  overflow: auto;
  padding: 8px 10px 20px;
}

.inbox-workspace .conversation-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  padding: 14px 10px;
  position: relative;
}

.inbox-workspace .conversation-card + .conversation-card {
  border-top: 1px solid var(--line);
}

.inbox-workspace .conversation-card:hover {
  background: var(--surface-sunken);
}

.inbox-workspace .conversation-card.is-active {
  background: var(--accent-tint);
  color: var(--ink);
}

.inbox-workspace .conversation-card.is-active::before {
  background: var(--accent);
  border-radius: var(--r-pill);
  bottom: 10px;
  content: "";
  left: 0;
  position: absolute;
  top: 10px;
  width: 3px;
}

.inbox-conversation {
  background: var(--surface);
}

.thread-toolbar {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  min-height: 76px;
  padding: 15px 22px;
}

.inbox-conversation .thread-title {
  font-size: 24px;
  line-height: 1.1;
}

.thread-status-form {
  align-items: center;
  display: flex;
  gap: 8px;
}

.thread-status-form select,
.thread-menu summary {
  background-color: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink-strong);
  min-height: 40px;
}

.inbox-conversation .conversation-messages {
  background: var(--surface);
  flex: 1;
  gap: 10px;
  padding: 22px clamp(18px, 3vw, 42px);
}

.inbox-conversation .message-bubble {
  border: 0;
  border-radius: 18px;
  box-shadow: none;
  max-width: min(76%, 680px);
  padding: 11px 13px;
}

.inbox-conversation .message-row.inbound .message-bubble {
  background: var(--surface-sunken);
}

.inbox-conversation .message-row.outbound .message-bubble {
  background: var(--accent-tint);
}

.inbox-conversation .message-media-card,
.inbox-conversation .message-action-chip,
.inbox-conversation .message-error-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.inbox-conversation .message-media-card > * + * {
  margin-top: 8px;
}

.inbox-conversation .message-media-link {
  background: transparent;
  border-color: var(--line-strong);
}

.inbox-conversation .thread-composer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 14px 20px;
}

.inbox-conversation .thread-composer textarea {
  background: var(--surface-sunken);
  border-color: var(--line);
}

.conversation-inspector {
  background: var(--surface);
  border-left: 1px solid var(--line);
  overflow: auto;
}

.conversation-inspector .inspector-profile,
.conversation-inspector .inspector-section {
  border-bottom: 1px solid var(--line);
  padding: 20px 22px;
}

.conversation-inspector .inspector-profile {
  align-items: center;
  display: grid;
  gap: 13px;
  grid-template-columns: auto minmax(0, 1fr);
}

.conversation-inspector .inspector-profile h2 {
  font-size: 22px;
  margin: 0;
}

.conversation-inspector .inspector-section {
  display: grid;
  gap: 12px;
}

.conversation-inspector .inspector-section h3 {
  font-size: 20px;
}

.conversation-inspector textarea {
  background: var(--surface);
  min-height: 112px;
}

.conversation-inspector .note-item {
  background: transparent;
  border: 0;
  border-radius: 0;
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.conversation-inspector .empty-state,
.conversation-inspector .empty-state-block,
.inbox-conversation .empty-state,
.inbox-conversation .empty-state-block {
  background: transparent;
  border: 0;
  padding: 22px 0;
}

@media (max-width: 1280px) {
  .inbox-workspace {
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  }

  .conversation-inspector {
    border-left: 0;
    border-top: 1px solid var(--line);
    grid-column: 1 / -1;
    max-height: 330px;
  }
}

@media (max-width: 920px) {
  .app-body .content-grid-aside > aside.panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 18px;
  }

  .app-body .stat + .stat,
  .app-body .kpi + .kpi,
  .app-body .meta-item + .meta-item {
    border-left: 0;
  }
}

@media (max-width: 760px) {
  .inbox-page .app-content {
    padding: 0;
  }

  .inbox-workspace {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .inbox-roster {
    border-bottom: 1px solid var(--line);
    border-right: 0;
  }

  .inbox-workspace .conversation-list {
    max-height: 44vh;
  }

  .inbox-conversation {
    min-height: 66vh;
  }

  .thread-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .thread-header-actions,
  .thread-status-form {
    width: 100%;
  }

  .thread-status-form select {
    flex: 1;
  }

  .inbox-conversation .message-bubble {
    max-width: 92%;
  }

  .conversation-inspector {
    max-height: none;
  }
}

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