/* ==========================================================================
   Электрички 24 (elektrichki24.ru) — Design System & Stylesheet
   Modern, Ultra-Fast, Responsive Static Timetable Interface
   ========================================================================== */

:root {
  /* Brand & Theme Colors */
  --brand-primary: #1d4ed8;
  --brand-primary-hover: #1e40af;
  --brand-electric: #2563eb;
  --brand-cyan: #0ea5e9;
  --brand-dark: #0f172a;
  --brand-navy: #1e293b;
  
  /* Status & Accents */
  --success: #059669;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --info: #0284c7;
  --info-bg: #f0f9ff;
  --info-border: #bae6fd;
  
  /* Neutrals & Surfaces */
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-muted: #f1f5f9;
  --bg-subtle: #f8fafc;
  
  /* Text & Inks */
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --text-inverse: #ffffff;
  
  /* Borders & Dividers */
  --border-light: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-focus: #3b82f6;
  
  /* Elevation & Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 2px 8px -1px rgba(15, 23, 42, 0.06), 0 1px 4px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px -4px rgba(15, 23, 42, 0.08), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 16px 36px -6px rgba(15, 23, 42, 0.1), 0 4px 12px -2px rgba(15, 23, 42, 0.05);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.15);
  
  /* Layout & Geometry */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 9999px;
  --shell: 1200px;
  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Resets & Global Typography */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout Shell */
.shell {
  width: min(calc(100% - 36px), var(--shell));
  margin-inline: auto;
}

a {
  color: var(--brand-electric);
  text-decoration: none;
  transition: color var(--transition), border-color var(--transition);
}

a:hover {
  color: var(--brand-primary-hover);
}

/* Accessibility: Skip Link */
.skip-link {
  position: fixed;
  left: 20px;
  top: -100px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--brand-dark);
  color: var(--text-inverse);
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  transition: top var(--transition);
}

.skip-link:focus {
  top: 16px;
  outline: 3px solid var(--brand-cyan);
}

/* Header & Sticky Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.03);
}

.header-row {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--brand-dark);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  flex-shrink: 0;
}

.brand:hover {
  color: var(--brand-electric);
}

.brand-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
}

.brand:hover .brand-icon {
  transform: scale(1.05);
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

/* Global Header Search Box */
.header-search-box {
  position: relative;
  flex: 1;
  max-width: 360px;
  margin: 0 12px;
}

.header-search-control {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  transition: all var(--transition);
}

.header-search-control:focus-within {
  border-color: var(--brand-electric);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12), var(--shadow-sm);
}

.header-search-control .search-icon {
  color: var(--text-subtle);
  flex-shrink: 0;
}

.header-search-control input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--brand-dark);
  font: inherit;
  font-size: 0.88rem;
  padding: 2px 0;
}

.header-search-control input::placeholder {
  color: var(--text-subtle);
}

.header-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 70;
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  padding: 6px 0;
}

.header-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-light);
  transition: background-color var(--transition);
}

.header-search-item:last-child {
  border-bottom: 0;
}

.header-search-item strong {
  color: var(--brand-dark);
  font-weight: 700;
}

.header-search-item small {
  margin-left: 8px;
  color: var(--text-subtle);
  font-size: 0.78rem;
}

.header-search-item .search-badge {
  font-size: 0.76rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  color: var(--brand-primary);
  font-weight: 700;
  white-space: nowrap;
}

.header-search-item:hover, .header-search-item.is-active {
  background: var(--bg-muted);
  color: var(--brand-electric);
}

.header-search-item:hover .search-badge, .header-search-item.is-active .search-badge {
  background: rgba(37, 99, 235, 0.1);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.nav-link {
  padding: 7px 12px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
}

.nav-link:hover {
  background: var(--bg-muted);
  color: var(--brand-dark);
}

/* Main Content Area */
main {
  min-height: calc(100vh - 200px);
  padding-bottom: 60px;
}

/* Breadcrumbs */
.breadcrumbs {
  padding-top: 20px;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  color: var(--text-subtle);
  font-size: 0.85rem;
  font-weight: 500;
}

.breadcrumbs li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--border-medium);
  font-size: 0.8rem;
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 2px 4px;
  border-radius: 4px;
}

.breadcrumbs a:hover {
  color: var(--brand-electric);
  background: rgba(37, 99, 235, 0.06);
}

/* Page Heading Typography */
.page-heading {
  margin-top: 24px;
}

.eyebrow-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px 0;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(37, 99, 235, 0.08);
  color: var(--brand-primary);
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.eyebrow-badge::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-electric);
}

h1 {
  margin: 0;
  color: var(--brand-dark);
  font-size: clamp(1.85rem, 3.8vw, 2.75rem);
  font-weight: 850;
  line-height: 1.18;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.95rem);
  font-weight: 750;
  margin: 0 0 12px 0;
}

h3 {
  font-size: 1.12rem;
  font-weight: 700;
  margin: 0 0 8px 0;
}

/* Search Hero Panel */
.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
  margin-top: 32px;
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: visible;
}

.search-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-electric), var(--brand-cyan));
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.search-panel h2 {
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 8px;
}

.search-panel p {
  color: var(--text-muted);
  font-size: 0.98rem;
  margin: 0;
}

.search-kicker {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--brand-electric);
  font-size: 0.84rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.search-quick-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
  font-size: 0.84rem;
}

.search-quick-tags span {
  color: var(--text-subtle);
  font-weight: 600;
}

.search-quick-tags a {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(37, 99, 235, 0.08);
  color: var(--brand-primary);
  font-weight: 650;
  text-decoration: none;
  transition: all var(--transition);
}

.search-quick-tags a:hover {
  background: var(--brand-electric);
  color: var(--text-inverse);
}

/* Search Form Control */
.station-search {
  position: relative;
}

.station-search label {
  display: block;
  margin-bottom: 8px;
  color: var(--brand-dark);
  font-size: 0.88rem;
  font-weight: 700;
}

.search-control {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-control:focus-within {
  border-color: var(--brand-electric);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12), var(--shadow-md);
}

.search-icon-prefix {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--text-subtle);
  flex-shrink: 0;
}

.search-control input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  padding: 10px 8px;
  background: transparent;
  color: var(--brand-dark);
  font: inherit;
  font-size: 1rem;
}

.search-control input::placeholder {
  color: var(--text-subtle);
}

.btn-primary, .search-control button {
  border: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand-electric) 0%, var(--brand-primary) 100%);
  color: var(--text-inverse);
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 11px 22px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.25);
  transition: all var(--transition);
}

.btn-primary:hover, .search-control button:hover {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-hover) 100%);
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-medium);
  background: var(--bg-card);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all var(--transition);
}

.btn-secondary:hover {
  border-color: var(--brand-electric);
  color: var(--brand-electric);
  background: var(--bg-muted);
}

/* Search Dropdown Results */
.search-results {
  position: absolute;
  inset: calc(100% + 6px) 0 auto;
  z-index: 60;
  overflow: hidden;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
}

.search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  text-decoration: none;
  transition: background-color var(--transition);
}

.search-item:last-child {
  border-bottom: 0;
}

.search-item strong {
  display: block;
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 1rem;
}

.search-item small {
  display: block;
  margin-top: 2px;
  color: var(--text-subtle);
  font-size: 0.82rem;
}

.search-badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  color: var(--brand-primary);
  font-size: 0.82rem;
  font-weight: 750;
}

.search-item:hover, .search-item.is-active {
  background: rgba(37, 99, 235, 0.05);
}

.search-item:hover strong, .search-item.is-active strong {
  color: var(--brand-electric);
}

/* Metrics Banner */
.metrics-banner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 28px;
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
}

.metric-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.metric-num {
  font-size: 1.7rem;
  font-weight: 850;
  color: var(--brand-electric);
  line-height: 1.2;
}

.metric-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
}

/* Homepage Sections */
.home-section {
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1px solid var(--border-light);
}

.section-title-wrap {
  margin-bottom: 28px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.02rem;
  margin: 6px 0 0 0;
  max-width: 820px;
}

/* Rich Direction Cards */
.directions-rich-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.direction-rich-card {
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-xs);
  color: var(--text-main);
  text-decoration: none;
  transition: all var(--transition);
}

.direction-rich-card:hover {
  border-color: var(--brand-electric);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.direction-rich-route {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--brand-dark);
}

.direction-rich-route .dir-arrow {
  color: var(--brand-electric);
}

.direction-rich-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.direction-trips-count {
  font-size: 0.82rem;
  font-weight: 750;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(37, 99, 235, 0.08);
  color: var(--brand-primary);
}

.direction-dur {
  font-size: 0.8rem;
  color: var(--text-subtle);
}

.direction-rich-times {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.direction-rich-times strong {
  color: var(--brand-dark);
}

/* Hub Stations Grid */
.hubs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hub-station-card {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-xs);
  color: var(--text-main);
  text-decoration: none;
  transition: all var(--transition);
}

.hub-station-card:hover {
  border-color: var(--brand-electric);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

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

.hub-card-header strong {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--brand-dark);
}

.hub-badge {
  font-size: 0.78rem;
  font-weight: 750;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  color: var(--brand-primary);
  white-space: nowrap;
}

.hub-card-sub {
  margin-top: 4px;
  color: var(--text-subtle);
  font-size: 0.84rem;
}

.hub-card-link {
  margin-top: 12px;
  color: var(--brand-electric);
  font-weight: 700;
  font-size: 0.85rem;
}

/* Alphabet Index */
.alpha-letters-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}

.alpha-letter-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--brand-dark);
  font-weight: 750;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all var(--transition);
}

.alpha-letter-btn:hover {
  border-color: var(--brand-electric);
  background: var(--brand-electric);
  color: var(--text-inverse);
}

.alpha-blocks-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.alpha-group-block {
  padding: 20px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}

.alpha-group-heading {
  font-size: 1.3rem;
  font-weight: 850;
  color: var(--brand-electric);
  border-bottom: 2px solid rgba(37, 99, 235, 0.15);
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.alpha-group-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.alpha-station-item {
  color: var(--text-main);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  padding: 2px 0;
  transition: color var(--transition);
}

.alpha-station-item:hover {
  color: var(--brand-electric);
}

.alpha-station-item small {
  color: var(--text-subtle);
  font-size: 0.8rem;
}

/* Feature Cards Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.feature-card {
  padding: 24px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-xs);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 750;
  color: var(--brand-dark);
}

.feature-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 860px;
}

.faq-item {
  padding: 20px 24px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-xs);
}

.faq-item h3 {
  font-size: 1.08rem;
  font-weight: 750;
  color: var(--brand-dark);
  margin-bottom: 8px;
}

.faq-item p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.94rem;
  line-height: 1.6;
}

/* Timetable Header Strip (Date & Local Time info above tables) */
.timetable-header-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.timetable-meta-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 750;
}

.meta-pill.local-time {
  background: var(--warning-bg);
  color: #92400e;
  border: 1px solid var(--warning-border);
}

.meta-pill.duration {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid var(--info-border);
}

.timetable-date-right {
  display: flex;
  align-items: center;
}

.timetable-date-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 650;
}

/* In-Page Table Live Filter Bar */
.table-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  margin-bottom: 14px;
}

.table-filter-control {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  max-width: 480px;
  padding: 8px 14px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition);
}

.table-filter-control:focus-within {
  border-color: var(--brand-electric);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.table-filter-control svg {
  color: var(--text-subtle);
  flex-shrink: 0;
}

.table-filter-input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--brand-dark);
  font: inherit;
  font-size: 0.92rem;
}

.table-filter-input::placeholder {
  color: var(--text-subtle);
}

.table-filter-counter {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Fact Strip Cards */
.fact-strip {
  margin-top: 24px;
}

.fact-strip dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
}

.fact-strip div {
  padding: 16px 20px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-xs);
}

.fact-strip dt {
  color: var(--text-subtle);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fact-strip dd {
  margin: 8px 0 0;
  color: var(--brand-dark);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

/* Content Sections */
.content-section {
  margin-top: 44px;
}

.section-header-flex {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.content-section > p.lead {
  max-width: 860px;
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

/* Schedule Table */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.schedule-table {
  width: 100%;
  min-width: 580px;
  border-collapse: collapse;
  font-size: 0.94rem;
  text-align: left;
}

.schedule-table caption {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-subtle);
  color: var(--brand-dark);
  font-weight: 750;
  font-size: 0.98rem;
  text-align: left;
}

.schedule-table thead {
  background: var(--bg-muted);
}

.schedule-table th, .schedule-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.schedule-table thead th {
  color: var(--text-subtle);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.schedule-table tbody th {
  font-weight: 650;
}

.schedule-table tbody th a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brand-dark);
  font-weight: 700;
}

.schedule-table tbody th a:hover {
  color: var(--brand-electric);
}

.train-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(37, 99, 235, 0.08);
  color: var(--brand-primary);
  font-weight: 750;
  font-size: 0.86rem;
}

.route-link {
  color: var(--brand-dark);
  font-weight: 650;
}

.route-link:hover {
  color: var(--brand-electric);
}

.schedule-table tbody tr:last-child > * {
  border-bottom: 0;
}

.schedule-table tbody tr {
  transition: background-color var(--transition);
}

.schedule-table tbody tr:hover {
  background-color: rgba(37, 99, 235, 0.04);
}

.row-number {
  width: 44px;
  color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.85rem;
}

.time-cell, .time-col {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.time-wrap {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}

.time-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  color: var(--brand-dark);
  font-weight: 800;
  font-size: 0.95rem;
}

.time-badge.accent {
  background: rgba(37, 99, 235, 0.1);
  color: var(--brand-primary);
}

.time-sub {
  font-size: 0.72rem;
  color: var(--text-subtle);
  font-weight: 600;
}

.stay-time {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.travel-time-pill {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-dark);
}

.badge-origin, .badge-terminal {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 750;
  text-transform: uppercase;
}

.badge-origin {
  background: var(--success-bg);
  color: var(--success);
}

.badge-terminal {
  background: var(--info-bg);
  color: var(--info);
}

.stops-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.origin-time-text {
  font-weight: 750;
  color: var(--brand-dark);
}

.text-subtle {
  color: var(--text-subtle);
}

.muted {
  color: var(--text-subtle);
}

/* Disclaimer Box (внизу страницы перед футером) */
.schedule-disclaimer-box {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 36px;
  padding: 18px 22px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
}

.disclaimer-icon {
  color: var(--brand-electric);
  flex-shrink: 0;
  margin-top: 2px;
}

.schedule-disclaimer-box p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.schedule-disclaimer-box strong {
  color: var(--brand-dark);
}

/* Station & Direction Lists (Куда уехать со станции) */
.station-list, .direction-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin: 16px 0 0 0;
  padding: 0;
  list-style: none;
}

.station-list li a, .direction-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-xs);
  color: var(--text-main);
  text-decoration: none;
  font-weight: 700;
  transition: all var(--transition);
}

.station-list li a:hover, .direction-list li a:hover {
  border-color: var(--brand-electric);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
  color: var(--brand-electric);
}

.station-list li a span, .direction-list li a span {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand-primary);
  background: rgba(37, 99, 235, 0.08);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

/* Bottom Schedule Snapshot Note */
.schedule-snapshot-footer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
  color: var(--text-subtle);
  font-size: 0.84rem;
}

.schedule-snapshot-footer p {
  margin: 0;
}

.status-pulse {
  position: relative;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.status-pulse::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--success);
  opacity: 0.35;
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.8); opacity: 0; }
  100% { transform: scale(1); opacity: 0.4; }
}

/* 404 Error Page */
.not-found-card {
  max-width: 680px;
  margin: 40px auto 0;
  padding: 48px 36px;
  text-align: center;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
}

.not-found-icon-wrap {
  display: inline-grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.08);
  color: var(--brand-electric);
  margin-bottom: 20px;
}

.error-code-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(217, 119, 6, 0.1);
  color: var(--warning);
  font-weight: 750;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.not-found-card h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  font-weight: 850;
  margin: 0 0 12px 0;
}

.not-found-card p.lead {
  color: var(--text-muted);
  font-size: 1rem;
  margin: 0 auto 28px;
}

.not-found-search {
  max-width: 520px;
  margin: 0 auto 28px;
  text-align: left;
}

.popular-quick-links {
  margin: 28px 0;
  text-align: left;
}

.popular-quick-links p {
  margin: 0 0 10px 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-link {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  border: 1px solid var(--border-light);
  color: var(--brand-dark);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
}

.chip-link:hover {
  border-color: var(--brand-electric);
  color: var(--brand-electric);
  background: rgba(37, 99, 235, 0.08);
}

.not-found-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 32px;
  flex-wrap: wrap;
}

/* Footer & 4-Column Layout */
.site-footer {
  margin-top: 80px;
  padding: 56px 0 32px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-card);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1.2fr 1.2fr 1.2fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border-light);
}

.footer-brand {
  margin-bottom: 12px;
}

.footer-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 0;
}

.footer-col-title {
  margin: 0 0 16px 0;
  font-size: 0.92rem;
  font-weight: 750;
  color: var(--brand-dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links li a {
  color: var(--text-muted);
  font-size: 0.88rem;
  text-decoration: none;
  transition: color var(--transition);
}

.footer-links li a:hover {
  color: var(--brand-electric);
}

.footer-note-item {
  color: var(--text-subtle);
  font-size: 0.84rem;
}

.footer-bottom-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  color: var(--text-subtle);
  font-size: 0.84rem;
}

.footer-bottom-row p {
  margin: 0;
}

/* Responsive Media Queries */
@media (max-width: 992px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .metrics-banner {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .search-panel {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .header-row {
    flex-wrap: wrap;
    min-height: auto;
    padding: 12px 0;
    gap: 10px;
  }

  .header-search-box {
    order: 3;
    max-width: 100%;
    width: 100%;
    margin: 4px 0 0 0;
  }

  .header-nav {
    gap: 4px;
  }

  .nav-link {
    padding: 5px 8px;
    font-size: 0.84rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 640px) {
  .shell {
    width: calc(100% - 24px);
  }

  .search-control {
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
  }

  .search-control input {
    padding: 8px 0;
  }

  .btn-primary, .search-control button {
    width: 100%;
  }

  .fact-strip dl {
    grid-template-columns: 1fr 1fr;
  }

  .metrics-banner {
    grid-template-columns: 1fr 1fr;
    padding: 16px;
  }

  .metric-num {
    font-size: 1.4rem;
  }

  .not-found-card {
    padding: 32px 20px;
  }
}
