/* Calorie Intake Calculator — design tokens */
:root {
  --paper: #fbfcf8;
  --white: #ffffff;
  --ink: #1b211d;
  --ink-2: #4a554e;
  --ink-3: #6b766f;
  --line: #d8dfd5;
  --mist: #edf2ea;
  --leaf: #1d5c38;
  --leaf-2: #2c7a4c;
  --citrus: #f2c230;
  --citrus-soft: #fdf3cf;
  --warn-bg: #fff4e5;
  --warn-ink: #7a4300;
  --label-ink: #000;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --r-s: 6px;
  --r-m: 12px;
  --gutter: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 var(--sans);
  font-variation-settings: "wdth" 100;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--leaf); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--leaf-2); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--citrus); outline-offset: 2px; border-radius: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 50; }
.skip:focus { left: 8px; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--sans); color: var(--ink); margin: 0; line-height: 1.08; }
h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.6rem);
  font-weight: 850;
  font-variation-settings: "wdth" 72;
  letter-spacing: -0.01em;
}
h2 {
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  font-weight: 800;
  font-variation-settings: "wdth" 78;
  margin-top: 2.4em;
  margin-bottom: 0.5em;
}
h3 { font-size: 1.18rem; font-weight: 700; margin-top: 1.8em; margin-bottom: 0.4em; line-height: 1.25; }
p { margin: 0 0 1em; }
.lede { font-size: 1.14rem; color: var(--ink-2); max-width: 58ch; margin-top: 0.8em; }
.muted { color: var(--ink-3); }
small { font-size: 0.82em; }

/* ---------- header ---------- */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-name { font-weight: 800; font-variation-settings: "wdth" 78; font-size: 1.22rem; line-height: 1.1; letter-spacing: -0.005em; white-space: nowrap; }
@media (max-width: 360px) { .brand-name { font-size: 1.05rem; } }

.nav-desktop { display: flex; align-items: center; gap: 18px; }
.nav-top { list-style: none; display: flex; margin: 0; padding: 0; gap: 2px; }
.nav-top > li { position: relative; }
.nav-top > li > a { display: flex; align-items: center; gap: 6px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 0.95rem; padding: 23px 12px; }
.nav-top > li > a:hover, .dd:hover > a, .dd:focus-within > a { color: var(--ink); }
.nav-top > li > a[aria-current="page"] { color: var(--leaf); box-shadow: inset 0 -3px 0 var(--leaf); }
.chev { width: 10px; height: 7px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: transform .15s; }
.dd:hover .chev, .dd:focus-within .chev { transform: rotate(180deg); }
.nav-cta { display: inline-flex; align-items: center; background: var(--leaf); color: #fff; text-decoration: none; font-weight: 700; font-size: 0.92rem; padding: 10px 16px; border-radius: var(--r-s); white-space: nowrap; }
.nav-cta:hover { background: var(--leaf-2); color: #fff; text-decoration: none; }

.dd-panel {
  position: absolute; top: 100%; left: -12px; min-width: 340px;
  background: var(--white); border: 1px solid var(--line); border-top: 3px solid var(--leaf);
  border-radius: 0 0 var(--r-m) var(--r-m); box-shadow: 0 18px 40px rgba(27, 33, 29, 0.12);
  padding: 10px; display: none;
}
.dd-wide { width: 640px; }
.dd:hover .dd-panel, .dd:focus-within .dd-panel { display: block; }
.dd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.dd-grid a, .dd-list a { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-s); text-decoration: none; color: var(--ink); }
.dd-grid a:hover, .dd-list a:hover, .dd-grid a:focus-visible, .dd-list a:focus-visible { background: var(--mist); }
.dd-grid a[aria-current="page"], .dd-list a[aria-current="page"] { background: var(--citrus-soft); }
.dd-grid b, .dd-list b { display: block; font-size: 0.95rem; font-weight: 700; line-height: 1.3; }
.dd-grid small, .dd-list small { display: block; color: var(--ink-3); font-size: 0.83rem; line-height: 1.35; margin-top: 2px; }
.dd-list { list-style: none; margin: 0; padding: 0; }
.dd-list a { display: block; }
.ico { width: 22px; height: 22px; flex: none; margin-top: 1px; fill: none; stroke: var(--leaf); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dd-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; padding: 10px 12px 4px; border-top: 1px solid var(--line); font-size: 0.86rem; color: var(--ink-3); }
.dd-foot a { font-weight: 700; }

.nav-toggle { display: none; }
.nav-toggle summary { list-style: none; cursor: pointer; display: grid; gap: 5px; padding: 12px 8px; }
.nav-toggle summary::-webkit-details-marker { display: none; }
.nav-toggle summary span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .15s, opacity .15s; }
.nav-toggle[open] summary span:nth-child(2) { opacity: 0; }
.nav-toggle[open] summary span:first-child { transform: translateY(7px) rotate(45deg); }
.nav-toggle[open] summary span:last-child { transform: translateY(-7px) rotate(-45deg); }
.nav-mobile { position: absolute; left: 0; right: 0; top: 100%; background: var(--white); border-bottom: 1px solid var(--line); padding: 16px var(--gutter) 24px; box-shadow: 0 16px 28px rgba(27, 33, 29, 0.12); max-height: calc(100vh - 68px); overflow-y: auto; }
.nav-mobile .nav-cta { display: flex; justify-content: center; padding: 13px; font-size: 1rem; }
.m-head { font-weight: 800; font-size: 0.82rem; color: var(--ink-3); margin: 20px 0 4px; }
.nav-mobile ul { list-style: none; margin: 0; padding: 0; }
.nav-mobile li a { display: block; padding: 11px 0; border-bottom: 1px solid var(--mist); color: var(--ink); text-decoration: none; font-weight: 600; }
.nav-mobile li a[aria-current="page"] { color: var(--leaf); }

@media (max-width: 1080px) { .nav-cta { display: none; } .nav-mobile .nav-cta { display: flex; } }
@media (max-width: 860px) {
  .nav-desktop { display: none; }
  .nav-toggle { display: block; }
}

/* ---------- breadcrumbs ---------- */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 18px 0 0; margin: 0; font-size: 0.86rem; color: var(--ink-3); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.crumbs a { color: var(--ink-3); }

/* ---------- calculator hero ---------- */
.tool { padding: clamp(24px, 5vw, 56px) 0 clamp(40px, 6vw, 72px); }
.tool-grid { display: grid; gap: clamp(28px, 4vw, 56px); grid-template-columns: minmax(0, 1fr) minmax(0, 400px); align-items: start; }
.tool-intro { margin-bottom: 28px; }
.tool-result { position: sticky; top: 88px; }
@media (max-width: 899px) {
  .tool-grid { grid-template-columns: 1fr; }
  .tool-result { position: static; }
}

.calc-form {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: clamp(18px, 3vw, 28px);
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; margin-top: 20px; }
.field-wide { grid-column: 1 / -1; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }
.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.field > label, .field > legend { display: block; font-weight: 650; font-size: 0.92rem; margin-bottom: 6px; padding: 0; }
.field small, .field > label small { font-weight: 400; color: var(--ink-3); }

input[type="number"], input[type="date"], select {
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--r-s);
  padding: 11px 12px;
  min-height: 48px;
  appearance: none;
  -webkit-appearance: none;
}
select {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231b211d' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
input:hover, select:hover { border-color: #b6c1b2; }
input:focus, select:focus { outline: none; border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(29, 92, 56, 0.16); background-color: var(--white); }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

.input-unit { position: relative; }
.input-unit input { padding-right: 56px; }
.input-unit span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 0.9rem; pointer-events: none; }
.input-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.calc-form[data-u="imperial"] .metric-only, .calc-form:not([data-u="imperial"]) .imperial-only { display: none; }

/* segmented control */
.seg { display: flex; border: 0; padding: 3px; margin: 0; background: var(--mist); border-radius: var(--r-s); gap: 3px; }
.seg label { flex: 1; position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; text-align: center; padding: 9px 8px; border-radius: 4px; font-weight: 650; font-size: 0.95rem; color: var(--ink-2); line-height: 1.25; }
.seg span small { display: block; font-weight: 400; font-size: 0.76rem; color: var(--ink-3); }
.seg input:checked + span { background: var(--white); color: var(--ink); box-shadow: 0 1px 2px rgba(27, 33, 29, 0.14); }
.seg input:focus-visible + span { outline: 3px solid var(--citrus); }
.seg-sm span { padding: 11px 8px; }

.advanced { grid-column: 1 / -1; margin-top: 4px; }
.advanced summary { cursor: pointer; font-weight: 650; color: var(--leaf); font-size: 0.95rem; padding: 4px 0; }
.advanced .form-grid { margin-top: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 22px; width: 100%;
  font: inherit; font-weight: 750; font-size: 1.05rem;
  background: var(--leaf); color: #fff;
  border: 0; border-radius: var(--r-s);
  padding: 14px 20px; min-height: 52px; cursor: pointer;
}
.btn:hover { background: var(--leaf-2); }
.form-error { margin: 16px 0 0; padding: 10px 12px; border-left: 4px solid #b3261e; background: #fdecea; color: #7f1d17; font-size: 0.93rem; border-radius: 0 var(--r-s) var(--r-s) 0; }

/* ---------- the Nutrition Facts label (signature element) ---------- */
.nf {
  background: var(--white);
  color: var(--label-ink);
  border: 2px solid var(--label-ink);
  padding: 8px 10px 10px;
  font-family: var(--sans);
  font-variation-settings: "wdth" 100;
  box-shadow: 8px 8px 0 var(--citrus);
}
.nf p { margin: 0; }
.nf-title { font-size: clamp(2.1rem, 6vw, 2.7rem); font-weight: 900; font-variation-settings: "wdth" 62; line-height: 1; letter-spacing: -0.005em; padding-bottom: 4px; border-bottom: 1px solid var(--label-ink); }
.nf-serving { display: flex; justify-content: space-between; font-weight: 800; font-size: 1.05rem; padding: 4px 0 2px; }
.nf-serving span { font-weight: 400; }
.nf-thick { height: 10px; background: var(--label-ink); margin: 4px -2px 2px; }
.nf-thick-end { margin-top: 2px; }
.nf-small { font-size: 0.78rem; font-weight: 800; }
.nf-cal { display: flex; justify-content: space-between; align-items: flex-end; line-height: 1; padding-bottom: 4px; }
.nf-cal span { font-size: 1.85rem; font-weight: 900; font-variation-settings: "wdth" 70; }
.nf-cal b { font-size: clamp(2.8rem, 9vw, 3.6rem); font-weight: 900; font-variation-settings: "wdth" 75; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.nf-sub { font-size: 0.86rem; padding: 4px 0 2px; border-top: 1px solid var(--label-ink); }
.nf-mid { height: 5px; background: var(--label-ink); margin: 2px -2px 0; }
.nf-row { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; align-items: baseline; padding: 5px 0 4px; border-bottom: 1px solid var(--label-ink); font-size: 0.95rem; }
.nf-row:has(em) { grid-template-columns: 1fr auto 3.2em; }
.nf-row span { font-weight: 400; }
.nf-row b { font-weight: 400; font-variant-numeric: tabular-nums; text-align: right; }
.nf-row em { font-style: normal; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.nf-bold span, .nf-bold b { font-weight: 800; }
.nf-bold b { font-weight: 500; }
.nf-indent span { padding-left: 1.2em; }
.nf-hl { background: var(--citrus-soft); margin: 0 -10px; padding-left: 10px; padding-right: 10px; }
.nf-group { font-size: 0.78rem; font-weight: 800; padding: 8px 0 3px; border-bottom: 1px solid var(--label-ink); }
.nf-note { font-size: 0.76rem; line-height: 1.4; padding-top: 6px; }
.nf .muted { color: #555; }
.nf small { color: #444; }

.bmi-bar { position: relative; height: 14px; margin: 10px 0 8px; }
.bmi-bar span { position: absolute; inset: 0; border: 1px solid #000; background: linear-gradient(90deg, #cfe3f5 0 var(--a), #bfe0c8 var(--a) var(--b), #f8e3a1 var(--b) var(--c), #f3b9a6 var(--c) 100%); }
.bmi-bar i { position: absolute; top: -5px; width: 4px; height: 24px; background: #000; transform: translateX(-2px); }

.warn { margin: 16px 0 0; padding: 12px 14px; background: var(--warn-bg); color: var(--warn-ink); border-radius: var(--r-s); font-size: 0.92rem; line-height: 1.5; }
.timeline { margin: 18px 0 0; padding: 14px 16px; background: var(--mist); border-radius: var(--r-s); font-size: 0.95rem; }
.result-extra { margin-top: 8px; }

/* goal table */
.table-wrap { overflow-x: auto; margin-top: 18px; }
table { width: 100%; border-collapse: collapse; font-size: 0.94rem; background: var(--white); }
caption { text-align: left; font-weight: 750; padding: 0 0 8px; font-size: 1rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: 0.82rem; color: var(--ink-3); font-weight: 650; border-bottom: 2px solid var(--ink); }
td { font-variant-numeric: tabular-nums; }
tbody th { font-weight: 600; }
tr.is-current { background: var(--citrus-soft); }

/* ---------- article / prose ---------- */
.content { padding: 0 0 72px; }
.prose-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 56px; }
@media (max-width: 980px) { .prose-grid { grid-template-columns: 1fr; } .aside { order: -1; } }
.prose { max-width: 70ch; font-family: var(--serif); font-size: 1.08rem; line-height: 1.72; }
.prose h2, .prose h3 { font-family: var(--sans); }
.prose h2:first-child { margin-top: 0.4em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.4em; }
.prose table { font-family: var(--sans); margin: 1.2em 0 1.6em; }
.prose .table-wrap { margin: 1.2em 0 1.6em; }
.prose .table-wrap table { margin: 0; }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 18px; border-left: 4px solid var(--citrus); color: var(--ink-2); }
.prose code { font-family: ui-monospace, Menlo, monospace; font-size: 0.86em; background: var(--mist); padding: 2px 5px; border-radius: 4px; }
.formula { font-family: var(--sans); background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--leaf); padding: 14px 16px; border-radius: 0 var(--r-s) var(--r-s) 0; margin: 1em 0 1.4em; font-size: 0.98rem; line-height: 1.6; overflow-x: auto; }
.formula b { font-weight: 700; }
.updated { font-family: var(--sans); font-size: 0.88rem; color: var(--ink-3); margin-top: 1em; }
.page-head { padding: clamp(24px, 5vw, 48px) 0 clamp(20px, 3vw, 32px); }

.aside-box { position: sticky; top: 88px; font-size: 0.93rem; }
.aside-box p { font-weight: 750; margin-bottom: 8px; }
.aside-box ul { list-style: none; padding: 0; margin: 0 0 28px; border-top: 1px solid var(--line); }
.aside-box li a { display: block; padding: 9px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink-2); }
.aside-box li a:hover { color: var(--leaf); }
.aside-box li a[aria-current="page"] { color: var(--ink); font-weight: 700; }
@media (max-width: 980px) { .aside-box { position: static; } .aside-box .toc { display: none; } .aside-box .related { display: none; } }

/* FAQ */
.faq { margin-top: 1em; font-family: var(--sans); font-size: 1rem; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 700; padding: 16px 32px 16px 0; position: relative; list-style: none; line-height: 1.4; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-size: 1.5rem; font-weight: 400; color: var(--leaf); }
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding: 0 0 16px; color: var(--ink-2); line-height: 1.65; }

/* cards for index pages — a list with rules, not a card kit */
.tool-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 2px solid var(--ink); }
.tool-list li { border-bottom: 1px solid var(--line); }
.tool-list li:nth-child(odd) { border-right: 1px solid var(--line); }
.tool-list a { display: block; padding: 20px 20px 20px 0; text-decoration: none; color: var(--ink); height: 100%; }
.tool-list li:nth-child(even) a { padding-left: 20px; }
.tool-list a:hover { background: var(--white); }
.tool-list b { display: block; font-size: 1.15rem; font-weight: 800; font-variation-settings: "wdth" 80; }
.tool-list span { color: var(--ink-2); font-size: 0.95rem; }
@media (max-width: 640px) {
  .tool-list { grid-template-columns: 1fr; }
  .tool-list li:nth-child(odd) { border-right: 0; }
  .tool-list li:nth-child(even) a { padding-left: 0; }
}

.home-more { padding: 56px 0 0; border-top: 1px solid var(--line); }
.home-more h2 { margin-top: 0; }

/* contact */
.contact-mail { font-family: var(--sans); font-size: clamp(1.3rem, 4vw, 1.9rem); font-weight: 800; font-variation-settings: "wdth" 80; word-break: break-all; }
.contact-list { font-family: var(--sans); }
.contact-list dt { font-weight: 750; margin-top: 1em; }
.contact-list dd { margin: 0.2em 0 0; color: var(--ink-2); }

/* ---------- footer ---------- */
.site-footer { background: #17201a; color: #c9d2cb; padding: 64px 0 28px; font-size: 0.93rem; }
.site-footer a { color: #e7ede8; text-decoration: none; }
.site-footer a:hover { color: var(--citrus); text-decoration: underline; }
.footer-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 48px; }
.footer-cols { display: grid; grid-template-columns: 1fr 1.25fr 0.85fr; gap: 32px; }
@media (max-width: 960px) { .footer-top { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .footer-cols { grid-template-columns: 1fr 1fr; } .footer-cols > div:nth-child(2) { order: 3; grid-column: 1 / -1; } }
@media (max-width: 400px) { .footer-cols { grid-template-columns: 1fr; } }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-brand span { font-weight: 850; font-variation-settings: "wdth" 70; font-size: 1.35rem; color: #fff; line-height: 1.1; }
.footer-brand:hover { text-decoration: none !important; }
.footer-about > p { max-width: 42ch; }
.footer-promises { list-style: none; padding: 0; margin: 18px 0 0; }
.footer-promises li { padding: 9px 0 9px 22px; border-top: 1px solid #2f3a33; position: relative; line-height: 1.5; }
.footer-promises li::before { content: ""; position: absolute; left: 2px; top: 16px; width: 9px; height: 9px; border-radius: 50%; background: var(--citrus); }
.footer-promises b { color: #fff; }
.footer-promises a { text-decoration: underline; }
.footer-head { color: #fff; font-weight: 750; margin: 0 0 8px; }
.footer-cols ul { list-style: none; padding: 0; margin: 0 0 22px; }
.footer-cols li { padding: 4px 0; line-height: 1.4; }
.footer-disclaimer { margin-top: 40px; padding-top: 22px; border-top: 1px solid #2f3a33; font-size: 0.85rem; line-height: 1.6; color: #a9b4ac; max-width: 100ch; }
.footer-disclaimer a, .footer-network a { text-decoration: underline; }
.footer-network { font-size: 0.85rem; color: #a9b4ac; }
.footer-bottom { margin-top: 22px; padding-top: 18px; border-top: 1px solid #2f3a33; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; font-size: 0.83rem; color: #8f9b93; }
.footer-bottom p { margin: 0; }

/* 404 */
.notfound { padding: 72px 0; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media print {
  .site-header, .site-footer, .calc-form, .crumbs, .to-top, .tool-actions, .content, .skip { display: none !important; }
  .nf { box-shadow: none; }
  .tool-grid { display: block; }
}

/* ---------- copy deterrent ---------- */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, select, [contenteditable], .allow-select, .allow-select * { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
img, svg { -webkit-user-drag: none; }

/* ---------- small buttons ---------- */
.tool-actions { display: flex; gap: 10px; margin-top: 14px; }
.btn-ghost {
  font: inherit; font-weight: 650; font-size: 0.92rem;
  background: transparent; color: var(--leaf);
  border: 1.5px solid var(--line); border-radius: var(--r-s);
  padding: 9px 14px; min-height: 42px; cursor: pointer;
}
.btn-ghost:hover { border-color: var(--leaf); background: var(--white); }

/* ---------- back to top ---------- */
.to-top {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--leaf); color: #fff; border: 2px solid #fff;
  box-shadow: 0 6px 18px rgba(27, 33, 29, 0.22);
  cursor: pointer; z-index: 40;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.to-top svg { width: 22px; height: 22px; }
.to-top:hover { background: var(--leaf-2); }
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }

/* ---------- home: educational blocks ---------- */
.energy { font-family: var(--sans); margin: 1.4em 0 1.6em; }
.energy-bar { display: flex; height: 56px; border: 2px solid var(--ink); background: var(--white); }
.energy-bar span { display: flex; align-items: flex-end; padding: 6px 8px; min-width: 0; border-right: 2px solid var(--ink); }
.energy-bar span:last-child { border-right: 0; }
.energy-bar b { font-size: 1.05rem; font-weight: 850; font-variation-settings: "wdth" 75; color: var(--ink); }
.e-bmr { background: var(--leaf); } .energy-bar .e-bmr b { color: #fff; }
.e-neat { background: #7fb28f; }
.e-tef { background: var(--citrus); }
.e-ex { background: #f4a259; }
.energy-key { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin: 16px 0 0; }
.energy-key dt { font-weight: 750; display: flex; align-items: center; gap: 8px; }
.energy-key dt i { width: 14px; height: 14px; border: 1.5px solid var(--ink); flex: none; }
.energy-key dd { margin: 2px 0 0 22px; color: var(--ink-2); font-size: 0.93rem; line-height: 1.5; }
@media (max-width: 560px) { .energy-key { grid-template-columns: 1fr; } .energy-bar b { font-size: 0.85rem; } }

.density { list-style: none; padding: 0; margin: 1.2em 0 0.6em; font-family: var(--sans); font-size: 0.93rem; border-top: 2px solid var(--ink); }
.density li { display: grid; grid-template-columns: minmax(9.5em, 13em) 1fr 3.2em; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); margin: 0; }
.density i { display: block; height: 12px; width: var(--w); min-width: 3px; border-radius: 0 3px 3px 0; }
.density b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.d-low i { background: #7fb28f; } .d-mid i { background: var(--leaf); } .d-high i { background: var(--citrus); } .d-top i { background: #e0803a; }
.density-key { display: flex; flex-wrap: wrap; gap: 6px 18px; font-family: var(--sans); font-size: 0.83rem; color: var(--ink-3); }
.density-key span { display: inline-flex; align-items: center; gap: 6px; }
.density-key span::before { content: ""; width: 12px; height: 12px; border-radius: 2px; }
.density-key .d-low::before { background: #7fb28f; } .density-key .d-mid::before { background: var(--leaf); }
.density-key .d-high::before { background: var(--citrus); } .density-key .d-top::before { background: #e0803a; }
@media (max-width: 520px) { .density li { grid-template-columns: 1fr 3em; } .density i { grid-column: 1 / -1; grid-row: 2; } }

.five { list-style: none; padding: 0; margin: 1.2em 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 2px solid var(--ink); background: var(--white); font-family: var(--sans); }
.five li { padding: 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0; }
.five li:nth-child(3n) { border-right: 0; }
.five li:nth-last-child(-n+3) { border-bottom: 0; }
.five b { display: block; font-size: 1.6rem; font-weight: 900; font-variation-settings: "wdth" 70; line-height: 1.05; }
.five span { display: block; font-weight: 650; margin-top: 2px; }
.five p { margin: 8px 0 0; font-size: 0.88rem; color: var(--ink-2); line-height: 1.45; }
@media (max-width: 720px) {
  .five { grid-template-columns: 1fr 1fr; }
  .five li:nth-child(3n) { border-right: 1px solid var(--line); }
  .five li:nth-child(2n) { border-right: 0; }
  .five li:nth-last-child(-n+3) { border-bottom: 1px solid var(--line); }
  .five li:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (max-width: 420px) { .five { grid-template-columns: 1fr; } .five li { border-right: 0 !important; border-bottom: 1px solid var(--line) !important; } .five li:last-child { border-bottom: 0 !important; } }

.myths { display: grid; gap: 0; margin: 1.2em 0; border-top: 2px solid var(--ink); }
.myth { padding: 16px 0; border-bottom: 1px solid var(--line); }
.myth p { margin: 0; }
.myth-claim { font-family: var(--sans); font-weight: 750; font-size: 1.05rem; margin-bottom: 6px !important; }
.myth-claim span { color: #b3261e; margin-right: 8px; }
.myth-claim span::after { content: ":"; }
.myth-fact { font-family: var(--sans); font-weight: 750; color: var(--leaf); margin-right: 6px; }
.myth-fact::after { content: ":"; }

.steps { list-style: none; counter-reset: s; padding: 0 !important; }
.steps li { counter-increment: s; position: relative; padding: 0 0 0 52px; margin-bottom: 1.1em; min-height: 36px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--leaf); color: #fff; font-family: var(--sans); font-weight: 800; display: grid; place-items: center; }

.glossary { margin: 1em 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; font-family: var(--sans); }
.glossary > div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.glossary dt { font-weight: 800; }
.glossary dd { margin: 4px 0 0; color: var(--ink-2); font-size: 0.93rem; line-height: 1.5; }
@media (max-width: 640px) { .glossary { grid-template-columns: 1fr; } }

.prose .tool-list { margin-top: 1em; font-size: 1rem; padding-left: 0; font-family: var(--sans); }
.prose .tool-list li { margin: 0; }
.tool-list-ico a { display: flex !important; gap: 12px; align-items: flex-start; }
.tool-list-ico .ico { width: 26px; height: 26px; }
.tool-list-ico a > span > span { display: block; }
.read-next { list-style: none; padding: 0 !important; margin: 1em 0; font-family: var(--sans); border-top: 2px solid var(--ink); }
.read-next li { margin: 0; border-bottom: 1px solid var(--line); }
.read-next a { display: block; padding: 14px 0; text-decoration: none; color: var(--ink); }
.read-next b { display: block; font-size: 1.08rem; }
.read-next span { color: var(--ink-2); font-size: 0.93rem; }
.read-next a:hover b { color: var(--leaf); text-decoration: underline; }
