/* ===================================
   住宅ローンシミュレーター CSS
   Design: Playful + Trustworthy
   =================================== */

/* ===================================
   Color: わたシミュ デザインシステム準拠
   =================================== */
:root {
  /* ─── わたシミュ デザイントークン ─── */
  --color-primary:              #d97706;
  --color-primary-hover:        #b45309;
  --color-primary-light:        #fef3c7;
  --color-success:              #059669;
  --color-success-light:        #d1fae5;
  --color-danger:               #dc2626;
  --color-danger-light:         #fee2e2;
  --color-warning:              #f59e0b;
  --color-invest:               #7c3aed;
  --color-invest-light:         #ede9fe;
  --color-text-primary:         #1a1a1a;
  --color-text-secondary:       #6b7280;
  --color-text-tertiary:        #9ca3af;
  --color-background-primary:   #ffffff;
  --color-background-secondary: #f9fafb;
  --color-background-tertiary:  #f3f4f6;
  --color-border-primary:       #e5e7eb;
  --color-border-secondary:     #d1d5db;

  /* ─── レイアウト用エイリアス ─── */
  --primary:       #d97706;
  --primary-light: #fbbf24;
  --primary-dark:  #b45309;
  --accent:        #059669;
  --accent-light:  #34d399;
  --accent2:       #f59e0b;
  --accent3:       #d1fae5;
  --navy:          #78350f;
  --navy-light:    #92400e;
  --dark:          #1c1917;
  --text:          #1a1a1a;
  --text-muted:    #6b7280;
  --bg:            #f9fafb;
  --bg-card:       #ffffff;
  --border:        #e5e7eb;
  --shadow-sm:     0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:     0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg:     0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --shadow-color:  0 8px 24px rgba(217,119,6,0.2);
  --radius:        16px;
  --radius-sm:     10px;
  --radius-lg:     24px;
  --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: 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

/* ===================================
   HEADER
   =================================== */
.header {
  background: var(--bg-card);
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.logo-icon {
  font-size: 2rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-main {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1.25rem;
  color: var(--navy);
}

.logo-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.header-badge {
  background: #1c1917;
  color: white;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 100px;
  letter-spacing: 0.05em;
}

/* ===================================
   HERO
   =================================== */
.hero {
  position: relative;
  background: var(--navy);
  padding: 80px 24px 100px;
  overflow: hidden;
  text-align: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.25;
  animation: blobFloat 8s ease-in-out infinite;
}

.blob1 {
  width: 400px; height: 400px;
  background: #d97706;
  top: -100px; left: -100px;
  animation-delay: 0s;
}
.blob2 {
  width: 300px; height: 300px;
  background: #059669;
  bottom: -80px; right: 10%;
  animation-delay: 3s;
}
.blob3 {
  width: 200px; height: 200px;
  background: #f59e0b;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: 1.5s;
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -20px) scale(1.05); }
  66% { transform: translate(-10px, 15px) scale(0.95); }
}

.hero-content {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
}

.hero-tag {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  color: rgba(255,255,255,0.9);
  font-size: 0.875rem;
  font-weight: 700;
  padding: 8px 20px;
  border-radius: 100px;
  margin-bottom: 24px;
  border: 1px solid rgba(255,255,255,0.2);
  animation: fadeInUp 0.8s ease both;
}

.hero-title {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: white;
  line-height: 1.3;
  margin-bottom: 20px;
  animation: fadeInUp 0.8s ease 0.15s both;
}

.hero-title-accent {
  color: var(--accent2);
  position: relative;
}

.hero-title-accent::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 0; right: 0;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
}

.hero-desc {
  color: rgba(255,255,255,0.75);
  font-size: 1.05rem;
  margin-bottom: 40px;
  animation: fadeInUp 0.8s ease 0.3s both;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--primary);
  color: white;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  padding: 16px 40px;
  border-radius: 100px;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(217,119,6,0.4);
  transition: transform var(--transition), box-shadow var(--transition);
  animation: fadeInUp 0.8s ease 0.45s both;
}

.hero-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(217,119,6,0.5);
}

.hero-cta span {
  animation: bounce 1.5s ease infinite;
  display: inline-block;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

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

/* ===================================
   STEPS BAR
   =================================== */
.steps-bar {
  max-width: 700px;
  margin: 40px auto 32px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 80px;
  opacity: 0.4;
  transition: opacity var(--transition);
}

.step.active, .step.done { opacity: 1; }

.step-num {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  border: 3px solid transparent;
}

.step.active .step-num {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(217,119,6,0.4);
  transform: scale(1.1);
}

.step.done .step-num {
  background: #059669;
  color: white;
  border-color: var(--accent);
}

.step.done .step-num::before {
  content: '✓';
}

.step-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.step.active .step-label { color: var(--primary); }
.step.done .step-label { color: var(--accent); }

.step-line {
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 26px;
  max-width: 60px;
  transition: background var(--transition);
}

.step-line.done { background: var(--accent); }

/* ===================================
   SIMULATOR WRAP
   =================================== */
.simulator-wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ===================================
   FORM SECTIONS
   =================================== */
.form-section {
  display: none;
  animation: fadeInUp 0.5s ease;
}

.form-section.active { display: block; }

.section-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}

.section-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.section-title {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1.75rem;
  color: var(--navy);
  margin-bottom: 4px;
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===================================
   CARDS & INPUTS
   =================================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.input-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-card:hover, .input-card:focus-within {
  border-color: #fbbf24;
  box-shadow: var(--shadow-color);
}

.input-card-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 12px;
}

.input-card-icon { font-size: 1.2rem; }

.input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-main {
  flex: 1;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  color: var(--navy);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  width: 100%;
}

.input-main:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(217,119,6,0.12);
}

.input-sm {
  width: 80px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  color: var(--navy);
  outline: none;
  text-align: center;
}

.input-unit {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.input-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.5;
}

.input-derived {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.input-derived strong {
  color: var(--primary);
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
}

/* Slider */
.slider-wrap { margin-top: 12px; }

.slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(to right, var(--primary) 0%, var(--primary) 70%, var(--border) 70%);
  border-radius: 3px;
  cursor: pointer;
  outline: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(255,107,107,0.4);
  cursor: pointer;
  transition: transform var(--transition);
}

.slider::-webkit-slider-thumb:hover { transform: scale(1.2); }

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Toggle */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-label {
  font-weight: 700;
  font-size: 0.9rem;
}

.toggle {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  cursor: pointer;
}

.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 14px;
  transition: background var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: white;
  top: 3px; left: 3px;
  transition: transform var(--transition);
  box-shadow: var(--shadow-sm);
}

.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(24px); }

/* ===================================
   SUBSECTIONS
   =================================== */
.subsection {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}

.subsection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.subsection-title {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--navy);
}

.subsection-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.6;
}

/* Split loan */
.split-settings { margin-top: 16px; }

.split-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.split-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.split-badge {
  background: var(--navy);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 100px;
}

.split-badge.secondary { background: var(--accent); }

.split-arrow {
  font-size: 1.5rem;
  color: var(--text-muted);
}

/* ===================================
   RATE TYPE SELECTOR
   =================================== */
.rate-type-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.rate-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 20px;
  background: var(--bg-card);
  border: 3px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.rate-type-btn:hover {
  border-color: #fbbf24;
  box-shadow: var(--shadow-color);
}

.rate-type-btn.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(217,119,6,0.05), rgba(217,119,6,0.1));
  box-shadow: var(--shadow-color);
}

.rate-type-icon { font-size: 2rem; }

.rate-type-label {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1rem;
  color: var(--navy);
}

.rate-type-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.rate-settings { animation: fadeInUp 0.3s ease; }

/* ===================================
   VARIABLE RATE PERIODS
   =================================== */
.variable-rate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.variable-rate-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.rate-period-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.rate-period-item {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.rate-period-item label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.rate-period-item input {
  width: 70px;
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  text-align: center;
  outline: none;
  color: var(--navy);
}

.rate-period-item input:focus {
  border-color: var(--primary);
}

.btn-remove {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  line-height: 1;
  transition: background var(--transition);
  margin-left: auto;
}

.btn-remove:hover { background: rgba(255,107,107,0.1); }

/* ===================================
   BUTTONS
   =================================== */
.btn-add {
  background: var(--accent);
  color: var(--dark);
  border: none;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 10px 20px;
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-add:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(5,150,105,0.35);
}

.step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid var(--border);
}

.btn-next {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  padding: 14px 32px;
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(217,119,6,0.35);
}

.btn-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(217,119,6,0.45);
}

.btn-back {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 2px solid var(--border);
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  padding: 12px 28px;
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-back:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.btn-calc {
  background: linear-gradient(135deg, #92400e, #b45309);
  color: white;
  border: none;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1.1rem;
  padding: 16px 40px;
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 6px 20px rgba(146,64,14,0.35);
  animation: pulse 2s ease infinite;
}

.btn-calc:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(146,64,14,0.45);
  animation: none;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(146,64,14,0.35); }
  50% { box-shadow: 0 6px 28px rgba(146,64,14,0.5), 0 0 0 6px rgba(146,64,14,0.1); }
}

.btn-share {
  background: var(--accent3);
  color: var(--dark);
  border: none;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  padding: 14px 28px;
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-share:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(168,230,207,0.5);
}

/* ===================================
   LUMP PREPAY
   =================================== */
.lump-prepay-section {
  margin-top: 16px;
}

.lump-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
}

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

.lump-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 20px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 2px dashed var(--border);
}

.lump-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  flex-wrap: wrap;
}

.lump-item label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.lump-item input {
  background: white;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  outline: none;
  color: var(--navy);
}

.lump-item input:focus { border-color: var(--primary); }
.lump-item input[type="number"] { width: 120px; }

/* ===================================
   ASSET TABS
   =================================== */
.asset-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.asset-tab {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 100px;
  padding: 8px 20px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-muted);
}

.asset-tab.active, .asset-tab:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: white;
}

.asset-tab-content { display: none; }
.asset-tab-content.active { display: block; }

/* ===================================
   RESULTS
   =================================== */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.summary-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: transform var(--transition);
  animation: fadeInUp 0.5s ease both;
}

.summary-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.summary-card:nth-child(1) { border-top: 4px solid var(--primary); }
.summary-card:nth-child(2) { border-top: 4px solid var(--accent); }
.summary-card:nth-child(3) { border-top: 4px solid var(--accent2); }
.summary-card:nth-child(4) { border-top: 4px solid var(--accent3); }
.summary-card:nth-child(5) { border-top: 4px solid var(--navy); }

.summary-card-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-card-value {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1.4rem;
  color: var(--navy);
  line-height: 1.2;
}

.summary-card-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Charts */
.chart-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.chart-tab {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 100px;
  padding: 8px 20px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-muted);
}

.chart-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(217,119,6,0.3);
}

.chart-wrap {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
  position: relative;
  height: 380px;
}

#mainChart { max-height: 320px; }

/* Table */
.table-section {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 2px solid var(--border);
  background: var(--bg);
  flex-wrap: wrap;
  gap: 12px;
}

.table-header h3 {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1rem;
  color: var(--navy);
}

.table-toggle {
  display: flex;
  gap: 6px;
}

.table-view-btn {
  background: white;
  border: 2px solid var(--border);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-muted);
}

.table-view-btn.active {
  background: var(--navy);
  border-color: var(--navy);
  color: white;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  white-space: nowrap;
}

.result-table th {
  background: #78350f;
  color: white;
  padding: 10px 12px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  text-align: right;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  position: sticky;
  top: 0;
}

.result-table th:first-child { text-align: center; }

.result-table td {
  padding: 9px 12px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  color: var(--text);
}

.result-table td:first-child { text-align: center; font-weight: 700; color: var(--navy); }

.result-table tbody tr:hover { background: rgba(255,107,107,0.04); }

.result-table tbody tr:nth-child(5n) { background: rgba(44,62,122,0.04); }

.result-table .highlight { color: var(--primary); font-weight: 800; }
.result-table .positive { color: var(--accent); }
.result-table .negative { color: var(--primary); }

/* ===================================
   FOOTER
   =================================== */
.footer {
  background: #1c1917;
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 32px 24px;
}

.footer-note {
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.footer-copy {
  font-size: 0.78rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
}

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 600px) {
  .hero { padding: 60px 20px 80px; }
  .hero-title { font-size: 1.8rem; }
  .hero-cta { font-size: 1rem; padding: 14px 28px; }
  .rate-type-selector { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .summary-cards { grid-template-columns: repeat(2, 1fr); }
  .chart-wrap { height: 300px; }
  .steps-bar { gap: 0; }
  .step { min-width: 60px; }
  .step-label { font-size: 0.65rem; }
}

/* ===================================
   LOADING OVERLAY
   =================================== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.loading-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.loading-inner {
  text-align: center;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 5px solid var(--border);
  border-top-color: #d97706;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

.loading-text {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: #78350f;
}
