:root {
    color-scheme: light;
    --bg: #F4F3F1;
    --surface: #FFFFFF;
    --ink: #1B1916;
    --ink-2: #3F3B36;
    --muted: #8C857B;
    --line: #E3E1DD;
    --line-soft: #EDEBE6;
    --accent: #2A2826;
    --accent-ink: #0F0E0D;
    --accent-bg: #EFEEEC;
    --danger: #A65A4A;
    --warn: #B89466;
    --warn-bg: rgba(184, 148, 102, 0.15);
    --warn-ink: #7A5C2E;

    --font-ui: 'Geist', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-serif: 'Instrument Serif', 'Cormorant Garamond', serif;
    --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    --fs-display: 46px;
    --fs-h1: 30px;
    --fs-h2: 22px;
    --fs-body: 15px;
    --fs-small: 13px;
    --fs-xs: 11.5px;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 18px 50px rgba(0,0,0,0.18);

    --nav-w: 220px;
    --tabbar-h: 64px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-ui);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body { min-height: 100vh; }

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

button { cursor: pointer; }

a { color: inherit; text-decoration: none; }

img { display: block; max-width: 100%; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

.hidden { display: none !important; }
.tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.ink-2 { color: var(--ink-2); }

/* ─── Typography ──────────────────────────────────────────────── */
h1, h2, h3 {
    font-family: var(--font-serif);
    font-weight: 400;
    letter-spacing: -0.5px;
    margin: 0;
}

.heading-display {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: var(--fs-display);
    line-height: 1.02;
    letter-spacing: -1.2px;
}
.heading-h1 {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: var(--fs-h1);
    line-height: 1.05;
    letter-spacing: -0.6px;
}
.heading-h2 {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: var(--fs-h2);
    line-height: 1.15;
    letter-spacing: -0.4px;
}
.label-tiny {
    font-size: var(--fs-xs);
    color: var(--muted);
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

/* ─── Buttons ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 11px 18px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: var(--fs-body);
    font-weight: 500;
    line-height: 1;
    transition: opacity 0.15s, background-color 0.15s;
}
.btn:disabled { cursor: wait; opacity: 0.55; }
.btn-primary {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
}
.btn-primary:hover { opacity: 0.92; }
.btn-secondary {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--line);
}
.btn-secondary:hover { background: var(--accent-bg); }
.btn-ghost {
    background: transparent;
    color: var(--ink-2);
    border: none;
    padding: 8px 12px;
    min-height: 36px;
}
.btn-ghost:hover { color: var(--ink); }
.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--line);
}
.btn-pill {
    border-radius: var(--radius-pill);
    padding: 10px 18px;
}
.btn-block { width: 100%; }
.btn-icon {
    position: relative;
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--ink);
    border: none;
    display: inline-grid;
    place-items: center;
}

.notification-button {
    position: relative;
}

.notification-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d64b3c;
    box-shadow: 0 0 0 2px var(--surface);
}

.notice-panel {
    display: block;
    padding: 14px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--accent-bg);
}

.notice-panel strong,
.notice-panel span {
    display: block;
}

.notice-panel strong {
    font-size: 14px;
    color: var(--ink);
    margin-bottom: 4px;
}

.notice-panel span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.notice-panel.is-ok {
    border-color: rgba(74, 130, 92, 0.35);
    background: rgba(74, 130, 92, 0.08);
}

.notification-list {
    display: grid;
    gap: 8px;
}

.notification-row {
    width: 100%;
    text-align: left;
    display: grid;
    gap: 3px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 12px;
    cursor: pointer;
}

.notification-row:hover {
    border-color: var(--ink);
}

.notification-title {
    font-weight: 600;
    color: var(--ink);
}

.notification-body,
.notification-time {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}
.btn-icon:hover { background: var(--accent-bg); }
.btn-icon-bordered {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
}

/* ─── Pills ───────────────────────────────────────────────────── */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}
.pill-paid { background: var(--accent-bg); color: var(--accent-ink); }
.pill-pending { background: var(--warn-bg); color: var(--warn-ink); }
.pill-failed { background: rgba(166,90,74,0.14); color: #7A3D30; }
.pill-active::before, .pill-queued::before, .pill-hidden::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.pill-active { color: var(--accent); }
.pill-queued { color: var(--warn); }
.pill-hidden { color: var(--muted); }

/* ─── Cards & inputs ─────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}
.card-pad { padding: 18px; }
.card-pad-sm { padding: 14px; }

.field {
    display: grid;
    gap: 6px;
}
.field-label {
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.input, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], textarea, select {
    width: 100%;
    min-height: 44px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    font: inherit;
}
.input:focus, input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--ink);
}
textarea { min-height: 80px; resize: vertical; }

.input-with-icon {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.input-with-icon input {
    flex: 1;
    min-height: auto;
    padding: 0;
    border: none;
    background: transparent;
}
.input-with-icon input:focus { outline: none; }
.input-with-icon .icon { color: var(--muted); display: inline-flex; }

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}
.check-row input { width: 18px; min-height: 18px; flex-shrink: 0; }

/* ─── Toggle switch ───────────────────────────────────────────── */
.toggle {
    width: 44px;
    height: 26px;
    border-radius: var(--radius-pill);
    padding: 3px;
    background: #D8D2C6;
    display: inline-flex;
    align-items: center;
    transition: background 0.15s;
    cursor: pointer;
    border: none;
}
.toggle-knob {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    transition: transform 0.15s;
}
.toggle.on { background: var(--accent); }
.toggle.on .toggle-knob { transform: translateX(18px); }

/* ─── Stack utility ───────────────────────────────────────────── */
.stack { display: grid; gap: 12px; }
.stack-lg { display: grid; gap: 20px; }
.row { display: flex; gap: 10px; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.row-end { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }

/* ─── Public top bar ──────────────────────────────────────────── */
.public-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(244, 243, 241, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-family: var(--font-serif);
    font-size: 22px;
    letter-spacing: -0.4px;
    line-height: 1;
}
.cart-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--ink);
    color: var(--bg);
    font-size: 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}

/* ─── Public shell layout ─────────────────────────────────────── */
.public-shell {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 24px 20px 96px;
}
.hero {
    margin-bottom: 28px;
}
.hero h1 { margin-bottom: 14px; }
.hero p { color: var(--ink-2); max-width: 480px; margin: 0; line-height: 1.5; font-size: 15px; }

.gallery-availability {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 9px 12px;
    border-radius: 999px;
    background: var(--accent-bg);
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
}
.gallery-availability span {
    color: var(--muted);
    text-transform: uppercase;
}
.gallery-availability strong {
    color: var(--ink);
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.section-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 28px 0 12px;
}
.section-label h2 { font-family: var(--font-serif); font-weight: 400; font-size: var(--fs-h2); margin: 0; }
.section-label .meta { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }

/* ─── Gallery cards (home) ────────────────────────────────────── */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.gallery-card {
    position: relative;
    aspect-ratio: 3 / 2;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: none;
    padding: 0;
    background: var(--line);
    cursor: pointer;
}
.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    -webkit-user-drag: none;
    user-select: none;
}
.gallery-card-empty {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #c8c4be 0%, #5e5a55 100%);
}
.gallery-card .gallery-meta {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px 14px;
    background: linear-gradient(180deg, transparent 35%, rgba(20,18,16,0.7) 100%);
    color: #fff;
    text-align: left;
}
.gallery-card .gallery-meta strong {
    display: block;
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 20px;
    line-height: 1.1;
    letter-spacing: -0.3px;
}
.gallery-card .gallery-meta small {
    font-size: 11.5px;
    opacity: 0.85;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

/* ─── Photo grid (home featured) ──────────────────────────────── */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.photo-card {
    position: relative;
    aspect-ratio: 3 / 2;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: zoom-in;
    background: var(--line-soft);
}
.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    -webkit-user-drag: none;
    user-select: none;
}
.photo-card .price-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 9px;
    border-radius: var(--radius-pill);
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(8px);
    color: var(--ink);
    font-size: 11.5px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}
.photo-card .add-button {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.96);
    color: var(--ink);
    border: none;
    display: inline-grid;
    place-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.photo-card .add-button.in-cart {
    background: var(--accent);
    color: #fff;
}
.photo-card .like-button {
    position: absolute;
    bottom: 8px;
    left: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.96);
    color: var(--ink);
    border: none;
    display: inline-grid;
    place-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.photo-card .like-button.is-liked {
    background: #fff;
    color: #A6424A;
}
.photo-card .like-button.is-liked svg {
    fill: currentColor;
    stroke: currentColor;
}

/* ─── Dense grid (gallery view) ───────────────────────────────── */
.photo-grid-dense {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 0 4px;
}
.photo-grid-col {
    display: grid;
    gap: 4px;
    align-content: start;
}
.photo-grid-dense .photo-thumb {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    cursor: zoom-in;
    background: var(--line-soft);
}
.photo-grid-dense .photo-thumb img {
    width: 100%;
    height: auto;
    display: block;
    -webkit-user-drag: none;
    user-select: none;
}
.grid-sentinel {
    height: 60px;
    pointer-events: none;
}
.photo-grid-dense .photo-thumb.in-cart::after {
    content: '';
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 0 3px var(--accent);
    border-radius: 4px;
    pointer-events: none;
}
.photo-grid-dense .photo-thumb .check-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.photo-grid-dense .photo-thumb .thumb-like {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,0.94);
    color: var(--ink);
    border: none;
    display: grid;
    place-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.photo-grid-dense .photo-thumb .thumb-like.is-liked {
    color: #A6424A;
}
.photo-grid-dense .photo-thumb .thumb-like.is-liked svg {
    fill: currentColor;
    stroke: currentColor;
}

/* ─── Gallery view: chips ─────────────────────────────────────── */
.chip-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 20px 12px;
    scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
    flex: 0 0 auto;
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
    font-family: var(--font-ui);
}
.chip.active {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
}

.gallery-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 14px;
}
.gallery-pager + .photo-grid-dense {
    margin-top: 2px;
}
.photo-grid-dense + .gallery-pager {
    margin-top: 18px;
    margin-bottom: 24px;
}
.gallery-pager .btn {
    min-height: 40px;
    padding: 0 14px;
}
.gallery-pager-status {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-align: center;
}

@media (max-width: 520px) {
    .gallery-pager {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .gallery-pager-status {
        grid-column: 1 / -1;
        grid-row: 1;
        margin-bottom: 2px;
    }
}

/* ─── Floating pill cart CTA ──────────────────────────────────── */
.cart-pill {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: 18px;
    z-index: 25;
    background: var(--ink);
    color: var(--bg);
    border-radius: var(--radius-pill);
    padding: 10px 8px 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 30px rgba(20,18,16,0.25);
    transform: translateY(150%);
    transition: transform 0.2s ease;
    border: none;
    font-family: var(--font-ui);
    text-align: left;
}
.cart-pill.visible { transform: translateY(0); }
.cart-pill .cart-meta-label {
    font-size: 10.5px;
    opacity: 0.6;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}
.cart-pill .cart-total {
    font-size: 16px;
    font-weight: 500;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}
.cart-pill .cart-cta {
    background: var(--bg);
    color: var(--ink);
    padding: 10px 16px;
    border-radius: var(--radius-pill);
    font-size: 13.5px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
}

/* ─── Bottom sheet (cart) ─────────────────────────────────────── */
.scrim {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(20,18,16,0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.scrim.open { opacity: 1; pointer-events: auto; }

.sheet {
    position: fixed;
    z-index: 50;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    transition: transform 0.25s cubic-bezier(0.32, 0.72, 0.2, 1);
}

.sheet-bottom {
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 92vh;
    border-top-left-radius: var(--radius-xl);
    border-top-right-radius: var(--radius-xl);
    transform: translateY(100%);
}
.sheet-bottom.open { transform: translateY(0); }

.sheet-handle {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--line);
    margin: 10px auto 0;
}

.sheet-head {
    padding: 6px 20px 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 4px 20px 12px;
}
.sheet-foot {
    padding: 14px 20px 28px;
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.cart-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid var(--line-soft);
}
.cart-item:first-child { border-top: none; }
.cart-item .thumb {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--line-soft);
    flex-shrink: 0;
}
button.cart-item .thumb,
.cart-item button.thumb {
    border: none;
    padding: 0;
    cursor: zoom-in;
}
.cart-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item .info { flex: 1; min-width: 0; }
.cart-item .info .name {
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cart-item .info .gallery {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}
.cart-item .price {
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}
.like-item .like-cart-btn {
    min-height: 38px;
    padding: 0 12px;
    gap: 6px;
    flex-shrink: 0;
}
#cartEmailBlock.needs-attention .input-with-icon {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(166, 90, 74, 0.16);
}

.checkout-consent {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 10px;
    align-items: start;
    margin: 0 0 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink-2);
    font-size: 12px;
    line-height: 1.4;
}

.checkout-consent input {
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: var(--ink);
}

.checkout-consent a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.checkout-consent.needs-attention {
    border-color: var(--danger);
    box-shadow: 0 0 0 2px rgba(166, 90, 74, 0.08);
}

.buyer-fields-block {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease-out;
}
.buyer-fields-block.is-open {
    max-height: 600px;
}
.buyer-fields-block input[type="text"] {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font-size: 14px;
    box-sizing: border-box;
}
.buyer-fields-block input[type="text"]:focus {
    outline: none;
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(27, 25, 22, 0.08);
}
.buyer-fields-block input.needs-attention {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(166, 90, 74, 0.16);
}

/* ─── Preview (lightbox) ──────────────────────────────────────── */
.preview-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    flex-direction: column;
    background: #0E0D0B;
    color: #fff;
}
.preview-modal.open { display: flex; }
.preview-head {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(env(safe-area-inset-top, 0px) + 6px) 8px 8px;
    color: #fff;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5), rgba(0,0,0,0));
}
.preview-head-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.preview-head-actions .btn-icon.is-liked {
    background: rgba(255,255,255,0.92);
    color: #A6424A !important;
}
.preview-head-actions .btn-icon.is-liked svg {
    fill: currentColor;
    stroke: currentColor;
}
.preview-head .preview-counter {
    font-size: 13px;
    opacity: 0.7;
    font-variant-numeric: tabular-nums;
}
.preview-body {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 6px calc(env(safe-area-inset-bottom, 0px) + 70px);
    min-height: 0;
}
.preview-body img {
    width: calc(100vw - 12px);
    height: calc(100vh - 86px);
    height: calc(100dvh - 86px);
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    -webkit-user-drag: none;
    user-select: none;
    border-radius: 6px;
}
.preview-body .nav-button {
    position: absolute;
    top: 50%;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(6px);
    color: #fff;
    border: none;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
}
.preview-body .nav-prev { left: 8px; }
.preview-body .nav-next { right: 8px; }
.preview-foot {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 8px 10px calc(env(safe-area-inset-bottom, 0px) + 8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #fff;
    text-align: center;
    background: linear-gradient(to top, rgba(0,0,0,0.62), rgba(0,0,0,0));
}
.preview-foot > div {
    max-width: 100%;
    min-width: 0;
}
.preview-foot .name {
    font-family: var(--font-serif);
    font-size: 20px;
    letter-spacing: -0.3px;
    max-width: calc(100vw - 40px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.preview-foot .meta {
    font-size: 12.5px;
    opacity: 0.6;
    margin-top: 2px;
}
.preview-foot .preview-description {
    max-width: min(560px, calc(100vw - 40px));
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.4;
    opacity: 0.72;
}
.preview-actions {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 6px;
    width: 100%;
    max-width: 520px;
}
.preview-foot .add-cta,
.preview-foot .preview-like-cta {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 9px 12px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    min-height: 40px;
    box-shadow: 0 10px 28px rgba(124, 77, 48, 0.36), 0 1px 2px rgba(0,0,0,0.24);
    white-space: nowrap;
    justify-content: center;
    flex: 0 1 auto;
    min-width: 0;
}
.preview-foot .preview-like-cta,
.preview-foot > div:first-child {
    display: none;
}
.preview-foot .preview-like-cta {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.24);
    box-shadow: none;
}
.preview-foot .preview-like-cta.is-liked {
    background: #fff;
    color: #A6424A;
}
.preview-foot .preview-like-cta.is-liked svg {
    fill: currentColor;
    stroke: currentColor;
}
.preview-foot .preview-cart-cta {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.24);
    padding: 9px 12px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    min-height: 40px;
    white-space: nowrap;
    justify-content: center;
    flex: 1 1 auto;
    min-width: 0;
}

.preview-foot .preview-cart-cta svg,
.preview-foot .add-cta svg,
.preview-foot .preview-like-cta svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
}
.preview-foot .preview-cart-cta[hidden] {
    display: none;
}
.preview-foot .add-cta[hidden] {
    display: none;
}
.preview-foot .add-cta.in-cart {
    background: #fff;
    color: #1B1916;
    box-shadow: 0 12px 30px rgba(0,0,0,0.28);
}
.preview-foot .add-cta.in-cart svg {
    color: currentColor;
}

@media (min-width: 720px) {
    .preview-head {
        position: static;
        padding: 12px 14px;
        background: none;
    }
    .preview-body {
        padding: 4px 14px;
    }
    .preview-body img {
        width: calc(100vw - 28px);
        height: calc(100vh - 156px);
        height: calc(100dvh - 156px);
    }
    .preview-foot {
        position: static;
        padding: 18px 32px 26px;
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
        gap: 10px;
        background: none;
    }
    .preview-foot > div:first-child {
        display: block;
    }
    .preview-foot .name {
        max-width: min(52vw, 680px);
        font-size: 22px;
    }
    .preview-foot .add-cta {
        padding: 15px 28px;
        min-width: 220px;
        justify-content: center;
    }
    .preview-foot .preview-cart-cta,
    .preview-foot .add-cta,
    .preview-foot .preview-like-cta {
        font-size: 15px;
        min-height: 50px;
        gap: 8px;
    }
    .preview-foot .preview-cart-cta svg,
    .preview-foot .add-cta svg,
    .preview-foot .preview-like-cta svg {
        width: 18px;
        height: 18px;
        flex-basis: 18px;
    }
    .preview-foot .preview-like-cta {
        display: inline-flex;
    }
    .preview-actions {
        flex-wrap: wrap;
        width: auto;
        justify-content: flex-end;
        gap: 8px;
    }
}

/* ─── Success page ────────────────────────────────────────────── */
.success-wrap {
    width: min(520px, 100%);
    margin: 6vh auto 0;
    padding: 20px;
}
.success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent-bg);
    color: var(--accent);
    display: grid;
    place-items: center;
    margin: 0 0 22px;
}
.success-icon svg { width: 32px; height: 32px; }
.success-detail {
    margin-top: 24px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    display: grid;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
}
.success-detail .row-between { color: var(--muted); }
.success-detail .row-between strong { color: var(--ink); font-weight: 500; }

/* ─── Admin shell layout ──────────────────────────────────────── */
.admin-wrap {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: var(--nav-w);
    flex-shrink: 0;
    border-right: 1px solid var(--line);
    background: var(--surface);
    padding: 20px 14px;
    display: none;
    flex-direction: column;
}
.sidebar .brand-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    padding: 4px 10px 22px;
}
.sidebar .brand-row .brand-label {
    margin-left: auto;
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--ink-2);
    font-size: 13.5px;
    font-weight: 400;
    margin-bottom: 2px;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: var(--font-ui);
}
.nav-item:hover { background: var(--bg); }
.nav-item.active {
    background: var(--bg);
    color: var(--ink);
    font-weight: 500;
}
.nav-item .nav-icon { color: var(--muted); display: inline-flex; flex-shrink: 0; }
.nav-item.active .nav-icon { color: var(--ink); }
.nav-item .nav-label { flex: 1; }
.nav-item .nav-count {
    font-size: 11px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.nav-item .nav-badge {
    background: var(--ink);
    color: var(--bg);
    font-size: 10px;
    font-weight: 600;
    border-radius: var(--radius-pill);
    padding: 2px 7px;
    min-width: 20px;
    text-align: center;
}
.sidebar-user {
    margin-top: auto;
    padding: 10px;
    border-radius: var(--radius);
    background: var(--bg);
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-user .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--bg);
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 500;
}
.sidebar-user .who { flex: 1; min-width: 0; }
.sidebar-user .who .name {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-user .who .email {
    font-size: 10.5px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-main {
    flex: 1;
    min-width: 0;
    overflow-x: hidden;
    padding-bottom: var(--tabbar-h);
}

/* ─── Admin tab bar (mobile) ──────────────────────────────────── */
.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    justify-content: space-around;
    padding: 8px 4px calc(env(safe-area-inset-bottom, 0) + 10px);
    border-top: 1px solid var(--line);
    background: var(--surface);
}
.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 4px;
    min-width: 56px;
    color: var(--muted);
    background: none;
    border: none;
    font-family: var(--font-ui);
}
.tab-item .tab-icon {
    width: 36px;
    height: 22px;
    border-radius: var(--radius-pill);
    display: grid;
    place-items: center;
    color: inherit;
}
.tab-item.active { color: var(--ink); }
.tab-item.active .tab-icon { background: var(--accent-bg); color: var(--accent-ink); }
.tab-item span { font-size: 10.5px; }

/* ─── Admin views (mobile-first padding) ──────────────────────── */
.admin-view {
    padding: 24px 20px 12px;
}
.admin-view-pad-bottom { padding-bottom: 32px; }

.admin-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}
.admin-header .sub {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 6px;
}
.admin-header .label-tiny { margin-bottom: 4px; }

/* ─── Dashboard hero ──────────────────────────────────────────── */
.hero-stat {
    padding: 22px;
    border-radius: var(--radius-lg);
    background: var(--ink);
    color: var(--bg);
    position: relative;
    overflow: hidden;
}
.hero-stat .blob {
    position: absolute;
    right: -40px;
    top: -40px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.35;
    filter: blur(28px);
}
.hero-stat .hero-label {
    position: relative;
    font-size: 11.5px;
    opacity: 0.6;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}
.hero-stat .hero-value {
    position: relative;
    margin-top: 8px;
    font-family: var(--font-serif);
    font-size: 44px;
    letter-spacing: -1px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.hero-stat .hero-delta {
    position: relative;
    margin-top: 10px;
    font-size: 12.5px;
    opacity: 0.78;
}
.hero-stat .hero-delta .up { color: #B6D4BA; }
.hero-stat .hero-delta .down { color: #E0A095; }

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
}
.stat-tile {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 14px;
}
.stat-tile .tile-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 11.5px;
    margin-bottom: 10px;
}
.stat-tile .tile-value {
    font-family: var(--font-serif);
    font-size: 26px;
    letter-spacing: -0.5px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

/* ─── Charts ──────────────────────────────────────────────────── */
.chart-card { margin-top: 14px; padding: 18px; }
.chart-card .chart-legend {
    display: flex;
    gap: 12px;
    font-size: 11.5px;
    color: var(--muted);
}
.chart-card .legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.legend-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.bar-chart {
    margin-top: 18px;
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 140px;
}
.bar-chart .bar-day { flex: 1; display: flex; align-items: flex-end; gap: 2px; height: 100%; }
.bar-chart .bar-prev { flex: 1; background: var(--line); border-radius: 1px; min-height: 1px; }
.bar-chart .bar-curr { flex: 1; background: var(--ink); border-radius: 1px; min-height: 1px; }
.bar-chart .bar-visitor { flex: 1; background: var(--accent); border-radius: 1px; min-height: 1px; }

/* ─── List/cards (orders, photos) ─────────────────────────────── */
.list-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.list-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-top: 1px solid var(--line-soft);
    cursor: pointer;
}
.list-row:first-child { border-top: none; }
.list-row .name {
    font-size: 13.5px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.list-row .secondary {
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 2px;
}

/* ─── Order card (mobile) ─────────────────────────────────────── */
.order-card {
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    margin-bottom: 8px;
    cursor: pointer;
}
.order-card .top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.order-card .top .email { font-size: 14px; font-weight: 500; }
.order-card .top .ref-time {
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 2px;
}
.order-card .top .amount {
    font-family: var(--font-serif);
    font-size: 22px;
    letter-spacing: -0.3px;
}
.order-card .bottom {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--muted);
}

/* ─── Settings groups ─────────────────────────────────────────── */
.settings-group { margin-top: 16px; }
.settings-group .group-label {
    font-size: 11.5px;
    color: var(--muted);
    letter-spacing: 0.6px;
    text-transform: uppercase;
    margin-bottom: 8px;
    padding-left: 4px;
}
.settings-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.settings-row {
    padding: 13px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid var(--line-soft);
}
.settings-row:first-child { border-top: none; }
.settings-row .label { font-size: 14px; }
.settings-row .value {
    font-size: 13.5px;
    color: var(--ink-2);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.settings-row .value.mono { font-family: var(--font-mono); }
.settings-row .value.muted { color: var(--muted); }

.settings-input-row {
    cursor: text;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding-top: 12px;
    padding-bottom: 12px;
}
.settings-input-row .label {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}
.settings-input-row .value {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    display: block;
}
.settings-input-row input {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    background: var(--line-soft);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px 12px;
    text-align: left;
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 14px;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.settings-input-row input.mono {
    font-family: var(--font-mono);
    font-size: 13px;
}
.settings-input-row input.input-narrow {
    width: 110px;
    max-width: 110px;
}
.settings-input-row input::placeholder { color: var(--muted); }
.settings-input-row:hover input:not(:focus) { background: var(--accent-bg); }
.settings-input-row input:focus {
    outline: none;
    background: var(--surface);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(42, 40, 38, 0.08);
}
.settings-select {
    width: 100%;
    min-height: 38px;
    background: var(--line-soft);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 7px 32px 7px 12px;
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--ink);
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%238C857B' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 11px center;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.settings-select:hover { background-color: var(--accent-bg); }
.settings-select:focus {
    outline: none;
    background-color: var(--surface);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(42, 40, 38, 0.08);
}

/* ─── Mode switch (TEST/LIVE) ─────────────────────────────────── */
.mode-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 6px;
    background: var(--line-soft);
    border-radius: 12px;
    border: 1px solid var(--line);
}
.mode-btn {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    padding: 14px 10px;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-family: inherit;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.mode-btn:hover { color: var(--ink-2); background: rgba(255, 255, 255, 0.45); }
.mode-btn .mode-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.35;
    margin-bottom: 2px;
}
.mode-btn .mode-name {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.8px;
}
.mode-btn .mode-desc {
    font-size: 11.5px;
    line-height: 1.3;
    font-weight: 400;
    color: var(--muted);
}
.mode-switch[data-mode="test"] .mode-test,
.mode-switch[data-mode="live"] .mode-live {
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 1px 0 rgba(0, 0, 0, 0.04);
}
.mode-switch[data-mode="test"] .mode-test {
    color: var(--warn-ink);
    border-color: rgba(184, 148, 102, 0.4);
}
.mode-switch[data-mode="test"] .mode-test .mode-dot {
    background: var(--warn);
    opacity: 1;
    box-shadow: 0 0 0 3px var(--warn-bg);
}
.mode-switch[data-mode="test"] .mode-test .mode-desc { color: var(--ink-2); }
.mode-switch[data-mode="live"] .mode-live {
    color: #1F6D3A;
    border-color: rgba(31, 109, 58, 0.35);
}
.mode-switch[data-mode="live"] .mode-live .mode-dot {
    background: #2E9D58;
    opacity: 1;
    box-shadow: 0 0 0 3px rgba(46, 157, 88, 0.18);
}
.mode-switch[data-mode="live"] .mode-live .mode-desc { color: var(--ink-2); }

/* ─── Upload progress ─────────────────────────────────────────── */

.drop-zone {
    margin-top: 12px;
    padding: 32px 20px;
    text-align: center;
    border: 1.5px dashed var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--ink-2);
}
.drop-zone.dragover { border-color: var(--ink); background: var(--accent-bg); }
.drop-zone .icon-circle {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: var(--accent-bg);
    color: var(--accent-ink);
    display: grid;
    place-items: center;
}
.drop-zone .drop-title { font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.drop-zone .drop-sub { font-size: 12.5px; color: var(--muted); max-width: 280px; margin: 0 auto; }
.drop-zone input[type="file"] { display: none; }

.progress-bar {
    margin-top: 8px;
    height: 6px;
    border-radius: 4px;
    background: var(--line-soft);
    overflow: hidden;
}
.progress-bar > div {
    width: 0;
    height: 100%;
    background: var(--accent);
    transition: width 0.2s ease;
    border-radius: 4px;
}
.upload-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}
.upload-grid .tile {
    position: relative;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    background: var(--line-soft);
}
.upload-grid .tile .overlay {
    position: absolute;
    inset: 0;
    background: rgba(20,18,16,0.45);
    display: grid;
    place-items: center;
    color: #fff;
}
.upload-grid .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Photo row (admin photos mobile) ─────────────────────────── */
.photo-row {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 8px;
    border-top: 1px solid var(--line-soft);
    cursor: pointer;
}
.photo-row:first-child { border-top: none; }
.photo-bulk-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0 12px;
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
    margin-bottom: 4px;
}
.photo-bulk-bar .bulk-left,
.photo-bulk-bar .bulk-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.photo-select {
    width: 28px;
    height: 56px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    cursor: pointer;
}
.photo-select input {
    width: 18px;
    min-height: 18px;
}
.photo-row .thumb {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--line-soft);
}
.photo-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-row .info { flex: 1; min-width: 0; }
.photo-row .info .name {
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.photo-row .info .meta {
    margin-top: 3px;
    font-size: 11.5px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
}
.photo-row .price {
    text-align: right;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

/* ─── Segmented filter ────────────────────────────────────────── */
.segmented {
    display: flex;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    padding: 3px;
    margin-bottom: 14px;
}
.segmented .seg {
    flex: 1;
    padding: 8px;
    text-align: center;
    font-size: 12.5px;
    font-weight: 400;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--ink-2);
    border: none;
    cursor: pointer;
    font-family: var(--font-ui);
}
.segmented .seg.active {
    background: var(--ink);
    color: var(--bg);
    font-weight: 500;
}

/* ─── Form messages ───────────────────────────────────────────── */
.form-message {
    margin: 0;
    min-height: 20px;
    color: var(--muted);
    font-size: 14px;
}
.form-message.error { color: var(--danger); }
.form-message.ok { color: var(--accent); }

.download-list {
    display: grid;
    gap: 8px;
    margin-top: 18px;
    width: 100%;
    min-width: 0;
}
.download-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
}
.download-item img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--line-soft);
    flex: 0 0 auto;
}
.download-item .name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}
.download-item .btn {
    flex: 0 0 42px;
    width: 42px;
    min-width: 42px;
    justify-content: center;
}

@media (max-width: 420px) {
    .download-item {
        gap: 8px;
        padding: 7px;
    }
    .download-item img {
        width: 42px;
        height: 42px;
    }
    .download-item .name {
        font-size: 12.5px;
    }
}

/* ─── Login ───────────────────────────────────────────────────── */
.login-wrap {
    max-width: 420px;
    margin: 8vh auto 0;
    padding: 28px;
}
.login-hint {
    margin-top: 28px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 12px;
    color: var(--muted);
    display: flex;
    gap: 10px;
}
.login-hint .icon { color: var(--accent); flex-shrink: 0; }

/* ─── Desktop overrides (≥ 720px) ─────────────────────────────── */
@media (min-width: 720px) {
    .public-shell { padding: 36px 28px 96px; }
    .sidebar { display: flex; }
    .tabbar { display: none; }
    .admin-main { padding-bottom: 32px; }
    .admin-view { padding: 28px 32px 32px; }
    .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
    .photo-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .photo-grid-dense { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 0 4px; }
    .photo-grid-col { gap: 6px; }
    .stat-grid { grid-template-columns: repeat(4, 1fr); }
    .cart-pill { left: 32px; right: 32px; }
    .upload-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (min-width: 1040px) {
    .gallery-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
    .photo-grid { grid-template-columns: repeat(4, 1fr); }
    .photo-grid-dense { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .upload-grid { grid-template-columns: repeat(8, 1fr); }
}

/* ─── Tables (admin desktop tellimused/maksed) ────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 500;
    font-size: 11.5px;
    color: var(--muted);
    letter-spacing: 0.4px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}
.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line-soft);
    color: var(--ink-2);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr.row-clickable { cursor: pointer; }
.data-table tr.row-clickable:hover td { background: var(--bg); }
.data-table .col-right { text-align: right; }
.data-table .col-money { font-variant-numeric: tabular-nums; color: var(--ink); }

/* ─── Tag chips (admin) ───────────────────────────────────────── */
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    background: var(--accent-bg);
    color: var(--accent-ink);
    font-size: 11px;
    margin-right: 4px;
    margin-bottom: 4px;
}
.tag-chip button {
    background: none;
    border: none;
    color: inherit;
    padding: 0;
    font-size: 12px;
    line-height: 1;
}

.public-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 18px;
}
.public-footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}
.public-footer-links a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
}
.legal-page {
    max-width: 820px;
    margin: 0 auto;
    padding: 24px 0 10px;
}
.legal-page .heading-display {
    margin-top: 22px;
    font-size: clamp(38px, 9vw, 72px);
    line-height: 0.95;
}
.legal-lead {
    max-width: 640px;
    margin: 18px 0 28px;
    color: var(--ink-2);
    line-height: 1.55;
}
.legal-section {
    padding: 20px 0;
    border-top: 1px solid var(--line);
}
.legal-section h2 {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 500;
}
.legal-section ul {
    margin: 0;
    padding-left: 20px;
    color: var(--ink-2);
    line-height: 1.6;
}
.legal-section li + li { margin-top: 8px; }
.legal-meta {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}
