:root {
  --ink: #17332d;
  --muted: #5d706b;
  --paper: #f7f4ed;
  --surface: #fffdf8;
  --line: #d8ddd5;
  --brand: #087b69;
  --brand-dark: #07584d;
  --mint: #dff3ec;
  --sun: #ffd66b;
  --danger: #a23a32;
  --danger-bg: #fff0ed;
  --warning: #795d00;
  --warning-bg: #fff7d9;
  --success: #176645;
  --success-bg: #e6f5ec;
  --shadow: 0 18px 50px rgba(19, 52, 44, .10);
  --radius: 20px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.65; }
a { color: var(--brand-dark); text-underline-offset: .18em; }
a:hover { color: var(--brand); }
img, svg { max-width: 100%; }
button, input, select { font: inherit; }

.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .75rem 1rem; background: var(--ink); color: white; border-radius: 10px; }
.skip-link:focus { top: 1rem; }

.site-header { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); background: rgba(247, 244, 237, .91); border-bottom: 1px solid rgba(23, 51, 45, .10); }
.header-inner { width: min(1160px, calc(100% - 2rem)); margin: auto; min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.logo { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; font-weight: 850; letter-spacing: -.035em; font-size: 1.25rem; }
.logo-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50% 50% 45% 45%; background: var(--brand); color: white; box-shadow: inset 0 -7px 0 rgba(0, 0, 0, .08); }
.site-nav { display: flex; align-items: center; gap: .2rem; flex-wrap: wrap; justify-content: flex-end; }
.site-nav a { text-decoration: none; color: var(--ink); padding: .55rem .72rem; border-radius: 999px; font-size: .93rem; font-weight: 700; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--mint); color: var(--brand-dark); }

main { min-height: 60vh; }
.shell { width: min(1160px, calc(100% - 2rem)); margin: auto; }
.narrow { width: min(820px, calc(100% - 2rem)); margin: auto; }

.hero { padding: clamp(4rem, 10vw, 8rem) 0 4rem; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.12fr .88fr; gap: clamp(2rem, 7vw, 6rem); align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 850; color: var(--brand-dark); }
.eyebrow::before { content: ""; width: 2.4rem; height: 2px; background: var(--brand); }
h1, h2, h3 { line-height: 1.08; letter-spacing: -.045em; margin: 0 0 .8rem; text-wrap: balance; }
h1 { font-size: clamp(3rem, 8vw, 6.6rem); max-width: 12ch; }
h2 { font-size: clamp(2rem, 5vw, 3.7rem); }
h3 { font-size: 1.35rem; letter-spacing: -.025em; }
.lede { font-size: clamp(1.08rem, 2vw, 1.35rem); color: var(--muted); max-width: 62ch; }
.hero-actions, .button-row { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: .72rem 1.05rem; border-radius: 12px; border: 1px solid var(--brand); background: var(--brand); color: white; text-decoration: none; font-weight: 800; cursor: pointer; }
.button:hover { background: var(--brand-dark); color: white; }
.button.secondary { color: var(--ink); background: transparent; border-color: var(--line); }
.button.secondary:hover { background: var(--surface); color: var(--ink); }

.measure-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 1.3rem; box-shadow: var(--shadow); transform: rotate(1deg); }
.measure-card::before { content: ""; position: absolute; inset: -2rem -3rem auto auto; width: 9rem; height: 9rem; border-radius: 50%; background: var(--sun); z-index: -1; opacity: .7; }
.toilet-diagram { min-height: 300px; border-radius: 18px; background: linear-gradient(145deg, #eff7f3, #d7ebe3); display: grid; place-items: center; padding: 2rem; }
.toilet-shape { width: 72%; aspect-ratio: 1 / 1.22; border: 18px solid white; border-radius: 48% 48% 44% 44%; box-shadow: 0 12px 28px rgba(7, 88, 77, .15); position: relative; }
.toilet-shape::before { content: ""; position: absolute; width: 48%; height: 10px; background: var(--brand); top: -22px; left: 26%; border-radius: 999px; }
.ruler { position: absolute; inset: 15% auto 15% 50%; width: 3px; background: repeating-linear-gradient(to bottom, var(--brand) 0 10px, transparent 10px 18px); }
.measure-list { display: grid; gap: .5rem; margin-top: 1rem; }
.measure-list span { display: flex; align-items: center; gap: .55rem; font-weight: 750; }
.measure-list b { width: 1.7rem; height: 1.7rem; display: grid; place-items: center; border-radius: 50%; background: var(--mint); color: var(--brand-dark); font-size: .78rem; }

.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section.alt { background: #eef4ef; border-block: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 2rem; }
.kicker { color: var(--brand-dark); font-weight: 850; text-transform: uppercase; letter-spacing: .11em; font-size: .78rem; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.35rem; box-shadow: 0 7px 20px rgba(20, 55, 46, .04); }
.card p:last-child { margin-bottom: 0; }
.card .number { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 10px; background: var(--mint); color: var(--brand-dark); font-weight: 900; margin-bottom: 1rem; }
.card-link { color: inherit; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
.card-link:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: inherit; }

.page-hero { padding: 4rem 0 2.4rem; }
.page-hero h1 { font-size: clamp(2.8rem, 7vw, 5.3rem); max-width: 15ch; }
.breadcrumb { display: flex; gap: .45rem; flex-wrap: wrap; color: var(--muted); font-size: .9rem; margin-bottom: 1.2rem; }
.breadcrumb a { color: inherit; }
.prose { font-size: 1.05rem; }
.prose h2 { margin-top: 2.6rem; font-size: clamp(1.8rem, 4vw, 2.7rem); }
.prose h3 { margin-top: 2rem; }
.prose p, .prose li { max-width: 72ch; }
.prose li + li { margin-top: .45rem; }
.prose table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.prose th, .prose td { text-align: left; vertical-align: top; padding: .85rem; border-bottom: 1px solid var(--line); }
.prose th { background: var(--mint); }
.callout { margin: 1.5rem 0; padding: 1.1rem 1.2rem; border-left: 5px solid var(--brand); background: var(--mint); border-radius: 0 14px 14px 0; }
.callout.warning { border-color: #b78700; background: var(--warning-bg); }
.callout.danger { border-color: var(--danger); background: var(--danger-bg); }
.sources { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: .92rem; color: var(--muted); }

.checker-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, .55fr); gap: 1.2rem; align-items: start; }
.checker { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: clamp(1rem, 3vw, 2rem); box-shadow: var(--shadow); }
fieldset { border: 0; margin: 0; padding: 1.35rem 0; border-bottom: 1px solid var(--line); }
fieldset:last-of-type { border-bottom: 0; }
legend { font-size: 1.18rem; font-weight: 900; letter-spacing: -.02em; padding: 0; margin-bottom: .75rem; }
.field-note { display: block; color: var(--muted); font-size: .9rem; margin: -.35rem 0 .7rem; }
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label { display: block; padding: .8rem; border: 1px solid var(--line); border-radius: 12px; background: white; font-weight: 750; cursor: pointer; min-height: 100%; }
.choice input:checked + label { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(8, 123, 105, .13); background: var(--mint); }
.choice input:focus-visible + label { outline: 3px solid var(--sun); outline-offset: 2px; }
.measure-inputs { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.field label { display: block; font-weight: 800; margin-bottom: .35rem; }
.field input, .field select { width: 100%; min-height: 46px; border: 1px solid #b9c7c2; border-radius: 10px; background: white; padding: .6rem .7rem; color: var(--ink); }
.result-panel { position: sticky; top: 92px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 1.25rem; }
.result-panel h2 { font-size: 1.7rem; }
.result-panel.empty { color: var(--muted); }
.result-panel.likely { border-color: #78b996; background: var(--success-bg); }
.result-panel.caution { border-color: #d8b547; background: var(--warning-bg); }
.result-panel.high-risk { border-color: #d38a83; background: var(--danger-bg); }
.result-badge { display: inline-flex; padding: .35rem .65rem; border-radius: 999px; background: rgba(255,255,255,.7); font-size: .77rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.result-list { padding-left: 1.2rem; }
.result-list li + li { margin-top: .55rem; }
.result-meta { font-size: .88rem; color: var(--muted); border-top: 1px solid rgba(23,51,45,.15); padding-top: .8rem; margin-top: 1rem; }

.notice { background: var(--ink); color: white; padding: 1rem 0; }
.notice .shell { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.notice a { color: var(--sun); }
.site-footer { padding: 3rem 0; border-top: 1px solid var(--line); color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 2rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .8rem 1rem; justify-content: flex-end; }
.small { font-size: .9rem; color: var(--muted); }

@media (max-width: 860px) {
  .hero-grid, .checker-layout, .footer-grid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr 1fr; }
  .result-panel { position: static; }
  .footer-links { justify-content: flex-start; }
  .site-nav a:nth-child(n+4) { display: none; }
}

@media (max-width: 580px) {
  .header-inner { min-height: 64px; }
  .site-nav a:not(.nav-primary) { display: none; }
  .grid, .grid.two, .choice-grid, .measure-inputs { grid-template-columns: 1fr; }
  h1 { font-size: clamp(2.7rem, 15vw, 4.5rem); }
  .hero { padding-top: 3rem; }
  .measure-card { transform: none; }
  .notice .shell { align-items: flex-start; flex-direction: column; }
}

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