:root {
  font-family: Arial, "Helvetica Neue", Helvetica, ui-sans-serif, system-ui, sans-serif;
  color: #002b45;
  background: #eef6fc;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: #eef6fc;
}

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

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 26px;
}

.eyebrow {
  display: flex;
  gap: 9px;
  align-items: center;
  margin: 0 0 10px;
  color: #006fc9;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #00875a;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2.25rem, 5.5vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.subtitle {
  margin: 14px 0 0;
  color: #4d687a;
  font-size: clamp(1rem, 2vw, 1.16rem);
}

.button {
  min-height: 44px;
  padding: 11px 18px;
  border: 2px solid transparent;
  border-radius: 4px;
  font-weight: 800;
}

.button--primary {
  color: #fff;
  background: #0078d4;
}

.button--primary:hover {
  background: #005fa8;
}

.button--secondary {
  border-color: #9eb8c9;
  color: #004f83;
  background: #fff;
}

.button--secondary:hover {
  border-color: #0078d4;
  background: #f3f9fd;
}

.button--small {
  min-height: 36px;
  padding: 7px 12px;
  font-size: 0.8rem;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #f5b335;
  outline-offset: 2px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-top: 1px solid #c2d5e1;
  border-bottom: 1px solid #c2d5e1;
  margin-bottom: 22px;
}

.toolbar p {
  margin: 0;
  color: #526f81;
  font-size: 0.82rem;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.connection-tile {
  --transport-color: #00678d;
  --transport-ink: #fff;

  display: flex;
  min-height: 340px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--transport-color);
  border-radius: 7px;
  background: #fff;
}

.transport--tram {
  --transport-color: #d33137;
}

.transport--bus {
  --transport-color: #005ca9;
}

.transport--metrobus {
  --transport-color: #f39200;
  --transport-ink: #002b45;
}

.transport--regio {
  --transport-color: #5b5e66;
}

.transport--sbahn {
  --transport-color: #008d5e;
}

.transport--ubahn {
  --transport-color: #0065ad;
}

.tile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 18px 15px;
  color: var(--transport-ink);
  background: var(--transport-color);
}

.tile-station {
  margin: 0 0 5px;
  color: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tile-title {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.2;
}

.tile-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.icon-button {
  min-height: 32px;
  padding: 5px 7px;
  border: 1px solid #a9becb;
  border-radius: 3px;
  color: #005c99;
  background: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.icon-button:hover {
  border-color: #0078d4;
  background: #e9f5fc;
}

.icon-button--tile {
  display: grid;
  width: 32px;
  min-height: 32px;
  padding: 6px;
  place-items: center;
  border-color: currentcolor;
  color: var(--transport-ink);
  background: transparent;
}

.icon-button--tile:hover {
  border-color: currentcolor;
  color: var(--transport-color);
  background: var(--transport-ink);
}

.icon-button--tile svg {
  width: 17px;
  height: 17px;
  fill: currentcolor;
}

.tile-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 16px 18px 18px;
}

.tile-filter {
  min-height: 36px;
  margin: 0 0 18px;
  color: #526f81;
  font-size: 0.76rem;
  line-height: 1.45;
}

.tile-loading,
.tile-message {
  display: grid;
  flex: 1;
  margin: 0;
  place-items: center;
  color: #526f81;
  text-align: center;
}

.tile-summary {
  display: grid;
  gap: 13px;
  justify-items: center;
  text-align: center;
}

.tile-service {
  display: flex;
  gap: 9px;
  align-items: center;
}

.line-badge {
  display: grid;
  min-width: 72px;
  min-height: 52px;
  padding: 8px 13px;
  place-items: center;
  border-radius: 4px;
  color: var(--transport-ink);
  background: var(--transport-color);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
}

.transport-type {
  color: #526f81;
  font-size: 0.72rem;
  font-weight: 800;
}

.tile-timing {
  display: grid;
  justify-items: center;
}

.leave-minutes {
  color: var(--transport-color);
  font-size: clamp(4.2rem, 8vw, 6rem);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.85;
}

.leave-label {
  margin-top: 9px;
  color: #526f81;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.departure-time {
  margin-top: 6px;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.tile-destination {
  margin: 18px 0;
  color: #173e56;
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
}

.tile-details {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-top: auto;
}

.detail-item,
.status {
  padding: 6px 8px;
  border-radius: 3px;
  background: #e9f0f4;
  font-size: 0.72rem;
  font-weight: 800;
}

.status--leave_later {
  color: #005c99;
  background: #dceffc;
}

.status--leave_now {
  color: #765000;
  background: #fff0c2;
}

.status--run {
  color: #962c20;
  background: #ffe0da;
}

.status--unreachable {
  color: #455b69;
  background: #e6edf1;
}

.empty-state {
  padding: 52px 22px;
  border: 1px solid #bdd0dc;
  border-top: 6px solid #0078d4;
  border-radius: 7px;
  background: #fff;
  text-align: center;
}

.empty-state h2 {
  margin-bottom: 8px;
}

.empty-state p {
  max-width: 560px;
  margin: 0 auto 22px;
  color: #526f81;
}

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 3px 0;
  color: #526f81;
  font-size: 0.76rem;
}

.tile-dialog {
  width: min(680px, calc(100% - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  border: 1px solid #89a7ba;
  border-top: 7px solid #0078d4;
  border-radius: 7px;
  color: #002b45;
  background: #fff;
}

.tile-dialog::backdrop {
  background: rgb(0 43 69 / 55%);
}

.tile-dialog form {
  padding: 22px;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.dialog-header h2 {
  margin: 0;
  font-size: 1.75rem;
}

.dialog-header .icon-button {
  min-width: 36px;
  font-size: 1.2rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
}

.field {
  display: grid;
  gap: 7px;
  color: #173e56;
  font-size: 0.84rem;
  font-weight: 800;
}

.field--wide {
  grid-column: 1 / -1;
}

.field small {
  color: #607888;
  font-weight: 400;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #8ba8ba;
  border-radius: 3px;
  color: #002b45;
  background: #fff;
}

.field input,
.field select {
  min-height: 44px;
  padding: 9px 10px;
}

.field textarea {
  min-height: 82px;
  padding: 10px;
  resize: vertical;
}

.form-error {
  margin: 17px 0 0;
  padding: 10px 12px;
  border-left: 4px solid #b23a2d;
  color: #962c20;
  background: #fff1ee;
  font-size: 0.84rem;
  font-weight: 700;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #d7e2e9;
}

@media (max-width: 920px) {
  .tile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .board-shell {
    width: min(100% - 20px, 520px);
    padding-top: 28px;
  }

  .page-header {
    display: grid;
    gap: 20px;
  }

  .page-header .button {
    width: 100%;
  }

  .toolbar {
    align-items: flex-start;
  }

  .tile-grid {
    grid-template-columns: 1fr;
  }

  .connection-tile {
    min-height: 285px;
  }

  .page-footer,
  .form-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .field--wide {
    grid-column: auto;
  }

  .dialog-actions {
    display: grid;
  }

  .dialog-actions .button--primary {
    grid-row: 1;
  }
}
