/* ===== PaacTools — Modern Fintech Design System ===== */

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

:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --primary-gradient: linear-gradient(135deg, #6366f1, #818cf8);
  --secondary: #10b981;
  --secondary-light: #34d399;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 50px;
  --amber-bg: #fffbeb;
  --amber-border: #fde68a;
  --amber-text: #92400e;
  --green-bg: #ecfdf5;
  --green-text: #065f46;
  --red-bg: #fef2f2;
  --red-text: #991b1b;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; display: block; }

h1, h2, h3, h4 { color: var(--text); line-height: 1.3; font-weight: 700; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}
.logo span { color: var(--primary); }
.logo:hover { color: var(--text); }

.main-nav { display: flex; gap: 8px; }
.main-nav a {
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.main-nav a:hover { background: var(--border-light); color: var(--text); }
.main-nav a.active { background: var(--primary); color: #fff; }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
  padding: 8px;
  z-index: 1001;
  line-height: 1;
}

/* Mobile Nav Overlay */
@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .main-nav {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #ffffff;
    flex-direction: column;
    padding: 0;
    margin: 0;
    z-index: 1000;
    overflow: hidden;
  }
  .main-nav.open { display: flex !important; }
  .main-nav a {
    font-size: 1.2rem !important;
    padding: 20px 28px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    border-bottom: 1px solid #e2e8f0 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    width: 100% !important;
    text-align: left !important;
    display: block !important;
    text-decoration: none !important;
  }
  .main-nav a:first-child {
    padding-top: 80px !important;
  }
  .main-nav a:hover, .main-nav a.active {
    background: #f1f5f9 !important;
    color: #6366f1 !important;
  }
}

/* --- Search --- */
.search-wrap { position: relative; max-width: 480px; margin: 0 auto; }

#tool-search {
  width: 100%;
  padding: 14px 24px 14px 48px;
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: all 0.2s;
}
#tool-search:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}
#tool-search::placeholder { color: var(--text-muted); }

.search-icon {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 1.1rem; pointer-events: none;
}

#search-results {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  z-index: 50;
}
#search-results.active { display: block; }
#search-results a {
  display: flex; flex-direction: column;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
}
#search-results a:last-child { border-bottom: none; }
#search-results a:hover { background: var(--border-light); }
.sr-cat { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.sr-name { font-size: 0.95rem; font-weight: 500; color: var(--text); margin-top: 2px; }
.no-results { padding: 16px 20px; color: var(--text-muted); text-align: center; font-size: 0.9rem; }

/* --- Hero --- */
.hero { text-align: center; padding: 24px 20px 18px; }
.hero h1 {
  font-size: 1.4rem; font-weight: 800; margin-bottom: 4px;
  background: var(--primary-gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p { color: var(--text-secondary); font-size: 0.88rem; margin-bottom: 16px; line-height: 1.4; }

@media (min-width: 768px) {
  .hero { padding: 32px 20px 20px; }
  .hero h1 { font-size: 1.8rem; }
  .hero p { font-size: 0.95rem; }
}

/* --- Feature Cards (Home) — bubble buttons --- */
.feature-cards {
  display: grid; grid-template-columns: 1fr;
  gap: 14px; max-width: 680px; margin: 0 auto 36px; padding: 0 20px;
}
@media (min-width: 640px) { .feature-cards { grid-template-columns: 1fr 1fr; } }

.feature-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 6px;
  background: var(--primary-gradient); color: #fff;
  border-radius: var(--radius-xl); padding: 28px 24px;
  box-shadow: 0 4px 16px rgba(99,102,241,0.25);
  border: none; transition: all 0.25s; cursor: pointer;
  text-decoration: none;
}
.feature-card:hover {
  transform: translateY(-3px); box-shadow: 0 8px 28px rgba(99,102,241,0.35);
  color: #fff;
}
.feature-card.budget-card {
  background: linear-gradient(135deg, #10b981, #34d399);
  box-shadow: 0 4px 16px rgba(16,185,129,0.25);
}
.feature-card.budget-card:hover {
  box-shadow: 0 8px 28px rgba(16,185,129,0.35);
}

.feature-icon { display: none; }
.feature-text h3 { font-size: 1.15rem; margin-bottom: 2px; color: #fff; }
.feature-text p { font-size: 0.82rem; color: rgba(255,255,255,0.85); margin: 0; }
.feature-arrow { display: none; }

/* --- Popular Tools — full-width bubbly cards --- */
.popular-section { max-width: 680px; margin: 0 auto 48px; padding: 0 20px; }
.popular-section h2 { font-size: 1.1rem; margin-bottom: 16px; color: var(--text-secondary); font-weight: 600; }
.popular-pills { display: flex; flex-direction: column; gap: 10px; }
.popular-pill {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 16px 20px; background: var(--card);
  border: 1px solid var(--border); border-radius: 16px;
  font-size: 0.92rem; font-weight: 500; color: var(--text);
  transition: all 0.2s; text-decoration: none;
}
.popular-pill:hover {
  border-color: var(--primary-light); background: #f5f3ff;
  color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-sm);
}
.popular-pill .pill-icon { font-size: 1.3rem; flex-shrink: 0; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: var(--border-light); border-radius: 12px; }
.popular-pill .pill-name { font-weight: 600; font-size: 0.95rem; }
.popular-pill .pill-desc { color: var(--text-secondary); font-size: 0.82rem; font-weight: 400; }
@media (max-width: 639px) {
  .popular-pill .pill-desc { display: none; }
  .popular-pill { padding: 14px 16px; }
}

/* --- Page Header --- */
.page-header { padding: 40px 20px 24px; text-align: center; }
.page-header h1 { margin-bottom: 8px; }
.page-header p { color: var(--text-secondary); max-width: 560px; margin: 0 auto; }

/* --- Breadcrumb --- */
.breadcrumb { padding: 16px 0 0; font-size: 0.82rem; color: var(--text-muted); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { margin: 0 6px; }

/* --- Disclaimer Banner --- */
.disclaimer-banner {
  background: var(--amber-bg); border: 1px solid var(--amber-border);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 24px;
  font-size: 0.82rem; color: var(--amber-text); line-height: 1.5;
}

/* --- Accordion --- */
.category-accordion { margin-bottom: 12px; }
.category-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: all 0.2s; user-select: none;
}
.category-header:hover { border-color: var(--primary-light); box-shadow: var(--shadow-sm); }
.cat-icon { font-size: 1.3rem; }
.cat-name { font-weight: 600; font-size: 1rem; flex: 1; }
.cat-count {
  font-size: 0.75rem; font-weight: 600;
  background: var(--border-light); color: var(--text-secondary);
  padding: 3px 10px; border-radius: var(--radius-pill);
}
.cat-chevron { font-size: 0.8rem; color: var(--text-muted); transition: transform 0.3s; }
.category-header.collapsed .cat-chevron { transform: rotate(-90deg); }

.category-body {
  padding: 14px 0 8px;
  display: flex; flex-wrap: wrap; gap: 10px;
  overflow: hidden; transition: all 0.3s ease;
}
.category-body.hidden { display: none; }

.calc-card {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  font-size: 0.88rem; font-weight: 500; color: var(--text);
  transition: all 0.2s; text-decoration: none;
}
.calc-card:hover {
  transform: translateY(-1px); box-shadow: var(--shadow-sm);
  border-color: var(--primary-light); background: #f5f3ff; color: var(--primary);
}
.calc-card h4 { font-size: 0.88rem; font-weight: 500; margin: 0; color: inherit; white-space: nowrap; }
.calc-card:hover h4 { color: var(--primary); }
.calc-card p { display: none; }

/* --- Calculator Page Layout --- */
.calc-layout {
  display: grid; grid-template-columns: 1fr; gap: 24px;
  max-width: 1120px; margin: 0 auto; padding: 0 20px 48px;
}
@media (min-width: 1024px) { .calc-layout { grid-template-columns: 1fr 300px; } }
.calc-main { min-width: 0; }
.calc-card-container {
  background: var(--card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 32px;
  border: 1px solid var(--border-light);
}
.calc-card-container h1 { margin-bottom: 8px; }
.calc-card-container .calc-desc { color: var(--text-secondary); margin-bottom: 24px; font-size: 0.95rem; }

/* --- Sidebar --- */
.calc-sidebar { display: none; }
@media (min-width: 1024px) { .calc-sidebar { display: block; } }
.sidebar-card {
  background: var(--card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 24px;
  border: 1px solid var(--border-light); position: sticky; top: 80px;
}
.sidebar-card h3 { font-size: 0.95rem; margin-bottom: 16px; color: var(--text-secondary); }
.sidebar-card a {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 0.88rem; color: var(--text); font-weight: 500;
  transition: all 0.15s; margin-bottom: 4px;
}
.sidebar-card a:hover { background: var(--border-light); color: var(--primary); }
.sidebar-card .ri { font-size: 1rem; }

/* --- Form Elements --- */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 0.85rem; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 6px;
}
.form-row { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }
.form-row-3 { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .form-row-3 { grid-template-columns: 1fr 1fr 1fr; } }

input[type="number"], input[type="text"], select {
  width: 100%; padding: 12px 16px;
  border: 2px solid var(--border); border-radius: 12px;
  font-size: 16px; font-family: inherit; color: var(--text);
  background: var(--card); outline: none; transition: all 0.2s;
  -webkit-appearance: none; appearance: none;
}
input:focus, select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.input-group { position: relative; }
.input-prefix, .input-suffix {
  position: absolute; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 0.9rem; font-weight: 500; pointer-events: none;
}
.input-prefix { left: 14px; }
.input-suffix { right: 14px; }
.input-group input.has-prefix { padding-left: 28px; }
.input-group input.has-suffix { padding-right: 40px; }

/* --- Buttons --- */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 32px;
  background: var(--primary-gradient); color: #fff; border: none;
  border-radius: var(--radius-pill); font-size: 1rem; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(99,102,241,0.4); }
.btn-primary:active { transform: scale(0.98); }
@media (min-width: 640px) { .btn-primary { width: auto; min-width: 200px; } }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; background: var(--card); color: var(--text);
  border: 2px solid var(--border); border-radius: var(--radius-pill);
  font-size: 0.9rem; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all 0.2s;
}
.btn-secondary:hover { border-color: var(--primary-light); color: var(--primary); background: #f5f3ff; }
.btn-secondary:active { transform: scale(0.98); }

.btn-sm { padding: 8px 16px; font-size: 0.82rem; border-radius: var(--radius-pill); }

/* --- Results Section --- */
.results-section { margin-top: 28px; padding-top: 28px; border-top: 2px solid var(--border-light); }
.result-highlight {
  text-align: center; padding: 24px;
  background: linear-gradient(135deg, #ede9fe, #e0e7ff);
  border-radius: var(--radius-lg); margin-bottom: 24px;
}
.result-highlight .label {
  font-size: 0.82rem; font-weight: 600; color: var(--primary-dark);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px;
}
.result-highlight .value { font-size: 2rem; font-weight: 800; color: var(--primary-dark); }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.result-item {
  padding: 14px 16px; background: var(--bg);
  border-radius: var(--radius); border: 1px solid var(--border-light);
}
.result-item .label { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; margin-bottom: 2px; }
.result-item .value { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.result-row {
  display: flex; justify-content: space-between; padding: 10px 0;
  border-bottom: 1px solid var(--border-light); font-size: 0.9rem;
}
.result-row:last-child { border-bottom: none; }
.result-row .label { color: var(--text-secondary); }
.result-row .value { font-weight: 600; }

/* --- Charts --- */
.chart-container { max-width: 360px; margin: 24px auto; }
.chart-container-wide { max-width: 100%; margin: 24px 0; }

/* --- Tables --- */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin: 16px 0; }
.data-table th {
  background: var(--bg); font-weight: 600; color: var(--text-secondary);
  text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--border);
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.3px;
}
.data-table td { padding: 8px 12px; border-bottom: 1px solid var(--border-light); color: var(--text); }
.data-table tbody tr:hover { background: var(--border-light); }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }

/* --- Related Tools --- */
.related-tools { margin-top: 32px; }
.related-tools h3 { font-size: 1rem; margin-bottom: 14px; color: var(--text-secondary); }
.related-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.related-card {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  font-size: 0.88rem; font-weight: 500; color: var(--text); transition: all 0.2s;
}
.related-card:hover {
  border-color: var(--primary-light); background: #f5f3ff;
  color: var(--primary); transform: translateY(-1px);
}
.related-card .ri { font-style: normal; }

/* --- Rate Panel (Mortgage) --- */
.rate-panel {
  background: var(--card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 28px;
  border: 1px solid var(--border-light); margin-bottom: 24px;
}
.rate-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 20px;
}
.rate-panel-header h2 { font-size: 1.15rem; margin: 0; }
.rate-badge {
  font-size: 0.72rem; font-weight: 600;
  background: var(--border-light); color: var(--text-secondary);
  padding: 4px 12px; border-radius: var(--radius-pill);
}
.rate-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 16px; }
.rate-table {
  width: 100%; border-collapse: collapse; font-size: 0.85rem;
}
.rate-table thead th {
  background: var(--bg); color: var(--text-secondary);
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.4px; padding: 10px 12px; text-align: left;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.rate-table tbody td {
  padding: 12px; border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.rate-table tbody tr:last-child td { border-bottom: none; }
.rate-table tbody tr:hover { background: var(--border-light); }
.rate-row-featured { background: linear-gradient(135deg, #f5f3ff, #ede9fe); }
.rate-row-featured:hover { background: #ede9fe !important; }
.rate-val { font-weight: 700; font-size: 1rem; color: var(--primary-dark); white-space: nowrap; }
.rate-note { font-size: 0.72rem; color: var(--text-muted); font-weight: 400; }
@media (max-width: 480px) {
  .rate-table { font-size: 0.78rem; }
  .rate-table thead th { padding: 8px 8px; font-size: 0.7rem; }
  .rate-table tbody td { padding: 10px 8px; }
  .rate-val { font-size: 0.9rem; }
}
.rate-source { font-size: 0.75rem; color: var(--text-muted); text-align: center; }
.rate-source a { color: var(--text-muted); text-decoration: underline; }
.rate-source a:hover { color: var(--primary); }

/* --- Budget Tool --- */
.budget-section {
  background: var(--card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px;
  border: 1px solid var(--border-light);
}
.budget-section h2 { font-size: 1.05rem; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.budget-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.budget-row input[type="text"] { flex: 2; min-width: 0; font-size: 0.85rem; padding: 10px 10px; }
.budget-row input[type="number"] { flex: 1; min-width: 0; max-width: 90px; font-size: 0.85rem; padding: 10px 8px; text-align: right; }
@media (max-width: 480px) {
  .budget-row input[type="text"] { flex: 3; font-size: 0.82rem; padding: 10px 8px; }
  .budget-row input[type="number"] { max-width: 75px; font-size: 0.82rem; padding: 10px 6px; }
}
.budget-row .remove-row {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.2rem; cursor: pointer; padding: 4px 8px;
  border-radius: 8px; transition: all 0.15s; flex-shrink: 0;
}
.budget-row .remove-row:hover { background: var(--red-bg); color: var(--red-text); }
.add-row-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 16px; background: var(--border-light);
  border: 1px dashed var(--border); border-radius: var(--radius-pill);
  font-size: 0.82rem; font-weight: 500; color: var(--text-secondary);
  cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.add-row-btn:hover { border-color: var(--primary-light); color: var(--primary); background: #f5f3ff; }
.budget-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
@media (min-width: 640px) { .budget-summary { grid-template-columns: 1fr 1fr 1fr 1fr; } }
.summary-card {
  padding: 16px; background: var(--bg); border-radius: var(--radius);
  text-align: center; border: 1px solid var(--border-light);
}
.summary-card .label {
  font-size: 0.75rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 4px;
}
.summary-card .value { font-size: 1.15rem; font-weight: 700; }
.budget-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* --- Budget View Toggle --- */
.budget-toggle {
  display: flex; background: var(--bg); border-radius: var(--radius-pill);
  padding: 4px; margin-bottom: 24px; border: 1px solid var(--border);
  max-width: 360px;
}
.budget-toggle button {
  flex: 1; padding: 10px 16px; border: none;
  border-radius: var(--radius-pill); background: transparent;
  font-family: inherit; font-size: 0.88rem; font-weight: 600;
  cursor: pointer; color: var(--text-secondary); transition: all 0.2s;
}
.budget-toggle button.active { background: var(--card); color: var(--primary); box-shadow: var(--shadow-sm); }

/* --- Annual Budget Table --- */
.annual-section {
  background: var(--card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px;
  border: 1px solid var(--border-light);
}
.annual-section h2 { font-size: 1.05rem; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.annual-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); border: 1px solid var(--border); }
.annual-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; min-width: 900px; }
.annual-table th {
  background: var(--bg); font-weight: 600; color: var(--text-secondary);
  text-align: right; padding: 8px 10px; border-bottom: 2px solid var(--border);
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.3px;
  position: sticky; top: 0;
}
.annual-table th:first-child { text-align: left; min-width: 160px; position: sticky; left: 0; background: var(--bg); z-index: 2; }
.annual-table td { padding: 6px 4px; border-bottom: 1px solid var(--border-light); text-align: right; }
.annual-table td:first-child { text-align: left; font-weight: 500; font-size: 0.82rem; color: var(--text); position: sticky; left: 0; background: var(--card); z-index: 1; padding-left: 10px; }
.annual-table td:last-child { font-weight: 700; background: var(--border-light); }
.annual-table input[type="number"] {
  width: 72px; padding: 5px 6px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 0.8rem; font-family: inherit;
  text-align: right; background: var(--card); color: var(--text);
}
.annual-table input[type="number"]:focus { border-color: var(--primary-light); outline: none; }
.annual-table .cat-header-row td { background: var(--bg); font-weight: 700; font-size: 0.85rem; color: var(--text); border-bottom: 2px solid var(--border); }
.annual-table .total-row td { font-weight: 700; border-top: 2px solid var(--border); background: var(--border-light); }

/* --- Comparison Layout --- */
.comparison-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 20px 0; }
@media (min-width: 640px) { .comparison-grid { grid-template-columns: 1fr 1fr; } }
.comparison-col { padding: 20px; border-radius: var(--radius); border: 2px solid var(--border); }
.comparison-col.winner { border-color: var(--secondary); background: var(--green-bg); }
.comparison-col h3 { font-size: 1rem; margin-bottom: 12px; }

/* --- Verdict/Recommendation --- */
.verdict-box {
  padding: 20px; border-radius: var(--radius); margin: 20px 0;
  text-align: center; font-weight: 600; font-size: 1.05rem;
}
.verdict-box.positive { background: var(--green-bg); color: var(--green-text); border: 1px solid #a7f3d0; }
.verdict-box.negative { background: var(--red-bg); color: var(--red-text); border: 1px solid #fecaca; }
.verdict-box.neutral { background: var(--amber-bg); color: var(--amber-text); border: 1px solid var(--amber-border); }

/* --- Strategy Tabs --- */
.strategy-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.strategy-tabs button {
  flex: 1; padding: 12px; border: 2px solid var(--border);
  border-radius: var(--radius); background: var(--card);
  font-family: inherit; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s; color: var(--text-secondary);
}
.strategy-tabs button.active { border-color: var(--primary); background: #f5f3ff; color: var(--primary); }

/* --- Toggle Button --- */
.toggle-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; background: var(--card);
  border: 2px solid var(--border); border-radius: var(--radius-pill);
  font-family: inherit; font-size: 0.85rem; font-weight: 600;
  color: var(--text-secondary); cursor: pointer; transition: all 0.2s; margin-top: 12px;
}
.toggle-btn:hover { border-color: var(--primary-light); color: var(--primary); }

/* --- DTI Gauge --- */
.dti-gauge {
  position: relative; height: 24px;
  background: linear-gradient(90deg, #10b981, #fbbf24, #ef4444);
  border-radius: var(--radius-pill); margin: 20px 0; overflow: visible;
}
.dti-marker {
  position: absolute; top: -6px; width: 4px; height: 36px;
  background: var(--text); border-radius: 2px; transition: left 0.5s;
}

/* --- Mode Toggle (Cash Flow) --- */
.mode-toggle {
  display: flex; background: var(--bg); border-radius: var(--radius-pill);
  padding: 4px; margin-bottom: 20px; border: 1px solid var(--border);
}
.mode-toggle button {
  flex: 1; padding: 10px 16px; border: none;
  border-radius: var(--radius-pill); background: transparent;
  font-family: inherit; font-size: 0.88rem; font-weight: 600;
  cursor: pointer; color: var(--text-secondary); transition: all 0.2s;
}
.mode-toggle button.active { background: var(--card); color: var(--primary); box-shadow: var(--shadow-sm); }

/* --- Paycheck Toggle --- */
.pay-toggle { display: flex; gap: 8px; margin-bottom: 20px; }
.pay-toggle button {
  padding: 10px 20px; border: 2px solid var(--border);
  border-radius: var(--radius-pill); background: var(--card);
  font-family: inherit; font-size: 0.88rem; font-weight: 600;
  color: var(--text-secondary); cursor: pointer; transition: all 0.2s;
}
.pay-toggle button.active { border-color: var(--primary); background: #f5f3ff; color: var(--primary); }

/* --- Legal Pages --- */
.legal-page { max-width: 800px; margin: 0 auto; padding: 0 20px 48px; }
.legal-card {
  background: var(--card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 32px; margin-bottom: 20px;
  border: 1px solid var(--border-light);
}
.legal-card h2 {
  font-size: 1.1rem; margin-bottom: 12px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}
.legal-card p, .legal-card li { font-size: 0.92rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 12px; }
.legal-card ul { padding-left: 20px; }
.legal-card li { margin-bottom: 6px; }

/* --- About Page --- */
.about-content { max-width: 800px; margin: 0 auto; padding: 0 20px 48px; }
.about-card {
  background: var(--card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 32px; margin-bottom: 20px;
  border: 1px solid var(--border-light);
}
.about-card h2 { font-size: 1.15rem; margin-bottom: 12px; }
.about-card p { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 12px; }

/* --- Footer --- */
.site-footer { background: var(--text); color: #cbd5e1; margin-top: auto; }
.footer-inner {
  max-width: 1120px; margin: 0 auto; padding: 48px 20px 32px;
  display: grid; grid-template-columns: 1fr; gap: 32px;
}
@media (min-width: 640px) { .footer-inner { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-brand h3 { color: #fff; font-size: 1.2rem; margin-bottom: 8px; }
.footer-brand p { font-size: 0.85rem; line-height: 1.6; color: #94a3b8; }
.footer-links h4 { color: #e2e8f0; font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
.footer-links a { display: block; color: #94a3b8; font-size: 0.85rem; margin-bottom: 8px; transition: color 0.15s; }
.footer-links a:hover { color: #fff; }
.footer-disclaimer { max-width: 1120px; margin: 0 auto; padding: 20px; border-top: 1px solid #334155; }
.footer-disclaimer p { font-size: 0.75rem; color: #64748b; line-height: 1.6; }
.footer-bottom {
  max-width: 1120px; margin: 0 auto; padding: 16px 20px 24px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px; font-size: 0.78rem; color: #64748b;
}
.footer-bottom-links { display: flex; gap: 16px; }
.footer-bottom-links a { color: #64748b; font-size: 0.78rem; }
.footer-bottom-links a:hover { color: #cbd5e1; }

/* --- Misc Helpers --- */
#min-prefix, #min-suffix, #min-hint { font-size: 0.82rem; color: var(--text-muted); }
.savings-tip {
  padding: 14px 16px; background: var(--green-bg);
  border: 1px solid #a7f3d0; border-radius: var(--radius);
  font-size: 0.88rem; color: var(--green-text); margin-top: 16px;
}
.debt-entry {
  background: var(--bg); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px; border: 1px solid var(--border-light);
}
.debt-entry .debt-remove {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 1rem; padding: 4px 8px; float: right;
}
.debt-entry .debt-remove:hover { color: var(--red-text); }
.hidden { display: none !important; }
.comparison-box { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0; }
@media (max-width: 639px) { .comparison-box { grid-template-columns: 1fr; } }
.strategy-card { padding: 20px; border-radius: var(--radius); border: 2px solid var(--border); background: var(--card); }
.strategy-card h3 { margin-bottom: 12px; font-size: 1rem; }
.strategy-card .stat { margin-bottom: 8px; }
.strategy-card .stat .label { font-size: 0.82rem; color: var(--text-secondary); }
.strategy-card .stat .value { font-size: 1.1rem; font-weight: 700; }
.info-box {
  padding: 16px; background: #eff6ff; border: 1px solid #bfdbfe;
  border-radius: var(--radius); font-size: 0.88rem; color: #1e40af; margin: 16px 0;
}
.results-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 20px 0; }
@media (min-width: 640px) { .results-grid { grid-template-columns: repeat(3, 1fr); } }
.amort-wrap { margin-top: 20px; }
.detail-body { margin-top: 16px; }
.detail-body .form-row { margin-bottom: 10px; }
.detail-body label { font-size: 0.82rem; color: var(--text-secondary); font-weight: 500; }
.w4-suggestion { padding: 16px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: var(--radius); margin-top: 16px; }
#row-negative {
  padding: 12px 16px; background: var(--red-bg);
  border: 1px solid #fecaca; border-radius: var(--radius);
  margin-top: 12px; font-size: 0.9rem; color: var(--red-text);
}
.graduated-note {
  padding: 12px 16px; background: var(--amber-bg);
  border: 1px solid var(--amber-border); border-radius: var(--radius);
  font-size: 0.85rem; color: var(--amber-text); margin-top: 12px;
}
.cash-to-close { margin-top: 20px; padding-top: 20px; border-top: 2px solid var(--border-light); }
.cash-to-close h3 { margin-bottom: 12px; }
.equity-info { padding: 16px; border-radius: var(--radius); margin-top: 16px; }
.equity-info.positive { background: var(--green-bg); color: var(--green-text); border: 1px solid #a7f3d0; }
.equity-info.negative { background: var(--red-bg); color: var(--red-text); border: 1px solid #fecaca; }

/* --- Utilities --- */
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.text-center { text-align: center; }
.text-sm { font-size: 0.85rem; }
.text-muted { color: var(--text-secondary); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.full-width { width: 100%; }
