:root {
  --paper: #F6F7F2;
  --paper-2: #ECEEE6;
  --ink: #1E282C;
  --ink-2: #4A5559;
  --line: #D5D9CE;
  --cobalt: #2C47B5;
  --cobalt-dark: #1F3486;
  --ball: #D6E65A;
  --kibble: #8A5A3C;
  --warn: #B8321D;
  --amber: #B7770F;
  --ok: #2F7A4B;
  --tag: #3552C4;
  --tag-hi: #6F86E3;
  --tag-lo: #22398F;
  --tag-text: #F1F4FF;
  --sans: 'Bricolage Grotesque', system-ui, sans-serif;
  --serif: 'Literata', Georgia, serif;
  --radius-s: 6px;
  --radius-m: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.5;
}
img, svg { max-width: 100%; }
a { color: var(--cobalt); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--cobalt-dark); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; border-radius: 3px; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header */
.site-head { border-bottom: 1px solid var(--line); }
.head-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 750; font-size: 1.3rem; letter-spacing: -0.01em; }
.brand .icon { color: var(--kibble); width: 28px; height: 28px; }
.brand:hover { color: var(--ink); }
.nav-list { list-style: none; display: flex; gap: 22px; margin: 0; padding: 0; }
.nav-list a { color: var(--ink-2); text-decoration: none; font-weight: 600; }
.nav-list a:hover, .nav-list a[aria-current] { color: var(--ink); text-decoration: underline; }

/* Headings */
h1, h2, h3 { font-family: var(--sans); line-height: 1.1; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 750; }
h2 { font-size: clamp(1.5rem, 3vw, 1.95rem); font-weight: 650; }
h3 { font-size: 1.2rem; font-weight: 650; letter-spacing: -0.01em; }

/* Breadcrumbs */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 22px 0 0; font-size: .9rem; color: var(--ink-2); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.crumbs a { color: var(--ink-2); }

/* Tool header + panel */
.tool-head { margin: 18px 0 26px; max-width: 46rem; }
.lede { font-family: var(--serif); font-size: 1.2rem; line-height: 1.6; color: var(--ink-2); margin: 14px 0 0; }

.panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: clamp(20px, 4vw, 40px);
}
.panel-out { display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 0; }
.panel-out .note { font-size: .95rem; color: var(--ink-2); text-align: center; max-width: 30rem; margin: 0; }
.panel-foot { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 14px; margin-top: -6px; display: flex; justify-content: flex-end; }
.link-btn { font: inherit; font-size: .95rem; font-weight: 600; color: var(--cobalt); background: none; border: 0; padding: 4px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--cobalt-dark); }
.field .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--cobalt); flex: 0 0 auto; }
.big-note { font-family: var(--sans); font-weight: 650; font-size: 1.05rem; margin: 0; text-align: center; }

/* Form controls */
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field label, .field > legend, .label { display: block; font-weight: 650; margin-bottom: 7px; }
.hint { display: block; font-size: .88rem; color: var(--ink-2); font-weight: 400; margin-top: 2px; }
legend { padding: 0; }
fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
input[type="number"], input[type="date"], select, textarea, input[type="text"], input[type="email"] {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-s);
  padding: 10px 12px;
  min-height: 46px;
}
input:focus, select:focus, textarea:focus { border-color: var(--cobalt); outline: none; box-shadow: 0 0 0 3px rgba(44,71,181,.18); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.with-unit { display: flex; gap: 8px; }
.with-unit input { flex: 1; min-width: 0; }
.with-unit select { width: auto; flex: 0 0 auto; }

/* Size chooser: radio pills */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice { margin: 0; }
.choice span {
  display: block; height: 100%;
  border: 1.5px solid var(--line); border-radius: var(--radius-s);
  padding: 9px 11px; cursor: pointer; background: var(--paper);
  font-weight: 600; line-height: 1.25;
}
.choice small { display: block; font-weight: 400; color: var(--ink-2); font-size: .82rem; margin-top: 2px; }
.choice input:checked + span { border-color: var(--cobalt); background: #E8ECFA; box-shadow: inset 0 0 0 1px var(--cobalt); }
.choice input:focus-visible + span { outline: 3px solid var(--cobalt); outline-offset: 2px; }

.error { color: var(--warn); font-weight: 600; font-size: .95rem; min-height: 1.4em; margin: 6px 0 0; }

/* Dog tag (signature element) */
.tag { margin: 0; width: min(100%, 380px); }
.tag svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 10px 14px rgba(30,40,44,.16)); }
.tag-big { font-family: var(--sans); font-weight: 750; font-size: 58px; fill: var(--tag-text); letter-spacing: -1px; paint-order: stroke; stroke: rgba(0,0,0,.18); stroke-width: 2px; }
.tag-small { font-family: var(--sans); font-weight: 600; font-size: 17px; fill: var(--tag-text); opacity: .9; }
.tag.pop svg { animation: swing .7s cubic-bezier(.3,1.4,.5,1); transform-origin: 12% 50%; }
@keyframes swing { 0% { transform: rotate(-6deg); } 60% { transform: rotate(2deg); } 100% { transform: rotate(0); } }

.result-list { list-style: none; padding: 0; margin: 0; width: 100%; max-width: 360px; border-top: 1px solid var(--line); }
.result-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .98rem; }
.result-list b { font-weight: 650; text-align: right; }

/* Page body */
.page-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: clamp(28px, 6vw, 72px); margin: 56px 0 80px; align-items: start; }
.prose { font-family: var(--serif); font-size: 1.08rem; line-height: 1.72; max-width: 40rem; }
.prose h2 { margin: 2.2em 0 .6em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 1.8em 0 .5em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose li { margin-bottom: .4em; }
.prose strong { font-weight: 600; }
.prose table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: .95rem; margin: 1.2em 0 1.6em; }
.prose th, .prose td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 650; background: var(--paper-2); }
.prose td:not(:first-child), .prose th:not(:first-child) { text-align: right; }
.table-scroll { overflow-x: auto; }
.callout { font-family: var(--sans); background: var(--paper-2); border-left: 4px solid var(--kibble); padding: 14px 18px; border-radius: 0 var(--radius-s) var(--radius-s) 0; margin: 1.4em 0; font-size: 1rem; line-height: 1.55; }
.callout.urgent { border-left-color: var(--warn); background: #F8E9E5; }
.callout p:last-child { margin-bottom: 0; }

.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { font-family: var(--sans); font-weight: 650; cursor: pointer; font-size: 1.08rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 400; color: var(--ink-2); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 10px 0 0; }

.sources { margin-top: 3em; padding-top: 1.4em; border-top: 1px solid var(--line); font-family: var(--sans); font-size: .95rem; }
.sources h2 { font-size: 1.15rem; margin: 0 0 .6em; }
.sources ul { padding-left: 1.1em; }
.updated { color: var(--ink-2); }

/* Rail */
.rail { position: sticky; top: 24px; }
.rail-head { font-weight: 650; margin: 0 0 10px; }
.rail ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rail a { display: flex; align-items: center; gap: 10px; padding: 11px 2px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); font-weight: 600; }
.rail a .icon { color: var(--kibble); flex: 0 0 auto; }
.rail a:hover span { text-decoration: underline; }

/* Buttons */
.btn { display: inline-block; font: inherit; font-weight: 650; background: var(--cobalt); color: #fff; border: 0; border-radius: var(--radius-s); padding: 12px 20px; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--cobalt-dark); color: #fff; }

/* Chocolate meter */
.meter { width: 100%; max-width: 420px; }
.meter-verdict { font-family: var(--sans); font-weight: 750; font-size: clamp(1.6rem, 4vw, 2.1rem); letter-spacing: -0.02em; margin: 0 0 4px; line-height: 1.15; }
.meter-dose { margin: 0 0 18px; color: var(--ink-2); }
.meter-bar { position: relative; height: 18px; border-radius: 999px; display: grid; grid-template-columns: 2fr 2fr 2fr 1.5fr; overflow: hidden; }
.meter-bar span:nth-child(1) { background: #CFE3D3; }
.meter-bar span:nth-child(2) { background: #F3DDA6; }
.meter-bar span:nth-child(3) { background: #F0B8A6; }
.meter-bar span:nth-child(4) { background: #D9705A; }
.meter-pin { position: absolute; top: -7px; width: 4px; height: 32px; background: var(--ink); border-radius: 2px; transform: translateX(-2px); transition: left .5s cubic-bezier(.2,.8,.2,1); }
.meter-scale { display: grid; grid-template-columns: 2fr 2fr 2fr 1.5fr; font-size: .8rem; color: var(--ink-2); margin-top: 8px; }
.meter-scale span { border-left: 1px solid var(--line); padding-left: 4px; }
.meter[data-level="0"] .meter-verdict { color: var(--ok); }
.meter[data-level="1"] .meter-verdict { color: var(--amber); }
.meter[data-level="2"] .meter-verdict, .meter[data-level="3"] .meter-verdict { color: var(--warn); }
.meter-advice { margin: 18px 0 0; font-size: .98rem; }
.helplines { font-size: .92rem; color: var(--ink-2); margin: 10px 0 0; }

/* Growth chart */
.growth { width: 100%; max-width: 420px; }
.growth svg { width: 100%; height: auto; display: block; }
.growth .axis { stroke: var(--line); stroke-width: 1; }
.growth .curve { fill: none; stroke: var(--kibble); stroke-width: 3; stroke-linecap: round; }
.growth .band { fill: rgba(138,90,60,.12); }
.growth .dot { fill: var(--cobalt); stroke: #fff; stroke-width: 3; }
.growth text { font-family: var(--sans); font-size: 11px; fill: var(--ink-2); }

/* Timeline (pregnancy) */
.timeline { list-style: none; counter-reset: step; padding: 0; margin: 0; width: 100%; max-width: 420px; font-size: .95rem; }
.timeline li { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.timeline time { font-weight: 650; }

/* Home */
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: center; padding: clamp(40px, 7vw, 88px) 0 clamp(36px, 6vw, 72px); }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); max-width: 12ch; }
.hero .lede { max-width: 32rem; }
.hero-demo { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 26px 26px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.hero-demo label { font-weight: 650; align-self: stretch; display: flex; justify-content: space-between; }
.hero-demo input[type="range"] { width: 100%; accent-color: var(--cobalt); }
.hero-demo .note { font-size: .9rem; color: var(--ink-2); margin: 0; text-align: center; }

.tool-rows { list-style: none; margin: 0 0 40px; padding: 0; border-top: 2px solid var(--ink); }
.tool-rows li { border-bottom: 1px solid var(--line); }
.tool-rows a { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 22px 4px; color: var(--ink); text-decoration: none; }
.tool-rows .icon { width: 34px; height: 34px; color: var(--kibble); }
.tool-rows strong { display: block; font-size: clamp(1.25rem, 2.6vw, 1.6rem); font-weight: 650; letter-spacing: -0.015em; }
.tool-rows .desc { font-family: var(--serif); color: var(--ink-2); }
.tool-rows .go { font-weight: 650; color: var(--cobalt); white-space: nowrap; }
.tool-rows a:hover strong { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin: 0 0 14px; }

.home-notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 4vw, 48px); margin: 64px 0 88px; }
.home-notes h3 { margin-bottom: 8px; }
.home-notes p { font-family: var(--serif); color: var(--ink-2); margin: 0; line-height: 1.65; }
.mark { background: linear-gradient(transparent 58%, var(--ball) 58%, var(--ball) 92%, transparent 92%); padding: 0 2px; }

/* Simple pages */
.simple { max-width: 42rem; margin: 0 0 88px; }
.simple .tool-head { margin-bottom: 36px; }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); padding: clamp(20px, 4vw, 32px); margin: 8px 0 32px; }
textarea { min-height: 150px; resize: vertical; }

/* Footer */
.site-foot { background: var(--ink); color: #DCE2E3; padding: 48px 0 24px; }
.site-foot a { color: #fff; }
.site-foot .brand { color: #fff; }
.site-foot .brand .icon { color: var(--ball); }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 32px; }
.foot-note { font-family: var(--serif); font-size: .95rem; line-height: 1.6; max-width: 26rem; color: #BFC8CA; }
.foot-head { font-weight: 650; color: #fff; margin: 4px 0 10px; }
.site-foot ul { list-style: none; padding: 0; margin: 0; }
.site-foot li { margin-bottom: 7px; }
.site-foot li a { color: #DCE2E3; text-decoration: none; }
.site-foot li a:hover { color: #fff; text-decoration: underline; }
.foot-base { border-top: 1px solid #36454A; margin-top: 36px; padding-top: 18px; font-size: .88rem; color: #97A3A6; }

/* Responsive */
@media (max-width: 880px) {
  .panel, .hero, .page-grid { grid-template-columns: 1fr; }
  .rail { position: static; }
  .home-notes { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .tool-rows a { grid-template-columns: 34px minmax(0, 1fr); }
  .tool-rows .go { display: none; }
  .nav-list { gap: 14px; font-size: .95rem; }
  .brand { font-size: 1.15rem; }
  .head-inner { gap: 8px; }
  .timeline li { grid-template-columns: 104px 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Contact */
.contact-card { font-family: var(--sans); }
.contact-mail { font-size: clamp(1.3rem, 3.5vw, 1.7rem); font-weight: 650; margin: 0 0 14px; word-break: break-all; }
.contact-topics { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.contact-topics a { display: inline-block; border: 1.5px solid var(--line); border-radius: var(--radius-s); padding: 8px 12px; text-decoration: none; font-weight: 600; background: var(--paper); }
.contact-topics a:hover { border-color: var(--cobalt); }
