:root {
  color-scheme: light;
  --surface: #ffffff;
  --surface-soft: #f7f7f8;
  --ink: #111111;
  --muted: #5f5f63;
  --line: #d8d8dc;
  --accent: #e4002b;
  --accent-dark: #b80022;
  --success: #176b3a;
  --warning: #8a5200;
  --error: #b00020;
  --camera: #050505;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tap: 48px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--surface); color: var(--ink); }
body { min-height: 100dvh; overscroll-behavior: none; }
button, input { font: inherit; }
button, label { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:focus-visible, label:focus-visible { outline: 3px solid #002fa7; outline-offset: 3px; }
.is-hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.update-notice { position: fixed; z-index: 20; top: calc(12px + var(--safe-top)); left: 50%; width: min(calc(100% - 24px), 560px); min-height: 60px; transform: translateX(-50%); display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; padding: 10px 10px 10px 16px; border: 1px solid var(--ink); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 700; }
.update-notice::before { content: ""; position: absolute; top: -1px; bottom: -1px; left: -1px; width: 5px; background: var(--accent); }
.login-body { background: var(--surface-soft); }
.login-page { min-height: 100dvh; display: grid; place-items: center; padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom)); }
.login-card { width: min(100%, 480px); padding: clamp(24px, 8vw, 48px); border: 1px solid var(--ink); background: var(--surface); }
.login-card h1 { margin: 12px 0 20px; font-size: clamp(42px, 13vw, 68px); line-height: .92; letter-spacing: -.06em; }
.login-intro { margin: 0 0 28px; color: var(--muted); font-size: 17px; line-height: 1.5; }
.login-form { display: grid; gap: 10px; }
.login-form label { margin-top: 8px; font-size: 14px; font-weight: 700; }
.login-form input { width: 100%; min-height: 56px; padding: 12px 14px; border: 1px solid var(--ink); border-radius: 0; background: var(--surface); color: var(--ink); font-size: 18px; }
.login-form input:focus { outline: 3px solid #002fa7; outline-offset: 2px; }
.login-error { margin: 4px 0 2px; }
.settings-dialog { width: min(calc(100% - 32px), 860px); max-height: calc(100dvh - 32px - var(--safe-top) - var(--safe-bottom)); margin: auto; padding: 24px; overflow-y: auto; border: 1px solid var(--ink); border-radius: 0; background: var(--surface); color: var(--ink); }
.settings-dialog::backdrop { background: rgba(0, 0, 0, .56); }
.photo-dialog { width: min(calc(100% - 24px), 900px); max-height: calc(100dvh - 24px - var(--safe-top) - var(--safe-bottom)); margin: auto; padding: 12px; border: 1px solid var(--ink); border-radius: 0; background: var(--surface); color: var(--ink); }
.photo-dialog::backdrop { background: rgba(0, 0, 0, .72); }
.photo-dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 12px; }
.photo-dialog-heading .eyebrow { margin: 0; }
.photo-dialog img { display: block; width: 100%; max-height: calc(100dvh - 116px - var(--safe-top) - var(--safe-bottom)); object-fit: contain; background: var(--surface-soft); }
.settings-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.settings-heading .eyebrow { margin: 0 0 6px; }
.settings-heading h2 { margin: 0; font-size: 38px; letter-spacing: -.05em; }
.settings-version { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 24px 0 16px; border: 1px solid var(--line); }
.settings-version div { min-width: 0; padding: 10px 12px; }
.settings-version div + div { border-left: 1px solid var(--line); }
.settings-version dt { color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.settings-version dd { margin: 4px 0 0; overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.settings-help { min-height: 42px; margin: 10px 0 20px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.settings-section { padding: 24px 0; border-top: 1px solid var(--line); }
.settings-section h3 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.settings-section-heading p { max-width: 620px; margin: 6px 0 20px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.reference-settings-layout { display: grid; grid-template-columns: minmax(260px, .9fr) minmax(280px, 1.1fr); gap: 24px; align-items: start; }
.reference-form { display: grid; gap: 8px; }
.reference-form label { margin-top: 6px; font-size: 14px; font-weight: 700; }
.reference-form select, .reference-form input[type="file"] { width: 100%; min-height: 48px; border: 1px solid var(--ink); border-radius: 0; background: var(--surface); color: var(--ink); font: inherit; }
.reference-form select { padding: 10px 40px 10px 12px; }
.reference-form input[type="file"] { padding: 5px; font-size: 14px; }
.reference-form input[type="file"]::file-selector-button { min-height: 36px; margin-right: 10px; padding: 6px 12px; border: 1px solid var(--ink); border-radius: 0; background: var(--surface-soft); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.reference-form select:focus, .reference-form input[type="file"]:focus { outline: 3px solid #002fa7; outline-offset: 2px; }
.reference-form .button { margin-top: 8px; }
.reference-status { min-height: 42px; margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.reference-status.is-error { color: var(--error); }
.reference-preview { min-height: 320px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface-soft); overflow: hidden; }
.reference-preview img { display: block; width: 100%; height: 100%; max-height: 440px; object-fit: contain; }
.reference-preview p { margin: 0; padding: 24px; color: var(--muted); text-align: center; line-height: 1.5; }
.reference-test { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.reference-test-heading h4 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.reference-test-heading p { max-width: 660px; margin: 6px 0 18px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.reference-test-layout { display: grid; grid-template-columns: minmax(260px, .9fr) minmax(280px, 1.1fr); gap: 24px; align-items: start; }
.reference-test-result { min-height: 320px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface-soft); overflow: hidden; }
.reference-test-result[aria-busy="true"] { opacity: .65; }
.reference-test-result img { display: block; width: 100%; height: 100%; max-height: 440px; object-fit: contain; }
.reference-test-result p { margin: 0; padding: 24px; color: var(--muted); text-align: center; line-height: 1.5; }
.reference-test-result small { width: 100%; padding: 10px 12px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; }
.settings-actions { padding-bottom: 0; }
.settings-actions h3 { margin-bottom: 16px; }

.screen { display: none; min-height: 100dvh; }
.screen.is-active { display: block; }
.masthead { min-height: calc(72px + var(--safe-top)); padding: calc(16px + var(--safe-top)) 20px 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 16px; background: var(--surface); }
.masthead.sticky { position: sticky; top: 0; z-index: 5; grid-template-columns: auto 1fr auto; align-items: center; }
.masthead h1 { font-size: 20px; margin: 0; letter-spacing: -.03em; }
.workflow-head-actions { display: flex; align-items: center; gap: 12px; }
.header-cancel { min-height: 44px; padding: 8px 0; border: 0; border-bottom: 1px solid currentColor; background: transparent; color: var(--error); font-weight: 700; cursor: pointer; }
.header-cancel:disabled { opacity: .45; cursor: default; }
.brand { font-weight: 700; font-size: 21px; letter-spacing: -.04em; }
.folio, .eyebrow { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
.main-menu { display: flex; gap: 4px; align-items: center; justify-content: flex-end; }
.menu-link { min-height: var(--tap); padding: 8px 10px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ink); font-weight: 700; cursor: pointer; }
.menu-link.is-current { border-bottom-color: var(--accent); color: var(--accent-dark); }
.menu-link:active { opacity: .65; }

.home-content { padding: clamp(40px, 10vh, 104px) 20px calc(32px + var(--safe-bottom)); max-width: 720px; }
.home-content h1 { margin: 12px 0 28px; font-size: clamp(52px, 15vw, 104px); line-height: .86; letter-spacing: -.075em; font-weight: 700; }
.intro { max-width: 34rem; font-size: 18px; line-height: 1.5; margin: 0 0 32px; }
.system-message { min-height: 24px; color: var(--error); line-height: 1.4; }

.setup-screen, .details-screen { background: var(--surface-soft); }
.details-summary { position: sticky; top: calc(72px + var(--safe-top)); z-index: 4; overflow-x: auto; overscroll-behavior-x: contain; border-bottom: 1px solid var(--line); background: var(--surface); scrollbar-width: thin; }
.details-summary dl { display: flex; width: max-content; min-width: 100%; margin: 0; padding: 0 20px; }
.details-summary-item { position: relative; display: grid; align-content: center; min-height: 54px; padding: 7px 16px; border-right: 1px solid var(--line); }
.details-summary-edit { display: block; max-width: 180px; padding: 0; overflow: hidden; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.details-summary-edit::after { content: ""; position: absolute; inset: 0; }
.details-summary-item:has(.details-summary-edit:hover) { background: var(--surface-soft); }
.details-summary-item:has(.details-summary-edit:focus-visible) { outline: 3px solid #002fa7; outline-offset: -3px; }
.details-summary-edit:disabled { cursor: default; }
.details-summary-item:first-child { padding-left: 0; }
.details-summary-item dt { color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.details-summary-item dd { margin: 2px 0 0; max-width: 180px; overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.choice-page { padding: clamp(40px, 9vh, 88px) 20px 40px; max-width: 760px; margin: 0 auto; }
.choice-page h2 { margin: 12px 0 20px; max-width: 650px; font-size: clamp(42px, 12vw, 76px); line-height: .94; letter-spacing: -.06em; }
.choice-page > p:not(.eyebrow) { max-width: 34rem; margin: 0 0 32px; font-size: 17px; line-height: 1.55; }
.choice-grid { display: grid; gap: 12px; }
.choice-button { min-height: 72px; padding: 16px 20px; border: 1px solid var(--ink); background: var(--surface); color: var(--ink); text-align: left; font-size: 24px; font-weight: 700; cursor: pointer; transition: background-color 160ms ease, color 160ms ease; }
.choice-button:active, .choice-button[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.choice-button:disabled { opacity: .55; cursor: default; }

.button { min-height: var(--tap); border: 1px solid var(--ink); padding: 12px 18px; background: var(--surface); color: var(--ink); font-weight: 700; cursor: pointer; border-radius: 0; transition: background-color 160ms ease, color 160ms ease, opacity 160ms ease; }
.button:active { opacity: .72; }
.button:disabled { opacity: .42; cursor: default; }
.button-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-dark); }
.button-secondary { background: var(--surface); margin-top: 12px; }
.button-light { background: #fff; color: #111; border-color: #fff; }
.button-large { width: 100%; min-height: 60px; font-size: 17px; }
.button.compact { min-height: 48px; padding: 10px 14px; }
.icon-button { width: var(--tap); height: var(--tap); display: inline-grid; place-items: center; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.icon-button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; }
.icon-button.on-camera { background: rgba(0,0,0,.56); color: #fff; border-color: rgba(255,255,255,.5); }

.camera-screen { background: var(--camera); overflow: hidden; }
.camera-stage { position: relative; width: 100%; height: 100dvh; background: var(--camera); }
#camera-video { width: 100%; height: 100%; object-fit: contain; display: block; }
.camera-grid { position: absolute; inset: 0; pointer-events: none; opacity: .34; }
.camera-grid i { position: absolute; background: rgba(255,255,255,.48); }
.camera-grid i:nth-child(1), .camera-grid i:nth-child(2) { width: 1px; height: 100%; left: 33.333%; }
.camera-grid i:nth-child(2) { left: 66.666%; }
.camera-grid i:nth-child(3), .camera-grid i:nth-child(4) { height: 1px; width: 100%; top: 33.333%; }
.camera-grid i:nth-child(4) { top: 66.666%; }
.camera-crop-guide { position: absolute; z-index: 1; top: 50%; left: 50%; transform: translate(-50%, -50%); border: 2px solid #fff; box-shadow: 0 0 0 999px rgba(0, 0, 0, .32); pointer-events: none; }
.camera-crop-guide span { position: absolute; top: -30px; left: 50%; transform: translateX(-50%); width: max-content; color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-shadow: 0 1px 4px rgba(0,0,0,.8); text-transform: uppercase; }
.camera-topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 2; padding: calc(12px + var(--safe-top)) 16px 12px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; background: linear-gradient(rgba(0,0,0,.72), transparent); }
.camera-topbar .button { justify-self: end; }
.capture-count { color: #fff; font-size: clamp(56px, 20vw, 92px); line-height: .8; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.08em; text-shadow: 0 2px 18px rgba(0,0,0,.65); }
.camera-bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 12px 16px calc(16px + var(--safe-bottom)); background: linear-gradient(transparent, rgba(0,0,0,.82) 28%); display: grid; justify-items: center; gap: 12px; }
.filmstrip { width: 100%; min-height: 58px; display: flex; justify-content: center; gap: 8px; overflow: hidden; }
.filmstrip img { width: 54px; height: 54px; object-fit: cover; border: 1px solid #fff; }
.shutter { width: 80px; height: 80px; border-radius: 50%; border: 3px solid #fff; background: transparent; padding: 6px; cursor: pointer; }
.shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; transition: transform 90ms ease, background-color 90ms ease; }
.shutter:active span { transform: scale(.88); background: var(--accent); }
.shutter:disabled { opacity: .45; }
.camera-status { color: #fff; min-height: 20px; margin: 0; font-size: 14px; }
.camera-unavailable { position: absolute; z-index: 3; inset: 0; padding: 32px; background: var(--camera); color: #fff; display: grid; place-content: center; text-align: center; gap: 16px; }

.review-screen, .results-screen { background: var(--surface-soft); }
.review-screen { padding-bottom: calc(148px + var(--safe-bottom)); }
.results-screen { padding-bottom: calc(104px + var(--safe-bottom)); }
.review-count, .progress-total { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; }
.review-grid { padding: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 960px; margin: 0 auto; }
.photo-card { background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.photo-card img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: #e5e5e7; }
.photo-card-footer { border-top: 1px solid var(--line); padding: 10px; display: grid; gap: 10px; }
.photo-number { font-size: 30px; font-weight: 700; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.text-button { min-height: 44px; padding: 0; border: 0; border-bottom: 1px solid currentColor; background: transparent; color: var(--ink); font-weight: 700; cursor: pointer; }
.text-button.danger { color: var(--error); }
.action-bar { position: fixed; z-index: 6; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + var(--safe-bottom)); background: rgba(255,255,255,.96); border-top: 1px solid var(--line); }
.action-bar.stacked { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.review-action-bar { display: grid; gap: 8px; }
.review-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.review-actions .button { min-width: 0; padding-inline: 10px; }
.ai-cost-hint { color: var(--muted); font-size: 12px; line-height: 1.35; text-align: center; font-variant-numeric: tabular-nums; }

.ai-details-screen { background: var(--surface-soft); }
.ai-details-content { width: min(100%, 720px); margin: 0 auto; padding: clamp(28px, 6vh, 64px) 20px calc(40px + var(--safe-bottom)); }
.ai-details-content > .eyebrow { margin: 0 0 10px; }
.ai-details-content h2 { margin: 0 0 12px; font-size: clamp(38px, 10vw, 64px); line-height: .94; letter-spacing: -.055em; text-wrap: balance; }
.ai-analysis-intro { max-width: 36rem; min-height: 48px; margin: 0 0 24px; color: var(--muted); font-size: 17px; line-height: 1.5; }
.ai-analysis-loader { height: 4px; overflow: hidden; background: var(--line); }
.ai-analysis-loader span { display: block; width: 36%; height: 100%; background: var(--accent); animation: ai-progress 1.15s ease-in-out infinite alternate; }
.ai-analysis-error { display: grid; gap: 16px; padding: 20px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.ai-analysis-error p { margin: 0; color: var(--error); line-height: 1.5; }
.ai-analysis-error div { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-analysis-form { display: grid; gap: 18px; }
.ai-analysis-field { display: grid; gap: 8px; }
.ai-analysis-field > span { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 700; }
.ai-analysis-field small { color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.ai-analysis-field small[data-state="missing"] { color: var(--warning); }
.ai-analysis-field select, .ai-analysis-field input { width: 100%; min-height: 58px; padding: 12px 14px; border: 1px solid var(--ink); border-radius: 0; background: var(--surface); color: var(--ink); font: inherit; font-size: 17px; font-weight: 700; }
.ai-analysis-field input { font-variant-numeric: tabular-nums; letter-spacing: .08em; }
.ai-analysis-field select:focus, .ai-analysis-field input:focus { outline: 3px solid #002fa7; outline-offset: 2px; }
.ai-brand-picker { width: 100%; min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--ink); border-radius: 0; background: var(--surface); color: var(--ink); text-align: left; font-size: 17px; font-weight: 700; cursor: pointer; }
.ai-brand-picker svg { width: 22px; height: 22px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; }
.ai-brand-picker:focus-visible { outline: 3px solid #002fa7; outline-offset: 2px; }
.ai-brand-picker:active { border-color: var(--accent); color: var(--accent-dark); }
.ai-market-result { display: grid; gap: 12px; margin-top: 2px; padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--surface); }
.ai-market-range { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.ai-market-range span { color: var(--muted); font-size: 12px; font-weight: 700; }
.ai-market-range strong { color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; }
.ai-analysis-cost { margin: 2px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.4; font-variant-numeric: tabular-nums; }
@keyframes ai-progress { from { transform: translateX(-30%); } to { transform: translateX(210%); } }

.product-choice-page { padding-top: clamp(28px, 6vh, 64px); }
.product-choice-page h2 { text-wrap: balance; }
.choice-panel { display: grid; gap: 12px; }
.choice-search { display: grid; gap: 8px; margin-bottom: 4px; }
.choice-search-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; font-size: 14px; font-weight: 700; }
.choice-search-heading output { color: var(--accent); font-variant-numeric: tabular-nums; }
.choice-search input { width: 100%; min-height: 60px; padding: 12px 16px; border: 1px solid var(--ink); border-radius: 0; background: var(--surface); color: var(--ink); font-size: 19px; font-weight: 700; }
.choice-search input::placeholder { color: var(--muted); font-weight: 400; opacity: 1; }
.choice-search input:focus { outline: 3px solid var(--accent); outline-offset: 2px; }
.choice-empty { margin: 4px 0 0; padding: 18px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); color: var(--muted); line-height: 1.4; }
.brand-custom-choice { display: grid; gap: 12px; padding: 16px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.brand-custom-choice p { margin: 0; line-height: 1.4; }
.brand-custom-choice strong { overflow-wrap: anywhere; }
.brand-custom-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.brand-custom-actions .button { min-height: 58px; padding-inline: 12px; }
.brand-custom-status { min-height: 20px; color: var(--error); font-size: 14px; }
.product-choice-grid[data-field="brand"] .choice-button { min-height: 60px; font-size: 19px; }
.price-step { display: grid; gap: 16px; }
.price-presets { min-width: 0; margin: 0 0 8px; padding: 0; border: 0; }
.price-presets legend { margin: 0 0 10px; padding: 0; font-size: 14px; font-weight: 700; }
.price-preset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.price-preset { min-width: 0; min-height: 56px; padding: 10px 6px; border: 1px solid var(--ink); border-radius: 0; background: var(--surface); color: var(--ink); font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; }
.price-preset:active, .price-preset[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: #fff; }
.price-preset:disabled { cursor: default; }
.price-field { font-size: 14px; font-weight: 700; }
.price-field-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.price-suggestion { color: var(--accent); font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.price-input { position: relative; display: block; }
.price-input input { padding-right: 44px; }
.price-input b { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); }
.price-input-large input { width: 100%; min-height: 76px; border: 1px solid var(--ink); border-radius: 0; background: var(--surface); color: var(--ink); padding: 12px 64px 12px 16px; font-size: 32px; font-weight: 700; }
.price-input-large b { right: 20px; font-size: 24px; }
.price-input-large input:focus { outline: 3px solid #002fa7; outline-offset: 2px; }
.content-step { display: grid; gap: 10px; }
.content-field { margin-top: 6px; font-size: 14px; font-weight: 700; }
.content-field span { color: var(--muted); font-weight: 400; }
.content-step input, .content-step textarea { width: 100%; border: 1px solid var(--ink); border-radius: 0; background: var(--surface); color: var(--ink); padding: 12px 14px; font-size: 17px; line-height: 1.45; }
.content-step input { min-height: 56px; font-weight: 700; }
.content-step textarea { min-height: 148px; resize: vertical; }
.content-step input:focus, .content-step textarea:focus { outline: 3px solid #002fa7; outline-offset: 2px; }
.tag-step { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tag-step fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.tag-step legend { margin: 0 0 8px; padding: 0; font-size: 14px; font-weight: 700; }
.tag-step legend span, .purchase-price-field small { color: var(--muted); font-size: inherit; font-weight: 400; }
.tag-grid { display: grid; gap: 12px; }
.tag-choice, .collection-choice { min-height: 56px; display: block; padding: 8px 10px; border: 1px solid var(--ink); border-radius: 0; background: var(--surface); color: var(--ink); text-align: left; font-size: 18px; line-height: 1.2; font-weight: 700; cursor: pointer; }
.tag-choice span, .collection-choice span { display: none; }
.tag-choice:active, .tag-choice[aria-pressed="true"], .collection-choice:active, .collection-choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: #fff; }
.supplier-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.supplier-choice { min-height: 48px; padding: 8px 6px; border: 1px solid var(--ink); border-radius: 0; background: var(--surface); color: var(--ink); font-size: 15px; font-weight: 700; cursor: pointer; }
.supplier-choice:active, .supplier-choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: #fff; }
.supplier-choice[data-supplier="French Pick"] { border-color: #002fa7; color: #002fa7; }
.supplier-choice[data-supplier="French Pick"]:active, .supplier-choice[data-supplier="French Pick"][aria-pressed="true"] { border-color: #002fa7; background: #002fa7; color: #fff; }
.purchase-price-field { display: grid; gap: 8px; font-size: 14px; font-weight: 700; }
.purchase-price-field input { width: 100%; min-height: 52px; border: 1px solid var(--ink); border-radius: 0; background: var(--surface); color: var(--ink); padding: 10px 44px 10px 14px; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.purchase-price-field input:focus { outline: 3px solid #002fa7; outline-offset: 2px; }
.product-choice-page:has(#tags-form:not(.is-hidden)) { padding-top: 20px; padding-bottom: calc(16px + var(--safe-bottom)); }
.product-choice-page:has(#tags-form:not(.is-hidden)) > .eyebrow { display: none; }
.product-choice-page:has(#tags-form:not(.is-hidden)) h2 { margin: 0 0 12px; font-size: 36px; }
.product-choice-page:has(#tags-form:not(.is-hidden)) > #details-help { margin-bottom: 16px; font-size: 14px; line-height: 1.4; }
.tag-step > * { grid-column: 1 / -1; }
.tag-step > fieldset:nth-of-type(1) { grid-column: 1; }
.tag-step > fieldset:nth-of-type(2) { grid-column: 2; }
.tag-step > .button { min-height: 52px; }
.form-error { min-height: 24px; margin: 0; color: var(--error); line-height: 1.45; }

.progress-track { position: sticky; top: calc(72px + var(--safe-top)); z-index: 4; height: 4px; background: var(--line); }
.progress-track span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 240ms ease; }
.results-message { max-width: 760px; margin: 20px auto 0; padding: 0 16px; color: var(--muted); line-height: 1.5; }
.result-list { list-style: none; margin: 0; padding: 16px; display: grid; gap: 8px; max-width: 760px; margin-inline: auto; }
.result-row { display: grid; grid-template-columns: 64px 1fr 24px; align-items: center; gap: 14px; min-height: 80px; background: var(--surface); border: 1px solid var(--line); padding: 8px; }
.result-row img { width: 64px; height: 64px; object-fit: cover; }
.result-copy { min-width: 0; display: grid; gap: 4px; }
.result-copy strong { font-size: 16px; }
.result-copy span { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.status-mark { width: 14px; height: 14px; border: 2px solid var(--muted); border-radius: 50%; }
.result-row[data-status="processing"] .status-mark, .result-row[data-status="leased"] .status-mark, .result-row[data-status="uploading"] .status-mark { border-color: var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; }
.result-row[data-status="completed"] .status-mark { border-color: var(--success); background: var(--success); }
.result-row[data-status="error"] .status-mark { border-color: var(--error); background: var(--error); }
.products-screen { background: var(--surface-soft); }
.products-content { max-width: 880px; margin: 0 auto; padding: 32px 16px calc(40px + var(--safe-bottom)); }
.products-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px; border-bottom: 1px solid var(--ink); padding-bottom: 20px; }
.products-heading .eyebrow { margin: 0 0 8px; }
.products-heading h1 { font-size: clamp(38px, 10vw, 68px); line-height: .95; letter-spacing: -.06em; margin: 0; }
.products-heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.products-heading .button { flex-shrink: 0; }
.products-message { min-height: 24px; line-height: 1.5; color: var(--muted); margin: 16px 0; }
.products-list { display: grid; gap: 12px; }
.products-new-capture { margin-top: 20px; }
.product-card { display: grid; grid-template-columns: 104px minmax(0, 1fr); border: 1px solid var(--line); background: var(--surface); }
.product-image { min-height: 148px; background: #e5e5e7; border-right: 1px solid var(--line); }
.product-image img { display: block; width: 100%; height: 100%; max-height: 210px; object-fit: cover; }
.product-image img:not([src]) { display: none; }
.product-card-body { min-width: 0; padding: 16px; display: grid; align-content: start; gap: 8px; }
.product-card-top { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.product-card h2 { min-width: 0; font-size: 20px; line-height: 1.2; letter-spacing: -.03em; margin: 0; overflow-wrap: anywhere; }
.product-state { flex-shrink: 0; padding: 4px 6px; border: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700; }
.product-card[data-state="ready"] .product-state { border-color: var(--success); color: var(--success); }
.product-card[data-state="saved"] .product-state { border-color: var(--success); color: var(--success); }
.product-meta, .product-detail, .product-error { margin: 0; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.product-meta { color: var(--muted); }
.product-detail { color: var(--ink); }
.product-error { color: var(--error); }
.product-error:empty { display: none; }
.product-gallery { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.product-gallery-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; min-height: 28px; font-size: 14px; }
.product-gallery-heading strong { font-weight: 700; }
.product-gallery-heading span { color: var(--muted); font-size: 12px; }
.product-thumbnails { display: flex; gap: 8px; padding: 8px 0; overflow-x: auto; }
.photo-thumbnail { width: 88px; height: 100px; flex: 0 0 auto; padding: 0; border: 1px solid var(--line); background: var(--surface-soft); cursor: pointer; }
.photo-thumbnail img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-thumbnail:active { opacity: .7; }
.product-card .button { justify-self: start; margin-top: 8px; min-width: 190px; text-decoration: none; text-align: center; }
.product-card .button:disabled { color: var(--ink); background: var(--surface-soft); border-color: var(--line); }
.product-card .delete-product { justify-self: start; margin-top: 8px; color: var(--error); }
.product-card .delete-product:disabled { opacity: .42; cursor: default; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (hover: hover) and (pointer: fine) {
  .choice-button:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
  .ai-brand-picker:hover { border-color: var(--accent); color: var(--accent-dark); }
  .price-preset:hover, .tag-choice:hover, .collection-choice:hover, .supplier-choice:hover { border-color: var(--accent); background: var(--accent); color: #fff; }
  .supplier-choice[data-supplier="French Pick"]:hover { border-color: #002fa7; background: #002fa7; color: #fff; }
}

@media (min-width: 720px) {
  .home-content, .review-grid, .result-list { padding-left: 32px; padding-right: 32px; }
  .review-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-choice-grid:not([data-field="brand"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .price-preset-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .action-bar { width: min(100%, 760px); left: 50%; transform: translateX(-50%); border: 1px solid var(--line); border-bottom: 0; }
  .product-card { grid-template-columns: 160px minmax(0, 1fr); }
}
@media (max-width: 430px) {
  .brand-custom-actions { grid-template-columns: 1fr; }
  .masthead { padding-inline: 14px; gap: 8px; }
  .main-menu { gap: 0; }
  .menu-link { padding-inline: 7px; }
  .settings-dialog { padding: 20px; }
  .product-card { grid-template-columns: 88px minmax(0, 1fr); }
  .product-card-body { padding: 12px; }
  .product-card-top { display: grid; gap: 6px; }
  .product-state { justify-self: start; }
  .product-card .button { justify-self: stretch; min-width: 0; }
  .product-card .delete-product { justify-self: stretch; text-align: left; }
  .products-heading-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 359px) {
  .tag-choice, .collection-choice { font-size: 16px; }
}
@media (max-width: 700px) {
  .reference-settings-layout, .reference-test-layout { grid-template-columns: 1fr; }
  .reference-preview, .reference-test-result { min-height: 220px; }
}
@media (orientation: landscape) and (max-height: 600px) {
  .camera-bottom { grid-template-columns: 1fr auto 1fr; align-items: end; }
  .filmstrip { justify-content: flex-start; }
  .camera-status { justify-self: end; }
  .shutter { width: 68px; height: 68px; }
  .product-choice-page { max-width: none; padding: 20px 24px calc(20px + var(--safe-bottom)); display: grid; grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr); align-content: start; column-gap: 32px; }
  .product-choice-page .eyebrow { grid-column: 1; grid-row: 1; align-self: end; }
  .product-choice-page h2 { grid-column: 1; grid-row: 2; margin: 8px 0 12px; font-size: clamp(38px, 7vw, 60px); }
  #details-help, #ai-brand-help { display: none; }
  #details-choice-panel, #ai-brand-choice-panel, #content-form, #price-form, #tags-form { grid-column: 2; grid-row: 1 / span 4; }
  #product-form-error, #ai-brand-error { grid-column: 1; grid-row: 4; }
  .product-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-choice-grid .choice-button { min-height: 60px; font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

.save-status { margin: 16px 0 8px; font-size: 16px; line-height: 1.5; font-weight: 700; overflow-wrap: anywhere; }
.save-progress { margin: 12px 0 20px; padding: 12px 16px; list-style: none; border: 1px solid var(--line); background: var(--surface-soft); font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.save-progress li + li { margin-top: 8px; }
