/* Shared styles for the free tools under /tools/ (task 22). Tokens copied from landing/index.html. */
@font-face { font-family: "Anton"; src: url("/fonts/anton-latin-400-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; src: url("/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "JetBrains Mono"; font-weight: 700; src: url("/fonts/jetbrains-mono-latin-700-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Source Serif 4"; font-weight: 400; src: url("/fonts/source-serif-4-latin-400-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Source Serif 4"; font-weight: 600; src: url("/fonts/source-serif-4-latin-600-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Libre Franklin"; font-weight: 400; src: url("/fonts/libre-franklin-latin-400-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Libre Franklin"; font-weight: 700; src: url("/fonts/libre-franklin-latin-700-normal.woff2") format("woff2"); font-display: swap; }

:root {
  --paper: #F3EFE6; --paper-2: #EAE5D9; --ink: #111417; --ink-2: #454B52; --ink-3: #61676E; --hair: #CFCBC2;
  --accent: #0E6A70; --accent-tint: #C6E6E1; --night: #16191C;
  --p2: #454605; --p2n: #A1A368;
  --cold: #2D416D; --high: #9A4A00; --extreme: #8E1B1B;
  --f-display: "Anton", Impact, "Arial Narrow", sans-serif;
  --f-mono: "JetBrains Mono", "Courier New", monospace;
  --f-text: "Source Serif 4", Georgia, serif;
  --f-label: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  --w: 760px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--f-text); font-size: 18px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: var(--w); margin: 0 auto; padding: 0 16px; }
p { margin: 0 0 14px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 400; line-height: 1.05; margin: 0 0 14px; }
h1 { font-size: clamp(36px, 9vw, 60px); }
h2 { font-size: clamp(26px, 6vw, 38px); text-transform: uppercase; }
h3 { font-family: var(--f-label); font-weight: 700; font-size: 18px; line-height: 1.3; }
.mono, .kicker { font-family: var(--f-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.kicker { color: var(--accent); margin: 0 0 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }


header.intro { padding: 22px 0 8px; }
@media (max-width: 420px) { .kicker { font-size: 11px; letter-spacing: .06em; } }
header.intro p { font-size: 17px; color: var(--ink-2); margin-bottom: 12px; }

section { padding: 30px 0; border-top: 1px solid var(--hair); }
section.tool { border-top: 0; padding-top: 4px; }

/* Tool card */
.card { background: #fff; border: 1px solid var(--hair); border-radius: 8px; padding: 16px; }
.card + .card { margin-top: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span, .label { font-family: var(--f-label); font-size: 13px; font-weight: 700; color: var(--ink-2); letter-spacing: .02em; }
input[type=text], input[type=number], select {
  font-family: var(--f-mono); font-size: 20px; color: var(--ink); background: var(--paper); border: 1.5px solid #9C988F; border-radius: 6px;
  min-height: 48px; padding: 8px 10px; width: 100%;
}
input:focus, select:focus { border-color: var(--accent); }
.mmss { display: flex; align-items: center; gap: 4px; }
.mmss input { width: 3.4em; text-align: center; padding: 8px 4px; }
.mmss .h { width: 2.6em; }
.mmss b { font-family: var(--f-mono); font-size: 20px; }
.unit { font-family: var(--f-mono); font-size: 13px; color: var(--ink-3); }
.msg { font-family: var(--f-label); font-size: 15px; color: var(--extreme); margin: 10px 0 0; min-height: 0; }
.msg:empty { display: none; }

/* Toggles */
.toggle { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 6px; overflow: hidden; }
.toggle button { font-family: var(--f-label); font-weight: 700; font-size: 15px; background: #fff; color: var(--ink); border: 0; min-height: 48px; min-width: 56px; padding: 0 12px; cursor: pointer; }
.toggle button[aria-pressed=true] { background: var(--ink); color: #fff; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices label { position: relative; }
.choices input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choices span { display: inline-flex; align-items: center; min-height: 48px; padding: 0 12px; border: 1.5px solid #9C988F; border-radius: 6px; font-family: var(--f-label); font-size: 15px; font-weight: 700; background: #fff; cursor: pointer; }
.choices input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.choices input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; font-family: var(--f-label); font-weight: 700; font-size: 17px; text-decoration: none; background: var(--accent); color: #fff; padding: 12px 22px; border-radius: 6px; min-height: 52px; border: 0; cursor: pointer; text-align: center; }
.btn:hover { background: #0A5559; }
.btn--ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn--ghost:hover { background: var(--accent-tint); }
.btn--light { background: var(--p2n); color: var(--night); }
.btn--light:hover { background: #B6B87E; }
.linkbtn { font: inherit; font-family: var(--f-label); font-size: 15px; font-weight: 700; color: var(--accent); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; min-height: 48px; }

/* Result */
.result.stale { opacity: .35; }
.result { margin-top: 14px; padding: 14px 16px; border-left: 5px solid var(--accent); background: var(--paper); border-radius: 0 6px 6px 0; }
.big { font-family: var(--f-display); font-size: clamp(34px, 9vw, 48px); line-height: 1.05; }
.hedge { font-size: 15px; color: var(--ink-2); margin: 8px 0 0; }
.rot { display: inline-block; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--ink-3); color: var(--ink-2); border-radius: 3px; padding: 0 5px; vertical-align: 2px; white-space: nowrap; font-weight: 400; }
sup.cite { font-family: var(--f-mono); font-size: 11px; line-height: 0; margin-left: 1px; }
sup.cite a { text-decoration: none; }

/* Tables */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; }
table.chart { border-collapse: collapse; width: 100%; font-family: var(--f-mono); font-size: 14px; background: #fff; }
table.chart caption { text-align: left; font-family: var(--f-label); font-weight: 700; font-size: 16px; padding: 0 0 8px; }
table.chart th, table.chart td { padding: 8px 8px; border-bottom: 1px solid var(--hair); text-align: right; white-space: nowrap; }
table.chart thead th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); background: var(--paper-2); }
table.chart tbody th { text-align: left; }
table.chart tr.on th, table.chart tr.on td { background: var(--accent-tint); font-weight: 700; }
table.chart--wear { font-family: var(--f-text); font-size: 15px; }
table.chart--wear th, table.chart--wear td { text-align: left; white-space: normal; vertical-align: top; }
table.chart--wear tbody th { font-family: var(--f-mono); font-size: 13px; width: 30%; }
.chart-note { font-size: 15px; color: var(--ink-2); margin-top: 8px; }

ol.sources { font-size: 14px; color: var(--ink-2); padding-left: 22px; }
ol.sources li { margin-bottom: 6px; overflow-wrap: anywhere; }
ol.sources li:target { background: var(--accent-tint); }

.emergency { border-left: 5px solid var(--extreme); background: #fff; padding: 12px 14px; border-radius: 0 6px 6px 0; font-size: 16px; }
.alert { border: 2px solid var(--extreme); background: #FFF4F2; border-radius: 6px; padding: 12px 14px; margin-top: 12px; font-size: 16px; }
.alert--cold { border-color: var(--cold); background: #EEF2FA; }
.alert b { font-family: var(--f-label); }
.disclaimer { font-size: 14px; color: var(--ink-3); }

/* Book block */
.book { background: var(--night); color: #E8E2D6; border-top: 0; padding: 36px 0 40px; }
.book .kicker { color: var(--p2n); }
.book h2 { color: #F3EFE6; text-transform: none; font-size: clamp(26px, 6.5vw, 36px); }
.book h2 em { font-style: italic; font-family: var(--f-text); font-weight: 600; text-transform: none; }
.book p { color: #D9D4C9; font-size: 17px; }
.book .btns { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 12px; }
.book .btn--ghost { color: #F3EFE6; border-color: #F3EFE6; }
.book .btn--ghost:hover { background: rgba(255,255,255,.08); }
.book small { font-family: var(--f-label); font-size: 14px; color: #B8B2A7; }
.book small a { color: #F3EFE6; display: inline-flex; align-items: center; min-height: 48px; padding: 0 4px; }

/* Footer */

/* Hub */
.tools-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.tools-list a { display: block; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--hair); border-left: 5px solid var(--accent); border-radius: 6px; padding: 16px 18px; }
.tools-list a:hover { border-color: var(--accent); }
.tools-list b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 26px; line-height: 1.1; margin-bottom: 6px; }
.tools-list span { display: block; font-size: 16px; color: var(--ink-2); }
.tools-list .go { display: inline-block; margin-top: 8px; font-family: var(--f-label); font-weight: 700; font-size: 15px; color: var(--accent); }

.print-only { display: none; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

@media print {
  @page { margin: 12mm; }
  body { background: #fff; font-size: 11pt; }
  .no-print, .book, footer, .tool .card, header.intro p, section.how, .print-hide { display: none !important; }
  .print-only { display: block !important; }
  section { border: 0; padding: 4pt 0; }
  h2 { font-size: 14pt; margin-bottom: 4pt; }
  table.chart th, table.chart td { padding: 3pt 5pt; }
  table.chart tr.on th, table.chart tr.on td { background: none; }
  table.chart tr.on td { font-weight: 400; }
  .tablewrap { overflow: visible; margin: 0; padding: 0; }
  a { color: inherit; text-decoration: none; }
  sup.cite { display: none; }
  .print-foot { margin-top: 10pt; font-family: var(--f-mono); font-size: 8pt; text-align: center; color: #555; }
}
.chip { display: inline-block; font-family: var(--f-mono); font-size: .62em; letter-spacing: .04em; border: 1.5px solid currentColor; border-radius: 4px; padding: 1px 7px; vertical-align: .18em; }
[hidden] { display: none !important; }

/* Guide text and FAQ under each tool (task 23, step 2) */
section.guide h2 { margin-bottom: 12px; }
section.guide p { max-width: 40em; }
.faq details { border-bottom: 1px solid var(--hair); padding: 2px 0; max-width: 40em; }
.faq summary { cursor: pointer; font-family: var(--f-label); font-weight: 700; font-size: 18px; line-height: 1.35; padding: 14px 30px 14px 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font-family: var(--f-mono); font-size: 22px; color: var(--accent); }
.faq details[open] summary::after { content: "−"; }
.faq details p { font-size: 17px; color: var(--ink-2); }
