/* Shared storefront components (docs/spec/design-system.md section 3). Colour and effect values come only
   from the design tokens inlined by the layout (src/generated/tokens.css); page packages add their own
   sheets (store.css, checkout.css, account.css, market.css) after this one. */

*,
*::before,
*::after {
    box-sizing: border-box;
}
* {
    margin: 0;
}
html {
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
}
body {
    min-height: 100vh;
    margin: 0 auto;
    max-width: 560px;
    padding-bottom: 24px;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.4 -apple-system, "SF Pro Text", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}
button {
    font: inherit;
    color: inherit;
    cursor: pointer;
    border: 0;
    background: none;
    padding: 0;
}
a {
    color: var(--act);
}
h1,
h2,
h3 {
    font-weight: 700;
    text-wrap: balance;
}
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--act);
    outline-offset: 2px;
}
::selection {
    background: color-mix(in srgb, var(--act) 24%, transparent);
}
img {
    max-width: 100%;
}

/* Type */
.tn {
    font-variant-numeric: tabular-nums;
}
.lt {
    font: 700 33px/1.1 var(--serif);
    letter-spacing: -0.01em;
}
.sub {
    color: var(--ink2);
    font-size: 15px;
    margin-top: 4px;
}
.eyebrow {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.mut {
    color: var(--ink2);
}
.small {
    font-size: 13px;
}
.xs {
    font-size: 12px;
    color: var(--ink3);
    line-height: 1.45;
}
.stat {
    font: 700 28px/1.1 var(--serif);
}

/* Layout helpers */
.pad {
    padding: 0 16px;
}
.stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.between {
    justify-content: space-between;
}
.grow {
    flex: 1;
    min-width: 0;
}

/* Card */
.card {
    background: var(--surface);
    border-radius: 22px;
    padding: 16px;
    box-shadow: var(--card);
}
.card h3 {
    font-size: 17px;
    margin-bottom: 8px;
}
.card .more,
.more {
    color: var(--act);
    font-size: 14px;
    font-weight: 600;
}

/* List row */
.rowi {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-top: 1px solid var(--line);
    width: 100%;
    text-align: left;
}
.rowi:first-of-type {
    border-top: 0;
}
.rowi .t {
    font-weight: 600;
    font-size: 15px;
}
.rowi .d {
    color: var(--ink2);
    font-size: 13px;
}

/* Pills */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 24px;
    padding: 0 9px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--fill);
    color: var(--ink2);
}
.pill.live {
    background: var(--live-soft);
    color: var(--live);
}
.pill.warn {
    background: var(--warn-soft);
    color: var(--warn);
}
.pill.act {
    background: var(--act-soft);
    color: var(--act-deep);
}
.pill i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 1.6s infinite;
}
@keyframes pulse {
    50% {
        opacity: 0.35;
    }
}

/* Buttons */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 52px;
    border-radius: 26px;
    background: var(--act);
    color: var(--act-ink);
    font-weight: 600;
    font-size: 17px;
    width: 100%;
    text-decoration: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 8px 18px -8px color-mix(in srgb, var(--act) 70%, transparent);
    transition: transform 0.35s var(--spring);
}
.btn:active {
    transform: scale(0.97);
}
.btn.ghost {
    background: var(--fill);
    color: var(--ink);
    box-shadow: none;
}
.btn.black {
    background: #000;
    color: #fff;
    font-size: 19px;
    box-shadow: none;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .btn.black {
        background: #fff;
        color: #000;
    }
}
:root[data-theme="dark"] .btn.black {
    background: #fff;
    color: #000;
}
.btn.sm {
    height: 38px;
    border-radius: 19px;
    font-size: 14px;
    width: auto;
    padding: 0 16px;
}
.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.45;
    pointer-events: none;
}

/* Chips and segmented control */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.chip {
    height: 38px;
    padding: 0 14px;
    border-radius: 19px;
    background: var(--fill);
    font-weight: 600;
    font-size: 14px;
    color: var(--ink);
}
.chip[aria-pressed="true"] {
    background: var(--ink);
    color: var(--bg);
}
.seg {
    display: flex;
    background: var(--fill);
    border-radius: 12px;
    padding: 3px;
}
.seg button {
    flex: 1;
    height: 34px;
    border-radius: 9px;
    font-weight: 600;
    font-size: 14px;
    color: var(--ink2);
}
.seg button[aria-pressed="true"] {
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
}

/* Radio rows */
.radio-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 44px;
    padding: 11px 0;
    border-top: 1px solid var(--line);
    text-align: left;
}
.radio-row:first-of-type {
    border-top: 0;
}
.radio-row .radio {
    width: 22px;
    height: 22px;
    flex: none;
    border-radius: 50%;
    border: 2px solid var(--ink3);
}
.radio-row[aria-checked="true"] .radio {
    border: 7px solid var(--act);
}
.radio-row .t {
    font-weight: 600;
    font-size: 15px;
}
.radio-row .d {
    margin-left: auto;
    color: var(--ink2);
    font-size: 13px;
}

/* Stepper */
.step {
    display: flex;
    align-items: center;
    flex: none;
    background: var(--fill);
    border-radius: 22px;
    height: 44px;
}
.step button {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    color: var(--act);
}
.step button:disabled {
    opacity: 0.35;
}
.step span {
    min-width: 26px;
    text-align: center;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Text fields */
.lab {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink2);
    margin-bottom: 6px;
}
.in {
    display: block;
    width: 100%;
    height: 46px;
    border: 0;
    border-radius: 14px;
    background: var(--fill);
    padding: 0 14px;
    font: inherit;
    font-size: 16px;
    color: var(--ink);
}
.in::placeholder {
    color: var(--ink3);
}
.in:focus-visible {
    outline: 2px solid var(--act);
    outline-offset: 1px;
}

/* Key-value rows (totals) */
.kv {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 15px;
}
.kv.tot {
    border-top: 1px solid var(--line);
    margin-top: 6px;
    padding-top: 12px;
    font-weight: 700;
    font-size: 17px;
}

/* Cover images and letter tiles */
.cover {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
    flex: none;
    background: var(--surface2);
}
.cover.tile {
    display: grid;
    place-items: center;
    background: var(--act-soft);
    color: var(--act-deep);
    font: 700 20px var(--serif);
}

/* Toast */
#toast {
    position: fixed;
    left: 20px;
    right: 20px;
    bottom: calc(24px + env(safe-area-inset-bottom));
    z-index: 40;
    max-width: 520px;
    margin: 0 auto;
    background: var(--ink);
    color: var(--bg);
    border-radius: 16px;
    padding: 13px 16px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.25s, transform 0.45s var(--spring);
}
#toast.on {
    opacity: 1;
    transform: none;
}

/* Cart bar */
#cart-bar {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: calc(24px + env(safe-area-inset-bottom));
    z-index: 30;
    max-width: 532px;
    margin: 0 auto;
    height: 56px;
    border-radius: 28px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--act);
    color: var(--act-ink);
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 12px 28px rgba(60, 20, 0, 0.3);
}
#cart-bar[hidden] {
    display: none;
}
body:has(#cart-bar:not([hidden])) #toast {
    bottom: calc(96px + env(safe-area-inset-bottom));
}

/* Page furniture */
main.legal,
main.notice {
    padding: 48px 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
main.legal h1,
main.notice h1 {
    font: 700 27px/1.1 var(--serif);
}
.site-foot {
    padding: 28px 20px 8px;
    text-align: center;
}
.site-foot nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 18px;
    font-size: 13px;
    margin-bottom: 6px;
}
.site-foot a {
    color: var(--ink2);
}

@media (prefers-reduced-motion: reduce) {
    .btn,
    #toast {
        transition: none;
    }
    .pill i {
        animation: none;
    }
}

/* Screen changes cross-fade (same-origin navigations between store, share, checkout and confirm). */
@media (prefers-reduced-motion: no-preference) {
    @view-transition {
        navigation: auto;
    }
}
