:root {
  --bg: #f6f5f0;
  --surface: #ffffff;
  --surface-subtle: #faf9f5;
  --surface-muted: #f0eee7;
  --border: #e5e1d8;
  --border-strong: #d2ccc0;
  --text: #141c2b;
  --text-secondary: #4e5969;
  --text-muted: #7a8596;
  --primary: #0b6e5c;
  --primary-hover: #09594a;
  --primary-soft: #e7f4f0;
  --primary-border: #b8dfd4;
  --accent: #b8294b;
  --accent-soft: #fcecef;
  --gold: #b47311;
  --gold-soft: #fef6e6;
  --gold-border: #f3d9a4;
  --hero-bg: linear-gradient(145deg, #0f1e2e 0%, #132d3b 52%, #0c453e 100%);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px -8px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-hero: 0 18px 40px -14px rgba(10, 33, 44, 0.36);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font-sans: "PingFang HK", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(246, 245, 240, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--hero-bg);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  box-shadow: 0 4px 12px rgba(11, 110, 92, 0.25);
  flex-shrink: 0;
}

.brand-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.brand-sub {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.year-switch {
  display: inline-flex;
  background: var(--surface-muted);
  padding: 3px;
  border-radius: 11px;
  border: 1px solid var(--border);
}

.year-btn {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
}

.year-btn:hover {
  color: var(--text);
}

.year-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.year-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 99px;
  background: var(--primary-soft);
  color: var(--primary);
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 11px;
  border-radius: 99px;
}

.privacy-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
}

/* Main Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}

/* Preset Banner */
.preset-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.preset-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: 4px;
}

.preset-btn {
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.preset-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.preset-btn.ghost {
  background: transparent;
  color: var(--text-muted);
}

.preset-btn.ghost:hover {
  color: var(--accent);
  border-color: #eab7c3;
  background: var(--accent-soft);
}

.year-banner {
  font-size: 12.5px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  padding: 5px 11px;
  border-radius: 8px;
  font-weight: 500;
}

/* Main 2-column Workspace */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(380px, 0.88fr);
  gap: 24px;
  align-items: start;
}

.form-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.result-col {
  position: sticky;
  top: 78px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}

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

.card-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-badge {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-desc {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.card-subtotal {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 4px 10px;
  border-radius: 99px;
  white-space: nowrap;
}

/* Segmented Controls */
.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--surface-muted);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 18px;
}

.segmented.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.seg-btn {
  border: none;
  background: transparent;
  padding: 9px 10px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.16s ease;
  text-align: center;
}

.seg-btn:hover {
  color: var(--text);
}

.seg-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.seg-sub {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 2px;
}

.seg-btn.active .seg-sub {
  color: var(--primary);
  opacity: 0.85;
}

/* Form Fields */
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field-grid.single-col {
  grid-template-columns: 1fr;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.field-cap {
  font-size: 11.5px;
  color: var(--text-muted);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
}

.input {
  width: 100%;
  height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-variant-numeric: tabular-nums;
}

.input.has-prefix {
  padding-left: 48px;
}

.input.has-action {
  padding-right: 92px;
}

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 110, 92, 0.12);
}

.input-action-btn {
  position: absolute;
  right: 6px;
  border: 1px solid var(--primary-border);
  background: var(--primary-soft);
  color: var(--primary);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.input-action-btn:hover {
  background: var(--primary);
  color: #fff;
}

.field-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Quick Income Helper */
.helper-drawer {
  margin-top: 8px;
  padding: 12px 14px;
  background: var(--surface-subtle);
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.helper-drawer.hidden {
  display: none;
}

.inline-link-btn {
  border: none;
  background: none;
  padding: 0;
  color: var(--primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Sub-panel (Spouse section) */
.subpanel {
  margin-top: 16px;
  padding: 16px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.subpanel.hidden {
  display: none;
}

.subpanel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.subpanel-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

/* Toggle Switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.toggle-row.highlight {
  background: var(--gold-soft);
  border-color: var(--gold-border);
}

.toggle-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.toggle-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  background: #cbd2dc;
  border-radius: 99px;
  transition: 0.2s;
}

.slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch input:checked + .slider {
  background: var(--primary);
}

.switch input:checked + .slider::before {
  transform: translateX(18px);
}

/* Stepper rows for allowances */
.stepper-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stepper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.stepper-info {
  min-width: 0;
}

.stepper-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.stepper-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.stepper-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.step-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.14s ease;
}

.step-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.step-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.step-val {
  min-width: 24px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
}

/* Divider / Collapsible */
.section-divider {
  margin: 14px 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.collapsible-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  margin-top: 14px;
}

.collapsible-trigger:hover {
  border-color: var(--primary-border);
  color: var(--primary);
}

.collapsible-body {
  margin-top: 12px;
}

.collapsible-body.hidden {
  display: none;
}

/* Hero Result Card */
.hero-card {
  background: var(--hero-bg);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-hero);
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(25, 195, 157, 0.22) 0%, transparent 70%);
  pointer-events: none;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.hero-eyebrow {
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
}

.hero-method-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e6fff8;
}

.hero-amount {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 4px 0 6px;
}

.hero-monthly {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 18px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.hero-metric-label {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.68);
}

.hero-metric-val {
  font-size: 17px;
  font-weight: 700;
  margin-top: 2px;
}

.hero-rec-box {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.hero-rec-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #7ef2d4;
  margin-bottom: 4px;
}

.hero-rec-desc {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.5;
}

/* Married Comparison Card */
.strategy-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.strategy-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
}

.strategy-item.best {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.strategy-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.best-pill {
  font-size: 11px;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: 99px;
}

.strategy-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.strategy-amount {
  text-align: right;
  flex-shrink: 0;
}

.strategy-tax {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.strategy-item.best .strategy-tax {
  color: var(--primary);
}

.strategy-diff {
  font-size: 11.5px;
  color: var(--accent);
  font-weight: 600;
}

.strategy-item.best .strategy-diff {
  color: var(--primary);
}

/* Breakdown Table & Visual Bar */
.income-bar-wrap {
  margin-bottom: 16px;
}

.income-bar {
  height: 12px;
  border-radius: 99px;
  background: var(--surface-muted);
  overflow: hidden;
  display: flex;
}

.bar-seg {
  height: 100%;
  transition: width 0.25s ease;
}

.bar-deduction { background: #2b8a78; }
.bar-allowance { background: #64b6ac; }
.bar-tax { background: #b8294b; }
.bar-takehome { background: #d6dde6; }

.bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

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

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
}

.breakdown-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13.5px;
}

.b-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}

.b-row.sub {
  padding-left: 14px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.b-row.total {
  border-top: 1px dashed var(--border-strong);
  padding-top: 9px;
  margin-top: 2px;
  font-weight: 700;
}

.b-row.final {
  border-top: 2px solid var(--text);
  padding-top: 10px;
  margin-top: 4px;
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
}

.neg {
  color: var(--primary);
}

/* Tax Band Bars */
.bands-box {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.bands-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
}

.band-row {
  display: grid;
  grid-template-columns: 44px 1fr 90px;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
  font-size: 12px;
}

.band-rate {
  font-weight: 700;
  color: var(--text);
}

.band-track {
  height: 8px;
  background: var(--surface-muted);
  border-radius: 99px;
  overflow: hidden;
}

.band-fill {
  height: 100%;
  background: linear-gradient(90deg, #0b6e5c, #18a387);
  border-radius: 99px;
  transition: width 0.25s ease;
}

.band-amt {
  text-align: right;
  font-weight: 600;
  color: var(--text-secondary);
}

.method-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.method-pill {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
}

.method-pill.chosen {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.method-pill-label {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.method-pill-val {
  font-size: 15px;
  font-weight: 800;
  margin-top: 2px;
}

/* Unit switcher for dual-earner separate details */
.mini-tabs {
  display: inline-flex;
  gap: 4px;
  background: var(--surface-muted);
  padding: 3px;
  border-radius: 9px;
  margin-bottom: 12px;
}

.mini-tab {
  border: none;
  background: transparent;
  padding: 5px 11px;
  border-radius: 7px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.mini-tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Tips & BIR60 Checklist */
.tip-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tip-item {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--primary-border);
  background: var(--primary-soft);
}

.tip-item.warning {
  border-color: var(--gold-border);
  background: var(--gold-soft);
}

.tip-item.info {
  border-color: #cbd8ea;
  background: #f1f6fc;
}

.tip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.tip-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.tip-save {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary);
  background: #fff;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}

.tip-body {
  font-size: 12.2px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.check-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.btn {
  height: 40px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary {
  border: none;
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-outline {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Bottom Reference Section */
.ref-section {
  margin-top: 32px;
}

.ref-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.ref-tab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
}

.ref-tab.active {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

.ref-panel.hidden {
  display: none;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table th,
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.data-table th {
  background: var(--surface-subtle);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

.data-table td.num-col,
.data-table th.num-col {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.highlight-cell {
  color: var(--primary);
  font-weight: 700;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.faq-card {
  padding: 16px 18px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.faq-q {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
}

.faq-a {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}

.footer {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: #fff;
  padding: 10px 18px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s ease;
  z-index: 100;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 1024px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .result-col {
    position: static;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 16px 14px 48px;
  }
  .topbar-inner {
    padding: 10px 14px;
  }
  .card {
    padding: 18px 16px;
  }
  .field-grid,
  .helper-drawer,
  .faq-grid {
    grid-template-columns: 1fr;
  }
  .hero-amount {
    font-size: 32px;
  }
  .segmented.cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media print {
  .topbar,
  .preset-bar,
  .action-row,
  .ref-section,
  .collapsible-trigger,
  .input-action-btn,
  .inline-link-btn {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .hero-card {
    background: #0f1e2e !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
