:root {
  --bg: #0a0a0f;
  --bg-card: #111118;
  --bg-card2: #16161f;
  --border: rgba(255,255,255,0.07);
  --border-active: rgba(212,175,85,0.5);
  --gold: #d4af55;
  --gold-light: #f0d080;
  --gold-dim: rgba(212,175,85,0.15);
  --text: #f0ede8;
  --text-muted: #7a7880;
  --text-soft: #b8b4c0;
  --green: #4ade80;
  --green-dim: rgba(74,222,128,0.12);
  --red: #f87171;
  --blue: #60a5fa;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 64px rgba(0,0,0,0.6);
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ── BACKGROUND ── */
.bg-grid {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(212,175,85,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212,175,85,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(circle at center, black, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at center, black, transparent 80%);
}
.bg-glow {
  position: fixed; z-index: 0; pointer-events: none;
  border-radius: 50%; filter: blur(120px); opacity: 0.3;
}

/* ── SWITCH TOGGLE ── */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background-color: rgba(255,255,255,0.1);
  transition: .4s; border: 1px solid var(--border);
}
.slider:before {
  position: absolute; content: ""; height: 16px; width: 16px;
  left: 3px; bottom: 3px; background-color: var(--text-muted);
  transition: .4s;
}
input:checked + .slider { background-color: var(--gold-dim); border-color: var(--gold); }
input:checked + .slider:before { transform: translateX(20px); background-color: var(--gold); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }
.bg-glow-1 { width: 600px; height: 600px; top: -200px; right: -200px; background: radial-gradient(circle, rgba(212,175,85,0.2) 0%, transparent 70%); }
.bg-glow-2 { width: 500px; height: 500px; bottom: 0; left: -150px; background: radial-gradient(circle, rgba(74,222,128,0.1) 0%, transparent 70%); }

/* ── LAYOUT ── */
.app { position: relative; z-index: 1; max-width: 1400px; margin: 0 auto; padding: 0 24px 80px; }

.simple-header {
  padding: 40px 0 32px;
  text-align: center;
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 1px;
  animation: fadeDown 0.8s ease both;
  text-transform: uppercase;
}


/* ── HEADER ── */
header {
  padding: 100px 0 80px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  position: relative;
}

.header-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(212,175,85,0.1); 
  backdrop-filter: blur(10px);
  border: 1px solid rgba(212,175,85,0.2);
  color: var(--gold); font-size: 11px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase;
  padding: 8px 20px; border-radius: 100px; margin-bottom: 32px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  animation: fadeDown 0.8s ease both;
}

h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(48px, 8vw, 84px);
  font-weight: 900; line-height: 1; letter-spacing: -2px;
  margin-bottom: 24px;
  animation: fadeUp 1s 0.2s ease both;
}

h1 span { 
  color: var(--gold); 
  position: relative;
  display: inline-block;
}

h1 span::after {
  content: '';
  position: absolute;
  bottom: 10px; left: 0; width: 100%; height: 8px;
  background: var(--gold-dim);
  z-index: -1;
  transform: skewX(-15deg);
}

.header-sub {
  color: var(--text-soft); font-size: 18px; max-width: 600px; font-weight: 300; margin-bottom: 56px;
  line-height: 1.8;
  animation: fadeUp 1s 0.4s ease both;
}

.header-stats {
  display: flex; gap: 60px; flex-wrap: wrap; justify-content: center;
  animation: fadeUp 1s 0.6s ease both;
  background: rgba(255,255,255,0.02);
  padding: 32px 64px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  backdrop-filter: blur(5px);
}

.stat-item { text-align: center; position: relative; }
.stat-item:not(:last-child)::after {
  content: '';
  position: absolute; right: -30px; top: 10%; height: 80%; width: 1px;
  background: var(--border);
}

.stat-number {
  font-family: 'Playfair Display', serif;
  font-size: 36px; font-weight: 700; color: var(--gold); display: block;
  margin-bottom: 4px;
}

.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 2px; }

/* Refined Glows for Hero */
.bg-glow-1 { 
  width: 800px; height: 800px; top: -300px; right: -100px; 
  background: radial-gradient(circle, rgba(212,175,85,0.15) 0%, transparent 70%); 
}
.bg-glow-2 { 
  width: 600px; height: 600px; top: 200px; left: -200px; 
  background: radial-gradient(circle, rgba(96,165,250,0.1) 0%, transparent 70%); 
}

@media (max-width: 600px) {
  header { padding: 60px 0 40px; }
  .header-stats { gap: 32px; padding: 24px; }
  .stat-item:not(:last-child)::after { display: none; }
  h1 { font-size: 42px; }
}

/* ── NAV TABS ── */
.nav-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px; margin-bottom: 32px;
  animation: fadeUp 0.8s 0.2s ease both;
}
.nav-tab {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px; border-radius: var(--radius-sm); cursor: pointer; border: none;
  background: transparent; color: var(--text-muted); font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 500; transition: var(--transition); white-space: nowrap;
}
.nav-tab:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.nav-tab.active {
  background: linear-gradient(135deg, rgba(212,175,85,0.2), rgba(212,175,85,0.05));
  border: 1px solid rgba(212,175,85,0.3); color: var(--gold-light);
}
.nav-tab .tab-icon { font-size: 16px; }

/* Nav tab as link */
a.nav-tab { text-decoration: none; }

/* ── HOME CALCULATOR GRID ── */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 48px;
  animation: fadeUp 0.8s 0.4s ease both;
}

.calc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-decoration: none;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.calc-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(212,175,85,0.05), transparent);
  opacity: 0;
  transition: var(--transition);
}

.calc-card:hover {
  transform: translateY(-8px);
  border-color: var(--border-active);
  background: var(--bg-card2);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.calc-card:hover::before {
  opacity: 1;
}

.calc-card-icon {
  font-size: 32px;
  width: 56px;
  height: 56px;
  background: var(--gold-dim);
  border: 1px solid rgba(212,175,85,0.2);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.calc-card:hover .calc-card-icon {
  background: var(--gold);
  color: #1a1000;
  transform: scale(1.1) rotate(5deg);
}

.calc-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.calc-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.calc-card-arrow {
  margin-top: auto;
  font-size: 18px;
  color: var(--gold);
  opacity: 0.5;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.calc-card:hover .calc-card-arrow {
  opacity: 1;
  transform: translateX(5px);
}

@media (max-width: 600px) {
  .calc-grid {
    grid-template-columns: 1fr;
  }
}


/* ── PANELS ── */
.calc-panel { display: none; animation: fadeIn 0.4s ease; }
.calc-panel.active { display: block; }

/* ── ADDITIONAL INFO SECTIONS ── */
.info-section {
  padding: 80px 0;
  animation: fadeUp 0.8s ease both;
}

.section-tag {
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  display: block;
  margin-bottom: 12px;
  text-align: center;
}

.section-title-alt {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  text-align: center;
  margin-bottom: 48px;
  color: var(--text);
}

/* Steps Grid */
.step-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 40px;
  border-radius: var(--radius);
  text-align: center;
  transition: var(--transition);
}

.step-card:hover {
  border-color: var(--gold);
  transform: translateY(-5px);
}

.step-number {
  width: 48px;
  height: 48px;
  background: var(--gold);
  color: #1a1000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 20px;
  margin: 0 auto 24px;
}

.step-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--gold);
}

.step-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-item {
  display: flex;
  gap: 16px;
  padding: 24px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.feature-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.feature-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.feature-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* FAQ Accordion */
.faq-container {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.faq-question {
  width: 100%;
  padding: 20px;
  background: none;
  border: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  padding: 0 20px;
}

.faq-item.active .faq-answer {
  max-height: 200px;
  padding-bottom: 20px;
}

@media (max-width: 900px) {
  .step-grid, .feature-grid { grid-template-columns: 1fr; }
}

.panel-grid {
  display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: start;
}

/* ── CARD ── */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: visible;
  position: relative;
  z-index: 10;
}
.card-header {
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.tooltip-wrap {
  position: relative; display: inline-block; margin-left: 6px;
  z-index: 1000;
}
.tooltip-trigger {
  width: 16px; height: 16px; background: rgba(255,255,255,0.05);
  border: 1px solid var(--border); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; cursor: help; color: var(--text-muted);
}
.tooltip-box {
  position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%);
  background: #1a1a2e; color: var(--text); padding: 12px 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--gold);
  font-size: 12px; width: 220px; max-width: 80vw; line-height: 1.6;
  opacity: 0; visibility: hidden; transition: 0.2s;
  box-shadow: 0 15px 35px rgba(0,0,0,0.8); pointer-events: none;
  text-align: center; white-space: normal;
  z-index: 9999;
}
.tooltip-wrap:hover .tooltip-box { opacity: 1; visibility: visible; bottom: 160%; }
.tooltip-box::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--gold);
}
.card-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--gold-dim); border: 1px solid rgba(212,175,85,0.2);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.card-title { font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 700; }
.card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.card-body { padding: 28px; }

/* ── FORM CONTROLS ── */
.form-group { margin-bottom: 24px; }
.form-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 600; color: var(--text-soft);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px;
}
.form-label-value {
  font-family: 'DM Mono', monospace; font-size: 13px; color: var(--gold);
  background: var(--gold-dim); padding: 2px 10px; border-radius: 100px;
}
.input-wrap { position: relative; }
.input-prefix {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 13px; color: var(--text-muted); pointer-events: none; font-weight: 500;
}
input[type="number"] {
  width: 100%; padding: 12px 14px 12px 40px; border-radius: var(--radius-sm);
  background: var(--bg-card2); border: 1px solid var(--border);
  color: var(--text); font-family: 'DM Mono', monospace; font-size: 15px;
  transition: var(--transition); outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; appearance: none; }
input[type="number"]:focus { border-color: var(--border-active); box-shadow: 0 0 0 3px rgba(212,175,85,0.1); }
input[type="number"].no-prefix { padding-left: 14px; }
input[type="number"].has-suffix { padding-right: 40px; }
.input-suffix {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  font-size: 13px; color: var(--text-muted); pointer-events: none;
}
.input-error { font-size: 11px; color: var(--red); margin-top: 6px; display: none; }
.input-error.show { display: block; }

/* PROFILE SELECT DROPDOWN */
.profile-select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-card2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23b8b4c0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}
.profile-select:hover {
  border-color: var(--border-active);
}
.profile-select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,175,85,0.1);
}
.profile-select option {
  background: var(--bg-card2);
  color: var(--text);
  padding: 8px;
}

/* RANGE SLIDER */
.range-group { margin-top: 10px; }
input[type="range"] {
  width: 100%; height: 4px; border-radius: 2px; appearance: none;
  background: linear-gradient(to right, var(--gold) var(--pct, 0%), var(--bg-card2) var(--pct, 0%));
  outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--gold); border: 3px solid var(--bg); box-shadow: 0 0 0 2px rgba(212,175,85,0.3);
  transition: box-shadow 0.2s;
}
input[type="range"]:hover::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(212,175,85,0.3); }
.range-labels {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--text-muted); margin-top: 6px; font-family: 'DM Mono', monospace;
}

/* ── RESULTS ── */
.results-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

.result-highlights {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--border); border-bottom: 1px solid var(--border);
}
.result-highlight {
  background: var(--bg-card); padding: 24px 20px;
  text-align: center; position: relative; overflow: hidden;
}
.result-highlight::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(212,175,85,0.04), transparent);
}
.result-highlight.primary::before { background: linear-gradient(135deg, rgba(212,175,85,0.1), transparent); }
.result-highlight .rh-label {
  font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 8px;
}
.result-highlight .rh-value {
  font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700;
  color: var(--text); line-height: 1.2;
}
.result-highlight.primary .rh-value { color: var(--gold); font-size: 26px; }
.result-highlight .rh-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; font-family: 'DM Mono', monospace; }
.result-highlight .rh-badge {
  display: inline-block; font-size: 10px; padding: 2px 8px; border-radius: 100px; margin-top: 6px;
}
.badge-green { background: var(--green-dim); color: var(--green); }
.badge-gold { background: var(--gold-dim); color: var(--gold); }
.badge-red { background: rgba(248,113,113,0.12); color: var(--red); }

/* ── CHART ── */
.chart-section { padding: 24px 28px; border-bottom: 1px solid var(--border); }
.chart-section-title {
  font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px;
}
.chart-container { position: relative; height: 280px; }

/* ── TABLE ── */
.table-section { padding: 0 28px 28px; }
.table-top {
  padding: 20px 0 16px; display: flex; align-items: center; justify-content: space-between;
}
.table-title { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  padding: 12px 16px; text-align: right; background: var(--bg-card2);
  font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px;
  white-space: nowrap;
}
thead th:first-child { text-align: center; }
tbody tr { border-top: 1px solid var(--border); transition: background 0.15s; }
tbody tr:hover { background: rgba(212,175,85,0.03); }
tbody td {
  padding: 11px 16px; text-align: right;
  font-family: 'DM Mono', monospace; font-size: 12px; color: var(--text-soft);
}
tbody td:first-child { text-align: center; color: var(--text-muted); font-weight: 600; }
tbody td.highlight-cell { color: var(--gold); font-weight: 500; }
tbody td.interest-cell { color: var(--green); }
.table-note { font-size: 11px; color: var(--text-muted); margin-top: 12px; text-align: right; }

/* ── INDICATOR ── */
.indicator-box {
  margin: 0 28px 24px; padding: 16px 20px;
  border-radius: var(--radius-sm); border: 1px solid;
  display: flex; align-items: flex-start; gap: 12px;
}
.indicator-box.good { background: var(--green-dim); border-color: rgba(74,222,128,0.2); }
.indicator-box.warn { background: rgba(251,191,36,0.08); border-color: rgba(251,191,36,0.2); }
.indicator-box.bad  { background: rgba(248,113,113,0.08); border-color: rgba(248,113,113,0.2); }
.indicator-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.indicator-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.indicator-box.good .indicator-title { color: var(--green); }
.indicator-box.warn .indicator-title { color: #fbbf24; }
.indicator-box.bad  .indicator-title { color: var(--red); }
.indicator-text { font-size: 12px; color: var(--text-soft); line-height: 1.5; }

/* ── BREAKDOWN BAR ── */
.breakdown-bar-section { padding: 0 28px 24px; border-bottom: 1px solid var(--border); }
.breakdown-bar { height: 8px; border-radius: 4px; background: var(--bg-card2); overflow: hidden; margin-bottom: 12px; display: flex; }
.bar-principal { background: linear-gradient(90deg, var(--blue), rgba(96,165,250,0.7)); border-radius: 4px 0 0 4px; transition: width 0.6s cubic-bezier(0.4,0,0.2,1); }
.bar-interest { background: linear-gradient(90deg, var(--gold), var(--gold-light)); transition: width 0.6s cubic-bezier(0.4,0,0.2,1); }
.breakdown-legend { display: flex; gap: 20px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); }
.legend-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.legend-dot.principal { background: var(--blue); }
.legend-dot.interest { background: var(--gold); }
.legend-value { font-family: 'DM Mono', monospace; color: var(--text-soft); font-size: 11px; }

/* ── RMD TABLE ── */
.rmd-age-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.rmd-age-table th { padding: 8px 12px; background: var(--bg-card2); color: var(--text-muted); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }
.rmd-age-table td { padding: 8px 12px; border-top: 1px solid var(--border); font-family: 'DM Mono', monospace; color: var(--text-soft); }
.rmd-age-table tr.current-age td { background: rgba(212,175,85,0.08); color: var(--gold); }

/* ── COLLEGE ── */
.inflation-highlight {
  background: linear-gradient(135deg, rgba(248,113,113,0.08), rgba(248,113,113,0.03));
  border: 1px solid rgba(248,113,113,0.2); border-radius: var(--radius-sm);
  padding: 14px 18px; margin-bottom: 20px;
}
.inflation-highlight-title { font-size: 11px; font-weight: 600; color: var(--red); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.inflation-highlight-val { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 700; color: var(--red); }
.inflation-highlight-sub { font-size: 11px; color: var(--text-muted); }

/* ── FOOTER ── */
footer {
  margin-top: 80px; padding: 40px 0 32px;
  border-top: 1px solid var(--border); text-align: center;
}
.footer-brand {
  font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 700; color: var(--gold); margin-bottom: 8px;
}
.footer-text { font-size: 12px; color: var(--text-muted); max-width: 480px; margin: 0 auto 16px; line-height: 1.8; }
.footer-link { color: var(--gold); text-decoration: none; }
.footer-link:hover { text-decoration: underline; }
.footer-disclaimer {
  font-size: 11px; color: rgba(122,120,128,0.6); max-width: 600px; margin: 0 auto;
  padding: 16px; background: var(--bg-card); border-radius: var(--radius-sm); border: 1px solid var(--border);
}

/* ── UTILITIES ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; border: none;
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 600;
  padding: 10px 20px; border-radius: var(--radius-sm); transition: var(--transition);
}
.btn-ghost {
  background: transparent; border: 1px solid var(--border); color: var(--text-muted);
}
.btn-ghost:hover { border-color: var(--border-active); color: var(--gold); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold), #b8900f);
  color: #1a1000; font-weight: 700;
}
.btn-gold:hover { opacity: 0.9; transform: translateY(-1px); }

.divider { height: 1px; background: var(--border); margin: 24px 0; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes countUp { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

.count-animate { animation: countUp 0.4s cubic-bezier(0.4,0,0.2,1) both; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .panel-grid { grid-template-columns: 1fr; }
  .result-highlights { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .app { padding: 0 16px 60px; }
  header { padding: 32px 0 40px; }
  .nav-tabs {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
  }
  .nav-tab { font-size: 11px; padding: 10px 6px; }
  .nav-tab .tab-icon { font-size: 14px; }
  .result-highlights { grid-template-columns: 1fr; }
  .header-stats { gap: 24px; }
  .card-body { padding: 20px; }
  input[type="number"],
  input[type="range"] {
    min-height: 44px;
  }
  .form-group {
    margin-bottom: 20px;
  }
}

/* ── TOOLTIP ── */
.tooltip-wrap { position: relative; display: inline-flex; }
.tooltip-trigger {
  width: 14px; height: 14px; border-radius: 50%; background: var(--bg-card2);
  border: 1px solid var(--border); color: var(--text-muted); font-size: 9px;
  display: inline-flex; align-items: center; justify-content: center; cursor: help;
}
.tooltip-box {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: #1e1e2a; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 14px; font-size: 11px; color: var(--text-soft); line-height: 1.5;
  width: 220px; opacity: 0; pointer-events: none; transition: opacity 0.2s;
  white-space: normal; z-index: 100; box-shadow: var(--shadow);
}
.tooltip-wrap:hover .tooltip-box { opacity: 1; }

/* ── LOADING SKELETON ── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card2) 25%, rgba(255,255,255,0.04) 50%, var(--bg-card2) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 4px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── CHART LOADING STATE ── */
.chart-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  gap: 12px;
  z-index: 10;
}
.chart-loading span {
  font-size: 12px;
  color: var(--text-muted);
}
.chart-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--bg-card2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── TOAST NOTIFICATION ── */
#toast-notification {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
}

/* ── INPUT VALIDATION ── */
input[type="number"].input-invalid {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px rgba(248,113,113,0.1) !important;
}

/* ── PHASE TABS ── */
.phase-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}
.phase-tab {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.phase-tab:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}
.phase-tab.active {
  background: linear-gradient(135deg, rgba(212,175,85,0.2), rgba(212,175,85,0.05));
  border-color: rgba(212,175,85,0.3);
  color: var(--gold-light);
}

/* ── SHARE BUTTON ── */
.share-btn-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 16px 28px 24px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green-dim);
  border: 1px solid rgba(74,222,128,0.3);
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.share-btn:hover {
  background: rgba(74,222,128,0.2);
  transform: translateY(-1px);
}

/* ── AI CHAT WIDGET ── */
.ai-chat-widget { 
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999; /* Sangat tinggi agar di atas footer */
  width: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ai-chat-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--gold);
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  z-index: 10001;
}

.ai-chat-toggle:hover {
  width: 280px;
  padding: 0 20px;
  box-shadow: 0 6px 25px rgba(212, 175, 85, 0.3);
}

.ai-chat-icon {
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-chat-placeholder {
  opacity: 0;
  width: 0;
  display: none;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
}

.ai-chat-toggle:hover .ai-chat-placeholder {
  opacity: 1;
  width: auto;
  display: block;
  margin-left: 10px;
}

.ai-chat-window {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  max-width: 90vw;
  max-height: 520px;
  background: rgba(26, 26, 46, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid var(--gold);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1);
  z-index: 10000;
}

.ai-chat-window.active {
  opacity: 1;
  visibility: visible;
  bottom: 0;
}

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

.ai-chat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
}

.ai-chat-avatar {
  font-size: 16px;
}

.ai-chat-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.ai-chat-close:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

.ai-chat-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ai-chat-expand {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.ai-chat-expand:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

.ai-chat-window.expanded {
  width: 600px;
  max-height: 80vh;
}

.ai-chat-window.expanded .ai-chat-messages {
  max-height: 60vh;
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 400px;
  background: rgba(10, 10, 20, 0.4);
}

.ai-message {
  max-width: 90%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.ai-message-bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  border: 1px solid rgba(212, 175, 85, 0.3);
  border-bottom-left-radius: 2px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.ai-message-user {
  align-self: flex-end;
  background: var(--gold);
  color: #0f172a;
  font-weight: 500;
  border-bottom-right-radius: 2px;
  box-shadow: 0 4px 15px rgba(212, 175, 85, 0.2);
}

.ai-message-content {
  word-wrap: break-word;
}

.ai-message-loading {
  display: flex;
  gap: 4px;
  align-items: center;
}

.ai-message-loading span {
  width: 8px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: aiLoading 1.4s infinite ease-in-out both;
}

.ai-message-loading span:nth-child(1) { animation-delay: -0.32s; }
.ai-message-loading span:nth-child(2) { animation-delay: -0.16s; }

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

.ai-chat-input-area {
  display: flex;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

.ai-chat-input-area textarea {
  flex: 1;
  padding: 10px 14px;
  border: none;
  border-radius: 20px;
  background: var(--bg-card2);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  resize: none;
  outline: none;
  transition: var(--transition);
  min-height: 40px;
  max-height: 80px;
}

.ai-chat-input-area textarea:focus {
  background: var(--bg);
}

.ai-chat-send {
  width: 40px;
  height: 40px;
  background: var(--gold);
  border: none;
  border-radius: 50%;
  color: #1a1a2e;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: var(--transition);
  flex-shrink: 0;
}

.ai-chat-send:hover {
  transform: scale(1.05);
  background: #e5c76b;
}

.ai-chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── MAIN NAVIGATION ── */
.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap;
  gap: 12px;
}

.nav-logo {
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 20px;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

.nav-link.active {
  color: var(--gold);
  background: rgba(212,175,85,0.1);
  border: 1px solid rgba(212,175,85,0.2);
}

/* ── CALCULATOR PAGE LAYOUT ── */
.calculator-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}

.page-header {
  text-align: center;
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}

.page-description {
  color: var(--text-muted);
  font-size: 14px;
}

.panel-grid.single-panel {
  display: block;
  max-width: 800px;
  margin: 0 auto;
}

/* ── TWO COLUMN FORM ── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .main-nav {
    padding: 12px 16px;
  }
  
  .nav-links {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }
  
  .calculator-page {
    padding: 16px;
  }
  
  .two-col {
    grid-template-columns: 1fr;
  }
}

/* ── PDF BUTTON ── */
.pdf-btn {
  background: rgba(96,165,250,0.12);
  border: 1px solid rgba(96,165,250,0.3);
  color: var(--blue);
}
.pdf-btn:hover {
  background: rgba(96,165,250,0.2);
}

/* ── KPR CALCULATOR STYLES ── */
.kpr-summary {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin: 20px 0;
}

.kpr-summary-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  text-align: center;
}

.kpr-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.kpr-summary-item {
  text-align: center;
}

.kpr-summary-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.kpr-summary-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.badge-green {
  background: var(--green-dim);
  color: var(--green);
}

.badge-red {
  background: rgba(248,113,113,0.15);
  color: #f87171;
}

@media (max-width: 768px) {
  .kpr-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── DATA SAVER / LOCALSTORAGE NOTICE ── */
.data-saver-notice {
  position: fixed;
  bottom: 80px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  max-width: 280px;
  box-shadow: var(--shadow);
  z-index: 100;
  animation: slideIn 0.3s ease;
}
.data-saver-notice .notice-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.data-saver-notice .notice-text {
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.5;
  margin-bottom: 12px;
}
.data-saver-notice .notice-actions {
  display: flex;
  gap: 8px;
}
.data-saver-notice button {
  font-size: 11px;
  padding: 6px 12px;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── PHASE 8: DRAGGABLE, NEW CHAT & HISTORY ── */

.ai-chat-widget {
  /* Fix position for dragging */
  transition: opacity 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ai-chat-toggle {
  cursor: pointer !important;
}

.ai-chat-toggle:active {
  cursor: grabbing !important;
}

.ai-chat-header-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.ai-chat-btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: var(--transition);
}

.ai-chat-btn-icon:hover {
  background: rgba(255,255,255,0.08);
  color: var(--gold);
}

/* History Sidebar */
.ai-chat-sidebar {
  position: absolute;
  top: 0;
  left: -280px; /* Hidden by default */
  width: 280px;
  height: 100%;
  background: rgba(26, 26, 46, 0.98);
  backdrop-filter: blur(25px);
  border-right: 1px solid var(--gold);
  z-index: 10002;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 10px 0 30px rgba(0,0,0,0.5);
}

.ai-chat-sidebar.active {
  left: 0;
}

.sidebar-header {
  padding: 18px;
  border-bottom: 1px solid rgba(212, 175, 85, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.history-item {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.history-item:hover {
  background: rgba(212, 175, 85, 0.08);
  border-color: rgba(212, 175, 85, 0.2);
}

.history-item-title {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-date {
  font-size: 10px;
  color: var(--text-muted);
}

.sidebar-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 10001;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.history-item {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-item-content {
  flex: 1;
  overflow: hidden;
}

.history-delete-btn {
  background: transparent;
  border: none;
  color: rgba(248, 113, 113, 0.4);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: var(--transition);
  opacity: 0;
}

.history-item:hover .history-delete-btn {
  opacity: 1;
}

.history-delete-btn:hover {
  background: rgba(248, 113, 113, 0.1);
  color: #f87171;
}

.sidebar-footer {
  padding: 15px;
  border-top: 1px solid rgba(212, 175, 85, 0.1);
}

.clear-all-btn {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #f87171;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.clear-all-btn:hover {
  background: rgba(248, 113, 113, 0.05);
  border-color: #f87171;
}

.ai-notif-bubble {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--gold);
  color: #1a1a2e;
  padding: 10px 18px;
  border-radius: 15px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 999;
}

.ai-notif-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--gold);
}

.ai-notif-bubble.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
}
.profile-select {
  width: auto !important;
}
.health-check-card {
  margin-top: 40px !important;
  z-index: 10;
}
@media (max-width: 768px) {
  .health-check-card {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  .health-check-result {
    border-left: none;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 20px;
  }
  .quick-tips-float {
    display: none; /* Hide on mobile to avoid clutter */
  }
}

/* Fix for text inputs in calculators */
.input-wrap input[type="text"] {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(212, 175, 85, 0.2) !important;
  border-radius: 12px !important;
  padding: 12px 12px 12px 45px !important; /* Extra padding for the 'Rp' prefix */
  color: #ffffff !important;
  font-family: 'DM Mono', monospace !important;
  font-size: 16px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  transition: all 0.3s ease !important;
}
.input-wrap input[type="text"]:focus {
  border-color: #d4af55 !important;
  background: rgba(212, 175, 85, 0.05) !important;
  outline: none !important;
}
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-prefix {
  position: absolute;
  left: 15px;
  color: var(--gold);
  font-weight: 600;
  z-index: 5;
}

.input-wrap input {
  padding-left: 55px !important; /* Increase padding for 'Rp ' space */
  letter-spacing: 2px !important; /* Elegant spacing for monospace numbers */
}
.input-prefix {
  left: 18px !important;
  font-size: 14px !important;
}

/* ── MOBILE RESPONSIVE ENHANCEMENTS ── */
@media (max-width: 600px) {
  /* Share buttons - stack vertically on mobile */
  .share-btn-container {
    flex-direction: column;
    gap: 8px;
  }
  .share-btn {
    width: 100%;
    justify-content: center;
  }
  
  /* Modal improvements */
  .modal-overlay {
    padding: 20px 12px !important;
    align-items: flex-end !important;
  }
  .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 16px 16px 0 0 !important;
    max-height: 90vh !important;
  }
  .modal-footer {
    flex-direction: column;
    gap: 8px;
  }
  .modal-footer button {
    width: 100%;
  }
  
  /* Table horizontal scroll */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-wrap table {
    min-width: 600px;
  }
  
  /* Chart container */
  .chart-container {
    min-height: 250px;
  }
  
  /* Form inputs larger touch targets */
  input[type="number"],
  input[type="text"],
  select {
    min-height: 48px;
    font-size: 16px; /* Prevents iOS zoom */
  }
  
  /* AI Chat widget */
  .ai-chat-widget {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
    max-width: 100%;
  }
  .ai-chat-button {
    width: 56px;
    height: 56px;
  }
}

/* Small phones */
@media (max-width: 380px) {
  .nav-tabs {
    grid-template-columns: repeat(2, 1fr);
  }
  .nav-tab {
    font-size: 10px;
    padding: 8px 4px;
  }
  .card-title {
    font-size: 20px;
  }
  .rh-value {
    font-size: 18px;
  }
}

/* ── UI POLISH - ANIMATIONS & EFFECTS ── */
/* Smooth button transitions */
.share-btn, .btn-primary, .btn-secondary {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.share-btn:active, .btn-primary:active, .btn-secondary:active {
  transform: scale(0.96);
}

/* Card hover lift effect */
.calc-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.calc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

/* Nav tab hover glow */
.nav-tab {
  transition: all 0.2s ease;
}
.nav-tab:hover:not(.active) {
  background: rgba(212,175,85,0.08);
  border-color: rgba(212,175,85,0.2);
}

/* Input focus glow */
input[type="number"]:focus,
input[type="text"]:focus {
  box-shadow: 0 0 0 3px rgba(212,175,85,0.15);
  border-color: var(--gold) !important;
}

/* Range slider thumb glow on hover */
input[type="range"]:hover::-webkit-slider-thumb {
  box-shadow: 0 0 0 8px rgba(212,175,85,0.15);
}

/* Result highlight pulse animation on update */
@keyframes highlightPulse {
  0% { background: rgba(212,175,85,0); }
  50% { background: rgba(212,175,85,0.1); }
  100% { background: rgba(212,175,85,0); }
}
.result-highlight.updated {
  animation: highlightPulse 0.6s ease;
}

/* Scenario item hover effect */
.scenario-item {
  transition: all 0.2s ease;
}
.scenario-item:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(212,175,85,0.3);
  transform: translateX(4px);
}

/* Toast slide in animation */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
#toast-notification {
  animation: slideIn 0.3s ease;
}

/* Modal fade in */
.modal-overlay {
  transition: opacity 0.2s ease;
}
.modal-content {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Loading shimmer for charts */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.chart-loading {
  background: linear-gradient(90deg, 
    rgba(255,255,255,0) 0%, 
    rgba(255,255,255,0.05) 50%, 
    rgba(255,255,255,0) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
