:root {
  --bg: #eef2ed;
  --surface: #ffffff;
  --surface-soft: #eef3ee;
  --surface-raised: rgba(255, 255, 255, 0.78);
  --surface-control: #eef1ed;
  --surface-control-hover: #e6ebe7;
  --ink: #17201b;
  --muted: #68746d;
  --muted-strong: #46514a;
  --muted-soft: #9aa39e;
  --line: #d7ded6;
  --line-strong: #b8c4bb;
  --accent: #166c63;
  --accent-hover: #11574f;
  --accent-soft: #dcefeb;
  --accent-shadow: rgba(22, 108, 99, 0.18);
  --warn: #9c5b13;
  --warn-soft: #fff1d8;
  --danger: #a03333;
  --danger-soft: #f8dfdf;
  --now: #d92d20;
  --lane-bg: #ffffff;
  --lane-hover-bg: #f4fbf9;
  --lane-blocked-bg: #fff7f7;
  --incoming-list-bg: #f5f6f4;
  --card-shadow: rgba(23, 32, 27, 0.08);
  --slot-height: 116px;
  --header-height: 74px;
  --timeline-card-min-height: 112px;
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1614;
  --surface: #18221f;
  --surface-soft: #121c19;
  --surface-raised: rgba(24, 34, 31, 0.86);
  --surface-control: #24302d;
  --surface-control-hover: #2c3a36;
  --ink: #dce7e1;
  --muted: #9cada5;
  --muted-strong: #c6d1cb;
  --muted-soft: #788a82;
  --line: #2b3834;
  --line-strong: #40504b;
  --accent: #54d0bf;
  --accent-hover: #78ddcf;
  --accent-soft: #193f3a;
  --accent-shadow: rgba(84, 208, 191, 0.18);
  --warn: #f1c665;
  --warn-soft: #49371d;
  --danger: #ff8a8a;
  --danger-soft: #4a2426;
  --now: #ff5c54;
  --lane-bg: #131c19;
  --lane-hover-bg: #182823;
  --lane-blocked-bg: #2b1b1d;
  --incoming-list-bg: #111a17;
  --card-shadow: rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 0;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

body.modal-open {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

.dashboard {
  height: 100vh;
  padding: 14px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.topbar {
  min-height: 52px;
  padding-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.brand-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 8px 18px var(--accent-shadow);
  text-decoration: none;
}

.brand-icon svg {
  width: 19px;
  height: 19px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.brand-icon:focus-visible {
  outline: 3px solid rgba(22, 108, 99, 0.24);
  outline-offset: 3px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 1.25vw, 26px);
  margin-left: clamp(24px, 4vw, 82px);
  padding: 0;
}

.main-nav a {
  position: relative;
  padding: 8px 0;
  color: var(--muted-soft);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.main-nav a:hover {
  color: var(--muted);
}

.main-nav a.active {
  color: var(--accent);
  font-weight: 800;
}

.main-nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
}

.mobile-rotation-menu {
  display: none;
}

.mobile-page-header,
.mobile-navigation-menu,
.mobile-portrait-message {
  display: none;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 21px;
  line-height: 1.1;
}

h2 {
  font-size: 16px;
  line-height: 1.2;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
}

.theme-toggle-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.theme-toggle-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle-button:focus-visible {
  outline: 3px solid rgba(22, 108, 99, 0.2);
  outline-offset: 2px;
}

.theme-toggle-track {
  position: relative;
  width: 36px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--surface-control);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.theme-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 2px 6px rgba(23, 32, 27, 0.22);
  transition:
    transform 160ms ease,
    background 160ms ease;
}

.theme-toggle-button[aria-pressed="true"] .theme-toggle-track {
  background: var(--accent);
  box-shadow: none;
}

.theme-toggle-button[aria-pressed="true"] .theme-toggle-thumb {
  transform: translateX(16px);
  background: #ffffff;
}

.action-group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
}

.action-button {
  min-width: 76px;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.action-button.primary {
  border: 0;
  background: var(--accent);
  color: #ffffff;
}

.action-button.primary:hover {
  background: var(--accent-hover);
}

.action-button.warning {
  border: 0;
  background: var(--accent);
  color: #ffffff;
}

.action-button.warning:hover {
  background: var(--accent-hover);
  color: #ffffff;
}

.action-button.secondary {
  background: transparent;
  color: var(--muted-strong);
}

.action-button.secondary:hover {
  background: var(--surface-control);
  color: var(--ink);
}

.parse-depth-select {
  min-height: 34px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  outline: none;
}

.parse-depth-select:hover,
.parse-depth-select:focus {
  border-color: var(--accent);
}

.parse-depth-select.compact {
  width: 58px;
  min-height: 34px;
  padding-left: 7px;
  padding-right: 22px;
}

.action-divider {
  width: 1px;
  height: 26px;
  background: var(--line-strong);
}

.board-shell {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: 64px minmax(720px, 1fr) 330px;
  gap: 10px;
}

.time-column,
.fleet-board,
.incoming-panel {
  min-height: 0;
  min-width: 0;
}

.time-column {
  display: grid;
  grid-template-rows: var(--header-height) 1fr;
}

.vehicle-header {
  min-height: var(--header-height);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--surface);
}

.vehicle-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.vehicle-header strong {
  display: block;
  font-size: 15px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vehicle-header .vehicle-type-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.vehicle-type-label svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--muted-soft);
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.driver-select {
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 4px 28px 4px 9px;
  border: 0;
  border-radius: 6px;
  appearance: none;
  -webkit-appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 14px) 12px / 5px 5px
      no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 9px) 12px / 5px 5px
      no-repeat,
    var(--surface-control);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  cursor: pointer;
}

.driver-select:hover {
  background:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%) calc(100% - 14px) 12px / 5px 5px
      no-repeat,
    linear-gradient(135deg, var(--ink) 50%, transparent 50%) calc(100% - 9px) 12px / 5px 5px
      no-repeat,
    var(--surface-control-hover);
  color: var(--ink);
}

.driver-select:focus {
  outline: 2px solid rgba(22, 108, 99, 0.16);
  outline-offset: 1px;
}

.driver-select:disabled {
  background: var(--surface-soft);
  color: var(--muted-soft);
  cursor: not-allowed;
  opacity: 1;
}

.vehicle-header.muted {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.time-date-header {
  align-content: center;
  gap: 2px;
  line-height: 1;
}

.time-date-header span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.time-date-header strong {
  color: var(--accent);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0;
}

.time-axis,
.vehicle-grid {
  overflow-y: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.time-axis::-webkit-scrollbar,
.vehicle-grid::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.time-axis {
  position: relative;
  background: var(--surface-soft);
  border-left: 1px solid var(--line);
}

.time-tick {
  height: var(--slot-height);
  padding-top: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.time-tick.day-start {
  border-top: 2px solid var(--accent);
  background: var(--accent-soft);
}

.time-tick span,
.time-tick small {
  display: block;
}

.time-tick small {
  margin-top: 4px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
}

.fleet-board {
  display: grid;
  grid-template-rows: var(--header-height) 1fr;
  overflow: hidden;
}

.vehicle-headers,
.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(var(--vehicle-count), minmax(132px, 1fr));
}

.vehicle-headers {
  gap: 8px;
}

.vehicle-grid {
  gap: 8px;
}

.vehicle-lane {
  position: relative;
  min-height: calc(var(--slot-height) * var(--hour-count));
  border-inline: 1px solid var(--line);
  background:
    repeating-linear-gradient(
      to bottom,
      var(--lane-bg) 0,
      var(--lane-bg) calc(var(--slot-height) - 1px),
      var(--line) calc(var(--slot-height) - 1px),
      var(--line) var(--slot-height)
    );
}

.day-separator {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  height: 0;
  border-top: 2px solid rgba(22, 108, 99, 0.55);
  pointer-events: none;
}

.day-separator span {
  position: absolute;
  top: -10px;
  left: 8px;
  padding: 2px 6px;
  border: 1px solid rgba(22, 108, 99, 0.24);
  border-radius: 6px;
  background: var(--surface);
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
}

.now-line {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 5;
  height: 0;
  border-top: 2px solid var(--now);
  pointer-events: none;
}

.time-axis .now-line::before {
  content: "";
  position: absolute;
  top: -5px;
  right: -5px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--now);
}

.vehicle-lane .now-line {
  z-index: 4;
}

.drop-preview {
  position: absolute;
  left: 5px;
  right: 5px;
  z-index: 3;
  border: 1px solid rgba(23, 32, 27, 0.12);
  border-radius: var(--radius);
  background: rgba(23, 32, 27, 0.07);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
  pointer-events: none;
}

.connection-note {
  position: absolute;
  left: 8px;
  right: 8px;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid rgba(22, 108, 99, 0.28);
  border-radius: 7px;
  background: #eef8f1;
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.1;
  box-shadow: 0 8px 18px rgba(23, 32, 27, 0.11);
  pointer-events: none;
}

.connection-note span,
.connection-note b,
.connection-note i,
.connection-note small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-note b {
  justify-self: center;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.1;
  text-transform: uppercase;
}

.connection-note i {
  width: 1px;
  height: 1px;
}

.connection-note small {
  justify-self: end;
  font-size: 10px;
  font-weight: 750;
  color: rgba(22, 108, 99, 0.82);
}

.connection-note.is-best {
  border-width: 2px;
  background: #e3f5ea;
  box-shadow:
    0 10px 22px rgba(22, 108, 99, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.58);
}

.connection-note.is-tight {
  border-color: rgba(170, 44, 44, 0.35);
  background: #fff0f0;
  color: var(--danger);
}

.connection-note.is-tight small {
  color: rgba(160, 51, 51, 0.86);
}

.connection-note.is-tight b {
  background: var(--danger);
}

.vehicle-lane.drag-over {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background:
    repeating-linear-gradient(
      to bottom,
      var(--lane-hover-bg) 0,
      var(--lane-hover-bg) calc(var(--slot-height) - 1px),
      var(--line-strong) calc(var(--slot-height) - 1px),
      var(--line-strong) var(--slot-height)
    );
}

.vehicle-lane.connection-best {
  box-shadow: inset 0 0 0 2px rgba(22, 108, 99, 0.28);
}

.vehicle-lane.drop-blocked {
  outline: 2px solid var(--danger);
  outline-offset: -2px;
  cursor: not-allowed;
  background:
    repeating-linear-gradient(
      to bottom,
      var(--lane-blocked-bg) 0,
      var(--lane-blocked-bg) calc(var(--slot-height) - 1px),
      #e5c5c5 calc(var(--slot-height) - 1px),
      #e5c5c5 var(--slot-height)
    );
}

.incoming-panel {
  display: grid;
  grid-template-rows: var(--header-height) 1fr;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: visible;
}

.incoming-header {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.dashboard-last-parse {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0.72;
}

.incoming-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.incoming-count-badge {
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.parse-depth-control + .icon-button {
  margin-left: -4px;
}

.icon-button svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.icon-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.incoming-list {
  min-height: 0;
  height: 100%;
  padding: 10px;
  background: var(--incoming-list-bg);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.incoming-day-header {
  margin: 4px 0 -2px;
  padding: 4px 2px 2px;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
}

.order-card {
  position: relative;
  width: calc(100% - 10px);
  min-height: 82px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 18px var(--card-shadow);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.order-card:active {
  cursor: grabbing;
}

.order-card.mobile-drag-source {
  opacity: 0.28;
}

.mobile-drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  pointer-events: none;
  opacity: 0.92;
  transform-origin: 0 0;
  box-shadow: 0 16px 32px rgba(23, 32, 27, 0.18);
}

body.mobile-dragging {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.vehicle-lane .order-card {
  position: absolute;
  left: 5px;
  z-index: 2;
  min-height: 112px;
  transform: translate(var(--timeline-overlap-offset, 0), var(--timeline-overlap-offset, 0));
}

.order-card.compact {
  min-height: 82px;
}

.order-card[data-direction="from-airport"] {
  border-left-color: #f0c84b;
}

.order-card[data-direction="to-airport"] {
  border-left-color: var(--accent);
}

.order-card[data-direction="other"] {
  border-left-color: #8b5d22;
}

.order-card.is-past {
  opacity: 0.48;
  filter: grayscale(0.75);
  box-shadow: none;
}

.order-card.is-past .order-time,
.order-card.is-past .badge {
  color: var(--muted);
}

.order-card.is-assigned {
  border-color: rgba(22, 108, 99, 0.34);
  background: var(--lane-hover-bg);
}

.order-card.is-split-order {
  border-color: rgba(112, 74, 190, 0.34);
  border-left-color: #8d6bd8;
  background: #f7f3ff;
  box-shadow: 0 10px 22px rgba(112, 74, 190, 0.13);
}

.order-card.is-split-order .badge {
  border-color: rgba(112, 74, 190, 0.42);
  color: #6b4cb3;
}

.order-card.is-split-order.is-assigned {
  border-color: rgba(22, 108, 99, 0.34);
  border-left-color: var(--accent);
  background: var(--lane-hover-bg);
  box-shadow: 0 8px 18px var(--card-shadow);
}

.order-card.is-split-order.is-assigned .badge {
  border-color: rgba(22, 108, 99, 0.28);
  color: var(--accent);
}

.delay-block {
  position: absolute;
  left: 5px;
  right: 5px;
  z-index: 1;
  border: 1px dashed #b8c0ba;
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(104, 116, 109, 0.12) 0,
      rgba(104, 116, 109, 0.12) 7px,
      rgba(255, 255, 255, 0.44) 7px,
      rgba(255, 255, 255, 0.44) 14px
    );
  color: var(--muted);
  overflow: hidden;
  pointer-events: none;
}

.delay-block span {
  display: block;
  padding: 6px 8px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.delay-block.is-negative {
  border-color: rgba(67, 114, 180, 0.36);
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(67, 114, 180, 0.13) 0,
      rgba(67, 114, 180, 0.13) 7px,
      rgba(237, 245, 255, 0.62) 7px,
      rgba(237, 245, 255, 0.62) 14px
    );
  color: #496b9a;
}

.order-main {
  display: grid;
  gap: 5px;
  min-height: 0;
  padding-right: 58px;
}

.order-card-head {
  display: none;
}

.order-meta {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 11px;
  line-height: 1.15;
}

.order-source {
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-time {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.order-time.delayed {
  display: inline-flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 1px;
}

.order-time.early-arrival {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.order-scheduled-time {
  color: var(--accent);
  font-weight: 800;
}

.order-early-flight-time {
  color: #b48700;
  font-weight: 400;
}

.order-original-time {
  color: #98a39f;
  font-weight: 400;
}

.order-delayed-time {
  color: #b23838;
  font-weight: 900;
}

.order-route {
  display: grid;
  gap: 5px;
  margin-bottom: 3px;
  transform: translateY(2px);
  color: var(--ink);
  font-size: 11px;
  line-height: 1.2;
  min-width: 0;
}

.order-route span {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  min-width: 0;
}

.order-route strong {
  min-width: 0;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
}

.route-dot.from {
  border: 1.5px solid rgba(22, 108, 99, 0.72);
  background: transparent;
}

.route-dot.to {
  background: rgba(22, 108, 99, 0.82);
}

.arrival-flight-warning {
  position: absolute;
  top: 26px;
  right: 10px;
  z-index: 2;
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  color: #e63b31;
  pointer-events: none;
}

.arrival-flight-warning svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.order-footer {
  display: grid;
  grid-template-columns: 44px max-content 4px 64px minmax(0, 1fr);
  align-items: center;
  gap: 3px;
  margin-top: auto;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  min-width: 0;
}

.footer-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  min-width: 0;
}

.order-footer .badge {
  width: 44px;
  justify-content: center;
}

.passenger-count {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  margin-left: 3px;
  white-space: nowrap;
}

.footer-separator {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
  text-align: center;
}

.assign-button,
.assign-status {
  flex: 1 1 auto;
  min-height: 20px;
  padding: 3px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.assign-row {
  margin-top: 2px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
}

.assign-button {
  border: 0;
  background: #fff0bd;
  color: #745700;
  cursor: pointer;
}

.assign-button:hover {
  background: #f4d979;
  color: #5c4500;
}

.assign-status {
  background: var(--accent);
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
}

.delay-control {
  position: relative;
  flex: 0 0 auto;
}

.toolbar-secondary-button {
  min-height: 20px;
  padding: 3px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}

.toolbar-secondary-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.toolbar-secondary-button.is-copied {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.delay-select {
  position: relative;
  top: -1px;
  width: 40px;
  min-height: 20px;
  padding-right: 20px;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 12px) 50%,
    calc(100% - 8px) 50%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  text-align: center;
}

.route-stat {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  max-width: 78px;
  min-height: 18px;
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge.sedan {
  background: #fff0bd;
  color: #806000;
}

.badge.van {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.empty-state {
  padding: 18px 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.incoming-empty-state {
  margin-top: 116px;
  display: grid;
  justify-items: center;
  gap: 6px;
}

.incoming-empty-state-icon {
  font-size: 26px;
  line-height: 1;
}

.incoming-loading {
  min-height: 180px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.incoming-loading-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: incoming-spin 900ms linear infinite;
}

@keyframes incoming-spin {
  to {
    transform: rotate(360deg);
  }
}

.order-modal[hidden] {
  display: none;
}

.order-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.order-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 32, 27, 0.38);
}

.order-modal-panel {
  position: relative;
  width: min(680px, 100%);
  max-height: calc(100vh - 48px);
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(23, 32, 27, 0.24);
  overflow: hidden;
}

.order-modal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px 6px;
}

.order-modal-header > div {
  min-width: 0;
}

.order-modal-header h2 {
  font-size: 14px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-close-button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.modal-close-button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.modal-close-button:hover {
  background: transparent;
}

.modal-card-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}

.modal-copy-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.modal-copy-button.is-copied {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.modal-delay-select {
  width: 44px;
  min-width: 44px;
  height: 20px;
  min-height: 20px;
  padding-top: 2px;
  padding-bottom: 2px;
}

.modal-assign-button {
  flex: 0 0 76px;
  width: 76px;
  min-width: 76px;
  max-width: 76px;
  min-height: 20px;
  padding: 3px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-modal-content {
  max-height: calc(100vh - 150px);
  padding: 6px 20px 28px;
  overflow-y: auto;
  display: grid;
  gap: 10px;
}

.modal-detail-scroll {
  display: grid;
  gap: 10px;
}

.route-map-shell {
  position: relative;
  margin-bottom: 6px;
}

.route-map {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #eef3ee;
  overflow: hidden;
}

.google-route-map {
  display: block;
}

.route-map-stat {
  position: absolute;
  left: 50%;
  bottom: 32px;
  z-index: 4;
  transform: translateX(-50%);
  max-width: calc(100% - 128px);
  padding: 5px 10px;
  border: 1px solid rgba(209, 216, 210, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 18px rgba(23, 32, 27, 0.16);
  color: #4f5a55;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.map-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.route-map svg {
  width: 100%;
  height: 100%;
  display: block;
}

.map-road {
  fill: none;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.map-road.secondary {
  stroke: rgba(104, 116, 109, 0.28);
  stroke-width: 2;
}

.map-route {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-dasharray: 1 0;
  vector-effect: non-scaling-stroke;
}

.map-point {
  stroke: #ffffff;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.map-point.start {
  fill: var(--accent);
}

.map-point.end {
  fill: #2f6fb2;
}

.map-label {
  position: absolute;
  transform: translate(-50%, calc(-100% - 8px));
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(23, 32, 27, 0.16);
}

.map-label.start {
  color: var(--accent);
}

.map-label.end {
  color: #2f6fb2;
}

.route-map.unavailable {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.detail-section {
  display: grid;
  gap: 6px;
}

.detail-section + .detail-section {
  padding-top: 0;
}

.detail-section h3 {
  margin: 0 0 2px;
  font-size: 16px;
}

.detail-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
  font-size: 13px;
  line-height: 1.2;
}

.detail-row span {
  color: var(--muted);
}

.detail-row strong {
  color: var(--ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.pickup-detail-row strong {
  font-size: 19px;
  font-weight: 850;
  line-height: 1.15;
}

.pickup-detail-row .pickup-time {
  color: var(--ink);
  font-weight: 850;
}

.pickup-detail-row .pickup-separator {
  color: var(--muted-strong);
  font-weight: 400;
}

.pickup-detail-row .pickup-date {
  color: var(--ink);
  font-size: 19px;
  font-weight: 850;
}

.editable-address,
.editable-pickup,
.editable-comment {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  max-width: 100%;
  color: var(--ink);
  line-height: 1.25;
}

.detail-row .editable-address-text {
  min-width: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.address-edit-button {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #9aa39e;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transform: translateY(2px);
}

.address-edit-button svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.address-edit-button:hover {
  background: rgba(22, 108, 99, 0.06);
  color: var(--accent);
}

.address-edit-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.pickup-edit-control {
  grid-template-columns: 112px minmax(96px, 1fr) auto auto;
}

.comment-edit-control {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.address-edit-input {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  outline: none;
}

.address-edit-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(22, 108, 99, 0.12);
}

.address-save-button,
.address-cancel-button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.address-save-button {
  background: var(--accent);
  color: #ffffff;
}

.address-cancel-button {
  background: #eef2ef;
  color: #68746d;
}

.address-save-button:hover {
  background: #125b54;
}

.address-cancel-button:hover {
  background: #e2e8e4;
}

.manual-flight-control {
  position: relative;
  display: inline-grid;
  align-items: center;
  min-width: 0;
}

.manual-flight-input {
  width: 148px;
  min-height: 38px;
  padding: 7px 34px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.manual-flight-input::placeholder {
  color: #a8b0ab;
  opacity: 1;
  text-transform: none;
}

.manual-flight-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(22, 108, 99, 0.12);
}

.manual-flight-clear {
  position: absolute;
  right: 7px;
  top: 50%;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #9aa39e;
  cursor: pointer;
  display: none;
  place-items: center;
  transform: translateY(-50%);
}

.manual-flight-control.has-value .manual-flight-clear {
  display: grid;
}

.manual-flight-clear:hover {
  color: #68746d;
  background: #f3f5f3;
}

.manual-flight-clear svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.flight-entry-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.modal-arrival-flight-warning {
  display: inline-grid;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  place-items: center;
  color: #e63b31;
}

.modal-arrival-flight-warning svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.modal-arrival-flight-warning svg path:not([fill="none"]) {
  fill: #e63b31;
}

.flight-link-slot {
  display: inline-flex;
  align-items: center;
  min-width: 72px;
  min-height: 38px;
}

.flight-number-link {
  color: var(--accent);
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.flight-number-link:hover {
  text-decoration: underline;
}

.flight-inline-control {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-width: 0;
}

.flight-detail-row {
  row-gap: 10px;
  align-items: center;
}

.flight-detail-row > strong,
.flight-detail-row .flight-inline-control {
  display: contents;
}

.flight-detail-row .flight-entry-row {
  grid-column: 2;
}

.flight-detail-row [data-flight-status-slot] {
  grid-column: 1 / -1;
}

.flight-inline-control [data-flight-status-slot] {
  width: 100%;
  min-width: 0;
}

.flight-status-card {
  display: grid;
  align-items: center;
  min-height: 64px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: rgba(104, 116, 109, 0.08);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.1;
  overflow: hidden;
}

.flight-status-card span {
  font-weight: 800;
}

.flight-status-card strong {
  font-size: 11px;
  font-weight: 500;
}

.flight-status-compact {
  display: grid;
  grid-template-columns: minmax(120px, max-content) minmax(112px, max-content) minmax(0, 1fr) max-content;
  gap: 16px;
  align-items: center;
  min-width: 0;
}

.flight-status-main {
  color: #2f3934;
  font-size: 20px;
  font-weight: 850;
  white-space: nowrap;
}

.flight-status-card .flight-status-main {
  color: #2f3934;
  font-weight: 850;
}

.flight-status-pill {
  display: inline-flex;
  justify-self: start;
  align-items: center;
  min-height: 26px;
  padding: 3px 10px;
  border: 1px solid rgba(104, 116, 109, 0.45);
  border-radius: 4px;
  color: var(--muted);
  background: rgba(104, 116, 109, 0.08);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
}

.flight-arrival-actual {
  color: var(--ink);
  min-width: 0;
  overflow: hidden;
  font-size: 20px;
  font-weight: 800;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flight-arrival-scheduled {
  color: #7f8984;
  font-size: 20px;
  font-weight: 400;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  white-space: nowrap;
}

.flight-status-card .flight-arrival-actual {
  font-weight: 800;
}

.flight-status-card .flight-arrival-scheduled {
  color: #7f8984;
  font-weight: 400;
}

.flight-status-card[data-status-tone="green"] .flight-status-pill {
  border-color: rgba(55, 139, 42, 0.5);
  color: #2f7f25;
  background: rgba(55, 139, 42, 0.08);
}

.flight-status-card[data-status-tone="green"] .flight-arrival-actual {
  color: #2f7f25;
}

.flight-status-card[data-status-tone="red"] .flight-status-pill {
  border-color: rgba(185, 55, 55, 0.5);
  color: #b93737;
  background: rgba(185, 55, 55, 0.08);
}

.flight-status-card[data-status-tone="red"] .flight-arrival-actual {
  color: #b93737;
}

.flight-status-card.is-loading {
  place-items: center;
  background: rgba(104, 116, 109, 0.08);
  color: var(--muted);
}

.flight-status-spinner {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: flight-status-spin 900ms linear infinite;
}

@keyframes flight-status-spin {
  to {
    transform: rotate(360deg);
  }
}

.flight-status-card.is-error {
  background: rgba(160, 51, 51, 0.08);
  color: #8c2f2f;
}

.detail-link {
  color: var(--accent);
  text-decoration: none;
}

.phone-value {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.phone-copy-button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #8b9690;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.phone-copy-button svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.phone-copy-button:hover,
.phone-copy-button.is-copied {
  background: rgba(22, 108, 99, 0.06);
  color: var(--accent);
}

.modal-title-link {
  color: inherit;
  text-decoration: none;
}

.modal-title-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.detail-link:hover {
  text-decoration: underline;
}

@media (max-width: 1320px) {
  .board-shell {
    grid-template-columns: 58px minmax(640px, 1fr) 300px;
  }

  .vehicle-headers,
  .vehicle-grid {
    grid-template-columns: repeat(var(--vehicle-count), minmax(160px, 1fr));
  }
}

@media (max-width: 1400px) {
  :root {
    --slot-height: 76px;
    --header-height: 34px;
    --timeline-card-min-height: 90px;
    --mobile-row-line: rgba(215, 222, 214, 0.16);
  }

  body {
    width: 100vw;
    min-width: 0;
    height: 100svh;
    overflow: hidden;
  }

  .dashboard {
    height: 100svh;
    min-width: 0;
    padding: 0;
    gap: 0;
  }

  .topbar {
    display: none;
  }

  .board-shell {
    grid-template-columns: 30px minmax(0, 1fr) 153px;
    gap: 0;
    overflow: hidden;
  }

  .vehicle-headers,
  .vehicle-grid {
    grid-template-columns: repeat(var(--vehicle-count), minmax(86px, 1fr));
    gap: 0;
  }

  .vehicle-header,
  .vehicle-lane,
  .incoming-panel {
    border-radius: 0;
  }

  .vehicle-header,
  .vehicle-lane {
    border-left: 0;
  }

  .vehicle-lane {
    background:
      repeating-linear-gradient(
        to bottom,
        var(--lane-bg) 0,
        var(--lane-bg) calc(var(--slot-height) - 1px),
        var(--mobile-row-line) calc(var(--slot-height) - 1px),
        var(--mobile-row-line) var(--slot-height)
      );
  }

  .vehicle-header {
    border-top: 0;
  }

  .time-date-header,
  .time-axis {
    border-left: 0;
    border-right: 1px solid var(--line);
  }

  .vehicle-header.muted.time-date-header {
    border-left: 0;
  }

  .time-axis,
  .vehicle-grid {
    border-bottom: 0;
  }

  .fleet-board,
  .vehicle-headers,
  .vehicle-grid {
    overflow-x: hidden;
    overscroll-behavior-x: none;
    touch-action: pan-y;
  }

  .incoming-panel {
    border-left: 0;
    border-top: 0;
    border-bottom: 0;
  }

  .vehicle-header {
    padding: 3px 6px 2px;
  }

  .vehicle-title-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
  }

  .vehicle-header strong {
    font-size: 10px;
    line-height: 1;
    transform: translateY(3px);
  }

  .vehicle-header .vehicle-type-label {
    gap: 3px;
    margin-top: 1px;
    font-size: 8.5px;
    line-height: 1;
  }

  .vehicle-type-label svg {
    width: 10px;
    height: 10px;
  }

  .driver-select {
    display: none;
  }

  .time-date-header {
    padding: 3px;
    font-size: 8px;
    gap: 0;
  }

  .vehicle-header.muted.time-date-header {
    font-size: 8px;
  }

  .time-date-header span {
    font-size: 7px;
    line-height: 1;
  }

  .time-date-header strong {
    font-size: 14px;
    line-height: 0.95;
  }

  .time-tick {
    padding-top: 6px;
    font-size: 8px;
    border-right: 0;
    border-bottom-color: rgba(215, 222, 214, 0.42);
  }

  .now-line {
    border-top-width: 1px;
  }

  .time-axis .now-line::before {
    top: -4px;
    right: -4px;
    width: 7px;
    height: 7px;
  }

  .time-tick small,
  .day-separator span {
    font-size: 8px;
  }

  .incoming-panel {
    grid-template-rows: var(--header-height) 1fr;
  }

  .incoming-header {
    gap: 3px;
    padding: 3px 5px;
    align-items: center;
  }

  .incoming-title-row {
    gap: 3px;
  }

  .incoming-title-row h2 {
    font-size: 10px;
  }

  .incoming-count-badge {
    min-width: 18px;
    height: 17px;
    padding: 0 4px;
    font-size: 9px;
  }

  .dashboard-last-parse {
    display: none;
  }

  .custom-select-button {
    height: 22px;
    min-width: 46px;
    gap: 4px;
    padding: 0 5px;
    font-size: 9px;
  }

  .incoming-header .custom-select-button {
    height: 24px;
    min-width: 44px;
    padding: 0 4px;
    font-size: 9px;
    line-height: 1;
    transform: translateY(-1px);
  }

  .custom-select-chevron {
    width: 7px;
    height: 7px;
    flex-basis: 7px;
  }

  .incoming-header .custom-select-chevron {
    width: 7px;
    height: 7px;
    flex-basis: 7px;
  }

  .custom-select-menu {
    min-width: 62px;
  }

  .custom-select-option {
    min-height: 24px;
    padding: 0 8px;
    font-size: 11px;
  }

  .icon-button {
    width: 26px;
    height: 26px;
  }

  .parse-depth-control + .icon-button {
    display: inline-grid;
    width: 24px;
    height: 24px;
    margin-left: 0;
  }

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

  .incoming-list {
    padding: 5px;
    gap: 5px;
  }

  .incoming-day-header {
    margin: 2px 0 -2px;
    font-size: 9.5px;
  }

  .order-card {
    width: 100%;
    min-height: 64px;
    padding: 4px 5px;
    gap: 2px;
    border-left-width: 3px;
    box-shadow: 0 5px 12px var(--card-shadow);
    touch-action: none;
  }

  .incoming-list .order-card {
    touch-action: pan-y;
  }

  .vehicle-lane .order-card {
    touch-action: pan-y;
  }

  .incoming-panel .order-card.compact {
    height: 60px;
    min-height: 60px;
  }

  .vehicle-lane .order-card {
    width: auto;
    left: 2px;
    right: 2px;
    padding: 5px;
    min-height: var(--timeline-card-min-height);
  }

  .order-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    min-width: 0;
  }

  .order-head-left {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
  }

  .order-card-head .passenger-count {
    margin-left: 0;
    font-size: 9px;
    color: var(--muted);
  }

  .order-card-head .badge {
    position: relative;
    max-width: 44px;
    min-width: 14px;
    min-height: 14px;
    padding: 0 4px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 500;
    line-height: 1.1;
    text-indent: -999px;
  }

  .order-card-head .badge::after {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: currentColor;
    text-indent: 0;
  }

  .order-card-head .badge.van::after {
    content: "V";
  }

  .order-card-head .badge.sedan::after {
    content: "S";
  }

  .order-main {
    gap: 2px;
    padding-right: 0;
  }

  .order-main > .order-meta {
    display: none;
  }

  .order-meta {
    position: static;
    justify-content: flex-end;
    font-size: 9px;
  }

  .order-source {
    font-size: 8.5px;
  }

  .order-time {
    font-size: 10.5px;
  }

  .order-time.delayed {
    flex-direction: row;
    align-items: baseline;
    gap: 4px;
  }

  .order-time.early-arrival {
    flex-direction: row;
    align-items: baseline;
    gap: 4px;
  }

  .order-route {
    gap: 1px;
    margin-bottom: 1px;
    font-size: 9px;
    line-height: 1.05;
  }

  .vehicle-lane .order-main {
    padding-right: 0;
  }

  .vehicle-lane .order-route {
    font-size: 8.5px;
  }

  .has-arrival-flight-warning .order-route {
    padding-right: 28px;
  }

  .arrival-flight-warning {
    top: 22px;
    right: 6px;
    width: 15px;
    height: 15px;
  }

  .route-dot {
    width: 6px;
    height: 6px;
  }

  .order-footer {
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 3px;
    font-size: 8.5px;
    line-height: 1;
  }

  .order-footer .badge,
  .order-footer .passenger-count,
  .footer-separator {
    display: none;
  }

  .route-stat {
    display: block;
    text-align: right;
  }

  .vehicle-lane .order-footer {
    display: grid;
  }

  .assign-button,
  .assign-status,
  .toolbar-secondary-button {
    min-height: 18px;
    padding: 2px 5px;
    font-size: 8.5px;
  }

  .assign-row {
    gap: 3px;
  }

  .vehicle-lane .assign-row {
    margin-top: 1px;
    display: block;
  }

  .vehicle-lane .copy-button,
  .vehicle-lane .delay-control {
    display: none;
  }

  .vehicle-lane .assign-button {
    width: 100%;
    min-width: 0;
    padding-inline: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .vehicle-lane .assign-button.assign-status {
    background: var(--accent);
    color: #ffffff;
  }

  .delay-block {
    left: 3px;
    right: 3px;
  }

  .delay-block span {
    padding: 4px 5px;
    font-size: 8px;
  }

  .drop-preview {
    left: 3px;
    right: 3px;
  }

  .connection-note {
    left: 4px;
    right: 4px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px;
    min-height: 22px;
    padding: 4px 5px;
    font-size: 8.5px;
  }

  .connection-note small {
    display: none;
  }

  .order-modal {
    padding: 0;
  }

  .order-modal-panel {
    width: 100svw;
    height: 100svh;
    max-height: 100svh;
    border-radius: 0;
    display: grid;
    grid-template-columns: 40% 60%;
    grid-template-rows: 34px minmax(0, 1fr);
  }

  .order-modal-header {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    gap: 6px;
    padding: 5px 8px 3px 10px;
  }

  .order-modal-header h2 {
    font-size: 8.5px;
    line-height: 1.05;
  }

  .modal-close-button {
    margin-left: 16px;
    width: 24px;
    height: 24px;
  }

  .modal-card-actions {
    gap: 4px;
  }

  .modal-card-actions .toolbar-secondary-button,
  .modal-card-actions .assign-button,
  .modal-card-actions .assign-status {
    min-height: 18px;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 8px;
    font-weight: 850;
    line-height: 1;
  }

  .modal-delay-select {
    width: 44px;
    min-width: 44px;
    height: 18px;
    transform: translateY(-1px);
  }

  .modal-assign-button {
    flex-basis: 60px;
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .order-modal-content {
    display: contents;
    max-height: none;
    padding: 0;
    overflow: visible;
  }

  .order-modal-content .route-map-shell {
    grid-column: 1;
    grid-row: 1 / 3;
    min-height: 0;
    margin: 0;
  }

  .order-modal-content .route-map {
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
  }

  .order-modal-content .route-map-stat {
    bottom: 8px;
    max-width: calc(100% - 18px);
    font-size: 9px;
  }

  .modal-detail-scroll {
    grid-column: 2;
    grid-row: 2;
    min-height: 0;
    padding: 5px 8px 8px 10px;
    overflow-y: auto;
    display: grid;
    align-content: start;
    gap: 6px;
  }

  .modal-detail-scroll .detail-section {
    gap: 4px;
  }

  .modal-detail-scroll .detail-row {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 8px;
    font-size: 9px;
    line-height: 1.1;
  }

  .modal-detail-scroll .editable-address,
  .modal-detail-scroll .editable-pickup,
  .modal-detail-scroll .editable-comment,
  .modal-detail-scroll .phone-value {
    align-items: center;
    gap: 5px;
    line-height: 1.1;
  }

  .modal-detail-scroll .address-edit-button {
    width: 13px;
    height: 13px;
    border-radius: 3px;
    transform: none;
  }

  .modal-detail-scroll .address-edit-button svg {
    width: 10px;
    height: 10px;
  }

  .modal-detail-scroll .address-edit-control,
  .modal-detail-scroll .pickup-edit-control,
  .modal-detail-scroll .comment-edit-control {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 4px;
  }

  .modal-detail-scroll .pickup-edit-control {
    grid-template-columns: 64px minmax(54px, 1fr) auto auto;
  }

  .modal-detail-scroll .address-edit-input {
    min-height: 24px;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 9px;
  }

  .modal-detail-scroll .address-save-button,
  .modal-detail-scroll .address-cancel-button {
    min-height: 24px;
    padding: 0 6px;
    border-radius: 6px;
    font-size: 9px;
  }

  .modal-detail-scroll .phone-copy-button {
    width: 13px;
    height: 13px;
    border-radius: 4px;
  }

  .modal-detail-scroll .phone-copy-button svg {
    width: 9px;
    height: 9px;
  }

  .modal-detail-scroll .pickup-detail-row strong {
    font-size: 12px;
  }

  .modal-detail-scroll .pickup-detail-row .pickup-date,
  .modal-detail-scroll .pickup-detail-row .pickup-separator,
  .modal-detail-scroll .pickup-detail-row .pickup-time {
    font-size: 12px;
    line-height: 1;
  }

  .modal-detail-scroll .pickup-detail-row .pickup-time {
    font-weight: 850;
  }

  .modal-detail-scroll .pickup-detail-row .pickup-date,
  .modal-detail-scroll .pickup-detail-row .pickup-separator {
    color: var(--muted-strong);
    font-weight: 400;
  }

  .modal-detail-scroll .pickup-detail-row .pickup-date {
    color: var(--ink);
    font-size: 12px;
    font-weight: 850;
  }

  .modal-detail-scroll .flight-inline-control {
    gap: 4px;
  }

  .modal-detail-scroll .flight-entry-row {
    gap: 5px;
  }

  .modal-detail-scroll .modal-arrival-flight-warning {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
  }

  .modal-detail-scroll .flight-link-slot {
    min-width: 62px;
    min-height: 26px;
  }

  .modal-detail-scroll .flight-number-link {
    font-size: 11px;
  }

  .modal-detail-scroll .manual-flight-input {
    width: 116px;
    min-height: 26px;
    padding: 4px 26px 4px 8px;
    border-radius: 6px;
    font-size: 10px;
  }

  .modal-detail-scroll .manual-flight-clear {
    right: 4px;
    width: 18px;
    height: 18px;
  }

  .modal-detail-scroll .manual-flight-clear svg {
    width: 12px;
    height: 12px;
  }

  .modal-detail-scroll .flight-status-card {
    min-height: 42px;
    padding: 0 8px;
    border-radius: 6px;
  }

  .modal-detail-scroll .flight-status-compact {
    grid-template-columns: minmax(72px, max-content) minmax(72px, max-content) minmax(0, 1fr) max-content;
    gap: 8px;
  }

  .modal-detail-scroll .flight-status-main,
  .modal-detail-scroll .flight-arrival-actual,
  .modal-detail-scroll .flight-arrival-scheduled {
    font-size: 13px;
  }

  .modal-detail-scroll .flight-status-pill {
    min-height: 20px;
    padding: 2px 6px;
    font-size: 10px;
  }
}

@media (min-width: 1024px) and (max-width: 1400px) and (orientation: landscape) {
  .board-shell {
    grid-template-columns: 30px minmax(0, 1fr) 180px;
  }

  .order-modal {
    padding: 48px;
  }

  .order-modal-backdrop {
    background: rgba(23, 32, 27, 0.64);
  }

  .order-modal-panel {
    width: min(760px, calc(100svw - 280px));
    height: min(390px, calc(100svh - 150px));
    max-height: min(390px, calc(100svh - 150px));
    border-radius: var(--radius);
    box-shadow:
      0 24px 70px rgba(0, 0, 0, 0.22),
      0 70px 180px rgba(0, 0, 0, 0.16);
  }
}

@media (max-width: 1180px) and (orientation: portrait) {
  body {
    min-width: 0;
    height: 100svh;
    overflow: hidden;
  }

  .mobile-page-header {
    width: 100%;
    min-height: 40px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 0;
    border-radius: 0;
    background: var(--surface);
    box-shadow: 0 5px 14px rgba(23, 32, 27, 0.05);
  }

  .mobile-page-brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 850;
    line-height: 1.1;
    text-decoration: none;
  }

  .mobile-page-brand .brand-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
  }

  .mobile-page-brand .brand-icon svg {
    width: 18px;
    height: 18px;
  }

  .mobile-page-brand span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-menu-button {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: grid;
    place-content: center;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
  }

  .mobile-menu-button span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
  }

  .mobile-navigation-menu {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--surface);
    color: var(--ink);
  }

  .mobile-navigation-menu:not([hidden]) {
    display: block;
  }

  .mobile-menu-panel {
    min-height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
    padding: max(18px, env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom));
  }

  .mobile-menu-top {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 900;
  }

  .mobile-menu-close {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
  }

  .mobile-menu-close svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-menu-links {
    display: grid;
    align-content: start;
    gap: 8px;
  }

  .mobile-menu-links a {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--ink);
    font-size: 22px;
    font-weight: 850;
    line-height: 1;
    text-decoration: none;
  }

  .mobile-menu-links a:hover,
  .mobile-menu-links a:focus-visible {
    border-color: var(--line);
    background: var(--surface-soft);
    outline: none;
  }

  .mobile-menu-links a.active {
    border-color: transparent;
    background: var(--accent-soft);
    color: var(--accent);
  }

  .dashboard {
    height: auto;
    min-height: calc(100svh - 58px);
    padding: 0;
    display: block;
  }

  .dashboard > .topbar,
  .dashboard > .board-shell {
    display: none;
  }

  .mobile-portrait-message {
    min-height: calc(100svh - 74px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 28px 18px;
    color: var(--muted-strong);
    text-align: center;
  }

  .mobile-portrait-message-inner {
    display: grid;
    justify-items: center;
    gap: 5px;
    color: var(--muted-soft);
  }

  .mobile-rotate-icon {
    width: 34px;
    height: 34px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-rotate-caption {
    font-size: 12px;
    font-weight: 650;
    line-height: 1;
    text-transform: lowercase;
  }
}


.custom-select {
  position: relative;
}

.parse-depth-control {
  flex: 0 0 auto;
}

.custom-select-button {
  height: 34px;
  min-width: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  appearance: none;
}

.custom-select-button:hover,
.custom-select-button[aria-expanded="true"] {
  border-color: var(--accent);
}

.custom-select-chevron {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: 0.85;
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 20;
  min-width: 76px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 12px 26px rgba(23, 32, 27, 0.16);
}

.custom-select-option {
  width: 100%;
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  text-align: left;
  cursor: pointer;
}

.custom-select-option:hover,
.custom-select-option.is-selected {
  background: var(--surface-control);
  color: var(--accent);
}

:root[data-theme="dark"] .brand-icon,
:root[data-theme="dark"] .action-button.primary,
:root[data-theme="dark"] .action-button.warning,
:root[data-theme="dark"] .assign-status,
:root[data-theme="dark"] .connection-note b {
  color: #07120f;
}

:root[data-theme="dark"] .vehicle-lane,
:root[data-theme="dark"] .vehicle-lane.drag-over,
:root[data-theme="dark"] .vehicle-lane.drop-blocked {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.015);
}

:root[data-theme="dark"] .drop-preview {
  border-color: rgba(84, 208, 191, 0.22);
  background: rgba(84, 208, 191, 0.09);
  box-shadow: inset 0 0 0 1px rgba(84, 208, 191, 0.08);
}

:root[data-theme="dark"] .connection-note {
  border-color: rgba(84, 208, 191, 0.28);
  background: #17342f;
  color: var(--accent);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .connection-note.is-best {
  background: #1a4039;
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.3),
    inset 0 0 0 1px rgba(84, 208, 191, 0.12);
}

:root[data-theme="dark"] .connection-note.is-tight {
  border-color: rgba(255, 138, 138, 0.34);
  background: #382124;
  color: var(--danger);
}

:root[data-theme="dark"] .order-card.is-split-order {
  border-color: rgba(167, 139, 250, 0.34);
  border-left-color: #a78bfa;
  background: #251f36;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .order-card.is-split-order .badge {
  border-color: rgba(167, 139, 250, 0.42);
  color: #c4b5fd;
}

:root[data-theme="dark"] .order-card.is-split-order.is-assigned {
  border-color: rgba(84, 208, 191, 0.3);
  border-left-color: var(--accent);
  background: #223630;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.22),
    inset 0 0 0 1px rgba(84, 208, 191, 0.08);
}

:root[data-theme="dark"] .order-card.is-split-order.is-assigned .badge {
  border-color: rgba(84, 208, 191, 0.32);
  color: var(--accent);
}

:root[data-theme="dark"] .order-card {
  background: #1c2925;
}

:root[data-theme="dark"] .order-card.is-assigned {
  border-color: rgba(84, 208, 191, 0.3);
  background: #223630;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.22),
    inset 0 0 0 1px rgba(84, 208, 191, 0.08);
}

:root[data-theme="dark"] .order-card.is-assigned::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(84, 208, 191, 0.2), rgba(84, 208, 191, 0.07) 58%, transparent),
    linear-gradient(180deg, rgba(84, 208, 191, 0.08), transparent 74%);
  pointer-events: none;
}

:root[data-theme="dark"] .order-card.is-assigned .assign-status {
  background: #2f7d68;
  color: #e8fff7;
}

:root[data-theme="dark"] .order-card.is-past.is-assigned {
  opacity: 0.46;
  filter: grayscale(0.68);
}

:root[data-theme="dark"] .order-card.is-past.is-assigned::after {
  background:
    linear-gradient(90deg, rgba(84, 208, 191, 0.08), rgba(84, 208, 191, 0.025) 58%, transparent),
    linear-gradient(180deg, rgba(84, 208, 191, 0.025), transparent 74%);
}

:root[data-theme="dark"] .order-card.is-past.is-assigned .assign-status {
  background: #375e55;
  color: #c7d8d3;
}

:root[data-theme="dark"] .delay-block {
  border-color: #53635d;
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(156, 173, 165, 0.16) 0,
      rgba(156, 173, 165, 0.16) 7px,
      rgba(255, 255, 255, 0.04) 7px,
      rgba(255, 255, 255, 0.04) 14px
    );
}

:root[data-theme="dark"] .delay-block.is-negative {
  border-color: rgba(112, 164, 232, 0.5);
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(112, 164, 232, 0.2) 0,
      rgba(112, 164, 232, 0.2) 7px,
      rgba(112, 164, 232, 0.06) 7px,
      rgba(112, 164, 232, 0.06) 14px
    );
  color: #b3d0f7;
}

:root[data-theme="dark"] .delay-block.is-past {
  opacity: 0.42;
}

:root[data-theme="dark"] .badge.sedan,
:root[data-theme="dark"] .assign-button {
  background: #4a3b18;
  color: #f8d56b;
}

:root[data-theme="dark"] .assign-button:hover {
  background: #614e20;
  color: #ffe08a;
}

:root[data-theme="dark"] .route-map,
:root[data-theme="dark"] .address-edit-input,
:root[data-theme="dark"] .manual-flight-input {
  background: var(--surface-soft);
}

:root[data-theme="dark"] .order-modal-panel {
  background: #1d2a26;
  box-shadow:
    0 18px 70px rgba(0, 0, 0, 0.12),
    0 70px 180px rgba(0, 0, 0, 0.18),
    0 140px 320px rgba(0, 0, 0, 0.12);
}

:root[data-theme="dark"] .order-modal-backdrop {
  background: rgba(3, 8, 7, 0.58);
}

:root[data-theme="dark"] .flight-status-card {
  background: rgba(255, 255, 255, 0.035);
}

:root[data-theme="dark"] .order-early-flight-time {
  color: #e2bf43;
}

:root[data-theme="dark"] .route-map-stat {
  border-color: var(--line-strong);
  background: rgba(24, 34, 31, 0.94);
  color: var(--muted-strong);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.32);
}

:root[data-theme="dark"] .map-label {
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.32);
}

:root[data-theme="dark"] .address-cancel-button,
:root[data-theme="dark"] .manual-flight-clear:hover {
  background: var(--surface-control);
  color: var(--muted-strong);
}

:root[data-theme="dark"] .flight-status-main,
:root[data-theme="dark"] .flight-status-card .flight-status-main {
  color: var(--ink);
}

:root[data-theme="dark"] .flight-arrival-scheduled,
:root[data-theme="dark"] .flight-status-card .flight-arrival-scheduled,
:root[data-theme="dark"] .order-original-time {
  color: var(--muted-soft);
}
