/* ChopOps free tools: shared styles. Tokens from the ChopOps design system. */
:root {
  --surface: #FAFBFD; --surface-raised: #FFFFFF; --line: #E2E7EF;
  --ink: #1B2233; --ink-muted: #5B6578;
  --tangerine: #FF7A1A; --on-tangerine: #1B2233; --tangerine-text: #B34700; --tangerine-soft: #FFE9D6;
  --sky: #38B6F5; --on-sky: #1B2233; --sky-text: #0B6799; --sky-soft: #DDF3FE;
  --good: #0A7C86; --good-soft: #DDF1F2; --bad: #D6323F; --bad-soft: #FCE7E9; --warn: #8A5300; --warn-soft: #FDF0D5;
  --track: #E2E7EF;
  --shadow-card: 0 1px 2px #1B22330D, 0 4px 12px #1B223314;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 8px; --r-md: 14px; --r-lg: 24px; --r-full: 9999px;
  color-scheme: light;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --surface: #121826; --surface-raised: #1B2233; --line: #2C3549;
  --ink: #F3F5F9; --ink-muted: #A5AEC0;
  --tangerine: #FF8A33; --on-tangerine: #121826; --tangerine-text: #FFA463; --tangerine-soft: #3A2414;
  --sky: #5CC6FA; --on-sky: #121826; --sky-text: #7DD3FC; --sky-soft: #10314A;
  --good: #4FD1C5; --good-soft: #0F3236; --bad: #FF6B73; --bad-soft: #3D1A20; --warn: #F5B547; --warn-soft: #3A2A0C;
  --track: #2C3549; --shadow-card: 0 2px 8px #00000080; color-scheme: dark; } }
:root[data-theme="dark"] {
  --surface: #121826; --surface-raised: #1B2233; --line: #2C3549;
  --ink: #F3F5F9; --ink-muted: #A5AEC0;
  --tangerine: #FF8A33; --on-tangerine: #121826; --tangerine-text: #FFA463; --tangerine-soft: #3A2414;
  --sky: #5CC6FA; --on-sky: #121826; --sky-text: #7DD3FC; --sky-soft: #10314A;
  --good: #4FD1C5; --good-soft: #0F3236; --bad: #FF6B73; --bad-soft: #3D1A20; --warn: #F5B547; --warn-soft: #3A2A0C;
  --track: #2C3549; --shadow-card: 0 2px 8px #00000080; color-scheme: dark; }

* { box-sizing: border-box; }
html { background: var(--surface); }
body { margin: 0; background: var(--surface); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 24px; }
@media (max-width: 520px) { .wrap { padding-inline: 16px; } }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: var(--sky-text); }
:focus-visible { outline: 2px solid var(--sky-text); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-muted); }

/* Header */
.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.top nav { display: flex; align-items: center; gap: 20px; }
.top nav a.tl { font-size: 14px; font-weight: 600; color: var(--ink-muted); text-decoration: none; }
.top nav a.tl:hover { color: var(--ink); }
.top .btn { min-height: 38px; padding: 0 14px; font-size: 13px; }
@media (max-width: 560px) { .top .btn { display: none; } }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.logo svg { width: 30px; height: 30px; flex: none; }

/* Intro */
.intro { padding-block: 36px 26px; display: grid; gap: 12px; }
.intro > * { max-width: 760px; }
.crumb { font-size: 13px; font-weight: 600; }
.crumb a { color: var(--ink-muted); text-decoration: none; }
.crumb a:hover { color: var(--sky-text); }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tangerine-text); }
.intro h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.07; font-weight: 800; letter-spacing: -0.03em; }
.intro p { font-size: 17px; color: var(--ink-muted); max-width: 62ch; }

/* Grid */
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 28px; align-items: start; padding-bottom: 64px; }
@media (max-width: 960px) { .grid { grid-template-columns: 1fr; } }
.inputs { display: grid; gap: 16px; min-width: 0; }
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--r-md); padding: 4px; gap: 2px; }
.seg button { font: 600 14px var(--font); color: var(--ink-muted); background: none; border: 0; padding: 8px 14px; border-radius: 10px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--sky-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--sky-text); }
.link-btn { font: 600 14px var(--font); color: var(--sky-text); background: none; border: 0; cursor: pointer; padding: 8px 4px; text-decoration: underline; text-underline-offset: 3px; }
.note { font-size: 13px; color: var(--ink); background: var(--tangerine-soft); border-radius: var(--r-sm); padding: 10px 14px; }

.card { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; display: grid; gap: 16px; min-width: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head h2 { font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.step { width: 28px; height: 28px; border-radius: 50%; background: var(--tangerine); color: var(--on-tangerine); display: inline-grid; place-items: center; font-size: 14px; font-weight: 800; flex: none; }
.card-head .sum { font-size: 14px; font-weight: 700; }
.card-head .sum span { color: var(--ink-muted); font-weight: 600; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fields.three { grid-template-columns: repeat(3, 1fr); }
.fields .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .fields, .fields.three { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field label, .flabel { font-size: 13px; font-weight: 600; }
.hint { font-size: 12px; color: var(--ink-muted); }
.in { position: relative; }
.in[data-pre]::before { content: attr(data-pre); position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-muted); font-weight: 600; pointer-events: none; }
.in[data-suf]::after { content: attr(data-suf); position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-muted); font-weight: 600; pointer-events: none; font-size: 14px; }
input.n, input.t, select.t { font: 600 16px var(--font); font-variant-numeric: tabular-nums; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); min-height: 46px; padding: 0 14px; width: 100%; }
input.t, select.t { font-weight: 500; font-size: 15px; }
.in[data-pre] input { padding-left: 28px; }
.in[data-suf] input { padding-right: 46px; }
input.n:focus, input.t:focus, select.t:focus { outline: 2px solid var(--sky-text); outline-offset: 1px; border-color: transparent; }
.formula { font-size: 13px; color: var(--ink-muted); border-top: 1px dashed var(--line); padding-top: 12px; }
.formula b { color: var(--ink); }

/* Editable rows (recipe, par level) */
.rows-wrap { overflow-x: auto; margin-inline: -4px; padding-inline: 4px; }
table.rows { width: 100%; border-collapse: separate; border-spacing: 0 8px; min-width: 620px; }
table.rows th { font-size: 12px; font-weight: 600; color: var(--ink-muted); text-align: left; padding: 0 6px; white-space: nowrap; }
table.rows td { padding: 0 4px; vertical-align: middle; }
table.rows td.out { font-weight: 700; text-align: right; white-space: nowrap; padding-left: 10px; }
table.rows input { min-height: 42px; font-size: 15px; padding: 0 10px; }
table.rows .in[data-pre] input { padding-left: 22px; }
table.rows .in[data-pre]::before { left: 10px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-muted); font-size: 18px; line-height: 1; cursor: pointer; }
.icon-btn:hover { color: var(--bad); border-color: var(--bad); }
.add-btn { justify-self: start; font: 700 14px var(--font); color: var(--sky-text); background: var(--sky-soft); border: 0; border-radius: var(--r-md); padding: 10px 16px; cursor: pointer; }

/* Results */
.results { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 16px); display: grid; gap: 16px; min-width: 0; }
@media (max-width: 960px) { .results { position: static; } }
.res { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: 22px; display: grid; gap: 16px; }
.res-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.res-head h2 { font-size: 17px; font-weight: 700; }
.res-head .per { font-size: 12px; color: var(--ink-muted); }
.hero-num { display: grid; gap: 4px; }
.hero-num .lbl { font-size: 13px; font-weight: 600; color: var(--ink-muted); }
.hero-num .val { font-size: 44px; font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; }
.hero-num .val small { font-size: 18px; font-weight: 700; color: var(--ink-muted); letter-spacing: 0; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { border-radius: var(--r-md); padding: 12px 14px; display: grid; gap: 2px; min-width: 0; }
.tile .lbl { font-size: 12px; font-weight: 600; }
.tile .val { font-size: 22px; font-weight: 700; line-height: 1.2; }
.tile.t { background: var(--tangerine); color: var(--on-tangerine); }
.tile.s { background: var(--sky); color: var(--on-sky); }
.tile.plain { border: 1px solid var(--line); }
.tile.plain .lbl { color: var(--ink-muted); }
.status { justify-self: start; display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: var(--r-full); font-size: 13px; font-weight: 600; color: var(--ink); }
.status i { font-style: normal; }
.status.good { background: var(--good-soft); } .status.good i { color: var(--good); }
.status.warn { background: var(--warn-soft); } .status.warn i { color: var(--warn); }
.status.bad { background: var(--bad-soft); } .status.bad i { color: var(--bad); }
.status.none { background: var(--sky-soft); }
.lines { display: grid; border-top: 1px solid var(--line); }
.line { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.line b { font-weight: 700; }
.line.total { font-weight: 700; }
.impact { background: var(--tangerine-soft); border-radius: var(--r-md); padding: 16px; display: grid; gap: 6px; }
.impact .big { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
.impact p { font-size: 14px; }
.impact.ok { background: var(--good-soft); }
.impact.bad { background: var(--bad-soft); }

/* Bars */
.hbar { height: 12px; border-radius: var(--r-full); background: var(--track); overflow: hidden; }
.hbar span { display: block; height: 100%; border-radius: var(--r-full); background: var(--sky); transition: width .3s ease; }
.hbar.t span { background: var(--tangerine); }
@media (prefers-reduced-motion: reduce) { .hbar span { transition: none; } }

/* Email form + CTA */
.send { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; display: grid; gap: 14px; }
.send h3 { font-size: 19px; font-weight: 800; }
.send .sub { font-size: 14px; color: var(--ink-muted); margin-top: -6px; }
.check { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; font-size: 13px; color: var(--ink-muted); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--sky-text); }
.msg { font-size: 14px; border-radius: var(--r-sm); padding: 12px 14px; background: var(--sky-soft); color: var(--ink); }
.msg.err { background: var(--warn-soft); }
.cta { background: var(--sky); color: var(--on-sky); border-radius: var(--r-lg); padding: 22px; display: grid; gap: 12px; }
.cta h3 { font-size: 19px; font-weight: 800; }
.cta p { font-size: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: var(--r-md); font: 700 15px/1 var(--font); text-decoration: none; background: var(--tangerine); color: var(--on-tangerine); border: 0; cursor: pointer; justify-self: start; }
.btn:hover { filter: brightness(1.05); }
.btn.wide { width: 100%; justify-self: stretch; }
.btn.ghost { background: var(--surface-raised); color: var(--ink); border: 1px solid var(--line); }

/* Explainer + more tools */
.explain { border-top: 1px solid var(--line); background: var(--surface-raised); padding-block: 52px; }
.explain .wrap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.explain h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.explain p { color: var(--ink-muted); font-size: 15px; }
.explain code { font: 600 13px var(--font); background: var(--sky-soft); color: var(--ink); padding: 2px 6px; border-radius: 6px; }
@media (max-width: 820px) { .explain .wrap { grid-template-columns: 1fr; } }
.more { padding-block: 48px; }
.more h2 { font-size: 22px; font-weight: 800; margin-bottom: 16px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tool-card { display: grid; gap: 8px; align-content: start; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; text-decoration: none; color: var(--ink); transition: border-color .15s ease, transform .15s ease; }
.tool-card:hover { border-color: var(--sky-text); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .tool-card { transition: none; } .tool-card:hover { transform: none; } }
.tool-card .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.tool-card .ic svg { width: 21px; height: 21px; }
.tool-card .ic.t { background: var(--tangerine-soft); color: var(--tangerine-text); }
.tool-card .ic.s { background: var(--sky-soft); color: var(--sky-text); }
.tool-card h3 { font-size: 17px; font-weight: 700; }
.tool-card p { font-size: 14px; color: var(--ink-muted); }
.tool-card .go { font-size: 13px; font-weight: 700; color: var(--sky-text); }
footer.ft { border-top: 1px solid var(--line); padding-block: 24px 96px; font-size: 13px; color: var(--ink-muted); }
@media (min-width: 961px) { footer.ft { padding-bottom: 32px; } }

/* Mobile sticky result bar */
.mbar { display: none; }
@media (max-width: 960px) {
  .mbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--surface-raised); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px #1B223314; }
  .mbar .l { font-size: 13px; font-weight: 600; color: var(--ink-muted); }
  .mbar .v { font-size: 20px; font-weight: 800; }
  .mbar a { font-size: 14px; font-weight: 700; }
}

/* Print (checklist builder) */
@media print {
  .top, .intro, .inputs, .results > :not(.printable), .explain, .more, footer.ft, .mbar, .no-print { display: none !important; }
  .grid { display: block; padding: 0; }
  body { background: #fff; color: #000; }
}
