    :root {
      --color-purple: #6b4eff;
      --color-purple-deep: #4f3ccc;
      --color-purple-tint: #eeedfe;
      --color-ink: #111111;
      --color-ink-2: #3d3a4a;
      --color-muted: #6f6b80;
      --color-hint: #8d89a0;
      --color-paper: #f6f5fb;     /* page background, shared with the report */
      --color-card: #ffffff;
      --color-surface: #f6f5fb;   /* inset areas inside a card */
      --color-border: #e0ddee;
      --color-error: #c3262e;
      --color-ok: #0e7a4d;
      --color-warn: #b35309;
      --color-warn-tint: #fbedd6;
      --color-error-tint: #fae1df;
      --color-ok-tint: #dcf1e5;
      --color-night: #1a1528;
      --shadow-card: 0 1px 2px rgb(42 33 64 / 0.04), 0 12px 32px -18px rgb(42 33 64 / 0.25);
      --shadow-lift: 0 18px 40px -20px rgb(79 60 204 / 0.45);
      --ease: cubic-bezier(0.16, 1, 0.3, 1);
      --radius-pill: 999px;
      --radius-card: 18px;
      --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    }
    * { box-sizing: border-box; }
    body {
      margin: 0; min-height: 100vh; font-family: var(--font); color: var(--color-ink);
      background:
        radial-gradient(1200px 600px at 85% -10%, rgb(91 61 245 / 0.10), transparent 60%),
        radial-gradient(900px 500px at -10% 30%, rgb(179 83 9 / 0.05), transparent 60%),
        var(--color-paper);
      background-attachment: fixed;
      display: grid; place-items: center; padding: 16px;
      -webkit-font-smoothing: antialiased;
    }
    /* Paper grain, as on the report. Only .app is lifted above it: a modal <dialog> must keep its own positioning. */
    body::before {
      content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.35; mix-blend-mode: multiply;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    }
    body > .app, body > main { position: relative; z-index: 1; }
    main {
      width: 100%; max-width: 420px; background: var(--color-card); border-radius: var(--radius-card);
      padding: 32px 24px; border: 1px solid var(--color-border); box-shadow: var(--shadow-card);
    }
    .brand { font-weight: 700; letter-spacing: -0.04em; font-size: 1.35rem; color: var(--color-ink); }
    h1 { font-size: 1.75rem; line-height: 1.1; margin: 16px 0 8px; font-weight: 800; letter-spacing: -0.04em; }
    p { color: var(--color-muted); line-height: 1.5; margin: 0 0 20px; }
    label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
    input[type=email] {
      width: 100%; font: inherit; font-size: 1rem; padding: 14px 16px; border-radius: 12px;
      border: 1.5px solid var(--color-border); background: var(--color-surface);
    }
    input[type=email]:focus { outline: none; border-color: var(--color-purple); box-shadow: 0 0 0 4px var(--color-purple-tint); }
    button {
      width: 100%; margin-top: 14px; font: inherit; font-weight: 700; font-size: 1rem; color: #fff;
      background: var(--color-purple); border: 0; border-radius: var(--radius-pill); padding: 15px;
      cursor: pointer; transition: background 150ms, transform 150ms;
    }
    button:hover { background: var(--color-purple-deep); }
    button:active { transform: scale(0.98); }
    button:focus-visible { outline: 3px solid var(--color-ink); outline-offset: 3px; }
    /* Headings get focus from code (so screen readers announce the new screen); that needs no visible box. */
    [tabindex="-1"]:focus { outline: none; }
    button[disabled] { opacity: 0.6; cursor: wait; }
    .status { min-height: 1.5em; margin-top: 14px; font-size: 0.9rem; }
    .status.error { color: var(--color-error); }
    .status.ok { color: var(--color-ok); }
    .hidden { display: none !important; } /* beats any later display rule, e.g. .preview */
    pre {
      background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px;
      padding: 12px; font-size: 0.75rem; overflow-x: auto; max-height: 260px;
    }
    .meta { margin-top: 20px; font-size: 0.75rem; color: var(--color-hint); word-break: break-all; }
    .invite-link { display: block; margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--color-purple-tint); color: var(--color-purple-deep); font-size: 0.85rem; word-break: break-all; }
    .invite-link:focus-visible { outline: 3px solid var(--color-ink); outline-offset: 2px; }

    /* --- check-in --- */
    .choices { display: grid; gap: 12px; margin-top: 8px; }
    .choice {
      position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr; gap: 18px 16px; text-align: left;
      background: var(--color-card); color: var(--color-ink); border: 1px solid var(--color-border);
      border-radius: var(--radius-card); padding: 20px 22px; margin: 0; box-shadow: var(--shadow-card);
      transition: border-color 160ms, transform 220ms var(--ease), box-shadow 220ms var(--ease);
    }
    .choice:hover { background: var(--color-card); border-color: var(--color-purple); transform: translateY(-2px); box-shadow: var(--shadow-lift); }
    .choice:active { transform: translateY(0); }
    .choice .choice-art {
      grid-area: 1 / 1; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
      background: var(--color-purple-tint); color: var(--color-purple);
      transition: background 160ms, color 160ms;
    }
    .choice .choice-art svg { width: 26px; height: 26px; }
    .choice:hover .choice-art { background: var(--color-purple); color: #fff; }
    .choice-text { grid-area: 2 / 1 / 3 / 3; align-self: end; }
    .choice strong { display: block; color: var(--color-ink); font-size: 1.3rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 4px; }
    .choice-text > span { color: var(--color-muted); font-weight: 500; font-size: 0.88rem; line-height: 1.4; }
    .choice .done {
      grid-area: 1 / 2; align-self: start; font-size: 0.75rem; font-weight: 700; padding: 5px 11px; border-radius: var(--radius-pill);
      background: var(--color-purple-tint); color: var(--color-purple-deep);
    }
    .choice .done::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: currentColor; vertical-align: 1px; }
    .choice .done[data-status="pending"], .choice .done[data-status="onhold"] { background: var(--color-warn-tint); color: var(--color-warn); }
    .choice .done[data-status="confirmed"] { background: var(--color-ok-tint); color: var(--color-ok); }
    .choice .done[data-status="declined"] { background: var(--color-error-tint); color: var(--color-error); }
    .choice-text > .choice-what { display: block; color: var(--color-ink-2); font-size: 0.95rem; margin-bottom: 6px; }
    .choice-text > span:last-child { font-size: 0.82rem; }

    /* --- explaining check-ins: lead, how it works, status key, what happens next --- */
    .lead { color: var(--color-ink-2); font-size: 1.02rem; line-height: 1.55; max-width: 62ch; }
    .section-label {
      margin: 28px 0 12px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-muted);
    }
    .how-steps { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 10px; counter-reset: none; }
    .how-steps li {
      display: grid; grid-template-columns: 32px 1fr; gap: 2px 12px; align-items: start;
      padding: 14px 16px; border-radius: 14px; background: rgb(255 255 255 / 0.6); border: 1px solid var(--color-border);
    }
    .how-num {
      grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
      background: var(--color-purple); color: #fff; font-size: 0.8rem; font-weight: 800;
    }
    .how-steps strong { font-size: 0.95rem; letter-spacing: -0.01em; }
    .how-steps li > span:last-child { color: var(--color-muted); font-size: 0.86rem; line-height: 1.45; }
    @media (min-width: 900px) {
      /* only in the wide signed-in layout; inside the 420px card the stacked list reads better */
      body.has-nav .how-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
      body.has-nav .how-steps li { grid-template-columns: 1fr; gap: 6px; padding: 18px; }
      body.has-nav .how-num { grid-row: auto; margin-bottom: 4px; }
    }
    .choices-more { margin: 12px 0 0; color: var(--color-muted); font-size: 0.86rem; }
    .status-key { margin: 32px 0 0; padding-top: 20px; border-top: 1px solid var(--color-border); display: grid; gap: 10px; font-size: 0.85rem; }
    .status-key div { display: grid; grid-template-columns: 108px 1fr; gap: 12px; align-items: baseline; }
    .status-key dt { margin: 0; }
    .status-key dd { margin: 0; color: var(--color-muted); line-height: 1.45; }
    .next-steps { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 0; }
    .next-steps li { position: relative; display: grid; gap: 2px; padding: 0 0 18px 26px; }
    .next-steps li::before {
      content: ""; position: absolute; left: 4px; top: 5px; width: 10px; height: 10px; border-radius: 50%;
      background: var(--color-card); border: 2px solid var(--color-purple);
    }
    .next-steps li:first-child::before { background: var(--color-purple); }
    .next-steps li:not(:last-child)::after {
      content: ""; position: absolute; left: 10px; top: 20px; bottom: 2px; width: 2px; background: var(--color-border);
    }
    .next-steps strong { font-size: 0.95rem; }
    .next-steps span { color: var(--color-muted); font-size: 0.88rem; line-height: 1.45; }
    .secondary { background: var(--color-card); color: var(--color-ink); border: 1px solid var(--color-border); }
    .secondary:hover { background: var(--color-card); border-color: var(--color-ink); }
    .shot-head { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
    .shot-head #shot-flow { margin: 0; font-weight: 700; color: var(--color-ink); }
    .shot-saved { margin-left: auto; font-size: 0.78rem; color: var(--color-muted); text-align: right; }
    /* photos strip on the shot screen: taken ones as thumbnails (tap to view), the rest as outlines */
    .shot-strip { list-style: none; padding: 0; margin: 0 0 16px; display: flex; gap: 8px; }
    .shot-strip li { flex: 1; min-width: 0; display: grid; gap: 4px; }
    .shot-strip .thumb, .shot-tile-art { width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; }
    .shot-tile-art {
      display: grid; place-items: center; padding: 0; margin: 0; background: var(--color-paper); border: 1.5px dashed var(--color-border);
      cursor: pointer; transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
    }
    .shot-tile-art:hover { border-color: var(--color-purple); background: var(--color-purple-tint); }
    .shot-tile-art img { width: 72%; max-height: 70%; object-fit: contain; opacity: 0.35; }
    .shot-strip .is-current .shot-tile-art { border-color: var(--color-purple); background: var(--color-purple-tint); }
    .shot-strip .is-current .shot-tile-art img { opacity: 0.8; }
    .shot-strip .is-done .thumb { position: relative; outline: 2px solid var(--color-ok); outline-offset: -2px; }
    .shot-strip .is-done.is-current .thumb { outline: 3px solid var(--color-purple); }
    .shot-tile-name { font-size: 0.72rem; font-weight: 600; color: var(--color-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .shot-strip .is-current .shot-tile-name { color: var(--color-purple-deep); }
    .shot-strip .is-done .shot-tile-name::before { content: "✓ "; color: var(--color-ok); }
    .steps { list-style: none; padding: 0; margin: 0 0 16px; display: flex; gap: 6px; }
    .steps li { flex: 1; height: 4px; border-radius: 2px; background: var(--color-border); }
    .steps li.is-done { background: var(--color-purple); }
    .shot-hint { display: flex; justify-content: center; padding: 16px; background: var(--color-card); border: 1px solid var(--color-border); border-radius: 16px; margin-bottom: 8px; }
    .shot-hint img { width: 140px; height: auto; }
    .preview { width: 100%; border-radius: 16px; display: block; margin-bottom: 4px; background: #000; }

    /* Full-screen camera with a framing overlay */
    .camera { position: fixed; inset: 0; background: #000; z-index: 10; display: flex; flex-direction: column; }
    .camera video { flex: 1; width: 100%; object-fit: cover; min-height: 0; }
    .camera .frame {
      position: absolute; inset: 15% 8% 28% 8%; display: flex; align-items: center; justify-content: center;
      border: 2px dashed rgb(255 255 255 / 0.7); border-radius: 18px; pointer-events: none;
    }
    /* the guide shows how to line up the shot, then fades to a faint ghost so the camera view is clear */
    .camera .frame img {
      width: 70%; max-height: 70%; opacity: 0.12; filter: brightness(2.2);
      animation: guide-fade 2600ms cubic-bezier(0.4, 0, 0.2, 1) both;
    }
    @keyframes guide-fade {
      0% { opacity: 0; transform: scale(0.96); }
      12%, 55% { opacity: 0.6; transform: scale(1); }
      100% { opacity: 0.12; transform: scale(1); }
    }
    @media (prefers-reduced-motion: reduce) { .camera .frame img { animation: none; opacity: 0.2; } }
    .camera .label {
      position: absolute; top: max(16px, env(safe-area-inset-top)); left: 16px; right: 16px; text-align: center;
      color: #fff; font-weight: 600; text-shadow: 0 1px 3px rgb(0 0 0 / 0.6);
    }
    .camera .bar {
      display: flex; align-items: center; justify-content: space-between; gap: 16px;
      padding: 20px 24px max(24px, env(safe-area-inset-bottom)); background: rgb(0 0 0 / 0.85);
    }
    .camera .bar button { width: auto; margin: 0; }
    .camera .bar .cancel { background: transparent; color: #fff; padding: 12px 8px; }
    /* .camera .bar .shutter: must outrank ".camera .bar button { width: auto }" or the empty button collapses */
    .camera .bar .shutter {
      flex: 0 0 72px; width: 72px; height: 72px; padding: 0; border-radius: 50%; background: #fff;
      box-shadow: 0 0 0 5px rgb(255 255 255 / 0.35);
    }
    .camera .bar .shutter:hover { background: #eee; }
    .camera .spacer { width: 56px; }

    /* Review: one row per photo, with its upload state */
    .review-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
    .review-item {
      display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 12px;
      padding: 8px; border: 1px solid var(--color-border); border-radius: 14px; background: var(--color-card);
    }
    .review-item .thumb { width: 64px; height: 64px; }
    .review-item strong { display: block; font-size: 0.95rem; }
    /* sync badge: on this device → uploading → uploaded (or failed) */
    .photo-sync {
      display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 3px 10px 3px 6px; border-radius: 999px;
      font-size: 0.78rem; font-weight: 600; color: var(--color-muted); background: var(--color-paper);
      transition: background-color 240ms var(--ease), color 240ms var(--ease);
    }
    .photo-sync svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
    .photo-sync[data-sync="uploading"] { color: var(--color-purple-deep); background: var(--color-purple-tint); }
    .photo-sync[data-sync="uploading"] svg { animation: sync-spin 800ms linear infinite; }
    .photo-sync[data-sync="synced"] { color: var(--color-ok); background: var(--color-ok-tint); }
    .photo-sync[data-sync="failed"] { color: var(--color-error); background: var(--color-error-tint); }
    .photo-sync.just-synced svg { animation: sync-pop 420ms cubic-bezier(0.34, 1.56, 0.64, 1) both; }
    .photo-sync.just-synced svg path:last-child { stroke-dasharray: 12; stroke-dashoffset: 12; animation: sync-tick 360ms 160ms var(--ease) forwards; }
    @keyframes sync-spin { to { transform: rotate(360deg); } }
    @keyframes sync-pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
    @keyframes sync-tick { to { stroke-dashoffset: 0; } }
    @media (prefers-reduced-motion: reduce) {
      .photo-sync, .photo-sync svg, .photo-sync svg path { animation: none !important; transition: none; stroke-dashoffset: 0 !important; }
    }
    button.small { width: auto; margin: 0; padding: 8px 14px; font-size: 0.85rem; }
    .choice .done.is-draft { color: var(--color-purple); }
    @media (prefers-reduced-motion: reduce) { button { transition: none; } }

    /* Submitted check-ins */
    .history-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 14px; }
    .history-item {
      padding: 18px 20px 20px; border: 1px solid var(--color-border); border-radius: var(--radius-card);
      background: var(--color-card); box-shadow: var(--shadow-card);
    }
    .history-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 0.9rem; }
    .history-when { display: flex; flex-direction: column; gap: 2px; }
    .history-when strong { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.02em; }
    .history-when span { font-size: 0.8rem; color: var(--color-muted); font-variant-numeric: tabular-nums; }
    .history-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
    .history-photos .thumb { width: 100%; aspect-ratio: 1; border-radius: 12px; }
    .badge { font-size: 0.75rem; font-weight: 700; padding: 5px 11px; border-radius: var(--radius-pill); background: var(--color-warn-tint); color: var(--color-warn); white-space: nowrap; }
    .badge::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: currentColor; vertical-align: 1px; }
    .badge.status-confirmed { background: var(--color-ok-tint); color: var(--color-ok); }
    .badge.status-declined { background: var(--color-error-tint); color: var(--color-error); }

    /* --- check-in results --- */
    .history-reason strong { color: var(--color-ink); font-weight: 700; }
    .history-reason { margin: -4px 0 14px; padding: 10px 12px; border-radius: 12px; font-size: 0.85rem; line-height: 1.4; color: var(--color-ink-2); background: var(--color-surface); }
    .history-head .badge { margin-left: auto; }
    .history-open {
      font-size: 0.85rem; font-weight: 600; color: var(--color-ink); text-decoration: none; white-space: nowrap;
      padding: 7px 14px; border-radius: var(--radius-pill); border: 1px solid var(--color-border); background: var(--color-card);
      transition: border-color 160ms, color 160ms;
    }
    .history-open::after { content: "→"; display: inline-block; margin-left: 6px; transition: transform 160ms var(--ease); }
    .history-open:hover::after { transform: translateX(3px); }
    .history-open:hover { border-color: var(--color-purple); color: var(--color-purple-deep); }
    .history-open:focus-visible { outline: 3px solid var(--color-ink); outline-offset: 2px; }
    .history-next { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
    .history-next:has(> .hidden + .hidden) { display: none; }
    .next-note { margin: 0; font-size: 0.85rem; color: var(--color-muted); }
    .screen-head { display: flex; align-items: center; gap: 10px; margin: 16px 0 8px; }
    .screen-head h1 { margin: 0; }
    .icon-back {
      width: 38px; height: 38px; margin: 0 0 0 -8px; padding: 0; flex: none; display: grid; place-items: center;
      background: transparent; color: var(--color-ink); border-radius: 50%;
    }
    .icon-back svg { width: 22px; height: 22px; }
    .icon-back:hover { background: var(--color-purple-tint); color: var(--color-purple-deep); }
    @media (min-width: 900px) { .history-photos { grid-template-columns: repeat(auto-fill, 112px); } }
    .result-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
    .result-route { margin: 0; font-size: 0.9rem; }
    .sample-tag { margin-left: auto; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 8px; border-radius: var(--radius-pill); border: 1px dashed var(--color-hint); color: var(--color-muted); }
    .result-reason { border-left: 4px solid var(--color-warn); background: var(--color-warn-tint); border-radius: 12px; padding: 12px 14px; margin-bottom: 18px; }
    .result-reason.is-declined { border-color: var(--color-error); background: var(--color-error-tint); }
    .result-reason strong { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-ink); margin-bottom: 4px; }
    .result-reason p { margin: 0; color: var(--color-ink); }
    .result-processing { margin: 12px 0 20px; }
    .result-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
    .result-figure { background: var(--color-surface); border: 1.5px solid var(--color-border); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
    .result-figure strong { font-size: 1.15rem; letter-spacing: -0.01em; overflow-wrap: anywhere; }
    .result-facts .result-figure:first-child strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
    .result-sub { font-size: 0.8rem; color: var(--color-muted); }
    .chip-note { align-self: flex-start; font-size: 0.72rem; font-weight: 700; padding: 3px 8px; border-radius: var(--radius-pill); background: var(--color-warn-tint); color: var(--color-warn); }
    .result-summary { margin-bottom: 12px; }
    .result-sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
    .result-side { margin: 0; }
    .result-side figcaption { display: flex; justify-content: space-between; gap: 6px; font-size: 0.8rem; margin-top: 6px; color: var(--color-muted); }
    .result-side figcaption strong { color: var(--color-ink); }
    /* The photo keeps its natural shape (no cropping) so the 0–1 damage boxes land where the model saw damage. */
    .result-photo { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: var(--color-border); min-height: 90px; cursor: zoom-in; }
    .result-photo:hover { background: var(--color-border); }
    .result-photo img { display: block; width: 100%; height: auto; }
    .result-photo:disabled { cursor: default; }
    .result-no-photo { display: grid; place-items: center; min-height: 90px; font-size: 0.8rem; color: var(--color-hint); }
    .damage-box { position: absolute; border: 2px solid #ff4d4f; border-radius: 6px; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6); pointer-events: none; }
    .damage-tag { position: absolute; left: -2px; bottom: 100%; margin-bottom: 2px; background: #ff4d4f; color: #fff; font-size: 0.65rem; font-weight: 700; padding: 2px 6px; border-radius: 6px; white-space: nowrap; text-transform: capitalize; }
    .damage-box.is-top .damage-tag { bottom: auto; top: 100%; margin: 2px 0 0; }
    .result-checks { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; }
    .check { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--color-surface); border: 1.5px solid var(--color-border); }
    .check-icon { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 0.8rem; color: #fff; background: var(--color-ok); }
    .check.is-warn .check-icon { background: var(--color-warn); }
    .check.is-fail .check-icon { background: var(--color-error); }
    .check.is-fail { border-color: var(--color-error-tint); }
    .check-text { display: flex; flex-direction: column; gap: 2px; font-size: 0.9rem; }
    .check-text span { color: var(--color-muted); font-size: 0.85rem; }
    .underwriter { border: 1.5px solid var(--color-purple); border-radius: 14px; padding: 0 14px; margin-bottom: 20px; background: var(--color-purple-tint); }
    .underwriter summary { cursor: pointer; padding: 14px 0; font-weight: 700; color: var(--color-purple-deep); }
    .underwriter summary:focus-visible { outline: 3px solid var(--color-ink); outline-offset: 2px; border-radius: 6px; }
    .underwriter-why { margin: 0 0 12px; color: var(--color-ink); font-size: 0.9rem; }
    .underwriter dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; font-size: 0.85rem; }
    .underwriter dt { color: var(--color-muted); }
    .underwriter dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
    .fine-print { font-size: 0.8rem; color: var(--color-hint); margin: 14px 0 0; }

    /* Thumbnails open a full-size viewer */
    .thumb {
      display: block; padding: 0; margin: 0; border: 0; border-radius: 10px; overflow: hidden; background: #000;
      cursor: zoom-in; transition: transform 150ms, box-shadow 150ms;
    }
    .thumb:hover { background: #000; transform: scale(1.03); box-shadow: 0 6px 16px rgb(0 0 0 / 0.2); }
    .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .viewer {
      width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 16px; border: 0;
      background: rgb(0 0 0 / 0.92); display: none; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
      cursor: zoom-out;
    }
    .viewer[open] { display: flex; }
    .viewer::backdrop { background: transparent; }
    .viewer img { max-width: 100%; max-height: calc(100dvh - 96px); object-fit: contain; border-radius: 8px; }
    .viewer p { color: #fff; margin: 0; font-weight: 600; }
    .viewer .viewer-close {
      position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; margin: 0; padding: 0;
      border-radius: 50%; background: rgb(255 255 255 / 0.15); font-size: 1.1rem;
    }
    .viewer .viewer-close:hover { background: rgb(255 255 255 / 0.3); }

    /* Loaders: one spinner, used in buttons and the page-level loading panel */
    @keyframes spin { to { transform: rotate(360deg); } }
    @keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
    .spinner {
      display: inline-block; width: 28px; height: 28px; border-radius: 50%;
      border: 3px solid var(--color-purple-tint); border-top-color: var(--color-purple);
      animation: spin 0.8s linear infinite;
    }
    button.is-loading { position: relative; color: transparent !important; cursor: progress; opacity: 1; }
    button.is-loading::after {
      content: ""; position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
      border-radius: 50%; border: 2.5px solid rgb(255 255 255 / 0.35); border-top-color: #fff;
      animation: spin 0.8s linear infinite;
    }
    button.secondary.is-loading::after, .choice.is-loading::after {
      border-color: var(--color-purple-tint); border-top-color: var(--color-purple);
    }
    .choice.is-loading > * { visibility: hidden; }
    .loading-panel { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 40px 0 24px; text-align: center; }
    .loading-panel p { margin: 0; }
    .is-loading-image {
      background: linear-gradient(90deg, #e9e9ee 25%, #f6f6f9 50%, #e9e9ee 75%) !important;
      background-size: 400% 100% !important; animation: shimmer 1.4s ease-in-out infinite;
    }
    .is-loading-image img { opacity: 0; }
    .viewer.is-loading-image { background: rgb(0 0 0 / 0.92) !important; animation: none; }
    .viewer.is-loading-image::before {
      content: ""; position: absolute; top: 50%; left: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px;
      border-radius: 50%; border: 3px solid rgb(255 255 255 / 0.25); border-top-color: #fff; animation: spin 0.8s linear infinite;
    }
    .is-broken-image::after { content: "Photo unavailable"; color: var(--color-hint); font-size: 0.7rem; }
    @media (prefers-reduced-motion: reduce) {
      .spinner, button.is-loading::after, .viewer.is-loading-image::before { animation-duration: 2.4s; }
      .is-loading-image { animation: none; }
    }

    /* ===== App shell: card alone, or sidebar + content once the user has a check-in ===== */
    .app { width: 100%; max-width: 420px; }
    .app > main { margin: 0 auto; }
    a.button-link {
      display: block; text-align: center; margin-top: 14px; padding: 15px; border-radius: var(--radius-pill);
      background: var(--color-purple); color: #fff; font-weight: 700; text-decoration: none;
    }
    a.button-link:hover { background: var(--color-purple-deep); }
    a.button-link:focus-visible { outline: 3px solid var(--color-ink); outline-offset: 3px; }

    .sidebar { color: var(--color-ink); }
    .sidebar ul { list-style: none; margin: 0; padding: 0; }
    .sidebar a, .sidebar .nav-signout {
      display: flex; align-items: center; gap: 12px; width: 100%; margin: 0; padding: 11px 14px; border-radius: 12px;
      color: var(--color-ink-2); background: transparent; font: inherit; font-weight: 600; font-size: 0.95rem;
      text-decoration: none; text-align: left; border: 0; cursor: pointer; transition: background 150ms, color 150ms;
    }
    .sidebar svg { width: 22px; height: 22px; flex: none; }
    .sidebar a:hover, .sidebar .nav-signout:hover { background: var(--color-surface); color: var(--color-ink); }
    .sidebar a[aria-current="page"] { background: var(--color-purple-tint); color: var(--color-purple-deep); }
    .sidebar a:focus-visible, .sidebar .nav-signout:focus-visible { outline: 3px solid var(--color-purple); outline-offset: 2px; }
    .nav-brand { display: flex; flex-direction: column; gap: 4px; padding: 6px 14px 20px; }
    .nav-brand .brand { font-size: 1.5rem; }
    .nav-email { font-size: 0.75rem; color: var(--color-muted); word-break: break-all; }

    @media (min-width: 900px) {
      body.has-nav { place-items: start center; padding: 32px 24px; }
      body.has-nav .app { max-width: 1320px; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; align-items: start; }
      body.has-nav .sidebar {
        position: sticky; top: 32px; padding: 20px 12px; border-radius: var(--radius-card);
        background: rgb(255 255 255 / 0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
        border: 1px solid var(--color-border); box-shadow: var(--shadow-card);
      }
      body.has-nav .sidebar ul { display: grid; gap: 4px; }
      body.has-nav .sidebar li:last-child { margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--color-border); }
      /* Content sits straight on the paper, like the report; the cards inside carry the surfaces. */
      body.has-nav .app > main:not(.wide) {
        width: 100%; max-width: 980px; margin: 0; padding: 8px 0 48px; min-height: calc(100dvh - 64px);
        background: none; border: 0; box-shadow: none; border-radius: 0;
      }
      /* The sidebar already carries the brand and Sign out: no second copy inside the panel. */
      body.has-nav main > .brand, body.has-nav #sign-out, body.has-nav #screen-choose > .fine-print { display: none; }
      body.has-nav main h1 { font-size: clamp(2.4rem, 1.6rem + 1.6vw, 3.2rem); margin-top: 8px; }
      body.has-nav main h1 + p, body.has-nav #history-intro { font-size: 1.05rem; margin-bottom: 28px; }
      /* Full-width buttons read as phone UI on a wide screen: keep them button-sized. */
      body.has-nav main > section > button:not(.choice):not(.small):not(.icon-back),
      body.has-nav main > section > a.button-link { max-width: 360px; }
      body.has-nav .choices { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
      body.has-nav .choice { min-height: 148px; padding: 24px 26px; }
      /* Taking a photo stays phone-sized and centred inside the wider panel. */
      /* taking photos, reviewing and the confirmation are a single task: one centred column, full-width buttons */
      body.has-nav #screen-shot { max-width: 460px; margin-inline: auto; }
      body.has-nav #screen-review, body.has-nav #screen-submitted { max-width: 600px; margin-inline: auto; }
      body.has-nav :is(#screen-shot, #screen-review, #screen-submitted) > :is(button, a.button-link) { max-width: none; width: 100%; }
    }
    @media (max-width: 899px) {
      body.has-nav { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
      body.has-nav .sidebar {
        position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 5;
        padding: 6px; border-radius: 22px; background: rgb(255 255 255 / 0.86); border: 1px solid var(--color-border);
        backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 12px 30px -10px rgb(42 33 64 / 0.3);
      }
      /* On phones the content sits on the paper too, with the cards carrying the surfaces. */
      body.has-nav .app > main:not(.wide) { background: none; border: 0; box-shadow: none; padding: 8px 4px 24px; }
      body.has-nav main > .brand { font-size: 1.2rem; }
      body.has-nav .nav-brand { display: none; }
      body.has-nav .sidebar ul { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
      body.has-nav .sidebar a, body.has-nav .sidebar .nav-signout {
        flex-direction: column; gap: 4px; padding: 8px 4px; font-size: 0.72rem; justify-content: center; text-align: center;
      }
    }

    /* ===== Rewards page: a column of panels on the gradient ===== */
    main.wide { max-width: none; background: none; box-shadow: none; padding: 0; display: grid; gap: 16px; }
    main.wide > .status:empty { display: none; }
    main.wide { border: 0; }
    main.wide > .status { margin: 0; padding: 12px 16px; background: var(--color-card); border: 1px solid var(--color-border); border-radius: 14px; }
    #r-content { display: grid; gap: 16px; }
    #r-content.hidden { display: none !important; }
    .panel { background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius-card); padding: 28px 24px; box-shadow: var(--shadow-card); }
    .panel h2 { font-size: 1.35rem; font-weight: 800; margin: 0 0 14px; letter-spacing: -0.03em; }
    .panel > p:last-child { margin-bottom: 0; }
    .panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
    .panel-head h2 { margin: 0; }

    .hero {
      position: relative; overflow: hidden; color: #fff;
      background: radial-gradient(120% 140% at 100% 0%, #8b74ff 0%, var(--color-purple) 40%, var(--color-night) 100%);
      border-color: transparent;
    }
    .hero::after {
      content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
      background: rgb(255 255 255 / 0.08); box-shadow: -40px 120px 0 -30px rgb(255 255 255 / 0.06);
    }
    .eyebrow { margin: 0; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.72rem; font-weight: 700; color: rgb(255 255 255 / 0.7); }
    .hero h1 { margin: 6px 0 8px; font-size: clamp(2.2rem, 1.6rem + 2.6vw, 3.2rem); letter-spacing: -0.03em; }
    .hero-sub { font-size: 1rem; font-weight: 600; letter-spacing: 0; color: rgb(255 255 255 / 0.75); }
    .hero-copy { color: rgb(255 255 255 / 0.82); max-width: 46ch; }
    .figures { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 4px 0 6px; }
    .figure { padding: 14px; border-radius: 16px; background: rgb(255 255 255 / 0.1); border: 1px solid rgb(255 255 255 / 0.14); }
    .figure-ready { background: #fff; color: var(--color-ink); }
    .figure-label { display: block; font-size: 0.75rem; font-weight: 600; opacity: 0.75; margin-bottom: 4px; }
    .figure strong { font-size: 1.25rem; letter-spacing: -0.02em; }
    .hero-cta { position: relative; z-index: 1; background: #fff; color: var(--color-purple-deep); }
    .hero-cta:hover { background: var(--color-purple-tint); }
    .hero-cta[disabled] { background: rgb(255 255 255 / 0.2); color: rgb(255 255 255 / 0.85); cursor: not-allowed; opacity: 1; }
    .hero-cta.is-loading::after { border-color: var(--color-purple-tint); border-top-color: var(--color-purple); }
    .hero-note { position: relative; z-index: 1; margin: 10px 0 0; text-align: center; font-size: 0.85rem; color: rgb(255 255 255 / 0.8); }
    .hero :focus-visible { outline-color: #fff; }

    .options { list-style: none; padding: 0; margin: 0 0 4px; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
    .option {
      display: flex; flex-direction: column; align-items: flex-start; gap: 6px; height: 100%; margin: 0; padding: 12px;
      background: var(--color-surface); color: var(--color-ink); border: 2px solid var(--color-border); border-radius: 16px; text-align: left;
    }
    .option:hover { background: var(--color-purple-tint); border-color: var(--color-purple); }
    .option[aria-pressed="true"] { border-color: var(--color-purple); background: var(--color-purple-tint); box-shadow: 0 0 0 4px rgb(107 78 255 / 0.15); }
    .option[disabled] { opacity: 0.5; cursor: not-allowed; }
    .option-art {
      width: 100%; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; display: grid; place-items: center;
      background: linear-gradient(150deg, var(--color-purple) 0%, #2a2140 100%); color: #fff; font-size: 1.6rem; font-weight: 800;
    }
    .option-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .option strong { font-size: 0.9rem; }
    .option-note { font-size: 0.75rem; color: var(--color-muted); font-weight: 500; }

    .celebrate { position: relative; overflow: hidden; text-align: center; }
    .confetti span {
      position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; opacity: 0.85;
      animation: fall 2.4s ease-in forwards;
    }
    .confetti span:nth-child(1) { left: 10%; background: var(--color-purple); animation-delay: 0s; }
    .confetti span:nth-child(2) { left: 28%; background: #ffb547; animation-delay: 0.2s; }
    .confetti span:nth-child(3) { left: 46%; background: #22c55e; animation-delay: 0.05s; }
    .confetti span:nth-child(4) { left: 64%; background: #ff5f8f; animation-delay: 0.3s; }
    .confetti span:nth-child(5) { left: 80%; background: var(--color-purple-deep); animation-delay: 0.15s; }
    .confetti span:nth-child(6) { left: 92%; background: #38bdf8; animation-delay: 0.25s; }
    @keyframes fall { to { transform: translateY(260px) rotate(540deg); opacity: 0; } }

    .how { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; counter-reset: how; }
    .how li { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; }
    .how-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--color-purple-tint); color: var(--color-purple); }
    .how-icon svg { width: 24px; height: 24px; }
    .how strong { display: block; margin-bottom: 2px; }
    .how .how-icon { color: var(--color-purple); }
    .how span { color: var(--color-muted); font-size: 0.9rem; line-height: 1.45; }

    .earn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
    .earn-card {
      display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 18px; text-decoration: none; color: var(--color-ink);
      background: var(--color-surface); border: 1.5px solid var(--color-border); transition: transform 150ms, border-color 150ms, box-shadow 150ms;
    }
    .earn-card:hover { transform: translateY(-2px); border-color: var(--color-purple); box-shadow: 0 10px 24px rgb(107 78 255 / 0.15); }
    .earn-card:focus-visible { outline: 3px solid var(--color-ink); outline-offset: 2px; }
    .earn-card > span:not(.earn-art):not(.earn-go) { color: var(--color-muted); font-size: 0.88rem; line-height: 1.45; }
    .earn-art { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 6px; }
    .earn-art svg { width: 30px; height: 30px; }
    .earn-mileage { background: #e7f0ff; color: #2f6fe4; }
    .earn-condition { background: #e6f7ee; color: #16a34a; }
    .earn-go { margin-top: auto; padding-top: 6px; color: var(--color-purple); font-weight: 700; font-size: 0.9rem; }

    .filters { display: flex; flex-wrap: wrap; gap: 6px; }
    .chip {
      width: auto; margin: 0; padding: 6px 12px; font-size: 0.8rem; font-weight: 600; border-radius: var(--radius-pill);
      background: var(--color-surface); color: var(--color-muted); border: 1.5px solid var(--color-border);
    }
    .chip:hover { background: var(--color-purple-tint); color: var(--color-purple-deep); }
    .chip[aria-pressed="true"] { background: var(--color-ink); color: #fff; border-color: var(--color-ink); }
    .ledger { list-style: none; margin: 0; padding: 0; }
    .ledger-row { display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--color-border); }
    .ledger-row:first-child { border-top: 0; }
    .ledger-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--color-purple); }
    .ledger-dot.status-confirmed { background: var(--color-ok); }
    .ledger-dot.status-declined { background: var(--color-error); }
    .ledger-dot.status-claimed { background: var(--color-hint); }
    .ledger-text strong { display: block; font-size: 0.92rem; }
    .ledger-text span { font-size: 0.78rem; color: var(--color-hint); }
    .ledger-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
    .amount { font-weight: 800; letter-spacing: -0.01em; }
    .amount.struck { text-decoration: line-through; color: var(--color-hint); }
    .ledger-link { font-size: 0.8rem; font-weight: 700; color: var(--color-purple); }
    .badge.status-claimed { background: #f0f0f2; color: var(--color-muted); }
    .empty { margin: 0; padding: 18px; text-align: center; border-radius: 14px; background: var(--color-surface); font-size: 0.9rem; }

    .why { background: linear-gradient(160deg, #fff 0%, var(--color-purple-tint) 100%); }
    .why-points { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
    .why-points div { padding: 14px; border-radius: 14px; background: #fff; border: 1px solid var(--color-border); }
    .why-points strong { display: block; color: var(--color-purple-deep); margin-bottom: 4px; }
    .why-points span { font-size: 0.85rem; color: var(--color-muted); line-height: 1.45; }

    .faq details { border-top: 1px solid var(--color-border); padding: 4px 0; }
    .faq details:first-of-type { border-top: 0; }
    .faq summary { cursor: pointer; padding: 12px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
    .faq summary::-webkit-details-marker { display: none; }
    .faq summary::after { content: "+"; color: var(--color-purple); font-weight: 800; font-size: 1.2rem; line-height: 1; }
    .faq details[open] summary::after { content: "–"; }
    .faq summary:focus-visible { outline: 3px solid var(--color-ink); outline-offset: 2px; border-radius: 6px; }
    .faq details p { margin: 0 0 12px; font-size: 0.92rem; }

    @media (max-width: 520px) {
      .figures { grid-template-columns: 1fr 1fr; }
      .figure-ready { grid-column: 1 / -1; }
      .panel { padding: 22px 18px; }
    }
    @media (prefers-reduced-motion: reduce) {
      .confetti span { animation: none; display: none; }
      .earn-card, .thumb { transition: none; }
    }

    /* ===== Motion: page-to-page (View Transitions) and screen-to-screen ===== */
    @view-transition { navigation: auto; } /* same-origin page loads cross-fade; ignored where unsupported */
    .sidebar { view-transition-name: sidebar; }           /* the sidebar stays put between pages */
    .app > main { view-transition-name: content; }        /* the content slides */
    ::view-transition-old(content) { animation: content-out 180ms ease-in both; }
    ::view-transition-new(content) { animation: content-in 420ms cubic-bezier(0.16, 1, 0.3, 1) both; }
    ::view-transition-group(sidebar) { animation-duration: 0s; }
    @keyframes content-out { to { opacity: 0; transform: translateY(-8px) scale(0.99); } }
    @keyframes content-in { from { opacity: 0; transform: translateY(16px) scale(0.985); } }

    /* A screen animates in each time it's shown: a CSS animation restarts when display:none is lifted. */
    @keyframes screen-in { from { opacity: 0; transform: translateY(12px); } }
    main > section:not(.hidden), #r-content > section:not(.hidden) {
      animation: screen-in 380ms cubic-bezier(0.16, 1, 0.3, 1) both;
    }
    /* Rewards panels arrive one after another */
    #r-content > section:nth-child(1) { animation-delay: 0ms; }
    #r-content > section:nth-child(2) { animation-delay: 40ms; }
    #r-content > section:nth-child(3) { animation-delay: 40ms; }
    #r-content > section:nth-child(4) { animation-delay: 90ms; }
    #r-content > section:nth-child(5) { animation-delay: 140ms; }
    #r-content > section:nth-child(6) { animation-delay: 190ms; }
    #r-content > section:nth-child(7) { animation-delay: 240ms; }
    #r-content > section:nth-child(n+8) { animation-delay: 290ms; }
    /* Lists fill in row by row */
    @keyframes row-in { from { opacity: 0; transform: translateX(-6px); } }
    .ledger-row, .review-item, .history-item, .options li { animation: row-in 320ms cubic-bezier(0.16, 1, 0.3, 1) both; }
    .ledger-row:nth-child(2), .review-item:nth-child(2), .history-item:nth-child(2), .options li:nth-child(2) { animation-delay: 40ms; }
    .ledger-row:nth-child(3), .review-item:nth-child(3), .history-item:nth-child(3), .options li:nth-child(3) { animation-delay: 80ms; }
    .ledger-row:nth-child(4), .review-item:nth-child(4), .history-item:nth-child(4), .options li:nth-child(4) { animation-delay: 120ms; }
    .ledger-row:nth-child(n+5), .options li:nth-child(n+5) { animation-delay: 160ms; }
    /* The full-size viewer zooms open */
    @keyframes viewer-in { from { opacity: 0; } }
    @keyframes viewer-img-in { from { opacity: 0; transform: scale(0.94); } }
    .viewer[open] { animation: viewer-in 200ms ease-out both; }
    .viewer[open] img { animation: viewer-img-in 320ms cubic-bezier(0.16, 1, 0.3, 1) both; }
    /* The camera slides up */
    @keyframes camera-in { from { opacity: 0; transform: translateY(24px); } }
    .camera { animation: camera-in 300ms cubic-bezier(0.16, 1, 0.3, 1) both; }
    /* The sidebar arrives once, when it first appears */
    @keyframes nav-in { from { opacity: 0; transform: translateX(-12px); } }
    @media (max-width: 899px) { @keyframes nav-in { from { opacity: 0; transform: translateY(16px); } } }
    .sidebar.is-new:not(.hidden) { animation: nav-in 420ms cubic-bezier(0.16, 1, 0.3, 1) both; }

    @media (prefers-reduced-motion: reduce) {
      @view-transition { navigation: none; }
      main > section:not(.hidden), #r-content > section:not(.hidden), .ledger-row, .review-item, .history-item,
      .options li, .viewer[open], .viewer[open] img, .camera, .sidebar.is-new:not(.hidden) { animation: none; }
    }

/* "Which car is this?": native selects styled like the email field, a custom chevron, one column. */
.car-form { display: grid; gap: 16px; margin-top: 4px; }
.car-form .field { display: grid; }
.car-form .optional { font-weight: 500; color: var(--color-muted); margin-left: 4px; }
.car-form input {
  width: 100%; font: inherit; font-size: 1rem; padding: 14px 16px; border-radius: 12px;
  border: 1.5px solid var(--color-border); background: var(--color-surface); color: var(--color-ink);
  transition: border-color 150ms, box-shadow 150ms;
}
.car-form input::placeholder { color: var(--color-muted); opacity: 0.8; }
.car-form input:focus { outline: none; border-color: var(--color-purple); box-shadow: 0 0 0 4px var(--color-purple-tint); }
.car-form input:disabled { opacity: 0.55; cursor: not-allowed; }
.car-form input.is-valid {
  padding-right: 42px;
  background: var(--color-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%231a9b5b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center / 18px;
}
.car-form input[aria-invalid="true"] { border-color: var(--color-error); }
.car-form input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px rgb(214 48 49 / 0.14); }
.car-form .field-error { margin: 6px 0 0; font-size: 0.85rem; color: var(--color-error); }
.car-form button { margin-top: 4px; }
.car-form button:disabled { opacity: 0.45; cursor: not-allowed; }

/* The car question is a modal: a centred card on desktop, a sheet from the bottom on phones. */
.car-dialog {
  width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto;
  padding: 0; border: 1px solid var(--color-border); border-radius: var(--radius-card);
  background: var(--color-card); color: var(--color-ink); box-shadow: 0 24px 64px rgb(17 17 17 / 0.22);
}
.car-dialog .car-form { padding: 24px; }
.car-dialog::backdrop { background: rgb(17 17 17 / 0.38); backdrop-filter: blur(3px); }
.car-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.car-dialog h2 { font-size: 1.4rem; line-height: 1.15; margin: 0; font-weight: 800; letter-spacing: -0.03em; }
.car-dialog p { margin: 0; font-size: 0.95rem; }
.car-dialog .car-dialog-close {
  width: 36px; height: 36px; flex: none; margin: -4px -6px 0 0; padding: 8px; border-radius: 50%;
  background: transparent; color: var(--color-muted);
}
.car-dialog .car-dialog-close:hover { background: var(--color-purple-tint); color: var(--color-ink); }
.car-dialog .car-dialog-close svg { width: 20px; height: 20px; display: block; }
@keyframes car-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
@keyframes car-sheet-in { from { transform: translateY(100%); } }
@keyframes car-backdrop-in { from { opacity: 0; } }
.car-dialog[open] { animation: car-in 260ms var(--ease) both; }
.car-dialog[open]::backdrop { animation: car-backdrop-in 200ms ease-out both; }
@media (max-width: 520px) {
  .car-dialog {
    width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: var(--radius-card) var(--radius-card) 0 0;
  }
  .car-dialog .car-form { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .car-dialog[open] { animation: car-sheet-in 320ms var(--ease) both; }
}
@media (prefers-reduced-motion: reduce) {
  .car-dialog[open], .car-dialog[open]::backdrop { animation: none; }
}

/* The car being checked in, on the photo and review screens. */
.car-chip {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 6px 12px 6px 10px;
  border-radius: var(--radius-pill); background: var(--color-purple-tint); color: var(--color-purple-deep);
  font-size: 0.9rem; font-weight: 700; line-height: 1.2;
}
.car-chip svg { width: 18px; height: 18px; flex: none; }

/* Sign-in page: the three things a visitor gets, as numbered purple badges. */
.intro-steps { list-style: none; counter-reset: step; margin: 18px 0 22px; padding: 0; display: grid; gap: 10px; }
.intro-steps li {
  counter-increment: step; display: flex; align-items: center; gap: 12px;
  font-weight: 500; color: var(--color-ink-2);
}
.intro-steps li::before {
  content: counter(step); flex: none; width: 26px; height: 26px; border-radius: var(--radius-pill);
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  background: var(--color-purple-tint); color: var(--color-purple-deep);
}

/* Sign-in page: small print under the button, and the no-car path to the sample reports. */
.form-note { margin: 10px 0 0; text-align: center; font-size: 0.85rem; color: var(--color-muted); }
.sample-paths { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--color-border); font-size: 0.9rem; color: var(--color-muted); line-height: 1.5; }
.sample-paths a { color: var(--color-purple-deep); font-weight: 600; text-underline-offset: 3px; }

/* After submission: the switch from policyholder to insurer is its own tinted panel. */
.perspective { margin: 22px 0; padding: 18px 20px; border-radius: 14px; background: var(--color-purple-tint); border-left: 4px solid var(--color-purple); }
.perspective h2 { margin: 0 0 6px; font-size: 1.1rem; color: var(--color-purple-deep); }
.perspective p { margin: 0; color: var(--color-ink-2); line-height: 1.5; }
a.button-link.secondary { background: var(--color-card); color: var(--color-ink); border: 1px solid var(--color-border); }
a.button-link.secondary:hover { background: var(--color-card); border-color: var(--color-ink); }
button.text-button { background: none; color: var(--color-muted); border: 0; text-decoration: underline; text-underline-offset: 3px; }
button.text-button:hover { background: none; color: var(--color-ink); }

/* The Ownli wordmark (gradient SVG from the marketing site) wherever .brand appears. */
.brand img { display: block; height: 25px; width: auto; }
