:root {
  --bg: #f4f2ee; --surface: #ffffff; --ink: #1b1a17; --muted: #6b675f; --line: #e3dfd7;
  --accent: #eb5a14; --accent-ink: #ffffff; --ok: #1e7b4a; --ok-bg: #e7f4ec; --err: #b3261e; --err-bg: #fbeaea;
  --warn-bg: #fff5dc; --warn: #7a5600; --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14130f; --surface: #1e1d19; --ink: #f1eee8; --muted: #a39e94; --line: #33312b;
    --ok-bg: #12301f; --err-bg: #3a1614; --warn-bg: #352a0e; --warn: #f2cf73; --ok: #6fd39c; --err: #ff8a80; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.5; }
a { color: inherit; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 35% 50%, #eb001b 0 45%, transparent 46%), radial-gradient(circle at 65% 50%, #f79e1b 0 45%, transparent 46%); }
.badge { font: 600 11px/1 var(--mono); letter-spacing: .06em; padding: 5px 8px; border-radius: 99px; background: var(--warn-bg); color: var(--warn); }
main { max-width: 1120px; margin: 0 auto; padding: 28px 16px 64px; }
h1 { font-size: 28px; letter-spacing: -.02em; margin: 0 0 6px; }
h2 { font-size: 18px; margin: 0 0 12px; }
.lede { color: var(--muted); margin: 0 0 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.grid { display: grid; gap: 16px; }
.products { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.product .art { height: 120px; border-radius: 10px; background: linear-gradient(135deg, #f3e5d8, #e9d3c0); display: grid; place-items: center; font-size: 44px; margin-bottom: 12px; }
@media (prefers-color-scheme: dark) { .product .art { background: linear-gradient(135deg, #2d2720, #3a3127); } }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.price { font-weight: 700; font-variant-numeric: tabular-nums; }
.qty { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty button { border: 0; background: transparent; color: inherit; width: 34px; height: 34px; font-size: 18px; cursor: pointer; }
.qty span { min-width: 30px; text-align: center; align-self: center; font-variant-numeric: tabular-nums; }
.btn { appearance: none; border: 0; border-radius: 10px; padding: 12px 18px; font: 600 15px/1 inherit; font-family: inherit; cursor: pointer; background: var(--accent); color: var(--accent-ink); transition: filter .15s, transform .05s; }
.btn:hover { filter: brightness(1.05); } .btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.block { width: 100%; }
.cartbar { position: sticky; bottom: 16px; margin-top: 20px; }

.checkout { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .checkout { grid-template-columns: 1fr; } }
.summary ul { list-style: none; margin: 0 0 12px; padding: 0; }
.summary li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.total { font-size: 20px; font-weight: 700; }
.meta { font: 12px/1.6 var(--mono); color: var(--muted); word-break: break-all; }

.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin: -4px 0 16px; scrollbar-width: thin; }
.tab { flex: none; border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 99px; padding: 8px 14px; font: 500 14px/1 inherit; font-family: inherit; cursor: pointer; white-space: nowrap; }
.tab[aria-selected="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.panel[hidden] { display: none; }
.panel p.hint { color: var(--muted); font-size: 14px; margin-top: 0; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.fields .full { grid-column: 1 / -1; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.input { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--surface); color: var(--ink); font: 15px var(--mono); }
.input:focus, .input:focus-within { outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); margin: 0 0 14px; font-weight: 400; }
.notice { border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; background: var(--warn-bg); color: var(--warn); }
.status { margin-top: 16px; border-radius: 10px; padding: 0; font-size: 14px; }
.status:not(:empty) { padding: 12px 14px; }
.status.info { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.status.ok { background: var(--ok-bg); color: var(--ok); }
.status.err { background: var(--err-bg); color: var(--err); }
.wallet-slot { min-height: 48px; display: flex; align-items: center; }
.wallet-slot > * { width: 100%; }
.apple-pay-button { -webkit-appearance: -apple-pay-button; -apple-pay-button-type: buy; -apple-pay-button-style: black; width: 100%; height: 48px; border: 0; border-radius: 10px; cursor: pointer; }
.c2p-box > div:empty { display: none; }
.c2p-box > div { margin-top: 12px; }
#hco-embed:empty { display: none; }
#hco-embed { margin-top: 16px; min-height: 420px; }
details.tests { margin-top: 16px; font-size: 13px; }
details.tests summary { cursor: pointer; font-weight: 600; }
details.tests table { width: 100%; border-collapse: collapse; margin-top: 8px; font: 12px var(--mono); }
details.tests td, details.tests th { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }

.modal { position: fixed; inset: 0; background: rgba(10,10,10,.55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal[hidden] { display: none; }
.modal-body { background: #fff; border-radius: var(--radius); width: min(520px, 100%); height: min(640px, 92vh); overflow: hidden; position: relative; }
.modal-body iframe { width: 100%; height: 100%; border: 0; }
#threeds-container { width: 100%; height: 100%; }
.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; vertical-align: -3px; margin-right: 8px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.result { max-width: 560px; margin: 24px auto; text-align: center; }
.result .icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 32px; margin: 0 auto 12px; }
.result.ok .icon { background: var(--ok-bg); color: var(--ok); }
.result.err .icon { background: var(--err-bg); color: var(--err); }
.kv { text-align: left; margin: 18px 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-family: var(--mono); word-break: break-all; }
