/* Cars Empire customer app. Fixed shell, one scrolling container, safe-area aware. */
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("fonts/barlow-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("fonts/barlow-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url("fonts/barlow-700.woff2") format("woff2"); }

:root {
    color-scheme: light dark;
    /* Brand, taken from the logo: royal blue, signal yellow, black */
    --brand: #0542d4;
    --brand-dark: #0e308f;
    --brand-ink: #ffffff;
    --brand-text: #0542d4;      /* blue used as text or icon colour */
    --brand-soft: #e9efff;      /* blue tint for bands and tiles */
    --accent: #facb0b;          /* the one call-to-action colour */
    --accent-dark: #e0b400;
    --accent-ink: #0a0a0a;
    --accent-soft: #fff6cf;
    --accent-text: #8a6700;     /* yellow dark enough to read on a light tint */
    --bg: #ffffff;
    --surface: #ffffff;
    --tile: #f4f6fa;
    --ink: #0a0a0a;
    --muted: #6b7385;
    --line: #e6e9f0;
    --good: #15803d;
    --warn: #b45309;
    --bad: #b91c1c;
    --shadow: 0 2px 10px rgba(16, 24, 40, 0.08);
    --shadow-up: 0 -4px 18px rgba(16, 24, 40, 0.08);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --header-h: 64px;
    --tabs-h: 66px;
}
@media (prefers-color-scheme: dark) {
    :root {
        --brand-text: #8fb0ff;
        --brand-soft: #131c36;
        --accent-soft: #2a2410;
        --accent-text: #facb0b;
        --bg: #0b0d12;
        --surface: #161a23;
        --tile: #1c212c;
        --ink: #f3f5f9;
        --muted: #98a1b3;
        --line: #272d3a;
        --good: #4ade80;
        --warn: #fbbf24;
        --bad: #f87171;
        --shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
        --shadow-up: 0 -4px 18px rgba(0, 0, 0, 0.45);
    }
}

*, *::before, *::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    user-select: none;
    -webkit-user-select: none;
    font-family: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Arabic", Tahoma, sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.45;
    background: var(--bg);
    color: var(--ink);
}
/* Text people read or copy stays selectable */
p, li, h1, h2, h3, input, textarea, .selectable {
    user-select: text;
    -webkit-user-select: text;
    -webkit-touch-callout: default;
}
a { color: inherit; text-decoration: none; }
button, a, input, select { touch-action: manipulation; font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
svg { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

#app { position: relative; height: 100%; background: var(--bg); }

/* ---------- header ---------- */
.app-header {
    position: fixed;
    inset: 0 0 auto 0;
    height: calc(var(--header-h) + var(--safe-top));
    padding: var(--safe-top) calc(16px + var(--safe-right)) 0 calc(16px + var(--safe-left));
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg);
    color: var(--ink);
    z-index: 30;
}
.app-header h1 {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
    -webkit-user-select: none;
}
/* Screens reached from the tab bar open with a large title, like the reference app */
.app-header.root h1 { font-size: 1.5rem; }
.brand-mark { flex: none; width: 44px; height: 44px; border-radius: 12px; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.header-search {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 46px;
    padding: 0 12px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--muted);
}
.header-search:focus-within { border-color: var(--brand-text); }
.header-search svg { width: 22px; height: 22px; }
.header-search input {
    flex: 1;
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    outline: none;
}
.header-search input:focus { outline: none; }
.header-search input::-webkit-search-cancel-button { display: none; }
.icon-btn, .cart-btn {
    position: relative;
    flex: none;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 12px;
    color: inherit;
}
.icon-btn { background: var(--tile); }
.icon-btn:active { filter: brightness(0.94); }
.cart-btn { background: var(--accent); color: var(--accent-ink); }
.cart-btn:active { background: var(--accent-dark); }
[dir="rtl"] #back-btn svg, [dir="rtl"] .flip { transform: scaleX(-1); }
.badge {
    position: absolute;
    top: -5px;
    inset-inline-end: -5px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border: 2px solid var(--bg);
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

/* ---------- notices ---------- */
.notice {
    position: fixed;
    inset: calc(var(--header-h) + var(--safe-top)) 0 auto 0;
    z-index: 25;
    padding: 8px 16px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.notice-offline { background: #0a0a0a; color: var(--accent); }
.notice-update { background: var(--brand); color: var(--brand-ink); }
.notice-update button { border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 8px; background: transparent; color: inherit; padding: 6px 12px; min-height: 36px; }
body.has-notice .scroll-container { padding-top: calc(var(--header-h) + var(--safe-top) + 40px); }

/* ---------- scrolling content ---------- */
.scroll-container {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding: calc(var(--header-h) + var(--safe-top)) var(--safe-right) calc(var(--tabs-h) + var(--safe-bottom) + var(--keyboard-inset, 0px)) var(--safe-left);
    outline: none;
    scrollbar-width: none;
}
.scroll-container::-webkit-scrollbar { display: none; }
.page { padding: 8px 16px 24px; max-width: 720px; margin: 0 auto; }
.page > * + * { margin-top: 16px; }
/* Room for a pinned action bar above the tab bar */
.page.has-cta { padding-bottom: 104px; }

/* ---------- tab bar ---------- */
.tab-bar {
    position: fixed;
    inset: auto 0 0 0;
    height: calc(var(--tabs-h) + var(--safe-bottom));
    padding: 0 var(--safe-right) var(--safe-bottom) var(--safe-left);
    display: flex;
    background: var(--surface);
    border-radius: 22px 22px 0 0;
    box-shadow: var(--shadow-up);
    z-index: 30;
}
.tab-bar a {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 44px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
}
.tab-bar svg { width: 26px; height: 26px; }
.tab-bar a.active { color: var(--brand-text); font-weight: 700; }
/* The current tab's icon is solid; its inner details are cut out in the bar's colour */
.tab-bar a.active svg { fill: currentColor; }
.tab-bar a.active svg .keep { fill: var(--surface); stroke: var(--surface); }
.keyboard-open .tab-bar { display: none; }
.keyboard-open .scroll-container { padding-bottom: calc(var(--keyboard-inset, 0px) + 16px); }

/* ---------- building blocks ---------- */
.card { background: var(--surface); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); }
.card > * + * { margin-top: 10px; }
h2 { font-size: 1.2rem; font-weight: 700; margin: 0; line-height: 1.25; }
h3 { font-size: 1.05rem; font-weight: 700; margin: 0; }
p { margin: 0; }
.muted { color: var(--muted); font-size: 0.9rem; }
.row { display: flex; align-items: center; gap: 12px; }
.row > .grow { flex: 1; min-width: 0; }
.grow { min-width: 0; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.price { font-weight: 700; font-size: 1.05rem; }
.price del { color: var(--muted); font-weight: 500; font-size: 0.875rem; margin-inline-start: 6px; }
.pill { flex: none; display: inline-block; white-space: nowrap; padding: 3px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; background: var(--tile); color: var(--ink); }
.pill.good { background: rgba(21, 128, 61, 0.14); color: var(--good); }
.pill.warn { background: rgba(180, 83, 9, 0.14); color: var(--warn); }
.pill.bad { background: rgba(185, 28, 28, 0.14); color: var(--bad); }
.pill.brand { background: var(--accent); color: var(--accent-ink); }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.empty .art { width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-text); display: grid; place-items: center; }
.empty .art svg { width: 38px; height: 38px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    padding: 0 18px;
    border: 1.5px solid transparent;
    border-radius: 14px;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 700;
    font-size: 1.05rem;
}
.btn:active { background: var(--accent-dark); }
.btn[disabled] { opacity: 0.55; }
.btn.block { display: flex; width: 100%; }
.btn.ghost { background: transparent; color: var(--brand-text); border-color: var(--line); }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--line); }
.btn.ghost:active, .btn.danger:active { background: var(--tile); }
.btn.small { min-height: 44px; padding: 0 14px; font-size: 0.9rem; border-radius: 12px; }

label { display: block; font-size: 0.9rem; color: var(--muted); margin-bottom: 4px; }
input, select, textarea {
    width: 100%;
    min-height: 50px;
    padding: 10px 14px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink);
    font-size: 16px; /* below 16px iOS zooms the page on focus */
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-text); }
.field + .field { margin-top: 12px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); font-size: 1rem; margin: 0; }
.check input { width: 22px; height: 22px; min-height: 0; padding: 0; accent-color: var(--brand); }
.form-error { color: var(--bad); font-size: 0.9rem; }
.link { color: var(--brand-text); font-weight: 700; }

/* horizontal scrollers */
.h-scroll { display: flex; gap: 12px; overflow-x: auto; margin-inline: -16px; padding: 4px 16px 6px; scrollbar-width: none; overscroll-behavior-x: contain; scroll-padding-inline: 16px; }
.h-scroll::-webkit-scrollbar { display: none; }
.chip { flex: none; display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 0.9rem; font-weight: 600; white-space: nowrap; }
.chip.active { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.chip.sub { min-height: 36px; border-radius: 999px; font-size: 0.85rem; }
.chip.sub.active { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ---------- home ---------- */
/* round shortcuts under the search bar */
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; text-align: center; font-size: 13px; font-weight: 600; }
.quick a { display: block; }
.quick .dot { width: 56px; height: 56px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); }
.quick .dot svg { width: 28px; height: 28px; }
.quick a:nth-child(even) .dot { background: var(--accent-soft); color: var(--accent-text); }
.quick a:active .dot { transform: scale(0.94); }

/* promotion banners: one per swipe, with position dots */
.slides { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; scrollbar-width: none; overscroll-behavior-x: contain; }
.slides::-webkit-scrollbar { display: none; }
.slides > * { flex: none; width: 100%; scroll-snap-align: start; }
.slides.many > * { width: 92%; }
.slides img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 20px; background: var(--tile); }
/* adverts: the whole picture on a blurred copy of itself, so any shape fills the frame without bars or cropping */
.slides.ads > * { position: relative; aspect-ratio: 16 / 10; border-radius: 20px; overflow: hidden; background: var(--tile); }
.slides.ads img { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; background: none; }
.slides.ads .picture { object-fit: contain; }
.slides.ads .fill { object-fit: cover; filter: blur(22px) saturate(1.15); transform: scale(1.25); }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.dots i { width: 10px; height: 4px; border-radius: 2px; background: var(--line); transition: width 0.2s, background-color 0.2s; }
.dots i.on { width: 28px; background: var(--ink); }

/* category tiles; the first one leads to the nearest centres */
.tiles .tile { flex: none; width: 116px; min-height: 124px; padding: 14px 8px 12px; border-radius: 18px; background: var(--tile); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; font-size: 14px; font-weight: 600; line-height: 1.25; }
.tile .tile-icon { position: relative; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; color: var(--muted); font-weight: 700; overflow: hidden; }
.tile .tile-icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--tile); }
.tile .tile-icon svg { width: 40px; height: 40px; }
.tile.lead { background: var(--brand); color: #fff; }
.tile.lead .tile-icon { color: var(--accent); }
.tile:active { filter: brightness(0.95); }

/* full-width coloured sections */
.band { margin-inline: -16px; padding: 20px 16px 22px; border-radius: 26px; background: var(--tile); }
.band.blue { background: var(--brand-soft); }
.band.yellow { background: var(--accent-soft); }
.band .h-scroll { margin-top: 10px; }
.band-head { display: flex; align-items: center; gap: 10px; }
.band-head h2 { font-size: 1.45rem; }
.band.blue .band-head h2 { color: var(--brand-text); }
.band-head .go { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; }
.band.yellow .band-head .go { background: var(--ink); color: var(--bg); }
.band-head .go svg { width: 18px; height: 18px; stroke-width: 2.2; }
.band-note { margin-top: 6px; color: var(--muted); font-size: 0.95rem; }

/* ---------- deal cards ---------- */
.deal-card { position: relative; display: block; margin-top: 24px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.h-scroll .deal-card { flex: none; width: 172px; }
.deal-card:active { transform: scale(0.985); }
.deal-card .media { position: relative; aspect-ratio: 4 / 3; border-radius: 16px 16px 0 0; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-dark), var(--brand)); color: rgba(255, 255, 255, 0.85); font-size: 1.6rem; font-weight: 700; }
.deal-card .media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ribbon { position: absolute; top: 0; inset-inline-start: 10px; z-index: 1; min-width: 30px; padding: 7px 5px 12px; background: var(--accent); color: var(--accent-ink); font-size: 15px; font-weight: 700; line-height: 1.05; text-align: center; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 84%, 0 100%); }
.ribbon small { display: block; font-size: 12px; font-weight: 600; }
.rating { position: absolute; bottom: 0; inset-inline-end: 0; padding: 3px 9px; border-start-start-radius: 10px; background: rgba(10, 10, 10, 0.82); color: var(--accent); font-size: 12px; font-weight: 700; }
.deal-card .logo { position: absolute; top: -24px; left: 50%; z-index: 2; width: 52px; height: 52px; margin-left: -26px; border: 3px solid var(--surface); border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: #fff; color: #6b7385; font-size: 13px; font-weight: 700; box-shadow: 0 2px 6px rgba(16, 24, 40, 0.18); }
.deal-card .logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.deal-card .body { padding: 10px 12px 12px; }
.deal-card .merchant { color: var(--brand-text); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deal-card .title { margin-top: 2px; height: 2.6em; font-size: 14.5px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.cost { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; margin-top: 6px; }
.cost b { font-size: 1.3rem; font-weight: 700; letter-spacing: 0.3px; }
.cost del, .cost span { color: var(--muted); font-size: 0.85rem; }
.cost.big b { font-size: 1.9rem; }
.cost.big del, .cost.big span { font-size: 1rem; }
.deal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.deal-grid > .empty, .deal-grid > .more, .deal-grid > .loading { grid-column: 1 / -1; }
.deal-grid > .more { margin-top: 16px; }
@media (min-width: 560px) { .deal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* merchant logos row */
.logo-tile { flex: none; width: 78px; text-align: center; font-size: 13px; line-height: 1.25; }
.logo-tile .thumb { width: 68px; height: 68px; margin: 0 auto 6px; border-radius: 18px; background: #fff; color: #6b7385; box-shadow: var(--shadow); }
.logo-tile small { display: block; margin-top: 2px; color: var(--brand-text); font-size: 12px; font-weight: 700; }
.logo-tile span:nth-child(2) { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }

/* ---------- lists ---------- */
.list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.item { display: flex; gap: 12px; align-items: center; background: var(--surface); border-radius: 18px; padding: 12px; min-height: 76px; box-shadow: var(--shadow); }
.item:active { filter: brightness(0.97); }
.thumb { position: relative; flex: none; width: 64px; height: 64px; border-radius: 14px; background: var(--tile); display: grid; place-items: center; overflow: hidden; color: var(--muted); font-weight: 700; }
/* The picture covers the initials; if it fails to load it is removed and the initials show */
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.thumb.photo img { object-fit: cover; }
.item .title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .chev { color: var(--muted); width: 20px; height: 20px; }
.stars { color: var(--accent-text); font-size: 13px; font-weight: 700; }
.segmented { display: flex; background: var(--tile); border-radius: 14px; padding: 4px; }
.segmented button { flex: 1; min-height: 42px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-weight: 700; }
.segmented button.active { background: var(--surface); color: var(--brand-text); box-shadow: var(--shadow); }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--tile); color: var(--ink); font-size: 1.3rem; font-weight: 600; }
.stepper button:active { background: var(--line); }
.stepper span { min-width: 30px; text-align: center; font-weight: 700; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv > :last-child { flex: none; white-space: nowrap; }

/* ---------- deal and merchant screens ---------- */
.cover { position: relative; margin: -8px -16px 0; }
.cover img, .cover .blank { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.cover .blank { display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-dark), var(--brand)); color: rgba(255, 255, 255, 0.85); font-size: 2.4rem; font-weight: 700; }
.cover .ribbon { inset-inline-start: 16px; min-width: 44px; padding: 10px 8px 16px; font-size: 21px; }
.cover .ribbon small { font-size: 14px; }
.cover + .sheet { position: relative; margin-top: -22px; padding: 18px 16px 4px; margin-inline: -16px; border-radius: 24px 24px 0 0; background: var(--bg); }
.sheet > * + * { margin-top: 10px; }
.shop { display: flex; align-items: center; gap: 10px; color: var(--brand-text); font-weight: 600; }
.shop .thumb { width: 40px; height: 40px; border-radius: 50%; font-size: 12px; box-shadow: var(--shadow); }
.facts { display: flex; flex-wrap: wrap; gap: 8px; }
.fact { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; background: var(--tile); color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.fact svg { width: 16px; height: 16px; }
.shop-head { display: flex; align-items: center; gap: 14px; }
.shop-head .thumb { width: 76px; height: 76px; border-radius: 18px; box-shadow: var(--shadow); }
.shop-head h2 { font-size: 1.45rem; }
.shop-head .facts { margin-top: 6px; align-items: center; }
/* gallery pictures use the adverts' frame: shown whole on a blurred copy of themselves */
.contact-row { display: flex; align-items: flex-start; gap: 12px; }
.contact-row svg { margin-top: 1px; color: var(--brand-text); }
.contact-row > :last-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.socials, .tags { display: flex; flex-wrap: wrap; gap: 10px; }
.social { width: 48px; height: 48px; display: grid; place-items: center; border: 1.5px solid var(--ink); border-radius: 12px; color: var(--ink); }
.social:active { background: var(--tile); }
.social svg { fill: currentColor; stroke: none; }
.tag { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-text); font-size: 0.9rem; font-weight: 700; }
.tag.plain { background: var(--tile); color: var(--ink); }
.branch { padding: 12px 0; border-bottom: 1px solid var(--line); }
.branch:last-child { border-bottom: 0; padding-bottom: 0; }
.branch > * + * { margin-top: 8px; }
.btn.small svg, .btn svg { width: 20px; height: 20px; }
.fact.near { background: var(--brand-soft); color: var(--brand-text); }
.btn.locate { margin-top: 12px; background: var(--ink); color: var(--bg); }
.block-title { display: flex; align-items: center; gap: 8px; }
.block-title::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--accent); }
/* pinned action bar above the tab bar */
.cta-bar {
    position: fixed;
    inset: auto 0 calc(var(--tabs-h) + var(--safe-bottom) - 22px) 0;
    z-index: 28;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px calc(16px + var(--safe-right)) 34px calc(16px + var(--safe-left));
    border-radius: 22px 22px 0 0;
    background: var(--surface);
    box-shadow: var(--shadow-up);
}
.cta-bar .cost { flex: none; margin: 0; flex-direction: column; gap: 0; }
.cta-bar .cost small { color: var(--muted); font-size: 12px; }
.cta-bar .btn { flex: 1; }

/* ---------- orders ---------- */
.order { padding: 0; overflow: hidden; }
.order > * + * { margin-top: 0; }
.order-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; padding: 16px; }
.order-facts div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; font-size: 0.95rem; }
.order-facts dt { font-weight: 700; }
.order-facts dd { margin: 0; color: var(--muted); font-weight: 600; overflow-wrap: anywhere; }
.order-facts dl, dl.order-facts { margin: 0; }
.order-actions { display: flex; margin: 0 16px; border-top: 1px solid var(--line); }
.order-actions > * { flex: 1; min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 0.95rem; }
.order-actions > * + * { border-inline-start: 1px solid var(--line); }
.order-actions .main { color: var(--brand-text); }
.order-actions .warn { color: var(--bad); }
.order-actions svg { width: 22px; height: 22px; transition: transform 0.2s; }
.order.open .order-actions .main svg { transform: rotate(180deg); }
.order-lines { margin: 0 12px 12px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.order:not(.open) .order-lines { display: none; }

/* ---------- coupons ---------- */
.ticket { position: relative; display: flex; align-items: stretch; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.ticket .stub { flex: none; width: 92px; display: grid; place-items: center; padding: 12px; background: var(--brand); color: #fff; }
.ticket .stub img { width: 68px; height: 68px; border-radius: 8px; background: #fff; padding: 3px; }
.ticket.off .stub { background: var(--muted); }
.ticket .grow { flex: 1; padding: 12px 14px; border-inline-start: 2px dashed var(--line); }
.ticket .title { font-weight: 700; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.ticket .pill { margin-top: 6px; }
/* the two notches where a ticket tears */
.ticket::before, .ticket::after { content: ""; position: absolute; inset-inline-start: 83px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); }
.ticket::before { top: -9px; }
.ticket::after { bottom: -9px; }
.pass { padding: 0; overflow: hidden; text-align: center; }
.pass > * + * { margin-top: 0; }
.pass-head { padding: 18px 16px; background: var(--brand); color: #fff; }
.pass-head p { color: rgba(255, 255, 255, 0.8); font-size: 0.95rem; }
.pass-body { padding: 18px 16px; border-bottom: 2px dashed var(--line); }
.pass-body > * + * { margin-top: 10px; }
.pass-foot { padding: 14px 16px; }
.qr { width: 220px; height: 220px; margin: 0 auto; background: #fff; border-radius: 16px; padding: 10px; }
.code { text-align: center; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 1.3rem; font-weight: 700; letter-spacing: 1px; direction: ltr; }
.banner { border-radius: 16px; padding: 14px 16px; font-weight: 600; }
.banner.good { background: rgba(21, 128, 61, 0.14); color: var(--good); }
.banner.warn { background: rgba(180, 83, 9, 0.14); color: var(--warn); }
.banner.bad { background: rgba(185, 28, 28, 0.14); color: var(--bad); }

/* ---------- account and wallet ---------- */
.hello { display: flex; align-items: center; gap: 12px; }
.hello .avatar { flex: none; width: 60px; height: 60px; border-radius: 50%; overflow: hidden; border: 2px solid var(--line); }
.hello .avatar img { width: 100%; height: 100%; object-fit: cover; }
.hello small { display: block; color: var(--muted); font-size: 0.95rem; }
.hello strong { display: block; font-size: 1.3rem; font-weight: 700; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wallet-band { display: flex; align-items: center; gap: 14px; margin-inline: -16px; padding: 14px 20px; background: var(--brand); color: #fff; }
.wallet-band .box { flex: none; width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.16); color: var(--accent); }
.wallet-band small { display: block; font-size: 0.95rem; opacity: 0.85; }
.wallet-band strong { display: block; font-size: 1.25rem; font-weight: 700; }
.wallet-band .grow { flex: 1; }
.wallet-card { padding: 22px 20px; border-radius: 22px; background: linear-gradient(135deg, var(--brand-dark), var(--brand)); color: #fff; box-shadow: var(--shadow); }
.wallet-card small { font-size: 0.95rem; opacity: 0.85; }
.wallet-card strong { display: block; margin: 4px 0 10px; font-size: 2.2rem; font-weight: 700; line-height: 1.1; }
.wallet-card p { font-size: 0.9rem; opacity: 0.85; }
.shortcuts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; text-align: center; font-size: 14px; font-weight: 600; }
.shortcuts .box { width: 54px; height: 54px; margin: 0 auto 8px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); }
.shortcuts a:active .box { transform: scale(0.94); }
.menu { margin-inline: -16px; padding: 6px 0; border-top: 8px solid var(--tile); }
.menu a, .menu button { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 58px; padding: 0 20px; border: 0; background: transparent; color: var(--ink); font-size: 1.05rem; font-weight: 600; text-align: start; }
.menu a:active, .menu button:active { background: var(--tile); }
.menu svg:first-child { color: var(--muted); }
.menu .label { flex: 1; }
.menu .value { color: var(--brand-text); }
.menu .chev { width: 20px; height: 20px; color: var(--muted); }
.menu .note { padding: 10px 20px; }
.version { text-align: center; color: var(--muted); font-size: 0.85rem; padding-top: 8px; }
.auth-logo { width: 88px; height: 88px; margin: 8px auto 0; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); }
.center { text-align: center; }

/* loading and toast */
.loading { display: grid; place-items: center; padding: 48px 0; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--line); border-top-color: var(--brand-text); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--tabs-h) + var(--safe-bottom) + 16px);
    transform: translate(-50%, 20px);
    max-width: calc(100% - 32px);
    padding: 12px 18px;
    border-radius: 14px;
    background: #0a0a0a;
    color: #fff;
    font-size: 0.95rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 50;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
body.cta #toast { bottom: calc(var(--tabs-h) + var(--safe-bottom) + 92px); }

/* screen-to-screen motion (browsers without it simply cut) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.22s; animation-timing-function: cubic-bezier(0.2, 0, 0, 1); }
.app-header { view-transition-name: header; }
.tab-bar { view-transition-name: tabs; }
@media (prefers-reduced-motion: reduce) {
    ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation-duration: 1ms !important; }
    .spinner { animation-duration: 2s; }
    #toast, .dots i, .order-actions svg { transition: none; }
    .deal-card:active, .quick a:active .dot, .shortcuts a:active .box { transform: none; }
}
