:root {
  font-family: system-ui, "Segoe UI", sans-serif;
  color: #182821;
  background: #f6f7f3;
  --ink: #182821;
  --muted: #495c53;
  --green: #155338;
  --green-deep: #103e2c;
  --green-light: #e7f1e8;
  --edge: #ced9d0;
  --surface: #ffffff;
  --warm: #ffefd2;
  --warn: #7c4512;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
button, input, select, textarea { font: inherit; }
button, a, label[for] { -webkit-tap-highlight-color: transparent; }
button, summary, label[for] { cursor: pointer; }
button[disabled] { cursor: default; opacity: .52; }
a { color: var(--green); }
:focus-visible { outline: 3px solid #9a561a; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.95rem, 5vw, 3.2rem); line-height: 1.04; letter-spacing: -.045em; }
h2 { font-size: clamp(1.28rem, 3vw, 1.65rem); line-height: 1.18; letter-spacing: -.02em; }
h3 { font-size: 1.05rem; }
p, li { line-height: 1.48; }
[hidden] { display: none !important; }
.shell { width: min(100% - 2rem, 62rem); margin: 0 auto; }
.top { background: #fff; border-bottom: 1px solid var(--edge); }
.top-inner { min-height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; border: 0; background: transparent; padding: 0; gap: .36rem; min-height: 50px; }
.brand img { width: 124px; height: auto; }
.brand span { font-size: .875rem; font-weight: 800; border-radius: 6px; padding: .22rem .4rem; background: var(--green-light); color: var(--green-deep); }
main { padding: 1.75rem 0; }
.stack { display: grid; gap: 1rem; }
.stack-sm { display: grid; gap: .6rem; }
.row { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; }
.row-between { justify-content: space-between; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.secondary-text { font-size: .9rem; color: var(--muted); }
.panel { border: 1px solid var(--edge); padding: clamp(.9rem, 3vw, 1.45rem); border-radius: 16px; background: var(--surface); min-width: 0; }
.intro { background: var(--green-deep); color: #fff; border-color: var(--green-deep); padding: clamp(1.2rem, 4vw, 2.6rem); display: grid; gap: 1rem; }
.intro p { color: #e1efe5; max-width: 42ch; }
.intro .main-button { background: #f0f6ed; color: var(--green-deep); border-color: #f0f6ed; }
.intro .secondary { border-color: #99c6a8; color: white; background: transparent; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 48px; gap: .4rem; padding: .65rem 1rem; border: 1px solid var(--edge); border-radius: 10px; color: var(--green-deep); background: #fff; font-weight: 680; text-align: center; text-decoration: none; }
.button:hover { border-color: var(--green); background: var(--green-light); }
.main-button, .main-button:hover { background: var(--green); border-color: var(--green); color: #fff; }
.utility { min-height: 44px; padding-inline: .75rem; }
.danger { color: #872b23; }
.link-button { border: 0; padding: .5rem 0; color: var(--green-deep); text-decoration: underline; text-underline-offset: 3px; background: none; min-height: 44px; display: inline-flex; align-items: center; font-size: .9rem; font-weight: 650; }
.field { display: grid; gap: .35rem; font-weight: 670; min-width: 0; }
input:not([type=radio],[type=checkbox],[type=file]), select, textarea {
  width: 100%; min-height: 48px; border: 1px solid #a6b6ac; border-radius: 8px; padding: .58rem .7rem;
  color: var(--ink); background: #fff; scroll-margin: 8rem 0; font-size: 1rem;
}
textarea { min-height: 80px; resize: vertical; }
input[type=checkbox], input[type=radio] { accent-color: var(--green); width: 22px; height: 22px; flex: 0 0 auto; margin: 0; }
fieldset { padding: .7rem; margin: 0; border: 1px solid var(--edge); border-radius: 10px; min-width: 0; }
legend { padding: 0 .35rem; font-weight: 730; }
.choice { display: flex; align-items: center; gap: .65rem; min-height: 48px; cursor: pointer; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: .75rem; }
.shapes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.shape { border: 1px solid var(--edge); border-radius: 12px; background: #fff; color: var(--ink); display: grid; justify-items: start; align-content: start; gap: .35rem; padding: .7rem; min-width: 0; text-align: left; }
.shape:hover, .shape[aria-pressed=true] { border-color: var(--green); background: var(--green-light); }
.shape[aria-pressed=true] { box-shadow: inset 0 0 0 2px var(--green); }
.shape svg { width: min(100%, 110px); height: 54px; }
.shape span { font-weight: 750; overflow-wrap: anywhere; }
.shape small { color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.wizard { max-width: 45rem; margin-inline: auto; }
.steps { display: flex; gap: .4rem; padding: 0; margin: 0; list-style: none; }
.steps li { width: 25%; overflow: hidden; border-radius: 4px; height: 6px; background: #d9e2da; }
.steps li.done { background: var(--green); }
.context { font-size: .95rem; color: var(--muted); font-weight: 650; }
.drawing { margin: 0; min-width: 0; min-height: 100px; background: #eff5ef; border-radius: 12px; text-align: center; padding: .6rem; }
.drawing svg { color: var(--green-deep); width: min(100%, 360px); height: auto; max-height: 190px; vertical-align: middle; }
.drawing figcaption { padding-block: .3rem; }
.photo-review { width: 100%; height: auto; max-height: 275px; object-fit: contain; background: #e9eee9; border-radius: 9px; }
.qty-result { background: var(--green-light); border-radius: 10px; padding: .8rem; }
.notice { padding: .7rem .85rem; border-radius: 8px; background: var(--warm); color: var(--warn); }
.review-item { display: grid; grid-template-columns: minmax(94px, 160px) minmax(0, 1fr); gap: .85rem; }
.review-item > .drawing { align-self: start; }
.summary-list { display: grid; gap: .35rem; margin: 0; padding-left: 1.1rem; }
.status-tag { display: inline-block; padding: .2rem .6rem; border-radius: 20px; background: var(--green-light); color: var(--green-deep); font-size: .9rem; font-weight: 680; }
.actions { position: sticky; bottom: 0; padding: .65rem 0 max(.65rem, env(safe-area-inset-bottom)); background: #f6f7f3; z-index: 1; }
.footer { padding: .65rem 0 1.5rem; color: var(--muted); border-top: 1px solid var(--edge); font-size: .9rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: .2rem 1.1rem; }
.toast { position: fixed; z-index: 2; right: 1rem; bottom: 1rem; max-width: min(90vw, 430px); color: #fff; background: var(--green-deep); border-radius: 8px; padding: .7rem 1rem; }
.toast button { margin-left: .5rem; color: white; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.advanced-link { margin-top: .4rem; }
@media (max-width: 620px) {
  .top-inner { min-height: 66px; }
  main { padding-block: 1rem; }
  .shapes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row.mobile-stack > .button { flex: 1 1 100%; }
  .review-item { grid-template-columns: minmax(0, 1fr); }
  .review-item > .drawing { width: min(100%, 220px); }
}
