:root { --bg: #EEF0F2; --card: #fff; --ink: #1B2430; --muted: #5B6573; --accent: #C2401A; --line: #D5DAE0; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
.top { display: flex; align-items: baseline; gap: 12px; padding: 14px 16px; }
.brand { color: var(--ink); font-weight: 700; text-decoration: none; }
.tag { color: var(--muted); font-size: 14px; }
.studio { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 0 16px 32px; max-width: 1180px; margin: 0 auto; }
@media (min-width: 860px) { .studio { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } .controls { position: sticky; top: 16px; } }
.preview { display: flex; justify-content: center; }
.sheet { position: relative; width: 100%; max-width: 560px; aspect-ratio: 210 / 297; background: #F7F3EC; box-shadow: 0 10px 30px rgba(20, 30, 45, .18); }
.sheet.drag { outline: 3px dashed var(--accent); outline-offset: -12px; }
.sheet svg { display: block; width: 100%; height: 100%; }
.empty { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 32px; }
.empty .lead { display: block; cursor: pointer; font-family: 'RP condBold', system-ui, sans-serif; font-size: 34px; letter-spacing: .02em; text-transform: uppercase; margin: 0 0 8px; }
.controls { background: var(--card); border-radius: 12px; padding: 20px; }
.controls h2 { font-size: 20px; margin: 0 0 12px; }
.field { display: block; font-weight: 600; margin: 16px 0 6px; }
fieldset.field { border: 0; padding: 0; }
fieldset.field legend { padding: 0; margin-bottom: 6px; }
fieldset.field label { font-weight: 400; margin-right: 16px; white-space: nowrap; }
.hint { font-weight: 400; color: var(--muted); font-size: 14px; }
.note { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.text { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.text:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.file { display: block; position: relative; }
.file input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file span { display: block; text-align: center; padding: 12px; border: 2px dashed var(--line); border-radius: 10px; cursor: pointer; font-weight: 600; }
.file input:focus-visible + span, .file span:hover { border-color: var(--accent); }
.error { color: #A3271F; font-size: 14px; margin: 6px 0 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches button { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.swatches button[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }
.buy { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.price { margin: 0 0 10px; }
.primary { display: inline-block; width: 100%; text-align: center; font: inherit; font-weight: 700; color: #fff; background: var(--accent); border: 0; border-radius: 8px; padding: 12px; cursor: pointer; text-decoration: none; margin-top: 8px; }
.primary:disabled { opacity: .5; cursor: progress; }
.link { font: inherit; background: none; border: 0; color: var(--accent); text-decoration: underline; cursor: pointer; padding: 0; }
.progress { color: var(--muted); font-size: 14px; min-height: 1.5em; }
.faq { max-width: 760px; margin: 0 auto; padding: 8px 16px 48px; }
.faq h2 { font-size: 20px; }
.faq details { background: var(--card); border-radius: 10px; padding: 12px 16px; margin: 8px 0; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { margin: 10px 0 0; color: var(--ink); }
.link:disabled { opacity: .5; cursor: wait; }
.layouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.layouts button { font: inherit; font-size: 14px; padding: 10px 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); cursor: pointer; }
.layouts button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); font-weight: 600; }
#zoom { width: 100%; }
.sheet.has-photo svg { touch-action: none; cursor: grab; }
.warn { color: #8a5a00; background: #fff6e0; border-radius: 8px; padding: 8px 10px; font-size: 14px; margin: 8px 0 0; }
.palettes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.palettes button { display: flex; flex-direction: column; align-items: center; gap: 4px; font: inherit; font-size: 13px; padding: 6px 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); cursor: pointer; }
.palettes button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); font-weight: 600; }
.palettes .chip { width: 100%; height: 26px; border-radius: 5px; border: 1px solid rgba(0,0,0,.08); }
.check { display: block; margin: 12px 0 0; }
.picker { max-width: 1180px; margin: 0 auto 20px; padding: 18px 16px 6px; }
.picker h1 { font-size: 28px; line-height: 1.15; margin: 0 0 6px; }
.picker .sub { margin: 0 0 4px; color: var(--muted); }
.picker #race-find, .picker .race-chosen { background: var(--card); border-radius: 12px; padding: 4px 16px 14px; margin-top: 12px; max-width: 760px; }
.picker input[type=search] { font-size: 17px; }
.race-list { max-height: 320px; overflow-y: auto; margin-top: 10px; }
.race-list .country { margin: 10px 0 4px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.race-list .race { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%; font: inherit; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 11px 4px; cursor: pointer; color: var(--ink); }
.race-list .race:hover, .race-list .race:focus-visible { background: #F6F7F8; }
.race-list .city { font-weight: 700; }
.race-list .dists { color: var(--muted); font-size: 14px; text-align: right; }
.race-chosen .chosen { display: flex; justify-content: space-between; align-items: baseline; margin: 12px 0 0; font-size: 20px; }
.race-chosen .chosen .link { font-size: 15px; }
.race-opts { display: grid; grid-template-columns: 1fr 104px; column-gap: 12px; }
.race-opts label[for=race-event] { grid-column: 1; grid-row: 1; }
.race-opts label[for=race-year] { grid-column: 2; grid-row: 1; }
.race-opts #race-event { grid-column: 1; grid-row: 2; }
.race-opts #race-year { grid-column: 2; grid-row: 2; }
.picker .hint { margin: 10px 0 0; }
.picker .hint.small { font-size: 13px; }
.own { margin: 0 0 8px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.own summary { cursor: pointer; font-weight: 600; }
.own .steps { padding-left: 20px; margin: 8px 0; font-size: 15px; }
.own .steps li { margin: 4px 0; }
.empty .lead { cursor: default; }
a { color: var(--accent); }
.empty a, .picker a, .own a, .faq a { color: var(--accent); text-decoration: underline; }
.consent { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin: 10px 0 0; }
.consent input { margin-top: 3px; }
.faq .credit { font-size: 13px; color: var(--muted); margin-top: 24px; }

.preview { position: relative; flex-direction: column; align-items: center; }
.zoom-btn { align-self: flex-end; margin: 0 0 8px; font: inherit; font-size: 14px; color: var(--accent); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
@media (min-width: 860px) { .zoom-btn { align-self: center; } }
.viewer { position: fixed; inset: 0; z-index: 50; background: #14181E; display: flex; flex-direction: column; }
.viewer-close { align-self: flex-end; margin: 12px 16px; font: inherit; font-weight: 600; color: #fff; background: none; border: 1px solid rgba(255,255,255,.5); border-radius: 999px; padding: 6px 16px; cursor: pointer; }
.viewer-scroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 0 16px 24px; }
.viewer-scroll svg { display: block; width: 200%; max-width: 1400px; height: auto; margin: 0 auto; background: #fff; }
@media (min-width: 860px) { .viewer-scroll svg { width: 100%; max-width: 900px; } }
body.viewing { overflow: hidden; }
.buybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--card); box-shadow: 0 -6px 20px rgba(20, 30, 45, .12); transition: transform .2s; }
.buybar .primary { width: auto; margin: 0; padding: 10px 16px; }
.buybar span { font-size: 14px; color: var(--muted); }
.buybar.away { transform: translateY(110%); }
@media (min-width: 860px) { .buybar { display: none; } }
body { padding-bottom: 72px; }
@media (min-width: 860px) { body { padding-bottom: 0; } }
[hidden] { display: none !important; }

/* Buy → copy key → paste and unlock, all visible in one place */
.buy-steps { padding-left: 22px; margin: 10px 0 14px; font-size: 15px; }
.buy-steps li { margin: 8px 0; }
.buy-steps li:first-child .primary { display: inline-block; width: auto; margin: 0 0 4px; }
.buy-steps li:first-child .hint { display: block; }
.restored { margin: 6px 0 0; }
.xsell { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.xsell[hidden] { display: none; }
.xsell img { flex: 0 0 64px; border-radius: 8px; }
.xsell p { margin: 0; }
.xsell-title { font-weight: 700; }
.xsell .xsell-text { color: var(--muted); font-size: 14px; margin: 2px 0 6px; }
.xsell-go { font-weight: 600; display: inline-block; min-height: 44px; line-height: 44px; }
.more-gifts { margin-top: 28px; }
.more-gifts h2 { font-size: 16px; }
.more-gifts .gift { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 10px; padding: 8px 12px; margin: 8px 0; color: var(--ink); text-decoration: none; min-height: 44px; }
.more-gifts .gift:hover span { color: var(--accent); text-decoration: underline; }
.more-gifts .gift img { flex: 0 0 56px; border-radius: 8px; }
