:root {
  --bg: #f6f5f1; --surface: #fff; --surface-2: #f0efe9; --text: #1b1d1a; --muted: #62665f; --line: #e2e0d8;
  --accent: #14532d; --accent-ink: #fff; --accent-soft: #e3efe6;
  --warn: #8a4b00; --warn-bg: #fcefd9; --ok: #17663a; --ok-bg: #e2f3e8; --info: #1d4f91; --info-bg: #e6eef9;
  --danger: #a12a2a; --danger-bg: #fbe6e4; --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 24, 18, .06), 0 4px 16px rgba(20, 24, 18, .05);
  --veil: rgba(246, 245, 241, .88); color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121411; --surface: #1b1e1a; --surface-2: #232720; --text: #ecede8; --muted: #a2a79d; --line: #2f342c;
    --accent: #5fbf85; --accent-ink: #0d1a11; --accent-soft: #1f3326;
    --warn: #f1c27d; --warn-bg: #3a2d17; --ok: #8fd7a8; --ok-bg: #1b3323; --info: #9cc0f5; --info-bg: #1c2a3d;
    --danger: #f2a2a0; --danger-bg: #3d1f1e; --shadow: none; --veil: rgba(18, 20, 17, .9); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(var(--veil), var(--veil)),
    url("https://cdn.shopify.com/s/files/1/1031/0601/9675/files/mms-hero-background.png?v=1796284485") center / cover no-repeat, var(--bg);
}
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1 { font-size: 24px; letter-spacing: -.02em; margin: 4px 0 4px; }
h2 { font-size: 17px; margin: 0 0 10px; letter-spacing: -.01em; }
.sub { color: var(--muted); font-size: 13px; }

.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 750; }
.view { max-width: 760px; margin: 0 auto; padding: 18px 16px 24px; outline: none; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 8px 16px 32px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin: 0 0 14px; }
.narrow { max-width: 420px; margin: 8vh auto 0; }
label.field { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 6px; }
input[type=email], input[type=text], input[inputmode=numeric], textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 16px;
}
textarea { min-height: 84px; resize: vertical; }
input.code { letter-spacing: 8px; font-size: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; text-decoration: none;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.full { width: 100%; margin-top: 14px; }
.btn[disabled] { opacity: .55; cursor: default; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }

.pill { display: inline-block; font-size: 12px; font-weight: 650; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill.action { background: var(--warn-bg); color: var(--warn); }
.pill.wait { background: var(--info-bg); color: var(--info); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.muted { background: var(--surface-2); color: var(--muted); }
.pill.danger { background: var(--danger-bg); color: var(--danger); }

.banner { background: var(--warn-bg); color: var(--warn); border-radius: 12px; padding: 12px 14px; font-weight: 600; margin-bottom: 14px; }

/* Timeline: across on wide screens, down on phones */
.tl { list-style: none; padding: 0; margin: 14px 0 6px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; }
.tl li { position: relative; text-align: center; padding-top: 26px; font-size: 13px; }
.tl li::before { content: ""; position: absolute; top: 9px; left: 0; right: 0; height: 3px; background: var(--line); }
.tl li:first-child::before { left: 50%; } .tl li:last-child::before { right: 50%; }
.tl li.done::before { background: var(--accent); }
.tl li.current::before { background: linear-gradient(90deg, var(--accent) 50%, var(--line) 50%); }
.tl li:last-child.current::before { background: var(--accent); }
.tl .dot { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); width: 17px; height: 17px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line); }
.tl li.done .dot { background: var(--accent); border-color: var(--accent); }
.tl li.current .dot { box-shadow: 0 0 0 4px var(--accent-soft); }
.tl b { display: block; font-weight: 600; } .tl .when { color: var(--muted); font-size: 12px; }
.tl li:not(.done) b { color: var(--muted); font-weight: 500; }
@media (max-width: 560px) {
  .tl { grid-template-columns: 1fr; }
  .tl li { text-align: left; padding: 0 0 14px 32px; }
  .tl li::before { top: 0; bottom: 0; left: 8px; right: auto; width: 3px; height: auto; }
  .tl li:first-child::before { left: 8px; top: 9px; } .tl li:last-child::before { display: none; }
  .tl li.current::before { background: linear-gradient(180deg, var(--accent) 0 9px, var(--line) 9px); }
  .tl .dot { left: 0; top: 1px; transform: none; }
  .tl b { display: inline; } .tl .when { margin-left: 6px; }
}

.items { margin: 8px 0 0; padding: 0; list-style: none; font-size: 14px; }
.items li { padding: 4px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
.items li:first-child { border-top: 0; }

.label-card .proof { background: var(--surface-2); border-radius: 12px; padding: 12px; margin: 12px 0; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin: 10px 0 0; }
.check input { margin-top: 3px; width: 18px; height: 18px; }
.drop { display: block; border: 2px dashed var(--line); border-radius: 12px; padding: 16px; text-align: center; cursor: pointer; margin-top: 12px; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.hist { list-style: none; margin: 10px 0 0; padding: 0; font-size: 14px; }
.hist li { padding: 8px 0; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: baseline; }
.hist .v { font-weight: 700; min-width: 30px; font-variant-numeric: tabular-nums; }
.hist .what { flex: 1; min-width: 0; overflow-wrap: anywhere; }
details > summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 14px; margin-top: 12px; }
.error { background: var(--danger-bg); color: var(--danger); border-radius: 10px; padding: 10px 12px; margin-top: 12px; font-size: 14px; }
.skeleton { height: 160px; border-radius: var(--radius); background: var(--surface-2); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(120px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; transition: transform .2s; max-width: calc(100vw - 32px); font-size: 14px; }
.toast.show { transform: translateX(-50%); }
.hide { display: none !important; }
