:root {
  color-scheme: light;
  --ink: #24362c;
  --muted: #5e6e62;
  --paper: #f8f5ed;
  --surface: #fffdf8;
  --surface-green: #edf3e9;
  --line: #d8dfd2;
  --green: #245c3a;
  --green-dark: #163d28;
  --green-soft: #d7e7d4;
  --terracotta: #b86946;
  --terracotta-dark: #88462d;
  --warning: #a7432f;
  --shadow: 0 18px 45px rgb(36 54 44 / 10%);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgb(215 231 212 / 75%), transparent 28rem),
    var(--paper);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
input,
select,
textarea,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--green-dark);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #e49a5d;
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  z-index: 10;
  top: 0.6rem;
  left: 0.75rem;
  padding: 0.6rem 0.9rem;
  color: white;
  background: var(--green-dark);
  border-radius: 0.4rem;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  padding: clamp(1rem, 3vw, 2rem) clamp(1rem, 5vw, 5rem) 0;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1250px;
  margin: 0 auto;
  color: var(--green-dark);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.brand-mark {
  display: grid;
  width: 2.15rem;
  height: 2.15rem;
  color: var(--surface);
  background: var(--green);
  border-radius: 50% 50% 42% 58%;
  place-items: center;
  transform: rotate(-8deg);
}

.brand-mark::before {
  width: 0.7rem;
  height: 1.1rem;
  content: "";
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 0 100% 0 100%;
  transform: rotate(35deg);
}

.eyebrow {
  margin: 0;
  color: var(--terracotta-dark);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.header-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
  gap: clamp(1.25rem, 5vw, 4.5rem);
  align-items: center;
  max-width: 1250px;
  min-height: 320px;
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2rem, 5vw, 4rem);
}

.hero-copy {
  max-width: 650px;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  line-height: 1.22;
}

h1 {
  max-width: 12ch;
  margin: 0.65rem 0 1.1rem;
  color: var(--green-dark);
  font-size: clamp(2.35rem, 6vw, 4.9rem);
  letter-spacing: -0.055em;
}

.hero-lead {
  max-width: 38rem;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.hero-art {
  position: relative;
  min-height: 245px;
  overflow: hidden;
  background-image:
    linear-gradient(135deg, rgb(22 61 40 / 12%), rgb(184 105 70 / 20%)),
    url("../assets/garden-planning-hero.jpg");
  background-position: center;
  background-size: cover;
  border: 0.8rem solid #d6b08a;
  border-radius: 48% 52% 50% 45% / 42% 45% 55% 58%;
  box-shadow: 0.7rem 0.8rem 0 var(--green-soft), var(--shadow);
  transform: rotate(1.5deg);
}

.hero-art::after {
  position: absolute;
  right: 1rem;
  bottom: 0.8rem;
  width: 5rem;
  height: 3.5rem;
  content: "";
  background: rgb(255 253 248 / 80%);
  border: 2px solid rgb(36 54 44 / 20%);
  border-radius: 50% 50% 45% 55%;
  transform: rotate(-8deg);
}

.page-shell {
  max-width: 1250px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 5vw, 5rem) 4rem;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: start;
}

.panel {
  min-width: 0;
  background: rgb(255 253 248 / 92%);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  box-shadow: var(--shadow);
}

.input-panel {
  position: sticky;
  top: 1rem;
  padding: clamp(1.15rem, 3vw, 1.8rem);
}

.result-panel {
  padding: clamp(1.15rem, 3vw, 2rem);
}

.panel-heading {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.panel-heading h2,
.panel-heading h3 {
  margin: 0;
  color: var(--green-dark);
}

.panel-heading p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.required-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

fieldset {
  min-width: 0;
  margin: 0 0 1.1rem;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 0.4rem;
  color: var(--green-dark);
  font-weight: 800;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.field {
  min-width: 0;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
}

.label-hint {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
}

input,
select,
textarea {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0.64rem 0.7rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #aebcae;
  border-radius: 0.55rem;
}

input,
select {
  min-height: 2.85rem;
}

textarea {
  min-height: 6rem;
  resize: vertical;
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--warning);
  box-shadow: 0 0 0 2px rgb(167 67 47 / 13%);
}

.unit-input {
  position: relative;
}

.unit-input input {
  padding-right: 3rem;
}

.unit {
  position: absolute;
  top: 50%;
  right: 0.7rem;
  color: var(--muted);
  font-size: 0.85rem;
  pointer-events: none;
  transform: translateY(-50%);
}

.field-error {
  min-height: 1.35rem;
  margin: 0.22rem 0 0;
  color: var(--warning);
  font-size: 0.8rem;
  line-height: 1.4;
}

.input-hint {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-top: 0.5rem;
}

button {
  min-height: 2.85rem;
  padding: 0.65rem 0.85rem;
  color: var(--green-dark);
  font-weight: 800;
  cursor: pointer;
  background: transparent;
  border: 1px solid #99ad9b;
  border-radius: 0.6rem;
}

button:hover:not(:disabled) {
  background: var(--surface-green);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.button-primary {
  color: #fffdf8;
  background: var(--green);
  border-color: var(--green);
}

.button-primary:hover:not(:disabled) {
  background: var(--green-dark);
}

.button-secondary {
  color: var(--terracotta-dark);
  border-color: #c99173;
}

.error-summary {
  margin: 0 0 1rem;
  padding: 0.8rem 1rem;
  color: #6e281d;
  background: #fff0eb;
  border: 1px solid #e6ad9b;
  border-radius: 0.65rem;
}

.error-summary strong {
  display: block;
  margin-bottom: 0.3rem;
}

.error-summary ul {
  margin: 0;
  padding-left: 1.2rem;
}

.status-message {
  min-height: 1.5rem;
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.empty-result {
  display: grid;
  min-height: 28rem;
  padding: 2rem;
  color: var(--muted);
  text-align: center;
  border: 1px dashed #aebcae;
  border-radius: 1rem;
  place-items: center;
}

.empty-result strong {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--green-dark);
  font-size: 1.2rem;
}

.result-content {
  min-width: 0;
}

.result-title-row {
  display: flex;
  gap: 0.8rem;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.result-title-row h3 {
  margin: 0;
  color: var(--green-dark);
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.result-badge {
  padding: 0.25rem 0.6rem;
  color: var(--terracotta-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: #f6e4d7;
  border-radius: 999px;
}

.result-input-summary {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 1.2rem;
}

.metric {
  min-width: 0;
  padding: 0.8rem;
  background: var(--surface-green);
  border: 1px solid var(--green-soft);
  border-radius: 0.8rem;
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.metric-value {
  display: block;
  margin-top: 0.25rem;
  color: var(--green-dark);
  font-size: clamp(1.15rem, 3vw, 1.6rem);
  font-weight: 800;
  line-height: 1.2;
}

.svg-frame {
  display: grid;
  min-height: 19rem;
  margin: 0 0 1.1rem;
  padding: clamp(0.8rem, 3vw, 1.5rem);
  background:
    linear-gradient(145deg, rgb(215 231 212 / 58%), transparent 60%),
    #f6f2e8;
  border: 1px solid var(--line);
  border-radius: 1rem;
  place-items: center;
}

.svg-frame svg {
  display: block;
  width: min(100%, 600px);
  max-height: 32rem;
  height: auto;
}

.container-shape {
  fill: #d7b68e;
  stroke: var(--terracotta-dark);
  stroke-width: 1.2;
}

.safe-area {
  fill: rgb(237 243 233 / 88%);
  stroke: #6d9874;
  stroke-width: 0.65;
  stroke-dasharray: 3 2;
}

.plant-point {
  fill: var(--green);
  stroke: #f7f3e9;
  stroke-width: 0.8;
}

.placement-description,
.result-note {
  margin: 0.6rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.result-note {
  padding: 0.75rem 0.9rem;
  color: var(--ink);
  background: #fbf7ef;
  border-left: 4px solid var(--terracotta);
}

.result-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.result-actions button {
  flex: 1 1 12rem;
}

.supporting-sections {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.info-section {
  min-width: 0;
  padding: 1.2rem;
  background: rgb(255 253 248 / 75%);
  border: 1px solid var(--line);
  border-radius: 1rem;
}

.info-section h2 {
  margin: 0 0 0.5rem;
  color: var(--green-dark);
  font-size: 1.05rem;
}

.info-section p,
.info-section ul {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.info-section ul {
  padding-left: 1.1rem;
}

.site-footer {
  max-width: 1250px;
  margin: 0 auto;
  padding: 1rem clamp(1rem, 5vw, 5rem) 2.5rem;
  color: var(--muted);
  font-size: 0.8rem;
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-art {
    min-height: 200px;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }

  .input-panel {
    position: static;
  }

  .supporting-sections {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .site-header {
    padding-top: 0.85rem;
  }

  .header-note {
    display: none;
  }

  .hero {
    gap: 1.25rem;
    padding-top: 2.5rem;
  }

  h1 {
    max-width: 11ch;
    font-size: clamp(2.25rem, 13vw, 3.6rem);
  }

  .hero-art {
    min-height: 150px;
    border-width: 0.55rem;
  }

  .page-shell {
    padding-bottom: 2rem;
  }

  .field-grid,
  .metric-grid,
  .supporting-sections {
    grid-template-columns: 1fr;
  }

  .field.full {
    grid-column: auto;
  }

  .actions {
    grid-template-columns: 1fr;
  }

  .empty-result {
    min-height: 20rem;
    padding: 1.25rem;
  }

  .svg-frame {
    min-height: 14rem;
  }
}

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

@media print {
  @page {
    margin: 1.2cm;
  }

  html,
  body {
    background: #fff;
  }

  .site-header,
  .input-panel,
  .site-footer,
  .no-print,
  .empty-result,
  .status-message {
    display: none !important;
  }

  .page-shell {
    max-width: none;
    padding: 0;
  }

  .tool-grid {
    display: block;
  }

  .result-panel {
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .result-content {
    display: block !important;
  }

  .svg-frame {
    min-height: 12cm;
    break-inside: avoid;
  }

  .supporting-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    break-inside: avoid;
  }
}



/* SOU100 Stage A: first-view hierarchy */
.stage-a-hero { min-width: 0; min-height: 0 !important; height: auto; grid-template-columns: minmax(0, 1.15fr) minmax(200px, .85fr); align-items: center; gap: clamp(1rem, 2.5vw, 2.5rem); padding-block: clamp(1.25rem, 3vw, 2.5rem) !important; }
.stage-a-hero .hero-copy, .stage-a-hero .intro-copy { min-width: 0; min-height: 0 !important; padding: clamp(1rem, 2.7vw, 2.25rem) !important; }
.stage-a-hero h1 { max-width: none !important; margin: 0 0 .75rem !important; font-size: clamp(2rem, 4vw, 3.35rem) !important; line-height: 1.14 !important; letter-spacing: -.035em; word-break: auto-phrase; }
.stage-a-lede { max-width: 52rem; margin: .25rem 0 0 !important; color: inherit; font-size: clamp(1rem, 1.25vw, 1.15rem) !important; line-height: 1.55 !important; }
.stage-a-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem 1rem; margin: .8rem 0 0; padding-left: 1.35rem; font-size: .92rem; line-height: 1.45; }
.stage-a-steps li { min-width: 0; padding-left: .12rem; }
.stage-a-extras { margin-top: .7rem; font-size: .8rem; }
.stage-a-extras > * { margin-top: .35rem !important; margin-bottom: 0 !important; }
.stage-a-cta { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; margin-top: .9rem; padding: .7rem 1.1rem; border: 2px solid #fff; border-radius: 999px; background: #17412f; color: #fff !important; font-weight: 800; line-height: 1.25; text-align: center; text-decoration: none; }
.stage-a-cta:hover { background: #0f3324; color: #fff !important; }
.stage-a-cta:focus-visible { outline: 3px solid #005fcc; outline-offset: 3px; box-shadow: 0 0 0 6px #fff; }
.stage-a-hero :is(.hero-visual, .hero-art, .hero-image) { width: 100%; min-width: 0; min-height: 0 !important; height: min(24vw, 280px); max-height: 280px; margin: 0; align-self: center; }
.stage-a-hero :is(.hero-visual, .hero-art, .hero-image) img { display: block; width: 100%; height: 100%; max-height: 280px; object-fit: cover; }

@media (max-width: 640px) {
  .stage-a-hero { display: block; min-height: 0 !important; height: auto !important; padding: 0 !important; }
  .stage-a-hero .hero-copy, .stage-a-hero .intro-copy { min-height: 0 !important; padding: 1.1rem 1rem 1.2rem !important; }
  .stage-a-hero h1 { margin-bottom: .55rem !important; font-size: clamp(1.8rem, 8vw, 2.35rem) !important; line-height: 1.18 !important; }
  .stage-a-lede { font-size: .94rem !important; line-height: 1.5 !important; }
  .stage-a-steps { grid-template-columns: 1fr; gap: .12rem; margin-top: .55rem; font-size: .87rem; }
  .stage-a-extras { margin-top: .55rem; font-size: .74rem; }
  .stage-a-cta { min-height: 46px; margin-top: .7rem; padding: .62rem 1rem; }
  .stage-a-hero :is(.hero-visual, .hero-art, .hero-image) { display: none !important; }
  .input-panel .panel-heading { gap: .45rem !important; margin-bottom: .8rem !important; }
  .input-panel .panel-heading .eyebrow { display: none !important; }
  .input-panel .panel-heading h2 { margin: 0 !important; font-size: clamp(1.2rem, 5.5vw, 1.55rem) !important; line-height: 1.25 !important; letter-spacing: 0 !important; }
  .input-panel .panel-heading p { margin: .35rem 0 0 !important; font-size: .86rem !important; line-height: 1.45 !important; }
}
