/* ============================================
   Summit Automations — Global Stylesheet
   Dark Terminal / Hacker Aesthetic
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300&family=Instrument+Sans:wght@400;500;600&display=swap');

/* ============================================
   1. CSS Custom Properties
   ============================================ */
:root {
  /* Premium SaaS dark theme — Linear / Vercel / Arc tier.
     Per design spec: #161B2C cards on #0F121B background with soft borders.
     Card bg is brighter than page bg for clear depth contrast. */
  --bg-primary: #0F121B;          /* page bg */
  --bg-secondary: #131727;        /* sidebar / topbar / sub-surfaces */
  --bg-tertiary: #161B2C;         /* inputs, nested surfaces */
  --bg-card: #161B2C;             /* default card base */
  --bg-elevated: #1B2238;         /* hovered or selected cards */
  --bg-hover: #1F2742;            /* row + button hover */

  /* Summit blue — the brand color. Reserved for CTAs, the one hero stat,
     focus rings, active nav, and KPI accents. */
  --accent: #00D4FF;
  --accent-bright: #4DE8FF;
  --accent-deep: #0099CC;
  --accent-dim: rgba(0, 212, 255, 0.10);
  --accent-glow: rgba(0, 212, 255, 0.25);

  /* Borders — the secret to looking expensive. */
  --border-color: #252E4A;
  --border-soft: rgba(255, 255, 255, 0.06);
  --border-strong: #2F3A5C;
  --border-accent: rgba(0, 212, 255, 0.45);

  --text-primary: #EDF1F7;        /* near-white */
  --text-secondary: #B4BBCC;
  --text-dim: #7782A0;
  --text-muted: #515B78;
  --text-white: #FFFFFF;

  /* Semantic Colors — use STRICTLY:
       success → completed/positive state only (paid, active, +NOI)
       warning → soft attention, won't block flow
       danger  → things actually broken / overdue / requires action
  */
  --color-success: #2BCB7F;       /* slightly desaturated from #00FF88 — less neon */
  --color-success-bg: rgba(43, 203, 127, 0.08);
  --color-warning: #F2B342;
  --color-warning-bg: rgba(242, 179, 66, 0.08);
  --color-danger: #F5536C;
  --color-danger-bg: rgba(245, 83, 108, 0.08);

  /* Typography */
  /* Inter for everything — the Linear / Vercel / Stripe house font.
     The OS font stack is the fallback if Inter fails to load. */
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;

  --font-xs: 0.75rem;
  --font-sm: 0.875rem;
  --font-base: 1rem;
  --font-lg: 1.125rem;
  --font-xl: 1.25rem;
  --font-2xl: 1.5rem;
  --font-3xl: 1.875rem;
  --font-4xl: 2.25rem;
  --font-5xl: 3rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Shadows — layered depth like Linear / Vercel. Inset highlight on top edge
     creates a "polished aluminium" feel that flat dark UIs miss. */
  --glow-sm: 0 0 0 1px rgba(0, 212, 255, 0.18);
  --glow-md: 0 0 0 1px rgba(0, 212, 255, 0.35);
  --glow-lg: 0 0 0 2px rgba(0, 212, 255, 0.30);
  --shadow-card:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 1px 2px rgba(0, 0, 0, 0.40),
    0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-card-hover:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 8px rgba(0, 0, 0, 0.45),
    0 16px 48px rgba(0, 0, 0, 0.55);
  --shadow-elevated:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 8px 24px rgba(0, 0, 0, 0.45),
    0 24px 64px rgba(0, 0, 0, 0.55);
  --shadow-accent: 0 4px 14px rgba(0, 212, 255, 0.42), 0 1px 3px rgba(0, 212, 255, 0.25);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* Layout */
  --sidebar-width: 300px;
  --header-height: 56px;
  --container-max: 1200px;

  /* ──── DESIGN SYSTEM v2 (added in Phase 1e, 2026-06-04) ────
     Disciplined Linear-style primitives. New components go here;
     existing component CSS keeps working until each is migrated. */

  /* Radii — pick three, use everywhere. Production today has 0/4/6/8/12/14/16/20 in inline styles. */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 12px;

  /* Borders — single source of truth for hairline / strong / accent */
  --hairline: 1px solid var(--border-soft);
  --hairline-strong: 1px solid var(--border-color);
  --hairline-accent: 1px solid var(--border-accent);

  /* Surfaces — semantic names so components don't reach for raw bg-* tokens */
  --surface-page: var(--bg-primary);
  --surface-card: var(--bg-secondary);
  --surface-elevated: var(--bg-elevated);
  --surface-input: var(--bg-tertiary);

  /* Z-stack — explicit so we stop guessing */
  --z-base: 1;
  --z-sticky: 100;
  --z-overlay: 500;
  --z-modal: 1000;
  --z-toast: 2000;
}

/* ──── DESIGN SYSTEM v2 — COMPONENT PRIMITIVES ────
   Drop-in replacements for the 480 inline-styled equivalents scattered
   through templates. Migrate to these gradually; once a section is
   migrated, kill the inline styles.
*/

/* Button system v2 — replaces the 3 coexisting button taxonomies
   (.btn .btn-*, standalone .btn-primary, and inline button styles).
   Mark a button with .ds-btn to opt into v2.
*/
.ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  font-family: var(--font-body);
  font-size: var(--font-sm);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}
.ds-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ds-btn--primary {
  background: var(--text-white);
  color: var(--bg-primary);
}
.ds-btn--primary:hover { background: var(--text-primary); }
.ds-btn--secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.ds-btn--secondary:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.ds-btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-color);
}
.ds-btn--ghost:hover { color: var(--text-white); border-color: var(--border-strong); }
.ds-btn--accent {
  background: var(--accent);
  color: var(--bg-primary);
  font-weight: 600;
}
.ds-btn--accent:hover { background: var(--accent-bright); }
.ds-btn--danger {
  background: var(--color-danger);
  color: var(--text-white);
}
.ds-btn--lg { padding: 12px 22px; font-size: var(--font-base); }
.ds-btn--sm { padding: 6px 12px; font-size: var(--font-xs); }
.ds-btn--block { width: 100%; }

/* Callout system v2 — replaces the 3 hand-rolled amber callouts.
   Single component, four variants. */
.ds-callout {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  border-left-width: 3px;
  background: var(--surface-card);
  font-size: var(--font-sm);
  line-height: 1.6;
  color: var(--text-secondary);
}
.ds-callout strong { color: var(--text-white); font-weight: 600; }
.ds-callout--info    { border-left-color: var(--accent);        background: rgba(0, 212, 255, 0.04); }
.ds-callout--warning { border-left-color: var(--color-warning); background: rgba(242, 179, 66, 0.04); }
.ds-callout--success { border-left-color: var(--color-success); background: rgba(43, 203, 127, 0.04); }
.ds-callout--danger  { border-left-color: var(--color-danger);  background: rgba(245, 83, 108, 0.04); }
.ds-callout-title {
  display: block;
  color: var(--text-white);
  font-weight: 600;
  margin-bottom: 4px;
  font-size: var(--font-sm);
}

/* Empty state v2 — first-class component with icon, title, copy, CTA.
   Replaces the "No items yet" text strings in 12+ dashboard views.
*/
.ds-empty {
  text-align: center;
  padding: 56px 24px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-color);
  background: var(--surface-card);
}
.ds-empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 212, 255, 0.06);
  border: 1px solid rgba(0, 212, 255, 0.20);
  border-radius: 50%;
  color: var(--accent);
}
.ds-empty-icon svg { width: 24px; height: 24px; }
.ds-empty-title {
  font-size: var(--font-lg);
  font-weight: 600;
  color: var(--text-white);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.ds-empty-body {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin: 0 auto 20px;
  max-width: 360px;
  line-height: 1.55;
}
.ds-empty-actions {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Skeleton loader v2 — replaces "Loading..." text strings.
   Use .ds-skel for a single bar; combine vertically for a row of bars. */
@keyframes ds-skel-shimmer {
  0%   { background-position:  200% 0; }
  100% { background-position: -200% 0; }
}
.ds-skel {
  display: block;
  height: 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 0%,
    var(--bg-hover) 50%,
    var(--bg-tertiary) 100%
  );
  background-size: 200% 100%;
  animation: ds-skel-shimmer 1.4s infinite linear;
}
.ds-skel + .ds-skel { margin-top: 10px; }
.ds-skel--lg { height: 22px; }
.ds-skel--sm { height: 10px; }
.ds-skel-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0;
}

/* Hero v2 — Linear-style hero composition.
   Tight, dense, product-forward. Generous typography. */
.ds-hero {
  padding: 96px 32px 64px;
  text-align: left;
  max-width: 1120px;
  margin: 0 auto;
}
.ds-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--surface-card);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text-secondary);
  margin-bottom: 26px;
}
.ds-hero-eyebrow .ds-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 8px rgba(43, 203, 127, 0.6);
}
.ds-hero-h1 {
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--text-white);
  font-weight: 600;
  margin: 0 0 22px;
  max-width: 900px;
}
.ds-hero-h1 em {
  font-style: normal;
  color: inherit;
}
.ds-hero-sub {
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 0 32px;
}
.ds-hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}
.ds-hero-meta {
  font-size: var(--font-sm);
  color: var(--text-dim);
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
}
.ds-hero-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ds-hero-meta-item::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
}
.ds-hero-meta-item:first-child::before { display: none; }

/* Hero product card — the visual that "shows what we actually do" */
.ds-hero-product {
  margin-top: 56px;
  border-radius: var(--radius-lg);
  border: var(--hairline-strong);
  background: var(--surface-card);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.20);
}
.ds-hero-product-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: var(--hairline-strong);
  background: var(--surface-elevated);
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}
.ds-hero-product-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg-hover);
  flex-shrink: 0;
}
.ds-hero-product-dot:nth-child(2) { background: var(--bg-hover); }
.ds-hero-product-dot:nth-child(3) { background: var(--bg-hover); }
.ds-hero-product-url {
  margin-left: 14px;
  padding: 3px 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}
.ds-hero-product-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: 380px;
}
.ds-hero-product-pane {
  padding: 22px;
}
.ds-hero-product-pane + .ds-hero-product-pane {
  border-left: var(--hairline-strong);
}
.ds-hero-product-label {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-bottom: 12px;
  font-family: var(--font-mono);
}
@media (max-width: 720px) {
  .ds-hero-product-body { grid-template-columns: 1fr; }
  .ds-hero-product-pane + .ds-hero-product-pane { border-left: none; border-top: var(--hairline-strong); }
  .ds-hero { padding: 64px 20px 40px; }
}

/* Section primitives — replace .section-wrap / .pricing-bg / .why-section sprawl */
.ds-section {
  padding: 88px 32px;
  max-width: 1120px;
  margin: 0 auto;
}
.ds-section--narrow { max-width: 760px; }
.ds-section--wide   { max-width: 1280px; }
.ds-section--surface { background: var(--surface-card); }
.ds-section-head { text-align: left; margin-bottom: 48px; }
.ds-section-head--center { text-align: center; max-width: 640px; margin-left: auto; margin-right: auto; margin-bottom: 56px; }
.ds-section-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--accent);
  margin-bottom: 12px;
}
.ds-section-h2 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--text-white);
  font-weight: 600;
  margin: 0 0 14px;
}
.ds-section-h2 em { font-style: normal; color: inherit; }
.ds-section-lead {
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0;
}
.ds-section-head--center .ds-section-lead { margin-left: auto; margin-right: auto; }
@media (max-width: 720px) { .ds-section { padding: 56px 20px; } }

/* Pricing grid + card — replace .pricing-grid + .price-card */
.ds-pricing { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1120px) { .ds-pricing { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .ds-pricing { grid-template-columns: 1fr; } }
.ds-price-card {
  display: flex;
  flex-direction: column;
  padding: 28px 22px;
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-base), background var(--transition-base);
}
.ds-price-card:hover { border-color: var(--border-strong); }
.ds-price-card--featured {
  border-color: rgba(0, 212, 255, 0.45);
  background: linear-gradient(180deg, rgba(0, 212, 255, 0.04), var(--surface-card) 70%);
  position: relative;
}
.ds-price-card--featured::before {
  content: "Most operators";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 10px;
  background: var(--accent);
  color: var(--bg-primary);
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  white-space: nowrap;
}
.ds-price-name { font-size: 14px; color: var(--text-white); font-weight: 600; margin-bottom: 4px; }
.ds-price-tag { font-size: 12.5px; color: var(--text-dim); margin-bottom: 22px; line-height: 1.45; min-height: 36px; }
.ds-price-amt { display: flex; align-items: baseline; gap: 4px; margin-bottom: 4px; }
.ds-price-currency { font-size: 18px; color: var(--text-white); font-weight: 500; }
.ds-price-num { font-size: 40px; line-height: 1; color: var(--text-white); font-weight: 700; letter-spacing: -0.03em; }
.ds-price-period { font-size: 13px; color: var(--text-dim); margin-bottom: 22px; }
.ds-price-features {
  list-style: none;
  padding: 18px 0 22px;
  margin: 0 0 18px;
  border-top: var(--hairline);
  border-bottom: var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.ds-price-features li { display: flex; gap: 8px; align-items: flex-start; }
.ds-price-features li::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-top: 3px;
  flex-shrink: 0;
  background: rgba(43, 203, 127, 0.10);
  border: 1px solid rgba(43, 203, 127, 0.25);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%232BCB7F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='2,6 5,9 10,3'/></svg>");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 9px;
}
.ds-price-card .ds-btn { margin-top: auto; }

/* Comparison table — replace the manual grid sprawl in pricing section */
.ds-compare {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-card);
}
.ds-compare-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  border-bottom: var(--hairline);
}
.ds-compare-row:last-child { border-bottom: none; }
.ds-compare-cell {
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text-secondary);
  border-left: var(--hairline);
}
.ds-compare-cell:first-child { border-left: none; color: var(--text-primary); }
.ds-compare-row--head .ds-compare-cell {
  background: var(--surface-elevated);
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.04em;
  font-weight: 600;
  text-align: center;
}
.ds-compare-row--head .ds-compare-cell:first-child { text-align: left; }
.ds-compare-row:not(.ds-compare-row--head) .ds-compare-cell:not(:first-child) { text-align: center; }
.ds-compare-cell--us {
  background: rgba(0, 212, 255, 0.04);
  color: var(--text-white);
}
.ds-compare-row--head .ds-compare-cell--us { color: var(--accent); }
.ds-compare-cell strong { color: var(--text-white); }
@media (max-width: 720px) {
  .ds-compare-row { grid-template-columns: 1fr; }
  .ds-compare-cell { border-left: none; border-top: var(--hairline); text-align: left !important; }
  .ds-compare-cell:first-child { background: var(--surface-elevated); font-weight: 600; }
  .ds-compare-row--head { display: none; }
}

/* FAQ accordion — replace .faq-wrap / .faq-item / .faq-q / .faq-a */
.ds-faq {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  overflow: hidden;
}
.ds-faq-item { border-bottom: var(--hairline-strong); }
.ds-faq-item:last-child { border-bottom: none; }
.ds-faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px;
  background: transparent;
  border: none;
  text-align: left;
  font-family: var(--font-body);
  font-size: 15.5px;
  font-weight: 500;
  color: var(--text-white);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.ds-faq-q:hover { background: var(--surface-elevated); }
.ds-faq-q::after {
  content: "+";
  font-size: 22px;
  color: var(--text-dim);
  font-weight: 300;
  flex-shrink: 0;
  line-height: 1;
}
.ds-faq-item.is-open .ds-faq-q::after { content: "−"; color: var(--accent); }
.ds-faq-a {
  padding: 0 24px;
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow), padding var(--transition-slow);
}
.ds-faq-item.is-open .ds-faq-a { max-height: 800px; padding: 0 24px 22px; }
.ds-faq-a p { font-size: 14.5px; line-height: 1.65; color: var(--text-secondary); margin: 0 0 8px; }
.ds-faq-a p:last-child { margin-bottom: 0; }
.ds-faq-a a { color: var(--accent); text-decoration: none; }
.ds-faq-a a:hover { text-decoration: underline; }
.ds-faq-a strong { color: var(--text-white); font-weight: 600; }

/* Footer CTA */
.ds-cta {
  text-align: center;
  padding: 96px 32px;
  border-top: var(--hairline-strong);
  background: linear-gradient(180deg, var(--surface-page), var(--surface-card));
}
.ds-cta h2 {
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.1;
  color: var(--text-white);
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0 0 16px;
}
.ds-cta p {
  font-size: 17px;
  color: var(--text-secondary);
  margin: 0 auto 28px;
  max-width: 560px;
}
.ds-cta-fine { font-size: 13px; color: var(--text-dim); margin-top: 18px; }

/* Monthly / annual pricing toggle */
.ds-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: 999px;
}
.ds-toggle button {
  padding: 6px 14px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  border-radius: 999px;
  transition: all var(--transition-fast);
}
.ds-toggle button.is-active { background: var(--text-white); color: var(--bg-primary); font-weight: 600; }
.ds-toggle-badge {
  margin-left: 6px;
  padding: 2px 8px;
  background: rgba(43, 203, 127, 0.12);
  color: var(--color-success);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

/* "Founding customer" trust block */
.ds-founding {
  padding: 36px 40px;
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  max-width: 760px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}
.ds-founding::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.ds-founding h3 {
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-white);
  font-weight: 600;
  margin: 0 0 14px;
}
.ds-founding p { font-size: 14.5px; line-height: 1.7; color: var(--text-secondary); margin: 0 0 14px; }
.ds-founding p:last-of-type { color: var(--text-dim); font-size: 13.5px; margin-bottom: 20px; }

/* Inbox / reply message blocks for the product card visual */
.ds-msg {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: var(--hairline-strong);
  background: var(--surface-elevated);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-primary);
}
.ds-msg + .ds-msg { margin-top: 12px; }
.ds-msg--reply {
  background: rgba(0, 212, 255, 0.05);
  border-color: rgba(0, 212, 255, 0.25);
}
.ds-msg-from {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
}
.ds-msg-from strong {
  color: var(--text-white);
  font-family: var(--font-body);
  font-weight: 600;
}
.ds-msg-meta-tag {
  display: inline-block;
  padding: 1px 6px;
  background: var(--bg-tertiary);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 10.5px;
  margin-left: 6px;
}
.ds-msg--held .ds-msg-meta-tag {
  background: rgba(242, 179, 66, 0.10);
  color: var(--color-warning);
}
.ds-msg-tool-trace {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
  padding: 10px 12px;
  margin-top: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  border: var(--hairline);
  line-height: 1.65;
}
.ds-msg-tool-trace .tool-name {
  color: var(--accent);
}
.ds-msg-tool-trace .tool-ok {
  color: var(--color-success);
}

/* ============================================
   2. Reset & Base Styles
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--font-base);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11' 1, 'ss01' 1, 'ss03' 1;  /* Inter's preferred contextual + stylistic alternates */
}

/* Custom scrollbar to match the dark aesthetic */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  transition: background 0.2s;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(0, 212, 255, 0.25); }

img, svg { max-width: 100%; display: block; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--accent-bright); }

ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* ============================================
   3. Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-body);
  color: var(--text-white);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-feature-settings: 'cv11' 1, 'ss01' 1;
}
h1 { font-size: 38px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; }
h2 { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; }
h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }
h4 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
h5 { font-size: 14px; font-weight: 600; letter-spacing: -0.005em; }
p { margin-bottom: var(--space-4); }

.text-sm { font-size: var(--font-sm); }
.text-xs { font-size: var(--font-xs); }
.text-lg { font-size: var(--font-lg); }
.text-muted { color: var(--text-dim); }

/* ============================================
   4. Container & Grid
   ============================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.grid { display: grid; gap: var(--space-6); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ============================================
   5. Buttons — modern, rounded, soft shadows
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-transform: none;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  border-radius: 10px;
  transition: all 160ms ease;
  white-space: nowrap;
  user-select: none;
  position: relative;
  cursor: pointer;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(180deg, var(--accent-bright) 0%, var(--accent) 100%);
  color: #FFFFFF;
  font-weight: 600;
  border: 1px solid var(--accent);
  box-shadow: var(--shadow-accent), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #7DEEFF 0%, var(--accent-bright) 100%);
  color: #FFFFFF;
  border-color: var(--accent-bright);
  box-shadow: 0 6px 20px rgba(0, 212, 255, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-white);
  border: 1px solid rgba(255, 255, 255, 0.10);
}
.btn-secondary:hover {
  background: rgba(0, 212, 255, 0.10);
  border-color: rgba(0, 212, 255, 0.30);
  color: var(--accent);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(0, 212, 255, 0.40);
}
.btn-outline:hover {
  background: rgba(0, 212, 255, 0.08);
  border-color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: none;
}
.btn-ghost:hover {
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.04);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: var(--font-base);
}

.btn-sm {
  padding: 0.375rem 1rem;
  font-size: var(--font-xs);
}

.btn-xs {
  padding: 0.25rem 0.7rem;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.btn-danger {
  background: rgba(255, 59, 92, 0.12);
  color: #FF6B88;
  border: 1px solid rgba(255, 59, 92, 0.35);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(255, 59, 92, 0.22);
  border-color: #FF3B5C;
  color: #fff;
}
.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Past-conversations dropdown — grouped by date band so it's scannable. */
.conv-list {
  position: absolute;
  left: 16px;
  right: 16px;
  top: calc(100% - 4px);
  z-index: 20;
  max-height: 440px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-elevated);
  padding: 6px 0;
}
.conv-list.hidden { display: none; }

/* Date-band header inside the dropdown (Today / Yesterday / etc) */
.conv-band {
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 12px 16px 6px;
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}

.conv-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  transition: background 160ms ease;
  color: var(--text-primary);
}
.conv-item:last-child { border-bottom: none; }
.conv-item:hover, .conv-item.is-focused {
  background: var(--bg-hover);
}
.conv-item-preview {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-white);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.005em;
}
.conv-item-meta {
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-dim);
  margin-top: 4px;
  text-transform: none;
}
.conv-list-empty {
  padding: 20px 16px;
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
}

.btn-block {
  width: 100%;
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
}

/* ─────────────  Button state machine (setBtnState helper)  ─────────────
   States: loading / success / error. Spinner inline, green ✓ on success
   with brief pulse, red shake on error. Auto-reverts to idle. */
.btn-state-loading,
.btn-state-success,
.btn-state-error {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-state-loading { opacity: 0.85; }
.btn-spinner {
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btnSpin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
@keyframes btnSpin { to { transform: rotate(360deg); } }
.btn-state-success {
  background: var(--color-success, #2BCB7F) !important;
  color: #0A1628 !important;
  border-color: var(--color-success, #2BCB7F) !important;
  animation: btnSuccessPulse 1.2s ease both;
}
.btn-check {
  display: inline-block;
  width: 14px; height: 14px;
  position: relative;
  flex-shrink: 0;
}
.btn-check::after {
  content: '';
  position: absolute;
  left: 2px; top: 7px;
  width: 4px; height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  animation: btnCheckIn 220ms ease both;
}
@keyframes btnCheckIn {
  from { transform: rotate(45deg) scale(0.5); opacity: 0; }
  to   { transform: rotate(45deg) scale(1);   opacity: 1; }
}
@keyframes btnSuccessPulse {
  0%   { box-shadow: 0 0 0 0 rgba(43, 203, 127, 0.55); }
  50%  { box-shadow: 0 0 0 8px rgba(43, 203, 127, 0); }
  100% { box-shadow: 0 0 0 0 rgba(43, 203, 127, 0); }
}
.btn-state-error {
  background: var(--color-danger, #F5536C) !important;
  color: #fff !important;
  border-color: var(--color-danger, #F5536C) !important;
  animation: btnShake 380ms ease both;
}
.btn-x {
  display: inline-block;
  width: 14px; height: 14px;
  position: relative;
  flex-shrink: 0;
}
.btn-x::before,
.btn-x::after {
  content: '';
  position: absolute;
  left: 6px; top: 0;
  width: 2px; height: 14px;
  background: currentColor;
}
.btn-x::before { transform: rotate(45deg); }
.btn-x::after  { transform: rotate(-45deg); }
@keyframes btnShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-3px); }
  40%, 80% { transform: translateX(3px); }
}

/* ============================================
   6. Cards — Soft, modern, subtle elevation
   ============================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 28px 32px;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
  box-shadow: var(--shadow-card);
}
.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card-hover);
}
.card > h3:first-child,
.card > .card-title:first-child {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-white);
  margin: 0 0 22px;
}

.card-header { margin-bottom: var(--space-4); }
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-color);
}
.card-title-row h3 { margin: 0; }
.card-title {
  font-family: var(--font-heading);
  font-size: var(--font-xl);
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: var(--space-1);
}
.card-body { flex: 1; }
.card-footer {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-color);
}

/* ============================================
   7. Forms — Dark Inputs, Cyan Focus Glow
   ============================================ */
.form-group {
  margin-bottom: 18px;
}

/* Sentence-case label, body font, semibold. Linear / Stripe pattern — feels
   premium, no shouting uppercase. */
.form-label {
  display: block;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text-primary);
  text-transform: none;
  margin-bottom: 8px;
}
.form-label .form-required {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  vertical-align: middle;
  margin-left: 6px;
  transform: translateY(-1px);
}
.form-help {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-dim);
  margin-top: 6px;
  line-height: 1.45;
  letter-spacing: 0;
}

/* Section header within long forms (Add Property / Create Lease etc.) */
.form-section {
  margin: 26px 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}
.form-section:first-child { margin-top: 8px; }
.form-section-title {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0;
}

/* Two-column row inside a modal (City / State / ZIP, Start / End dates). */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}
.form-row .form-group { margin-bottom: 0; }

/* Sticky save area at the bottom of long modals. */
.form-save-bar {
  position: sticky;
  bottom: -32px;        /* compensates for .modal's 32px bottom padding */
  margin: 24px -32px -32px;
  padding: 16px 32px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}
.form-save-bar .btn { flex: 1; }
.form-save-bar-msg {
  flex: 2;
  font-size: 12.5px;
  color: var(--text-dim);
  white-space: pre-wrap;
  min-height: 14px;
}

/* Checkbox row — inline label + native checkbox, looks intentional. */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
}
.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.form-check-body { font-family: var(--font-body); font-size: 13.5px; color: var(--text-primary); line-height: 1.4; }
.form-check-body strong { color: var(--text-white); font-weight: 600; }

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 11px 14px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--text-white);
  background: rgba(0, 0, 0, 0.20);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  outline: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.30);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.10);
}

.form-input:hover:not(:focus),
.form-textarea:hover:not(:focus),
.form-select:hover:not(:focus) {
  border-color: rgba(255, 255, 255, 0.14);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-dim);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-error {
  font-family: var(--font-mono);
  font-size: var(--font-xs);
  color: var(--color-danger);
  margin-top: var(--space-1);
}

/* ============================================
   8. Auth Page — Login / Register
   ============================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  padding: var(--space-4);
  position: relative;
  overflow: hidden;
}

/* Subtle scanline overlay */
.auth-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 212, 255, 0.015) 2px,
    rgba(0, 212, 255, 0.015) 4px
  );
  pointer-events: none;
  z-index: 0;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0;
  box-shadow: var(--shadow-card), var(--glow-sm);
  padding: var(--space-8);
  position: relative;
  z-index: 1;
  animation: fadeUp 0.4s ease both;
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.auth-header h1,
.auth-header h2 {
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--text-white);
}

.auth-header p {
  color: var(--text-dim);
  font-size: var(--font-sm);
}

/* Tab Switcher */
.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--space-6);
}

.auth-tab {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--font-sm);
  font-weight: 400;
  color: var(--text-dim);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.auth-tab:hover {
  color: var(--text-primary);
}

.auth-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Auth Error */
.auth-error {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  font-family: var(--font-mono);
  font-size: var(--font-sm);
  padding: var(--space-3) var(--space-4);
  border: 1px solid rgba(255, 59, 92, 0.20);
  border-radius: 0;
  margin-bottom: var(--space-4);
  display: none;
}

.auth-error.visible {
  display: block;
  animation: fadeUp 0.2s ease both;
}

/* Auth Footer */
.auth-footer {
  text-align: center;
  margin-top: var(--space-6);
  font-size: var(--font-sm);
  color: var(--text-dim);
}

.auth-footer a {
  color: var(--accent);
  font-weight: 600;
}
.auth-footer a:hover {
  color: var(--accent-bright);
}

/* ============================================
   9. Sidebar — Fixed Dark Navigation
   ============================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  flex-shrink: 0;
  overflow-y: auto;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
}

/* Sidebar brand — v2 (Linear-style) — quieter, tighter.
   Was: 72px tall with 62px logo, Syne wordmark, cyan glow.
   Now: 56px tall with 32px logo, Inter wordmark, no glow. */
.sidebar-brand {
  padding: 0 16px;
  height: 76px;
  border-bottom: var(--hairline-strong);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--font-sm);
  color: var(--text-white);
  letter-spacing: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: visible;
  position: relative;
}

.sidebar-brand span {
  color: var(--accent);
}

.brand-logo-img {
  height: 44px;
  width: auto;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 76px;
  width: 100%;
  overflow: hidden;
}

.brand-logo img {
  height: 44px;
  width: auto;
  flex-shrink: 0;
}

/* Brand wordmark — v2 Inter, sentence case, quieter accent. */
.brand-text {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-white);
  letter-spacing: -0.01em;
  line-height: 1;
  margin: 0;
  white-space: nowrap;
  overflow: visible;
}

.brand-dot {
  color: var(--accent);
  margin: 0 1px;
}

/* Stacked brand wordmark for the dashboard sidebar */
.brand-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1;
  min-width: 0;
}
.brand-text-line1,
.brand-text-line2 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  color: var(--text-white);
  letter-spacing: -0.01em;
  line-height: 1.15;
  white-space: nowrap;
}
.brand-text-line2 {
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Nav is now grouped — each group gets a label, a hairline divider above
   (except the first), and a quiet bottom margin. */
.nav-group {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}
.nav-group + .nav-group {
  margin-top: 4px;
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
}

/* Nav section label — v2 sentence case, no tracking. */
.nav-section-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
  padding: 12px 20px 6px;
}

/* Nav-item — v2 Linear-style. Was: 8px radii, gradient + 3px inset
   stripe on active, emoji-font fallback. Now: 6px radii, flat subtle
   background on active, no stripe, no glow. */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(100% - 16px);
  padding: 7px 12px;
  margin: 1px 8px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  text-align: left;
  letter-spacing: 0;
  transition: background var(--transition-fast), color var(--transition-fast);
  cursor: pointer;
  outline: none;
}

.nav-item .nav-icon {
  font-size: 14px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-dim);
}

.nav-item .nav-label {
  flex: 1;
}

.nav-item:hover {
  color: var(--text-white);
  background: var(--bg-tertiary);
}
.nav-item:hover .nav-icon { color: var(--text-secondary); }

.nav-item.active {
  color: var(--text-white);
  background: var(--bg-tertiary);
  font-weight: 500;
}
.nav-item.active .nav-icon { color: var(--accent); }

.nav-item svg,
.nav-item i {
  width: 16px;
  height: 16px;
}

.sidebar-user {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--font-sm);
  color: var(--text-dim);
}

/* Sidebar footer (user info + logout) */
.sidebar-footer {
  padding: 16px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(0, 0, 0, 0.20);
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.user-name {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 3px 10px;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(0, 212, 255, 0.10);
  border: 1px solid rgba(0, 212, 255, 0.20);
  border-radius: 99px;
  margin-top: 4px;
}

.sidebar-actions {
  display: flex;
  flex-direction: row;
  gap: 6px;
}

.btn-sidebar, .btn-logout {
  flex: 1;
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-sidebar:hover {
  color: var(--text-white);
  border-color: rgba(0, 212, 255, 0.30);
  background: rgba(0, 212, 255, 0.08);
}

.btn-logout:hover {
  color: var(--color-danger);
  border-color: rgba(255, 59, 92, 0.30);
  background: rgba(255, 59, 92, 0.08);
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--font-xs);
  color: var(--accent);
}

/* ============================================
   10. Dashboard Layout
   ============================================ */
.dashboard-layout,
.app-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  background: var(--bg-primary);
}

/* Top bar — only renders on mobile (where the hamburger lives). On
   desktop it was a second copy of the page title under a sticky bar
   that did nothing; deleted that experience and let each page own its
   own header. */
.top-bar { display: none; }
@media (max-width: 720px) {
  .top-bar {
    display: flex;
    height: 56px;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(10, 12, 20, 0.85);
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}

.top-bar-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.top-bar-logo {
  display: none;
  height: 36px;
  width: auto;
  flex-shrink: 0;
}

.top-bar h2 {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-white);
  margin: 0;
  letter-spacing: -0.01em;
}

.greeting {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0;
  text-transform: none;
}

/* Content area + views */
.content-area {
  padding: 0;
  background: var(--bg-primary);
  min-height: calc(100vh - var(--header-height));
}

.view {
  display: none;
  padding: 44px 56px 80px;
  max-width: 1440px;
  margin: 0 auto;
  animation: fadeUp 0.3s ease;
}

.view.active {
  display: block;
}

/* Main content stat/card layout */
.section-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 28px;
  padding: 0 0 36px;
  margin-top: 36px;
}

.section-row .card h3,
.view .card h3 {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-white);
  margin: 0 0 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

/* Dashboard top row — greeting on the left, time range + primary CTA on the
   right. Anchored by a fine bottom separator so it reads as a real page
   header, not floating text above a chart. */
.dash-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}
.dash-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Segmented control: 7d / 30d / 90d. Lives in .dash-actions. */
.time-range {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 3px;
}
.time-range-btn {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  border-radius: 7px;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}
.time-range-btn:hover { color: var(--text-primary); }
.time-range-btn.is-active {
  background: var(--bg-elevated);
  color: var(--text-white);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
/* Primary CTA on the header — more presence than a stock btn-primary so
   it can hold the right side of the page header on its own. */
.dash-cta {
  white-space: nowrap;
  padding: 12px 22px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border-radius: 10px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.10) inset,
    0 6px 18px rgba(0, 212, 255, 0.30),
    0 1px 3px rgba(0, 0, 0, 0.40);
}
.dash-cta:hover {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.15) inset,
    0 10px 24px rgba(0, 212, 255, 0.42),
    0 2px 4px rgba(0, 0, 0, 0.45);
}

/* Personalized greeting — calm, confident, premium. Anchors the top of
   every dashboard load. Sits next to the action controls inside
   .dash-header. */
.greeting-hero {
  margin-bottom: 0;
  padding: 0;
  flex: 1 1 auto;
  min-width: 280px;
  position: relative;
  animation: greetingFadeUp 380ms ease both;
}
@keyframes greetingFadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* Workspace identity row above the title — company name + date.
   Replaces the marketing-style stacked layout with a tight, Linear-esque
   metadata strip so the dashboard reads as a workspace, not a slide. */
.greeting-hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0;
  text-transform: none;
}
.greeting-hero-meta-company {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-weight: 600;
}
.greeting-hero-meta-company::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.14);
}
.greeting-hero-meta-divider { color: var(--text-muted); opacity: 0.5; }
.greeting-hero-meta-date { color: var(--text-dim); font-feature-settings: 'tnum' 1; }

/* "Summit handled N things while you were away" chip — now sits inline at
   the right of the greeting block instead of stacked above. Smaller and
   more workspace-y so it reads as a status pill, not a hero banner. */
.greeting-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding: 4px 10px 4px 8px;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.18);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0;
  animation: eyebrowFade 480ms ease 120ms both;
}
.greeting-hero-eyebrow[hidden] { display: none; }
.greeting-hero-eyebrow strong { color: var(--text-white); font-weight: 600; }
.greeting-eyebrow-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.18);
  animation: eyebrowPulse 2.2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes eyebrowFade {
  from { opacity: 0; transform: translateY(-2px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes eyebrowPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.18); }
  50%      { box-shadow: 0 0 0 5px rgba(0, 212, 255, 0.06); }
}
.greeting-hero-title {
  font-family: 'Syne', 'Inter', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-white);
  line-height: 1.15;
  margin-bottom: 6px;
}
@media (max-width: 720px) {
  .greeting-hero-title { font-size: 22px; }
}
.greeting-hero-sub {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 450;
  color: var(--text-secondary);
  letter-spacing: -0.003em;
  line-height: 1.5;
  max-width: 720px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.greeting-hero-sub .greeting-context strong { color: var(--text-white); font-weight: 600; }
.greeting-hero-sub.is-danger  .greeting-context strong { color: var(--color-danger); }
.greeting-hero-sub.is-warning .greeting-context strong { color: var(--color-warning); }
.greeting-hero-sub.is-success .greeting-context strong { color: var(--color-success); }
.greeting-hero-sub.is-info    .greeting-context strong { color: var(--accent-bright); }

/* Quick Actions — full-row mini cards with icon + label. Feels like a list
   of next-steps, not a generic button stack. */
.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.quick-actions .btn {
  justify-content: flex-start;
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  gap: 12px;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}
.quick-actions .btn:hover {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-white);
  transform: none;
}
.quick-actions .btn.btn-primary {
  background: linear-gradient(180deg, var(--accent-bright) 0%, var(--accent) 100%);
  border-color: var(--accent);
  color: #FFFFFF;
}
.quick-actions .btn.btn-primary:hover {
  background: linear-gradient(180deg, #7DEEFF 0%, var(--accent-bright) 100%);
  color: #FFFFFF;
}
.quick-actions .btn svg,
.quick-actions .btn .ic {
  width: 18px;
  height: 18px;
  opacity: 0.85;
  flex-shrink: 0;
}

/* Empty / loading states — calm, encouraging, premium. */
.empty-state {
  text-align: center;
  padding: 36px 24px 32px;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.18) 0%, rgba(0, 212, 255, 0.04) 100%);
  border: 1px solid rgba(0, 212, 255, 0.24);
  color: var(--accent-bright);
  font-size: 1.6rem;
  margin-bottom: 14px;
}
.empty-icon .ic,
.empty-icon svg {
  width: 26px;
  height: 26px;
}

.empty-state h4 {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-white);
  margin: 0 0 6px;
}

.empty-state p {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0 0 16px;
  max-width: 460px;
  line-height: 1.55;
}

.empty-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: center;
  margin-top: var(--space-2);
}

/* Setup & Integrations — bottom section of dashboard with the inbound email
   + widget snippet banners. Visually softer than the main dashboard cards
   so it reads as 'configuration you set up once' instead of dominating the
   front page. */
/* Host for the inbound forwarding + widget snippet banners. Lives inside
   Settings → Channels & integrations, no longer on the daily dashboard. */
.dashboard-integrations {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.dashboard-integrations:empty { display: none; }
.integrations-heading {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
  opacity: 0.7;
}

.inbound-banner {
  margin: 0;
  padding: 18px 20px;
  background: rgba(10, 22, 40, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  position: relative;
  box-shadow: none;
}
.inbound-banner::before {
  display: none;
}

/* "How it works" explainer block inside the inbound banner */
.ib-explainer {
  background: rgba(0, 212, 255, 0.04);
  border: 1px solid rgba(0, 212, 255, 0.14);
  border-radius: 10px;
  padding: 16px 18px;
  margin: 4px 0 16px;
}
.ib-explainer-title {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  opacity: 0.9;
}
.ib-explainer-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ib-explainer-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-body);
}
.ib-explainer-steps li strong {
  color: var(--text-white);
  font-weight: 600;
}
.ib-step-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 212, 255, 0.12);
  border: 1px solid rgba(0, 212, 255, 0.3);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.ib-explainer-lead {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-body);
  margin: 0 0 12px;
}
.ib-eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  opacity: 0.9;
}
.ib-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
}
.ib-addr {
  font-family: var(--font-mono);
  font-size: var(--font-sm);
  color: var(--text-white);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: var(--space-2) var(--space-3);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ib-help {
  font-size: var(--font-xs);
  color: var(--text-dim);
  line-height: 1.6;
}

/* Onboarding panel (first-run dashboard walkthrough) */
/* Onboarding card — v2 (Linear-style). Was: gradient bg + 60px glow
   box-shadow + 2px cyan top stripe. Now: clean surface-card + hairline. */
.onboard-card {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin: var(--space-6) var(--space-6) 0;
  padding: 24px 28px;
}

.onboard-eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--accent);
  margin-bottom: 8px;
}

/* Onboarding checklist */
.ob-progress {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 14px 0 22px;
}
.ob-progress-bar {
  height: 100%;
  background: var(--accent);
  transition: width 0.4s ease;
}
.ob-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ob-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast);
}
.ob-step:hover { border-color: var(--border-color); }
.ob-step.done { opacity: 0.5; }
.ob-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-body);
  flex-shrink: 0;
}
.ob-dot.done {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-primary);
}
.ob-step-body { flex: 1; min-width: 0; }
.ob-step-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-white);
}
.ob-status {
  font-size: 12px;
  color: var(--color-success);
  font-weight: 600;
  font-family: var(--font-body);
}

.onboard-sub {
  font-size: 14px;
  color: var(--text-dim);
  margin: 0 0 var(--space-3);
  line-height: 1.6;
}

.ob-footer-tip {
  margin-top: 16px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.025);
  border-left: 2px solid rgba(0, 212, 255, 0.3);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}
.ob-footer-tip a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.ob-footer-tip a:hover {
  text-decoration: underline;
}

/* Forwarding-modal step cards — replaces the wall-of-text list with a
   numbered visual flow that scans fast. */
.fwd-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fwd-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(0, 212, 255, 0.04);
  border: 1px solid rgba(0, 212, 255, 0.12);
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-body);
}
.fwd-step strong { color: var(--text-white); font-weight: 600; }
.fwd-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 212, 255, 0.16);
  border: 1px solid rgba(0, 212, 255, 0.4);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.ob-recommend {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--accent);
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.25);
  padding: 1px 8px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
}

.onboard-title {
  font-family: 'Syne', 'Inter', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-white);
  margin: 0 0 var(--space-3);
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.onboard-sub {
  font-size: var(--font-base);
  color: var(--text-primary);
  margin: 0 0 var(--space-6);
  max-width: 560px;
  line-height: 1.6;
}

.onboard-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.onboard-step {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: rgba(6, 13, 26, 0.6);
  border: 1px solid var(--border-color);
  transition: border-color 0.2s, transform 0.2s;
}

.onboard-step:hover {
  border-color: var(--accent-glow);
}

.onboard-step.done {
  border-left: 3px solid var(--color-success);
  opacity: 0.7;
}

.onboard-step.locked {
  opacity: 0.5;
  pointer-events: none;
}

.onboard-num {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: var(--accent-dim);
  border: 1px solid var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--accent);
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
}

.onboard-step.done .onboard-num {
  background: rgba(0, 255, 136, 0.12);
  border-color: rgba(0, 255, 136, 0.3);
  color: var(--color-success);
}

.onboard-step-body {
  flex: 1;
}

.onboard-step-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--font-lg);
  color: var(--text-white);
  margin-bottom: 4px;
}

.onboard-step-desc {
  font-size: var(--font-sm);
  color: var(--text-dim);
  line-height: 1.55;
  margin-bottom: var(--space-3);
}

.onboard-tip {
  padding: var(--space-3) var(--space-4);
  background: var(--accent-dim);
  border-left: 3px solid var(--accent);
  font-size: var(--font-sm);
  color: var(--text-primary);
  line-height: 1.55;
}

.onboard-tip strong {
  color: var(--accent);
}

/* .loading — Phase 3 migration. Used at 21+ template/JS sites as the
   placeholder while a view fetches data. Was a centered spinner +
   "Loading X" text; now renders as a stack of 3 shimmering skeleton
   bars (Linear/Stripe-style) without touching a single callsite.

   The text content ("Loading bookings", etc.) is read by screen readers
   via .visually-hidden positioning but invisible to sighted users so the
   skeleton owns the visual space. The label still aids accessibility. */
.loading {
  position: relative;
  padding: 16px 20px;
  /* Hide the "Loading X" text visually but keep it for screen readers */
  color: transparent;
  font-size: 0;
  user-select: none;
  /* Stack of skeleton bars via three vertically arranged ::before/::after
     pseudos. We need three so we use ::before for two and ::after for one;
     wrap them with display:block + sized backgrounds. */
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 64px;
}
.loading::before,
.loading::after {
  content: '';
  display: block;
  height: 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 0%,
    var(--bg-hover) 50%,
    var(--bg-tertiary) 100%
  );
  background-size: 200% 100%;
  animation: ds-skel-shimmer 1.4s infinite linear;
}
.loading::before { width: 65%; }
.loading::after  { width: 85%; }

/* Compact variant for in-row loading states (e.g. inside form panels).
   Use inline as a single bar without padding. */
.loading--inline {
  padding: 4px 0;
  min-height: 0;
}
.loading--inline::before { width: 100%; }
.loading--inline::after  { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Stat card variants — icons + value carry the tone (set lower in the
   single .stat-card block). No noisy left-border bars. */

/* Compare grid (Why Summit section on landing) */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 56px;
  background: var(--border-color);
  border: 1px solid var(--border-color);
}
.compare-col {
  padding: 36px 32px;
  background: var(--bg-secondary);
}
.compare-col.compare-them {
  background: var(--bg-secondary);
}
.compare-col.compare-us {
  background: var(--bg-tertiary);
  border-left: 2px solid var(--accent);
  box-shadow: inset 0 0 60px rgba(0, 212, 255, 0.08);
}
.compare-h {
  font-family: var(--font-mono);
  font-size: var(--font-xs);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}
.compare-col.compare-us .compare-h {
  color: var(--accent);
}
.compare-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.compare-list li {
  padding: 10px 0;
  font-size: var(--font-sm);
  line-height: 1.6;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(0, 212, 255, 0.05);
}
.compare-list li:last-child { border-bottom: none; }
.compare-col.compare-them .compare-list li {
  color: var(--text-dim);
}
/* ─────────────  Per-page header used on list views  ─────────────
   Same visual treatment as .settings-page-header but with an action button
   row sibling below the divider. Used by Properties / Tenants / Maintenance
   / Vendors / Applicants / Activity / Invoices etc. */
.page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 22px;
}
.page-actions:empty { display: none; }

/* ─────────────  Inline-editable fields  ─────────────
   Click an .editable span → swap for an input. Enter saves, Esc cancels.
   Used for low-stakes single-value edits (email, phone, etc.) so the
   user doesn't have to open a modal. */
.editable {
  cursor: text;
  padding: 1px 4px;
  margin: -1px -4px;
  border-radius: 4px;
  border: 1px dashed transparent;
  transition: border-color 140ms ease, background 140ms ease;
}
.editable:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
}
.editable:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-tertiary);
}
.editable.is-saving { opacity: 0.55; }
.editable.is-saved  {
  animation: editSaved 700ms ease both;
}
@keyframes editSaved {
  0%   { background: rgba(43, 203, 127, 0.18); }
  100% { background: transparent; }
}
.editable-empty {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.92em;
}
.editable-input {
  display: inline-block;
  min-width: 140px;
  max-width: 280px;
  padding: 2px 8px;
  background: var(--bg-card);
  color: var(--text-white);
  border: 1px solid var(--accent);
  border-radius: 4px;
  font-family: inherit;
  font-size: inherit;
  outline: none;
}

.contact-sep {
  color: var(--text-muted);
  margin: 0 6px;
  user-select: none;
}

/* ─────────────  Toast stack (undo on delete, action feedback)  ───────────── */
.toast-stack {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 250;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.toast {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 320px;
  max-width: 480px;
  padding: 14px 16px 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-elevated);
  pointer-events: auto;
  animation: toastIn 220ms ease both;
  overflow: hidden;
}
@keyframes toastIn {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.toast.is-leaving { animation: toastOut 220ms ease both; }
@keyframes toastOut {
  from { transform: translateY(0);    opacity: 1; }
  to   { transform: translateY(8px);  opacity: 0; }
}
.toast-msg {
  flex: 1;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-white);
  letter-spacing: -0.005em;
}
.toast-undo {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-bright);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  letter-spacing: 0;
  text-transform: none;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}
.toast-undo:hover {
  color: var(--text-white);
  border-color: var(--accent);
  background: var(--accent-dim);
}
.toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--accent);
  transform: scaleX(1);
  transform-origin: left center;
  opacity: 0.7;
}

/* Generic toast variants — fired by toast(message, kind). The undo-toast
   pattern above is a specialization of this; both share .toast / .toast-msg
   styling but the generic variants add an icon + close button + colored
   left border so the operator knows at a glance whether something
   succeeded, failed, or is informational. */
.toast-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.toast-icon svg { width: 22px; height: 22px; }
.toast-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  margin-left: 4px;
  transition: color 140ms ease;
  flex-shrink: 0;
}
.toast-close:hover { color: var(--text-white); }
.toast-action {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-bright);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  letter-spacing: 0;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
  flex-shrink: 0;
}
.toast-action:hover {
  color: var(--text-white);
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* Kind variants — colored left rail + icon color. */
.toast--info    { border-left: 3px solid var(--accent); }
.toast--info    .toast-icon { color: var(--accent-bright); }
.toast--success { border-left: 3px solid var(--color-success); }
.toast--success .toast-icon { color: var(--color-success); }
.toast--error   { border-left: 3px solid var(--color-danger); }
.toast--error   .toast-icon { color: var(--color-danger); }
.toast--warning { border-left: 3px solid var(--color-warning); }
.toast--warning .toast-icon { color: var(--color-warning); }

@media (max-width: 480px) {
  .toast-stack { bottom: 14px; left: 12px; right: 12px; transform: none; align-items: stretch; }
  .toast { min-width: 0; max-width: none; }
}

/* ─────────────  Row hover quick-actions  ─────────────
   Tiny inline buttons that fade in on .list-row hover (desktop).
   Drop pre-built prompts into AI Chat so the operator can act on a tenant
   in two clicks instead of opening a detail view. */
.row-quick-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transform: translateX(4px);
  transition: opacity 140ms ease, transform 140ms ease;
  pointer-events: none;
}
.list-row:hover .row-quick-actions,
.list-row:focus-within .row-quick-actions {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
.row-quick-btn {
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}
.row-quick-btn:hover {
  color: var(--accent-bright);
  border-color: var(--border-accent);
  background: var(--accent-dim);
}
/* On touch / mobile, no hover — render the quick actions inline so they're
   still reachable. They drop below the body in the existing 2-col layout. */
@media (hover: none), (max-width: 720px) {
  .row-quick-actions {
    opacity: 1;
    transform: none;
    pointer-events: auto;
    grid-column: 1 / -1;
    flex-wrap: wrap;
    margin-top: 8px;
  }
}

/* Mobile bottom-tab notification dot (small red badge on the Menu tab) */
.bt-dot {
  position: absolute;
  top: 8px;
  right: 24%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-bright);
  border: 1.5px solid var(--bg-secondary);
}
.bt-dot.is-danger { background: var(--color-danger); }
.bt-dot[hidden] { display: none; }
.bottom-tab { position: relative; }

/* ─────────────  Notifications bell + drawer  ───────────── */
.notif-bell {
  position: fixed;
  top: 18px;
  right: 24px;
  z-index: 60;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 50%;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
  box-shadow: var(--shadow-card);
}
.notif-bell:hover {
  color: var(--text-white);
  border-color: var(--border-strong);
  background: var(--bg-elevated);
}
.notif-bell svg { width: 18px; height: 18px; }
.notif-bell-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-bright);
  border: 2px solid var(--bg-card);
}
.notif-bell-dot.is-danger { background: var(--color-danger); }
.notif-bell-dot[hidden] { display: none; }
@media (max-width: 720px) {
  .notif-bell { top: 10px; right: 14px; width: 36px; height: 36px; }
}

.notif-drawer { position: fixed; inset: 0; z-index: 240; animation: fadeIn 140ms ease; }
.notif-drawer[hidden] { display: none; }
.notif-drawer-backdrop {
  position: absolute; inset: 0;
  background: rgba(8, 10, 18, 0.55);
  backdrop-filter: blur(4px);
}
.notif-drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 420px; max-width: 92vw;
  background: var(--bg-card);
  border-left: 1px solid var(--border-strong);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.45);
  display: flex; flex-direction: column;
  animation: notifSlideIn 220ms ease both;
}
@keyframes notifSlideIn {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);   opacity: 1; }
}
.notif-drawer-header {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.notif-drawer-header h3 {
  font-size: 18px; font-weight: 600; letter-spacing: -0.015em;
  color: var(--text-white); margin: 0 0 4px;
}
.notif-drawer-header p {
  font-size: 13px; color: var(--text-dim); margin: 0; letter-spacing: 0;
}
.notif-drawer-close {
  background: transparent; border: none; color: var(--text-dim);
  font-size: 24px; line-height: 1; cursor: pointer; padding: 0 4px;
  transition: color 140ms ease;
}
.notif-drawer-close:hover { color: var(--text-white); }
.notif-drawer-body {
  flex: 1; overflow-y: auto;
  padding: 8px 12px 18px;
  display: flex; flex-direction: column; gap: 6px;
}
.notif-empty { padding: 48px 16px; text-align: center; color: var(--text-dim); }
.notif-empty-emoji {
  width: 44px; height: 44px; margin: 0 auto 12px;
  border-radius: 50%;
  background: rgba(43, 203, 127, 0.12);
  color: var(--color-success);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 600;
}
.notif-empty-title {
  font-family: var(--font-body); font-size: 15px; font-weight: 600;
  color: var(--text-white); letter-spacing: -0.01em; margin-bottom: 6px;
}
.notif-empty-sub { font-size: 13px; color: var(--text-dim); }

.notif-item {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 12px; align-items: center;
  padding: 12px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
  font-family: var(--font-body);
}
.notif-item:hover { background: var(--bg-hover); border-color: var(--border-color); }
.notif-item-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-bright);
  flex-shrink: 0;
}
.notif-item--danger  .notif-item-dot { background: var(--color-danger); }
.notif-item--warning .notif-item-dot { background: var(--color-warning); }
.notif-item--info    .notif-item-dot { background: var(--accent-bright); }
.notif-item-body { min-width: 0; }
.notif-item-title {
  font-size: 14px; font-weight: 500;
  color: var(--text-white); letter-spacing: -0.005em; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-item-detail {
  font-size: 12.5px; font-weight: 400;
  color: var(--text-dim); margin-top: 3px; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-item-arrow {
  width: 14px; height: 14px;
  color: var(--text-muted); flex-shrink: 0;
}

/* ─────────────  Command palette (⌘K / Ctrl+K)  ───────────── */
.cmdk-overlay {
  position: fixed;
  inset: 0;
  z-index: 220;
  background: rgba(8, 10, 18, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  animation: fadeIn 140ms ease;
}
.cmdk-overlay[hidden] { display: none; }
.cmdk-panel {
  width: 100%;
  max-width: 620px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow-elevated);
  overflow: hidden;
  animation: fadeUp 180ms ease both;
}
.cmdk-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
}
.cmdk-search-icon { width: 18px; height: 18px; color: var(--text-dim); flex-shrink: 0; }
.cmdk-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-white);
  font-family: var(--font-body);
  font-size: 15.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.cmdk-input::placeholder { color: var(--text-dim); }
.cmdk-kbd, .cmdk-hint kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  padding: 2px 7px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  background: var(--bg-tertiary);
  text-transform: lowercase;
}
.cmdk-results { max-height: 52vh; overflow-y: auto; padding: 6px 6px 8px; }
.cmdk-empty { text-align: center; color: var(--text-dim); font-size: 13px; padding: 28px 12px; }
.cmdk-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 120ms ease;
}
.cmdk-result.is-selected { background: var(--bg-hover); }
.cmdk-result-icon { width: 16px; height: 16px; color: var(--accent-bright); flex-shrink: 0; }
.cmdk-result-body { flex: 1; min-width: 0; }
.cmdk-result-label {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-white);
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cmdk-result-sub {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-dim);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cmdk-type {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 2px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  flex-shrink: 0;
}
.cmdk-hint {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 18px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  font-family: var(--font-body);
  font-size: 11.5px;
  color: var(--text-dim);
}
.cmdk-hint span { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 720px) {
  .cmdk-overlay { padding-top: 6vh; padding-left: 12px; padding-right: 12px; }
  .cmdk-hint { display: none; }
}

/* ─────────────  Tool-call chain on AI Chat assistant messages  ─────────────
   Show the agent's actual work as inline chips below each reply, never
   collapsed. Operators see "get_tenant_info → list_payments → generate_pdf"
   beneath each reply and it builds trust. PR #200. */
.tool-chain {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-color);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11.5px;
  color: var(--text-dim);
  letter-spacing: 0;
}
.tool-chain-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-right: 4px;
}
.tool-chain-icon { width: 12px; height: 12px; color: var(--accent-bright); flex-shrink: 0; }
.tool-chain-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 4px;
  background: var(--bg-tertiary, rgba(0,212,255,0.06));
  border: 1px solid var(--border-color);
  color: var(--text-secondary, var(--text));
  font-size: 11.5px;
  white-space: nowrap;
}
.tool-chain-arrow { color: var(--text-dim); opacity: 0.7; }

/* ─────────────  Tool-use expandable (legacy)  ───────────────────────────── */
.tools-used {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-color);
}
.tools-used[open] .tools-used-chev { transform: rotate(180deg); }
.tools-used-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  transition: color 160ms ease, border-color 160ms ease;
  user-select: none;
}
.tools-used-summary::-webkit-details-marker { display: none; }
.tools-used-summary:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.tools-used-icon {
  width: 13px;
  height: 13px;
  color: var(--accent-bright);
  flex-shrink: 0;
}
.tools-used-chev {
  font-size: 10px;
  color: var(--text-dim);
  transition: transform 200ms ease;
  margin-left: 2px;
}
.tools-used-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tools-used-list li {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  border-left: 2px solid var(--accent);
  letter-spacing: 0;
}

/* ─────────────  Agent live surface: status pill + working-now stream  ─────────────
   Makes the autonomous work visible so the dashboard feels like a control
   room, not a static report. */

.agent-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: -0.005em;
  white-space: nowrap;
  cursor: default;
}
.agent-status-pill.is-active {
  border-color: rgba(43, 203, 127, 0.30);
  background: rgba(43, 203, 127, 0.06);
  color: var(--text-white);
}
.agent-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  position: relative;
}
.agent-status-dot.is-active {
  background: var(--color-success);
  box-shadow: 0 0 8px rgba(43, 203, 127, 0.7);
}
.agent-status-dot.is-active::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: rgba(43, 203, 127, 0.35);
  animation: agentPulse 1.8s ease-out infinite;
}
@keyframes agentPulse {
  0%   { transform: scale(0.7); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Escalation review panel — held tenant replies awaiting operator action.
   Pinned at the very top of the dashboard because nothing else on the page
   matters until these are cleared. PR #197. */
.esc-panel {
  background: linear-gradient(135deg, rgba(255,184,0,0.08), rgba(255,107,76,0.05));
  border: 1px solid rgba(255,184,0,0.35);
  border-left: 3px solid #FFB800;
  border-radius: 14px;
  padding: 22px 24px 18px;
  margin-bottom: 28px;
  box-shadow: 0 0 40px rgba(255,184,0,0.08);
}
.esc-panel-header {
  margin-bottom: 16px;
}
.esc-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  margin-bottom: 4px;
}
.esc-panel-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  color: #1a0d00;
  background: #FFB800;
  border-radius: 13px;
}
.esc-panel-sub {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  max-width: 640px;
}
.esc-panel-rows {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.esc-row {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px 18px;
}
.esc-row-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.esc-row-from {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}
.esc-row-subject {
  color: var(--text-dim);
  font-size: 13px;
}
.esc-row-reason {
  display: inline-block;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: #FFB800;
  background: rgba(255,184,0,0.10);
  border: 1px solid rgba(255,184,0,0.30);
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.esc-row-section {
  margin-top: 12px;
}
.esc-row-label {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.esc-row-body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
  background: var(--bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 14px;
  max-height: 180px;
  overflow-y: auto;
}
.esc-row-draft {
  width: 100%;
  min-height: 110px;
  background: var(--bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 14px;
  font: inherit;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  resize: vertical;
}
.esc-row-draft:focus { outline: none; border-color: var(--accent); }
.esc-row-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.esc-btn {
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  /* Doug's mobile bug: "Send draft to tenant" truncated to "Send dr...".
     Force the button to take its natural label width and never clip. */
  white-space: nowrap;
  flex: 0 0 auto;
}
@media (max-width: 720px) {
  .esc-row-actions { flex-direction: column; }
  .esc-btn { width: 100%; text-align: center; }
}
.esc-btn-send { background: var(--accent); color: var(--bg); }
.esc-btn-send:hover { filter: brightness(1.1); }
.esc-btn-dismiss { background: transparent; color: var(--text-dim); border-color: var(--border-color); }
.esc-btn-dismiss:hover { color: var(--text); border-color: var(--text-dim); }
.esc-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.esc-row-status {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
}
.esc-row-status.ok { color: #3DDC84; }
.esc-row-status.err { color: #FF3B5C; }

/* Working-now action stream. Pinned right under the hero number. */
.live-stream {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-card);
}
.live-stream-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.live-stream-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.live-stream-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 8px rgba(43, 203, 127, 0.7);
  position: relative;
}
.live-stream-pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: rgba(43, 203, 127, 0.35);
  animation: agentPulse 1.8s ease-out infinite;
}
.live-stream-meta {
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-dim);
  text-transform: none;
}
.live-stream-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.live-stream-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--text-secondary);
  transition: background 160ms ease;
}
.live-stream-row:hover { background: var(--bg-hover); }
.live-stream-row.is-new {
  animation: liveRowIn 360ms ease-out;
}
@keyframes liveRowIn {
  from { opacity: 0; transform: translateY(-4px); background: rgba(43, 203, 127, 0.08); }
  to   { opacity: 1; transform: translateY(0); }
}
.live-stream-time {
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  min-width: 60px;
}
.live-stream-subject {
  color: var(--text-white);
  font-weight: 500;
  letter-spacing: -0.005em;
  flex-shrink: 0;
}
.live-stream-why {
  flex: 1;
  min-width: 0;
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 4px;
  border-left: 1px solid var(--border-soft);
}

/* Compact activity rows used inside the dashboard's right-panel feed.
   Lighter weight than the dedicated /activity view since this is a snippet,
   not the full timeline. Hover surfaces the agent's reasoning via title. */
.dash-activity-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border-soft);
  cursor: default;
}
.dash-activity-row:last-child { border-bottom: none; }
.dash-activity-body { min-width: 0; }
.dash-activity-title {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-white);
  letter-spacing: -0.005em;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-activity-why {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-dim);
  line-height: 1.45;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-activity-time {
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-dim);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}

/* ─────────────  Command-center dashboard: hero metric + split layout  ─────────────
   The whole dashboard is three things: greeting (above), one giant number
   (hero), and a two-column split (trend chart + live activity). Everything
   else moved to its own view. */

/* Ambient warm-cyan glow behind the dashboard top — gives the whole view
   a horizon line of accent color without changing the dark theme. */
#view-dashboard {
  position: relative;
}
#view-dashboard::before {
  content: "";
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1100px, 110%);
  height: 380px;
  background: radial-gradient(ellipse at center top,
              rgba(0, 212, 255, 0.10) 0%,
              rgba(0, 212, 255, 0.04) 35%,
              transparent 70%);
  pointer-events: none;
  z-index: 0;
}
#view-dashboard > * { position: relative; z-index: 1; }

.dash-hero {
  padding: 16px 0 48px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 32px;
}
.dash-hero-eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 22px;
}
.dash-hero-number {
  font-family: 'Syne', 'Inter', sans-serif;
  font-size: 116px;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.95;
  color: var(--text-white);
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  margin: 0 0 24px;
  text-shadow: 0 0 60px rgba(0, 212, 255, 0.18);
}
.dash-hero-context {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 760px;
  letter-spacing: -0.005em;
}

/* Day-1 empty state — bare "0" felt cold for brand-new accounts. The
   "Ready when you are" treatment is smaller, warmer, sits in italic
   serif-like Syne with the accent halo still glowing. */
.dash-hero.is-empty .dash-hero-number {
  font-size: 56px;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, var(--accent-bright) 0%, rgba(0, 212, 255, 0.55) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}
@media (max-width: 720px) {
  .dash-hero.is-empty .dash-hero-number { font-size: 40px; }
}
.dash-hero-day1 {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.10) 0%, rgba(0, 212, 255, 0.02) 100%);
  border: 1px solid rgba(0, 212, 255, 0.22);
}
.dash-hero-link {
  color: var(--accent-bright);
  text-decoration: none;
  border-bottom: 1px dashed rgba(0, 212, 255, 0.35);
  transition: color 140ms ease, border-color 140ms ease;
}
.dash-hero-link:hover {
  color: #6BE4FF;
  border-color: rgba(0, 212, 255, 0.7);
}

/* Cold-start 3-step guide that replaces the hero context when account is
   blank. Doug's #1 dashboard ask was "tell me what to do next" instead of
   an empty stat dashboard. PR #200. */
.dash-coldstart {
  margin-top: 14px;
  text-align: left;
}
.dash-coldstart-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 680px;
  margin: 0 auto;
}
.dash-coldstart-step {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  transition: border-color 160ms ease, background 160ms ease;
}
.dash-coldstart-step:hover {
  border-color: var(--accent);
  background: var(--bg-tertiary, rgba(0,212,255,0.04));
}
.dash-coldstart-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 212, 255, 0.10);
  border: 1px solid rgba(0, 212, 255, 0.30);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.dash-coldstart-step-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary, var(--text));
  margin-bottom: 2px;
}
.dash-coldstart-step-sub {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.5;
}
.dash-coldstart-cta {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  white-space: nowrap;
  transition: all 160ms ease;
}
.dash-coldstart-cta:hover { border-color: var(--accent); background: rgba(0,212,255,0.06); }
.dash-coldstart-cta.is-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.dash-coldstart-cta.is-primary:hover {
  filter: brightness(1.1);
  border-color: var(--accent-bright);
}
@media (max-width: 720px) {
  .dash-coldstart-step { grid-template-columns: auto 1fr; }
  .dash-coldstart-cta { grid-column: 1 / -1; text-align: center; }
}

/* ─────────────  Documents tab polish  ─────────────
   List-row pattern matches the rest of the app + skeleton loader +
   click-to-preview modal with embedded PDF iframe. */
.docs-row { cursor: pointer; }
.docs-row:hover { transform: translateY(-1px); }
.docs-row-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.docs-row-icon svg { width: 19px; height: 19px; }
.docs-row-icon--danger  { background: rgba(245, 83, 108, 0.12); color: var(--color-danger);  box-shadow: inset 0 0 0 1px rgba(245, 83, 108, 0.25); }
.docs-row-icon--info    { background: rgba(0, 212, 255, 0.12);  color: var(--accent-bright); box-shadow: inset 0 0 0 1px rgba(0, 212, 255, 0.25); }
.docs-row-icon--success { background: rgba(43, 203, 127, 0.12); color: var(--color-success); box-shadow: inset 0 0 0 1px rgba(43, 203, 127, 0.25); }
.docs-row-icon--muted   { background: var(--bg-tertiary);       color: var(--text-secondary); box-shadow: inset 0 0 0 1px var(--border-color); }

/* Docs skeleton */
.docs-skeleton-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 8px;
}
.docs-skel {
  background: linear-gradient(90deg, var(--bg-tertiary) 0%, var(--bg-elevated) 50%, var(--bg-tertiary) 100%);
  background-size: 200% 100%;
  animation: docsShimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
}
.docs-skel--icon { width: 40px; height: 40px; border-radius: 10px; }
.docs-skel--line { height: 11px; margin: 5px 0; }
.docs-skel--line.long  { width: 70%; }
.docs-skel--line.short { width: 35%; }
.docs-skel--btn  { width: 88px; height: 26px; border-radius: 6px; }
@keyframes docsShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Docs empty state */
.docs-empty {
  text-align: center;
  padding: 56px 24px 52px;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: 14px;
  margin-top: 8px;
}
.docs-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.18) 0%, rgba(0, 212, 255, 0.04) 100%);
  border: 1px solid rgba(0, 212, 255, 0.24);
  color: var(--accent-bright);
  margin-bottom: 16px;
  box-shadow: 0 0 0 8px rgba(0, 212, 255, 0.04);
}
.docs-empty h4 {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-white);
  letter-spacing: -0.015em;
  margin: 0 0 8px;
}
.docs-empty p {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0 0 18px;
  max-width: 480px;
  line-height: 1.6;
  display: inline-block;
}
.docs-empty code {
  background: var(--bg-tertiary);
  color: var(--accent-bright);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

/* Docs preview modal */
.docs-preview-modal {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vh 4vw;
  background: rgba(8, 10, 18, 0.78);
  backdrop-filter: blur(6px);
  z-index: 250;
  animation: fadeIn 160ms ease;
}
.docs-preview-shell {
  width: min(880px, 100%);
  height: 90vh;
  max-height: 90vh;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: previewSlideUp 240ms ease both;
}
@keyframes previewSlideUp {
  from { transform: translateY(14px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.docs-preview-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.docs-preview-title {
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-white);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.docs-preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.docs-preview-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color 140ms ease;
}
.docs-preview-close:hover { color: var(--text-white); }
.docs-preview-body {
  flex: 1;
  background: #fff;
  position: relative;
  overflow: hidden;
}
.docs-preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.docs-preview-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 13.5px;
  background: var(--bg-elevated);
}
.docs-preview-error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-danger);
  font-size: 13.5px;
  background: var(--bg-elevated);
  padding: 24px;
  text-align: center;
}

/* ─────────────  Dashboard quick-actions ribbon  ─────────────
   Four colorful action cards between the hero number and the split panels.
   The dashboard isn't just a stats display — it's a workspace, and these
   are the one-click entry points to the operator's daily tasks. Each card
   gets its own accent color so the row has visual life. */
.dash-quick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 0 0 36px;
}
@media (max-width: 960px) {
  .dash-quick { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .dash-quick { grid-template-columns: 1fr; }
}
.dash-quick-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 16px 16px 18px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
  font-family: var(--font-body);
}
.dash-quick-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--dq-glow, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}
.dash-quick-card:hover {
  transform: translateY(-2px);
  border-color: var(--dq-border, var(--border-strong));
  background: var(--bg-elevated);
}
.dash-quick-card:hover::after { opacity: 1; }
.dash-quick-card > * { position: relative; z-index: 1; }
.dash-quick-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--dq-icon-bg, rgba(0, 212, 255, 0.12));
  color: var(--dq-icon-fg, var(--accent-bright));
  border: 1px solid var(--dq-icon-border, rgba(0, 212, 255, 0.22));
}
.dash-quick-icon svg { width: 18px; height: 18px; }
.dash-quick-label {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-white);
  letter-spacing: -0.01em;
}
.dash-quick-sub {
  font-size: 12.5px;
  font-weight: 450;
  color: var(--text-dim);
  letter-spacing: -0.003em;
  line-height: 1.45;
}
/* Per-card accent variants. */
.dash-quick-card.is-cyan {
  --dq-icon-bg:    rgba(0, 212, 255, 0.14);
  --dq-icon-fg:    var(--accent-bright);
  --dq-icon-border: rgba(0, 212, 255, 0.28);
  --dq-border:      rgba(0, 212, 255, 0.45);
  --dq-glow:        radial-gradient(circle at top right, rgba(0, 212, 255, 0.10), transparent 70%);
}
.dash-quick-card.is-violet {
  --dq-icon-bg:    rgba(139, 92, 246, 0.14);
  --dq-icon-fg:    #B9A4FB;
  --dq-icon-border: rgba(139, 92, 246, 0.30);
  --dq-border:      rgba(139, 92, 246, 0.45);
  --dq-glow:        radial-gradient(circle at top right, rgba(139, 92, 246, 0.10), transparent 70%);
}
.dash-quick-card.is-amber {
  --dq-icon-bg:    rgba(242, 179, 66, 0.14);
  --dq-icon-fg:    #F2B342;
  --dq-icon-border: rgba(242, 179, 66, 0.30);
  --dq-border:      rgba(242, 179, 66, 0.42);
  --dq-glow:        radial-gradient(circle at top right, rgba(242, 179, 66, 0.10), transparent 70%);
}
.dash-quick-card.is-emerald {
  --dq-icon-bg:    rgba(43, 203, 127, 0.14);
  --dq-icon-fg:    #43D796;
  --dq-icon-border: rgba(43, 203, 127, 0.30);
  --dq-border:      rgba(43, 203, 127, 0.42);
  --dq-glow:        radial-gradient(circle at top right, rgba(43, 203, 127, 0.10), transparent 70%);
}
.dash-hero-context strong {
  color: var(--text-white);
  font-weight: 600;
}
.dash-context-soft {
  color: var(--text-muted);
  margin: 0 4px;
}
.dash-context-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 9px;
  margin-left: 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  letter-spacing: 0;
}
.dash-context-trend.is-up {
  background: rgba(43, 203, 127, 0.12);
  color: var(--color-success);
  border: 1px solid rgba(43, 203, 127, 0.25);
}
.dash-context-trend.is-down {
  background: rgba(245, 83, 108, 0.12);
  color: var(--color-danger);
  border: 1px solid rgba(245, 83, 108, 0.25);
}

/* Two-column body: trend chart left (1.6fr), live activity right (1fr). */
.dash-split {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 28px;
  align-items: stretch;
}
@media (max-width: 1024px) {
  .dash-split { grid-template-columns: 1fr; }
}

.dash-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 26px 28px 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}
.dash-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 12px;
}
.dash-panel-header h3 {
  font-family: 'Syne', 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-white);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.dash-panel-header h3::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.12);
  flex-shrink: 0;
}
.dash-panel-meta {
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.dash-panel-link {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent-bright);
  text-decoration: none;
  cursor: pointer;
  transition: color 160ms ease;
}
.dash-panel-link:hover { color: var(--text-white); }

.dash-panel-chart {
  margin: 0 -6px;
}
.dash-panel-chart .hero-chart {
  display: block;
  width: 100%;
  height: 200px;
}
.dash-panel-chart:empty { display: none; }

.dash-panel-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border-color);
}
.dash-panel-stats:empty { display: none; }
.panel-stat {
  padding: 0 14px;
  border-right: 1px solid var(--border-soft);
}
.panel-stat:first-child { padding-left: 0; }
.panel-stat:last-child  { border-right: none; padding-right: 0; }
.panel-stat-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.panel-stat-value {
  font-family: 'Syne', 'Inter', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-white);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.dash-panel-feed {
  max-height: 420px;
  overflow-y: auto;
  margin: 0 -8px;
  padding: 0 8px;
}
.dash-panel-feed .activity-stream { gap: 18px; margin-top: 0; }

@media (max-width: 720px) {
  .dash-hero { padding: 8px 0 36px; margin-bottom: 28px; }
  .dash-hero-number { font-size: 80px; letter-spacing: -0.045em; }
  .dash-hero-context { font-size: 15px; }
  .dash-panel { padding: 22px 20px; }
  .dash-panel-stats { grid-template-columns: 1fr 1fr; gap: 14px; border-top: 1px solid var(--border-color); padding-top: 18px; }
  .panel-stat { padding: 0; border-right: none; }
}

/* ─────────────  Generic list view: toolbar + search + card rows  ─────────────
   Used by Properties + Tenants. Replaces the cramped data-table pattern with
   a Linear/Notion-style card list that's scannable and properly responsive. */
.list-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 4px 0 18px;
  flex-wrap: wrap;
}
.list-search-wrap {
  position: relative;
  flex: 1 1 320px;
  min-width: 200px;
}
.list-search {
  width: 100%;
  padding: 11px 14px 11px 40px;
  background: var(--bg-card);
  color: var(--text-white);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 13.5px;
  outline: none;
  transition: border-color 160ms ease, background 160ms ease;
}
.list-search::placeholder { color: var(--text-dim); }
.list-search:focus {
  border-color: var(--accent);
  background: var(--bg-elevated);
}
.list-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  pointer-events: none;
}
.list-count {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

.list-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.list-row:hover {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
}

.list-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  color: #FFFFFF;
  letter-spacing: 0;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.10);
}
.list-avatar--square { border-radius: 10px; }

.list-row-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.list-row-primary {
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-white);
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.list-row-secondary {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.4;
  /* Doug's mobile bug: addresses got ellipsized at ~20 chars on phones
     because the list-row-body had min-width:0 but no explicit overflow
     handling, so flex pushed text past the container. Force wrap onto
     two lines instead of clipping. */
  overflow-wrap: anywhere;
  word-break: break-word;
}
@media (max-width: 720px) {
  .list-row-secondary {
    /* On phones, allow the address to wrap to two lines instead of one
       ellipsized line. Most PM owners are reading these on phones in
       the field. */
    white-space: normal;
  }
}
.list-row-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* Pills for status / type / badges within rows */
.list-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.08);
  line-height: 1.4;
  white-space: nowrap;
}
.list-pill--success { background: rgba(43, 203, 127, 0.12); color: var(--color-success); border-color: rgba(43, 203, 127, 0.25); }
.list-pill--info    { background: rgba(0, 212, 255, 0.12);  color: var(--accent-bright); border-color: rgba(0, 212, 255, 0.28); }
.list-pill--warning { background: rgba(242, 179, 66, 0.12); color: var(--color-warning); border-color: rgba(242, 179, 66, 0.25); }
.list-pill--danger  { background: rgba(245, 83, 108, 0.12); color: var(--color-danger);  border-color: rgba(245, 83, 108, 0.25); }
.list-pill--muted   { background: rgba(255, 255, 255, 0.04); color: var(--text-dim); border-color: rgba(255, 255, 255, 0.08); }

/* Occupancy bar — visual progress for Properties */
.list-row-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.list-bar-track {
  flex: 1;
  max-width: 200px;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}
.list-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 200ms ease;
}
.list-bar-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  white-space: nowrap;
}

.list-row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

/* Meta line — tertiary info below the secondary line (e.g. unit + assignee + age). */
.list-row-meta {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-dim);
  line-height: 1.5;
  margin-top: 4px;
}
.list-row-meta strong {
  color: var(--text-secondary);
  font-weight: 600;
}

/* Mono ID chip inside list rows (#3214 etc) */
.list-mono {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
  letter-spacing: 0;
}

/* Variant with a prominent right-aligned dollar amount (overdue payments). */
.list-row--with-amount {
  grid-template-columns: 44px 1fr auto auto;
}
.list-amount {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-white);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-right: 6px;
}
.list-amount--danger  { color: var(--color-danger); }
.list-amount--success { color: var(--color-success); }

/* ─────────────  Trial-balance preview card (from #228)  ─────────────
   Income-statement summary above the QBO/Xero download buttons. */
.trial-balance { margin: 4px 0 18px; }
.trial-balance-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
}
.trial-balance-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
}
.trial-balance-title {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.trial-balance-period {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.trial-balance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
}
@media (max-width: 720px) {
  .trial-balance-grid { grid-template-columns: 1fr; }
}
.trial-balance-cell {
  padding: 16px 18px;
  border-right: 1px solid var(--border-color);
}
.trial-balance-cell:last-child { border-right: none; }
.trial-balance-cell--accent {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.05) 0%, rgba(0, 212, 255, 0) 100%);
}
.trial-balance-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.trial-balance-value {
  font-family: 'Syne', 'Inter', sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  color: var(--text-white);
  line-height: 1.1;
  margin-bottom: 4px;
}
.trial-balance-value--success { color: var(--color-success); }
.trial-balance-value--danger  { color: var(--color-danger); }
.trial-balance-sub {
  font-size: 11.5px;
  color: var(--text-dim);
}

/* Invoices bulk-select — checkbox column + action bar at the top of
   the list that slides in when at least one invoice is checked. */
.list-row-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
}
.list-row-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-bright);
  cursor: pointer;
}
.list-row[data-invoice-id] {
  grid-template-columns: 22px 44px 1fr auto auto;
}
.invoices-bulkbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.08) 0%, rgba(0, 212, 255, 0.02) 100%);
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: 12px;
  animation: bulkbarSlide 220ms ease both;
}
.invoices-bulkbar[hidden] { display: none; }
@keyframes bulkbarSlide {
  from { transform: translateY(-4px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.invoices-bulkbar-count {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-white);
  letter-spacing: -0.005em;
  font-variant-numeric: tabular-nums;
}
.invoices-bulkbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ─────────────  Listing assistant modal  ─────────────
   AI-drafted listing copy + syndication links. */
.listing-section { margin-bottom: 18px; }
.listing-section:last-child { margin-bottom: 0; }
.listing-section-label {
  display: flex;
  align-items: center;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.listing-title {
  font-family: 'Syne', 'Inter', sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: -0.015em;
  line-height: 1.3;
  padding: 12px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}
.listing-quick-facts {
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--text-white);
  padding: 10px 14px;
  background: rgba(0, 212, 255, 0.06);
  border: 1px solid rgba(0, 212, 255, 0.18);
  border-radius: 8px;
}
.listing-syndication-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.listing-syndication-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: border-color 160ms ease, background 160ms ease;
}
.listing-syndication-row:hover {
  border-color: rgba(0, 212, 255, 0.30);
  background: rgba(0, 212, 255, 0.04);
}
.listing-syndication-name {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-white);
  letter-spacing: -0.005em;
  margin-bottom: 2px;
}
.listing-syndication-instructions {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.5;
}
.listing-tip {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(242, 179, 66, 0.05);
  border: 1px solid rgba(242, 179, 66, 0.22);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Inactive / soft-deleted variant — used by disabled recurring expenses
   when the Show-disabled toggle is on, so the operator can see history
   without the row pretending to be live. */
.list-row--inactive {
  opacity: 0.55;
}
.list-row--inactive:hover { opacity: 0.9; }

/* Preferred-vendor star (filled amber) */
.list-star {
  color: #F59E0B;
  font-size: 14px;
  line-height: 1;
  margin-left: 2px;
}

/* Status / filter button group — segmented control next to the search input. */
.list-filter-group {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 3px;
  flex-shrink: 0;
}
.list-filter-btn {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  border-radius: 7px;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}
.list-filter-btn:hover { color: var(--text-primary); }
.list-filter-btn.is-active {
  background: var(--bg-elevated);
  color: var(--text-white);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

@media (max-width: 720px) {
  .list-row {
    grid-template-columns: 36px 1fr;
    grid-template-rows: auto auto;
    gap: 10px 12px;
  }
  .list-row--with-amount {
    grid-template-columns: 36px 1fr auto;
  }
  .list-amount { font-size: 16px; align-self: center; }
  .list-avatar { width: 36px; height: 36px; font-size: 12.5px; }
  .list-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .list-bar-track { max-width: 100%; }
  .list-toolbar { gap: 10px; }
  .list-count { width: 100%; }
}

/* ─────────────  Activity feed — scannable timeline  ───────────── */
.activity-stream {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-top: 16px;
}
.activity-day-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding-bottom: 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}
.activity-day-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.activity-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 10px;
  transition: background 140ms ease;
}
.activity-row:hover { background: var(--bg-card); }
.activity-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: #FFFFFF;
  letter-spacing: 0;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.10);
}
.activity-body { min-width: 0; }
.activity-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.activity-verb {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
  border: 1px solid transparent;
}
.activity-verb--pos      { color: #34D399; background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.25); }
.activity-verb--info     { color: var(--accent-bright); background: rgba(0, 212, 255, 0.12); border-color: rgba(0, 212, 255, 0.28); }
.activity-verb--success  { color: var(--color-success); background: var(--color-success-bg); border-color: rgba(43, 203, 127, 0.25); }
.activity-verb--neg      { color: var(--color-danger); background: var(--color-danger-bg); border-color: rgba(245, 83, 108, 0.25); }
.activity-verb--neutral  { color: var(--text-secondary); background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.10); }
.activity-subject {
  color: var(--text-white);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.005em;
  word-break: break-word;
}
.activity-details {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  margin-top: 4px;
  word-break: break-word;
}
.activity-time {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  flex-shrink: 0;
  white-space: nowrap;
  align-self: start;
  padding-top: 4px;
}

/* Failure row: subtle red left edge so it's noticeable but not alarming. */
.activity-row.activity-row--neg {
  box-shadow: inset 2px 0 0 var(--color-danger);
}

@media (max-width: 720px) {
  .activity-row { grid-template-columns: 28px 1fr auto; gap: 10px; padding: 10px 8px; }
  .activity-subject { font-size: 13.5px; }
  .activity-details { font-size: 12.5px; }
}

/* ─────────────  Settings page: sticky-nav SaaS layout  ───────────── */
.settings-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 56px;
  align-items: flex-start;
  max-width: 1080px;
  margin: 0 auto;
}

/* ─────────────  Finances view — distinct from Settings  ─────────────
   Settings is a config screen. Finances is a portfolio report. They used
   to share the exact same shell which made Finances feel like 'just more
   settings' instead of a money dashboard. This block restyles Finances
   while reusing wireSettingsNav() for the sticky scroll-spy behavior. */

.finances-page-header {
  max-width: 1080px;
  margin: 0 auto 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}
.finances-page-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.finances-page-header h2 {
  font-family: 'Syne', 'Inter', sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-white);
  margin: 0;
  line-height: 1.1;
}
.finances-page-header p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
  max-width: 720px;
}
.finances-eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-bottom: 8px;
}
.finances-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Hero strip — 4 oversized money tiles at the top, like a bank statement.
   loadFinances populates #finance-stats with .finances-tile children. */
.finances-hero {
  max-width: 1080px;
  margin: 0 auto 32px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 880px) {
  .finances-hero { grid-template-columns: repeat(2, 1fr); }
}
/* Finances-tile — Linear-style KPI tile (PR-aligned with stat-card below
   to share the v2 visual vocabulary). Compact variant used in the Finances
   view header row. Drops Syne for Inter, uses --radius-md, no top stripe. */
.finances-tile {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  position: relative;
  transition: border-color var(--transition-base);
}
.finances-tile:hover { border-color: var(--border-strong); }
.finances-tile--success { border-left: 2px solid var(--color-success); }
.finances-tile--warning { border-left: 2px solid var(--color-warning); }
.finances-tile--danger  { border-left: 2px solid var(--color-danger); }
.finances-tile-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.finances-tile-value {
  font-family: var(--font-body);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-white);
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  margin-bottom: 4px;
}
.finances-tile--success .finances-tile-value { color: var(--color-success); }
.finances-tile--warning .finances-tile-value { color: var(--color-warning); }
.finances-tile--danger  .finances-tile-value { color: var(--color-danger);  }
.finances-tile-sub {
  font-size: 12.5px;
  color: var(--text-dim);
}

/* Shell — same 2-column structure as settings-shell but with its own
   class so future Finances styling doesn't leak into Settings. */
.finances-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 56px;
  align-items: flex-start;
  max-width: 1080px;
  margin: 0 auto;
}

/* Sidebar nav — icons + colored badges per section so it reads as a
   report TOC, not a settings list. */
.finances-nav {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
}
.finances-nav-title {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 12px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border-color);
}
.finances-nav-link {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
}
.finances-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(0, 212, 255, 0.10);
  color: var(--accent-bright);
  border: 1px solid rgba(0, 212, 255, 0.20);
}
.finances-nav-icon svg { width: 13px; height: 13px; }
.finances-nav-icon--danger {
  background: rgba(245, 83, 108, 0.10);
  color: var(--color-danger);
  border-color: rgba(245, 83, 108, 0.22);
}
.finances-nav-icon--warning {
  background: rgba(242, 179, 66, 0.10);
  color: var(--color-warning);
  border-color: rgba(242, 179, 66, 0.22);
}
.finances-nav-label {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.finances-nav-link.is-active .finances-nav-label { color: var(--text-white); font-weight: 600; }

/* Sections — leading colored bar instead of bottom border + bigger
   Syne section titles so each section reads as a chapter, not a form. */
.finances-content { min-width: 0; }
.finances-section {
  scroll-margin-top: 92px;
  margin-bottom: 48px;
}
.finances-section-header {
  display: grid;
  grid-template-columns: 4px 1fr;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 22px;
  padding: 0;
  border: none;
}
.finances-section-bar {
  width: 4px;
  align-self: stretch;
  min-height: 38px;
  border-radius: 4px;
  background: var(--accent-bright);
}
.finances-section-bar--danger  { background: var(--color-danger); }
.finances-section-bar--warning { background: var(--color-warning); }
.finances-section-bar--success { background: var(--color-success); }
.finances-section-header h3 {
  font-family: 'Syne', 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-white);
  margin: 0 0 6px;
  line-height: 1.2;
}
.finances-section-header p {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.55;
  margin: 0;
}

@media (max-width: 960px) {
  .finances-shell { grid-template-columns: 1fr; gap: 28px; }
  .finances-nav { position: static; }
  .finances-page-header h2 { font-size: 26px; }
}
.settings-nav {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
}
.settings-nav-title {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 12px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border-color);
}
.settings-nav-link {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 8px;
  transition: background 160ms ease, color 160ms ease;
  letter-spacing: -0.005em;
  position: relative;
}
.settings-nav-link:hover {
  color: var(--text-white);
  background: var(--bg-card);
}
.settings-nav-link.is-active {
  color: var(--text-white);
  background: var(--bg-card);
  font-weight: 600;
}
.settings-nav-link.is-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 18px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.settings-content { min-width: 0; }
.settings-page-header {
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}
.settings-page-header h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-white);
  margin: 0 0 8px;
}
.settings-page-header p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
  max-width: 640px;
}

.settings-section {
  scroll-margin-top: 92px;  /* sticky topbar offset so anchor links land cleanly */
}
.settings-section-header {
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}
.settings-section-header h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-white);
  margin: 0 0 6px;
}
.settings-section-header p {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0;
}

/* Sub-cards inside sections (the [data-collapsible] blocks) get a calmer
   treatment — same as the rest of the dashboard cards. */
.settings-section [data-collapsible] {
  border-radius: 12px;
}

@media (max-width: 960px) {
  .settings-shell {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .settings-nav {
    position: relative;
    top: 0;
    flex-direction: row;
    overflow-x: auto;
    gap: 4px;
    padding: 0 0 16px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    scrollbar-width: thin;
  }
  .settings-nav-title { display: none; }
  .settings-nav-link {
    flex-shrink: 0;
    padding: 7px 12px;
    font-size: 12.5px;
    border-radius: 999px;
  }
  .settings-nav-link.is-active::before { display: none; }
  .settings-nav-link.is-active {
    background: var(--accent-dim);
    color: var(--accent-bright);
  }
}

@media (max-width: 720px) {
  .compare-grid { grid-template-columns: 1fr; }
  .dash-header { flex-direction: column; align-items: stretch; }
  .dash-actions { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .agent-status-pill { order: -1; width: 100%; justify-content: center; }
  .dash-cta { flex: 1; justify-content: center; }
  .roi-banner-chart .hero-chart { height: 140px; }
  .live-stream { padding: 14px 16px; }
  .live-stream-row { padding: 7px 8px; }
  .live-stream-why { display: none; }   /* save row width — hover the title for the why */
}

/* Clip-path buttons inside quick-actions & chat header */
.clip-btn {
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
}

/* Make sure all buttons reset browser default backgrounds */
button {
  background: transparent;
  border: none;
  color: inherit;
}

/* Chat header + send button */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.chat-header h3 {
  font-family: var(--font-heading);
  font-size: var(--font-lg);
  color: var(--text-white);
  margin: 0;
}

.chat-input-area {
  display: flex;
  gap: var(--space-3);
  align-items: flex-end;
}

.chat-input-area textarea {
  flex: 1;
  padding: 10px 14px;
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--font-sm);
  resize: none;
  max-height: 140px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.chat-input-area textarea:focus {
  border-color: var(--accent);
}

.btn-send {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-md);
  color: var(--bg-primary);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition-fast);
}

.btn-send:hover {
  background: var(--accent-bright);
  box-shadow: var(--glow-md);
  transform: translateY(-1px);
}

.btn-send svg {
  width: 18px;
  height: 18px;
}

/* Stats Grid — premium KPI row. Uniform sizing, ample gap. */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
  padding: 0;
  margin-top: 32px;
}

/* Stat-card — dashboard-home KPI with icon top-right. Aligned to v2
   visual vocabulary: --radius-md, Inter, no halo theater, gentle hover
   lift only. Same body/label classes as .finances-tile so the typography
   is consistent across both contexts. */
.stat-card {
  position: relative;
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color var(--transition-base), background var(--transition-base);
}
.stat-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-elevated);
}

.stat-card .stat-icon {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(0, 212, 255, 0.08);
  color: var(--accent);
  border: 1px solid rgba(0, 212, 255, 0.20);
  line-height: 1;
}
.stat-card .stat-icon svg,
.stat-card .stat-icon.ic {
  width: 16px;
  height: 16px;
}

.stat-card .stat-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  margin: 0 0 20px;
  padding-right: 58px;
}

.stat-card .stat-value {
  font-family: var(--font-body);
  font-size: 48px;
  font-weight: 700;
  color: var(--text-white);
  text-shadow: none;
  line-height: 1;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1, "cv11" 1;
  margin: 0;
}

.stat-card .stat-change {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-success);
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Secondary microcopy below a stat value (used in Portfolio KPI cards
   for context — "5 of 8 units", "23 payments paid", etc). */
.stat-card .stat-sub {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  margin-top: 10px;
  letter-spacing: 0;
  line-height: 1.4;
}

/* Variants — icon chip background + value tint */
.stat-card.highlight .stat-icon  { background: linear-gradient(135deg, rgba(0, 212, 255, 0.22) 0%, rgba(0, 212, 255, 0.06) 100%);  color: var(--accent-bright); border-color: rgba(0, 212, 255, 0.28); }
.stat-card.success   .stat-icon  { background: linear-gradient(135deg, rgba(43, 203, 127, 0.22) 0%, rgba(43, 203, 127, 0.06) 100%); color: var(--color-success);   border-color: rgba(43, 203, 127, 0.28); }
.stat-card.warning   .stat-icon  { background: linear-gradient(135deg, rgba(242, 179, 66, 0.22) 0%, rgba(242, 179, 66, 0.06) 100%); color: var(--color-warning);   border-color: rgba(242, 179, 66, 0.28); }
.stat-card.danger    .stat-icon  { background: linear-gradient(135deg, rgba(245, 83, 108, 0.22) 0%, rgba(245, 83, 108, 0.06) 100%); color: var(--color-danger);    border-color: rgba(245, 83, 108, 0.28); }

.stat-card.highlight .stat-value { color: var(--text-white); }
.stat-card.success   .stat-value { color: var(--text-white); }
.stat-card.warning   .stat-value { color: var(--text-white); }
.stat-card.danger    .stat-value { color: var(--color-danger); }

/* The "urgent" overdue card — distinct but polished */
.stat-card.danger {
  border-color: rgba(245, 83, 108, 0.28);
  background: linear-gradient(180deg, rgba(245, 83, 108, 0.04) 0%, var(--bg-card) 60%);
}
.stat-card.danger:hover {
  border-color: rgba(245, 83, 108, 0.50);
  background: linear-gradient(180deg, rgba(245, 83, 108, 0.07) 0%, var(--bg-elevated) 60%);
}

/* Empty-state styling — value reads as muted '—' instead of a colored '0'
   so brand-new accounts don't look like a broken dashboard. */
.stat-card .stat-value.is-empty,
.stat-card.highlight .stat-value.is-empty,
.stat-card.success .stat-value.is-empty,
.stat-card.warning .stat-value.is-empty,
.stat-card.danger .stat-value.is-empty {
  color: var(--text-dim);
  opacity: 0.55;
  text-shadow: none;
}

/* ROI banner — premium hero block. Tight rhythm, calm layered gradient,
   per-metric sparklines, scannable on first glance. */
.roi-banner {
  position: relative;
  margin-bottom: 36px;
  padding: 40px 44px 36px;
  background:
    radial-gradient(ellipse 900px 340px at 0% 0%, rgba(0, 212, 255, 0.14), transparent 65%),
    radial-gradient(ellipse 700px 400px at 100% 100%, rgba(0, 212, 255, 0.05), transparent 60%),
    linear-gradient(180deg, #1A2138 0%, #131829 100%);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  box-shadow: var(--shadow-elevated);
  overflow: hidden;
}
.roi-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.55), transparent);
}
.roi-banner-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-bottom: 18px;
  padding: 6px 12px;
  background: rgba(0, 212, 255, 0.14);
  border: 1px solid rgba(0, 212, 255, 0.32);
  border-radius: 999px;
}
.roi-banner-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent-bright);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.9);
  animation: dotPulse 2.4s ease-in-out infinite;
}
@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}
.roi-banner-headline {
  color: var(--text-secondary);
  font-size: 18px;
  line-height: 1.5;
  font-weight: 400;
  margin: 4px 0 24px;
  letter-spacing: -0.005em;
  max-width: 760px;
}

/* Hero chart container — sits between the headline and the metric strip.
   Full-width SVG with date labels. The single biggest "this is real SaaS"
   visual on the page. */
.roi-banner-chart {
  margin: 0 -8px 28px;
  padding: 0;
  position: relative;
}
.roi-banner-chart .hero-chart {
  display: block;
  width: 100%;
}
.roi-banner-chart:empty { display: none; }
.roi-banner-headline strong {
  color: var(--text-white);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.015em;
}
.roi-banner-headline strong.text-accent { color: var(--accent-bright); }
.roi-banner-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0;
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
}
.roi-stat {
  padding: 0 32px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.roi-stat:first-child { padding-left: 0; }
.roi-stat:last-child  { border-right: none; padding-right: 0; }
/* Per-metric sparkline removed — the hero chart above the metric strip
   carries the trend visualization now. Class kept for backward-compat
   in case other surfaces still render them. */
.roi-stat-spark {
  height: 32px;
  margin-bottom: 16px;
}
.roi-stat-spark:empty { display: none; }
.roi-stat-value {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 44px;
  line-height: 1;
  color: var(--text-white);
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1, "cv11" 1;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.roi-stat-value--success { color: var(--color-success); }
.roi-stat-value--accent  { color: var(--accent-bright); }
.roi-stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-body);
  border-radius: 999px;
  background: rgba(43, 203, 127, 0.12);
  color: var(--color-success);
  border: 1px solid rgba(43, 203, 127, 0.25);
  letter-spacing: 0;
  text-transform: none;
  line-height: 1;
}
.roi-stat-trend--up::before   { content: '↑'; font-size: 11px; }
.roi-stat-trend--down {
  background: rgba(245, 83, 108, 0.12);
  color: var(--color-danger);
  border-color: rgba(245, 83, 108, 0.25);
}
.roi-stat-trend--down::before { content: '↓'; font-size: 11px; }
.roi-stat-trend--muted {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  border-color: rgba(255, 255, 255, 0.08);
}
.roi-stat-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 14px;
}

/* Sparkline base — used in ROI stats. */
.sparkline {
  display: inline-block;
  vertical-align: middle;
}

/* Savings widget — labor saved + actions handled tiles, then a row breakdown. */
.savings-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.savings-tile {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 22px 24px;
  position: relative;
  transition: border-color 180ms ease, transform 180ms ease;
}
.savings-tile:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.savings-tile--success { border-left: 3px solid var(--color-success); }
.savings-tile--accent  { border-left: 3px solid var(--accent); }
.savings-tile-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.savings-tile--success .savings-tile-label { color: var(--color-success); }
.savings-tile--accent  .savings-tile-label { color: var(--accent-bright); }
.savings-tile-value {
  font-family: var(--font-body);
  font-size: 34px;
  font-weight: 700;
  color: var(--text-white);
  line-height: 1;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums lining-nums;
}
.savings-tile-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
  letter-spacing: 0;
}
.savings-rows {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  color: var(--text-secondary);
}
.savings-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}
.savings-row:last-child { border-bottom: none; }
.savings-row strong {
  color: var(--text-white);
  font-family: var(--font-body);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ============================================
   11. Chat UI
   ============================================ */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-height));
  max-width: 860px;
  margin: 0 auto;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  scroll-behavior: smooth;
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border-color);
}

/* Chat message bubbles — v2 (Linear-style). Was: gradient + glow on user
   + cyan-tinted bg + box-shadow halo on assistant. Now: flat fills,
   --radius-md, hairlines, no glow. */
.message {
  max-width: 78%;
  padding: 12px 16px;
  font-size: 14.5px;
  line-height: 1.6;
  animation: fadeUp 0.25s ease both;
  border-radius: var(--radius-md);
}

.message.user {
  align-self: flex-end;
  background: var(--accent);
  color: var(--bg-primary);
  font-weight: 500;
}

.message.assistant {
  align-self: flex-start;
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

/* ─────────────  Chat welcome hero  ─────────────
   Hero card shown when chat opens fresh or after "New conversation". Big
   Syne heading, sub copy, 4 click-to-fill starter cards. Replaces the
   bare bulleted welcome that didn't feel like a real AI assistant. */
.chat-welcome {
  align-self: stretch;
  max-width: 720px;
  margin: 8px auto 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  animation: fadeUp 0.35s ease both;
}
.chat-welcome-hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
}
.chat-welcome-avatar {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.22) 0%, rgba(0, 212, 255, 0.04) 100%);
  border: 1px solid rgba(0, 212, 255, 0.32);
  color: var(--accent-bright);
  box-shadow: 0 0 0 8px rgba(0, 212, 255, 0.05);
}
.chat-welcome-avatar svg { width: 28px; height: 28px; }
.chat-welcome-heading {
  font-family: 'Syne', 'Inter', sans-serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-white);
  line-height: 1.1;
  margin-top: 4px;
}
.chat-welcome-subtitle {
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 450;
  color: var(--text-secondary);
  letter-spacing: -0.005em;
  line-height: 1.55;
  max-width: 560px;
}

/* Contextual urgent-work callout (only when overdue/urgent maint exist). */
.chat-welcome-context {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(242, 179, 66, 0.10) 0%, rgba(242, 179, 66, 0.02) 100%);
  border: 1px solid rgba(242, 179, 66, 0.32);
  border-radius: 12px;
}
.chat-welcome-context-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-warning);
  box-shadow: 0 0 0 4px rgba(242, 179, 66, 0.18);
  animation: eyebrowPulse 2.2s ease-in-out infinite;
}
.chat-welcome-context-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.chat-welcome-context-text {
  color: var(--text-white);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.chat-welcome-context-text strong { color: var(--color-warning); font-weight: 700; }
.chat-welcome-context-cta { flex-shrink: 0; }

/* 2x2 grid of starter prompts on desktop, stacked on mobile. */
.chat-welcome-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (max-width: 560px) {
  .chat-welcome-grid { grid-template-columns: 1fr; }
}
.chat-welcome-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  padding: 14px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.chat-welcome-card:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 212, 255, 0.35);
  background: var(--bg-elevated);
}
.chat-welcome-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 212, 255, 0.12);
  color: var(--accent-bright);
  border: 1px solid rgba(0, 212, 255, 0.22);
  flex-shrink: 0;
}
.chat-welcome-card-icon svg { width: 16px; height: 16px; }
.chat-welcome-card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chat-welcome-card-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-white);
  letter-spacing: -0.005em;
}
.chat-welcome-card-sub {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: -0.003em;
  line-height: 1.4;
}
.chat-welcome-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: -0.003em;
  margin-top: 4px;
}

.message.assistant code {
  font-family: var(--font-mono);
  background: var(--bg-tertiary);
  padding: 0.1em 0.35em;
  font-size: 0.85em;
  color: var(--accent-bright);
}

.message.assistant > *:first-child { margin-top: 0; }
.message.assistant > *:last-child { margin-bottom: 0; }

.message.assistant p { margin: 0 0 var(--space-2) 0; }
.message.assistant p:last-child { margin-bottom: 0; }

.message.assistant h1,
.message.assistant h2,
.message.assistant h3,
.message.assistant h4,
.message.assistant h5,
.message.assistant h6 {
  font-family: var(--font-display, inherit);
  font-weight: 700;
  color: var(--text-primary);
  margin: var(--space-3) 0 var(--space-2) 0;
  line-height: 1.3;
}
.message.assistant h1 { font-size: 1.25rem; }
.message.assistant h2 { font-size: 1.15rem; }
.message.assistant h3 { font-size: 1.05rem; }
.message.assistant h4,
.message.assistant h5,
.message.assistant h6 { font-size: 1rem; }

/* Re-enable list markers inside chat messages (overrides the global
   `ul, ol { list-style: none; }` reset). Custom marker color so the
   bullets feel intentional, not browser default. */
.message.assistant ul,
.message.assistant ol {
  margin: 6px 0 10px 0;
  padding-left: 22px;
}
.message.assistant ul { list-style: disc outside; }
.message.assistant ol { list-style: decimal outside; }
.message.assistant li {
  margin: 4px 0;
  padding-left: 4px;
  line-height: 1.55;
}
.message.assistant li::marker {
  color: var(--accent-bright);
  font-size: 0.9em;
}
.message.assistant li > p { margin: 0; }

.message.assistant hr {
  border: 0;
  border-top: 1px solid var(--border-color);
  margin: var(--space-3) 0;
}

.message.assistant blockquote {
  margin: 0 0 var(--space-2) 0;
  padding: 0.25em 0.75em;
  border-left: 3px solid var(--accent);
  color: var(--text-secondary, var(--text-primary));
  background: var(--bg-tertiary);
}

.message.assistant pre {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: var(--space-3);
  margin: 0 0 var(--space-2) 0;
  overflow-x: auto;
  font-size: 0.85em;
  line-height: 1.5;
}
.message.assistant pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
  font-size: 1em;
}

.message.assistant .chat-table-wrap {
  overflow-x: auto;
  margin: 0 0 var(--space-2) 0;
  border: 1px solid var(--border-color);
}
.message.assistant .chat-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9em;
}
.message.assistant .chat-table th,
.message.assistant .chat-table td {
  padding: 0.5em 0.75em;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
}
.message.assistant .chat-table th {
  background: var(--bg-tertiary);
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
.message.assistant .chat-table tbody tr:last-child td {
  border-bottom: 0;
}
.message.assistant .chat-table tbody tr:hover {
  background: var(--bg-tertiary);
}

.message.assistant a {
  color: var(--accent-bright, var(--accent));
  text-decoration: underline;
}

/* Chat Input Area */
.chat-input-area {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.chat-input-wrapper {
  display: flex;
  gap: var(--space-3);
  align-items: flex-end;
}

.chat-input-wrapper textarea {
  flex: 1;
  padding: 10px 14px;
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--font-sm);
  resize: none;
  max-height: 140px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.chat-input-wrapper textarea:focus {
  border-color: var(--accent);
}

.chat-input-wrapper textarea::placeholder {
  color: var(--text-dim);
}

.chat-input-wrapper .btn {
  flex-shrink: 0;
}

/* ============================================
   12. Typing Indicator
   ============================================ */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  align-self: flex-start;
  max-width: 78%;
  animation: fadeUp 0.25s ease both;
}
.typing-dots { display: flex; gap: 4px; flex-shrink: 0; }
.typing-dots span {
  width: 6px;
  height: 6px;
  background: var(--text-dim);
  border-radius: 50%;
  animation: bounce 1.4s ease-in-out infinite;
}
.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
.typing-label {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 450;
  color: var(--text-dim);
  letter-spacing: -0.005em;
  transition: opacity 200ms ease;
}

/* ============================================
   13. Suggestion Chips
   ============================================ */
.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-3) 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--font-xs);
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--border-color);
  border-radius: 0;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chip:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
  box-shadow: var(--glow-sm);
}

/* ============================================
   14. Data Tables
   ============================================ */
.data-table, .table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

/* Global numeric utility — apply to any inline value that should read as a
   real number (rent amount in chat, totals in modal previews, etc.). Same
   tabular-nums + lining-nums treatment as the stat cards + data tables. */
.num, code.num {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  font-family: var(--font-body);
}

.data-table thead th, .table thead th {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  background: var(--bg-tertiary);
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  white-space: nowrap;
}

.data-table tbody td, .table tbody td {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 400;
}

.data-table tbody tr, .table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover, .table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.data-table tbody tr:last-child td, .table tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================
   15. Badges
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 99px;
  border: 1px solid transparent;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

.badge-success, .badge.live {
  color: var(--color-success);
  background: rgba(0, 255, 136, 0.10);
  border-color: rgba(0, 255, 136, 0.20);
}

.badge-warning, .badge.trial {
  color: var(--color-warning);
  background: rgba(255, 184, 0, 0.10);
  border-color: rgba(255, 184, 0, 0.20);
}

.badge-danger, .badge.churned {
  color: var(--color-danger);
  background: rgba(255, 59, 92, 0.10);
  border-color: rgba(255, 59, 92, 0.20);
}

/* ============================================
   16. Spinner / Loading
   ============================================ */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

.spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 13, 26, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

/* ============================================
   17. Toast / Notifications
   ============================================ */
.toast-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.toast {
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--font-sm);
  font-weight: 400;
  color: var(--text-white);
  box-shadow: var(--shadow-card);
  border-left: 3px solid var(--accent);
  background: var(--bg-secondary);
  animation: slideUp 0.3s ease both;
  min-width: 280px;
}

.toast-success { border-left-color: var(--color-success); }
.toast-error { border-left-color: var(--color-danger); }
.toast-warning { border-left-color: var(--color-warning); }

/* ============================================
   18. Modal
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 13, 26, 0.80);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-elevated);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  animation: fadeUp 0.25s ease both;
}
.modal h3 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-white);
  margin: 0 0 6px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-dim);
  float: right;
  line-height: 1;
  transition: color var(--transition-fast);
}
.modal-close:hover {
  color: var(--accent);
}

/* ============================================
   19. Utility Classes
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.w-full { width: 100%; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }
.hidden { display: none !important; }
.visible { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* ============================================
   20. Keyframe Animations
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Animation Helpers */
.animate-fade-in { animation: fadeIn 0.4s ease both; }
.animate-slide-up { animation: fadeUp 0.4s ease both; }
.animate-slide-up-delay-1 { animation: fadeUp 0.4s ease 0.1s both; }
.animate-slide-up-delay-2 { animation: fadeUp 0.4s ease 0.2s both; }
.animate-slide-up-delay-3 { animation: fadeUp 0.4s ease 0.3s both; }

/* ============================================
   20a. Branded SVG icon set (Summit cyan)
   ============================================ */
/* Default icon sizing — every <svg class="ic"> takes currentColor so the
   parent's color rule wins. This means hover/active states "just work". */
.ic {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
}
.ic-inline {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  position: relative;
  top: -1px;
}

/* Sidebar nav: dim by default, full cyan on hover/active */
.sidebar .nav-icon.ic {
  width: 18px;
  height: 18px;
  color: rgba(184, 212, 224, 0.6);
  transition: color 0.15s;
}
.sidebar .nav-item:hover .nav-icon.ic,
.sidebar .nav-item.active .nav-icon.ic {
  color: var(--accent);
}

/* Stat card icons: subtle cyan tint, top-right corner */
.stat-card .stat-icon.ic {
  width: 22px;
  height: 22px;
  color: var(--accent);
  opacity: 0.55;
}
.stat-card.success .stat-icon.ic { color: var(--color-success); }
.stat-card.warning .stat-icon.ic { color: var(--color-warning); }
.stat-card.danger  .stat-icon.ic { color: var(--color-danger);  }

/* Bottom-tab icons: pick up the tab's color (inactive=dim, active=cyan) */
.bottom-tab .bt-icon.ic {
  width: 22px;
  height: 22px;
}

/* Empty state — bigger, glowing icon inside the circular badge */
.empty-icon .ic {
  width: 26px;
  height: 26px;
  color: var(--accent);
}

/* ============================================
   20b. Mobile Bottom Tab Bar (primary nav on phones)
   ============================================ */
.bottom-tabs {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: rgba(8, 18, 34, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
}

.bottom-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 9px 4px 8px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  position: relative;
  font-family: var(--font-body);
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.bottom-tab:active {
  background: rgba(0, 212, 255, 0.06);
}

.bottom-tab .bt-icon {
  font-size: 20px;
  line-height: 1;
  filter: grayscale(0.4);
  transition: filter 0.15s, transform 0.15s;
}

.bottom-tab .bt-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.bottom-tab.active {
  color: var(--accent);
}
.bottom-tab.active .bt-icon {
  filter: none;
  transform: scale(1.05);
}
.bottom-tab.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.6);
}

.bottom-tab .bt-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 22px);
  background: var(--color-danger);
  color: var(--text-white);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 0 0 2px rgba(8, 18, 34, 0.92);
}

/* ============================================
   21. Responsive — Mobile Breakpoint 960px
   ============================================ */
/* Mobile menu toggle (hamburger) — hidden on desktop */
.mobile-menu-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-white);
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 49;
  animation: fadeUp 0.2s ease;
}
.mobile-backdrop.show { display: block; }

@media (max-width: 960px) {
  /* iOS Safari auto-zooms ANY input/textarea whose computed font-size is
     below 16px when it receives focus. Bumping every form field to 16px
     on phones kills the zoom permanently — no more "tap field, screen
     jumps, tap somewhere else to recover" UX. The 16px applies only on
     mobile so desktop typography stays clean. */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="url"],
  input[type="number"],
  input[type="search"],
  input[type="date"],
  textarea,
  select {
    font-size: 16px !important;
  }

  /* Sidebar slides in as overlay */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: 280px;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.4);
  }
  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0 !important;
  }

  /* Hamburger no longer needed — bottom tab bar handles primary nav */
  .mobile-menu-toggle { display: none !important; }

  /* Bottom tabs become the primary navigation on phones */
  .bottom-tabs { display: flex; }

  /* Reserve space at the bottom of every view so the tab bar can't
     cover content (also account for the iPhone home indicator).
     100px is generous on purpose — iOS Safari's URL bar collapses/expands,
     so we need extra room to make sure the last interactive element
     (e.g. Save button on Settings) always clears the bottom tab bar. */
  .view {
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0));
  }

  /* Chat view is full-height — kill the standard view padding so the chat
     container can fill the exact area between top bar and bottom tabs.
     Without this, the .view padding pushes the chat-input-area down behind
     the bottom tab bar (the bug Joey hit: only chips visible, no textarea). */
  #view-chat {
    padding: 0 !important;
  }
  .chat-container {
    /* Prefer the visualViewport height (set by app.js as --vv-h) when
       available so the keyboard appearing actually shrinks the chat
       container. Falls back to 100dvh on browsers that don't expose
       visualViewport. Doug's bug: new message hidden by the keyboard. */
    height: calc(var(--vv-h, 100dvh) - 64px - 64px - env(safe-area-inset-bottom, 0));
  }
  .chat-messages {
    padding: 14px 14px 8px;
  }
  .chat-input-area {
    padding: 10px 12px 12px;
  }

  /* Stacked grids */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 4px;
  }

  .stat-card {
    padding: 14px 14px 16px;
    border-radius: 14px;
  }
  .stat-card .stat-icon {
    top: 10px;
    right: 10px;
    font-size: 15px;
  }
  .stat-card .stat-label {
    font-size: 10.5px;
    margin-bottom: 8px;
    padding-right: 22px;
    letter-spacing: 0.06em;
  }
  .stat-card .stat-value {
    font-size: 26px;
  }

  .section-row {
    grid-template-columns: 1fr;
    margin-top: 16px;
    padding-bottom: 16px;
    gap: 14px;
  }

  /* Tighter cards on mobile */
  .card {
    padding: 16px;
    border-radius: 14px;
  }
  .card h3 {
    font-size: 16px;
  }

  /* Onboarding card — tighten margins/padding for thumb-scale screens */
  .onboard-card {
    margin: 0 0 16px;
    padding: 18px 16px 14px;
    border-radius: 14px;
  }
  .onboard-title {
    font-size: 18px;
  }
  .ob-step {
    padding: 11px 12px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .ob-step .btn {
    margin-left: auto;
  }
  .ob-step-title {
    font-size: 13px;
    line-height: 1.35;
  }

  /* Title row (h3 + action button) — wrap and let the button sit full-width
     under the title instead of getting squashed on the right. */
  .card-title-row {
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 12px;
  }
  .card-title-row .btn {
    margin-left: auto;
  }

  /* Quick actions: full-width buttons, single column, comfortable tap targets */
  .quick-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .quick-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Tables transform into vertical card stacks on mobile —
     each row becomes a card with key:value pairs (driven by data-label). */
  .data-table, .table {
    display: block;
    width: 100%;
  }
  .data-table thead, .table thead {
    display: none;
  }
  .data-table tbody, .table tbody {
    display: block;
  }
  .data-table tbody tr, .table tbody tr {
    display: block;
    background: rgba(15, 30, 55, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 10px 12px;
    transition: border-color 0.15s;
  }
  .data-table tbody tr:hover, .table tbody tr:hover {
    background: rgba(0, 212, 255, 0.06);
    border-color: rgba(0, 212, 255, 0.22);
  }
  .data-table tbody td, .table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 13px;
  }
  .data-table tbody td:last-child, .table tbody td:last-child {
    border-bottom: none;
  }
  .data-table tbody td::before, .table tbody td::before {
    content: attr(data-label);
    font-family: var(--font-body);
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    flex-shrink: 0;
  }
  .data-table tbody td[data-label="ID"], .table tbody td[data-label="ID"] {
    display: none;
  }

  /* Chat adjustments — height is set above, near the bottom-tabs rules.
     This block only handles message bubble width on phones. */
  .message {
    max-width: 92%;
  }

  /* Top bar */
  .top-bar {
    padding: 0 16px;
    gap: 10px;
  }
  .top-bar h2 { font-size: 18px; }
  .top-bar-logo { display: inline-block; }
  .greeting { display: none; }

  /* Tighter view padding */
  .view {
    padding: 16px 14px;
  }

  .inbound-banner {
    margin: 0;
    padding: 14px 14px 16px;
  }
  .ib-row { gap: 8px; }
  .ib-addr { font-size: 12px; padding: 8px 10px; word-break: break-all; }

  /* Auth card padding */
  .auth-card {
    padding: 24px;
    margin: 16px;
  }

  /* Suggestion chips wrap to two rows on phones — every prompt visible,
     no horizontal scrolling guesswork. */
  .suggestion-chips {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px 4px;
    justify-content: flex-start;
  }
  .chip {
    flex: 0 1 calc(50% - 4px);
    justify-content: center;
    text-align: center;
    padding: 9px 10px;
    font-size: 11px;
    letter-spacing: 0.03em;
    line-height: 1.25;
    white-space: normal;
    word-break: break-word;
  }
}

@media (max-width: 480px) {
  /* Keep stats as a 2x2 grid on phones — single column wastes space */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 12px 12px 14px; }
  .stat-card .stat-value { font-size: 24px; }
  .stat-card .stat-label { font-size: 10px; padding-right: 20px; }
  .stat-card .stat-icon { font-size: 14px; top: 9px; right: 9px; }

  .auth-card { padding: 20px; }

  .btn-lg {
    padding: 12px 20px;
    font-size: 14px;
  }

  h1 { font-size: 28px; }
  h2 { font-size: 22px; }

  .sidebar { width: 86%; max-width: 320px; }

  /* Pending reply cards on small screens */
  .pending-card { padding: 14px; }
  .pc-actions { flex-direction: column; }
  .pc-actions .btn { width: 100%; }
}

/* ============================================
   22. Selection & Focus Styles
   ============================================ */
::selection {
  background: var(--accent);
  color: var(--bg-primary);
}

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

/* Custom scrollbar for the entire app */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 212, 255, 0.20);
}
