:root {
  --ink: #172320;
  --muted: #66736e;
  --line: #dfe6df;
  --paper: #f7f6f1;
  --white: #ffffff;
  --moss: #225940;
  --moss-dark: #174330;
  --mint: #dff1e4;
  --clay: #c86c45;
  --gold: #f2c768;
  --blue: #176891;
  --shadow: 0 16px 36px rgba(28, 55, 44, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 100% 0%, #edf5e9 0, transparent 30rem), var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, input, a { font: inherit; }
a { color: var(--moss-dark); text-underline-offset: 3px; }
main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 36px 0 64px; }
.hero { max-width: 820px; }
.eyebrow { margin: 0 0 8px; color: var(--moss); font-size: .77rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 16px; max-width: 780px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.25rem, 9vw, 4.4rem); letter-spacing: -.055em; line-height: .99; }
h2 { margin-bottom: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.8rem, 5vw, 2.55rem); letter-spacing: -.035em; line-height: 1.05; }
h3 { margin-bottom: 4px; font-size: 1.32rem; line-height: 1.2; }
.intro { max-width: 700px; color: #3f4d47; font-size: 1.08rem; }
.search-panel { margin: 28px 0 19px; padding: 18px; border: 1px solid #cddbd0; background: rgba(255, 255, 255, .82); border-radius: 18px; box-shadow: 0 10px 24px rgba(28, 55, 44, .07); }
.search-panel label { display: block; margin-bottom: 9px; color: var(--moss-dark); font-size: 1.08rem; font-weight: 850; }
.search-row { display: grid; grid-template-columns: 1fr; gap: 10px; }
.search-row input { width: 100%; min-height: 50px; padding: 12px 14px; color: var(--ink); border: 1px solid #afc3b5; background: var(--white); border-radius: 10px; outline: none; }
.search-row input::placeholder { color: #829087; }
.search-row input:focus { border-color: var(--moss); box-shadow: 0 0 0 3px rgba(34, 89, 64, .13); }
.search-hint { margin: 10px 1px 0; color: var(--muted); font-size: .86rem; }
.material-chip { display: inline-flex; gap: 9px; align-items: center; margin-top: 4px; padding: 9px 13px; color: var(--moss-dark); background: var(--mint); border-radius: 999px; font-weight: 750; font-size: .92rem; }
.ranking-section, .viewer-section, .model-section { margin-top: 52px; }
.ranking-section { padding: 23px; border: 1px solid var(--line); background: rgba(255,255,255,.65); border-radius: 20px; }
.criteria-list { display: grid; gap: 10px; padding: 0; margin: 22px 0 13px; list-style: none; }
.criteria-list li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; }
.criteria-list span { display: grid; place-items: center; width: 28px; height: 28px; color: var(--white); background: var(--moss); border-radius: 50%; font-size: .8rem; font-weight: 850; }
.criteria-list p { margin: 1px 0 0; color: #3f4d47; font-size: .94rem; }
.criteria-note { margin: 0; padding: 12px; border-left: 3px solid var(--gold); color: #52625a; background: #f4f1e6; font-size: .88rem; }
.section-heading { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.section-heading.compact { margin-bottom: 12px; }
.viewer-help, .selection-counter { margin: 0; color: var(--muted); font-size: .9rem; }
.viewer-shell { position: relative; overflow: hidden; height: min(68vw, 610px); min-height: 345px; border: 1px solid #d6ded7; border-radius: 22px; background: #e7ebe6; box-shadow: var(--shadow); }
.viewer-shell iframe { width: 100%; height: 100%; border: 0; display: block; }
.viewer-label { position: absolute; left: 14px; bottom: 14px; padding: 8px 12px; color: var(--white); background: rgba(23, 35, 32, .83); border-radius: 999px; font-weight: 750; font-size: .86rem; pointer-events: none; }
.embed-note { margin: 12px 4px 0; color: var(--muted); font-size: .88rem; }
.search-status { margin: 0 0 17px; padding: 11px 13px; border-radius: 11px; font-size: .9rem; font-weight: 650; }
.search-status.loading { color: #315a6c; background: #e3f1f5; }
.search-status.live { color: #154f36; background: #ddf1e4; }
.search-status.fallback { color: #75432f; background: #f7e7dc; }
.model-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.model-card { display: flex; flex-direction: column; padding: 21px; border: 1px solid var(--line); background: rgba(255,255,255,.82); border-radius: 20px; box-shadow: 0 7px 16px rgba(28, 55, 44, .035); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.model-card.selected { border: 2px solid var(--moss); padding: 20px; box-shadow: 0 15px 31px rgba(34, 89, 64, .14); }
.card-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; color: var(--muted); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.status-dot { display: inline-flex; gap: 5px; align-items: center; color: var(--moss); letter-spacing: normal; text-transform: none; }
.status-dot::before { width: 7px; height: 7px; border-radius: 50%; content: ""; background: var(--moss); }
.author { margin-bottom: 13px; color: var(--muted); font-size: .95rem; }
.metadata { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 18px; color: var(--muted); font-size: .87rem; }
.rating { margin-bottom: 16px; padding: 14px; background: #f4f7f2; border-radius: 13px; }
.rating p { margin-bottom: 7px; color: var(--moss-dark); font-size: .86rem; }
.rating ul { padding: 0; margin: 0; list-style: none; }
.rating li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-top: 1px solid #dfe7df; font-size: .84rem; }
.rating li:first-child { border-top: 0; }
.rating li span { flex: 0 0 38%; color: var(--muted); }
.rating li b { color: var(--ink); text-align: right; }
.geometry-state { margin-bottom: 18px; color: #5c655f; font-size: .84rem; }
.geometry-state span { color: var(--clay); font-weight: 900; }
.card-actions { display: grid; grid-template-columns: 1fr; gap: 9px; margin-top: auto; }
.primary-button, .secondary-button { min-height: 47px; padding: 10px 14px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; font-weight: 800; transition: background .18s ease, transform .18s ease, border-color .18s ease; }
.primary-button { color: var(--white); background: var(--moss); }
.primary-button:hover, .primary-button:focus-visible { background: var(--moss-dark); }
.secondary-button { color: var(--moss-dark); background: transparent; border-color: #bfcfc5; }
.secondary-button:hover, .secondary-button:focus-visible { background: #edf3ed; border-color: var(--moss); }
button:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.next-step { display: grid; gap: 25px; align-items: center; margin-top: 58px; padding: 25px; background: #1b4433; color: var(--white); border-radius: 23px; overflow: hidden; }
.next-step .eyebrow { color: #b9e7c4; }
.next-step h2 { max-width: 550px; }
.layer-illustration { display: grid; place-items: center; min-height: 250px; position: relative; color: #d9f1dc; }
.moai-shape { position: relative; width: 155px; height: 222px; display: flex; flex-direction: column; justify-content: center; gap: 5px; padding-top: 20px; }
.moai-shape i { display: block; height: 23px; background: linear-gradient(90deg, #7cc191, #c0e5c4); border-radius: 31% 36% 14% 15%; transform: skewY(-4deg); box-shadow: inset 0 -3px 0 rgba(20, 67, 48, .24); }
.moai-shape i:nth-child(1) { width: 48%; margin-left: 22%; border-radius: 50% 50% 20% 20%; }
.moai-shape i:nth-child(2) { width: 66%; margin-left: 14%; }
.moai-shape i:nth-child(3) { width: 78%; margin-left: 9%; }
.moai-shape i:nth-child(4) { width: 87%; margin-left: 5%; }
.moai-shape i:nth-child(5) { width: 96%; margin-left: 1%; }
.moai-shape i:nth-child(6), .moai-shape i:nth-child(7) { width: 100%; margin-left: 0; }
.moai-shape span { position: absolute; top: 18px; bottom: 0; left: 50%; width: 3px; border-radius: 999px; background: var(--gold); box-shadow: 0 0 0 3px rgba(242,199,104,.15); }
.axis-label, .layer-label { position: absolute; padding: 5px 8px; background: rgba(255,255,255,.12); border-radius: 6px; font-size: .74rem; font-weight: 750; }
.axis-label { left: 52%; top: 30px; }
.layer-label { right: 5%; bottom: 30px; }
.selection-summary { margin: 19px 0 16px; padding: 15px; color: #e9f6ea; background: rgba(255,255,255,.11); border-radius: 13px; }
.selection-summary p:last-child { margin-bottom: 0; }
.selection-summary.empty { color: #d3e5d6; }
.summary-label { margin-bottom: 4px; color: var(--gold); font-size: 1.05rem; font-weight: 850; }
.summary-meta { margin: 0; color: #dceee0; font-size: .92rem; }
.notice { padding: 13px; border-left: 3px solid var(--gold); color: #e4f0e6; background: rgba(0, 0, 0, .14); font-size: .89rem; }
footer { padding: 23px 16px 32px; color: var(--muted); text-align: center; font-size: .8rem; }
footer p { margin: 0; }

@media (min-width: 650px) {
  .search-row { grid-template-columns: 1fr auto; }
  .search-button { min-width: 124px; }
  .criteria-list { grid-template-columns: 1fr 1fr; column-gap: 27px; }
}

@media (min-width: 700px) {
  main { width: min(1180px, calc(100% - 56px)); padding-top: 56px; }
  .section-heading { flex-direction: row; align-items: end; justify-content: space-between; }
  .viewer-help, .selection-counter { padding-bottom: 4px; }
  .model-grid { grid-template-columns: repeat(3, 1fr); }
  .next-step { grid-template-columns: minmax(255px, .75fr) 1.3fr; padding: 36px; }
}

@media (min-width: 1000px) {
  .viewer-shell { height: 610px; }
}
