:root {
  --snow: #eef3f5;
  --paper: #f7fafb;
  --ink: #17262c;
  --steel: #4a5f6c;
  --line: #d2dde3;
  --teal: #0d7d8c;
  --teal-deep: #0a5f6b;
  --blind: #0f3d48;
  --blind-edge: #0a2e36;
  --amber: #0d7d8c;
  --link: #0d7d8c;
  --focus: #f7fbff;
  --wrap: min(1080px, calc(100% - 2.5rem));
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--snow);
  color: var(--ink);
  font-family: Geologica, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.5;
  font-weight: 400;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  background: var(--paper);
  color: var(--ink);
  padding: 0.4rem 0.7rem;
  z-index: 5;
}

.skip:focus { top: 0.75rem; }

:focus-visible {
  outline: 3px solid #0b6e8a;
  outline-offset: 3px;
}

.wrap {
  width: var(--wrap);
  margin-inline: auto;
}

a { color: var(--link); }

.prose a,
.plain a,
.years a,
.news a,
.stops a,
.foot a {
  text-underline-offset: 0.16em;
}

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h1 {
  margin: 1.4rem 0 0.6rem;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  max-width: 22ch;
}

h2 {
  margin: 0 0 0.45rem;
  font-size: 1.28rem;
}

h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }

p { margin: 0.4rem 0 0.8rem; }

.lede, .prose p, .route p, .news p, .years li p {
  max-width: 68ch;
}

.top {
  width: 100%;
  background: #fff;
  color: var(--ink);
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.top-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "brand phone"
    "nav nav";
  gap: 0.75rem 1rem;
  align-items: center;
}

.brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  width: 2.4rem;
  height: 2.4rem;
  object-fit: contain;
  flex: none;
  border-radius: 0.35rem;
}

.brand-mark {
  display: none;
}

.brand-text { display: grid; gap: 0.12rem; }

.brand-name {
  font-family: Unbounded, "Segoe UI", sans-serif;
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  display: block;
  line-height: 1;
  color: var(--ink);
}

.brand-place {
  display: block;
  color: var(--steel);
  margin-top: 0;
  font-size: 0.86rem;
}

.top-phone {
  grid-area: phone;
  justify-self: end;
  text-decoration: none;
  text-align: center;
  color: #fff;
  background: var(--teal);
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
}

.top-phone:hover { background: var(--teal-deep); }

.top-phone span { display: none; }

nav[aria-label="Разделы"] {
  grid-area: nav;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

nav[aria-label="Разделы"] a {
  color: var(--steel);
  text-decoration: none;
  padding: 0.35rem 0;
}

nav[aria-label="Разделы"] a:hover {
  color: var(--ink);
}

nav[aria-label="Разделы"] a[aria-current="page"] {
  color: var(--teal);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.28em;
}

.hero {
  background: var(--snow);
  padding: 1.1rem 0 1.8rem;
}

.hero-copy {
  padding: 0.35rem 0 1rem;
}

.hero h1 {
  margin: 0 0 0.35rem;
  max-width: 18ch;
  font-size: clamp(1.7rem, 3.4vw, 2.35rem);
}

.hero-lead {
  margin: 0;
  max-width: 42ch;
  color: var(--steel);
}

.section-lead {
  margin: 0 0 0.7rem;
  color: var(--steel);
  max-width: 52ch;
}

.stop {
  padding: 0.95rem 0 1rem;
  border-top: 1px solid var(--line);
}

.stop h3 {
  margin: 0 0 0.4rem;
  font-size: 1.08rem;
}

.stop h3 a {
  color: inherit;
  text-decoration: none;
}

.stop h3 a:hover {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.stop-routes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
}

a.stop-route {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.6rem;
  min-height: 2.1rem;
  padding: 0 0.45rem;
  text-decoration: none;
  font-family: Unbounded, "Segoe UI", sans-serif;
  font-size: 0.92rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
}

a.stop-route:hover {
  border-color: var(--blind);
  background: #eef5f8;
}

.search-panels {
  display: grid;
  gap: 0.85rem;
  margin: 0 0 1rem;
}

.search-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem 1.05rem 1.1rem;
  display: grid;
  gap: 0.7rem;
  margin: 0;
}

.search-kicker {
  margin: 0;
  color: var(--steel);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.search-title {
  margin: -0.35rem 0 0;
  font-family: Unbounded, "Segoe UI", sans-serif;
  font-size: 1.15rem;
  font-weight: 500;
}

.search-field {
  display: grid;
  gap: 0.3rem;
  margin: 0;
}

.search-field span {
  color: var(--steel);
  font-size: 0.92rem;
}

.search-field input {
  font: inherit;
  color: inherit;
  width: 100%;
  padding: 0.7rem 0.75rem;
  border: 1px solid #8aa0ab;
  background: var(--paper);
  border-radius: 0.55rem;
}

.search-card .btn-primary {
  justify-self: start;
  border-radius: 0.55rem;
  min-width: 7.5rem;
}

.board {
  position: relative;
  background: transparent;
  color: inherit;
  box-shadow: none;
  display: grid;
  gap: 1.15rem;
}

.trip-card {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  padding: 1.15rem 1.2rem 1.05rem;
  box-shadow: 0 10px 24px rgba(15, 61, 72, 0.08);
}

.trip-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.35rem 0.9rem;
  align-items: start;
}

.trip-num {
  margin: 0;
  font-family: Unbounded, "Segoe UI", sans-serif;
  font-weight: 500;
  font-size: clamp(3.4rem, 10vw, 5.2rem);
  line-height: 0.85;
  letter-spacing: -0.045em;
  color: var(--ink);
}

.trip-main { min-width: 0; padding-top: 0.25rem; }

.trip-to {
  margin: 0;
  font-family: Unbounded, "Segoe UI", sans-serif;
  font-weight: 500;
  font-size: clamp(1.15rem, 2.5vw, 1.55rem);
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.2;
}

.trip-via {
  margin: 0.4rem 0 0;
  color: var(--steel);
  max-width: 42rem;
  font-size: 0.98rem;
}

.trip-fare {
  grid-column: 1 / -1;
  margin: 0.15rem 0 0;
  font-family: Unbounded, "Segoe UI", sans-serif;
  font-weight: 500;
  font-size: 1.45rem;
  color: var(--teal);
  letter-spacing: -0.03em;
}

.trip-actions { margin-top: 0.85rem; }

.btn-schedule {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  padding: 0.45rem 1rem;
  border-radius: 0.55rem;
  background: var(--teal);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.btn-schedule:hover { background: var(--teal-deep); }

.trip-line {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.55rem;
  align-items: center;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  color: var(--steel);
  font-size: 0.9rem;
}

.trip-line-track {
  height: 2px;
  background: linear-gradient(90deg, var(--teal), rgba(13, 125, 140, 0.2));
  border-radius: 999px;
  position: relative;
}

.trip-line-track::before,
.trip-line-track::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--teal);
  transform: translateY(-50%);
}

.trip-line-track::before { left: 0; }
.trip-line-track::after { right: 0; }

.route-grid-block { display: grid; gap: 0.7rem; }

.route-grid-title {
  margin: 0;
  font-size: 1.15rem;
}

.flags,
.route-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
  padding: 0;
  background: transparent;
}

.flags button,
.route-grid button {
  width: 100%;
  min-height: 2.75rem;
  padding: 0 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-family: Unbounded, "Segoe UI", sans-serif;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  cursor: pointer;
  background: #fff;
}

.flags button:hover,
.route-grid button:hover {
  border-color: var(--teal);
}

.flags button:focus-visible,
.route-grid button:focus-visible {
  outline: 3px solid #0b6e8a;
  outline-offset: 2px;
}

.flags button.is-active,
.route-grid button.is-active {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

.service-cards {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.35rem;
}

.service-card {
  display: grid;
  gap: 0.55rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem 1.05rem;
  text-decoration: none;
  color: inherit;
}

.service-card:hover .service-go { color: var(--teal-deep); }

.service-icon {
  width: 1.85rem;
  height: 1.85rem;
  color: var(--teal);
  display: block;
}

.service-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.service-name {
  font-family: Unbounded, "Segoe UI", sans-serif;
  font-weight: 500;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}

.service-go {
  color: var(--teal);
  font-size: 0.95rem;
  font-weight: 600;
}

@media (prefers-reduced-motion: no-preference) {
  .trip-card.is-arrive {
    animation: arrive 0.35s ease;
  }

  .flags button,
  .route-grid button {
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
  }
}

@keyframes arrive {
  from { opacity: 0; }
  to { opacity: 1; }
}

.plain { list-style: none; margin: 0.5rem 0 0; padding: 0; }

.plain li {
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
  max-width: 68ch;
}

.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0.9rem 0 0;
}

.jump a {
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.group-title {
  font-family: Unbounded, "Segoe UI", sans-serif;
  font-size: 1.05rem;
  font-weight: 500;
  margin: 1.4rem 0 0.2rem;
}

.finder { margin: 1.2rem 0 0.4rem; }

.finder label { display: block; margin-bottom: 0.35rem; }

.finder input[type="search"] {
  font: inherit;
  color: inherit;
  width: min(100%, 36rem);
  padding: 0.7rem 0.75rem;
  border: 1px solid #8aa0ab;
  background: var(--paper);
  border-radius: 0;
}

.route {
  padding: 0;
  border-top: 1px solid var(--line);
}

.route-fold {
  margin: 0;
  padding: 0;
}

.route-fold > summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) 10.5rem 1.4rem;
  align-items: center;
  column-gap: 0.85rem;
  padding: 0.95rem 0;
  font-family: Unbounded, "Segoe UI", sans-serif;
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  font-weight: 500;
}

.route-fold > summary::-webkit-details-marker { display: none; }

.route-fold > summary::after {
  content: "+";
  justify-self: end;
  color: var(--steel);
  font-family: Geologica, "Segoe UI", sans-serif;
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 400;
}

.route-fold[open] > summary::after { content: "−"; }

.route-fold .num {
  margin: 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.route-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-hint {
  justify-self: end;
  text-align: right;
  white-space: nowrap;
  font-family: Geologica, "Segoe UI", sans-serif;
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--steel);
  font-variant-numeric: tabular-nums;
}

.route-fold .stops,
.route-fold .meta {
  margin-left: 0;
  padding-bottom: 0.9rem;
}

@media (max-width: 560px) {
  :root {
    --wrap: min(1080px, calc(100% - 1.4rem));
  }

  .top-inner {
    gap: 0.55rem 0.75rem;
  }

  .brand-name { font-size: 1.1rem; }

  .top-phone {
    font-size: 0.78rem;
    padding: 0.45rem 0.7rem;
  }

  nav[aria-label="Разделы"] {
    gap: 0.15rem 0.85rem;
  }

  nav[aria-label="Разделы"] a {
    padding: 0.45rem 0;
    min-height: 2.4rem;
    display: inline-flex;
    align-items: center;
  }

  .route-fold > summary {
    grid-template-columns: 3.4rem minmax(0, 1fr) 1.35rem;
    align-items: start;
    column-gap: 0.55rem;
    font-size: 1.02rem;
    padding: 0.85rem 0;
  }

  .route-hint { display: none; }

  .route-name {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.28;
  }

  .route-fold > summary::after {
    align-self: start;
    margin-top: 0.05rem;
  }

  .stops li {
    min-height: 2.55rem;
    padding: 0.5rem 0;
    align-items: center;
  }

  .flags,
  .route-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .flags button,
  .route-grid button {
    min-height: 2.6rem;
    font-size: 0.9rem;
  }

  .trip-card { padding: 1rem; }

  .finder input[type="search"] {
    width: 100%;
  }

  h1 {
    max-width: none;
  }
}

.num {
  font-family: Unbounded, "Segoe UI", sans-serif;
  font-weight: 500;
  letter-spacing: -0.03em;
  margin-right: 0.35rem;
  color: var(--ink);
}

.meta { color: var(--steel); margin-top: 0; }

.stops {
  list-style: none;
  counter-reset: stop;
  margin: 0.2rem 0 0.8rem;
  padding: 0;
  max-width: 38rem;
  border-top: 1px solid var(--line);
}

.stops li {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.6rem;
  padding: 0.38rem 0;
  border-bottom: 1px solid var(--line);
}

.stops li::before {
  content: counter(stop);
  counter-increment: stop;
  font-variant-numeric: tabular-nums;
  color: var(--steel);
}

.years { list-style: none; margin: 0.4rem 0 0; padding: 0; }

.years li {
  padding: 0.15rem 0 0.9rem 1rem;
  border-left: 3px solid #b7c8d1;
}

.years time {
  display: block;
  color: var(--steel);
  font-variant-numeric: tabular-nums;
}

table {
  border-collapse: collapse;
  width: min(100%, 28rem);
  margin: 0.4rem 0 1rem;
}

th, td {
  text-align: left;
  padding: 0.45rem 0.6rem 0.45rem 0;
  border-bottom: 1px solid var(--line);
  font-weight: 400;
}

th { color: var(--steel); }

.contacts {
  display: grid;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.contacts dl { margin: 0; }

.contacts dt { color: var(--steel); margin-top: 0.75rem; }

.contacts dd { margin: 0.1rem 0 0; }

.news article {
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
  max-width: 68ch;
}

.news time {
  display: block;
  color: var(--steel);
  font-variant-numeric: tabular-nums;
}

.empty { color: var(--steel); }

.notice {
  margin: 0.9rem 0 1.2rem;
  padding: 0.7rem 0.85rem;
  border-left: 3px solid #7f9eab;
  background: #eef4f6;
  max-width: 68ch;
}

.notice p { margin: 0; }

.ticket-form {
  max-width: 40rem;
  margin: 0.4rem 0 1.5rem;
}

.ticket-form .field,
.contact-set .field {
  margin: 0 0 0.9rem;
}

.ticket-form label,
.contact-set label,
.ticket-form legend {
  display: block;
  margin-bottom: 0.3rem;
}

.optional {
  color: var(--steel);
  font-weight: 400;
}

.ticket-form input,
.ticket-form select,
.ticket-form textarea,
.admin-filters input,
.admin-filters select,
.detail-form input,
.detail-form select,
.detail-form textarea {
  font: inherit;
  color: inherit;
  width: 100%;
  padding: 0.65rem 0.7rem;
  border: 1px solid #8aa0ab;
  background: var(--paper);
  border-radius: 0;
}

.ticket-form textarea { resize: vertical; min-height: 10rem; }

.field-row {
  display: grid;
  gap: 0.75rem;
}

.contact-set {
  margin: 0.4rem 0 1rem;
  padding: 0.85rem 0 0.2rem;
  border: 0;
  border-top: 1px solid var(--line);
}

.hint {
  margin: 0.3rem 0 0;
  color: var(--steel);
  font-size: 0.95rem;
}

.form-status {
  min-height: 1.4em;
  margin: 0.2rem 0 0.8rem;
}

.form-status.is-error { color: #8a2f2f; }

.form-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.btn-primary,
.btn-secondary {
  font: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  padding: 0.65rem 1rem;
  min-height: 2.75rem;
}

.btn-primary {
  background: var(--teal);
  color: #f7fbff;
  border-color: var(--teal);
}

.btn-primary:hover { background: var(--teal-deep); }

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--paper);
  color: var(--ink);
  border-color: #8aa0ab;
}

.ticket-done {
  max-width: 40rem;
  margin: 0.5rem 0 2rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

@media (min-width: 700px) {
  .field-row { grid-template-columns: 1fr 1fr; }
}

.foot {
  margin-top: 2.5rem;
  padding: 1.5rem 0 1.8rem;
  background: var(--blind);
  color: #9eb8c0;
}

.foot-grid {
  display: grid;
  gap: 0.4rem 2rem;
}

.foot .brand-name { font-size: 1rem; color: #f7fbff; }

.foot a { color: #d7e4ea; }

.foot a:hover { color: #f7fbff; }

.note {
  margin: 1.1rem auto 0;
  max-width: var(--wrap);
  padding-top: 0.9rem;
  border-top: 1px solid rgba(158, 180, 191, 0.28);
  color: #7f95a1;
  font-size: 0.86rem;
  line-height: 1.45;
}

caption {
  caption-side: bottom;
  text-align: left;
  padding-top: 0.35rem;
}

@media (min-width: 720px) {
  .search-panels {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .trip-top {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .trip-fare {
    grid-column: auto;
    margin: 0.2rem 0 0;
    text-align: right;
    justify-self: end;
  }

  .flags,
  .route-grid {
    grid-template-columns: repeat(11, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .service-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 800px) {
  .top-inner {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "brand nav phone";
    align-items: center;
  }

  nav[aria-label="Разделы"] {
    justify-content: center;
  }

  .contacts { grid-template-columns: 1fr 1fr; }

  .foot-grid { grid-template-columns: 1.4fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .flags button {
    transition: none;
  }
}

@media print {
  .top-phone, .flags, .finder, .skip { display: none; }
  body { background: white; }
  .board { box-shadow: none; }
}
