@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-cyrillic.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  --brand: #0071e3;
  --brand-ink: #0058b3;
  --brand-soft: #e8f2fd;
  --navy: #0a2540;
  --ink: #101828;
  --muted: #5a6880;
  --ground: #f3f6fb;
  --surface: #ffffff;
  --line: #e2e8f1;
  --track: #d5deea;
  --ok: #0f8a4f;
  --ok-soft: #e4f5ec;
  --warn: #a45a00;
  --warn-soft: #fdf1e1;
  --bad: #c0362c;
  --bad-soft: #fceceb;
  --shadow: 0 10px 30px rgba(10, 37, 64, 0.08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --brand: #3ea0ff;
    --brand-ink: #7cc0ff;
    --brand-soft: #10294a;
    --ink: #e8eef7;
    --muted: #93a3bb;
    --ground: #061a33;
    --surface: #0d2645;
    --line: #1c3a60;
    --track: #24476f;
    --ok: #4cc98a;
    --ok-soft: #0f3a2b;
    --warn: #f0a94a;
    --warn-soft: #3d2a0e;
    --bad: #ff7a70;
    --bad-soft: #3d1715;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand: #3ea0ff;
  --brand-ink: #7cc0ff;
  --brand-soft: #10294a;
  --ink: #e8eef7;
  --muted: #93a3bb;
  --ground: #061a33;
  --surface: #0d2645;
  --line: #1c3a60;
  --track: #24476f;
  --ok: #4cc98a;
  --ok-soft: #0f3a2b;
  --warn: #f0a94a;
  --warn-soft: #3d2a0e;
  --bad: #ff7a70;
  --bad-soft: #3d1715;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-inline: 16px;
  padding-block: 16px 40px;
}
button { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible, select:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}


.page {
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 4px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.brand svg { width: 32px; height: 32px; flex: none; }
.langs {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}
.langs button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  min-width: 40px;
  min-height: 32px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.langs button[aria-pressed="true"] {
  background: var(--brand);
  color: #fff;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
}

.status { display: flex; flex-direction: column; gap: 14px; }
.chip {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 4px 10px 4px 8px;
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.chip.live .dot { animation: pulse 1.8s ease-in-out infinite; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  50% { box-shadow: 0 0 0 5px transparent; opacity: 0.55; }
}
.status h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.22;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.status .sub {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 14.5px;
}

.steps {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  position: relative;
}
.steps li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--muted);
  position: relative;
  padding-inline: 2px;
}
.steps li::before {
  content: "";
  position: absolute;
  top: 9px;
  left: -50%;
  width: 100%;
  height: 3px;
  background: var(--track);
  z-index: 0;
}
.steps li:first-child::before { display: none; }
.steps li.done::before, .steps li.now::before { background: var(--brand); }
.steps .node {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--track);
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
}
.steps li.done .node { background: var(--brand); border-color: var(--brand); }
.steps li.done .node svg { display: block; }
.steps .node svg { display: none; width: 11px; height: 11px; }
.steps li.now .node { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.steps li.now .node::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
}
.steps li.done, .steps li.now { color: var(--ink); }
.steps li.now { font-weight: 700; }
.steps.halted li.now .node { border-color: var(--muted); box-shadow: none; }
.steps.halted li.now .node::after { background: var(--muted); }
@media (max-width: 400px) {
  .steps li { font-size: 10.5px; letter-spacing: -0.01em; padding-inline: 0; }
}


.route {
  display: grid;
  grid-template-columns: 18px 1fr;
  column-gap: 12px;
  row-gap: 4px;
}
.route .rail {
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-block: 7px;
}
.route .rail i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 3px solid var(--brand);
  flex: none;
}
.route .rail i:last-child { background: var(--brand); }
.route .rail b {
  flex: 1;
  width: 0;
  border-left: 2px dashed var(--track);
  margin-block: 4px;
  min-height: 22px;
}
.stop small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.stop span { font-weight: 600; font-size: 16px; }
.stop + .stop { margin-top: 10px; }

.driver {
  display: flex;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 16px;
}
.car {
  width: 64px;
  height: 48px;
  flex: none;
  border-radius: 12px;
  background: var(--brand-soft);
  display: grid;
  place-items: center;
  color: var(--brand);
}
.car svg { width: 30px; height: 30px; }
.driver .who { display: flex; flex-direction: column; min-width: 0; }
.driver .who small { color: var(--muted); font-size: 12px; }
.driver .who strong { font-size: 16px; font-weight: 600; }
.driver .who span { color: var(--muted); font-size: 14px; }

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.notice .ico {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--bad-soft);
  color: var(--bad);
}
.notice .ico svg { width: 22px; height: 22px; }
.notice.warn .ico { background: var(--warn-soft); color: var(--warn); }
.notice.ok .ico { background: var(--ok-soft); color: var(--ok); }
.notice h2 { margin: 0 0 2px; font-size: 16px; font-weight: 700; }
.notice p { margin: 0; color: var(--muted); font-size: 14px; }

.app {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--brand-soft);
  border-color: transparent;
}
.app h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.app p { margin: 0; color: var(--muted); font-size: 14px; }
.app ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}
.app li { display: flex; gap: 9px; align-items: flex-start; }
.app li svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--brand); }
.store {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  border-radius: 14px;
  background: var(--navy);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
}
:root[data-theme="dark"] .store { background: var(--brand); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .store { background: var(--brand); }
}
.store svg { width: 20px; height: 20px; flex: none; }
.stores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}
.store { padding-inline: 12px; font-size: 14px; }
.qrs, .or { display: none; }
@media (min-width: 720px) {
  .qrs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
  }
  .qr {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
  }
  .qr svg { display: block; width: 100%; height: auto; }
  .or {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
  }
  .or::before, .or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--track);
  }
}

.foot {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  padding-top: 4px;
}
.refresh {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
}
.refresh svg { width: 15px; height: 15px; }
.refresh.spin svg { animation: spin 0.8s linear; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .chip.live .dot, .refresh.spin svg { animation: none; }
}

.loading {
  color: var(--muted);
  text-align: center;
  padding-block: 32px;
}
.notice .refresh { margin-top: 12px; margin-bottom: 0; }

/* The recipient's receiving code: a small fallback under the app card (texted link only). */
.card.code { display: flex; align-items: center; gap: 16px; }
.code-text { flex: 1 1 auto; min-width: 0; }
.code-text small { display: block; color: var(--muted, #6e6e73); font-size: 13px; }
.code-text strong { display: block; font-size: 28px; font-weight: 800; letter-spacing: 3px; color: var(--accent, #0071e3); margin: 2px 0 6px; }
.code-text p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted, #6e6e73); }
.code-qr { flex: 0 0 112px; width: 112px; height: 112px; }
.code-qr svg { width: 100%; height: 100%; display: block; border-radius: 8px; }
