:root {
  color-scheme: light;
  --ink: #173c39;
  --muted: #526864;
  --accent: #176c59;
  --mint: #e6f2eb;
  --line: #d3ded6;
  --error: #a32c27;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: #f4f3ed;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
main { width: min(100% - 40px, 980px); margin: 0 auto; padding: 36px 0 26px; }
.hero { padding: 12px 4px 28px; }
.topline, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topline { flex-wrap: wrap; }
.test-badge { color: #653b07; background: #ffe4a3; border: 1px solid #c6983e; padding: 8px 13px; border-radius: 8px; font-size: .83rem; letter-spacing: .04em; }
.language-control { display: flex; align-items: center; gap: 9px; }
.language-control label { font-size: .86rem; }
.language-control select { width: auto; min-width: 145px; padding: 8px 10px; }
.eyebrow { margin: 29px 0 8px; font-size: .84rem; font-weight: 650; color: var(--accent); }
h1 { margin: 0; font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.15; letter-spacing: -.04em; overflow-wrap: anywhere; }
.intro { margin: 14px 0 0; font-size: 1.08rem; color: var(--muted); line-height: 1.6; }
.card { background: #fffef9; border: 1px solid var(--line); border-radius: 18px; padding: 26px; margin-bottom: 20px; box-shadow: 0 5px 24px #173c3907; }
h2 { font-size: 1.22rem; margin: 0 0 22px; line-height: 1.4; }
.section-heading h2 { margin: 0; }
.section-heading { margin-bottom: 15px; }
.counts-grid { display: grid; grid-template-columns: 1fr 48px 1fr; align-items: start; gap: 18px; }
.ratio-mark { text-align: center; font-size: 2rem; color: var(--accent); margin-top: 27px; }
.field { min-width: 0; }
label { display: block; font-size: .88rem; font-weight: 650; margin-bottom: 7px; line-height: 1.4; }
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid #9aaea6; border-radius: 8px; width: 100%; padding: 11px 12px; min-height: 44px; }
input[inputmode='decimal'] { font-variant-numeric: tabular-nums; }
input[aria-invalid='true'] { border-color: var(--error); background: #fff9f7; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 3px solid #247e66; outline-offset: 3px; }
.help { color: var(--muted); font-size: .84rem; line-height: 1.65; margin: 17px 0 0; }
#text-help { margin: 0 0 20px; }
.field-error { color: var(--error); font-size: .8rem; line-height: 1.45; margin: 7px 0 0; }
.counter, .local-tag { border-radius: 20px; padding: 6px 11px; font-size: .78rem; font-weight: 700; background: var(--mint); white-space: nowrap; }
.material-row { margin: 0 0 18px; padding: 15px 16px 17px; border: 1px solid var(--line); border-radius: 11px; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: start; }
legend { padding: 0 7px; color: var(--muted); font-size: .8rem; font-weight: 650; }
button { font: inherit; font-size: .9rem; font-weight: 650; padding: 11px 17px; min-height: 44px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; }
button:hover:enabled { filter: brightness(.92); }
button:disabled { cursor: default; opacity: .48; }
button.secondary { background: #fffef9; color: var(--accent); }
.remove-button { margin-top: 27px; background: transparent; border-color: #b9c7bf; color: #624c43; padding: 11px 12px; }
.result-card { border-top: 4px solid var(--accent); }
.factor-box { background: var(--mint); border-radius: 10px; padding: 18px 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.factor-box span { font-size: .84rem; color: var(--muted); }
.factor-box strong { font-size: 1.24rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; min-width: 0; }
.table-scroll { width: 100%; overflow-x: auto; margin-top: 22px; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; text-align: left; font-size: .93rem; }
th, td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; white-space: pre-wrap; }
thead th { color: var(--muted); font-size: .79rem; background: #f4f6f0; }
tbody th { font-weight: 650; }
tbody td { font-variant-numeric: tabular-nums; }
tbody td:last-child { color: var(--accent); font-weight: 750; }
.actions { margin-top: 23px; display: flex; flex-wrap: wrap; gap: 12px; }
.feedback { min-height: 1.4em; font-size: .85rem; line-height: 1.6; margin: 13px 0 0; }
.validation-summary { color: var(--error); background: #fff2e9; border-radius: 8px; padding: 12px 15px; margin: 19px 0 0; font-size: .9rem; line-height: 1.5; }
.manual-copy { margin-top: 18px; padding: 16px; background: #f3f6ef; border-radius: 10px; }
textarea { resize: vertical; line-height: 1.6; font-size: .88rem; }
footer { padding: 7px 6px 0; text-align: center; font-size: .78rem; color: var(--muted); line-height: 1.65; }
footer p { margin: 6px 0; }
.brand { color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
.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; }
@media (max-width: 680px) {
  main { width: min(100% - 24px, 980px); padding-top: 20px; }
  .card { padding: 19px 16px; border-radius: 13px; }
  .counts-grid { gap: 10px; grid-template-columns: minmax(0, 1fr) 25px minmax(0, 1fr); }
  .material-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 12px; }
  .field-name { grid-column: 1 / -1; }
  .remove-button { margin-top: 0; grid-column: 1 / -1; justify-self: end; }
  .section-heading { align-items: flex-start; }
  .local-tag { white-space: normal; text-align: center; }
  th, td { padding: 12px 7px; }
  .factor-box { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; } }
