@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg-page: #f3f4f6;
  --bg-header: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #eef2ff;
  --bg-soft: #f9fafb;
  --bg-muted: #e5e7eb;

  --border-subtle: #e5e7eb;
  --border-strong: #d1d5db;

  --text-main: #111827;
  --text-muted: #6b7280;
  --text-soft: #334155;
  --text-inverse: #ffffff;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #dbeafe;

  --danger-bg: #fee2e2;
  --danger-border: #dc2626;
  --danger-text: #991b1b;

  --warning-bg: #fff7cc;
  --warning-border: #e6c200;
  --warning-text: #6b5e00;

  --fare-bg: #fff6d5;
  --fare-border: #eab308;

  --success-text: #166534;

  --shadow-soft: 0 10px 25px rgba(15, 23, 42, 0.05);
  --shadow-hover: 0 14px 30px rgba(15, 23, 42, 0.1);
  --shadow-map: 0 10px 25px rgba(15, 23, 42, 0.05);
  --shadow-popup: 0 16px 36px rgba(15, 23, 42, 0.18);
  --shadow-button: 0 8px 18px rgba(37, 99, 235, 0.2);

  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --rail-polregio: #c8102e;
}

html[data-theme="dark"] {
  --bg-page: #020617;
  --bg-header: #0f172a;
  --bg-card: #111827;
  --bg-card-hover: #172554;
  --bg-soft: #0f172a;
  --bg-muted: #1f2937;

  --border-subtle: #334155;
  --border-strong: #475569;

  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-soft: #e2e8f0;
  --text-inverse: #ffffff;

  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-soft: rgba(96, 165, 250, 0.16);

  --danger-bg: rgba(239, 68, 68, 0.14);
  --danger-border: #ef4444;
  --danger-text: #fecaca;

  --warning-bg: rgba(234, 179, 8, 0.14);
  --warning-border: #facc15;
  --warning-text: #fde68a;

  --fare-bg: rgba(234, 179, 8, 0.14);
  --fare-border: #facc15;

  --success-text: #86efac;

  --shadow-soft: 0 14px 34px rgba(0, 0, 0, 0.38);
  --shadow-hover: 0 18px 42px rgba(0, 0, 0, 0.48);
  --shadow-map: 0 14px 34px rgba(0, 0, 0, 0.38);
  --shadow-popup: 0 18px 42px rgba(0, 0, 0, 0.52);
  --shadow-button: 0 8px 22px rgba(96, 165, 250, 0.18);
  color-scheme: dark;
}


html.theme-is-changing *,
html.theme-is-changing *::before,
html.theme-is-changing *::after {
  transition:
    background-color 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease,
    fill 0.25s ease,
    stroke 0.25s ease;
}

body {
  font-family: 'DM Sans', sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

main {
  flex: 1;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.85rem;
}

table th,
table td {
  border: 1px solid var(--border-strong);
  padding: 0.45rem 0.6rem;
  text-align: center;
}

thead {
  background: var(--bg-page);
}

#contact-form {
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

#fare-discounts {
  margin-top: 2rem;
  padding: 1.3rem 1.2rem;
}

#nav-container {
  position: sticky;
  top: 0;
  z-index: 1000;
}

#network-map {
  height: 480px;
  width: 100%;
  border-radius: 16px;
  box-shadow: var(--shadow-map);
  border: 1px solid var(--border-subtle);
}

#stop-map {
  height: 300px;
  width: 100%;
  border-radius: 16px;
  box-shadow: var(--shadow-map);
  border: 1px solid var(--border-subtle);
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  gap: 0.75rem;
}

.brand-logo {
  width: 36px;
  height: auto;
  object-fit: contain;
  padding: 0;
  background: none;
  border-radius: 0;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.bus-location-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #111111;
}

.bus-location-icon {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 44px;
  height: 28px;
  padding: 0 6px;
  background: #ffffff;
  border: 2px solid var(--bus-line-color, #facc15);
  border-radius: 25px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
  color: #111111;
  font-family: "DM Sans", sans-serif;
  line-height: 1;
}

.bus-location-icon-wrapper {
  background: transparent;
  border: 0;
}

.bus-location-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bus-location-svg svg {
  width: 14px;
  height: 14px;
  display: block;
  fill: currentColor;
}

.bus-popup-card {
  background: var(--bg-card);
  color: var(--text-main);
  border-radius: 14px;
  overflow: hidden;
  font-family: "DM Sans", sans-serif;
}

.bus-popup-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  background: var(--accent);
  color: var(--text-inverse);
  font-size: 13px;
}

.bus-popup-header-icon svg {
  width: 14px;
  height: 14px;
  fill: var(--text-inverse);
}

.bus-popup-line-number {
  font-weight: 900;
}

.bus-popup-direction {
  font-weight: 600;
  min-width: 0;
}

.bus-popup-body {
  padding: 5px;
  display: grid;
  gap: 1px;
}

.bus-popup-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bus-popup-row-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--accent);
}

.bus-popup-row-icon svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: currentColor;
}

.bus-popup-row-text {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-main);
  line-height: 1.1;
}

.bus-popup-row-text-next {
  font-weight: 600;
}

.bus-popup-separator {
  opacity: 0.92;
  font-weight: 400;
}

.card {
  display: block;
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.card h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  background-color: var(--bg-card-hover);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  background-color: var(--bg-muted);
  font-size: 0.95rem;
  color: var(--text-soft);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.chip:hover {
  background-color: var(--accent);
  color: var(--text-inverse);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.compact-timetable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  table-layout: auto;
  border: none;
}

.compact-timetable td {
  padding: 0.15rem 0.25rem;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
}

.compact-timetable td:first-child {
  white-space: nowrap;
  width: 1%;
  text-align: right;
  padding-right: 0.5rem;
  font-weight: 600;
}

.compact-timetable td:last-child {
  width: 99%;
  text-align: left;
}

.compact-timetable tr:last-child td {
  border-bottom: none;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
}

.contact-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 1.1rem 1.1rem 1.2rem;
}

.contact-card,
.contact-card:hover {
  transition: none !important;
  transform: none !important;
  background-color: var(--bg-card) !important;
  cursor: default !important;
}

.contact-card h2 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.contact-card-desc {
  margin: 0 0 0.7rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.contact-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form-card {
  margin-top: 0.5rem;
}

.contact-header h1 {
  margin-bottom: 0.4rem;
}

.contact-intro {
  margin: 0 0 1.2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.contact-layout {
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1.3rem;
}

.contact-line {
  margin: 0.1rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.contact-link {
  color: var(--text-main);
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: currentColor;
  text-underline-offset: 3px;
  transition: color 0.25s ease, text-decoration-color 0.25s ease;
}

.contact-link:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.contact-org-block,
.operator-block {
  margin-top: 0.4rem;
  padding-top: 0.2rem;
}

.contact-org-block h3,
.operator-block h3 {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
}

.contact-submit-btn {
  align-self: flex-start;
  margin-top: 0.2rem;
  font: inherit;
  font-size: 0.9rem;
  padding: 0.5rem 1.4rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background-color: var(--accent);
  color: var(--text-inverse);
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.contact-submit-btn:hover {
  background-color: var(--accent-hover);
  box-shadow: var(--shadow-button);
}

.contact-submit-btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

.course-link {
  color: var(--text-main);
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: currentColor;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  font-weight: 400;
}

.course-link:hover,
.course-link:active,
.course-link:visited {
  color: var(--text-main);
  text-decoration-color: currentColor;
  text-decoration-thickness: 1px;
}

.course-link.next-departure {
  background: var(--accent);
  color: #ffffff;
  border-radius: 999px;
  padding: 0.15rem 0.2rem;
  font-weight: 600;
  text-decoration: none;
}

.course-link.next-departure sup {
  color: inherit;
}

.discount-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 1rem;
  display: grid;
  grid-template-columns: 10% 90%;
  gap: 0.8rem;
  align-items: center;
  border: 1px solid transparent; 
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  scroll-margin-top: 65px;
}

.discount-card:hover {
  border-color: var(--accent);
}

.discount-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.discount-left {
  text-align: center;
}

.discount-right li {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.3rem;
}

.discount-right p {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.discount-right ul {
  margin: 0.1rem 0 0 1rem;
  padding: 0;
}

.discount-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.dotted-link {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.dotted-link:hover,
.dotted-link:focus-visible {
  outline: none;
  color: var(--text-main);
  transition: color 0.25s ease;
}

.fare-card {
  margin-top: 0.5rem;
  background-color: var(--fare-bg);
  border: 1px solid var(--fare-border);
}

.fare-card,
.fare-card:hover {
  transition: none !important;
  transform: none !important;
  background-color: var(--fare-bg) !important;
  box-shadow: var(--shadow-soft) !important;
  cursor: default !important;
}

.fare-desc {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.fare-main {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 1.3rem 1.2rem;
}

.fare-section {
  margin-top: 1.5rem;
}

.fare-section h2 {
  margin-bottom: 0.3rem;
  font-size: 1.15rem;
}

.fare-switch {
  margin: 0 0 1.2rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.fare-switch-btn {
  font: inherit;
  font-size: 0.95rem;
  min-width: 250px;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: var(--bg-muted);
  color: var(--text-soft);
  transition: 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fare-switch-btn.active {
  background: var(--accent);
  color: var(--text-inverse);
  font-weight: bold;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-note {
  font-size: 0.78rem;
}

.form-error {
  min-height: 0.9rem;
  margin: 0;
  font-size: 0.75rem;
  color: var(--danger-text);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-group input,
.form-group textarea {
  font-family: inherit;
  font-size: 0.88rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  outline: none;
  background-color: var(--bg-soft);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
  background-color: var(--bg-card);
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
}

.form-note {
  margin: 0.1rem 0 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.form-status {
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

.form-status.error {
  color: var(--danger-text);
}

.form-status.success {
  color: var(--success-text);
}

.frpa {
  margin-top: 0rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.hero {
  margin-top: 1.8rem;
  margin-bottom: 2rem;
  padding: 3.5rem 1.5rem;
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  min-height: 260px;
  background-image: url('/hero.jpg');
  background-size: cover;
  background-position: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.65),
    rgba(0, 0, 0, 0.35)
  );
}

.hero-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--text-inverse);
  padding: 1rem;
}

.hero-subtitle {
  font-size: 1.4rem;
  font-weight: 400;
  margin-top: 0;
}

.hero-title {
  font-size: 2.4rem;
  font-weight: 700;
  margin: 0;
}

.hero-title,
.hero-subtitle {
  white-space: nowrap;
}

.info-box {
  background-color: var(--bg-soft);
  border-radius: var(--radius-lg);
  padding: 1rem 1rem;
  border: 1px dashed var(--border-subtle);
}

.info-box p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.info-tile {
  --tile-fg: var(--warning-text);
  --tile-bg: var(--warning-bg);
  --tile-border: var(--warning-border);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 1rem 1.3rem;
  border: 1px solid var(--tile-border);
  background: var(--tile-bg);
  color: var(--tile-fg);
  border-radius: var(--radius-lg);
  line-height: 1.5;
}

.info-tile__content {
  min-width: 0;
}

.info-tile__icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--tile-fg);
}

.info-tile__icon .material-icon {
  width: 28px;
  height: 28px;
  display: block;
}

.info-tile__text {
  margin: 0;
  font-size: 14px;
}

.info-tile__title {
  margin: 0 0 2px 0;
  font-size: 16px;
}

.journey-body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: var(--bg-page);
  color: var(--text-main);
}

.journey-card {
  width: min(100%, 430px);
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 0.7rem 0.8rem 0.8rem;
}

.journey-content {
  margin-top: 0.5rem;
  font-size: 0.86rem;
  line-height: 1.3;
}

.journey-course-desc {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.25;
}

.journey-header h1 {
  margin: 0 0 0.2rem;
  font-size: 1.1rem;
  line-height: 1.2;
}

.journey-notes {
  margin: 0;
  padding-left: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.journey-notes-block {
  margin-top: 0.5rem;
}

.journey-notes-block p {
  margin: 0 0 0.2rem;
  font-size: 0.8rem;
}

.journey-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-top: 0.3rem;
}

.journey-table .lp {
  width: 28px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.journey-table .stop-name {
  text-align: left;
}

.journey-table .stop-name a {
  color: var(--text-muted);
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: currentColor;
  text-underline-offset: 4px;
  transition: color 0.25s ease;
}

.journey-table .stop-name a:hover {
  color: var(--accent);
}

.journey-table tr.journey-row-before-start td,
.journey-table tr.journey-row-before-start .stop-name a,
.journey-table tr.journey-row-before-start .stop-name a:hover,
.journey-table tr.journey-row-before-start .stop-name a:focus-visible,
.journey-table tr.journey-row-before-start .stop-name a:active,
.journey-table tr.journey-row-before-start .stop-name a:visited {
  color: #9ca3af;
}

html[data-theme="dark"] .journey-table tr.journey-row-before-start td,
html[data-theme="dark"] .journey-table tr.journey-row-before-start .stop-name a,
html[data-theme="dark"] .journey-table tr.journey-row-before-start .stop-name a:hover,
html[data-theme="dark"] .journey-table tr.journey-row-before-start .stop-name a:focus-visible,
html[data-theme="dark"] .journey-table tr.journey-row-before-start .stop-name a:active,
html[data-theme="dark"] .journey-table tr.journey-row-before-start .stop-name a:visited {
  color: #64748b;
}

.journey-table .time {
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}

.journey-table td {
  padding: 0.22rem 0.25rem;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
}

.journey-table tr:last-child td {
  border-bottom: none;
}

.journey-validity {
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
}

.journey-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 0.8rem;
}

.leaflet-popup.bus-popup .leaflet-popup-content {
  margin: 0;
  min-width: 220px;
}

.leaflet-popup.bus-popup .leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-popup);
}

.leaflet-popup.bus-popup .leaflet-popup-tip {
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.leaflet-tooltip.stop-tooltip {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  pointer-events: none;
}

.leaflet-tooltip.stop-tooltip {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.leaflet-tooltip.stop-tooltip.leaflet-tooltip-right.leaflet-tooltip-visible {
  opacity: 1;
}

.line-alert-card {
  align-items: flex-start;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.22);
  border-radius: 1rem;
  color: var(--text-main);
  display: flex;
  gap: 0.9rem;
  padding: 1rem;
}

.line-alert-card,
.line-alert-card:hover {
  background-color: rgba(220, 38, 38, 0.08) !important;
  box-shadow: var(--shadow-soft) !important;
  cursor: default;
  transform: none !important;
  transition: none !important;
}

.line-alert-icon {
  align-items: center;
  background: rgba(220, 38, 38, 0.12);
  border-radius: 999px;
  color: #dc2626;
  display: inline-flex;
  flex: 0 0 auto;
  height: 2.25rem;
  justify-content: center;
  width: 2.25rem;
}

.line-alert-icon svg {
  display: block;
  height: 1.35rem;
  width: 1.35rem;
}

.line-alert-content {
  color: #dc2626;
  flex: 1 1 auto;
  font-size: 0.95rem;
  line-height: 1.55;
}

[data-theme="dark"] .line-alert-card {
  border-color: rgba(248, 113, 113, 0.28);
}

[data-theme="dark"] .line-alert-card,
[data-theme="dark"] .line-alert-card:hover {
  background-color: rgba(248, 113, 113, 0.12) !important;
  box-shadow: var(--shadow-soft) !important;
}

[data-theme="dark"] .line-alert-content {
  color: #f87171;
}

[data-theme="dark"] .line-alert-icon {
  background: rgba(248, 113, 113, 0.16);
  color: #f87171;
}

.line-box {
  background-color: var(--bg-soft);
  border-radius: var(--radius-lg);
  padding: 0.7rem 0.8rem;
}

.line-box h3 {
  margin: 0 0 0;
  font-size: 0.9rem;
}

.line-box h4 {
  margin: 0 0 0.4rem;
  font-size: 0.7rem;
}

.line-box-stack {
  display: flex;
  flex-direction: column;
  background: transparent !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  gap: 0;
}

.line-card {
  margin-top: 1.5rem;
  padding: 1.1rem 1.1rem 1.2rem;
}

.line-card,
.line-card:hover {
  transition: none !important;
  transform: none !important;
  background-color: var(--bg-card) !important;
  box-shadow: var(--shadow-soft) !important;
  cursor: default;
}

.line-card-body {
  margin-top: 0.2rem;
}

.line-card-header h2 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.line-frpa {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-block;
  font-size: 12px;
  padding: 4px 8px;
  background-color: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: 20px;
  color: var(--warning-text);
  font-weight: 600;
}

.line-id {
  bottom: 10px;
}

.line-inner-grid {
  padding: 0.4rem 1rem 0.8rem;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.9rem;
}

.line-map {
  margin-top: 0.2rem;
  min-height: 460px;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.line-notes {
  padding: 0.2rem 1rem 0.9rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.line-notes .line-operator {
  margin-top: 1.1rem;
}

.line-notes ul {
  margin: 0.2rem 0 0.4rem;
  padding-left: 1.1rem;
}

.line-pill {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  margin-left: 0.2rem;
  margin-right: 0.1rem;
  border-radius: 999px;
  background-color: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.line-pill:hover {
  background-color: var(--accent);
  color: var(--text-inverse);
}

.line-route {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.line-separator {
  width: 100%;
  display: block;
  margin: 1.2rem 0;
  text-align: left;
}

.line-separator::after {
  content: "";
  display: block;
  width: 30%;
  border-bottom: 1px solid var(--border-subtle);
}

.line-text {
  margin: 0 0 0.8rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.line-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.1rem;
  color: var(--accent);
}

.line-tile {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-lg);
  background-color: var(--bg-card);
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  border: 1px solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.line-tile:hover {
  border-color: var(--accent);
}

.line-tile,
.line-tile:link,
.line-tile:visited,
.line-tile:hover,
.line-tile:active {
  color: inherit;
  text-decoration: none;
}

.line-tile-left {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.line-tile-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: 60px;
  flex: 1;
  min-width: 0;
}

.line-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.1rem;
  color: var(--accent);
}

.line-validity {
  padding: 0.6rem 1rem 0.3rem;
  text-align: right;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.lines-grid {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 0.8rem;
}

.map-note {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px !important;
  margin-bottom: 0 !important;
  font-size: 12px !important;
  color: var(--text-muted);
}

.map-note-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.map-note-icon svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.map-placeholder {
  margin-top: 0.2rem;
  min-height: 260px;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.marker-cluster {
  width: 20px !important;
  height: 20px !important;
  border-radius: 50% !important;
  background: transparent !important;
}

.marker-cluster div {
  width: 20px !important;
  height: 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: normal !important;
  margin: 0 !important;
  border-radius: 50% !important;
  background-color: var(--accent) !important;
  color: var(--text-inverse) !important;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.35);
}

.marker-cluster span {
  font-size: 10px !important;
  font-weight: 600;
  font-family: 'DM Sans';
  color: var(--text-inverse) !important;
  line-height: 1 !important;
}

.mini-timetable-box {
  border-radius: var(--radius-lg) !important;
  padding: 0.9rem 1.1rem !important;
  box-shadow: var(--shadow-soft) !important;
  border: 1px solid transparent !important;
  margin: 0 !important;
  flex-shrink: 0 !important;
}

.nav-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-links a {
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  color: var(--text-muted);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-links a:hover {
  background-color: var(--accent-soft);
  color: var(--accent);
  transform: none;
}

.nav-links a.active {
  background-color: var(--accent);
  color: var(--text-inverse);
}

.nav-links li {
  margin: 0;
  display: flex;
  align-items: center;
}

.nav-menu {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.theme-toggle-item,
.nav-theme-item {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.25rem;
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 999px;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--text-main);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.nav-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.network-card-body {
  margin-top: 0.5rem;
}

.network-card-header h2 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.network-lines-card,
.network-map-card {
  margin-top: 1.4rem;
  padding: 1.1rem 1.1rem 1.2rem;
}

.network-map-card,
.network-map-card:hover,
.network-lines-card,
.network-lines-card:hover {
  transition: none !important;
  transform: none !important;
  background-color: var(--bg-card) !important;
  box-shadow: var(--shadow-soft) !important;
  cursor: default;
}

.network-lines-subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.no-service-banner {
  margin: 0.4rem 1rem 0.5rem;
  padding: 1rem 1.3rem;
  border-radius: var(--radius-lg);
  background-color: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
  font-size: 0.9rem;
  line-height: 1.5;
}

.no-service-content {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.no-service-content span {
  display: block;
}

.no-service-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: currentColor;
  margin-top: 1px;
}

.operator-block + .operator-block {
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border-subtle);
}

.quick-links {
  margin-bottom: 2rem;
}

.rail-line-card .line-inner-grid {
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.65fr);
}

.rail-line-badge {
  min-width: 2.7rem;
  justify-content: center;
  background: var(--rail-polregio) !important;
  color: #fff !important;
  font-weight: 700;
}

.rail-route-list li {
  display: block;
  position: relative;
  padding-left: 1.35rem;
  margin: 0.2rem 0;
}

.rail-route-list li::before {
  position: absolute;
  top: 0;
  left: 0;
  content: "|";
  color: var(--border-strong);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1;
  transition: color 0.25s ease;
}

.rail-route-list a,
.rail-route-list .rail-stop-outside {
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: normal;
}

.rail-route-list a {
  text-decoration: none;
  transition: color 0.25s ease;
}

.rail-route-list .rail-stop-outside {
  display: inline;
  opacity: 0.65;
}

.rail-route-list ul {
  list-style: none;
  margin: 0.2rem 0 0;
  padding-left: 1.25rem;
}

.rail-route-list li.current-stop-item::before {
  color: var(--accent);
}

.rail-route-list li.current-stop-item > a {
  color: var(--accent);
  font-weight: 600;
}

.rail-route-list li:hover > a,
.rail-route-list li:hover::before {
  color: var(--accent);
}

.rail-timetable-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.rail-timetable-header h3 {
  margin: 0;
}

.rail-date-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-size: 0.86rem;
  cursor: pointer;
  transition: color 0.25s ease;
}

.rail-date-picker:hover {
  color: var(--accent);
}

.rail-date-icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.rail-date-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.rail-date-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.rail-departures {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.rail-departure {
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
  min-width: 4.8rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid color-mix(in srgb, var(--text-main) 18%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-main) 5%, transparent);
  color: var(--text-main);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.rail-departure:hover {
  background: color-mix(in srgb, var(--text-main) 10%, transparent);
  border-color: color-mix(in srgb, var(--text-main) 30%, transparent);
}

.rail-departure-time {
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.rail-departure-note {
  margin-left: 0.12rem;
  color: var(--rail-polregio);
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
}

.rail-no-departures {
  padding: 1rem .5rem;
  text-align: center;
  color: var(--text-main);
  font-size: .9rem;
  opacity: .65;
}

.rail-departure[hidden],
.rail-no-departures[hidden],
.rail-date-today[hidden] {
  display: none;
}

.section-divider {
  border: none;
  height: 1px;
  background-color: var(--text-muted);
  opacity: 0.35;
  margin: 10px 50px;
  border-radius: 2px;
}

.site-footer {
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-soft);
  padding: 1rem 0 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: auto;
}

.site-header {
  background-color: var(--bg-header);
  box-shadow: var(--shadow-soft);
  top: 0;
  z-index: 100;
}

.spacer-box {
  height: 1rem !important;
  flex: 0 0 1rem !important;
  display: block !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}

.stop-details-list {
  list-style: none;
  padding-left: 0;
  margin: 0.3rem 0 0;
}

.stop-details-list a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.86rem;
  transition: color 0.25s ease;
}

.stop-details-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.2rem 0;
}

.stop-details-list li::before {
  content: "|";
  color: var(--border-strong);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1;
  transition: color 0.25s ease;
}

.stop-details-list li.current-stop-item::before {
  color: var(--accent);
}

.stop-details-list li.current-stop-item a {
  color: var(--accent);
  font-weight: 600;
}

.stop-details-list li:hover a,
.stop-details-list li:hover::before {
  color: var(--accent);
}

.stop-expandable {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease;
}

.stop-expandable.is-open {
  max-height: 1000px;
  opacity: 1;
}

.stop-board {
  margin: 1.2rem auto;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  width: 100%;
}

.stop-board.is-open {
  max-height: 1000px;
  opacity: 1;
}

.stop-board-alert {
  align-items: center;
  background: transparent;
  border: 0;
  color: #dc2626;
  cursor: help;
  display: inline-flex;
  flex-shrink: 0;
  justify-content: center;
  left: -0.25rem;
  line-height: 1;
  margin: 0;
  padding: 0;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.stop-board-alert-icon {
  display: block;
  height: 1rem;
  width: 1rem;
}

.stop-board-floating-tooltip {
  background: rgba(17, 24, 39, 0.9);
  border-radius: 0.55rem;
  color: #ffffff;
  font-family: "DM Sans", sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  left: 0;
  line-height: 1.25;
  max-width: min(16rem, calc(100vw - 1rem));
  opacity: 0;
  padding: 0.45rem 0.65rem;
  pointer-events: none;
  position: fixed;
  text-align: center;
  top: 0;
  transform: translateY(0.25rem);
  transition: opacity 0.15s ease, transform 0.15s ease;
  visibility: hidden;
  width: max-content;
  z-index: 9999;
}

.stop-board-floating-tooltip::after {
  border-color: rgba(17, 24, 39, 0.9) transparent transparent transparent;
  border-style: solid;
  border-width: 0.35rem 0.35rem 0 0.35rem;
  content: "";
  left: var(--tooltip-arrow-left, 50%);
  position: absolute;
  top: 100%;
  transform: translateX(-50%);
}

.stop-board-floating-tooltip.is-below::after {
  border-color: transparent transparent rgba(17, 24, 39, 0.9) transparent;
  border-width: 0 0.35rem 0.35rem 0.35rem;
  bottom: 100%;
  top: auto;
}

.stop-board-floating-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

body.dark-mode .stop-board-floating-tooltip,
[data-theme="dark"] .stop-board-floating-tooltip {
  background: rgba(255, 255, 255, 0.9);
  color: #111827;
}

body.dark-mode .stop-board-floating-tooltip::after,
[data-theme="dark"] .stop-board-floating-tooltip::after {
  border-color: rgba(255, 255, 255, 0.9) transparent transparent transparent;
}

body.dark-mode .stop-board-floating-tooltip.is-below::after,
[data-theme="dark"] .stop-board-floating-tooltip.is-below::after {
  border-color: transparent transparent rgba(255, 255, 255, 0.9) transparent;
}

.stop-board-card {
  background: var(--bg-card);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  box-sizing: border-box;
  margin: 0;
  max-width: none;
  padding: 0.9rem 1.1rem;
  width: 100%;
}

.stop-board-card,
.stop-board-card:hover {
  background-color: var(--bg-card) !important;
  box-shadow: var(--shadow-soft) !important;
  cursor: default !important;
  transform: none !important;
  transition: none !important;
}

.stop-board-direction {
  color: var(--text-main);
  min-width: 0;
  overflow: hidden;
  text-align: left;
  white-space: nowrap;
  position: relative;
}

.stop-board-direction-text {
  display: inline-block;
  white-space: nowrap;
  will-change: transform;
}

.stop-board-direction.is-marquee .stop-board-direction-text {
  animation: stopBoardMarquee var(--marquee-duration, 10s) linear infinite;
  padding-left: 100%;
}

.stop-board-empty {
  align-items: flex-start;
  color: var(--text-muted);
  display: flex;
  gap: 0.65rem;
}

.stop-board-empty svg {
  flex: 0 0 auto;
  height: 22px;
  margin-top: 0.1rem;
  width: 22px;
}

.stop-board-line {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-align: left;
  white-space: nowrap;
}

.stop-board-list {
  display: flex;
  flex-direction: column;
}

.stop-board-now {
  display: inline-flex;
  font-weight: 700;
  gap: 2px;
  letter-spacing: 0.5px;
}

.stop-board-now span {
  animation: stopBoardPulse 900ms ease-in-out infinite;
  opacity: 0.15;
}

.stop-board-now span:nth-child(2) {
  animation-delay: 150ms;
}

.stop-board-now span:nth-child(3) {
  animation-delay: 300ms;
}

.stop-board-row {
  align-items: center;
  display: grid;
  gap: 0.6rem;
  grid-template-columns: 1.25rem 1fr 5.6rem;
  padding: 0.15rem 0;
}

.stop-board-row + .stop-board-row {
  border-top: 1px solid var(--border-subtle);
}

.stop-board-time {
  align-items: center;
  color: var(--text-main);
  display: flex;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  justify-content: flex-end;
  position: relative;
  text-align: right;
  white-space: nowrap;
}

.stop-fav-btn,
.stop-board-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background-color: var(--bg-muted);
  color: var(--text-soft);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.stop-fav-btn .material-icon,
.stop-board-btn .material-icon {
  width: 20px;
  height: 20px;
}

.stop-fav-btn:hover,
.stop-board-btn:hover {
  background-color: var(--accent);
  color: var(--text-inverse);
}

.stop-fav-btn.is-active,
.stop-board-btn.is-active {
  background-color: var(--accent-soft);
  color: var(--accent);
}

.stop-fav-btn.is-active:hover,
.stop-board-btn.is-active:hover {
  background-color: var(--accent);
  color: var(--text-inverse);
}

.stop-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stop-header-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  color: var(--text-main);
}

.stop-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

.stop-icon-wrapper {
}

.stop-lines {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stop-line-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background-color: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
}

.stop-line-body {
  border-top: 1px solid var(--border-subtle);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

.stop-line-card {
  padding: 0;
}

.stop-line-card,
.stop-line-card:hover {
  transition: none !important;
  transform: none !important;
  background-color: var(--bg-card) !important;
  box-shadow: var(--shadow-soft) !important;
  cursor: default;
}

.stop-line-card.open .stop-line-icon {
  transform: rotate(180deg);
}

.stop-line-direction {
  font-size: 0.9rem;
  min-width: 0;
  text-align: left;
}

.stop-line-header {
  margin: 0;
}

.stop-line-icon {
  font-size: 0.9rem;
  transition: transform 0.25s ease;
  margin-left: auto;
  flex: 0 0 auto;
}

.stop-line-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.stop-line-toggle {
  width: 100%;
  padding: 0.8rem 1rem;
  border: none;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  font: inherit;
}

.stop-ref {
  text-decoration: none;
  color: var(--accent);
}

.stop-served-lines {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.stop-served-lines .stop-line-chips {
  margin-left: 0.3rem;
}

.stop-served-lines .chip {
  font-size: 0.85rem;
}

.stop-tooltip-inner {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 8px 10px;
  box-shadow: var(--shadow-popup);
  border: 1px solid var(--border-subtle);
  font-family: 'DM Sans';
}

.stop-tooltip-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: var(--accent);
}

.stop-tooltip-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.stop-tooltip-row {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.stop-tooltip-subtitle {
  margin-top: 1px;
  font-size: 10px;
  color: var(--text-muted);
}

.stops-column h3 {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.stops-column h3 b {
  font-weight: 800;
}

.stops-column li {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.3rem;
}

.stops-column ul {
  margin: 0;
  padding-left: 1rem;
}

.stops-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
  margin-top: 0.5rem;
}

.stops-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.stops-list a {
  text-decoration: none;
  color: var(--text-muted);
  transition: color 0.25s ease;
}

.stops-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.25rem 0;
}

.stops-list li::before {
  content: "|";
  color: var(--border-strong);
  font-weight: 300;
  font-size: 1.3rem;
  line-height: 1;
  transition: color 0.25s ease;
}

.stops-list li:hover a,
.stops-list li:hover::before {
  color: var(--accent);
  font-weight: 500;
}

.table-header-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background-color: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.8rem;
}

.table-header-badge {
  transition: background-color 0.25s ease, color 0.25s ease;
}

.table-header-link {
  text-decoration: none;
  cursor: pointer;
}

.table-header-link:hover .table-header-badge {
  background-color: var(--accent);
  color: var(--text-inverse);
}

.table-wrapper {
  margin: 0.6rem 0 1.4rem;
  overflow-x: auto;
}

.theme-toggle {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 76px;
  height: 40px;
  padding: 3px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition:
    background-color 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.theme-toggle:focus-visible {
  box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-soft);
}

.theme-toggle-indicator {
  position: absolute;
  top: 3px;
  left: 3px;
  z-index: 0;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(37, 99, 235, 0.35);
  border-radius: 999px;
  background: var(--accent-soft);
  transform: translateX(0);
  transition:
    transform 0.28s ease,
    background-color 0.25s ease,
    border-color 0.25s ease;
}

html[data-theme="dark"] .theme-toggle-indicator,
.theme-toggle[data-theme-current="dark"] .theme-toggle-indicator {
  transform: translateX(36px);
}

html[data-theme="dark"] .theme-toggle-indicator {
  border-color: rgba(96, 165, 250, 0.45);
}

.theme-toggle-option {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--text-muted);
  transition: color 0.25s ease, transform 0.25s ease;
}

.theme-toggle-option svg {
  display: block;
  width: 18px;
  height: 18px;
}

html[data-theme="light"] .theme-toggle-option:first-of-type,
html[data-theme="dark"] .theme-toggle-option:last-of-type,
.theme-toggle[data-theme-current="light"] .theme-toggle-option:first-of-type,
.theme-toggle[data-theme-current="dark"] .theme-toggle-option:last-of-type {
  color: var(--accent);
  transform: scale(1.04);
}

.timetable-body {
  border-top: 1px solid var(--border-subtle);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

.timetable-box {
  border: 1px solid transparent;
}

.timetable-box.timetable-active {
  border-color: var(--accent);
}

.timetable-card {
  margin-top: 1.2rem;
  padding: 0;
  transition: none !important;
}

.timetable-card:hover {
  background-color: var(--bg-card) !important;
  transform: none !important;
  box-shadow: var(--shadow-soft) !important;
  cursor: default !important;
}

.timetable-card.open .timetable-icon {
  transform: rotate(180deg);
}

.timetable-header {
  margin: 0;
}

.timetable-header-text h2 {
  margin: 0;
  font-size: 1.05rem;
}

.timetable-header-text p {
  margin: 0.2rem 0 0;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.timetable-hint {
  margin: 0 0 0.7rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.timetable-icon {
  font-size: 0.9rem;
  margin-top: 0.2rem;
  transition: transform 0.25s ease;
}

.timetable-inner {
  padding: 0.8rem 1rem 1rem;
}

.timetable-toggle {
  width: 100%;
  padding: 0.8rem 1rem;
  border: none;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  font: inherit;
}

.transfer-info {
  margin-top: 0rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.transfer-link {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: currentColor;
  text-underline-offset: 3px;
  transition: color 0.25s ease, text-decoration-color 0.25s ease;
}

.transfer-link:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.updates h2,
.quick-links h2 {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
}

.update-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-soft);
  transition: background-color 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.update-card-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.update-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 16px 16px 14px;
}

.update-card-date {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
}

.update-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.update-card-lead {
  margin: 0 0 16px;
  color: var(--text-soft);
  font-size: 0.97rem;
  line-height: 1.5;
}

.update-card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--bg-muted);
  color: var(--text-soft);
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease,
    opacity 0.2s ease;
}

.update-card-link:focus-visible {
  background: var(--accent);
  color: var(--text-inverse);
  transform: translateX(2px);
  opacity: 0.92;
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.update-card-link svg {
  display: block;
  width: 20px;
  height: 20px;
}

.update-card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-muted);
}

.update-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.update-card-title {
  margin: 0 0 10px;
  color: var(--text-main);
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.3;
}

.update-card-title a {
  color: inherit;
  text-decoration: none;
}

.update-card-title a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.updates {
  margin-top: 32px;
}

.updates-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.updates-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.updates-hidden {
  display: none !important;
}

.card,
.stop-line-card,
.fare-main,
.network-map-card,
.network-lines-card,
.line-card,
.timetable-card {
  width: 100%;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}



button,
input,
textarea {
  color: var(--text-main);
}

input,
textarea {
  caret-color: var(--accent);
}

::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

html[data-theme="dark"] img {
  color-scheme: normal;
}

html[data-theme="dark"] .leaflet-control-container .leaflet-control,
html[data-theme="dark"] .leaflet-control-container .leaflet-bar a {
  background-color: var(--bg-card);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

html[data-theme="dark"] .leaflet-control-container .leaflet-bar a:hover {
  background-color: var(--bg-card-hover);
}

.course-link.tour-cancelled-course,
.course-link.tour-cancelled-course:hover,
.course-link.tour-cancelled-course:active,
.course-link.tour-cancelled-course:visited {
  background: transparent;
  color: #dc2626;
  font-weight: 500;
  text-decoration-line: line-through;
  text-decoration-style: solid;
  text-decoration-color: currentColor;
  text-decoration-thickness: 1.5px;
}

html[data-theme="dark"] .course-link.tour-cancelled-course,
html[data-theme="dark"] .course-link.tour-cancelled-course:hover,
html[data-theme="dark"] .course-link.tour-cancelled-course:active,
html[data-theme="dark"] .course-link.tour-cancelled-course:visited {
  color: #f87171;
}

.course-cancellation-info {
  align-items: center;
  background: transparent;
  border: 0;
  color: #dc2626;
  cursor: help;
  display: inline-flex;
  height: 1rem;
  justify-content: center;
  margin: 0 0.1rem 0 0.15rem;
  padding: 0;
  vertical-align: -0.15rem;
  width: 1rem;
}

.course-cancellation-info:focus-visible {
  border-radius: 50%;
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.course-cancellation-info-icon {
  display: block;
  height: 1rem;
  width: 1rem;
}

html[data-theme="dark"] .course-cancellation-info {
  color: #f87171;
}

.course-cancellation-floating-tooltip {
  background: rgba(17, 24, 39, 0.9);
  border-radius: 0.55rem;
  color: #ffffff;
  font-family: "DM Sans", sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  left: 0;
  line-height: 1.25;
  max-width: min(16rem, calc(100vw - 1rem));
  opacity: 0;
  padding: 0.45rem 0.65rem;
  pointer-events: none;
  position: fixed;
  text-align: center;
  top: 0;
  transform: translateY(0.25rem);
  transition: opacity 0.15s ease, transform 0.15s ease;
  visibility: hidden;
  width: max-content;
  z-index: 9999;
}

.course-cancellation-floating-tooltip::after {
  border-color: rgba(17, 24, 39, 0.9) transparent transparent transparent;
  border-style: solid;
  border-width: 0.35rem 0.35rem 0 0.35rem;
  content: "";
  left: var(--tooltip-arrow-left, 50%);
  position: absolute;
  top: 100%;
  transform: translateX(-50%);
}

.course-cancellation-floating-tooltip.is-below::after {
  border-color: transparent transparent rgba(17, 24, 39, 0.9) transparent;
  border-width: 0 0.35rem 0.35rem 0.35rem;
  bottom: 100%;
  top: auto;
}

.course-cancellation-floating-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

html[data-theme="dark"] .course-cancellation-floating-tooltip {
  background: rgba(255, 255, 255, 0.9);
  color: #111827;
}

html[data-theme="dark"] .course-cancellation-floating-tooltip::after {
  border-color: rgba(255, 255, 255, 0.9) transparent transparent transparent;
}

html[data-theme="dark"] .course-cancellation-floating-tooltip.is-below::after {
  border-color: transparent transparent rgba(255, 255, 255, 0.9) transparent;
}

@keyframes stopBoardMarquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

@keyframes stopBoardPulse {
  0% { opacity: 0.15; }
  50% { opacity: 1; }
  100% { opacity: 0.15; }
}

@media (max-width: 900px) {
  .discount-card {
    grid-template-columns: 20% 80%;
  }
}

@media (max-width: 640px) {
  .discount-card {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .discount-left {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
  }
}

@media (max-width: 480px) {
  .line-tile {
    flex-direction: row;
    align-items: flex-start;
  }

  .line-tile-left {
    font-size: 1.5rem;
    min-width: 2.4rem;
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 1.4rem 1.2rem;
  }

  .hero h1 {
    font-size: 1.35rem;
  }

  .brand-title {
    font-size: 0.85rem;
  }

  .brand-subtitle {
    font-size: 0.75rem;
  }
}

@media (max-width: 600px) {
  .timetable-toggle {
    padding: 0.7rem 0.8rem;
  }

  .timetable-inner {
    padding: 0.7rem 0.8rem 0.9rem;
  }

  .chip {
    font-size: 0.9rem;
    padding: 0.4rem 1rem;
  }
}

@media (max-width: 700px) {
  .stops-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .nav-links {
    position: absolute;
    right: 1rem;
    top: 60px;
    flex-direction: column;
    align-items: stretch;
    background-color: var(--bg-header);
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    display: none;
    min-width: 170px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }

  .nav-links {
    position: static;
    flex-direction: row;
    box-shadow: none;
    background: transparent;
  }
}

@media (max-width: 900px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .line-inner-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 900px) {
  .stop-board {
    width: 40%;
  }
}

@media (max-width: 600px) {
  .rail-date-nav {
    grid-template-columns: 2.25rem minmax(0, 1fr) 2.25rem;
  }

  .rail-date-picker {
    padding: .4rem .5rem;
  }

  .rail-date-text strong {
    font-size: .9rem;
  }

  .rail-departures {
    gap: .4rem;
  }

  .rail-departure {
    min-width: 4.5rem;
    padding: .5rem .6rem;
  }
  
  .stop-board-card {
    padding: 0.75rem 0.85rem;
  }

  .stop-board-row {
    gap: 0.55rem;
    grid-template-columns: 2rem 1fr 5.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stop-board-direction.is-marquee .stop-board-direction-text {
    animation: none;
    padding-left: 0;
  }
}

@media (hover: hover) and (pointer: fine) {
  .update-card:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
  }

  .update-card:hover .update-card-link {
    background: var(--accent);
    color: var(--text-inverse);
  }

  .update-card-link:hover {
    background: var(--accent);
    color: var(--text-inverse);
    transform: translateX(2px);
    opacity: 0.92;
  }

  .update-card-title a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}

@media (max-width: 1024px) {
  .updates-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
}

@media (max-width: 640px) {
  .updates {
    margin-top: 24px;
  }

  .updates-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .updates-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
  }

  .update-card {
    min-height: auto;
    border-radius: 16px;
  }

  .update-card-body {
    padding: 14px;
  }

  .update-card-title {
    margin-bottom: 8px;
    font-size: 1rem;
    line-height: 1.35;
  }

  .update-card-lead {
    margin-bottom: 14px;
    font-size: 0.94rem;
    line-height: 1.45;
  }

  .update-card-date {
    margin-bottom: 8px;
    font-size: 0.86rem;
  }

  .update-card-footer {
    gap: 10px;
  }

  .update-card-badge {
    font-size: 0.74rem;
    white-space: normal;
  }

  .update-card-link {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
  }

  .update-card-media {
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 767px) {
  .theme-toggle-item,
  .nav-theme-item {
    width: 100%;
    justify-content: center;
    margin-left: 0;
    margin-top: 0.35rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-subtle);
  }

  .theme-toggle {
    width: 82px;
    box-shadow: none;
  }

  html[data-theme="dark"] .theme-toggle-indicator,
  .theme-toggle[data-theme-current="dark"] .theme-toggle-indicator {
    transform: translateX(42px);
  }
}

@media (max-width: 380px) {
  .update-card-body {
    padding: 12px;
  }

  .update-card-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .update-card-link {
    align-self: flex-end;
  }
}

@media (max-width: 767px) {
  .stop-board-alert {
    left: -0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle,
  .theme-toggle-indicator,
  .theme-toggle-option {
    transition: none;
  }
}

@media (max-width: 800px) {
  .rail-line-card .line-inner-grid {
    grid-template-columns: 1fr;
  }
}