/* =====================================================
   WEALTHPATH 3.0 — MIDNIGHT FINANCE · BOLD EDITORIAL
   Deep charcoal · Electric teal · Hot orange
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=Space+Grotesk:wght@400;500;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --cream:        #0c0e12;
  --cream-dark:   #14171e;
  --parchment:    #2a2e38;
  --stone:        #3a3f4c;
  --forest:       #00d4aa;
  --forest-mid:   #00b894;
  --forest-light: #00e6b8;
  --moss:         #5a6270;
  --sage:         #8b929e;
  --sage-pale:    #e8ecf0;
  --amber:        #ff6a3d;
  --amber-light:  #ff8855;
  --amber-glow:   #ffaa44;
  --sunrise:      #ff5533;
  --gold:         #ffaa44;
  --ink:          #e8ecf0;
  --text-body:    #c8cdd5;
  --text-muted:   #8b929e;
  --text-faint:   #5a6270;
  --white:        #1c2028;
  --danger:       #ff4757;
  --success:      #00d4aa;
  --shadow-warm:  rgba(0,0,0,0.3);
  --shadow-deep:  rgba(0,0,0,0.5);

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 16px;
  --transition: 220ms cubic-bezier(0.4,0,0.2,1);
  /* Sidebar width is set by the Dhan-X logo's tagline legibility, not the nav links.
     After cropping the source PNG to remove right-side dead space the logo aspect
     is ≈2.86:1, so a ~430px-wide logo renders the tagline "YOUR WEALTH DESERVES
     THE X FACTOR" at ~15px tall — readable without dominating the viewport. */
  --sidebar-w: 450px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--cream);
  color: var(--text-body);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
}
a { color: inherit; text-decoration: none; }
button { font-family: var(--font-body); }

/* ── SIDEBAR ─────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: #0a0c10;
  border-right: 1px solid var(--parchment);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; z-index: 200;
  overflow: hidden;
}

.sidebar::after {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(0,212,170,0.06) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 90%, rgba(255,106,61,0.04) 0%, transparent 50%);
  pointer-events: none;
}

.sidebar-logo {
  /* Tight horizontal padding so the logo image gets nearly the full sidebar width. */
  padding: 22px 8px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  position: relative; z-index: 1;
}

.logo-lockup { display: flex; align-items: center; gap: 12px; }

.logo-sun {
  width: 42px; height: 42px;
  background: linear-gradient(145deg, var(--forest), var(--forest-mid));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 5px rgba(0,212,170,0.15), 0 4px 18px rgba(0,212,170,0.3);
}

/* Dhan-X brand mark — wide logo (≈2.5:1) with name + tagline already baked in,
   so the surrounding text wordmark was removed. Fill the full sidebar inner width
   so the "YOUR WEALTH DESERVES THE X FACTOR" tagline inside the artwork is legible. */
.nav-logo {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}
.login-logo .nav-logo { max-width: 480px; margin: 0 auto; }

.logo-sun-rays {
  width: 22px; height: 22px;
  position: relative; display: flex; align-items: center; justify-content: center;
}

.logo-sun-rays::before {
  content: '☀';
  font-size: 18px; color: rgba(255,255,255,0.9);
  animation: spin-slow 20s linear infinite;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.logo-wordmark { display: flex; flex-direction: column; gap: 1px; }
.logo-name {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700;
  color: var(--ink); letter-spacing: 0.01em; line-height: 1.1;
}
.logo-tagline {
  font-size: 9px; font-weight: 400; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--sage);
}

.sidebar-nav { padding: 18px 0; flex: 1; position: relative; z-index: 1; }
.sidebar-section-label {
  /* Brighter + larger so the section header is easy to read against the dark sidebar. */
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--sage); font-weight: 700; padding: 14px 22px 8px;
}

/* ── Collapsible nav groups (Portfolio Analysis / Financial Models) ── */
.nav-group { margin-bottom: 4px; }
.nav-group-header {
  display: flex; align-items: center; gap: 8px;
  width: 100%; background: none; border: 0;
  padding: 14px 22px 8px; cursor: pointer; text-align: left;
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--sage); font-weight: 700; font-family: inherit;
  transition: color var(--transition);
}
.nav-group-header:hover { color: var(--sage-pale); }
.nav-group-caret {
  font-size: 10px; line-height: 1; width: 12px;
  display: inline-block; transition: transform var(--transition);
}
.nav-group.collapsed .nav-group-caret { transform: rotate(-90deg); }
.nav-group-title { flex: 1; }
.nav-group-items { overflow: hidden; }
.nav-group.collapsed .nav-group-items { display: none; }

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 22px;
  /* Bumped from 14px/400 → 15.5px/500 for legibility on the wider sidebar. */
  font-size: 15.5px; font-weight: 500;
  line-height: 1.35;
  /* Brightened from rgba(200,221,216,0.75) to a near-ink off-white. */
  color: rgba(232,236,240,0.95);
  border-left: 3px solid transparent;
  transition: all var(--transition); cursor: pointer;
}

.nav-item:hover:not(.coming-soon) {
  color: var(--sage-pale);
  background: rgba(255,255,255,0.04);
  border-left-color: rgba(0,212,170,0.4);
}
.nav-item.active {
  color: var(--forest); font-weight: 700;
  border-left-color: var(--forest);
  background: rgba(0,212,170,0.08);
}
.nav-item.coming-soon { opacity: 0.38; cursor: default; }

.nav-icon {
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  /* Bumped from 14px → 17px so emoji icons feel proportional to the larger label. */
  font-size: 17px; flex-shrink: 0;
  align-self: center;
}
.nav-item.active .nav-icon { background: rgba(0,212,170,0.12); }

.badge {
  margin-left: auto; font-size: 9px; letter-spacing: 0.06em;
  background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.45);
  padding: 2px 8px; border-radius: 20px; font-weight: 700;
}

.sidebar-footer {
  position: relative; z-index: 1;
  padding: 18px 22px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-quote {
  font-family: var(--font-display); font-style: italic;
  font-size: 12px; color: var(--moss); line-height: 1.6;
}

.sidebar-fi-link-row {
  margin: 0 0 12px;
}
.sidebar-fi-link {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(200,221,216,0.55);
  text-decoration: none;
  transition: color var(--transition);
}
.sidebar-fi-link:hover { color: var(--sage-pale); }
.sidebar-fi-current {
  color: var(--forest);
  cursor: default;
}

/* ── SIDEBAR AUTH ──────────────────────────────── */
.sidebar-signin-btn-wrap {
  padding: 14px 22px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-signin-btn {
  display: block;
  text-align: center;
  padding: 9px 16px;
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: var(--radius-sm);
  color: var(--sage-pale);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: background var(--transition), border-color var(--transition);
}
.sidebar-signin-btn:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.32);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-avatar { flex-shrink: 0; }
.avatar-img {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255,255,255,0.2);
}
.avatar-initials {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: 0.05em;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--sage-pale);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-email {
  font-size: 10px;
  color: var(--moss);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-signout {
  background: transparent;
  border: none;
  color: var(--moss);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color var(--transition);
  flex-shrink: 0;
}
.sidebar-signout:hover { color: var(--sage-pale); }

/* ── MAIN ──────────────────────────────────────── */
.main-content { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; }

/* ── HERO ──────────────────────────────────────── */
.hero-banner {
  background: linear-gradient(155deg, #0a0c10 0%, #0f1218 55%, #14171e 100%);
  padding: 44px 48px 0;
  position: relative; overflow: hidden;
}

.hero-orbs {
  position: absolute; inset: 0; pointer-events: none;
}
.orb {
  position: absolute; border-radius: 50%;
  filter: blur(70px); animation: orb-drift 10s ease-in-out infinite;
}
.orb-1 { width:340px;height:340px;background:rgba(0,212,170,0.08);top:-120px;right:8%;animation-delay:0s; }
.orb-2 { width:220px;height:220px;background:rgba(255,106,61,0.06);top:10px;right:38%;animation-delay:-4s; }
.orb-3 { width:160px;height:160px;background:rgba(0,230,184,0.05);bottom:20px;left:15%;animation-delay:-7s; }

@keyframes orb-drift {
  0%,100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(10px,-15px) scale(1.04); }
  66%      { transform: translate(-8px,8px) scale(0.97); }
}

.hero-content { position: relative; z-index: 2; }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--amber-glow); font-weight: 700; margin-bottom: 14px;
}
.hero-eyebrow-line { width: 28px; height: 1.5px; background: var(--amber-glow); border-radius: 1px; }

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 56px); font-weight: 500;
  color: var(--ink); line-height: 1.1; letter-spacing: -0.01em;
  margin-bottom: 12px;
}
.hero-title em { font-style: italic; color: var(--amber-glow); }

.hero-sub {
  font-size: 15px; color: var(--sage-pale); font-weight: 300;
  max-width: 480px; line-height: 1.7; margin-bottom: 32px;
}

/* Horizon SVG scene */
.hero-horizon {
  position: relative; height: 90px; overflow: hidden;
  margin: 0 -48px;
}

/* ── KPI ROW ───────────────────────────────────── */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--white);
  border-bottom: 2px solid var(--parchment);
  box-shadow: 0 2px 20px var(--shadow-warm);
}

.kpi-card {
  padding: 22px 24px;
  border-right: 1px solid var(--parchment);
  position: relative; overflow: hidden;
  transition: background var(--transition);
}
.kpi-card:last-child { border-right: none; }
.kpi-card:hover { background: rgba(255,255,255,0.02); }

.kpi-accent {
  position: absolute; bottom: 0; left: 0;
  height: 3px; width: 0%;
  transition: width 1.4s cubic-bezier(0.4,0,0.2,1);
}

.kpi-label {
  font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-faint); font-weight: 700; margin-bottom: 8px;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 500;
  color: var(--ink); line-height: 1; margin-bottom: 5px;
  transition: color 400ms ease;
  text-shadow: 0 0 20px rgba(0,212,170,0.2);
}

.kpi-sub { font-size: 10px; color: var(--text-faint); font-family: var(--font-mono); }

/* ── LAYOUT ────────────────────────────────────── */
.fi-layout {
  display: grid;
  grid-template-columns: 292px 1fr;
  gap: 0;
  align-items: start;
}

/* ── INPUTS PANEL ──────────────────────────────── */
.inputs-panel {
  background: #0a0c10;
  border-right: 2px solid var(--parchment);
  box-shadow: inset -1px 0 0 rgba(0,212,170,0.06);
  position: sticky; top: 0;
  height: calc(100vh - 0px);
  overflow-y: auto;
}
.inputs-panel::-webkit-scrollbar { width: 3px; }
.inputs-panel::-webkit-scrollbar-thumb { background: var(--forest); opacity: 0.4; border-radius: 2px; }

/* Currency input wrapper */
.currency-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.currency-prefix {
  position: absolute;
  left: 11px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
  pointer-events: none;
  user-select: none;
}
.currency-wrap .input-field {
  padding-left: 22px;
}

.panel-section {
  padding: 18px 20px;
  border-bottom: 1px solid var(--cream-dark);
}

.panel-section-title {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 14px;
}

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

.section-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-body);
}

/* inputs */
.input-row { margin-bottom: 12px; }
.input-row:last-child { margin-bottom: 0; }

.input-label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11px; color: var(--text-muted); font-weight: 700;
  letter-spacing: 0.03em; margin-bottom: 5px;
}
.input-hint { font-size: 10px; color: var(--text-faint); font-family: var(--font-mono); font-weight: 400; }

.input-field {
  width: 100%;
  background: var(--cream-dark);
  border: 1.5px solid var(--parchment);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--font-mono); font-size: 14px;
  padding: 8px 11px;
  transition: all var(--transition); outline: none;
}
.input-field:focus {
  border-color: var(--forest-light);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(0,212,170,0.1);
}
.input-field.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(255,71,87,0.1); }

.error-msg { font-size: 10px; color: var(--danger); margin-top: 3px; display: none; }
.input-field.invalid + .error-msg { display: block; }

/* slider */
.input-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px;
  background: var(--parchment);
  border-radius: 2px; outline: none; cursor: pointer;
  margin-top: 8px;
}
.input-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 17px; height: 17px;
  background: var(--white);
  border: 2.5px solid var(--forest-light);
  border-radius: 50%;
  box-shadow: 0 2px 6px var(--shadow-deep);
  cursor: pointer; transition: all var(--transition);
}
.input-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25); border-color: var(--amber);
}

.slider-ticks {
  display: flex; justify-content: space-between;
  font-size: 9px; color: var(--text-faint); font-family: var(--font-mono);
  margin-top: 3px;
}

/* computed */
.computed-row {
  background: linear-gradient(to right, var(--cream-dark), var(--cream));
  border: 1px solid var(--parchment);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px;
}
.computed-label { font-size: 10px; color: var(--text-muted); }
.computed-val {
  font-family: var(--font-display); font-size: 18px;
  font-weight: 500; color: var(--forest);
}

/* expense rows */
.expense-card {
  background: var(--cream);
  border: 1px solid var(--parchment);
  border-radius: var(--radius-sm);
  padding: 9px;
  margin-bottom: 7px;
  display: grid;
  grid-template-columns: 1fr 52px 76px 20px;
  gap: 5px; align-items: center;
}
.expense-field {
  background: var(--white); border: 1px solid var(--parchment);
  border-radius: 4px; color: var(--ink);
  font-family: var(--font-mono); font-size: 11px;
  padding: 5px 7px; width: 100%; outline: none;
}
.expense-field:focus { border-color: var(--forest-light); }
.expense-field::placeholder { color: var(--text-faint); }

.remove-btn {
  background: none; border: none;
  color: var(--text-faint); cursor: pointer;
  font-size: 16px; padding: 0; line-height: 1;
  transition: color var(--transition);
}
.remove-btn:hover { color: var(--danger); }

.add-expense-btn {
  width: 100%; background: none;
  border: 1.5px dashed var(--parchment);
  border-radius: var(--radius-sm);
  color: var(--text-faint); font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em; padding: 8px;
  cursor: pointer; transition: all var(--transition); margin-top: 4px;
}
.add-expense-btn:hover {
  border-color: var(--forest-light); color: var(--forest);
  background: rgba(0,212,170,0.04);
}

/* calc button */
.calc-btn {
  display: block; width: calc(100% - 40px);
  margin: 18px 20px;
  background: linear-gradient(135deg, var(--forest) 0%, var(--forest-mid) 100%);
  color: #0a0c10; border: none; cursor: pointer;
  padding: 13px 20px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 18px rgba(0,212,170,0.32);
  transition: all var(--transition); position: relative; overflow: hidden;
}
.calc-btn::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), transparent);
  opacity: 0; transition: opacity var(--transition);
}
.calc-btn:hover { transform: translateY(-2px); box-shadow: 0 7px 24px rgba(0,212,170,0.4); }
.calc-btn:hover::before { opacity: 1; }
.calc-btn:active { transform: translateY(0); }

/* ── RESULTS ───────────────────────────────────── */
.results-area {
  padding: 28px 32px;
  background: var(--cream);
  display: flex; flex-direction: column; gap: 24px;
}

/* progress card */
.progress-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--parchment);
  box-shadow: 0 2px 20px var(--shadow-warm);
  overflow: hidden;
}

.progress-card-top {
  padding: 24px 28px 20px;
  background: linear-gradient(135deg, var(--cream) 0%, rgba(0,212,170,0.03) 100%);
  border-bottom: 1px solid var(--parchment);
}

.progress-heading {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}

.progress-title {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 500; color: var(--ink);
}

.fi-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--forest);
  color: #0a0c10; padding: 5px 13px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  box-shadow: 0 2px 10px rgba(0,212,170,0.3);
}

/* progress track */
.progress-track {
  height: 14px; background: var(--cream-dark);
  border-radius: 7px; overflow: visible;
  position: relative; margin-bottom: 10px;
}

.progress-fill {
  height: 100%; border-radius: 7px;
  background: linear-gradient(90deg, var(--forest) 0%, var(--forest-light) 60%, var(--amber-glow) 100%);
  transition: width 1.3s cubic-bezier(0.4,0,0.2,1);
  position: relative; min-width: 14px;
}

.progress-sun-icon {
  position: absolute; right: -11px; top: -9px;
  width: 32px; height: 32px;
  background: radial-gradient(circle, var(--forest) 30%, var(--forest-mid) 100%);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(0,212,170,0.2), 0 0 20px rgba(0,212,170,0.4);
  transition: right 1.3s cubic-bezier(0.4,0,0.2,1);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}

.progress-labels {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-faint); font-family: var(--font-mono);
}
.progress-labels strong { color: var(--amber); font-weight: 700; }

.progress-stats {
  display: grid; grid-template-columns: repeat(3,1fr);
  border-top: 1px solid var(--parchment);
}

.pstat {
  padding: 16px 20px;
  border-right: 1px solid var(--parchment);
  text-align: center;
}
.pstat:last-child { border-right: none; }
.pstat-label { font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 5px; }
.pstat-val {
  font-family: var(--font-display); font-size: 24px; font-weight: 500;
  color: var(--ink); line-height: 1;
}
.pstat-val.amber { color: var(--amber); }
.pstat-val.forest { color: var(--forest); }

/* chart */
.chart-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--parchment);
  box-shadow: 0 2px 20px var(--shadow-warm);
  overflow: hidden;
}

.card-header {
  padding: 18px 26px;
  border-bottom: 1px solid var(--cream-dark);
  display: flex; justify-content: space-between; align-items: center;
}

.card-title {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 500; color: var(--ink);
}

.chart-legend-row {
  display: flex; gap: 16px;
}
.legend-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--text-muted);
}
.legend-line { width: 18px; height: 3px; border-radius: 2px; }

.chart-body { padding: 18px 26px 22px; }

/* table */
.table-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--parchment);
  box-shadow: 0 2px 20px var(--shadow-warm);
  overflow: hidden;
}

.table-scroll { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

thead th {
  background: var(--cream-dark);
  padding: 9px 12px; text-align: right;
  font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-faint); font-weight: 700;
  border-bottom: 1px solid var(--parchment);
  white-space: nowrap; font-family: var(--font-body);
  position: sticky; top: 0; z-index: 1;
}
thead th:first-child, thead th:nth-child(2) { text-align: left; }

tbody tr {
  border-bottom: 1px solid rgba(232,221,200,0.6);
  transition: background var(--transition);
}
tbody tr:hover { background: rgba(0,212,170,0.025); }
tbody tr:last-child { border-bottom: none; }

tbody td {
  padding: 8px 12px; text-align: right;
  font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);
}
tbody td:first-child { text-align: left; color: var(--text-faint); font-size: 10px; }
tbody td:nth-child(2) { text-align: left; font-weight: 700; color: var(--text-body); }

.td-balance  { color: var(--ink) !important; font-weight: 700; }
.td-savings  { color: var(--forest-light) !important; }
.td-ss       { color: #5588bb !important; }
.td-expenses { color: var(--danger) !important; }
.td-phil     { color: var(--moss) !important; }
.td-growth   { color: var(--amber) !important; }
.td-pv       { color: var(--gold) !important; font-style: italic; }
.td-neg      { color: var(--danger) !important; }
.td-dash     { color: var(--text-faint) !important; }

.fi-row { background: rgba(0,212,170,0.03) !important; }
.retire-row { background: rgba(255,106,61,0.04) !important; border-top: 2px solid rgba(255,106,61,0.18) !important; }

.tag {
  display: inline-block; border-radius: 3px;
  font-family: var(--font-body); font-size: 8px; font-weight: 700;
  letter-spacing: 0.06em; padding: 2px 5px; vertical-align: middle; margin-left: 4px;
}
.tag-fi     { background: var(--forest); color: #0a0c10; }
.tag-retire { background: var(--amber);  color: var(--white); }

.table-legend-bar {
  display: flex; gap: 18px; flex-wrap: wrap;
  padding: 12px 20px;
  border-top: 1px solid var(--cream-dark);
  background: var(--cream-dark);
}
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── ANIMATIONS ─────────────────────────────── */
@keyframes fadeUp {
  from { opacity:0; transform:translateY(16px); }
  to   { opacity:1; transform:translateY(0); }
}
.animate-in { opacity:0; animation: fadeUp 500ms cubic-bezier(0.4,0,0.2,1) forwards; }
.animate-in:nth-child(1) { animation-delay: 0ms; }
.animate-in:nth-child(2) { animation-delay: 80ms; }
.animate-in:nth-child(3) { animation-delay: 160ms; }
.animate-in:nth-child(4) { animation-delay: 240ms; }

/* ── TEST PANEL ──────────────────────────────── */
.test-panel {
  position: fixed; bottom: 20px; right: 20px;
  background: var(--white); border: 1px solid var(--parchment);
  border-radius: var(--radius-md); padding: 16px 20px;
  font-size: 11px; font-family: var(--font-mono);
  box-shadow: 0 8px 32px var(--shadow-deep);
  z-index: 9999; min-width: 270px; max-height: 420px; overflow-y: auto;
  display: none;
}
.test-panel.visible { display: block; }
.test-panel-title { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
.test-item { display: flex; align-items: flex-start; gap: 7px; padding: 2px 0; line-height: 1.4; font-size: 10px; }
.test-pass { color: var(--forest-light); }
.test-fail { color: var(--danger); }

/* ── RESPONSIVE ──────────────────────────────── */
@media (max-width: 1100px) {
  .fi-layout { grid-template-columns: 1fr; }
  .inputs-panel { position: static; height: auto; }
  .kpi-strip { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .hero-banner { padding: 30px 22px 0; }
  .main-content { margin-left: 0; }
  /* Sidebar is now a slide-in drawer on mobile — see "MOBILE NAV (drawer)"
     block at the end of this file. The drawer is hidden by transform, not
     display, so it can animate in. */
  .results-area { padding: 18px 16px; }
}
@media (max-width: 500px) {
  .kpi-strip { grid-template-columns: 1fr; }
}

/* =========================================
   SCENARIO SAVE / LOAD PANEL
   ========================================= */

.scenario-bar {
  background: var(--white);
  border-bottom: 1px solid var(--parchment);
  padding: 10px 24px;
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
}

.scenario-bar-label {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-faint); font-weight: 700; white-space: nowrap;
}

.scenario-name-input {
  flex: 1; min-width: 180px; max-width: 280px;
  background: var(--cream);
  border: 1.5px solid var(--parchment);
  border-radius: var(--radius-sm);
  color: var(--ink); font-family: var(--font-body);
  font-size: 13px; padding: 7px 11px; outline: none;
  transition: border-color var(--transition);
}
.scenario-name-input:focus { border-color: var(--forest-light); }
.scenario-name-input::placeholder { color: var(--text-faint); }

.btn-save-scenario {
  background: var(--forest);
  color: #0a0c10; border: none; cursor: pointer;
  padding: 7px 16px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 700; letter-spacing: 0.05em;
  white-space: nowrap;
  transition: all var(--transition);
  box-shadow: 0 2px 8px rgba(0,212,170,0.25);
}
.btn-save-scenario:hover { background: var(--forest-mid); transform: translateY(-1px); }
.btn-save-scenario:active { transform: none; }

.btn-view-scenarios {
  background: none;
  border: 1.5px solid var(--parchment);
  color: var(--text-muted); cursor: pointer;
  padding: 6px 14px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  white-space: nowrap;
  transition: all var(--transition);
}
.btn-view-scenarios:hover { border-color: var(--forest-light); color: var(--forest); }

.scenario-count-badge {
  background: var(--amber);
  color: var(--white);
  font-size: 9px; font-weight: 700;
  padding: 2px 6px; border-radius: 10px;
  margin-left: 4px;
}

.save-toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--forest);
  color: #0a0c10; padding: 11px 22px; border-radius: 20px;
  font-size: 13px; font-weight: 700;
  box-shadow: 0 4px 20px rgba(0,212,170,0.4);
  z-index: 9000;
  transition: transform 350ms cubic-bezier(0.4,0,0.2,1), opacity 350ms ease;
  opacity: 0; pointer-events: none;
}
.save-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* SCENARIOS DRAWER */
.scenarios-drawer {
  position: fixed; top: 0; right: -440px;
  width: 420px; height: 100vh;
  background: var(--white);
  border-left: 1px solid var(--parchment);
  box-shadow: -8px 0 40px rgba(0,0,0,0.12);
  z-index: 500;
  display: flex; flex-direction: column;
  transition: right 380ms cubic-bezier(0.4,0,0.2,1);
}
.scenarios-drawer.open { right: 0; }

.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 499;
  opacity: 0; pointer-events: none;
  transition: opacity 380ms ease;
}
.drawer-overlay.open { opacity: 1; pointer-events: all; }

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

.drawer-title {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 500; color: var(--ink);
}
.drawer-sub { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

.drawer-close {
  background: var(--cream-dark); border: none; cursor: pointer;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 18px; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.drawer-close:hover { background: var(--parchment); color: var(--ink); }

.drawer-body {
  flex: 1; overflow-y: auto; padding: 16px;
}
.drawer-body::-webkit-scrollbar { width: 3px; }
.drawer-body::-webkit-scrollbar-thumb { background: var(--parchment); }

.drawer-empty {
  text-align: center; padding: 60px 24px;
  font-family: var(--font-display); font-style: italic;
  font-size: 16px; color: var(--text-faint); line-height: 1.6;
}

/* Scenario cards */
.scenario-card {
  background: var(--cream);
  border: 1.5px solid var(--parchment);
  border-radius: var(--radius-md);
  padding: 16px; margin-bottom: 10px;
  transition: all var(--transition); position: relative;
}
.scenario-card:hover { border-color: var(--forest-light); box-shadow: 0 2px 12px var(--shadow-warm); }

.sc-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 10px; gap: 10px;
}

.sc-name {
  font-family: var(--font-display); font-size: 17px; font-weight: 500;
  color: var(--ink); line-height: 1.2; flex: 1;
  cursor: pointer; border: none; background: none;
  text-align: left; padding: 0; font-style: normal;
}
.sc-name:hover { color: var(--forest); }

.sc-name-edit {
  font-family: var(--font-display); font-size: 17px; font-weight: 500;
  color: var(--ink); border: 1px solid var(--forest-light);
  background: var(--white); border-radius: 4px;
  padding: 1px 6px; width: 100%; outline: none; display: none;
}

.sc-actions { display: flex; gap: 5px; flex-shrink: 0; }

.sc-btn {
  background: none; border: 1px solid var(--parchment);
  border-radius: 4px; cursor: pointer;
  padding: 4px 8px; font-size: 10px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  transition: all var(--transition); color: var(--text-muted);
}
.sc-btn:hover { background: var(--white); }
.sc-btn--load:hover  { border-color: var(--forest-light); color: var(--forest); }
.sc-btn--delete:hover { border-color: #c0534a; color: #c0534a; }
.sc-btn--rename:hover { border-color: var(--amber); color: var(--amber); }

.sc-timestamp {
  font-size: 9px; color: var(--text-faint); font-family: var(--font-mono);
  margin-bottom: 10px;
}

.sc-stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.sc-stat {
  background: var(--white); border-radius: 6px;
  padding: 7px 9px; text-align: center;
}
.sc-stat-label { font-size: 8px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 3px; }
.sc-stat-val   { font-family: var(--font-display); font-size: 14px; font-weight: 500; color: var(--ink); }
.sc-stat-val.green  { color: var(--forest-mid); }
.sc-stat-val.amber  { color: var(--amber); }

/* =========================================
   SCENARIO COMPARISON MODAL
   ========================================= */

.comparison-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 600;
  opacity: 0; pointer-events: none;
  transition: opacity 350ms ease;
}
.comparison-overlay.open { opacity: 1; pointer-events: all; }

.comparison-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 90vw; max-width: 1100px;
  max-height: 85vh;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  z-index: 601;
  opacity: 0; pointer-events: none;
  transition: all 350ms cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column;
}
.comparison-modal.open {
  opacity: 1; pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

.comparison-header {
  padding: 22px 28px;
  border-bottom: 1px solid var(--parchment);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}

.comparison-title {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 500; color: var(--ink);
}

.comparison-body {
  flex: 1; overflow-y: auto; padding: 24px 28px;
}
.comparison-body::-webkit-scrollbar { width: 4px; }
.comparison-body::-webkit-scrollbar-thumb { background: var(--parchment); }

.comparison-instructions {
  font-size: 13px; color: var(--text-muted); margin-bottom: 14px;
}

.comparison-checkbox-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px; margin-bottom: 20px;
}

.comparison-checkbox-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--cream);
  border: 1.5px solid var(--parchment);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: all var(--transition);
}
.comparison-checkbox-item:hover { border-color: var(--forest-light); }
.comparison-checkbox-item input[type="checkbox"] {
  width: 16px; height: 16px; cursor: pointer;
}
.comparison-checkbox-item label {
  font-size: 13px; color: var(--text-body); cursor: pointer; flex: 1;
}

.comparison-table-wrap { overflow-x: auto; margin-top: 20px; }
.comparison-table {
  width: 100%; border-collapse: collapse;
  font-size: 12px;
}
.comparison-table thead th {
  background: var(--cream-dark);
  padding: 10px 12px; text-align: left;
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-faint); font-weight: 700;
  border-bottom: 2px solid var(--parchment);
  position: sticky; top: 0; z-index: 1;
}
.comparison-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(232,221,200,0.5);
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-muted);
}
.comparison-table tbody td:first-child {
  font-family: var(--font-body); font-weight: 700;
  color: var(--text-body);
}
.comparison-table tbody tr:hover { background: rgba(0,212,170,0.02); }

.comparison-chart-container {
  margin-top: 24px;
  background: var(--cream);
  border-radius: var(--radius-md);
  padding: 20px;
}
.comparison-chart-title {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 500; color: var(--ink);
  margin-bottom: 14px;
}

/* =========================================
   FINANCIAL HEALTH INSIGHTS PANEL
   ========================================= */

.insights-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--parchment);
  box-shadow: 0 2px 20px var(--shadow-warm);
  overflow: hidden;
}

.insights-header {
  padding: 20px 26px;
  background: linear-gradient(135deg, var(--cream-dark) 0%, rgba(0,212,170,0.04) 100%);
  border-bottom: 1px solid var(--parchment);
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
  transition: background var(--transition);
}
.insights-header:hover { background: #181c24; }

.insights-header-left {
  display: flex; align-items: center; gap: 14px;
}

.insights-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--forest-light), var(--forest-mid));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: 0 2px 10px rgba(0,212,170,0.3);
}

.insights-title-group h3 {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 500; color: var(--ink);
  margin: 0;
}

.insights-subtitle {
  font-size: 11px; color: var(--text-muted);
  margin-top: 2px;
}

.insights-toggle {
  background: none; border: none;
  font-size: 24px; color: var(--text-muted);
  cursor: pointer;
  transition: transform var(--transition);
}
.insights-toggle.open { transform: rotate(180deg); }

.insights-body {
  padding: 24px 26px;
  display: none;
}
.insights-body.open { display: block; }

/* Health Score */
.health-score-section {
  display: flex; align-items: center; gap: 20px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--cream-dark);
}

.health-score-gauge {
  position: relative;
  width: 100px; height: 100px;
  flex-shrink: 0;
}

.health-score-circle {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: conic-gradient(var(--score-color, var(--forest)) 0deg var(--score-degrees, 288deg), var(--cream-dark) var(--score-degrees, 288deg) 360deg);
  display: flex; align-items: center; justify-content: center;
}

.health-score-inner {
  width: 76px; height: 76px;
  background: var(--white);
  border-radius: 50%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}

.health-score-value {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 600;
  color: var(--ink);
  line-height: 1;
}

.health-score-max {
  font-size: 12px; color: var(--text-faint);
}

.health-score-text h4 {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 500;
  color: var(--ink);
  margin: 0 0 6px 0;
}

.health-score-label {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.04em;
}

/* Strengths & Risks */
.insights-section {
  margin-bottom: 24px;
}

.insights-section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-body);
  margin-bottom: 12px;
}

.insights-section-icon {
  font-size: 16px;
}

.insights-list {
  list-style: none;
  padding: 0; margin: 0;
}

.insights-list li {
  padding: 10px 14px;
  background: var(--cream);
  border-left: 3px solid var(--forest-light);
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 13px; line-height: 1.5;
  color: var(--text-body);
}

.insights-list.risks li {
  border-left-color: var(--amber);
  background: rgba(255,106,61,0.05);
}

.insights-list.risks li.risk-high {
  border-left-color: var(--danger);
  background: rgba(255,71,87,0.05);
}

/* Commentary */
.insights-commentary {
  background: linear-gradient(135deg, rgba(0,212,170,0.04), rgba(0,212,170,0.02));
  border: 1px solid var(--parchment);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 24px;
}

.insights-commentary p {
  font-family: var(--font-body);
  font-size: 13px; line-height: 1.8;
  color: var(--text-body);
  margin: 0 0 12px 0;
}

.insights-commentary p:last-child {
  margin-bottom: 0;
}

/* Recommendations */
.recommendations-list {
  list-style: none;
  padding: 0; margin: 0;
  counter-reset: rec-counter;
}

.recommendations-list li {
  counter-increment: rec-counter;
  padding: 12px 16px 12px 44px;
  background: var(--cream);
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 13px; line-height: 1.6;
  color: var(--text-body);
  position: relative;
}

.recommendations-list li::before {
  content: counter(rec-counter);
  position: absolute;
  left: 14px; top: 12px;
  width: 22px; height: 22px;
  background: var(--amber);
  color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  font-family: var(--font-mono);
}

/* ── Buttons (pages that only load styles.css) ─────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--forest), var(--forest-mid));
  color: #0a0c10;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 2px 10px rgba(0,212,170,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,212,170,0.4); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  color: var(--text-body);
  border: 1.5px solid var(--parchment);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-secondary:hover {
  border-color: var(--forest-light);
  color: var(--forest);
}

/* ── Investment Portfolio + Sophtron ────────────────────────────────────────── */
.ip-body {
  padding: 40px 48px 72px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 1100px;
}
.ip-sophtron-card {
  background: var(--white);
  border: 1px solid var(--parchment);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: 0 2px 14px var(--shadow-warm);
}
.ip-sophtron-card-head { margin-bottom: 20px; }
.ip-sophtron-heading {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 10px;
}
.ip-sophtron-lead {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.ip-sophtron-lead a {
  color: var(--forest);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ip-sophtron-lead a:hover { color: var(--forest-light); }
.ip-sophtron-status {
  font-size: 12px;
  line-height: 1.55;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--parchment);
}
.ip-sophtron-status-on {
  border-color: rgba(0,212,170,0.35);
  background: rgba(0,212,170,0.06);
  color: var(--sage-pale);
}
.ip-sophtron-status-off {
  color: var(--text-muted);
}
.ip-sophtron-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.ip-sophtron-hint {
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.65;
}
.ip-code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--sage);
  background: var(--cream);
  padding: 1px 6px;
  border-radius: 4px;
}
.ip-placeholder-note p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 640px;
}

.ip-portfolio-empty {
  background: var(--cream);
  border: 1px dashed var(--parchment);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  max-width: 720px;
}
.ip-portfolio-empty p {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-muted);
}
.ip-portfolio-panels {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.ip-portfolio-meta {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.ip-panel {
  background: var(--white);
  border: 1px solid var(--parchment);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  box-shadow: 0 2px 12px var(--shadow-warm);
}
.ip-panel-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 16px;
}
.ip-panel-caption {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-faint);
}

.ip-accounts-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.ip-acc-card {
  flex: 1 1 240px;
  min-width: 200px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--parchment);
  background: var(--cream);
}
.ip-acc-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.ip-acc-inst {
  font-size: 14px;
  font-weight: 600;
  color: var(--sage-pale);
}
.ip-acc-bal {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.ip-acc-sub {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.ip-acc-meta {
  color: var(--text-faint);
}

.ip-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--parchment);
}
.ip-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ip-table th,
.ip-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--parchment);
  vertical-align: top;
}
.ip-table thead th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  background: var(--cream-dark);
}
.ip-table th.num,
.ip-table td.ip-num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ip-table tbody tr:last-child td {
  border-bottom: none;
}
.ip-table-muted {
  color: var(--text-faint);
  font-style: italic;
}
.ip-pad-cell {
  padding-top: 16px !important;
  padding-bottom: 16px !important;
}
.ip-num.pos {
  color: var(--forest);
}
.ip-num.neg {
  color: #d96b7a;
}

.ip-accounts-feed {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.ip-account-summary-panel.ip-panel {
  padding-top: 22px;
}
.ip-summary-card {
  padding-bottom: 4px;
  border-bottom: 1px solid var(--parchment);
  margin-bottom: 4px;
}
.ip-sum-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 8px;
}
.ip-sum-inst {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
}
.ip-sum-bal {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  color: var(--forest);
  white-space: nowrap;
}
.ip-sum-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--sage-pale);
  margin-bottom: 4px;
}
.ip-sum-name-line {
  font-size: 15px;
  font-weight: 600;
  color: var(--sage-pale);
  margin-bottom: 2px;
  line-height: 1.35;
}
.ip-sum-account-actions {
  margin-bottom: 8px;
}
.ip-link-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--forest);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-family: var(--font-body);
}
.ip-link-btn:hover {
  color: var(--forest-light);
}
.ip-account-renaming .ip-sum-name-line,
.ip-account-renaming .ip-sum-account-actions {
  display: none;
}
.ip-sum-name-edit {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--parchment);
  background: var(--cream);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ip-account-rename-input {
  width: 100%;
  max-width: 420px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--parchment);
  border-radius: var(--radius-sm);
}
.ip-account-rename-input:focus {
  outline: none;
  border-color: rgba(0,212,170,0.45);
  box-shadow: 0 0 0 2px rgba(0,212,170,0.12);
}
.ip-account-rename-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ip-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.ip-sum-meta {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.ip-tx-caption {
  margin: 12px 0 10px !important;
  font-size: 13px;
  font-weight: 600;
  color: var(--sage-pale);
}
.ip-tx-table {
  margin-bottom: 4px;
}
.ip-tx-credit {
  color: var(--forest);
  font-weight: 600;
}
.ip-tx-debit {
  color: #c95d6d;
  font-weight: 600;
}
.ip-tx-neutral {
  color: var(--text-body);
  font-weight: 500;
}

.ip-summary-card-selectable {
  cursor: pointer;
  margin: -4px -6px 0;
  padding: 4px 6px 2px;
  border-radius: var(--radius-md);
  transition:
    background var(--transition),
    box-shadow var(--transition);
}
.ip-summary-card-selectable:hover {
  background: rgba(0,212,170,0.06);
}
.ip-summary-card-selectable:focus {
  outline: none;
}
.ip-summary-card-selectable:focus-visible {
  outline: 2px solid rgba(0,212,170,0.45);
  outline-offset: 2px;
}
.ip-account-holdings-selected .ip-summary-card-selectable {
  box-shadow: inset 0 0 0 1px rgba(0,212,170,0.35);
  background: rgba(0,212,170,0.04);
}
.ip-sum-holdings-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Holdings block: high-contrast summary for readability ───────────────── */
.ip-holdings-block {
  margin: 20px 0 6px;
  padding: 18px 20px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0,212,170,0.22);
  background:
    linear-gradient(165deg, rgba(0,212,170,0.09) 0%, transparent 42%),
    var(--cream);
  box-shadow:
    inset 3px 0 0 var(--forest),
    0 4px 20px rgba(0, 0, 0, 0.22);
}

.ip-holdings-header {
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0,212,170, 0.16);
}

.ip-holdings-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.ip-holdings-intro {
  margin: 0;
  max-width: 52rem;
  font-size: 14px;
  line-height: 1.58;
  color: var(--text-body);
}

.ip-holdings-msg {
  font-size: 14px !important;
  line-height: 1.62 !important;
  color: var(--text-body) !important;
  font-style: normal !important;
  font-weight: 500 !important;
}

.ip-holdings-placeholder,
.ip-holdings-empty {
  margin: 0;
  padding: 12px 2px;
}

.ip-holdings-content {
  margin-top: 2px;
}

.ip-holdings-content[aria-busy="true"] {
  pointer-events: none;
  opacity: 0.95;
}

.ip-holdings-loading {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--sage-pale);
}

.ip-holdings-loading-text {
  letter-spacing: 0.01em;
}

.ip-spinner {
  display: inline-block;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: 3px solid var(--parchment);
  border-top-color: var(--forest);
  border-radius: 50%;
  animation: wp-ip-spin-holdings 0.72s linear infinite;
}

@keyframes wp-ip-spin-holdings {
  to {
    transform: rotate(360deg);
  }
}

.ip-holdings-table-wrap {
  border-color: rgba(0,212,170, 0.2);
  background: rgba(0, 0, 0, 0.12);
}

.ip-table.ip-holdings-table {
  font-size: 14px;
}

.ip-holdings-table thead th {
  font-size: 11px !important;
  letter-spacing: 0.075em !important;
  color: var(--ink) !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  padding-top: 12px !important;
  padding-bottom: 12px !important;
  background:
    linear-gradient(to bottom, rgba(0,212,170, 0.1), transparent),
    var(--cream-dark) !important;
  border-bottom: 1px solid rgba(0,212,170, 0.25);
}

.ip-holdings-table tbody td {
  color: var(--text-body);
  padding-top: 12px !important;
  padding-bottom: 12px !important;
  font-size: 14px !important;
  line-height: 1.48;
  vertical-align: middle;
}

.ip-holdings-table tbody td:nth-child(2) {
  color: var(--sage-pale);
  font-size: 13px !important;
  max-width: 22rem;
}

.ip-holdings-table tbody tr:last-child td {
  border-bottom: 1px solid var(--parchment);
}

.ip-holdings-table tbody tr:nth-child(even) {
  background: rgba(255,255,255, 0.02);
}

.ip-holdings-table tbody tr:hover td {
  background: rgba(0,212,170, 0.07);
}

.ip-holdings-total-row td {
  border-top: 2px solid rgba(0,212,170, 0.4) !important;
  padding-top: 14px !important;
  padding-bottom: 14px !important;
  background: rgba(0,212,170, 0.08);
  font-weight: 600;
}

.ip-holdings-total-label {
  font-family: var(--font-display);
  font-size: 13px !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase;
  font-weight: 700 !important;
  color: var(--sage-pale) !important;
}

.ip-holdings-total-value {
  font-family: var(--font-mono);
  font-size: 16px !important;
  font-weight: 700 !important;
  color: var(--forest-light) !important;
}

.ip-holdings-total-tail {
  border-bottom: none;
}

.ip-holding-ticker {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px !important;
  color: var(--ink);
}

.ip-holding-ticker-cell .ip-ticker-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  vertical-align: middle;
}

.ip-ticker-edit-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0 4px;
  margin: 0;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  opacity: 0.8;
}

.ip-ticker-edit-btn:hover,
.ip-ticker-edit-btn:focus-visible {
  opacity: 1;
  border-color: rgba(0, 212, 170, 0.4);
  background: rgba(0, 212, 170, 0.1);
  outline: none;
}

.ip-ticker-edit-ico {
  font-size: 16px;
  line-height: 1;
}

.ip-ticker-row.ip-ticker-editing .ip-ticker-edit-btn,
.ip-ticker-row.ip-ticker-editing .ip-ticker-readable {
  display: none !important;
}

.ip-ticker-edit-input {
  min-width: 6.25rem;
  max-width: 14rem;
  padding: 7px 12px !important;
  font-family: var(--font-mono) !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  color: var(--ink);
  background: var(--white);
  border: 2px solid rgba(0, 212, 170, 0.55);
  border-radius: var(--radius-sm);
}

.ip-holdings-table-wrap .ip-num {
  font-variant-numeric: tabular-nums;
}

.ip-investment-sections {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.ip-broker-panel .ip-broker-title {
  margin-bottom: 4px;
}
.ip-broker-caption {
  margin: 0 0 16px;
}
.ip-ticker-cell {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--sage-pale);
}

.ip-portfolio-load-status {
  margin: 12px 0 0;
  max-width: 900px;
}

.ip-footnote {
  font-size: 13px;
  line-height: 1.65;
  max-width: 720px;
  margin-bottom: 0;
}
.ip-footnote a {
  color: var(--forest);
}

.ind-ip-crosslink {
  margin-top: 0 !important;
  margin-bottom: 12px;
  max-width: none;
}

.ip-api-setup {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--parchment);
}
.ip-api-setup-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--sage-pale);
  margin-bottom: 10px;
  letter-spacing: 0.04em;
}
.ip-api-setup-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.ip-api-setup-input {
  flex: 1;
  min-width: 220px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--parchment);
  background: var(--cream);
  color: var(--text-body);
  font-size: 13px;
  font-family: var(--font-mono);
}
.ip-api-setup-hint {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.6;
}

.ip-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  max-width: min(560px, 92vw);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.55;
  z-index: 500;
  opacity: 0;
  transition: opacity 260ms ease, transform 260ms ease;
  border: 1px solid var(--parchment);
  background: var(--cream-dark);
  color: var(--sage-pale);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}
.ip-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.ip-toast-info { border-left: 3px solid var(--forest); }
.ip-toast-err {
  border-left: 3px solid var(--danger);
  color: #f3c6ca;
}

/* ── India CAS portfolio ─────────────────────────────────────────────────────── */
.ind-body-wide {
  max-width: min(1180px, 100%);
}
.ind-upload-card { margin-bottom: 8px; }
.ind-gmail-card {
  margin-bottom: 8px;
}
.ind-gmail-connected {
  padding-top: 2px;
}
.ind-gmail-connected-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 12px;
}
.ind-gmail-live-dot {
  display: inline-block;
  flex-shrink: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #5ee9c8, var(--forest) 65%);
  box-shadow:
    0 0 0 2px rgba(0, 212, 170, 0.25),
    0 0 14px rgba(0, 212, 170, 0.45);
  animation: ind-gmail-pulse 2.2s ease-in-out infinite;
}
@keyframes ind-gmail-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(0.94);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ind-gmail-live-dot {
    animation: none;
    box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.35);
  }
}
.ind-gmail-connected-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--forest);
}
.ind-gmail-email-value {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 15px;
  font-weight: 500;
  color: var(--sage-pale);
  word-break: break-all;
}
.ind-gmail-last-sync {
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}
.ind-gmail-email,
.ind-gmail-last-sync {
  margin: 0 0 8px;
}
.ind-gmail-last-sync:empty,
.ind-gmail-last-sync[hidden] {
  display: none !important;
}
.ind-gmail-status {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.45;
}
.ind-gmail-status:not([hidden]) {
  display: block;
}
.gmail-status-info {
  color: var(--text-muted);
}
.gmail-status-success {
  color: var(--forest);
}
.gmail-status-warn {
  color: #dcb74a;
}
.gmail-status-error {
  color: #e07a7a;
}
.ind-gmail-connected-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}
.ind-gmail-password-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--parchment);
  max-width: 520px;
}
.ind-gmail-password-hint {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}
.ind-gmail-password-hint .ind-mono-sample {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--text-faint);
}
.ind-cas-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
  max-width: 520px;
}
.ind-form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ind-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--sage-pale);
  letter-spacing: 0.04em;
}
.ind-file-input {
  font-size: 13px;
  color: var(--text-muted);
}
.ind-pan-input {
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ind-form-actions { margin-top: 4px; }
.ind-form-error {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(217,107,122,0.45);
  color: #f3c6ca;
  font-size: 13px;
}
.ind-loading {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}
.ind-loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--forest);
  animation: ind-loading-pulse 1s ease-in-out infinite alternate;
}
@keyframes ind-loading-pulse {
  from {
    opacity: 0.35;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.ind-portfolio-root {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: 28px;
}
.ind-summary-card { padding-bottom: 8px; }
.ind-sum-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--parchment);
}
.ind-sum-name {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  color: var(--ink);
}
.ind-sum-pan {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.ind-sum-meta {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-faint);
}
.ind-sum-total { text-align: right; }
.ind-sum-total-label {
  font-size: 12px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ind-sum-total-amt {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--forest);
  margin-top: 4px;
}
.ind-mf-xirr-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--parchment);
  text-align: right;
}
.ind-mf-xirr-heading {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  font-weight: 600;
  margin-bottom: 6px;
}
.ind-mf-xirr-val {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
}
.ind-mf-xirr-val-pos {
  color: var(--forest);
}
.ind-mf-xirr-val-neg {
  color: var(--danger, #c44);
}
.ind-mf-xirr-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.ind-mf-xirr-note {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-faint);
  max-width: 340px;
  margin-left: auto;
}
.ind-break-bar-caption {
  margin: 0 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}
.ind-break-bar {
  display: flex;
  width: 100%;
  height: 14px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--cream);
  border: 1px solid var(--parchment);
  margin-bottom: 6px;
}
.ind-break-bar-empty {
  align-items: center;
  justify-content: center;
  min-height: 14px;
  padding: 4px 8px;
}
.ind-break-bar-empty-txt {
  font-size: 12px;
  color: var(--text-muted);
}
.ind-bar-seg {
  display: block;
  min-width: 2px;
  height: 100%;
  box-sizing: border-box;
}
.ind-bar-seg-mf {
  background: linear-gradient(180deg, #1f8f7a 0%, #00b894 100%);
}
.ind-bar-seg-demat {
  background: linear-gradient(180deg, #4a7bb5 0%, #6ea8dc 100%);
}
.ind-bar-seg-nps {
  background: linear-gradient(180deg, #b8860b 0%, #dcb74a 100%);
}
.ind-bar-seg-ins {
  background: linear-gradient(180deg, #7a6148 0%, #a08066 100%);
}
.ind-break-item-mf { border-left: 3px solid #00b894; }
.ind-break-item-demat { border-left: 3px solid #6ea8dc; }
.ind-break-item-nps { border-left: 3px solid #dcb74a; }
.ind-break-item-ins { border-left: 3px solid #a08066; }
.ind-demat-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  vertical-align: middle;
  border-radius: 999px;
  border: 1px solid var(--parchment);
  background: var(--cream);
  color: var(--text-muted);
}
.ind-demat-badge-nsdl { color: #6ea8dc; border-color: rgba(110, 168, 220, 0.45); }
.ind-demat-badge-cdsl { color: #c9a962; border-color: rgba(201, 169, 98, 0.45); }
.ind-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.ind-break-item {
  background: var(--cream);
  border: 1px solid var(--parchment);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.ind-break-item span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.ind-break-item strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--sage-pale);
}
.ind-break-item em {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  font-style: normal;
  margin-top: 4px;
}
.ind-section .ip-panel-title { margin-bottom: 16px; }
.ind-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}
.ind-amc-block,
.ind-demat-block,
.ind-nps-block {
  margin-bottom: 18px;
}
.ind-amc-block:last-child,
.ind-demat-block:last-child,
.ind-nps-block:last-child {
  margin-bottom: 0;
}
.ind-amc-head {
  margin-bottom: 12px;
}
.ind-amc-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--sage-pale);
}
.ind-folio-meta {
  font-size: 13px;
  color: var(--text-muted);
}
.ind-subhead {
  margin: 16px 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sage-pale);
}
.ind-mono {
  font-family: var(--font-mono);
  font-size: 12px;
}
.ind-num-pos {
  color: var(--forest) !important;
  font-weight: 600;
}
.ind-num-neg {
  color: #d96b7a !important;
  font-weight: 600;
}
.ind-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.ind-badge-live {
  background: rgba(0, 212, 170, 0.12);
  color: var(--forest);
  border: 1px solid rgba(0, 212, 170, 0.35);
}
.ind-badge-danger {
  background: rgba(217, 107, 122, 0.12);
  color: #f3c6ca;
  border: 1px solid rgba(217, 107, 122, 0.4);
}
.ind-badge-muted {
  background: var(--cream);
  color: var(--text-muted);
  border: 1px solid var(--parchment);
}

@media (max-width: 680px) {
  .ip-body { padding: 28px 20px 48px; }
}

/* ── Clerk / account top bar ─────────────────────────────────────────── */
.wp-auth-topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  padding: 10px 0 14px;
  box-sizing: border-box;
}

.wp-user-menu {
  position: relative;
  font-size: 14px;
  z-index: 50;
}

.wp-user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 14, 18, 0.72);
  color: var(--sage-pale, #dfe6e3);
  cursor: pointer;
  font: inherit;
  max-width: min(280px, 42vw);
}

.wp-user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wp-user-caret {
  opacity: 0.75;
  font-size: 10px;
}

.wp-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  padding: 8px 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #10141c;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

.wp-user-dropdown.open {
  display: block;
}

.wp-user-dropdown a,
.wp-user-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: none;
  background: none;
  color: var(--sage-pale, #dfe6e3);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
}

.wp-user-dropdown a:hover,
.wp-user-dropdown button:hover {
  background: rgba(0, 212, 170, 0.08);
}

.wp-user-dropdown button.danger,
.wp-nav-delete {
  color: #f3a8b0 !important;
}

.wp-auth-signin {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(0, 212, 170, 0.35);
  color: var(--forest, #00d4aa);
  text-decoration: none;
  font-size: 14px;
}

.wp-auth-signin:hover {
  background: rgba(0, 212, 170, 0.08);
}

/* Settings landing */
.settings-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-back {
  color: var(--sage-pale);
  text-decoration: none;
  font-size: 14px;
}

.settings-back:hover {
  color: var(--forest);
}

.settings-main-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.settings-card {
  background: rgba(12, 14, 18, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 18px;
}

.settings-card h2 {
  margin: 0 0 14px;
  font-size: 17px;
  color: var(--sage-pale);
}

.settings-row {
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--text-muted, #8a9a94);
}

.settings-row strong {
  color: var(--sage-pale);
  font-weight: 600;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.btn-wp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn-wp-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--sage-pale);
}

.btn-wp-primary {
  background: linear-gradient(135deg, var(--amber), var(--amber-light));
  color: #fff;
}

.btn-wp-danger {
  background: rgba(217, 107, 122, 0.2);
  color: #f3c6ca;
  border: 1px solid rgba(217, 107, 122, 0.45);
}

/* ============================================================
   MOBILE NAV (drawer)
   ------------------------------------------------------------
   wp-mobile-nav.js injects:
     • .wp-hamburger   — 44×44 teal button, fixed top-right
     • .wp-mobile-backdrop — full-viewport dim, dismisses drawer
     • .sidebar-close  — ✕ button inside the sidebar, mobile-only
   The sidebar element itself becomes a left-edge slide-in
   drawer on ≤ 768 px. Above that, this whole block is dormant.
   ============================================================ */

.wp-hamburger {
  display: none; /* mobile-only — opened up in the @media below */
  position: fixed;
  top: 12px; right: 12px;
  width: 44px; height: 44px;
  border: 0; border-radius: 10px;
  background: var(--forest, #00d4aa);
  color: #04130f;
  font-size: 22px; line-height: 1;
  font-weight: 700;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  -webkit-tap-highlight-color: transparent;
}
.wp-hamburger:focus-visible {
  outline: 2px solid var(--forest, #00d4aa);
  outline-offset: 3px;
}

.wp-mobile-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 998;
  backdrop-filter: blur(2px);
}
.wp-mobile-backdrop.wp-open { display: block; }

.sidebar-close {
  display: none; /* mobile-only */
  position: absolute;
  top: 12px; right: 12px;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: var(--ink, #e8ecf0);
  font-size: 16px; cursor: pointer;
  z-index: 2;
}

@media (max-width: 768px) {
  .wp-hamburger { display: block; }

  /* The sidebar is hidden by transform (not display:none) so it can slide
     in and out. Width is capped at 88vw so the drawer never edges the
     backdrop off-screen on narrow phones. */
  .sidebar {
    display: block !important;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(280px, 88vw);
    transform: translateX(-100%);
    transition: transform 240ms ease;
    z-index: 999;
    overflow-y: auto;
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.4);
  }
  .sidebar.wp-open { transform: translateX(0); }

  .sidebar-close { display: flex; }

  /* Lock the body scroll while the drawer is open — otherwise the page
     under the backdrop can still scroll on iOS. */
  body.wp-mobile-nav-open { overflow: hidden; touch-action: none; }

  /* Push the auth top-bar (it's right-aligned) inward so the hamburger
     doesn't sit right on top of the user-menu trigger. */
  .wp-auth-topbar { padding-right: 56px; }
}

/* ============================================================
   MOBILE: iOS input zoom fix + touch-target sizing
   ------------------------------------------------------------
   iOS Safari auto-zooms when a focused input has font-size < 16px.
   Touch targets per Apple HIG: 44×44. Applied under @media so the
   denser desktop sizing is unchanged.
   ============================================================ */
@media (max-width: 768px) {
  input, select, textarea {
    font-size: 16px !important;
  }
  .btn-primary, .btn-secondary, .ss-btn-primary,
  .rvb-toggle-type, .rvb-country-pill {
    min-height: 44px;
    padding: 10px 16px;
  }
}
