:root {
  color-scheme: light;
  font-family: "Atkinson Hyperlegible Next","Apple SD Gothic Neo","Malgun Gothic",sans-serif;
  color: #172e4a;
  background: #eaf0f6;
  line-height: 1.55;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

main {
  max-width: 43rem;
  min-height: 100vh;
  margin: auto;
  padding: 1.35rem clamp(1rem,5vw,3rem) 3rem;
  background: #fff;
}

header {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: #213d63;
  font-weight: 700;
  border-bottom: 2px solid #213d63;
  padding: .25rem 0 1rem;
}

.mark {
  display: flex;
  gap: 3px;
  transform: skewX(-17deg);
}

.mark i {
  width: 5px;
  height: 19px;
  background: #246a8b;
}

.mark i:last-child {
  background: #dc6530;
}

h1 {
  font-size: clamp(2.1rem,7vw,3.1rem);
  line-height: 1.15;
  letter-spacing: -.055em;
  margin: 2rem 0 .45rem;
}

h2 {
  font-size: 1.35rem;
  line-height: 1.35;
  margin: 0;
}

h3 {
  font-size: 1.22rem;
  margin: .3rem 0;
}

p {
  color: #44576a;
  margin: .55rem 0 1rem;
}

.account,small,time,.note,.via {
  font-size: .92rem;
  color: #4e6172;
}

.account {
  overflow-wrap: anywhere;
  margin: 0;
}

section {
  padding: 1.6rem 0;
  border-bottom: 1px solid #d5dee7;
}

.desk-nav {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  margin-top: 1.4rem;
  border-bottom: 1px solid #91a4b5;
  background: #fff;
}

.desk-nav a {
  display: grid;
  place-items: center;
  min-height: 3rem;
  padding: .35rem .15rem;
  border-bottom: 3px solid transparent;
  color: #4e6172;
  font-size: clamp(.875rem, 3.9vw, 1rem);
  font-weight: 650;
  text-align: center;
  text-decoration: none;
  word-break: keep-all;
}

.desk-nav a[aria-current] {
  border-color: #246a8b;
  color: #172e4a;
  font-weight: 750;
}

[data-desk-panel] [id] { scroll-margin-top: 3.5rem; }
#cards details, #rail-account details { margin-top: .75rem; }
#cards summary, #rail-account summary { cursor: pointer; padding-block: .55rem; }

.stations {
  display: grid;
  grid-template-columns: minmax(0,1fr) 1.5rem minmax(0,1fr);
  align-items: end;
  gap: .6rem;
}

.departure-time {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.track {
  height: 2px;
  background: #6084a1;
  position: relative;
  margin-bottom: 2.15rem;
}

.track:before,.track:after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  border: 2px solid #6084a1;
  border-radius: 50%;
  background: white;
  top: -3px;
}

.track:before {
  left: -2px;
}

.track:after {
  right: -2px;
}

label {
  display: block;
  font-size: 1rem;
  font-weight: 650;
}

small {
  font-weight: 400;
}

input, select {
  margin: .3rem 0 .9rem;
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 2.9rem;
  border: 1px solid #91a4b5;
  border-radius: .4rem;
  padding: .55rem .7rem;
  font: inherit;
  background: #fff;
  color: inherit;
}

select {
  appearance: none;
  padding-right: 1.65rem;
}

.stations label {
  position: relative;
}

.stations label::after {
  content: "";
  position: absolute;
  right: .8rem;
  bottom: 2.25rem;
  width: .46rem;
  height: .46rem;
  border: solid #315774;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  pointer-events: none;
}

button,.official {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  min-height: 2.8rem;
  padding: .5rem 1rem;
  border: 1px solid #213d63;
  border-radius: .4rem;
  text-decoration: none;
  background: #213d63;
  color: white;
}

.official,.secondary {
  background: white;
  color: #213d63;
}

.official {
  margin-top: .65rem;
}

.text {
  background: transparent;
  border: 0;
  color: #315774;
  padding: .3rem;
  text-decoration: underline;
  font-size: .95rem;
}

button:disabled {
  opacity: .5;
}

[hidden] {
  display: none;
}

article {
  border-left: 4px solid #4085a3;
  background: #f1f6f8;
  padding: 1rem 1.1rem;
  margin: 1rem 0;
}

.status {
  font-size: .9rem;
  font-weight: 700;
  color: #285773;
}

.via {
  font-weight: 400;
}

.note {
  margin-top: 1rem;
}

p[role=alert] {
  color: #992c20;
}

p:empty {
  display: none;
}

:focus-visible {
  outline: 3px solid #b95215;
  outline-offset: 3px;
}

#manual-invite summary {
  min-height: 2.8rem;
  padding: .55rem 0;
  cursor: pointer;
  color: #315774;
}

.full { width: 100%; }
.choice { display: flex; align-items: center; gap: .65rem; min-height: 44px; }
.choice[hidden] { display: none; }
.choice input { display: block; flex: none; width: 1.2rem; height: 1.2rem; min-height: 0; margin: 0; }
.train { padding: .55rem 0; border-bottom: 1px solid #d5dee7; }
.train:last-of-type { margin-bottom: .9rem; }
.booking-result { white-space: pre-line; }
.back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: .65rem;
  color: #315774;
}
.back + h1 { margin-top: .55rem; }
.actions { display: flex; gap: .65rem; flex-wrap: wrap; }
.actions button { flex: 1; }
.friends { padding: 0; list-style: none; }
.friends li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .65rem 0;
  border-top: 1px solid #d5dee7;
}
.friends li span,.share-result h2 { overflow-wrap: anywhere; }
.friends form { flex-shrink: 0; }
.connection { display: block; }

.desk-layout {
  --desk-ink: #142b46;
  --desk-blue: #185477;
  --desk-muted: #4d6277;
  --desk-line: #d2dde8;
  --desk-wash: #f0f5fa;
  max-width: 48rem;
  background: #f5f8fc;
  color: var(--desk-ink);
}

.desk-layout header {
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--desk-line);
}

.desk-intro, .desk-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
}

.desk-intro { margin: 1.25rem 0 1.1rem; }
.desk-intro > div { min-width: 0; }
.desk-intro h1 { margin: 0 0 .28rem; font-size: clamp(1.85rem, 7vw, 2.75rem); }
.desk-intro .official { flex: none; margin: 0; }

.desk-layout .desk-nav {
  padding: .25rem;
  gap: .25rem;
  margin: 0;
  border: 1px solid var(--desk-line);
  border-radius: .75rem;
  background: #e8eff6;
}

.desk-layout .desk-nav a {
  padding-inline: .1rem;
  border: 0;
  border-radius: .5rem;
  color: var(--desk-muted);
}

.desk-layout .desk-nav a[aria-current] { color: #fff; background: var(--desk-ink); }

.desk-layout :is(#rail-account, #cards, #search > section, #journeys > section) {
  margin-top: .85rem;
  padding: clamp(.9rem, 4vw, 1.6rem);
  border: 1px solid var(--desk-line);
  border-radius: .85rem;
  background: #fff;
}

.desk-layout :is(label, h3) { color: var(--desk-ink); }
.desk-layout label { font-size: .95rem; }
.desk-layout label small { font-size: .78rem; }
.desk-layout select { appearance: auto; padding-right: .5rem; }
.desk-layout input, .desk-layout select { font-size: 1rem; }

.desk-layout :where(input:not([type=checkbox]):not([type=hidden]), select) {
  min-height: 3rem;
  margin-block: .35rem .7rem;
  border: 1px solid #a7bacd;
  border-radius: .55rem;
  background: #fff;
}

.search-form { margin-top: 1rem; }
.desk-layout .stations {
  grid-template-columns: minmax(0, 1fr) 1rem minmax(0, 1fr);
  gap: .4rem;
  padding: .8rem;
  margin-bottom: .95rem;
  border-radius: .7rem;
  background: var(--desk-wash);
}
.desk-layout .stations select { appearance: none; margin-bottom: 0; padding-right: 1.35rem; }
.desk-layout .stations label::after { right: .6rem; bottom: 1.44rem; }
.desk-layout .track { margin-bottom: 1.48rem; }
.desk-layout .departure-time { column-gap: .7rem; }
.search-timing > label { min-inline-size: 0; }
.search-timing input { min-inline-size: 0; max-inline-size: 100%; inline-size: 100%; }
.search-timing input::-webkit-date-and-time-value { min-width: 0; text-align: start; }

.passenger-options {
  display: grid;
  grid-template-columns: minmax(6.4rem, 1fr) minmax(0, 1.7fr);
  gap: 0 .7rem;
}
.passenger-extra { align-self: end; margin-bottom: .7rem; }
.passenger-extra[open] { grid-column: 1 / -1; }
.passenger-extra[open] > .departure-time { padding: .7rem .65rem 0; }
.desk-layout :is(details > summary) {
  min-height: 2.75rem;
  padding: .65rem;
  border-radius: .5rem;
  background: var(--desk-wash);
  color: var(--desk-blue);
  font-weight: 650;
  cursor: pointer;
}
.desk-layout details > form { padding: .75rem .35rem .25rem; }

.desk-checks, .desk-note {
  padding: .6rem .75rem;
  border-radius: .55rem;
  background: var(--desk-wash);
  font-size: .88rem;
}
.desk-checks p { display: flex; justify-content: space-between; gap: .25rem .65rem; flex-wrap: wrap; margin: .15rem 0; }
.desk-checks a { color: var(--desk-blue); font-weight: 650; }
.search-actions { margin-top: .9rem; }
.desk-layout .full { min-height: 3rem; }
.desk-layout :is(button, .official) { border-radius: .55rem; }
.desk-layout .secondary { padding-inline: .65rem; font-size: .9rem; }

.desk-layout article {
  padding: .85rem .9rem;
  border: 1px solid var(--desk-line);
  border-left: 3px solid var(--desk-blue);
  border-radius: .55rem;
  background: #f7fafd;
}
.desk-layout .desk-empty { margin-bottom: 0; padding-block: .35rem; color: var(--desk-muted); }
.desk-logout { margin-top: .85rem; }
.desk-layout .train { padding: .65rem; border-bottom-color: var(--desk-line); }
.desk-layout .train:has(input:checked) { border-radius: .5rem; background: var(--desk-wash); }
.desk-layout .choice input { accent-color: var(--desk-blue); }
.seat-list { display: flex; flex-wrap: wrap; gap: .45rem; padding: 0; margin: .65rem 0; list-style: none; }
.seat-list li { display: flex; flex-wrap: wrap; gap: .2rem .55rem; align-items: baseline; padding: .35rem .65rem; border: 1px solid var(--desk-line); border-radius: .45rem; background: #fff; }
.cancel-record { margin-top: .75rem; }
.desk-layout .cancel-record > summary { padding: .55rem .25rem; background: transparent; text-decoration: underline; }

@media (max-width: 375px) {
  .departure-time { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

@media (max-width: 600px) {
  .search-timing { grid-template-columns: minmax(0, 1fr); gap: .12rem; }
  .search-timing input { appearance: none; }
}
