@font-face {
  font-display: swap;
  font-family: "D-DIN";
  font-style: normal;
  font-weight: 400 900;
  src: url("/assets/fonts/D-DIN.woff2") format("woff2");
}

:root {
  --sd-bg: #030303;
  --sd-text: #f3f4f1;
  --sd-muted: #a7aaa6;
  --sd-dim: #686d69;
  --sd-line: rgba(243, 244, 241, 0.22);
  --sd-line-soft: rgba(243, 244, 241, 0.1);
  --sd-input: rgba(255, 255, 255, 0.025);
  --sd-green: #8bff5f;
  --sd-warn: #d9b562;
  --sd-bad: #ee8a7b;
  --sd-max: 1480px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  overflow-x: clip;
}

body {
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.03), transparent 34%),
    linear-gradient(180deg, #050505 0%, #010101 100%);
  color: var(--sd-text);
  font-family: "D-DIN", Arial, sans-serif;
  letter-spacing: 0;
  margin: 0;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.sd-app {
  margin: 0 auto;
  max-width: var(--sd-max);
  min-height: 100vh;
  padding: 32px clamp(22px, 5vw, 72px) clamp(28px, 5vw, 68px);
}

.sd-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 56px;
}

.sd-brand,
.sd-vision-link {
  align-items: center;
  display: inline-flex;
}

.sd-brand {
  gap: 16px;
  font-size: 19px;
  font-weight: 900;
  text-transform: uppercase;
}

.sd-brand img {
  height: 44px;
  width: 44px;
}

.sd-brand span {
  letter-spacing: 0.36em;
}

.sd-vision-link {
  color: #dedfdb;
  gap: 14px;
  font-size: 18px;
}

.sd-vision-link span {
  font-size: 26px;
  line-height: 1;
}

.sd-shell {
  align-items: center;
  display: grid;
  gap: clamp(42px, 8vw, 116px);
  grid-template-columns: minmax(320px, 0.92fr) minmax(360px, 1fr);
  min-height: calc(100vh - 132px);
  padding: clamp(52px, 8vh, 118px) 0 0;
}

.sd-planner {
  min-width: 0;
}

.sd-form {
  display: grid;
  gap: 24px;
  max-width: 520px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(48px, 6vw, 72px);
  font-weight: 400;
  line-height: 1.02;
}

.sd-field {
  display: grid;
  gap: 10px;
}

.sd-field > span:first-child {
  color: var(--sd-muted);
  font-size: 18px;
}

.sd-field small {
  color: var(--sd-dim);
  font-size: 13px;
  min-height: 18px;
}

.sd-input-row {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 58px;
}

.sd-field input {
  appearance: none;
  background: var(--sd-input);
  border: 1px solid var(--sd-line);
  color: var(--sd-text);
  height: 64px;
  min-width: 0;
  padding: 0 20px;
  width: 100%;
}

.sd-field input::placeholder {
  color: var(--sd-dim);
}

.sd-field input:focus,
.sd-icon-button:focus-visible,
.sd-submit:focus-visible {
  border-color: rgba(243, 244, 241, 0.8);
  outline: 0;
}

.sd-icon-button,
.sd-submit {
  align-items: center;
  border: 1px solid var(--sd-line);
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
}

.sd-icon-button {
  background: rgba(255, 255, 255, 0.055);
  height: 64px;
  width: 58px;
}

.sd-icon-button svg,
.sd-submit svg,
.sd-source-toggle svg,
.sd-leg__icon svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sd-icon-button svg {
  height: 24px;
  width: 24px;
}

.sd-submit {
  background: var(--sd-text);
  color: #050505;
  gap: 20px;
  height: 64px;
  justify-content: space-between;
  margin-top: 16px;
  padding: 0 22px 0 28px;
  width: 100%;
}

.sd-submit span {
  color: #050505;
  font-size: 18px;
  font-weight: 700;
}

.sd-submit svg {
  height: 28px;
  width: 28px;
}

.sd-result {
  border-left: 1px solid var(--sd-line);
  min-height: 560px;
  min-width: 0;
  padding-left: clamp(40px, 6vw, 80px);
}

.sd-route {
  display: grid;
  gap: 18px;
  max-width: 620px;
}

.sd-route__dates {
  align-items: end;
  color: var(--sd-muted);
  display: grid;
  font-size: 17px;
  gap: 36px;
  grid-template-columns: 1fr auto 1fr;
}

.sd-route__times {
  align-items: end;
  display: grid;
  gap: 36px;
  grid-template-columns: 1fr auto 1fr;
}

.sd-time-label {
  color: var(--sd-muted);
  display: block;
  font-size: 18px;
  margin-bottom: 8px;
}

.sd-time-value {
  display: block;
  font-size: clamp(52px, 7vw, 82px);
  font-weight: 400;
  line-height: 0.94;
}

.sd-time-arrow {
  color: var(--sd-muted);
  font-size: clamp(34px, 4vw, 50px);
  line-height: 0.9;
  padding-bottom: 7px;
}

.sd-route__head {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.sd-route__head h2 {
  font-size: 26px;
  font-weight: 400;
}

.sd-route__summary {
  color: var(--sd-muted);
  font-size: 17px;
  line-height: 1.4;
}

.sd-legs {
  display: grid;
  gap: 0;
  position: relative;
}

.sd-leg {
  --sd-leg-gap: 22px;
  --sd-rail-col: 42px;
  --sd-time-col: 62px;
  align-items: start;
  display: grid;
  gap: var(--sd-leg-gap);
  grid-template-columns: var(--sd-time-col) var(--sd-rail-col) 1fr;
  min-height: 92px;
  position: relative;
}

.sd-leg::before {
  background: var(--sd-line);
  content: "";
  height: calc(100% - 28px);
  left: calc(var(--sd-time-col) + var(--sd-leg-gap) + (var(--sd-rail-col) / 2));
  position: absolute;
  top: 32px;
  transform: translateX(-0.5px);
  width: 1px;
}

.sd-leg:last-child::before {
  display: none;
}

.sd-leg__time {
  color: var(--sd-muted);
  font-size: 16px;
  padding-top: 2px;
}

.sd-leg__dot {
  background: var(--sd-bg);
  border: 2px solid var(--sd-text);
  border-radius: 999px;
  height: 13px;
  justify-self: center;
  margin-top: 8px;
  width: 13px;
}

.sd-leg__body {
  border-bottom: 1px solid var(--sd-line-soft);
  display: grid;
  gap: 8px;
  grid-template-columns: 48px 1fr;
  min-height: 76px;
  padding-bottom: 22px;
}

.sd-leg:last-child .sd-leg__body {
  border-bottom: 0;
}

.sd-leg__icon {
  align-items: center;
  color: var(--sd-text);
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.sd-leg__icon svg {
  height: 34px;
  width: 34px;
}

.sd-leg__title {
  display: block;
  font-size: 20px;
  font-weight: 400;
}

.sd-leg__meta {
  color: var(--sd-muted);
  display: block;
  font-size: 17px;
  line-height: 1.4;
}

.sd-sources {
  border-top: 1px solid var(--sd-line);
  display: grid;
  gap: 12px;
  padding-top: 22px;
}

.sd-source-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--sd-muted);
  cursor: pointer;
  display: grid;
  gap: 16px;
  grid-template-columns: 24px 1fr 24px;
  padding: 0;
  text-align: left;
}

.sd-bars {
  align-items: end;
  display: inline-grid;
  gap: 4px;
  grid-template-columns: repeat(3, 3px);
  height: 22px;
}

.sd-bars i {
  background: var(--sd-text);
  display: block;
  width: 3px;
}

.sd-bars i:nth-child(1) { height: 10px; }
.sd-bars i:nth-child(2) { height: 18px; }
.sd-bars i:nth-child(3) { height: 13px; }

.sd-source-toggle span {
  font-size: 16px;
}

.sd-source-toggle svg {
  height: 22px;
  width: 22px;
}

.sd-source-list {
  color: var(--sd-muted);
  display: grid;
  gap: 8px;
  font-size: 14px;
  line-height: 1.35;
  list-style: none;
  margin: 0;
  padding: 0 0 0 40px;
}

.sd-source-list[hidden] {
  display: none;
}

.sd-source-list strong {
  color: var(--sd-text);
  font-weight: 700;
}

.sd-loading,
.sd-empty {
  color: var(--sd-muted);
  font-size: 24px;
  padding-top: 180px;
}

@media (max-width: 980px) {
  .sd-app {
    padding-top: 20px;
  }

  .sd-brand span {
    letter-spacing: 0.22em;
  }

  .sd-shell {
    align-items: start;
    gap: 48px;
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 42px;
  }

  .sd-form {
    max-width: none;
  }

  .sd-result {
    border-left: 0;
    border-top: 1px solid var(--sd-line);
    min-height: auto;
    padding-left: 0;
    padding-top: 38px;
  }

  .sd-route {
    max-width: none;
  }
}

@media (max-width: 620px) {
  .sd-app {
    padding-left: 18px;
    padding-right: 18px;
  }

  .sd-header {
    min-height: 46px;
  }

  .sd-brand {
    gap: 10px;
    font-size: 12px;
  }

  .sd-brand img {
    height: 30px;
    width: 30px;
  }

  .sd-vision-link {
    font-size: 15px;
  }

  h1 {
    font-size: 42px;
  }

  .sd-field > span:first-child {
    font-size: 15px;
  }

  .sd-field input,
  .sd-icon-button,
  .sd-submit {
    height: 56px;
  }

  .sd-input-row {
    grid-template-columns: 1fr 52px;
  }

  .sd-icon-button {
    width: 52px;
  }

  .sd-route__times {
    gap: 18px;
  }

  .sd-route__dates {
    font-size: 14px;
    gap: 18px;
  }

  .sd-time-label {
    font-size: 14px;
  }

  .sd-time-value {
    font-size: 44px;
  }

  .sd-time-arrow {
    font-size: 28px;
  }

  .sd-leg {
    --sd-leg-gap: 12px;
    --sd-rail-col: 28px;
    --sd-time-col: 48px;
    min-height: 86px;
  }

  .sd-leg__body {
    gap: 10px;
    grid-template-columns: 34px 1fr;
  }

  .sd-leg__title {
    font-size: 18px;
  }

  .sd-leg__meta,
  .sd-route__summary {
    font-size: 15px;
  }

  .sd-source-list {
    padding-left: 0;
  }
}
