/* ===========================================================================
   Delegate — design tokens + component styles.
   No build step (see web/README.md for why) — plain CSS, custom properties
   for theming, system dark-mode support via prefers-color-scheme.
   =========================================================================== */

:root {
  /* Design Tokens per docs/DESIGN-SYSTEM.md — enterprise SaaS direction (RealPage / ServiceTitan / Housecall Pro) */
  --color-bg: #f4f6fb;
  --color-bg-subtle: #eef1f7;       /* sunken panels, hovered rows */
  --color-surface: #ffffff;          /* cards, panels, sidebar */
  --color-border: #dde3ee;
  --color-border-strong: #c7d0e0;
  --color-text: #0f1b2d;
  --color-text-secondary: #4b5768;  /* captions, plain-language explainer text */
  --color-text-tertiary: #8592a6;   /* disabled states, least important labels */

  /* Accent — the ONE primary color (bold enterprise blue) */
  --color-accent: #3b6fd9;          /* softer, calmer blue — deliberately less saturated than a
                                        pure electric blue so long dashboard sessions feel calmer */
  --color-accent-hover: #2f5bc0;
  --color-accent-subtle: #eaf0ff;   /* light accent background tint */
  --color-accent-subtle-strong: #d7e3ff;

  /* Warm secondary — used sparingly (hero glow, brand mark) as the page's visual signature, not
     as a functional color. Pulled from the salon/service-business world (terracotta/rose gold)
     rather than the generic blue-on-white SaaS palette, so the page doesn't read as an
     interchangeable AI-dashboard template. */
  --color-warm: #d97a4d;
  --color-warm-subtle: #fbe9de;

  /* Semantic status colors */
  --color-success: #0f9d58;
  --color-success-subtle: #e5f7ed;
  --color-warning: #b5730a;
  --color-warning-subtle: #fdf1de;
  --color-danger: #d3342d;          /* irreversible action confirmations */
  --color-danger-subtle: #fbe9e8;

  /* Elevation */
  --shadow-card: 0 1px 2px rgba(15, 27, 45, 0.06), 0 1px 1px rgba(15, 27, 45, 0.04);
  --shadow-pop: 0 12px 32px rgba(15, 27, 45, 0.14);

  /* Typography Scale */
  --font-family: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Sora", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, monospace;

  --text-hero: 2.25rem;    /* 36px */
  --text-h1: 1.5rem;      /* 24px */
  --text-h2: 1.05rem;     /* ~17px */
  --text-body: 1rem;      /* 16px */
  --text-caption: 0.8rem; /* ~13px */

  --leading-tight: 1.2;
  --leading-normal: 1.55;

  --weight-regular: 400;
  --weight-medium: 600;
  --weight-bold: 700;

  /* Spacing Scale */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 1rem;     /* 16px */
  --space-4: 1.5rem;   /* 24px */
  --space-5: 2rem;     /* 32px */
  --space-6: 3rem;     /* 48px */
  --space-7: 4rem;     /* 64px */

  /* Legacy aliases mapped to new design system tokens */
  --bg: var(--color-bg);
  --surface: var(--color-surface);
  --surface-2: var(--color-bg-subtle);
  --border: var(--color-border);
  --border-strong: var(--color-border-strong);
  --ink: var(--color-text);
  --ink-soft: var(--color-text-secondary);
  --muted: var(--color-text-tertiary);

  --accent: var(--color-accent);
  --accent-hover: var(--color-accent-hover);
  --accent-soft: var(--color-accent-subtle);
  --accent-text: var(--color-accent);

  --good: var(--color-success);
  --good-soft: var(--color-success-subtle);
  --warn: var(--color-warning);
  --warn-soft: var(--color-warning-subtle);
  --bad: var(--color-danger);
  --bad-soft: var(--color-danger-subtle);

  --shadow-sm: var(--shadow-card);
  --shadow-md: var(--shadow-pop);

  --radius: 12px;
  --radius-sm: 8px;

  --font-ui: var(--font-family);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #0a1220;
    --color-bg-subtle: #0c1729;
    --color-surface: #101b2e;
    --color-border: #223350;
    --color-border-strong: #2c4266;
    --color-text: #eaf0fb;
    --color-text-secondary: #a3b1c9;
    --color-text-tertiary: #708099;

    --color-accent: #4d84ff;
    --color-accent-hover: #6b98ff;
    --color-accent-subtle: #14294c;
    --color-accent-subtle-strong: #1b3260;

    --color-success: #35c987;
    --color-success-subtle: #103322;
    --color-warning: #e3a53d;
    --color-warning-subtle: #3a2c10;
    --color-danger: #f0685f;
    --color-danger-subtle: #3a1715;

    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-pop: 0 16px 40px rgba(0, 0, 0, 0.5);

    --bg: var(--color-bg);
    --surface: var(--color-surface);
    --surface-2: var(--color-bg-subtle);
    --border: var(--color-border);
    --border-strong: var(--color-border-strong);
    --ink: var(--color-text);
    --ink-soft: var(--color-text-secondary);
    --muted: var(--color-text-tertiary);

    --accent: var(--color-accent);
    --accent-hover: var(--color-accent-hover);
    --accent-soft: var(--color-accent-subtle);
    --accent-text: var(--color-accent);

    --good: var(--color-success);
    --good-soft: var(--color-success-subtle);
    --warn: var(--color-warning);
    --warn-soft: var(--color-warning-subtle);
    --bad: var(--color-danger);
    --bad-soft: var(--color-danger-subtle);

    --shadow-sm: var(--shadow-card);
    --shadow-md: var(--shadow-pop);
  }
}

:root[data-theme="dark"] {
  --color-bg: #0a1220;
  --color-bg-subtle: #0c1729;
  --color-surface: #101b2e;
  --color-border: #223350;
  --color-border-strong: #2c4266;
  --color-text: #eaf0fb;
  --color-text-secondary: #a3b1c9;
  --color-text-tertiary: #708099;

  --color-accent: #4d84ff;
  --color-accent-hover: #6b98ff;
  --color-accent-subtle: #14294c;
  --color-accent-subtle-strong: #1b3260;

  --color-success: #35c987;
  --color-success-subtle: #103322;
  --color-warning: #e3a53d;
  --color-warning-subtle: #3a2c10;
  --color-danger: #f0685f;
  --color-danger-subtle: #3a1715;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-pop: 0 16px 40px rgba(0, 0, 0, 0.5);

  --bg: var(--color-bg);
  --surface: var(--color-surface);
  --surface-2: var(--color-bg-subtle);
  --border: var(--color-border);
  --border-strong: var(--color-border-strong);
  --ink: var(--color-text);
  --ink-soft: var(--color-text-secondary);
  --muted: var(--color-text-tertiary);

  --accent: var(--color-accent);
  --accent-hover: var(--color-accent-hover);
  --accent-soft: var(--color-accent-subtle);
  --accent-text: var(--color-accent);

  --good: var(--color-success);
  --good-soft: var(--color-success-subtle);
  --warn: var(--color-warning);
  --warn-soft: var(--color-warning-subtle);
  --bad: var(--color-danger);
  --bad-soft: var(--color-danger-subtle);

  --shadow-sm: var(--shadow-card);
  --shadow-md: var(--shadow-pop);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 6px;
  text-wrap: balance;
}

h1 {
  font-size: 1.6rem;
}
h2 {
  font-size: 1.25rem;
}
h3 {
  font-size: 1.02rem;
}

p {
  margin: 0 0 12px;
  color: var(--ink-soft);
}

a {
  color: var(--accent-text);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Layout: auth shell (login/signup/reset) ---------- */

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 32px 28px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.auth-brand .mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(155deg, var(--accent), var(--color-warm));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.auth-brand .name {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.auth-foot {
  margin-top: 18px;
  font-size: 0.86rem;
  color: var(--muted);
  text-align: center;
}

/* ---------- Layout: app shell (sidebar + content) ---------- */

.app-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  gap: 20px;
  max-width: 1360px;
  margin: 0 auto;
  padding: 20px 24px 60px;
  min-height: 100vh;
  align-items: start;
}

.sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 20px;
}

.sidebar .auth-brand {
  padding: 6px 10px 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.sidebar .auth-brand .mark {
  background: linear-gradient(155deg, var(--accent), color-mix(in srgb, var(--accent) 55%, white));
}
.sidebar .auth-brand .sub {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 1px;
}

.nav-group {
  margin-top: 12px;
}
.nav-group:first-of-type {
  margin-top: 2px;
}
.nav-label {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  padding: 0 10px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.nav-link .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
}

.nav-link .count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  background: var(--surface-2);
  color: var(--muted);
  padding: 1px 6px;
  border-radius: 999px;
}
.nav-link.active .count {
  background: color-mix(in srgb, var(--accent) 18%, var(--accent-soft));
  color: var(--accent-text);
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 10px;
}
.sidebar-foot .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-text);
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}
.sidebar-foot .who {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}
.sidebar-foot .plan {
  font-size: 0.68rem;
  color: var(--muted);
}

.content {
  min-width: 0;
}

.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-head p {
  margin: 4px 0 0;
  max-width: 60ch;
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 0 0 40px;
    gap: 0;
  }
  .sidebar {
    position: static;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    box-shadow: none;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: 10px 14px;
    gap: 2px;
  }
  .sidebar .auth-brand {
    border-bottom: none;
    padding: 0 10px 0 4px;
    margin-bottom: 0;
    margin-right: 6px;
    flex-shrink: 0;
  }
  .nav-group {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-top: 0;
    flex-shrink: 0;
  }
  .nav-label {
    display: none;
  }
  .sidebar-foot {
    margin-top: 0;
    margin-left: auto;
    padding-top: 0;
    padding-left: 8px;
    border-top: none;
    flex-shrink: 0;
  }
  .content {
    padding: 20px 16px 0;
  }
}

/* ---------- Components ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.card + .card {
  margin-top: 14px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 5px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
}

.field textarea {
  resize: vertical;
  min-height: 70px;
}

.field .hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
}

.btn {
  font-family: var(--font-family);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-4);
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: var(--weight-medium);
  font-size: var(--text-body);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease,
    transform 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn:active {
  transform: scale(0.97);
}
.btn-primary {
  box-shadow: 0 1px 2px color-mix(in srgb, var(--accent) 35%, transparent);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
}
.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--ink);
}
.btn-ghost:hover {
  background: var(--surface-2);
}

.btn-outline {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--accent);
}
.btn-outline:hover {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.btn-danger {
  background: transparent;
  border-color: var(--bad);
  color: var(--bad);
}
.btn-danger:hover {
  background: var(--bad-soft);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 6px 11px;
  font-size: 0.8rem;
}

.alert {
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 0.86rem;
  margin-bottom: 14px;
  border: 1px solid transparent;
}
.alert-bad {
  background: var(--bad-soft);
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 30%, transparent);
}
.alert-good {
  background: var(--good-soft);
  color: var(--good);
  border-color: color-mix(in srgb, var(--good) 30%, transparent);
}
.alert-warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 30%, transparent);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-good {
  background: var(--good-soft);
  color: var(--good);
}
.badge-warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.badge-bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.badge-muted {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}
.stat {
  background: var(--surface);
  padding: 16px 18px;
}
.stat .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.6rem;
  font-weight: 700;
  display: block;
  line-height: 1.1;
}
.stat .lbl {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}
tbody tr:hover {
  background: var(--surface-2);
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.table-wrap table {
  border: none;
}
.table-wrap tr:last-child td {
  border-bottom: none;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
}
.empty-state h3 {
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.btn-ghost .spinner,
.btn-danger .spinner {
  border-color: color-mix(in srgb, var(--ink) 25%, transparent);
  border-top-color: var(--ink);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
  }
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-text);
  margin-bottom: 6px;
  display: block;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--ink-soft);
}
.checkbox-row input {
  width: auto;
}

/* ===========================================================================
   docs/DESIGN-SYSTEM.md — the Task picker (web/src/pages/skills.js) only.
   A deliberate visual reset for that one screen, not a site-wide retheme —
   see docs/BUILD-BRIEF.md Section 4. Namespaced under --ds-* / .ds- so it
   never collides with the tokens/components above, which the rest of the
   app keeps using untouched.
   =========================================================================== */

:root {
  --ds-color-bg: #ffffff;
  --ds-color-bg-subtle: #f7f7f8;
  --ds-color-border: #e5e5e7;
  --ds-color-text: #1d1d1f;
  --ds-color-text-secondary: #6e6e73;
  --ds-color-text-tertiary: #a1a1a6;

  --ds-color-accent: #3a5a9b;
  --ds-color-accent-hover: #2f4a80;
  --ds-color-accent-subtle: #eef1f8;

  --ds-color-success: #1a7f37;
  --ds-color-warning: #9a6700;
  --ds-color-danger: #c9282d;

  --ds-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06);

  --ds-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --ds-text-hero: 2.5rem;
  --ds-text-h1: 1.75rem;
  --ds-text-h2: 1.25rem;
  --ds-text-body: 1rem;
  --ds-text-caption: 0.875rem;
  --ds-leading-tight: 1.2;
  --ds-leading-normal: 1.5;
  --ds-weight-regular: 400;
  --ds-weight-medium: 500;
  --ds-weight-bold: 700;

  --ds-space-1: 0.25rem;
  --ds-space-2: 0.5rem;
  --ds-space-3: 1rem;
  --ds-space-4: 1.5rem;
  --ds-space-5: 2rem;
  --ds-space-6: 3rem;
  --ds-space-7: 4rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ds-color-bg: #000000;
    --ds-color-bg-subtle: #1c1c1e;
    --ds-color-border: #38383a;
    --ds-color-text: #f5f5f7;
    --ds-color-text-secondary: #98989d;
    --ds-color-text-tertiary: #6e6e73;
    --ds-color-accent: #6d8fd6;
    --ds-color-accent-hover: #85a2de;
    --ds-color-accent-subtle: #1c2a45;
    --ds-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}

:root[data-theme="dark"] {
  --ds-color-bg: #000000;
  --ds-color-bg-subtle: #1c1c1e;
  --ds-color-border: #38383a;
  --ds-color-text: #f5f5f7;
  --ds-color-text-secondary: #98989d;
  --ds-color-text-tertiary: #6e6e73;
  --ds-color-accent: #6d8fd6;
  --ds-color-accent-hover: #85a2de;
  --ds-color-accent-subtle: #1c2a45;
  --ds-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.ds-page {
  font-family: var(--ds-font-family);
  color: var(--ds-color-text);
  max-width: 1024px;
}

.ds-page-head {
  margin-bottom: var(--ds-space-5);
}

.ds-page-head h1 {
  font-family: var(--ds-font-family);
  font-size: var(--ds-text-h1);
  font-weight: var(--ds-weight-bold);
  line-height: var(--ds-leading-tight);
  color: var(--ds-color-text);
  margin: 0 0 var(--ds-space-2);
}

.ds-page-head p {
  font-size: var(--ds-text-body);
  color: var(--ds-color-text-secondary);
  line-height: var(--ds-leading-normal);
  max-width: 60ch;
  margin: 0;
}

.ds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--ds-space-4);
}

.ds-card {
  background: var(--ds-color-bg-subtle);
  border: 1px solid var(--ds-color-border);
  border-radius: 12px;
  padding: var(--ds-space-4);
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-3);
  transition: box-shadow 0.15s ease;
}

.ds-card:hover,
.ds-card:focus-within {
  box-shadow: var(--ds-shadow-card);
}

.ds-card-title {
  font-size: var(--ds-text-h2);
  font-weight: var(--ds-weight-medium);
  color: var(--ds-color-text);
  margin: 0;
}

.ds-card-explainer {
  font-size: var(--ds-text-body);
  color: var(--ds-color-text-secondary);
  line-height: var(--ds-leading-normal);
  margin: 0;
}

.ds-card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-3);
}

.ds-reversibility {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-1);
  font-size: var(--ds-text-caption);
  color: var(--ds-color-text-tertiary);
}

.ds-btn {
  font-family: var(--ds-font-family);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ds-space-2);
  min-height: 44px;
  padding: 0 var(--ds-space-4);
  border-radius: 8px;
  font-size: var(--ds-text-body);
  font-weight: var(--ds-weight-medium);
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}

.ds-btn-primary {
  background: var(--ds-color-accent);
  color: #ffffff;
}
.ds-btn-primary:hover {
  background: var(--ds-color-accent-hover);
}
.ds-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ds-btn-secondary {
  background: transparent;
  border-color: var(--ds-color-border);
  color: var(--ds-color-text);
}
.ds-btn-secondary:hover {
  background: var(--ds-color-accent-subtle);
}

.ds-badge-muted {
  display: inline-flex;
  align-items: center;
  font-size: var(--ds-text-caption);
  color: var(--ds-color-text-tertiary);
}

/* Modal: confirmation step for CONFIRM/OWNER_APPROVAL tasks, and the tap-choice candidate list
   for a task that needs one customer picked — both single-primary-action, per DESIGN-SYSTEM.md. */
.ds-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--ds-space-4);
  z-index: 100;
}

.ds-modal {
  font-family: var(--ds-font-family);
  color: var(--ds-color-text);
  background: var(--ds-color-bg);
  border-radius: 12px;
  max-width: 420px;
  width: 100%;
  padding: var(--ds-space-5);
  max-height: min(80vh, 640px);
  overflow-y: auto;
}

.ds-modal h2 {
  font-family: var(--ds-font-family);
  font-size: var(--ds-text-h2);
  font-weight: var(--ds-weight-medium);
  margin: 0 0 var(--ds-space-3);
}

.ds-modal p {
  font-size: var(--ds-text-body);
  color: var(--ds-color-text-secondary);
  line-height: var(--ds-leading-normal);
  margin: 0 0 var(--ds-space-4);
}

.ds-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--ds-space-2);
  margin-top: var(--ds-space-4);
}

.ds-candidate-list {
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-2);
  margin-bottom: var(--ds-space-4);
}

.ds-candidate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-3);
  min-height: 44px;
  padding: var(--ds-space-2) var(--ds-space-3);
  border: 1px solid var(--ds-color-border);
  border-radius: 8px;
  background: var(--ds-color-bg-subtle);
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: var(--ds-font-family);
  font-size: var(--ds-text-body);
  color: var(--ds-color-text);
}

.ds-candidate-row:hover,
.ds-candidate-row.ds-selected {
  border-color: var(--ds-color-accent);
  background: var(--ds-color-accent-subtle);
}

.ds-candidate-row .ds-candidate-reason {
  font-size: var(--ds-text-caption);
  color: var(--ds-color-text-tertiary);
}

.ds-result {
  font-family: var(--ds-font-family);
  font-size: var(--ds-text-body);
  line-height: var(--ds-leading-normal);
  white-space: pre-wrap;
  border-radius: 8px;
  padding: var(--ds-space-3);
  margin-top: var(--ds-space-3);
}

.ds-result-good {
  background: var(--ds-color-accent-subtle);
  color: var(--ds-color-text);
}

.ds-result-warn {
  background: color-mix(in srgb, var(--ds-color-warning) 12%, var(--ds-color-bg));
  color: var(--ds-color-text);
}

.ds-empty {
  font-size: var(--ds-text-body);
  color: var(--ds-color-text-secondary);
  text-align: center;
  padding: var(--ds-space-6) var(--ds-space-3);
  border: 1px dashed var(--ds-color-border);
  border-radius: 12px;
}

@media (min-width: 720px) {
  .ds-page {
    padding: 0 var(--ds-space-3);
  }
}

/* ===========================================================================
   Apple.com Top Navigation Bar + Hover Megamenu + Supervised Chatbot Widget
   =========================================================================== */

.apple-app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg-subtle);
}

.apple-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.2s ease;
}

@media (prefers-color-scheme: dark) {
  .apple-navbar {
    background: rgba(28, 28, 30, 0.85);
  }
}

:root[data-theme="dark"] .apple-navbar {
  background: rgba(28, 28, 30, 0.85);
}

.apple-nav-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.apple-nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 700;
  font-size: 1.05rem;
}

.apple-nav-brand .mark {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--color-accent);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
}

.apple-nav-menu {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
}

.apple-nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
  transition: color 0.15s ease;
}

.apple-nav-link:hover,
.apple-nav-link.active {
  color: var(--color-accent);
  text-decoration: none;
}

/* Hover Megamenu Dropdown */

.megamenu-trigger {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.apple-megamenu {
  position: absolute;
  top: 52px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: 680px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
  padding: 20px 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.25s ease;
  z-index: 1001;
}

.megamenu-trigger:hover .apple-megamenu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.megamenu-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.megamenu-header h4 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 2px;
  color: var(--color-text);
}

.megamenu-header p {
  font-size: 0.84rem;
  color: var(--color-text-secondary);
  margin: 0;
}

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

.megamenu-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--color-bg-subtle);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.megamenu-card:hover {
  background: var(--color-accent-subtle);
  border-color: var(--color-accent);
  transform: translateY(-1px);
}

.megamenu-card .icon {
  font-size: 1.25rem;
  line-height: 1;
}

.megamenu-card .cat {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-accent);
  letter-spacing: 0.04em;
}

.megamenu-card .title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text);
}

.megamenu-card .desc {
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  line-height: 1.35;
}

.apple-main-content {
  flex: 1;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* Supervised Delegate Smart Assistant Floating Chat Widget */

#delegate-chat-container,
#public-chat-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
}

/* Pre-login widget: a more formal, corporate navy identity — this is a prospect's first
   impression of the company, not a logged-in customer's day-to-day assistant, so it's deliberately
   more restrained than the accent-gradient "Delegate Assistant" bubble used post-login. */
#public-chat-container .chat-trigger-btn {
  background: #14315c;
  box-shadow: 0 8px 24px rgba(20, 49, 92, 0.35);
}
#public-chat-container .chat-trigger-btn:hover {
  background: #1c4374;
  box-shadow: 0 10px 28px rgba(20, 49, 92, 0.45);
}
#public-chat-container .chat-header {
  background: #14315c;
  border-bottom: 1px solid #14315c;
}
#public-chat-container .chat-title strong {
  color: #ffffff;
}
#public-chat-container .chat-subtitle {
  color: rgba(255, 255, 255, 0.72);
}
#public-chat-container .chat-avatar {
  background: #ffffff;
  color: #14315c;
}
#public-chat-container .chat-close-icon {
  color: rgba(255, 255, 255, 0.75);
}
#public-chat-container .chat-close-icon:hover {
  color: #ffffff;
}
#public-chat-container .chat-send {
  background: #14315c;
}
#public-chat-container .chat-send:hover {
  background: #1c4374;
}
#public-chat-container .chat-avatar {
  width: 38px;
  height: 38px;
  background: #1c4374;
}

/* Embedded CTA in the greeting — RealPage-style pill, deliberately in the warm accent so it
   contrasts with the formal navy chrome around it (the one warm touch inside an otherwise
   restrained widget, same signature color as the landing page's brand mark and hero glow). */
.chat-cta-inline {
  padding: 0 16px 14px;
}
.chat-cta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-warm);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 9px 18px;
  font-family: var(--font-family);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.chat-cta-pill:hover {
  background: color-mix(in srgb, var(--color-warm) 82%, black);
  transform: translateY(-1px);
}

.chat-mic-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--color-text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.chat-mic-btn:hover {
  background: var(--color-bg-subtle);
  color: var(--color-text);
}
.chat-mic-btn.listening {
  color: #fff;
  background: var(--color-danger);
  animation: dotPulse 1s ease-in-out infinite;
}

.chat-trigger-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--color-accent);
  color: #ffffff;
  font-family: var(--font-family);
  font-size: 0.92rem;
  font-weight: 600;
  border: none;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--color-accent) 35%, transparent);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.2s ease,
              background-color 0.2s ease;
}

.chat-trigger-btn:hover {
  transform: scale(1.04);
  background: var(--color-accent-hover);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--color-accent) 45%, transparent);
}

.chat-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 14px 14px;
  padding: 6px 8px 6px 16px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg);
}
.chat-input-row input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-family);
  font-size: 0.86rem;
  color: var(--color-text);
}
.chat-input-row input::placeholder {
  color: var(--color-text-tertiary);
}
.chat-input-row input:disabled {
  opacity: 0.6;
}
.chat-send {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s ease, transform 0.12s ease;
}
.chat-send:hover {
  background: var(--color-accent-hover);
}
.chat-send:active {
  transform: scale(0.94);
}
.chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-disclaimer {
  padding: 8px 16px 12px;
  font-size: 0.7rem;
  color: var(--color-text-tertiary);
  text-align: center;
  background: var(--color-bg);
}

.chat-drawer {
  position: absolute;
  bottom: 60px;
  right: 0;
  width: 380px;
  height: 520px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2001;
}

.chat-drawer.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(16px) scale(0.96);
}

.chat-header {
  padding: 16px 18px;
  background: var(--color-bg-subtle);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #ffffff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
}

.chat-title strong {
  display: block;
  font-size: 0.92rem;
  color: var(--color-text);
}

.chat-subtitle {
  font-size: 0.72rem;
  color: var(--color-text-secondary);
  display: block;
}

.chat-close-icon {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: var(--color-text-tertiary);
  cursor: pointer;
  padding: 4px;
}
.chat-close-icon:hover {
  color: var(--color-text);
}

.chat-messages-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--color-bg);
}

.chat-bubble {
  max-width: 85%;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.bot-bubble {
  background: var(--color-bg-subtle);
  color: var(--color-text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--color-border);
}

.user-bubble {
  background: var(--color-accent);
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-quick-actions {
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
}

.quick-title {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.chip-btn:hover {
  background: var(--color-accent-subtle);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.chat-task-result {
  font-size: 0.86rem;
}

.chat-task-result .result-title {
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--color-accent);
}

.chat-task-result .result-body {
  margin-bottom: 10px;
  color: var(--color-text);
}

.approval-box {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 6px;
}

.approval-note {
  font-size: 0.78rem;
  color: var(--color-warning);
  margin: 0 0 6px;
  font-weight: 600;
}

.approval-actions {
  display: flex;
  gap: 6px;
}

.status-done {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-success);
  margin-top: 4px;
}

@media (max-width: 720px) {
  .apple-nav-menu {
    gap: 12px;
  }
  .apple-nav-link {
    font-size: 0.82rem;
  }
  .apple-megamenu {
    width: 90vw;
    left: 5vw;
    transform: translateY(8px);
  }
  .megamenu-trigger:hover .apple-megamenu {
    transform: translateY(0);
  }
  .chat-drawer {
    width: calc(100vw - 32px);
    right: -8px;
    height: 480px;
  }
}

/* ===========================================================================
   Enterprise SaaS direction — topbar utility, stat cards, panels, status
   pills, and motion. See docs/DESIGN-SYSTEM.md. Sits alongside the .app-shell
   / .sidebar / .nav-link rules above; the .apple-* rules further up stay for
   the admin console only (renderAdminAppShell in layout.js).
   =========================================================================== */

.topbar-utility {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
  width: 240px;
  max-width: 40vw;
}

.icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  color: var(--ink-soft);
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.icon-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.icon-btn .ping {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bad);
  border: 1.5px solid var(--surface);
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.account-chip:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}
.account-chip .av {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(155deg, var(--accent), color-mix(in srgb, var(--accent) 55%, white));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.account-chip .chev {
  font-size: 0.62rem;
  color: var(--muted);
}

/* ---------- Stat cards ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 980px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-bar, var(--accent));
}
.stat-card .top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}
.stat-card .ic-chip {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  background: var(--chip-bg, var(--accent-soft));
  color: var(--chip-fg, var(--accent));
}
.stat-card .trend {
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
}
.stat-card .trend.up {
  color: var(--good);
}
.stat-card .trend.down {
  color: var(--bad);
}
.stat-card .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.65rem;
  font-weight: 600;
  display: block;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.stat-card .lbl {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 6px;
  font-weight: 500;
}

/* ---------- Panels (replaces bare .card for scannable lists) ---------- */

.body-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
}
@media (max-width: 980px) {
  .body-grid {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.panel + .panel {
  margin-top: 16px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.panel-head h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
}
.panel-head .link {
  font-size: 0.78rem;
  color: var(--accent-text);
  font-weight: 600;
  cursor: pointer;
}
.panel-body {
  padding: 6px 8px;
}

.task-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 8px;
  transition: background-color 0.15s ease;
}
.task-row:hover {
  background: var(--surface-2);
}
.task-row .ic-chip {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  background: var(--chip-bg, var(--surface-2));
  color: var(--chip-fg, var(--ink-soft));
}
.task-row .info {
  min-width: 0;
  flex: 1;
}
.task-row .title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-row .meta {
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 1px;
}

.status-chip {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 9px;
  border-radius: 999px;
  flex-shrink: 0;
}
.status-chip.st-good {
  background: var(--good-soft);
  color: var(--good);
}
.status-chip.st-warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.status-chip.st-bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.status-chip.st-wait {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.quick-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}
.quick-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}
.quick-item:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateX(2px);
}
.quick-item .ic {
  font-size: 1.05rem;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.quick-item:hover .ic {
  transform: scale(1.12);
}
.quick-item .t {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
}
.quick-item .d {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 1px;
}
.quick-item .arrow {
  margin-left: auto;
  color: var(--muted);
}

.seg-control {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.seg-control button {
  font-family: var(--font-family);
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
}
.seg-control button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-card);
}

/* ---------- Chat widget: online status + typing indicator ---------- */

.chat-avatar {
  position: relative;
}
.chat-avatar .online {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--good);
  border: 2px solid var(--color-bg-subtle);
}

.typing-dots {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  padding: 2px 3px;
}
.typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  animation: dotPulse 1.1s ease-in-out infinite;
}
.typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}
.typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

#delegate-chat-trigger {
  position: relative;
}
#delegate-chat-trigger::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  animation: ringPulse 2.4s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

/* ---------- Motion: entrance + interaction polish ---------- */

@keyframes fadeUpIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes ringPulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 35%, transparent);
  }
  100% {
    box-shadow: 0 0 0 10px transparent;
  }
}
@keyframes dotPulse {
  0%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.sidebar,
.topbar-utility,
.page-head,
.stat-card,
.panel {
  animation: fadeUpIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.stat-grid .stat-card:nth-child(1) {
  animation-delay: 60ms;
}
.stat-grid .stat-card:nth-child(2) {
  animation-delay: 100ms;
}
.stat-grid .stat-card:nth-child(3) {
  animation-delay: 140ms;
}
.stat-grid .stat-card:nth-child(4) {
  animation-delay: 180ms;
}
.body-grid .panel {
  animation-delay: 200ms;
}

.stat-card,
.panel {
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease;
}
.stat-card:hover,
.panel:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .topbar-utility,
  .page-head,
  .stat-card,
  .panel {
    animation: none;
  }
  .stat-card,
  .panel,
  .quick-item,
  .typing-dots span,
  #delegate-chat-trigger::after {
    transition: none;
    animation: none;
  }
}

/* ===========================================================================
   Marketing / pre-login page (web/src/pages/welcome.js) — the only page in
   this app that isn't the operational tool, so it gets a full-bleed layout
   instead of the sidebar shell. Namespaced .mkt-* throughout.
   =========================================================================== */

.mkt-page {
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.mkt-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.mkt-nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.mkt-nav-talk {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.18s ease;
}
.mkt-nav-talk:hover {
  color: var(--color-warm);
  text-decoration: none;
}
@media (max-width: 560px) {
  .mkt-nav-talk {
    display: none;
  }
}
.mkt-nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
}
.mkt-nav-links a {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.18s ease;
}
.mkt-nav-links a:hover {
  color: var(--accent-text);
  text-decoration: none;
}
@media (max-width: 720px) {
  .mkt-nav-links {
    display: none;
  }
}

.mkt-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
}
.mkt-mobile-toggle .bar {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink-soft);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.mkt-mobile-toggle.open .bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.mkt-mobile-toggle.open .bar:nth-child(2) {
  opacity: 0;
}
.mkt-mobile-toggle.open .bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}
.mkt-mobile-panel {
  display: none;
  flex-direction: column;
  max-height: 0;
  overflow: hidden;
  border-top: 1px solid transparent;
  background: var(--surface);
  transition: max-height 0.24s ease;
}
.mkt-mobile-panel a,
.mkt-mobile-panel button {
  padding: 13px 24px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.mkt-mobile-panel button {
  margin: 12px 24px 16px;
  border-bottom: none;
  width: calc(100% - 48px);
}
@media (max-width: 720px) {
  .mkt-mobile-toggle {
    display: inline-flex;
  }
  .mkt-mobile-panel.open {
    display: flex;
    max-height: 80vh;
    overflow-y: auto;
    border-top-color: var(--border);
  }
}

.mkt-nav-item {
  position: relative;
  height: 62px;
  display: flex;
  align-items: center;
}
.mkt-nav-disabled {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
  cursor: default;
  display: inline-flex;
  align-items: center;
  user-select: none;
}
.mkt-nav-item > a .chev {
  display: inline-block;
  font-size: 0.7rem;
  margin-left: 2px;
  color: var(--muted);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.mkt-nav-item.open > a .chev {
  transform: rotate(180deg);
}

.mkt-nav-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  width: min(760px, 88vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 22px 6px 22px 22px;
  display: grid;
  grid-template-columns: 1fr 1fr 1.1fr;
  gap: 4px 28px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(calc(-50% - 40px)) translateY(8px);
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s ease;
}
.mkt-nav-item.open .mkt-nav-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(calc(-50% - 40px)) translateY(10px);
}

.mkt-nav-dropdown-sm {
  width: min(420px, 88vw);
  grid-template-columns: 1fr 1.15fr;
}

.mkt-mega-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mkt-mega-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mkt-mega-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 16px;
}
.mkt-mega-head {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0 10px 10px;
}
.mkt-mega-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.mkt-mega-link:hover {
  background: var(--surface-2);
  color: var(--ink);
  text-decoration: none;
}
.mkt-mega-link .ic {
  font-size: 0.92rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.mkt-mega-feature {
  background: linear-gradient(155deg, var(--accent), color-mix(in srgb, var(--accent) 65%, #0c1f36));
  border-radius: 12px;
  padding: 20px;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-self: stretch;
}
.mkt-mega-feature h4 {
  color: #fff;
  font-size: 1.02rem;
  margin: 6px 0 6px;
}
.mkt-mega-feature p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.82rem;
  line-height: 1.5;
  margin: 0 0 16px;
  flex: 1;
}
.mkt-mega-feature .btn {
  align-self: flex-start;
  background: #fff;
  color: var(--accent-hover);
  min-height: 36px;
  padding: 0 14px;
}
.mkt-mega-feature .btn:hover {
  background: rgba(255, 255, 255, 0.9);
}

@media (max-width: 860px) {
  .mkt-nav-dropdown {
    grid-template-columns: 1fr 1fr;
  }
  .mkt-mega-feature {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mkt-nav-dropdown,
  .mkt-nav-item > a .chev {
    transition: none;
  }
}

.mkt-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 112px 24px;
}
.mkt-section-tight {
  padding-top: 88px;
  padding-bottom: 88px;
}
.mkt-section-head {
  max-width: 620px;
  margin: 0 auto 72px;
  text-align: center;
}
.mkt-section-head h2 {
  font-size: var(--text-hero);
  letter-spacing: -0.01em;
}
.mkt-section-head p {
  font-size: 1.02rem;
  margin-top: 8px;
}
.mkt-glossary-line {
  display: block;
  max-width: 46ch;
  margin: 20px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.6;
}
.mkt-glossary-line strong {
  color: var(--accent-text);
}

/* ---------- Hero ---------- */

.mkt-hero-wrap {
  position: relative;
  overflow: hidden;
}
/* Two stacked videos cross-fade into each other so the two clips read as
   one continuous loop instead of a hard cut. Both play at full clarity —
   the softening comes from the frosted-glass pane in front of them, not
   from blurring/dimming the footage itself. */
.mkt-hero-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.mkt-hero-bg-video.is-active {
  opacity: 1;
}
/* Light color-grading pass over the video, not a frosted pane — the earlier version
   (blur(22px) + a 40%-opacity tint) obscured the footage almost entirely. This keeps the video
   sharp and clearly visible; text legibility instead comes from .mkt-hero-copy's own backdrop
   below, the way RealPage's actual hero handles it (a crisp visible video, with a light panel
   behind the headline itself rather than a wash over the whole frame). */
.mkt-hero-bg-glass {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: color-mix(in srgb, var(--bg) 12%, transparent);
  backdrop-filter: saturate(1.08);
  -webkit-backdrop-filter: saturate(1.08);
}
.mkt-hero-bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    180deg,
    transparent 0%,
    transparent 60%,
    var(--bg) 97%
  );
}
@media (prefers-reduced-motion: reduce) {
  .mkt-hero-bg-video {
    display: none;
  }
  .mkt-hero-bg-glass {
    background: var(--bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

.mkt-hero {
  position: relative;
  z-index: 3;
  max-width: 1400px;
  margin: 0 auto;
  padding: 100px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 64px;
  align-items: center;
}
/* Legibility panel behind the headline column only — not a wash over the whole hero — so the
   video itself stays fully visible everywhere else (behind the preview card, in the margins). */
.mkt-hero-copy {
  position: relative;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 24px;
  padding: 32px 36px;
  margin: -32px -36px;
}
@media (max-width: 640px) {
  .mkt-hero-copy {
    /* Smaller screens have less room for the video to read through anyway —
       keep it more opaque there so text stays comfortably legible. */
    background: color-mix(in srgb, var(--bg) 78%, transparent);
  }
}
.mkt-hero::before,
.mkt-hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}
.mkt-hero::before {
  top: -40px;
  right: 40px;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 68%);
}
.mkt-hero::after {
  top: 160px;
  right: 340px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, var(--color-warm-subtle) 0%, transparent 72%);
  opacity: 0.8;
}
@media (max-width: 980px) {
  .mkt-hero::before,
  .mkt-hero::after {
    display: none;
  }
}
@media (max-width: 980px) {
  .mkt-hero {
    grid-template-columns: 1fr;
  }
}
.mkt-hero h1 {
  font-size: 2.6rem;
  line-height: 1.22;
  letter-spacing: -0.015em;
  margin: 14px 0 18px;
}
@media (max-width: 640px) {
  .mkt-hero h1 {
    font-size: 2rem;
  }
}
@media (max-width: 400px) {
  .mkt-hero h1 {
    font-size: 1.72rem;
  }
}
.mkt-hero-audience {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--accent-text);
  margin: 0 0 22px;
}
.mkt-hero p.lead {
  font-size: 1.08rem;
  color: var(--ink-soft);
  max-width: 52ch;
  line-height: 1.6;
}
.mkt-hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.mkt-hero-actions .btn {
  height: 46px;
  padding: 0 22px;
}
.mkt-hero-link {
  display: inline-block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-top: 22px;
  cursor: pointer;
}
.mkt-hero-link:hover {
  color: var(--accent-text);
  text-decoration: none;
}

.mkt-hero-visual {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 16px;
  transform: rotate(1deg);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.mkt-hero-visual:hover {
  transform: rotate(0deg);
}
.mkt-preview-tag {
  position: absolute;
  top: -11px;
  right: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
  box-shadow: var(--shadow-card);
}
.mkt-hero-visual .mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
.mkt-hero-visual .stat-card {
  padding: 12px 14px;
  box-shadow: none;
}
.mkt-hero-visual .stat-card .num {
  font-size: 1.3rem;
}
.mkt-hero-visual .panel {
  box-shadow: none;
}
.mkt-hero-visual .panel-head {
  padding: 11px 14px;
}
.mkt-hero-visual .panel-head h3 {
  font-size: 0.82rem;
}
.mkt-hero-visual .task-row {
  padding: 8px 10px;
}

/* ---------- Value strip: three short claims right under the hero ---------- */

.mkt-value-strip {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 120px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 44px;
}
@media (max-width: 860px) {
  .mkt-value-strip {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}
.mkt-value-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.mkt-value-item .ic-chip {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--chip-bg, var(--accent-soft));
  color: var(--chip-fg, var(--accent));
}
.mkt-value-item h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 3px;
}
.mkt-value-item p {
  font-size: 0.8rem;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0;
}

/* ---------- Pillars / feature grid ---------- */

.mkt-pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
@media (max-width: 860px) {
  .mkt-pillars {
    grid-template-columns: repeat(2, 1fr);
  }
}
.mkt-pillar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 26px;
  box-shadow: var(--shadow-card);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease, border-color 0.18s ease;
}
.mkt-pillar-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
.mkt-pillar-card .ic-chip {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 1.1rem;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--chip-bg, var(--accent-soft));
  color: var(--chip-fg, var(--accent));
}
.mkt-pillar-card h3 {
  font-size: 1.02rem;
  margin-bottom: 8px;
}
.mkt-pillar-card p {
  font-size: 0.87rem;
  line-height: 1.6;
  margin: 0;
}

/* ---------- Solutions / tiers ---------- */

.mkt-tier-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
@media (max-width: 1080px) {
  .mkt-tier-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .mkt-tier-grid {
    grid-template-columns: 1fr;
  }
}
.mkt-tier-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: var(--shadow-card);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease, border-color 0.18s ease;
}
.mkt-tier-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
.mkt-tier-card.is-highlighted {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.mkt-tier-card.mkt-tier-featured {
  border-color: var(--accent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 6%, var(--surface)), var(--surface));
}
.mkt-tier-ribbon {
  position: absolute;
  top: -11px;
  left: 22px;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 10px;
  border-radius: 999px;
}
.mkt-tier-name {
  font-size: 1.15rem;
  font-weight: 700;
}
.mkt-tier-tagline {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0;
}
.mkt-tier-desc {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0;
}
.mkt-tier-meta {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 4px;
}
.mkt-tier-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 2px;
}
.mkt-tier-chip {
  font-size: 0.72rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 9px;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.mkt-tier-chip .new-tag {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--good);
  background: var(--good-soft);
  border-radius: 999px;
  padding: 1px 5px;
}
.mkt-tier-for {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 4px 0 8px;
}
.mkt-tier-for strong {
  color: var(--ink-soft);
}

/* ---------- Charms ---------- */

.mkt-charms-block {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.mkt-charms-note {
  max-width: 68ch;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 22px;
}
.mkt-charms-note strong {
  color: var(--ink);
}
.mkt-charms-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 860px) {
  .mkt-charms-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.mkt-charm-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.mkt-charm-card .ic-chip {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.mkt-charm-card .t {
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.mkt-charm-card .d {
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
}

/* ---------- Steps ---------- */

.mkt-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
}
@media (max-width: 860px) {
  .mkt-steps {
    grid-template-columns: 1fr;
  }
}
.mkt-step {
  position: relative;
  padding-left: 46px;
}
.mkt-step .step-num {
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mkt-step h3 {
  font-size: 0.98rem;
  margin-bottom: 4px;
}
.mkt-step p {
  font-size: 0.86rem;
  margin: 0;
}

/* ---------- Delegate catalog grid ---------- */

.mkt-delegate-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
@media (max-width: 860px) {
  .mkt-delegate-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px) {
  .mkt-delegate-grid {
    grid-template-columns: 1fr;
  }
}
.mkt-delegate-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.18s ease;
}
.mkt-delegate-card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.mkt-delegate-card .ic {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--chip-bg, var(--accent-soft));
  color: var(--chip-fg, var(--accent));
}
.mkt-delegate-card .t {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
}
.mkt-delegate-card .d {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.4;
}

/* ---------- Trust / permission-model section ---------- */

.mkt-trust {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 860px) {
  .mkt-trust {
    grid-template-columns: 1fr;
  }
}
.mkt-trust-legend {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 6px;
}
.mkt-trust-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 20px 22px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.mkt-trust-row:hover,
.mkt-trust-row:focus-visible {
  background: var(--surface-2);
  outline: none;
}
.mkt-trust-row .lbl {
  flex: 1 1 100%;
  font-size: 0.86rem;
  color: var(--ink-soft);
}
.mkt-trust-row .chev {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--muted);
  transition: transform 0.18s ease;
}
.mkt-trust-row.open .chev {
  transform: rotate(180deg);
}
.mkt-trust-enum {
  font-size: 0.68rem;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
}
@media (min-width: 480px) {
  .mkt-trust-row .lbl {
    flex: 1 1 auto;
  }
}
.mkt-trust-detail {
  max-height: 0;
  overflow: hidden;
  padding: 0 22px;
  border-bottom: 1px solid var(--border);
  transition: max-height 0.22s ease, padding 0.22s ease;
}
.mkt-trust-detail.open {
  max-height: 160px;
  padding: 0 22px 18px;
}
.mkt-trust-detail p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--muted);
}
.mkt-trust-detail:last-of-type {
  border-bottom: none;
}

/* ---------- FAQ accordion ---------- */

.mkt-faq {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.mkt-faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.mkt-faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  background: transparent;
  border: none;
  text-align: left;
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}
.mkt-faq-q .chev {
  color: var(--muted);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}
.mkt-faq-item.open .mkt-faq-q .chev {
  transform: rotate(180deg);
}
.mkt-faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.mkt-faq-item.open .mkt-faq-a {
  max-height: 240px;
}
.mkt-faq-a p {
  padding: 0 18px 16px;
  font-size: 0.87rem;
  margin: 0;
}

/* ---------- CTA banner ---------- */

.mkt-cta-banner {
  max-width: 1400px;
  margin: 0 auto 84px;
  padding: 48px 40px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent-soft), var(--surface) 75%);
  border: 1px solid var(--accent-soft-strong, var(--border));
  text-align: center;
}
.mkt-cta-banner h2 {
  font-size: 1.7rem;
  margin-bottom: 8px;
}
.mkt-cta-banner p {
  max-width: 48ch;
  margin: 0 auto 22px;
}

/* ---------- Footer ---------- */

.mkt-footer {
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.mkt-footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 48px 24px 28px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
}
@media (max-width: 720px) {
  .mkt-footer-inner {
    grid-template-columns: 1fr;
  }
}
.mkt-footer-col h4 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 12px;
}
.mkt-footer-col a,
.mkt-footer-col p {
  display: block;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 8px;
  cursor: pointer;
}
.mkt-footer-col a:hover {
  color: var(--accent-text);
}
.mkt-footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px 24px 28px;
  border-top: 1px solid var(--border);
  font-size: 0.76rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Demo page (virtual client walkthrough) ---------- */

.demo-page {
  background: var(--surface-2);
  min-height: 100vh;
}
.demo-banner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.demo-banner .ic-chip {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.demo-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 24px 60px;
}
.demo-client-head {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-card);
}
.demo-client-head h1 {
  font-size: 1.5rem;
  margin: 4px 0 2px;
}
.demo-client-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}
.demo-body-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 22px;
  align-items: start;
}
.demo-picker {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 20px;
}
@media (max-width: 860px) {
  .demo-body-grid {
    grid-template-columns: 1fr;
  }
  .demo-picker {
    /* Sticky made sense as a side column tracking a taller main panel; stacked full-width
       above the scenario detail on mobile, the ~9-item list stayed pinned to the top of the
       screen while scrolling through the rest of the demo, covering everything beneath it. */
    position: static;
    max-height: none;
  }
}
.demo-picker-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 8px 10px 4px;
}
.demo-pick-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--ink);
  transition: background-color 0.15s ease;
}
.demo-pick-item:hover {
  background: var(--surface-2);
}
.demo-pick-item.active {
  background: var(--accent-soft);
}
.demo-pick-item .ic-chip {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--ink-soft);
  flex-shrink: 0;
}
.demo-pick-item.active .ic-chip {
  background: var(--accent);
  color: #fff;
}
.demo-pick-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.demo-pick-body .t {
  font-size: 0.84rem;
  font-weight: 600;
}
.demo-pick-body .d {
  font-size: 0.72rem;
  color: var(--muted);
}
.demo-pick-status {
  font-size: 0.62rem;
  padding: 2px 6px;
  flex-shrink: 0;
}
.demo-scenario {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 26px;
}
.demo-scenario-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.demo-scenario-head h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}
.demo-trigger {
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--ink-soft);
  background: var(--surface-2);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 14px;
}
.demo-trigger strong {
  color: var(--ink);
}
.demo-charms {
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.demo-draft {
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.demo-draft-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 8px;
}
.demo-draft-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.86rem;
  line-height: 1.7;
  color: var(--ink);
}
.demo-action {
  display: flex;
  align-items: center;
}
.demo-thinking {
  font-size: 0.84rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.demo-thinking .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  animation: demo-pulse 1s infinite ease-in-out;
}
.demo-thinking .dot:nth-child(2) {
  animation-delay: 0.15s;
}
.demo-thinking .dot:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes demo-pulse {
  0%, 80%, 100% {
    opacity: 0.25;
    transform: scale(0.85);
  }
  40% {
    opacity: 1;
    transform: scale(1.15);
  }
}
.demo-footnote {
  max-width: 72ch;
  margin: 26px auto 0;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
}
