/* MoneyHub — styles */
:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #047857;
  --brand-strong: #065f46;
  --accent: #d97706;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 8px 24px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: linear-gradient(135deg, #022c22, #065f46 55%, #047857);
  color: #fff;
  padding: 18px 0;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand-mark { font-size: 26px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 18px; letter-spacing: -0.01em; }
.brand-text small { opacity: 0.85; font-size: 12px; }
.header-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.currency-label { font-size: 12px; opacity: 0.9; }
.currency-select {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.currency-select option { color: #0f172a; }
.currency-note { font-size: 11px; opacity: 0.8; margin: 0; flex-basis: 100%; text-align: right; }

/* Hero */
.hero { text-align: center; padding: 34px 0 18px; }
.hero h1 { font-size: clamp(24px, 4vw, 34px); margin: 0 0 8px; letter-spacing: -0.02em; }
.hero p { color: var(--muted); margin: 0; font-size: 15px; }

/* Tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 18px 0 14px; }
.tab {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tab:hover { border-color: var(--brand); color: var(--brand); }
.tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Panels */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 26px;
}
.panel h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -0.01em; }
.lede { color: var(--muted); margin: 0 0 16px; font-size: 14px; }

/* Forms */
.calc-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.field input,
.field select {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 15px;
  background: #fbfdff;
  color: var(--ink);
  width: 100%;
}
.field input:focus,
.field select:focus {
  outline: 2px solid rgba(4, 120, 87, 0.35);
  border-color: var(--brand);
}

/* Slider + stepper controls (Round 5 UI/UX — replace typing with a control) */
.slider-field { grid-column: 1 / -1; } /* full-width rows give the slider room */
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.field-head label { margin: 0; }
.live-value { font-size: 12px; font-weight: 700; color: var(--brand-strong); white-space: nowrap; }
.slider-row { display: flex; align-items: center; gap: 8px; }
.ctl-slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand) var(--fill, 0%), var(--line) var(--fill, 0%));
  outline: none;
  cursor: pointer;
  margin: 4px 0;
}
.ctl-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--brand);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  cursor: grab;
}
.ctl-slider:active::-webkit-slider-thumb { cursor: grabbing; transform: scale(1.08); }
.ctl-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--brand);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  cursor: grab;
}
.slider-row input[type="number"] { flex: 0 0 92px; text-align: right; }
.btn-stepper {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
}
.btn-stepper:hover { border-color: var(--brand); color: var(--brand); }
.btn-stepper:active { background: var(--brand); border-color: var(--brand); color: #fff; transform: translateY(1px); }

/* Segmented radio group (compounding frequency) */
.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  background: #f8fafc;
  align-self: flex-start;
}
.seg-btn {
  border: 0;
  padding: 9px 14px;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn:hover { color: var(--brand); }
.seg-btn:active { background: #ecfdf5; color: var(--brand-strong); }
.seg-btn.selected { background: var(--brand); color: #fff; }
.seg-btn.selected + .seg-btn { border-left-color: transparent; }
.seg-btn.selected:active { background: var(--brand-strong); color: #fff; }

/* Results */
.results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}
.stat {
  background: #f0fdf4;
  border: 1px solid #d1fae5;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-wide { grid-column: 1 / -1; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; }
.stat-value { font-size: 20px; font-weight: 700; color: var(--brand-strong); }
.milestone {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  color: #78350f;
}

/* Charts */
.chart-wrap { grid-column: 1 / -1; margin-top: 8px; }
.chart-wrap canvas {
  width: 100%;
  height: 220px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

/* Actions */
.actions { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.btn {
  display: inline-block;
  border: none;
  border-radius: 9px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn-share { background: var(--brand); color: #fff; }
.btn-share:hover { background: var(--brand-strong); }
.btn-share:active { background: #03563e; }
.btn-ko-fi { background: #c2410c; color: #fff; }  /* 4.5:1+ on #c2410c (contrast fix, 2026-11-09) */
.btn-ko-fi:active { background: #9a3412; }  /* contrast fix 2026-11-09 */
.btn-paypal { background: #1e3a8a; color: #fff; }
.btn-paypal:active { background: #172a6e; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* Pressed feedback shared by every button */
.btn:active { transform: translateY(1px); }
.btn-sm:active { transform: translateY(1px); }
.tab:active { background: var(--brand); border-color: var(--brand); color: #fff; }
.debt-remove:active { color: #9f1239; transform: scale(0.94); }

/* Transient click flash — added by app.js click delegation, removed ~300ms later */
@keyframes click-flash {
  0% { filter: brightness(1.4); transform: scale(0.97); }
  100% { filter: brightness(1); transform: scale(1); }
}
.clicked { animation: click-flash 300ms ease; }

/* Result recompute flash — added by each compute(), removed ~700ms later */
@keyframes result-flash {
  0% { background-color: #a7f3d0; box-shadow: 0 0 0 2px rgba(4, 120, 87, 0.25); }
  100% { background-color: #f0fdf4; box-shadow: 0 0 0 0 rgba(4, 120, 87, 0); }
}
.results.flash { animation: result-flash 700ms ease; }
.results.flash .stat { animation: result-flash 700ms ease; }

/* FAQ */
.faq { margin: 8px 0 28px; }
.faq h2 { font-size: 18px; }
.faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 8px;
}
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { color: var(--muted); margin: 8px 0 0; font-size: 14px; }

/* Footer */
.site-footer { background: #0f172a; color: #cbd5e1; padding: 30px 0 26px; margin-top: 20px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.site-footer strong { color: #fff; }
.fineprint { font-size: 12px; color: #94a3b8; margin: 6px 0 0; }
.footer-links { display: flex; flex-direction: column; gap: 6px; }
.footer-links a { color: #cbd5e1; text-decoration: none; font-size: 14px; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-donate { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.ad-slot { margin-top: 24px; text-align: center; }
.ad-placeholder {
  border: 1px dashed #334155;
  border-radius: 8px;
  color: #64748b;
  font-size: 12px;
  padding: 10px;
  margin-bottom: 8px;
}

/* Toast */
#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #0f172a;
  color: #fff;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: var(--shadow);
  z-index: 50;
}

/* Guides / static pages */
.site-header.guide { margin-bottom: 0; }
.guide-body { max-width: 760px; margin: 0 auto; padding: 30px 20px 40px; }
.guide-body h1 { font-size: 26px; letter-spacing: -0.02em; }
.guide-body h2 { font-size: 19px; margin-top: 28px; }
.guide-body p { color: #334155; }
.guide-body .fineprint { color: var(--muted); }
.guide-body ul { color: #334155; }

@media (max-width: 560px) {
  .results { grid-template-columns: 1fr 1fr; }
  .stat-wide { grid-column: 1 / -1; }
  .header-inner { justify-content: center; text-align: center; }
}

/* Debt payoff rows */
.fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.fieldset legend { font-size: 0.9rem; color: var(--muted); padding: 0 6px; }
.debt-row { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.debt-row input { flex: 1; min-width: 90px; }
.debt-remove { flex: 0 0 auto; align-self: center; border: 0; background: transparent; color: var(--err, #e11d48); font-size: 1rem; cursor: pointer; }


/* Hub rail — internal links across the tool network */
.hub { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.hub a {
  color: inherit; opacity: 0.92; text-decoration: none; font-size: 0.9em;
  font-size: 0.8em; padding: 2px 8px; border: 1px solid currentColor; border-radius: 999px;
}
.hub a:hover { opacity: 1; }

/* >>> theme-by-name (2026-11-02) >>> */
/* Theme derived from the site's MEANING, not a random variant.
 * Money and trust = forest green on paper, with serif numerals. Reads like a ledger, not a casino.
 * Ad layout is deliberately NOT set here — container width and rail geometry are
 * measured and verified separately by check-ad-layout.mjs.
 */
:root {
  --bg: #f7faf8;
  --card: #ffffff;
  --ink: #0f1f18;
  --muted: #55665d;
  --line: #dde7e1;
  --brand: #065f46;
  --brand-strong: #065f46;
  --accent: #0d9488;
  --radius: 6px;
  --font-sans: 'Source Serif Pro', Georgia, 'Times New Roman', serif;
}
body { font-family: var(--font-sans); background: var(--bg); color: var(--ink); }
h1, h2, h3 { font-family: var(--font-sans); font-weight: 600; letter-spacing: -0.015em; }
.card, .panel, section[class*="card"] { border-radius: var(--radius); }
/* <<< theme-by-name <<< */

/* ── image-compressor tool styles (2026-11-07) ───────────────────────────── */
:root { --accent: #0f766e; --bad: #b91c1c; --good: #15803d; }
.dropzone{border:2px dashed #cbd5e1;border-radius:14px;padding:38px 20px;text-align:center;
  cursor:pointer;transition:border-color .15s,background .15s;background:#fafafa}
.dropzone:hover,.dropzone:focus-visible,.dropzone.is-over{border-color:var(--accent);background:#f0fdfa;outline:none}
.dropzone__title{margin:0 0 6px;font-size:17px;font-weight:600}
.dropzone__hint{margin:0;color:#64748b;font-size:13px}
.controls{display:flex;flex-wrap:wrap;gap:16px;align-items:center;margin:20px 0}
.controls label{font-size:14px;color:#334155}
.controls input[type=range]{width:200px;accent-color:var(--accent)}
.controls input[type=number]{width:78px;padding:4px 6px;border:1px solid #cbd5e1;border-radius:6px}
.checkbox{display:flex;align-items:center;gap:6px}
.summary{background:#ecfdf5;border-left:4px solid var(--good);padding:10px 14px;border-radius:8px;
  font-size:14px;margin:14px 0}
.results{list-style:none;padding:0;margin:16px 0}
.result{border:1px solid #e2e8f0;border-radius:10px;padding:12px 14px;margin-bottom:10px;background:#fff}
.result--bad{border-color:#fecaca;background:#fef2f2;color:var(--bad)}
.result__head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:4px}
.result__meta{color:#64748b;font-size:13px;margin-bottom:8px}
.result .good{color:var(--good);font-weight:600}
.result .muted{color:#94a3b8}
.btn-sm{display:inline-block;padding:6px 12px;font-size:13px}
@media (max-width:640px){ .controls{gap:10px} .controls input[type=range]{width:140px} }

/* ── pdf-tools styles (2026-11-07) ───────────────────────────────────────── */
:root { --accent: #b91c1c; }
.tabs{display:flex;gap:8px;margin-bottom:18px;flex-wrap:wrap}
.tab{padding:9px 16px;border:1px solid #cbd5e1;background:#fff;border-radius:999px;cursor:pointer;font-size:14px;color:#334155}
.tab.is-active{background:var(--accent);border-color:var(--accent);color:#fff;font-weight:600}
.files{list-style:none;padding:0;margin:14px 0}
.file-row{display:flex;align-items:center;gap:12px;padding:10px 12px;border:1px solid #e2e8f0;border-radius:8px;margin-bottom:8px;background:#fff}
.file-row__name{flex:1;font-size:14px;word-break:break-all}
#controls{margin-top:18px}
#range-row label{display:block;font-size:14px;font-weight:600;margin-bottom:6px}
#range{width:100%;max-width:340px;padding:9px 12px;border:1px solid #cbd5e1;border-radius:8px;font-size:15px}
.hint{color:#64748b;font-size:13px;margin:6px 0 14px}
.summary{display:flex;align-items:center;gap:14px;flex-wrap:wrap;background:#ecfdf5;border-left:4px solid #15803d;padding:12px 14px;border-radius:8px;margin-top:16px}
.error{color:#b91c1c;background:#fef2f2;border-left:4px solid #b91c1c;padding:10px 14px;border-radius:8px;margin-top:14px}
.btn-ghost{background:#fff;color:#334155;border:1px solid #cbd5e1}
.muted{color:#94a3b8;font-size:12px}

/* Name detection — a separate, explicit step because it downloads a model */
.names-row{display:flex;flex-wrap:wrap;gap:10px 16px;align-items:center;margin:8px 0 0;
  padding:12px 14px;background:#f8fafc;border:1px dashed #cbd5e1;border-radius:10px}
.btn-alt{background:#0f172a;color:#f8fafc;border:1px solid #0f172a}
.btn-alt:disabled{opacity:.6}
.names-note{margin:0;font-size:12.5px;color:#64748b;line-height:1.5;max-width:60ch}
.names-status{margin:10px 0 0;padding:10px 14px;border-radius:8px;font-size:13.5px;line-height:1.5;
  background:#f1f5f9;border-left:4px solid #94a3b8;color:#334155}
.names-status.ok{background:#ecfdf5;border-left-color:#15803d;color:#14532d}
.names-status.bad{background:#fef2f2;border-left-color:#b91c1c;color:#7f1d1d}
@media (max-width:640px){ .names-note{max-width:none} }

/* Watermark editor (2026-11-08) */
h3.sub{font-size:13px;text-transform:uppercase;letter-spacing:.06em;color:#64748b;margin:18px 0 8px}
.wm-style{display:grid;grid-template-columns:140px 1fr;gap:8px 12px;align-items:center;
  background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px;padding:12px;margin:8px 0 12px}
.wm-style label{font-size:13px;color:#334155}
.wm-style select,.wm-style input[type=range],.wm-style input[type=color]{width:100%}
.wm-style input[type=color]{height:34px;padding:2px}
@media (max-width:640px){ .wm-style{grid-template-columns:1fr} }

/* Redaction + extraction UI (2026-11-08) */
.pii-source{width:100%;min-height:90px;margin:8px 0;padding:10px;border:1px solid #cbd5e1;border-radius:8px;font-size:13px}
.pii-row{display:flex;align-items:flex-start;gap:10px;padding:7px 10px;border:1px solid #e2e8f0;
  border-radius:8px;margin-bottom:6px;background:#fff;cursor:pointer;font-size:13px}
.pii-row code{background:#f1f5f9;padding:1px 6px;border-radius:4px;white-space:nowrap}
.pii-why{color:#64748b;font-size:12px;flex:1}
.redact-canvas-wrap{margin-top:12px}
#redact-canvas{display:block;border:1px solid #e2e8f0;border-radius:8px;touch-action:none;cursor:crosshair}
.extract-actions{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0}
.extract-list{margin:10px 0;padding-left:18px;font-size:13px}
.extract-out{margin-top:10px}
.extract-out textarea{width:100%;min-height:110px;padding:10px;border:1px solid #cbd5e1;border-radius:8px;
  font-family:ui-monospace,Menlo,monospace;font-size:12.5px;margin:8px 0}
.table-preview{background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:10px;
  overflow-x:auto;font-size:12.5px;max-height:300px}

/* Privacy architecture section (2026-11-08) — the selling point of every site. */
.privacy-section{margin-top:34px;padding-top:24px;border-top:2px solid #e2e8f0}
.privacy-section h2{font-size:1.35em;margin-bottom:10px}
.privacy-section h3{font-size:1.05em;margin:20px 0 8px}
.privacy-steps{margin:10px 0 14px;padding-left:22px}
.privacy-steps li{margin-bottom:8px;line-height:1.6}
.privacy-section kbd{background:#f1f5f9;border:1px solid #cbd5e1;border-bottom-width:2px;
  border-radius:4px;padding:1px 5px;font-size:.85em;font-family:ui-monospace,Menlo,monospace}

/* Grouped redaction findings (2026-11-08) */
.pii-group{border:1px solid #e2e8f0;border-radius:10px;margin-bottom:8px;background:#fff;overflow:hidden}
.pii-group summary{padding:9px 12px;cursor:pointer;font-size:13.5px;background:#f8fafc;
  display:flex;align-items:center;gap:10px;list-style:none}
.pii-group summary::-webkit-details-marker{display:none}
.pii-group summary::after{content:'▾';margin-left:auto;color:#94a3b8}
.pii-group[open] summary::after{content:'▴'}
.pii-group-body{padding:6px 12px 10px}
.pii-group-body .pii-row{border:none;background:transparent;padding:4px 0;margin:0}
.pii-all{margin-top:10px;padding:9px 12px;background:#eef2ff;border-radius:8px;font-size:13px}

/* PII Shield (2026-11-08) */
:root { --accent: #0f766e; }
.split{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:16px 0}
.split__pane{min-width:0}
.pane-label{display:block;font-size:13px;font-weight:600;color:#475569;margin-bottom:6px}
#source,#out{width:100%;height:300px;padding:12px;border:1px solid #cbd5e1;border-radius:10px;
  font-family:ui-monospace,Menlo,monospace;font-size:13px;line-height:1.55;resize:vertical}
#out{background:#f8fafc}
.findings{margin-top:14px}
.findings-head{margin:0 0 8px;font-size:13.5px}
.group{border:1px solid #e2e8f0;border-radius:10px;margin-bottom:8px;background:#fff;overflow:hidden}
.group summary{padding:9px 12px;cursor:pointer;font-size:13.5px;background:#f8fafc;
  display:flex;align-items:center;gap:10px;list-style:none}
.group summary::-webkit-details-marker{display:none}
.group summary::after{content:'▾';margin-left:auto;color:#94a3b8}
.group[open] summary::after{content:'▴'}
.group-body{padding:6px 12px 10px}
.finding{display:flex;align-items:center;gap:8px;padding:4px 0;font-size:13px}
.finding code{background:#f1f5f9;padding:1px 6px;border-radius:4px}
.why{color:#64748b;font-size:12px}
.ok-line{color:#15803d;background:#ecfdf5;border-left:4px solid #15803d;padding:10px 14px;border-radius:8px}
@media (max-width:760px){ .split{grid-template-columns:1fr} #source,#out{height:200px} }

/* ===== HERO TOOL CARD (2026-11-13) =====
   The tool IS the product. Before this, `class="tool-card"` existed in the
   markup of all six sites with no matching rule — so the primary feature sat in
   the same visual plane as the prose below it and nothing drew the eye (the
   owner's "the main feature is not emphasised" report). A real card with an
   accent edge, a soft shadow and extra breathing room makes it the focal point
   without changing any behaviour or markup. */
.tool-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 14px;
  padding: 22px 22px 20px;
  margin: 26px 0 30px;
  box-shadow: 0 10px 30px rgba(15, 31, 24, .07), 0 2px 6px rgba(15, 31, 24, .04);
}
.tool-card > h2:first-child,
.tool-card > h1:first-child { margin-top: 0; }
@media (max-width: 560px) {
  .tool-card { padding: 16px 14px 15px; border-radius: 12px; margin: 18px 0 22px; }
}
