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

:root {
  /* ── Core palette ── */
  --navy:         #1C1916;
  --navy-light:   #242018;
  --blue:         #D4784A;
  --blue-hover:   #C0673C;
  --blue-light:   rgba(212,120,74,0.13);
  --green:        #3DB87A;
  --green-bg:     rgba(61,184,122,0.11);
  --red:          #D4604A;
  --red-bg:       rgba(212,96,74,0.11);
  --yellow:       #D4A44A;
  --amber:        #D4A44A;
  --amber-bg:     rgba(212,164,74,0.11);
  --teal:         #4AB8B0;
  --white:        #F2EDE6;

  /* ── Design system aliases (matches Claude Design bundle) ── */
  --accent:       var(--blue);
  --accent-hover: var(--blue-hover);
  --accent-soft:  rgba(212,120,74,0.12);
  --accent-ring:  rgba(212,120,74,0.18);
  --green-soft:   rgba(61,184,122,0.14);
  --amber-soft:   rgba(212,164,74,0.14);
  --muted:        #8C8278;
  --dim:          #5C554E;
  --border-strong: rgba(255,240,220,0.14);
  --hover:        rgba(255,240,220,0.03);
  --hover-2:      rgba(255,240,220,0.05);
  --input-bg:     rgba(255,240,220,0.04);
  --input-border: rgba(255,240,220,0.10);
  --radius-sm:    6px;
  --radius-md:    10px;
  --radius-lg:    14px;
  --radius-pill:  999px;
  --font-mono:    'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;

  /* ── Dark surfaces — warm, near-black ── */
  --bg:           #141210;
  --bg-sidebar:   #0F0D0A;
  --surface:      #1C1916;
  --surface-2:    #242018;
  --surface-3:    #2C2820;
  --border:       rgba(255,240,220,0.08);
  --border-2:     rgba(255,240,220,0.045);

  /* ── Text ── */
  --text:         #F2EDE6;
  --text-muted:   #8C8278;
  --text-dim:     #5C554E;

  /* ── Legacy aliases — JS and inline HTML depend on these ── */
  --gray-50:    var(--surface-2);
  --gray-100:   var(--border-2);
  --gray-200:   var(--border);
  --gray-400:   #6B6058;
  --gray-600:   var(--text-muted);
  --gray-800:   var(--text);

  /* ── Shadows — warm-tinted ── */
  --shadow-sm:  0 1px 3px rgba(10,5,0,0.45);
  --shadow-md:  0 4px 20px rgba(10,5,0,0.5), 0 1px 4px rgba(10,5,0,0.3);
  --shadow-lg:  0 16px 56px rgba(10,5,0,0.65), 0 4px 16px rgba(10,5,0,0.4);
}

body {
  font-family: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "liga" 1, "kern" 1;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,240,220,0.08); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,240,220,0.14); background-clip: padding-box; }

/* ── Utilities ── */
.mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-accent { color: var(--accent); }

/* ── Pill / badge system ── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.4;
  border: 1px solid var(--border);
}
.pill-green  { color: var(--green);  background: var(--green-soft);  border-color: rgba(61,184,122,0.18); }
.pill-amber  { color: var(--amber);  background: var(--amber-soft);  border-color: rgba(212,164,74,0.2); }
.pill-rust   { color: var(--accent); background: var(--accent-soft); border-color: rgba(212,120,74,0.2); }
.pill-muted  { color: var(--muted);  background: var(--hover);       border-color: var(--border); }
.pill-dot    { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ── Storm severity dot ── */
.storm-sev-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
}
.storm-sev-dot--hot  { background: var(--accent); box-shadow: 0 0 0 3px rgba(212,120,74,0.15); }
.storm-sev-dot--warm { background: var(--amber); }
.storm-sev-dot--cool { background: var(--text-muted); }

/* ── Stat card sparkline ── */
.stat-sparkline {
  display: block;
  width: 100%;
  height: 28px;
  margin-top: 12px;
}

/* ─────────────────────────────────────────────────────
   AUTH PAGES
   ───────────────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 60% 10%, rgba(212,120,74,0.07) 0%, transparent 55%),
    radial-gradient(ellipse at 20% 80%, rgba(61,184,122,0.04) 0%, transparent 50%),
    var(--bg);
}

.auth-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 44px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-logo svg { width: 34px; height: 34px; }
.auth-logo-text { font-size: 20px; font-weight: 700; color: var(--text); }
.auth-logo-text span { color: var(--blue); }

.auth-tabs {
  display: flex;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.auth-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.auth-tab.active { color: var(--blue); border-bottom-color: var(--blue); }

.auth-form { display: none; }
.auth-form.active { display: block; }

.auth-card h2 { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.auth-card p  { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: var(--surface-2);
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.form-group input::placeholder { color: var(--text-muted); }
.form-group input:focus { border-color: var(--blue); background: var(--surface-3); }

/* ─────────────────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s, box-shadow 0.15s, transform 0.1s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary  { background: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) {
  background: var(--blue-hover);
  box-shadow: 0 4px 16px rgba(212,120,74,0.3);
  transform: translateY(-1px);
}

.btn-navy { background: var(--surface-3); color: var(--text); border: 1px solid var(--border); }
.btn-navy:hover:not(:disabled) { background: var(--surface-2); }

.btn-green { background: var(--green); color: #fff; }
.btn-green:hover:not(:disabled) {
  filter: brightness(1.1);
  box-shadow: 0 4px 14px rgba(61,184,122,0.2);
  transform: translateY(-1px);
}

.btn-outline { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover:not(:disabled) { background: var(--surface-2); border-color: rgba(255,240,220,0.18); }

.btn-ghost { background: transparent; color: var(--text-muted); border: 1.5px solid var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }

.btn-full { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

.btn-google {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-google:hover:not(:disabled) { background: var(--surface-3); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─────────────────────────────────────────────────────
   ALERTS
   ───────────────────────────────────────────────────── */
.error-msg, .success-msg {
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}
.error-msg.show, .success-msg.show { display: block; }
.error-msg   { background: var(--red-bg);   border: 1px solid rgba(239,68,68,0.3);   color: #fca5a5; }
.success-msg { background: var(--green-bg); border: 1px solid rgba(16,185,129,0.3);  color: #6ee7b7; }

/* ─────────────────────────────────────────────────────
   APP SHELL — sidebar layout
   ───────────────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.app-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 18px 18px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}
.sidebar-logo svg { width: 30px; height: 30px; flex-shrink: 0; }
.sidebar-logo-text { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.sidebar-logo-text span { color: var(--blue); }

.sidebar-nav {
  flex: 1;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 14px 10px 5px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px 7px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 450;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
  position: relative;
}
.sidebar-link:hover { background: var(--hover-2); color: var(--text); }
.sidebar-link.active {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 500;
}
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.sidebar-link svg { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.7; transition: opacity 0.12s; }
.sidebar-link:hover svg, .sidebar-link.active svg { opacity: 1; }
.sidebar-kbd {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--dim);
  font-family: var(--font-mono);
  opacity: 0.7;
}

.sidebar-footer {
  padding: 10px 10px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.sidebar-user {
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.sidebar-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue-light);
  border: 1px solid rgba(212,120,74,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  flex-shrink: 0;
  text-transform: uppercase;
}
.sidebar-user-info { min-width: 0; flex: 1; }
.sidebar-user-email {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-top: 2px;
}
.sidebar-status-badge--active  { background: var(--green-bg); color: var(--green); }
.sidebar-status-badge--trial   { background: var(--amber-bg); color: var(--amber); }
.sidebar-status-badge--expired { background: var(--red-bg);   color: var(--red); }

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.12s;
  font-family: inherit;
}
.sidebar-logout:hover { background: var(--surface-2); color: var(--text); }
.sidebar-logout svg { width: 14px; height: 14px; opacity: 0.6; }

/* ── App topbar ── */
.app-topbar {
  height: 52px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  flex-shrink: 0;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.app-topbar-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}
.crumb-dim { color: var(--text-muted); }
.crumb-sep { color: var(--dim); }
.crumb-cur { color: var(--text); font-weight: 500; }
.app-topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-search-wrap { position: relative; }
.topbar-search {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-pill);
  padding: 6px 32px 6px 30px;
  font-size: 12.5px;
  color: var(--muted);
  width: 220px;
  font-family: var(--font);
}
.topbar-search::placeholder { color: var(--dim); }
.topbar-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dim);
  pointer-events: none;
}
.topbar-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--dim);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
  pointer-events: none;
}
.topbar-bell-btn {
  position: relative;
  border: 1px solid var(--input-border);
  color: var(--muted);
  background: transparent;
  padding: 6px 8px;
  border-radius: 8px;
}
.topbar-bell-btn:hover { color: var(--text); border-color: var(--border-strong); }
.topbar-bell-dot {
  position: absolute;
  top: 4px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid var(--bg);
}

/* ── Dashboard 2-column lower layout ── */
.dash-lower {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 14px;
  margin-bottom: 28px;
}
.dash-panel-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.dash-panel-title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.dash-panel-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.dash-panel-link {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.dash-panel-link:hover { color: var(--text); }

/* Storm icon box */
.storm-icon-box {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

/* Pill-style state select */
.state-select-pill {
  font-size: 11.5px;
  font-family: inherit;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-pill);
  padding: 5px 22px 5px 10px;
  color: var(--text);
  background: var(--input-bg);
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%238C8278' stroke-width='2' stroke-linecap='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.state-select-pill:focus { border-color: var(--accent); }

/* Storm footer */
.dash-storm-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

/* ── Recent supplements table rows ── */
.recent-table-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr 0.9fr auto;
  gap: 12px;
  padding: 12px 18px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
  text-decoration: none;
  color: inherit;
}
.recent-table-row:hover { background: var(--hover); }
.recent-table-row:last-child { border-bottom: none; }
.recent-addr { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-claim { font-size: 11.5px; color: var(--text-muted); font-family: var(--font-mono); margin-top: 2px; }
.recent-val { font-size: 13px; font-weight: 500; font-family: var(--font-mono); color: var(--text); }
.recent-date { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* ── Carrier badge ── */
.carrier-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  white-space: nowrap;
}
.carrier-badge-mark {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 700;
  color: #1a0e07;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

/* ── Status pill (used in recent + history) ── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
}
.status-pill-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(2px);
  z-index: 99;
}
.sidebar-overlay.show { display: block; }

/* ── Mobile top bar (replaces full nav on < 1024px) ── */
.app-nav {
  background: var(--bg-sidebar);
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 54px;
  position: sticky;
  top: 0;
  z-index: 98;
  border-bottom: 1px solid var(--border);
}

.nav-logo { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.nav-logo svg { width: 28px; height: 28px; }
.nav-logo-text { font-size: 15px; font-weight: 700; }
.nav-logo-text span { color: var(--blue); }

.nav-links { display: flex; gap: 4px; }
.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover, .nav-link.active { color: var(--text); background: var(--surface-2); }

.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.badge-subscribed { background: var(--green-bg); color: var(--green); }
.badge-trial      { background: var(--amber-bg); color: var(--amber); }
.badge-expired    { background: var(--red-bg);   color: var(--red); }
.badge-past_due   { background: rgba(239,68,68,0.1); color: #fca5a5; }

.btn-logout {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-logout:hover { background: var(--surface-2); color: var(--text); }

.nav-hamburger {
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 8px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.12s;
  display: flex;
  align-items: center;
}
.nav-hamburger:hover { background: var(--surface-2); color: var(--text); }

.mobile-menu {
  display: none;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px 16px;
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border-2);
  transition: color 0.15s;
}
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a.active, .mobile-menu a:hover { color: var(--text); }

/* ─────────────────────────────────────────────────────
   MAIN CONTENT AREA
   ───────────────────────────────────────────────────── */
.app-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 36px 24px;
}

.app-shell .app-main {
  margin-left: 240px;
  margin-right: 0;
  max-width: none;
  width: calc(100% - 240px);
  padding: 0 44px 44px;
}

.app-shell .app-main > * { max-width: 1400px; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-top: 28px;
  margin-bottom: 28px;
  gap: 16px;
}
.page-header h1 {
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
}
.page-header p { color: var(--text-muted); font-size: 14px; margin-top: 3px; }

/* ─────────────────────────────────────────────────────
   CARDS
   ───────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Dashboard action cards ── */
.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.action-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s, background 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.action-card:hover {
  border-color: rgba(212,120,74,0.3);
  box-shadow: 0 8px 28px rgba(10,5,0,0.4);
  transform: translateY(-2px);
  background: var(--surface-2);
}
.action-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--blue-light);
  border: 1px solid rgba(212,120,74,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}
.action-icon svg { width: 18px; height: 18px; color: var(--blue); }
.action-card h3 { font-size: 14px; font-weight: 700; color: var(--text); }
.action-card p  { font-size: 13px; color: var(--text-muted); line-height: 1.4; }

/* ─────────────────────────────────────────────────────
   STATUS / PAYWALL BANNERS
   ───────────────────────────────────────────────────── */
.status-banner {
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.status-banner.trial   { background: var(--amber-bg); border: 1px solid rgba(245,158,11,0.25); }
.status-banner.active  { background: var(--green-bg); border: 1px solid rgba(16,185,129,0.25); }
.status-banner.expired { background: var(--red-bg);   border: 1px solid rgba(239,68,68,0.25); }

.status-banner-text h3 { font-size: 14px; font-weight: 700; color: var(--text); }
.status-banner-text p  { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.trial-progress-wrap { margin-bottom: 6px; }
.trial-progress-bar  {
  height: 5px;
  background: var(--surface-3);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}
.trial-progress-fill {
  height: 100%;
  background: var(--amber);
  border-radius: 3px;
  transition: width 0.3s;
  box-shadow: 0 0 8px rgba(245,158,11,0.5);
}

.paywall-banner {
  background: linear-gradient(135deg, #1C1510 0%, #2A1A10 100%);
  border: 1px solid rgba(212,120,74,0.18);
  border-radius: 12px;
  padding: 22px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.paywall-banner h2 { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.paywall-banner p  { font-size: 13px; color: rgba(226,232,240,0.65); max-width: 440px; }

/* ─────────────────────────────────────────────────────
   FORMS
   ───────────────────────────────────────────────────── */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-grid-4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (min-width: 640px) { .form-grid-4 { grid-template-columns: repeat(4, 1fr); } }
.field-full  { grid-column: 1 / -1; }

.damage-chip-group { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.damage-chip { cursor: pointer; }
.damage-chip input[type="checkbox"] { display: none; }
.damage-chip span {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-2);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  user-select: none;
}
.damage-chip span:hover { border-color: var(--blue); color: var(--blue); }
.damage-chip input:checked + span {
  background: var(--blue-light);
  border-color: var(--blue);
  color: var(--blue);
  font-weight: 600;
}

.form-section-card { margin-bottom: 18px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text); }
.field input, .field textarea, .field select {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  resize: vertical;
  background: var(--surface-2);
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-muted); }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--blue);
  background: var(--surface-3);
  box-shadow: 0 0 0 3px rgba(212,120,74,0.1);
}
.field select option { background: var(--surface-2); color: var(--text); }
.field-hint { font-size: 11px; color: var(--text-muted); }

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 28px 24px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
  background: var(--surface-2);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--blue);
  background: rgba(212,120,74,0.07);
}
.upload-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.upload-zone svg   { color: var(--text-muted); width: 32px; height: 32px; margin-bottom: 8px; }
.upload-zone p     { font-size: 14px; color: var(--text-muted); }
.upload-zone span  { font-size: 12px; color: var(--text-dim); }
.upload-zone.has-file { border-color: var(--green); background: var(--green-bg); }
.upload-zone.has-file p { color: var(--green); font-weight: 600; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* ── New supplement — form step indicator ── */
.form-steps {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 20px;
  overflow-x: auto;
  gap: 4px;
}
.form-step {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
}
.form-step:not(:last-child)::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 10px;
  min-width: 16px;
}
.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all 0.15s;
}
.step-label { font-size: 12px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.form-step.active .step-num {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(212,120,74,0.15);
}
.form-step.active .step-label { color: var(--text); font-weight: 600; }
.form-step.done .step-num { background: var(--green); border-color: var(--green); color: #fff; }
.form-step.done .step-label { color: var(--text); font-weight: 500; }
.form-step.done:not(:last-child)::after { background: rgba(61,184,122,0.30); }

/* ─── Supplement result 2-column layout ─── */
.doc-result-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 0 20px;
}
.doc-result-main { min-width: 0; }
.doc-result-side { display: flex; flex-direction: column; }
@media (max-width: 860px) {
  .doc-result-grid { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────────────────────
   LOADING OVERLAY
   ───────────────────────────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7,13,27,0.88);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
  color: var(--text);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}
.loading-overlay.show { opacity: 1; visibility: visible; pointer-events: auto; }
.spinner {
  width: 44px; height: 44px;
  border: 2px solid rgba(212,120,74,0.15);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 16px; font-weight: 600; }
.loading-sub  { font-size: 13px; color: var(--text-muted); max-width: 340px; text-align: center; }

/* ─────────────────────────────────────────────────────
   SUPPLEMENT RESULT
   ───────────────────────────────────────────────────── */
#resultSection { display: none; }
#resultSection.show { display: block; }

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}
.result-title { font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.result-actions { display: flex; gap: 10px; align-items: center; }

.quality-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.01em;
}
.quality-badge--pass      { background: var(--green-bg); color: var(--green); border: 1px solid rgba(16,185,129,0.3); }
.quality-badge--corrected { background: var(--blue-light); color: var(--blue); border: 1px solid rgba(212,120,74,0.3); }

.supplement-doc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.doc-header {
  background: linear-gradient(135deg, #181310 0%, #251C16 100%);
  border-bottom: 1px solid rgba(255,240,220,0.08);
  color: var(--text);
  padding: 20px 24px;
}
.doc-header h2 { font-size: 17px; font-weight: 700; }
.doc-header-meta { display: flex; gap: 20px; margin-top: 6px; flex-wrap: wrap; }
.doc-header-meta span { font-size: 13px; color: rgba(226,232,240,0.6); }

.doc-body { padding: 24px; }

.doc-section { margin-bottom: 24px; }
.doc-section:last-child { margin-bottom: 0; }
.doc-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.doc-summary { font-size: 14px; color: var(--text); line-height: 1.65; }

.line-items-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.line-items-table th {
  background: var(--surface-2);
  color: var(--text-muted);
  padding: 9px 10px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid var(--border);
}
.line-items-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-2);
  vertical-align: top;
  color: var(--text);
}
.line-items-table tr:last-child td { border-bottom: none; }
.line-items-table tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
.line-items-table td:first-child { font-family: monospace; font-size: 12px; font-weight: 600; color: var(--blue); white-space: nowrap; }
.line-items-table td:last-child { font-weight: 700; white-space: nowrap; }

.total-box {
  background: linear-gradient(135deg, #1C1510, #2C1E14);
  border: 1px solid rgba(212,120,74,0.2);
  color: var(--text);
  border-radius: 10px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}
.total-box .label  { font-size: 13px; font-weight: 600; color: rgba(242,237,230,0.65); }
.total-box .amount { font-size: 28px; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }

.doc-notes { list-style: none; }
.doc-notes li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border-2);
  font-size: 13px;
  color: var(--text);
  display: flex;
  gap: 8px;
}
.doc-notes li:last-child { border-bottom: none; }
.doc-notes li::before { content: '→'; color: var(--blue); font-weight: 700; flex-shrink: 0; }

/* ─────────────────────────────────────────────────────
   HISTORY TABLE
   ───────────────────────────────────────────────────── */
.history-table-wrap { overflow-x: auto; }
.history-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.history-table th {
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.th-sortable { cursor: pointer; user-select: none; }
.th-sortable:hover { color: var(--text); background: var(--surface-3); }
.sort-arrow { margin-left: 4px; font-style: normal; }
.sort-arrow--idle   { opacity: 0.3; }
.sort-arrow--active { opacity: 1; color: var(--blue); }
.history-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-2);
  color: var(--text);
}
.history-table tr:hover td { background: var(--surface-2); }
.history-table .address-cell { font-weight: 600; }
.history-table .claim-cell   { color: var(--text-muted); font-size: 13px; }
.history-table .date-cell    { color: var(--text-muted); font-size: 13px; white-space: nowrap; }
.history-table .carrier-cell { font-size: 13px; color: var(--text-muted); }
.history-table .value-cell   { font-size: 13px; font-weight: 600; color: var(--text); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-completed { background: var(--green-bg); color: var(--green); }
.badge-failed    { background: var(--red-bg);   color: var(--red); }
.badge-pending   { background: var(--blue-light); color: var(--blue); }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.pagination-info { font-size: 13px; color: var(--text-muted); margin: 0 8px; }

/* ─────────────────────────────────────────────────────
   BILLING / PLAN CARDS
   ───────────────────────────────────────────────────── */
.plan-card {
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
  background: var(--surface);
}
.plan-card.active-plan  { border-color: rgba(16,185,129,0.4);  background: rgba(16,185,129,0.05); }
.plan-card.trial-plan   { border-color: rgba(245,158,11,0.4);  background: rgba(245,158,11,0.05); }
.plan-card.expired-plan { border-color: rgba(239,68,68,0.4);   background: rgba(239,68,68,0.05); }

.plan-name   { font-size: 18px; font-weight: 700; color: var(--text); }
.plan-status { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.plan-price  { font-size: 28px; font-weight: 800; color: var(--text); margin: 12px 0 4px; }
.plan-price-sub { font-size: 13px; color: var(--text-muted); }
.billing-actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }

/* ─────────────────────────────────────────────────────
   RECENT SUPPLEMENTS
   ───────────────────────────────────────────────────── */
.recent-list { list-style: none; }
.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-2);
  gap: 16px;
}
.recent-item:last-child { border-bottom: none; }
.recent-address { font-size: 14px; font-weight: 600; color: var(--text); }
.recent-meta    { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.recent-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ─────────────────────────────────────────────────────
   EMPTY STATE
   ───────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state svg { width: 44px; height: 44px; margin-bottom: 12px; color: var(--text-dim); opacity: 0.4; }
.empty-state h3  { font-size: 15px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.empty-state p   { font-size: 14px; color: var(--text-dim); }

/* ─────────────────────────────────────────────────────
   HISTORY CONTROLS
   ───────────────────────────────────────────────────── */
.history-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.history-search {
  flex: 1;
  min-width: 200px;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: var(--surface-2);
  color: var(--text);
  transition: border-color 0.15s;
}
.history-search::placeholder { color: var(--text-muted); }
.history-search:focus { border-color: var(--blue); }
.history-filter {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: var(--surface-2);
  color: var(--text);
  transition: border-color 0.15s;
  height: 38px;
}
.history-filter:focus { border-color: var(--blue); }
.history-filter option { background: var(--surface-2); }
.history-carrier { width: 130px; }
.history-date    { width: 140px; color: var(--text-muted); }
.history-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.history-count { font-size: 13px; color: var(--text-dim); font-weight: 500; }

/* ─────────────────────────────────────────────────────
   PIPELINE STATUS
   ───────────────────────────────────────────────────── */
.pipeline-select {
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  border: none;
  border-radius: 20px;
  padding: 4px 8px;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: opacity 0.15s;
}
.pipeline-select:hover { opacity: 0.8; }
.pipeline-submitted   { background: var(--blue-light);               color: var(--blue); }
.pipeline-review      { background: var(--amber-bg);                 color: var(--amber); }
.pipeline-negotiating { background: rgba(239,68,68,0.12);            color: #fca5a5; }
.pipeline-approved    { background: var(--green-bg);                 color: var(--green); }
.pipeline-paid        { background: rgba(16,185,129,0.2);            color: #6ee7b7; font-style: italic; }

/* ─────────────────────────────────────────────────────
   HISTORY TOOLBAR (pill filters + redesigned search)
   ───────────────────────────────────────────────────── */
.history-toolbar { padding-bottom: 4px; }
.history-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.hist-search-wrap { flex: 1; min-width: 200px; position: relative; }
.hist-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dim);
  pointer-events: none;
}
.hist-search-input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.hist-search-input::placeholder { color: var(--dim); }
.hist-search-input:focus { border-color: var(--accent); }
.hist-input-sm {
  padding: 7px 10px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
  height: 36px;
}
.hist-input-sm:focus { border-color: var(--accent); }
.hist-input-sm::placeholder { color: var(--dim); }
.hist-input-carrier { width: 120px; }
.hist-input-date    { width: 134px; color: var(--text-muted); }
.history-pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-pill {
  padding: 5px 13px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  line-height: 1.4;
}
.filter-pill:hover { border-color: rgba(212,120,74,0.5); color: var(--text); }
.filter-pill.active {
  border-color: var(--accent);
  background: rgba(212,120,74,0.12);
  color: var(--accent);
  font-weight: 500;
}

/* Pipeline status summary chips */
.status-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 12px 0 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 8px;
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.status-chip-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.status-chip-count { font-weight: 600; color: var(--text); margin-left: 1px; }

/* ─────────────────────────────────────────────────────
   PHOTO UPLOAD & GRID
   ───────────────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

.photo-upload-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 18px 24px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
  background: var(--surface-2);
}
.photo-upload-zone:hover, .photo-upload-zone.dragover { border-color: var(--blue); background: rgba(212,120,74,0.07); }
.photo-upload-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.photo-upload-zone svg   { color: var(--text-muted); width: 28px; height: 28px; margin-bottom: 6px; }
.photo-upload-zone p     { font-size: 14px; color: var(--text-muted); }
.photo-upload-zone span  { font-size: 12px; color: var(--text-dim); }

.photo-progress {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-light);
  padding: 4px 10px;
  border-radius: 6px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.photo-card {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
  position: relative;
  display: flex;
  flex-direction: column;
}
.photo-card-remove {
  position: absolute;
  top: 5px; right: 5px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  padding: 0;
}
.photo-card-remove:hover { background: var(--red); }
.photo-card-img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; }
.photo-card-body { padding: 7px 8px 9px; display: flex; flex-direction: column; gap: 5px; }
.photo-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  align-self: flex-start;
}
.photo-badge--hail     { background: var(--blue-light);              color: var(--blue); }
.photo-badge--wind     { background: var(--amber-bg);                color: var(--amber); }
.photo-badge--deck     { background: rgba(234,88,12,0.15);           color: #fb923c; }
.photo-badge--interior { background: rgba(139,92,246,0.15);          color: #a78bfa; }
.photo-badge--code     { background: var(--red-bg);                  color: var(--red); }
.photo-badge--unclear  { background: var(--surface-3);               color: var(--text-muted); }

.photo-caption {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
  border-radius: 4px;
  padding: 2px 3px;
  cursor: text;
  outline: none;
  word-break: break-word;
  transition: background 0.1s;
}
.photo-caption:hover  { background: var(--surface-3); }
.photo-caption:focus  { background: var(--surface-3); }

.photo-skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.photo-skeleton-img     { width: 100%; aspect-ratio: 1/1; }
.photo-skeleton-body    { padding: 7px 8px 9px; display: flex; flex-direction: column; gap: 6px; }
.photo-skeleton-badge   { height: 16px; width: 46px; border-radius: 20px; }
.photo-skeleton-line    { height: 10px; border-radius: 4px; }
.photo-skeleton-line-sm { height: 10px; border-radius: 4px; width: 72%; }

/* ─────────────────────────────────────────────────────
   DASHBOARD STATS
   ───────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px 14px;
  box-shadow: none;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s;
}
.stat-card:hover { border-color: rgba(255,240,220,0.18); }
.stat-card--blue   { border-left: 2px solid var(--blue); }
.stat-card--green  { border-left: 2px solid var(--green); }
.stat-card--amber  { border-left: 2px solid var(--amber); }
.stat-card--purple { border-left: 2px solid #A87DC4; }

.stat-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 12px;
  font-weight: 450;
  color: var(--text-muted);
  letter-spacing: 0;
}

/* ─────────────────────────────────────────────────────
   STORM WIDGET
   ───────────────────────────────────────────────────── */
.storm-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.storm-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.state-select {
  font-size: 13px;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  color: var(--text);
  background: var(--surface-2);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
.state-select:focus { border-color: var(--blue); }
.state-select option { background: var(--surface-2); }

.storm-alert-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-2);
}
.storm-alert-item:last-child { border-bottom: none; }
.storm-info { flex: 1; min-width: 0; }
.storm-event { font-size: 13px; font-weight: 600; color: var(--text); }
.storm-area {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.storm-time { font-size: 11px; color: var(--text-dim); white-space: nowrap; flex-shrink: 0; margin-top: 2px; }
.storm-hail-tag {
  display: inline-block;
  background: var(--amber-bg);
  color: var(--amber);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.storm-clear { text-align: center; padding: 24px 16px; color: var(--text-muted); font-size: 14px; }
.storm-clear-icon { font-size: 28px; margin-bottom: 8px; }
.storm-source {
  font-size: 11px;
  color: var(--text-dim);
  text-align: right;
  margin-top: 12px;
  border-top: 1px solid var(--border-2);
  padding-top: 10px;
}
.storm-loading, .storm-error { padding: 20px; text-align: center; font-size: 13px; color: var(--text-muted); }

/* ─────────────────────────────────────────────────────
   WIZARD NAVIGATION & OPTIONAL COLLAPSE
   ───────────────────────────────────────────────────── */
.wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* Smooth card entrance */
@keyframes wiz-card-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.wiz-card-in { animation: wiz-card-in 0.2s ease forwards; }

/* Optional collapse toggle */
.optional-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 14px;
  padding: 9px 13px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.optional-toggle:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-strong);
}
.optional-toggle.open {
  color: var(--accent);
  border-color: rgba(212,120,74,0.3);
  background: rgba(212,120,74,0.05);
}
.optional-toggle svg {
  flex-shrink: 0;
  transition: transform 0.2s;
  opacity: 0.6;
}
.optional-toggle.open svg { transform: rotate(180deg); }
.optional-toggle-hint {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
  white-space: nowrap;
}

/* Optional section collapse */
.optional-section {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s;
  opacity: 0;
}
.optional-section.open {
  max-height: 600px;
  opacity: 1;
}

/* Import shortcuts row */
.import-shortcuts {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.import-shortcuts-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 2px;
}
.import-shortcut-btn {
  padding: 4px 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.import-shortcut-btn:hover {
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--border-strong);
}

/* Result overflow menu */
.result-overflow-wrap {
  position: relative;
}
.result-overflow-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  min-width: 170px;
  box-shadow: var(--shadow-md);
  z-index: 50;
}
.result-overflow-menu button {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  border-radius: 7px;
  text-align: left;
  transition: background 0.1s;
}
.result-overflow-menu button:hover { background: var(--surface-3); }

/* ─────────────────────────────────────────────────────
   STREAMING
   ───────────────────────────────────────────────────── */
.streaming-cursor {
  display: inline-block;
  color: var(--blue);
  animation: cursor-blink 0.9s step-end infinite;
}
@keyframes cursor-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.btn-link {
  background: none;
  border: none;
  color: var(--blue);
  cursor: pointer;
  padding: 0;
  font-size: inherit;
  text-decoration: underline;
}

.section-skeleton { padding: 4px 0 2px; }
.skel-line {
  height: 13px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.4s ease-in-out infinite;
  margin-bottom: 10px;
  width: 100%;
}
.skel-line--md { width: 72%; }
.skel-line--sm { width: 44%; }

@keyframes skel-shimmer {
  0%   { background-position:  200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes section-reveal {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.doc-section > p,
.doc-section > ul,
.doc-section > div.total-box,
.doc-section > .editable-table-wrap,
.doc-section > table {
  animation: section-reveal 0.18s ease forwards;
}

/* ─────────────────────────────────────────────────────
   EDITABLE LINE ITEMS
   ───────────────────────────────────────────────────── */
.editable-cell {
  outline: none;
  border-radius: 3px;
  transition: background 0.12s;
  cursor: text;
  min-width: 40px;
  color: var(--text);
}
.editable-cell:hover  { background: var(--blue-light); }
.editable-cell:focus  {
  background: rgba(212,120,74,0.13);
  box-shadow: inset 0 0 0 1.5px var(--blue);
}

.cell-edit {
  display: block;
  min-width: 40px;
  padding: 2px 4px;
  border-radius: 4px;
  outline: none;
  transition: background 0.12s;
  white-space: nowrap;
  color: var(--text);
}
.cell-edit:focus {
  background: var(--blue-light);
  outline: 2px solid var(--blue);
  outline-offset: 0;
}
.cell-edit:hover:not(:focus) { background: var(--surface-2); }
.cell-desc { white-space: normal; min-width: 120px; }
.cell-number { text-align: right; max-width: 80px; }
.cell-total { font-weight: 700; white-space: nowrap; color: var(--text); }

.btn-remove-row {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}
.btn-remove-row:hover { background: var(--red-bg); color: var(--red); }

.editable-table-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
}
.edit-hint { font-size: 11px; color: var(--text-dim); font-style: italic; }

/* ─────────────────────────────────────────────────────
   VOLUME CHART
   ───────────────────────────────────────────────────── */
.volume-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 96px;
  padding-top: 20px;
}
.vol-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.vol-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.vol-bar {
  width: 100%;
  background: var(--blue);
  border-radius: 4px 4px 0 0;
  min-height: 3px;
  transition: height 0.4s ease;
  opacity: 0.75;
  box-shadow: 0 -2px 6px rgba(212,120,74,0.2);
}
.vol-count { font-size: 11px; font-weight: 700; color: var(--text); min-height: 16px; }
.vol-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* ─────────────────────────────────────────────────────
   AI MEMORY CARD
   ───────────────────────────────────────────────────── */
.memory-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 4px; }
.memory-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.memory-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.memory-value { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.4; }

/* ─────────────────────────────────────────────────────
   CLAIM INTEL PANEL
   ───────────────────────────────────────────────────── */
.intel-strength {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  white-space: nowrap;
}
.intel-strength--strong { background: var(--green-bg); color: var(--green); }
.intel-strength--fair   { background: var(--amber-bg); color: var(--amber); }
.intel-strength--weak   { background: var(--red-bg);   color: var(--red); }

.intel-chip {
  font-size: 12px;
  font-weight: 500;
  color: var(--blue);
  background: var(--blue-light);
  border-radius: 12px;
  padding: 3px 10px;
  white-space: nowrap;
}
.intel-hint { font-size: 11px; color: var(--text-muted); margin-left: 2px; }

.adjuster-intel-card {
  display: none;
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ─────────────────────────────────────────────────────
   RESPONSIVE — sidebar collapses to top bar
   ───────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .app-sidebar { transform: translateX(-100%); }
  .app-sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .app-shell .app-main { margin-left: 0; width: 100%; }
  .app-nav { display: flex !important; }
}

@media (max-width: 768px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .history-search { flex-basis: 100%; min-width: 0; }
}

@media (max-width: 640px) {
  .form-grid-2, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
  .action-grid { grid-template-columns: 1fr; }
  .paywall-banner { flex-direction: column; }
  .app-main { padding: 20px 16px; }
  .app-shell .app-main { padding: 20px 16px; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 16px 14px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-header > .btn { width: 100%; text-align: center; justify-content: center; }
  .form-actions { flex-direction: column; gap: 8px; }
  .form-actions .btn { width: 100%; justify-content: center; }
  .result-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .result-actions { flex-wrap: wrap; gap: 8px; width: 100%; }
  .result-actions > * { flex: 1 1 calc(50% - 4px); text-align: center; justify-content: center; }
  .result-actions .quality-badge { flex: 0 0 100%; margin-bottom: 2px; }
  .doc-header { padding: 14px 16px; }
  .doc-body { padding: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .line-items-table { min-width: 520px; }
  .total-box { flex-direction: column; gap: 6px; align-items: flex-start; }
  .total-box .amount { font-size: 22px; }
  .loading-overlay { padding: 24px; }
  .loading-sub { max-width: 100%; }
  .history-filter.history-carrier { min-width: calc(50% - 4px); }
  .auth-card { padding: 28px 20px; }
  .plan-features { gap: 6px; }
  .profile-section { padding: 20px 16px; }
  .memory-grid { grid-template-columns: 1fr; }
  .volume-chart { gap: 6px; }
  .paywall-banner .btn { width: 100%; text-align: center; justify-content: center; }
  .modal-box .modal-body { overflow-x: auto; }
  .outcome-table { min-width: 460px; }
  #downloadBtn { flex: 1 1 100% !important; }
  .edit-hint { display: none; }
  .intel-chip { font-size: 11px; padding: 2px 8px; }
}

@media (max-width: 480px) {
  .history-table .date-cell,
  .history-table th:nth-child(1),
  .history-table td:nth-child(1) { display: none; }
  .history-table .carrier-cell,
  .history-table th:nth-child(4),
  .history-table td:nth-child(4) { display: none; }
  .history-table .address-cell { font-size: 12px; }
  .history-table .claim-cell   { font-size: 12px; }
  .history-table .value-cell   { font-size: 12px; }
  .result-actions > * { flex: 1 1 100%; }
  .nav-logo-text { display: none; }
  .storm-card-header { flex-wrap: wrap; }
  .state-select { width: 100%; }
  .history-table td:last-child { min-width: 120px; }
}
