/* Barlow is self-hosted (SIL Open Font License, see /fonts/OFL.txt): no requests to Google Fonts. */
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/barlow-regular.woff') format('woff'); }
@font-face { font-family: 'Barlow'; font-style: italic; font-weight: 400; font-display: swap; src: url('fonts/barlow-italic.woff') format('woff'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/barlow-medium.woff') format('woff'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/barlow-semibold.woff') format('woff'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/barlow-bold.woff') format('woff'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 800; font-display: swap; src: url('fonts/barlow-extrabold.woff') format('woff'); }

/* Yardstickly: drywall-grey paper, graphite ink, and one bold thing: the tape-measure yellow tally card. */
:root {
  --paper: #EDF0EC;
  --surface: #FFFFFF;
  --ink: #1C2320;
  --steel: #55635E;
  --rule: #C8CFCA;
  --tape: #F2B705;
  --tape-deep: #C99400;
  --error: #A8231A;
  --focus: #1D5FD1;
  --radius-input: 6px;
  --radius-card: 4px;
  --font: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-cond: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151A18;
    --surface: #1E2522;
    --ink: #E6EBE8;
    --steel: #A2AFAA;
    --rule: #34403B;
    --error: #FF8A80;
    --focus: #8AB4FF;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #151A18; --surface: #1E2522; --ink: #E6EBE8; --steel: #A2AFAA; --rule: #34403B; --error: #FF8A80; --focus: #8AB4FF; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--font);
  font-feature-settings: 'tnum' 1;
}
img, svg { max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--tape-deep); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

.wrap { width: min(1120px, 100%); margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .wrap { padding: 0 28px; } }

/* ---------- header ---------- */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 6px; }
.brand { font: 700 1.6rem/1 var(--font-cond); letter-spacing: 0.01em; text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.brand::before { content: ''; width: 22px; height: 14px; background: var(--tape); border: 2px solid var(--ink); border-radius: 2px; }
.country select { font: 600 0.95rem var(--font); color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-input); padding: 6px 28px 6px 10px; min-height: 40px; }
.tools-nav { display: flex; gap: 4px 18px; flex-wrap: wrap; padding-bottom: 10px; }
.tools-nav a { text-decoration: none; color: var(--steel); font-weight: 500; padding: 6px 0; border-bottom: 2px solid transparent; }
.tools-nav a:hover, .tools-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--tape); }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--font-cond); line-height: 1.1; margin: 0 0 0.4em; letter-spacing: -0.012em; text-wrap: balance; }
h1 { font-weight: 700; font-size: clamp(2.2rem, 6vw, 3.4rem); letter-spacing: -0.005em; margin-top: 0.2em; }
h2 { font-weight: 600; font-size: 1.75rem; margin-top: 1.6em; }
h3 { font-weight: 600; font-size: 1.3rem; margin-top: 1.3em; }
.lede { font-size: 1.2rem; color: var(--steel); max-width: 60ch; margin: 0 0 1.5rem; }
.crumbs { font-size: 0.9rem; color: var(--steel); padding-top: 18px; }
.crumbs a { color: var(--steel); }
.prose { padding-bottom: 48px; }
.prose > * { max-width: 68ch; }
.prose li { max-width: 66ch; }
.prose ul { padding-left: 1.2em; }
.prose li + li { margin-top: 0.35em; }
.updated { font-size: 0.9rem; color: var(--steel); margin-top: 2.5rem; }

/* ---------- estimator layout ---------- */
.estimator-grid { display: grid; gap: 24px; align-items: start; padding-bottom: 32px; }
@media (min-width: 900px) {
  .estimator-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 40px; }
  .tally { position: sticky; top: 16px; }
}

.estimator { display: grid; gap: 20px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font: 600 1.05rem var(--font); padding: 0; margin-bottom: 8px; }
.group { border-top: 1px solid var(--rule); padding-top: 14px; }
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 16px; }
.field { display: grid; gap: 4px; align-content: start; }
.field label { font-weight: 500; font-size: 0.95rem; }
.field.w-narrow { max-width: 160px; }
.field.check { align-content: end; }
.field.check label { display: flex; gap: 10px; align-items: center; min-height: 44px; }
.field.check input { width: 20px; height: 20px; accent-color: var(--ink); }
.hint { font-size: 0.85rem; color: var(--steel); margin: 0; }
.hint.wide { grid-column: 1 / -1; }

.input-unit { display: flex; align-items: stretch; border: 1px solid var(--rule); border-radius: var(--radius-input); background: var(--surface); overflow: hidden; }
.input-unit:focus-within { outline: 3px solid var(--focus); outline-offset: 1px; }
.input-unit input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: 600 1.15rem var(--font); padding: 10px 12px; min-height: 46px; }
.input-unit input:focus { outline: none; }
.input-unit .unit { display: flex; align-items: center; padding: 0 12px; color: var(--steel); font-size: 0.9rem; border-left: 1px solid var(--rule); white-space: nowrap; }
.input-unit:has(input[aria-invalid="true"]) { border-color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }
.field-error { color: var(--error); font-size: 0.85rem; margin: 2px 0 0; font-weight: 500; }

select { font: 500 1rem var(--font); color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-input); padding: 10px; min-height: 46px; width: 100%; }

.segmented .seg-row { display: flex; flex-wrap: wrap; gap: 8px; }
.seg { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); font-weight: 500; }
.seg input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.room-row { display: contents; }
.room-label { grid-column: 1 / -1; margin: 6px 0 -6px; font-size: 0.9rem; color: var(--steel); font-weight: 500; }

.areas { display: grid; gap: 14px; }
.area-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 16px; padding-bottom: 14px; border-bottom: 1px dashed var(--rule); }
.area-row:last-child { border-bottom: 0; padding-bottom: 0; }
.area-head { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.area-head .room-label { margin: 0; }
.link-button { background: none; border: 0; padding: 8px 0; min-height: 40px; font: 500 0.95rem var(--font); color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.add-button { justify-self: start; margin-top: 12px; background: var(--surface); color: var(--ink); border: 1px dashed var(--ink); border-radius: var(--radius-input); min-height: 44px; padding: 8px 16px; font: 600 0.95rem var(--font); cursor: pointer; }
.add-button:hover { border-style: solid; }
.group > .hint { margin-top: 8px; }

.optional { border-top: 1px solid var(--rule); padding-top: 14px; }
.optional summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.optional[open] summary { margin-bottom: 12px; }

.calc-button, .tally-actions button {
  font: 600 1rem var(--font); cursor: pointer; border-radius: var(--radius-input); min-height: 46px; padding: 10px 18px;
}
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.calc-button { background: var(--ink); color: var(--paper); border: 2px solid var(--ink); }
.calc-button:hover { background: transparent; color: var(--ink); }
.reset-button { font: 500 1rem var(--font); background: none; border: 0; color: var(--steel); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 46px; padding: 10px 6px; }
.reset-button:hover { color: var(--ink); }
@media (min-width: 900px) { .calc-button { display: none; } } /* results update live beside the form */

/* related calculators */
.related { margin-top: 2.5rem; border-top: 2px solid var(--ink); padding-top: 4px; }
.related ul { list-style: none; padding: 0; margin: 0; }
.related li { display: grid; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--rule); max-width: none; }
.related a { font: 600 1.15rem var(--font-cond); }
.related span { color: var(--steel); font-size: 0.93rem; }

/* ---------- the tally card: the one loud element ---------- */
.tally {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.tape {
  height: 30px;
  background-color: var(--tape);
  background-image:
    repeating-linear-gradient(90deg, #1C2320 0 2px, transparent 2px 48px),
    repeating-linear-gradient(90deg, #1C2320 0 1px, transparent 1px 12px);
  background-size: 100% 16px, 100% 8px;
  background-position: 0 0, 0 0;
  background-repeat: repeat-x;
  border-bottom: 2px solid var(--ink);
}
.tally > div[data-body], .tally-empty, .ticket > p, .ticket > a { padding-left: 20px; padding-right: 20px; }
.tally-empty { padding-top: 22px; padding-bottom: 22px; color: var(--steel); }
.tally-empty p { margin: 0; }
.tally-big { margin: 18px 0 2px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.tally-big .n { font: 800 clamp(3.6rem, 12vw, 5rem)/0.9 var(--font-cond); letter-spacing: -0.02em; }
.tally-big .u { font: 600 1.35rem/1.1 var(--font-cond); }
.tally-sub { margin: 4px 0 14px; color: var(--steel); }
.tally-h { font: 600 1.05rem var(--font); margin: 0 0 6px; }
.tally-list { list-style: none; margin: 0 0 16px; padding: 0; border-top: 1px dashed var(--rule); }
.tally-list li { display: grid; grid-template-columns: 4.2em 1fr; gap: 0 8px; padding: 9px 0; border-bottom: 1px dashed var(--rule); }
.tally-list .qty { font: 700 1.15rem var(--font-cond); }
.tally-list .note { grid-column: 2; font-size: 0.88rem; color: var(--steel); }
.tally-rows { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; margin: 0 0 16px; font-size: 0.95rem; }
.tally-rows dt { color: var(--steel); }
.tally-rows dd { margin: 0; text-align: right; font-weight: 600; }
.tally-warn p { margin: 0 0 12px; padding: 10px 12px; border-left: 4px solid var(--tape); background: color-mix(in srgb, var(--tape) 12%, var(--surface)); font-size: 0.93rem; }
.tally-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 20px 18px; border-top: 1px solid var(--rule); }
.tally-actions button { background: var(--surface); color: var(--ink); border: 1px solid var(--ink); }
.tally-actions button:hover { background: var(--ink); color: var(--paper); }

/* ---------- home ---------- */
.hero { display: grid; gap: 28px; padding-top: 28px; padding-bottom: 36px; align-items: center; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.2fr 0.8fr; gap: 56px; padding-top: 48px; padding-bottom: 56px; } }
.hero h1 { font-size: clamp(2.5rem, 7vw, 4.2rem); max-width: 14ch; }
.ticket { transform: rotate(-1.2deg); max-width: 420px; }
@media (prefers-reduced-motion: no-preference) {
  .ticket { animation: ticket-in 600ms cubic-bezier(.2,.8,.2,1) both; }
  @keyframes ticket-in { from { transform: translateY(14px) rotate(-3deg); opacity: 0; } to { transform: rotate(-1.2deg); opacity: 1; } }
}
.ticket-title { margin: 16px 0 0; font-weight: 600; }
.ticket .tally-sub { margin-bottom: 8px; }
.ticket-link { display: inline-block; margin-bottom: 18px; font-weight: 600; }

.tools h2 { margin-top: 0; }
.tool-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.tool-list li { border-bottom: 1px solid var(--rule); }
.tool-list a { display: grid; gap: 2px 24px; padding: 16px 4px; text-decoration: none; }
@media (min-width: 760px) { .tool-list a { grid-template-columns: 14rem 1fr auto; align-items: baseline; } }
.tool-list a:hover { background: color-mix(in srgb, var(--tape) 16%, transparent); }
.tool-name { font: 700 1.5rem var(--font-cond); }
.tool-gives { font-weight: 500; }
.tool-sample { color: var(--steel); font-size: 0.9rem; }
.home-why { padding-top: 12px; }

/* ---------- ads & footer ---------- */
.ad { margin: 28px 0; padding-top: 6px; border-top: 1px solid var(--rule); min-height: 120px; }
.ad-label { font-size: 0.75rem; color: var(--steel); margin: 0 0 6px; }
.site-footer { border-top: 2px solid var(--ink); margin-top: 24px; padding: 24px 0 32px; font-size: 0.93rem; }
.footer-grid { display: grid; gap: 12px; }
.footer-grid nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-note, .copyright { color: var(--steel); margin: 0; max-width: 70ch; }

/* ---------- print: only the shopping list ---------- */
@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .estimator, .prose, .crumbs, .lede, .tally-actions, .ad, .skip { display: none !important; }
  .estimator-grid { display: block; }
  .tally { border: 1px solid #000; position: static; }
  .tape { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- guides ---------- */
.article { padding-top: 0; }
.byline { color: var(--steel); font-size: 0.93rem; margin: 0 0 1.2rem; }
.answer { border: 2px solid var(--ink); border-left-width: 10px; border-left-color: var(--tape); background: var(--surface); padding: 14px 18px; margin: 0 0 1.5rem; border-radius: var(--radius-card); }
.answer p { margin: 0; font-size: 1.1rem; }
.prose ol { padding-left: 1.4em; }
.prose ol li + li { margin-top: 0.35em; }
.table-wrap { overflow-x: auto; margin: 1.2rem 0 1.6rem; max-width: 100%; }
.prose .table-wrap { max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
caption { text-align: left; font-weight: 600; padding-bottom: 8px; caption-side: top; }
th, td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
thead th { border-bottom: 2px solid var(--ink); font-weight: 600; white-space: nowrap; }
tbody th { font-weight: 500; }
.num { text-align: right; white-space: nowrap; padding-left: 12px; padding-right: 0; }
.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin: 2rem 0; padding: 16px 18px; background: color-mix(in srgb, var(--tape) 22%, var(--surface)); border: 2px solid var(--ink); border-radius: var(--radius-card); }
.prose .cta { max-width: 68ch; }
.cta-text { margin: 0; font-weight: 500; flex: 1 1 260px; }
.cta-link { display: inline-flex; align-items: center; min-height: 46px; padding: 10px 18px; background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 600; border-radius: var(--radius-input); }
.cta-link:hover { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.sources ol { font-size: 0.93rem; }
.guide-list { list-style: none; padding: 0; margin: 0 0 1.5rem; border-top: 2px solid var(--ink); }
.guide-list li { display: grid; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--rule); max-width: none; }
.guide-list a { font: 600 1.2rem var(--font-cond); }
.guide-list span { color: var(--steel); font-size: 0.93rem; }

/* ---------- embed page and widgets ---------- */
@media (min-width: 900px) { .calc-button.show { display: inline-flex; align-items: center; } }
.embed-grid { display: grid; gap: 28px; align-items: start; padding-bottom: 24px; }
@media (min-width: 900px) { .embed-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; } }
textarea { width: 100%; font: 0.85rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-input); padding: 10px 12px; resize: vertical; }
.embed-preview { border: 1px dashed var(--rule); border-radius: var(--radius-card); padding: 12px; background: var(--paper); }
.preview-label { margin: 0 0 8px; font-size: 0.85rem; color: var(--steel); }
.embed-preview iframe { display: block; width: 100%; max-width: 520px; }

body.embed { background: var(--surface); font-size: 1rem; }
.widget { padding: 12px 14px 10px; display: grid; gap: 12px; max-width: 520px; }
.widget-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.widget h1 { font-size: 1.5rem; margin: 0; }
.widget .estimator { gap: 12px; }
.widget .group-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px 12px; }
.widget .segmented legend { font-size: 0.95rem; margin-bottom: 6px; }
.widget .seg span { min-height: 40px; padding: 6px 14px; }
.tally.compact .tally-big { margin-top: 12px; }
.tally.compact .tally-big .n { font-size: 3.2rem; }
.tally.compact .tally-empty { padding-top: 14px; padding-bottom: 14px; }
.tally.compact .tape { height: 20px; background-size: 100% 12px, 100% 6px; }
.tally.compact .tally-actions { padding: 10px 20px 14px; }
.widget-full { font-weight: 600; }
.widget-credit { margin: 0; font-size: 0.85rem; color: var(--steel); }

/* ---------- share and social ---------- */
.share { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 2rem 0 1rem; padding-top: 12px; border-top: 1px solid var(--rule); }
.share-label { margin: 0; font-weight: 600; }
.share ul { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; margin: 0; padding: 0; }
.share li { margin: 0; }
.share a { display: inline-block; padding: 6px 0; min-height: 32px; }
.social { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; }
.social span { color: var(--steel); }

/* ---------- research ---------- */
.cite { border-left: 4px solid var(--tape); padding: 4px 0 4px 16px; margin: 2rem 0; }
.cite h2 { margin-top: 0; font-size: 1.3rem; }
.cite p { margin: 0; font-size: 0.95rem; overflow-wrap: anywhere; }
.bars { margin: 1rem 0 2rem; }
.prose .bars { max-width: 100%; }
.bar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bar-list li, .bar-axis { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) 3.6rem; gap: 10px; align-items: center; max-width: none; }
.bar-label { font-size: 0.9rem; line-height: 1.25; }
.bar-label small { color: var(--steel); display: block; }
.bar-track { position: relative; height: 18px; background: color-mix(in srgb, var(--rule) 45%, transparent); border-radius: 2px; }
.bar { position: absolute; inset: 0 auto 0 0; background: var(--ink); border-radius: 2px; }
.bar.derived { background: var(--steel); opacity: 0.6; }
.bar-value { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; font-size: 0.9rem; }
.bar-axis { margin-top: 4px; }
.bar-ticks { position: relative; height: 1.2em; font-size: 0.75rem; color: var(--steel); }
.bar-ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.bar-ticks span:first-child { transform: none; }
.bar-ticks span:last-child { transform: translateX(-100%); }
@media (max-width: 520px) { .bar-list li, .bar-axis { grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr) 3.2rem; } }

/* ---------- phone result bar ---------- */
.result-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; align-items: baseline; gap: 8px; padding: 12px max(16px, env(safe-area-inset-left, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--tape); color: #1C2320; border-top: 2px solid #1C2320; text-decoration: none; font-weight: 600; }
.result-bar .rb-n { font: 700 1.6rem/1 var(--font-cond); }
.result-bar .rb-u { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-bar .rb-go { text-decoration: underline; text-underline-offset: 3px; }
.format-hint { margin-top: -10px; }
body.has-result-bar { padding-bottom: 64px; }

/* ---------- contact form ---------- */
.contact-form { display: grid; gap: 16px; max-width: 560px; margin: 1.5rem 0; padding: 20px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-card); }
.contact-form input[type="text"], .contact-form input[type="email"], .contact-form input[type="url"], .contact-form textarea {
  width: 100%; font: 500 1rem/1.45 var(--font); color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius-input); padding: 10px 12px; min-height: 46px; }
.contact-form textarea { resize: vertical; min-height: 140px; }
.contact-form input:focus-visible, .contact-form textarea:focus-visible, .contact-form select:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.contact-form .calc-button { justify-self: start; display: inline-flex; align-items: center; }
.optional-tag { color: var(--steel); font-weight: 400; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 0; padding: 12px 14px; border-radius: var(--radius-input); border-left: 4px solid var(--tape); background: var(--paper); }
.form-status.error { border-left-color: var(--error); }
.form-status:focus { outline: none; }

/* ---------- editor ---------- */
.editor-card { border-left: 4px solid var(--tape); padding: 4px 0 4px 16px; }
.editor-card p { margin: 0.4em 0; }
.editor-name { font-size: 1.1rem; }

/* ---------- diagrams and photos in guides ---------- */
.figure { margin: 1.6rem 0; max-width: 68ch; }
.figure svg { display: block; width: 100%; height: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-card); }
.figure img { display: block; width: 100%; height: auto; border-radius: var(--radius-card); background: var(--rule); }
.figure figcaption { font-size: 0.9rem; color: var(--steel); margin-top: 8px; }
.figure .credit { display: block; font-size: 0.8rem; margin-top: 2px; }
.dg-ink { stroke: var(--ink); fill: none; }
.dg-text { fill: var(--ink); font: 500 19px var(--font); }
.dg-dot { fill: var(--ink); }
.dg-note { fill: var(--steel); font: 500 16px var(--font); }
.dg-tape { fill: var(--tape); }
.dg-soil { fill: #A48B6A; }
.dg-soil-dark { fill: #7A6248; }
.dg-gravel { fill: #9AA19D; }
.dg-concrete { fill: #C9CCC8; }
.dg-wood { fill: #C79A63; }
.dg-mulch { fill: #6B4A2E; }
.dg-grass { fill: #6E9B4C; }
.dg-dim { stroke: var(--steel); stroke-width: 1.2; fill: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dg-concrete { fill: #8E928F; } }
.tool-group { font-size: 1.15rem; font-weight: 600; color: var(--steel); text-transform: uppercase; letter-spacing: 0.06em; margin: 1.8em 0 0.5em; }
.tools > .tool-group:first-of-type, .tools h2 + .tool-group { margin-top: 0.6em; }
/* A halo behind diagram labels keeps them readable over soil, gravel and wood in both themes. */
.dg-text, .dg-note { paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dg-soil { fill: #6E5A44; } :root:not([data-theme="light"]) .dg-wood { fill: #9C7A4E; } }
:root[data-theme="dark"] .dg-soil { fill: #6E5A44; }
