/* ─── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }

body {
  font-family: 'Geist', sans-serif;
  background: #F0F2F7;
  color: #0F1923;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Design Tokens ─────────────────────────────────────────────── */
:root {
  --ink:          #0F1923;
  --ink-mid:      #1E2D3D;
  --ink-soft:     #2C3E50;
  --blue:         #1A6BF5;
  --blue-dim:     rgba(26,107,245,0.12);
  --blue-border:  rgba(26,107,245,0.35);
  --green:        #0DBF7E;
  --green-dim:    rgba(13,191,126,0.1);
  --green-text:   #077A51;
  --amber:        #F5A623;
  --amber-dim:    rgba(245,166,35,0.1);
  --amber-text:   #9B6400;
  --red:          #E84040;
  --red-dim:      rgba(232,64,64,0.1);
  --red-text:     #B52E2E;
  --muted:        #64748B;
  --border:       rgba(15,25,35,0.09);
  --border-med:   rgba(15,25,35,0.14);
  --surface:      #F8FAFD;
  --card:         #ffffff;
  --sidebar-w:    230px;
  --topbar-h:     56px;
  --radius-sm:    6px;
  --radius-md:    10px;
  --radius-lg:    14px;
  --radius-xl:    18px;
}

/* ─── App Shell ─────────────────────────────────────────────────── */
.app {
  display: flex;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  height: var(--app-height, 100vh);
  overflow: hidden;
}

/* ─── Sidebar ───────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--ink);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  z-index: 10;
}

/* decorative rings */
.sidebar::before {
  content: '';
  position: absolute;
  bottom: -80px; right: -80px;
  width: 240px; height: 240px;
  border: 1.5px solid rgba(26,107,245,0.15);
  border-radius: 50%;
  pointer-events: none;
}
.sidebar::after {
  content: '';
  position: absolute;
  bottom: -120px; right: -120px;
  width: 340px; height: 340px;
  border: 1px solid rgba(26,107,245,0.08);
  border-radius: 50%;
  pointer-events: none;
}

/* brand */
.sidebar-brand {
  padding: 22px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.brand-row {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 3px;
}
.brand-icon {
  width: 34px; height: 34px;
  background: var(--blue);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-icon svg { width: 20px; height: 20px; }
.brand-name {
  font-family: 'Geist', sans-serif;
  font-size: 18px; font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
}
.brand-sub {
  font-size: 10.5px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding-left: 45px;
}

/* nav sections */
.sidebar-controls {
  padding: 16px 12px 6px;
  flex-shrink: 0;
}
.sidebar-section {
  padding: 0 12px 6px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.sidebar-section::-webkit-scrollbar {
  width: 4px;
}
.sidebar-section::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-section::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
.sidebar-section::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}
.section-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.25);
  padding: 0 8px;
  margin-bottom: 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 1px;
  text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,0.05); }
.nav-item.active { background: rgba(26,107,245,0.2); }
.nav-icon {
  width: 17px; height: 17px;
  opacity: 0.5; flex-shrink: 0;
  transition: opacity 0.15s;
}
.nav-item.active .nav-icon { opacity: 1; }
.nav-item:hover .nav-icon { opacity: 0.75; }
.nav-label {
  font-size: 13.5px;
  color: rgba(255,255,255,0.55);
  font-weight: 400;
  transition: color 0.15s;
}
.nav-item.active .nav-label { color: #fff; font-weight: 500; }
.nav-item:hover .nav-label { color: rgba(255,255,255,0.8); }
.nav-badge {
  margin-left: auto;
  background: var(--blue);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  letter-spacing: 0.03em;
}

/* new chat button */
.new-chat-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(26,107,245,0.15);
  color: #fff;
  font-family: 'Geist', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  margin-bottom: 10px;
}
.new-chat-btn:hover {
  background: rgba(26,107,245,0.25);
  border-color: rgba(26,107,245,0.4);
}
.new-chat-btn svg { width: 16px; height: 16px; opacity: 0.9; flex-shrink: 0; }
.new-chat-btn span { flex: 1; }
.new-chat-shortcut {
  font-size: 10px;
  opacity: 0.35;
  letter-spacing: 0.02em;
}

/* search history */
.search-wrap {
  position: relative;
  margin-bottom: 14px;
}
.search-icon {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  opacity: 0.35;
  pointer-events: none;
}
.history-search {
  width: 100%;
  padding: 8px 10px 8px 32px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  font-family: 'Geist', sans-serif;
  font-size: 12.5px;
  color: rgba(255,255,255,0.75);
  outline: none;
  transition: all 0.15s;
}
.history-search::placeholder { color: rgba(255,255,255,0.28); }
.history-search:focus {
  background: rgba(255,255,255,0.09);
  border-color: rgba(26,107,245,0.4);
}

/* recents */
.recent-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.recent-item:hover { background: rgba(255,255,255,0.05); }
.recent-item:hover .recent-del { opacity: 1; }
.recent-item.active-session { background: rgba(26,107,245,0.12); }
.recent-icon-wrap {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.recent-icon-wrap svg { width: 12px; height: 12px; opacity: 0.45; }
.recent-meta { flex: 1; min-width: 0; }
.recent-label {
  font-size: 12.5px;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.recent-time {
  font-size: 10.5px;
  color: rgba(255,255,255,0.2);
  margin-top: 1px;
  display: block;
}
.recent-del {
  opacity: 0;
  width: 14px; height: 14px;
  color: rgba(255,255,255,0.25);
  flex-shrink: 0;
  transition: opacity 0.15s;
  cursor: pointer;
}

/* sidebar footer */
.sidebar-footer {
  margin-top: auto;
  padding: 14px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s;
}
.user-row:hover { background: rgba(255,255,255,0.05); }
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: #fff;
  flex-shrink: 0;
}
.user-name {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
}
.user-settings {
  margin-left: auto;
  opacity: 0.3;
  width: 15px; height: 15px;
}

/* delete modal */
.delete-modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(4px);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
.delete-modal-overlay.open { opacity: 1; pointer-events: auto; }
.delete-modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 24px; width: 90%; max-width: 340px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  transform: translateY(10px) scale(0.95); transition: transform 0.2s cubic-bezier(0.16,1,0.3,1);
}
.delete-modal-overlay.open .delete-modal { transform: translateY(0) scale(1); }
.del-title { font-size: 18px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.del-desc { font-size: 14px; color: var(--muted); line-height: 1.4; margin-bottom: 24px; }
.del-actions { display: flex; gap: 12px; justify-content: flex-end; }
.del-btn {
  padding: 10px 16px; border-radius: 8px; font-size: 14px; font-weight: 600;
  cursor: pointer; border: none; transition: all 0.2s;
}
.del-btn.cancel { background: var(--surface-hover); color: var(--ink-soft); }
.del-btn.cancel:hover { background: var(--border-light); color: var(--ink); }
.del-btn.confirm { background: #fee2e2; color: #dc2626; }
.del-btn.confirm:hover { background: #fecaca; }

/* ─── Main Panel ────────────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
}

/* topbar */
.topbar {
  height: var(--topbar-h);
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-icon-wrap {
  width: 30px; height: 30px;
  background: var(--blue-dim);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
}
.topbar-icon-wrap svg { width: 15px; height: 15px; color: var(--blue); }
.topbar-title {
  font-family: 'Geist', sans-serif;
  font-size: 15px; font-weight: 600;
  color: var(--ink);
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.share-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 99px;
  border: 1px solid var(--border-med);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: 'Geist', sans-serif;
  transition: all 0.15s;
}
.share-btn:hover {
  background: var(--blue-dim);
  color: var(--blue);
  border-color: var(--blue-border);
}
.share-btn svg { width: 14px; height: 14px; }

/* share toast */
.share-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 99px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
  z-index: 999;
}
.share-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Chat Area ─────────────────────────────────────────────────── */
.chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  scroll-behavior: smooth;
  align-items: center;
}
.chat-scroll::-webkit-scrollbar { width: 4px; }
.chat-scroll::-webkit-scrollbar-track { background: transparent; }
.chat-scroll::-webkit-scrollbar-thumb { background: rgba(15,25,35,0.12); border-radius: 2px; }

/* constrain all direct children to a centered column */
.chat-scroll > * {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

/* messages */
.msg {
  display: flex;
  gap: 12px;
  animation: msgIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.msg.user { flex-direction: row-reverse; }

/* ─── Animations ────────────────────────────────────────────────── */
@keyframes msgIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseLoading {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 0.5; }
}

[id^="loading-"] {
  animation: pulseLoading 1.5s infinite ease-in-out;
}

.msg:nth-child(1) { animation-delay: 0.05s; }
.msg:nth-child(2) { animation-delay: 0.15s; }
.msg:nth-child(3) { animation-delay: 0.28s; }
.msg:nth-child(4) { animation-delay: 0.45s; }

.ctx-chips {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px;
  animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.ctx-chip {
  background: var(--card);
  border: 1px solid var(--border-med);
  padding: 8px 14px; border-radius: 99px;
  font-size: 13px; font-weight: 500; color: var(--ink-soft);
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.ctx-chip:hover {
  background: var(--surface); color: var(--ink); border-color: var(--ink-soft);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.ctx-chips.disabled .ctx-chip {
  opacity: 0.45;
  pointer-events: none;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.msg-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.msg-avatar.ai {
  background: var(--ink);
  color: #fff;
  font-family: 'Geist', sans-serif;
}
.msg-avatar.user {
  background: var(--blue);
  color: #fff;
}

.msg-body {
  max-width: 86%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.msg.user .msg-body { align-items: flex-end; }

.bubble {
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.65;
  animation: bubbleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.bubble.ai {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px var(--radius-lg) var(--radius-lg) var(--radius-lg);
  color: var(--ink);
}
.bubble.user {
  background: var(--blue);
  color: #fff;
  border-radius: var(--radius-lg) 4px var(--radius-lg) var(--radius-lg);
}

.loading-pulse {
  animation: pulseOpacity 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulseOpacity {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

.msg-time {
  font-size: 11px;
  color: var(--muted);
  padding: 0 4px;
}

/* ─── Result Cards ──────────────────────────────────────────────── */
.result-card {
  background: var(--card);
  width: 100%;
  min-width: 380px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 6px;
}

/* PNR card header */
.pnr-head {
  padding: 14px 18px;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pnr-meta-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.35);
  margin-bottom: 3px;
}
.pnr-number {
  font-family: 'Geist', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
}
.status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 99px;
  letter-spacing: 0.04em;
}
.status-pill.confirmed { background: var(--green); color: #fff; }
.status-pill.waiting   { background: var(--amber); color: #fff; }
.status-pill.cancelled { background: var(--red);   color: #fff; }
.status-pill.running   { background: var(--green-dim); color: var(--green-text); border: 1px solid rgba(13,191,126,0.3); }
.status-pill.late      { background: var(--amber-dim); color: var(--amber-text); border: 1px solid rgba(245,166,35,0.3); }
.status-pill.not-running { background: var(--surface-hover); color: var(--muted); border: 1px solid var(--border-light); }
.status-pill.departed  { background: var(--amber-dim); color: var(--amber-text); border: 1px solid rgba(245,166,35,0.3); }

.hidden { display: none !important; }

/* card body */
.card-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* info rows */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--muted); }
.info-value { font-weight: 500; color: var(--ink); }
.info-value.blue { color: var(--blue); }

/* passenger table */
.passenger-table {
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-top: 4px;
}
.passenger-row {
  display: flex;
  align-items: center;
  padding: 9px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
.passenger-row:last-child { border-bottom: none; }
.p-idx {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--blue-dim);
  color: var(--blue);
  font-size: 10px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.p-name { flex: 1; color: var(--ink); }
.p-seat {
  font-family: 'Geist', sans-serif;
  font-size: 12px; font-weight: 700;
  color: var(--blue);
  background: var(--blue-dim);
  padding: 3px 10px;
  border-radius: 99px;
}
.cnf-badge {
  font-size: 10px; font-weight: 700;
  background: var(--green-dim);
  color: var(--green-text);
  padding: 2px 9px;
  border-radius: 99px;
  letter-spacing: 0.03em;
}

/* ─── Route Visual (live running card) ─────────────────────────── */
.live-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.train-id {
  font-family: 'Geist', sans-serif;
  font-size: 22px; font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1;
}
.train-name-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.route-row {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 16px 18px 8px;
}
.route-stn { flex: 0 0 auto; }
.stn-code {
  font-family: 'Geist', sans-serif;
  font-size: 20px; font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.stn-name { font-size: 11px; color: var(--muted); margin-top: 1px; }
.stn-time { font-size: 14px; font-weight: 500; color: var(--ink-soft); margin-top: 4px; }
.route-stn.dest { text-align: right; }

.route-track {
  flex: 1;
  padding: 8px 14px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.track-bar {
  width: 100%;
  height: 3px;
  background: var(--border-med);
  border-radius: 2px;
  position: relative;
}
.track-fill {
  position: absolute; left: 0; top: 0; height: 100%;
  background: var(--blue);
  border-radius: 2px;
  width: 62%;
}
.track-dot {
  position: absolute;
  left: 60%;
  top: -5px;
  width: 13px; height: 13px;
  background: var(--blue);
  border-radius: 50%;
  border: 3px solid var(--card);
  box-shadow: 0 0 0 1.5px var(--blue);
}
.track-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}

/* stat cells */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 4px 18px 16px;
}
.stat-cell {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  border: 1px solid var(--border);
}
.stat-lbl { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.stat-val { font-size: 14px; font-weight: 600; color: var(--ink); }
.stat-val.amber { color: var(--amber); }
.stat-val.green { color: var(--green-text); }
.stat-val.blue  { color: var(--blue); }

/* ─── Input Area ────────────────────────────────────────────────── */
.input-area {
  padding: 10px 24px 20px;
  background: var(--surface);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.input-area-inner {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

/* unified Claude-style composer box */
.composer {
  background: var(--card);
  border: 1.5px solid var(--border-med);
  border-radius: 18px;
  padding: 14px 12px 10px 16px;
  transition: border-color 0.15s;
}
.composer:focus-within {
  border-color: rgba(15,25,35,0.22);
}

/* ─── Station Card ───────────────────────────────────────────────── */
.stn-card-head {
  padding: 18px 18px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.stn-card-left { flex: 1; min-width: 0; }
.stn-code-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ink);
  color: #fff;
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 4px 11px;
  border-radius: 7px;
  margin-bottom: 10px;
}
.stn-full-name {
  font-family: 'Geist', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 5px;
}
.stn-state-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
}
.stn-state-row svg { width: 12px; height: 12px; flex-shrink: 0; }
.stn-zone-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 99px;
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid var(--blue-border);
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
}

/* ─── Train Detail Card ──────────────────────────────────────────── */
.train-card-head {
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.train-card-left { flex: 1; min-width: 0; }
.train-num-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.train-num-tag {
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  background: var(--ink);
  color: #fff;
  padding: 4px 11px;
  border-radius: 7px;
}
.train-fav-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  color: var(--muted);
  transition: color 0.15s;
}
.train-fav-btn:hover { color: var(--amber); }
.train-fav-btn svg { width: 16px; height: 16px; }
.train-card-name {
  font-family: 'Geist', sans-serif;
  font-size: 19px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 5px;
}
.train-type-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid var(--blue-border);
  white-space: nowrap;
  align-self: flex-start;
  flex-shrink: 0;
}

/* route strip */
.train-route-strip {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  gap: 0;
}
.train-stn-block { flex: 0 0 auto; }
.train-stn-block.dest { text-align: right; }
.train-stn-code {
  font-family: 'Geist', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1;
}
.train-stn-name {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  max-width: 100px;
  line-height: 1.3;
}
.train-route-mid {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 12px;
}
.train-route-line {
  width: 100%;
  height: 2px;
  background: var(--border-med);
  border-radius: 2px;
  position: relative;
  margin-bottom: 6px;
}
.train-route-line::before,
.train-route-line::after {
  content: '';
  position: absolute;
  top: -3px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ink);
}
.train-route-line::before { left: 0; }
.train-route-line::after  { right: 0; }
.train-route-label {
  font-size: 10.5px;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
}

/* ─── Trains Between Stations Card ──────────────────────────────── */
.tbs-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.tbs-route {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.tbs-stn {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.tbs-stn-code {
  font-family: 'Geist', sans-serif;
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1;
}
.tbs-stn-name {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}
.tbs-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0 4px;
  flex-shrink: 0;
}
.tbs-arrow-line {
  width: 40px;
  height: 1.5px;
  background: var(--border-med);
  border-radius: 1px;
  position: relative;
}
.tbs-arrow-line::after {
  content: '';
  position: absolute;
  right: -1px; top: -3px;
  width: 7px; height: 7px;
  border-top: 1.5px solid var(--muted);
  border-right: 1.5px solid var(--muted);
  transform: rotate(45deg);
}
.tbs-meta {
  font-size: 10px;
  color: var(--muted);
}
.tbs-count-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid var(--blue-border);
  white-space: nowrap;
  flex-shrink: 0;
}

/* filter bar */
.tbs-filters {
  display: flex;
  gap: 6px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tbs-filters::-webkit-scrollbar { display: none; }
.tbs-filter-btn {
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 99px;
  border: 1px solid var(--border-med);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  font-family: 'Geist', sans-serif;
  transition: all 0.15s;
  flex-shrink: 0;
}
.tbs-filter-btn.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.tbs-filter-btn:not(.active):hover {
  background: var(--surface);
  border-color: var(--border-med);
  color: var(--ink);
}

/* train list */
.tbs-list { display: flex; flex-direction: column; }

.tbs-train-row {
  display: flex;
  align-items: center;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  cursor: pointer;
  transition: background 0.12s;
  text-decoration: none;
}
.tbs-train-row:last-child { border-bottom: none; }
.tbs-train-row:hover { background: var(--surface); }

.tbs-train-left { flex: 1; min-width: 0; }
.tbs-train-name-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
}
.tbs-train-num {
  font-family: 'Geist', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.tbs-train-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tbs-special-tag {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--amber-dim);
  color: var(--amber-text);
  border: 1px solid rgba(245,166,35,0.3);
  white-space: nowrap;
  flex-shrink: 0;
}
.tbs-pantry-tag {
  font-size: 9.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--green-dim);
  color: var(--green-text);
  flex-shrink: 0;
  white-space: nowrap;
}
.tbs-train-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tbs-type-label {
  font-size: 11px;
  color: var(--muted);
}
.tbs-classes {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}
.tbs-class-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border-med);
  color: var(--ink-soft);
}

/* inline train actions sheet */
.tbs-train-row {
  position: relative;
  overflow: hidden;
}
.tbs-actions {
  display: none;
  gap: 8px;
  margin-top: 12px;
  animation: slideDown 0.2s ease-out forwards;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.tbs-train-row.expanded .tbs-actions {
  display: flex;
}
.tbs-train-row.expanded .tbs-train-right {
  display: none;
}
.tbs-train-row.expanded .tbs-train-name-row,
.tbs-train-row.expanded .tbs-train-meta-row {
  opacity: 0.6;
}
.tbs-action-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: all 0.15s;
  cursor: pointer;
}
.tbs-action-btn:hover {
  background: var(--bg);
  border-color: var(--border-med);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}
.tbs-act-icon {
  font-size: 16px;
}
.tbs-act-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
}

.tbs-train-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}
.tbs-time-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tbs-time-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  min-width: 22px;
  text-align: right;
}
.tbs-dep {
  font-family: 'Geist', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.tbs-time-row.dur {
  color: var(--muted);
}
.tbs-time-row.dur svg {
  width: 12px;
  height: 12px;
}
.tbs-duration {
  font-size: 11px;
  color: var(--muted);
}
.tbs-arr {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
}

/* show-more row */
.tbs-show-more {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 13px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--blue);
  cursor: pointer;
  gap: 6px;
  transition: background 0.15s;
  background: none;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}
.tbs-show-more:hover { background: var(--blue-dim); }
.tbs-show-more svg { width: 14px; height: 14px; }

/* ─── Train Schedule Card ────────────────────────────────────────── */
.sched-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.sched-train-meta { flex: 1; min-width: 0; }
.sched-num-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.sched-num-tag {
  font-family: 'Geist', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  background: var(--ink);
  color: #fff;
  padding: 3px 10px;
  border-radius: 6px;
}
.sched-type-pill {
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid var(--blue-border);
}
.sched-name {
  font-family: 'Geist', sans-serif;
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 4px;
}
.sched-sub {
  font-size: 12px;
  color: var(--muted);
}
.sched-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.sched-stat-item {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.sched-stat-item strong { color: var(--ink); font-weight: 600; }

/* run-days strip */
.sched-days {
  display: flex;
  gap: 4px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.sched-days-label {
  font-size: 11px;
  color: var(--muted);
  margin-right: 4px;
  white-space: nowrap;
}
.sched-day {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  border: 1px solid var(--border-med);
  color: var(--muted);
  background: transparent;
}
.sched-day.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

/* classes/quota strip */
.sched-meta-row {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.sched-meta-cell {
  flex: 1;
  padding: 10px 14px;
  border-right: 1px solid var(--border);
}
.sched-meta-cell:last-child { border-right: none; }
.sched-meta-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 6px;
}
.sched-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.sched-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--border-med);
  color: var(--ink-soft);
}
.sched-tag.quota { background: var(--green-dim); color: var(--green-text); border-color: rgba(13,191,126,0.25); }

/* route timeline */
.sched-timeline {
  display: flex;
  flex-direction: column;
}
.sched-section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}
.sched-section-bar:hover { background: rgba(15,25,35,0.04); }
.sched-section-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}
.sched-section-badge {
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--border);
  color: var(--muted);
  font-weight: 500;
}
.sched-section-toggle {
  font-size: 11px;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 4px;
}
.sched-section-toggle svg { width: 12px; height: 12px; transition: transform 0.2s; }
.sched-section-toggle.open svg { transform: rotate(180deg); }

/* halt station row */
.sched-halt-row {
  display: flex;
  align-items: stretch;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.sched-halt-row:last-child { border-bottom: none; }
.sched-halt-row.origin .sched-dot { background: var(--blue); }
.sched-halt-row.terminus .sched-dot { background: var(--red); }

.sched-spine {
  width: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  padding: 14px 0;
  position: relative;
}
.sched-line {
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 2px;
  background: var(--border-med);
  transform: translateX(-50%);
}
.sched-halt-row:first-child .sched-line { top: 50%; }
.sched-halt-row:last-child .sched-line { bottom: 50%; }
.sched-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--ink-soft);
  border: 2px solid var(--card);
  box-shadow: 0 0 0 1.5px var(--ink-soft);
  z-index: 1;
  flex-shrink: 0;
}

.sched-halt-info {
  flex: 1;
  padding: 13px 0 13px 12px;
  min-width: 0;
}
.sched-stn-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}
.sched-stn-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sched-stn-code-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
.sched-halt-meta {
  display: flex;
  gap: 10px;
  font-size: 11.5px;
  color: var(--muted);
}
.sched-halt-meta span { display: flex; align-items: center; gap: 3px; }

.sched-halt-times {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  flex-shrink: 0;
  padding: 13px 0;
}
.sched-arr-time {
  font-family: 'Geist', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.sched-dep-time {
  font-size: 11px;
  color: var(--muted);
}
.sched-day-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--amber-dim);
  color: var(--amber-text);
  border: 1px solid rgba(245,166,35,0.25);
}

/* intermediate stations (hidden by default) */
.sched-inter-wrap {
  display: none;
  flex-direction: column;
  background: var(--surface);
}
.sched-inter-wrap.open { display: flex; }
.sched-inter-row {
  display: flex;
  align-items: center;
  padding: 7px 18px 7px 60px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
  position: relative;
}
.sched-inter-row:last-child { border-bottom: none; }
.sched-inter-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--border-med);
  flex-shrink: 0;
  position: absolute;
  left: 32px;
  top: 50%; transform: translateY(-50%);
}
.sched-inter-name {
  font-size: 12.5px;
  color: var(--muted);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sched-inter-time {
  font-size: 12px;
  color: var(--muted);
  font-family: 'Geist', sans-serif;
  font-weight: 600;
  flex-shrink: 0;
}
.sched-inter-dist {
  font-size: 11px;
  color: rgba(100,116,139,0.5);
  flex-shrink: 0;
}

/* ─── Station Trains Card (trains at a station) ─────────────────── */
.stlist-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.stlist-stn { flex: 1; min-width: 0; }
.stlist-stn-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.stlist-stn-code {
  font-family: 'Geist', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.stlist-stn-name {
  font-size: 12.5px;
  color: var(--muted);
}
.stlist-total-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 99px;
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid var(--blue-border);
  white-space: nowrap;
  flex-shrink: 0;
}

/* tab switcher */
.stlist-tabs {
  display: flex;
  background: var(--surface);
  padding: 10px 14px;
  gap: 6px;
  border-bottom: 1px solid var(--border);
}
.stlist-tab {
  flex: 1;
  padding: 8px 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: all 0.15s;
  background: none;
  font-family: 'Geist', sans-serif;
}
.stlist-tab.active {
  color: var(--blue);
  background: var(--blue-dim);
  border-color: var(--blue-border);
}
.stlist-tab-count {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--border);
  color: var(--muted);
  margin-left: 4px;
  vertical-align: middle;
}
.stlist-tab.active .stlist-tab-count {
  background: var(--surface);
  color: var(--blue);
}

/* date bar */
.stlist-date-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.stlist-date-label {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.stlist-date-label svg { width: 13px; height: 13px; }
.stlist-search-wrap {
  position: relative;
}
.stlist-search {
  padding: 5px 10px 5px 28px;
  font-size: 12px;
  font-family: 'Geist', sans-serif;
  border: 1px solid var(--border-med);
  border-radius: 99px;
  background: var(--card);
  color: var(--ink);
  outline: none;
  width: 150px;
  transition: border 0.15s, width 0.2s;
}
.stlist-search:focus { border-color: var(--blue-border); width: 180px; }
.stlist-search::placeholder { color: rgba(100,116,139,0.5); font-size: 12px; }
.stlist-search-icon {
  position: absolute;
  left: 9px; top: 50%;
  transform: translateY(-50%);
  width: 12px; height: 12px;
  color: var(--muted);
  pointer-events: none;
}

/* train rows */
.stlist-body { display: flex; flex-direction: column; width: 100%; }
.stlist-tab-content { width: 100%; min-width: 0; }
.stlist-train-row {
  display: flex;
  align-items: center;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
  overflow: hidden;
}
.stlist-train-row:last-child { border-bottom: none; }
.stlist-train-row:hover { background: var(--surface); }

/* expanded state */
.stlist-train-row.expanded .tbs-actions { display: flex; }
.stlist-train-row.expanded .stlist-train-right { display: none; }
.stlist-train-row.expanded .stlist-train-name-row,
.stlist-train-row.expanded .stlist-classes { opacity: 0.6; }

.stlist-train-left { flex: 1; min-width: 0; }
.stlist-train-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}
.stlist-train-num {
  font-family: 'Geist', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
.stlist-train-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  /* Default single line truncation for desktop */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stlist-classes {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}
.stlist-class-tag {
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border-med);
  color: var(--ink-soft);
}
.stlist-train-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}
.stlist-time {
  font-family: 'Geist', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.stlist-type-tag {
  font-size: 10px;
  color: var(--muted);
}
.stlist-origin-tag {
  font-size: 9.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
  white-space: nowrap;
}
.stlist-origin-tag.orig { background: var(--green-dim); color: var(--green-text); }
.stlist-origin-tag.dest { background: var(--red-dim); color: var(--red-text); }
.stlist-origin-tag.pass { background: var(--amber-dim); color: var(--amber-text); }

/* empty state */
.stlist-empty {
  padding: 28px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* show more */
.stlist-show-more {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--blue);
  cursor: pointer;
  gap: 6px;
  background: none;
  border-top: 1px solid var(--border);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  transition: background 0.15s;
  width: 100%;
}
.stlist-show-more:hover { background: var(--blue-dim); }
.stlist-show-more svg { width: 13px; height: 13px; }
.hidden-row { display: none !important; }

/* ─── Contextual suggestion chips (shown below AI response cards) ── */
.ctx-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}
.ctx-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  padding: 6px 13px;
  border-radius: 99px;
  border: 1px solid var(--border-med);
  background: var(--card);
  color: var(--ink-soft);
  cursor: pointer;
  font-family: 'Geist', sans-serif;
  transition: all 0.15s;
  white-space: nowrap;
}
.ctx-chip svg { width: 13px; height: 13px; flex-shrink: 0; opacity: 0.55; }
.ctx-chip:hover {
  background: var(--blue-dim);
  border-color: var(--blue-border);
  color: var(--blue);
}
.ctx-chip:hover svg { opacity: 1; }
.ctx-chips.disabled .ctx-chip {
  opacity: 0.45;
  pointer-events: none;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.pick-action-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 8px 12px;
}
.action-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 90%;
  max-width: 320px;
}
.action-card:hover {
  background: var(--surface-hover);
  border-color: var(--blue-border);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.pick-action-grid.disabled .action-card,
.pick-date-row.disabled .date-chip,
.startday-chips.disabled .startday-chip {
  pointer-events: none;
  opacity: 0.6;
  cursor: default;
}
.action-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.action-icon.ic-blue { background: rgba(26,107,245,0.1); color: var(--blue); }
.action-icon.ic-green { background: rgba(16,185,129,0.1); color: var(--green); }
.action-icon.ic-amber { background: rgba(245,158,11,0.1); color: var(--amber); }

.action-content {
  flex: 1;
}
.action-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 2px;
}
.action-desc {
  font-size: 12px;
  color: var(--muted);
}

.pick-date-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 8px 12px;
}
@media (max-width: 600px) {
  .pick-date-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-right: 0;
    scrollbar-width: none;
  }
  .pick-date-row::-webkit-scrollbar { display: none; }
  .date-chip { flex-shrink: 0; }
  
  /* stlist mobile full name wrap */
  .stlist-train-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .stlist-train-name-row {
    flex-wrap: wrap;
  }
  .stlist-train-name {
    white-space: normal;
    overflow: visible;
  }
  .stlist-train-right {
    flex-direction: row;
    align-items: center;
    width: 100%;
    justify-content: flex-start;
    background: var(--surface);
    padding: 6px 10px;
    border-radius: 6px;
    gap: 8px;
    margin-top: 4px;
  }
}
.date-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.date-chip:hover {
  background: var(--blue-dim);
  border-color: var(--blue-border);
  color: var(--blue);
}
.date-chip.more-dates {
  background: var(--surface-hover);
  border-style: dashed;
}
.date-chip.custom-date-btn {
  background: var(--blue-dim);
  border-color: var(--blue-border);
  color: var(--blue);
  font-weight: 600;
}

.startday-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 8px 12px;
}
.startday-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.startday-chip:hover {
  background: var(--green-dim);
  border-color: rgba(16,185,129,0.3);
  color: var(--green);
}

/* text input row */
.input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-input {
  flex: 1;
  padding: 4px 0;
  border: none;
  border-radius: 0;
  font-size: 14.5px;
  font-family: 'Geist', sans-serif;
  background: transparent;
  color: var(--ink);
  outline: none;
  line-height: 1.5;
}
.chat-input::placeholder { color: rgba(100,116,139,0.5); }

/* action buttons row below input */
.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.composer-left {
  display: flex;
  gap: 2px;
}

.send-btn {
  width: 34px; height: 34px;
  background: var(--ink);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.1s;
}
.send-btn:hover { opacity: 0.82; }
.send-btn:active { transform: scale(0.94); }
.send-btn svg { width: 15px; height: 15px; }

/* ─── Voice / attach buttons ─────────────────────────────────────── */
.voice-btn {
  width: 32px; height: 32px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.voice-btn:hover { background: var(--surface); }
.voice-btn svg { width: 16px; height: 16px; color: var(--muted); }

.composer-disclaimer {
  font-size: 11px;
  color: rgba(100,116,139,0.5);
  text-align: center;
  padding: 6px 0 2px;
}

/* ─── Section labels ─────────────────────────────────────────────── */
.chat-date-label {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

/* ─── Welcome / New Chat Screen ──────────────────────────────────── */
.welcome-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 40px 20px;
  gap: 0;
  overflow: hidden;
  animation: welcomeIn 0.4s cubic-bezier(0.22,1,0.36,1) both;
}

@keyframes welcomeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.welcome-logo {
  width: 52px; height: 52px;
  background: var(--ink);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  flex-shrink: 0;
}
.welcome-logo svg { width: 28px; height: 28px; }

.welcome-greeting {
  position: relative;
  width: 100%;
  height: 40px;          /* fixed height prevents layout shift */
  font-family: 'Geist', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.03em;
  text-align: center;
  margin-bottom: 6px;
}

/* Each phrase is stacked and fades in/out */
.greeting-phrase {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(16px);
  filter: blur(4px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              filter 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}
.greeting-phrase.active {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}
.greeting-phrase.exit {
  opacity: 0;
  transform: translateY(-16px);
  filter: blur(4px);
}
.welcome-sub {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
  margin-bottom: 32px;
  max-width: 380px;
}

/* centered input box */
.welcome-input-wrap {
  width: 100%;
  max-width: 560px;
  background: var(--card);
  border: 1.5px solid var(--border-med);
  border-radius: var(--radius-xl);
  padding: 14px 16px 12px;
  transition: border-color 0.2s;
  flex-shrink: 0;
}
.welcome-input-wrap:focus-within {
  border-color: var(--blue-border);
}
.welcome-textarea {
  width: 100%;
  min-height: 52px;
  max-height: 140px;
  resize: none;
  border: none;
  outline: none;
  font-family: 'Geist', sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: transparent;
  line-height: 1.5;
}
.welcome-textarea::placeholder { color: rgba(100,116,139,0.5); }
.welcome-input-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.welcome-attach {
  display: flex; gap: 4px;
}
.attach-btn {
  width: 30px; height: 30px;
  border: none; background: transparent;
  border-radius: 7px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.attach-btn:hover { background: var(--surface); color: var(--ink); }
.attach-btn svg { width: 16px; height: 16px; }
.welcome-send {
  width: 34px; height: 34px;
  background: var(--ink);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.15s, transform 0.1s;
  flex-shrink: 0;
}
.welcome-send:hover { opacity: 0.8; }
.welcome-send:active { transform: scale(0.94); }
.welcome-send svg { width: 16px; height: 16px; }

/* suggestion chips grid */
.suggestions {
  width: 100%;
  max-width: 560px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
  flex-shrink: 0;
}
.sug-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}
.sug-card:hover {
  border-color: var(--blue-border);
  transform: translateY(-1px);
}
.sug-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sug-icon svg { width: 15px; height: 15px; }
.sug-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
}
.sug-desc {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}

/* icon bg variants */
.ic-blue  { background: var(--blue-dim); }
.ic-blue svg  { color: var(--blue); }
.ic-green { background: var(--green-dim); }
.ic-green svg { color: var(--green-text); }
.ic-amber { background: var(--amber-dim); }
.ic-amber svg { color: var(--amber-text); }
.ic-ink   { background: rgba(15,25,35,0.07); }
.ic-ink svg   { color: var(--ink-soft); }

.welcome-footer {
  margin-top: 14px;
  font-size: 11px;
  color: rgba(100,116,139,0.5);
  text-align: center;
}

/* hide mobile-only hamburger in desktop topbar */
.topbar .mobile-topbar-btn { display: none; }
@media (max-width: 768px) {
  .topbar .mobile-topbar-btn { display: flex; }
  .topbar .topbar-icon-wrap { display: none; }
}

/* iOS safe areas */
@supports (padding: max(0px)) {
  .input-area { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .mobile-topbar { padding-top: env(safe-area-inset-top); }
}

/* ─── Mobile bottom nav ──────────────────────────────────────────── */
.mobile-topbar {
  display: none;
  height: 54px;
  padding: 0 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 20;
}
.mobile-topbar-center {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mobile-brand-icon {
  width: 28px; height: 28px;
  background: var(--ink);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.mobile-brand-icon svg { width: 16px; height: 16px; }
.mobile-brand-name {
  font-family: 'Geist', sans-serif;
  font-size: 16px; font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.mobile-topbar-btn {
  width: 38px; height: 38px;
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft);
  transition: background 0.15s;
}
.mobile-topbar-btn:hover { background: var(--surface); }
.mobile-topbar-btn svg { width: 20px; height: 20px; }

/* sidebar drawer overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 40;
  opacity: 0;
  transition: opacity 0.25s;
}
.sidebar-overlay.open { opacity: 1; }

/* ─── Responsive breakpoints ─────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 280px; }

  body { background: var(--surface); }

  /* show mobile topbar, hide desktop sidebar */
  .mobile-topbar { display: flex; }
  .sidebar-overlay { display: block; pointer-events: none; }
  .sidebar-overlay.open { pointer-events: all; }

  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100%;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.22,1,0.36,1);
    z-index: 50;
    overflow-y: auto;
  }
  .sidebar.open { transform: translateX(0); }

  .app { flex-direction: column; }

  /* topbar — only share btn, smaller */
  .topbar {
    height: 48px;
    padding: 0 16px;
  }
  .topbar-title { font-size: 13.5px; }
  .share-btn span { display: none; }
  .share-btn { padding: 7px 10px; gap: 0; }

  /* chat area */
  .chat-scroll {
    padding: 16px 12px;
    gap: 16px;
  }
  .chat-scroll > * { max-width: 100%; }

  /* messages */
  .msg-body { max-width: 88%; }
  .bubble { font-size: 14px; padding: 10px 14px; }
  .msg-avatar { width: 28px; height: 28px; font-size: 11px; }

  /* result cards */
  .result-card { border-radius: var(--radius-md); min-width: 0; max-width: 100%; }
  .pnr-head { padding: 12px 14px; }
  .pnr-number { font-size: 15px; }
  .card-body { padding: 12px 14px; }
  .info-row { font-size: 13px; padding: 8px 0; }
  .stats-grid { padding: 4px 14px 14px; gap: 6px; }
  .stat-cell { padding: 9px 10px; }
  .stat-val { font-size: 13px; word-break: break-word; }
  .route-row { padding: 12px 14px 6px; flex-wrap: wrap; gap: 4px; }
  .route-stn { min-width: 0; }
  
  .sched-halt-row { flex-wrap: wrap; gap: 4px; }
  .sched-halt-times { flex-shrink: 1; min-width: 0; }
  .sched-halt-info { min-width: 0; flex-shrink: 1; }
  .sched-stn-name { word-break: break-word; }
  .stn-code { font-size: 17px; }
  .train-id { font-size: 19px; }
  .live-head { padding: 12px 14px; }
  
  .tbs-train-row { 
    flex-direction: column; 
    align-items: flex-start; 
    gap: 8px; 
    padding: 14px 14px; 
  }
  .tbs-train-name { 
    white-space: normal;
    word-break: break-word; 
  }
  .tbs-train-right { 
    flex-direction: row; 
    gap: 12px; 
    align-items: center;
    width: 100%;
    justify-content: space-between;
    background: var(--surface);
    padding: 8px 12px;
    border-radius: 8px;
  }

  /* passenger table */
  .passenger-row { padding: 8px 12px; font-size: 12.5px; }
  .p-seat { font-size: 11px; padding: 2px 8px; }
  .cnf-badge { font-size: 9.5px; padding: 2px 7px; }

  /* contextual chips */
  .ctx-chips { gap: 6px; margin-top: 8px; }
  .ctx-chip { font-size: 12px; padding: 6px 11px; }

  /* input area */
  .input-area { padding: 8px 12px 12px; }
  .input-area-inner { max-width: 100%; }
  .composer { border-radius: 16px; padding: 12px 12px 10px 14px; }
  .chat-input { font-size: 16px; } /* prevent iOS zoom */
  .send-btn { width: 36px; height: 36px; border-radius: 11px; }

  /* welcome screen */
  .welcome-screen {
    padding: 24px 16px 16px;
    justify-content: center;
    overflow-y: auto;
  }
  .welcome-logo { width: 44px; height: 44px; border-radius: 13px; margin-bottom: 14px; }
  .welcome-logo svg { width: 24px; height: 24px; }
  .welcome-greeting { font-size: 22px; margin-bottom: 6px; height: 34px; }
  .welcome-sub { font-size: 13.5px; margin-bottom: 20px; }
  .welcome-input-wrap { border-radius: 16px; }
  .welcome-textarea { font-size: 16px; min-height: 44px; } /* prevent iOS zoom */
  .suggestions { grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
  .sug-card { padding: 12px 12px; gap: 5px; border-radius: var(--radius-md); }
  .sug-title { font-size: 12.5px; }
  .sug-desc { font-size: 11px; }
  .welcome-footer { font-size: 10.5px; margin-top: 12px; padding-bottom: 8px; }
}

@media (max-width: 380px) {
  .suggestions { grid-template-columns: 1fr; }
  .sug-card { flex-direction: row; align-items: center; gap: 10px; }
  .sug-desc { display: none; }
  .welcome-greeting { font-size: 20px; height: 30px; }
  .ctx-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .ctx-chip { flex-shrink: 0; }
}
/* 💺 Seat Availability — Compact Card */
.seat-card {
  overflow: hidden;
  border-radius: var(--radius-lg);
}
.seat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.seat-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.seat-train-no {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.seat-route {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.seat-date-tag {
  font-size: 11px;
  background: var(--blue-dim);
  color: var(--blue);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  white-space: nowrap;
}

/* Tabs */
.seat-tabs-wrap {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.seat-tabs {
  display: flex;
  overflow-x: auto;
  gap: 0;
  scrollbar-width: none;
}
.seat-tabs::-webkit-scrollbar { display: none; }

.seat-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 0;
}
.seat-tab:hover { color: var(--ink); background: var(--surface-hover); }
.seat-tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
  background: var(--blue-dim);
}
.seat-tab-fare {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.7;
}
.seat-tab.active .seat-tab-fare { opacity: 1; }

/* Table */
.avl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.avl-table thead th {
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  padding: 8px 12px 6px;
  border-bottom: 1px solid var(--border);
}
.avl-table thead th:last-child { text-align: right; }
.avl-row td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.avl-row:last-child td { border-bottom: none; }
.avl-date {
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  font-size: 12px;
}

/* Badges */
.avl-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.avl-cnf { background: var(--green-dim); color: var(--green-text); }
.avl-rac { background: var(--amber-dim); color: var(--amber-text); }
.avl-wl  { background: var(--red-dim); color: var(--red-text); }

/* Prediction */
.avl-pct-cell { text-align: right; }
.avl-pct {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}
.pct-good { color: var(--green-text); background: var(--green-dim); }
.pct-mid  { color: var(--amber-text); background: var(--amber-dim); }
.pct-low  { color: var(--red-text); background: var(--red-dim); }


/* 📅 Custom RailMind Calendar Modal */
.calendar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.calendar-modal {
  background: var(--surface);
  width: 100%;
  max-width: 380px;
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  overflow: hidden;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 10px;
}
.cal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}
.cal-nav {
  background: var(--surface-hover);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  transition: all 0.2s;
}
.cal-nav:hover { background: var(--border); }

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 10px 15px;
  text-align: center;
}
.calendar-weekdays span {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 5px 15px 15px;
  gap: 4px;
}
.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--ink);
}
.cal-day.selectable:hover {
  background: var(--blue-dim);
  color: var(--blue);
}
.cal-day.today {
  border: 2px solid var(--blue);
  color: var(--blue);
  font-weight: 700;
}
.cal-day.disabled {
  color: var(--muted);
  opacity: 0.25;
  cursor: not-allowed;
}
.cal-day.empty { cursor: default; }

.calendar-footer {
  padding: 15px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cal-legend {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.lg-dot.running {
  width: 8px;
  height: 8px;
  background: var(--blue);
  border-radius: 50%;
}
.cal-close {
  background: var(--ink);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* 📡 Premium Live Status Card */
.live-status-card {
  padding-bottom: 0;
}
.live-route-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
}
.live-stn { flex: 1; }
.live-stn.dest { text-align: right; }
.live-stn-code { font-size: 24px; font-weight: 900; color: var(--ink); letter-spacing: -0.02em; line-height: 1; }
.live-stn-name { font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 4px; }
.live-stn-time { font-size: 18px; font-weight: 700; color: var(--ink); margin-top: 6px; }

.live-progress-wrap {
  flex: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 15px;
}
.live-track {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  position: relative;
  margin-bottom: 8px;
}
.live-track-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 2px;
  position: absolute;
  top: 0;
  left: 0;
}
.live-track-dot {
  width: 14px;
  height: 14px;
  background: white;
  border: 3px solid var(--blue);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 4px var(--blue-dim);
}
.live-track-label { font-size: 11px; font-weight: 600; color: var(--muted); }

/* Alert Box */
.live-alert-box {
  background: var(--amber-dim);
  border: 1px solid var(--amber-border);
  margin: 0 18px 15px;
  padding: 12px 15px;
  border-radius: 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.live-alert-icon { color: var(--amber-text); width: 20px; height: 20px; flex-shrink: 0; }
.live-alert-text { font-size: 13px; font-weight: 500; color: var(--amber-text); line-height: 1.4; }

/* Info Grid */
.live-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0 18px 15px;
}
.live-grid-cell {
  background: var(--blue-dim);
  padding: 12px 14px;
  border-radius: 10px;
  border: none;
}
.lg-label { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.lg-value { font-size: 14px; font-weight: 700; color: var(--blue); }
.lg-sub { font-size: 11px; color: var(--muted); margin-top: 2px; font-weight: 500; }
.lg-value.late { color: var(--red-text); }
.lg-value.stn { color: var(--blue); }
.lg-value.plat { color: var(--ink); }

/* Chips */
.live-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 18px 18px;
}
.live-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface-hover);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  border: 1px solid var(--border-light);
}
.live-chip svg { width: 14px; height: 14px; color: var(--blue); }
.chip-label { font-weight: 500; color: var(--muted); }
.live-chip.red { color: var(--red-text); }
.live-chip.red svg { color: var(--red-text); }

/* Footer */
.live-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-hover);
}
.lf-text { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; display: flex; align-items: center; gap: 6px; }
.lf-refresh {
  background: transparent; border: 1px solid transparent; color: var(--muted);
  width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s;
}
.lf-refresh:hover { background: var(--surface); color: var(--ink); border-color: var(--border-light); }
.lf-refresh svg { width: 14px; height: 14px; }
.lf-dot { width: 6px; height: 6px; background: var(--green); border-radius: 50%; display: inline-block; animation: pulse 2s infinite; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Seat availability inline form */
.seat-form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 6px;
  width: 380px;
  max-width: 100%;
}
.seat-form-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--ink);
}
.seat-form-train-num {
  font-family: 'Geist', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}
.seat-form-train-name {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
}
.seat-form-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.seat-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.seat-form-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.seat-form-select,
.seat-form-input,
.date-trigger {
  padding: 10px 12px;
  border: 1.5px solid var(--border-med);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: 'Geist', sans-serif;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
.date-trigger {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.date-trigger::after {
  content: '📅';
  font-size: 12px;
  opacity: 0.6;
}
.seat-form-select:focus,
.seat-form-input:focus,
.date-trigger:active { border-color: var(--blue-border); }

.seat-form-row {
  display: flex;
  gap: 10px;
}

/* Quick-select station pills */
.seat-form-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.stn-pill {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid var(--border-med);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.12s;
  font-family: 'Geist', sans-serif;
}
.stn-pill:hover { background: var(--blue-dim); color: var(--blue); border-color: var(--blue-border); }
.stn-pill.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* Submit button */
.seat-form-btn {
  padding: 12px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Geist', sans-serif;
  cursor: pointer;
  transition: opacity 0.15s;
  width: 100%;
}
.seat-form-btn:hover:not(:disabled) { opacity: 0.88; }
.seat-form-btn:disabled {
  background: var(--border-med);
  color: var(--muted);
  cursor: not-allowed;
}

/* Mobile */
@media (max-width: 768px) {
  .seat-form-body   { padding: 14px; gap: 12px; }
  .seat-form-row    { flex-direction: column; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
