
/* ============================================================
   BASE & GLOBAL VARIABLES
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }

:root {
  --p1: #002868;       /* Navy */
  --p1d: #00183F;      /* Dark Navy */
  --p8: #BF0A30;       /* Red */
  --p8h: #9B0826;      /* Red Hover */
  --p9: #00875A;       /* Green */
  --p9h: #006B47;      /* Green Hover */
  --white: #FFFFFF;
  --charcoal: #1D1D1F;
  --gray-text: #5F6368;
  --border: #E0E4E8;
  --bg-light: #F7F9FC;
  --amber: #d97706;
  --amber-bg: #fffbeb;
  --amber-border: #fde68a;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,40,104,.08);
}

body { font-family: 'Inter', 'Segoe UI', sans-serif; font-size: 15px; color: var(--charcoal); background: var(--bg-light); line-height: 1.5; }
input, select, button, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ============================================================
   LAYOUT
   ============================================================ */
.calc-wrap {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px 60px;
}

/* ── TITLE BAR ── */
.calc-title-bar {
  background: linear-gradient(135deg, var(--p1) 0%, var(--p1d) 100%);
  color: var(--white);
  border-radius: 12px 12px 0 0;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  border-bottom: 4px solid var(--p8);
  position: relative;
  overflow: hidden;
}
.calc-title-bar::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -5%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(191,10,48,0.15) 0%, rgba(0,0,0,0) 70%);
  border-radius: 50%;
  pointer-events: none;
}
.calc-title-left {
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 1;
}
.calc-title-icon {
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--white);
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.calc-title-bar h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.5px;
  color: #ffffff !important;
}
.calc-title-bar .badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  z-index: 1;
}
.calc-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #ffffff !important;
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}
.calc-badge i { color: #4ade80; font-size: 11px; }

/* ── BODY / COLUMNS ── */
.calc-body {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.inputs-col {
  padding: 24px;
  border-right: 1px solid #e8eaf0;
  overflow-y: auto;
}
.results-panel {
  background: #f0f4fb;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
}

/* ── MODE TABS ── */
.mode-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
}
.mode-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 7px;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-text);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 180ms ease;
  white-space: nowrap;
}
.mode-tab:hover { color: var(--p1); background: rgba(0,40,104,0.05); }
.mode-tab.active {
  background: var(--p1);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,40,104,0.25);
}
.mode-tab i { font-size: 13px; }

/* ── SECTION TITLES ── */
.section-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--p1);
  margin: 20px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--bg-light);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title:first-child { margin-top: 0; }
.section-title i { color: var(--p9); }

/* ── FORM FIELDS ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid.cols3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid.cols1 { grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--charcoal); }
.field label .hint { font-weight: 400; color: var(--gray-text); font-size: 11px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .prefix,
.input-wrap .suffix { position: absolute; font-size: 13px; font-weight: 600; color: var(--gray-text); pointer-events: none; z-index: 5; }
.input-wrap .prefix { left: 12px; }
.input-wrap .suffix { right: 12px; }
.input-wrap.has-prefix input { padding-left: 26px !important; }
.input-wrap.has-suffix input { padding-right: 28px !important; }

/* Nuclear input overrides */
.inputs-col input[type="text"],
.inputs-col input[type="number"],
.inputs-col input[type="date"],
.inputs-col select {
  width: 100% !important;
  padding: 9px 12px !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 8px !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 13.5px !important;
  color: var(--charcoal) !important;
  background-color: #ffffff !important;
  background-image: none !important;
  transition: all 0.2s !important;
  outline: none !important;
  -webkit-appearance: none !important;
  box-shadow: none !important;
  height: 40px !important;
}
.inputs-col input:focus,
.inputs-col select:focus {
  border-color: var(--p1) !important;
  box-shadow: 0 0 0 3px rgba(0,40,104,.1) !important;
}
.inputs-col select {
  cursor: pointer !important;
  padding-right: 30px !important;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%235F6368'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") no-repeat right 10px center/12px #ffffff !important;
}

/* ── QUICK-ADD BAR ── */
.quick-add-bar {
  position: relative;
  margin-bottom: 12px;
}
.quick-add-wrap {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.quick-add-search {
  flex: 1;
  position: relative;
}
.quick-add-search input {
  width: 100% !important;
  padding: 9px 12px 9px 36px !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 8px !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 13.5px !important;
  color: var(--charcoal) !important;
  background-color: #ffffff !important;
  outline: none !important;
  box-shadow: none !important;
  height: 40px !important;
}
.quick-add-search input:focus {
  border-color: var(--p1) !important;
  box-shadow: 0 0 0 3px rgba(0,40,104,.1) !important;
}
.quick-add-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-text);
  font-size: 13px;
  pointer-events: none;
  z-index: 5;
}
.dropdown-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid var(--p1);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,40,104,0.12);
  z-index: 100;
  max-height: 240px;
  overflow-y: auto;
  display: none;
}
.dropdown-list.open { display: block; }
.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid var(--bg-light);
  transition: background 120ms;
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover { background: var(--bg-light); }
.dropdown-item .svc-name { font-weight: 600; color: var(--charcoal); }
.dropdown-item .svc-meta { display: flex; align-items: center; gap: 8px; }
.dropdown-item .svc-price { font-weight: 700; color: var(--p1); font-size: 12.5px; }
.dropdown-item .svc-cat {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
  background: var(--bg-light);
  color: var(--gray-text);
}
.dropdown-no-results {
  padding: 14px;
  text-align: center;
  color: var(--gray-text);
  font-size: 13px;
}

/* Add Custom button */
.btn-add-custom {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  background: var(--p9);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 180ms;
  height: 40px;
}
.btn-add-custom:hover { background: var(--p9h); }

/* ── SUBSCRIPTION LIST ── */
.sub-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.sub-row {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  position: relative;
  transition: border-color 180ms, box-shadow 180ms;
}
.sub-row:hover { border-color: #c5cdd8; box-shadow: 0 2px 8px rgba(0,40,104,0.06); }
.sub-row.waste-row { border-color: #fca5a5; background: #fff8f8; }
.sub-row-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.sub-row-header .sub-name-input {
  flex: 1;
  font-weight: 700;
  font-size: 14px !important;
  color: var(--charcoal) !important;
  border-color: transparent !important;
  background: transparent !important;
  padding: 2px 4px !important;
  height: auto !important;
  border-radius: 4px !important;
}
.sub-row-header .sub-name-input:focus {
  border-color: var(--p1) !important;
  background: #fff !important;
  box-shadow: none !important;
}
.cat-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 9999px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.cat-Streaming { background: #dbeafe; color: #1e40af; }
.cat-Music { background: #ede9fe; color: #5b21b6; }
.cat-Software { background: #e0f2fe; color: #0369a1; }
.cat-Productivity { background: #d1fae5; color: #065f46; }
.cat-Fitness { background: #fef3c7; color: #92400e; }
.cat-Health { background: #fce7f3; color: #9d174d; }
.cat-News { background: #f3f4f6; color: #374151; }
.cat-Cloud\ Storage, .cat-Cloud-Storage, [class*="cat-Cloud"] { background: #e0f2fe; color: #075985; }
.cat-Business\/SaaS, .cat-Business-SaaS, [class*="cat-Business"] { background: #fef3c7; color: #78350f; }
.cat-Other { background: #f3f4f6; color: #6b7280; }
.btn-del-row {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1.5px solid #fca5a5;
  border-radius: 6px;
  color: var(--p8);
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 160ms;
}
.btn-del-row:hover { background: var(--p8); color: #fff; border-color: var(--p8); }
.sub-row-fields {
  display: grid;
  grid-template-columns: 90px 1fr 1fr 1fr;
  gap: 8px;
  align-items: end;
}
.sub-row-fields .field label { font-size: 11px; font-weight: 600; color: var(--gray-text); margin-bottom: 2px; }
.sub-row-fields input,
.sub-row-fields select {
  width: 100% !important;
  padding: 6px 8px !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 6px !important;
  font-size: 12.5px !important;
  height: 34px !important;
  background-color: #ffffff !important;
  background-image: none !important;
  outline: none !important;
  -webkit-appearance: none !important;
  box-shadow: none !important;
}
.sub-row-fields input:focus,
.sub-row-fields select:focus {
  border-color: var(--p1) !important;
  box-shadow: 0 0 0 2px rgba(0,40,104,.08) !important;
}
.sub-row-fields select {
  cursor: pointer !important;
  padding-right: 22px !important;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%235F6368'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") no-repeat right 7px center/10px #ffffff !important;
}
.sub-row-extra {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: end;
  margin-top: 8px;
}
.sub-row-extra .field label { font-size: 11px; font-weight: 600; color: var(--gray-text); }
.checkbox-field {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 18px;
}
.checkbox-field input[type="checkbox"] {
  width: 15px !important;
  height: 15px !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 3px !important;
  cursor: pointer;
  accent-color: var(--p1);
}
.checkbox-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--charcoal);
  cursor: pointer;
}
.waste-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fee2e2;
  color: var(--p8);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  margin-left: 6px;
}
.sub-empty-state {
  text-align: center;
  padding: 32px 20px;
  color: #9ca3af;
  border: 2px dashed var(--border);
  border-radius: 10px;
  font-size: 13.5px;
}
.sub-empty-state i { font-size: 32px; display: block; margin-bottom: 10px; color: #d1d5db; }

/* Dept field for business mode */
.field-dept { display: none; }
.mode-business .field-dept { display: flex; }
.field-deduct { display: none; }
.mode-freelancer .field-deduct,
.mode-business .field-deduct { display: flex; }

/* ── BUTTONS ── */
.calc-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 180ms ease;
  letter-spacing: 0.01em;
}
.btn-pdf { background: var(--p1); color: #fff; }
.btn-pdf:hover { background: var(--p1d); box-shadow: 0 4px 12px rgba(0,40,104,.2); transform: translateY(-1px); }
.btn-wa { background: var(--p9); color: #fff; }
.btn-wa:hover { background: var(--p9h); box-shadow: 0 4px 12px rgba(0,135,90,.2); transform: translateY(-1px); }
.btn-reset { background: #fff; color: var(--charcoal); border: 1.5px solid #d1d5db; }
.btn-reset:hover { border-color: var(--p8); color: var(--p8); background: #fff7f7; }

/* ── KPI CARDS ── */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  transition: box-shadow 180ms;
}
.kpi:hover { box-shadow: 0 3px 10px rgba(0,40,104,0.08); }
.kpi-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gray-text);
  margin-bottom: 5px;
}
.kpi-val {
  font-size: 24px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  color: var(--p1);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.kpi-val.red { color: var(--p8); }
.kpi-val.green { color: var(--p9); }
.kpi-val.amber { color: var(--amber); }
.kpi-sub { font-size: 11px; color: #9ca3af; margin-top: 4px; }

/* ── RESULTS SECTIONS ── */
.result-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.result-card-header {
  background: var(--p1);
  color: #fff;
  padding: 10px 16px;
  font-family: 'Montserrat', sans-serif;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}
.result-card-header.red { background: var(--p8); }
.result-card-header.green { background: var(--p9); }
.result-card-header.amber { background: var(--amber); }
.result-card-body { padding: 14px 16px; }
.data-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}
.data-row:last-child { border-bottom: none; }
.data-label { color: var(--gray-text); font-weight: 600; }
.data-val { font-weight: 700; color: var(--charcoal); font-variant-numeric: tabular-nums; }
.data-val.green { color: var(--p9); }
.data-val.red { color: var(--p8); }
.data-val.amber { color: var(--amber); }

/* Donut chart */
.donut-wrap {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
}
.donut-chart {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}
.donut-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-name { color: var(--charcoal); font-weight: 600; flex: 1; }
.legend-pct { color: var(--gray-text); font-size: 11px; }
.legend-amt { color: var(--p1); font-weight: 700; font-size: 11px; font-variant-numeric: tabular-nums; }

/* Waste list */
.waste-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--bg-light);
  font-size: 13px;
}
.waste-item:last-child { border-bottom: none; }
.waste-item-name { color: var(--charcoal); font-weight: 600; }
.waste-item-cost { color: var(--p8); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Alert box */
.alert-box {
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 13px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 8px;
}
.alert-box i { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.alert-box.warn { background: #fff7ed; border: 1px solid #fed7aa; color: #92400e; }
.alert-box.warn i { color: var(--amber); }
.alert-box.danger { background: #fff0f2; border: 1px solid #fecdd3; color: #9f1239; }
.alert-box.danger i { color: var(--p8); }
.alert-box.success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #065f46; }
.alert-box.success i { color: var(--p9); }
.alert-box p { font-size: 12.5px; line-height: 1.5; }
.alert-box strong { font-weight: 700; }

/* Investment table */
.inv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px 16px; }
.inv-cell { text-align: center; background: var(--bg-light); border-radius: 8px; padding: 10px 8px; }
.inv-cell .inv-period { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-text); margin-bottom: 4px; }
.inv-cell .inv-val { font-family: 'Montserrat', sans-serif; font-size: 16px; font-weight: 900; color: var(--p9); font-variant-numeric: tabular-nums; }

/* Optimizer items */
.optimizer-item {
  padding: 9px 0;
  border-bottom: 1px solid var(--bg-light);
  font-size: 12.5px;
}
.optimizer-item:last-child { border-bottom: none; }
.optimizer-svc { font-weight: 700; color: var(--charcoal); margin-bottom: 3px; }
.optimizer-detail { color: var(--gray-text); }
.optimizer-save { color: var(--p9); font-weight: 700; }

/* Inflation warning */
.inflation-row { padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13px; display: flex; justify-content: space-between; }
.inflation-row:last-child { border-bottom: none; }

/* Renewal items */
.renewal-item { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--bg-light); font-size: 12.5px; }
.renewal-item:last-child { border-bottom: none; }
.renewal-date { color: var(--p8); font-weight: 700; font-size: 11px; }

/* Results placeholder */
.results-placeholder { text-align: center; padding: 40px 20px; color: #9ca3af; }
.results-placeholder i { font-size: 40px; margin-bottom: 16px; color: #d1d5db; display: block; }
.results-placeholder p { font-size: 13.5px; line-height: 1.6; }
.results-placeholder h3 { font-family: 'Montserrat', sans-serif; font-size: 15px; font-weight: 800; color: #c5cdd8; margin-bottom: 8px; }

/* Action buttons row in results */
.results-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.results-actions .btn { width: 100%; justify-content: center; }

/* Mode-specific visibility */
.tax-field { display: none; }
.mode-freelancer .tax-field,
.mode-business .tax-field { display: flex; }
.employees-field { display: none; }
.mode-business .employees-field { display: flex; }
.business-section { display: none; }
.mode-business .business-section { display: block; }
.freelancer-section { display: none; }
.mode-freelancer .freelancer-section,
.mode-business .freelancer-section { display: block; }

/* ── HOW IT WORKS ── */
.how-section {
  background: #f7f8fa;
  border-top: 3px solid #e8eaf0;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1rem, 4vw, 2rem);
  font-family: 'Inter', 'Segoe UI', sans-serif;
  color: #1a1f2e;
}
.how-container { max-width: 1160px; margin-inline: auto; }
.how-eyebrow {
  display: inline-block;
  background: #e8f4f5;
  color: #00875A;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.3rem 0.9rem;
  border-radius: 9999px;
  border: 1px solid #c3e6cb;
  margin-bottom: 0.85rem;
}
.how-section h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 800;
  color: #002868;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  font-family: 'Montserrat', sans-serif;
}
.how-intro { font-size: 0.95rem; color: #4a5568; max-width: 72ch; line-height: 1.7; margin-bottom: 2rem; }
.how-steps { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 2.5rem; }
.how-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.625rem;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 180ms ease, transform 180ms ease;
}
.how-step:hover { box-shadow: 0 4px 12px rgba(0,40,104,0.08); transform: translateY(-1px); }
.how-step-number {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  background: #002868;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.15rem;
}
.how-step-body h4 { font-size: 0.95rem; font-weight: 700; color: #002868; margin-bottom: 0.25rem; }
.how-step-body p { font-size: 0.875rem; color: #4a5568; line-height: 1.65; }
.how-step-body p strong { color: #002868; font-weight: 700; }
.how-divider { border: none; border-top: 1px solid #e2e8f0; margin: 2.5rem 0; }
.section-subtitle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #002868;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
  font-family: 'Montserrat', sans-serif;
}

/* ── FAQ ── */
.faq-section {
  background: #fff;
  border-top: 3px solid #e8eaf0;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1rem, 4vw, 2rem);
}
.faq-container { max-width: 860px; margin-inline: auto; }
.faq-item {
  border-bottom: 1px solid #e2e8f0;
  padding: 0;
}
.faq-q {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 1.1rem 0;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #002868;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  line-height: 1.4;
}
.faq-q i { color: var(--gray-text); font-size: 13px; flex-shrink: 0; transition: transform 200ms; }
.faq-item.open .faq-q i { transform: rotate(180deg); }
.faq-a {
  display: none;
  padding: 0 0 1.1rem 0;
  font-size: 0.875rem;
  color: #4a5568;
  line-height: 1.75;
}
.faq-item.open .faq-a { display: block; }

/* ── RELATED CALCULATORS ── */
.related-section {
  background: var(--bg-light);
  border-top: 3px solid #e8eaf0;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2rem);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: 1rem;
  max-width: 1160px;
  margin: 1.5rem auto 0;
}
.related-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.125rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 180ms, transform 180ms;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.related-card:hover { box-shadow: 0 6px 18px rgba(0,40,104,0.1); transform: translateY(-2px); }
.related-card .related-label { font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--p9); }
.related-card h4 { font-size: 0.85rem; font-weight: 700; color: var(--p1); line-height: 1.35; }

/* ── DATA SOURCES ── */
.sources-section {
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 2rem clamp(1rem, 4vw, 2rem);
}
.sources-container { max-width: 1160px; margin-inline: auto; }
.sources-title { font-family: 'Montserrat', sans-serif; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-text); margin-bottom: 12px; }
.sources-list { display: flex; flex-wrap: wrap; gap: 8px; }
.source-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 4px 12px;
  font-size: 11.5px;
  color: var(--gray-text);
  font-weight: 600;
}
.source-chip i { font-size: 10px; color: var(--p9); }

/* ── DISCLAIMER ── */
.disclaimer-bar {
  background: var(--amber-bg);
  border-top: 1px solid var(--amber-border);
  padding: 1rem clamp(1rem, 4vw, 2rem);
  font-size: 12px;
  color: #78350f;
  line-height: 1.6;
}
.disclaimer-bar strong { font-weight: 700; }

/* ── MOBILE RESPONSIVE ── */
@media (max-width: 900px) {
  .calc-body { grid-template-columns: 1fr; }
  .results-panel { border-top: 1px solid #e8eaf0; max-height: none; position: static; }
  .sub-row-fields { grid-template-columns: 80px 1fr 1fr; }
  .sub-row-extra { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .calc-wrap { padding: 0 12px 40px; margin: 20px auto; }
  .calc-title-bar { padding: 20px; flex-direction: column; align-items: flex-start; gap: 16px; }
  .calc-title-bar h1 { font-size: 18px; }
  .inputs-col, .results-panel { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr; }
  .mode-tabs { flex-direction: column; }
  .sub-row-fields { grid-template-columns: 1fr 1fr; }
  .sub-row-extra { grid-template-columns: 1fr; }
  .inv-grid { grid-template-columns: 1fr; }
  .quick-add-wrap { flex-direction: column; }
  .btn-add-custom { width: 100%; justify-content: center; }
}
/* ── HOW IT WORKS ── */
.how-section {
  background: #f7f8fa;
  border-top: 3px solid #e8eaf0;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1rem, 4vw, 2rem);
  font-family: 'Inter', 'Segoe UI', sans-serif;
  color: #1a1f2e;
}
.how-container { max-width: 1160px; margin-inline: auto; }
.how-eyebrow {
  display: inline-block;
  background: #e8f4f5;
  color: #00875A;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.3rem 0.9rem;
  border-radius: 9999px;
  border: 1px solid #c3e6cb;
  margin-bottom: 0.85rem;
}
.how-section h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 800;
  color: #002868;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  font-family: 'Montserrat', sans-serif;
}
.how-intro { font-size: 0.95rem; color: #4a5568; max-width: 72ch; line-height: 1.7; margin-bottom: 2rem; }
.how-steps { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 2.5rem; }
.how-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.625rem;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 180ms ease, transform 180ms ease;
}
.how-step:hover { box-shadow: 0 4px 12px rgba(0,40,104,0.08); transform: translateY(-1px); }
.how-step-number {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  background: #002868;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.15rem;
}
.how-step-body h4 { font-size: 0.95rem; font-weight: 700; color: #002868; margin-bottom: 0.25rem; }
.how-step-body p { font-size: 0.875rem; color: #4a5568; line-height: 1.65; }
.how-step-body p strong { color: #002868; font-weight: 700; }
.how-divider { border: none; border-top: 1px solid #e2e8f0; margin: 2.5rem 0; }
.section-subtitle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #002868;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
  font-family: 'Montserrat', sans-serif;
}

/* FAQ Accordion Styles */
.faq-item[open] {
  box-shadow: 0 4px 16px rgba(0,40,104,0.08);
  border-color: #c5cee0;
}
.faq-item[open] > summary .faq-chevron {
  transform: rotate(180deg);
}
.faq-item summary:hover {
  background: #fafbfc;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::marker {
  display: none;
  content: "";
}
.faq-item > div {
  animation: faqSlide 250ms cubic-bezier(.4,0,.2,1);
}
@keyframes faqSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (max-width: 600px) {
  .faq-item summary {
    padding: 0.85rem 0.9rem !important;
    gap: 0.5rem !important;
  }
  .faq-item > div {
    padding-left: 0.9rem !important;
    padding-right: 0.9rem !important;
  }
}
/* ==========================================================
   CATEGORY BREAKDOWN SECTION (MOBILE OPTIMIZED)
   ========================================================== */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columns side-by-side on desktop */
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.cat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.cat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 40, 104, 0.08);
}

.cat-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 20px;
}

.cat-card h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 800;
    color: var(--p1);
    margin-bottom: 12px;
    line-height: 1.3;
}

.cat-card p {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--gray-text);
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1; /* Pushes the tip box to the bottom automatically */
}

.cat-tip {
    background: #f8fafc;
    border-left: 3px solid var(--p9);
    padding: 12px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 12.5px;
    color: var(--charcoal);
    line-height: 1.5;
    border-radius: 0 8px 8px 0;
}

.cat-tip strong {
    color: var(--p1);
    font-weight: 700;
}

/* 📱 MOBILE RESPONSIVENESS */
@media (max-width: 900px) {
    .cat-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on tablets */
    }
}

@media (max-width: 768px) {
    .cat-section {
        margin-top: 32px !important;
        margin-bottom: 32px !important;
    }
    
    .cat-grid {
        grid-template-columns: 1fr; /* Stacks to 1 column on phones */
        gap: 16px;
    }
    
    .cat-header h2 {
        font-size: 22px !important;
    }
    
    .cat-card {
        padding: 20px;
    }
}