:root {
  color-scheme: light;
  --paper: #f9f6eb;
  --ink: #20271e;
  --muted: #535749;
  --green: #173a2e;
  --gold: #f3bd54;
  --rule: #cbc7b7;
  --focus: #a13e17;
  --display: Georgia, "Times New Roman", serif;
  --body: system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-block-start: 1rem; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.55 var(--body);
}
img { display: block; max-width: 100%; }
button, input { font: inherit; }
a {
  color: inherit;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.08em;
}
a:hover { text-decoration-thickness: 0.14em; }
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}
h1, h2, h3, h4, p, figure { margin: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; }
p + p { margin-top: 0.65rem; }
.shell { width: min(100% - 2.5rem, 73rem); margin-inline: auto; }
.skip-link {
  position: absolute;
  z-index: 4;
  top: 0.75rem;
  left: 1rem;
  padding: 0.65rem 1rem;
  transform: translateY(calc(-100% - 2rem));
  color: var(--green);
  background: white;
}
.skip-link:focus { transform: none; }
.patch-header { background: var(--green); color: #fff8e6; }
.patch-header :focus-visible, .patch-footer :focus-visible { outline-color: var(--gold); }
.header-inner, .footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}
.header-inner { min-height: 4.35rem; flex-wrap: wrap; }
.patch-brand {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 0.65rem;
  font: 1.28rem/1.02 var(--display);
  text-decoration: none;
}
.patch-brand span span {
  display: block;
  margin-top: 0.16rem;
  color: #e2d6b5;
  font: 0.76rem/1.2 var(--body);
  letter-spacing: 0.045em;
}
.patch-header nav { display: flex; align-items: center; gap: 1.4rem; }
.patch-header nav a, .patch-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.9rem;
}

.patch-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  align-items: center;
  gap: clamp(1.8rem, 5vw, 4.5rem);
  padding-block: clamp(2.6rem, 5.7vw, 5.75rem);
}
.overline {
  color: #655027;
  font-size: 0.79rem;
  font-weight: 750;
  line-height: 1.4;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.patch-hero h1 {
  max-width: 11ch;
  margin-block: 0.65rem 1.15rem;
  color: var(--green);
  font-size: clamp(3.25rem, 6.4vw, 6.5rem);
  line-height: 0.94;
  letter-spacing: -0.06em;
  overflow-wrap: anywhere;
}
.hero-description { max-width: 37ch; color: var(--muted); font-size: clamp(1rem, 1.8vw, 1.22rem); }
.hero-copy .button { margin-top: 1.4rem; }
.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0.63rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 0.25rem;
  font-weight: 750;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.button-primary { background: var(--gold); border-color: #b58731; color: #1f2717; }
.button-primary:hover { background: #ffd286; }
.button-secondary { background: transparent; border-color: var(--green); color: var(--green); }
.button-secondary:hover { background: #e7eddb; }
.button:disabled { opacity: 0.62; cursor: default; }

.field-photo {
  overflow: hidden;
  min-width: 0;
  border: 1px solid #26362a;
  border-radius: 0.3rem;
  background: #3f553c;
}
.field-photo img {
  width: 100%;
  height: clamp(17rem, 31vw, 29rem);
  object-fit: cover;
  object-position: 62% 55%;
}
.field-photo figcaption {
  padding: 0.15rem 0.75rem;
  background: #172a22;
  color: #fff8e6;
  font-size: 0.81rem;
}
.field-photo figcaption a { display: inline-flex; min-height: 44px; align-items: center; color: #f2ce88; }
.field-photo figcaption a:focus-visible { outline-color: var(--gold); }

.plan-band {
  background: #eaf0e1;
  border-block: 1px solid #bdcbb5;
  padding-block: clamp(2.1rem, 5vw, 4.2rem);
}
.planner-layout { display: grid; grid-template-columns: minmax(0, 0.62fr) minmax(0, 1.38fr); gap: clamp(1.5rem, 5vw, 4.25rem); }
.planner-intro h2, .result-header h2, .source-section h2 {
  margin-block: 0.4rem 0.75rem;
  color: var(--green);
  font-size: clamp(2rem, 4.2vw, 4rem);
  line-height: 1;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}
.planner-intro p:last-child { max-width: 30ch; }
.patch-form { min-width: 0; }
.patch-form fieldset { min-width: 0; margin: 0 0 1.2rem; padding: 0; border: 0; }
.patch-form legend { max-width: 100%; margin-bottom: 0.5rem; padding: 0; color: var(--green); font-weight: 760; }
.choice-grid { display: grid; gap: 0.6rem; }
.choice-grid-two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); }
.choice-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice-grid label {
  display: flex;
  min-height: 64px;
  gap: 0.58rem;
  padding: 0.7rem;
  border: 1px solid #9ca995;
  border-radius: 0.25rem;
  background: #f9f9f2;
  cursor: pointer;
}
.choice-grid label span { min-width: 0; overflow-wrap: anywhere; }
.choice-grid label:hover { border-color: var(--green); }
.choice-grid label:has(input:checked) { border-color: var(--green); background: #fcf1d6; }
.choice-grid label:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.choice-grid input {
  flex: 0 0 1.08rem;
  width: 1.08rem;
  height: 1.08rem;
  margin: 0.15rem 0 0;
  accent-color: var(--green);
}
.choice-grid small { display: block; margin-top: 0.12rem; color: var(--muted); font-size: 0.85rem; line-height: 1.3; }
.field-note { margin-block: 0.25rem 1.1rem; color: #354731; }
.form-end { display: flex; flex-wrap: wrap; gap: 0.7rem 1rem; align-items: center; }
.form-end p { color: var(--muted); font-size: 0.88rem; }

.patch-result { padding-block: clamp(2.25rem, 5.4vw, 5rem); animation: reveal 180ms ease-out both; }
@keyframes reveal { from { opacity: 0; } to { opacity: 1; } }
.result-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.9rem 1rem;
  margin-bottom: 1.25rem;
}
.result-header h2 { margin-bottom: 0.48rem; }
.result-header p:not(.overline) { max-width: 51ch; color: var(--muted); }
.bloom-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; }
.season-card {
  min-width: 0;
  padding: 1.1rem;
  border: 1px solid var(--season-border);
  border-block-start: 0.28rem solid var(--season-ink);
  background: var(--season-paper);
}
.season-spring { --season-ink: #375333; --season-border: #b1bf9c; --season-paper: #eff2df; }
.season-summer { --season-ink: #674d13; --season-border: #c7b680; --season-paper: #fbf0cd; }
.season-fall { --season-ink: #73371c; --season-border: #c6ac94; --season-paper: #f7e8d9; }
.season-name { color: var(--season-ink); font-size: 1.8rem; line-height: 1.08; }
.season-role { color: var(--muted); font-size: 0.86rem; }
.plant-name {
  margin-block: 1rem 0.18rem;
  font-size: 1.18rem;
  font-weight: 750;
  line-height: 1.25;
}
.plant-details { color: #414438; overflow-wrap: anywhere; }
.plant-details i { display: block; margin-bottom: 0.37rem; }
.plant-height, .plant-soil, .plant-sources { font-size: 0.86rem; }
.plant-sources { margin-top: 0.55rem; line-height: 1.35; }
.plant-sources a { color: var(--green); }
.season-gap p:last-child { margin-top: 0.5rem; color: var(--muted); }
.more-plants { margin-top: 0.5rem; border-top: 1px solid var(--season-border); }
.more-plants summary { min-height: 44px; padding-block: 0.7rem; color: var(--green); cursor: pointer; }
.more-plants ul { margin: 0 0 0.2rem; padding-left: 1.12rem; }
.more-plants li + li { margin-top: 0.8rem; }
.first-step {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 0.35rem 1rem;
  margin-top: 1.2rem;
  padding: 0.85rem 1rem;
  border-block: 1px solid var(--rule);
}
.first-step h3 { color: var(--green); font-size: 1.55rem; }
.first-step p { max-width: 68ch; }
.first-step p + p { color: var(--muted); }
.print-habitat { display: none; }

.source-section {
  display: grid;
  grid-template-columns: minmax(0, 0.62fr) minmax(0, 1.38fr);
  gap: 0.85rem clamp(1.5rem, 5vw, 4.25rem);
  padding-block: clamp(2.2rem, 5vw, 3.8rem);
}
.source-section h2 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); }
.source-section p { max-width: 65ch; color: var(--muted); }
.source-section ul { margin: 0.3rem 0 0; padding: 0; list-style: none; }
.source-section li a { display: inline-flex; align-items: center; min-height: 44px; color: var(--green); }
.habitat-section { border-block: 1px solid var(--rule); padding-block: clamp(1.25rem, 3.5vw, 2.5rem); }
.habitat-section strong { color: var(--green); }
.habitat-section p + p { margin-top: 0.65rem; }
.habitat-section .habitat-references { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.patch-releases { max-width: 65ch; margin-top: 0.65rem; border-top: 1px solid var(--rule); }
.patch-releases summary { min-height: 44px; padding-block: 0.6rem; color: var(--green); cursor: pointer; }
.patch-releases p + p { margin-top: 0.35rem; }
.patch-footer { padding-block: 0.7rem max(0.7rem, env(safe-area-inset-bottom)); color: #fff8e6; background: var(--green); }
.footer-inner { flex-wrap: wrap; justify-content: flex-start; }
.patch-footer .footer-brand { margin-right: auto; font: 1.3rem var(--display); text-decoration: none; }
.patch-footer .bb-zen-launcher { position: static; min-width: 44px; min-height: 44px; }

@media (max-width: 55rem) {
  .patch-hero { gap: 1.35rem; }
  .patch-hero h1 { font-size: clamp(2.85rem, 7vw, 5rem); }
  .planner-layout { grid-template-columns: minmax(0, 1fr); }
  .planner-intro p:last-child { max-width: 60ch; }
}

@media (max-width: 39rem) {
  .shell { width: calc(100% - 2rem); }
  .header-inner { min-height: 3.7rem; }
  .patch-header nav .source-nav { display: none; }
  .patch-brand img { width: 32px; height: 32px; }
  .patch-header nav a { text-align: right; }
  .patch-hero { grid-template-columns: minmax(0, 1fr); padding-block: 1.5rem 1.25rem; }
  .patch-hero h1 { max-width: 12ch; margin-block: 0.5rem 0.65rem; font-size: clamp(2.9rem, 11vw, 4.35rem); }
  .hero-copy .button { margin-top: 0.9rem; }
  .field-photo img { height: clamp(9rem, 43vw, 14rem); }
  .choice-grid-three, .bloom-results, .first-step, .source-section { grid-template-columns: minmax(0, 1fr); }
  .choice-grid label { min-height: 55px; }
  .season-card { padding: 0.9rem; }
  .source-section h2 { margin-bottom: 0; }
  .footer-inner { gap: 0.15rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .patch-result { animation: none; }
}

@media print {
  @page { margin: 0.55in; }
  body { color: #121412; background: white; font-size: 10pt; }
  body > :not(main), main > :not(.patch-result), .patch-result button, .more-plants { display: none !important; }
  .shell { width: 100%; }
  .patch-result { padding: 0; animation: none; }
  .result-header { margin-bottom: 0.65rem; }
  .result-header h2 { font-size: 27pt; }
  .result-header h2::before { content: "Bella Bees · "; }
  .bloom-results { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.45rem; }
  .season-card { break-inside: avoid; padding: 0.55rem; background: white; }
  .season-name { font-size: 17pt; }
  .plant-name { margin-top: 0.55rem; }
  .first-step { grid-template-columns: 6.5rem 1fr; }
  .print-habitat { display: block; margin-top: 0.45rem; font-size: 9pt; }
}
