/* Hallmark · pre-emit critique: P5 H4 E4 S5 R5 V4
 * genre: modern-minimal · macrostructure: workbench · theme: Cobalt
 * contrast: pass (40–41) · tokens: pass (48) · mobile: pass (34, 49–57)
 */
:root {
  --color-paper: oklch(97% 0.008 95);
  --color-surface: oklch(100% 0 0);
  --color-ink: oklch(20% 0.015 230);
  --color-muted: oklch(49% 0.018 230);
  --color-line: oklch(88% 0.012 230);
  --color-accent: oklch(55% 0.19 250);
  --color-accent-ink: oklch(100% 0 0);
  --color-success: oklch(48% 0.14 155);
  --color-danger: oklch(55% 0.19 28);
  --color-camera: oklch(11% 0.012 230);
  --color-camera-ink: oklch(96% 0.008 230);
  --color-overlay: oklch(10% 0.01 230 / 75%);
  --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-pill: 999px;
  --shadow-button: 0 8px 24px oklch(20% 0.02 230 / 14%);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow-x: clip; background: var(--color-paper); color: var(--color-ink); font-family: var(--font-body); }
button, a { font: inherit; }
button { white-space: nowrap; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 3px; }
.shell { width: min(100%, 720px); min-height: 100dvh; margin-inline: auto; padding: 0 20px calc(28px + var(--safe-bottom)); }
.shell--camera-flow { padding-top: 0; }
.topbar { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { color: var(--color-ink); text-decoration: none; display: inline-flex; align-items: center; gap: 9px; font-weight: 720; }
.brand__mark { width: 20px; height: 16px; border: 2px solid var(--color-ink); border-radius: 5px; position: relative; }
.brand__mark::after { content: ""; position: absolute; width: 5px; height: 5px; border: 2px solid var(--color-ink); border-radius: 50%; inset: 3px auto auto 5px; }
.connection { color: var(--color-muted); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.connection span { width: 7px; height: 7px; border-radius: 50%; background: var(--color-muted); }
.connection--online span { background: var(--color-success); }
.screen { display: none; }
.screen--active { display: block; }
#loading-screen { min-height: 70dvh; place-content: center; text-align: center; color: var(--color-muted); }
#loading-screen.screen--active { display: grid; }
.ready-screen { min-height: 100dvh; place-content: center; justify-items: center; text-align: center; }
.ready-screen.screen--active { display: grid; }
.ready-screen h1 { max-width: 560px; font-size: clamp(36px, 9vw, 60px); }
.ready-screen > p { max-width: 480px; margin: 20px auto 28px; color: var(--color-muted); line-height: 1.5; }
.ready-screen .primary-action { width: auto; min-width: min(100%, 260px); }
.camera-ready-mark { width: 72px; height: 72px; margin-bottom: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--color-ink); color: var(--color-accent-ink); }
.loading-mark { width: 30px; height: 30px; margin: 0 auto 14px; border: 3px solid var(--color-line); border-top-color: var(--color-accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading-mark { animation: none; } }
.intro { padding: 58px 0 38px; }
.eyebrow { margin: 0 0 12px; color: var(--color-accent); font-size: 13px; font-weight: 740; letter-spacing: .07em; text-transform: uppercase; }
h1, h2 { min-width: 0; overflow-wrap: anywhere; font-family: var(--font-display); font-style: normal; }
h1 { margin: 0; max-width: 620px; font-size: clamp(38px, 9vw, 70px); line-height: 1.01; letter-spacing: -.045em; }
.lede { max-width: 560px; margin: 24px 0 0; color: var(--color-muted); font-size: clamp(16px, 4vw, 19px); line-height: 1.5; }
.primary-action, .secondary-action { min-height: 56px; border-radius: var(--radius-pill); border: 1px solid transparent; padding: 0 24px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 12px; font-weight: 720; transition: transform 120ms ease, background-color 120ms ease; }
.primary-action { width: 100%; background: var(--color-ink); color: var(--color-accent-ink); box-shadow: var(--shadow-button); }
.primary-action:hover { transform: translateY(-1px); }
.primary-action:active { transform: translateY(1px); }
.primary-action:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.primary-action--compact { width: auto; min-width: 190px; }
.secondary-action { background: var(--color-surface); border-color: var(--color-line); color: var(--color-ink); }
.camera-icon { width: 22px; height: 16px; border: 2px solid currentColor; border-radius: 5px; position: relative; }
.camera-icon::before { content: ""; position: absolute; width: 7px; height: 4px; border-radius: 3px 3px 0 0; background: currentColor; left: 5px; top: -6px; }
.camera-icon::after { content: ""; position: absolute; width: 5px; height: 5px; border: 2px solid currentColor; border-radius: 50%; left: 6px; top: 3px; }
.trust-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 22px 0 70px; background: var(--color-line); border: 1px solid var(--color-line); border-radius: var(--radius-md); overflow: hidden; }
.trust-row > div { background: var(--color-surface); padding: 18px; min-width: 0; }
.trust-row span { font-size: 11px; color: var(--color-accent); font-weight: 760; }
.trust-row p { margin: 12px 0 0; font-size: 13px; line-height: 1.3; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--color-line); }
.section-head h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.section-head span { min-width: 28px; height: 28px; padding-inline: 8px; display: grid; place-items: center; border-radius: var(--radius-pill); background: var(--color-ink); color: var(--color-accent-ink); font-size: 12px; }
.report-list { padding-top: 8px; }
.empty-state { padding: 30px 0; color: var(--color-muted); line-height: 1.5; }
.report-item { display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--color-line); }
.report-item img { width: 60px; height: 60px; object-fit: cover; border-radius: var(--radius-sm); background: var(--color-line); }
.report-item strong, .report-item small { display: block; }
.report-item strong { font-size: 14px; }
.report-item small { margin-top: 5px; color: var(--color-muted); }
.report-item__status { color: var(--color-success); font-size: 13px; font-weight: 700; }
.camera-screen { position: fixed; inset: 0; z-index: 10; background: var(--color-camera); color: var(--color-camera-ink); }
.camera-screen.screen--active { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.camera-head { min-height: 76px; padding: max(14px, env(safe-area-inset-top)) 18px 12px; display: flex; align-items: center; gap: 14px; }
.camera-head div { display: grid; gap: 3px; }
.camera-head span { color: var(--color-line); font-size: 12px; }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--color-muted); border-radius: 50%; background: transparent; color: var(--color-camera-ink); font-size: 28px; line-height: 1; cursor: pointer; }
.viewfinder { position: relative; overflow: hidden; background: var(--color-ink); }
.viewfinder video { width: 100%; height: 100%; display: block; object-fit: cover; }
.viewfinder__guide { position: absolute; inset: 11%; border: 1px solid var(--color-camera-ink); border-radius: var(--radius-sm); opacity: .72; }
.camera-controls { min-height: 156px; padding: 18px 20px calc(16px + var(--safe-bottom)); display: grid; place-items: center; }
.shutter { width: 74px; height: 74px; padding: 5px; border-radius: 50%; border: 2px solid var(--color-camera-ink); background: transparent; cursor: pointer; }
.shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--color-camera-ink); }
.preview-screen { padding-top: 18px; }
.preview-image-wrap { background: var(--color-ink); border-radius: var(--radius-md); overflow: hidden; aspect-ratio: 4 / 3; }
.preview-image-wrap img { width: 100%; height: 100%; display: block; object-fit: contain; }
.preview-copy { padding: 26px 0; }
.preview-copy h1, .success-screen h1, .error-screen h1 { font-size: clamp(34px, 8vw, 52px); }
.preview-copy > p:last-child, .success-screen > p, .error-screen > p { color: var(--color-muted); line-height: 1.5; }
.preview-actions { display: flex; justify-content: flex-end; gap: 10px; }
.success-screen, .error-screen { min-height: 75dvh; place-content: center; text-align: center; }
.success-screen.screen--active, .error-screen.screen--active { display: grid; justify-items: center; }
.success-mark, .error-mark { width: 72px; height: 72px; margin-bottom: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--color-accent-ink); font-size: 34px; font-weight: 800; }
.success-mark { background: var(--color-success); }
.error-mark { background: var(--color-danger); }
.success-screen .primary-action, .error-screen .secondary-action { margin-top: 24px; }

@media (max-width: 500px) {
  .shell { padding-inline: 16px; }
  .connection { font-size: 0; }
  .connection span { width: 8px; height: 8px; }
  .intro { padding-top: 42px; }
  .trust-row > div { padding: 14px 10px; }
  .trust-row p { font-size: 11px; }
  .report-item { grid-template-columns: 52px minmax(0, 1fr); }
  .report-item img { width: 52px; height: 52px; }
  .report-item__status { grid-column: 2; }
  .preview-actions { flex-direction: column-reverse; }
  .preview-actions > button { width: 100%; }
  .camera-controls { grid-template-columns: minmax(0, 1fr) 74px; }
}
