/* Мини-приложение сопровождения делегаций.
   Экран смотрят с телефона в чужом городе, часто на ходу: крупный тап, спокойный
   фон, один главный элемент на экран. Темная тема берется системная. */
:root {
  --ink: #0e131a;
  --ink-2: #4b5665;
  --ink-3: #8c98a8;
  --bg: #f3f5f9;
  --card: #ffffff;
  --line: rgba(14, 19, 26, .09);
  --line-2: rgba(14, 19, 26, .05);
  --acc: #1e5eff;
  --acc-soft: rgba(30, 94, 255, .10);
  --ok: #0f9d58;
  --ok-soft: rgba(15, 157, 88, .11);
  --wait: #b26a00;
  --wait-soft: rgba(178, 106, 0, .11);
  --r: 16px;
  --r-s: 12px;
  --tap: 54px;
  --pad: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #eef2f7; --ink-2: #a7b3c3; --ink-3: #6d7b8d;
    --bg: #0b0f15; --card: #151b24; --line: rgba(255, 255, 255, .10);
    --line-2: rgba(255, 255, 255, .05);
    --acc: #5b8bff; --acc-soft: rgba(91, 139, 255, .14);
    --ok: #3ddc84; --ok-soft: rgba(61, 220, 132, .13);
    --wait: #ffb64d; --wait-soft: rgba(255, 182, 77, .13);
  }
}
:root[data-theme="dark"] {
  --ink: #eef2f7; --ink-2: #a7b3c3; --ink-3: #6d7b8d;
  --bg: #0b0f15; --card: #151b24; --line: rgba(255, 255, 255, .10);
  --line-2: rgba(255, 255, 255, .05);
  --acc: #5b8bff; --acc-soft: rgba(91, 139, 255, .14);
  --ok: #3ddc84; --ok-soft: rgba(61, 220, 132, .13);
  --wait: #ffb64d; --wait-soft: rgba(255, 182, 77, .13);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 400 16px/1.45 -apple-system, "SF Pro Text", "Segoe UI", Roboto, Inter, sans-serif;
  font-feature-settings: "tnum" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
}
#app {
  max-width: 620px; margin: 0 auto;
  padding: 0 var(--pad) calc(96px + env(safe-area-inset-bottom));
}
button, input { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

/* ---------- заголовки */
.top { padding: 22px 0 16px; }
.top h1 { margin: 0; font-size: 24px; font-weight: 660; letter-spacing: -.028em;
          text-wrap: balance; }
.top .sub { color: var(--ink-3); font-size: 13.5px; margin-top: 4px; }
h2 { margin: 26px 0 10px; font-size: 13px; font-weight: 600; color: var(--ink-3);
     letter-spacing: 0; }
h3 { margin: 0 0 4px; font-size: 18px; font-weight: 620; letter-spacing: -.02em; }
p { margin: 0 0 10px; }
.muted { color: var(--ink-3); }
.small { font-size: 13.5px; }

/* ---------- карточки */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px; margin-bottom: 10px;
}
.card.flat { padding: 0; overflow: hidden; }
.card.tap { cursor: pointer; transition: border-color .15s ease, transform .12s ease; }
.card.tap:active { transform: scale(.993); border-color: var(--acc); }
.rows { display: grid; gap: 1px; background: var(--line-2); }
.rows > div { background: var(--card); padding: 13px 16px; display: flex;
              justify-content: space-between; gap: 14px; align-items: baseline; }
.rows span { color: var(--ink-3); font-size: 14px; white-space: nowrap; }
.rows b { font-weight: 560; text-align: right; }

/* ---------- главный блок: что сейчас */
.hero { padding: 18px; }
.hero .kicker { font-size: 12.5px; font-weight: 600; color: var(--acc);
                margin-bottom: 8px; }
.hero .title { font-size: 21px; font-weight: 640; letter-spacing: -.024em; line-height: 1.22; }
.hero .when { margin-top: 6px; color: var(--ink-2); }
.hero .where { color: var(--ink-3); font-size: 14.5px; margin-top: 2px; }

/* ---------- встречающий */
.meeter { display: flex; gap: 14px; align-items: center; }
.meeter img { width: 68px; height: 68px; border-radius: 50%; object-fit: cover;
              object-position: center top; flex: none; background: var(--line-2); }
.meeter .no-photo { width: 68px; height: 68px; border-radius: 50%; flex: none;
                    background: var(--acc-soft); color: var(--acc); font-weight: 620;
                    display: flex; align-items: center; justify-content: center;
                    font-size: 22px; }
.meeter .who { min-width: 0; }

/* ---------- полоски статуса */
.status { display: flex; align-items: center; gap: 12px; }
.status .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.status.ok .dot { background: var(--ok); }
.status.wait .dot { background: var(--wait); }
.tag { font-size: 12.5px; font-weight: 600; padding: 5px 9px; border-radius: 8px;
       white-space: nowrap; }
.tag.ok { color: var(--ok); background: var(--ok-soft); }
.tag.wait { color: var(--wait); background: var(--wait-soft); }
.tag.acc { color: var(--acc); background: var(--acc-soft); }

/* ---------- кнопки */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; min-height: var(--tap); border: 1px solid transparent;
  border-radius: var(--r-s); background: var(--acc); color: #fff;
  font-size: 17px; font-weight: 580; cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}
.btn:active { transform: scale(.985); filter: brightness(.94); }
.btn.ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn.soft { background: var(--acc-soft); color: var(--acc); }
.btn.ok { background: var(--ok); color: #04130a; }
.btn.slim { min-height: 46px; font-size: 16px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btns { display: grid; gap: 8px; margin-top: 12px; }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9;
           stroke-linecap: round; stroke-linejoin: round; }

/* ---------- списки выбора */
.list { display: grid; gap: 8px; }
.item {
  display: flex; align-items: center; gap: 12px; min-height: var(--tap);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-s);
  padding: 11px 14px; cursor: pointer; text-align: left; width: 100%;
  transition: border-color .15s ease, transform .12s ease;
}
.item:active { transform: scale(.993); border-color: var(--acc); }
.item .grow { flex: 1; min-width: 0; }
.item .fio { display: block; font-weight: 550; letter-spacing: -.01em; overflow: hidden;
             text-overflow: ellipsis; white-space: nowrap; }
.item .note { display: block; color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.item .time { font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: 13.5px;
              white-space: nowrap; }
.chev { width: 18px; height: 18px; flex: none; stroke: var(--ink-3); fill: none;
        stroke-width: 2; }

/* ---------- поиск */
.search { position: relative; margin-bottom: 10px; }
.search input {
  width: 100%; min-height: 50px; padding: 0 14px 0 42px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r-s); font-size: 16px; outline: none;
}
.search input:focus { border-color: var(--acc); }
.search svg { position: absolute; left: 13px; top: 14px; width: 21px; height: 21px;
              stroke: var(--ink-3); fill: none; stroke-width: 1.8; }

/* ---------- прогресс на стойке */
.counter { display: flex; align-items: baseline; gap: 12px; }
.counter b { font-size: 32px; font-weight: 680; letter-spacing: -.035em; line-height: 1; }
.counter .of { color: var(--ink-3); font-size: 15px; }
.bar { flex: 1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ok); border-radius: 3px;
         transition: width .45s cubic-bezier(.22,.7,.3,1); }

/* ---------- QR */
.qr { text-align: center; padding: 22px 18px; }
.qr img { width: min(260px, 70vw); margin: 4px auto 14px; border-radius: 12px;
          background: #fff; padding: 12px; }
.qr .code { font-variant-numeric: tabular-nums; letter-spacing: .04em; color: var(--ink-2);
            font-size: 15px; }

/* ---------- нижняя навигация */
nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
nav .inner { max-width: 620px; margin: 0 auto; display: flex; }
nav button {
  flex: 1; border: 0; background: none; cursor: pointer; padding: 9px 0 10px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--ink-3); font-size: 11px; font-weight: 530;
}
nav button svg { width: 23px; height: 23px; fill: none; stroke: currentColor;
                 stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
nav button[aria-current="true"] { color: var(--acc); }

/* ---------- мелочи */
.steps { display: flex; gap: 5px; margin-bottom: 18px; }
.steps i { height: 3px; flex: 1; border-radius: 2px; background: var(--line); }
.steps i.on { background: var(--acc); }
.empty { color: var(--ink-3); text-align: center; padding: 30px 6px; font-size: 15px; }
.err { color: #d33; font-size: 14px; margin-top: 8px; }
.route { white-space: pre-wrap; }
.map { border-radius: var(--r-s); margin-top: 12px; border: 1px solid var(--line); }
.skeleton { background: var(--line-2); border-radius: var(--r); height: 84px;
            margin-bottom: 10px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55 } }
.screen { animation: in .22s ease; }
@keyframes in { from { opacity: .3; transform: translateY(6px) } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important } }

dialog {
  border: 0; border-radius: 20px 20px 0 0; width: 100%; max-width: 620px;
  margin: auto auto 0; background: var(--card); color: var(--ink);
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  animation: up .22s cubic-bezier(.22,.7,.3,1);
}
dialog::backdrop { background: rgba(4, 7, 12, .55); }
@keyframes up { from { transform: translateY(18px); opacity: .5 } }

#toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 9;
  background: var(--ink); color: var(--bg); font-size: 14.5px; font-weight: 530;
  padding: 11px 16px; border-radius: 12px; max-width: 90vw; text-align: center;
  animation: up .2s ease;
}

/* режим организатора: человек должен понимать, почему видит не то, что участник */
.mode { font-size: 13px; font-weight: 600; letter-spacing: .01em; color: var(--acc);
  margin-bottom: 6px; }
