/* Cube Pass mini app, v3 (2026-10). Night-cobalt shop with the "notch" from the CUBE wordmark. */

@font-face { font-family: "YekanBakh"; src: url("assets/fonts/YekanBakh/YekanBakh-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "YekanBakh"; src: url("assets/fonts/YekanBakh/YekanBakh-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "YekanBakh"; src: url("assets/fonts/YekanBakh/YekanBakh-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "YekanBakh"; src: url("assets/fonts/YekanBakh/YekanBakh-Black.woff2") format("woff2"); font-weight: 900; font-display: swap; }

:root {
    --night: #0A1030;
    --deep: #121B4A;
    --deep-2: #18235A;
    --rim: #26327A;
    --cobalt: #3E69FE;
    --cobalt-press: #2F55E0;
    --frost: #ECF0FF;
    --mist: #98A3D4;
    --dim: #6A76AE;
    --amber: #FFB547;
    --mint: #3DDC97;
    --coral: #FF6B6B;

    --xbox: #2FB44F;
    --ps: #2E8BFF;
    --gold: #F2B33D;
    --rent: #A77BFF;
    --apps: #FF6FAE;
    --dns: #5FD3E8;

    --notch: 12px;
    --r: 12px;
    --gutter: 16px;
    --header-h: 60px;
    --tabbar-h: 64px;
    --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--night); }
body {
    font-family: "YekanBakh", Tahoma, sans-serif;
    color: var(--frost);
    font-size: 14px;
    line-height: 1.75;
    min-height: 100vh;
    overscroll-behavior-y: none;
}
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.display { font-family: "YekanBakh", Tahoma, sans-serif; font-weight: 900; letter-spacing: 0; }

:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }

/* the notch: one corner cut like the counters of the CUBE letters */
.notch { clip-path: polygon(var(--notch) 0, 100% 0, 100% 100%, 0 100%, 0 var(--notch)); }

/* ---------- top loading bar ---------- */
.topbar {
    position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60;
    background: var(--cobalt); transform: scaleX(0); transform-origin: right;
    transition: transform .3s ease, opacity .3s ease; opacity: 0;
}
.topbar.on { opacity: 1; transform: scaleX(.75); transition: transform 2.5s cubic-bezier(.1,.6,.2,1), opacity .2s; }
.topbar.done { opacity: 0; transform: scaleX(1); }

/* ---------- header ---------- */
.header {
    position: sticky; top: 0; z-index: 30;
    height: var(--header-h);
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 0 var(--gutter);
    background: rgba(10, 16, 48, .92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
}
.header.scrolled { border-bottom-color: var(--rim); }
.header-main, .header-sub { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
    width: 38px; height: 38px; position: relative;
    background: var(--cobalt); color: #fff;
    display: grid; place-items: center; font-weight: 700; font-size: 16px;
    clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px);
    overflow: hidden;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hello { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.hello-sub { font-size: 12px; color: var(--mist); }
.hello strong { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.page-title { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; line-height: 1.4; }
.icon-btn {
    width: 38px; height: 38px; display: grid; place-items: center;
    color: var(--frost); border-radius: 10px;
}
.icon-btn:active { background: var(--deep-2); }

.wallet-chip {
    display: flex; align-items: center; gap: 6px;
    height: 36px; padding: 0 12px;
    background: var(--deep); border: 1px solid var(--rim);
    border-radius: 10px;
    font-weight: 700; font-size: 14px; white-space: nowrap;
}
.wallet-chip .i { width: 18px; height: 18px; color: var(--cobalt); }
.wallet-chip small { font-weight: 400; color: var(--mist); font-size: 11px; }

/* ---------- screens ---------- */
.screens { padding: 8px var(--gutter) calc(var(--tabbar-h) + var(--safe-b) + 24px); }
.screen { display: none; }
.screen.active { display: block; animation: screen-in .22s ease-out; }
.screen.has-dock.active { padding-bottom: 88px; }
@keyframes screen-in { from { opacity: 0; } to { opacity: 1; } }
.screen.back-in.active { animation-name: screen-back; }
@keyframes screen-back { from { opacity: 0; } to { opacity: 1; } }

.section-title { font-family: "YekanBakh", Tahoma, sans-serif; font-weight: 900; font-size: 18px; margin: 26px 0 12px; line-height: 1.5; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; }
.section-head .section-title { margin-bottom: 12px; }
.group-title { font-size: 14px; font-weight: 600; color: var(--mist); margin: 22px 0 10px; }
.lead { color: var(--mist); font-size: 13px; margin: 4px 0 14px; }
.link { color: var(--cobalt); font-weight: 600; font-size: 13px; padding: 4px 0; }
.amber { color: var(--amber); }

/* ---------- search ---------- */
.search {
    display: flex; align-items: center; gap: 10px;
    height: 46px; padding: 0 14px;
    background: var(--deep); border: 1px solid var(--rim); border-radius: var(--r);
    color: var(--mist);
}
.search:focus-within { border-color: var(--cobalt); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--frost); font-size: 14px; }
.search input::placeholder { color: var(--dim); }
.search input::-webkit-search-cancel-button { display: none; }
.search-clear { color: var(--mist); display: grid; place-items: center; }
.search-sm { height: 42px; margin-bottom: 14px; }

/* ---------- banner ---------- */
.banner {
    position: relative; margin-top: 14px;
    aspect-ratio: 7 / 3;   /* the site's slider images are 1400x600; the real ratio is set from the first image */
    overflow: hidden;
    background: var(--deep);
    clip-path: polygon(16px 0, 100% 0, 100% 100%, 0 100%, 0 16px);
    border-radius: 0 var(--r) var(--r) var(--r);
}
.banner-track { display: flex; height: 100%; transition: transform .45s cubic-bezier(.2,.7,.2,1); direction: ltr; }
.slide { flex: 0 0 100%; height: 100%; position: relative; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide-title {
    position: absolute; inset: auto 0 0 0; direction: rtl;
    padding: 28px 14px 10px;
    background: linear-gradient(to top, rgba(10,16,48,.9), rgba(10,16,48,0));
    font-weight: 600; font-size: 14px;
}
.slide-brand {
    display: grid; place-items: center; height: 100%;
    background:
        repeating-linear-gradient(90deg, rgba(255,255,255,.04) 0 1px, transparent 1px 28px),
        repeating-linear-gradient(0deg, rgba(255,255,255,.04) 0 1px, transparent 1px 28px),
        var(--cobalt);
}
.slide-brand img { width: 62%; height: auto; }
.banner-dots { position: absolute; bottom: 10px; left: 12px; display: flex; gap: 6px; direction: ltr; }
.banner-dots button { width: 7px; height: 7px; background: rgba(236,240,255,.4); transition: width .25s, background .25s; }
.banner-dots button.on { width: 18px; background: #fff; }

/* ---------- category tiles ---------- */
/* six equal, solid-colour tiles in a 3 x 2 grid, sized for phones */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(8px, 2.6vw, 12px); }
.cat {
    --g1: var(--cobalt); --g2: var(--cobalt-press);
    position: relative; overflow: hidden;
    aspect-ratio: 1 / 1; width: 100%; min-width: 0;
    display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
    padding: clamp(10px, 3vw, 14px);
    color: #fff; text-align: right;
    background: linear-gradient(155deg, var(--g1) 0%, var(--g2) 100%);
    border-radius: 18px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 -18px 30px -18px rgba(0,0,0,.35);
    transition: transform .15s ease, filter .15s ease;
}
.cat::before { /* soft light from the top corner */
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(90% 70% at 100% 0%, rgba(255,255,255,.22), transparent 60%);
}
.cat:active { transform: scale(.95); filter: brightness(1.08); }
.cat-glyph { position: relative; width: clamp(30px, 9vw, 38px); height: clamp(30px, 9vw, 38px); }
.cat-glyph svg { width: 100%; height: 100%; display: block; }
.cat-glyph img { width: 100%; height: 100%; display: block; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0,0,0,.18)); }
.cat-text { position: relative; display: flex; flex-direction: column; min-width: 0; max-width: 100%; }
.cat-name {
    display: block; position: relative; font-weight: 700; font-size: clamp(12.5px, 3.6vw, 14.5px); line-height: 1.35;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
    text-shadow: 0 1px 2px rgba(0,0,0,.18);
}
.cat-soon {
    position: absolute; top: clamp(8px, 2.4vw, 11px); left: clamp(8px, 2.4vw, 11px);
    font-size: 10px; font-weight: 600; line-height: 1; padding: 4px 6px; border-radius: 6px;
    background: rgba(255,255,255,.14); color: var(--frost);
}
.cat-xbox { --g1: #34C05A; --g2: #15813A; }
.cat-playstation { --g1: #3B8CFF; --g2: #1A4ECC; }
.cat-apps { --g1: #FF72B0; --g2: #C33683; }
.cat-rental { --g1: #A983FF; --g2: #6A3FDB; }
.cat-pro { --g1: #F7C24C; --g2: #C88A10; }
.cat-dns { --g1: #3ec8ea; --g2: #1577b0; }

/* sub categories (Xbox / PlayStation): the same tile, two across */
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.choices .cat { aspect-ratio: 4 / 3; }
.cat-sub { display: block; font-size: 12px; opacity: .85; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- shelf (horizontal products) ---------- */
.shelf {
    display: flex; gap: 10px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity;
    margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter) 6px;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; touch-action: pan-x pan-y;
}
.shelf.dragging { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.shelf.dragging .card { pointer-events: none; }
.shelf img { -webkit-user-drag: none; user-select: none; }
.head-end { display: flex; align-items: center; gap: 10px; }
.shelf-nav { display: none; gap: 6px; }
.shelf-nav button {
    width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center;
    background: var(--deep); border: 1px solid var(--rim); color: var(--frost);
    transition: opacity .2s, background .2s;
}
.shelf-nav button:hover:not(:disabled) { background: var(--deep-2); }
.shelf-nav button:disabled { opacity: .35; cursor: default; }
.shelf-nav .i { width: 16px; height: 16px; }
.i.flip { transform: scaleX(-1); }
@media (hover: hover) and (pointer: fine) {
    .shelf-nav:not([hidden]) { display: flex; }
    .shelf { cursor: grab; }
}
.shelf::-webkit-scrollbar { display: none; }
.card {
    flex: 0 0 142px; scroll-snap-align: start; text-align: right;
    display: flex; flex-direction: column; gap: 8px;
}
.card .thumb { width: 142px; height: 142px; --notch: 14px; }
.card-name { font-weight: 600; font-size: 13px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 39px; }
.card-price { font-size: 12.5px; color: var(--mist); }
.card-price b { color: var(--frost); font-weight: 700; font-size: 13.5px; }

/* ---------- thumbs ---------- */
.thumb {
    --c: var(--cobalt);
    position: relative; flex: none;
    width: 56px; height: 56px;
    display: grid; place-items: center;
    background: color-mix(in srgb, var(--c) 22%, var(--deep));
    color: var(--c);
    clip-path: polygon(var(--notch) 0, 100% 0, 100% 100%, 0 100%, 0 var(--notch));
    border-radius: 0 10px 10px 10px;
    overflow: hidden;
}
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .4s ease; }

/* ---------- picture loading (shimmer + spinning arc, like a video loading on Instagram) ---------- */
.thumb { --ldr: 18px; }
.card .thumb { --ldr: 30px; }
.slide { --ldr: 34px; }
.is-loading {
    background-image: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.08) 42%, rgba(255,255,255,.17) 50%, rgba(255,255,255,.08) 58%, transparent 70%);
    background-size: 300% 100%; background-repeat: no-repeat;
    animation: shimmer 1.5s linear infinite;
}
@keyframes shimmer { from { background-position: 130% 0; } to { background-position: -30% 0; } }
.is-loading > .i, .is-loaded > .i { opacity: 0; }
.is-loading > img { opacity: 0; }
.ldr { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 1; }
.ldr svg { width: var(--ldr); height: var(--ldr); animation: ldr-turn 1.4s linear infinite; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.ldr svg { overflow: visible; background: radial-gradient(circle, rgba(10,16,48,.35) 0 58%, transparent 60%); border-radius: 50%; }
.ldr circle {
    fill: none; stroke: #fff; stroke-width: 4.5; stroke-linecap: round;
    stroke-dasharray: 12 150; stroke-dashoffset: 0;
    animation: ldr-arc 1.4s ease-in-out infinite;
}
@keyframes ldr-turn { to { transform: rotate(360deg); } }
@keyframes ldr-arc {
    0%   { stroke-dasharray: 12 150; stroke-dashoffset: 0; }
    50%  { stroke-dasharray: 90 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90 150; stroke-dashoffset: -124; }
}
.slide.is-loading { background-color: var(--deep); }
.slide > img { transition: opacity .4s ease; }
@media (prefers-reduced-motion: reduce) {
    .is-loading { animation: none; }
    .ldr svg, .ldr circle { animation-duration: 2.4s; }
}
.thumb .i { width: 26px; height: 26px; }
.card .thumb .i { width: 44px; height: 44px; stroke-width: 1.3; }
.c-xbox { --c: var(--xbox); } .c-ps { --c: var(--ps); } .c-gold { --c: var(--gold); }
.c-rent { --c: var(--rent); } .c-apps { --c: var(--apps); } .c-dns { --c: var(--dns); }

/* ---------- rows (lists) ---------- */
.rows { display: flex; flex-direction: column; }
.row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--rim);
    text-align: right; width: 100%;
}
.row:last-child { border-bottom: 0; }
.row:active { background: linear-gradient(to left, var(--deep), transparent); }
.row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { font-weight: 600; font-size: 14.5px; line-height: 1.5; }
.row-sub { font-size: 12.5px; color: var(--mist); line-height: 1.5; }
.row-sub.clamp { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.price { font-weight: 700; font-size: 14.5px; white-space: nowrap; }
.price small { font-weight: 400; font-size: 11px; color: var(--mist); margin-right: 3px; }
.from { font-size: 11px; color: var(--mist); }

/* ---------- empty / skeleton ---------- */
.empty { text-align: center; padding: 48px 20px 24px; color: var(--mist); }
.empty .i { width: 40px; height: 40px; color: var(--dim); margin: 0 auto 12px; stroke-width: 1.3; }
.empty strong { display: block; color: var(--frost); font-size: 15px; margin-bottom: 4px; }
.empty .btn { margin-top: 16px; }
.sk { background: linear-gradient(90deg, var(--deep) 0%, var(--deep-2) 50%, var(--deep) 100%); background-size: 200% 100%; animation: sk 1.2s linear infinite; border-radius: 6px; }
@keyframes sk { to { background-position: -200% 0; } }
.sk-row { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rim); }
.sk-row .sk-a { width: 56px; height: 56px; border-radius: 10px; }
.sk-row .sk-b { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.sk-line { height: 11px; }


/* ---------- product ---------- */
.pd-media { margin-top: 6px; }
.pd-media .thumb { width: 100%; height: auto; aspect-ratio: 16 / 10; --notch: 18px; border-radius: 0 14px 14px 14px; }
.pd-media .thumb .i { width: 64px; height: 64px; stroke-width: 1.2; }
.pd-name { font-size: 21px; font-weight: 900; line-height: 1.55; margin: 16px 0 6px; }
.pd-desc { color: var(--mist); font-size: 13.5px; line-height: 1.9; white-space: pre-line; }
.pd-desc.clamped { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

.options { display: flex; flex-direction: column; gap: 8px; }
.option {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 14px;
    background: var(--deep); border: 1.5px solid var(--deep);
    border-radius: var(--r); text-align: right; width: 100%;
    transition: border-color .15s, background .15s;
}
.option-radio { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--dim); flex: none; position: relative; }
.option-name { flex: 1; font-size: 13.5px; line-height: 1.55; }
.option .price { font-size: 14px; }
.option.selected { border-color: var(--cobalt); background: var(--deep-2); }
.option.selected .option-radio { border-color: var(--cobalt); }
.option.selected .option-radio::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--cobalt); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 3px 10px; border-radius: 6px; background: var(--deep); color: var(--frost); border: 1px solid var(--rim); }
#pd-games .link { margin-top: 8px; }

/* ---------- dock (sticky action bar) ---------- */
.dock {
    position: fixed; z-index: 25;
    inset: auto 0 calc(var(--tabbar-h) + var(--safe-b)) 0;
    display: flex; align-items: center; gap: 12px;
    padding: 10px var(--gutter);
    background: rgba(10,16,48,.96);
    border-top: 1px solid var(--rim);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.screen:not(.active) .dock { display: none; }
.dock-price { flex: 1; display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
.dock-label { font-size: 11.5px; color: var(--mist); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-price strong { font-size: 17px; font-weight: 700; white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 46px; padding: 0 18px;
    border-radius: var(--r);
    font-weight: 600; font-size: 14.5px; white-space: nowrap;
    text-decoration: none;
    transition: background .15s, transform .1s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--cobalt); color: #fff; }
.btn-primary:active { background: var(--cobalt-press); }
.btn-primary:disabled { opacity: .45; }
.btn-ghost { background: var(--deep-2); color: var(--frost); border: 1px solid var(--rim); height: 42px; padding: 0 14px; font-size: 13.5px; }
.btn .i { width: 18px; height: 18px; }

/* ---------- cart ---------- */
.cart-row { align-items: flex-start; }
.cart-row .row-body { gap: 6px; }
.cart-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stepper { display: inline-flex; align-items: center; background: var(--deep); border: 1px solid var(--rim); border-radius: 10px; height: 34px; }
.stepper button { width: 34px; height: 32px; display: grid; place-items: center; color: var(--frost); }
.stepper button .i { width: 16px; height: 16px; }
.stepper button.danger { color: var(--coral); }
.stepper span { min-width: 26px; text-align: center; font-weight: 700; font-size: 14px; }
.unit { font-size: 11.5px; color: var(--mist); }
.row.removing { opacity: 0; transform: translateX(30px); transition: opacity .2s, transform .2s; }

/* ---------- checkout ---------- */
.group {
    background: var(--deep); border-radius: var(--r);
    padding: 14px; margin-bottom: 12px;
    display: flex; flex-direction: column; gap: 10px;
}
.group-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.group-head .i { color: var(--cobalt); width: 18px; height: 18px; }
.line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; color: var(--mist); }
.line strong { color: var(--frost); font-weight: 600; white-space: nowrap; }
.line-item span { color: var(--frost); }
.line-item small { color: var(--mist); }
.line-total { border-top: 1px dashed var(--rim); padding-top: 10px; }
.line-total strong { font-size: 15px; font-weight: 700; }
.line b { font-weight: 600; color: var(--amber); }

.inline-field { display: flex; gap: 8px; }
.inline-field input, .field {
    flex: 1; min-width: 0; height: 42px; padding: 0 12px;
    background: var(--night); border: 1px solid var(--rim); border-radius: 10px;
    color: var(--frost); outline: 0; font-size: 14px;
}
textarea.field { height: auto; padding: 10px 12px; resize: none; line-height: 1.7; width: 100%; }
.inline-field input:focus, .field:focus { border-color: var(--cobalt); }
.inline-field input:disabled { opacity: .6; }
.field-msg { font-size: 12.5px; min-height: 0; }
.field-msg:empty { display: none; }
.field-msg.ok { color: var(--mint); } .field-msg.err { color: var(--coral); }
.counter { font-size: 11px; color: var(--dim); text-align: left; margin-top: -4px; }

.switch-row { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch-text { flex: 1; display: flex; flex-direction: column; line-height: 1.5; }
.switch-text span { font-weight: 600; }
.switch-text small { color: var(--mist); font-size: 12px; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { width: 42px; height: 24px; border-radius: 12px; background: var(--rim); position: relative; transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--frost); transition: right .2s; }
.switch-row input:checked + .switch { background: var(--cobalt); }
.switch-row input:checked + .switch::after { right: 21px; }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--cobalt); outline-offset: 2px; }

/* the destination card: the one loud thing on the page */
.bank-card {
    position: relative; width: 100%;
    aspect-ratio: 1.75 / 1;
    padding: 18px 18px 16px;
    display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 6px;
    color: #fff; text-align: right;
    clip-path: polygon(22px 0, 100% 0, 100% 100%, 0 100%, 0 22px);
    border-radius: 0 16px 16px 16px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.14) 0 28%, transparent 28% 100%),
        repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 1px, transparent 1px 22px),
        linear-gradient(160deg, #4C76FF 0%, #2443C7 100%);
    margin-bottom: 14px;
}
.bank-chip { position: absolute; top: 18px; right: 18px; width: 38px; height: 28px; border-radius: 5px; background: linear-gradient(135deg, #FFD98A, #C9952F); }
.bank-chip::after { content: ""; position: absolute; inset: 9px 0; border-top: 1px solid rgba(0,0,0,.25); border-bottom: 1px solid rgba(0,0,0,.25); }
.bank-number { font-family: "YekanBakh", monospace; font-weight: 700; font-size: clamp(19px, 6.2vw, 25px); letter-spacing: .06em; text-align: left; white-space: nowrap; }
.bank-holder { font-size: 13.5px; opacity: .9; }
.bank-copy { position: absolute; top: 16px; left: 16px; display: flex; align-items: center; gap: 5px; font-size: 12px; background: rgba(10,16,48,.35); padding: 4px 10px; border-radius: 6px; }
.bank-copy .i { width: 15px; height: 15px; }
.bank-card.copied .bank-copy { background: var(--mint); color: var(--night); font-weight: 600; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; background: var(--deep); border-radius: 10px; padding: 3px; margin-bottom: 10px; }
.seg { height: 38px; border-radius: 8px; font-weight: 600; font-size: 13.5px; color: var(--mist); }
.seg.active { background: var(--deep-2); color: var(--frost); box-shadow: inset 0 0 0 1px var(--rim); }

.drop {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 20px 14px; border: 1.5px dashed var(--rim); border-radius: var(--r);
    color: var(--mist); text-align: center; cursor: pointer; margin-bottom: 12px;
}
.drop .i { width: 30px; height: 30px; color: var(--cobalt); margin-bottom: 6px; }
.drop span { color: var(--frost); font-weight: 600; }
.drop small { font-size: 12px; }
.receipt-preview { position: relative; margin-bottom: 12px; }
.receipt-preview img { width: 100%; max-height: 260px; object-fit: contain; background: var(--deep); border-radius: var(--r); }
.receipt-preview .icon-btn { position: absolute; top: 8px; left: 8px; background: rgba(10,16,48,.8); }
#pay-text { margin-bottom: 12px; }
#pay-text .field { width: 100%; }

.progress { height: 6px; background: var(--deep); border-radius: 3px; overflow: hidden; margin: 6px 0 12px; }
.progress-bar { height: 100%; width: 0; background: var(--cobalt); transition: width .2s; }

/* ---------- orders ---------- */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: currentColor; }
.st-pending_admin_approval { color: var(--amber); }
.st-accepted { color: var(--cobalt); }
.st-completed { color: var(--mint); }
.st-rejected { color: var(--coral); }
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 16px; }
.pager button { min-width: 36px; height: 36px; border-radius: 9px; background: var(--deep); border: 1px solid var(--rim); font-weight: 600; padding: 0 10px; }
.pager button.on { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }

/* order detail: the four steps an order really goes through */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 8px 0 18px; }
.step { display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; color: var(--dim); text-align: center; }
.step::before { content: ""; height: 4px; border-radius: 2px; background: var(--rim); }
.step.done { color: var(--frost); }
.step.done::before { background: var(--mint); }
.step.now { color: var(--frost); font-weight: 600; }
.step.now::before { background: var(--amber); }
.steps.rejected .step.now::before { background: var(--coral); }
.order-id { font-family: "YekanBakh", monospace; font-size: 12px; color: var(--mist); direction: ltr; word-break: break-all; }
.account {
    background: var(--night); border: 1px dashed var(--mint); border-radius: 10px;
    padding: 12px; white-space: pre-wrap; direction: ltr; text-align: left;
    font-size: 13px; line-height: 1.7; word-break: break-word;
}
.order-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 4px; }

/* ---------- profile ---------- */
.balance {
    margin-top: 10px; padding: 22px 18px;
    background: var(--deep);
    clip-path: polygon(18px 0, 100% 0, 100% 100%, 0 100%, 0 18px);
    border-radius: 0 16px 16px 16px;
    display: flex; flex-direction: column; gap: 4px;
    position: relative;
}
.balance::after { content: ""; position: absolute; top: 0; right: 0; left: 18px; height: 3px; background: var(--cobalt); }
.balance-label { color: var(--mist); font-size: 13px; }
.balance-amount { font-size: 32px; font-weight: 900; line-height: 1.4; display: flex; align-items: baseline; gap: 6px; }
.balance-amount small { font-size: 13px; color: var(--mist); font-weight: 400; }
.balance-note { color: var(--dim); font-size: 12px; }
.menu { margin-top: 18px; display: flex; flex-direction: column; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 14px 2px; border-bottom: 1px solid var(--rim); text-align: right; font-size: 14.5px; }
.menu-item:last-child { border-bottom: 0; }
.menu-item span { flex: 1; }
.menu-item .i { color: var(--cobalt); }
.menu-item .chev { color: var(--dim); width: 18px; height: 18px; }
.footnote { text-align: center; color: var(--dim); font-size: 11.5px; margin-top: 28px; line-height: 1.8; }

/* ---------- tab bar ---------- */
.tabbar {
    position: fixed; z-index: 30; inset: auto 0 0 0;
    height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
    display: grid; grid-template-columns: repeat(4, 1fr);
    background: var(--night); border-top: 1px solid var(--rim);
}
.tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--dim); font-size: 11px; font-weight: 600; }
.tab .i { width: 22px; height: 22px; }
.tab.active { color: var(--frost); }
.tab.active::before { content: ""; position: absolute; top: -1px; width: 22px; height: 3px; background: var(--cobalt); }
.tab.active .i { color: var(--cobalt); }
.badge { position: absolute; top: 8px; right: calc(50% - 22px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 6px; background: var(--coral); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

/* ---------- toast ---------- */
.toast {
    position: fixed; z-index: 70; left: var(--gutter); right: var(--gutter);
    bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px);
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; border-radius: var(--r);
    background: var(--frost); color: var(--night); font-weight: 600; font-size: 13.5px;
    transform: translateY(16px); opacity: 0; pointer-events: none;
    transition: transform .25s ease, opacity .25s ease;
}
.toast.show { transform: none; opacity: 1; pointer-events: auto; }
.toast.err { background: var(--coral); color: #fff; }
.toast span { flex: 1; }
.toast button { color: var(--cobalt); font-weight: 700; }
body.dock-open .toast { bottom: calc(var(--tabbar-h) + var(--safe-b) + 84px); }

/* ---------- gates ---------- */
.gate { position: fixed; inset: 0; z-index: 90; background: var(--night); display: grid; place-items: center; padding: 24px; }
.gate-box { max-width: 340px; width: 100%; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.gate-logo { width: 200px; }
.gate-icon { width: 64px; height: 64px; display: grid; place-items: center; background: var(--deep); color: var(--amber); clip-path: polygon(14px 0, 100% 0, 100% 100%, 0 100%, 0 14px); border-radius: 0 14px 14px 14px; }
.gate-icon .i { width: 30px; height: 30px; }
.gate h1 { font-size: 22px; }
.gate p { color: var(--mist); }
.gate-steps { text-align: right; align-self: stretch; padding: 12px 34px 12px 14px; background: var(--deep); border-radius: var(--r); line-height: 2.1; }
.gate .btn { width: 100%; margin-top: 8px; }

@media (min-width: 560px) {
    .screens, .header, .tabbar, .dock { max-width: 560px; margin: 0 auto; }
    .toast { max-width: 528px; margin: 0 auto; }
    .tiles { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
