:root {
  color-scheme: light;
  --paper: #f5f7f2;
  --surface: #fff;
  --ink: #14281c;
  --muted: #455a4c;
  --line: #d5dfd2;
  --forest: #10241b;
  --lime: #cdefa3;
  --accent: #346044;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}
*, *::before, *::after { box-sizing: border-box; }
body, figure, h1, h2, h3, h4, p { margin: 0; }
main, section, header, footer { display: block; }
section { scroll-margin-top: 1rem; }
img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .22em; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #b45e19; outline-offset: 4px; }
.wrap { width: min(100% - 3rem, 72rem); margin-inline: auto; }
.visually-hidden, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap;
}
.skip { position: fixed; z-index: 5; left: 1rem; top: 1rem; padding: .5rem 1rem; background: white; }
.top { background: var(--forest); color: #f5faf4; border-bottom: 1px solid #ffffff24; }
.nav-wrap, .brand, nav, .actions { display: flex; align-items: center; }
.nav-wrap { min-height: 4.5rem; gap: 1rem; justify-content: space-between; }
.brand { gap: .65rem; font-size: 1.19rem; font-weight: 720; text-decoration: none; letter-spacing: -.035em; width: fit-content; }
nav { flex-wrap: wrap; column-gap: clamp(.75rem, 4vw, 2.25rem); row-gap: .25rem; font-size: .92rem; }
nav a { color: #d9eadc; text-decoration: none; }
nav a:hover, footer a:hover { text-decoration: underline; }
.hero { background: var(--forest); color: #f3faef; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(1.8rem, 5vw, 5.5rem); align-items: center; padding-block: clamp(2.7rem, 7vw, 5.5rem); }
.eyebrow { color: var(--accent); text-transform: uppercase; font-weight: 750; font-size: .78rem; letter-spacing: .16em; }
.hero .eyebrow { color: var(--lime); }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; letter-spacing: -.057em; }
h1 { font-size: clamp(3.65rem, 6.3vw, 5.6rem); line-height: .93; margin-block: .6rem 1.4rem; }
h1 em { color: var(--lime); font-weight: 400; }
h2 { font-size: clamp(2.55rem, 5vw, 4.1rem); line-height: 1; margin-top: .34rem; }
h3 { font-size: 1.22rem; letter-spacing: -.025em; }
h4 { font-size: 1.65rem; line-height: 1.15; margin-block: .35rem .65rem; letter-spacing: -.03em; }
.lead { color: #d7e7dc; font-size: clamp(1rem, 2vw, 1.22rem); max-width: 29rem; }
.actions { flex-wrap: wrap; gap: .6rem; }
.hero .actions { margin-top: 1.55rem; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  min-height: 2.75rem; padding: .52rem .92rem; border: 1px solid transparent; border-radius: .55rem;
  font-size: .91rem; font-weight: 690; text-decoration: none; white-space: nowrap;
}
.button.primary { background: var(--lime); color: var(--ink); }
.button.primary:hover { background: #ddf8bd; }
.button.outline { border-color: #72907e; color: #f5faf4; }
.button.outline:hover { background: #ffffff16; }
.button.dark { background: #234e35; color: #fff; }
.button.dark:hover:enabled { background: #376b49; }
.button.secondary { border-color: #bccdbd; background: white; color: var(--ink); }
.button.secondary:hover:enabled, label.button:hover { background: #edf5e9; }
.specimen { position: relative; overflow: hidden; border: 1px solid #ffffff35; border-radius: 1rem; margin: 0; isolation: isolate; }
.specimen img { width: 100%; height: auto; aspect-ratio: 1.35; object-fit: cover; }
.specimen figcaption { position: absolute; inset: auto 0 0; display: flex; justify-content: space-between; gap: .5rem; color: #f5faf4; background: linear-gradient(transparent, #071710e8); padding: 1.4rem 1rem .75rem; font-size: .83rem; }
.specimen figcaption span { color: #c0d3c5; }
.specimen-corners { position: absolute; inset: .85rem; pointer-events: none; opacity: .68; }
.specimen-corners::before, .specimen-corners::after { content: ""; width: 1.2rem; height: 1.2rem; position: absolute; border-color: var(--lime); border-style: solid; }
.specimen-corners::before { top: 0; left: 0; border-width: 1px 0 0 1px; }
.specimen-corners::after { top: 0; right: 0; border-width: 1px 1px 0 0; }
.section { padding-block: clamp(2.75rem, 7vw, 5rem); }
.section-heading { display: flex; gap: 1rem; justify-content: space-between; align-items: end; margin-bottom: 1.65rem; }
.section-heading > p { color: var(--muted); max-width: 23rem; }
.panel-grid, .guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: stretch; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: .95rem; padding: clamp(1rem, 3vw, 1.5rem); background: var(--surface); }
.muted, .panel > p { color: var(--muted); }
.small { font-size: .89rem; }
.dropzone {
  margin-top: .9rem; min-height: 13.5rem; border: 1px dashed #86a48a; border-radius: .7rem;
  padding: 1.2rem .55rem; background: #f3f8ef; display: grid; justify-items: center;
  align-content: center; gap: .5rem; text-align: center;
}
.dropzone > span:not(.drop-symbol) { color: var(--muted); font-size: .88rem; }
.dropzone.is-dragged { background: #deefd6; border-color: var(--accent); }
.drop-symbol { color: var(--accent); font-size: 1.4rem; line-height: 1; }
label.button { cursor: pointer; }
.panel:has(#photo:focus-visible) label.button { outline: 3px solid #b45e19; outline-offset: 3px; }
.preview { margin-top: .9rem; border-radius: .7rem; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; background: #f3f8ef; padding: .8rem; min-height: 13.5rem; }
.preview img { width: 11rem; height: 11rem; object-fit: contain; background: #e5eee2; border-radius: .35rem; }
.preview > div { min-width: 0; flex: 1 1 8rem; }
.preview strong { display: block; overflow-wrap: anywhere; margin-bottom: .65rem; }
.scan-actions, .result-actions { margin-top: .9rem; }
.status { margin-top: .35rem; min-height: 1.55rem; font-size: .92rem; }
.status[data-error] { color: #8c3527; }
.examples { border-top: 1px solid var(--line); margin-top: .55rem; padding-top: .75rem; }
.examples > p { margin-bottom: .45rem; color: var(--muted); font-size: .88rem; }
.sample-list { display: flex; flex-wrap: wrap; gap: .45rem; }
.sample-list button { display: flex; align-items: center; gap: .45rem; min-height: 2.6rem; padding: .23rem .55rem .23rem .24rem; border: 1px solid var(--line); background: white; border-radius: .55rem; font-size: .87rem; color: var(--ink); }
.sample-list button:hover { background: #edf5e9; }
.sample-list img { width: 2.25rem; height: 2.25rem; object-fit: cover; border-radius: .32rem; }
.result-panel { display: flex; flex-direction: column; }
.result-empty { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; padding: 2rem .5rem; text-align: center; color: var(--muted); }
.result-empty strong { color: var(--ink); }
.result-empty p { max-width: 18rem; }
#result-content { margin-top: 1rem; }
#result-content > p:last-child { margin-top: .8rem; }
.score-list { padding: 0; margin: .75rem 0; list-style: none; display: grid; gap: .55rem; }
.score-info { display: flex; justify-content: space-between; gap: .75rem; font-size: .9rem; }
.score-info span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.score-bar { width: 100%; height: .36rem; margin-top: .23rem; display: block; border: 0; border-radius: 1rem; overflow: hidden; appearance: none; background: #e7eee2; }
.score-bar::-webkit-progress-bar { background: #e7eee2; }
.score-bar::-webkit-progress-value { background: #4d875f; }
.score-bar::-moz-progress-bar { background: #4d875f; }
summary { cursor: pointer; color: #254e35; font-weight: 680; padding-block: .35rem; }
.research { background: #eaf1e7; border-block: 1px solid #dce7da; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1rem; }
.metrics > div { display: flex; flex-direction: column; gap: .2rem; background: #dcead8; border: 1px solid #cddfcc; border-radius: .8rem; padding: clamp(.8rem, 3vw, 1.35rem); }
.metrics strong { font: 400 clamp(2rem, 4.5vw, 3.4rem)/1 Georgia, serif; letter-spacing: -.06em; }
.metrics span { font-size: .92rem; font-weight: 650; }
.research-grid p { margin-top: .65rem; }
.table-wrap { margin-top: .9rem; overflow: auto; }
table { border-collapse: collapse; width: 100%; font-size: .87rem; text-align: left; }
caption { text-align: left; color: var(--muted); padding-bottom: .4rem; }
th, td { padding: .48rem .4rem; border-bottom: 1px solid var(--line); }
td { font-variant-numeric: tabular-nums; }
.reference-links { display: flex; flex-direction: column; align-items: start; gap: .4rem; margin-top: 1rem; color: #245436; font-size: .94rem; }
.class-details { margin-top: .8rem; }
.class-details ul { columns: 3; column-gap: 2rem; padding-left: 1.2rem; }
.class-details li { break-inside: avoid; margin-bottom: .28rem; }
.guide-grid { grid-template-columns: .8fr 1.2fr; }
.questions { display: grid; gap: .5rem; margin-block: .85rem; }
.questions button { text-align: left; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: .5rem; background: #f3f8ef; color: var(--ink); }
.questions button:hover { background: #e2efde; }
.messages { min-height: 8rem; max-height: 18rem; overflow-y: auto; display: flex; flex-direction: column; gap: .6rem; padding: .65rem 0; }
.message { padding: .6rem .75rem; border-radius: .7rem; overflow-wrap: anywhere; width: fit-content; max-width: 93%; }
.guide-message { background: #edf5e9; }
.user-message { background: #234e35; color: white; align-self: flex-end; }
#chat-form { display: flex; gap: .5rem; }
#question { min-width: 0; width: 100%; border: 1px solid #bacbbb; border-radius: .55rem; padding: .55rem .65rem; }
.text-button { background: none; padding: .35rem 0; border: 0; color: var(--accent); text-decoration: underline; font-size: .88rem; }
footer { background: var(--forest); color: #e0eee2; padding-block: 2rem; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 1.2rem 3rem; justify-content: space-between; }
.footer-grid p { max-width: 28rem; margin-top: .5rem; }
.footer-grid > div:last-child { display: flex; flex-direction: column; gap: .2rem; }
.credit-list { padding-left: 1.3rem; }
.credit-list li { margin-block: .55rem; }
.credits p { margin-block: .75rem; max-width: 56ch; }
.credits h2 { margin-top: 1.75rem; font-size: 2.15rem; }
@media (max-width: 760px) {
  .wrap { width: calc(100% - 2rem); }
  .hero-grid, .panel-grid, .guide-grid { grid-template-columns: 1fr; }
  .hero-grid { gap: 1.6rem; }
  .hero-copy h1 br { display: none; }
  .specimen img { aspect-ratio: 1.65; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: .55rem; }
  .class-details ul { columns: 2; }
}
@media (max-width: 400px) {
  .nav-wrap { flex-wrap: wrap; padding-block: .65rem; gap: .55rem; }
  .metrics { gap: .45rem; }
  .metrics span { font-size: .81rem; }
  .metrics strong { font-size: 1.78rem; }
  .class-details ul { columns: 1; }
}
@media (max-width: 350px) {
  .metrics { grid-template-columns: 1fr; }
  h1 { font-size: 3.2rem; }
}
