:root {
  color-scheme: dark;
  --page: #0b0f14;
  --ink: #f4f7fb;
  --muted: #92a0ae;
  --panel: #151b22;
  --panel-soft: #10161d;
  --panel-strong: #1d2630;
  --line: #293542;
  --line-strong: #415264;
  --navy: #ecf2f8;
  --navy-2: #c8d5e0;
  --teal: #25c2a0;
  --teal-dark: #0d8d79;
  --teal-soft: rgba(37, 194, 160, 0.14);
  --coral: #ff7a59;
  --red: #ff5f7a;
  --amber: #ffc857;
  --blue: #6aa6ff;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
  --shadow-low: 0 16px 34px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

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

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: auto;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #111820;
  color: var(--ink);
  padding: 16px 18px;
  box-shadow: var(--shadow-low);
}

.top-actions {
  display: contents;
}

.clock {
  min-width: 194px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #090d12;
  color: var(--ink);
  padding: 10px 15px 12px;
  text-align: right;
}

.clock span {
  display: block;
  font-size: clamp(2rem, 4vw, 3.35rem);
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.eyebrow,
.panel-kicker {
  margin: 0;
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar .eyebrow {
  width: fit-content;
  margin-bottom: 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f3c5ad;
  padding: 6px 10px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 520px;
  font-size: clamp(2.1rem, 5vw, 3.8rem);
  line-height: 0.95;
}

h2 {
  font-size: 1.05rem;
}

.workspace {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.sidebar,
.route-editor,
.board {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow-low);
}

.sidebar {
  position: sticky;
  top: 16px;
  min-height: 480px;
  padding: 16px;
}

.section-head,
.board-head,
.editor-head,
.actions,
.form-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-head,
.board-head,
.editor-head {
  justify-content: space-between;
}

.route-list {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.route-item {
  width: 100%;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
  color: var(--ink);
  padding: 14px;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.route-item:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: #17212b;
}

.route-item.active {
  border-color: rgba(37, 194, 160, 0.62);
  background: #122822;
  box-shadow: inset 4px 0 0 var(--teal);
}

.route-item strong,
.result-main strong {
  display: block;
  font-size: 0.98rem;
}

.route-item strong {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.route-via {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  border-radius: 8px;
  padding: 4px 8px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
}

.route-kind {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 200, 87, 0.16);
  font-size: 1rem;
}

.route-item.meal-route {
  border-style: dashed;
  background: #17151c;
}

.route-item.meal-route.active {
  border-color: rgba(255, 200, 87, 0.68);
  background: #241d13;
  box-shadow: inset 4px 0 0 var(--amber);
}

.route-item.launch-route {
  border-style: dashed;
  background: #101724;
}

.route-item.launch-route.active {
  border-color: rgba(106, 166, 255, 0.68);
  background: #111f35;
  box-shadow: inset 4px 0 0 var(--blue);
}

.route-item span,
.result-main span,
#boardMeta {
  color: var(--muted);
  font-size: 0.88rem;
}

.route-item .route-via {
  color: #fff;
  font-size: 0.72rem;
}

.line-chain {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.line-chain span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(37, 194, 160, 0.28);
  border-radius: 8px;
  background: rgba(37, 194, 160, 0.12);
  color: #b6fff0;
  padding: 5px 10px;
  font-size: 0.86rem;
  font-weight: 850;
}

.line-chain .transfer-chip {
  background: rgba(242, 179, 65, 0.18);
  border-color: rgba(242, 179, 65, 0.42);
  color: #ffd88a;
}

.line-chain .line-alternatives {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
  background: rgba(216, 231, 255, 0.08);
  border-color: rgba(216, 231, 255, 0.24);
  color: #e6eef7;
}

.line-alternatives em {
  display: grid;
  gap: 2px;
  min-width: 92px;
  border: 1px solid rgba(216, 231, 255, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  padding: 5px 7px;
  font-style: normal;
}

.line-alternatives strong {
  color: #f1f6fb;
  font-size: 0.82rem;
  line-height: 1.1;
}

.line-alternatives small {
  color: #aebdca;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.15;
}

.line-chain span + span {
  position: relative;
  margin-left: 16px;
}

.line-chain span + span::before {
  content: "→";
  position: absolute;
  left: -18px;
  margin-right: 8px;
  color: var(--muted);
}

.trip-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.via-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 8px;
  padding: 5px 10px;
  background: #171717;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 900;
}

.origin-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(237, 243, 248, 0.24);
  border-radius: 8px;
  background: rgba(237, 243, 248, 0.09);
  color: #e9f1f8;
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: 900;
}

.via-hbf {
  background: var(--teal-dark);
}

.via-sued {
  background: #b94b33;
}

.content {
  display: grid;
  gap: 16px;
}

.route-editor {
  padding: 18px;
}

.editor-head {
  margin-bottom: 16px;
}

.form-row {
  align-items: flex-start;
  margin-bottom: 14px;
}

.form-row.compact label:first-child {
  flex: 1.6;
}

label {
  display: grid;
  gap: 7px;
  flex: 1;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0e141a;
  color: var(--ink);
  padding: 11px 13px;
}

textarea {
  resize: vertical;
  line-height: 1.35;
}

input::placeholder,
textarea::placeholder {
  color: #8a94a0;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  outline: 4px solid rgba(0, 163, 143, 0.13);
}

.journey-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-soft);
  padding: 12px;
}

.route-arrow {
  display: grid;
  place-items: center;
  width: 42px;
  height: 48px;
  border-radius: 14px;
  background: var(--navy);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
}

.route-arrow::before {
  content: "→";
}

.stop-picker {
  position: relative;
}

.suggestions {
  position: absolute;
  z-index: 5;
  top: 73px;
  right: 0;
  left: 0;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.suggestions:empty {
  display: none;
}

.suggestion {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  padding: 12px;
  text-align: left;
}

.suggestion:last-child {
  border-bottom: 0;
}

.suggestion:hover {
  background: var(--panel-strong);
}

.mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mode-row label {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  padding: 8px 12px;
  color: var(--ink);
  font-weight: 750;
}

.mode-row input {
  width: auto;
  min-height: auto;
  accent-color: var(--teal);
}

.primary-button,
.text-button,
.ghost-button,
.icon-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0 15px;
  font-weight: 800;
}

.primary-button {
  background: var(--teal);
  color: #03120f;
  box-shadow: 0 10px 20px rgba(37, 194, 160, 0.16);
}

.primary-button:hover {
  background: var(--teal-dark);
}

.text-button,
.ghost-button,
.icon-button {
  background: #0e141a;
  border-color: var(--line);
  color: var(--ink);
}

.icon-button {
  width: 48px;
  min-width: 48px;
  justify-self: end;
  align-self: center;
  border-color: var(--line);
  background: #0c1218;
  color: var(--ink);
  padding: 0;
  font-size: 1.35rem;
}

.ghost-button {
  color: var(--red);
}

.board {
  min-height: 390px;
  padding: 18px;
}

.status-pill {
  min-width: 76px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #0e141a;
  color: var(--muted);
  padding: 8px 11px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 800;
}

.status-pill.loading {
  background: var(--teal-soft);
  color: #b6fff0;
}

.status-pill.error {
  background: #fae8ea;
  color: var(--red);
}

.results {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.route-note {
  margin: 14px 0 0;
  border: 1px solid rgba(0, 163, 143, 0.22);
  border-radius: 12px;
  background: var(--teal-soft);
  color: #b6fff0;
  padding: 12px 14px;
  font-size: 0.9rem;
  line-height: 1.35;
}

.results.empty {
  min-height: 235px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--panel-soft);
  color: var(--muted);
  text-align: center;
  padding: 20px;
}

.feed-results {
  gap: 14px;
}

.meal-results {
  gap: 18px;
}

.feed-section {
  display: grid;
  gap: 10px;
}

.feed-section-head {
  display: grid;
  gap: 3px;
  border-bottom: 1px solid var(--line);
  padding: 4px 0 10px;
}

.feed-section-head strong {
  font-size: 1rem;
}

.feed-section-head span {
  color: var(--muted);
  font-size: 0.88rem;
}

.feed-section-body {
  display: grid;
  gap: 10px;
}

.inline-empty {
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--panel-soft);
  color: var(--muted);
  padding: 14px;
  text-align: center;
}

.meal-plan {
  border-top: 1px solid var(--line);
  padding-top: 2px;
}

.meal-canteens {
  display: grid;
  gap: 14px;
}

.meal-canteen {
  display: grid;
  gap: 9px;
}

.meal-canteen h3 {
  margin: 0;
  color: #ffe2a1;
  font-size: 0.98rem;
}

.meal-list {
  display: grid;
  gap: 9px;
}

.meal-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(255, 200, 87, 0.25);
  border-radius: 14px;
  background: #141317;
  padding: 14px;
}

.meal-main {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.meal-main strong {
  overflow-wrap: anywhere;
  font-size: 0.96rem;
  line-height: 1.3;
}

.meal-head {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.meal-type,
.meal-diet {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 900;
}

.meal-type {
  background: rgba(255, 200, 87, 0.16);
  color: #ffe2a1;
}

.meal-diet {
  background: rgba(37, 194, 160, 0.14);
  color: #b6fff0;
}

.meal-price {
  display: grid;
  gap: 2px;
  justify-items: end;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.meal-price strong {
  color: #fff;
  font-size: 1.08rem;
}

.meal-price span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.result-row {
  display: grid;
  grid-template-columns: 106px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0f151c;
  padding: 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.result-row-alternatives {
  align-items: start;
  grid-template-columns: 106px minmax(0, 1fr) 72px;
}

.result-row-alternatives .badge {
  margin-top: 2px;
}

.result-row-alternatives .trip-head strong {
  color: #d9e4ed;
}

.time {
  color: #ffffff;
  font-size: 1.62rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.multi-times {
  display: grid;
  gap: 8px;
}

.multi-times div {
  display: grid;
  gap: 2px;
}

.multi-times strong {
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.multi-times span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.delay {
  color: var(--amber);
  font-size: 0.82rem;
  font-weight: 850;
}

.mini-delay {
  color: var(--amber);
  font-style: normal;
  font-weight: 950;
}

.badge {
  min-width: 48px;
  border-radius: 10px;
  background: #edf3f8;
  color: #091018;
  padding: 9px 12px;
  text-align: center;
  font-weight: 850;
}

.launch-result {
  align-items: start;
  grid-template-columns: 106px minmax(0, 1fr) 132px;
  background:
    linear-gradient(135deg, rgba(216, 231, 255, 0.08), rgba(37, 194, 160, 0.05)),
    var(--panel);
  border-color: rgba(216, 231, 255, 0.18);
}

.launch-headline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.launch-description {
  max-width: 620px;
  margin: 7px 0 0;
  color: #c4d0dc;
  font-size: 0.86rem;
  line-height: 1.35;
}

.launch-badge {
  background: #d8e7ff;
  width: 132px;
  max-width: 132px;
  overflow-wrap: anywhere;
}

.launch-info {
  margin-top: 7px;
}

.launch-info summary {
  width: fit-content;
  color: #d8e7ff;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 900;
}

.launch-info dl {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
}

.launch-info dl div {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 10px;
}

.launch-info dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.launch-info dd {
  margin: 0;
  color: #e5edf5;
  font-size: 0.82rem;
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .app-shell {
    width: min(100% - 20px, 680px);
    padding: 10px 0 24px;
  }

  .topbar {
    grid-template-columns: 1fr;
    min-height: auto;
    border-radius: 18px;
    padding: 14px;
    gap: 12px;
  }

  .clock {
    width: 100%;
    min-width: 0;
    text-align: left;
  }

  .clock span {
    font-size: clamp(2.4rem, 13vw, 3.4rem);
  }

  .icon-button {
    position: absolute;
    right: 24px;
    top: 24px;
    width: 40px;
    min-width: 40px;
    min-height: 40px;
    font-size: 1.1rem;
  }

  h1 {
    font-size: clamp(2.15rem, 12vw, 3.4rem);
  }

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

  .sidebar {
    position: static;
    min-height: auto;
  }

  .editor-head,
  .form-row,
  .board-head {
    display: grid;
  }

  .actions {
    width: 100%;
  }

  .actions button {
    flex: 1;
  }

  .journey-fields {
    grid-template-columns: 1fr;
  }

  .route-arrow {
    width: 100%;
    height: 34px;
    font-size: 0;
  }

  .route-arrow::before {
    content: "↓";
    font-size: 1.1rem;
  }

  .result-row {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 10px;
  }

  .meal-row {
    grid-template-columns: 1fr;
  }

  .meal-price {
    justify-items: start;
    text-align: left;
  }

  .badge {
    grid-column: 2;
    width: fit-content;
  }

  .launch-result {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .launch-badge {
    width: fit-content;
    max-width: 100%;
  }
}
