/* ═══════════════════════════════════════════════════════════════
   SIP & LUMPSUM CALCULATOR TOOL — STYLESHEET
   Groww-Inspired Layout with Matrix Runway Purple Theme + Dark Mode
   ═══════════════════════════════════════════════════════════════ */

:root {
  --sip-accent: var(--purple-600, #7c3aed);
  --sip-accent-hover: var(--purple-700, #6d28d9);
  --sip-accent-bg: rgba(124, 58, 237, 0.10);
  --sip-accent-pill-bg: rgba(124, 58, 237, 0.12);
  --sip-track-bg: #e5e0f5;
  --sip-chart-invested: #ede9f8;
  --sip-chart-returns: #7c3aed;
  --sip-card-border: var(--border, rgba(109, 40, 217, 0.22));
  --sip-thumb-bg: #ffffff;
  --sip-thumb-shadow: 0 2px 8px rgba(124, 58, 237, 0.25), 0 0 1px rgba(109, 40, 217, 0.2);
}

[data-theme="dark"] {
  --sip-accent: var(--purple-400, #a78bfa);
  --sip-accent-hover: var(--purple-500, #8b5cf6);
  --sip-accent-bg: rgba(139, 92, 246, 0.16);
  --sip-accent-pill-bg: rgba(139, 92, 246, 0.22);
  --sip-track-bg: rgba(167, 139, 250, 0.18);
  --sip-chart-invested: #271c47;
  --sip-chart-returns: #8b5cf6;
  --sip-card-border: var(--border, rgba(167, 139, 250, 0.24));
  --sip-thumb-bg: #f8fafc;
  --sip-thumb-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(139, 92, 246, 0.35);
}

/* ── Wrapper & Container ── */
.sip-calculator-wrapper {
  width: 100%;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  min-height: 85vh;
  display: flex;
  flex-direction: column;
}

/* ── Main Calculator Card ── */
.sip-calculator-card {
  background: var(--bg-card);
  border: 1px solid var(--sip-card-border);
  border-radius: var(--radius-lg, 22px);
  padding: 36px 36px 40px;
  box-shadow: var(--shadow-md);
  box-sizing: border-box;
  max-width: 100%;
}

/* ── Top Mode Switcher Pills (SIP / Lumpsum) ── */
.sip-tabs-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.sip-mode-pill {
  padding: 8px 22px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  line-height: 1.3;
}

@media (hover: hover) {
  .sip-mode-pill:hover:not(.active) {
    color: var(--sip-accent);
    background: rgba(124, 58, 237, 0.06);
  }
}

.sip-mode-pill.active {
  background: var(--sip-accent-pill-bg);
  color: var(--sip-accent);
  border-color: rgba(124, 58, 237, 0.22);
}

/* ── Two-Column Workspace Grid ── */
.sip-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 1fr);
  gap: 48px;
  align-items: start;
  max-width: 100%;
}

/* ── Left Column: Sliders & Inputs ── */
.sip-controls-col {
  display: flex;
  flex-direction: column;
  gap: 32px;
  min-width: 0;
  max-width: 100%;
}

.sip-slider-block {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.sip-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: nowrap;
}

.sip-field-label {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.35;
  min-width: 0;
}

/* ── Value Input Box (Purple Theme) ── */
.sip-input-box {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
  background: var(--sip-accent-bg);
  border: 1.5px solid rgba(124, 58, 237, 0.18);
  border-radius: 8px;
  height: 40px;
  width: 112px;
  min-width: 96px;
  max-width: 124px;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.sip-input-box:focus-within {
  border-color: var(--purple-500);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.sip-input-box.input-error {
  background: rgba(239, 68, 68, 0.12);
  border-color: #ef4444;
}

.sip-input-prefix,
.sip-input-suffix {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--sip-accent);
  pointer-events: none;
  user-select: none;
  line-height: 1;
}

.sip-input-prefix {
  left: 12px;
}

.sip-input-suffix {
  right: 12px;
}

.sip-number-input {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-heading);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--sip-accent);
  text-align: right;
  padding: 6px 12px;
  box-sizing: border-box;
  -moz-appearance: textfield;
}

/* Prevent overlap with prefix/suffix */
.sip-number-input.with-prefix {
  padding-left: 30px;
  padding-right: 12px;
}

.sip-number-input.with-suffix {
  padding-left: 10px;
  padding-right: 32px;
}

/* Currency Dropdown Inside Investment Input Box */
.sip-input-box.sip-input-box-currency {
  width: 156px;
  min-width: 140px;
  max-width: 185px;
}

.sip-currency-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 7px 0 10px;
  border-right: 1.5px solid rgba(124, 58, 237, 0.18);
  border-radius: 6.5px 0 0 6.5px;
  flex-shrink: 0;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.sip-currency-picker:hover {
  background: rgba(124, 58, 237, 0.12);
}

.sip-currency-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--sip-accent);
  pointer-events: none;
  user-select: none;
  line-height: 1;
  white-space: nowrap;
}

.sip-currency-caret {
  opacity: 0.78;
  flex-shrink: 0;
}

.sip-currency-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.sip-currency-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: var(--font-body);
}

.sip-number-input.with-currency-select {
  flex: 1;
  min-width: 0;
  padding-left: 8px;
  padding-right: 10px;
}

.sip-number-input::-webkit-outer-spin-button,
.sip-number-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ── Custom Range Slider (Purple Theme) ── */
.sip-range-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 4px 0;
}

.sip-range-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--purple-600, #7c3aed) 0%,
    var(--purple-500, #8b5cf6) var(--slider-pct, 25%),
    var(--sip-track-bg) var(--slider-pct, 25%),
    var(--sip-track-bg) 100%
  );
  outline: none;
  cursor: default;
  pointer-events: none;
  margin: 0;
}

.sip-range-input.is-dragging {
  pointer-events: auto;
  cursor: grabbing;
}

.sip-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--sip-thumb-bg);
  box-shadow: var(--sip-thumb-shadow);
  border: 2px solid var(--purple-500, #8b5cf6);
  cursor: grab;
  pointer-events: auto;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sip-range-input::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--sip-thumb-bg);
  box-shadow: var(--sip-thumb-shadow);
  border: 2px solid var(--purple-500, #8b5cf6);
  cursor: grab;
  pointer-events: auto;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sip-range-input:active::-webkit-slider-thumb {
  cursor: grabbing;
  transform: scale(1.08);
}

.sip-range-input:active::-moz-range-thumb {
  cursor: grabbing;
  transform: scale(1.08);
}

/* ── 4. Inflation Calculation Feature Block ── */
.sip-inflation-block {
  padding: 16px 18px;
  border-radius: 12px;
  border: 1.5px dashed var(--border);
  background: var(--bg-primary);
  transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
  gap: 14px;
}

.sip-inflation-block.inflation-enabled {
  border-style: solid;
  border-color: var(--purple-500);
  background: rgba(124, 58, 237, 0.04);
}

.sip-inflation-check-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  min-width: 0;
}

.sip-inflation-check-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.sip-check-ui {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  border-radius: 5px;
  border: 2px solid var(--purple-400);
  background: var(--bg-card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  box-sizing: border-box;
}

.sip-check-ui::after {
  content: '';
  width: 5px;
  height: 10px;
  border: solid #ffffff;
  border-width: 0 2.2px 2.2px 0;
  transform: rotate(45deg) scale(0);
  margin-bottom: 2px;
  transition: transform 0.18s ease;
}

.sip-inflation-check-label input[type="checkbox"]:checked + .sip-check-ui {
  background: var(--purple-600);
  border-color: var(--purple-600);
}

.sip-inflation-check-label input[type="checkbox"]:checked + .sip-check-ui::after {
  transform: rotate(45deg) scale(1);
}

.sip-inflation-check-label input[type="checkbox"]:focus-visible + .sip-check-ui {
  outline: 2px solid var(--purple-500);
  outline-offset: 2px;
}

/* Dim inflation slider when checkbox is unchecked */
.sip-inflation-block:not(.inflation-enabled) .sip-range-wrap,
.sip-inflation-block:not(.inflation-enabled) .sip-input-box {
  opacity: 0.65;
}

.sip-inflation-hint {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.sip-inflation-block.inflation-enabled .sip-inflation-hint {
  color: var(--sip-accent);
  font-weight: 600;
}

/* ── 5. Output Summary Rows (Invested Amount, Est. Returns, Total Value) ── */
.sip-output-summary {
  margin-top: 12px;
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sip-output-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}

.sip-output-label {
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.35;
  flex: 1 1 auto;
  min-width: 0;
}

.sip-output-val {
  font-family: var(--font-heading);
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  flex-shrink: 0;
  white-space: nowrap;
  text-align: right;
  margin-left: auto;
}

.sip-output-row-total {
  padding-top: 6px;
}

.sip-total-highlight {
  font-size: 1.22rem;
  font-weight: 800;
  color: var(--sip-accent);
}

.sip-val-negative {
  color: #ef4444;
}

.sip-output-row-inflation-total {
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.hidden-row,
.hidden-col {
  display: none !important;
}

/* ── Right Column: Legend, Doughnut Chart & CTA ── */
.sip-chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 28px;
  padding-top: 8px;
  min-width: 0;
  max-width: 100%;
}

.sip-chart-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  width: 100%;
}

.sip-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sip-legend-chip {
  width: 20px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
  flex-shrink: 0;
}

.chip-invested {
  background: var(--sip-chart-invested);
  border: 1px solid rgba(124, 58, 237, 0.25);
}

.chip-returns {
  background: var(--sip-chart-returns);
}

.sip-legend-text {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Doughnut Chart Container */
.sip-doughnut-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 220px;
  height: 220px;
  margin: 0 auto;
  flex-shrink: 0;
}

.sip-doughnut-svg {
  width: 220px;
  height: 220px;
  display: block;
  flex-shrink: 0;
}

/* Bottom Action Buttons (Matrix Runway Purple Theme) */
.sip-cta-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  width: 100%;
}

.sip-invest-btn {
  background: var(--gradient-primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm, 8px);
  padding: 13px 26px;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-sm);
}

@media (hover: hover) {
  .sip-invest-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }
}

.sip-reset-btn {
  background: var(--bg-primary);
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm, 8px);
  padding: 12px 18px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

@media (hover: hover) {
  .sip-reset-btn:hover {
    border-color: var(--purple-500);
    color: var(--sip-accent);
  }
}

/* ── Yearly Breakdown Schedule Section ── */
.sip-schedule-section {
  margin-top: 44px;
  padding-top: 32px;
  border-top: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sip-schedule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.sip-schedule-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

.sip-schedule-sub {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 0;
}

.sip-csv-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

@media (hover: hover) {
  .sip-csv-btn:hover {
    border-color: var(--purple-500);
    color: var(--sip-accent);
  }
}

.sip-table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 420px;
  overflow-y: auto;
}

.sip-schedule-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 480px;
}

.sip-schedule-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 13px 16px;
  border-bottom: 1.5px solid var(--border);
  z-index: 1;
}

.sip-schedule-table tbody td {
  padding: 12px 16px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.sip-schedule-table tbody tr:last-child td {
  border-bottom: none;
}

.sip-schedule-table tbody tr:hover {
  background: rgba(124, 58, 237, 0.05);
}

.sip-schedule-table td.td-year {
  font-weight: 700;
  color: var(--text-primary);
}

.sip-schedule-table td.td-returns {
  color: var(--sip-accent);
  font-weight: 600;
}

.sip-schedule-table td.td-total {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
}

/* ── Year-by-Year Interactive Growth Graph Section ── */
.sip-graph-section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 100%;
}

.sip-graph-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.sip-graph-inflation-label {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--sip-accent-bg);
  border: 1px solid var(--sip-card-border);
  color: var(--sip-accent);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: -4px;
}

.sip-graph-legend {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  width: 100%;
}

.sip-legend-val {
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--text-primary);
  margin-left: 3px;
  font-variant-numeric: tabular-nums;
}

.sip-legend-line {
  display: inline-block;
  width: 22px;
  height: 4px;
  border-radius: 99px;
  flex-shrink: 0;
}

.sip-line-key-invested {
  background: #eab308;
}

.sip-line-key-returns {
  background: #8b5cf6;
}

.sip-line-key-total {
  background: #10b981;
}

.sip-dot-invested {
  background: #eab308;
}

.sip-dot-returns {
  background: #8b5cf6;
}

.sip-dot-total {
  background: #10b981;
}

/* Graph Card & Plot */
.sip-graph-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 18px 16px;
  max-width: 100%;
  overflow: hidden;
}

.sip-graph-body {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 10px;
  height: 260px;
  align-items: stretch;
}

.sip-graph-yaxis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  height: 100%;
  min-height: 0;
  padding-right: 4px;
  font-family: var(--font-heading);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-tertiary);
  user-select: none;
  font-variant-numeric: tabular-nums;
}

.sip-yaxis-label {
  line-height: 1;
  white-space: nowrap;
}

.sip-graph-plot-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  touch-action: pan-y;
  cursor: crosshair;
}

.sip-graph-gridlines {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.sip-grid-line {
  width: 100%;
  border-bottom: 1px dashed var(--border);
}

.sip-grid-line:last-child {
  border-bottom: 1.5px solid var(--border);
}

.sip-line-svg {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.sip-svg-area-total {
  fill: url(#sip-total-area-grad);
  pointer-events: none;
}

.sip-svg-area-invested {
  fill: url(#sip-invested-area-grad);
  pointer-events: none;
}

.sip-svg-line-invested {
  fill: none;
  stroke: #eab308;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sip-svg-line-total {
  fill: none;
  stroke: #10b981;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sip-svg-hover-vline {
  stroke: var(--text-tertiary);
  stroke-width: 1.4;
  stroke-dasharray: 4 4;
  opacity: 0.65;
  pointer-events: none;
}

.sip-svg-hover-vline.hidden-dot,
.sip-active-dots-group.hidden-dot {
  opacity: 0;
}

.sip-year-dot {
  fill: var(--bg-secondary);
  stroke-width: 2;
  pointer-events: none;
}

.sip-year-dot-invested {
  stroke: #eab308;
}

.sip-year-dot-total {
  stroke: #10b981;
}

.sip-active-dot {
  stroke: var(--bg-secondary);
  stroke-width: 2.5;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.sip-active-dot-invested {
  fill: #eab308;
}

.sip-active-dot-total {
  fill: #10b981;
}

/* Compact Hover Card */
.sip-graph-tooltip {
  position: absolute;
  top: 8px;
  left: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  font-size: 0.76rem;
}

.sip-graph-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
}

.sip-tooltip-head {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-primary);
  padding-bottom: 3px;
  margin-bottom: 1px;
  border-bottom: 1px solid var(--border);
}

.sip-tooltip-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

.sip-tooltip-item strong {
  margin-left: auto;
  padding-left: 8px;
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.sip-tooltip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* X-Axis Labels Row */
.sip-graph-xaxis-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.sip-graph-xaxis {
  position: relative;
  width: 100%;
  height: 18px;
  min-width: 0;
}

.sip-xaxis-tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  text-align: center;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-tertiary);
  white-space: nowrap;
  user-select: none;
}

/* ── Mobile & Tablet Responsive Overrides ── */
@media (max-width: 1024px) {
  .sip-calculator-card {
    padding: 28px 24px 32px;
  }

  .sip-workspace-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(230px, 1fr);
    gap: 28px;
  }
}

@media (max-width: 900px) {
  .sip-workspace-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .sip-chart-col {
    border-top: 1px solid var(--border);
    padding-top: 28px;
  }
}

@media (max-width: 768px) {
  .sip-calculator-card {
    padding: 24px 20px !important;
    border-radius: 14px;
  }

  .sip-tabs-row {
    margin-bottom: 24px;
  }

  .sip-controls-col {
    gap: 24px;
  }

  .sip-field-label {
    font-size: 0.94rem;
  }

  .sip-input-box {
    width: 102px;
    min-width: 90px;
    max-width: 112px;
    height: 38px;
  }

  .sip-input-box.sip-input-box-currency {
    width: 148px;
    min-width: 134px;
    max-width: 168px;
  }

  .sip-number-input {
    font-size: 1rem;
  }

  .sip-graph-body {
    height: 230px;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 8px;
  }

  .sip-graph-xaxis-row {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .sip-calculator-card {
    padding: 18px 16px !important;
  }

  .sip-label-row {
    gap: 8px;
  }

  .sip-field-label {
    font-size: 0.88rem;
  }

  .sip-input-box {
    width: 92px;
    min-width: 84px;
    max-width: 102px;
    height: 36px;
  }

  .sip-input-box.sip-input-box-currency {
    width: 136px;
    min-width: 124px;
    max-width: 152px;
  }

  .sip-number-input {
    font-size: 0.95rem;
  }

  .sip-inflation-block {
    padding: 14px 12px;
  }

  .sip-output-label {
    font-size: 0.88rem;
  }

  .sip-output-val {
    font-size: 1rem;
  }

  .sip-total-highlight {
    font-size: 1.08rem;
  }

  .sip-doughnut-container,
  .sip-doughnut-svg {
    width: 190px;
    height: 190px;
  }

  .sip-cta-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .sip-invest-btn,
  .sip-reset-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .sip-graph-card {
    padding: 16px 10px 12px;
  }

  .sip-graph-body {
    height: 200px;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 6px;
  }

  .sip-graph-xaxis-row {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 6px;
  }

  .sip-graph-yaxis {
    font-size: 0.66rem;
  }

  .sip-xaxis-tick {
    font-size: 0.64rem;
  }

  .sip-graph-tooltip {
    padding: 4px 9px;
    font-size: 0.72rem;
    gap: 5px;
  }
}
