/* Reusable UI components: buttons, badges, tables, cards, boxes, toast */

/* ── Search button ───────────────────────────────────────────────────────── */

.btn-search {
  background: var(--c-blue);
  color: var(--c-white);
  border: none;
  padding: 12px 40px;
  border-radius: var(--r-pill);
  font-size: 17px;
  font-weight: 600;
  transition: all var(--t);
}

.btn-search:hover {
  background: var(--c-blue-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(13, 110, 253, 0.35);
}

.btn-search:active { transform: scale(0.98); }

.btn-search:focus-visible {
  outline: 2px solid var(--c-white);
  outline-offset: 3px;
}

/* ── Route label chip ────────────────────────────────────────────────────── */

.route-label {
  display: inline-block;
  background: var(--c-tag-bg);
  color: #333;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  margin: 20px 0 10px;
}

/* ── Next-bus info box ───────────────────────────────────────────────────── */

.next-bus-box {
  display: none; /* shown by renderNextBusBox when date is today */
  background: linear-gradient(135deg, var(--c-navy-dark), var(--c-blue));
  color: var(--c-white);
  padding: var(--sp-xl);
  border-radius: var(--r-xl);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.next-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-sm);
}

.next-label {
  font-size: 18px;
  letter-spacing: 3px;
  opacity: 0.8;
}

.next-bus-name {
  font-size: 35px;
  font-weight: 700;
  margin-top: 10px;
}

.next-bus-number {
  font-size: 16px;
  opacity: 0.85;
  margin-top: 4px;
}

.next-bus-type {
  display: inline-block;
  padding: 4px 14px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.15);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.next-bus-time {
  font-size: 32px;
  color: var(--c-yellow);
  margin-top: 10px;
}

.next-countdown {
  margin-top: 15px;
  font-size: 20px;
}

/* ── In-results service-type filter ──────────────────────────────────────── */

.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-sm);
  margin: var(--sp-md) 0 0;
}

.type-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
}

.type-filter-btn {
  display: inline-block;
  padding: 6px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--c-border);
  background: var(--c-white);
  color: var(--c-text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--t);
}

.type-filter-btn:hover { background: var(--c-bg-hover); }

.type-filter-btn.active {
  border-color: transparent;
  background: var(--c-navy);
  color: var(--c-white);
}

.type-filter-btn.active[data-type="normal"] { background: var(--c-type-normal-text); }
.type-filter-btn.active[data-type="ctb"]    { background: var(--c-type-ctb-text); }
.type-filter-btn.active[data-type="semi"]   { background: var(--c-type-semi-text); }
.type-filter-btn.active[data-type="ac"]     { background: var(--c-type-ac-text); }

.type-filter-btn:focus-visible {
  outline: 2px solid var(--c-navy);
  outline-offset: 2px;
}

.jump-now-btn[hidden] { display: none; }

.jump-now-btn {
  margin-left: auto; /* stay at the toolbar's trailing edge even if .type-filter is hidden */
  display: inline-block;
  padding: 6px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--c-navy);
  background: transparent;
  color: var(--c-navy);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--t);
}

.jump-now-btn:hover {
  background: var(--c-navy);
  color: var(--c-white);
}

.jump-now-btn:focus-visible {
  outline: 2px solid var(--c-navy);
  outline-offset: 2px;
}

/* ── Schedule table ──────────────────────────────────────────────────────── */

.schedule-table {
  background: var(--c-white);
  border-radius: var(--r-lg);
  overflow-x: auto;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  margin-top: var(--sp-md);
}

.schedule-table table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.schedule-table thead {
  background: var(--c-navy-dark);
  color: var(--c-white);
}

.schedule-table th {
  padding: 20px;
  font-size: 18px;
  font-weight: 600;
  text-align: left;
}

.schedule-table td {
  padding: 6px 20px;
  vertical-align: middle;
  font-size: 16px;
  border-bottom: 1px solid var(--c-border);
}

.schedule-table tbody tr:last-child td { border-bottom: none; }

.schedule-table tbody tr { transition: background var(--t); }
.schedule-table tbody tr:hover { background: var(--c-bg-hover); }

/* Routes with only one service type (see DIRECTIONS' showServiceType in config.js)
   hide the Type column entirely — it never carries useful information there. */
.schedule-table.no-type-column th:nth-child(3),
.schedule-table.no-type-column td:nth-child(3) { display: none; }

/* Highlight the row for the upcoming "NEXT BUS" — soft wash of the brand orange */
.schedule-table tbody tr.row--next { background: rgba(255, 107, 0, 0.08); }
.schedule-table tbody tr.row--next:hover { background: rgba(255, 107, 0, 0.14); }

.bus-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--c-bus-name);
  line-height: 1.2;
}

.bus-number {
  font-size: 14px;
  color: var(--c-text-muted);
  margin-top: 4px;
  font-weight: 500;
}

.departure-time { font-weight: 500; }

.type-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.type-badge--normal { background: var(--c-type-normal-bg); color: var(--c-type-normal-text); }
.type-badge--ctb     { background: var(--c-type-ctb-bg);    color: var(--c-type-ctb-text); }
.type-badge--semi    { background: var(--c-type-semi-bg);   color: var(--c-type-semi-text); }
.type-badge--ac      { background: var(--c-type-ac-bg);     color: var(--c-type-ac-text); }

/* Reserve height while data is loading to reduce footer CLS (schedule table
   grows from this baseline to full height, rather than from ~50px). */
.schedule-table.is-loading { min-height: 400px; }

/* Reserve a row of height for the type-filter before buttons are populated,
   so the schedule table doesn't shift when buttons appear after data loads. */
.type-filter { min-height: 36px; }

/* Empty / error / loading states inside tbody */
.schedule-empty,
.schedule-error,
.schedule-loading {
  text-align: center;
  padding: 24px;
  color: var(--c-text-muted);
  font-size: 15px;
}

.schedule-error { color: #842029; }

.retry-btn {
  display: inline-block;
  margin-top: var(--sp-sm);
  margin-left: var(--sp-sm);
  padding: 6px 16px;
  background: var(--c-navy);
  color: var(--c-white);
  border: none;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t);
}

.retry-btn:hover { background: var(--c-navy-dark); }

/* ── Status badges ───────────────────────────────────────────────────────── */

.status-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.badge--next      { background: var(--c-badge-next-bg);       color: var(--c-badge-next-text); }
.badge--upcoming  { background: var(--c-badge-upcoming-bg);   color: var(--c-badge-upcoming-text); }
.badge--scheduled { background: var(--c-badge-scheduled-bg);  color: var(--c-badge-scheduled-text); }
.badge--departed  { background: var(--c-badge-departed-bg);   color: var(--c-badge-departed-text); }

/* ── Availability Column & Header ────────────────────────────────────────── */

.route-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0 10px;
}

.route-header-row .route-label {
  margin: 0;
}

.availability-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-white);
  background: var(--c-navy);
  padding: 6px 14px;
  border-radius: var(--r-pill);
}

.avail-content {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.avail-text-group {
  display: inline-flex;
  gap: 4px;
}

.avail-percent,
.avail-status {
  font-size: 12px;
  font-weight: 600;
}

.avail-status {
  text-transform: uppercase;
}

/* Middot separator between percentage and label — only when both are present */
.avail-content:not(.avail-departed):not(.avail-scheduled) .avail-status::before {
  content: '· ';
  opacity: 0.55;
}

/* Availability Theme Alignment — flat pastel pills matching .type-badge */
.avail-content.avail-green     { background: var(--c-avail-high-bg);      color: var(--c-avail-high-text); }
.avail-content.avail-orange    { background: var(--c-avail-mid-bg);       color: var(--c-avail-mid-text); }
.avail-content.avail-red       { background: var(--c-avail-low-bg);       color: var(--c-avail-low-text); }
.avail-content.avail-departed,
.avail-content.avail-scheduled { background: var(--c-avail-departed-bg); color: var(--c-avail-departed-text); }

/* ── Site-wide entry notice (popup) ──────────────────────────────────────── */

.notice-overlay {
  position: fixed;
  inset: 0;
  z-index: 1060;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  padding: var(--sp-md);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t);
}

.notice-overlay.open {
  opacity: 1;
  visibility: visible;
}

.notice-modal {
  background: var(--c-white);
  border-radius: var(--r-md);
  border-top: 4px solid var(--c-blue);
  box-shadow: var(--shadow-lg);
  max-width: 440px;
  width: 100%;
  padding: var(--sp-lg) var(--sp-md);
  text-align: center;
  transform: scale(0.95);
  transition: transform var(--t);
}

.notice-overlay.open .notice-modal {
  transform: scale(1);
}

.notice-modal-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #d00000;
  margin-bottom: var(--sp-sm);
}

.notice-modal-text {
  font-size: 0.9rem;
  color: #000;
  line-height: 1.9;
  margin-bottom: var(--sp-lg);
}

.notice-modal-text p {
  margin: 0 0 var(--sp-sm);
}

.notice-modal-text p:last-child {
  margin-bottom: 0;
}

/* ── About cards ─────────────────────────────────────────────────────────── */

.about-section {
  padding: 80px 0;
  background: var(--c-bg-light);
}

.about-text {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  font-size: 18px;
  color: #555;
  line-height: 1.7;
}

.contact-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-lg);
  margin-top: var(--sp-xl);
  justify-content: center;
}

.contact-card {
  flex: 1 1 200px;
  max-width: 280px;
  background: var(--c-white);
  padding: 30px;
  border-radius: var(--r-md);
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: transform var(--t);
}

.contact-card:hover { transform: translateY(-5px); }

.contact-card h4 { margin-bottom: 15px; }

.contact-card a {
  text-decoration: none;
  font-weight: 600;
  color: var(--c-blue);
}

.contact-card-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 15px;
}

.contact-card-header h4 { margin: 0; }

.about-version {
  text-align: center;
  margin-top: var(--sp-lg);
  font-size: 0.85rem;
  color: var(--c-text-muted);
}

/* ── Contact page ─────────────────────────────────────────────────────────── */

.contact-section {
  padding: var(--sp-2xl) 0;
}

.contact-section-heading {
  margin-top: var(--sp-2xl);
}

.contact-card-form {
  max-width: 700px;
  margin: var(--sp-lg) auto 0;
  background: var(--c-white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: var(--sp-lg);
}

.contact-field {
  margin-bottom: var(--sp-md);
}

.contact-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin: 0 0 var(--sp-sm);
}

.contact-control {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-bg-light);
  color: var(--c-text);
  font-family: inherit;
  font-size: 15px;
  transition: border-color var(--t), box-shadow var(--t);
}

.contact-textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-control:focus {
  border-color: var(--c-blue);
  box-shadow: 0 0 0 3px var(--c-blue-ring);
  outline: none;
}

.contact-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form-msg {
  min-height: 1.2em;
  margin: var(--sp-md) 0 0;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.contact-form-msg--ok {
  color: var(--c-badge-next-text);
}

.contact-form-msg--err {
  color: var(--c-badge-departed-text);
}

/* ── Ticket prices page header band ──────────────────────────────────────── */

.page-hero {
  background: linear-gradient(135deg, var(--c-navy-dark), var(--c-blue));
  border-bottom: 4px solid var(--c-blue-light);
  padding: var(--sp-2xl) 0;
  text-align: center;
}

.page-hero-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  margin-bottom: var(--sp-md);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.page-hero-icon {
  display: block;
  margin: 0;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.page-hero-title {
  color: var(--c-white);
  font-size: 2rem;
  font-weight: 800;
}

.page-hero-sub {
  color: rgba(255, 255, 255, 0.8);
  margin-top: var(--sp-sm);
  font-size: 1rem;
}

.page-hero-sub strong { color: var(--c-white); }

/* ── Ticket price selector ───────────────────────────────────────────────── */

.fare-intro {
  color: #666;
  margin-bottom: var(--sp-sm);
}

.fare-card {
  max-width: 700px;
  margin: var(--sp-lg) auto 0;
  background: var(--c-white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: var(--sp-lg);
}

/* Service-type tabs — bigger and bordered from the inputs below */
.fare-card .type-filter {
  display: flex;
  justify-content: center;
  gap: var(--sp-sm);
  padding-bottom: var(--sp-md);
  margin-bottom: var(--sp-md);
  border-bottom: 1px solid var(--c-border);
}

.fare-card .type-filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  font-size: 14px;
  border-radius: var(--r-pill);
  background: var(--c-bg);
  border-color: transparent;
}

.fare-card .type-filter-btn.active,
.fare-card .type-filter-btn.active[data-type="normal"],
.fare-card .type-filter-btn.active[data-type="semi"],
.fare-card .type-filter-btn.active[data-type="ac"] {
  background: var(--c-navy-dark);
  color: var(--c-white);
}

/* Search route inputs */

.fare-search-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin: 0 0 var(--sp-sm);
}

.fare-inputs-row {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.fare-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.fare-pin-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--c-navy);
  pointer-events: none;
  z-index: 1;
}

.fare-control {
  width: 100%;
  height: 48px;
  padding: 8px 36px 8px 34px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-bg-light) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--c-text);
  font-family: inherit;
  font-size: 15px;
  appearance: none;
  transition: border-color var(--t), box-shadow var(--t);
}

/* Text inputs (combobox) — remove the dropdown-arrow background */
input.fare-control {
  background-image: none;
  padding-right: 14px;
}

.fare-control:focus {
  border-color: var(--c-blue);
  box-shadow: 0 0 0 3px var(--c-blue-ring);
  outline: none;
}

.fare-swap-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--c-navy-dark);
  color: var(--c-white);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--t), transform var(--t);
}

.fare-swap-btn:hover {
  background: var(--c-navy);
  transform: rotate(180deg);
}

.fare-swap-btn:focus-visible {
  outline: 2px solid var(--c-blue);
  outline-offset: 2px;
}

/* Search Fare button */

.fare-search-btn {
  display: block;
  width: 100%;
  max-width: 220px;
  margin: var(--sp-lg) auto 0;
  padding: 12px 32px;
  background: var(--c-blue);
  color: var(--c-white);
  border: none;
  border-radius: var(--r-pill);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t);
}

.fare-search-btn:hover {
  background: var(--c-blue-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(13, 110, 253, 0.3);
}

.fare-search-btn:active { transform: scale(0.98); }

.fare-search-btn:focus-visible {
  outline: 2px solid var(--c-blue-hover);
  outline-offset: 3px;
}

/* Fare result area */

.fare-result-area {
  margin-top: var(--sp-md);
}

.fare-error-msg {
  text-align: center;
  font-size: 14px;
  color: var(--c-badge-departed-text);
  padding: var(--sp-sm) var(--sp-md);
  margin: 0;
}

.fare-error-msg.booking-loading-msg {
  color: var(--c-text-muted);
}

/* Suggestion dropdown */

.fare-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-md);
  list-style: none;
  margin: 0;
  padding: var(--sp-xs) 0;
  max-height: 240px;
  overflow-y: auto;
}

.fare-suggestion {
  padding: 9px 14px 9px 34px;
  cursor: pointer;
  font-size: 14px;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background var(--t), color var(--t);
}

.fare-suggestion:hover,
.fare-suggestion.active {
  background: var(--c-bg-hover);
  color: var(--c-navy);
}

@keyframes ticketPopup {
  0% { opacity: 0; transform: translateY(20px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.fare-result-card {
  display: flex;
  flex-direction: row;
  background: #ffffff;
  border-radius: 16px;
  margin: var(--sp-lg) auto;
  max-width: 820px;
  width: 100%;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.08);
  animation: ticketPopup 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  border: 1px solid var(--c-border);
  overflow: hidden;
}

/* Left Accent Bar (Blue Stub) */
.ticket-accent-bar {
  width: 68px;
  background: #2563eb;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  position: relative;
  border-right: 1px solid #1d4ed8;
  mask-image: radial-gradient(circle at 0px 10px, transparent 6px, #000 6.5px);
  mask-size: 100% 20px;
  -webkit-mask-image: radial-gradient(circle at 0px 10px, transparent 6px, #000 6.5px);
  -webkit-mask-size: 100% 20px;
}

.ticket-accent-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.ticket-accent-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #ffffff;
  margin-top: 16px;
}

/* Main Ticket Body */
.ticket-main {
  flex: 1;
  background: #ffffff;
  padding: 28px 36px;
  display: flex;
  flex-direction: column;
}

.ticket-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.fare-oneway-badge {
  background: #e0f2fe;
  color: #0284c7;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  text-transform: uppercase;
}

.fare-route-heading {
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px 0;
  letter-spacing: -0.5px;
}

.fare-svc-label {
  font-size: 0.95rem;
  color: #64748b;
  margin: 0 0 28px 0;
}

.ticket-stops-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.fare-stop-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fare-stop-meta {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #2563eb;
}

.fare-stop-value {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fare-stop-pin {
  color: #0f172a;
  flex-shrink: 0;
}

.fare-stop-name {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.ticket-meta-divider {
  border: 0;
  border-top: 2px dotted #cbd5e1;
  margin: 28px 0 24px 0;
  width: 100%;
}

.ticket-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.ticket-meta-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ticket-meta-icon {
  color: #64748b;
  flex-shrink: 0;
}

.ticket-meta-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ticket-meta-label {
  font-size: 12px;
  color: #64748b;
}

.ticket-meta-val {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

/* Perforated Divider & Cutouts */
.ticket-divider {
  width: 2px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  z-index: 1;
}

.ticket-perforation {
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 0;
  width: 2px;
  border-left: 2px dashed #cbd5e1;
}

.ticket-notch {
  width: 28px;
  height: 14px;
  background: var(--c-bg, #f8fafc);
  position: absolute;
  left: -13px;
  z-index: 2;
  border: 1px solid var(--c-border);
}

.ticket-notch-top {
  top: 0;
  border-bottom-left-radius: 28px;
  border-bottom-right-radius: 28px;
  border-top: none;
}

.ticket-notch-bottom {
  bottom: 0;
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  border-bottom: none;
}

/* Ticket Stub (Price & Illustration) */
.ticket-stub {
  width: 205px;
  background: #ffffff;
  padding: 32px 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
}

.ticket-price-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.fare-price-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #0284c7;
  margin-bottom: 4px;
}

.fare-price-amount {
  font-size: 2.25rem;
  font-weight: 800;
  color: #0284c7;
  line-height: 1.1;
}

.fare-price-per {
  font-size: 13px;
  color: #64748b;
}

.ticket-stub-divider {
  border: 0;
  border-top: 1px solid #e2e8f0;
  width: 100%;
  margin: 20px 0;
}

.ticket-stub-illustration {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Info notices */

.fare-notices {
  margin-top: var(--sp-md);
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

.fare-notice {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-sm);
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: 0.78rem;
  line-height: 1.5;
}

.fare-notice-icon { flex-shrink: 0; margin-top: 1px; }

.fare-notice--warn {
  background: #fffbeb;
  border-left: 3px solid var(--c-amber);
  color: #78350f;
}

.fare-notice--info {
  background: #f0fdf4;
  border-left: 3px solid #16a34a;
  color: #14532d;
}

/* ── Fare service-type guide ─────────────────────────────────────────────── */

.fare-guide-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-lg);
  justify-content: center;
}

.fare-guide-card {
  flex: 1 1 220px;
  max-width: 320px;
  background: var(--c-white);
  padding: var(--sp-lg);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: transform var(--t);
}

.fare-guide-card:hover { transform: translateY(-5px); }

.fare-guide-card .type-badge {
  margin-bottom: var(--sp-sm);
}

.fare-guide-card p {
  margin-top: var(--sp-sm);
  color: #555;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ── Fare cross-link CTA ──────────────────────────────────────────────────── */

.fare-cta {
  text-align: center;
}

.fare-cta-text {
  margin-bottom: var(--sp-md);
  font-size: 1.1rem;
  color: var(--c-text);
}

.fare-cta .btn-search {
  display: inline-block;
  text-decoration: none;
}

/* ── Terms box ───────────────────────────────────────────────────────────── */

.terms-box {
  background: var(--c-white);
  padding: 30px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  text-align: left;
}

.terms-box ol li,
.terms-box ul li {
  margin-bottom: 12px;
  line-height: 1.7;
}

/* ── Toast notifications ─────────────────────────────────────────────────── */

.toast-container {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1055;
  padding: var(--sp-md);
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  pointer-events: none;
}

.custom-toast {
  background: rgba(220, 53, 69, 0.95);
  backdrop-filter: blur(10px);
  color: var(--c-white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--r-sm);
  padding: 15px 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 300px;
  font-weight: 500;
  pointer-events: all;
  animation: toast-in 0.3s ease forwards;
}

.custom-toast .close-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--c-white);
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0.8;
  padding: 0;
  line-height: 1;
}

.custom-toast .close-btn:hover { opacity: 1; }

.custom-toast .close-btn:focus-visible {
  outline: 2px solid var(--c-white);
  outline-offset: 2px;
  border-radius: 2px;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(-20px); }
}

/* ── Explore grid (Home Page quick links) ────────────────────────────────── */

.explore-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-lg);
}

.explore-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-sm);
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  text-decoration: none;
  color: inherit;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}

.explore-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}

.explore-card:focus-visible {
  outline: 2px solid var(--c-blue);
  outline-offset: 2px;
}

.explore-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  background: var(--c-blue-soft);
  color: var(--c-blue);
}

.explore-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-navy-dark);
}

.explore-desc {
  font-size: 0.9rem;
  color: var(--c-text-muted);
  line-height: 1.5;
}

.explore-arrow {
  position: absolute;
  top: var(--sp-lg);
  right: var(--sp-lg);
  color: var(--c-blue);
  font-weight: 700;
  opacity: 0;
  transform: translateX(-4px);
  transition: all var(--t);
}

.explore-card:hover .explore-arrow,
.explore-card:focus-visible .explore-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ── Landing notes (Terms + About teasers) ───────────────────────────────── */

.notes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-lg);
}

.note-card {
  background: var(--c-bg-light);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
}

.note-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-navy-dark);
  margin-bottom: var(--sp-md);
}

.note-list {
  margin: 0 0 var(--sp-md);
  padding-left: 1.1em;
  color: var(--c-text);
  font-size: 0.92rem;
  line-height: 1.6;
}

.note-list li { margin-bottom: 6px; }

.note-text {
  color: var(--c-text);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: var(--sp-md);
}

.note-social {
  display: flex;
  gap: var(--sp-md);
  margin-bottom: var(--sp-md);
}

.note-social a {
  color: var(--c-navy);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}

.note-social a:hover { text-decoration: underline; }

.note-link {
  display: inline-block;
  color: var(--c-blue);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}

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

/* ── Book Your Seat page ─────────────────────────────────────────────────── */

.booking-btn-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.booking-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  transition: all var(--t);
  width: 125px;
}

.booking-schedule-link {
  display: inline-block;
  color: var(--c-blue);
  font-weight: 600;
  font-size: 14px;
  text-decoration: underline;
}

.booking-action-btn--book {
  background: var(--c-blue);
  color: var(--c-white);
  border: 1px solid var(--c-blue);
}

.booking-action-btn--book:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  transform: translateY(-1px);
}

.booking-action-btn--call {
  background: var(--c-white);
  color: var(--c-blue);
  border: 1px solid var(--c-blue);
  width: 100px;
}

.booking-action-btn--call:hover {
  background: #eff6ff;
  transform: translateY(-1px);
}

.booking-tel-link {
  display: inline-block;
  color: var(--c-blue);
  font-weight: 600;
  font-size: 14px;
  text-decoration: underline;
}

.booking-cell--center { text-align: center; vertical-align: middle; }

.booking-muted {
  color: var(--c-text-muted);
  font-size: 13px;
  font-style: italic;
}

/* ── Booking redirect gateway page ───────────────────────────────────────── */

.redirect-wrap {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-xl) var(--sp-md);
}

.redirect-card {
  max-width: 480px;
  width: 100%;
  background: var(--c-white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: var(--sp-xl) var(--sp-lg);
  text-align: center;
}

.redirect-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--c-navy-dark);
  margin-bottom: var(--sp-sm);
}

.redirect-sub {
  color: var(--c-text-muted);
  font-size: 0.95rem;
  margin-bottom: var(--sp-lg);
}

.redirect-countdown {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-navy-dark), var(--c-blue));
  color: var(--c-white);
  font-size: 2.2rem;
  font-weight: 800;
  margin: 0 auto var(--sp-lg);
}

.redirect-continue-btn {
  display: inline-block;
  text-decoration: none;
}

.redirect-note {
  margin-top: var(--sp-md);
  font-size: 0.8rem;
  color: var(--c-text-muted);
}

/* ── Booking Cards ───────────────────────────────────────────────────────── */

.booking-cards-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-md);
  margin: var(--sp-lg) auto 0;
  max-width: 800px;
}

@media (min-width: 768px) {
  .booking-cards-container {
    grid-template-columns: repeat(4, 1fr);
  }
}

.booking-card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--sp-lg) var(--sp-sm);
  text-align: center;
  cursor: pointer;
  transition: all var(--t);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.booking-card:hover {
  border-color: var(--c-navy);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.booking-card.active {
  border-color: var(--c-blue);
  background: rgba(13, 110, 253, 0.05);
  box-shadow: 0 0 0 2px var(--c-blue);
}

.booking-card:focus-visible {
  outline: 2px solid var(--c-blue);
  outline-offset: 2px;
}

.booking-card-icon {
  width: 44px;
  height: 44px;
  color: var(--c-navy);
}

.booking-card.active .booking-card-icon {
  color: var(--c-blue);
}

.booking-card-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.booking-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--c-text);
  line-height: 1.3;
}

.booking-card-subtitle {
  font-size: 12px;
  font-weight: 500;
  color: var(--c-text-muted);
}

/* ── All Buses / bus profile pages (buses.html, bus/*.html) ──────────────── */
/* Reuses .container, .static-section, .section-heading, .type-filter /
   .type-filter-btn, .type-badge--*, .btn-search, .page-hero* elsewhere in
   this file — everything below is new. */

/* Breadcrumb strip — placed below .page-hero on bus profile pages.
   position+z-index kept explicitly below .notice-overlay's 1060 so the
   entry notice modal always renders on top of it. */
.breadcrumb {
  position: relative;
  z-index: 1;
  background: var(--c-bg-light);
  border-bottom: 1px solid var(--c-border);
  padding: 14px 0;
}

.breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  font-size: 13px;
  color: var(--c-text-muted);
}

.breadcrumb a {
  color: var(--c-navy);
  text-decoration: none;
  font-weight: 600;
}

.breadcrumb a:hover { text-decoration: underline; }

.breadcrumb li { display: flex; align-items: center; }

.breadcrumb li:not(:last-child)::after {
  content: '\203a'; /* › */
  margin: 0 8px;
  color: var(--c-text-muted);
}

.breadcrumb li[aria-current="page"] { color: var(--c-text); font-weight: 600; }

/* Bus list (buses.html) */
.bus-count {
  margin: var(--sp-md) 0 0;
  font-size: 14px;
  color: var(--c-text-muted);
}

.bus-list {
  list-style: none;
  margin: var(--sp-md) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

.bus-list-row {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  background: var(--c-white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-md);
  color: inherit;
  text-decoration: none;
  transition: box-shadow var(--t), transform var(--t);
}

.bus-list-row:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.bus-list-row:focus-visible {
  outline: 2px solid var(--c-navy);
  outline-offset: 2px;
}

/* Thumbnail slot — sized/positioned identically whether it holds the
   placeholder below or a future real <img>, so dropping photos in later
   causes no layout shift. */
.bus-thumb {
  flex: 0 0 120px;
  width: 120px;
  aspect-ratio: 1.45 / 1;
  border-radius: var(--r-md);
  overflow: hidden;
  background: linear-gradient(135deg, var(--c-navy-dark), var(--c-blue));
  display: flex;
  align-items: center;
  justify-content: center;
}

.bus-thumb img { width: 100%; height: 100%; object-fit: cover; }

.bus-thumb--placeholder {
  flex-direction: column;
  gap: 4px;
  color: var(--c-white);
}

/* Higher specificity than ".bus-thumb img" above so the decorative icon
   doesn't get stretched to fill the box by that future-real-photo rule. */
.bus-thumb--placeholder .bus-thumb-icon { width: 28px; height: 28px; filter: brightness(0) invert(1); opacity: 0.85; }

.bus-thumb-plate {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  opacity: 0.9;
}

.bus-list-content { flex: 1 1 auto; min-width: 0; }

.bus-list-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-navy-dark);
  margin: 0 0 2px;
}

.bus-list-model { font-size: 13px; color: var(--c-text-muted); margin: 0 0 6px; }

.bus-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--c-blue);
  margin: 0 0 6px;
}

.bus-chips span:not(:last-child) {
  border-right: 1px solid var(--c-border);
  padding-right: 8px;
}

.bus-list-desc {
  font-size: 13px;
  color: var(--c-text-muted);
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.bus-list-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sp-sm);
  flex-shrink: 0;
}

.bus-list-chevron { color: var(--c-text-muted); flex-shrink: 0; }

/* Mobile-only tap affordance — chevron hides at 768px (see responsive.css)
   since there's no hover to reveal it, so this pill takes its place. */
.bus-tap-hint { display: none; }

.bus-empty {
  text-align: center;
  padding: var(--sp-xl) var(--sp-md);
  color: var(--c-text-muted);
  font-size: 15px;
}

/* Bus profile page (bus/*.html) */
.bus-photo {
  aspect-ratio: 2 / 1;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, var(--c-navy-dark), var(--c-blue));
  display: flex;
  align-items: center;
  justify-content: center;
}

.bus-photo img { width: 100%; height: 100%; object-fit: cover; }

.bus-photo--placeholder { flex-direction: column; gap: var(--sp-sm); color: var(--c-white); }

/* Higher specificity than ".bus-photo img" above so the decorative icon
   doesn't get stretched to fill the box by that future-real-photo rule. */
.bus-photo--placeholder .bus-photo-icon { width: 56px; height: 56px; filter: brightness(0) invert(1); opacity: 0.85; }

.bus-photo-plate { font-size: 15px; font-weight: 700; letter-spacing: 1px; }

.bus-spec-table {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--c-white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin: var(--sp-lg) 0;
}

.bus-spec-row {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: 14px var(--sp-lg);
  border-bottom: 1px solid var(--c-border);
}

/* Vertical divider between the two columns — left-column cells only
   (odd position in source order), skipped on the full-width row. */
.bus-spec-row:nth-child(odd):not(.bus-spec-row--full) {
  border-right: 1px solid var(--c-border);
}

.bus-spec-row:last-child { border-bottom: none; }

.bus-spec-row--full { grid-column: 1 / -1; }

.bus-spec-label {
  flex: 0 0 auto;
  min-width: 120px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text-muted);
}

.bus-spec-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--c-blue-soft);
  flex-shrink: 0;
}

.bus-spec-icon svg { width: 16px; height: 16px; color: var(--c-blue); }

.bus-spec-value { font-size: 15px; color: var(--c-text); font-weight: 500; }

.bus-spec-value--highlight { font-size: 17px; font-weight: 700; color: var(--c-navy-dark); }

.ac-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
}

.ac-badge--yes { background: var(--c-type-ac-bg); color: var(--c-type-ac-text); }
.ac-badge--no  { background: var(--c-avail-departed-bg); color: var(--c-avail-departed-text); }

.bus-card {
  background: var(--c-white);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-lg);
  margin: var(--sp-lg) 0;
}

.bus-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-navy);
  margin: 0 0 var(--sp-sm);
}

.bus-card-title svg { color: var(--c-blue); flex-shrink: 0; }

.bus-card p { color: var(--c-text); font-size: 0.95rem; line-height: 1.6; margin: 0; }

.bus-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-lg);
  margin: var(--sp-lg) 0;
}

.bus-card-grid .bus-card { margin: 0; }

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

.bus-departure-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
}

.bus-departure-label { display: flex; align-items: center; gap: 6px; color: var(--c-text); font-weight: 500; }

.bus-departure-label svg { color: var(--c-blue); flex-shrink: 0; }

.bus-departure-time { font-weight: 700; color: var(--c-navy-dark); }

.bus-hotline-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--c-text);
  margin: 0 0 var(--sp-sm);
}

.bus-hotline-row a { color: var(--c-navy); font-weight: 600; text-decoration: none; }
.bus-hotline-row a:hover { text-decoration: underline; }
.bus-hotline-row svg { color: var(--c-blue); flex-shrink: 0; }

.bus-book-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  padding: 10px 22px;
  font-size: 14px;
  margin-top: var(--sp-sm);
  text-decoration: none;
}

/* Route chain — plain text with arrow separators, not pills (a 16+ stop
   route wraps to multiple lines on mobile, so a pill-per-stop look breaks). */
.bus-route-chain {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  font-size: 14px;
  color: var(--c-text);
}

.bus-route-chain li { display: flex; align-items: center; font-weight: 600; }

.bus-route-chain li::after {
  content: '\2192'; /* → */
  margin: 0 8px;
  color: var(--c-text-muted);
  font-weight: 400;
}

.bus-route-chain li:last-child::after { content: none; }

.bus-back-btn {
  display: block;
  width: fit-content;
  padding: 10px 22px;
  font-size: 14px;
  text-align: center;
  margin: var(--sp-lg) auto 0;
  text-decoration: none;
}
