/* =============================================
   FINANCIAL CALCULATOR ADVANCE – styles.css
   ============================================= */

/* ── CSS Variables (Light Theme) ── */
:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #818cf8;
  --secondary: #7c3aed;
  --accent: #06b6d4;
  --accent2: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --grad-1: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #06b6d4 100%);
  --grad-2: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --grad-card: linear-gradient(135deg, #f0f0ff 0%, #e8f4fd 100%);

  --bg: #f4f6fb;
  --bg2: #eef0f8;
  --surface: #ffffff;
  --surface2: #f8fafc;
  --border: #e2e8f0;
  --border2: #d1d5db;
  --text: #1e293b;
  --text2: #475569;
  --text3: #94a3b8;
  --text-muted: #64748b;

  --sidebar-w: 265px;
  --topbar-h: 64px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .08);
  --shadow: 0 4px 16px rgba(79, 70, 229, .1);
  --shadow-lg: 0 12px 40px rgba(79, 70, 229, .15);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --transition: all .22s cubic-bezier(.4, 0, .2, 1);
}

/* ── Dark Theme ── */
[data-theme="dark"] {
  --bg: #0f1117;
  --bg2: #161b27;
  --surface: #1e2334;
  --surface2: #252d40;
  --border: #2d3551;
  --border2: #3d4a6b;
  --text: #e8ecf5;
  --text2: #a8b4cf;
  --text3: #5e6e8c;
  --text-muted: #8595b4;
  --grad-card: linear-gradient(135deg, #1e2a44 0%, #1a2540 100%);
  --shadow: 0 4px 16px rgba(0, 0, 0, .35);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 15px;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background .3s, color .3s;
}

/* ══════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════ */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform .3s cubic-bezier(.4, 0, .2, 1), background .3s;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 14px;
  background: var(--grad-1);
  flex-shrink: 0;
}

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

.logo-icon {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, .25);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  backdrop-filter: blur(4px);
  border: 1.5px solid rgba(255, 255, 255, .3);
}

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

.logo-name {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.logo-sub {
  font-size: 10px;
  font-weight: 500;
  color: rgba(255, 255, 255, .75);
  letter-spacing: .5px;
}

.sidebar-close {
  background: rgba(255, 255, 255, .15);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  display: none;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.sidebar-close:hover {
  background: rgba(255, 255, 255, .28);
}

/* Sidebar Search */
.sidebar-search-wrap {
  position: relative;
  padding: 12px 12px 8px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.sidebar-search-wrap .search-icon {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  pointer-events: none;
  margin-top: 2px;
}

.sidebar-search {
  width: 100%;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 8px 10px 8px 32px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: var(--transition);
}

.sidebar-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}

.sidebar-search::placeholder {
  color: var(--text3);
}

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px 80px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text2);
  transition: var(--transition);
  margin-bottom: 1px;
  user-select: none;
}

.nav-item:hover {
  background: var(--bg2);
  color: var(--primary);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(79, 70, 229, .12), rgba(124, 58, 237, .08));
  color: var(--primary);
  font-weight: 600;
}

.nav-item.active .nav-icon {
  filter: none;
}

.nav-icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sections */
.nav-section {
  margin-bottom: 2px;
}

.nav-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .7px;
  cursor: pointer;
  border-radius: 8px;
  transition: var(--transition);
  user-select: none;
}

.nav-section-header:hover {
  color: var(--primary);
}

.chevron {
  transition: transform .2s;
  font-size: 11px;
}

.nav-section-header.collapsed .chevron {
  transform: rotate(-90deg);
}

.nav-section-body {
  overflow: hidden;
  transition: max-height .3s ease;
}

.nav-section-body.collapsed {
  max-height: 0 !important;
}

.nav-sub-header {
  padding: 8px 10px 2px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: .6px;
}

/* Sidebar Overlay (Mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 190;
  backdrop-filter: blur(2px);
}

/* ══════════════════════════════════════════
   MAIN WRAPPER
═══════════════════════════════════════════ */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left .3s;
}

/* ══════════════════════════════════════════
   TOPBAR
═══════════════════════════════════════════ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  box-shadow: var(--shadow-sm);
  transition: background .3s;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text2);
  border-radius: 2px;
  transition: var(--transition);
}

.topbar-title {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Global Search */
.global-search-wrap {
  position: relative;
}

.gsearch-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  pointer-events: none;
}

.global-search {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px 8px 32px;
  font-size: 13px;
  color: var(--text);
  width: 220px;
  outline: none;
  transition: var(--transition);
}

.global-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
  width: 280px;
}

.global-search::placeholder {
  color: var(--text3);
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  max-height: 300px;
  overflow-y: auto;
  display: none;
  z-index: 300;
}

.search-dropdown.visible {
  display: block;
}

.sdrop-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
}

.sdrop-item:hover {
  background: var(--bg2);
  color: var(--primary);
}

.sdrop-item:first-child {
  border-radius: 12px 12px 0 0;
}

.sdrop-item:last-child {
  border-radius: 0 0 12px 12px;
}

/* Currency Select */
.currency-select {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  outline: none;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
}

.currency-select:focus {
  border-color: var(--primary);
}

/* Theme Toggle */
.theme-toggle {
  width: 38px;
  height: 38px;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 18px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  border-color: var(--primary);
  transform: rotate(15deg);
}

/* ══════════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════════ */
.main-content {
  flex: 1;
  padding: 24px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  animation: fadeIn .3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ══════════════════════════════════════════
   DASHBOARD
═══════════════════════════════════════════ */
.dash-hero {
  background: var(--grad-1);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  color: #fff;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.dash-hero::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, .07);
  border-radius: 50%;
}

.dash-hero::after {
  content: '';
  position: absolute;
  bottom: -60px;
  right: 60px;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, .04);
  border-radius: 50%;
}

.dash-hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}

.dash-hero p {
  font-size: 15px;
  opacity: .88;
  max-width: 480px;
  line-height: 1.6;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.hero-badge {
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

/* Stat Cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

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

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad-1);
  border-radius: var(--radius) var(--radius) 0 0;
}

.stat-icon {
  font-size: 26px;
}

.stat-num {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
}

.stat-lbl {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Quick Access Grid */
.section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title span {
  font-size: 20px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.quick-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 14px;
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.quick-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--primary-light);
}

.qc-icon {
  font-size: 30px;
}

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

.qc-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.qc-region {
  font-size: 10px;
  background: var(--bg2);
  border-radius: 12px;
  padding: 2px 8px;
  color: var(--text3);
  font-weight: 600;
}

/* ══════════════════════════════════════════
   CALCULATOR PANELS
═══════════════════════════════════════════ */
.calc-page {
  animation: fadeIn .3s ease;
}

.calc-header {
  background: var(--grad-1);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  color: #fff;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.calc-header-icon {
  font-size: 36px;
}

.calc-header-text h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 700;
}

.calc-header-text p {
  font-size: 13px;
  opacity: .85;
  margin-top: 4px;
}

.calc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.calc-layout.wide {
  grid-template-columns: 1fr;
  max-width: 680px;
}

.calc-layout.triple {
  grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 900px) {

  .calc-layout,
  .calc-layout.triple {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: background .3s, border .3s;
}

.card h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Form Elements */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
  letter-spacing: .3px;
}

.form-control {
  width: 100%;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .1);
  background: var(--surface);
}

select.form-control {
  cursor: pointer;
}

/* Range Slider */
.range-wrap {
  position: relative;
}

.form-control[type=range] {
  -webkit-appearance: none;
  padding: 0;
  height: 6px;
  background: linear-gradient(to right, var(--primary) 0%, var(--border) 0%);
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.form-control[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(79, 70, 229, .4);
  cursor: pointer;
  border: 2px solid #fff;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text3);
  margin-top: 4px;
}

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--grad-1);
  color: #fff;
  width: 100%;
  box-shadow: 0 4px 14px rgba(79, 70, 229, .35);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(79, 70, 229, .5);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}

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

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
}

.btn-success:hover {
  box-shadow: 0 6px 20px rgba(16, 185, 129, .4);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 12.5px;
}

.btn-group {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

/* Toggle Buttons (Old vs New regime) */
.toggle-group {
  display: flex;
  border-radius: 9px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  margin-bottom: 16px;
}

.toggle-btn {
  flex: 1;
  padding: 9px 12px;
  background: var(--bg2);
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}

.toggle-btn.active {
  background: var(--grad-1);
  color: #fff;
  font-weight: 600;
}

/* Result Box */
.result-box {
  background: var(--grad-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.result-box.hidden {
  display: none;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.result-item {
  text-align: center;
}

.result-item .r-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 4px;
}

.result-item .r-val {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
}

.result-item .r-val.success {
  color: var(--success);
}

.result-item .r-val.danger {
  color: var(--danger);
}

.result-item .r-val.warning {
  color: var(--warning);
}

.result-highlight {
  background: var(--grad-1);
  border-radius: 10px;
  padding: 16px 18px;
  color: #fff;
  text-align: center;
  margin-bottom: 14px;
}

.result-highlight .rh-label {
  font-size: 12px;
  opacity: .8;
  font-weight: 500;
}

.result-highlight .rh-val {
  font-family: 'Outfit', sans-serif;
  font-size: 30px;
  font-weight: 800;
  margin-top: 4px;
}

.result-highlight .rh-sub {
  font-size: 12px;
  opacity: .75;
  margin-top: 2px;
}

/* Chart Container */
.chart-wrap {
  position: relative;
  height: 240px;
  margin: 16px 0;
}

/* Amortization Table */
.table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-top: 16px;
  max-height: 320px;
  overflow-y: auto;
}

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

.data-table th {
  background: var(--grad-1);
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  position: sticky;
  top: 0;
}

.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
}

.data-table tr:hover td {
  background: var(--bg2);
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* Info Tags */
.info-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(79, 70, 229, .1);
  color: var(--primary);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 2px;
}

.info-tag.green {
  background: rgba(16, 185, 129, .12);
  color: var(--success);
}

.info-tag.amber {
  background: rgba(245, 158, 11, .12);
  color: var(--warning);
}

.info-tag.red {
  background: rgba(239, 68, 68, .12);
  color: var(--danger);
}

/* Slab Table */
.slab-table {
  width: 100%;
  font-size: 12.5px;
  border-collapse: collapse;
}

.slab-table th {
  background: var(--bg2);
  color: var(--text2);
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
}

.slab-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
}

.slab-table tr.active-slab td {
  background: rgba(79, 70, 229, .08);
  color: var(--primary);
  font-weight: 600;
}

/* Download Button */
.download-btn-wrap {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════
   BOTTOM BAR (Mobile)
═══════════════════════════════════════════ */
.bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 150;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, .1);
  transition: background .3s;
}

.bb-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  padding: 6px 4px;
  transition: var(--transition);
  color: var(--text3);
}

.bb-item:hover,
.bb-item.active {
  color: var(--primary);
}

.bb-icon {
  font-size: 20px;
}

.bb-label {
  font-size: 10px;
  font-weight: 600;
}

/* ══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 768px) {
  :root {
    --sidebar-w: 270px;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 40px rgba(0, 0, 0, .3);
  }

  .sidebar-close {
    display: flex;
  }

  .sidebar-overlay.visible {
    display: block;
  }

  .hamburger {
    display: flex;
  }

  .main-wrapper {
    margin-left: 0;
  }

  .topbar-title {
    font-size: 15px;
  }

  .global-search {
    width: 150px;
  }

  .global-search:focus {
    width: 190px;
  }

  .main-content {
    padding: 16px 14px 80px;
  }

  .bottom-bar {
    display: flex;
  }

  .dash-hero {
    padding: 22px 18px;
  }

  .dash-hero h1 {
    font-size: 20px;
  }

  .calc-header {
    flex-direction: column;
    text-align: center;
    padding: 18px;
  }

  .result-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions .currency-select {
    display: none;
  }
}

/* ══════════════════════════════════════════
   UTILITY
═══════════════════════════════════════════ */
.hidden {
  display: none !important;
}

.mt-2 {
  margin-top: 8px;
}

.mt-3 {
  margin-top: 12px;
}

.mt-4 {
  margin-top: 16px;
}

.mb-2 {
  margin-bottom: 8px;
}

.mb-3 {
  margin-bottom: 12px;
}

.mb-4 {
  margin-bottom: 16px;
}

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

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 12px;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

/* Accordion */
.accordion-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
}

.accordion-header {
  padding: 13px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  background: var(--surface2);
  transition: var(--transition);
  user-select: none;
}

.accordion-header:hover {
  background: var(--bg2);
}

.accordion-header.open {
  color: var(--primary);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
}

.accordion-body-inner {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, .3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

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

/* Tooltip */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  opacity: 0;
  background: #1e293b;
  color: #fff;
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  transition: opacity .2s;
  z-index: 500;
  box-shadow: var(--shadow);
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* Notification toast */
#toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 13.5px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
  z-index: 999;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}

#toast.show {
  opacity: 1;
}

/* NAV ITEM HIDDEN (search filter) */
.nav-item.search-hidden {
  display: none;
}

/* ══════════════════════════════════════════
   PREMIUM COUNTRY → CATEGORY → CALC FLOW
═══════════════════════════════════════════ */

/* ── Flow Page Wrapper ── */
.flow-page {
  animation: fadeIn .35s ease;
}

/* ── Flow Hero ── */
.flow-hero {
  background: var(--grad-1);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  color: #fff;
  margin-bottom: 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.flow-hero::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 250px;
  height: 250px;
  background: rgba(255, 255, 255, .07);
  border-radius: 50%;
}

.flow-hero::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: 30px;
  width: 320px;
  height: 320px;
  background: rgba(255, 255, 255, .04);
  border-radius: 50%;
}

.flow-hero-icon {
  font-size: 52px;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .25));
  position: relative;
  z-index: 1;
}

.flow-hero-title {
  font-family: 'Outfit', sans-serif;
  font-size: 30px;
  font-weight: 800;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.flow-hero-sub {
  font-size: 15px;
  opacity: .88;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

/* Flow Stats Row */
.flow-stats {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-top: 22px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.flow-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 14px;
  padding: 10px 20px;
  backdrop-filter: blur(6px);
  min-width: 80px;
}

.fs-num {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 800;
}

.fs-lbl {
  font-size: 11px;
  opacity: .8;
  font-weight: 500;
  margin-top: 1px;
}

/* ── Country Grid ── */
.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.country-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  min-height: 175px;
  transition: transform .25s cubic-bezier(.4, 0, .2, 1), box-shadow .25s;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .12);
}

.country-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .22);
}

.cc-bg {
  position: absolute;
  inset: 0;
  background: var(--cc-gradient);
  transition: opacity .25s;
}

.country-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .12);
  transition: opacity .25s;
}

.country-card:hover::after {
  opacity: 0;
}

.cc-content {
  position: relative;
  z-index: 2;
  padding: 22px 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
  color: #fff;
}

.cc-flag {
  font-size: 40px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .3));
  margin-bottom: 10px;
  line-height: 1;
}

.cc-name {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 800;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}

.cc-tagline {
  font-size: 12px;
  opacity: .88;
  margin-top: 4px;
  line-height: 1.4;
  flex: 1;
}

.cc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  background: rgba(255, 255, 255, .15);
  border-radius: 10px;
  padding: 6px 12px;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, .2);
}

.cc-count {
  font-size: 12px;
  font-weight: 600;
}

.cc-arrow {
  font-size: 20px;
  font-weight: 700;
  transition: transform .2s;
}

.country-card:hover .cc-arrow {
  transform: translateX(4px);
}

/* ── Country Hero Banner (Step 2 & 3) ── */
.country-hero-banner {
  border-radius: 16px;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

.chb-flag {
  font-size: 48px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .25));
  flex-shrink: 0;
}

.chb-info {
  color: #fff;
}

.chb-name {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 800;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}

.chb-sub {
  font-size: 13px;
  opacity: .85;
  margin-top: 3px;
}

/* ── Flow Choose Label ── */
.flow-choose-label {
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Category Grid ── */
.category-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--grad-1);
  border-radius: 4px 0 0 4px;
  opacity: 0;
  transition: opacity .2s;
}

.category-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow);
  transform: translateX(4px);
}

.category-card:hover::before {
  opacity: 1;
}

.cat-icon-wrap {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(79, 70, 229, .12), rgba(124, 58, 237, .08));
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border: 1px solid rgba(79, 70, 229, .12);
  transition: transform .2s;
}

.category-card:hover .cat-icon-wrap {
  transform: scale(1.1) rotate(-4deg);
}

.cat-info {
  flex: 1;
  min-width: 0;
}

.cat-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.cat-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.4;
}

.cat-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.cat-badge {
  background: var(--grad-1);
  color: #fff;
  border-radius: 20px;
  padding: 3px 11px;
  font-size: 12px;
  font-weight: 700;
  min-width: 28px;
  text-align: center;
}

.cat-arrow {
  font-size: 22px;
  color: var(--text3);
  font-weight: 700;
  transition: transform .2s, color .2s;
}

.category-card:hover .cat-arrow {
  transform: translateX(4px);
  color: var(--primary);
}

/* ── Calc List Grid (Step 3) ── */
.calc-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.calc-list-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 13px;
  padding: 15px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.calc-list-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
  background: linear-gradient(135deg, rgba(79, 70, 229, .04), rgba(124, 58, 237, .03));
}

.clc-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.clc-info {
  flex: 1;
  min-width: 0;
}

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

.clc-region {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
  font-weight: 500;
}

.clc-arrow {
  font-size: 22px;
  color: var(--text3);
  font-weight: 700;
  flex-shrink: 0;
  transition: transform .2s, color .2s;
}

.calc-list-card:hover .clc-arrow {
  transform: translateX(4px);
  color: var(--primary);
}

/* ── Breadcrumb Nav ── */
.breadcrumb-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
}

.bc-item {
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 500;
  border-radius: 6px;
  padding: 2px 6px;
  transition: var(--transition);
}

.bc-item:hover {
  color: var(--primary);
  background: var(--bg2);
}

.bc-item.bc-home {
  font-weight: 600;
}

.bc-item.bc-active {
  color: var(--primary);
  font-weight: 700;
  cursor: default;
}

.bc-item.bc-active:hover {
  background: transparent;
}

.bc-sep {
  color: var(--text3);
  font-weight: 600;
  user-select: none;
}

/* ── Responsive for Flow ── */
@media (max-width: 768px) {
  .country-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .country-card {
    min-height: 145px;
  }

  .cc-flag {
    font-size: 32px;
  }

  .cc-name {
    font-size: 16px;
  }

  .flow-hero {
    padding: 28px 20px;
  }

  .flow-hero-title {
    font-size: 22px;
  }

  .flow-stats {
    gap: 10px;
  }

  .calc-list-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .country-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .country-card {
    min-height: 130px;
  }

  .cc-count {
    display: none;
  }
}
/* ═══════════════════════════════════
   SEO FOOTER — All Calculators List
═══════════════════════════════════ */
.seo-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 3rem 1.5rem 2rem;
  margin-top: 0;
}
.seo-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.seo-footer h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}
.seo-footer > div > p,
.seo-footer .seo-footer-desc {
  color: var(--text2);
  font-size: 0.875rem;
  margin-bottom: 2rem;
  line-height: 1.6;
  max-width: 900px;
}
.seo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.seo-grid section h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin: 1.25rem 0 0.6rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}
.seo-grid section h3:first-child {
  margin-top: 0;
}
.seo-grid ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}
.seo-grid ul li {
  margin: 0;
  padding: 0;
}
.seo-grid ul li a {
  display: block;
  color: var(--text2);
  font-size: 0.80rem;
  text-decoration: none;
  padding: 0.22rem 0;
  transition: color 0.15s;
  line-height: 1.4;
}
.seo-grid ul li a:hover {
  color: var(--primary);
  text-decoration: underline;
}
.seo-footer-desc {
  font-size: 0.82rem !important;
  margin-top: 1rem !important;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text3) !important;
}
@media (max-width: 768px) {
  .seo-grid {
    grid-template-columns: 1fr;
  }
  .seo-footer {
    padding: 2rem 1rem 1.5rem;
  }
}

/* ═══════════════════════════════════════════
   HISTORY BUTTON (topbar)
═══════════════════════════════════════════ */
.history-btn {
  position: relative;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.4rem 0.65rem;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  line-height: 1;
}
.history-btn:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.06);
  box-shadow: 0 4px 14px rgba(79,70,229,0.35);
}
.history-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--bg);
  animation: badge-pop 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes badge-pop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* ═══════════════════════════════════════════
   HISTORY DRAWER PANEL (slides in from right)
═══════════════════════════════════════════ */
.history-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1100;
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.history-overlay.visible {
  display: block;
  opacity: 1;
}
.history-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 360px;
  max-width: 95vw;
  height: 100dvh;
  background: var(--bg);
  border-left: 1px solid var(--border);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.25);
}
.history-panel.open {
  right: 0;
}

/* Header */
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  flex-shrink: 0;
}
.history-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.hh-icon { font-size: 1.25rem; }
.hh-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
}
.history-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.hist-clear-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.hist-clear-btn:hover { background: rgba(255,255,255,0.28); }
.hist-close-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.hist-close-btn:hover { background: rgba(255,255,255,0.3); }

/* Body — scrollable list */
.history-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}
.history-body::-webkit-scrollbar { width: 5px; }
.history-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Group labels */
.hist-group-label {
  padding: 0.6rem 1.2rem 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}

/* Item rows */
.hist-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1.2rem;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  position: relative;
}
.hist-item:hover { background: var(--bg2); }
.hist-item:hover .hi-del { opacity: 1; }

.hi-icon {
  font-size: 1.4rem;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, rgba(79,70,229,0.12), rgba(124,58,237,0.08));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(79,70,229,0.12);
}
.hi-info { flex: 1; min-width: 0; }
.hi-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hi-meta {
  font-size: 0.75rem;
  color: var(--text3);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hi-del {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.hi-del:hover { color: #ef4444; background: rgba(239,68,68,0.1); }

/* Empty state */
.history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60vh;
  text-align: center;
  padding: 2rem;
}
.he-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.he-title { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 0.5rem; }
.he-sub { font-size: 0.85rem; color: var(--text3); line-height: 1.5; }

@media (max-width: 480px) {
  .history-panel { width: 100vw; border-left: none; }
}

/* ═══════════════════════════════════════
   COMPARE TABLES
═══════════════════════════════════════ */
.compare-table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  margin-top: 1rem;
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 600px;
}
.compare-table thead tr {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
}
.compare-table thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}
.compare-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.compare-table tbody tr:hover { background: var(--bg2); }
.compare-table tbody td {
  padding: 0.65rem 1rem;
  color: var(--text);
  vertical-align: middle;
}
.compare-table .best-row { background: rgba(16,185,129,0.07) !important; }
.compare-table .best-row:hover { background: rgba(16,185,129,0.12) !important; }
.best-tag {
  background: rgba(16,185,129,0.15);
  color: #059669;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  border: 1px solid rgba(16,185,129,0.25);
  white-space: nowrap;
}
.bank-logo { font-size: 1rem; margin-right: 0.25rem; }

/* credit score gauge */
.score-gauge-wrap {
  position: relative;
  text-align: center;
  padding: 1rem 0;
}
.score-display {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  margin-top: -0.5rem;
}
.score-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text2);
  margin-top: 0.25rem;
}
.tip-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.84rem;
  color: var(--text2);
  line-height: 1.5;
}
.tip-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 0.1rem; }

/* CSR bar in insurance compare */
.csr-bar { height:4px; background:rgba(0,0,0,.08); border-radius:3px; margin-top:3px }
.csr-fill { height:100%; background:linear-gradient(90deg,#10b981,#059669); border-radius:3px }

/* debt row */
.debt-row { margin-bottom: .75rem; padding: .75rem; background: var(--bg2); border-radius: 12px; border: 1px solid var(--border); }

/* result cards color helpers */
.result-card.danger { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.2); }
.result-card.success { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.2); }

/* ═══════════════════════════════════════════════
   GOOGLE ADSENSE AD UNITS
═══════════════════════════════════════════════ */

/* Shared ad label */
.ad-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text3);
  text-align: center;
  padding: 0.15rem 0;
  opacity: 0.7;
}

/* ── Leaderboard banner below topbar ── */
.ad-bar {
  width: 100%;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0.3rem 0.5rem 0.4rem;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ad-leaderboard-ins {
  width: 100%;
  max-width: 728px;
  min-height: 50px;
}

/* ── In-content rectangle below calculator ── */
.ad-incontent {
  max-width: 800px;
  margin: 0 auto 1.5rem;
  padding: 0.4rem 1rem 0.6rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 90px;
}
.ad-incontent ins {
  width: 100%;
  min-height: 60px;
}

/* ── Mobile sticky anchor ad above bottom-nav ── */
.ad-mobile-anchor {
  display: none; /* shown only on mobile */
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 0.25rem 0.5rem;
  position: fixed;
  bottom: 60px; /* sits just above bottom nav */
  left: 0;
  right: 0;
  z-index: 800;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: 60px;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
}
.ad-mobile-anchor ins {
  width: 100%;
  min-height: 50px;
}

@media (max-width: 768px) {
  .ad-mobile-anchor {
    display: flex;
  }
  /* push main content up so mobile ad doesn't overlap calculator */
  .main-content {
    padding-bottom: 130px !important;
  }
  /* hide leaderboard on small screens (not enough width) */
  .ad-leaderboard-ins {
    min-height: 50px;
  }
}

/* Hide ad bar if AdSense doesn't fill it (avoid blank space) */
.ad-bar:empty,
.ad-incontent:empty {
  display: none;
}
