:root {
  color-scheme: light;
  --forest-950: #09281d;
  --forest-900: #123b2b;
  --forest-800: #194c38;
  --forest-700: #256349;
  --ink: #17211d;
  --muted: #617068;
  --paper: #f3f4ed;
  --surface: #ffffff;
  --line: #d9ded6;
  --lime: #b9e45b;
  --lime-strong: #9bd137;
  --pass: #3d8c55;
  --check: #bb7919;
  --attention: #c9453f;
  --shadow: 0 18px 44px rgba(9, 40, 29, 0.12);
  --radius: 24px;
  font-family: Inter, "Avenir Next", "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--paper); }

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 95% 0%, rgba(185, 228, 91, 0.18), transparent 28rem),
    var(--paper);
  -webkit-tap-highlight-color: transparent;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 4px solid rgba(155, 209, 55, 0.45);
  outline-offset: 2px;
}

.app-shell { min-height: 100dvh; }

.topbar {
  width: min(100%, 900px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  padding: 8px 0;
  color: var(--forest-950);
  background: transparent;
  font-weight: 850;
  letter-spacing: -0.03em;
  font-size: 1.2rem;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--forest-900);
  color: var(--lime);
  font-size: 1rem;
}

.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-button, .language-pill {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  color: var(--forest-900);
  font-weight: 750;
}
.icon-button { width: 44px; padding: 0; display: grid; place-items: center; }
.language-pill { padding: 0 15px; }

.page {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 24px 20px max(40px, env(safe-area-inset-bottom));
}

.hero { padding-top: clamp(42px, 10vh, 100px); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  color: var(--forest-700);
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 22px; height: 3px; border-radius: 9px; background: var(--lime-strong); }

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--forest-950); letter-spacing: -0.045em; }
h1 { max-width: 680px; margin-bottom: 20px; font-size: clamp(2.65rem, 9vw, 5.4rem); line-height: .96; }
h2 { margin-bottom: 12px; font-size: clamp(2rem, 7vw, 3.4rem); line-height: 1.03; }
h3 { margin-bottom: 8px; font-size: 1.15rem; letter-spacing: -.02em; }
.lead { max-width: 590px; color: var(--muted); font-size: clamp(1.05rem, 3vw, 1.25rem); line-height: 1.5; }
.hero .lead { margin-bottom: 34px; }

.action-stack { display: grid; gap: 12px; max-width: 460px; }
.button {
  min-height: 56px;
  border: 0;
  border-radius: 16px;
  padding: 15px 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  text-decoration: none;
  font-weight: 820;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}
.button:active { transform: scale(.985); }
.button-primary { color: #102019; background: var(--lime); box-shadow: 0 10px 25px rgba(116, 157, 32, .2); }
.button-primary:hover { background: #c7ec75; }
.button-dark { color: #fff; background: var(--forest-900); }
.button-secondary { color: var(--forest-900); background: var(--surface); border: 1px solid var(--line); }
.button-ghost { color: var(--forest-800); background: transparent; }
.button-danger { color: #fff; background: var(--attention); }
.button-small { min-height: 44px; padding: 10px 15px; border-radius: 13px; }
.button-wide { width: 100%; }
.button-new-sprayer {
  margin-top: 12px;
  color: var(--forest-900);
  background: #eff8d6;
  border-color: var(--lime-strong);
}
.button-new-sprayer:hover { background: #e3f1bd; }

.trust-row {
  margin-top: 54px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
}

.setup-head { margin-bottom: 30px; }
.step-label { margin-bottom: 9px; color: var(--forest-700); font-size: .82rem; font-weight: 850; text-transform: uppercase; letter-spacing: .1em; }
.progress-track { width: 100%; height: 6px; margin-bottom: 32px; overflow: hidden; border-radius: 10px; background: #dfe4da; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--lime-strong); transition: width .35s ease; }

.card {
  padding: 22px;
  border: 1px solid rgba(18, 59, 43, .1);
  border-radius: var(--radius);
  background: rgba(255,255,255,.88);
  box-shadow: 0 8px 24px rgba(9, 40, 29, .06);
}
.card + .card { margin-top: 14px; }
.card-selectable { width: 100%; text-align: left; color: inherit; }
.card-selectable[aria-pressed="true"] { border: 2px solid var(--forest-700); background: #f9fff0; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.card-meta { color: var(--muted); font-size: .9rem; }

.check-list { display: grid; gap: 14px; margin: 26px 0 34px; }
.check-item { display: flex; align-items: center; gap: 15px; padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); font-weight: 750; }
.check-icon { flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 11px; color: var(--forest-900); background: var(--lime); }

.form-grid { display: grid; gap: 18px; }
.field { display: grid; gap: 8px; }
.field label, .field-label { color: var(--forest-950); font-size: .9rem; font-weight: 820; }
.field-help { color: var(--muted); font-size: .82rem; line-height: 1.4; }
.input, .select {
  width: 100%;
  min-height: 56px;
  border: 1.5px solid #cdd5cc;
  border-radius: 15px;
  padding: 12px 16px;
  color: var(--ink);
  background: var(--surface);
  font-size: 1.05rem;
  font-weight: 720;
}
.input-invalid { border-color: var(--attention); }
.error-text { margin: 0; color: var(--attention); font-size: .84rem; font-weight: 750; }
.input-suffix { position: relative; }
.input-suffix .input { padding-right: 76px; }
.suffix { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 750; }

.segmented { padding: 4px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: 16px; background: #e4e8df; }
.segment { min-height: 48px; border: 0; border-radius: 12px; color: var(--muted); background: transparent; font-weight: 820; }
.segment[aria-pressed="true"] { color: var(--forest-950); background: var(--surface); box-shadow: 0 3px 10px rgba(9,40,29,.1); }
.segmented-two { grid-template-columns: 1fr 1fr; }

.section-actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }
.section-actions .button-primary, .section-actions .button-dark { flex: 1 1 220px; }
.link-button { border: 0; padding: 10px 0; color: var(--forest-700); background: transparent; font-weight: 800; text-decoration: underline; text-underline-offset: 4px; }
.disclosure { margin-top: 20px; }
.calculation-panel { margin-top: 16px; padding: 20px; border-radius: 18px; background: #e9eee5; }
.calculated-result { margin: 16px 0 0; color: var(--forest-900); font-size: 1.05rem; font-weight: 850; }

.live-shell { min-height: 100dvh; padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom)); display: grid; grid-template-rows: auto 1fr auto; color: #fff; background: var(--forest-950); }
.live-top { width: min(100%, 720px); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.live-progress { flex: 1; }
.live-progress-text { margin-bottom: 7px; display: flex; justify-content: space-between; color: #becbc4; font-size: .78rem; font-weight: 780; }
.live-progress .progress-track { height: 5px; margin: 0; background: rgba(255,255,255,.13); }
.live-body { width: min(100%, 680px); margin: 0 auto; padding: 30px 0; display: grid; align-content: center; text-align: center; }
.live-kicker { margin-bottom: 14px; color: var(--lime); font-size: .84rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.live-title { margin-bottom: 18px; color: #fff; font-size: clamp(2rem, 9vw, 4.8rem); line-height: 1; }
.live-copy { max-width: 490px; margin: 0 auto 28px; color: #cbd6d0; font-size: 1.08rem; line-height: 1.5; }
.timer { margin: 8px 0 32px; color: #fff; font-variant-numeric: tabular-nums; font-size: clamp(5rem, 28vw, 10rem); line-height: .9; font-weight: 880; letter-spacing: -.07em; }
.timer-active { color: var(--lime); }
.live-actions { width: min(100%, 480px); margin: 0 auto; display: grid; gap: 12px; }
.live-actions .button { min-height: 62px; font-size: 1.02rem; }
.live-input-wrap { width: min(100%, 420px); margin: 0 auto 26px; position: relative; }
.live-input { width: 100%; height: 112px; border: 2px solid #5a6f64; border-radius: 22px; padding: 12px 94px 12px 20px; color: #fff; background: rgba(255,255,255,.08); text-align: center; font-size: clamp(2.7rem, 15vw, 5.2rem); font-weight: 860; font-variant-numeric: tabular-nums; }
.live-input::placeholder { color: #71847b; }
.live-input-unit { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); color: #b8c7bf; font-weight: 800; }
.live-footer { width: min(100%, 720px); margin: 0 auto; display: flex; justify-content: space-between; gap: 8px; }
.live-footer .button-ghost { min-height: 48px; color: #c7d2cc; }
.result-orb { width: 112px; height: 112px; margin: 0 auto 24px; display: grid; place-items: center; border-radius: 50%; color: white; font-size: 3rem; font-weight: 900; animation: result-in .32s ease-out; }
.status-pass { background: var(--pass); }
.status-check { background: var(--check); }
.status-attention { background: var(--attention); }
.deviation { margin: -4px 0 22px; color: #fff; font-size: 1.2rem; font-weight: 800; }
@keyframes result-in { from { transform: scale(.75); opacity: 0; } }

.summary-grid { margin: 28px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.summary-stat { min-width: 0; padding: 16px 10px; border-radius: 18px; color: white; text-align: center; }
.summary-number { display: block; font-size: 2rem; font-weight: 880; }
.summary-label { font-size: .74rem; font-weight: 800; line-height: 1.2; }
.affected-list { display: grid; gap: 12px; margin: 24px 0; }
.affected-item { padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.status-chip { display: inline-flex; padding: 6px 10px; border-radius: 999px; color: white; font-size: .75rem; font-weight: 850; white-space: nowrap; }
.empty-state { padding: 36px 20px; border: 1px dashed #bdc8bf; border-radius: 22px; color: var(--muted); text-align: center; }

.list { display: grid; gap: 12px; margin-top: 24px; }
.list-item { padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.list-item-copy { min-width: 0; }
.list-item-title { margin: 0 0 5px; color: var(--forest-950); font-weight: 850; }
.list-item-meta { margin: 0; color: var(--muted); font-size: .85rem; }

.setting-row { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-copy { padding: 14px 0; }
.setting-copy p { margin: 4px 0 0; color: var(--muted); font-size: .82rem; }
.switch { width: 54px; height: 32px; flex: 0 0 auto; border: 0; border-radius: 99px; padding: 3px; background: #cbd2cc; transition: background .18s ease; }
.switch::after { content: ""; display: block; width: 26px; height: 26px; border-radius: 50%; background: white; box-shadow: 0 2px 7px rgba(0,0,0,.2); transition: transform .18s ease; }
.switch[aria-checked="true"] { background: var(--forest-700); }
.switch[aria-checked="true"]::after { transform: translateX(22px); }
.language-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.toast-region { position: fixed; z-index: 20; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); width: min(calc(100% - 32px), 480px); transform: translateX(-50%); pointer-events: none; }
.toast { padding: 14px 18px; border-radius: 14px; color: white; background: var(--forest-950); box-shadow: var(--shadow); font-weight: 750; animation: toast-in .2s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
.hidden { display: none !important; }

@media (min-width: 720px) {
  .page { padding-left: 30px; padding-right: 30px; }
  .form-grid-two { grid-template-columns: 1fr 1fr; }
  .hero { min-height: calc(100dvh - 88px); display: grid; align-content: center; padding-bottom: 100px; }
  .card { padding: 28px; }
}

@media (max-width: 420px) {
  .topbar { padding-left: 16px; padding-right: 16px; }
  .page { padding-left: 16px; padding-right: 16px; }
  .summary-grid { gap: 6px; }
  .summary-stat { padding: 14px 6px; }
  .summary-label { font-size: .68rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
