:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #5d6d82;
  --line: #d7dee8;
  --panel: #f8fafc;
  --review: #b45309;
  --candidate: #475569;
  --ok: #166534;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #eef3f8;
  letter-spacing: 0;
}

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

header {
  min-height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

h1 {
  margin: 0;
  font-size: 21px;
  line-height: 1.15;
  font-weight: 780;
}

p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

nav a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid #c3cedb;
  border-radius: 6px;
  background: #ffffff;
  color: #223149;
  text-decoration: none;
  font-size: 13px;
}

nav a[aria-current="page"] {
  border-color: #2563eb;
  color: #1d4ed8;
  font-weight: 700;
}

main {
  display: grid;
  grid-template-columns: minmax(330px, 410px) minmax(460px, 1fr) minmax(320px, 390px);
  min-height: 0;
  overflow: hidden;
}

.left-panel,
.detail-panel {
  overflow: auto;
  padding: 14px;
  background: var(--panel);
}

.left-panel {
  border-right: 1px solid var(--line);
}

.detail-panel {
  border-left: 1px solid var(--line);
}

.map-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 640px;
}

.gps-track-toggle {
  position: absolute;
  top: 12px;
  right: 58px;
  z-index: 500;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #94a3b8;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.94);
  color: #334155;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.14);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.gps-track-toggle[aria-pressed="true"] {
  border-color: #0f766e;
  background: #ccfbf1;
  color: #115e59;
}

.gps-track-toggle[hidden] {
  display: none;
}

.route-phase-legend {
  position: absolute;
  left: 12px;
  bottom: 22px;
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 9px;
  max-width: min(520px, calc(100% - 24px));
  padding: 7px 8px;
  border: 1px solid rgba(148, 163, 184, 0.62);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  color: #334155;
  font-size: 11px;
  line-height: 1.2;
}

.route-phase-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.route-phase-legend i {
  display: inline-block;
  width: 24px;
  border-top: 3px solid var(--selected-route-color, #2563eb);
}

.route-phase-legend .exit {
  border-color: #475569;
  opacity: 0.76;
}

.route-phase-legend .standby {
  border-color: #94a3b8;
  opacity: 0.82;
}

.route-phase-legend .dashed {
  border-top-style: dashed;
}

.route-phase-legend .conditional {
  border-color: var(--selected-route-color, #2563eb);
  border-top-style: dashed;
  opacity: 0.72;
}

.route-phase-legend .direction {
  width: 9px;
  height: 9px;
  margin: 0 6px 0 3px;
  border: 0;
  border-top: 3px solid var(--selected-route-color, #2563eb);
  border-right: 3px solid var(--selected-route-color, #2563eb);
  transform: rotate(45deg);
}

.description {
  margin-bottom: 10px;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px;
}

.stat {
  display: inline-flex;
  gap: 5px;
  align-items: baseline;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: #405168;
  font-size: 12px;
}

.stat.review {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.stat.candidate {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

.status {
  margin-bottom: 12px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #405168;
  font-size: 12px;
  line-height: 1.4;
}

.coverage-panel {
  margin: 0 0 14px;
  padding: 9px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
}

.coverage-panel h2 {
  margin: 0 0 5px;
  color: #9a3412;
  font-size: 12px;
  line-height: 1.2;
  text-transform: uppercase;
}

.coverage-panel p {
  margin-bottom: 7px;
  color: #9a3412;
  font-size: 11px;
}

.coverage-panel ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
}

.coverage-panel li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 7px;
  color: #7c2d12;
  font-size: 12px;
  line-height: 1.3;
}

.coverage-panel b,
.coverage-panel span,
.coverage-panel small {
  display: block;
}

.coverage-panel small {
  grid-column: 1 / -1;
  color: #9a3412;
}

.coverage-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.coverage-actions span {
  color: #9a3412;
  font-size: 11px;
  font-weight: 760;
}

.coverage-actions button {
  padding: 3px 7px;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  background: #ffffff;
  color: #9a3412;
  font-size: 11px;
  font-weight: 760;
  cursor: pointer;
}

.coverage-actions button:hover {
  border-color: #fdba74;
  background: #fff7ed;
}

.coverage-panel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 0 0 8px;
}

.coverage-panel-actions span {
  color: #9a3412;
  font-size: 11px;
  font-weight: 760;
}

.coverage-panel-actions button,
.coverage-answer-actions button {
  padding: 3px 7px;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  background: #ffffff;
  color: #9a3412;
  font-size: 11px;
  font-weight: 760;
  cursor: pointer;
}

.coverage-panel-actions button:hover,
.coverage-answer-actions button:hover {
  border-color: #fdba74;
  background: #fff7ed;
}

.coverage-questions {
  grid-column: 1 / -1;
  display: grid;
  gap: 3px;
  margin: 0;
  padding-left: 16px;
  color: #7c2d12;
  font-size: 11px;
  line-height: 1.3;
}

.coverage-questions li {
  display: list-item;
  color: #7c2d12;
}

.coverage-answer {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
}

.coverage-answer span,
.coverage-answer-actions span {
  color: #9a3412;
  font-size: 11px;
  font-weight: 760;
}

.coverage-answer textarea {
  width: 100%;
  min-height: 68px;
  resize: vertical;
  box-sizing: border-box;
  padding: 6px 7px;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  background: #ffffff;
  color: #7c2d12;
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
}

.coverage-answer-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.coverage-pill {
  align-self: start;
  padding: 2px 5px;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  background: #ffffff;
  color: #9a3412;
  font-size: 10px;
  font-weight: 760;
  white-space: nowrap;
}

.coverage-pill.candidate {
  border-color: #cbd5e1;
  color: #475569;
}

.operator-queue-panel {
  margin: 0 0 14px;
  padding: 9px;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  background: #eef2ff;
}

.operator-queue-panel h2 {
  margin: 0 0 5px;
  color: #3730a3;
  font-size: 12px;
  line-height: 1.2;
  text-transform: uppercase;
}

.operator-queue-panel p {
  margin-bottom: 7px;
  color: #4338ca;
  font-size: 11px;
  line-height: 1.35;
}

.operator-queue-closeout {
  display: grid;
  gap: 6px;
  margin: 0 0 8px;
}

.operator-queue-closeout-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 7px;
  align-items: center;
  padding: 7px;
  border: 1px solid #c7d2fe;
  border-radius: 7px;
  background: #ffffff;
}

.operator-queue-closeout-row b,
.operator-queue-closeout-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.operator-queue-closeout-row b {
  color: #312e81;
  font-size: 12px;
  line-height: 1.25;
}

.operator-queue-closeout-row span {
  grid-column: 1 / -1;
  color: #475569;
  font-size: 11px;
  line-height: 1.3;
}

.operator-queue-closeout-row button {
  min-height: 25px;
  padding: 3px 6px;
  border: 1px solid #14b8a6;
  border-radius: 6px;
  background: #f0fdfa;
  color: #0f766e;
  font: inherit;
  font-size: 11px;
  font-weight: 760;
  cursor: pointer;
}

.operator-queue-list {
  display: grid;
  gap: 7px;
}

.operator-queue-group {
  border: 1px solid #c7d2fe;
  border-radius: 7px;
  background: #ffffff;
  overflow: hidden;
}

.operator-queue-group summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  padding: 7px;
  color: #312e81;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.operator-queue-group summary span {
  overflow-wrap: anywhere;
}

.operator-queue-group summary b {
  min-width: 22px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #e0e7ff;
  color: #3730a3;
  font-size: 10px;
  text-align: center;
}

.operator-queue-items {
  display: grid;
  gap: 7px;
  padding: 0 7px 7px;
}

.operator-queue-item {
  display: grid;
  gap: 6px;
  padding: 7px;
  border: 1px solid #e0e7ff;
  border-radius: 7px;
  background: #fbfdff;
  color: #334155;
}

.operator-queue-item.review {
  border-color: #fed7aa;
  background: #fffaf4;
}

.operator-queue-item.candidate {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.operator-queue-item.gps {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.operator-queue-item-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: start;
}

.operator-queue-item-head b {
  color: #1e293b;
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.operator-queue-item-head span {
  padding: 2px 5px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #475569;
  font-size: 10px;
  font-weight: 760;
  white-space: nowrap;
}

.operator-queue-item small {
  color: #475569;
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.operator-queue-next {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  color: #475569;
  font-size: 11px;
  line-height: 1.3;
}

.operator-queue-next b {
  color: #334155;
  font-size: 10px;
  text-transform: uppercase;
}

.operator-queue-next span {
  overflow-wrap: anywhere;
}

.operator-queue-block {
  display: grid;
  gap: 4px;
}

.operator-queue-block > b {
  color: #334155;
  font-size: 10px;
  line-height: 1.2;
  text-transform: uppercase;
}

.operator-queue-block ul,
.operator-queue-block ol {
  display: grid;
  gap: 3px;
  margin: 0;
  padding-left: 16px;
}

.operator-queue-block li {
  color: #334155;
  font-size: 11px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.gps-review-panel {
  margin: 0 0 14px;
  padding: 9px;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  background: #f0fdfa;
}

.gps-review-panel h2 {
  margin: 0 0 5px;
  color: #0f766e;
  font-size: 12px;
  line-height: 1.2;
  text-transform: uppercase;
}

.gps-review-panel p {
  margin-bottom: 7px;
  color: #115e59;
  font-size: 11px;
  line-height: 1.35;
}

.gps-review-list {
  display: grid;
  gap: 6px;
}

.gps-review-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  width: 100%;
  padding: 7px;
  border: 1px solid #99f6e4;
  border-radius: 7px;
  background: #ffffff;
  color: #134e4a;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.gps-review-item:hover,
.gps-review-item:focus-visible {
  border-color: #14b8a6;
  background: #ccfbf1;
}

.gps-review-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.gps-review-main b,
.gps-review-main span,
.gps-review-main small {
  display: block;
  overflow-wrap: anywhere;
}

.gps-review-main b {
  color: #0f766e;
  font-size: 12px;
  line-height: 1.25;
}

.gps-review-main span {
  color: #47706c;
  font-size: 11px;
  line-height: 1.25;
}

.gps-review-main small {
  color: #115e59;
  font-size: 10px;
  line-height: 1.3;
}

.gps-review-pill {
  align-self: start;
  padding: 2px 5px;
  border: 1px solid #99f6e4;
  border-radius: 999px;
  background: #f0fdfa;
  color: #0f766e;
  font-size: 10px;
  font-weight: 760;
  white-space: nowrap;
}

.gps-review-pill.review {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.gps-review-pill.candidate {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

.route-list-toolbar {
  position: sticky;
  top: -14px;
  z-index: 20;
  display: grid;
  gap: 7px;
  margin: 0 -4px 10px;
  padding: 10px 4px 8px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.route-search {
  display: grid;
  gap: 4px;
}

.route-search span {
  color: #41546d;
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.route-search input {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #b8c5d5;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.route-search input:focus {
  border-color: #2563eb;
  outline: 2px solid rgba(37, 99, 235, 0.15);
}

.route-list-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.route-list-actions span {
  margin-right: auto;
  color: var(--muted);
  font-size: 11px;
}

.route-list-actions button {
  min-height: 29px;
  padding: 4px 7px;
  border: 1px solid #c3cedb;
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.route-groups {
  display: grid;
  gap: 8px;
}

.group {
  margin: 0;
}

.route-group {
  overflow: clip;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #ffffff;
}

.route-group > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 45px;
  padding: 9px 10px;
  color: #32445c;
  font-size: 13px;
  font-weight: 780;
  cursor: pointer;
  list-style: none;
}

.route-group > summary::-webkit-details-marker {
  display: none;
}

.route-group > summary::before {
  width: 8px;
  height: 8px;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  content: "";
  transform: rotate(-45deg);
  transition: transform 120ms ease;
}

.route-group[open] > summary::before {
  transform: rotate(45deg) translate(-1px, -1px);
}

.route-group > summary b {
  display: inline-grid;
  place-items: center;
  min-width: 25px;
  min-height: 25px;
  margin-left: auto;
  border-radius: 999px;
  background: #e8eef6;
  color: #41546d;
  font-size: 11px;
}

.route-group[open] > summary {
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.route-group-list {
  padding: 8px 8px 1px;
}

.route-subgroup {
  margin: 0 0 7px;
  overflow: clip;
  border: 1px solid #d8e1ec;
  border-radius: 8px;
  background: #f8fafc;
}

.route-subgroup > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  color: #40536b;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
  list-style: none;
}

.route-subgroup > summary::-webkit-details-marker {
  display: none;
}

.route-subgroup > summary::before {
  width: 7px;
  height: 7px;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  content: "";
  transform: rotate(-45deg);
}

.route-subgroup[open] > summary::before {
  transform: rotate(45deg) translate(-1px, -1px);
}

.route-subgroup > summary b {
  display: inline-grid;
  place-items: center;
  min-width: 23px;
  min-height: 23px;
  margin-left: auto;
  border-radius: 999px;
  background: #e4ebf4;
  color: #41546d;
  font-size: 10px;
}

.route-subgroup[open] > summary {
  border-bottom: 1px solid #d8e1ec;
  background: #eef3f8;
}

.route-subgroup-list {
  padding: 7px 7px 0;
  background: #ffffff;
}

.route-empty {
  padding: 14px;
  border: 1px dashed #b8c5d5;
  border-radius: 8px;
  background: #ffffff;
  text-align: center;
}

.leg-card {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 5px minmax(0, 1fr) auto;
  gap: 9px;
  text-align: left;
  margin: 0 0 8px;
  padding: 9px 9px 9px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.leg-card.active {
  border-color: #2563eb;
  box-shadow: inset 0 0 0 1px #2563eb;
}

.bar {
  border-radius: 8px 0 0 8px;
}

.leg-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.leg-title {
  font-size: 13px;
  line-height: 1.25;
  font-weight: 760;
}

.leg-meta,
.leg-route,
.leg-routing {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.leg-route,
.leg-routing {
  white-space: normal;
  overflow-wrap: anywhere;
}

.leg-routing {
  color: #475569;
  font-size: 11px;
  font-weight: 650;
}

.leg-side {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 3px 6px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--candidate);
  font-size: 11px;
  font-weight: 700;
}

.pill.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: var(--ok);
}

.pill.candidate {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: var(--candidate);
}

.pill.review {
  border-color: #fed7aa;
  background: #fff7ed;
  color: var(--review);
}

.warn {
  color: var(--review);
  font-weight: 700;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.detail-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 1.2;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.detail-grid div,
.warning-box,
.info-box,
.notes {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 8px;
}

.detail-grid b {
  display: block;
  margin-bottom: 3px;
  color: #43566f;
  font-size: 11px;
  text-transform: uppercase;
}

.detail-grid span,
.notes,
.warning-box,
.info-box {
  color: #33465f;
  font-size: 12px;
  line-height: 1.4;
}

.warning-box {
  margin-bottom: 8px;
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 650;
}

.info-box {
  margin-bottom: 8px;
}

.road-segments {
  margin: 0 0 10px;
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
}

.road-segments > summary {
  margin: 0 0 7px;
  color: #43566f;
  font-size: 11px;
  line-height: 1.2;
  text-transform: uppercase;
  font-weight: 800;
  cursor: pointer;
}

.road-segments > summary span {
  margin-left: 5px;
  color: #64748b;
  font-weight: 650;
}

.road-segments ol {
  display: grid;
  gap: 5px;
  max-height: 230px;
  margin: 0;
  padding-left: 20px;
  overflow: auto;
}

.road-segments li {
  padding-left: 2px;
  color: #33465f;
  font-size: 12px;
  line-height: 1.35;
}

.road-segments .road-segment-card {
  width: 100%;
  padding: 4px 5px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

.road-segments button.road-segment-card {
  cursor: pointer;
}

.road-segments button.road-segment-card:hover,
.road-segments button.road-segment-card.active {
  border-color: #fda4af;
  background: #fff1f2;
}

.road-segments button.road-segment-card.active {
  box-shadow: inset 0 0 0 1px #e11d48;
}

.road-segments b,
.road-segments span {
  display: block;
}

.road-segments span {
  color: #64748b;
  font-size: 11px;
}

.gps-segments {
  margin: 0 0 10px;
  padding: 8px;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  background: #f0fdfa;
}

.gps-segment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.gps-segments h3 {
  margin: 0 0 7px;
  color: #0f766e;
  font-size: 11px;
  line-height: 1.2;
  text-transform: uppercase;
}

.gps-segment-head h3 {
  margin-bottom: 0;
}

.gps-decision-export,
.segment-actions button {
  border: 1px solid #99f6e4;
  border-radius: 5px;
  background: #ffffff;
  color: #0f766e;
  font: inherit;
  font-size: 10px;
  font-weight: 760;
  cursor: pointer;
}

.gps-decision-export {
  flex: 0 0 auto;
  padding: 4px 6px;
}

.gps-segment-summary {
  margin: -2px 0 7px;
  color: #115e59;
  font-size: 11px;
  line-height: 1.25;
}

.gps-segment-highlights {
  display: grid;
  gap: 4px;
  margin: 0 0 7px;
}

.gps-segment-highlights div {
  padding: 5px 6px;
  border: 1px solid #99f6e4;
  border-radius: 6px;
  background: #ffffff;
  color: #134e4a;
  font-size: 11px;
  line-height: 1.3;
}

.gps-segment-highlights b,
.gps-segment-highlights span {
  display: block;
}

.gps-segment-highlights b {
  margin-bottom: 2px;
  color: #0f766e;
  font-size: 10px;
  text-transform: uppercase;
}

.segment-highlight-button,
.segment-highlight-static {
  display: block;
  width: 100%;
  margin-top: 3px;
  padding: 3px 5px;
  border-radius: 5px;
  font-size: 11px;
  line-height: 1.25;
  text-align: left;
}

.segment-highlight-button {
  border: 1px solid #99f6e4;
  background: #f0fdfa;
  color: #0f766e;
  cursor: pointer;
}

.segment-highlight-button:hover {
  border-color: #14b8a6;
  background: #ccfbf1;
}

.segment-highlight-static {
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.gps-segments ol {
  display: grid;
  gap: 5px;
  max-height: 260px;
  margin: 0;
  padding-left: 20px;
  overflow: auto;
}

.gps-segments li {
  padding-left: 2px;
  color: #134e4a;
  font-size: 12px;
  line-height: 1.35;
}

.gps-segments .segment-card {
  width: 100%;
  padding: 5px 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

.gps-segments button.segment-card {
  cursor: pointer;
}

.gps-segments button.segment-card:hover,
.gps-segments button.segment-card.active {
  border-color: #14b8a6;
  background: #ccfbf1;
}

.gps-segments button.segment-card.active {
  box-shadow: inset 0 0 0 1px #0f766e;
}

.gps-segments .no-map-slice {
  border-color: #fed7aa;
  background: rgba(255, 247, 237, 0.72);
}

.gps-segments .segment-card b,
.gps-segments .segment-card span {
  display: block;
}

.gps-segments .segment-card span {
  color: #47706c;
  font-size: 11px;
}

.gps-segments .segment-ref {
  width: fit-content;
  margin-bottom: 2px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #ccfbf1;
  color: #0f766e;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.gps-segments .segment-status {
  width: fit-content;
  margin-top: 3px;
  padding: 2px 5px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #475569;
  font-size: 10px;
  font-weight: 760;
}

.gps-segments .segment-status.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.gps-segments .segment-status.review {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.segment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 4px 0 1px;
}

.segment-actions button {
  padding: 3px 6px;
}

.segment-actions button.active {
  border-color: #0f766e;
  background: #0f766e;
  color: #ffffff;
}

.notes {
  margin-bottom: 8px;
  white-space: pre-line;
}

.stop-pin {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  min-width: 34px;
  height: 24px;
  padding: 0 6px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  color: #ffffff;
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.32);
}

.standby-marker {
  position: relative;
  width: 154px;
  height: 44px;
}

.standby-dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 14px;
  height: 14px;
  border: 3px solid #ffffff;
  border-radius: 999px;
  background: var(--route-color);
  box-shadow:
    0 0 0 2px var(--route-color),
    0 2px 6px rgba(15, 23, 42, 0.28);
}

.standby-callout {
  position: absolute;
  left: -84px;
  top: -32px;
  display: grid;
  gap: 1px;
  min-width: 116px;
  max-width: 148px;
  padding: 4px 6px;
  border: 1px solid rgba(71, 85, 105, 0.32);
  border-left: 4px solid var(--route-color);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.96);
  color: #122033;
  line-height: 1.15;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
  pointer-events: none;
}

.standby-marker.callout-right .standby-callout {
  left: 26px;
}

.standby-marker.callout-low .standby-callout {
  top: 24px;
}

.standby-callout::before {
  content: "";
  position: absolute;
  right: 2px;
  top: 28px;
  width: 12px;
  border-top: 2px solid var(--route-color);
}

.standby-marker.callout-right .standby-callout::before {
  left: 2px;
  right: auto;
}

.standby-marker.callout-low .standby-callout::before {
  top: 7px;
}

.standby-callout b {
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0;
  white-space: nowrap;
}

.standby-callout small {
  color: #475569;
  font-size: 9px;
  font-weight: 750;
  white-space: normal;
  overflow-wrap: anywhere;
}

.service-start-marker {
  position: relative;
  width: 176px;
  height: 46px;
  pointer-events: none;
}

.service-start-callout {
  position: absolute;
  left: 40px;
  top: -10px;
  display: grid;
  gap: 1px;
  min-width: 112px;
  padding: 4px 6px;
  border: 1px solid rgba(71, 85, 105, 0.32);
  border-left: 4px solid var(--route-color);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.96);
  color: #122033;
  line-height: 1.15;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
  pointer-events: none;
}

.service-start-marker.callout-left .service-start-callout {
  left: auto;
  right: 148px;
  border-right: 4px solid var(--route-color);
  border-left-width: 1px;
}

.service-start-marker.callout-high .service-start-callout {
  top: -38px;
}

.service-start-callout::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 17px;
  width: 10px;
  border-top: 2px solid var(--route-color);
}

.service-start-marker.callout-left .service-start-callout::before {
  left: auto;
  right: 2px;
}

.service-start-marker.callout-high .service-start-callout::before {
  top: 45px;
}

.service-start-callout b {
  display: block;
  max-width: 132px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 700px) {
  .standby-callout {
    top: 28px;
  }

  .standby-marker.callout-low .standby-callout {
    top: 64px;
  }

  .standby-callout::before {
    top: 7px;
  }

  .service-start-callout,
  .service-start-marker.callout-high .service-start-callout {
    top: -40px;
  }

  .service-start-callout::before,
  .service-start-marker.callout-high .service-start-callout::before {
    top: 47px;
  }
}

.leaflet-control-attribution {
  font-size: 10px;
}

@media (max-width: 1080px) {
  .app-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  main {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .detail-panel {
    border: 0;
    border-bottom: 1px solid var(--line);
  }

  .left-panel {
    display: contents;
  }

  #page-description { order: 1; }
  #stats { order: 2; }
  #status { order: 3; }
  .map-panel { order: 4; }
  #leg-list { order: 5; }
  .detail-panel { order: 6; }
  #gps-review-queue { order: 7; }
  #coverage-gaps { order: 8; }
  #operator-queue { order: 9; }

  #page-description,
  #stats,
  #status,
  #leg-list,
  #gps-review-queue,
  #coverage-gaps,
  #operator-queue {
    background: var(--panel);
  }

  #page-description {
    margin: 0;
    padding: 14px 14px 0;
  }

  #stats {
    margin: 0;
    padding: 8px 14px 10px;
  }

  #status {
    margin: 0 14px 12px;
  }

  #leg-list {
    margin: 0;
    padding: 14px;
    border-bottom: 1px solid var(--line);
  }

  #gps-review-queue,
  #coverage-gaps,
  #operator-queue {
    padding: 14px 14px 0;
  }

  .route-list-toolbar {
    top: 0;
  }

  .route-list-actions [data-route-list-action="expand"] {
    display: none;
  }

  .leg-card {
    grid-template-columns: 4px minmax(0, 1fr) auto;
    gap: 7px;
    padding: 8px 8px 8px 0;
  }

  .leg-card:not(.active) .leg-route,
  .leg-card:not(.active) .leg-routing,
  .leg-card:not(.active) .leg-badge {
    display: none;
  }

  .leg-meta {
    font-size: 11px;
  }

  #map {
    height: 62vh;
    min-height: 460px;
  }
}

@media (max-width: 700px) {
  header {
    display: grid;
    gap: 10px;
    padding: 11px 12px;
  }

  nav {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  nav a {
    flex: 0 0 auto;
  }

  .left-panel,
  .detail-panel {
    padding: 12px;
  }

  .route-list-toolbar {
    top: 0;
    margin-inline: -2px;
  }

  .route-group > summary {
    min-height: 48px;
    font-size: 14px;
  }

  .route-group-list {
    padding: 7px 7px 0;
  }

  .route-subgroup > summary {
    min-height: 44px;
    font-size: 13px;
  }

  .route-list-actions {
    flex-wrap: wrap;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 8mm;
  }

  body {
    background: #ffffff;
  }

  header {
    min-height: 0;
    padding: 0 0 6mm;
  }

  nav {
    display: none;
  }

  main {
    grid-template-columns: 88mm 1fr 78mm;
    height: 178mm;
  }

  .left-panel,
  .detail-panel {
    padding: 0 4mm 0 0;
    overflow: hidden;
    background: #ffffff;
  }

  .detail-panel {
    padding: 0 0 0 4mm;
  }

  #map {
    min-height: 0;
    height: 178mm;
  }

  .leg-card {
    page-break-inside: avoid;
  }
}
