/* Financial Pro Calculator - design system based on the original Mortgage Calculator page. */
:root {
  --navy-900: #0b1f3a; --blue-700: #12407a; --teal-700: #0a7f7f; --teal-500: #46c5c1; --ink: #1b2430; --slate: #5b6778; --paper: #f7f8fb; --surface: #ffffff;
  --border: #dde3ea; --muted: #eef2f5; --head: #f1f5f7; --shadow: 0 12px 34px rgba(11, 31, 58, 0.07); --good: #2e7d62; --bad: #c0453a; --warn: #8a6420; --focus: #0a7f7f;
  --c1: #3a66d1; --c2: #f2aa4c; --c3: #43b597; --c4: #8e72d8; --c5: #ef7b79; --c6: #0a7f7f; --c7: #b8893a; --c8: #7f8ea3;
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; --display: "Manrope", "DM Sans", system-ui, sans-serif;
  --radius: 12px; color-scheme: light;
}
html.dark {
  --paper: #0e1620; --surface: #162230; --border: #2a3a4c; --muted: #22344a; --head: #1e2d3b; --ink: #e6edf3; --slate: #aebbc8; --navy-900: #e6edf3; --blue-700: #8fb8ee; --teal-700: #4cc3cc;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.25); --good: #5fc79d; --bad: #f08b80; --warn: #e0b35c; --focus: #4cc3cc; --c1: #6f9ef0; --c3: #5fd0b3; color-scheme: dark;
}
.lang-ar, .lang-ar input, .lang-ar button, .lang-ar select, .lang-ar textarea { --font: "Noto Naskh Arabic", "Segoe UI", Tahoma, "DM Sans", sans-serif; --display: "Noto Naskh Arabic", "Segoe UI", Tahoma, sans-serif; }
.lang-ur, .lang-ur input, .lang-ur button, .lang-ur select, .lang-ur textarea { --font: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Urdu Typesetting", "Noto Naskh Arabic", "Segoe UI", sans-serif; --display: "Noto Nastaliq Urdu", "Noto Naskh Arabic", "Segoe UI", sans-serif; }
.lang-ur { line-height: 2; } .lang-ur h1, .lang-ur h2, .lang-ur h3 { line-height: 1.9; letter-spacing: 0 !important; } .lang-ar h1, .lang-ar h2 { letter-spacing: 0 !important; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html.no-scroll { overflow: hidden; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.55; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; } button:disabled { cursor: not-allowed; opacity: .5; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--navy-900); color: var(--surface); padding: 10px 14px; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--slate); } .small { font-size: 12.5px; } .block { display: block; }
h1, h2, h3 { font-family: var(--display); color: var(--navy-900); }
h1 { margin: 0; font-size: clamp(28px, 3vw, 38px); letter-spacing: -1.2px; line-height: 1.15; }
h2 { margin: 0; font-size: 18px; } h3 { font-size: 15px; }
.eyebrow { margin: 0 0 5px; color: var(--slate); font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.lang-ar .eyebrow, .lang-ur .eyebrow { letter-spacing: 0; }

/* ---------- shell ---------- */
.shell { min-height: 100vh; display: grid; grid-template-columns: 72px minmax(0, 1fr); background: var(--paper); }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 18px 10px; background: #0b1f3a; z-index: 20; }
html.dark .rail, html.dark .topbar { background: #121e2b; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; overflow: hidden; }
.rail-nav { margin-top: 48px; display: grid; gap: 10px; }
.rail-item, .theme-toggle { width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 12px; background: transparent; color: #97a9c1; transition: background .18s, color .18s; }
.rail-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.rail-item.active { background: #fff; color: #12407a; box-shadow: 0 8px 20px rgba(0,0,0,.15); }
.theme-toggle { margin-top: auto; color: #dbe6f3; border: 1px solid rgba(255,255,255,.12); }
.theme-toggle .i-sun { display: none; } html.dark .theme-toggle .i-sun { display: block; } html.dark .theme-toggle .i-moon { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
main { flex: 1; outline: none; }
.topbar { position: sticky; top: 0; z-index: 15; height: 72px; display: flex; align-items: center; gap: 28px; padding: 0 38px; border-bottom: 1px solid var(--border); background: var(--surface); }
.wordmark { display: flex; align-items: center; gap: 8px; font-family: "Manrope", sans-serif; color: var(--navy-900); letter-spacing: -0.5px; white-space: nowrap; }
.wordmark-icon { width: 34px; height: 34px; border-radius: 8px; }
.wordmark-copy { display: flex; flex-direction: column; line-height: 1; }
.wordmark-copy strong { font-size: 15px; font-weight: 800; }
.wordmark-copy small { margin-top: 3px; color: var(--slate); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.topnav { display: flex; align-items: center; gap: 22px; margin-inline: 8px auto; overflow: hidden; }
.topnav a { color: var(--slate); font-size: 13.5px; font-weight: 600; white-space: nowrap; padding: 6px 0; border-bottom: 2px solid transparent; }
.topnav a:not(:last-child) { min-width: 0; overflow: hidden; text-overflow: ellipsis; } .topnav a:last-child { flex-shrink: 0; }
.topnav a:hover { color: var(--navy-900); } .topnav a.active { color: var(--blue-700); border-color: var(--teal-700); }
.header-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.icon-button { width: 38px; height: 38px; flex: none; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--slate); display: grid; place-items: center; }
.icon-button:hover { color: var(--teal-700); border-color: var(--teal-700); }
.icon-button .ic { width: 18px; height: 18px; }
.menu-btn { display: none; }
.currency-select, .select { height: 38px; padding: 0 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink); }
.select { width: 100%; height: 44px; border-color: #ccd5df; } html.dark .select { border-color: var(--border); }
.language-select { min-width: 92px; }

/* ---------- breadcrumb / heading ---------- */
.breadcrumb { max-width: 1320px; margin: 0 auto; padding: 18px 38px 0; font-size: 12.5px; color: var(--slate); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "/"; margin-inline-end: 6px; opacity: .6; }
.breadcrumb a:hover { color: var(--teal-700); }
.page-heading { max-width: 1320px; margin: 0 auto; padding: 14px 38px 20px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.lede { margin: 8px 0 0; max-width: 760px; color: var(--slate); }
.meta-line { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; color: var(--slate); font-size: 12px; }
.meta-line span { display: inline-flex; align-items: center; gap: 5px; } .meta-line .ic { width: 14px; height: 14px; color: var(--good); }
.heading-actions { display: flex; gap: 8px; flex: none; }
.save-button, .download-button { height: 42px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--blue-700); padding: 0 14px; font-weight: 700; transition: border-color .18s, transform .18s; }
.save-button:hover { border-color: var(--teal-700); transform: translateY(-1px); }
.save-button .ic { width: 17px; height: 17px; }
.fav-button { width: 42px; padding: 0; justify-content: center; }
.fav-button.active { color: #e0a21a; border-color: #e0a21a; } .fav-button.active .ic { fill: currentColor; }

/* ---------- cards & calculator grid ---------- */
.card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.calculator-grid { max-width: 1320px; margin: 0 auto; padding: 0 38px; display: grid; grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr); gap: 20px; align-items: start; }
.input-card { padding: 22px; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.card-tools { display: flex; align-items: center; gap: 8px; }
.card-currency .currency-select { height: 34px; font-weight: 700; color: var(--teal-700); }
.reset-button { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: var(--teal-700); font-weight: 700; font-size: 13px; padding: 6px; }
.reset-button .ic { width: 15px; height: 15px; }
.field { display: grid; gap: 7px; margin: 0 0 15px; min-width: 0; }
.field > span, .term-field legend { color: var(--slate); font-size: 13px; font-weight: 600; }
.input-shell { height: 44px; display: flex; align-items: center; border: 1px solid #ccd5df; border-radius: 7px; background: var(--surface); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
html.dark .input-shell { border-color: var(--border); background: #13202d; }
.input-shell:focus-within { border-color: var(--teal-700); box-shadow: 0 0 0 3px rgba(10,127,127,.14); }
.input-shell b { padding: 0 12px; color: var(--slate); white-space: nowrap; font-weight: 600; }
.input-shell input { width: 100%; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); padding: 0 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.input-shell b + input { padding-inline-start: 0; }
[dir="rtl"] .input-shell input { direction: ltr; text-align: right; }
.input-shell input::-webkit-inner-spin-button { opacity: .4; }
textarea { width: 100%; border: 1px solid #ccd5df; border-radius: 7px; background: var(--surface); padding: 10px 12px; font-weight: 600; resize: vertical; }
html.dark textarea { border-color: var(--border); background: #13202d; }
.field.invalid .input-shell, .field.invalid textarea { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(192,69,58,.12); }
.err { color: var(--bad); font-size: 12px; min-height: 0; } .err:empty { display: none; }
.split-input { display: grid; grid-template-columns: 1.4fr 0.6fr; gap: 8px; }
.percent-shell input { text-align: end; }
.slider { width: 100%; height: 22px; margin: 0; accent-color: var(--teal-700); background: transparent; cursor: pointer; }
.term-field { border: 0; padding: 0; margin: 2px 0 15px; min-width: 0; }
.term-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 7px; margin-top: 7px; }
.term-option { min-width: 0; overflow-wrap: anywhere; min-height: 42px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--slate); font-weight: 700; font-size: 13px; padding: 6px 8px; line-height: 1.25; transition: all .15s; }
.term-option:hover { border-color: var(--teal-700); color: var(--teal-700); }
.term-option.active { border-color: var(--teal-700); background: var(--teal-700); color: #fff; }
html.dark .term-option.active { background: #4cc3cc; color: #0e1620; border-color: #4cc3cc; }
.extras-toggle { width: 100%; height: 40px; border: 0; border-top: 1px dashed var(--border); display: flex; align-items: center; justify-content: space-between; background: transparent; color: var(--blue-700); font-weight: 700; padding: 0; margin-bottom: 6px; }
.extras-toggle .ic { transition: transform .2s; } .extras-toggle[aria-expanded="true"] .ic { transform: rotate(180deg); }
.extras { display: none; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.extras.open { display: grid; animation: fade .25s ease; }
.extras .term-field { grid-column: 1 / -1; }
.calc-button { width: 100%; height: 46px; margin-top: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 9px; background: var(--teal-700); color: #fff; font-weight: 800; transition: filter .15s, transform .15s; }
html.dark .calc-button { color: #0e1620; }
.calc-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.privacy-note { display: flex; align-items: center; gap: 6px; margin: 14px 0 0; color: var(--slate); font-size: 12px; } .privacy-note .ic { width: 15px; height: 15px; color: var(--good); }

/* ---------- results ---------- */
.result-column { display: grid; align-content: start; gap: 12px; min-width: 0; }
.result-card { overflow: hidden; transition: opacity .2s; }
.result-card.stale { opacity: .55; }
.result-top { text-align: center; padding: 22px 20px 14px; }
.result-top p { margin: 0 0 4px; color: var(--slate); font-size: 13px; font-weight: 600; }
.result-top strong { display: block; color: var(--navy-900); font-family: "Manrope", var(--display); font-size: clamp(30px, 4vw, 44px); letter-spacing: -1.5px; line-height: 1.15; font-variant-numeric: tabular-nums; word-break: break-word; }
.result-top strong.good { color: var(--good); } .result-top strong.bad { color: var(--bad); }
.result-top > span { color: var(--slate); font-size: 12.5px; }
.status { margin: 10px auto 0; max-width: 520px; padding: 8px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; text-align: center; }
.status.good { background: rgba(46,125,98,.1); color: var(--good); } .status.bad { background: rgba(192,69,58,.1); color: var(--bad); }
.status.warn { background: rgba(242,170,76,.16); color: var(--warn); } .status.info { background: var(--muted); color: var(--slate); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--border); border-top: 1px solid var(--muted); }
.tab { height: 44px; border: 0; background: transparent; color: var(--slate); font-weight: 700; position: relative; }
.tab.active { color: var(--blue-700); }
.tab.active::after { content: ""; position: absolute; inset-inline: 14%; bottom: -1px; height: 2px; background: var(--teal-700); }
.result-content { min-height: 250px; display: grid; grid-template-columns: 0.85fr 1.15fr; align-items: center; gap: 12px; padding: 22px 24px; }
.result-content > * { min-width: 0; }
.result-content:has(> .breakdown.wide) { grid-template-columns: 1fr; }
.result-content.table-panel { display: block; padding: 16px 18px; }
.result-content[hidden] { display: none !important; }
.donut-svg { position: relative; width: 190px; max-width: 100%; margin: 0 auto; aspect-ratio: 1; }
.donut-svg svg { width: 100%; height: 100%; }
.donut-svg .seg { transition: stroke-dasharray .6s ease, stroke-dashoffset .6s ease; }
.donut-hole { position: absolute; inset: 17%; padding: 0 4px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.donut-hole strong { color: var(--navy-900); font-family: "Manrope", var(--display); font-size: clamp(12px, 1.35vw, 17px); max-width: 100%; overflow-wrap: anywhere; line-height: 1.1; font-variant-numeric: tabular-nums; }
.donut-hole span { color: var(--slate); font-size: 11px; line-height: 1.2; }
.breakdown h3 { margin: 0 0 10px; font-size: 13px; color: var(--navy-900); }
.breakdown-row { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--muted); font-size: 13px; }
.breakdown-row:last-child { border-bottom: 0; }
.breakdown-row span { display: flex; align-items: center; gap: 8px; color: var(--slate); }
.breakdown-row i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.breakdown-row strong { color: var(--ink); text-align: end; font-variant-numeric: tabular-nums; }
.breakdown-row small { display: block; color: var(--slate); font-weight: 500; font-size: 11px; }
.result-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; border-top: 1px solid var(--muted); background: var(--head); }
.action-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--blue-700); font-size: 12.5px; font-weight: 700; transition: all .15s; }
.action-btn:hover { border-color: var(--teal-700); color: var(--teal-700); transform: translateY(-1px); }
.action-btn .ic { width: 15px; height: 15px; }
.amortization-preview-table { max-height: 320px; overflow: auto; border: 1px solid var(--muted); border-radius: 8px; scrollbar-width: thin; }
.metrics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.metric { min-height: 88px; display: flex; flex-direction: column; justify-content: center; padding: 14px 16px; transition: transform .18s; }
.metric:hover { transform: translateY(-2px); }
.metric span { color: var(--slate); font-size: 12px; line-height: 1.3; }
.metric strong { margin-top: 5px; color: var(--navy-900); font-family: "Manrope", var(--display); font-size: 17px; font-variant-numeric: tabular-nums; word-break: break-word; }
.metric.good strong { color: var(--good); } .metric.bad strong { color: var(--bad); }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { padding: 10px; text-align: end; border-bottom: 1px solid var(--muted); white-space: nowrap; }
th { color: var(--slate); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; position: sticky; top: 0; background: var(--head); z-index: 1; }
.lang-ar th, .lang-ur th { text-transform: none; letter-spacing: 0; font-size: 12px; }
th:first-child, td:first-child { text-align: start; }
tbody tr:hover { background: rgba(10,127,127,.05); }
.schedule-table-wrap { overflow-x: auto; }

/* ---------- detail grid ---------- */
.detail-grid { max-width: 1320px; margin: 20px auto 0; padding: 0 38px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.detail-grid > .card { padding: 22px; min-width: 0; }
.detail-grid > .chart-card[hidden] + .formula-card { grid-column: 1 / -1; }
.chart-card h2, .formula-card h2 { margin-bottom: 12px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 8px; font-size: 12px; color: var(--slate); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; } .chart-legend i { width: 10px; height: 10px; border-radius: 3px; }
.chart-card { overflow: hidden; }
.chart-box { position: relative; direction: ltr; }
.chart-box svg { width: 100%; height: auto; overflow: hidden; }
.chart-box .grid { stroke: var(--muted); stroke-width: 1; } .chart-box .zero { stroke: var(--slate); stroke-width: 1; }
.chart-box .yl { fill: var(--slate); font-size: 11px; text-anchor: end; } .chart-box .xl { fill: var(--slate); font-size: 11px; text-anchor: middle; }
.chart-box .area { opacity: .16; } .chart-box .line { stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw .6s ease-out; }
.chart-box .bar { transform-box: fill-box; transform-origin: bottom; animation: grow .5s ease-out both; animation-delay: calc(var(--i) * 12ms); }
.chart-box .guide { stroke: var(--slate); stroke-dasharray: 3 3; opacity: 0; } .chart-box.hover .guide { opacity: .6; }
.chart-tip { position: absolute; top: 8px; min-width: 150px; padding: 8px 10px; border-radius: 8px; background: var(--navy-900); color: var(--surface); font-size: 12px; pointer-events: none; box-shadow: var(--shadow); z-index: 3; }
html.dark .chart-tip { background: #e6edf3; color: #0e1620; }
.chart-tip strong { display: block; margin-bottom: 3px; } .chart-tip span { display: flex; align-items: center; gap: 6px; } .chart-tip i { width: 8px; height: 8px; border-radius: 2px; }
.formula { padding: 12px 14px; border-radius: 8px; background: var(--head); overflow-x: auto; }
.formula code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 13px; font-weight: 600; color: var(--navy-900); white-space: pre-wrap; }
.formula-legend { margin: 10px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 16px; font-size: 12.5px; color: var(--slate); }
.formula-legend div { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.formula-legend dt { flex: none; min-width: 2.2em; font-family: ui-monospace, Consolas, monospace; font-weight: 700; color: var(--navy-900); }
.formula-legend dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.formula-card h3 { margin: 16px 0 8px; font-size: 13px; color: var(--slate); }
.steps { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; }
.steps code { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; white-space: pre-wrap; word-break: break-word; }
.fx-note { margin: 12px 0 0; }
.fx-note a { color: var(--teal-700); text-decoration: underline; }

/* ---------- saved / content ---------- */
.saved-card, .schedule-card { max-width: 1244px; margin: 20px auto 0; padding: 22px; }
.compare-table td, .compare-table th { white-space: nowrap; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.link-btn { border: 0; background: none; color: var(--teal-700); font-weight: 700; padding: 4px 6px; display: inline-flex; align-items: center; }
.link-btn.danger { color: var(--bad); } .link-btn .ic { width: 16px; height: 16px; }
.calculator-guide { line-height: 1.75; }
.calculator-guide h2 { margin: 26px 0 8px; } .calculator-guide h2:first-of-type { margin-top: 0; }
.calculator-guide p { color: var(--slate); margin: 0 0 12px; }
.example-table { max-width: 620px; } .example-table th { position: static; background: none; text-transform: none; letter-spacing: 0; font-size: 13px; text-align: start; font-weight: 600; white-space: normal; }
.example-table td { text-align: end; font-weight: 700; } .example-result th, .example-result td { color: var(--teal-700); font-size: 15px; }
.faq details { border-bottom: 1px solid var(--muted); padding: 4px 0; }
.faq summary { cursor: pointer; list-style: none; padding: 10px 0; font-weight: 700; color: var(--navy-900); display: flex; justify-content: space-between; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--teal-700); font-size: 18px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq p { margin: 0 0 12px; color: var(--slate); }
.card.pad { padding: 8px 22px; }
.disclaimer-box { display: flex; gap: 10px; align-items: flex-start; margin-top: 24px !important; padding: 12px 14px; border-radius: 8px; background: rgba(242,170,76,.12); color: var(--ink) !important; font-size: 13px; }
.disclaimer-box .ic { color: var(--warn); margin-top: 3px; }
.prose p { color: var(--ink); }

/* ---------- directory / home ---------- */
.directory-hero { width: calc(100% - 76px); max-width: 1244px; margin: 28px auto 0; padding: 52px 38px; border-radius: 16px; background: linear-gradient(135deg, #0b1f3a 0%, #12407a 100%); color: #fff; display: grid; grid-template-columns: 1.6fr 1fr; gap: 30px; align-items: center; }
html.dark .directory-hero { background: linear-gradient(135deg, #0b1f3a 0%, #163b61 100%); }
.directory-hero h1 { color: #fff; font-size: clamp(34px, 5vw, 54px); }
.directory-hero .eyebrow { color: #77d1d0; }
.hero-copy > p:not(.eyebrow) { max-width: 640px; color: #dce7f2; line-height: 1.7; }
.hero-search { display: flex; gap: 8px; max-width: 620px; margin-top: 18px; padding: 6px; border-radius: 12px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); }
.hero-search input { flex: 1; min-width: 0; height: 44px; border: 0; border-radius: 8px; padding: 0 14px; background: #fff; color: #1b2430; font-weight: 600; }
.hero-button { display: inline-flex; height: 44px; align-items: center; gap: 8px; padding: 0 18px; border: 0; border-radius: 8px; background: #46c5c1; color: #0b1f3a; font-weight: 800; white-space: nowrap; }
.hero-button:hover { filter: brightness(1.06); }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hero-chips a { padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); color: #dce7f2; font-size: 13px; font-weight: 600; }
.hero-chips a:hover { background: rgba(255,255,255,.12); color: #fff; }
.hero-stats { display: grid; gap: 12px; }
.hero-stats div { padding: 16px 18px; border-radius: 12px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); display: flex; align-items: baseline; gap: 10px; }
.hero-stats strong { font-family: "Manrope", sans-serif; font-size: 34px; color: #fff; } .hero-stats span { color: #b9cbe0; font-weight: 600; }
.trust-strip { max-width: 1320px; margin: 16px auto 0; padding: 0 38px; list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--slate); font-size: 13px; font-weight: 600; }
.trust-strip li { display: flex; align-items: center; gap: 6px; } .trust-strip .ic { width: 16px; height: 16px; color: var(--good); }
.directory-section { max-width: 1320px; margin: 0 auto; padding: 30px 38px 0; }
.directory-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.directory-heading h2 { font-size: 24px; }
.directory-heading a { color: var(--teal-700); font-size: 13px; font-weight: 800; white-space: nowrap; }
.calculator-grid-directory { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.calculator-card { min-height: 92px; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px; transition: transform .18s ease, border-color .18s ease; }
.calculator-card:hover { transform: translateY(-2px); border-color: #74aaa9; }
.calculator-card-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; background: #edf4f7; color: var(--teal-700); }
html.dark .calculator-card-icon { background: #26384a; }
.cat-islamic { color: #8a6420; background: #f7f0e1; } html.dark .cat-islamic { color: #e0b35c; }
.cat-mortgage, .cat-loans { color: #12407a; } html.dark .cat-mortgage, html.dark .cat-loans { color: #8fb8ee; }
.cat-business, .cat-income { color: #2e7d62; } html.dark .cat-business, html.dark .cat-income { color: #5fc79d; }
.calculator-card > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.calculator-card strong { font-size: 14px; color: var(--navy-900); }
.calculator-card small { margin-top: 3px; color: var(--slate); font-size: 12px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.calculator-card > b { color: var(--teal-700); } [dir="rtl"] .calculator-card > b, [dir="rtl"] .directory-heading a { transform: scaleX(-1); display: inline-block; }
[dir="rtl"] .directory-heading a { transform: none; }
.category-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.category-card { padding: 16px; display: flex; flex-direction: column; gap: 6px; transition: transform .18s, border-color .18s; }
.category-card:hover { transform: translateY(-2px); border-color: #74aaa9; }
.category-card strong { color: var(--navy-900); } .category-card small { color: var(--teal-700); font-weight: 700; } .category-card p { margin: 0; color: var(--slate); font-size: 12.5px; }
.why-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.why-card { padding: 20px; } .why-card .ic { width: 28px; height: 28px; color: var(--teal-700); } .why-card h3 { margin: 12px 0 6px; } .why-card p { margin: 0; color: var(--slate); font-size: 13.5px; }
.how-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.how-grid li { padding: 20px; } .how-grid h3 { margin: 10px 0 6px; } .how-grid p { margin: 0; color: var(--slate); font-size: 13.5px; }
.how-num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--teal-700); color: #fff; font-weight: 800; }
.filter-wrap { max-width: 1320px; margin: 0 auto; padding: 0 38px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-bar { display: flex; gap: 6px; padding: 8px; overflow-x: auto; flex: 1 1 600px; min-width: 0; }
.filter-bar button { height: 38px; padding: 0 13px; border: 0; border-radius: 7px; background: transparent; color: var(--slate); white-space: nowrap; font-size: 13px; font-weight: 700; }
.filter-bar button.active { background: var(--teal-700); color: #fff; } html.dark .filter-bar button.active { color: #0e1620; }
.filter-search { flex: 0 1 300px; height: 54px; padding-inline-start: 12px; border-radius: 12px; }
.filter-search .ic { color: var(--slate); }
.search-empty { text-align: center; color: var(--slate); padding: 30px; }
.contact-form { max-width: 620px; margin-top: 18px; }

/* ---------- footer ---------- */
.site-footer { max-width: 1320px; width: 100%; margin: 40px auto 0; padding: 30px 38px 34px; border-top: 1px solid var(--border); display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 24px; color: var(--slate); font-size: 13px; }
.site-footer h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--navy-900); margin: 0 0 10px; }
.site-footer nav { display: flex; flex-direction: column; gap: 7px; } .site-footer nav a:hover { color: var(--teal-700); }
.site-footer nav a[aria-current] { color: var(--teal-700); font-weight: 700; }
.footer-brand p { margin: 12px 0 0; max-width: 300px; }
.footer-bottom { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-top: 18px; border-top: 1px solid var(--muted); font-size: 12px; }
.footer-bottom span:last-child { max-width: 720px; }

/* ---------- dialogs & toast ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(11,31,58,.45); display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; animation: fade .15s ease; }
.dialog { width: 100%; max-width: 560px; padding: 20px; max-height: 80vh; overflow: auto; }
.search-dialog { padding: 0; }
.search-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.search-row input { flex: 1; min-width: 0; height: 44px; border: 0; outline: 0; background: transparent; font-size: 16px; font-weight: 600; }
.search-results { list-style: none; margin: 0; padding: 8px; max-height: 60vh; overflow: auto; }
.search-results a { display: flex; justify-content: space-between; gap: 10px; padding: 11px 12px; border-radius: 8px; }
.search-results li[aria-selected="true"] a, .search-results a:hover { background: var(--muted); }
.search-results small { color: var(--slate); }
.drawer-overlay { justify-content: flex-start; padding: 0; }
.drawer { width: min(320px, 86vw); height: 100%; border-radius: 0; padding: 18px; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.drawer a { display: flex; align-items: center; gap: 10px; padding: 11px 10px; border-radius: 8px; color: var(--ink); font-weight: 600; } .drawer a:hover { background: var(--muted); }
.drawer a .ic { color: var(--teal-700); }
.toast { position: fixed; bottom: 22px; inset-inline-start: 50%; transform: translate(-50%, 20px); z-index: 60; padding: 11px 16px; border-radius: 10px; background: #0b1f3a; color: #fff; font-weight: 600; font-size: 13.5px; box-shadow: var(--shadow); opacity: 0; transition: opacity .2s, transform .2s; max-width: 90vw; }
[dir="rtl"] .toast { transform: translate(50%, 20px); } [dir="rtl"] .toast.show { transform: translate(50%, 0); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
html.dark .toast { background: #e6edf3; color: #0e1620; }

/* ---------- root page ---------- */
.root-page { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.root-chooser { padding: 34px; text-align: center; max-width: 460px; } .root-chooser img { margin: 0 auto 10px; }
.root-chooser ul { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .root-chooser a { display: block; padding: 10px; border: 1px solid var(--border); border-radius: 8px; font-weight: 700; }

/* ---------- motion ---------- */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; } .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1480px) { .topnav a:nth-child(n+5):not(:last-child) { display: none; } html:not([lang="en"]) .topnav a:nth-child(n+4):not(:last-child) { display: none; } }
@media (max-width: 1200px) { .topnav a:nth-child(n+3):not(:last-child) { display: none; } .category-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1050px) {
  .topnav { display: none; } .menu-btn { display: grid; }
  .calculator-grid { grid-template-columns: 1fr 1fr; }
  .result-content { grid-template-columns: 1fr; }
  .donut-svg { width: 170px; }
  .calculator-grid-directory { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .why-grid { grid-template-columns: 1fr 1fr; }
  .site-footer { grid-template-columns: 1fr 1fr 1fr; } .footer-brand { grid-column: 1 / -1; }
  .directory-hero { grid-template-columns: 1fr; } .hero-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) { .calculator-grid, .detail-grid { grid-template-columns: 1fr; } .metrics-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) {
  .shell { display: block; } .rail { display: none; }
  .topbar { height: 62px; padding: 0 12px; gap: 8px; }
  .topbar .currency-select:not(.language-select) { display: none; }
  .breadcrumb, .page-heading, .calculator-grid, .detail-grid, .directory-section, .trust-strip, .filter-wrap { padding-inline: 16px; }
  .page-heading { flex-direction: column; align-items: stretch; }
  .heading-actions { justify-content: flex-start; }
  .result-content { padding: 16px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .action-btn span { display: none; } .action-btn { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .result-actions { justify-content: space-between; }
  .calculator-grid-directory, .how-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: 1fr 1fr; }
  .directory-hero { width: calc(100% - 32px); margin: 16px auto 0; padding: 32px 20px; }
  .hero-stats div { flex-direction: column; gap: 0; padding: 12px; } .hero-stats strong { font-size: 26px; }
  .saved-card, .schedule-card { margin-inline: 16px; }
  .site-footer { grid-template-columns: 1fr 1fr; padding-inline: 16px; }
  .calc-button { position: sticky; bottom: 10px; z-index: 5; box-shadow: 0 8px 24px rgba(10,127,127,.35); }
}
@media (max-width: 480px) {
  .wordmark-copy small { display: none; }
  .language-select { min-width: 0; width: 86px; }
  h1 { font-size: 25px; }
  .input-card, .detail-grid > .card, .schedule-card, .saved-card { padding: 16px; }
  .extras { grid-template-columns: 1fr; }
  .why-grid, .category-grid { grid-template-columns: 1fr; }
  .hero-search { flex-direction: column; } .hero-search input { flex: none; } .hero-button { justify-content: center; }
  .term-options { grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 5px; } .term-option { font-size: 12px; }
}

/* ---------- print ---------- */
@media print {
  @page { margin: 14mm; }
  html.dark { --paper: #fff; --surface: #fff; --ink: #1b2430; --navy-900: #0b1f3a; --slate: #5b6778; --border: #dde3ea; --muted: #eef2f5; --head: #f1f5f7; }
  body { background: #fff; font-size: 12px; }
  .rail, .topbar, .breadcrumb, .heading-actions, .result-actions, .reset-button, .card-currency, .extras-toggle, .calc-button, .slider, .privacy-note, .site-footer, .overlay, .toast, .saved-card, .faq, .calculator-grid-directory, .skip-link, .tabs { display: none !important; }
  .shell { display: block; } .card { box-shadow: none; break-inside: avoid; }
  .calculator-grid, .detail-grid { display: block; padding: 0; } .calculator-grid > *, .detail-grid > * { margin-bottom: 12px; }
  .extras { display: grid !important; } .field[hidden] { display: none !important; }
  .input-shell { border: 0; height: auto; } .term-option:not(.active) { display: none; } .term-option.active { background: none; color: #000; border: 0; padding: 0; text-align: start; }
  #r-table[hidden] { display: block !important; } .amortization-preview-table { max-height: none; overflow: visible; }
  .page-heading, .saved-card, .schedule-card { padding-inline: 0; }
  .page-heading::after { content: "financialprocalculator.com"; color: #5b6778; font-size: 11px; }
}
