/* ruvori app styles. Tokens first; screens below in the order of the tab bar. */

@font-face { font-family: "Unbounded"; src: url("../assets/fonts/unbounded-latin.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("../assets/fonts/space-grotesk-latin.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "League Spartan"; src: url("../assets/fonts/league-spartan-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --ink: #000000;
  --paper: #f4f4f4;
  --fog: #e4e4e4;
  --line-light: #cfcfcf;
  --graphite: #5c5c5c;     /* muted text on paper */
  --mist: #a9a9a9;         /* muted text on ink */
  --dim: #8a8a8a;
  --coal: #141414;         /* raised surface on ink */
  --coal-2: #1d1d1d;
  --line: #2e2e2e;
  --red: #d90500;          /* red wording on light */
  --red-hi: #ff2a1a;       /* red wording on dark */
  --escape-red: #c72a09;
  --ivory: #e7e3dd;

  --font-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --font-body: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-brand: "League Spartan", "Arial Black", system-ui, sans-serif;

  --gutter: 20px;
  --tabs-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --app-w: 480px;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ink); -webkit-text-size-adjust: 100%; overscroll-behavior-y: contain; } /* our own pull-to-refresh replaces the browser's */
body { margin: 0; min-height: 100dvh; background: var(--ink); color: #fff; font-family: var(--font-body); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--red-hi); outline-offset: 3px; }
[hidden] { display: none !important; }

/* App frame: phone width, centred on bigger screens */
#app { position: relative; max-width: var(--app-w); min-height: 100dvh; margin: 0 auto; background: var(--ink); overflow-x: clip; }
#app[data-theme="light"] { background: var(--paper); color: var(--ink); }
#view { outline: none; padding-bottom: calc(var(--tabs-h) + var(--safe-bottom) + 24px); }
#view.no-tabs { padding-bottom: calc(var(--safe-bottom) + 24px); }
.screen { animation: enter 0.45s var(--ease) both; }
.no-anim .screen { animation: none; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Type helpers */
.rv { font-family: var(--font-brand); font-weight: 800; letter-spacing: -0.045em; text-transform: lowercase; }
.lbl { font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--mist); }
[data-theme="light"] .lbl { color: var(--graphite); }
.lbl--red { color: var(--red-hi); }
[data-theme="light"] .lbl--red { color: var(--red); }
.h1 { font-family: var(--font-display); font-weight: 600; font-size: 26px; line-height: 1.15; margin: 0; }
.h2 { font-family: var(--font-display); font-weight: 400; font-size: 20px; line-height: 1.25; margin: 0; }
.muted { color: var(--mist); }
[data-theme="light"] .muted { color: var(--graphite); }
.price { color: var(--red-hi); font-weight: 500; }
[data-theme="light"] .price { color: var(--red); }
.bw { filter: grayscale(1); }

.pad { padding: 0 var(--gutter); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack--tight { gap: 8px; }
.stack--loose { gap: 24px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 5; height: calc(60px + var(--safe-top)); padding: var(--safe-top) 8px 0; display: grid; grid-template-columns: 52px 1fr 52px; align-items: center; background: linear-gradient(var(--ink) 70%, rgba(0,0,0,0)); }
[data-theme="light"] .top { background: linear-gradient(var(--paper) 70%, rgba(244,244,244,0)); }
.top--clear { position: absolute; left: 0; right: 0; background: none !important; }
.top__title { text-align: center; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; }
.top__title.rv { font-size: 26px; letter-spacing: -0.045em; text-transform: lowercase; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; position: relative; justify-self: center; }
.icon-btn svg, .tabs svg, .ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn--glass { background: rgba(20,20,20,0.8); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.dot { position: absolute; top: 9px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--red-hi); }
.mark { width: 36px; height: auto; justify-self: center; } /* header logo: clearly visible, not loud */

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 24px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; transition: transform 0.15s var(--ease), opacity 0.2s; width: 100%; }
.btn:active { transform: scale(0.98); }
.btn--white { background: #fff; color: #000; }
.btn--black { background: #000; color: #fff; }
.btn--ghost { border: 1px solid rgba(255,255,255,0.4); }
[data-theme="light"] .btn--ghost { border-color: #000; }
.btn--ivory { background: var(--ivory); color: #000; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.35; pointer-events: none; }
.btn .ico { width: 18px; height: 18px; }
.link { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 4px; }
.btn-row { display: flex; gap: 10px; }

/* Cards and lists */
.card { background: var(--coal); border-radius: 10px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.card--line { background: none; border: 1px solid var(--line); }
.list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
[data-theme="light"] .list { border-color: var(--line-light); }
.list > * { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 12px 0; border-bottom: 1px solid var(--line); }
[data-theme="light"] .list > * { border-color: var(--line-light); }
.chev { width: 16px; height: 16px; color: var(--mist); flex-shrink: 0; }
.photo { border-radius: 10px; overflow: hidden; position: relative; background: var(--coal); }
.photo > img { width: 100%; height: 100%; object-fit: cover; }
.photo__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,0.88) 100%); }
.photo__text { position: absolute; left: 18px; right: 18px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.bars { display: flex; gap: 6px; }
.bars span { flex: 1; height: 3px; border-radius: 2px; background: var(--line); }
.bars span.on { background: #fff; }

.stamp { position: absolute; top: 14px; left: 14px; padding: 6px 12px; border: 1.5px solid var(--red-hi); color: var(--red-hi); border-radius: 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; transform: rotate(-6deg); background: rgba(0,0,0,0.5); }
[data-theme="light"] .stamp { border-color: var(--red); color: var(--red); background: rgba(244,244,244,0.8); }

/* Countdown */
.count { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.count > span { padding: 10px 0; border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; background: rgba(0,0,0,0.5); }
.count b { font-family: var(--font-display); font-weight: 400; font-size: 22px; }
.count i { font-style: normal; font-size: 9px; letter-spacing: 0.2em; color: var(--mist); }
.count--inline { display: flex; gap: 14px; }
.count--inline > span { border: 0; padding: 0; background: none; align-items: flex-start; }
.count--inline b { font-size: 18px; }

/* Tab bar */
.tabs { position: fixed; z-index: 20; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, var(--app-w)); height: calc(var(--tabs-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom); display: flex; background: rgba(0,0,0,0.94); border-top: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
[data-theme="light"] .tabs { background: rgba(244,244,244,0.95); border-color: var(--line-light); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: var(--dim); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; }
[data-theme="light"] .tabs a { color: #6b6b6b; }
.tabs a[aria-current="page"] { color: #fff; }
[data-theme="light"] .tabs a[aria-current="page"] { color: #000; }

/* Toast */
.toast { position: fixed; z-index: 40; left: 50%; bottom: calc(var(--tabs-h) + var(--safe-bottom) + 14px); transform: translate(-50%, 20px); width: min(calc(100% - 24px), calc(var(--app-w) - 24px)); padding: 14px 16px; border-radius: 16px; background: var(--coal-2); color: #fff; font-size: 14px; display: flex; gap: 12px; align-items: center; opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.3s var(--ease); box-shadow: 0 12px 30px rgba(0,0,0,0.5); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast img { width: 22px; height: 22px; object-fit: contain; }
.toast strong { display: block; }

/* Sheet (bottom dialog) */
.sheet { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,0.6); animation: fade 0.25s both; }
.sheet__panel { width: min(100%, var(--app-w)); background: var(--coal); color: #fff; border-radius: 22px 22px 0 0; padding: 12px var(--gutter) calc(24px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 16px; animation: rise 0.35s var(--ease) both; }
.sheet__grip { align-self: center; width: 40px; height: 4px; border-radius: 2px; background: #3a3a3a; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 12px; color: var(--mist); }
[data-theme="light"] .field span { color: var(--graphite); }
.input { height: 50px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: #000; color: #fff; font-size: 16px; width: 100%; }
[data-theme="light"] .input { background: #fff; color: #000; border-color: var(--line-light); }
.input::placeholder { color: #6f6f6f; }
.choice { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-light); background: #fff; font-size: 14px; cursor: pointer; }
.choice:has(input:checked) { border: 1.5px solid #000; }
.choice input { width: 18px; height: 18px; accent-color: #000; margin: 0; }

/* Enter */
.enter { position: relative; min-height: 100dvh; display: flex; flex-direction: column; justify-content: flex-end; }
.enter__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.enter__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 22%, rgba(0,0,0,0) 34%, rgba(0,0,0,0.8) 56%, #000 82%); }
.enter__mark { position: absolute; top: calc(48px + var(--safe-top)); left: 50%; transform: translateX(-50%); width: 30px; }
.enter__body { position: relative; padding: 0 28px calc(40px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 18px; }
.enter__name { font-size: 96px; line-height: 0.82; }
.enter__tag { font-family: var(--font-display); font-size: 20px; }

/* Choice chips (identity setup) */
.chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.chip { min-height: 48px; border-radius: 999px; border: 1px solid #3a3a3a; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.chip[aria-pressed="true"] { background: #fff; color: #000; border-color: #fff; font-weight: 600; }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 4px; border-radius: 999px; background: var(--coal); }
.seg button { min-height: 44px; border-radius: 999px; font-size: 14px; color: var(--mist); }
.seg button[aria-pressed="true"] { background: #fff; color: #000; font-weight: 600; }
.seg button.is-red:not([aria-pressed="true"]) { color: var(--red-hi); }
.time { background: none; border: 0; color: #fff; font-family: var(--font-display); font-size: 18px; text-align: right; width: 104px; color-scheme: dark; }
.time--red { color: var(--red-hi); }

/* Identity */
.streak { display: flex; flex-direction: column; align-items: flex-end; }
.streak b { font-family: var(--font-display); font-weight: 800; font-size: 56px; line-height: 0.9; }
.task { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; min-height: 64px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.task__box { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid #5c5c5c; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: background 0.2s, border-color 0.2s; }
.task__box svg { width: 14px; height: 14px; stroke: #000; stroke-width: 2.5; fill: none; opacity: 0; }
.task[aria-pressed="true"] .task__box { background: #fff; border-color: #fff; }
.task[aria-pressed="true"] .task__box svg { opacity: 1; }
.task[aria-pressed="true"] .task__text { color: var(--mist); text-decoration: line-through; text-decoration-color: #5c5c5c; }
.task__text { font-size: 15px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; text-align: center; font-size: 11px; color: var(--mist); }
.week > span { display: flex; flex-direction: column; gap: 6px; }
.week i { height: 28px; border-radius: 6px; background: var(--coal); }
.week i.done { background: #fff; }
.week i.today { border: 1.5px solid var(--red-hi); }
.alarm { background: var(--escape-red); color: #fff; border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.success { background: #fff; color: #000; border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 6px; }

/* Product */
/* Track: live map (MapLibre + OpenFreeMap, dark, tilted) */
.livemap { position: relative; height: 58vh; min-height: 360px; background: #0c0c0c; }
.livemap__wait { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); padding: 10px 16px; border-radius: 999px; background: rgba(20,20,20,0.9); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--mist); text-align: center; }
.tracksheet { position: relative; z-index: 2; margin-top: -28px; background: var(--coal); border-radius: 22px 22px 0 0; padding-top: 12px; padding-bottom: 24px; box-shadow: 0 -10px 30px rgba(0,0,0,0.5); }
.maplibregl-ctrl-attrib { background: rgba(0,0,0,0.55) !important; font-size: 10px; }
.maplibregl-ctrl-attrib a { color: #8a8a8a !important; }
.maplibregl-ctrl-attrib-button { filter: invert(1); }
.mk__you { display: flex; flex-direction: column; align-items: center; padding: 5px 10px; border-radius: 999px; background: #fff; color: #000; font-size: 11px; font-weight: 600; box-shadow: 0 6px 16px rgba(0,0,0,0.5); position: relative; }
.mk__you::after { content: ""; position: absolute; bottom: -7px; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top-color: #fff; border-bottom: 0; }
.mk__boda { width: 54px; height: 54px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(0,0,0,0.5); animation: riderPulse 2.2s ease-out infinite; }
.mk__boda svg { width: 36px; height: 36px; } /* the helmet faces you, so it never flips */
.mk__me { display: block; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid #000; box-shadow: 0 0 0 6px rgba(255,255,255,0.25); }
.mk__rider { width: 46px; height: 46px; border-radius: 50%; background: #000; border: 2px solid #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 0 rgba(255,255,255,0.35); animation: riderPulse 2.2s ease-out infinite; }
.mk__rider img { width: 24px; }
@keyframes riderPulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.35); } 100% { box-shadow: 0 0 0 18px rgba(255,255,255,0); } }
.riderrow { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.riderrow__av { width: 44px; height: 44px; border-radius: 50%; background: #2e2e2e; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); flex-shrink: 0; }
.icon-btn--line { border: 1px solid #3a3a3a; flex-shrink: 0; }
/* the bag: where to deliver */
.deliverbox { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-light); background: #fff; font-size: 14px; }
.deliverbox__pin { width: auto; min-height: 44px; padding: 0 14px; font-size: 11px; flex-shrink: 0; }

/* ---------- orders page (admin.html) and rider page (ride.html) ---------- */
.opspage .toast { bottom: calc(18px + var(--safe-bottom)); }
.ops { max-width: 760px; margin: 0 auto; padding: calc(16px + var(--safe-top)) var(--gutter) 60px; display: flex; flex-direction: column; gap: 14px; }
.ops__signin { max-width: 420px; margin: 12vh auto 0; display: flex; flex-direction: column; gap: 16px; }
.ops__top { display: flex; align-items: center; gap: 12px; padding-bottom: 6px; }
.ops__tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.ops__tabs button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; color: var(--mist); }
.ops__tabs button[aria-pressed="true"] { background: #fff; color: #000; border-color: #fff; font-weight: 600; }
.ops__card { background: var(--coal); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.ops__card--sent { border-color: #5c5c5c; }
.ops__id { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.02em; }
.ops__pill { padding: 5px 10px; border-radius: 999px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; background: #2e2e2e; }
.ops__pill--sent { background: #fff; color: #000; }
.ops__pill--onway { background: var(--red-hi); color: #fff; }
.ops__pill--delivered { background: #1f3a24; color: #b9f0c4; }
.ops__pill--cancelled { background: transparent; border: 1px solid #5c5c5c; color: var(--mist); }
.ops__row { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.ops__items { margin: 0; padding-left: 18px; color: #e4e4e4; }
.ops__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ops__btn { width: auto; min-height: 44px; padding: 0 16px; font-size: 11px; }
.ops__views { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; padding: 4px; border-radius: 999px; background: var(--coal); }
.ops__views button { min-height: 44px; border-radius: 999px; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mist); }
.ops__views button[aria-pressed="true"] { background: #fff; color: #000; font-weight: 600; }
.ops__url { display: block; padding: 10px 12px; border-radius: 10px; background: #000; border: 1px solid var(--line); font-size: 12px; color: #e4e4e4; word-break: break-all; }
.ops__qr { width: 220px; max-width: 100%; background: #fff; border-radius: 12px; padding: 6px; align-self: center; }
.ops__qr svg { display: block; width: 100%; height: auto; }
.ops__thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; }
.ops__seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ops__seg button { min-height: 44px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; color: var(--mist); }
.ops__seg button[aria-pressed="true"] { background: #fff; color: #000; border-color: #fff; font-weight: 600; }
.ops__photos { display: flex; gap: 8px; flex-wrap: wrap; min-height: 20px; }
.ops__photos img { width: 72px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.ops__file { cursor: pointer; align-self: flex-start; }
.ops__colour input[type="color"] { width: 64px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #000; padding: 4px; }
.ops__card--new { border-color: #fff; }
.ops__card--removed { opacity: 0.7; }
.ops__two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice--dark { background: #000; border-color: var(--line); color: #fff; }
.choice--dark input { accent-color: #fff; }
input[type="datetime-local"].input { color-scheme: dark; }
.ops__rider { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.ops__rider .phone { height: 50px; }
.ops__rider .phone input { font-size: 17px; }
.ride { max-width: var(--app-w); margin: 0 auto; min-height: 100dvh; }
.ride__map { height: 52vh; }
.ride__acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ride__acts .btn { padding: 0 8px; font-size: 11px; }
.ride__live { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 13px; color: #fff; }
.ride__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red-hi); flex-shrink: 0; animation: riderPulse 1.6s ease-out infinite; }

/* Track: delivery code, stale rider warning, moving the pin */
.codebox { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px; border-radius: 14px; background: #fff; color: #000; text-align: center; }
.codebox .lbl { color: var(--graphite); }
.codebox .muted { color: var(--graphite); }
.codebox__digits { font-family: var(--font-display); font-weight: 800; font-size: 34px; letter-spacing: 0.12em; }
.trackwarn { margin: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--red-hi); color: #fff; font-size: 13px; line-height: 1.45; }
.deliverbox--dark { background: #0d0d0d; border-color: var(--line); color: #fff; }
.deliverbox--dark .btn--ghost { border-color: rgba(255,255,255,0.4); }
/* The arrival moment: black screen, the wink, then "Delivered" */
.arrived { position: fixed; inset: 0; z-index: 80; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; animation: fade 0.4s both; transition: opacity 0.5s; }
.arrived.is-out { opacity: 0; }
.arrived__wink { width: min(100%, var(--app-w), 70dvh); aspect-ratio: 720 / 900; transform: translate(1.53%, -10%); transition: transform 0.8s var(--ease), opacity 0.6s; }
.arrived.is-text .arrived__wink { transform: translate(1.53%, -22%) scale(0.82); }
.arrived__text { position: absolute; left: 0; right: 0; bottom: calc(60px + var(--safe-bottom)); padding: 0 var(--gutter); display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); max-width: var(--app-w); margin: 0 auto; }
.arrived.is-text .arrived__text { opacity: 1; transform: none; }
.arrived__word { font-family: var(--font-display); font-weight: 800; font-size: 40px; letter-spacing: -0.01em; }
.arrived__text .btn { width: 100%; }

/* Track: the rider's delivery fee note */
.feenote { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: #0d0d0d; font-size: 13px; line-height: 1.5; color: var(--mist); }
.feenote strong { color: #fff; font-weight: 600; font-size: 14px; }
.feenote .ico { flex-shrink: 0; margin-top: 2px; color: #fff; }

/* bag (cart) */
.badge { position: absolute; top: 5px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #fff; color: #000; font-size: 10px; font-weight: 600; line-height: 17px; text-align: center; }
[data-theme="light"] .badge { background: #000; color: #fff; }
.tabs a { position: relative; }
.tabs .badge { top: 6px; right: auto; left: calc(50% + 6px); }
.price, .was { white-space: nowrap; }
.pricebox { padding-top: 14px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 15px; }
.was { color: var(--dim); text-decoration: line-through; font-size: 0.9em; }
[data-theme="light"] .was { color: #7a7a7a; }
.clubtag { align-self: flex-start; padding: 6px 10px; border-radius: 999px; background: #000; color: #fff; font-size: 11px; letter-spacing: 0.06em; font-variant-numeric: tabular-nums; }
.clubtag--red { background: var(--red); }
.stamp--soon { border-color: #fff; color: #fff; }
[data-theme="light"] .stamp--soon { border-color: #000; color: #000; }
.baglist { display: flex; flex-direction: column; border-top: 1px solid var(--line-light); }
.bagline { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line-light); }
.bagline img { width: 76px; height: 76px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.bagline.is-out img { filter: grayscale(1); opacity: 0.5; }
.bagline__remove { align-self: flex-start; min-height: 32px; font-size: 12px; color: var(--graphite); text-decoration: underline; text-underline-offset: 3px; }
.qty button:disabled { opacity: 0.3; }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: var(--fog); }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: 0 0 100%; width: 100%; height: min(110vw, 500px); object-fit: cover; scroll-snap-align: start; }
.swatch { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid transparent; }
.swatch[aria-current="true"] { border-color: #000; }
.swatch i { width: 26px; height: 26px; border-radius: 50%; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-light); border-radius: 999px; background: #fff; }
.qty button { width: 44px; height: 44px; font-size: 18px; }
.qty output { min-width: 28px; text-align: center; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 8px; }
.tile .photo { aspect-ratio: 4 / 5; }

/* Track map (decorative until live tracking launches) */
.map { position: relative; height: 56vh; min-height: 380px; overflow: hidden; perspective: 700px; background: #050505; }
.map__plane { position: absolute; left: -60%; top: -40%; width: 220%; height: 190%; transform: rotateX(52deg) rotateZ(-24deg); transform-origin: 50% 60%; background-color: #0d0d0d; background-image: repeating-linear-gradient(0deg, #1f1f1f 0 2px, transparent 2px 70px), repeating-linear-gradient(90deg, #1f1f1f 0 2px, transparent 2px 90px); }
.map__road { position: absolute; background: #2a2a2a; }
.map__block { position: absolute; background: #1a1a1a; box-shadow: 6px -10px 0 #262626, 12px -20px 0 #303030; }
.map__note { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); padding: 10px 16px; border-radius: 999px; background: rgba(20,20,20,0.9); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; white-space: nowrap; }
.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.steps > span { display: flex; flex-direction: column; gap: 6px; font-size: 10px; color: var(--dim); }
.steps > span::before { content: ""; height: 3px; border-radius: 2px; background: var(--line); }
.steps > span.on { color: #fff; }
.steps > span.on::before { background: #fff; }
.steps > span.now { color: #fff; }
.steps > span.now::before { background: var(--red-hi); }

/* Club */
.coupon { border-radius: 16px; background: var(--paper); color: #000; display: flex; overflow: hidden; }
.coupon__main { flex-grow: 1; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.coupon__cut { border-left: 2px dashed var(--line-light); margin: 12px 0; }
.coupon__go { width: 96px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.coupon__left { font-size: 12px; font-variant-numeric: tabular-nums; opacity: 0.8; }
.coupon.is-off { background: var(--coal); color: #fff; border: 1px solid var(--line); }
.coupon.is-off .coupon__cut { border-color: var(--line); }
.big { font-family: var(--font-display); font-weight: 800; font-size: 26px; line-height: 1; }
.escape { border-radius: 16px; background: var(--escape-red); color: var(--ivory); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.escape img { width: 52px; height: 52px; }

/* Chat */
.bubble { max-width: 80%; padding: 12px 14px; border-radius: 16px; font-size: 14px; }
.bubble--me { align-self: flex-end; background: #fff; color: #000; border-bottom-right-radius: 4px; }
.bubble--them { align-self: flex-start; background: var(--coal); border-bottom-left-radius: 4px; }

/* ---------- Joining: create your profile / sign in ---------- */
.join { position: relative; min-height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: radial-gradient(90% 42% at 50% 0%, #171717 0%, #000 72%); }
.join__bars { display: flex; gap: 5px; padding: calc(14px + var(--safe-top)) var(--gutter) 0; min-height: 16px; }
.join__bars span { flex: 1; height: 2px; border-radius: 2px; background: #2a2a2a; overflow: hidden; position: relative; }
.join__bars span.on { background: #fff; }
.join__nav { display: grid; grid-template-columns: 52px 1fr 52px; align-items: center; height: 56px; padding: 0 8px; text-align: center; }
.join__num { position: absolute; right: -14px; top: calc(66px + var(--safe-top)); font-family: var(--font-display); font-weight: 800; font-size: 190px; line-height: 0.8; letter-spacing: -0.04em; color: transparent; -webkit-text-stroke: 1px #2c2c2c; pointer-events: none; user-select: none; animation: numIn 0.9s var(--ease) both; }
@keyframes numIn { from { opacity: 0; transform: translateY(24px); } }
.join__body { position: relative; flex: 1; display: flex; flex-direction: column; gap: 26px; padding: 64px var(--gutter) calc(28px + var(--safe-bottom)); }
.join__body > form { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.join__q { font-size: 30px; line-height: 1.12; max-width: 12ch; }
.join__foot { margin-top: auto; }
.join__err { margin: 0; color: var(--red-hi); font-size: 13px; }
.join__note { margin: 0; font-size: 12px; color: var(--dim); line-height: 1.5; }
.input--big { height: 60px; font-size: 20px; font-family: var(--font-display); }
select.input { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, #a9a9a9 50%), linear-gradient(135deg, #a9a9a9 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }

/* phone number: fixed +256 then the number */
.phone { display: flex; align-items: center; height: 60px; border: 1px solid var(--line); border-radius: 999px; background: #000; overflow: hidden; }
.phone:focus-within { border-color: #fff; }
.phone b { padding: 0 14px 0 20px; font-family: var(--font-display); font-weight: 400; font-size: 16px; border-right: 1px solid var(--line); line-height: 28px; }
.phone input { flex: 1; min-width: 0; height: 100%; padding: 0 16px; border: 0; background: none; color: #fff; font-family: var(--font-display); font-size: 20px; letter-spacing: 0.04em; outline: none; }
.phone input::placeholder { color: #4a4a4a; }

/* six code boxes over one invisible input */
.code { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.code input { position: absolute; inset: 0; width: 100%; opacity: 0; font-size: 16px; z-index: 1; }
.code span { height: 62px; border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 24px; transition: border-color 0.2s; }
.code:focus-within span.on, .code:focus-within span:first-of-type:empty { border-color: #fff; }
/* password with a show/hide eye */
.pw { position: relative; display: block; }
.pw .input { padding-right: 56px; }
.pw__eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--dim); border-radius: 50%; }
.pw__eye.is-on { color: #fff; }
.join__ok { margin: 0; font-size: 13px; color: #fff; line-height: 1.5; }
.code.is-wrong span { border-color: var(--red-hi); }
.code.is-wrong { animation: shake 0.42s ease-in-out; }
.code.is-locked span { opacity: 0.35; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.link:disabled { opacity: 0.45; text-decoration: none; cursor: default; }
.btn.is-busy { opacity: 0.75; }

/* single-choice rows (language) */
.opt { width: 100%; min-height: 60px; padding: 0 20px; border: 1px solid var(--line); border-radius: 14px; display: flex; align-items: center; justify-content: space-between; font-size: 17px; transition: border-color 0.2s, background 0.2s; }
.opt[aria-pressed="true"] { border-color: #fff; background: var(--coal); }
.opt__tick { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid #5c5c5c; display: flex; align-items: center; justify-content: center; }
.opt__tick svg { width: 13px; height: 13px; stroke: #000; stroke-width: 2.6; fill: none; opacity: 0; }
.opt[aria-pressed="true"] .opt__tick { background: #fff; border-color: #fff; }
.opt[aria-pressed="true"] .opt__tick svg { opacity: 1; }

/* edition picker */
.ed { display: flex; flex-direction: column; gap: 10px; text-align: left; font-size: 14px; border-radius: 12px; padding: 6px; border: 1px solid transparent; transition: border-color 0.2s; }
.ed .photo { aspect-ratio: 4 / 5; }
.ed[aria-pressed="true"] { border-color: #fff; }
.ed[aria-pressed="true"] .bw { filter: none; }
.ed__dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid #5c5c5c; }

/* the wink between steps: same framing as the opening intro (face dead centre) */
.wink { min-height: 100dvh; background: #000; display: flex; align-items: center; justify-content: center; }
.wink__anim { width: min(100%, var(--app-w), 80dvh); height: auto; aspect-ratio: 720 / 900; transform: translate(1.53%, -7.33%); }

/* the ruvori card (Club + the reveal) */
@property --edge { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.mcard { position: relative; isolation: isolate; overflow: hidden; aspect-ratio: 1.62; border-radius: 16px; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; color: #fff;
  border: 1px solid rgba(255,255,255,0.09);
  box-shadow: 0 26px 50px rgba(0,0,0,0.7), 0 8px 18px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.2), inset 0 -26px 46px rgba(0,0,0,0.5); }
/* grey metal falling into black at the edges; Gray Edition lighter, Black Edition darker graphite */
.mcard--gray { background: radial-gradient(130% 150% at 92% 0%, #a2a2a2 0%, #767676 30%, #3c3c3c 64%, #151515 100%); }
.mcard--black { background: radial-gradient(130% 150% at 92% 0%, #5e5e5e 0%, #383838 32%, #171717 66%, #070707 100%); }
.mcard__mark { width: 44px; height: auto; } /* dots mark sized to balance the ruvori wordmark */
.mcard__lbl { color: var(--red-hi); text-shadow: 0 1px 3px rgba(0,0,0,0.7); }
.mcard__meta { color: #d6d6d6; text-shadow: 0 1px 3px rgba(0,0,0,0.6); }
/* a line of light travelling round the edge */
.mcard::before { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--edge), rgba(255,255,255,0) 0deg 250deg, rgba(255,255,255,0.15) 290deg, rgba(255,255,255,0.95) 330deg, rgba(255,255,255,0) 352deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: edge 3.4s linear infinite; }
@keyframes edge { to { --edge: 360deg; } }
/* in the Club the card floats; its shadow breathes with it; the edge light moves slower */
.mcard-float { animation: float 6s ease-in-out infinite; }
.mcard-float .mcard { animation: floatShadow 6s ease-in-out infinite; }
.mcard-float .mcard::before { animation-duration: 6s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes floatShadow { 0%, 100% { box-shadow: 0 26px 50px rgba(0,0,0,0.7), 0 8px 18px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.2), inset 0 -26px 46px rgba(0,0,0,0.5); }
  50% { box-shadow: 0 36px 60px rgba(0,0,0,0.55), 0 14px 26px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.2), inset 0 -26px 46px rgba(0,0,0,0.5); } }
.mcard::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, rgba(255,255,255,0) 38%, rgba(255,255,255,0.22) 50%, rgba(255,255,255,0) 62%); transform: translateX(-120%); pointer-events: none; }

/* the reveal: the card rises out of the dark, light sweeps across it */
.join--reveal .join__body { justify-content: flex-end; padding-top: 24px; }
.reveal { perspective: 900px; margin-top: auto; }
.mcard.is-reveal { animation: cardIn 1.3s var(--ease) 0.15s both; }
.mcard.is-reveal::before { animation: edge 2.6s linear 1.2s infinite; }
.mcard.is-reveal::after { animation: sheen 1.1s ease-in-out 1.2s both; }
.reveal__text { animation: enter 0.8s var(--ease) 1.1s both; }
@keyframes cardIn { from { opacity: 0; transform: rotateX(58deg) translateY(90px) scale(0.86); } 60% { opacity: 1; } }
@keyframes sheen { to { transform: translateX(120%); } }

/* Offline: the intro's ruvori mark with "Offline" under it, until the connection returns */
.offline { position: fixed; inset: 0; z-index: 70; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; animation: fade 0.5s var(--ease) both; }
.offline__mark { width: 120px; }
.offline__text { margin: 0; font-size: 15px; font-weight: 500; letter-spacing: 0.32em; text-transform: uppercase; color: #fff; padding-left: 0.32em; }

/* Pull to refresh: a small ruvori mark follows the finger down from the top */
.ptr { position: fixed; z-index: 45; top: 0; left: 50%; width: 46px; height: 46px; margin-left: -23px; border-radius: 50%; background: var(--coal); border: 1px solid #3a3a3a; box-shadow: 0 8px 20px rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; pointer-events: none; opacity: 0; transform: translateY(-60px); }
.ptr img { width: 26px; }
.ptr.is-back { transition: transform 0.35s var(--ease), opacity 0.35s; }
.ptr.is-ready { border-color: #fff; }
.ptr.is-loading img { animation: ptrPulse 0.8s ease-in-out infinite; }
@keyframes ptrPulse { 50% { transform: scale(0.72); opacity: 0.55; } }

/* First-open intro: the animation, then the ruvori mark, then the app */
.intro { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; align-items: center; justify-content: center; transition: opacity 0.7s var(--ease); }
/* The face sits low and a little left in the animation's frame (centre at 349,516 of 720x900),
   so the frame is nudged up 7.33% and right 1.53% of its own size to put the face dead centre. */
.intro__anim { width: min(100%, var(--app-w), 80dvh); height: auto; aspect-ratio: 720 / 900; transform: translate(1.53%, -7.33%); transition: opacity 0.5s var(--ease); }
.intro__mark { position: absolute; top: 50%; left: 50%; width: 120px; opacity: 0; transform: translate(-50%, -50%) scale(0.86); transition: opacity 0.7s var(--ease), transform 1.1s var(--ease); }
.intro.is-logo .intro__anim { opacity: 0; }
.intro.is-logo .intro__mark { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.intro.is-out { opacity: 0; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
