:root {
  --bg: #0E0E10;
  --surface: #17171A;
  --surface-2: #1F1F23;
  --line: #2A2A2F;
  --text: #F5F5F4;
  --muted: #A8A29E;
  --faint: #6E6A66;
  --red: #E3262F;
  --red-soft: rgba(227, 38, 47, 0.12);
  --ok: #34C77B;
  --ok-soft: rgba(52, 199, 123, 0.14);
  --radius: 18px;
  --radius-sm: 12px;
  --gutter: 16px;
  --tap: 44px;
  --font-display: "Oswald", "Arial Narrow", Impact, sans-serif;
  --font-body: "Manrope", -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 160ms;
  --sheet: 320ms;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 28px -18px rgba(0, 0, 0, 0.9);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; background: var(--bg); color: var(--text); }

body {
  font: 500 16px/1.45 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  background: linear-gradient(180deg, #151518 0, var(--bg) 320px);
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 10px; }
svg { display: block; }

.app { max-width: 520px; margin: 0 auto; padding: 14px var(--gutter) 0; }

.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.brand {
  margin: 20px 0 0;
  font: 700 12px/1 var(--font-display);
  letter-spacing: 0.32em;
  color: var(--red);
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #fff;
  font: 700 19px/1 var(--font-display);
}

.top-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: var(--tap);
  height: var(--tap);
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  place-items: center;
  color: var(--text);
  text-decoration: none;
  transition: background var(--fast), transform var(--fast) var(--ease);
}

.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:active { transform: scale(0.94); background: var(--surface-2); }

.call-btn {
  height: var(--tap);
  padding: 0 16px 0 12px;
  border-radius: 999px;
  border: 0;
  background: var(--ok);
  color: #06210F;
  font-weight: 800;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform var(--fast) var(--ease), filter var(--fast);
}

.call-btn svg { width: 18px; height: 18px; }
.call-btn:active { transform: scale(0.96); filter: brightness(0.95); }

.title {
  margin: 10px 0 8px;
  font: 700 40px/1 var(--font-display);
  text-transform: uppercase;
}

.title-arrow { color: var(--red); font-weight: 500; }

.lead { margin: 0 0 14px; color: var(--muted); font-size: 15px; font-weight: 600; max-width: 34ch; }

.perks {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.perks li { display: flex; align-items: center; gap: 7px; }
.perks li::before { content: ""; width: 6px; height: 6px; background: var(--red); border-radius: 1px; flex: none; }

.ticket {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.ticket::before, .ticket::after {
  content: "";
  position: absolute;
  top: 78px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
}

.ticket::before { left: -10px; clip-path: inset(0 0 0 50%); }
.ticket::after { right: -10px; clip-path: inset(0 50% 0 0); }

.ticket-route {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 16px;
}

.city { display: grid; gap: 4px; min-width: 0; }
.city-to { text-align: right; }

.city-label, .field-label, .bar-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.city strong { font: 700 22px/1.05 var(--font-display); text-transform: uppercase; overflow-wrap: anywhere; }

.swap {
  width: var(--tap);
  height: var(--tap);
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  display: grid;
  place-items: center;
  transition: transform var(--fast) var(--ease), background var(--fast);
}

.swap svg { width: 20px; height: 20px; }
.swap:active { transform: scale(0.92) rotate(180deg); }

.ticket-stub {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 12px 18px 14px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.ticket-stub span:first-child { color: var(--text); }

.segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 18px 0 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.seg {
  min-height: var(--tap);
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-weight: 700;
  font-size: 15px;
  color: var(--muted);
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}

.seg.on { background: var(--text); color: var(--bg); }

.block { padding: 24px 0 4px; }

.block-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 12px;
  font: 700 20px/1.1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.num { font-size: 13px; color: var(--red); letter-spacing: 0.1em; }

.dates {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  margin: 0 calc(-1 * var(--gutter));
  padding: 2px var(--gutter) 6px;
  scrollbar-width: none;
}

.dates::-webkit-scrollbar { display: none; }

.date {
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: 92px;
  min-height: 116px;
  padding: 12px 10px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
  display: grid;
  align-content: start;
  gap: 2px;
  transition: border-color var(--fast) var(--ease), transform var(--fast) var(--ease), background var(--fast);
}

.date:active { transform: scale(0.97); }

.skeleton {
  background: linear-gradient(90deg, var(--surface) 0, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

.date-wd { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.date-day { font: 700 34px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.date-month { font-size: 13px; font-weight: 600; color: var(--muted); }
.date-free { margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--ok); }
.date-free.low { color: #FF8A3D; }

.date[aria-checked="true"] {
  border-color: var(--red);
  background: linear-gradient(180deg, var(--red-soft), var(--surface) 75%);
  box-shadow: 0 0 0 1px var(--red) inset;
}

.date[aria-checked="true"] .date-wd { color: var(--red); }

.stepper { display: flex; align-items: center; gap: 12px; }

.step-btn {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  transition: background var(--fast), transform var(--fast) var(--ease);
}

.step-btn:active { transform: scale(0.94); background: var(--surface-2); }
.step-btn:disabled { opacity: 0.35; }
.step-val { min-width: 44px; text-align: center; font: 700 40px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.step-hint { color: var(--muted); font-size: 13px; font-weight: 600; margin-left: auto; text-align: right; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chips-small { margin: -2px 0 14px; }

.chip {
  min-height: 40px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  transition: border-color var(--fast), background var(--fast), color var(--fast);
}

.chips-small .chip { color: var(--muted); }
.chip[aria-pressed="true"] { border-color: var(--red); background: var(--red-soft); color: var(--text); }

.field { display: grid; gap: 6px; margin-bottom: 12px; }

.field input {
  width: 100%;
  min-height: 50px;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 16px;
  font-weight: 600;
  outline: none;
  transition: border-color var(--fast);
}

.field input::placeholder { color: var(--faint); font-weight: 500; }
.field input:focus { border-color: var(--muted); }
.field input[aria-invalid="true"] { border-color: var(--red); }

.link-btn {
  min-height: var(--tap);
  border: 0;
  background: none;
  padding: 0;
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--red);
}

.note { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.photo-pick { display: grid; gap: 8px; margin: 4px 0 10px; }

.photo-btn {
  min-height: 56px;
  border-radius: var(--radius-sm);
  border: 1px dashed #3A3A40;
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  transition: background var(--fast), border-color var(--fast), transform var(--fast) var(--ease);
}

.photo-btn svg { width: 22px; height: 22px; color: var(--red); }
.photo-btn:active { transform: scale(0.98); background: var(--surface-2); border-color: var(--muted); }
.photo-btn[aria-busy="true"] { opacity: 0.6; pointer-events: none; }

.photo-preview {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
}

.photo-preview[hidden] { display: none; }
.photo-preview img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; display: block; }
.photo-meta { display: grid; font-size: 14px; }
.photo-meta span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

.error {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--red-soft);
  border: 1px solid rgba(227, 38, 47, 0.5);
  font-weight: 600;
  font-size: 14px;
}

.steps-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: step; }

.steps-list li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 32px 1fr;
  column-gap: 12px;
  font-size: 15px;
}

.steps-list li::before {
  content: counter(step);
  grid-row: span 2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font: 700 15px/1 var(--font-display);
  color: var(--red);
}

.steps-list strong { font-weight: 700; }
.steps-list span { color: var(--muted); font-size: 14px; }

.people-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.person {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 12px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font: 700 18px/1 var(--font-display);
}

.person-info { display: grid; min-width: 0; }
.person-name { font-weight: 700; }
.person-name small { color: var(--muted); font-weight: 600; font-size: 13px; margin-left: 6px; }
.person-phone { color: var(--muted); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

.person-call {
  width: var(--tap);
  height: var(--tap);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ok-soft);
  color: var(--ok);
  text-decoration: none;
  transition: transform var(--fast) var(--ease), background var(--fast);
}

.person-call svg { width: 20px; height: 20px; }
.person-call:active { transform: scale(0.92); background: rgba(52, 199, 123, 0.24); }

.social { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }

.social-btn, .ghost-btn {
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: background var(--fast), transform var(--fast) var(--ease);
}

.social-btn svg { width: 20px; height: 20px; }
.social-btn:active, .ghost-btn:active { transform: scale(0.98); background: var(--surface-2); }

.spacer { height: calc(150px + var(--safe-bottom)); }

.bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px var(--gutter) calc(8px + var(--safe-bottom));
  background: rgba(14, 14, 16, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}

.bar[hidden] { display: none; }
.bar-inner { display: flex; align-items: center; gap: 14px; max-width: 520px; margin: 0 auto; }
.bar-sum { display: grid; line-height: 1.15; min-width: 0; }
.bar-price { font: 700 24px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.bar-alt { font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }

.bar-note {
  max-width: 520px;
  margin: 6px auto 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}

.send {
  flex: 1;
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  background: var(--red);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  padding: 0 12px;
  white-space: nowrap;
  display: grid;
  place-items: center;
  text-decoration: none;
  transition: transform var(--fast) var(--ease), opacity var(--fast);
}

.send:active { transform: scale(0.98); }
.send:disabled { opacity: 0.55; }

.sheet {
  width: 100%;
  max-width: 520px;
  margin: auto auto 0;
  padding: 16px var(--gutter) calc(20px + var(--safe-bottom));
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  background: var(--surface);
  color: var(--text);
}

.sheet[open] { animation: sheet-in var(--sheet) var(--ease) both; }
.sheet::backdrop { background: rgba(0, 0, 0, 0.6); }
.sheet .person { background: var(--surface-2); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet-title { margin: 0; font: 700 20px/1.1 var(--font-display); text-transform: uppercase; }

.done {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 24px var(--gutter) calc(24px + var(--safe-bottom));
  background: var(--bg);
  animation: rise 420ms var(--ease) both;
}

.done[hidden] { display: none; }

.done-mark {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ok);
  color: #06210F;
}

.done-mark svg { width: 36px; height: 36px; }
.done-title { margin: 0; font: 700 38px/1 var(--font-display); text-transform: uppercase; }
.done-text { margin: 0 0 12px; color: var(--muted); font-size: 16px; white-space: pre-line; }
.done .send { flex: 0 0 auto; }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

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

@media (max-width: 360px) {
  .title { font-size: 34px; }
  .city strong { font-size: 19px; }
  .date { width: 84px; }
  .call-btn { padding: 0 12px 0 10px; font-size: 14px; }
  .send { font-size: 14px; padding: 0 8px; }
  .bar-inner { gap: 10px; }
}
