/* Shared by every 6PT tool page (the rules that were identical in all of them). Page-specific rules stay in each page; the standard sizes are in tool-standard-1.css, loaded last.
   Changing this file: give it a new version number (tool-2.css becomes tool-5.css) and point every tool page at it. tests/tool-standard.spec.js checks they all agree. */
/* ==========================================================================
   6PT LIQUOR COST CALCULATOR
   One self-contained page (font, logo, styles and script inside). It matches the dashboard:
   Porcelain ground, white glass cards, near black text, cobalt accent, 10px corners.
   Layout: header, title and short answer, the calculator widget (three columns on a laptop,
   two on a tablet, one on a phone), then the guide that search engines read.
   ========================================================================== */
/* Title font: Bricolage Grotesque Semibold, embedded so the file stays self-contained and works offline.
   Trimmed to English plus Spanish/French accents and smart quotes (about 15 KB of font data).
   Copyright 2022 The Bricolage Grotesque Project Authors (https://github.com/ateliertriay/bricolage).
   Licensed under the SIL Open Font License, Version 1.1 (https://openfontlicense.org). */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 600;
  font-display: block;
  src: url("/assets/fonts/bricolage-grotesque-600-1.woff2") format("woff2");
}
:root {
  --bg: #F8F9FB;
  --panel: #FFFFFF;
  --glass: rgba(255, 255, 255, 0.74);
  --ink: #17191C;
  --ink-2: rgba(23, 25, 28, 0.70);
  --ink-3: rgba(23, 25, 28, 0.62);
  --rule: rgba(23, 25, 28, 0.12);
  --rule-soft: rgba(23, 25, 28, 0.08);
  --fill: rgba(23, 25, 28, 0.05);
  --accent: #214AC8;
  --accent-lift: #3D63E0;
  --accent-soft: rgba(33, 74, 200, 0.10);
  --accent-glow: rgba(33, 74, 200, 0.16);
  --good: #17703F;
  --bad: #B3261E;
  --shadow: 0 12px 30px -14px rgba(23, 25, 28, 0.20), 0 2px 6px rgba(23, 25, 28, 0.05);
  --font-title: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --radius: 10px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 8px 14px; border-radius: var(--radius); background: var(--ink); color: #fff; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
/* ---------- Header ---------- */
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-logo { display: inline-flex; align-items: center; gap: 2px; }
.brand-star { width: 1.6rem; height: 1.7rem; }
.brand-wordmark { width: 3.1rem; height: 1.1rem; }
.brand-name { padding-left: 12px; border-left: 1px solid var(--rule); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.5625rem; letter-spacing: 0.22em; text-transform: uppercase; line-height: 1.5; color: var(--ink-2); }
.brand-name b { display: block; font-weight: 500; color: var(--ink); letter-spacing: 0.3em; font-size: 0.625rem; }
/* ---------- Page ---------- */
main { position: relative; }
body { position: relative; }
body::before { content: ""; position: absolute; inset: 0 0 auto; height: 800px; pointer-events: none; z-index: -1;
  background: radial-gradient(760px 380px at 82% 0%, var(--accent-glow), transparent 70%), radial-gradient(560px 320px at 0% 12%, var(--accent-soft), transparent 70%); }
.wrap { max-width: 1240px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
main { padding-top: 22px; }
.crumbs { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; font-size: 0.8125rem; color: var(--ink-3); }
.crumbs li + li::before { content: ">"; margin-right: 8px; color: var(--ink-3); }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.hero { display: grid; gap: 8px; padding-block: 14px 22px; max-width: 820px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; justify-self: start; padding: 4px 11px 4px 8px; border: 1px solid var(--rule); border-radius: 999px; background: var(--glass); font-size: 0.75rem; font-weight: 600; color: var(--accent); }
.eyebrow svg { width: 0.95rem; height: 0.95rem; }
h1 { margin: 6px 0 2px; font-family: var(--font-title); font-weight: 600; font-size: clamp(2rem, 4.6vw, 3rem); line-height: 1.04; letter-spacing: -0.035em; text-wrap: balance; }
.answer { margin: 0; max-width: 68ch; font-size: 1.0625rem; color: var(--ink-2); }
.answer strong { color: var(--ink); }
.facts { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 4px 0 0; padding: 0; list-style: none; font-size: 0.8125rem; color: var(--ink-3); }
.facts li { display: inline-flex; align-items: center; gap: 6px; }
.facts li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: 0.7; }
/* ---------- The calculator widget ---------- */
.calc { position: relative; padding: 12px; border: 1px solid var(--rule); border-radius: 22px; background: color-mix(in srgb, #fff 55%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); box-shadow: var(--shadow); scroll-margin-top: 80px; }
.calc-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.modes { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 14px; background: var(--fill); }
.mode { display: inline-flex; align-items: center; gap: 7px; min-height: 2.4rem; padding: 6px 14px; border: 0; border-radius: 11px; background: transparent; font-weight: 700; font-size: 0.875rem; color: var(--ink-2);
  transition: background 160ms var(--ease), color 160ms var(--ease), box-shadow 160ms var(--ease); }
.mode svg { width: 1.1rem; height: 1.1rem; flex: none; }
.mode:hover { color: var(--ink); background: rgba(255, 255, 255, 0.7); }
.mode[aria-pressed="true"] { color: #fff; background: linear-gradient(180deg, var(--accent-lift), var(--accent)); box-shadow: 0 8px 18px -10px var(--accent-glow); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.sumbar { position: sticky; top: 64px; z-index: 6; display: none; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 14px; margin-bottom: 10px; padding: 8px 14px; border: 1px solid var(--rule); border-radius: 12px;
  background: color-mix(in srgb, #fff 84%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: var(--shadow); font-size: 0.75rem; color: var(--ink-2); }
.sumbar b { margin-left: 4px; font-size: 0.9375rem; color: var(--ink); }
.sumbar .big b { font-family: var(--font-title); font-size: 1.125rem; color: var(--accent); }
.calc-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas: "inputs adjust result" "chart chart eco" "bench mail mail"; align-items: stretch; }
.a-inputs { grid-area: inputs; }
.a-adjust { grid-area: adjust; }
.a-result { grid-area: result; }
.a-chart { grid-area: chart; }
.a-eco { grid-area: eco; }
.a-bench { grid-area: bench; }
.a-mail { grid-area: mail; }
@container (max-width: 1100px) {
  .calc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "inputs result" "adjust result" "chart chart" "eco bench" "mail mail"; }
  .sumbar { display: flex; }
}
@container (max-width: 720px) {
  .calc { padding: 8px; border-radius: 18px; }
  .calc-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "inputs" "result" "adjust" "chart" "eco" "bench" "mail"; }
  .mode { padding: 6px 10px; font-size: 0.8125rem; }
}
.card { min-width: 0; padding: 14px; border: 1px solid var(--rule-soft); border-radius: 16px; background: var(--panel); box-shadow: 0 1px 2px rgba(23, 25, 28, 0.04); }
.card h2 { margin: 0 0 12px; display: flex; align-items: center; gap: 8px; font-family: var(--font-title); font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; }
.card h2 svg { width: 1rem; height: 1rem; color: var(--accent); flex: none; }
.card h3 { margin: 0 0 8px; font-size: 0.75rem; font-weight: 600; color: var(--ink-2); }
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.field + .field { margin-top: 14px; }
.label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.8125rem; font-weight: 600; }
.label small { font-weight: 500; color: var(--ink-3); }
.label output, .label .val { color: var(--accent); font-weight: 700; }
.label-right { display: inline-flex; align-items: center; gap: 8px; }
.hint { margin: 0; font-size: 0.75rem; color: var(--ink-3); }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.two .field + .field { margin-top: 0; }
.two + .field, .field + .two { margin-top: 14px; }
#drinkAdjust { margin-top: 14px; }
.two .label { min-height: 2.6em; align-items: flex-end; }
.two .label output { min-width: 3.2ch; text-align: right; font-variant-numeric: tabular-nums; }   /* 9% and 11% take the same room, so nothing shifts */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips.even { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
.chips.even .chip { min-width: 0; padding-inline: 4px; }
.chip { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-width: 3.9rem; min-height: 2.5rem; padding: 5px 10px; border: 1px solid var(--rule); border-radius: 10px; background: var(--panel); text-align: center; line-height: 1.2;
  transition: border-color 140ms var(--ease), background 140ms var(--ease), color 140ms var(--ease); }
.chip b { font-size: 0.8125rem; font-weight: 700; }
.chip span { font-size: 0.625rem; color: var(--ink-3); }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chip[aria-pressed="true"] span { color: var(--accent); }
.chip.small { min-width: 0; min-height: 1.9rem; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.input { display: flex; align-items: center; gap: 6px; min-height: 2.5rem; padding: 0 11px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--panel); transition: border-color 140ms, box-shadow 140ms; }
.input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input .pre, .input .suf { color: var(--ink-2); font-weight: 600; font-size: 0.875rem; }
.input input { flex: 1; min-width: 0; height: 2.4rem; border: 0; outline: 0; background: transparent; font-size: 1rem; font-weight: 700; }
.input.mini { min-height: 2rem; width: 5.2rem; padding: 0 8px; }
.input.mini input { height: 1.9rem; font-size: 0.875rem; text-align: right; }
.seg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; border-radius: 10px; background: var(--fill); }
.seg button { position: relative; z-index: 1; padding: 5px 11px; border: 0; border-radius: 8px; background: transparent; font-weight: 600; font-size: 0.75rem; color: var(--ink-2); white-space: nowrap; transition: color 160ms var(--ease); }
.seg button[aria-pressed="true"] { color: var(--ink); }
.seg .pill { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; border-radius: 8px; background: var(--panel); box-shadow: 0 1px 2px rgba(23, 25, 28, 0.14); transition: transform 220ms var(--ease), width 220ms var(--ease); }
.seg.fmt { display: flex; width: 100%; margin-bottom: 12px; }
.seg.fmt button { flex: 1 1 0; min-width: 0; white-space: normal; line-height: 1.2; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 2.25rem; padding: 0 12px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--panel); font-weight: 600; font-size: 0.8125rem; color: var(--ink); text-decoration: none; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn svg { width: 0.95rem; height: 0.95rem; }
.btn-primary { border-color: transparent; color: #fff; background: linear-gradient(180deg, var(--accent-lift), var(--accent)); }
.btn-primary:hover { color: #fff; border-color: transparent; filter: brightness(1.06); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; margin: 0; background: transparent; cursor: pointer; --pct: 50%; }
input[type="range"]::-webkit-slider-runnable-track { height: 5px; border-radius: 5px; background: linear-gradient(90deg, var(--accent-lift) 0, var(--accent) var(--pct), var(--fill) var(--pct)); box-shadow: inset 0 0 0 1px var(--rule); }
input[type="range"]::-moz-range-track { height: 5px; border-radius: 5px; background: var(--fill); }
input[type="range"]::-moz-range-progress { height: 5px; border-radius: 5px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin-top: -6.5px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); box-shadow: 0 2px 6px rgba(23, 25, 28, 0.25), 0 0 0 4px var(--accent-soft); }
input[type="range"]::-moz-range-thumb { width: 15px; height: 15px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--panel), 0 0 0 5px var(--accent); }
.slider-row { display: flex; align-items: center; gap: 10px; }
.slider-row input[type="range"] { flex: 1; }
/* Result */
.price-hero { position: relative; display: grid; justify-items: center; gap: 1px; padding: 16px 10px 14px; margin-bottom: 10px; border: 1px solid var(--rule-soft); border-radius: 14px; overflow: hidden; text-align: center;
  background: radial-gradient(closest-side, var(--accent-soft), transparent 80%) center / 120% 160% no-repeat, var(--panel); }
.price-label { font-size: 0.75rem; font-weight: 600; color: var(--ink-2); }
.price { display: flex; align-items: flex-start; font-family: var(--font-title); font-weight: 700; font-size: clamp(2.5rem, 4.4vw, 3.25rem); line-height: 1; letter-spacing: -0.04em; }
.price .cur { margin-top: 0.3em; font-size: 0.42em; color: var(--accent); letter-spacing: 0; }
.price .pct { margin-top: 0.3em; margin-left: 2px; font-size: 0.42em; color: var(--accent); letter-spacing: 0; }
.price-note { font-size: 0.75rem; color: var(--ink-2); min-height: 1.2em; }
.status { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; text-align: left; }
.status::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.good { background: color-mix(in srgb, var(--good) 13%, transparent); color: var(--good); }
.status.ok { background: var(--accent-soft); color: var(--accent); }
.status.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.rows { display: grid; margin: 0; }
.rows > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--rule-soft); }
.rows > div:first-child { border-top: 0; }
.rows dt { color: var(--ink-2); font-size: 0.8125rem; }
.rows dd { margin: 0; font-size: 0.9375rem; font-weight: 700; text-align: right; }
.rows .profit dt, .rows .profit dd { color: var(--good); }
.rows .profit dd { font-size: 1.125rem; }
.split { margin-top: 12px; }
.split-bar { position: relative; display: flex; height: 10px; margin-top: 20px; border-radius: 6px; background: var(--fill); }
.split-bar i { display: block; height: 100%; min-width: 0; transition: width 360ms var(--ease); }
.split-bar i:first-child { border-radius: 6px 0 0 6px; }
.split-bar i:last-child { border-radius: 0 6px 6px 0; }
.seg-cost { background: var(--ink); opacity: 0.82; }
.seg-extras { background: var(--accent-lift); opacity: 0.5; }
.seg-profit { background: linear-gradient(90deg, var(--accent-lift), var(--accent)); }
.target-tick { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--ink); transition: left 360ms var(--ease); }
.target-tick span { position: absolute; top: -17px; left: 50%; transform: translateX(-50%); font-size: 0.625rem; font-weight: 700; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 0.75rem; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.legend b { color: var(--ink); }
/* Compare with what you charge today */
.compare { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--rule); }
.cmp-out { display: grid; gap: 6px; margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--fill); font-size: 0.8125rem; }
.cmp-out .cmp-row { display: flex; justify-content: space-between; gap: 10px; }
.cmp-out .cmp-row b { font-variant-numeric: tabular-nums; }
.cmp-out .cmp-gap { font-weight: 600; }
.cmp-out .cmp-gap.good { color: var(--good); }
.cmp-out .cmp-gap.bad { color: var(--bad); }
.wine-link { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); font-size: 0.75rem; line-height: 1.5; color: var(--ink-2); }
.wine-link a { font-weight: 600; }
/* Chart */
.chart-wrap { position: relative; }
.chart { display: block; width: 100%; height: auto; touch-action: pan-y; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.chart text { font-family: var(--font); font-size: 11px; fill: var(--ink-2); }
.chart .grid-line { stroke: var(--rule-soft); stroke-width: 1; }
.chart .curve { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .band { fill: var(--accent-soft); }
.chart .band-label { fill: var(--accent); font-weight: 600; }
.chart .guide { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .dot { fill: var(--panel); stroke: var(--accent); stroke-width: 3; }
.chart .dot-halo { fill: var(--accent-glow); }
.chart .you { fill: var(--panel); stroke: var(--ink); stroke-width: 2.5; }
.chart .tip-box { fill: var(--ink); }
.chart .tip-text { fill: #fff; font-weight: 600; }
.chart .hover { opacity: 0; transition: opacity 120ms; }
.chart-wrap:hover .hover, .chart-wrap.is-drag .hover { opacity: 1; }
/* the hover tooltip says the same thing */
.cap { margin: 8px 0 0; font-size: 0.75rem; color: var(--ink-3); }
/* Bottle, keg or case economics */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile { display: grid; gap: 2px; min-width: 0; padding: 10px; border: 1px solid var(--rule-soft); border-radius: 12px; background: var(--panel); }
.tile small { font-size: 0.6875rem; font-weight: 600; color: var(--ink-2); }
.tile b { font-family: var(--font-title); font-size: 1.1875rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; overflow-wrap: anywhere; }
.tile.hl { background: var(--accent-soft); border-color: transparent; }
.tile.hl b { color: var(--accent); }
.tile span { font-size: 0.6875rem; color: var(--ink-3); }
.bars { display: grid; gap: 7px; margin-top: 12px; }
.bar-row { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr) 4.4rem; align-items: center; gap: 8px; font-size: 0.75rem; color: var(--ink-2); }
.bar-row .track { height: 8px; border-radius: 5px; background: var(--fill); overflow: hidden; }
.bar-row .track i { display: block; height: 100%; width: 0; border-radius: 5px; transition: width 400ms var(--ease); }
.bar-row b { text-align: right; color: var(--ink); }
/* Typical ranges */
.bench { display: grid; gap: 9px; }
.bench-row { display: grid; grid-template-columns: minmax(0, 8.5rem) minmax(0, 1fr) 5.6rem; align-items: center; gap: 10px; font-size: 0.75rem; }
.bench-row .name { font-weight: 600; }
.bench-row.is-cur .name { color: var(--accent); }
.bench-row .range { text-align: right; color: var(--ink-2); }
.bench-track { position: relative; height: 8px; border-radius: 5px; background: var(--fill); }
.bench-track i { position: absolute; top: 0; bottom: 0; border-radius: 5px; background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.bench-track em { position: absolute; top: -4px; width: 4px; height: 16px; margin-left: -2px; border-radius: 3px; background: var(--ink); transition: left 360ms var(--ease); }
/* Email */
.mail-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.mail-row .field { flex: 1 1 15rem; }
.mail-row .btns { display: flex; flex-wrap: wrap; gap: 8px; }
.mail-row .btn { min-height: 2.5rem; }
.mail-note { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-top: 8px; }
.a-mail { display: flex; flex-direction: column; }
.preview-wrap { position: relative; flex: 1 1 0; min-height: 2.6rem; margin-top: 10px; }
.preview-wrap.is-open { min-height: 9.5rem; }
.preview { position: absolute; inset: 0 0 auto; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--rule-soft); border-radius: 12px; background: var(--fill); }
.preview-wrap.is-open .preview { bottom: 0; }
.preview-toggle { display: flex; align-items: center; gap: 8px; flex: none; height: 2.45rem; padding: 0 12px; border: 0; background: transparent; text-align: left; font-weight: 600; font-size: 0.8125rem; color: var(--ink-2); }
.preview-toggle::before { content: ""; width: 0; height: 0; border-style: solid; border-width: 4px 0 4px 6px; border-color: transparent transparent transparent currentColor; transition: transform 160ms var(--ease); }
.preview-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }
.preview-toggle:hover { color: var(--ink); }
.preview pre { flex: 1 1 auto; min-height: 0; margin: 0; padding: 2px 12px 12px; overflow: auto; white-space: pre-wrap; word-break: break-word; font-family: var(--font); font-size: 0.75rem; line-height: 1.55; color: var(--ink-2); }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 40; transform: translate(-50%, 16px); opacity: 0; padding: 9px 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.16);
  background: color-mix(in srgb, var(--ink) 80%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: #fff; font-weight: 600; font-size: 0.8125rem; pointer-events: none; transition: opacity 180ms, transform 220ms var(--ease); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
/* ---------- The guide (what search engines read) ---------- */
.guide { display: grid; grid-template-columns: minmax(0, 1fr); gap: 34px; max-width: 860px; padding-block: 48px 20px; }
.guide > * { min-width: 0; }
.guide h2 { margin: 0 0 10px; font-family: var(--font-title); font-weight: 600; font-size: clamp(1.4rem, 2.6vw, 1.75rem); letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; }
.guide h3 { margin: 18px 0 6px; font-size: 1.0625rem; font-weight: 700; }
.guide p { margin: 0 0 10px; max-width: 70ch; color: var(--ink-2); }
.guide p strong, .guide li strong { color: var(--ink); }
.guide ul, .guide ol { margin: 0 0 10px; padding-left: 1.2rem; color: var(--ink-2); max-width: 70ch; }
.guide li + li { margin-top: 4px; }
.formula { margin: 10px 0 12px; padding: 12px 16px; border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--accent) 5%, var(--panel)); font-weight: 600; color: var(--ink); }
.example { margin: 0 0 12px; padding: 12px 16px; border-radius: var(--radius); background: var(--accent-soft); color: var(--ink); font-size: 0.9375rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--rule-soft); border-radius: 14px; background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
caption { padding: 12px 14px 4px; text-align: left; font-size: 0.8125rem; color: var(--ink-3); caption-side: bottom; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--rule-soft); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { font-size: 0.75rem; font-weight: 700; color: var(--ink-2); background: var(--fill); }
tbody tr:last-child td { border-bottom: 0; }
.faq { display: grid; gap: 8px; }
/* FAQ: the same foldable cards as the dashboard's FAQ page. Collapsed by default; the chevron turns and the border goes faintly blue when a
   card opens; "Expand all" sits on the heading line (tool-N.js shows it and keeps its label right). The answers stay in the page, so the FAQ
   structured data still matches the visible text. */
.faq-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.faq-head h2 { margin: 0; min-width: 0; }
.faq-toggle { flex: none; padding: 6px 12px; border: 0; border-radius: 8px; background: var(--fill); font-size: 0.8125rem; font-weight: 600; color: var(--ink); transition: background 140ms var(--ease), color 140ms var(--ease); }
.faq-toggle:hover { background: rgba(33, 74, 200, 0.12); color: var(--accent); }
.faq-item { border: 1px solid var(--rule-soft); border-radius: 12px; background: var(--panel); box-shadow: 0 1px 2px rgba(23, 25, 28, 0.04); overflow: hidden; transition: border-color 140ms var(--ease); interpolate-size: allow-keywords; }
.faq-item[open] { border-color: rgba(33, 74, 200, 0.20); }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; list-style: none; cursor: pointer; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { background: rgba(33, 74, 200, 0.06); }
.faq-item summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.faq-item summary::after { content: ""; flex: none; width: 14px; height: 14px; background: var(--ink-2); transform: rotate(90deg); transition: transform 220ms var(--ease), background 140ms var(--ease);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat; }
.faq-item[open] summary::after { transform: rotate(-90deg); background: var(--accent); }
.faq-item .faq-q { margin: 0; font-size: 0.9375rem; font-weight: 600; line-height: 1.4; color: var(--ink); }
.faq-item .faq-a { margin: 0; max-width: none; padding: 0 44px 16px 16px; font-size: 0.9375rem; line-height: 1.6; color: var(--ink-2); }
.faq-item::details-content { block-size: 0; overflow: clip; transition: block-size 220ms var(--ease), content-visibility 220ms allow-discrete; }
.faq-item[open]::details-content { block-size: auto; }
@media print { .faq-toggle { display: none; } }
.byline { font-size: 0.8125rem; color: var(--ink-3); }
.cta-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; padding: 22px 24px; border-radius: 20px; background: linear-gradient(135deg, #1C3FB0, #214AC8 55%, #3A62E6); color: #fff; box-shadow: 0 18px 36px -18px rgba(33, 74, 200, 0.7); }
.cta-band h2 { margin: 0 0 4px; color: #fff; }
.cta-band p { margin: 0; color: rgba(255, 255, 255, 0.88); }
.cta-band a { display: inline-flex; align-items: center; min-height: 2.6rem; padding: 0 16px; border-radius: 12px; background: #fff; color: #1C3FB0; font-weight: 700; text-decoration: none; }
.cta-band a:hover { background: #EEF2FF; }
.site-foot { margin-top: 40px; border-top: 1px solid var(--rule-soft); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; max-width: 1240px; margin: 0 auto; padding-block: 22px 32px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); font-size: 0.8125rem; color: var(--ink-3); }
.foot-in nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.foot-in a { color: var(--ink-2); text-decoration: none; }
.foot-in a:hover { color: var(--accent); text-decoration: underline; }
.foot-in p { margin: 0; max-width: 62ch; }
.chips.even .chip b { white-space: nowrap; }
@container (max-width: 520px) { .chips.even { gap: 5px; } .chips.even .chip { padding-inline: 2px; } .chips.even .chip b { font-size: 0.6875rem; letter-spacing: -0.01em; } .chips.even .chip span { font-size: 0.5625rem; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; } }
@media print { .site-head, .col-nav, .embed-bar, .calc-top .top-actions, .a-mail, .sumbar, .cta-band { display: none !important; } .calc { box-shadow: none; } }
/* ---------- Dashboard look: rounded frame, top bar, left menu (same as the dashboard) ---------- */
.app { position: relative; width: calc(100% - 32px); margin: 16px auto; border: 1px solid var(--rule); border-radius: 18px; background: var(--bg); box-shadow: 0 24px 60px -34px rgba(23, 25, 28, 0.35); overflow: clip; }
.site-head { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 24px; min-height: 64px; padding: 14px 20px; border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, #fff 50%, transparent); -webkit-backdrop-filter: blur(10px) saturate(1.45); backdrop-filter: blur(10px) saturate(1.45); }
.brand { gap: 14px; flex: none; }
.menu-btn { display: none; flex: none; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--rule); border-radius: 10px; background: #fff; color: var(--ink); }
.menu-btn svg { width: 1.1rem; height: 1.1rem; }
.site-search { position: relative; flex: none; width: 340px; margin-left: auto; }
.site-search svg { position: absolute; left: 10px; top: 50%; width: 1rem; height: 1rem; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.site-search input { width: 100%; height: 34px; padding: 0 14px 0 32px; border: 1px solid rgba(23, 25, 28, 0.2); border-radius: 10px; background: #fff; font-size: 0.875rem; -webkit-appearance: none; appearance: none; }
.site-search input::placeholder { color: var(--ink-3); }
.help-wrap { position: relative; flex: none; }
.help-btn { width: 34px; height: 34px; padding: 0; border: 1px solid rgba(23, 25, 28, 0.2); border-radius: 50%; background: #fff; font-weight: 700; font-size: 0.9375rem; color: var(--ink); }
.help-btn:hover { border-color: var(--accent); color: var(--accent); }
/* Moved out of the top bar when the page starts: the bar has its own blur, and a blur inside a blur has nothing to frost. */
.help-panel { position: fixed; right: 16px; top: 76px; z-index: 45; width: min(360px, calc(100vw - 32px)); padding: 18px 18px 16px; text-align: left; border: 1px solid color-mix(in srgb, var(--rule) 70%, transparent); border-radius: 18px;
  background: color-mix(in srgb, #fff 84%, transparent); -webkit-backdrop-filter: blur(18px) saturate(1.45); backdrop-filter: blur(18px) saturate(1.45); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), var(--shadow); }
.help-panel:focus { outline: none; }
.help-title { margin: 0 0 10px; font-family: var(--font-title); font-weight: 600; font-size: 1.125rem; letter-spacing: -0.01em; }
.help-steps { margin: 0; padding-left: 1.2rem; font-size: 0.875rem; color: var(--ink-2); }
.help-steps li + li { margin-top: 8px; }
.help-steps strong { color: var(--ink); }
.help-about { display: inline-block; margin-top: 14px; font-weight: 600; font-size: 0.875rem; color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(33, 74, 200, 0.2); }
.help-about:hover { border-bottom-color: var(--accent); }
.shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); align-items: start; }
.col-nav { position: sticky; top: 64px; max-height: calc(100vh - 64px); overflow-y: auto; padding: 14px; border-right: 1px solid var(--rule); background: color-mix(in srgb, #fff 50%, transparent); }
.nav-tabs { display: grid; gap: 6px; }
.nav-tab { display: grid; grid-template-columns: 1.25rem minmax(0, 1fr); column-gap: 10px; row-gap: 1px; align-items: center; padding: 8px 12px; border: 1px solid var(--rule-soft); border-radius: 12px; background: #fff; color: var(--ink); text-decoration: none;
  box-shadow: 0 1px 2px rgba(23, 25, 28, 0.04); transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease); }
/* Menu rows share one height (72px) whenever the window is tall enough for the whole menu; on short laptop windows they fall back to their natural height so the menu never scrolls. */
.nav-tab:hover { border-color: var(--rule); }
.nav-tab .nav-ico { grid-column: 1; grid-row: 1 / span 2; width: 1.25rem; height: 1.25rem; color: var(--accent); }
.nav-tab-label { grid-column: 2; grid-row: 1; align-self: end; font-size: 0.875rem; font-weight: 600; }
.nav-tab-sub { grid-column: 2; grid-row: 2; align-self: start; font-size: 0.78rem; line-height: 1.35; color: var(--ink-2); }
.nav-tab.is-active { border-color: transparent; background: linear-gradient(180deg, var(--accent-lift), var(--accent)); color: #fff; box-shadow: 0 10px 22px -12px rgba(33, 74, 200, 0.6); }
.nav-tab.is-active .nav-ico, .nav-tab.is-active .nav-tab-sub { color: #fff; }
.nav-tab.is-active .nav-tab-sub { color: rgba(255, 255, 255, 0.86); }
/* The calculator lays itself out by the width of this pane (not the window), so the left menu never squeezes it. */
.pane { min-width: 0; container-type: inline-size; }
@media (max-width: 760px) {
  .app { width: 100%; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
  .site-head { flex-wrap: wrap; gap: 10px 12px; padding: 12px 16px; }
  .menu-btn { display: inline-flex; order: 3; margin-left: auto; }
  .brand { order: 1; }
  .help-wrap { order: 2; margin-left: auto; }
  .menu-btn { margin-left: 0; }
  .site-search { order: 4; width: 100%; margin-left: 0; }
  .brand-name { display: block; padding-left: 10px; }
  .shell { display: block; }
  .col-nav { display: none; position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--rule); padding: 12px 16px 16px; background: var(--bg); }
  .app.menu-open .col-nav { display: block; }
}
/* ---------- Dashboard mode (?embed=1): only the tool, for the dashboard's main pane ---------- */
.embed-bar { display: none; }
html.embed { font-size: 15px; overflow: hidden; scrollbar-gutter: auto; }   /* inside the dashboard the pane scrolls, never the page itself (no inner scrollbar, no blank strip) */
html.embed body { background: transparent; }
html.embed body::before { display: none; }
html.embed .skip, html.embed .site-head, html.embed .col-nav, html.embed .crumbs, html.embed .hero, html.embed .guide, html.embed .site-foot, html.embed .toast { display: none !important; }
html.embed .app { width: auto; max-width: none; margin: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: visible; }
html.embed .shell { display: block; }
html.embed main { padding-top: 0; }
html.embed .wrap { padding-left: 4px; padding-right: 4px; }
html.embed .embed-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 4px 12px; }
html.embed .embed-title { font-family: var(--font-title); font-weight: 600; font-size: 1.125rem; letter-spacing: -0.01em; }
html.embed .embed-open { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--panel); box-shadow: 0 1px 2px rgba(23, 25, 28, 0.04); font-size: 0.75rem; font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; transition: border-color 140ms var(--ease), color 140ms var(--ease); }
html.embed .embed-open:hover { border-color: var(--accent); color: var(--accent); }
html.embed .embed-open svg { width: 0.9rem; height: 0.9rem; }
html.embed .calc { padding: 8px; scroll-margin-top: 0; }
html.embed .sumbar { top: 0; }

/* In a narrow card, side-by-side fields whose label carries a live value ("Spillage and overpour 11%" wrapped) stack instead. */
.card { container: card / inline-size; }
@container card (max-width: 400px) {
  .two:has(.label output) { grid-template-columns: minmax(0, 1fr); }
  .two:has(.label output) .label { min-height: 0; align-items: center; }
  .two:has(.label output) .field + .field { margin-top: 14px; }
}
/* Menu rows: same layout as the dashboard's left menu. Each row's text is centered with the same space above and below, so a description that
   wraps to two lines gets the same spacing; one-line rows share one minimum height. Two sizes by window height. */
.nav-tabs { gap: 8px; }
.nav-tab { padding: 10px 12px; min-height: 60px; }
.nav-divider { height: 0; margin: 2px 4px; border: 0; border-top: 1px solid var(--rule); }
@media (max-height: 769px) {
  .nav-tabs { gap: 4px; }
  .nav-tab { padding: 7px 12px; min-height: 52px; }
  .nav-tab-sub { font-size: 0.75rem; line-height: 1.25; }
}
/* Privacy Policy and Terms of Service: plain long-form text */
.legal { max-width: 780px; padding-block: 18px 40px; }
.legal h1 { max-width: none; margin-bottom: 4px; }
.legal-date { margin: 0 0 14px; font-size: 0.8125rem; color: var(--ink-3); }
.legal-note { margin: 0 0 26px; padding: 12px 14px; border: 1px solid rgba(165, 83, 0, 0.28); border-radius: 12px; background: rgba(165, 83, 0, 0.08); font-size: 0.8125rem; line-height: 1.5; color: var(--ink); }
.legal-sec { margin-top: 26px; }
.legal-sec h2 { margin: 0 0 8px; font-family: var(--font-title); font-weight: 600; font-size: 1.25rem; letter-spacing: -0.015em; line-height: 1.2; }
.legal-sec p { margin: 0 0 10px; max-width: 70ch; color: var(--ink-2); }
.legal-sec strong { color: var(--ink); }
@media print { .legal-note { border-color: #999; background: none; } }
