:root {
  --ink: #061b3d;
  --navy: #0b2f73;
  --navy-2: #123f8a;
  --panel: #ffffff;
  --panel-soft: #f5f8fd;
  --line: #cbd7ea;
  --text: #061b3d;
  --muted: #53647d;
  --green: #36d399;
  --amber: #f6b93b;
  --red: #ff4d6d;
  --blue: #4aa3ff;
  --shadow: 0 20px 50px rgba(0, 0, 0, .18);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--navy);
  color: #fff;
}
a { color: inherit; }
button, input, select, textarea {
  font: inherit;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 28px;
  background: var(--ink);
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: .04em;
}
.brand h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}
.logo.logo-image {
  overflow: hidden;
  padding: 0;
}
.logo.logo-image img {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}
.brand p {
  margin: 4px 0 0;
  color: #c7d5ea;
  font-size: 14px;
}
.marshal-title-block { min-width: 0; position: relative; }
.ride-title-menu-button {
  background: var(--navy-2);
  border: 2px solid #86b7ff;
  border-radius: 8px;
  color: #fff;
  gap: 8px;
  justify-content: flex-start;
  min-height: 38px;
  padding: 5px 10px;
  text-align: left;
}
.ride-title-menu-button:hover,
.ride-title-menu-button:focus-visible {
  background: #1853a8;
  border-color: #fff;
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}
.ride-title-chevron { color: #ffe08a; font-size: .72em; }
.ride-switch-menu {
  background: #fff;
  border: 3px solid #4aa3ff;
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .42);
  color: var(--ink);
  display: grid;
  gap: 10px;
  left: 0;
  padding: 12px;
  position: absolute;
  top: calc(100% + 9px);
  width: min(520px, calc(100vw - 76px));
  z-index: 1400;
}
.ride-switch-menu-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
}
.ride-switch-menu-heading > strong { font-size: 17px; }
.ride-switch-menu-heading > button {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  flex: 0 0 38px;
  min-height: 36px;
  padding: 4px;
}
.ride-switch-choices { display: grid; gap: 8px; }
.ride-switch-choice {
  background: var(--navy);
  border: 2px solid var(--navy);
  color: #fff;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  justify-content: stretch;
  padding: 10px 12px;
  text-align: left;
  width: 100%;
}
.ride-switch-choice > span { display: grid; gap: 3px; min-width: 0; }
.ride-switch-choice strong,
.ride-switch-choice small { color: #fff; }
.ride-switch-choice small { font-weight: 600; }
.ride-switch-choice > b { color: #ffe08a; }
.ride-switch-choice.is-current,
.ride-switch-choice.is-current:disabled {
  background: #d7fbeb;
  border-color: #208b64;
  color: #064e38;
  opacity: 1;
}
.ride-switch-choice.is-current strong,
.ride-switch-choice.is-current small,
.ride-switch-choice.is-current > b { color: #064e38; }
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.nav a, .btn, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.btn.primary, button.primary { background: var(--green); color: var(--ink); border-color: var(--green); }
.btn.warn, button.warn { background: var(--amber); color: var(--ink); border-color: var(--amber); }
.btn.danger, button.danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn.light, button.light { background: #fff; color: var(--ink); border-color: #fff; }
.btn:disabled, button:disabled { opacity: .45; cursor: not-allowed; }

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 26px auto 60px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.two-col {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 18px;
}
.card {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.card.soft {
  background: var(--panel-soft);
  box-shadow: none;
}
.card h2, .card h3 {
  margin: 0 0 12px;
}
.card p {
  color: var(--muted);
  line-height: 1.45;
}
.metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}
.metric strong {
  display: block;
  font-size: 26px;
  color: var(--ink);
}
.metric-open-sos-active {
  animation: protect-sos-tile-flash 1.15s ease-in-out infinite alternate;
  background: #b0002b;
  border-color: #ff8aa1;
  color: #fff;
}
.metric-open-sos-active strong { color: #fff; }
@keyframes protect-sos-tile-flash {
  from { background: #8f0022; box-shadow: 0 0 0 rgba(255, 23, 68, 0); }
  to { background: #ff1744; box-shadow: 0 0 0 5px rgba(255, 23, 68, .22); }
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #e8f1ff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}
.pill.green { background: #d7fbeb; color: #065c3d; }
.pill.amber { background: #fff0ce; color: #734a00; }
.pill.red { background: #ffe1e7; color: #8a001f; }
.pill.muted { background: #e8edf5; color: #46566f; }

form {
  display: grid;
  gap: 12px;
}
label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-weight: 800;
}
label span {
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}
input, select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 88px; resize: vertical; }
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.status {
  min-height: 24px;
  font-weight: 800;
  color: var(--ink);
}
.status.bad { color: var(--red); }
.status.good { color: #067747; }

.pwa-install-invitation {
  align-items: center;
  background: #fff7dc;
  border-bottom: 1px solid #e4bd47;
  color: var(--ink);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 12px max(16px, calc((100% - 1180px) / 2));
}
.pwa-install-copy {
  display: grid;
  gap: 3px;
}
.pwa-install-copy strong {
  font-size: 17px;
}
.pwa-install-copy span {
  color: #4e4a3c;
  font-size: 14px;
  line-height: 1.35;
}
.pwa-install-copy ol {
  margin: 6px 0 0;
  padding-left: 22px;
}
.pwa-install-copy li { margin: 3px 0; }
.pwa-install-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}
.pwa-install-actions button {
  border-color: #926b00;
  color: var(--ink);
  min-height: 42px;
}
.pwa-install-actions .pwa-install-later {
  background: transparent;
}
.install-journey-status {
  margin: 10px auto 0;
  width: min(1180px, calc(100% - 32px));
}
.registration-restoration {
  align-items: center;
  background: #e8f1ff;
  border: 3px solid var(--blue);
  border-radius: 10px;
  color: var(--ink);
  display: grid;
  gap: 6px;
  margin: 14px auto;
  padding: 14px 18px;
  width: min(760px, calc(100% - 32px));
  z-index: 1500;
}
.registration-restoration strong { font-size: 18px; }
.registration-restoration button {
  background: var(--navy);
  justify-self: start;
}
.rider-mobile-flow {
  display: grid;
  gap: 16px;
  max-width: 760px;
}
.marshal-secondary-below-map {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tracking-summary {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
}
.tracking-summary .pill { justify-self: start; }
.tracking-summary small { color: var(--muted); line-height: 1.4; }
.tracking-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.tracking-actions button { min-height: 52px; }
.tracking-state {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .04em;
}
.speed-record-grid { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
.speed-record-heading {
  justify-content: space-between;
}
.speed-record-heading h2 { margin-bottom: 0; }
.speed-record-value {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  min-height: 76px;
}
.speed-record-value strong {
  color: var(--navy);
  font-size: 30px;
}
.speed-record-value small { color: var(--muted); }
.route-speed-editor {
  background: #eef5ff;
  border: 2px solid #5c82bd;
  border-radius: 8px;
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 16px;
}
.route-speed-editor-heading {
  justify-content: space-between;
}
.route-speed-editor-heading h3 { margin: 0 0 4px; }
.route-speed-editor-heading small { color: var(--muted); }
.route-speed-fields {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}
.route-speed-change-list { max-height: 260px; }
.speed-limit-route-marker {
  align-items: center;
  background: #fff;
  border: 4px solid #e3345f;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  color: #111;
  display: flex;
  font-size: 13px;
  font-weight: 950;
  height: 38px;
  justify-content: center;
  width: 38px;
}
.marshal-self-label {
  background: #061b3d;
  border: 2px solid #fff;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  color: #fff;
  font-weight: 800;
  padding: 4px 7px;
  white-space: nowrap;
}
.marshal-self-label::before { display: none; }

.map {
  min-height: 520px;
  border-radius: 8px;
  border: 1px solid var(--line);
  overflow: hidden;
}
.map-speed-limit-badge {
  align-items: center;
  background: #fff;
  border: 5px solid #e3345f;
  border-radius: 50%;
  bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  color: #111;
  display: flex;
  flex-direction: column;
  height: 62px;
  justify-content: center;
  left: 12px;
  line-height: 1;
  pointer-events: none;
  position: absolute;
  width: 62px;
  z-index: 20;
}
.map-speed-limit-badge strong { font-size: 25px; }
.map-speed-limit-badge small {
  color: #202020;
  font-size: 9px;
  font-weight: 900;
  margin-top: 3px;
}
.map-speed-limit-badge.is-unknown {
  border-color: #6b7b91;
  color: #46566f;
}
.map::after {
  border: 6px solid transparent;
  border-radius: 8px;
  content: '';
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 15;
}
.map.speed-limit-neutral::after { border-color: #6b7b91; }
.map.speed-limit-within::after { border-color: #12a66a; }
.map.speed-limit-amber::after {
  animation: speed-limit-amber-pulse .9s infinite alternate;
  border-color: #f6b93b;
}
.map.speed-limit-red::after { border-color: #e3345f; border-width: 8px; }
@keyframes speed-limit-amber-pulse {
  from { border-width: 5px; box-shadow: inset 0 0 0 0 rgba(246,185,59,.15); }
  to { border-width: 9px; box-shadow: inset 0 0 0 5px rgba(246,185,59,.35); }
}
@media (prefers-reduced-motion: reduce) {
  .map.speed-limit-amber::after { animation: none; }
}
.mini-map { min-height: 360px; }
.list {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
}
.list-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--ink);
}
.list-item small { color: var(--muted); }
.participant-card {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  padding: 4px;
  text-align: left;
  width: 100%;
}
.participant-card:hover,
.participant-card:focus-visible {
  box-shadow: 0 0 0 3px rgba(26,86,219,.14);
}
.participant-edit-hint { font-weight: 800; }
.participant-entry {
  display: grid;
  gap: 10px;
}
.participant-card-details {
  display: grid;
  gap: 4px;
}
.participant-card-pills,
.participant-card-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.participant-card-actions {
  border-top: 1px solid var(--line);
  padding-top: 9px;
}
.rider-trail-toggle {
  flex: 1 1 160px;
  min-height: 38px;
}
.rider-trail-toggle[aria-pressed="false"] {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}
.message-composer {
  display: grid;
  gap: 12px;
}
.message-composer textarea {
  min-height: 88px;
  resize: vertical;
}
.participant-message {
  border-left: 4px solid #4aa3ff;
}
.urgent-message {
  border-left-color: #e3345f;
  background: #fff6f8;
}
.message-acknowledged {
  color: #26734d;
  font-weight: 700;
}
.message-acknowledge {
  justify-self: start;
}
.map-dot-marker {
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
  display: block;
  height: 18px;
  width: 18px;
}
.map-initial-marker {
  align-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0,0,0,.4);
  color: #062b66;
  display: flex;
  font-size: 12px;
  font-weight: 950;
  height: 36px;
  justify-content: center;
  width: 36px;
}
.map-dot-marker,
.map-initial-marker,
.rider-live-marker,
.rider-direction-marker,
.ride-map-marker {
  position: relative;
}
.sos-beacon {
  z-index: 5;
}
.sos-beacon::after {
  animation: protect-sos-pulse 1.15s ease-out infinite;
  border: 5px solid #ff1744;
  border-radius: 50%;
  box-shadow: 0 0 16px rgba(255,23,68,.95);
  content: "";
  inset: -10px;
  pointer-events: none;
  position: absolute;
}
@keyframes protect-sos-pulse {
  0% { opacity: 1; transform: scale(.72); }
  70%, 100% { opacity: 0; transform: scale(1.65); }
}
@media (prefers-reduced-motion: reduce) {
  .sos-beacon::after {
    animation: none;
    opacity: 1;
  }
}
.sos-control-stack {
  display: grid;
  gap: 8px;
}
.sos-control-stack button {
  width: 100%;
}
.cancel-sos-button {
  background: #fff;
  border: 3px solid #b00020;
  color: #8b0018;
  font-weight: 900;
}
.sos-ack-button {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.image-drop-zone {
  align-items: center;
  background: #f4f8ff;
  border: 2px dashed #0b2f73;
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  gap: 8px;
  justify-items: center;
  min-height: 150px;
  padding: 16px;
  text-align: center;
}
.image-drop-zone.dragging {
  background: #e2f9ef;
  border-color: #16845a;
}
.image-drop-zone input[type="file"] {
  max-width: 100%;
}
.branding-preview {
  background: #fff;
  border: 1px solid #c8d6ee;
  border-radius: 12px;
  height: 96px;
  object-fit: contain;
  padding: 6px;
  width: 96px;
}
.ride-icon-inline {
  align-items: center;
  display: flex;
  gap: 12px;
}
.ride-icon-inline img {
  height: 64px;
  width: 64px;
}
.ride-choice-icon {
  border-radius: 10px;
  height: 48px;
  object-fit: contain;
  width: 48px;
}
.marshal-header-tracking {
  align-items: stretch;
  display: grid;
  gap: 5px;
  min-width: min(300px, 100%);
}
.marshal-header-tracking button { min-height: 48px; }
.marshal-header-tracking button.tracking-on {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(54,211,153,.2);
  color: var(--ink);
}
.marshal-header-tracking button.tracking-off {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.marshal-header-tracking button.header-reregister {
  background: transparent;
  border-color: rgba(255,255,255,.55);
  color: #fff;
  min-height: 38px;
}
.marshal-header-tracking button.header-reregister:hover {
  background: rgba(255,255,255,.12);
}
.marshal-header-secondary {
  display: grid;
  gap: 5px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.marshal-header-tracking button.header-messages {
  align-items: center;
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.55);
  color: #fff;
  display: flex;
  gap: 7px;
  justify-content: center;
  min-height: 38px;
}
.marshal-header-tracking button.header-messages.has-new-messages {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(255,190,11,.2);
}
.marshal-header-tracking small {
  align-items: center;
  background: rgba(255,255,255,.11);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  color: #dce8ff;
  display: flex;
  justify-content: center;
  min-height: 28px;
  padding: 4px 8px;
  text-align: center;
}
.marshal-page {
  display: grid;
  gap: 16px;
}
.marshal-live-status:empty { display: none; }
.marshal-compact-panel {
  overflow: hidden;
  padding: 0;
}
.marshal-compact-panel > summary {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 4px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  font-weight: 850;
  list-style-position: inside;
  padding: 14px 16px;
}
.marshal-compact-panel > summary small {
  color: var(--muted);
  font-weight: 650;
  max-width: min(48vw, 420px);
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.marshal-compact-panel[open] > summary {
  border-bottom: 1px solid var(--line);
}
.compact-panel-content {
  display: grid;
  gap: 12px;
  padding: 14px 16px 16px;
}
.marshal-channel-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.marshal-status-card {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 12px 14px;
}
.marshal-status-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.marshal-status-actions button {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  min-height: 42px;
}
.tracking-policy-details summary {
  color: var(--muted);
  cursor: pointer;
  font-weight: 750;
}
.marshal-resume-card,
.rider-resume-card {
  border: 3px solid var(--green);
  margin-bottom: 16px;
}
.marshal-emergency {
  background: transparent;
  border: 0;
  padding: 0;
}
.marshal-emergency button {
  font-size: 18px;
  min-height: 58px;
  width: 100%;
}
.marshal-map-card {
  padding: 12px;
  position: relative;
  width: min(100%, 640px);
  justify-self: start;
}
.marshal-map-card .map {
  aspect-ratio: 1 / 1;
  height: auto;
  min-height: 0;
  width: 100%;
}
.marshal-map-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: absolute;
  left: 22px;
  right: 58px;
  top: 22px;
  z-index: 500;
}
.marshal-map-tools button {
  flex: 0 1 auto;
  min-height: 38px;
  padding: 8px 11px;
}
#marshalTrailToggleBtn {
  background: rgba(255,255,255,.24);
  border: 3px solid var(--ink);
  box-shadow: 0 0 0 1px rgba(255,255,255,.9), 0 2px 6px rgba(0,0,0,.28);
  color: var(--ink);
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(255,255,255,.95);
}
#marshalTrailToggleBtn:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}
.marshal-map-view-control {
  align-items: center;
  background: var(--navy);
  border: 2px solid #fff;
  border-radius: 10px;
  color: #fff;
  display: flex;
  font-size: 12px;
  font-weight: 900;
  gap: 5px;
  min-height: 38px;
  padding: 4px 7px;
}
.marshal-map-view-control select {
  background: #fff;
  border: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  min-height: 27px;
  padding: 2px 4px;
  width: 118px;
}
.tracking-policy-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
}
.marshal-operational-roles {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: min(100%, 640px);
}
.marshal-operational-roles > div:first-child {
  display: grid;
  margin-right: auto;
}
.marshal-operational-roles small { color: var(--muted); }
.assignment-toggle {
  align-items: center;
  background: #eef5ff;
  border: 2px solid var(--navy);
  border-radius: 8px;
  color: var(--ink);
  display: inline-flex;
  font-weight: 900;
  gap: 7px;
  min-height: 42px;
  padding: 8px 10px;
}
.assignment-toggle input { width: 20px; height: 20px; }
.marshal-identity-feed {
  align-items: center;
  display: flex;
  gap: 5px;
  max-width: min(72vw, 720px);
  white-space: nowrap;
}
.header-feed-window {
  display: inline-block;
  max-width: min(50vw, 440px);
  overflow: hidden;
  vertical-align: bottom;
}
.header-info-feed {
  animation: marshal-feed-scroll 9.5s linear infinite;
  display: inline-block;
  min-width: max-content;
  padding-left: 100%;
}
.header-info-feed[data-kind="bad"] { color: #ff9aaf; }
.header-feed-window.sos-ticker-active {
  background: #c70031;
  border: 2px solid #ff8aa1;
  border-radius: 5px;
  box-shadow: 0 0 0 2px rgba(255, 23, 68, .18);
  color: #fff;
  padding: 2px 6px;
}
.header-info-feed[data-kind="sos"] {
  color: #fff;
  font-weight: 900;
}
@keyframes marshal-feed-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}
@media (prefers-reduced-motion: reduce) {
  .header-info-feed { animation: none; padding-left: 0; }
  .metric-open-sos-active { animation: none; background: #c70031; }
}
.marshal-ride-select-page {
  margin-inline: auto;
  max-width: 760px;
}
.ride-choice-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.ride-choice {
  align-items: center;
  background: #f5f8fd;
  border: 2px solid #b8cbe8;
  border-radius: 12px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 14px;
}
.ride-choice.is-current {
  background: #ecfff7;
  border-color: #279873;
}
.ride-choice-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.ride-choice-copy strong {
  color: var(--navy);
  font-size: 1.1rem;
}
.ride-choice-copy time { font-weight: 800; }
.ride-choice-copy > span:not(.pill) { color: var(--muted); }
.ride-choice-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 3px;
}
.ride-choice > button { min-width: 118px; }
.marshal-ride-select-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
@media (max-width: 560px) {
  .ride-choice { grid-template-columns: auto minmax(0, 1fr); }
  .ride-choice > button { grid-column: 1 / -1; }
  .ride-choice > button { width: 100%; }
}
.route-planner-card { border: 3px solid #9b5de5; }
.route-planner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.route-planner-actions button { min-height: 48px; }
.route-list-item .route-action {
  border-style: solid;
  border-width: 2px;
  box-shadow: 0 2px 5px rgba(6, 27, 61, .2);
  min-height: 44px;
}
.route-list-item .route-action-rename {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.route-list-item .route-action-activate {
  background: var(--green);
  border-color: #208b64;
  color: var(--ink);
}
.route-list-item .route-action-delete {
  background: var(--red);
  border-color: #b91f43;
  color: #fff;
}
.route-list-item .route-action:hover {
  filter: brightness(.92);
}
.route-list-item .route-action:focus-visible {
  outline: 4px solid var(--amber);
  outline-offset: 2px;
}
.marshal-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.participant-dialog {
  border: 0;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  color: var(--ink);
  max-height: 90vh;
  max-width: 680px;
  overflow: auto;
  padding: 0;
  width: calc(100% - 24px);
}
.participant-dialog::backdrop { background: rgba(3,20,48,.72); }
.participant-dialog form { padding: 22px; }
.participant-dialog-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
}
.participant-dialog-header h2 { margin: 0; }
.participant-dialog-fields {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.participant-dialog-fields .wide { grid-column: 1 / -1; }
.participant-dialog-fields input[type="checkbox"] {
  min-height: 0;
  width: auto;
}
@media (max-width: 640px) {
  .pwa-install-invitation {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }
  .pwa-install-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .participant-dialog-fields { grid-template-columns: 1fr; }
  .participant-dialog-fields .wide { grid-column: auto; }
}
.qr-box {
  display: grid;
  gap: 10px;
  justify-items: start;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}
.qr-box img {
  width: 180px;
  height: 180px;
  background: #fff;
  border: 1px solid var(--line);
}

.scan-video {
  width: 100%;
  max-height: 320px;
  background: #000;
  border-radius: 8px;
  border: 1px solid var(--line);
}

@media (max-width: 800px) {
  .app-header { align-items: flex-start; flex-direction: column; padding: 16px; }
  .page { width: min(100% - 20px, 1180px); margin-top: 16px; }
  .two-col { grid-template-columns: 1fr; }
  .map { min-height: 420px; }
  .nav { width: 100%; }
  .nav a, .btn, button { flex: 1 1 auto; }
  .tracking-actions { grid-template-columns: 1fr; }
  .speed-record-grid,
  .route-speed-fields { grid-template-columns: 1fr; }
  .marshal-header-tracking { width: 100%; }
  .marshal-live-body .app-header {
    gap: 10px;
    padding: 10px 12px;
    position: sticky;
    top: 0;
    z-index: 1200;
  }
  .marshal-live-body .brand { width: 100%; }
  .marshal-live-body .brand h1 { font-size: 18px; }
  .marshal-live-body .brand p {
    font-size: 12px;
    margin-top: 2px;
  }
  .marshal-live-body .logo {
    height: 38px;
    width: 38px;
  }
  .marshal-live-body .marshal-header-tracking {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .marshal-live-body .marshal-header-tracking button {
    font-size: 13px;
    min-height: 44px;
    padding: 8px;
  }
  .marshal-live-body .marshal-header-tracking small {
    font-size: 11px;
    line-height: 1.2;
    min-height: 26px;
    padding: 4px 6px;
  }
  .marshal-live-body .marshal-header-secondary {
    grid-column: 1 / -1;
  }
  .marshal-live-body .marshal-header-secondary button {
    min-height: 36px;
  }
  .marshal-live-body .marshal-page {
    gap: 10px;
    margin-top: 10px;
    width: min(100% - 16px, 1180px);
  }
  .marshal-live-body .marshal-emergency button {
    min-height: 50px;
  }
  .marshal-live-body .message-composer textarea { min-height: 72px; }
  .marshal-live-body .marshal-map-card { padding: 8px; }
  .marshal-live-body .marshal-map-tools {
    gap: 5px;
    left: 14px;
    right: 48px;
    top: 14px;
  }
  .marshal-live-body .marshal-map-tools button {
    font-size: 12px;
    min-height: 34px;
    padding: 6px 8px;
  }
  .marshal-live-body .marshal-map-view-control {
    min-height: 34px;
    padding: 3px 5px;
  }
  .marshal-live-body .marshal-map-view-control select {
    font-size: 11px;
    width: 104px;
  }
  .marshal-live-body .marshal-status-card {
    grid-template-columns: 1fr;
  }
  .marshal-compact-panel > summary {
    padding: 12px;
  }
  .compact-panel-content {
    padding: 12px;
  }
  .marshal-map-card { width: 100%; }
  .marshal-map-card .map { min-height: 0; }
  .marshal-map-tools {
    gap: 6px;
    left: 18px;
    right: 50px;
    top: 18px;
  }
  .marshal-map-tools button {
    font-size: .82rem;
    padding: 7px 9px;
  }
}
