/* Free tools pages (/calculators/*, /free-barcode-scanner).
   Same tokens and type as pricing/index.html: gym luminance ladder + lime,
   kitchen amber used only for carbs. Depth by luminance, one accent bar on
   the result panel, no nested cards, no glow. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #07090D; --card: #0D1117; --card-2: #131A22; --card-3: #1A2330;
  --border: rgba(255,255,255,0.06);
  --accent: #30D158; --amber: #FFA355;
  --white: #F2F5F7; --muted: #9AA6B5; --dim: #5E6A7A;
  color-scheme: dark;
}
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--white); font-family: 'Outfit', -apple-system, sans-serif; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.skip-link { position: absolute; left: 12px; top: -60px; background: var(--accent); color: #000; padding: 10px 14px; border-radius: 10px; font-weight: 700; z-index: 10; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* nav: the pricing page bar, plus a tools link and the quiz */
nav.top {
  padding: 18px 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--border);
}
@media (max-width: 600px) { nav.top { padding: 14px 16px; } }
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-logo:hover { text-decoration: none; }
.nav-logo img { width: 26px; height: 26px; border-radius: 7px; }
.nav-logo-txt { font-size: 16px; font-weight: 700; color: var(--white); }
.nav-right { display: flex; align-items: center; gap: 18px; }
.nav-link { font-size: 13px; color: var(--muted); text-decoration: none; }
.nav-link:hover { color: var(--white); text-decoration: none; }
.nav-link[aria-current="page"] { color: var(--white); }
.nav-quiz { font-size: 13px; font-weight: 700; padding: 9px 16px; border-radius: 999px; background: var(--accent); color: #000; white-space: nowrap; }
.nav-quiz:hover { text-decoration: none; filter: brightness(1.1); }
@media (max-width: 380px) { .nav-right { gap: 12px; } .nav-quiz { padding: 9px 13px; } }

.content { max-width: 1040px; margin: 0 auto; padding: 48px 24px 100px; }
@media (max-width: 600px) { .content { padding: 32px 16px 80px; } }
.crumbs { font-size: 13px; color: var(--dim); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
h1 { font-size: clamp(30px, 5vw, 44px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.08; margin-bottom: 12px; text-wrap: balance; }
.lede { font-size: 17px; color: var(--muted); line-height: 1.6; max-width: 640px; margin-bottom: 32px; text-wrap: pretty; }
.lede strong { color: var(--white); font-weight: 600; }
h2 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin: 64px 0 12px; text-wrap: balance; }
h3 { font-size: 16px; font-weight: 700; margin: 26px 0 8px; }
p, li { font-size: 15px; color: var(--muted); line-height: 1.75; margin-bottom: 12px; }
p strong, li strong { color: var(--white); font-weight: 600; }
ul, ol { padding-left: 20px; margin-bottom: 12px; }
.prose { max-width: 720px; }
.label { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* ── the tool: form + result side by side on desktop ── */
.tool { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
@media (min-width: 860px) { .tool { grid-template-columns: 1.05fr 1fr; gap: 20px; } }
.panel { background: var(--card); border-radius: 18px; padding: 26px; }
@media (max-width: 440px) { .panel { padding: 20px 16px; } }
.result { background: var(--card-2); box-shadow: inset 0 2px 0 var(--accent); }
@media (min-width: 860px) { .result { position: sticky; top: 20px; } }

.field { margin-bottom: 20px; border: 0; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field > label, .field > legend, .field-label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; padding: 0; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row > .field { margin-bottom: 0; }
.row + .field, .row + .row { margin-top: 20px; }

.input-wrap { position: relative; }
.input, select.input {
  width: 100%; height: 54px; padding: 0 16px; border: 0; border-radius: 12px;
  background: var(--bg); color: var(--white);
  font: 600 18px 'Outfit', -apple-system, sans-serif; font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: var(--dim); font-weight: 500; }
.input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.input-wrap .input { padding-right: 48px; }
.unit { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 14px; font-weight: 600; color: var(--dim); pointer-events: none; }
select.input {
  font-size: 16px; padding-right: 44px; cursor: pointer;
  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 1.5l5 5 5-5' fill='none' stroke='%239AA6B5' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
select.input option { background: var(--card); color: var(--white); }
.hint { font-size: 12px; color: var(--dim); margin-top: 6px; line-height: 1.5; }

/* segmented control: real radios, visually a pill track */
.seg { display: flex; background: var(--bg); border-radius: 12px; padding: 4px; gap: 4px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.seg label { flex: 1; position: relative; }
.seg input { position: absolute; opacity: 0; width: 100%; height: 100%; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 44px; padding: 6px 8px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: var(--muted); line-height: 1.2;
  transition: background .18s ease, color .18s ease;
}
.seg input:checked + span { background: var(--card-3); color: var(--white); box-shadow: inset 0 -2px 0 var(--accent); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.seg-wrap { flex-wrap: wrap; }
.seg-wrap label { flex: 1 1 calc(50% - 4px); }

/* ── results ── */
.res-empty { color: var(--muted); font-size: 15px; line-height: 1.6; }
.res-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.big { color: var(--white); font-size: clamp(44px, 9vw, 60px); font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; margin-top: 10px; }
.big small { font-size: 16px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 6px; }
.res-sub { font-size: 14px; color: var(--muted); margin: 8px 0 0; line-height: 1.55; }
.res-rows { margin-top: 22px; }
.res-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); }
.res-row .k { font-size: 14px; color: var(--muted); line-height: 1.4; }
.res-row .k b { display: block; color: var(--white); font-weight: 600; font-size: 15px; }
.res-row .v { font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.res-row .v small { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.res-row.lit .v { color: var(--accent); }
.dot { display: inline-block; width: 10px; height: 2px; border-radius: 1px; vertical-align: middle; margin-right: 8px; position: relative; top: -2px; }
.d-p { background: var(--accent); } .d-c { background: var(--amber); } .d-f { background: var(--muted); }
.mbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin-top: 20px; background: var(--bg); gap: 2px; }
.mbar i { display: block; height: 100%; transition: width .35s cubic-bezier(.22,.9,.3,1); }
.mbar i:nth-child(1) { background: var(--accent); } .mbar i:nth-child(2) { background: var(--amber); } .mbar i:nth-child(3) { background: var(--muted); }
.warn { font-size: 13px; color: var(--amber); line-height: 1.55; margin: 12px 0 0; }

.cta-block { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--border); }
.cta-block p { font-size: 15px; color: var(--white); font-weight: 600; margin-bottom: 12px; line-height: 1.45; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; padding: 13px 22px; border-radius: 999px; text-decoration: none; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { color: var(--white); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px rgba(255,255,255,.32); }
@media (max-width: 420px) { .cta-row .btn { flex: 1 1 100%; } }
.disclaimer { font-size: 12px; color: var(--dim); margin: 16px 0 0; line-height: 1.55; }

/* ── explainer ── */
.formula {
  background: var(--card); border-radius: 14px; padding: 18px 20px; margin: 14px 0 18px;
  font-size: 15px; line-height: 1.9; color: var(--white); font-variant-numeric: tabular-nums;
  overflow-x: auto;
}
.formula span { color: var(--muted); }
table.ref { width: 100%; border-collapse: collapse; margin: 14px 0 18px; font-size: 14px; font-variant-numeric: tabular-nums; }
table.ref th, table.ref td { text-align: left; padding: 11px 10px 11px 0; border-top: 1px solid var(--border); color: var(--muted); vertical-align: top; }
table.ref th { color: var(--white); font-weight: 600; }
table.ref thead th { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); border-top: 0; }
.table-scroll { overflow-x: auto; }

/* FAQ: native details, a lime stroke that turns */
.faq { margin-top: 8px; max-width: 760px; }
.faq details { border-top: 1px solid var(--border); }
.faq details:last-child { border-bottom: 1px solid var(--border); }
.faq summary {
  list-style: none; cursor: pointer; position: relative;
  padding: 18px 36px 18px 0; font-size: 16px; font-weight: 600; color: var(--white); line-height: 1.45;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before, .faq summary::after {
  content: ''; position: absolute; right: 6px; top: 50%; width: 12px; height: 2px; border-radius: 1px;
  background: var(--accent); transition: transform .25s cubic-bezier(.22,.9,.3,1);
}
.faq summary::after { transform: rotate(90deg); }
.faq details[open] summary::after { transform: rotate(0deg); }
.faq details > div { padding: 0 0 18px; }
.faq details p:last-child { margin-bottom: 0; }

/* tools index + "more tools": rows, not cards */
.tool-list { list-style: none; padding: 0; margin: 8px 0 0; }
.tool-list li { margin: 0; border-top: 1px solid var(--border); }
.tool-list li:last-child { border-bottom: 1px solid var(--border); }
.tool-list a { display: grid; grid-template-columns: 1fr auto; gap: 4px 20px; align-items: center; padding: 22px 0; color: var(--white); text-decoration: none; }
.tool-list a:hover { text-decoration: none; }
.tool-list .t-name { font-size: clamp(20px, 3.2vw, 26px); font-weight: 800; letter-spacing: -.02em; }
.tool-list .t-desc { grid-column: 1; font-size: 15px; color: var(--muted); line-height: 1.55; }
.tool-list .t-go { grid-row: 1 / span 2; grid-column: 2; width: 12px; height: 2px; background: var(--accent); border-radius: 1px; transition: width .28s cubic-bezier(.22,.9,.3,1); }
.tool-list a:hover .t-go, .tool-list a:focus-visible .t-go { width: 28px; }
.tool-list a:hover .t-name { color: var(--accent); }

/* footer: pricing's line + the tools */
hr { border: none; border-top: 1px solid var(--border); margin: 72px 0 28px; }
.foot-tools { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; margin-bottom: 14px; }
.foot-tools .label { width: 100%; margin-bottom: 4px; }
.foot-tools a { color: var(--muted); }
.foot-tools a:hover { color: var(--white); }
.foot-links { font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); margin: 0; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
/* four-option goal control wraps to 2 x 2 on phones */
@media (max-width: 520px) { .seg-4 { flex-wrap: wrap; } .seg-4 label { flex: 1 1 calc(50% - 4px); } }
