:root {
  --ink: #0B1E3A;
  --ink-soft: #57647D;
  --ink-faint: #8695AC;
  --accent: #17458C;
  --accent-deep: #0F2F5E;
  --accent-tint: #EAF1FC;
  --surface: #FFFFFF;
  --surface-rgb: 255, 255, 255;
  --surface-soft: #F6F8FB;
  --line: #DCE3EE;
  --good: #157A4D;
  --good-tint: #E4F5EC;
  --warn: #B4770C;
  --warn-tint: #FBF0DC;
  --risk: #C4362B;
  --risk-tint: #FBE3E0;
  --shadow: 0 24px 48px -20px rgba(11, 30, 58, 0.28);
  --shadow-sm: 0 2px 10px rgba(11, 30, 58, 0.06);
  --radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #EAF0FA; --ink-soft: #9FB0C9; --ink-faint: #66748F;
    --accent: #5B93E6; --accent-deep: #7FACF0; --accent-tint: #16233D;
    --surface: #0B1424; --surface-rgb: 11, 20, 36; --surface-soft: #0F1B30; --line: #223250;
    --good: #3FBE84; --good-tint: #123425; --warn: #E0A83D; --warn-tint: #3A2C10;
    --risk: #E2645A; --risk-tint: #3C1614;
    --shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.55); --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
  }
}
:root[data-theme="dark"] {
  --ink: #EAF0FA; --ink-soft: #9FB0C9; --ink-faint: #66748F;
  --accent: #5B93E6; --accent-deep: #7FACF0; --accent-tint: #16233D;
  --surface: #0B1424; --surface-rgb: 11, 20, 36; --surface-soft: #0F1B30; --line: #223250;
  --good: #3FBE84; --good-tint: #123425; --warn: #E0A83D; --warn-tint: #3A2C10;
  --risk: #E2645A; --risk-tint: #3C1614;
  --shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.55); --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
}
:root[data-theme="light"] {
  --ink: #0B1E3A; --ink-soft: #57647D; --ink-faint: #8695AC;
  --accent: #17458C; --accent-deep: #0F2F5E; --accent-tint: #EAF1FC;
  --surface: #FFFFFF; --surface-rgb: 255, 255, 255; --surface-soft: #F6F8FB; --line: #DCE3EE;
  --good: #157A4D; --good-tint: #E4F5EC; --warn: #B4770C; --warn-tint: #FBF0DC;
  --risk: #C4362B; --risk-tint: #FBE3E0;
  --shadow: 0 24px 48px -20px rgba(11, 30, 58, 0.28); --shadow-sm: 0 2px 10px rgba(11, 30, 58, 0.06);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--surface-soft);
  color: var(--ink);
  font-family: 'Inter', -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: 'Jakarta', 'Inter', sans-serif; text-wrap: balance; margin: 0; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Site chrome ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 28px;
  padding: 16px max(24px, calc((100% - 1160px) / 2));
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: 'Jakarta', sans-serif; font-weight: 800; font-size: 19px; letter-spacing: -0.01em; text-decoration: none; color: inherit; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(155deg, var(--accent), var(--accent-deep));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 800;
}
.brand small { display: block; font-family: 'Inter'; font-weight: 500; font-size: 11px; color: var(--ink-soft); letter-spacing: 0; }
.site-nav { display: none; align-items: center; gap: 22px; font-size: 14px; font-weight: 600; color: var(--ink-soft); margin-left: auto; }
@media (min-width: 980px) { .site-nav { display: flex; } }
.site-nav a { text-decoration: none; }
.site-nav a:hover { color: var(--accent); }

.nav-item { position: relative; display: flex; align-items: center; }
.nav-item > button { background: none; border: none; font: inherit; font-weight: 600; color: inherit; display: flex; align-items: center; gap: 4px; padding: 4px 0; }
.nav-item .caret { font-size: 9px; margin-top: 1px; }
.nav-item:hover > button, .nav-item:focus-within > button { color: var(--accent); }
.nav-dropdown {
  position: absolute; top: 100%; left: 50%; margin-top: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  padding: 6px; min-width: 210px;
  opacity: 0; visibility: hidden; transform: translate(-50%, 4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.nav-dropdown::before {
  content: ''; position: absolute; left: 0; right: 0; top: -12px; height: 12px;
}
.nav-item:hover .nav-dropdown, .nav-item:focus-within .nav-dropdown { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.nav-dropdown a { display: block; padding: 9px 12px; border-radius: 7px; font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; text-decoration: none; }
.nav-dropdown a:hover { background: var(--accent-tint); color: var(--accent); }

.nav-cta { margin-left: 32px; display: flex; gap: 16px; align-items: center; }
@media (max-width: 979px) { .nav-cta { margin-left: auto; } }
.icon-btn { background: none; border: none; padding: 4px; color: var(--ink-soft); display: flex; cursor: pointer; }
.icon-btn:hover { color: var(--accent); }
@media (min-width: 980px) { #mobile-nav-toggle { display: none; } }
.lang-toggle { display: none; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
@media (min-width: 640px) { .lang-toggle { display: flex; } }
.lang-toggle a { color: var(--accent); text-decoration: none; }
.lang-toggle .sep { color: var(--line); }

.btn {
  font-size: 14px; font-weight: 700; padding: 10px 18px; border-radius: 10px;
  border: 1px solid transparent; display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ---------- Mobile nav drawer (hamburger) ---------- */
.mobile-nav-panel {
  display: none; position: fixed; inset: 0; z-index: 60;
  background: rgba(11, 20, 36, 0.4);
}
.mobile-nav-panel.is-open { display: block; }
.mobile-nav-sheet {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(320px, 86vw);
  background: var(--surface); box-shadow: var(--shadow);
  padding: 18px; overflow-y: auto;
}
.mobile-nav-close { background: none; border: none; color: var(--ink-soft); font-size: 22px; padding: 4px; float: right; cursor: pointer; }
.mobile-nav-group { margin-top: 44px; }
.mobile-nav-group + .mobile-nav-group { margin-top: 22px; }
.mobile-nav-group-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); margin-bottom: 8px; }
.mobile-nav-group a { display: block; padding: 9px 4px; font-size: 15px; font-weight: 600; color: var(--ink); text-decoration: none; }
.mobile-nav-group a.is-sub { padding-left: 14px; font-size: 14px; font-weight: 500; color: var(--ink-soft); }
@media (min-width: 980px) { .mobile-nav-panel { display: none !important; } }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: var(--ink);
  padding: 56px 24px 48px; background: var(--surface);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: url('/hero-bg.png');
  background-size: cover; background-position: 78% center;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(92deg, rgba(var(--surface-rgb),1) 0%, rgba(var(--surface-rgb),1) 20%, rgba(var(--surface-rgb),0.88) 34%, rgba(var(--surface-rgb),0.35) 46%, rgba(var(--surface-rgb),0.02) 58%, transparent 68%);
}
.hero-inner { position: relative; z-index: 1; max-width: 1160px; margin: 0 auto; }

@media (max-width: 979px) {
  .hero { padding: 0 0 32px; }
  .hero::before { position: static; display: block; height: 220px; width: 100%; background-position: 70% 30%; }
  .hero::after { display: none; }
  .hero-inner { padding: 24px 20px 0; }
}
.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 18px;
}
.hero h1 { font-size: clamp(32px, 4.6vw, 50px); line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; max-width: 560px; color: var(--ink); }
.hero h1 .accent-line { color: var(--accent); }
.hero p.lede { margin-top: 18px; max-width: 480px; font-size: 16.5px; line-height: 1.6; color: var(--ink-soft); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

.trust-line { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; margin-top: 30px; }
.avatar-stack { display: flex; }
.avatar-stack span {
  width: 32px; height: 32px; border-radius: 50%; border: 2.5px solid var(--surface); margin-left: -10px;
  background: linear-gradient(155deg, var(--accent), var(--accent-deep));
}
.avatar-stack span:first-child { margin-left: 0; }
.trust-line small { font-size: 13px; font-weight: 600; color: var(--ink-soft); line-height: 1.35; }

/* ---------- Calculator card ---------- */
.calc-wrap { max-width: 1160px; margin: 0 auto; padding: 40px 24px 72px; }
.calc-card {
  background: var(--surface); border-radius: 20px; box-shadow: var(--shadow);
  display: grid; grid-template-columns: 1fr; overflow: hidden;
}
@media (min-width: 900px) { .calc-card { grid-template-columns: 1.05fr 0.95fr; } }
.calc-form { padding: 36px 32px; }
.calc-form h2 { font-size: 21px; font-weight: 800; }
.calc-form > p { margin-top: 8px; font-size: 14px; color: var(--ink-soft); }
.field { margin-top: 22px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.input-money { position: relative; }
.input-money span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); font-weight: 600; }
.input-money input {
  width: 100%; padding: 13px 14px 13px 34px; border-radius: 10px; border: 1.5px solid var(--line);
  font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); background: var(--surface-soft);
}
.input-money input:focus, .field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.seg { display: flex; gap: 6px; background: var(--surface-soft); padding: 4px; border-radius: 10px; border: 1.5px solid var(--line); }
.seg-btn {
  flex: 1; border: none; background: transparent; padding: 9px 6px; border-radius: 7px;
  font-size: 12.5px; font-weight: 700; color: var(--ink-soft); font-family: inherit; cursor: pointer;
}
.seg-btn.is-active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
.plain-input { width: 100%; padding: 13px 14px; border-radius: 10px; border: 1.5px solid var(--line); font: inherit; font-size: 15px; font-weight: 600; background: var(--surface-soft); color: var(--ink); }
.calc-submit { width: 100%; margin-top: 28px; justify-content: center; padding: 14px; font-size: 15px; border: none; }

.calc-result { background: var(--surface-soft); padding: 36px 32px; border-left: 1px solid var(--line); display: flex; flex-direction: column; }
@media (max-width: 899px) { .calc-result { border-left: none; border-top: 1px solid var(--line); } }
.verdict-badge {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  padding: 7px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 800; letter-spacing: 0.02em;
}
.verdict-badge .dot { width: 8px; height: 8px; border-radius: 50%; }
.verdict-figure { font-family: 'Jakarta'; font-weight: 800; font-size: 44px; margin-top: 18px; line-height: 1; letter-spacing: -0.01em; }
.verdict-figure sup { font-size: 18px; font-weight: 700; margin-left: 2px; }
.verdict-reason { margin-top: 10px; font-size: 14px; line-height: 1.55; color: var(--ink-soft); max-width: 40ch; }
.receipt-lines { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.receipt-line { display: flex; justify-content: space-between; font-size: 13.5px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.receipt-line span:first-child { color: var(--ink-soft); }
.receipt-line span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; }
.calc-result-actions { margin-top: auto; padding-top: 24px; display: flex; gap: 10px; flex-wrap: wrap; }
.form-error-v2 { color: var(--risk); font-size: 13px; font-weight: 600; margin-top: 12px; }

/* ---------- Sections ---------- */
.section { max-width: 1160px; margin: 0 auto; padding: 64px 24px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 32px; flex-wrap: wrap; }
.section-head h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }
.section-head p { color: var(--ink-soft); font-size: 14.5px; margin-top: 6px; max-width: 46ch; }
.see-all { font-size: 13.5px; font-weight: 700; color: var(--accent); text-decoration: none; white-space: nowrap; }

.trust-strip { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.trust-strip .section { padding: 40px 24px; }
.trust-strip-inner { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.trust-strip-inner h3 { font-size: 17px; font-weight: 800; margin-right: 8px; }
.trust-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.trust-pill .check { width: 17px; height: 17px; border-radius: 50%; background: var(--good-tint); color: var(--good); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; flex-shrink: 0; }

.tools-section-head { text-align: center; margin-bottom: 28px; }
.tools-section-head h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }

.tool-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 480px) { .tool-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 860px) { .tool-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1180px) { .tool-grid { grid-template-columns: repeat(5, 1fr); } }
.tool-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px;
  display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.tool-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.tool-card h3 { font-size: 15.5px; font-weight: 800; line-height: 1.3; }
.tool-card p { font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.tool-card .see-all { margin-top: auto; }
.view-all-tools { display: block; text-align: center; margin-top: 24px; }

@media (max-width: 639px) {
  .tool-grid { gap: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
  .tool-card { flex-direction: row; align-items: center; border: none; border-radius: 0; border-bottom: 1px solid var(--line); padding: 16px; }
  .tool-card:last-child { border-bottom: none; }
  .tool-card p, .tool-card .see-all { display: none; }
  .tool-card h3 { font-size: 14.5px; flex: 1; }
  .tool-card::after { content: "\203A"; font-size: 20px; color: var(--ink-faint); }
}

.article-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
/* Inside the calculator's result column the grid never has more than ~460px
   to work with regardless of viewport width, so it needs its own narrower
   breakpoints instead of following the homepage's full-width ones. */
.calc-result .article-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
.calc-result .article-thumb { height: 72px; font-size: 18px; }
.calc-result .article-card-body { padding: 10px 12px 12px; }
.calc-result .article-card h4 { font-size: 12.5px; }
@media (min-width: 620px) { .article-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .article-grid { grid-template-columns: repeat(4, 1fr); } }
.article-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-decoration: none; color: inherit; display: block; }
.article-thumb { height: 128px; background: linear-gradient(135deg, var(--accent-tint), var(--surface-soft)); display: flex; align-items: center; justify-content: center; color: var(--accent); font-size: 26px; }
.article-card-body { padding: 16px 18px 20px; }
.article-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-faint); }
.article-card h4 { font-size: 14.5px; font-weight: 700; margin-top: 6px; line-height: 1.4; }

.signup-band { background: #0F2F5E; color: #fff; border-radius: 20px; padding: 40px; margin: 0 24px 64px; max-width: 1112px; margin-left: auto; margin-right: auto; }
.signup-band-inner { display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 780px) { .signup-band-inner { flex-direction: row; align-items: center; justify-content: space-between; } }
.signup-band h3 { font-size: 20px; font-weight: 800; }
.signup-band p { color: #C3D3EC; font-size: 13.5px; margin-top: 6px; max-width: 46ch; }

.site-footer { background: #0B1E3A; color: #B9C4D8; padding: 48px 24px 28px; }
.footer-inner { max-width: 1160px; margin: 0 auto; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; margin-bottom: 24px; }
.footer-links a { text-decoration: none; color: inherit; }
.footer-links a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding-top: 20px; font-size: 12px; color: #6E7D96; }

/* ---------- Guide pages (Rights / Responsibilities) ---------- */
.guide-header-v2 { max-width: 760px; margin: 0 auto; padding: 44px 24px 0; }
.guide-header-v2 .eyebrow { color: var(--accent); }
.guide-header-v2 h1 { font-size: clamp(28px, 4vw, 38px); font-weight: 800; margin-top: 10px; }
.guide-header-v2 p { margin-top: 14px; font-size: 16px; line-height: 1.6; color: var(--ink-soft); }
.guide-body-wrap { max-width: 760px; margin: 0 auto; padding: 32px 24px 64px; }

/* ---------- Theme picker page (reuses theme.js's generated markup) ---------- */
.theme-modal-overlay {
  position: fixed; inset: 0; background: rgba(11, 20, 36, 0.5);
  display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 100;
}
.theme-modal {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow); padding: 1.25rem;
}
.theme-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  font-family: 'Jakarta', sans-serif; font-weight: 800; font-size: 16px; color: var(--ink); margin-bottom: 1rem;
}
.theme-modal-close { border: none; background: none; color: var(--ink-soft); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px; }
.theme-tabs { display: flex; gap: 4px; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.theme-tab {
  flex: 1; padding: 8px; border: none; background: none; cursor: pointer;
  font-family: 'Jakarta', sans-serif; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--ink-soft); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.theme-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.theme-swatch-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.theme-swatch { width: 100%; aspect-ratio: 1; padding: 0; border: 2px solid var(--line); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform 0.1s; }
.theme-swatch:hover { transform: scale(1.08); }
.theme-swatch.is-active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.theme-swatch-dot { width: 42%; height: 42%; border-radius: 50%; }
.theme-customize-form { display: flex; flex-direction: column; gap: 10px; }
.theme-color-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.theme-color-row label { font-family: 'Jakarta', sans-serif; font-size: 12px; font-weight: 700; color: var(--ink); }
.theme-color-row input[type="color"] { width: 44px; height: 32px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); cursor: pointer; }
.theme-reset-link { display: block; width: 100%; margin-top: 1rem; padding: 4px 0; border: none; background: none; color: var(--ink-soft); font-size: 12px; text-decoration: underline; cursor: pointer; }
.theme-page-intro { max-width: 640px; margin: 0 auto; padding: 44px 24px 24px; text-align: center; }
.theme-page-intro h1 { font-size: clamp(26px, 4vw, 34px); font-weight: 800; }
.theme-page-intro p { margin-top: 12px; font-size: 15px; color: var(--ink-soft); }

/* ---------- Calculator verdict states ----------
   script.js drives these purely by overwriting className (e.g.
   `stamp.className = 'stamp ' + verdict.key`), so the class names below are
   load-bearing — they must match script.js's RANK_KEY / HATOL_KEYS exactly. */
.stamp {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  padding: 7px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 800; letter-spacing: 0.02em;
  font-family: 'Jakarta', sans-serif;
}
.stamp::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stamp.favorable { background: var(--good-tint); color: var(--good); }
.stamp.caution { background: var(--warn-tint); color: var(--warn); }
.stamp.risky { background: var(--risk-tint); color: var(--risk); }

.receipt-value.rag-chip { padding: 3px 10px; border-radius: 999px; font-size: 12px; }
.receipt-value.rag-chip.favorable { background: var(--good-tint); color: var(--good); }
.receipt-value.rag-chip.caution { background: var(--warn-tint); color: var(--warn); }
.receipt-value.rag-chip.risky { background: var(--risk-tint); color: var(--risk); }

.hatol-box {
  margin-top: 20px; padding: 16px; border-radius: 12px; background: var(--surface-soft); border: 1px solid var(--line);
}
.hatol-box.afford { background: var(--good-tint); border-color: var(--good); }
.hatol-box.thinkItOver { background: var(--warn-tint); border-color: var(--warn); }
.hatol-box.challenging { background: var(--warn-tint); border-color: var(--warn); }
.hatol-box.tilting { background: var(--risk-tint); border-color: var(--risk); }
.hatol-box.cantAfford { background: var(--risk-tint); border-color: var(--risk); }
.hatol-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); margin: 0; }
.hatol-title { font-size: 16px; font-weight: 800; margin: 4px 0 0; }
.hatol-explain { font-size: 13.5px; color: var(--ink-soft); margin: 6px 0 0; line-height: 1.5; }
.hatol-cta { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--accent); text-decoration: none; }
.tip { margin-top: 20px; padding: 16px; border-radius: 12px; background: var(--surface-soft); border: 1px solid var(--line); font-size: 13.5px; color: var(--ink-soft); }
.tip .hatol-cta { display: block; margin-top: 8px; }

/* ---------- Legacy simple-page layout (articles, about, contact, faq, etc.) ---------- */
.page-shell { max-width: 760px; margin: 0 auto; }
.ad-rail { display: none; }
.page { display: block; }

.guide-back-link { display: inline-block; font-size: 13.5px; font-weight: 700; color: var(--accent); text-decoration: none; margin: 20px 24px 0; }
.guide-back-link:hover { text-decoration: underline; }
.page-nav { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 24px; }
.page-nav .guide-back-link { margin: 0; }
.guide-intro { max-width: 640px; margin: 10px 24px 0; font-size: 15px; line-height: 1.6; color: var(--ink-soft); }

.article { max-width: 760px; margin: 0 auto; padding: 0 24px 64px; }
.article-eyebrow { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin: 28px 0 10px; }
.article-title { font-size: clamp(26px, 4vw, 36px); font-weight: 800; letter-spacing: -0.015em; line-height: 1.15; color: var(--ink); }
.article-dek { margin-top: 14px; font-size: 16.5px; line-height: 1.6; color: var(--ink-soft); }

.article-byline { display: flex; align-items: center; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.article-byline-avatar { width: 32px; height: 32px; border-radius: 50%; }
.article-byline-text { font-size: 13px; color: var(--ink-soft); margin: 0; }
.article-byline-text a { color: var(--accent); font-weight: 600; text-decoration: none; }

.article-share-top { display: flex; gap: 8px; margin-top: 14px; }
.article-share-top-btn {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-soft); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.article-share-top-btn:hover { color: var(--accent); border-color: var(--accent); }

.stamp-stage { display: flex; justify-content: center; margin: 28px 0; }
.stamp-stage .stamp { font-size: 15px; padding: 12px 22px; text-align: center; line-height: 1.3; }
.stamp-stage .stamp::before { display: none; }

.article-body { margin-top: 24px; font-size: 16.5px; line-height: 1.75; color: var(--ink); }
.article-body p { margin: 0 0 20px; }
.article-body h2 { font-size: 21px; font-weight: 800; margin: 36px 0 14px; letter-spacing: -0.01em; }
.article-body ul, .article-body ol { margin: 0 0 20px; padding-left: 22px; }
.article-body li { margin-bottom: 10px; line-height: 1.6; }
.article-body a { color: var(--accent); font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent-tint); }
.article-body strong { font-weight: 700; }

.article-sources { margin-top: 32px; padding: 20px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; }
.article-sources-title { font-size: 15px; font-weight: 800; margin: 0 0 10px; }
.article-sources ol { margin: 0; padding-left: 20px; }
.article-sources li { font-size: 13.5px; line-height: 1.6; margin-bottom: 6px; }
.article-sources a { color: var(--accent); text-decoration: underline; }

.share-block { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.share-icons { display: flex; gap: 8px; }
.share-icon-btn {
  display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); font-size: 13px; font-weight: 600; cursor: pointer;
}
.share-icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.share-feedback { font-size: 12.5px; color: var(--ink-soft); margin: 8px 0 0; width: 100%; }

.related-section { margin-top: 40px; }
.related-title { font-size: 19px; font-weight: 800; margin: 0 0 16px; }
.related-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 560px) { .related-grid { grid-template-columns: repeat(2, 1fr); } }
.related-card { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-decoration: none; color: inherit; }
.related-card:hover { box-shadow: var(--shadow-sm); }
.related-card-thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--surface-soft); }
.related-card-title { font-size: 13.5px; font-weight: 700; line-height: 1.4; }

.article-cta { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 10px; }
.btn-knowledge {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 10px;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 700; text-decoration: none;
}
.btn-knowledge:hover { background: var(--accent-deep); }

.article-author-card { margin-top: 32px; display: flex; gap: 12px; padding: 18px; background: var(--surface-soft); border-radius: 12px; }
.article-author-avatar { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; }
.article-author-name { font-size: 14.5px; font-weight: 800; margin: 0; }
.article-author-bio { font-size: 13px; color: var(--ink-soft); margin: 4px 0 0; line-height: 1.55; }
.article-author-bio a { color: var(--accent); text-decoration: underline; }

.article-rating { margin-top: 24px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; text-align: center; }
.article-rating-question { font-size: 14px; font-weight: 700; margin: 0 0 12px; }
.article-rating-buttons { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.article-rating-btn {
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; font-weight: 700; color: var(--ink); cursor: pointer;
}
.article-rating-btn.is-selected { background: var(--accent-tint); color: var(--accent); border-color: var(--accent); }
.article-rating-btn[disabled] { cursor: default; opacity: 0.7; }
.article-rating-feedback { margin-top: 10px; font-size: 13px; color: var(--good); font-weight: 600; }

.comments-section { margin-top: 40px; }
.comments-title { font-size: 19px; font-weight: 800; margin: 0 0 4px; }
.comments-subtitle { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 18px; }
.comments-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.comments-empty { font-size: 13.5px; color: var(--ink-soft); }
.comment-item { padding: 14px; background: var(--surface-soft); border-radius: 10px; }
.comment-meta { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); margin: 0 0 4px; }
.comment-body { font-size: 14px; line-height: 1.55; margin: 0; white-space: pre-wrap; word-break: break-word; }

.comment-form { display: flex; flex-direction: column; gap: 10px; max-width: 480px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="password"], .comment-form textarea {
  font-family: inherit; font-size: 14px; padding: 11px 13px; border-radius: 10px; border: 1.5px solid var(--line);
  background: var(--surface-soft); color: var(--ink); width: 100%;
}
.comment-form input:focus, .comment-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.comment-form textarea { resize: vertical; }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.btn-share {
  align-self: flex-start; padding: 11px 20px; border-radius: 10px; border: none;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 700; cursor: pointer;
}
.btn-share:hover { background: var(--accent-deep); }
.comment-feedback { font-size: 13px; color: var(--ink-soft); margin: 0; }

.lang-switch { display: flex; gap: 6px; }
.lang-switch-btn {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 12.5px; font-weight: 700; color: var(--ink-soft); text-decoration: none; cursor: pointer;
}
.lang-switch-btn.is-active { background: var(--accent-tint); color: var(--accent); border-color: var(--accent); }

/* Article listing pages (/articles, /articles/en) */
.article-list { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 24px 24px 64px; max-width: 760px; margin: 0 auto; }
@media (min-width: 620px) { .article-list { grid-template-columns: repeat(2, 1fr); } }
.article-list .article-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-decoration: none; color: inherit; }
.article-list .article-card:hover { box-shadow: var(--shadow-sm); }
.article-card-thumb { width: 100%; height: 140px; object-fit: cover; background: var(--surface-soft); }
.article-list .article-card-body { padding: 14px 16px 18px; }
.article-card-title { font-size: 15px; font-weight: 800; margin: 0; line-height: 1.35; }
.article-card-dek { font-size: 13px; color: var(--ink-soft); margin: 6px 0 0; line-height: 1.5; }
.article-card-more { color: var(--accent); font-weight: 700; }

/* article-edit.js's admin-only inline editor */
.edit-save-btn, .edit-discard-btn { padding: 8px 14px; border-radius: 8px; border: none; font-size: 12.5px; font-weight: 700; cursor: pointer; margin-right: 8px; }
.edit-save-btn { background: var(--accent); color: #fff; }
.edit-discard-btn { background: var(--surface-soft); color: var(--ink); border: 1px solid var(--line); }
.edit-feedback { font-size: 12px; color: var(--ink-soft); }

/* ---------- Rights/Responsibilities law list (rendered by rights.js/responsibilities.js) ---------- */
#guide-list { display: flex; flex-direction: column; gap: 14px; margin: 24px 24px 32px; }
.knowledge-item { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.knowledge-law { font-size: 14.5px; font-weight: 800; margin: 0 0 6px; }
.knowledge-desc { font-size: 13.5px; line-height: 1.6; color: var(--ink-soft); margin: 0 0 10px; }
.knowledge-source { display: inline-block; margin-right: 14px; font-size: 12.5px; font-weight: 700; color: var(--accent); text-decoration: none; }
.knowledge-source:hover { text-decoration: underline; }
#article-grid.article-grid { margin: 0 24px 32px; }
.btn-knowledge { margin: 0 24px 24px; }

/* ---------- Placeholder ("in progress") pages ---------- */
.placeholder-wrap { max-width: 480px; margin: 0 auto; padding: 96px 24px 120px; text-align: center; }
.placeholder-gear { width: 72px; height: 72px; margin: 0 auto 24px; color: var(--accent); animation: placeholder-spin 3.2s linear infinite; }
@keyframes placeholder-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.placeholder-wrap h1 { font-size: 24px; font-weight: 800; }
.placeholder-wrap p { margin-top: 12px; font-size: 15px; line-height: 1.6; color: var(--ink-soft); }

/* ---------- Tracker + Report pages ---------- */
.subtitle { font-size: 14px; color: var(--ink-soft); margin: 8px 24px 0; max-width: 560px; }
.page > h1#page-title { margin: 4px 24px 0; font-size: 26px; font-weight: 800; }

.ledger { margin: 20px 24px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.ledger-row { margin-bottom: 18px; }
.ledger-row:last-of-type { margin-bottom: 22px; }
.ledger-row.is-inactive { opacity: 0.45; transition: opacity 0.2s ease; }
.ledger-row label, .report-card label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 8px; color: var(--ink); }

.ledger input[type="text"], .ledger input[type="date"],
.report-card input[type="text"], .report-card input[type="date"],
.tracker-pay-reschedule input[type="date"] {
  width: 100%; height: 46px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 15px; font-weight: 600; background: var(--surface-soft); color: var(--ink); outline: none;
}
.ledger input:focus, .report-card input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.input-peso { position: relative; display: flex; align-items: center; }
.input-peso span { position: absolute; left: 14px; color: var(--ink-faint); font-weight: 700; }
.ledger .input-peso input, .report-card .input-peso input { padding-left: 38px; }

.segmented { display: flex; gap: 4px; }
.segmented .seg-btn { flex: 1; height: 42px; min-width: 0; padding: 0 2px; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.form-error { color: var(--risk); font-size: 13px; margin: 10px 0 0; text-align: center; }

.loan-chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 24px 22px; }
.loan-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink); }
.loan-chip.is-editing { border-color: var(--accent); background: var(--accent-tint); }
.loan-chip-name { border: none; background: transparent; color: var(--ink); font: inherit; cursor: pointer; padding: 2px 0 2px 6px; text-decoration: underline; text-decoration-style: dotted; text-decoration-color: var(--ink-soft); }
.loan-chip-name:hover { color: var(--accent); }
.loan-chip-remove { border: none; background: transparent; color: var(--ink-soft); font-size: 15px; line-height: 1; cursor: pointer; padding: 2px 4px; }
.loan-chip-remove:hover { color: var(--risk); }

.tracker-table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; -webkit-overflow-scrolling: touch; }
.tracker-table { border-collapse: collapse; width: max-content; min-width: 100%; font-size: 12.5px; }
.tracker-table th, .tracker-table td { padding: 8px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
.tracker-table th:first-child, .tracker-table td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); }
.tracker-table thead th { color: var(--ink-soft); font-weight: 700; }
.tracker-total-row td { font-weight: 700; color: var(--ink); background: var(--surface-soft); }
.tracker-empty { font-size: 13px; color: var(--ink-soft); text-align: center; padding: 24px 0; margin: 0 24px 24px; }

.report-link-banner { display: block; margin: 16px 24px 0; padding: 13px 16px; border: 1.5px solid var(--accent); border-radius: 10px; background: var(--accent-tint); color: var(--accent); font-size: 13.5px; font-weight: 700; text-align: center; text-decoration: none; }
.report-link-banner:hover { background: color-mix(in srgb, var(--accent-tint) 60%, var(--accent) 10%); }
.report-empty-cta { display: inline-block; margin: 16px 24px 0; }
#report-empty-state .tracker-empty { text-align: left; }

.tracker-mode-switch { margin: 20px 24px 0; width: calc(100% - 48px); }
.tracker-mode-switch .seg-btn { flex: 1; padding: 10px 0; font-size: 13.5px; }

.tracker-details { margin: 20px 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.tracker-summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--ink); user-select: none; }
.tracker-summary::-webkit-details-marker { display: none; }
.tracker-summary::after { content: '▾'; font-size: 11px; color: var(--ink-soft); transition: transform 0.15s ease; flex-shrink: 0; }
.tracker-details[open] .tracker-summary::after { transform: rotate(180deg); }
.tracker-details:not([open]) .tracker-summary { border-bottom: none; }
.tracker-details[open] .tracker-summary { border-bottom: 1px solid var(--line); }
.tracker-details .tracker-table-scroll { border: none; border-radius: 0; margin: 0; }

.tracker-cell-btn {
  display: inline-block; width: 100%; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  padding: 3px 8px; text-align: right; cursor: pointer; border-radius: 6px; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px;
}
.tracker-cell-btn:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); border-color: var(--accent); }
.tracker-cell-btn.is-paid, .tracker-cell-btn.is-moved-away { background: none; border-color: transparent; text-decoration-style: solid; }
.tracker-cell-btn.is-paid { color: var(--ink-soft); text-decoration: line-through; }
.tracker-cell-btn.is-moved-away { color: var(--warn); text-decoration: line-through; opacity: 0.75; }

.tracker-pay-detail { font-size: 13px; color: var(--ink-soft); margin: 0 0 16px; }
.tracker-pay-actions { display: flex; flex-direction: column; gap: 8px; }
.tracker-pay-reschedule { display: flex; flex-direction: column; gap: 8px; }
.tracker-pay-reschedule label { font-size: 12px; font-weight: 700; color: var(--ink-soft); margin: 0; }

.report-card { margin: 20px 24px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.report-card-title { font-size: 16px; font-weight: 800; color: var(--ink); margin: 0 0 14px; }
.report-card-intro { font-size: 13px; line-height: 1.6; color: var(--ink-soft); margin: 0 0 16px; }

.summary-bars { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.summary-bar-row { display: grid; grid-template-columns: 88px 1fr 76px; align-items: center; gap: 8px; }
.summary-bar-label { font-size: 11.5px; color: var(--ink-soft); }
.summary-bar-track { height: 10px; border-radius: 6px; background: var(--surface-soft); overflow: hidden; }
.summary-bar-fill { height: 100%; border-radius: 6px; transition: width 0.3s ease; width: 0; }
.summary-bar-fill.income { background: var(--good); }
.summary-bar-fill.debt { background: var(--risk); }
.summary-bar-value { font-size: 12px; font-weight: 700; color: var(--ink); text-align: right; }

.runway-result { margin-top: 16px; padding: 12px 14px; border-radius: 10px; font-size: 13px; line-height: 1.55; font-weight: 700; }
.runway-result.runway-ok { background: var(--good-tint); color: var(--good); }
.runway-result.runway-warning { background: var(--risk-tint); color: var(--risk); }
.runway-result.runway-neutral { background: var(--surface-soft); color: var(--ink-soft); font-weight: 400; }

.breakdown-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 480px) { .breakdown-cols { grid-template-columns: 1fr; } }
.breakdown-col-title { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 8px; }
.breakdown-list { list-style: none; margin: 0; padding: 0; }
.breakdown-list li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.breakdown-list li:first-child { border-top: none; }
.breakdown-name { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breakdown-amount { color: var(--ink-soft); flex-shrink: 0; }
.breakdown-empty { color: var(--ink-soft); font-style: italic; }
.placeholder-wrap .btn { margin-top: 28px; }
