:root {
  color-scheme: light;
  --bg: oklch(0.985 0.006 75);
  --surface: oklch(1 0 0);
  --soft: oklch(0.965 0.01 70);
  --ink: oklch(0.24 0.02 50);
  --muted: oklch(0.5 0.02 50);
  --line: oklch(0.9 0.01 60);
  --line-strong: oklch(0.8 0.015 60);
  --brand: oklch(0.47 0.12 30);
  --brand-hover: oklch(0.41 0.12 30);
  --brand-soft: oklch(0.95 0.025 40);
  --good: oklch(0.5 0.11 150);
  --good-bg: oklch(0.96 0.035 150);
  --mid: oklch(0.55 0.12 75);
  --mid-bg: oklch(0.96 0.045 85);
  --bad: oklch(0.5 0.16 25);
  --bad-bg: oklch(0.96 0.025 25);
  --focus: oklch(0.6 0.14 30);
  --radius: 14px;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 9px; transition: background 160ms, border-color 160ms, transform 160ms; }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: 0.42; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2 { text-wrap: balance; }
p { text-wrap: pretty; }
svg { width: 20px; height: 20px; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* Header */
.header { max-width: 980px; margin: auto; padding: 0 24px; height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 680; font-size: 21px; letter-spacing: -0.6px; text-decoration: none; color: inherit; }
.privacy-button { background: none; border: 0; color: var(--good); font-size: 13px; padding: 8px 0 8px 8px; gap: 7px; }
.privacy-button svg { width: 16px; height: 16px; }
.privacy-note { position: fixed; inset: 84px 24px auto auto; max-width: 330px; margin: 0; padding: 20px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 14px; box-shadow: 0 6px 20px oklch(0.2 0 0 / 0.1); }
.privacy-note p { margin-top: 6px; color: var(--muted); }

main { max-width: 980px; margin: auto; padding: 0 24px 64px; }

/* Progress */
.progress { list-style: none; display: flex; gap: 8px; padding: 0; margin: 28px 0 34px; flex-wrap: wrap; }
.progress li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 6px 12px 6px 6px; border-radius: 99px; background: var(--soft); }
.progress li span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-strong); font-size: 11px; background: var(--surface); }
.progress li.current { color: var(--brand); font-weight: 650; background: var(--brand-soft); }
.progress li.current span, .progress li.done span { background: var(--brand); border-color: var(--brand); color: #fff; }
.progress li.done { color: var(--ink); }

/* Views */
.view h1 { font-size: 34px; line-height: 1.15; letter-spacing: -1px; font-weight: 680; outline: none; }
.lead { color: var(--muted); font-size: 16px; margin-top: 10px; max-width: 640px; }
.eyebrow { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand); margin-bottom: 6px; }
.small { font-size: 13px; color: var(--muted); margin-top: 14px; }

.primary, .secondary { min-height: 46px; padding: 11px 20px; border-radius: 10px; font-weight: 600; font-size: 15px; }
.primary { background: var(--brand); color: #fff; border: 1px solid var(--brand); }
.primary:hover:not(:disabled) { background: var(--brand-hover); }
.secondary { background: var(--surface); border: 1px solid var(--line-strong); }
.secondary:hover { background: var(--soft); }
.text-button { background: none; border: 0; padding: 4px 2px; color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.icon-button { background: none; border: 0; font-size: 22px; line-height: 1; padding: 4px 8px; }

.capture-card { margin-top: 26px; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.capture-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.tips { margin: 22px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; color: var(--muted); font-size: 14px; }
.tips li { padding-left: 22px; position: relative; }
.tips li::before { content: ""; position: absolute; left: 4px; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); opacity: 0.6; }
.tips strong { color: var(--ink); font-weight: 600; }
.manual-link { margin-top: 20px; color: var(--muted); font-size: 14px; }
.step-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

.notice { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; padding: 10px 10px 10px 16px; border-radius: 10px; background: var(--bad-bg); color: var(--bad); font-size: 14px; }

/* Point picker */
.picker { margin-top: 22px; }
.targets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.target { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 99px; padding: 6px 14px 6px 6px; font-size: 14px; font-weight: 600; min-height: 40px; }
.target em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 12px; }
.target[aria-checked="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
.target-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px dashed var(--line-strong); }
.target.done .target-swatch { border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); }
.photo-wrap { position: relative; width: fit-content; max-width: 100%; margin: auto; }
.photo { display: block; max-width: 100%; max-height: 72vh; border-radius: var(--radius); touch-action: none; cursor: crosshair; background: var(--soft); }
.loupe { position: absolute; width: 140px; height: 140px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 4px 18px oklch(0 0 0 / 0.35); transform: translate(-50%, -50%); pointer-events: none; }
.target-hint { margin-top: 10px; font-size: 14px; color: var(--muted); text-align: center; min-height: 1.5em; }

/* Season result */
.palette { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; margin-top: 24px; }
.swatch i { display: block; aspect-ratio: 1; border-radius: 10px; box-shadow: 0 0 0 1px oklch(0 0 0 / 0.08) inset; }
.swatch span { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.25; }
.cards { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; margin-top: 26px; }
.card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.card h2 { font-size: 15px; font-weight: 650; margin-bottom: 8px; }
.card p + h2 { margin-top: 18px; }
.card p { color: var(--muted); font-size: 14px; }
.trait { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); margin: 14px 0; }
.trait span:last-child { text-align: right; }
.trait-track { position: relative; height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--line), var(--line-strong)); }
.trait-track b { position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 50%; background: var(--brand); border: 3px solid #fff; box-shadow: 0 1px 4px oklch(0 0 0 / 0.3); transform: translate(-50%, -50%); }
.trait-typical { position: absolute; top: -4px; width: 2px; height: 16px; background: var(--ink); opacity: 0.35; transform: translateX(-50%); }
.reasons { margin: 16px 0 0; padding-left: 18px; font-size: 14px; display: grid; gap: 6px; }

/* Season choice */
.season-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 24px; }
.season-option { flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.season-option:hover { border-color: var(--line-strong); }
.season-option[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.season-option .strip { display: flex; width: 100%; height: 28px; border-radius: 7px; overflow: hidden; margin-bottom: 8px; }
.season-option .strip i { flex: 1; }
.season-option span { font-size: 13px; color: var(--muted); }
.season-option em { font-style: normal; font-size: 11px; font-weight: 650; color: var(--brand); margin-top: 4px; }

/* Color result */
.result { margin-top: 22px; }
.result:empty { display: none; }
.result h3 { font-size: 14px; font-weight: 650; margin: 20px 0 8px; }
.verdict { display: flex; gap: 20px; align-items: center; padding: 18px; border-radius: var(--radius); border: 1px solid; }
.verdict h2 { font-size: 26px; letter-spacing: -0.6px; }
.verdict h2 small { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.verdict p:not(.eyebrow) { font-size: 15px; margin-top: 4px; }
.verdict-main { background: var(--good-bg); border-color: color-mix(in oklch, var(--good) 35%, transparent); }
.verdict-main h2, .verdict-main .eyebrow { color: var(--good); }
.verdict-secondary { background: var(--mid-bg); border-color: color-mix(in oklch, var(--mid) 40%, transparent); }
.verdict-secondary h2, .verdict-secondary .eyebrow { color: var(--mid); }
.verdict-avoid { background: var(--bad-bg); border-color: color-mix(in oklch, var(--bad) 30%, transparent); }
.verdict-avoid h2, .verdict-avoid .eyebrow { color: var(--bad); }
.verdict-swatch { flex: 0 0 96px; height: 96px; border-radius: 12px; box-shadow: 0 0 0 3px #fff, 0 2px 8px oklch(0 0 0 / 0.15); display: flex; align-items: flex-end; justify-content: center; }
.verdict-swatch span { font-size: 10px; font-family: ui-monospace, monospace; background: oklch(1 0 0 / 0.85); padding: 1px 5px; border-radius: 4px; margin-bottom: 6px; }
.why { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.why li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.why li span { flex: 0 0 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; margin-top: 1px; }
.fit-good span { background: var(--good); }
.fit-mid span { background: var(--mid); }
.fit-bad span { background: var(--bad); }
.compare { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; }
.mini-row { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.mini-swatch { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.mini-swatch i { width: 30px; height: 30px; border-radius: 8px; box-shadow: 0 0 0 1px oklch(0 0 0 / 0.1) inset; flex-shrink: 0; }
.mini-swatch span { color: var(--muted); }

/* Camera */
.camera-dialog { width: min(720px, 100vw); max-width: 100vw; max-height: 100dvh; padding: 0; border: 0; border-radius: 16px; background: #111; color: #fff; overflow: hidden; }
.camera-dialog::backdrop { background: oklch(0 0 0 / 0.75); }
.camera-dialog video { display: block; width: 100%; max-height: 70dvh; object-fit: contain; background: #000; }
.camera-dialog video.mirrored { transform: scaleX(-1); }
.camera-hint { text-align: center; font-size: 14px; color: #ccc; padding: 10px 16px 0; }
.camera-actions { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px 18px; }
.camera-actions .secondary { background: #2a2a2a; color: #fff; border-color: #444; min-width: 92px; }
.shutter { width: 66px; height: 66px; border-radius: 50%; background: #fff; border: 5px solid #555; box-shadow: 0 0 0 3px #fff; }

@media (max-width: 720px) {
  .header { height: 64px; padding: 0 16px; }
  .privacy-button span { display: none; }
  main { padding: 0 16px 48px; }
  .progress { margin: 18px 0 24px; gap: 6px; }
  .progress li { padding: 4px; font-size: 0; }
  .progress li.current { font-size: 13px; padding-right: 12px; }
  .view h1 { font-size: 27px; }
  .capture-card { padding: 18px; }
  .capture-actions > button { flex: 1 1 100%; }
  .palette { grid-template-columns: repeat(4, 1fr); }
  .cards, .compare { grid-template-columns: 1fr; }
  .verdict { flex-direction: column; align-items: flex-start; }
  .verdict-swatch { flex: none; width: 100%; height: 72px; }
  .camera-dialog { border-radius: 0; }
}
