:root {
  --bg: #f3f5f7; --card: #fff; --ink: #121a24; --muted: #5d6b7a; --line: #dde3ea;
  --accent: #0f6e8c; --accent-ink: #fff; --green: #2f7d4f; --green-bg: #e3f1e7; --amber: #9a6a00; --amber-bg: #fdf1d3;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; padding-bottom: 110px; }
h1, h2 { font-family: Fraunces, Georgia, serif; margin: 0; }
button { font: inherit; cursor: pointer; }

.hero { background: linear-gradient(160deg, #0b1220, #12283a 70%, #0f4d63); color: #fff; padding: 28px 20px 24px; }
.hero > * { max-width: 640px; margin-left: auto; margin-right: auto; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; opacity: .75; margin-top: 0; margin-bottom: 6px; }
.hero h1 { font-size: clamp(34px, 9vw, 52px); line-height: 1.02; font-weight: 800; }
.sub { font-size: 19px; margin: 6px auto 0; opacity: .92; }
.details { margin-top: 10px; font-size: 15px; opacity: .9; white-space: pre-line; }
.overall { margin-top: 18px; }
.overall p { margin: 8px 0 0; font-size: 14px; opacity: .92; }
.bar { height: 8px; border-radius: 99px; background: rgba(0,0,0,.12); overflow: hidden; }
.hero .bar { background: rgba(255,255,255,.22); }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .4s ease; }
.hero .bar span { background: #7fe0f5; }
.hero .bar { height: 12px; }
.fine { margin: 18px 2px; font-size: 13px; }

main { max-width: 640px; margin: 0 auto; padding: 16px; }
.filters { display: flex; gap: 8px; margin: 4px 0 6px; }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 8px 14px; border-radius: 99px; font-size: 15px; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.hint { color: var(--muted); font-size: 14px; margin: 8px 2px 14px; }
.loading, .empty { color: var(--muted); text-align: center; padding: 30px 0; }
.closed { background: var(--amber-bg); color: var(--amber); padding: 12px 14px; border-radius: 12px; font-weight: 600; }

.items { display: grid; gap: 12px; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 14px 12px; box-shadow: 0 1px 2px rgba(60,30,10,.04); }
.item.picked { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(15,110,140,.18); }
.item-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.item h3 { margin: 0; font-size: 17px; line-height: 1.25; }
.need { margin: 3px 0 0; font-size: 15px; color: var(--accent); font-weight: 700; }
.need.done { color: var(--green); }
.need.tbd { color: var(--amber); }
.item .bar { margin-top: 10px; }
.item.covered .bar span { background: var(--green); }
.meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.who { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.note { margin: 6px 0 0; font-size: 13px; color: var(--ink); }
.badge { flex: none; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 99px; background: var(--green-bg); color: var(--green); }

.stepper { flex: none; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.stepper button { width: 44px; height: 44px; border: 0; background: #eef2f6; font-size: 22px; line-height: 1; color: var(--ink); }
.stepper button:active { background: #dde3ea; }
.stepper button.plus { background: var(--accent); color: #fff; }
.stepper input { width: 46px; height: 44px; border: 0; text-align: center; font-size: 17px; font-weight: 700; color: var(--ink); -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.unit { display: block; text-align: right; font-size: 12px; color: var(--muted); margin-top: 4px; }

.mine { background: var(--green-bg); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.mine h2 { font-size: 18px; color: var(--green); margin-bottom: 6px; }
.mine-entry { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid rgba(47,125,79,.2); }
.mine-entry:first-of-type { border-top: 0; }
.mine-entry ul { margin: 0; padding-left: 18px; }
.link-btn { background: none; border: 0; color: #a33; text-decoration: underline; padding: 4px; font-size: 14px; flex: none; }

.tray { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 35%); }
.tray-btn { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 608px; margin: 0 auto; border: 0; border-radius: 14px; padding: 16px 18px; background: var(--accent); color: #fff; font-size: 17px; font-weight: 700; box-shadow: 0 6px 20px rgba(15,110,140,.35); }

.sheet { border: 0; padding: 0; width: 100%; max-width: 560px; border-radius: 20px 20px 0 0; margin: auto auto 0; max-height: 92vh; background: var(--card); color: var(--ink); }
@media (min-width: 640px) { .sheet { border-radius: 20px; margin: auto; } }
.sheet::backdrop { background: rgba(8,14,22,.6); }
.sheet form, .sheet > * { padding-left: 18px; padding-right: 18px; }
#thanks { padding-bottom: 18px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding-top: 18px; }
.sheet h2 { font-size: 22px; }
.x { border: 0; background: #eef2f6; width: 36px; height: 36px; border-radius: 50%; font-size: 22px; line-height: 1; }
.summary { list-style: none; padding: 0; margin: 12px 0 16px; border: 1px solid var(--line); border-radius: 12px; }
.summary li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--line); }
.summary li:first-child { border-top: 0; }
.summary b { white-space: nowrap; }
label { display: block; font-weight: 600; margin-bottom: 12px; }
label small { font-weight: 400; color: var(--muted); }
input, textarea { display: block; width: 100%; margin-top: 6px; padding: 12px; font: inherit; font-size: 16px; border: 1px solid #c9d3dd; border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.err { color: #b3261e; min-height: 1.2em; margin: 4px 0; font-size: 14px; }
.submit { width: 100%; border: 0; border-radius: 14px; padding: 16px; background: var(--accent); color: #fff; font-size: 17px; font-weight: 700; margin-bottom: 18px; }
.submit:disabled { opacity: .6; }
.muted { color: var(--muted); font-size: 14px; }
[hidden] { display: none !important; }

/* --- order form: search, one card per product, one row per size --- */
.search { position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; align-items: center; background: var(--bg); padding: 10px 0 8px; }
.search input { margin: 0; flex: 1; border-radius: 99px; padding: 11px 16px; }
.search .chip { flex: none; white-space: nowrap; }
.item { padding: 12px 14px 4px; }
.item h3 { margin-bottom: 4px; }
.size { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.size.picked { background: linear-gradient(90deg, rgba(15,110,140,.09), transparent); margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
.size-info p { margin: 0; }
.size-name { font-size: 16px; }
.vials { font-size: 12px; color: var(--muted); }
.price { font-size: 14px; color: var(--ink); margin-top: 2px; }
.per { color: var(--muted); }
.line-total { font-size: 13px; font-weight: 700; color: var(--accent); margin-top: 2px !important; }
.summary small { color: var(--muted); }
.summary li.sum { background: #f3f5f7; font-weight: 700; border-radius: 0 0 12px 12px; }
.summary { max-height: 34vh; overflow-y: auto; }
.item { overflow: hidden; }
