/* 우림레일 — mobile-only design system */
:root {
  --bg: #f3f5fa;
  --surface: #ffffff;
  --surface-2: #f6f7fb;
  --line: #e7e9f1;
  --text: #121521;
  --text-2: #5c6377;
  --text-3: #9aa1b4;
  --primary: #2f5bff;
  --primary-2: #6a4dff;
  --primary-soft: #eaf0ff;
  --ok: #00b386;
  --ok-soft: #e3f8f1;
  --warn: #f59f00;
  --warn-soft: #fff4dc;
  --bad: #f0384f;
  --bad-soft: #ffe8eb;
  --shadow: 0 1px 2px rgba(18, 21, 33, .04), 0 8px 24px rgba(18, 21, 33, .06);
  --radius: 20px;
  --radius-sm: 12px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d14;
    --surface: #151926;
    --surface-2: #1c2131;
    --line: #262c3f;
    --text: #eef0f7;
    --text-2: #a6adc2;
    --text-3: #6c7389;
    --primary: #5b7fff;
    --primary-2: #8b6dff;
    --primary-soft: #1d2747;
    --ok: #2fd3a3;
    --ok-soft: #10302a;
    --warn: #ffb938;
    --warn-soft: #33290f;
    --bad: #ff5f73;
    --bad-soft: #3a1820;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
svg.i { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 16px; height: 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- shell ---------- */
.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px);
}
.app.no-tabs { padding-bottom: 32px; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: calc(var(--safe-t) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(16px);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
}
.topbar h1 { font-size: 20px; font-weight: 800; margin: 0; flex: 1; letter-spacing: -0.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .sub { display: block; font-size: 12px; color: var(--text-2); font-weight: 500; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 0;
  display: inline-grid; place-items: center;
  background: transparent; color: var(--text); cursor: pointer;
}
.icon-btn:active { background: var(--surface-2); }
.content { padding: 4px 16px 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(18px);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line);
}
.tabbar ul { list-style: none; margin: 0 auto; padding: 0; max-width: 480px; height: var(--tabbar-h); display: grid; grid-template-columns: repeat(4, 1fr); }
.tabbar a {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 600; color: var(--text-3); position: relative;
}
.tabbar a.on { color: var(--primary); }
.tabbar .badge {
  position: absolute; top: 8px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center;
}

/* ---------- toasts ---------- */
.toasts { position: fixed; top: calc(var(--safe-t) + 8px); left: 0; right: 0; z-index: 60; display: grid; gap: 8px; padding: 0 12px; pointer-events: none; }
.toast {
  max-width: 456px; margin: 0 auto; width: 100%;
  padding: 12px 14px; border-radius: 14px; pointer-events: auto;
  background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  display: flex; gap: 10px; align-items: flex-start;
  animation: toast-in .35s cubic-bezier(.2,.9,.3,1.2);
}
.toast.error { background: var(--bad); color: #fff; }
.toast.success { background: var(--ok); color: #fff; }
.toast.warning { background: var(--warn); color: #1d1500; }
.toast.hide { opacity: 0; transform: translateY(-8px); transition: .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(.98); } }

/* ---------- cards & text ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.card h2, .section-title { font-size: 17px; font-weight: 800; margin: 0 0 12px; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
.section-title { margin: 10px 4px 0; font-size: 16px; }
.section-title .more { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--text-2); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.mono { font-variant-numeric: tabular-nums; }
.hero { padding: 8px 4px 2px; }
.hero h2 { font-size: 26px; font-weight: 800; margin: 0; letter-spacing: -0.04em; line-height: 1.25; }
.hero p { margin: 6px 0 0; color: var(--text-2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 18px; border-radius: 14px; border: 0;
  font-weight: 700; font-size: 15px; cursor: pointer; white-space: nowrap;
  background: var(--surface-2); color: var(--text);
  transition: transform .12s, filter .12s, opacity .12s;
}
.btn:active { transform: scale(.97); }
.btn[disabled], .btn.loading { opacity: .55; pointer-events: none; }
.btn.block { width: 100%; }
.btn.lg { height: 56px; font-size: 17px; border-radius: 16px; }
.btn.sm { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 35%, transparent); }
.btn.soft { background: var(--primary-soft); color: var(--primary); }
.btn.ok { background: var(--ok); color: #fff; }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.ghost { background: transparent; color: var(--text-2); }
.btn.loading::after { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-row { display: flex; gap: 8px; }
.btn-row > * { flex: 1; }

/* ---------- chips / pills ---------- */
.chips {
  --bleed: 18px;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(-1 * var(--bleed)); padding: 2px 0;
  scroll-padding-inline: var(--bleed); scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
/* iOS Safari 는 가로 스크롤 영역의 끝 padding 을 무시하므로 앞뒤 여백을 실제 요소로 둡니다 */
.chips::before, .chips::after { content: ""; flex: 0 0 calc(var(--bleed) - 8px); }
.chips::-webkit-scrollbar { display: none; }
/* 스크롤로 가려지는 쪽 가장자리를 부드럽게 흐리게 — 앞/뒤로 더 있을 때만 (app.js 가 fade-l / fade-r 토글) */
.chips {
  --fl: 0px; --fr: 0px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--fl), #000 calc(100% - var(--fr)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--fl), #000 calc(100% - var(--fr)), transparent 100%);
}
.chips.fade-l { --fl: 36px; }
.chips.fade-r { --fr: 36px; }
.chip {
  flex: none; scroll-snap-align: start;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 56px; height: 52px; padding: 0 12px; border-radius: 14px;
  background: var(--surface-2); color: var(--text-2); font-weight: 700; font-size: 14px; cursor: pointer; border: 0; position: relative;
}
.chip small { font-size: 11px; font-weight: 600; opacity: .8; }
.chip.flat { height: 36px; flex-direction: row; gap: 6px; font-size: 13px; border-radius: 11px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip input[type="date"] {
  /* 달력 칩 전체를 실제 날짜 입력으로 덮어 iOS 에서 탭하면 바로 네이티브 달력이 열리게 합니다 */
  inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0;
  pointer-events: auto; cursor: pointer; font-size: 16px; color: transparent; background: transparent;
  -webkit-appearance: none; appearance: none; z-index: 1;
}
.chip input[type="date"]::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.chip:has(input:checked), .chip.on { background: var(--text); color: var(--bg); }
.chip.sun { color: var(--bad); }
.chip.sat { color: var(--primary); }
.chip.on.sun, .chip.on.sat, .chip:has(input:checked).sun, .chip:has(input:checked).sat { color: var(--bg); }
.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 8px;
  font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--text-2); white-space: nowrap;
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.primary { background: var(--primary-soft); color: var(--primary); }
.pill.off { text-decoration: line-through; opacity: .55; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.dot.live { animation: pulse 1.4s ease-out infinite; box-shadow: 0 0 0 0 currentColor; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 60%, transparent); } 100% { box-shadow: 0 0 0 9px transparent; } }

/* ---------- search card ---------- */
.route { display: grid; grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr); align-items: center; gap: 6px; }
.station-btn {
  border: 0; background: var(--surface-2); border-radius: 16px; padding: 12px 14px; text-align: left; cursor: pointer; min-width: 0;
}
.station-btn small { display: block; font-size: 12px; color: var(--text-3); font-weight: 600; }
.station-btn b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.station-btn.arr { text-align: right; }
.swap { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; cursor: pointer; transition: transform .3s; }
.swap.spin { transform: rotate(180deg); }
.field-label { font-size: 12px; font-weight: 700; color: var(--text-3); margin: 14px 2px 8px; display: flex; justify-content: space-between; }
.select-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.select-btn {
  height: 52px; border-radius: 14px; border: 0; background: var(--surface-2); padding: 0 14px;
  display: flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; text-align: left; position: relative; width: 100%;
}
.select-btn select { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.select-btn .grow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- inputs ---------- */
.input, select.input, textarea.input {
  width: 100%; height: 50px; padding: 0 14px; border-radius: 14px; border: 1.5px solid transparent;
  background: var(--surface-2); font-size: 16px; outline: none; transition: border-color .15s, background .15s;
  -webkit-appearance: none; appearance: none;
}
.input:focus { border-color: var(--primary); background: var(--surface); }
label.lbl { display: block; font-size: 13px; font-weight: 700; color: var(--text-2); margin: 0 2px 6px; }
.form-grid { display: grid; gap: 12px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.help { font-size: 12px; color: var(--text-3); margin: 6px 2px 0; }
.errorlist { margin: 6px 2px 0; padding: 0; list-style: none; color: var(--bad); font-size: 13px; font-weight: 600; }

.switch-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.switch-row:first-child { border-top: 0; }
.switch-row .grow b { display: block; font-size: 15px; }
.switch-row .grow span { font-size: 12px; color: var(--text-2); }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; border-radius: 15px; background: var(--line); transition: .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: .2s; }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:disabled + i { opacity: .4; }

.segment { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.segment label, .segment button { height: 40px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--text-2); cursor: pointer; border: 0; background: transparent; position: relative; }
.segment input { position: absolute; opacity: 0; }
.segment label:has(input:checked), .segment button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 36px; height: 36px; border-radius: 11px; border: 0; background: var(--surface-2); font-size: 20px; font-weight: 700; cursor: pointer; display: grid; place-items: center; }
.stepper output { min-width: 30px; text-align: center; font-weight: 800; font-size: 17px; }

/* ---------- train result ---------- */
.date-nav { display: flex; align-items: center; justify-content: space-between; background: var(--surface); border-radius: 16px; padding: 6px; box-shadow: var(--shadow); }
.date-nav b { font-size: 16px; }
.date-nav a, .date-nav span.disabled { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; }
.date-nav span.disabled { opacity: .25; }
.train {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center;
  background: var(--surface); border-radius: 18px; padding: 14px 14px 14px 12px; box-shadow: var(--shadow);
  cursor: pointer; position: relative; border: 2px solid transparent; transition: border-color .15s, transform .12s;
}
.train:active { transform: scale(.99); }
.train:has(input:checked) { border-color: var(--primary); }
.train.soldout .times b { color: var(--text-2); }
.check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; transition: .15s; }
.check svg { opacity: 0; width: 14px; height: 14px; stroke: #fff; stroke-width: 3.5; }
.train input { position: absolute; opacity: 0; pointer-events: none; }
.train input:checked ~ .check { background: var(--primary); border-color: var(--primary); }
.train input:checked ~ .check svg { opacity: 1; }
.times { display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.times b { font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
.times .arrow { color: var(--text-3); font-size: 13px; }
.train .meta { font-size: 12px; color: var(--text-2); margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.train .seats { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.train .side { display: grid; gap: 6px; justify-items: end; }
.empty { text-align: center; padding: 40px 20px; color: var(--text-2); }
.empty .big { font-size: 40px; margin-bottom: 8px; }

.actionbar {
  position: fixed; left: 0; right: 0; z-index: 25;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px);
  padding: 0 12px; pointer-events: none;
}
.actionbar .inner {
  max-width: 456px; margin: 0 auto; pointer-events: auto;
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 18px;
  background: var(--text); color: var(--bg); box-shadow: 0 12px 32px rgba(0,0,0,.25);
}
.actionbar .inner b { font-size: 15px; }
.actionbar .btn { height: 44px; }
.with-actionbar { padding-bottom: 80px; }

/* ---------- jobs ---------- */
.job { display: grid; gap: 10px; }
.job-head { display: flex; align-items: center; gap: 10px; }
.job-route { font-size: 17px; font-weight: 800; letter-spacing: -0.03em; }
.job-meta { font-size: 13px; color: var(--text-2); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; }
.status.RUNNING, .status.PENDING { background: var(--primary-soft); color: var(--primary); }
.status.SUCCESS { background: var(--ok-soft); color: var(--ok); }
.status.FAILED { background: var(--bad-soft); color: var(--bad); }
.status.CANCELED { background: var(--surface-2); color: var(--text-3); }
.progress { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; position: relative; }
.progress::after { content: ""; position: absolute; inset: 0; width: 40%; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--primary), transparent); animation: scan 1.6s ease-in-out infinite; }
@keyframes scan { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.counter { font-size: 40px; font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.radar { width: 120px; height: 120px; margin: 6px auto 14px; border-radius: 50%; position: relative; display: grid; place-items: center; background: radial-gradient(circle, var(--primary-soft) 0 60%, transparent 61%); color: var(--primary); }
.radar::before, .radar::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--primary); opacity: 0; animation: ring 2.4s ease-out infinite; }
.radar::after { animation-delay: 1.2s; }
.radar.done::before, .radar.done::after { display: none; }
.radar.SUCCESS { background: radial-gradient(circle, var(--ok-soft) 0 60%, transparent 61%); color: var(--ok); }
.radar.FAILED { background: radial-gradient(circle, var(--bad-soft) 0 60%, transparent 61%); color: var(--bad); }
.radar.CANCELED { background: radial-gradient(circle, var(--surface-2) 0 60%, transparent 61%); color: var(--text-3); }
.radar svg.i { width: 40px; height: 40px; }
@keyframes ring { from { transform: scale(.6); opacity: .7; } to { transform: scale(1.15); opacity: 0; } }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; font-weight: 700; text-align: right; }
.log { background: #0d1020; color: #b9c3e6; border-radius: 14px; padding: 12px; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; max-height: 280px; overflow: auto; white-space: pre-wrap; word-break: break-all; margin: 0; }

/* ---------- tickets ---------- */
.ticket { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.ticket .top { padding: 16px 18px 14px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; }
.ticket .top.wait { background: linear-gradient(135deg, #f59f00, #ff7a45); }
.ticket .top.issued { background: linear-gradient(135deg, #0f9b78, #00b3a1); }
.ticket .route-big { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px; margin-top: 10px; }
.ticket .route-big b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -0.04em; }
.ticket .route-big small { display: block; font-size: 13px; opacity: .85; font-weight: 600; }
.ticket .route-big .r { text-align: right; }
.ticket .route-big .mid { text-align: center; font-size: 12px; opacity: .85; padding-bottom: 6px; }
.ticket .perf { height: 0; border-top: 2px dashed var(--line); margin: 0 14px; position: relative; }
.ticket .perf::before, .ticket .perf::after { content: ""; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); }
.ticket .perf::before { left: -24px; } .ticket .perf::after { right: -24px; }
.ticket .bottom { padding: 14px 18px 16px; display: grid; gap: 12px; }
.ticket .seatbig { display: flex; gap: 18px; }
.ticket .seatbig div small { display: block; font-size: 12px; color: var(--text-3); font-weight: 600; }
.ticket .seatbig div b { font-size: 20px; font-weight: 800; }
.ticket.focus { outline: 3px solid var(--warn); outline-offset: 2px; }
.countdown { font-weight: 800; font-variant-numeric: tabular-nums; }
.countdown.urgent { color: var(--bad); }

.skeleton { border-radius: var(--radius); height: 160px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- list rows ---------- */
.list { display: grid; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 13px 2px; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }
.avatar { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 800; flex: none; }
.avatar.tg { background: #e5f4fd; color: #229ed9; }
.avatar.card { background: var(--warn-soft); color: var(--warn); }
.avatar.ok { background: var(--ok-soft); color: var(--ok); }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13px; color: var(--text-2); }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--warn-soft); color: var(--text); font-size: 13px; align-items: flex-start; }
.notice.info { background: var(--primary-soft); }
.notice.ok { background: var(--ok-soft); }
.setup-card { display: flex; align-items: center; gap: 12px; }

/* ---------- bottom sheet (native dialog) ---------- */
dialog.sheet {
  margin: auto auto 0; padding: 0; border: 0; width: 100%; max-width: 480px; max-height: 88dvh;
  border-radius: 24px 24px 0 0; background: var(--surface); color: var(--text);
  box-shadow: 0 -10px 40px rgba(0,0,0,.2);
  display: none; flex-direction: column;
}
dialog.sheet[open] { display: flex; animation: sheet-in .32s cubic-bezier(.2,.9,.25,1); }
dialog.sheet::backdrop { background: rgba(8, 10, 20, .45); backdrop-filter: blur(2px); animation: fade-in .25s; }
dialog.sheet.closing { animation: sheet-out .22s ease-in forwards; }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 10px auto 4px; flex: none; }
.sheet-head { display: flex; align-items: center; padding: 6px 12px 6px 20px; flex: none; }
.sheet-head h3 { margin: 0; font-size: 19px; font-weight: 800; flex: 1; letter-spacing: -0.03em; }
.sheet-body { padding: 6px 20px 16px; overflow-y: auto; display: grid; gap: 12px; }
.sheet-foot { padding: 10px 20px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); flex: none; }
.station-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.station-grid button { height: 42px; border-radius: 12px; border: 0; background: var(--surface-2); font-weight: 700; font-size: 13px; cursor: pointer; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.station-grid button:active { background: var(--primary-soft); color: var(--primary); }
.station-list button { display: block; width: 100%; text-align: left; height: 48px; border: 0; background: transparent; font-weight: 600; font-size: 16px; border-bottom: 1px solid var(--line); cursor: pointer; padding: 0 4px; }
.station-list mark { background: none; color: var(--primary); font-weight: 800; }

/* ---------- auth ---------- */
.auth { min-height: 100dvh; display: grid; align-content: center; gap: 22px; padding: 24px 20px calc(24px + var(--safe-b)); max-width: 420px; margin: 0 auto; }
.brand { display: grid; justify-items: center; gap: 10px; text-align: center; }
.brand img { width: 72px; height: 72px; border-radius: 22px; box-shadow: 0 10px 30px rgba(61, 107, 255, .35); }
.brand h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.04em; }
.brand p { margin: 0; color: var(--text-2); }

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