/* ==========================================================================
   RailRoute Web App — Design Technologist UI System (v2.5.0)
   Pixel-perfect 100% parity with Native Android Jetpack Compose (MainActivity.kt)
   Palette: Material 3 Color Schemes (Slate & Crisp Light)
   Font: Roboto & Material Symbols Rounded
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Color+Emoji&family=Roboto:wght@400;500;700;900&family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..24,400..700,0..1,0&display=swap');

:root {
  /* Material 3 Dark Scheme (MainActivity.kt DarkColors) */
  --primary: #3b82f6;               /* Color(0xFF3B82F6) */
  --on-primary: #ffffff;            /* Color.White */
  --primary-container: #1e3a8a;     /* Color(0xFF1E3A8A) */
  --on-primary-container: #dbeafe;  /* Color(0xFFDBEAFE) */
  --secondary: #10b981;             /* Color(0xFF10B981) */
  --on-secondary: #ffffff;          /* Color.White */
  --secondary-container: #064e3b;   /* Color(0xFF064E3B) */
  --on-secondary-container: #a7f3d0;/* Color(0xFFA7F3D0) */
  --bg-app: #0f172a;                /* Color(0xFF0F172A) Slate 900 */
  --on-background: #f1f5f9;         /* Color(0xFFF1F5F9) */
  --bg-surface: #1e293b;            /* Color(0xFF1E293B) Slate 800 */
  --on-surface: #f8fafc;            /* Color(0xFFF8FAFC) */
  --surface-variant: #334155;       /* Color(0xFF334155) Slate 700 */
  --on-surface-variant: #94a3b8;     /* Color(0xFF94A3B8) Slate 400 */
  --outline-variant: #475569;       /* Color(0xFF475569) */
  --error: #ef4444;                 /* Color(0xFFEF4444) */
  --error-container: #450a0a;
  --on-error-container: #fca5a5;

  /* Theme Bridge Tokens */
  --bg-canvas: var(--bg-app);
  --bg-surface-elevated: var(--surface-variant);
  --bg-input: #152033;
  --border-color: var(--surface-variant);
  --border-specular-top: rgba(255, 255, 255, 0.08);
  --border-focus: var(--primary);
  --border-hover: var(--outline-variant);

  --text-main: var(--on-surface);
  --text-muted: var(--on-surface-variant);
  --text-dim: #64748b;

  --accent-blue: var(--primary);
  --accent-cyan: var(--primary);
  --accent-emerald: var(--secondary);
  --accent-emerald-bg: rgba(16, 185, 129, 0.14);
  --accent-amber: #f59e0b;
  --accent-red: var(--error);
  --accent-purple: #8b5cf6;

  --shadow-card: 0 4px 18px -2px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 16px -2px rgba(59, 130, 246, 0.35);

  /* Precise Material 3 Compose Shapes */
  --radius-xs: 6px;                 /* RoundedCornerShape(6.dp) */
  --radius-sm: 8px;                 /* RoundedCornerShape(8.dp) */
  --radius-chip: 10px;              /* RoundedCornerShape(10.dp) */
  --radius-card-sm: 12px;           /* RoundedCornerShape(12.dp) */
  --radius-input: 14px;             /* RoundedCornerShape(14.dp) */
  --radius-md: 16px;                /* RoundedCornerShape(16.dp) */
  --radius-search: 18px;            /* RoundedCornerShape(18.dp) */
  --radius-card: 20px;              /* RoundedCornerShape(20.dp) */
  --radius-card-lg: 22px;           /* RoundedCornerShape(22.dp) */
  --radius-pill: 9999px;            /* CircleShape */

  --font-display: 'Roboto', 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
  --font-body: 'Roboto', 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
}

.emoji {
  font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
  font-style: normal;
  display: inline-block;
  vertical-align: -0.08em;
  line-height: 1;
}

body.light-theme {
  /* Material 3 Light Scheme (MainActivity.kt LightColors) */
  --primary: #1e5bb5;               /* Color(0xFF1E5BB5) */
  --on-primary: #ffffff;            /* Color.White */
  --primary-container: #e8f0fe;     /* Color(0xFFE8F0FE) */
  --on-primary-container: #0d47a1;  /* Color(0xFF0D47A1) */
  --secondary: #00897b;             /* Color(0xFF00897B) */
  --on-secondary: #ffffff;          /* Color.White */
  --secondary-container: #e0f2f1;   /* Color(0xFFE0F2F1) */
  --on-secondary-container: #004d40;/* Color(0xFF004D40) */
  --bg-app: #f6f8fc;                /* Color(0xFFF6F8FC) */
  --on-background: #0f172a;         /* Color(0xFF0F172A) */
  --bg-surface: #ffffff;            /* Color.White */
  --on-surface: #0f172a;            /* Color(0xFF0F172A) */
  --surface-variant: #f1f5f9;       /* Color(0xFFF1F5F9) */
  --on-surface-variant: #475569;     /* Color(0xFF475569) */
  --outline-variant: #e2e8f0;       /* Color(0xFFE2E8F0) */
  --error: #ba1a1a;
  --error-container: #ffdad6;
  --on-error-container: #410002;

  --bg-canvas: var(--bg-app);
  --bg-surface-elevated: var(--surface-variant);
  --bg-input: #f8fafc;
  --border-color: var(--outline-variant);
  --border-specular-top: #e2e8f0;
  --border-focus: var(--primary);
  --border-hover: #cbd5e1;

  --text-main: var(--on-surface);
  --text-muted: var(--on-surface-variant);
  --text-dim: #64748b;

  --accent-blue: var(--primary);
  --accent-cyan: var(--primary);
  --accent-emerald: var(--secondary);
  --accent-emerald-bg: rgba(0, 137, 123, 0.12);
  --accent-amber: #d97706;
  --accent-red: var(--error);

  --shadow-card: 0 4px 16px -2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 0 16px -4px rgba(30, 91, 181, 0.18);
}

/* Material Symbols Rounded Standard Class (Matching Android Vector Icons) */
.material-symbols-rounded {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  vertical-align: middle;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}

.material-symbols-rounded.filled {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}

/* ==========================================================================
   Base & Reset (Strict Overflow Containment)
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  user-select: none;
  -webkit-user-select: none;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  position: relative;
  transition: background-color 0.2s ease, color 0.2s ease;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  -webkit-overflow-scrolling: touch;
}

input, button, select, textarea {
  font-family: inherit;
  user-select: auto;
  -webkit-user-select: auto;
}

/* iOS Safari: Prevent automatic zoom on input focus */
@media screen and (max-width: 768px) {
  input[type="text"],
  input[type="search"],
  input[type="time"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Ambient Subtle Mesh Background */
.app-ambient-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.app-orb-1 {
  position: absolute;
  width: 500px;
  height: 500px;
  top: -80px;
  left: 15%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, transparent 70%);
  filter: blur(100px);
  opacity: 0.6;
}

.app-orb-2 {
  position: absolute;
  width: 550px;
  height: 550px;
  bottom: -50px;
  right: -80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
  filter: blur(120px);
  opacity: 0.5;
}

body.light-theme .app-orb-1 {
  background: radial-gradient(circle, rgba(30, 91, 181, 0.06) 0%, transparent 70%);
}

body.light-theme .app-orb-2 {
  background: radial-gradient(circle, rgba(0, 137, 123, 0.05) 0%, transparent 70%);
}

.app-tech-grid {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
  z-index: 0;
}

body.light-theme .app-tech-grid {
  background-image: 
    linear-gradient(to right, rgba(15, 23, 42, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.02) 1px, transparent 1px);
}

/* ==========================================================================
   App Header & Shell
   ========================================================================== */
.app-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 24px 14px;
  padding-left: calc(24px + env(safe-area-inset-left, 0px));
  padding-right: calc(24px + env(safe-area-inset-right, 0px));
  background: var(--bg-surface);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-anchor {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.header-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.header-title-block h1 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: linear-gradient(135deg, #f8fafc 40%, var(--accent-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.light-theme .header-title-block h1 {
  background: linear-gradient(135deg, #0f172a 40%, #1e5bb5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-title-block span {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
}

.icon-btn:hover {
  border-color: var(--accent-blue);
  transform: translateY(-1px);
}

.header-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent-blue);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   2-Column Travel Hub Layout
   ========================================================================== */
.main-content {
  display: grid;
  grid-template-columns: 460px 1fr;
  flex: 1;
  gap: 24px;
  padding: 24px;
  align-items: flex-start;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Sidebar: Strict Overflow Guard */
.search-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 82px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
  padding-right: 2px;
}

.search-sidebar::-webkit-scrollbar {
  width: 4px;
}
.search-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

/* Quick Route Section (Popular Routes, Isolated Stacking) */
.popular-routes-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  position: relative;
  z-index: 10;
  margin-bottom: 4px;
}

.section-subcaption {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.quick-routes-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
  scrollbar-width: none;
  width: 100%;
  box-sizing: border-box;
}

.quick-routes-row::-webkit-scrollbar {
  display: none;
}

.quick-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
  user-select: none;
}

.quick-pill:hover {
  color: var(--text-main);
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.15);
  transform: translateY(-1px);
}

.pill-icon {
  font-size: 0.95rem;
}

/* History Banner & Transit Notice Cards */
.history-banner-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  box-sizing: border-box;
}

.history-banner-card:hover {
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.12);
}

.history-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-banner-icon {
  font-size: 1.2rem;
}

.history-banner-text-group {
  display: flex;
  flex-direction: column;
}

.history-banner-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.history-banner-sub {
  font-size: 0.74rem;
  color: var(--text-dim);
}

.history-banner-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-banner-count {
  background: rgba(59, 130, 246, 0.16);
  color: var(--accent-blue);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 800;
}

.history-banner-arrow {
  font-size: 1rem;
  color: var(--text-dim);
}

.transit-notice-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-main);
}

.notice-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

/* History Sheet Modal & Cards (1-to-1 with Android HistoryScreen) */
.history-sheet-modal {
  max-width: 680px;
  width: 95%;
}

.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-right: 32px;
}

.modal-title-with-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-count-badge {
  background: rgba(59, 130, 246, 0.16);
  color: var(--accent-blue);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

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

.btn-clear-history-all {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #ef4444;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-clear-history-all:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: #ef4444;
}

.history-items-scroll {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 65vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}

/* History Entry Card */
.history-card-item {
  background: var(--color-surface);
  border: 1px solid var(--color-outline-variant);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

body.light-theme .history-card-item {
  background: var(--color-surface);
  border-color: var(--color-outline-variant);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.history-card-item:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.history-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.history-card-route {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 900;
  color: var(--color-on-surface);
}

.btn-delete-history-item {
  background: transparent;
  border: none;
  color: var(--color-on-surface-variant);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  line-height: 1;
}

.btn-delete-history-item:hover {
  color: var(--color-error);
  background: rgba(239, 68, 68, 0.12);
}

.history-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-on-surface-variant);
}

.history-meta-badge {
  background: var(--color-primary-container);
  color: var(--color-on-primary-container);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-weight: 700;
  font-size: 11px;
}

.history-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.btn-history-apply {
  flex: 1;
  height: 40px;
  background: transparent;
  border: 1px solid var(--color-outline);
  color: var(--color-primary);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-history-apply:hover {
  background: var(--color-surface-variant);
  border-color: var(--color-primary);
}

.btn-history-search-now {
  flex: 1;
  height: 40px;
  background: var(--color-primary);
  border: 1px solid var(--color-primary);
  color: var(--color-on-primary);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.25);
  transition: all 0.15s ease;
}

.btn-history-search-now:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
}

.history-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-on-surface-variant);
}

.history-empty-icon {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-empty-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--color-on-surface);
  margin-bottom: 6px;
}

.history-empty-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-on-surface-variant);
  max-width: 380px;
  margin: 0 auto;
}

/* ==========================================================================
   Material 3 Cards & Form Modules
   ========================================================================== */
.m3-card, .glass-card {
  background: var(--bg-surface);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--border-color);
  border-top: 1px solid var(--border-specular-top);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-card);
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  position: relative;
}

/* ==========================================================================
   1. Station Inputs Module (Clean Stacking, Autocomplete on Top)
   ========================================================================== */
.station-card-container {
  position: relative;
  z-index: 50;
  overflow: visible !important;
}

.stations-layout-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
  position: relative;
  width: 100%;
}

.rail-indicator-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
  width: 14px;
  flex-shrink: 0;
}

.rail-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-origin {
  background: var(--accent-blue);
  box-shadow: 0 0 8px var(--accent-blue);
}

.dot-dest {
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.rail-line {
  flex: 1;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-blue), var(--accent-emerald));
  margin: 4px 0;
  min-height: 24px;
}

.station-fields-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  position: relative;
}

.station-field-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
}

.station-field-wrap:focus-within {
  z-index: 100;
}

.station-input-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-input);
  padding: 8px 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  box-sizing: border-box;
}

.station-input-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.station-leading-icon {
  font-size: 20px;
  color: var(--primary);
  margin-right: 10px;
  flex-shrink: 0;
}

.station-inner-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.station-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--on-surface-variant);
  margin-bottom: 2px;
  line-height: 1.1;
}

.station-text-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--on-surface);
  font-size: 15px;
  font-weight: 600;
  width: 100%;
  min-width: 0;
  font-family: inherit;
}

.station-text-input::placeholder {
  color: var(--on-surface-variant);
  font-weight: 400;
  opacity: 0.6;
}

.btn-clear-station {
  background: transparent;
  border: none;
  outline: none;
  color: var(--on-surface-variant);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  line-height: 1;
  transition: all 0.15s;
  flex-shrink: 0;
  margin-left: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-clear-station:hover {
  color: var(--on-surface);
  background: rgba(255, 255, 255, 0.08);
}

body.light-theme .btn-clear-station:hover {
  background: rgba(0, 0, 0, 0.06);
}

/* Autocomplete Popup (Super elevated z-index: 1000) */
.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--bg-surface);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-input);
  max-height: 240px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  display: none;
  width: 100%;
  box-sizing: border-box;
}

body.light-theme .autocomplete-dropdown {
  background: #ffffff;
  border-color: var(--outline-variant);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.autocomplete-item {
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  font-weight: 600;
  color: var(--on-surface);
  transition: background 0.15s;
}

.autocomplete-item:hover {
  background: rgba(59, 130, 246, 0.1);
}

body.light-theme .autocomplete-item:hover {
  background: #e8f0fe;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.swap-action-col {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
}

.btn-swap-animated {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary-container);
  border: none;
  color: var(--on-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s;
}

.btn-swap-animated .material-symbols-rounded {
  font-size: 22px;
}

.btn-swap-animated:hover {
  filter: brightness(1.15);
  transform: scale(1.05);
}

.card-divider {
  height: 1px;
  background: var(--border-color);
  margin: 14px 0;
  width: 100%;
}

.checkbox-row-container {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  margin-top: 4px;
}

.m3-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-blue);
  cursor: pointer;
  margin-top: 2px;
  flex-shrink: 0;
}

.checkbox-text-group {
  display: flex;
  flex-direction: column;
}

.checkbox-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.checkbox-sub {
  font-size: 0.74rem;
  color: var(--text-dim);
}

.commuter-toggle-section {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.commuter-toggle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

.commuter-toggle-label {
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.commuter-toggle-state {
  font-weight: 700;
  color: var(--accent-blue);
}

.commuter-toggle-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.toggle-choice-btn {
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.toggle-choice-btn.active {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.16);
}

.commuter-toggle-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* ==========================================================================
   2. Tactile DateCards & Weekdays Module
   ========================================================================== */
.card-section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.card-sub-header {
  font-size: 0.74rem;
  color: var(--text-dim);
}

.date-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-bottom: 12px;
}

.tactile-date-card {
  background: rgba(51, 65, 85, 0.6);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  display: flex;
  flex-direction: column;
  user-select: none;
}

body.light-theme .tactile-date-card {
  background: rgba(241, 245, 249, 0.6);
  border-color: var(--outline-variant);
}

.tactile-date-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.tactile-date-card:focus {
  outline: none;
  border-color: var(--primary);
}

.date-card-eyebrow {
  font-size: 11px;
  font-weight: 500;
  color: var(--on-surface-variant);
  margin-bottom: 4px;
}

.date-card-main {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.date-card-num {
  font-family: var(--font-body);
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  color: var(--primary);
}

.date-card-meta {
  display: flex;
  flex-direction: column;
  padding-bottom: 2px;
}

.date-card-month-year {
  font-size: 13px;
  font-weight: 700;
  color: var(--on-surface);
  line-height: 1.15;
}

.date-card-weekday {
  font-size: 11px;
  color: var(--on-surface-variant);
}

.native-date-hidden {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.quick-date-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  margin-bottom: 12px;
}

.date-chip-btn {
  flex: 1 1 calc(33.333% - 6px);
  padding: 5px 8px;
  border-radius: var(--radius-chip);
  background: var(--surface-variant);
  border: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--on-surface);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  white-space: nowrap;
}

.date-chip-btn:hover {
  filter: brightness(1.15);
}

.weekdays-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.weekdays-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-text-link {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.btn-text-link:hover {
  text-decoration: underline;
}

.weekdays-circles-bar {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
}

.dow-circle-label {
  flex: 1;
  aspect-ratio: 1;
  max-width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-variant);
  border: 1px solid var(--outline-variant);
  font-size: 12px;
  font-weight: 600;
  color: var(--on-surface-variant);
  cursor: pointer;
  transition: all 0.15s;
}

.dow-circle-label input {
  display: none;
}

.dow-circle-label:has(input:checked) {
  background: var(--primary-container);
  border-color: var(--primary);
  color: var(--on-primary-container);
  font-weight: 700;
}

/* ==========================================================================
   3. Passengers & Discounts Module
   ========================================================================== */
.passengers-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.passengers-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stepper-buttons-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-stepper-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
}

.btn-stepper-circle:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.passengers-dynamic-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.passenger-box-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pax-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pax-name-input {
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  width: 100%;
}

.pax-checkbox-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-color);
}

.checkbox-discount-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
}

.checkbox-discount-label:hover {
  color: var(--text-main);
}

.checkbox-discount-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-blue);
  border-radius: 4px;
  cursor: pointer;
}

.discount-tag-info {
  font-size: 0.72rem;
  color: var(--text-dim);
  padding-left: 24px;
  margin-top: -2px;
}

/* ==========================================================================
   4. Filter Accordion, Brands, Cars, Seats & Symmetric Time
   ========================================================================== */
.filters-accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border: none;
  width: 100%;
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  padding: 2px 0;
}

.filters-header-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filters-title-group {
  display: flex;
  flex-direction: column;
}

.filters-sub-status {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.accordion-arrow {
  transition: transform 0.3s;
  font-size: 0.78rem;
  color: var(--accent-blue);
}

.accordion-arrow.open {
  transform: rotate(180deg);
}

.filters-accordion-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  width: 100%;
  box-sizing: border-box;
}

.filter-group-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.filter-group-title {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.filter-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}

.filter-choice-chip {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-choice-chip:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
}

.filter-choice-chip.active {
  background: rgba(59, 130, 246, 0.16);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

/* Departure and Arrival Symmetric Time Sections */
.time-presets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}

.time-preset-pill {
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.time-preset-pill:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
}

.time-preset-pill.active {
  background: rgba(59, 130, 246, 0.16);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.time-inputs-container {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.time-field-box {
  flex: 1;
  min-width: 0;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 8px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.time-field-box input[type="time"] {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.9rem;
  color-scheme: dark;
  width: 100%;
  text-align: center;
}

.time-range-separator {
  color: var(--text-dim);
  font-weight: 700;
  flex-shrink: 0;
}

/* ==========================================================================
   5. Primary Search Button (Exact Android 56dp Height, M3 Primary)
   ========================================================================== */
.btn-search-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 56px;
  min-height: 56px;
  border-radius: 18px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s, background 0.2s;
  flex-shrink: 0;
  user-select: none;
  margin-top: 4px;
}

.btn-search-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.55);
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.btn-search-primary:active {
  transform: translateY(1px) scale(0.99);
}

.search-btn-icon {
  font-size: 1.15rem;
}

/* ==========================================================================
   Results Column: Toolbar, Price Ribbon with "Все даты"
   ========================================================================== */
.results-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.results-toolbar-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  width: 100%;
  box-sizing: border-box;
}

.results-count-badge {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-muted);
}
.results-count-badge strong {
  color: var(--text-main);
}

.sorting-tabs {
  display: flex;
  gap: 6px;
}

.sort-btn {
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.sort-btn:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
}

.sort-btn.active {
  background: rgba(59, 130, 246, 0.16);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

body.light-theme .sort-btn.active {
  background: #e8f0fe;
  border-color: #1e5bb5;
  color: #1e5bb5;
}

.btn-mobile-back {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--accent-blue);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

/* Price Calendar Ribbon with "Все даты" */
.price-ribbon-container {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  width: 100%;
  box-sizing: border-box;
}

.price-ribbon-container::-webkit-scrollbar {
  height: 4px;
}
.price-ribbon-container::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.ribbon-day-card {
  min-width: 94px;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.ribbon-day-card:hover {
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

.ribbon-day-card.active {
  background: rgba(59, 130, 246, 0.16);
  border-color: var(--accent-blue);
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.25);
}

body.light-theme .ribbon-day-card.active {
  background: #e8f0fe;
  border-color: #1e5bb5;
  box-shadow: 0 4px 12px rgba(30, 91, 181, 0.15);
}

.ribbon-card-dow {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.ribbon-card-date {
  font-size: 0.85rem;
  font-weight: 800;
  margin-bottom: 3px;
  color: var(--text-main);
}

.ribbon-card-price {
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--accent-blue);
}

.ribbon-card-price.best {
  color: var(--accent-emerald);
}

/* Fast Brand Filters & Sorting Row (Exact Android Compose MainActivity.kt:3050-3094) */
.results-filters-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
  margin-bottom: 6px;
  box-sizing: border-box;
}

.brand-filter-chips-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex: 1;
  padding: 2px 0;
}

.brand-filter-chips-scroll::-webkit-scrollbar {
  display: none;
}

.results-brand-chip {
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-chip); /* 10px */
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.results-brand-chip:hover {
  border-color: var(--primary);
  color: var(--text-main);
}

.results-brand-chip.active {
  background: rgba(59, 130, 246, 0.16);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}

body.light-theme .results-brand-chip {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #475569;
}

body.light-theme .results-brand-chip.active {
  background: #e8f0fe;
  border-color: #1e5bb5;
  color: #1e5bb5;
}

.btn-sort-cycle {
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.14);
  color: var(--primary);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

body.light-theme .btn-sort-cycle {
  border-color: rgba(30, 91, 181, 0.35);
  background: rgba(30, 91, 181, 0.1);
  color: #1e5bb5;
}

.btn-sort-cycle:hover {
  background: rgba(59, 130, 246, 0.22);
}

/* Empty results card */
.empty-results-card-m3 {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 32px 20px;
  text-align: center;
  margin-top: 16px;
  width: 100%;
  box-sizing: border-box;
}

.btn-reset-results-filters {
  background: var(--primary);
  color: var(--on-primary);
  border: none;
  border-radius: var(--radius-card-sm);
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-top: 10px;
}

.btn-reset-results-filters:hover {
  filter: brightness(1.08);
}

/* ==========================================================================
   BoardingPassTicketCard (Complete Parity with Android)
   ========================================================================== */
.tickets-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.ticket-card-pass {
  background: var(--bg-surface);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-color);
  border-top: 1px solid var(--border-specular-top);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  position: relative;
}

.ticket-card-pass:hover {
  transform: translateY(-2px);
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-card);
}

/* Composite Multimodal Route Ribbon */
.composite-transit-ribbon {
  background: rgba(59, 130, 246, 0.14);
  border-radius: 8px;
  padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent-blue);
}

body.light-theme .composite-transit-ribbon {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e5bb5;
}

/* Top Bar: Train No, Brand, Price */
.ticket-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.train-ident-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-train-no {
  background: var(--surface-variant);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  color: var(--on-surface);
}

.badge-brand-chip {
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-brand-chip .material-symbols-rounded {
  font-size: 13px;
}

/* 1. Sapsan */
.brand-sapsan {
  background: #3B1515;
  color: #FF6B6B;
}
body.light-theme .brand-sapsan {
  background: #FFEBEE;
  color: #C62828;
}

/* 2. Lastochka */
.brand-lastochka {
  background: #14301D;
  color: #4ADE80;
}
body.light-theme .brand-lastochka {
  background: #E8F5E9;
  color: #1B5E20;
}

/* 3. Aurora */
.brand-aurora {
  background: #3B2012;
  color: #FB923C;
}
body.light-theme .brand-aurora {
  background: #FFF3E0;
  color: #E65100;
}

/* 4. Doubledeck */
.brand-doubledeck {
  background: #2E1744;
  color: #C084FC;
}
body.light-theme .brand-doubledeck {
  background: #F3E5F5;
  color: #6A1B9A;
}

/* 5. Nevsky Express */
.brand-nevsky {
  background: #10283B;
  color: #38BDF8;
}
body.light-theme .brand-nevsky {
  background: #E1F5FE;
  color: #0277BD;
}

/* 6. Krasnaya Strela */
.brand-krasnaya-strela {
  background: #3E1616;
  color: #FF5252;
}
body.light-theme .brand-krasnaya-strela {
  background: #FFEBEE;
  color: #B71C1C;
}

/* 7. Grand Express */
.brand-grand {
  background: #38290E;
  color: #FBBF24;
}
body.light-theme .brand-grand {
  background: #FFFDE7;
  color: #F57F17;
}

/* 8. Regular / Other train */
.brand-regular {
  background: #334155;
  color: #CBD5E1;
}
body.light-theme .brand-regular {
  background: #ECEFF1;
  color: #37474F;
}

.ticket-big-price {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 900;
  color: var(--primary);
}

/* Main Movement Track: Dep -> Travel Time -> Arr */
.track-movement-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.track-node-col {
  display: flex;
  flex-direction: column;
}

.track-time {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
}

.track-station {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.track-date {
  font-size: 0.74rem;
  color: var(--text-dim);
}

.track-center-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 110px;
}

.track-duration-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.track-line-visual {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.track-bar {
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.next-day-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent-red);
  margin-left: 4px;
}

/* Composite Legs Summary Box */
.composite-legs-preview {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

body.light-theme .composite-legs-preview {
  background: #f8fafc;
  border-color: #e2e8f0;
}

/* Bottom Row: Car Class, Discounts, Arrow Link */
.ticket-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.car-class-label {
  background: var(--bg-surface-elevated);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
}

.discount-summary-tag {
  background: var(--accent-emerald-bg);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  margin-left: 6px;
}

body.light-theme .discount-summary-tag {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.btn-card-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-blue);
}

/* ==========================================================================
   Interactive Cabin Class Chips (R3 Grouping)
   ========================================================================== */
.cabin-chips-container {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  gap: 8px;
  padding: 4px 2px 8px 2px;
  margin: 12px 0 10px 0;
}

.cabin-chips-container::-webkit-scrollbar {
  display: none;
}

.cabin-class-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-chip, 10px);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
  background: var(--bg-surface-elevated, rgba(51, 65, 85, 0.55));
  color: var(--text-muted, #94a3b8);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.cabin-class-chip:hover {
  border-color: var(--primary, #3b82f6);
  color: var(--text-main, #f8fafc);
  background: rgba(59, 130, 246, 0.08);
}

.cabin-class-chip.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--primary, #3b82f6);
  color: var(--primary, #3b82f6);
  font-weight: 700;
  box-shadow: 0 0 0 1px var(--primary, #3b82f6);
}

.cabin-class-chip .chip-dot {
  opacity: 0.55;
  font-size: 10px;
}

.cabin-class-chip .chip-price {
  font-weight: 700;
}

/* Desktop & Tablet (>= 769px): Flex Row Wrapping */
@media (min-width: 769px) {
  .cabin-chips-container {
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 8px;
    padding: 2px 0 6px 0;
  }
  .cabin-class-chip {
    flex-shrink: 1;
  }
}

/* Light Theme Support */
body.light-theme .cabin-class-chip {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

body.light-theme .cabin-class-chip:hover {
  background: #e2e8f0;
  border-color: #2563eb;
  color: #0f172a;
}

body.light-theme .cabin-class-chip.active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
  box-shadow: 0 0 0 1px #2563eb;
}

/* ==========================================================================
   Modals & Sheets
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

body.light-theme .modal-backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.modal-sheet {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  padding: 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  color: var(--text-main);
}

body.light-theme .modal-sheet {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.15);
}

.modal-close-x {
  position: absolute;
  top: 18px;
  right: 18px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  transition: color 0.15s;
}

.modal-close-x:hover {
  color: var(--text-main);
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
    padding: 14px;
  }
  .search-sidebar {
    position: static;
    max-height: none;
    padding-right: 0;
  }
  .btn-mobile-back {
    display: inline-flex;
  }
  #resultsCol {
    display: none;
  }
}

/* ==========================================================================
   DEDICATED FULL-PAGE ROUTE DETAILS VIEW (NOT A POPUP)
   Matches Android TicketDetails Screen (MainActivity.kt)
   ========================================================================== */
.details-page-view {
  width: 100%;
  min-height: 100vh;
  position: relative;
  z-index: 100;
  display: flex;
  flex-direction: column;
  animation: fadeInDetails 0.22s ease-out;
}

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

/* Sticky Top Navigation Bar */
.details-nav-sticky {
  position: sticky;
  top: 0;
  z-index: 110;
  background: var(--bg-surface);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-color);
  width: 100%;
}

body.light-theme .details-nav-sticky {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid #e2e8f0;
}

.details-nav-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 18px 12px;
  padding-left: calc(18px + env(safe-area-inset-left, 0px));
  padding-right: calc(18px + env(safe-area-inset-right, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.btn-back-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-back-nav:hover {
  background: var(--border-hover);
  border-color: var(--accent-blue);
  transform: translateX(-2px);
}

.details-header-title-block {
  text-align: center;
  flex: 1;
  min-width: 0;
}

.details-header-train {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.details-header-route {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-share-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid var(--border-focus);
  color: var(--accent-blue);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

body.light-theme .btn-share-nav {
  background: #e8f0fe;
  border-color: #1e5bb5;
  color: #1e5bb5;
}

.btn-share-nav:hover {
  background: rgba(59, 130, 246, 0.24);
  transform: translateY(-1px);
}

/* Details Page Body */
.details-body-container {
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 16px calc(80px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Alert Banners (Warning & Transit Notice) */
.transit-notice-banner, .results-alert-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  line-height: 1.45;
}

.transit-notice-banner {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.results-alert-banner {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}

/* Boarding Pass Hero Card */
.details-card-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-top: 1px solid var(--border-specular-top);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-card);
  position: relative;
}

body.light-theme .details-card-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-card);
}

.ticket-perforated-wrap {
  position: relative;
  margin: 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.ticket-cutout-left, .ticket-cutout-right {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-app);
  flex-shrink: 0;
}

.ticket-perforated-line {
  flex: 1;
  height: 1px;
  background: var(--outline-variant);
}

/* 4 Feature Boxes in 2x2 Grid (MainActivity.kt: FeatureBox) */
.details-features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (max-width: 540px) {
  .details-features-grid {
    grid-template-columns: 1fr;
  }
}

.feature-box-card {
  background: rgba(51, 65, 85, 0.6);
  border: none;
  border-radius: var(--radius-input);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

body.light-theme .feature-box-card {
  background: rgba(241, 245, 249, 0.6);
}

.feature-box-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.feature-box-icon {
  font-size: 16px;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
}

.feature-box-label {
  font-size: 11px;
  color: var(--on-surface-variant);
  font-weight: 500;
}

.feature-box-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Multimodal Route Legs Timeline (MainActivity.kt: RouteLegItem) */
.itinerary-timeline-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 14px;
}

.itinerary-leg-item {
  display: flex;
  gap: 12px;
  position: relative;
}

.leg-marker-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 36px;
  flex-shrink: 0;
}

.leg-icon-bubble {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  z-index: 2;
  border: none;
}

.leg-icon-bubble.suburban {
  background: #0C2A3D;
  color: #0284C7;
}
body.light-theme .leg-icon-bubble.suburban {
  background: #E0F2FE;
  color: #0284C7;
}

.leg-icon-bubble.metro {
  background: #271B42;
  color: #8B5CF6;
}
body.light-theme .leg-icon-bubble.metro {
  background: #EDE9FE;
  color: #8B5CF6;
}

.leg-icon-bubble.train {
  background: #38121B;
  color: #E11D48;
}
body.light-theme .leg-icon-bubble.train {
  background: #FFE4E6;
  color: #E11D48;
}

.leg-connecting-track {
  width: 2px;
  height: 38px;
  background: var(--outline-variant);
  margin: 2px 0;
}

.leg-content-col {
  flex: 1;
  padding-bottom: 12px;
}

.leg-top-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.leg-title-text {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-main);
}

.leg-price-badge {
  font-size: 0.88rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.14);
  color: var(--accent-blue);
  white-space: nowrap;
}

.leg-price-badge.discounted {
  background: var(--accent-emerald-bg);
  color: #34d399;
}

body.light-theme .leg-price-badge.discounted {
  background: #ecfdf5;
  color: #047857;
}

.leg-price-original {
  text-decoration: line-through;
  opacity: 0.6;
  font-size: 0.8rem;
  margin-right: 4px;
}

.leg-route-stations {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.leg-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.leg-pill-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

body.light-theme .leg-pill-badge {
  background: var(--bg-surface-elevated);
  border-color: #e2e8f0;
}

.leg-pill-badge.highlight {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

body.light-theme .leg-pill-badge.highlight {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

/* Commuter Schedule Accordion */
.commuter-schedule-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid var(--border-focus);
  color: var(--accent-blue);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.15s ease;
}

body.light-theme .commuter-schedule-btn {
  background: #e8f0fe;
  border-color: #1e5bb5;
  color: #1e5bb5;
}

.commuter-schedule-btn:hover {
  background: rgba(59, 130, 246, 0.22);
}

.commuter-schedule-table-wrap {
  margin-top: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  max-height: 280px;
  overflow-y: auto;
}

body.light-theme .commuter-schedule-table-wrap {
  background: var(--bg-surface-elevated);
  border-color: #e2e8f0;
}

.commuter-table-row {
  display: grid;
  grid-template-columns: 80px 1fr 90px 70px;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8rem;
  align-items: center;
  color: var(--text-main);
}

.commuter-table-row:last-child {
  border-bottom: none;
}

.commuter-table-header {
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 0.72rem;
}

/* Passenger Calculations Breakdown */
.pax-details-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.pax-detail-item-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
}

body.light-theme .pax-detail-item-card {
  background: var(--bg-surface-elevated);
  border-color: #e2e8f0;
}

.pax-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.pax-item-name {
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--text-main);
}

.pax-discount-badge {
  font-size: 0.76rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

body.light-theme .pax-discount-badge {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.pax-price-lines {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.pax-price-row {
  display: flex;
  justify-content: space-between;
}

.pax-price-total-row {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-main);
}

/* Total Price Hero Card */
.total-price-hero-card {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.4) 0%, rgba(6, 78, 59, 0.4) 100%);
  border: 1px solid var(--accent-blue);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-card);
}

body.light-theme .total-price-hero-card {
  background: linear-gradient(135deg, #e8f0fe 0%, #e0f2f1 100%);
  border: 1px solid #bfdbfe;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.total-hero-left {
  display: flex;
  flex-direction: column;
}

.total-hero-caption {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--accent-blue);
  text-transform: uppercase;
}

.total-hero-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.total-hero-price {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--text-main);
}

/* Where to Buy Card & Referral Action Buttons */
.buy-buttons-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.btn-buy-partner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.btn-buy-partner:hover {
  transform: translateY(-2px);
}

/* 1. Official RZD */
.btn-buy-rzd {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

body.light-theme .btn-buy-rzd {
  background: linear-gradient(135deg, #1e5bb5 0%, #174a96 100%);
  color: #ffffff;
}

.btn-buy-rzd:hover {
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.55);
}

/* 2. Yandex Travel Partner */
.btn-buy-yandex {
  background: var(--bg-surface-elevated);
  border: 1px solid rgba(252, 186, 3, 0.4);
  color: var(--text-main);
}

body.light-theme .btn-buy-yandex {
  background: #fffbeb;
  border-color: #fde68a;
  color: #0f172a;
}

.btn-buy-yandex:hover {
  background: rgba(252, 186, 3, 0.15);
  border-color: #fcba03;
  box-shadow: 0 8px 24px rgba(252, 186, 3, 0.2);
}

/* 3. Tutu.ru Partner */
.btn-buy-tutu {
  background: var(--bg-surface-elevated);
  border: 1px solid rgba(14, 165, 233, 0.4);
  color: var(--text-main);
}

body.light-theme .btn-buy-tutu {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #0f172a;
}

.btn-buy-tutu:hover {
  background: rgba(14, 165, 233, 0.15);
  border-color: #0ea5e9;
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.2);
}

.buy-partner-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.buy-partner-icon {
  font-size: 22px;
}

.buy-partner-text {
  display: flex;
  flex-direction: column;
}

.buy-partner-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-main);
}

.btn-buy-rzd .buy-partner-title,
.btn-buy-rzd .buy-partner-sub,
.btn-buy-rzd .buy-partner-arrow {
  color: #ffffff;
}

.buy-partner-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.buy-partner-arrow {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-muted);
}

/* Toast Popup */
.toast-popup {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--accent-blue);
  color: #ffffff;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
  z-index: 1000;
  animation: toastPop 0.2s ease-out;
  pointer-events: none;
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.light-theme .toast-popup {
  background: #0f172a;
  border-color: #1e5bb5;
  color: #ffffff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.25);
}

@keyframes toastPop {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ==========================================================================
   METRO FARES 2026 & FEEDBACK MODALS (1-to-1 Match with Android Compose)
   ========================================================================== */
.modal-header-with-icon {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.metro-header-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(14, 165, 233, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

body.light-theme .metro-header-icon-box {
  background: rgba(2, 132, 199, 0.12);
}

.modal-desc-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 16px;
}

.metro-cards-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 65vh;
  overflow-y: auto;
  padding-right: 4px;
}

.metro-city-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s ease;
}

body.light-theme .metro-city-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.metro-city-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metro-city-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.metro-loyalty-pill {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
}

body.light-theme .metro-loyalty-pill {
  background: #d1fae5;
  color: #047857;
  border-color: #a7f3d0;
}

.metro-loyalty-highlight {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent-blue);
}

body.light-theme .metro-loyalty-highlight {
  color: #0284c7;
}

.metro-prices-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.metro-dot-sep {
  opacity: 0.5;
}

.metro-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.metro-badge-student {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

body.light-theme .metro-badge-student {
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
}

.metro-badge-bio {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

body.light-theme .metro-badge-bio {
  background: #f3e8ff;
  color: #7e22ce;
  border-color: #e9d5ff;
}

.metro-special-note {
  font-size: 0.76rem;
  color: var(--text-main);
  opacity: 0.88;
  line-height: 1.4;
  margin-top: 2px;
}

.metro-normative-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* Feedback Modal Styles */
.feedback-type-chips {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.feedback-chip {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.feedback-chip:hover {
  border-color: var(--accent-blue);
  background: var(--border-hover);
}

.feedback-chip.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #ffffff;
}

body.light-theme .feedback-chip {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

body.light-theme .feedback-chip.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}

.feedback-form-group {
  margin-bottom: 12px;
}

.feedback-textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.88rem;
  resize: vertical;
  min-height: 90px;
  outline: none;
  transition: border-color 0.15s ease;
}

.feedback-textarea:focus {
  border-color: var(--accent-blue);
}

body.light-theme .feedback-textarea {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

.feedback-input {
  width: 100%;
  box-sizing: border-box;
}

.feedback-error-text {
  color: #ef4444;
  font-size: 0.78rem;
  margin-top: 4px;
  font-weight: 600;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.spin {
  animation: spin 0.8s linear infinite;
}

/* ==========================================================================
   AUTO-MONITORING RADAR v2.0 (DATE RADAR & TRAIN RADAR)
   ========================================================================== */
.date-radar-banner {
  margin: 10px 0 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.12) 0%, rgba(37, 99, 235, 0.08) 100%);
  border: 1px solid rgba(2, 132, 199, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.08);
  transition: all 0.2s ease;
}

body.light-theme .date-radar-banner {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-color: #bae6fd;
}

.date-radar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-radar-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(2, 132, 199, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #0284c7;
}

.date-radar-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.date-radar-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.btn-date-radar-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #0284c7;
  color: #ffffff !important;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.18s ease;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.btn-date-radar-action:hover {
  background: #0369a1;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.45);
}

/* Quick Radar Action on Ticket Card */
.btn-card-radar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid rgba(2, 132, 199, 0.3);
  color: #0284c7;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-right: 6px;
}

body.light-theme .btn-card-radar {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
}

.btn-card-radar:hover {
  background: rgba(2, 132, 199, 0.22);
  transform: scale(1.03);
}

/* Radar Modal */
.radar-sheet-modal {
  max-width: 520px;
  width: 95%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-modal);
  position: relative;
}

body.light-theme .radar-sheet-modal {
  background: #ffffff;
  border-color: #cbd5e1;
}

.radar-modal-route-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-top: 10px;
  font-size: 0.85rem;
}

body.light-theme .radar-modal-route-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.radar-modal-info-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.25);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-top: 14px;
}

/* Radar Empty State Card */
.empty-results-radar-card {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.12) 0%, rgba(30, 58, 138, 0.08) 100%);
  border: 1px solid rgba(2, 132, 199, 0.35);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  margin-top: 16px;
}

body.light-theme .empty-results-radar-card {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-color: #bae6fd;
}

