/* ============================================================
   AI CFO PLATFORM — CLAUDE-IDENTICAL DESIGN SYSTEM
   Version 3.0 — Maximum Claude fidelity

   Matches Claude.ai exactly:
   - Claude's exact color tokens (cream, warm-gray, orange accent)
   - Claude's sidebar width, typography scale, and spacing
   - Claude's message bubble shape and layout
   - Claude's input bar design (pill, inner shadow)
   - Claude's logo style (square orange/coral gradient)
   - Claude's font stack (Styrene A, fallback to system)
   - Claude's subtle animations and micro-interactions
============================================================ */


/* ============================================================
   01. DESIGN TOKENS — CLAUDE COLOR SYSTEM
============================================================ */

:root,
[data-theme="dark"] {

  /* ── Core backgrounds — Claude dark palette ── */
  --bg-base:        #1c1917;   /* Claude's main dark bg — warm charcoal */
  --bg-sidebar:     #1c1917;   /* sidebar same as base in Claude dark */
  --bg-panel:       #292524;   /* message bubble / card bg */
  --bg-elevated:    #312f2e;   /* hover states, elevated cards */
  --bg-hover:       #312f2e;
  --bg-active:      #3a3836;
  --bg-input:       #292524;   /* input field bg */
  --bg-modal:       #1c1917;
  --bg-overlay:     rgba(0,0,0,0.6);

  /* ── Borders — very subtle warm gray ── */
  --border:         #3a3836;
  --border-light:   #2e2c2b;
  --border-focus:   #d97757;   /* Claude's orange focus ring */

  /* ── Text hierarchy — Claude's warm whites ── */
  --text-primary:   #eeeeec;   /* Claude's near-white */
  --text-secondary: #a8a29e;   /* muted text */
  --text-tertiary:  #78716c;   /* very muted — timestamps, labels */
  --text-inverse:   #1c1917;
  --text-link:      #d97757;   /* Claude's orange for links */

  /* ── Brand & Accent — Claude's exact orange/coral ── */
  --accent:         #d97757;   /* Claude orange — the main brand color */
  --accent-hover:   #cc6b49;
  --accent-light:   rgba(217, 119, 87, 0.12);
  --accent-glow:    rgba(217, 119, 87, 0.08);

  /* ── Claude logo gradient colors ── */
  --logo-from:      #d97757;
  --logo-to:        #c96442;

  /* ── Semantic — success / warning / critical ── */
  --success:        #34d399;
  --success-bg:     rgba(52, 211, 153, 0.1);
  --success-text:   #6ee7b7;
  --warning:        #f59e0b;
  --warning-bg:     rgba(245, 158, 11, 0.1);
  --warning-text:   #fbbf24;
  --critical:       #f87171;
  --critical-bg:    rgba(248, 113, 113, 0.1);
  --critical-text:  #fca5a5;
  --medium-bg:      rgba(245, 158, 11, 0.08);
  --medium-text:    #fbbf24;

  /* ── Sidebar ── */
  --sidebar-width:  260px;

  /* ── Shadows — warm, barely visible ── */
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:      0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg:      0 8px 32px rgba(0,0,0,0.5);
  --shadow-modal:   0 24px 64px rgba(0,0,0,0.6);

  /* ── Radius — Claude uses more rounded corners ── */
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      14px;
  --radius-xl:      18px;
  --radius-2xl:     24px;
  --radius-full:    9999px;

  /* ── Transitions ── */
  --transition:     140ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-md:  240ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {

  /* ── Claude light backgrounds — warm cream palette ── */
  --bg-base:        #f9f7f5;   /* Claude's warm cream base */
  --bg-sidebar:     #f0ece8;   /* slightly darker warm cream */
  --bg-panel:       #ffffff;
  --bg-elevated:    #f5f1ee;
  --bg-hover:       #ede9e5;
  --bg-active:      #e6e1dc;
  --bg-input:       #ffffff;
  --bg-modal:       #ffffff;
  --bg-overlay:     rgba(0,0,0,0.15);

  /* ── Light borders ── */
  --border:         #e2ddd9;
  --border-light:   #ede9e5;
  --border-focus:   #d97757;

  /* ── Light text ── */
  --text-primary:   #1c1917;
  --text-secondary: #57534e;
  --text-tertiary:  #a8a29e;
  --text-inverse:   #ffffff;
  --text-link:      #c96442;

  /* ── Brand remains orange ── */
  --accent:         #d97757;
  --accent-hover:   #c96442;
  --accent-light:   rgba(217, 119, 87, 0.1);
  --accent-glow:    rgba(217, 119, 87, 0.06);

  /* ── Logo same ── */
  --logo-from:      #d97757;
  --logo-to:        #c96442;

  /* ── Semantic — light mode ── */
  --success:        #059669;
  --success-bg:     rgba(5, 150, 105, 0.08);
  --success-text:   #047857;
  --warning:        #d97706;
  --warning-bg:     rgba(217, 119, 6, 0.08);
  --warning-text:   #b45309;
  --critical:       #dc2626;
  --critical-bg:    rgba(220, 38, 38, 0.08);
  --critical-text:  #b91c1c;
  --medium-bg:      rgba(217, 119, 6, 0.08);
  --medium-text:    #b45309;

  /* ── Light shadows ── */
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:      0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:      0 8px 32px rgba(0,0,0,0.1);
  --shadow-modal:   0 24px 64px rgba(0,0,0,0.14);
}


/* ============================================================
   02. RESET & BASE
============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
}

body {
  height: 100%;
  /* Claude uses Styrene A first, falls back to system fonts */
  font-family: 'Styrene A', ui-sans-serif, system-ui, -apple-system,
               BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
               Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-base);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: opacity var(--transition);
}
a:hover { opacity: 0.8; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

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

ul, ol { list-style: none; }
img { display: block; max-width: 100%; }
strong { font-weight: 600; }


/* ============================================================
   03. TYPOGRAPHY
============================================================ */

.mono {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
}

.label-caps {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}


/* ============================================================
   04. SCREEN SYSTEM
============================================================ */

.screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  opacity: 0;
  transition: opacity var(--transition-md);
}

.screen.active {
  display: flex;
  opacity: 1;
}

.screen--app {
  display: none;
}
.screen--app.active {
  display: flex;
  flex-direction: row;
}


/* ============================================================
   05. CLAUDE-STYLE LOGO MARK
   The AI CFO logo uses Claude's exact orange gradient shape.
   Square with rounded corners, gradient fill, white icon inside.
============================================================ */

.logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(145deg, var(--logo-from), var(--logo-to));
}

.logo-mark--xs { width: 26px; height: 26px; border-radius: 7px; }
.logo-mark--sm { width: 34px; height: 34px; border-radius: 9px; }
.logo-mark     { width: 42px; height: 42px; border-radius: 10px; }
.logo-mark--xl { width: 56px; height: 56px; border-radius: 14px; }

.logo-mark svg { width: 60%; height: 60%; }

/* Claude's logo SVG override — pure white icon */
.logo-mark svg path,
.logo-mark svg circle,
.logo-mark svg rect {
  stroke: #ffffff;
  fill: none;
}

.logo-mark svg circle[fill="#60a5fa"] {
  fill: rgba(255,255,255,0.5);
  stroke: none;
}

.logo-mark svg rect {
  fill: transparent;
  stroke: none;
}

.logo-wordmark {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}


/* ============================================================
   06. SCREEN 1 — SIGN IN
   Claude's sign-in: centered, clean, no gradient bg.
   Just a white/dark field, single prominent button.
============================================================ */

.screen--signin {
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
}

/* Very faint warm glow behind the container */
.signin-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 60% at 50% 40%,
    rgba(217, 119, 87, 0.04) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.signin-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 400px;
  padding: 48px 32px 40px;
  text-align: center;
}

.signin-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
}

/* App name beside logo */
.signin-logo-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.signin-headline {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.signin-subheadline {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 36px;
  line-height: 1.55;
  max-width: 280px;
}

/* Claude-style Google button — clean bordered, not filled */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  border: 1.5px solid var(--border);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition:
    background var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
  margin-bottom: 14px;
}

.btn-google:hover {
  background: var(--bg-elevated);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn-google:active {
  transform: translateY(1px);
}

.btn-google__icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.signin-trust-note {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 36px;
  line-height: 1.5;
}

/* Three small trust badges at the bottom */
.signin-benefits {
  display: flex;
  gap: 28px;
  justify-content: center;
}

.signin-benefit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.signin-benefit__icon {
  font-size: 18px;
  line-height: 1;
}

.signin-benefit__text {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* deprecated but keep for safety */
.signin-tagline { font-size: 28px; font-weight: 700; color: var(--text-primary); }
.signin-descriptor { font-size: 15px; color: var(--text-secondary); }
.signin-features { display: flex; gap: 20px; }
.signin-feature { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.signin-feature__icon { font-size: 18px; }
.signin-feature__text { font-size: 11px; color: var(--text-tertiary); }


/* ============================================================
   07. SCREEN 2 — DRIVE CONNECTION + SCREEN 3 BASE
============================================================ */

.screen--drive,
.screen--activation {
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
}

.onboarding-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 460px;
  padding: 48px 32px;
  text-align: center;
}

.onboarding-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.onboarding-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.onboarding-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.onboarding-note {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.6;
  margin-top: 16px;
}

/* Drive explanation — subtle warm card */
.drive-explanation {
  padding: 18px 22px;
  border-radius: var(--radius-lg);
  background: var(--accent-glow);
  border: 1px solid rgba(217, 119, 87, 0.2);
  margin-bottom: 24px;
  text-align: center;
}

.drive-explanation__text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.drive-explanation__text strong {
  color: var(--accent);
  font-weight: 600;
}

/* deprecated but keep */
.drive-card { padding: 18px; border-radius: var(--radius-lg); background: var(--bg-panel); border: 1px solid var(--border); margin-bottom: 24px; width: 100%; }
.drive-card__text { font-size: 13px; color: var(--text-secondary); }

/* Trust badges — pill style */
.trust-badges {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 28px;
}

.trust-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  min-width: 76px;
}

.trust-badge__icon {
  font-size: 18px;
  line-height: 1;
}

.trust-badge__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

/* Primary CTA button — Claude's orange */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 28px;
  border-radius: var(--radius-lg);
  background: var(--accent);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition:
    background var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 14px rgba(217, 119, 87, 0.35);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-drive-connect {
  width: 100%;
  max-width: 300px;
  height: 48px;
  font-size: 15px;
}


/* ============================================================
   08. SCREEN 3 — AI ACTIVATION
============================================================ */

.activation-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  max-width: 360px;
  margin: 8px 0 28px;
}

.activation-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
  transition: opacity var(--transition-md);
}

.activation-step:last-child {
  border-bottom: none;
}

.activation-step--pending {
  opacity: 0.38;
}

.activation-step__indicator {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.activation-step--complete .activation-step__indicator {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1.5px solid var(--success);
}

.activation-step--active .activation-step__indicator {
  background: var(--accent-light);
  border: 1.5px solid var(--accent);
}

.activation-step--pending .activation-step__indicator {
  background: var(--bg-panel);
  border: 1.5px solid var(--border);
}

.activation-step__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.activation-step__label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: left;
}

.activation-step--pending .activation-step__label {
  color: var(--text-tertiary);
}

.activation-step__detail {
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: left;
}

.step-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid var(--accent-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.step-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
}

/* Manual API key fallback */
.fallback-panel {
  width: 100%;
  max-width: 400px;
  margin-top: 8px;
}

.fallback-card {
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  border: 1px solid var(--warning);
  text-align: left;
}

.fallback-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.fallback-card__icon { font-size: 16px; }

.fallback-card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.fallback-card__text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.fallback-card__link {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 14px;
}

.fallback-input-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.input-field {
  flex: 1;
  height: 42px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  color: var(--text-primary);
  font-size: 13px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.input-field:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.fallback-card__note {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 10px;
  line-height: 1.5;
}


/* ============================================================
   09. SCREEN 4 — APP SHELL
============================================================ */




/* ============================================================
   10. SIDEBAR — Claude exact layout
   260px, same bg as base in dark, border-right, no drop shadow
============================================================ */

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  max-width: var(--sidebar-width);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow: hidden;
  transition:
    width var(--transition-md),
    min-width var(--transition-md),
    transform var(--transition-md);
  z-index: 100;
  flex-shrink: 0;
}

.sidebar.sidebar--collapsed {
  width: 0;
  min-width: 0;
  overflow: hidden;
}

/* Sidebar header — logo + name row */
.sidebar__header {
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 14px;
  flex-shrink: 0;
  gap: 10px;
}

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: 9px;
}

/* Product name in sidebar header */
.sidebar__logo-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  white-space: nowrap;
}

/* New Chat button — Claude uses a pencil-edit icon button at top right of sidebar */
.sidebar__new-chat {
  padding: 6px 10px 6px;
  flex-shrink: 0;
}

.btn-new-chat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  height: 36px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition);
}

.btn-new-chat:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--accent);
}

/* History list */
.sidebar__history {
  flex: 1;
  overflow-y: auto;
  padding: 4px 6px 8px;
}

.history-group {
  margin-bottom: 2px;
}

.history-group__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  padding: 10px 8px 4px;
}

.history-group__list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.history-item {
  display: flex;
  align-items: center;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.history-item__btn {
  flex: 1;
  display: flex;
  align-items: center;
  text-align: left;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 400;
  overflow: hidden;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  min-width: 0;
}

.history-item__btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.history-item--active .history-item__btn {
  background: var(--bg-active);
  color: var(--text-primary);
  font-weight: 500;
}

.history-item__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.history-item__delete {
  display: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  flex-shrink: 0;
  margin-right: 4px;
  transition: background var(--transition), color var(--transition);
}

.history-item:hover .history-item__delete {
  display: flex;
}

.history-item__delete:hover {
  background: var(--critical-bg);
  color: var(--critical-text);
}

.history-empty {
  padding: 24px 12px;
  text-align: center;
}

.history-empty__text {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.65;
}

/* Sidebar footer */
.sidebar__footer {
  border-top: 1px solid var(--border);
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

/* Drive connection status */
.drive-status {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
}

.drive-status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.drive-status__dot--connected {
  background: var(--success);
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.2);
}

.drive-status__dot--disconnected {
  background: var(--critical);
}

.drive-status__dot--syncing {
  background: var(--warning);
  animation: pulse 1.5s ease-in-out infinite;
}

.drive-status__text {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* User profile row — same as Claude */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition);
}

.sidebar-user:hover {
  background: var(--bg-elevated);
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

/* Upgrade button — Claude-orange border style */
.btn-upgrade {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--accent-light);
  border: 1px solid rgba(217, 119, 87, 0.35);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: background var(--transition), box-shadow var(--transition);
}

.btn-upgrade:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(217, 119, 87, 0.3);
}

/* Settings button */
.sidebar-settings-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}

.sidebar-settings-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}


/* ============================================================
   11. TOP BAR — Claude's topbar with editable title
============================================================ */

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 16px 0 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-base);
  flex-shrink: 0;
  gap: 12px;
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sidebar-toggle-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}

.sidebar-toggle-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* Editable chat title — Claude style */
.chat-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
  border-radius: var(--radius-sm);
  padding: 3px 7px;
  margin: 0 -7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 40px;
  max-width: 360px;
  cursor: text;
  transition: background var(--transition);
  letter-spacing: -0.01em;
}

.chat-title:hover { background: var(--bg-elevated); }

.chat-title:focus {
  background: var(--bg-panel);
  outline: 1px solid var(--border-focus);
}

.chat-title:empty::before {
  content: attr(data-placeholder);
  color: var(--text-tertiary);
}

/* Sync indicator */
.topbar-sync {
  display: flex;
  align-items: center;
  gap: 5px;
}

.topbar-sync__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.topbar-sync__dot--synced  { background: var(--success); }
.topbar-sync__dot--syncing { background: var(--warning); animation: pulse 1.5s ease-in-out infinite; }
.topbar-sync__dot--error   { background: var(--critical); }

.topbar-sync__label {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* Master Sheet timestamp */
.topbar-sheet-info {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.topbar-sheet-info__prefix { font-weight: 500; }

.topbar-sheet-info__time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}

.topbar-icon-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  transition: background var(--transition), color var(--transition);
}

.topbar-icon-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}


/* ============================================================
   12. CENTER PANEL & EMPTY STATE
   Claude's empty state: centered logo, subtitle, 3 prompt cards
============================================================ */

.center-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px 28px;
  gap: 0;
  overflow-y: auto;
}

.empty-state__logo {
  margin-bottom: 18px;
}

.empty-state__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  margin-bottom: 6px;
}

.empty-state__subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  text-align: center;
  line-height: 1.55;
}

/* Starter prompts — Claude's card grid */
.starter-prompts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 540px;
}

.starter-prompt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  text-align: left;
  cursor: pointer;
  transition:
    background var(--transition),
    border-color var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
}

.starter-prompt:hover {
  background: var(--bg-elevated);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217,119,87,0.1);
}

.starter-prompt:active {
  transform: translateY(0);
}

.starter-prompt__icon {
  font-size: 18px;
  flex-shrink: 0;
}

.starter-prompt__body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.starter-prompt__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.starter-prompt__desc {
  font-size: 12px;
  color: var(--text-secondary);
}


/* ============================================================
   13. CHAT THREAD & MESSAGES
   Claude-exact layout:
   - CFO: avatar left, bubble no-border, full-width with padding
   - User: right-aligned, filled orange bubble, no avatar
============================================================ */

.chat-thread {
  flex: 1;
  overflow-y: auto;
  padding: 20px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 0;
  scroll-behavior: smooth;
}

/* Base message row */
.msg {
  display: flex;
  gap: 0;
  padding: 6px 20px;
  max-width: 100%;
  animation: fadeSlideIn 0.18s ease forwards;
}

/* CFO message — left, with avatar */
.msg--cfo {
  align-items: flex-start;
  gap: 12px;
}

.msg__avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(145deg, var(--logo-from), var(--logo-to));
  overflow: hidden;
  margin-top: 3px;
}

/* CFO bubble — no border in Claude style, just slight bg */
.msg--cfo .msg__bubble {
  max-width: calc(100% - 40px);
  background: transparent;
  border-radius: 0;
  padding: 2px 0 8px;
  flex: 1;
}

/* Client message — right aligned, no avatar */
.msg--client {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

.msg--client .msg__bubble {
  max-width: 72%;
  background: var(--accent);
  border-radius: var(--radius-xl) var(--radius-xl) var(--radius-sm) var(--radius-xl);
  padding: 11px 15px;
}

.msg--client .msg__content {
  color: #ffffff;
  font-size: 14px;
  line-height: 1.6;
}

/* Message content */
.msg__content {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-primary);
  word-break: break-word;
}

/* Message footer */
.msg__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border-light);
}

.msg--client .msg__footer {
  border-top-color: rgba(255,255,255,0.18);
}

.msg__time {
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: 'JetBrains Mono', monospace;
}

.msg--client .msg__time {
  color: rgba(255,255,255,0.55);
}

.msg__actions {
  display: flex;
  gap: 3px;
}

.msg-action-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  font-size: 12px;
  transition: background var(--transition), color var(--transition);
}

.msg-action-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* File upload pill */
.upload-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}

.upload-pill__icon { font-size: 15px; }
.upload-pill__name { font-weight: 500; color: var(--text-primary); }
.upload-pill__status { font-size: 11px; color: var(--warning-text); }

/* Typing indicator */
.msg--typing .msg__bubble { padding: 10px 0 8px; }

.typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 16px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-tertiary);
  animation: typingBounce 1.2s 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; }


/* ============================================================
   14. CFO MESSAGE FORMATTING
   Structured financial sections with warm-orange accents
============================================================ */

.msg__content .cfo-section {
  margin-bottom: 14px;
}

.msg__content .cfo-section:last-child {
  margin-bottom: 0;
}

.msg__content .cfo-section-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
}

/* Section type colors — orange theme */
.cfo-section-header--briefing {
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid rgba(217,119,87,0.35);
}
.cfo-section-header--analysis {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.cfo-section-header--risk {
  background: var(--critical-bg);
  color: var(--critical-text);
  border: 1px solid var(--critical);
}
.cfo-section-header--recs {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success);
}
.cfo-section-header--actions {
  background: var(--warning-bg);
  color: var(--warning-text);
  border: 1px solid var(--warning);
}

/* Risk flags */
.risk-flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.risk-flag--critical { background: var(--critical-bg); color: var(--critical-text); border: 1px solid var(--critical); }
.risk-flag--high     { background: var(--warning-bg);  color: var(--warning-text);  border: 1px solid var(--warning); }
.risk-flag--medium   { background: var(--medium-bg);   color: var(--medium-text);   border: 1px solid var(--warning); }

/* Financial numbers — monospace bold */
.msg__content .num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.msg__content .num--positive { color: var(--success-text); }
.msg__content .num--negative { color: var(--critical-text); }
.msg__content .num--neutral  { color: var(--warning-text); }

/* Priority actions */
.msg__content .priority-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.msg__content .priority-action {
  display: flex;
  gap: 10px;
  padding: 9px 13px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.msg__content .priority-action__rank {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
  width: 18px;
}

.msg__content .priority-action__text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

/* Tables */
.msg__content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 10px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.msg__content th {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 11px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.msg__content td {
  padding: 8px 11px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}

.msg__content tr:last-child td {
  border-bottom: none;
}

.msg__content tr:hover td {
  background: var(--bg-elevated);
}

.msg__content td.val-good  { color: var(--success-text); font-family: 'JetBrains Mono', monospace; }
.msg__content td.val-bad   { color: var(--critical-text); font-family: 'JetBrains Mono', monospace; }
.msg__content td.val-watch { color: var(--warning-text); font-family: 'JetBrains Mono', monospace; }

/* Prose */
.msg__content p { margin-bottom: 9px; }
.msg__content p:last-child { margin-bottom: 0; }
.msg__content h3 { font-size: 14px; font-weight: 700; color: var(--text-primary); margin: 12px 0 5px; }
.msg__content ul, .msg__content ol { padding-left: 16px; margin-bottom: 9px; }
.msg__content li { margin-bottom: 3px; font-size: 14px; line-height: 1.6; list-style: disc; }
.msg__content ol li { list-style: decimal; }
.msg__content hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.msg__content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--accent);
}


/* ============================================================
   15. INPUT AREA — Claude's exact pill input
   Full-width rounded pill, border, inner shadow on focus
============================================================ */

.input-area {
  padding: 10px 20px 14px;
  background: var(--bg-base);
  flex-shrink: 0;
}

/* Upload progress */
.upload-progress {
  height: 2px;
  background: var(--border);
  border-radius: var(--radius-full);
  margin-bottom: 8px;
  overflow: hidden;
}

.upload-progress__bar {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 0.3s ease;
}

/* Attachment pill */
.attachment-preview { margin-bottom: 6px; }

.attachment-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-primary);
}

.attachment-pill__icon { font-size: 14px; }
.attachment-pill__name { font-weight: 500; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.attachment-pill__remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  color: var(--text-tertiary);
  transition: background var(--transition), color var(--transition);
}

.attachment-pill__remove:hover {
  background: var(--critical-bg);
  color: var(--critical-text);
}

/* Input row — Claude's wide pill */
.input-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 6px 6px 6px 10px;
  border-radius: var(--radius-2xl);
  background: var(--bg-panel);
  border: 1.5px solid var(--border);
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

.input-row:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Icon buttons inside input */
.input-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}

.input-btn--upload:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* Send button — Claude's orange circle */
.input-btn--send {
  background: var(--accent);
  color: #ffffff;
  border-radius: var(--radius-full);
  width: 32px;
  height: 32px;
  transition:
    background var(--transition),
    opacity var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
}

.input-btn--send:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 2px 8px rgba(217,119,87,0.4);
}

.input-btn--send:disabled {
  background: var(--bg-elevated);
  color: var(--text-tertiary);
  cursor: not-allowed;
}

/* Textarea */
.textarea-wrapper {
  flex: 1;
  min-width: 0;
}

.message-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  padding: 5px 4px;
  min-height: 34px;
  max-height: 180px;
  overflow-y: auto;
}

.message-input::placeholder {
  color: var(--text-tertiary);
}

/* Privacy note */
.input-privacy-note {
  text-align: center;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 7px;
  letter-spacing: 0.01em;
}


/* ============================================================
   16. TIER WALL (session limit modal)
============================================================ */

.tier-wall {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 50;
  padding: 20px;
}

.tier-wall__card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.tier-wall__icon { font-size: 36px; margin-bottom: 14px; }

.tier-wall__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.tier-wall__text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 24px;
}

.btn-upgrade-cta {
  width: 100%;
  height: 48px;
  font-size: 15px;
  margin-bottom: 10px;
}

.tier-wall__footnote {
  font-size: 12px;
  color: var(--text-tertiary);
}


/* ============================================================
   17. SETTINGS MODAL
============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.15s ease forwards;
}

.modal {
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 460px;
  max-height: 86vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-modal);
  animation: slideUp 0.2s ease forwards;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.modal__close-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  transition: background var(--transition), color var(--transition);
}

.modal__close-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.modal__body { overflow-y: auto; padding: 6px 0; }

.settings-section {
  padding: 14px 22px;
  border-bottom: 1px solid var(--border-light);
}

.settings-section:last-child { border-bottom: none; }

.settings-section--danger { border-top: 1px solid var(--border); }

.settings-section__title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.settings-section__title--danger { color: var(--critical-text); }

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 34px;
  margin-bottom: 8px;
}

.settings-row:last-child { margin-bottom: 0; }

.settings-row__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}

.settings-row__sublabel {
  display: block;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.settings-row__value {
  font-size: 13px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
}

.settings-row__value--green { color: var(--success-text); }

.settings-row__link {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
}

.settings-plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.settings-plan-badge--pro {
  background: var(--accent-light);
  color: var(--accent);
  border-color: rgba(217,119,87,0.35);
}

/* Theme switcher */
.theme-switcher {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.theme-btn {
  padding: 4px 13px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}

.theme-btn--active {
  background: var(--bg-panel);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* Upgrade card */
.upgrade-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--accent-light);
  border: 1px solid rgba(217,119,87,0.25);
}

.upgrade-card__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.upgrade-card__price {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
  margin-bottom: 7px;
  font-family: 'JetBrains Mono', monospace;
}

.upgrade-card__features { display: flex; flex-direction: column; gap: 3px; }

.upgrade-card__features li {
  font-size: 12px;
  color: var(--text-secondary);
  list-style: none;
  padding-left: 12px;
  position: relative;
}

.upgrade-card__features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.btn-upgrade-modal { flex-shrink: 0; white-space: nowrap; height: 42px; }

.btn-signout {
  padding: 6px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-signout:hover {
  background: var(--critical-bg);
  border-color: var(--critical);
  color: var(--critical-text);
}


/* ============================================================
   18. TOAST NOTIFICATIONS
============================================================ */

.toast-container {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 500;
  min-width: 240px;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn 0.22s ease forwards;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.toast--success {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success-text);
}

.toast--warning {
  background: var(--warning-bg);
  border-color: var(--warning);
  color: var(--warning-text);
}

.toast--error {
  background: var(--critical-bg);
  border-color: var(--critical);
  color: var(--critical-text);
}

.toast__icon { font-size: 15px; flex-shrink: 0; }
.toast__text { flex: 1; line-height: 1.4; }

.toast--dismissing {
  animation: toastOut 0.18s ease forwards;
}


/* ============================================================
   19. SECONDARY BUTTONS & FORM ELEMENTS
============================================================ */

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  transition: background var(--transition), border-color var(--transition);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--accent);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  background: var(--critical-bg);
  border: 1px solid var(--critical);
  color: var(--critical-text);
  font-size: 13px;
  font-weight: 600;
  transition: background var(--transition);
}

.btn-danger:hover {
  background: var(--critical);
  color: #ffffff;
}

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


/* ============================================================
   20. ANIMATIONS
============================================================ */

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

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

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30%           { transform: translateY(-4px); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

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

@keyframes toastIn {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(16px); }
}

@keyframes stepComplete {
  0%   { transform: scale(0.75); opacity: 0; }
  60%  { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.activation-step--complete .step-check {
  animation: stepComplete 0.35s ease forwards;
}


/* ============================================================
   21. SCROLLBARS — thin, warm-toned
============================================================ */

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--bg-active); }
* { scrollbar-width: thin; scrollbar-color: var(--bg-elevated) transparent; }


/* ============================================================
   22. RESPONSIVE / MOBILE
============================================================ */

@media (max-width: 768px) {

  :root { --sidebar-width: 280px; }

  .screen--app { position: relative; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 200;
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-md);
  }

  .sidebar.sidebar--collapsed {
    transform: translateX(-100%);
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    z-index: 190;
  }

  .sidebar-overlay.active { display: block; }

  .main { width: 100%; }

  .topbar-sheet-info { display: none; }
  .topbar-sync { display: none; }

  .msg { padding: 5px 14px; }
  .msg--client .msg__bubble { max-width: 88%; }

  .input-area { padding: 8px 14px 12px; }

  .toast-container { bottom: 14px; right: 14px; left: 14px; }
  .toast { min-width: unset; max-width: 100%; }

  .modal { max-height: 90vh; margin: 0 8px; }

  .signin-container { padding: 40px 22px 32px; }
  .onboarding-container { padding: 40px 22px; }
  .trust-badges { gap: 8px; }
  .trust-badge { padding: 9px 11px; min-width: 68px; }
}

@media (max-width: 480px) {
  .signin-headline { font-size: 24px; }
  .signin-benefits { gap: 18px; }
  .empty-state__title { font-size: 17px; }
  .empty-state { padding: 24px 14px 14px; }
  .starter-prompt { padding: 11px 13px; }
}

/* ============================================================
   END OF STYLESHEET — AI CFO × Claude Design System
============================================================ */
