/* i247 — Apple-style minimal design system + SPA polish
 * Surfaces: near-white, soft borders. Type: Inter, tight tracking.
 * Motion: short, opacity + small translate. Skeletons shimmer. Spinners spin.
 */

:root {
    --bg:            #fbfbfd;
    --surface:       #ffffff;
    --surface-2:     #f5f5f7;
    --surface-3:     #efeff3;
    --nav-bg:        rgba(255, 255, 255, .85);
    --thumb-bg:      #fafafa;
    --tinted-bg:     #f5f7fb;
    --tinted-bg-strong: #eef1f6;

    --border:        #e5e7eb;
    --border-strong: #d2d2d7;

    --text:          #1d1d1f;
    --text-2:        #6e6e73;
    --text-3:        #86868b;

    --black:         #000;        /* primary CTA bg in light mode */
    --on-black:      #fff;        /* primary CTA fg in light mode */
    --grey-fill:     #f2f2f7;
    --grey-fill-hover: #e5e5ea;

    --blue:          #0066cc;
    --red:           #ff3b30;
    --orange:        #ff9500;
    --green:         #34c759;

    --alert-error-bg:     #ffe5e3;
    --alert-error-fg:     #b91c1c;
    --alert-error-border: #fecaca;
    --alert-success-bg:     #e8f9ea;
    --alert-success-fg:     #1f7a2a;
    --alert-success-border: #bde6c4;
    --alert-info-bg:      #e6f0ff;
    --alert-info-fg:      #0050a0;
    --alert-info-border:  #c4d8f5;
    --alert-warn-bg:      #fff3df;
    --alert-warn-fg:      #92400e;
    --alert-warn-border:  #f5d5a3;

    --skel-base: #f5f5f7;
    --skel-mid:  #efeff3;

    --radius-s:     8px;
    --radius-m:     14px;
    --radius-l:     20px;
    --radius-xl:    28px;

    --shadow-1:     0 1px 2px rgba(0,0,0,.04);
    --shadow-card:  0 1px 2px rgba(0,0,0,.03), 0 6px 24px rgba(0,0,0,.06);
    --shadow-pop:   0 8px 28px rgba(0,0,0,.10);

    --app-bar-h:    56px;
    --nav-h:        62px;
    --buy-bar-h:    72px;

    --ease:         cubic-bezier(.2, .8, .2, 1);
    --dur-fast:     150ms;
    --dur-base:     250ms;
}

[data-theme="dark"] {
    --bg:            #000000;
    --surface:       #1c1c1e;
    --surface-2:     #2c2c2e;
    --surface-3:     #3a3a3c;
    --nav-bg:        rgba(28, 28, 30, .85);
    --thumb-bg:      #2c2c2e;
    --tinted-bg:     #1f2127;
    --tinted-bg-strong: #25272f;

    --border:        #38383a;
    --border-strong: #48484a;

    --text:          #f5f5f7;
    --text-2:        #aeaeb2;
    --text-3:        #8e8e93;

    --black:         #f5f5f7;
    --on-black:      #000;
    --grey-fill:     #2c2c2e;
    --grey-fill-hover: #3a3a3c;

    --blue:          #0a84ff;
    --red:           #ff453a;
    --orange:        #ff9f0a;
    --green:         #30d158;

    --alert-error-bg:     #3a1010;
    --alert-error-fg:     #ff9f9a;
    --alert-error-border: #5a1616;
    --alert-success-bg:     #0e2a13;
    --alert-success-fg:     #7ee297;
    --alert-success-border: #1a4524;
    --alert-info-bg:      #0d1f3d;
    --alert-info-fg:      #6daeff;
    --alert-info-border:  #1a3157;
    --alert-warn-bg:      #2f1f0a;
    --alert-warn-fg:      #ffb868;
    --alert-warn-border:  #4a3215;

    --skel-base: #2c2c2e;
    --skel-mid:  #3a3a3c;

    --shadow-card:  0 1px 2px rgba(0,0,0,.3), 0 6px 24px rgba(0,0,0,.5);
    --shadow-pop:   0 8px 28px rgba(0,0,0,.6);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; height: 100%; }

/* Ensure the HTML [hidden] attribute always overrides our display rules
 * (otherwise an empty .nav-tabs with display:grid still blocks clicks). */
[hidden] { display: none !important; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100%;
    overflow-x: hidden;
}
body.has-nav     { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
body.has-buy-bar { padding-bottom: calc(var(--buy-bar-h) + env(safe-area-inset-bottom)); }
body.has-buy-bar.has-nav { padding-bottom: calc(var(--buy-bar-h) + var(--nav-h) + env(safe-area-inset-bottom)); }

a       { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button  { font: inherit; -webkit-tap-highlight-color: transparent; }
img     { max-width: 100%; display: block; }
hr      { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
small   { font-size: 12px; color: var(--text-3); }

::selection { background: rgba(0,0,0,.10); }

/* --- boot splash --- */

.is-booting #app-bar,
.is-booting #nav-tabs { display: none !important; }
.boot-splash {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
    justify-content: center;
    animation: fadeIn .4s var(--ease);
}

/* --- progress bar --- */

.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    transform: scaleX(0);
    transform-origin: left;
    background: var(--text);
    z-index: 200;
    pointer-events: none;
    opacity: 0;
    transition: opacity 180ms var(--ease), transform 220ms var(--ease);
}
.progress-bar.is-loading {
    opacity: 1;
    transform: scaleX(0.85);
    transition: opacity 100ms var(--ease), transform 8s cubic-bezier(.08,.82,.17,1);
}
.progress-bar.is-done {
    opacity: 0;
    transform: scaleX(1);
    transition: opacity 250ms var(--ease) 100ms, transform 200ms var(--ease);
}

/* --- layout primitives --- */

.container        { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.container-tight  { max-width: 640px; }
.app-view         { min-height: 50vh; }

.row          { display: flex; gap: 12px; align-items: center; }
.row-between  { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.col          { display: flex; flex-direction: column; gap: 12px; }
.stack-sm     { display: flex; flex-direction: column; gap: 8px; }
.stack-md     { display: flex; flex-direction: column; gap: 16px; }
.stack-lg     { display: flex; flex-direction: column; gap: 24px; }

.text-muted   { color: var(--text-2); }
.text-quiet   { color: var(--text-3); }
.text-red     { color: var(--red); }
.text-green   { color: var(--green); }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.fw-600       { font-weight: 600; }
.fw-700       { font-weight: 700; }
.fs-11        { font-size: 11px; }
.fs-13        { font-size: 13px; }
.fs-17        { font-size: 17px; }
.fs-20        { font-size: 20px; }
.fs-24        { font-size: 24px; }
.lh-tight     { line-height: 1.25; }

.hidden       { display: none !important; }
.no-wrap      { white-space: nowrap; }
.mt-2         { margin-top: 8px; }
.mt-3         { margin-top: 12px; }
.mt-4         { margin-top: 16px; }
.mt-6         { margin-top: 24px; }

/* --- app bar (top) --- */

.app-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--app-bar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    transition: height var(--dur-fast) var(--ease);
}
.app-bar.is-tall { height: 68px; }
.app-bar-left, .app-bar-right { display: flex; align-items: center; gap: 4px; min-width: 0; }
.app-bar-left  { flex: 1; min-width: 0; }
.app-bar-right { flex-shrink: 0; }

/* Wallet greeting in app bar */
.bar-greet-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
    padding: 0 4px;
}
.bar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--black);
    color: var(--on-black);
    display: grid;
    place-items: center;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.02em;
    flex-shrink: 0;
}
.bar-greet { min-width: 0; line-height: 1.2; flex: 1; }
.bar-name {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.012em;
    color: var(--text);
}
.bar-email {
    font-size: 11px;
    color: var(--text-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.app-bar .brand {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.025em;
    margin-left: 6px;
    display: inline-flex;
    align-items: baseline;
}
.brand-tld {
    font-size: 0.62em;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--green);
    margin-left: 1px;
    padding: 1px 5px 1px 4px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--green) 14%, transparent);
    line-height: 1;
    transform: translateY(-0.18em);
}
.app-bar .title-strap {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.012em;
    margin-left: 4px;
    color: var(--text-2);
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--text);
    position: relative;
    transition: background var(--dur-fast) var(--ease), transform 80ms var(--ease);
}
.icon-btn:hover { background: var(--grey-fill); }
.icon-btn:active { transform: scale(0.95); }
.icon-btn .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 0 4px;
    display: grid;
    place-items: center;
    line-height: 1;
    border: 2px solid var(--surface);
}
.icon-btn .badge[hidden] { display: none; }
.badge.bump { animation: bump 420ms var(--ease); }
@keyframes bump {
    0%, 100% { transform: scale(1); }
    40%      { transform: scale(1.4); }
}

/* --- footer nav --- */

.nav-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 60;
    height: var(--nav-h);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
}
.nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-3);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: color var(--dur-fast) var(--ease), transform 80ms var(--ease);
    -webkit-tap-highlight-color: transparent;
}
.nav-tab:active { transform: scale(0.94); }
.nav-tab[aria-current="page"] { color: var(--text); }
.nav-tab[aria-current="page"] svg { stroke-width: 2; }

/* --- buttons --- */

.btn {
    appearance: none;
    border: 0;
    background: var(--grey-fill);
    color: var(--text);
    border-radius: 999px;
    padding: 12px 22px;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease), transform 60ms var(--ease), opacity var(--dur-fast) var(--ease);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}
.btn:hover  { background: var(--grey-fill-hover); }
.btn:active { transform: scale(0.97); }
.btn[disabled], .btn.is-disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary  { background: var(--black); color: var(--on-black); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-danger   { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(1.05); }
.btn-block    { width: 100%; }
.btn-lg       { padding: 16px 28px; font-size: 16px; }
.btn-sm       { padding: 8px 14px; font-size: 13px; }
.btn-ghost    { background: transparent; border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--grey-fill); }

.btn.is-loading .btn-label { opacity: 0; }
.btn.is-loading::after {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-right-color: transparent;
    animation: spin 0.7s linear infinite;
    opacity: 0.8;
}

/* --- spinner --- */

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0,0,0,.08);
    border-top-color: var(--text);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    display: inline-block;
}
.spinner-lg { width: 28px; height: 28px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- cards --- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    padding: 20px;
}
.card-flat   { background: var(--surface-2); border: 1px solid transparent; }
.card-pad-sm { padding: 14px 16px; }
.card-tinted { background: #f5f7fb; border: 1px solid transparent; }

/* --- forms --- */

.form-group { margin-bottom: 14px; }
.label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}
.input, .select, .textarea {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
    padding: 12px 14px;
    font: inherit;
    font-size: 15px;
    color: var(--text);
    letter-spacing: -0.01em;
    transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.input::placeholder { color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus {
    outline: 0;
    border-color: var(--text);
    box-shadow: 0 0 0 4px rgba(0,0,0,.06);
}
.input[aria-invalid="true"] { border-color: var(--red); }
.select {
    background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}
.textarea { min-height: 80px; resize: vertical; }
.hint  { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.err   { font-size: 12px; color: var(--red); margin-top: 6px; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) {
    .form-grid-2 { grid-template-columns: 1fr; }
}

/* --- alerts --- */

.alert {
    border-radius: var(--radius-s);
    padding: 12px 14px;
    font-size: 14px;
    margin-bottom: 12px;
    border: 1px solid transparent;
    animation: alertSlide 220ms var(--ease);
}
@keyframes alertSlide {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.alert-error   { background: var(--alert-error-bg);   color: var(--alert-error-fg);   border-color: var(--alert-error-border); }
.alert-success { background: var(--alert-success-bg); color: var(--alert-success-fg); border-color: var(--alert-success-border); }
.alert-info    { background: var(--alert-info-bg);    color: var(--alert-info-fg);    border-color: var(--alert-info-border); }
.alert-warn    { background: var(--alert-warn-bg);    color: var(--alert-warn-fg);    border-color: var(--alert-warn-border); }

/* --- chips --- */

.chip-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px;
    margin: 0 -2px;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    scroll-snap-align: start;
    transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.chip:hover { background: var(--grey-fill); }
.chip.is-active { background: var(--black); color: #fff; border-color: var(--black); }
.chip-count { color: var(--text-3); font-weight: 400; font-size: 12px; }
.chip.is-active .chip-count { color: rgba(255,255,255,.6); }

/* --- product grid + card --- */

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (min-width: 480px) { .product-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
@media (min-width: 720px) { .product-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; } }

.product-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    overflow: hidden;
    transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
    border-color: transparent;
}
.product-card .thumb {
    aspect-ratio: 1 / 1;
    background: var(--thumb-bg);
    display: grid;
    place-items: center;
    padding: 10px;
}
.product-card .thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.product-card .meta { padding: 10px 12px 12px; }
.product-card .name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.35;
    letter-spacing: -0.01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 36px;
}
.product-card .price {
    margin-top: 6px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.012em;
}
.product-card .price .market {
    font-size: 12px;
    color: var(--text-3);
    text-decoration: line-through;
    margin-left: 6px;
    font-weight: 400;
}
.product-card .oos {
    margin-top: 4px;
    font-size: 11px;
    color: var(--red);
    font-weight: 500;
}

/* --- hero --- */

.hero {
    margin: 8px 0 24px;
    background: linear-gradient(160deg, var(--surface-2) 0%, var(--bg) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-l);
    padding: 32px 24px;
    text-align: center;
    overflow: hidden;
    position: relative;
    animation: heroIn .5s var(--ease);
}
@keyframes heroIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hero h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.028em;
    line-height: 1.1;
    margin: 0 0 8px;
}
.hero p {
    margin: 0 auto 16px;
    font-size: 15px;
    color: var(--text-2);
    max-width: 380px;
}
.hero .ctas { display: inline-flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* --- section header --- */

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 28px 0 12px;
}
.section-head h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.022em;
    margin: 0;
}
.section-head .link {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-2);
    display: inline-flex;
    align-items: center;
    gap: 2px;
    transition: color var(--dur-fast) var(--ease);
}
.section-head .link:hover { color: var(--text); }

/* --- category grid --- */

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
@media (min-width: 480px) { .category-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 720px) { .category-grid { grid-template-columns: repeat(4, 1fr); } }
.category-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.category-tile:hover { background: var(--grey-fill); border-color: var(--border-strong); }
.category-tile .name  { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.category-tile .count { font-size: 12px; color: var(--text-3); }

/* --- auth pages --- */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    animation: fadeIn .35s var(--ease);
}
.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 32px 28px;
}
.auth-card h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.022em;
    margin: 0 0 4px;
}
.auth-card .sub { color: var(--text-2); margin: 0 0 24px; font-size: 14px; }
.auth-footer {
    margin-top: 18px;
    font-size: 14px;
    color: var(--text-2);
    text-align: center;
}
.auth-footer a {
    color: var(--text);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--border-strong);
    text-underline-offset: 3px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--black);
    color: var(--on-black);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.02em;
    margin: 0 auto 16px;
}

/* --- profile --- */

.profile-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 0 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}
.avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--black);
    color: var(--on-black);
    display: grid;
    place-items: center;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.profile-head .name  { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.profile-head .email { color: var(--text-2); font-size: 13px; }

.section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 10px;
}

/* --- search page --- */

.search-form {
    position: sticky;
    top: var(--app-bar-h);
    z-index: 30;
    background: var(--bg);
    padding: 12px 0 8px;
}
.search-input-wrap { position: relative; }
.search-input {
    padding-left: 40px;
    padding-right: 38px;
    border-radius: 999px;
    height: 44px;
}
.search-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
    display: grid;
    place-items: center;
    pointer-events: none;
}
.search-input-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--grey-fill);
    color: var(--text-2);
    cursor: pointer;
}
.search-input-clear:hover { color: var(--text); }
.search-input-clear[hidden] { display: none; }

.filter-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.select-compact {
    padding: 8px 32px 8px 12px;
    background-position: right 10px center;
    font-size: 13px;
    width: auto;
    border-radius: 999px;
    background-color: var(--surface);
}

.result-meta {
    margin: 14px 0 4px;
    font-size: 13px;
    color: var(--text);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 28px 0 8px;
    font-size: 13px;
    color: var(--text-2);
}

/* --- empty state --- */

.empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-2);
    animation: fadeIn .35s var(--ease);
}
.empty .empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--surface-2);
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
}
.empty h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 6px;
    letter-spacing: -0.02em;
}
.empty p { margin: 0 0 16px; font-size: 14px; }

/* --- skeletons --- */

.skel {
    background: linear-gradient(90deg, var(--skel-base) 0%, var(--skel-mid) 50%, var(--skel-base) 100%);
    background-size: 200% 100%;
    border-radius: 6px;
    animation: skel 1.4s ease-in-out infinite;
    color: transparent !important;
    user-select: none;
}
@keyframes skel {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skel-line  { height: 12px; margin: 6px 0; border-radius: 4px; }
.skel-line.short { width: 40%; }
.skel-line.med   { width: 70%; }
.skel-line.long  { width: 92%; }
.skel-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    overflow: hidden;
}
.skel-card .skel-thumb {
    aspect-ratio: 1 / 1;
    background: linear-gradient(90deg, var(--skel-base) 0%, var(--skel-mid) 50%, var(--skel-base) 100%);
    background-size: 200% 100%;
    animation: skel 1.4s ease-in-out infinite;
}
.skel-card .skel-body { padding: 12px; }
.skel-chip {
    height: 32px;
    width: 76px;
    border-radius: 999px;
    flex-shrink: 0;
}
.skel-cat {
    height: 64px;
    border-radius: var(--radius-m);
}

/* --- toasts --- */

.toast-root {
    position: fixed;
    bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    pointer-events: none;
}
body:not(.has-nav) .toast-root {
    bottom: calc(16px + env(safe-area-inset-bottom));
}
body.has-buy-bar .toast-root {
    bottom: calc(var(--buy-bar-h) + 16px + env(safe-area-inset-bottom));
}
.toast {
    pointer-events: auto;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--bg);
    background: var(--text);
    box-shadow: var(--shadow-pop);
    max-width: 90vw;
    text-align: center;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.toast.is-shown { opacity: 1; transform: translateY(0); }
.toast.is-error { background: var(--red); color: #fff; }
.toast.is-success { background: var(--text); color: var(--bg); }

/* --- view transition --- */

.app-view { transition: opacity 180ms var(--ease), transform 180ms var(--ease); }
.app-view.is-leaving { opacity: 0; transform: translateY(6px); }
.app-view.is-entering { animation: viewIn 240ms var(--ease); }
@keyframes viewIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* --- page headers --- */

.page-head { padding: 18px 0 14px; animation: fadeIn .3s var(--ease); }
.page-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.022em;
    margin: 0 0 4px;
    line-height: 1.15;
}
.page-sub { margin: 0; font-size: 14px; }

/* --- cart --- */

.cart-rows {
    list-style: none;
    padding: 0;
    margin: 16px 0 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cart-row {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    padding: 12px;
    align-items: flex-start;
    animation: viewIn 200ms var(--ease);
}
.cart-thumb {
    width: 80px;
    height: 80px;
    background: var(--thumb-bg);
    border-radius: var(--radius-s);
    overflow: hidden;
    display: grid;
    place-items: center;
}
.cart-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.thumb-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
}
.cart-meta { min-width: 0; }
.cart-name {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.012em;
    color: var(--text);
    line-height: 1.3;
    display: block;
    margin-bottom: 2px;
}
.cart-line-total {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.012em;
}
.cart-warn {
    color: var(--red);
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
}
.qty-stepper {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    background: var(--surface-2);
    border-radius: 999px;
    padding: 2px;
}
.qty-btn {
    appearance: none;
    border: 0;
    background: transparent;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background var(--dur-fast) var(--ease), transform 80ms var(--ease);
}
.qty-btn:hover { background: var(--surface); }
.qty-btn:active { transform: scale(0.9); }
.qty-val { min-width: 24px; text-align: center; font-size: 13px; font-weight: 600; }
.cart-remove {
    border: 0;
    background: transparent;
    color: var(--text-2);
    font-size: 12px;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--border-strong);
    margin-left: 8px;
    cursor: pointer;
    padding: 4px 6px;
}
.cart-remove:hover { color: var(--red); text-decoration-color: var(--red); }

.cart-summary { padding: 18px 20px; }

/* --- checkout --- */

.checkout-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.checkout-item {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 12px;
    align-items: center;
}
.checkout-thumb {
    width: 56px;
    height: 56px;
    background: var(--thumb-bg);
    border-radius: var(--radius-s);
    overflow: hidden;
    display: grid;
    place-items: center;
}
.checkout-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.checkout-line-total {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.012em;
}

.tier-options { display: flex; flex-direction: column; gap: 8px; }
.tier-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    background: var(--surface);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.tier-option:hover { background: var(--surface-2); }
.tier-option input[type="radio"] { accent-color: var(--black); transform: scale(1.1); }
.tier-option:has(input:checked) { border-color: var(--text); background: var(--surface-2); }
.tier-text { display: flex; flex-direction: column; gap: 2px; }
.tier-text strong { font-size: 14px; font-weight: 600; letter-spacing: -0.012em; }

.card-totals { padding: 18px 20px; }
.total-line  { padding-top: 12px; border-top: 1px solid var(--border); }

/* --- orders list --- */

.order-list {
    list-style: none;
    padding: 0;
    margin: 16px 0 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.order-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform 80ms var(--ease);
    animation: viewIn 220ms var(--ease);
}

/* Stacked thumbnails on each delivery row */
.order-thumb-stack {
    display: flex;
    flex-shrink: 0;
    align-items: flex-start;
    padding-top: 2px;
}
.order-thumb {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--thumb-bg);
    border: 2px solid var(--surface);
    overflow: hidden;
    display: grid;
    place-items: center;
    padding: 4px;
    margin-left: -14px;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
    position: relative;
}
.order-thumb:first-child { margin-left: 0; }
.order-thumb img        { max-width: 100%; max-height: 100%; object-fit: contain; }
.order-thumb-fallback   { color: var(--text-3); }
.order-thumb-more {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--surface-2);
    border: 2px solid var(--surface);
    display: grid;
    place-items: center;
    margin-left: -14px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
    position: relative;
}

@media (max-width: 380px) {
    .order-thumb, .order-thumb-more { width: 38px; height: 38px; border-radius: 10px; margin-left: -12px; padding: 3px; }
    .order-thumb:first-child { margin-left: 0; }
}
.order-row:hover  { background: var(--surface-2); border-color: var(--border-strong); }
.order-row:active { transform: scale(0.99); }
.order-row-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.order-status { display: flex; align-items: center; gap: 8px; }
.order-ref {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.012em;
    color: var(--text);
}
.order-sub   { font-size: 13px; }
.order-total { font-weight: 600; font-size: 15px; }
.order-total-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    padding-top: 2px;
}
.order-chev  { color: var(--text-3); display: grid; place-items: center; }

/* --- order progress (full, on detail page) --- */

.order-progress {
    margin: 0 0 24px;
    animation: viewIn 280ms var(--ease);
}
.order-progress .progress-bar-track {
    position: relative;
    height: 6px;
    background: var(--surface-2);
    border-radius: 3px;
    overflow: hidden;
}
.order-progress .progress-bar-fill {
    height: 100%;
    background: var(--green);
    border-radius: 3px;
    transition: width 600ms var(--ease);
}
.order-progress.is-cancelled .progress-bar-fill { background: var(--text-3); }
.progress-cancelled-note {
    margin-top: 10px;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.progress-stages {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 12px;
}
.progress-stage {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-3);
    line-height: 1.3;
    letter-spacing: -0.005em;
}
.progress-stages > :first-child { text-align: left; }
.progress-stages > :last-child  { text-align: right; }
.progress-stages > :nth-child(2),
.progress-stages > :nth-child(3) { text-align: center; }
.progress-stage.is-done    { color: var(--text-2); font-weight: 600; }
.progress-stage.is-current { color: var(--text);   font-weight: 700; }

/* --- order progress (compact, in list rows) --- */

.order-progress-compact {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}
.order-progress-compact .progress-bar-track {
    flex: 1;
    height: 4px;
    background: var(--surface-2);
    border-radius: 2px;
    overflow: hidden;
    min-width: 0;
}
.order-progress-compact .progress-bar-fill {
    display: block;
    height: 100%;
    background: var(--green);
    border-radius: 2px;
    transition: width 600ms var(--ease);
}
.order-progress-compact .progress-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    letter-spacing: 0.01em;
}
.order-progress-compact.is-cancelled .progress-bar-fill { background: var(--text-3); }
.order-progress-compact.is-cancelled .progress-label    { color: var(--text-3); }

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
    text-transform: capitalize;
}
.status-pill.is-paid       { background: #e6f0ff; color: #0050a0; border-color: #c4d8f5; }
.status-pill.is-accepted   { background: #e6f0ff; color: #0050a0; border-color: #c4d8f5; }
.status-pill.is-shipped    { background: #fff3df; color: #92400e; border-color: #f5d5a3; }
.status-pill.is-delivered  { background: #e8f9ea; color: #1f7a2a; border-color: #bde6c4; }
.status-pill.is-cancelled  { background: #f2f2f7; color: #6e6e73; border-color: var(--border); }

/* --- order detail --- */

.order-head { padding-bottom: 12px; }
.order-ref-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-top: 6px;
}
.order-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}
.order-items > li:not(:last-child) .order-item-link {
    border-bottom: 1px solid var(--border);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.order-item-link {
    display: grid;
    grid-template-columns: 60px 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 12px 8px;
    margin: 0 -8px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    transition: background var(--dur-fast) var(--ease), transform 80ms var(--ease);
}
.order-item-link:hover  { background: var(--surface-2); }
.order-item-link:active { transform: scale(0.99); }
.order-item-link.is-loading {
    pointer-events: none;
    cursor: default;
}
.order-item-link.is-loading .order-item-chev { opacity: 0; }
.order-item-thumb {
    width: 60px;
    height: 60px;
    background: var(--thumb-bg);
    border-radius: 10px;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 4px;
}
.order-item-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.order-item-main {
    min-width: 0;
}
.order-item-main .cart-name {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.012em;
    line-height: 1.3;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.order-item-price {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.012em;
    white-space: nowrap;
}
.order-item-chev {
    color: var(--text-3);
    display: grid;
    place-items: center;
    transition: opacity var(--dur-fast) var(--ease);
}

.delivery-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--surface-2);
    border-radius: var(--radius-s);
    padding: 4px 12px;
}
.breakdown-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    gap: 10px;
}
.breakdown-row:last-child { border-bottom: 0; }

/* --- product detail --- */

.product-page-bg { background: var(--surface); }

.gallery { padding: 8px 0 0; }
.gallery-main {
    aspect-ratio: 1 / 1;
    background: var(--thumb-bg);
    display: grid;
    place-items: center;
    padding: 20px;
    margin: 0 16px;
    border-radius: var(--radius-m);
    overflow: hidden;
}
.gallery-main img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 180ms var(--ease);
}
.gallery-thumbs {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    scrollbar-width: none;
}
.gallery-thumbs::-webkit-scrollbar { display: none; }
.gallery-thumb {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 10px;
    background: var(--thumb-bg);
    border: 1.5px solid transparent;
    padding: 6px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: border-color var(--dur-fast) var(--ease), transform 80ms var(--ease);
}
.gallery-thumb:hover  { border-color: var(--border-strong); }
.gallery-thumb:active { transform: scale(0.94); }
.gallery-thumb.is-active { border-color: var(--text); }
.gallery-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }

.product-info { padding: 8px 20px 16px; }
.product-brand {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
}
.product-title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.022em;
    line-height: 1.3;
    margin: 0 0 8px;
}
.product-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0 0 6px;
    flex-wrap: wrap;
}
.product-price {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.022em;
}
.product-market {
    font-size: 14px;
    color: var(--text-3);
    text-decoration: line-through;
    font-weight: 500;
}
.product-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text);
    margin-top: 2px;
}
.product-rating svg { color: var(--orange); fill: var(--orange); }
.product-stock {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-3);
    font-weight: 500;
}
.product-stock.is-oos { color: var(--red); }

.delivery-card {
    margin: 4px 20px 0;
    background: var(--tinted-bg);
    border-radius: var(--radius-m);
    overflow: hidden;
    transition: background var(--dur-fast) var(--ease);
}
.delivery-card[open] { background: var(--tinted-bg-strong); }
.delivery-card > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}
.delivery-card > summary::-webkit-details-marker { display: none; }
.delivery-icon { color: var(--text); display: grid; place-items: center; }
.delivery-text { flex: 1; min-width: 0; }
.delivery-headline {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.012em;
    line-height: 1.3;
}
.delivery-sub {
    font-size: 12px;
    color: var(--text-2);
    margin-top: 2px;
}
.delivery-chev {
    color: var(--text-2);
    display: grid;
    place-items: center;
    transition: transform .2s var(--ease);
}
.delivery-card[open] .delivery-chev { transform: rotate(180deg); }
.delivery-body { padding: 0 16px 14px; }
.delivery-card .tier-option { background: var(--surface); border-color: transparent; }
.delivery-card .tier-option:has(input:checked) { border-color: var(--text); }

.product-description {
    padding: 20px 20px 28px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-2);
    white-space: pre-line;
    border-top: 1px solid var(--border);
    margin-top: 18px;
}

.buy-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--border);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    animation: slideUp 280ms var(--ease);
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.buy-bar .btn { padding: 14px 20px; font-size: 15px; }

/* --- generic helpers --- */

.divider-h { height: 1px; background: var(--border); margin: 16px 0; }

.kbd-hint {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 4px;
}

/* --- responsive trims --- */

@media (max-width: 380px) {
    .page-title { font-size: 22px; }
    .hero       { padding: 24px 18px; }
    .hero h1    { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================
 * WALLET VIEW
 * ============================================================ */

.wallet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 0 22px;
}
.wallet-head .avatar { width: 48px; height: 48px; font-size: 18px; }
.wallet-head .hello {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.wallet-head-actions { display: flex; gap: 4px; }
.icon-btn-bordered {
    border: 1px solid var(--border);
    background: var(--surface);
    width: 40px;
    height: 40px;
    border-radius: 12px;
}
.icon-btn-bordered:hover { background: var(--surface-2); }

.wallet-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-l);
    padding: 22px 22px 18px;
    margin: 20px 0 28px;
    animation: viewIn 280ms var(--ease);
}
.wallet-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 8px;
}
.wallet-card-head h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.wallet-card-head h3::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-3);
}
.wallet-balance {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: var(--text);
}
.wallet-balance .naira-sign { font-size: 28px; margin-right: 2px; }
.wallet-balance .cents      { font-size: 18px; color: var(--text-3); font-weight: 600; }

.wallet-account-row {
    margin-top: 16px;
    padding: 12px 14px;
    background: var(--surface-2);
    border-radius: var(--radius-m);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.wallet-account-label   { font-weight: 600; font-size: 13px; color: var(--text-2); letter-spacing: -0.005em; }
.wallet-account-number  { font-weight: 700; font-size: 15px; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.wallet-account-actions { display: flex; gap: 6px; }

.wallet-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 16px;
}
.wallet-action {
    appearance: none;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 14px 8px;
    border-radius: var(--radius-m);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: -0.005em;
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease), transform 60ms var(--ease);
    text-decoration: none;
}
.wallet-action:hover  { background: var(--surface-2); }
.wallet-action:active { transform: scale(0.97); }
.wallet-action.is-primary { background: var(--black); color: var(--on-black); border-color: var(--black); }
.wallet-action.is-primary:hover { filter: brightness(1.08); }
.wallet-action svg { color: inherit; }

/* ============================================================
 * TRANSACTIONS
 * ============================================================ */

.tx-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}
.tx-row {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 8px;
    margin: 0 -8px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    transition: background var(--dur-fast) var(--ease);
}
.tx-row:hover { background: var(--surface-2); }
.tx-icon {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: var(--surface-2);
    display: grid;
    place-items: center;
    color: var(--text-2);
}
.tx-icon.is-credit    { background: rgba(52, 199, 89, .15); color: var(--green); }
.tx-icon.is-debit     { background: rgba(255, 59, 48, .12); color: var(--red); }
.tx-icon.is-cancelled { background: var(--surface-2);       color: var(--text-3); }
.tx-main  { min-width: 0; }
.tx-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.012em;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tx-date  { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.tx-amount {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.tx-amount.is-debit     { color: var(--text); }
.tx-amount.is-credit    { color: var(--green); }
.tx-amount.is-cancelled { color: var(--text-3); text-decoration: line-through; }

/* ============================================================
 * SETTINGS LIST + ROWS
 * ============================================================ */

.settings-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    overflow: hidden;
}
.settings-row {
    display: grid;
    grid-template-columns: 38px 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease);
    background: var(--surface);
    border-left: 0;
    border-right: 0;
    border-top: 0;
    width: 100%;
}
.settings-list > li:last-child .settings-row { border-bottom: 0; }
.settings-row:hover { background: var(--surface-2); }
.settings-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--surface-2);
    display: grid;
    place-items: center;
    color: var(--text-2);
}
.settings-icon.is-destructive { background: rgba(255, 59, 48, .12); color: var(--red); }
.settings-label {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.012em;
    text-align: left;
}
.settings-meta { font-size: 13px; color: var(--text-3); }
.settings-chev { color: var(--text-3); display: grid; place-items: center; }
.settings-row.is-destructive .settings-label { color: var(--red); }
.settings-section { margin-bottom: 28px; }
.settings-section h3 {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 8px 4px;
}

/* ============================================================
 * ADDRESS CARDS
 * ============================================================ */

.address-list {
    list-style: none;
    padding: 0;
    margin: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.address-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    padding: 14px 16px;
    transition: border-color var(--dur-fast) var(--ease);
}
.address-card.is-default { border-color: var(--text); }
.address-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.address-tag {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.012em;
}
.address-actions {
    margin-left: auto;
    display: flex;
    gap: 4px;
}
.address-actions .icon-btn { width: 32px; height: 32px; }
.address-body  { color: var(--text-2); font-size: 13px; line-height: 1.45; }
.address-body .fw-600 { color: var(--text); font-size: 14px; }

.address-default-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.address-card.is-default .address-default-pill {
    background: var(--black);
    color: var(--on-black);
}

/* Checkout address picker */
.address-pick {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.address-radio {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    background: var(--surface);
    cursor: pointer;
    transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.address-radio:hover { background: var(--surface-2); }
.address-radio:has(input:checked) {
    border-color: var(--text);
    background: var(--surface-2);
}
.address-radio input[type="radio"] {
    accent-color: var(--black);
    transform: scale(1.1);
    margin-top: 2px;
}
.address-radio-main { min-width: 0; flex: 1; }
.address-radio-tag {
    font-weight: 600;
    font-size: 14px;
    letter-spacing: -0.012em;
}
.address-radio-sub  { color: var(--text-2); font-size: 13px; margin-top: 2px; line-height: 1.4; }

/* ============================================================
 * THEME PICKER
 * ============================================================ */

.theme-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.theme-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    background: var(--surface);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.theme-option:hover { background: var(--surface-2); }
.theme-option:has(input:checked) { border-color: var(--text); background: var(--surface-2); }
.theme-option input[type="radio"] { accent-color: var(--black); transform: scale(1.1); }
.theme-option-text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.theme-option-text strong { font-size: 14px; font-weight: 600; letter-spacing: -0.012em; }
.theme-option-sub { font-size: 13px; color: var(--text-2); }
.theme-option-icon { color: var(--text-2); display: grid; place-items: center; }

/* ============================================================
 * SUB-PAGE BACK BAR
 * ============================================================ */

.subpage-head { margin-bottom: 8px; }
