/* ============================================================
   מחושב — מערכת עיצוב "הפנקס"
   RTL, Hebrew, light/dark, mobile-first
   נייר מילימטרי, דיו, גומיית חותמת — בלי צללים רכים
   ============================================================ */

:root {
  color-scheme: light;
  --bg: #f7f3ea;
  --surface: #fffdf6;
  --surface-2: #efe9db;
  --text: #201d16;
  --text-2: #6b6353;
  --text-3: #8d8574;
  --border: #c9c2b0;
  --border-soft: #e5dfd0;
  --ink: #201d16;
  --ink-contrast: #f7f3ea;
  --ink-hover: #3a3426;
  --accent: #b23a16;
  --accent-strong: #8f2e11;
  --accent-soft: #f6e4da;
  --accent-contrast: #fffdf6;
  --accent-dot: #d2481f;
  --green: #2f6b4f;
  --green-soft: #e4ede6;
  --amber: #915c10;
  --amber-soft: #f3ead6;
  --rose: #a03a26;
  --rose-soft: #f4e2dc;
  --blue: #2f5d6b;
  --blue-soft: #e3ecec;
  --input-bg: #ffffff;
  --grid-line: rgba(32, 29, 22, .05);
  --ad-dash: #b8ae97;
  --footer-bg: #201d16;
  --shadow: 3px 3px 0 rgba(32, 29, 22, .14);
  --shadow-lg: 4px 4px 0 rgba(32, 29, 22, .14);
  --radius: 6px;
  --radius-sm: 5px;
  --font-display: 'Suez One', 'Heebo', serif;
  --font-mono: 'Miriam Libre', 'Heebo', monospace;
  --chart-1: #201d16;
  --chart-2: #d2481f;
  --chart-3: #2f6b4f;
  --chart-4: #2f5d6b;
  --chart-5: #915c10;
  --chart-grid: #e5dfd0;
  --max-w: 1120px;
  --focus-ring: 0 0 0 3px rgba(178, 58, 22, .3);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171512;
  --surface: #1e1a15;
  --surface-2: #26211a;
  --text: #f0ead9;
  --text-2: #b3a993;
  --text-3: #8d8574;
  --border: #3a3426;
  --border-soft: #2b2620;
  --ink: #f0ead9;
  --ink-contrast: #171512;
  --ink-hover: #d9d2c0;
  --accent: #e0663a;
  --accent-strong: #e98a63;
  --accent-soft: #33221b;
  --accent-contrast: #171512;
  --accent-dot: #e0663a;
  --green: #6fa58a;
  --green-soft: #1e2a24;
  --amber: #cfa050;
  --amber-soft: #2e2718;
  --rose: #d97a5f;
  --rose-soft: #33201a;
  --blue: #8fb3bd;
  --blue-soft: #1d2a2e;
  --input-bg: #14110d;
  --grid-line: rgba(240, 234, 217, .04);
  --ad-dash: #4a4232;
  --footer-bg: #171512;
  --shadow: 3px 3px 0 rgba(0, 0, 0, .45);
  --shadow-lg: 4px 4px 0 rgba(0, 0, 0, .45);
  --chart-1: #f0ead9;
  --chart-2: #e0663a;
  --chart-3: #6fa58a;
  --chart-4: #8fb3bd;
  --chart-5: #cfa050;
  --chart-grid: #2b2620;
  --focus-ring: 0 0 0 3px rgba(224, 102, 58, .4);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--text);
  font-family: 'Heebo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.3; margin: 0 0 .5em; }
h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(1.6rem, 3.6vw, 2rem); }
h2 { font-size: clamp(1.25rem, 2.6vw, 1.5rem); margin-top: 1.8em; }
h3 { font-size: 1.1rem; margin-top: 1.4em; }
p { margin: 0 0 1em; }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 4px; }

.skip-link {
  position: absolute; top: -60px; right: 12px;
  background: var(--ink); color: var(--ink-contrast);
  padding: 8px 16px; border-radius: var(--radius-sm); z-index: 300; transition: top .12s;
}
.skip-link:focus { top: 10px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 2px solid var(--ink);
}
.header-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 18px;
  display: flex; align-items: center; gap: 10px; height: 60px;
}
.logo { display: flex; align-items: center; gap: 9px; color: var(--text); }
.logo > span { font-family: var(--font-display); font-weight: 400; font-size: 1.32rem; line-height: 1.1; }
.logo:hover { text-decoration: none; color: var(--text); }
.logo svg { width: 32px; height: 32px; flex: none; }
.logo .logo-tag { font-family: 'Heebo', sans-serif; font-size: .66rem; font-weight: 500; color: var(--text-3); margin-top: 3px; display: block; line-height: 1; }
.header-spacer { flex: 1; }

.header-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1.5px solid var(--ink); color: var(--text);
  border-radius: var(--radius); padding: 6px 12px; font: inherit; font-size: .88rem; font-weight: 500;
  cursor: pointer; transition: background .12s, color .12s;
}
.header-btn:hover { background: var(--surface-2); }
.header-btn svg { width: 16px; height: 16px; }
.header-btn .kbd {
  font-family: var(--font-mono); font-weight: 700; font-size: 10px;
  border: 1px solid var(--border); border-radius: 4px;
  padding: 1px 5px; color: var(--text-3); background: var(--surface);
}
#theme-toggle { border: 1.5px solid var(--border); color: var(--text-2); }
@media (max-width: 640px) {
  .header-btn span.hide-sm { display: none; }
  .header-btn { padding: 6px 9px; }
}

/* ---------- category nav row ---------- */
.cat-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.cat-nav-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 18px;
  display: flex; align-items: center; gap: 22px; height: 42px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.cat-nav-inner::-webkit-scrollbar { display: none; }
.cat-nav a { font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.cat-nav a:hover { color: var(--text); text-decoration: none; }

/* ---------- search overlay ---------- */
.search-overlay {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(32, 29, 22, .5);
  padding: 9vh 16px 16px;
}
.search-overlay.open { display: block; }
.search-box {
  max-width: 620px; margin: 0 auto; background: var(--surface);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  border: 1.5px solid var(--ink); overflow: hidden;
}
.search-box input {
  width: 100%; border: none; background: none; color: var(--text);
  font: inherit; font-size: 1.1rem; padding: 16px 20px; outline: none;
}
.search-results { max-height: 52vh; overflow-y: auto; border-top: 1px solid var(--border); }
.search-results a {
  display: flex; align-items: center; gap: 12px; padding: 11px 20px;
  color: var(--text); border-bottom: 1px solid var(--border-soft);
}
.search-results a:last-child { border-bottom: none; }
.search-results a:hover, .search-results a.active { background: var(--surface-2); text-decoration: none; }
.search-results .s-icon { font-size: 1.25rem; flex: none; width: 30px; text-align: center; }
.search-results .s-cat { margin-inline-start: auto; font-family: var(--font-mono); font-size: .74rem; color: var(--text-3); flex: none; }
.search-empty { padding: 22px 20px; color: var(--text-3); text-align: center; }

/* ---------- layout ---------- */
.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 18px; }
.page-main { padding-bottom: 56px; }

.breadcrumb {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums;
  color: var(--text-3); padding: 16px 0 4px; list-style: none; margin: 0;
}
.breadcrumb a { color: var(--text-3); }
.breadcrumb li:not(:last-child)::after { content: "‹"; margin-inline-start: 6px; color: var(--text-3); }
.breadcrumb li:last-child { color: var(--text); }

.page-head { padding: 6px 0 18px; }
.page-head h1 { font-size: clamp(1.55rem, 3.4vw, 2rem); }
.page-head .subtitle { color: var(--text-2); max-width: 700px; margin: 0; font-size: 1.02rem; }

/* stamp badge — חותמת דיו ירוקה */
.updated-badge {
  display: inline-block; margin-top: 12px;
  transform: rotate(-2deg);
  border: 2px solid var(--green); color: var(--green); background: none;
  border-radius: 4px; padding: 6px 11px;
  font-family: var(--font-mono); font-weight: 700; font-size: 11px;
  letter-spacing: .05em; font-variant-numeric: tabular-nums;
}

/* ---------- calculator grid ---------- */
.calc-layout { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 22px; align-items: start; }
@media (max-width: 880px) { .calc-layout { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
}
.calc-layout > .card {
  border: 1.5px solid var(--ink);
  box-shadow: var(--shadow-lg);
}
.card h2:first-child, .card h3:first-child { margin-top: 0; }

.calc-form .field { margin-bottom: 16px; }
.calc-form label.f-label {
  display: block; font-family: var(--font-mono); font-weight: 700; font-size: 12px;
  letter-spacing: .04em; color: var(--text-2); margin-bottom: 6px;
}
.calc-form .f-hint { font-size: .8rem; color: var(--text-3); margin-top: 4px; }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .unit {
  position: absolute; inset-inline-end: 12px; color: var(--text-3);
  font-family: var(--font-mono); font-size: .82rem; pointer-events: none;
}
input[type="number"], input[type="text"], input[type="date"], input[type="time"], select {
  width: 100%; color: var(--text);
  font-family: var(--font-mono); font-size: 16px; font-variant-numeric: tabular-nums;
  background: var(--input-bg); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 13px; transition: border-color .12s;
  appearance: textfield;
}
.calc-form > .field:first-child input:not([type="range"]),
.calc-form > .field:first-child select,
.calc-form > .grid-2:first-child .field:first-child input:not([type="range"]) {
  border-color: var(--ink);
}
select option { background: var(--input-bg); color: var(--text); }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input:focus, select:focus {
  border-color: var(--ink); outline: 2px solid transparent; outline-offset: 1px;
  box-shadow: 2px 2px 0 rgba(210, 72, 31, .35);
}
input.has-unit { padding-inline-end: 44px; }

input[type="range"] {
  width: 100%; margin: 10px 0 2px; height: 22px;
  -webkit-appearance: none; appearance: none; background: none;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 3px; background: var(--border); border-radius: 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 0; border: none;
  background: var(--ink); margin-top: -5.5px; cursor: pointer;
}
input[type="range"]::-moz-range-track { height: 3px; background: var(--border); border-radius: 0; }
input[type="range"]::-moz-range-progress { height: 3px; background: var(--ink); }
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 0; border: none;
  background: var(--ink); cursor: pointer;
}
input[type="range"]:focus-visible { box-shadow: var(--focus-ring); }

.radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-row label {
  border: 1.5px solid var(--border); border-radius: 4px; padding: 7px 16px;
  font-size: .9rem; cursor: pointer; user-select: none; transition: all .12s;
  background: var(--surface);
}
.radio-row input { position: absolute; opacity: 0; pointer-events: none; }
.radio-row label:has(input:checked) {
  background: var(--ink); border-color: var(--ink); color: var(--ink-contrast); font-weight: 500;
}
.radio-row label:has(input:focus-visible) { box-shadow: var(--focus-ring); }

.check-row { display: flex; align-items: center; gap: 9px; font-size: .93rem; }
.check-row input { width: 18px; height: 18px; accent-color: var(--ink); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- results ---------- */
.results-card { position: sticky; top: 76px; }
@media (max-width: 880px) { .results-card { position: static; } }

.result-hero { text-align: center; padding: 6px 0 16px; }
.result-hero .r-label { font-size: .9rem; color: var(--text-2); font-weight: 500; }
.result-hero .r-value {
  display: inline-block;
  font-family: var(--font-mono); font-size: clamp(2rem, 6vw, 2.6rem); font-weight: 700;
  color: var(--text); line-height: 1.15; font-variant-numeric: tabular-nums;
  padding-bottom: 6px; border-bottom: 6px double var(--ink); margin: 2px 0 4px;
}
.result-hero .r-sub { font-family: var(--font-mono); font-size: .84rem; color: var(--text-3); font-variant-numeric: tabular-nums; }

.result-rows { border-top: 1px solid var(--border); margin-top: 6px; }
.r-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 9px 2px; border-bottom: 1px solid var(--border-soft); font-size: .95rem;
}
.r-row .rr-label { color: var(--text-2); }
.r-row .rr-value { font-family: var(--font-mono); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.r-row.minor .rr-value { font-weight: 400; }
.r-row.total { border-bottom: none; border-top: 1.5px solid var(--ink); margin-top: -1px; }
.r-row.total .rr-label { font-weight: 800; color: var(--text); }
.r-row.total .rr-value { font-weight: 700; color: var(--text); }
.rr-value.pos { color: var(--green); }
.rr-value.neg { color: var(--rose); }

.result-note {
  margin-top: 12px; font-size: .8rem; color: var(--text-3);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 12px;
}

.result-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-size: .9rem; font-weight: 500; cursor: pointer;
  border-radius: var(--radius-sm); padding: 9px 15px; transition: all .12s; border: 1.5px solid transparent;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--ink); color: var(--ink-contrast); border-color: var(--ink); }
.btn-primary:hover { background: var(--ink-hover); border-color: var(--ink-hover); }
.btn-ghost { background: var(--surface); border-color: var(--ink); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-tertiary { background: none; border-color: var(--border); color: var(--text-2); }
.btn-tertiary:hover { background: var(--surface-2); color: var(--text); }

.chart-wrap { margin: 14px 0 4px; }
.chart-wrap text { font-family: var(--font-mono); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; margin-top: 10px; font-size: .82rem; color: var(--text-2); }
.chart-legend .lg-item { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .lg-dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* ---------- ad frames ---------- */
.ad-frame {
  border: 1px solid var(--border); background: var(--surface);
  padding: 10px 10px 12px; margin: 26px 0;
}
.ad-frame .ad-label {
  text-align: center; font-family: var(--font-mono); font-weight: 700; font-size: 10px;
  letter-spacing: .34em; text-indent: .34em; color: var(--text-3); margin-bottom: 9px;
}
.ad-frame .ad-box {
  background: var(--surface-2); border: 1px dashed var(--ad-dash);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 12px; color: var(--text-3);
  overflow: hidden;
}
.ad-970x90 { height: 90px; }
.ad-300x250 { height: 250px; max-width: 300px; margin: 0 auto; }
.ad-300x600 { height: 600px; max-width: 300px; margin: 0 auto; }
.results-card .ad-frame { margin: 16px 0 0; }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; margin: 14px 0; border: 1.5px solid var(--ink); border-radius: var(--radius-sm); }
table.data {
  width: 100%; border-collapse: collapse; background: var(--surface);
  font-variant-numeric: tabular-nums;
}
table.data th {
  background: var(--surface-2); text-align: right;
  font-family: var(--font-mono); font-weight: 700; font-size: 12px;
  padding: 9px 13px; border-bottom: 1.5px solid var(--ink); white-space: nowrap;
}
table.data td {
  font-family: var(--font-mono); font-size: 13px;
  padding: 8px 13px; border-bottom: 1px solid var(--border-soft);
}
table.data tr:last-child td { border-bottom: none; }
table.data tr.hl td { background: var(--accent-soft); font-weight: 700; }

/* ---------- article ---------- */
.article { max-width: 760px; margin-top: 34px; }
.article h2 { font-size: 24px; line-height: 1.35; }
.article ul, .article ol { padding-inline-start: 22px; margin: 0 0 1em; }
.article li { margin-bottom: .35em; }
.callout {
  border-inline-start: 4px solid var(--accent-dot); background: var(--accent-soft);
  border-radius: var(--radius-sm); padding: 13px 16px; margin: 16px 0; font-size: .95rem;
}
.callout.warn { border-color: var(--amber); background: var(--amber-soft); }

.faq details {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 9px; background: var(--surface); overflow: hidden;
}
.faq summary {
  cursor: pointer; font-weight: 500; padding: 13px 16px; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); font-weight: 700; font-size: 1.1rem; color: var(--text-3); flex: none; }
.faq details[open] summary::after { content: "–"; }
.faq .faq-a { padding: 0 16px 14px; color: var(--text-2); }

.sources { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); margin-top: 26px; }
.sources a { color: var(--text-3); text-decoration: underline; }

/* ---------- related + guide card ---------- */
.related { margin-top: 36px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px; padding: 8px 16px; font-size: .9rem; color: var(--text);
  transition: all .12s;
}
.chip:hover { border-color: var(--ink); color: var(--text); text-decoration: none; box-shadow: var(--shadow); }

.guide-card {
  margin-top: 18px; max-width: 480px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px;
}
.guide-card h3 { font-size: 15px; margin: 0 0 6px; }
.guide-card p { font-size: 13px; color: var(--text-2); margin: 0 0 8px; line-height: 1.55; }
.guide-card a { font-size: 13px; font-weight: 500; }

/* ---------- homepage ---------- */
.hero { text-align: center; padding: 44px 0 30px; }
.hero h1 { font-size: clamp(1.9rem, 5vw, 2.75rem); line-height: 1.32; margin-bottom: 12px; }
.hero h1 .hl {
  background-image: linear-gradient(transparent 64%, rgba(210, 72, 31, .3) 64%);
}
.hero p { color: var(--text-2); font-size: 1.08rem; max-width: 620px; margin: 0 auto 22px; }
.hero-search {
  max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--radius);
  padding: 8px 10px; box-shadow: var(--shadow-lg); cursor: text;
}
.hero-search:focus-within { box-shadow: var(--focus-ring); }
.hero-search svg { width: 20px; height: 20px; color: var(--text-3); margin-inline-start: 8px; flex: none; }
.hero-search input { flex: 1; border: none; background: none; font: inherit; font-size: 1.05rem; color: var(--text); outline: none; min-width: 0; }

.hero-popular {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 8px; margin-top: 16px;
}
.hero-popular .hp-label { font-family: var(--font-mono); font-weight: 700; font-size: 11px; color: var(--text-3); }
.hero-popular a {
  background: var(--surface); border: 1px solid var(--border); border-radius: 4px;
  padding: 4px 12px; font-size: .85rem; color: var(--text);
}
.hero-popular a:hover { border-color: var(--ink); text-decoration: none; }

.hero-stats {
  display: flex; justify-content: center; align-items: center; gap: 0;
  margin-top: 26px; flex-wrap: wrap; color: var(--text-3); font-size: .85rem;
}
.hero-stats > span { padding: 0 24px; }
.hero-stats > span:not(:last-child) { border-inline-end: 1px solid var(--border); }
.hero-stats b {
  color: var(--text); font-family: var(--font-mono); font-size: 20px; font-weight: 700;
  display: block; font-variant-numeric: tabular-nums;
}
.hero-stats .stat-stamp { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.hero-stats .updated-badge { margin: 0 0 4px; display: inline-block; }
.hero-stats .stamp-sub { display: block; font-size: 11px; }

.fav-strip { margin: 4px 0 8px; }
.fav-strip h2 { margin: 0 0 12px; font-size: 1.1rem; }

.cat-section { margin-top: 34px; }
.cat-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 1.5px solid var(--ink);
}
.cat-head h2 { margin: 0; font-size: 22px; }
.cat-head .cat-count { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.cat-head .cat-all { margin-inline-start: auto; font-size: .85rem; font-weight: 500; white-space: nowrap; }

/* letter tile */
.t-icon {
  width: 37px; height: 37px; flex: none;
  border: 1.5px solid var(--ink); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 14px; line-height: 1;
  color: var(--text); background: transparent;
}
.t-icon.lat { font-size: 11px; letter-spacing: 0; }
.cat-head .t-icon { width: 30px; height: 30px; font-size: 13px; }
.cat-head .t-icon.lat { font-size: 10px; }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tool-card {
  display: flex; gap: 13px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 16px; color: var(--text); transition: border-color .12s, box-shadow .12s; position: relative;
}
.tool-card:hover { border-color: var(--ink); box-shadow: var(--shadow); text-decoration: none; color: var(--text); }
.tool-card .t-name { font-weight: 700; font-size: .97rem; }
.tool-card .t-desc { font-size: .82rem; color: var(--text-3); margin-top: 2px; line-height: 1.45; }

/* homepage category index */
.cat-index { margin-top: 44px; }
.cat-index h2 { font-size: 22px; }
.cat-index-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 880px) { .cat-index-grid { grid-template-columns: repeat(2, 1fr); } }
.cat-index-grid a {
  display: flex; align-items: center; gap: 11px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; color: var(--text);
}
.cat-index-grid a:hover { border-color: var(--ink); box-shadow: var(--shadow); text-decoration: none; }
.cat-index-grid .t-icon { border-color: var(--border); color: var(--text-2); width: 34px; height: 34px; }
.cat-index-grid .ci-name { font-weight: 500; font-size: .92rem; line-height: 1.3; }
.cat-index-grid .ci-count { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.cat-index-grid .ci-arrow { margin-inline-start: auto; color: var(--text-3); }

/* ---------- guide pages ---------- */
.guide-layout { display: grid; grid-template-columns: minmax(0, 760px) minmax(0, 300px); gap: 32px; align-items: start; }
@media (max-width: 880px) { .guide-layout { grid-template-columns: 1fr; } }

.guide-kicker {
  display: inline-block; border: 2px solid var(--green); color: var(--green);
  border-radius: 4px; padding: 4px 10px;
  font-family: var(--font-mono); font-weight: 700; font-size: 11px; letter-spacing: .05em;
}
.guide-head { padding: 18px 0 6px; }
.guide-head h1 { font-size: clamp(1.7rem, 4vw, 2.25rem); line-height: 1.35; max-width: 760px; margin: 12px 0 10px; }
.guide-standfirst { font-size: 16.5px; color: var(--text-2); max-width: 700px; margin: 0 0 10px; }
.guide-meta {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3);
  font-variant-numeric: tabular-nums; margin-bottom: 8px;
}

.guide-body { max-width: 760px; margin-top: 0; }
.guide-body h2 { font-size: 24px; line-height: 1.35; scroll-margin-top: 76px; }
.guide-body p { font-size: 16px; line-height: 1.8; }

.cta-band {
  background: var(--footer-bg); color: #f0ead9; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 20px 22px; margin: 26px 0;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.cta-band .cta-title { font-family: var(--font-display); font-weight: 400; font-size: 19px; color: #f0ead9; margin: 0 0 4px; }
.cta-band .cta-sub { font-size: 13.5px; color: #a89f8c; margin: 0; }
.cta-band .cta-btn {
  margin-inline-start: auto; flex: none;
  background: #d2481f; color: #fff; border-radius: var(--radius-sm);
  padding: 10px 18px; font-weight: 500; font-size: .92rem;
}
.cta-band .cta-btn:hover { background: #b23a16; color: #fff; text-decoration: none; }
@media (max-width: 640px) { .cta-band .cta-btn { margin-inline-start: 0; } }

.guide-side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 880px) { .guide-side { position: static; } }
.side-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px;
}
.side-card h3 { font-size: 15px; margin: 0 0 10px; }
.toc-card ul { list-style: none; padding: 0; margin: 0; }
.toc-card li { margin: 0; }
.toc-card a {
  display: block; padding: 5px 10px; font-size: 13px; color: var(--text-2);
  border-inline-start: 2px solid var(--border);
}
.toc-card a:hover { color: var(--accent); border-inline-start-color: var(--ink); text-decoration: none; }

.mini-calc { border: 1.5px solid var(--ink); box-shadow: var(--shadow); }
.mini-calc .mc-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 6px 0; font-size: .9rem; color: var(--text-2);
  border-bottom: 1px solid var(--border-soft);
}
.mini-calc .mc-row b { font-family: var(--font-mono); font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.mini-calc .mc-result { text-align: center; padding: 12px 0 8px; }
.mini-calc .mc-result .mc-label { font-size: .82rem; color: var(--text-2); }
.mini-calc .mc-result .mc-value {
  display: inline-block; font-family: var(--font-mono); font-weight: 700; font-size: 26px;
  font-variant-numeric: tabular-nums; padding-bottom: 4px; border-bottom: 5px double var(--ink);
}
.mini-calc .mc-link { display: block; margin-top: 10px; font-size: 13px; font-weight: 500; }
.guide-side .ad-frame { margin: 0; }

/* guide strip on category pages */
.guide-strip { margin-top: 26px; }
.guide-strip a.guide-link {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 11px 15px; margin-bottom: 8px; color: var(--text); font-size: .93rem; font-weight: 500;
}
.guide-strip a.guide-link:hover { border-color: var(--ink); box-shadow: var(--shadow); text-decoration: none; }
.guide-strip .g-min { margin-inline-start: auto; font-family: var(--font-mono); color: var(--text-3); font-size: 11.5px; flex: none; font-variant-numeric: tabular-nums; }

/* ---------- footer ---------- */
.site-footer {
  background: var(--footer-bg); margin-top: 60px;
  --ink: #f0ead9; --ink-contrast: #201d16; --accent-dot: #e0663a;
}
.footer-inner { max-width: var(--max-w); margin: 0 auto; padding: 34px 18px 26px; }
.footer-cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 26px; }
@media (max-width: 780px) { .footer-cols { grid-template-columns: 1fr 1fr; } }
.footer-cols h3 { font-family: 'Heebo', sans-serif; font-weight: 700; font-size: .95rem; margin: 0 0 10px; color: #f0ead9; }
.footer-cols ul { list-style: none; padding: 0; margin: 0; }
.footer-cols li { margin-bottom: 7px; font-size: .88rem; }
.footer-cols a { color: #cfc7b4; }
.footer-cols a:hover { color: #f0ead9; }
.site-footer .logo { color: #f0ead9; }
.site-footer .logo .logo-tag { color: #a89f8c; }
.footer-about { color: #a89f8c; font-size: .88rem; max-width: 300px; }
.footer-bottom {
  border-top: 1px solid #3a3426; margin-top: 26px; padding-top: 18px;
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
  color: #8d8574; font-family: var(--font-mono); font-size: 11.5px; font-variant-numeric: tabular-nums;
}
.footer-disclaimer { font-size: .78rem; color: #8d8574; margin-top: 14px; max-width: 720px; }

/* ---------- mobile sticky result bar ---------- */
.sticky-result {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  display: none; align-items: center; gap: 14px;
  background: var(--surface); border-top: 2px solid var(--ink);
  padding: 12px 16px;
}
.sticky-result .sr-text { min-width: 0; }
.sticky-result .sr-label {
  display: block; font-family: var(--font-mono); font-weight: 700; font-size: 10.5px;
  color: var(--text-2); letter-spacing: .03em;
}
.sticky-result .sr-value {
  display: inline-block; font-family: var(--font-mono); font-weight: 700; font-size: 23px;
  font-variant-numeric: tabular-nums; color: var(--text); line-height: 1.25;
  padding-bottom: 3px; border-bottom: 4px double var(--ink); white-space: nowrap;
}
.sticky-result .sr-btn {
  margin-inline-start: auto; flex: none; min-height: 44px;
  display: inline-flex; align-items: center;
  background: var(--ink); color: var(--ink-contrast); border: none; cursor: pointer;
  border-radius: var(--radius-sm); padding: 0 18px; font: inherit; font-size: .9rem; font-weight: 500;
}
@media (max-width: 880px) {
  .sticky-result.visible { display: flex; }
  body.sticky-pad { padding-bottom: 96px; }
}

/* ---------- print ---------- */
@media print {
  .site-header, .site-footer, .cat-nav, .result-actions, .related, .breadcrumb,
  .search-overlay, .article .faq summary::after, .fav-btn,
  .ad-frame, .sticky-result { display: none !important; }
  body { background: #fff; background-image: none; color: #000; }
  .card, .calc-layout > .card { box-shadow: none; border-color: #999; }
  .calc-layout { grid-template-columns: 1fr; }
  .faq details { page-break-inside: avoid; }
  .faq details:not([open]) .faq-a { display: block; }
}

/* ---------- misc ---------- */
.fav-btn {
  position: absolute; top: 10px; inset-inline-end: 10px;
  background: none; border: none; cursor: pointer; color: var(--text-3);
  font-size: 1.05rem; padding: 4px; border-radius: 4px; line-height: 1;
}
.fav-btn:hover { color: var(--amber); }
.fav-btn.on { color: var(--amber); }

.notice-top {
  background: var(--blue-soft); color: var(--blue); font-size: .85rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 13px; margin-bottom: 14px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

::selection { background: var(--accent-soft); }
