*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --font-main: 'Montserrat', system-ui, sans-serif;
  --green: #198754;
  --green-dark: #157347;
  --green-soft: #e9f8ef;
  --text: #17202c;
  --muted: #667085;
  --line: #dde5ee;
  --bg: #f5f8f6;
  --card: #ffffff;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

/* HEADER */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.app-header h1 {
  font-size: clamp(24px, 8vw, 32px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.045em;
  white-space: nowrap;
}

.brand-green {
  color: var(--green);
}
.app-header p {
  display: none;
}

.language-switcher {
  flex-shrink: 0;
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.lang-btn {
  min-width: clamp(34px, 12vw, 44px);
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: clamp(12px, 4vw, 14px);
  font-weight: 850;
  cursor: pointer;
}

/* CARDS */

.search-card {
  background: var(--card);
  border: 1px solid rgba(221, 229, 238, 0.9);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 26px;
  margin-top: 48px;
}

.departures-card{
  margin-top: 64px;
}

.search-card {
  margin-bottom: 18px;
}

.search-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-bottom: 32px;
}

/* FIELDS */

.field-block label {
  display: block;
  margin-bottom: 12px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.big-input {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}

.big-input > iconify-icon {
  width: 70px;
  height: 70px;
  min-width: 70px;
  display: grid;
  place-items: center;
  background: var(--green-soft);
  color: var(--green);
  font-size: 38px;
}

.big-input input {
  width: 100%;
  min-height: 68px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 0 18px;
  font: inherit;
  font-size: 22px;
  font-weight: 650;
}

.big-input:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.12);
}

.big-input input:disabled {
  color: #98a2b3;
}

.loading-pill {
  position: absolute;
  right: 10px;
  top: 10px;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
  padding: 0 14px;
  font: inherit;
  font-weight: 800;
}

/* NEAREST INSIDE STOP FIELD */

.stop-input-wrap input {
  padding-right: 120px;
}

.nearest-inside-btn {
  position: absolute;
  right: 8px;
  top: 8px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  padding: 0 14px;
  font: inherit;
  font-size: 15px;
  font-weight: 850;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: 0.21s;
}

.nearest-inside-btn:hover {
  background: var(--green-soft);
  color: var(--green-dark);
  border-color: rgba(25, 135, 84, 0.35);
}

.nearest-inside-btn iconify-icon {
  font-size: 21px;
}

/* SECTION TITLES */

.center-title {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
}

.center-title h2 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 30px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: -0.045em;
  margin-top: 16px;
}

.no-center{
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
}

.no-center iconify-icon {
  color: var(--green);
  font-size: 32px;
 margin-right: 10px;
}

.no-center #searchTitle{
  font-size: 26px;
  align-items: center !important;
      font-weight: 800;
      display: flex;
}

.center-title iconify-icon {
  color: var(--green);
  font-size: 34px;
}

/* BUS BUTTONS */

.bus-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 12px;
}

.bus-grid:empty {
  display: none;
}

.bus-grid .btn,
.bus-grid button,
#busesWrap .bus-btn {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 21px;
  font-weight: 850;
  cursor: pointer;
}

.bus-grid .btn:hover,
.bus-grid button:hover {
  border-color: var(--green);
  color: var(--green);
}

.bus-grid .btn-dark,
.bus-grid .active,
#busesWrap .btn-dark,
#busesWrap .active {
  background: var(--green) !important;
  border-color: var(--green) !important;
  color: #fff !important;
}

/* EMPTY STATES */

.empty-state {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 20px;
  font-weight: 800;
  text-align: center;
}

.empty-state.d-none {
  display: none !important;
}

/* DEPARTURES */

.departures-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.departure-group {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
}

.departure-group-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.departure-route {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.departure-route iconify-icon {
  color: var(--green);
  font-size: 26px;
}

.departure-group-head div:first-child {
  font-size: 18px;
  font-weight: 850;
  color: var(--text);
}

.departure-group-head div:last-child {
  font-size: 15px;
  font-weight: 750;
  color: var(--muted);
  text-align: right;
}

.departure-times {
  display: grid;
}

.departure-time-row {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.departure-time-row:last-child {
  border-bottom: 0;
}

.departure-time-row strong {
  font-size: 31px;
  font-weight: 850;
  letter-spacing: -0.045em;
  color: var(--text);
}

.departure-time-row .time-badge {
  min-height: 38px;
  border-radius: 999px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 850;
  white-space: nowrap;
}

.time-badge-danger {
  background: #fee2e2;
  color: #b42318;
}

.time-badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.time-badge-good {
  background: var(--green-soft);
  color: var(--green-dark);
}

.time-badge-neutral {
  background: #f1f5f9;
  color: var(--muted);
}

/* SKELETONS */

.placeholder {
  display: inline-block;
  background: #d9dde3 !important;
  opacity: 1 !important;
  border-radius: 999px;
  position: relative;
  overflow: hidden;
  animation: placeholder-glow 1.2s ease-in-out infinite;
}

.placeholder::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.5),
    transparent
  );
  animation: skelMove 1.1s infinite;
}

@keyframes placeholder-glow {
  0% { opacity: 1; }
  50% { opacity: 0.52; }
  100% { opacity: 1; }
}

@keyframes skelMove {
  100% {
    transform: translateX(100%);
  }
}

.bus-skel,
#busesWrap .bus-skeleton {
  min-height: 62px;
  border-radius: 15px;
  background-color: #d9dde3 !important;
  border: none !important;
  pointer-events: none;
  position: relative;
  overflow: hidden;
}

.bus-skel::after,
#busesWrap .bus-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,.45),
    transparent
  );
  animation: skelMove 1.5s infinite;
}

.skeleton-group {
  pointer-events: none;
}

.skeleton-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

.skeleton-route {
  width: 170px;
  height: 22px;
}

.skeleton-next-stop {
  width: 190px;
  height: 20px;
}

.skeleton-time {
  width: 90px;
  height: 34px;
}

.skeleton-left {
  width: 110px;
  height: 38px;
}

.departure-skeleton-row {
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* DOWNLOAD */

.download-btn {
  width: auto;
  min-width: 240px;
  min-height: 52px;
  margin-top: 22px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  gap: 10px;
  transition: 0.18s ease;
}

.download-btn iconify-icon {
  font-size: 20px;
  flex-shrink: 0;
  display: block;
}

.download-btn:hover {
  border-color: rgba(25, 135, 84, 0.28);
  background: var(--green-soft);
  color: var(--green-dark);
}

.arrivals-hint {
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
  min-height: 20px;
}

.app-header h1 {
  font-size: clamp(38px, 10vw, 48px);
  line-height: 0.95;
  font-weight: 850;
  letter-spacing: -0.07em;
  white-space: nowrap;
}

.language-switcher {
  flex-shrink: 0;
  display: flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.lang-btn {
  min-width: clamp(42px, 12vw, 54px);
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: clamp(14px, 4vw, 17px);
  font-weight: 850;
  cursor: pointer;
  transition: 0.18s ease;
}

/* UTILS */

.d-none {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.spinner-border {
  width: 1rem;
  height: 1rem;
  border: 0.15em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: spinner-border .75s linear infinite;
}

@keyframes spinner-border {
  to {
    transform: rotate(360deg);
  }
}

/* TABLET */

@media (max-width: 980px) {
  .app-shell {
    width: min(100% - 22px, 1180px);
    padding: 22px 0;
  }

  .search-card,
  .departures-card {
    padding: 18px;
    border-radius: 22px;
    margin-top: 32px;
  }

  

  .search-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .bus-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .departures-list {
    grid-template-columns: 1fr;
  }

  .departure-group-head {
    min-height: auto;
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding: 14px 18px;
  }

  .departure-group-head div:last-child {
    text-align: left;
  }
}

/* MOBILE */

@media (max-width: 520px) {
  .app-shell {
    width: min(100% - 14px, 1180px);
    padding: 14px 0;
  }

  .app-header {
    gap: 8px;
    margin-bottom: 18px;
  }



  .language-switcher {
    padding: 3px;
    gap: 3px;
  }

  .lang-btn {
    min-width: 48px;
    height: 44px;
    font-size: 16px;
  }

  .search-grid {
    gap: 18px;
    margin-bottom: 46px;
  }

  .field-block label {
    font-size: 18px;
  }

  .big-input {
    min-height: 62px;
  }

  .big-input > iconify-icon {
    width: 62px;
    height: 62px;
    min-width: 62px;
    font-size: 34px;
  }

  .big-input input {
    min-height: 60px;
    font-size: 19px;
  }

  .stop-input-wrap {
    display: grid;
    grid-template-columns: 62px 1fr;
    overflow: visible;
  }

  .stop-input-wrap > iconify-icon {
    width: 62px;
    height: 62px;
    min-width: 62px;
    border-radius: 18px 0 0 0;
  }

  .stop-input-wrap input {
    min-height: 62px;
    padding-right: 14px;
    border-radius: 0 18px 18px 0;
  }

  .brand-green {
  color: var(--green);
}

  .nearest-inside-btn {
    position: static;
    grid-column: 1 / -1;
    width: 100%;
    height: 50px;
    justify-content: center;
    background: #fff;
    border-radius: 0 0 16px 16px;
    border: none;
    border-top: 1px solid var(--line);
  }

  .center-title h2 {
    font-size: 27px;
  }

  .bus-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .departure-time-row strong {
    font-size: 27px;
  }

  .download-btn {
    width: 100%;
    min-width: 0;
    margin-left: 0;
  }

  .skeleton-route {
    width: 130px;
  }

  .skeleton-next-stop {
    width: 150px;
  }

  .skeleton-time {
    width: 78px;
  }

  .skeleton-left {
    width: 92px;
  }
}

/* VERY SMALL */

@media (max-width: 300px) {
  .app-shell {
    width: min(100% - 10px, 1180px);
  }

  .app-header h1 {
    font-size: 22px;
  }

  .lang-btn {
    min-width: 30px;
    height: 30px;
    font-size: 11px;
  }
}

.departures-card {
  margin-top: 64px;

}

.departures-card .center-title h2 {
  color: #111827;
}

.departure-group {
  border: 1px solid #d7e2dd;
  border-radius: 18px;
  overflow: hidden;
  background: #fbfffd;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.045);
}

.departure-group-head {
  background: #f4faf7;
  border-bottom: 1px solid #d7e2dd;
}

.departure-time-row {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

.departure-time-row:nth-child(even) {
  background: #fbfcfd;
}