:root {
  --bg: #f1efea;
  --raised: #ffffff;
  --stage: #e2dfd8;
  --line: #d6d2c9;
  --text: #1d1c1a;
  --muted: #5d5a54;
  --faint: #8b877f;
  --drop: #a6473d;
  --good: #6f6d66;
  --great: #2f5f8f;
  --amazing: #9a6f12;
  --on-label: #ffffff;
  --ui: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --radius: 10px;
  --sheet-h: 250px;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: var(--ui); font-size: 16px; line-height: 1.5; -webkit-tap-highlight-color: transparent; }
button, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--great); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.top {
  position: sticky; top: 0; z-index: 20; background: var(--bg);
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 12px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--display); font-size: 23px; line-height: 1; }
.sub { color: var(--muted); font-size: 14px; }
.pillbtn {
  margin-left: auto; background: var(--raised); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; font-size: 14px; white-space: nowrap;
}
.pillbtn b { font-weight: 600; font-variant-numeric: tabular-nums; }

main { max-width: 1180px; margin: 0 auto; padding: 18px 16px calc(var(--sheet-h) + 32px); }
main.plain { padding-bottom: 48px; }

.intro { max-width: 620px; margin: 6vh auto 0; display: grid; gap: 16px; }
.intro h1, .done h1 { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 8vw, 48px); line-height: 1.05; margin: 0; }
.intro p, .done p { margin: 0; color: var(--muted); font-size: 17px; }
.intro ol { margin: 0; padding-left: 22px; color: var(--muted); font-size: 17px; display: grid; gap: 6px; }
.legend { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 15px; color: var(--muted); }
.legend span:nth-child(odd) { font-weight: 600; color: var(--c); }
.cta { justify-self: start; background: var(--text); color: var(--bg); border: 0; border-radius: var(--radius); padding: 13px 22px; font-weight: 600; font-size: 16px; }

.head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.eyebrow { font-size: 12.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.name { font-family: var(--display); font-weight: 400; font-size: clamp(30px, 7vw, 42px); line-height: 1.05; margin: 2px 0 2px; }
.visit { color: var(--great); font-size: 15px; text-decoration: none; }
.visit:hover { text-decoration: underline; }

.switch { display: flex; gap: 6px; justify-content: center; margin: 4px 0 10px; }
.switch button { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; font-size: 14px; color: var(--muted); }
.switch button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }

.slides { display: grid; gap: 14px; }
.slide { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.shot { display: grid; place-items: center; width: 100%; padding: 12px; border: 0; border-radius: var(--radius); background: var(--stage); min-height: 200px; }
.shot img { display: block; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.slide.phone img { max-height: min(58vh, 640px); width: auto; max-width: 100%; }
.slide.desktop img { width: 100%; height: auto; }
.cap { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; color: var(--faint); }
.cap button { background: none; border: 0; color: var(--great); padding: 4px 0; font-size: 14px; }
@media (max-width: 899px) { .slide[data-hidden="true"] { display: none; } }
@media (min-width: 900px) {
  .slides { grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr); align-items: start; }
  .switch { display: none; }
  .slide.phone img { max-height: 68vh; }
}

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--raised);
  border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(0,0,0,.08);
  padding: 10px max(16px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.sheet-in { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 9px; }
.q { margin: 0; font-weight: 600; font-size: 15px; }
.labels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.label-btn {
  border: 1.5px solid color-mix(in srgb, var(--c) 55%, var(--line)); background: none; color: var(--c);
  border-radius: var(--radius); padding: 11px 4px; font-weight: 600; font-size: 14.5px; line-height: 1.2;
}
.label-btn[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: var(--on-label); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; align-items: center; }
.chips::-webkit-scrollbar { display: none; }
.chips-label { flex: none; font-size: 13.5px; color: var(--muted); }
.chip { flex: none; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 13.5px; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.field textarea {
  width: 100%; resize: vertical; min-height: 44px; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px; font-size: 16px;
}
.actions { display: flex; gap: 8px; }
.ghost { background: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 14px; color: var(--muted); }
.ghost:disabled { opacity: .35; cursor: default; }
.save { flex: 1; background: var(--text); color: var(--bg); border: 0; border-radius: var(--radius); padding: 12px; font-weight: 600; }
.save:disabled { opacity: .3; cursor: default; }
.status-line { margin: 0; font-size: 13px; color: var(--faint); text-align: center; min-height: 1.2em; }
.status-line.warn { color: var(--drop); }

.overlay { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: flex; flex-direction: column; }
.overlay-bar { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding: 10px 16px; }
.overlay-bar strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.overlay-body { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 16px; }
.overlay-body img.full { display: block; margin: 0 auto; max-width: min(100%, 1100px); height: auto; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.overlay-body img.full.phone { max-width: min(100%, 420px); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; max-width: 1180px; margin: 0 auto; }
.card { text-align: left; background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; display: block; background: var(--stage); }
.card .meta { padding: 10px 12px 12px; display: grid; gap: 4px; }
.card .meta strong { font-weight: 600; }
.card .meta span { font-size: 13.5px; color: var(--muted); }
.badge { justify-self: start; font-size: 12.5px; font-weight: 600; border-radius: 999px; padding: 2px 10px; background: var(--c, var(--stage)); color: var(--on-label); }
.badge.none { background: none; border: 1px dashed var(--line); color: var(--faint); font-weight: 500; }

.done { max-width: 620px; margin: 6vh auto 0; display: grid; gap: 16px; }
.tally { display: flex; flex-wrap: wrap; gap: 8px; }

.save .short { display: none; }
@media (max-width: 600px) {
  .sheet { padding-top: 8px; }
  .sheet-in { gap: 7px; }
  .q { display: none; }
  .label-btn { padding: 9px 2px; font-size: 13.5px; }
  .chip { padding: 4px 10px; font-size: 13px; }
  .field textarea { min-height: 40px; padding: 8px 10px; }
  .actions .ghost, .save { padding: 10px 12px; }
  .save .long { display: none; }
  .save .short { display: inline; }
  .status-line { font-size: 12px; }
}
.card .meta .badge { color: var(--on-label); font-size: 12.5px; }
.card .meta .badge.none { color: var(--faint); }
