/* =====================================================
   LEGALSTHAL — INCOME TAX CALCULATOR
   Premium Dashboard Design System
   ===================================================== */

@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/RecklessCondensedS-TRIAL-Book.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/midnight-sans-rd-12-medium-trial.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/midnight-sans-rd-12-semibold-trial.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  
  src: url('../assets/fonts/RobotoMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  
  src: url('../assets/fonts/RobotoMono-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ─── TOKENS ─── */
:root {
  --primary:        #255E8E;
  --primary-dark:   #1d4d77;
  --primary-mid:    #3a7ab5;
  --primary-light:  #EBF3FA;
  --primary-xlight: #F0F7FF;
  --accent:         #F28C28;
  --accent-dark:    #d97916;
  --accent-light:   #FEF3E2;
  --success:        #16A34A;
  --success-light:  #DCFCE7;
  --danger:         #DC2626;
  --danger-light:   #FEE2E2;
  --warning:        #D97706;
  --warning-light:  #FEF3C7;

  --bg-page:        #EEF3F8;
  --bg-card:        #FFFFFF;
  --bg-section:     #F8FAFC;
  --bg-input:       #FAFBFD;

  --text-main:      #0F172A;
  --text-body:      #1E293B;
  --text-muted:     #64748B;
  --text-light:     #94A3B8;
  --text-xlight:    #CBD5E1;

  --border:         #E2E8F0;
  --border-focus:   #255E8E;

  --shadow-xs:      0 1px 2px rgba(15,23,42,0.05);
  --shadow-sm:      0 1px 4px rgba(15,23,42,0.07), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md:      0 4px 16px rgba(15,23,42,0.09), 0 2px 4px rgba(15,23,42,0.05);
  --shadow-lg:      0 8px 32px rgba(15,23,42,0.11), 0 4px 8px rgba(15,23,42,0.06);
  --shadow-xl:      0 20px 60px rgba(15,23,42,0.16);

  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-xl:   18px;
  --r-2xl:  24px;

  --font: 'Inter', "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
  --font-mono: 'Inter', "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t:    all 0.22s var(--ease);
  --t-slow: all 0.38s var(--ease);
}

h1, h2, h3, h4, h5, h6, .th-name, .panel-title, .section-title, .modal-heading, .results-placeholder h3 {
  font-family: 'Inter', "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
}

.sp-value, .breakdown-value, .res-val, .form-input, .minput, .slab-table td {
  font-family: var(--font-mono) !important;
}

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  max-width: 100vw;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  padding: 0 0 60px;
}

/* ─── PAGE WRAP ─── */
.page-wrap {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 20px;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════
   HEADER STRIP
══════════════════════════════════════════════════ */
.tool-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-bottom: 3px solid var(--accent);
  padding: 18px 0;
  margin: 0 -20px 28px;
  padding-left: 32px;
  padding-right: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.th-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.th-logo {
  width: 44px;
  height: 44px;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.th-text {
  display: flex;
  flex-direction: column;
}

.th-name {
  font-size: 19px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.th-tag {
  font-size: 11px;
  color: rgba(255,255,255,0.68);
  font-weight: 400;
  letter-spacing: 0.2px;
}

.th-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.92);
  border: 1px solid rgba(255,255,255,0.20);
  white-space: nowrap;
}

.badge-pill.accent {
  background: var(--accent);
  border-color: var(--accent-dark);
  color: #fff;
}

/* ═══════════════════════════════════════════════════
   MAIN LAYOUT
══════════════════════════════════════════════════ */
.calc-layout {
  display: grid;
  grid-template-columns: clamp(280px, 35%, 440px) 1fr;
  gap: 22px;
  align-items: start;
  min-width: 0;
}

/* ═══════════════════════════════════════════════════
   LEFT PANEL — INPUTS
══════════════════════════════════════════════════ */
.panel-inputs {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  padding: 28px 24px;
  position: sticky;
  top: 20px;
  animation: panelIn 0.42s var(--ease) both;
  min-width: 0;
  overflow: hidden;
}

@keyframes panelIn {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}

.panel-title-row {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1.5px solid var(--border);
}

.panel-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.4px;
  margin-bottom: 4px;
}

.panel-sub {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── FORM BLOCKS ── */
.form-block {
  margin-bottom: 20px;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-body);
  margin-bottom: 8px;
}

.form-label.small { font-size: 12.5px; }

.label-ico {
  color: var(--primary);
  font-size: 12.5px;
  width: 14px;
  text-align: center;
}

.cap-badge {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid rgba(37,94,142,0.16);
}

/* ── SELECT ── */
.select-wrap {
  position: relative;
}

.form-select {
  width: 100%;
  height: 46px;
  padding: 0 42px 0 14px;
  font-family: var(--font);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-main);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-input);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
  transition: var(--t);
}

.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,94,142,0.12);
  background: #fff;
}

.sel-arr {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 11px;
  pointer-events: none;
  transition: var(--t);
}

.select-wrap:focus-within .sel-arr {
  color: var(--primary);
  transform: translateY(-50%) rotate(180deg);
}

/* ── FIELD NOTE ── */
.field-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.5;
}

.field-note i { color: var(--primary); font-size: 11px; margin-top: 1px; flex-shrink: 0; }
.field-note.small { font-size: 11.5px; }

/* ── REGIME SELECTOR ── */
.regime-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.regime-card {
  cursor: pointer;
  display: block;
}

.regime-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.rc-inner {
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 12px 12px;
  background: var(--bg-section);
  transition: var(--t);
  user-select: none;
  position: relative;
  overflow: hidden;
}

.rc-inner::before {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}

.regime-card:hover .rc-inner {
  border-color: var(--primary-mid);
}

.regime-card input:checked + .rc-inner {
  border-color: var(--primary-dark);
  box-shadow: 0 4px 16px rgba(37,94,142,0.28);
}

.regime-card input:checked + .rc-inner::before {
  opacity: 1;
}

/* All children need to be above the pseudo */
.rc-top, .rc-icon, .rc-title, .rc-desc {
  position: relative;
  z-index: 1;
}

.rc-top { margin-bottom: 8px; }

.rc-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid rgba(37,94,142,0.18);
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  transition: var(--t);
}

.rc-tag.muted {
  color: var(--text-muted);
  background: var(--bg-section);
  border-color: var(--border);
}

.regime-card input:checked ~ .rc-inner .rc-tag {
  background: rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.3);
}

.rc-icon {
  font-size: 20px;
  color: var(--primary);
  margin-bottom: 8px;
  transition: var(--t);
}

.regime-card input:checked + .rc-inner .rc-icon {
  color: rgba(255,255,255,0.9);
}

.rc-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
  transition: var(--t);
}

.regime-card input:checked + .rc-inner .rc-title {
  color: #fff;
}

.rc-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
  transition: var(--t);
}

.regime-card input:checked + .rc-inner .rc-desc {
  color: rgba(255,255,255,0.75);
}

/* ── AMOUNT INPUT ── */
.input-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-input);
  transition: var(--t);
  overflow: hidden;
}

.input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,94,142,0.11);
  background: #fff;
}

.inp-prefix {
  padding: 0 14px;
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  height: 46px;
  display: flex;
  align-items: center;
  border-right: 1.5px solid var(--border);
  transition: var(--t);
  user-select: none;
  flex-shrink: 0;
}

.inp-prefix.sm {
  height: 40px;
  font-size: 14px;
  padding: 0 11px;
}

.input-wrap:focus-within .inp-prefix {
  border-right-color: var(--primary);
}

.form-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0 14px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-main);
  height: 46px;
  font-family: var(--font);
  background: transparent;
  min-width: 0;
  width: 0;
}

.form-input.sm {
  height: 40px;
  font-size: 14px;
}

.form-input::placeholder { color: var(--text-light); font-weight: 400; }

.inp-suffix {
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
  background: transparent;
}

/* Error state */
.has-error .input-wrap {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.10);
}

.field-err {
  display: block;
  font-size: 12px;
  color: var(--danger);
  margin-top: 5px;
  min-height: 14px;
  font-weight: 500;
}

/* ── DEDUCTIONS SECTION ── */
.deductions-section {
  background: var(--primary-xlight);
  border: 1.5px solid rgba(37,94,142,0.15);
  border-radius: var(--r-lg);
  padding: 18px;
  margin-bottom: 20px;
  display: none;
  animation: fadeSlide 0.30s var(--ease) both;
  overflow: hidden;
}

.deductions-section.visible {
  display: block;
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.deduct-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 10px;
}

.deduct-badge {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.deduct-note {
  font-size: 12px;
  color: var(--primary);
  display: flex;
  align-items: flex-start;
  gap: 6px;
  background: rgba(37,94,142,0.08);
  padding: 8px 10px;
  border-radius: var(--r-sm);
  margin-bottom: 14px;
  line-height: 1.4;
}

.deduct-note i { font-size: 11px; margin-top: 1px; flex-shrink: 0; }

.deduct-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.deduct-field { margin-bottom: 0; }

/* Cap badge inside labels — prevent overflow */
.form-label {
  flex-wrap: wrap;
}

.cap-badge {
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── BUTTONS ── */
.btn-calc {
  width: 100%;
  height: 50px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--t);
  position: relative;
  overflow: hidden;
  margin-bottom: 10px;
}

.btn-calc::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 55%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.55s ease;
}

.btn-calc:hover::after { left: 150%; }
.btn-calc:hover {
  background: linear-gradient(135deg, var(--primary-mid) 0%, var(--primary) 100%);
  box-shadow: 0 6px 22px rgba(37,94,142,0.38);
  transform: translateY(-1px);
}

.btn-calc:active { transform: translateY(0); }

.btn-reset {
  width: 100%;
  height: 38px;
  background: transparent;
  border: none;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: var(--t);
  border-radius: var(--r-sm);
}

.btn-reset:hover {
  color: var(--danger);
  background: var(--danger-light);
}

/* ═══════════════════════════════════════════════════
   RIGHT PANEL — RESULTS
══════════════════════════════════════════════════ */
.panel-results {
  animation: panelInR 0.42s var(--ease) 0.1s both;
  min-width: 0;
}

@keyframes panelInR {
  from { opacity: 0; transform: translateX(14px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── PLACEHOLDER ── */
.results-placeholder {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 56px 32px;
  text-align: center;
}

.placeholder-icon {
  font-size: 52px;
  color: var(--text-xlight);
  margin-bottom: 18px;
}

.results-placeholder h3 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-body);
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

.results-placeholder p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 380px;
  margin: 0 auto 20px;
  line-height: 1.6;
}

.placeholder-chips {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.placeholder-chips span {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 6px 14px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(37,94,142,0.16);
}

/* ── RESULTS CONTENT ── */
.results-content {
  display: none;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  width: 100%;
}

.results-content.visible {
  display: flex;
  animation: resultsIn 0.38s var(--ease) both;
}

@keyframes resultsIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* common card style for result sections */
.summary-row,
.chart-breakdown-row,
.progress-section,
.compare-section,
.suggestions-section,
.slab-section,
.lead-cta,
.action-row {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

/* ── SUMMARY PILLS ── */
.summary-row {
  display: flex;
  padding: 0;
  overflow: hidden;
}

.summary-pill {
  flex: 1;
  padding: 16px 18px;
  border-right: 1px solid var(--border);
  transition: var(--t);
}

.summary-pill:last-child { border-right: none; }

.summary-pill.accent {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.sp-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}

.summary-pill.accent .sp-label { color: rgba(255,255,255,0.70); }

.sp-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.summary-pill.accent .sp-value { color: #fff; font-size: 18px; }

/* ── CHART + BREAKDOWN ── */
.chart-breakdown-row {
  display: flex;
  gap: 0;
  overflow: hidden;
  align-items: stretch;
}

.chart-box {
  padding: 24px 20px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 220px;
}

.chart-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  margin-bottom: 16px;
}

.chart-wrap canvas {
  display: block;
}

.chart-center-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.ccl-title {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.ccl-value {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  line-height: 1;
}

.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
}

.cl-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.cl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Breakdown Table */
.breakdown-table {
  flex: 1;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.bt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  transition: var(--t);
}

.bt-row:hover { background: var(--bg-section); }
.bt-row.highlight { background: var(--primary-xlight); }
.bt-row.total-row {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--r-md);
  margin-top: 4px;
}

.bt-row.total-row:hover { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); }

.bt-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.bt-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.bt-label i {
  font-size: 12px;
  color: var(--primary);
  width: 14px;
  text-align: center;
}

.bt-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.bt-value.deduct { color: var(--success); }
.bt-value.primary { color: var(--primary); font-size: 15px; }
.bt-value.total {
  color: #fff;
  font-size: 16px;
  font-weight: 900;
}

.bt-row.total-row .bt-label {
  color: rgba(255,255,255,0.80);
  font-weight: 600;
}

.bt-row.total-row .bt-label i { color: rgba(255,255,255,0.70); }

/* ── PROGRESS SECTION ── */
.progress-section {
  padding: 20px 24px;
}

.ps-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ps-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-body);
}

.ps-value {
  font-size: 18px;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -0.4px;
}

.progress-track {
  height: 12px;
  background: var(--bg-section);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-mid) 0%, var(--primary) 50%, var(--accent-dark) 100%);
  border-radius: 10px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; right: 0;
  width: 6px;
  background: rgba(255,255,255,0.45);
  border-radius: 0 10px 10px 0;
}

.ps-markers {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-light);
  font-weight: 500;
}

/* ── COMPARISON CARD ── */
.compare-section {
  padding: 20px 24px;
}

.compare-header {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-body);
}

.compare-header i { color: var(--primary); }

.compare-tag {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(22,163,74,0.20);
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.compare-card {
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  text-align: center;
  transition: var(--t);
  position: relative;
}

.compare-card.winner {
  border-color: var(--success);
  background: var(--success-light);
  box-shadow: 0 4px 14px rgba(22,163,74,0.18);
}

.compare-card.loser {
  border-color: var(--border);
  opacity: 0.72;
}

.cmp-regime {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.compare-card.winner .cmp-regime { color: var(--success); }

.cmp-tax {
  font-size: 22px;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.cmp-erate {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 10px;
}

.cmp-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  display: inline-block;
}

.compare-vs {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-light);
  text-align: center;
}

.compare-insight {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-section);
  padding: 12px 14px;
  border-radius: var(--r-md);
  line-height: 1.6;
  border-left: 3px solid var(--primary);
}

.compare-insight strong { color: var(--primary); }

/* ── SUGGESTIONS ── */
.suggestions-section {
  padding: 20px 24px;
}

.sugg-header {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-body);
  margin-bottom: 14px;
}

.sugg-header i { color: var(--accent); }

.sugg-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sugg-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-section);
  transition: var(--t);
}

.sugg-item:hover {
  border-color: var(--primary);
  background: var(--primary-xlight);
}

.sugg-ico {
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.sugg-ico.green  { background: var(--success-light); color: var(--success); }
.sugg-ico.orange { background: var(--accent-light);  color: var(--accent-dark); }
.sugg-ico.blue   { background: var(--primary-light); color: var(--primary); }

.sugg-body { flex: 1; }

.sugg-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-body);
  margin-bottom: 3px;
  line-height: 1.3;
}

.sugg-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.sugg-saving {
  font-size: 13px;
  font-weight: 800;
  color: var(--success);
  white-space: nowrap;
  align-self: center;
}

/* ── SLAB TABLE ── */
.slab-section {
  padding: 20px 24px;
}

.slab-header-row {
  margin-bottom: 14px;
}

.slab-header {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-body);
}

.slab-header i { color: var(--primary); }

.slab-table-wrap {
  overflow-x: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

.slab-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.slab-table thead {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.slab-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  color: rgba(255,255,255,0.88);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.slab-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--t);
}

.slab-table tbody tr:last-child { border-bottom: none; }
.slab-table tbody tr:hover { background: var(--primary-xlight); }
.slab-table tbody tr.active-slab { background: var(--accent-light); }

.slab-table tbody td {
  padding: 10px 14px;
  color: var(--text-body);
  font-weight: 500;
}

.slab-table .td-tax {
  font-weight: 700;
  color: var(--primary);
}

/* ── LEAD CTA ── */
.lead-cta {
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #EBF3FA 0%, #E0EEFA 100%);
  border-color: rgba(37,94,142,0.20);
}

.lc-left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 1;
  min-width: 220px;
}

.lc-icon {
  width: 50px;
  height: 50px;
  background: var(--primary);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(37,94,142,0.30);
}

.lc-text { flex: 1; }

.lc-q {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 4px;
  line-height: 1.4;
}

.lc-s {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.btn-consult {
  height: 48px;
  padding: 0 22px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
  transition: var(--t);
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(242,140,40,0.35);
}

.btn-consult:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(242,140,40,0.48);
}

.btn-consult:active { transform: translateY(0); }

/* ── ACTION ROW ── */
.action-row {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-section);
}

.btn-action {
  flex: 1;
  height: 42px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-body);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--t);
}

.btn-action:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
}

.btn-action.accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  border-color: var(--accent-dark);
  color: #fff;
}

.btn-action.accent:hover {
  background: linear-gradient(135deg, var(--accent-dark) 0%, #c26010 100%);
  border-color: #c26010;
  color: #fff;
  box-shadow: 0 4px 16px rgba(242,140,40,0.38);
  transform: translateY(-1px);
}
/* ═══════════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: #fff;
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  padding: 32px;
  position: relative;
  transform: scale(0.94) translateY(12px);
  transition: transform 0.28s var(--ease);
  max-height: 92vh;
  overflow-y: auto;
}

.modal-overlay.open .modal-box {
  transform: scale(1) translateY(0);
}

.modal-x {
  position: absolute;
  top: 16px; right: 16px;
  width: 34px; height: 34px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  background: #fff;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--t);
}

.modal-x:hover {
  background: var(--danger-light);
  border-color: var(--danger);
  color: var(--danger);
}

.modal-head {
  text-align: center;
  margin-bottom: 26px;
}

.modal-ico {
  width: 66px; height: 66px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--r-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 26px;
  margin: 0 auto 16px;
  box-shadow: 0 6px 22px rgba(37,94,142,0.35);
}

.modal-heading {
  font-size: 21px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.4px;
  margin-bottom: 8px;
}

.modal-sub {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Modal form */
.mrow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.mgroup { margin-bottom: 16px; }

.mlabel {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-body);
  margin-bottom: 6px;
}

.req { color: var(--danger); }

.minput, .mselect {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  color: var(--text-main);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-input);
  outline: none;
  transition: var(--t);
  appearance: none;
  -webkit-appearance: none;
}

.minput:focus, .mselect:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,94,142,0.11);
  background: #fff;
}

.minput.error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220,38,38,0.10); }

.merr {
  display: block;
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
  min-height: 14px;
  font-weight: 500;
}

.btn-msubmit {
  width: 100%;
  height: 50px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--t);
  margin-top: 4px;
}

.btn-msubmit:hover {
  background: linear-gradient(135deg, var(--primary-mid) 0%, var(--primary) 100%);
  box-shadow: 0 6px 20px rgba(37,94,142,0.36);
  transform: translateY(-1px);
}

.btn-msubmit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Modal Success */
.modal-success {
  display: none;
  text-align: center;
  padding: 20px 0;
  animation: slideUp 0.34s ease both;
}

.modal-success.visible { display: block; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ms-icon {
  font-size: 64px;
  color: var(--success);
  margin-bottom: 14px;
  animation: bounceIn 0.44s var(--ease) both;
}

@keyframes bounceIn {
  0%   { transform: scale(0.5); opacity: 0; }
  70%  { transform: scale(1.12); }
  100% { transform: scale(1); opacity: 1; }
}

.modal-success h4 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.modal-success p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 22px;
}

.btn-done {
  height: 44px;
  padding: 0 32px;
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--t);
}

.btn-done:hover {
  background: #15803D;
  box-shadow: 0 4px 14px rgba(22,163,74,0.38);
  transform: translateY(-1px);
}

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text-main);
  color: #fff;
  padding: 12px 22px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 2000;
  box-shadow: var(--shadow-lg);
  transition: transform 0.30s var(--ease), opacity 0.30s ease;
  opacity: 0;
  white-space: nowrap;
}

.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast-ico { color: #4ADE80; font-size: 16px; }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .calc-layout {
    grid-template-columns: minmax(0, 38%) 1fr;
  }
}

@media (max-width: 960px) {
  .calc-layout {
    grid-template-columns: minmax(0, 40%) 1fr;
  }
}

@media (max-width: 860px) {
  .calc-layout {
    grid-template-columns: 1fr;
  }

  .panel-inputs {
    position: static;
    max-width: 600px;
    margin: 0 auto;
  }

  .panel-results {
    max-width: 100%;
  }

  .chart-breakdown-row {
    flex-direction: column;
  }

  .chart-box {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .chart-legend {
    flex-direction: row;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
  }

  .compare-grid {
    grid-template-columns: 1fr auto 1fr;
  }
}

@media (max-width: 600px) {
  body { padding-bottom: 100px !important; }

  .page-wrap { padding: 0 10px; }

  .tool-header {
    margin: 0 -10px 16px;
    padding: 14px 14px;
    gap: 10px;
  }

  .th-badges { display: none; }

  .panel-inputs {
    padding: 20px 16px;
    border-radius: var(--r-lg);
  }

  .panel-title { font-size: 17px; }
  .panel-sub { font-size: 12.5px; }

  .deductions-section {
    padding: 14px 12px;
  }

  .deduct-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .form-label {
    font-size: 12.5px;
    gap: 5px;
  }

  .cap-badge {
    font-size: 9.5px;
    padding: 1px 6px;
  }

  .inp-prefix { padding: 0 10px; font-size: 14px; }
  .inp-prefix.sm { padding: 0 9px; font-size: 13px; }
  .form-input { font-size: 15px; padding: 0 10px; }
  .form-input.sm { font-size: 14px; padding: 0 10px; }

  .summary-row { flex-wrap: wrap; }
  .summary-pill { flex: 1 1 50%; border: none; border-bottom: 1px solid var(--border); padding: 12px 14px; }
  .summary-pill:last-child { border-bottom: none; flex: 1 1 100%; }

  .progress-section,
  .compare-section,
  .suggestions-section,
  .slab-section,
  .lead-cta,
  .action-row {
    padding: 16px 14px;
  }

  .breakdown-table {
    padding: 16px 12px;
  }

  .chart-box {
    padding: 20px 14px;
  }

  .ps-markers span {
    white-space: nowrap;
  }

  .compare-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .compare-vs {
    text-align: center;
    padding: 2px 0;
  }

  .lead-cta { flex-direction: column; text-align: center; }
  .btn-consult { width: 100%; justify-content: center; }

  .action-row { flex-direction: column; gap: 12px; padding: 12px 16px; }
  .btn-action { width: 100%; height: 46px; border-radius: 50px; font-size: 14px; justify-content: center; }

  .regime-toggle { grid-template-columns: 1fr; gap: 10px; }
  .rc-inner { padding: 12px; }

  .mrow { grid-template-columns: 1fr; }
  .modal-box { padding: 22px 16px; }

  .th-name { font-size: 16px; }

  .btn-calc { height: 48px; font-size: 14.5px; }
  .btn-reset { font-size: 12.5px; }
}

@media (max-width: 400px) {
  .page-wrap { padding: 0 8px; }

  .tool-header {
    margin: 0 -8px 14px;
    padding: 12px 12px;
  }

  .panel-inputs {
    padding: 16px 12px;
  }

  .deductions-section {
    padding: 12px 10px;
  }

  .panel-title { font-size: 16px; }
  .hdr-name { font-size: 15px; }

  .form-label { font-size: 12px; }
  .cap-badge { font-size: 9px; }

  .inp-prefix { padding: 0 8px; font-size: 13px; height: 42px; }
  .inp-prefix.sm { padding: 0 7px; height: 36px; }
  .form-input { height: 42px; font-size: 14px; }
  .form-input.sm { height: 36px; font-size: 13px; }

  .deduct-note { font-size: 11px; padding: 6px 8px; }
  .field-note { font-size: 11px; }
  .field-note.small { font-size: 10.5px; }
}

@media (max-width: 480px) {
  .action-buttons {
    flex-direction: column;
    gap: 12px;
  }
  .btn-action {
    width: 100%;
    height: 46px;
    border-radius: 50px;
    font-size: 14px;
  }
}


