:root {
    --bg: #070d18;
    --card: #121c2e;
    --line: rgba(255, 255, 255, 0.08);
    --text: #f4f7fb;
    --muted: #8ea0b8;
    --blue: #2f89ff;
    --price: #7ec8ff;
    --ok: #3ddc97;
    --danger: #ff6b81;
    --app-top: calc(56px + env(safe-area-inset-top, 0px));
}
* { box-sizing: border-box; }
html, body {
    overscroll-behavior: none;
}
body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background:
        radial-gradient(520px 240px at 100% -8%, rgba(47, 137, 255, 0.28), transparent 60%),
        var(--bg);
}
button, input { font: inherit; }
button { border: 0; cursor: pointer; color: inherit; background: none; }
.wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: var(--app-top) 16px calc(28px + env(safe-area-inset-bottom)) 22px;
}
main { flex: 1; }
.footer {
    margin-top: 28px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.06em;
}
.footer a {
    color: #9ec9ff;
    font-weight: 700;
    text-decoration: none;
}
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    overflow: hidden;
    display: grid;
    place-items: center;
    font-weight: 800;
    background: #101826;
    box-shadow: 0 8px 18px rgba(10, 111, 232, 0.28);
}
.logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
h1 { margin: 0; font-size: 17px; letter-spacing: -0.03em; }
.links {
    display: flex;
    gap: 8px;
    margin: -4px 0 14px;
}
.links a {
    flex: 1;
    text-align: center;
    text-decoration: none;
    color: #d7e7ff;
    font-size: 13px;
    font-weight: 700;
    padding: 9px 8px;
    border-radius: 12px;
    background: rgba(47, 137, 255, 0.12);
    border: 1px solid rgba(126, 200, 255, 0.18);
}
.cart-btn {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
}
.cart-btn.active { background: #0a6fe8; border-color: transparent; }
.cart-btn svg { width: 22px; height: 22px; }
.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ff4d6d;
    color: white;
    font-size: 11px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}
.search {
    display: flex;
    align-items: center;
    gap: 8px;
}
.search input {
    width: 100%;
    border: 1px solid var(--line);
    background: rgba(18, 28, 46, 0.92);
    color: var(--text);
    border-radius: 14px;
    padding: 12px 14px;
    outline: none;
}
.search input:focus { border-color: rgba(94, 176, 255, 0.7); }
.done {
    flex: none;
    color: #9ec9ff;
    font-weight: 800;
    padding: 8px 4px;
}
.section { margin-top: 18px; }
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 0 0 10px;
}
.section-head h2 { margin: 0; font-size: 17px; }
.rail, .results {
    background: #17304d;
    border: 1px solid rgba(150, 196, 255, 0.2);
    border-radius: 20px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.rail {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: auto;
    grid-auto-columns: 132px;
    gap: 12px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    margin: 0;
    padding: 14px 14px 14px 18px;
    scroll-padding-left: 18px;
}
.rail.rows-2 { grid-template-rows: auto auto; }
.rail::-webkit-scrollbar { display: none; }
.results {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 10px;
    padding: 12px;
}
.tile {
    scroll-snap-align: start;
    min-width: 0;
    content-visibility: auto;
    contain-intrinsic-size: 148px 190px;
    padding: 8px;
    border: 1px solid rgba(186, 214, 255, 0.38);
    border-radius: 16px;
    background: rgba(7, 13, 24, 0.45);
}
.art {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: #0c1626;
    aspect-ratio: 1;
}
.art img, .art .missing {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.art .missing {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}
.buy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
}
.add {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 999px;
    background: #0a6fe8;
    color: white;
    line-height: 0;
    display: grid;
    place-items: center;
}
.add svg {
    width: 16px;
    height: 16px;
    display: block;
}
.add.in { background: rgba(255, 255, 255, 0.12); }
.tile h3 {
    margin: 8px 0 2px;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.25;
    height: 2.5em;
    overflow: hidden;
}
.price { color: var(--price); font-size: 13px; font-weight: 750; }
.sale {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(61, 220, 151, 0.14);
    color: var(--ok);
    font-size: 10px;
    font-weight: 800;
}
.cart-list { display: grid; gap: 10px; margin-top: 8px; }
.cart-item {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 8px;
    border-radius: 16px;
    background: var(--card);
    border: 1px solid var(--line);
}
.cart-item img, .cart-item .missing {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 10px;
    background: #0c1626;
}
.cart-item .missing { display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.cart-item h3 { margin: 0 0 4px; font-size: 14px; line-height: 1.3; height: auto; }
.remove { color: var(--muted); font-size: 13px; padding: 8px; }
.bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 0 12px;
    color: var(--muted);
    font-size: 13px;
}
.linkish { color: #9ec9ff; font-weight: 700; }
.total, .pay, .panel {
    border-radius: 16px;
}
.total {
    margin-top: 14px;
    padding: 14px;
    display: flex;
    justify-content: space-between;
    background: rgba(47, 137, 255, 0.12);
    border: 1px solid rgba(126, 200, 255, 0.22);
    font-weight: 800;
}
.pay {
    width: 100%;
    margin-top: 10px;
    padding: 14px;
    color: white;
    font-size: 16px;
    font-weight: 800;
    background: linear-gradient(180deg, #3b95ff, #0a6fe8);
}
.pay:disabled { opacity: 0.55; }
.panel {
    text-align: center;
    padding: 34px 16px;
    background: rgba(18, 28, 46, 0.8);
    border: 1px solid var(--line);
}
.panel h2 { margin: 0 0 8px; }
.muted { color: var(--muted); font-size: 14px; }
.err { color: var(--danger); }
.ghost, .more, .back {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    font-weight: 700;
}
.more, .back { width: 100%; color: #d7e7ff; }
.plans { display: grid; gap: 8px; }
.plan {
    padding: 14px;
    border-radius: 16px;
    background: #17304d;
    border: 1px solid rgba(150, 196, 255, 0.2);
}
.plan-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}
.plan-cover {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    object-fit: cover;
    display: block;
    border-radius: 10px;
    background: #0c1626;
}
.plan-copy { display: grid; gap: 2px; min-width: 0; }
.plan strong { display: block; font-size: 16px; }
.plan span { color: var(--muted); font-size: 12px; }
.periods { display: grid; gap: 8px; margin-top: 12px; }
.period {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(7, 13, 24, 0.35);
}
.period-info { display: grid; gap: 2px; }
.period .price { font-size: 14px; }
