:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  line-height: 1.5;
  font-weight: 400;
  color: #0f172a;
  background-color: #f5f5f5;
  --site-header-bg: #2f3e51;
  --site-header-border: rgba(255, 255, 255, 0.15);
  --site-header-link: #ffffff;
  --site-header-link-hover: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

input {
  font: inherit;
}

input[type="number"] {
  appearance: auto;
  -webkit-appearance: auto;
  -moz-appearance: auto;
}

.page {
  min-height: calc(100vh - 58px);
  padding: 32px;
}

.site-header {
  background: var(--site-header-bg);
  border-bottom: 1px solid var(--site-header-border);
}

.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.site-logo img {
  height: 60px;
  max-height: 60px;
  width: auto;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-nav-link {
  display: inline-block;
  text-decoration: none;
  font-weight: 600;
  color: var(--site-header-link);
}

.site-nav-link:hover,
.site-nav-link:focus {
  text-decoration: underline;
  color: var(--site-header-link-hover);
  outline: none;
}

.hero {
  max-width: 1100px;
  margin: 0 auto 24px;
  background: #ffffff;
  border-radius: 16px;
  padding: 28px 32px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.eyebrow {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
  margin: 0 0 8px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 1.8rem;
}

.subhead {
  margin: 0;
  color: #475569;
  max-width: 720px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1fr);
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.panel--full {
  grid-column: 1 / -1;
}

.panel {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.panel h2 {
  margin: 0 0 16px;
  font-size: 1.2rem;
}

.section {
  border-top: 1px solid #e2e8f0;
  padding-top: 16px;
  margin-top: 16px;
}

.section:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.section h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: #0f172a;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.field--inline {
  flex-direction: row;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.field__label {
  color: #475569;
  font-size: 0.92rem;
}

.field__control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field__control--inline {
  align-items: center;
  gap: 12px;
}

.range-pair {
  display: grid;
  gap: 8px;
  width: 100%;
}

.range-pair__track {
  position: relative;
  height: 18px;
  display: flex;
  align-items: center;
  background: #e2e8f0;
  border-radius: 999px;
  touch-action: none;
}

.range-input--hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.range-pair__track input[type="range"] {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  max-width: none;
  margin: 0;
  background: transparent;
  pointer-events: auto;
  z-index: 2;
}

.range-pair__fill {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 6px;
  background: #2563eb;
  border-radius: 999px;
  left: 0;
  width: 0%;
  z-index: 1;
  pointer-events: none;
}

.range-thumb {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #2563eb;
  transform: translate(-50%, -50%);
  z-index: 2;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
}

.range-pair__inputs {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-input {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #475569;
}

.range-input input {
  width: 72px;
  text-align: center;
}

.number-input-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.spinner {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}

.spinner button {
  width: 24px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid #cbd5f5;
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
}

.spinner button:active {
  transform: translateY(1px);
}

.number-spinner {
  display: none;
}

.number-spinner--inside {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 2;
}

.number-spinner--inside button {
  width: 20px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid #cbd5f5;
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.65rem;
  line-height: 1;
  cursor: pointer;
}

.number-spinner--inside button:active {
  transform: translateY(1px);
}


.field__control input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #cbd5f5;
  background: #f8fafc;
}

input[type="range"] {
  flex: 1 1 auto;
  width: 100%;
  max-width: min(100%, 360px);
  margin: 6px 0 2px;
  accent-color: #2563eb;
}

.field__control input[type="number"] {
  flex: 0 0 auto;
  width: 96px;
  max-width: 100%;
  text-align: center;
}

.field__unit {
  font-size: 0.85rem;
  color: #64748b;
  background: #f1f5f9;
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #475569;
}

.assumptions {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #f8fafc;
  color: #475569;
}

.assumptions summary {
  cursor: pointer;
  font-weight: 600;
  color: #0f172a;
}

.results {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.results__actions {
  display: flex;
  justify-content: flex-end;
}

.button {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid #cbd5f5;
  background: #2563eb;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

.button:hover,
.button:focus {
  background: #1d4ed8;
  outline: none;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.summary {
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 16px;
}

.summary__header h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.summary__header p {
  margin: 0 0 12px;
  color: #64748b;
  font-size: 0.85rem;
}

.summary__content {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  align-items: center;
}

.summary__pie {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: conic-gradient(#cbd5f5 0% 100%);
}

.summary__pie::after {
  content: "";
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  background: #ffffff;
}

.summary__list {
  display: grid;
  gap: 8px;
}

.summary__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 6px 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.85rem;
}

.summary__item--completed {
  border-color: #16a34a;
}

.summary__item--delayed {
  border-color: #f59e0b;
}

.summary__item--not-completed {
  border-color: #ef4444;
}

.summary__label {
  color: #475569;
  font-weight: 600;
}

.summary__value {
  font-weight: 600;
  color: #0f172a;
}

.kpi {
  padding: 16px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.kpi--green {
  border-color: #16a34a;
  background: #ecfdf3;
}

.kpi--amber {
  border-color: #f59e0b;
  background: #fffbeb;
}

.kpi--red {
  border-color: #ef4444;
  background: #fef2f2;
}

.kpi__label {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: #475569;
}

.kpi__value {
  margin: 0 0 6px;
  font-size: 1.6rem;
  font-weight: 600;
  color: #0f172a;
}

.kpi__hint {
  margin: 0;
  font-size: 0.82rem;
  color: #64748b;
}

.table {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.table__header {
  padding: 12px 16px;
  background: #f1f5f9;
  font-weight: 600;
}

.table__row {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
  color: #0f172a;
}

.table__row--heading {
  font-weight: 600;
  background: #f8fafc;
}

.report .table__row,
.report .table__row--heading {
  display: grid;
  grid-template-columns: 90px 110px 110px 110px 140px 110px;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.report .table__row span,
.report .table__row--heading span {
  text-align: right;
}

.report .table__row span:first-child,
.report .table__row--heading span:first-child,
.report .table__row span:nth-child(2),
.report .table__row--heading span:nth-child(2) {
  text-align: left;
}

.report .table__row--delayed {
  background: #fffbeb;
}

.report .table__row--delayed span {
  color: #b45309;
}

.report .table__row--not-completed {
  background: #fef2f2;
}

.report .table__row--not-completed span {
  color: #b91c1c;
}

.table__row--total {
  font-weight: 600;
}

.timeline {
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  padding: 16px;
  background: #ffffff;
}

.timeline__header h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.timeline__header p {
  margin: 0 0 12px;
  color: #64748b;
  font-size: 0.85rem;
}

.timeline__axis {
  display: grid;
  grid-template-columns: 90px repeat(6, 1fr);
  gap: 8px;
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 12px;
}

.timeline__axis span {
  text-align: center;
}

.timeline__rows {
  display: grid;
  gap: 10px;
}

.timeline__row {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: center;
  gap: 12px;
}

.timeline__label {
  font-size: 0.85rem;
  color: #475569;
}

.timeline__bar {
  position: relative;
  height: 18px;
  border-radius: 999px;
  background: #f1f5f9;
  overflow: hidden;
}

.timeline__ticks {
  position: absolute;
  inset: 0;
  display: grid;
  pointer-events: none;
}

.timeline__tick {
  border-left: 1px solid rgba(148, 163, 184, 0.45);
  height: 100%;
}

.timeline__fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}

.timeline__segment {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}

.timeline__segment--outbound {
  background: linear-gradient(90deg, #14b8a6, #5eead4);
}

@media (max-width: 900px) {
  .page {
    padding: 16px;
  }

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

  .hero {
    padding: 20px;
  }

  .field__control {
    flex-wrap: wrap;
  }

  input[type="range"] {
    max-width: 280px;
  }

  .number-spinner {
    display: flex;
  }

  .field__control input[type="number"] {
    width: 88px;
    padding-right: 30px;
  }

  .field__unit {
    white-space: nowrap;
  }

  .report .table {
    overflow: visible;
  }
}

@media (max-width: 600px) {
  .timeline {
    display: none;
  }

  input[type="range"] {
    max-width: 220px;
  }

  .field__control input[type="number"] {
    width: 80px;
  }

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

  .summary__content {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .summary__pie {
    width: 120px;
    height: 120px;
  }

  .summary__pie::after {
    inset: 28px;
  }

  .report .table__row--heading {
    display: none;
  }

  .report .table__row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    text-align: left;
  }

  .report .table__row span {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 10px;
    text-align: left;
  }

  .report .table__row span::before {
    text-align: left;
    font-weight: 600;
    color: #475569;
  }

  .report .table__row span:first-child::before {
    content: "Vehicle";
  }

  .report .table__row span:nth-child(2)::before {
    content: "Type";
  }

  .report .table__row span:nth-child(3)::before {
    content: "Arrival";
  }

  .report .table__row span:nth-child(4)::before {
    content: "Start";
  }

  .report .table__row span:nth-child(5)::before {
    content: "Completed";
  }

  .report .table__row span:nth-child(6)::before {
    content: "Delay";
  }
}
