:root {
  color-scheme: light;
  --ink: #17221f;
  --muted: #64736e;
  --paper: #f4f1e9;
  --card: #fffdf8;
  --green: #173f35;
  --green-light: #dfece6;
  --gold: #d5a638;
  --red: #a53c32;
  --border: #d9d5ca;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
.topbar { position: sticky; z-index: 10; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem clamp(1rem, 4vw, 2.5rem); color: white; background: var(--green); box-shadow: 0 3px 18px #173f3530; }
.topbar h1 { margin: 0; font-size: clamp(1.15rem, 4vw, 1.7rem); }
.eyebrow { margin: 0 0 .15rem; color: #c8ddd5; font-size: .76rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
main { width: min(980px, 100%); margin: 0 auto; padding: 1.2rem clamp(.8rem, 3vw, 2rem) 5rem; }
.hidden { display: none !important; }
.status-card, .summary, .roller-card { border: 1px solid var(--border); border-radius: 18px; background: var(--card); box-shadow: 0 9px 32px #27352f12; }
.status-card { padding: 1.1rem 1.25rem; }
.status-card.error { border-color: #d9aaa5; color: var(--red); }
.summary { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; margin: 1rem 0; padding: 1rem 1.25rem; }
.summary p { margin: 0; }
.roller-list { display: grid; gap: 1rem; }
.roller-card { overflow: hidden; }
.roller-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.2rem 1.25rem 1rem; background: linear-gradient(145deg, #fffdf8, #f6f3ea); }
.order-label { margin: 0 0 .25rem; color: var(--muted); font-size: .82rem; font-weight: 750; text-transform: uppercase; }
.roller-title { margin: 0; font-size: 1.35rem; }
.roller-meta { margin: .35rem 0 0; color: var(--muted); }
.requirement { flex: none; border-radius: 999px; padding: .35rem .65rem; color: var(--green); background: var(--green-light); font-size: .76rem; font-weight: 800; }
.requirement.complete { color: white; background: var(--green); }
.measurements { display: flex; flex-wrap: wrap; gap: .55rem; padding: 0 1.25rem 1rem; }
.measurement { border: 1px solid var(--border); border-radius: 9px; padding: .4rem .6rem; color: var(--muted); font-size: .83rem; }
.measurement strong { color: var(--ink); }
.existing-evidence { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .65rem; padding: 0 1.25rem 1rem; }
.evidence-item { overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: white; }
.evidence-item img, .evidence-item video { display: block; width: 100%; height: 130px; object-fit: cover; background: #202624; }
.evidence-caption { padding: .55rem .65rem; color: var(--muted); font-size: .76rem; }
.evidence-caption p { margin: .2rem 0 0; color: var(--ink); white-space: pre-wrap; }
.upload-form { border-top: 1px solid var(--border); padding: 1.1rem 1.25rem 1.3rem; }
.upload-form > label { display: block; font-size: .9rem; font-weight: 750; }
textarea { width: 100%; margin-top: .4rem; border: 1px solid #bfc7c3; border-radius: 10px; padding: .7rem; color: var(--ink); background: white; font: inherit; resize: vertical; }
textarea:focus { outline: 3px solid #c8ddd5; border-color: var(--green); }
.capture-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-top: .8rem; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; border: 0; border-radius: 10px; padding: .7rem .85rem; font: inherit; font-weight: 800; text-align: center; text-decoration: none; cursor: pointer; }
.button-primary { width: 100%; margin-top: .8rem; color: white; background: var(--green); }
.button-primary:disabled { cursor: not-allowed; opacity: .45; }
.button-camera { color: #261f0d; background: #f2cf70; }
.button-secondary { color: var(--green); background: var(--green-light); }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.preview { margin-top: .8rem; border-radius: 12px; padding: .75rem; background: #edf1ef; }
.preview img, .preview video { display: block; width: min(100%, 380px); max-height: 280px; margin: 0 auto .5rem; border-radius: 9px; object-fit: contain; background: #202624; }
.preview p { margin: 0; color: var(--muted); font-size: .82rem; text-align: center; }
.progress { height: 8px; overflow: hidden; margin-top: .8rem; border-radius: 99px; background: #d9dfdc; }
.progress span { display: block; width: 0; height: 100%; background: var(--gold); transition: width .15s linear; }
.form-message { min-height: 1.2em; margin: .65rem 0 0; color: var(--muted); font-size: .86rem; }
.form-message.error { color: var(--red); }

@media (max-width: 640px) {
  .topbar { align-items: flex-start; }
  .topbar .button { min-height: 38px; padding: .5rem .6rem; font-size: .8rem; }
  .capture-actions { grid-template-columns: 1fr 1fr; }
  .capture-actions .button-secondary { grid-column: 1 / -1; }
  .roller-heading { flex-direction: column; }
}
