:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-strong: #f8fafc;
  --rail: #111827;
  --text: #111827;
  --muted: #64748b;
  --line: #dbe3ee;
  --line-strong: #c7d2e3;
  --green: #16a34a;
  --blue: #2563eb;
  --red: #dc2626;
  --shadow: 0 18px 42px rgba(15, 23, 42, 0.11);
  --soft-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  min-height: 100%;
}

body {
  min-height: 100vh;
  overflow: hidden;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  width: 100%;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.hero {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  gap: 18px;
  padding: 22px;
  color: #f8fafc;
  background: linear-gradient(180deg, #111827, #0f172a);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 7px;
}

.eyebrow {
  margin: 0 0 6px;
  color: #86efac;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.helper-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

h1,
h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

h1 {
  font-size: 22px;
  line-height: 1.1;
}

h2 {
  font-size: 25px;
  letter-spacing: 0;
}

.hero-copy p {
  margin: 0 0 12px;
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  gap: 10px;
}

.app-nav {
  grid-column: 1;
  grid-row: 2;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 6px 14px 22px;
  overflow-y: auto;
  max-height: 100%;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, #111827, #0f172a);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.app-nav button {
  position: relative;
  width: 100%;
  min-height: 44px;
  padding: 0 12px 0 16px;
  border: 0;
  border-radius: 8px;
  color: #cbd5e1;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-nav button:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
}

.app-nav button.is-active {
  color: #052e16;
  background: #86efac;
  box-shadow: 0 10px 22px rgba(134, 239, 172, 0.18);
}

.app-nav button.is-active::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: #052e16;
}

.nav-group {
  display: grid;
  gap: 6px;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-group > span {
  padding: 0 12px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.grid {
  grid-column: 2;
  grid-row: 1 / 3;
  display: block;
  min-width: 0;
  height: 100vh;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 28px;
}

.panel {
  width: min(1120px, 100%);
  min-height: calc(100vh - 56px);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96)),
    var(--surface);
  box-shadow: var(--shadow);
}

[hidden] {
  display: none !important;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-subhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 18px 0 12px;
}

.panel-subhead h3 {
  margin: 0;
  font-size: 17px;
}

.toolbar-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
}

.demo-checklist {
  display: grid;
  gap: 10px;
}

.demo-checklist > div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.demo-checklist > div:last-child {
  border-bottom: 0;
}

.demo-checklist strong {
  font-size: 0.92rem;
}

.demo-checklist code {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: #0f172a;
  font-size: 0.84rem;
}

.demo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.demo-commands {
  padding: 12px 0;
}

.demo-commands summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 800;
}

.demo-commands code {
  margin-top: 10px;
}

.toolbar-inline label {
  min-width: 130px;
}

.toolbar-inline input,
.toolbar-inline select {
  min-height: 40px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: #1e293b;
  background: #e2e8f0;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.is-good {
  color: #052e16;
  background: #dcfce7;
}

.status-pill.is-warn {
  color: #713f12;
  background: #fef3c7;
}

.status-pill.is-danger {
  color: #7f1d1d;
  background: #fee2e2;
}

.status-pill.is-muted {
  color: #334155;
  background: #e2e8f0;
}

.stack,
.table-list,
.summary-list,
.two-list,
.log-output {
  display: grid;
  gap: 12px;
}

.gps-health-list {
  display: grid;
  gap: 10px;
}

.gps-health-row {
  display: grid;
  grid-template-columns: max-content minmax(120px, 1fr) minmax(140px, 1fr);
  gap: 6px 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 13px;
}

.gps-health-row strong {
  color: var(--text);
}

.summary-mini-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 1.4fr) max-content;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 13px;
}

.attention-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff7ed;
}

.attention-panel.is-clear {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.attention-panel.is-clear div {
  display: grid;
  gap: 4px;
}

.attention-panel.is-clear span {
  color: var(--muted);
  font-size: 13px;
}

.attention-panel-head,
.attention-item {
  display: grid;
  align-items: center;
  gap: 10px;
}

.attention-panel-head {
  grid-template-columns: minmax(0, 1fr) max-content;
}

.attention-panel-head strong {
  display: block;
  font-size: 18px;
}

.attention-list {
  display: grid;
  gap: 8px;
}

.attention-item {
  grid-template-columns: 46px minmax(0, 1fr) max-content;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.attention-item > strong {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--blue);
}

.attention-item.danger > strong {
  background: var(--red);
}

.attention-item.warn > strong {
  background: #d97706;
}

.attention-item span,
.attention-item small {
  display: block;
}

.attention-item span {
  font-weight: 800;
}

.attention-item small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

@media (max-width: 720px) {
  .summary-mini-row,
  .attention-panel-head,
  .attention-item {
    grid-template-columns: 1fr;
  }

  .attention-item > strong {
    width: 100%;
  }
}

label span,
.metric-label,
.table-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

textarea {
  min-height: 110px;
  padding: 12px 13px;
  line-height: 1.45;
  resize: vertical;
}

select {
  cursor: pointer;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(37, 99, 235, 0.16);
  border-color: rgba(37, 99, 235, 0.55);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  background: #eef2f7;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--soft-shadow);
}

.button.primary {
  color: #ffffff;
  background: var(--green);
}

.button.subtle {
  color: #0f172a;
  background: #e2e8f0;
}

.callout,
.empty-state {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--muted);
  line-height: 1.55;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metrics article,
.table-row,
.summary-row,
.resource-card,
.log-line {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.metrics article:nth-child(2n) {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.metrics article:nth-child(3n) {
  border-color: #fed7aa;
  background: #fff7ed;
}

.table-row:hover,
.summary-row:hover,
.resource-card:hover {
  border-color: var(--line-strong);
  background: #ffffff;
}

.summary-action-bar {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.summary-action {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.summary-action:hover,
.summary-action:focus {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.summary-action.danger {
  border-color: #fecaca;
  background: #fef2f2;
}

.summary-action strong,
.summary-action span {
  display: block;
  overflow-wrap: anywhere;
}

.summary-action strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
  line-height: 1;
}

.summary-action span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metrics strong {
  display: block;
  min-height: 25px;
  overflow-wrap: anywhere;
  font-family: "Space Grotesk", sans-serif;
  font-size: 24px;
}

#map {
  width: 100%;
  height: min(62vh, 560px);
  min-height: 360px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table-row {
  cursor: pointer;
}

.trip-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.1fr) minmax(210px, 1.3fr) minmax(170px, 1fr) max-content;
  gap: 12px;
  align-items: stretch;
}

.trip-cell {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 4px;
  padding-right: 8px;
  border-right: 1px solid var(--line);
}

.trip-cell:last-of-type {
  border-right: 0;
}

.trip-cell strong {
  margin: 0;
  overflow-wrap: anywhere;
}

.trip-cell small {
  display: block;
}

.trip-actions {
  align-self: center;
  justify-content: end;
}

.table-row strong {
  display: block;
  color: var(--text);
  margin-bottom: 6px;
}

.table-row small,
.summary-row,
.resource-card,
.log-line {
  color: var(--muted);
  line-height: 1.5;
}

.resource-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.resource-card h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.resource-card ul {
  margin: 0;
  padding-left: 18px;
}

.resource-card li small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.rider-list-item {
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
}

.rider-list-item:hover,
.rider-list-item:focus {
  outline: none;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px var(--line);
}

.resource-filter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 150px);
  gap: 8px;
  margin: 0 0 10px;
}

.schedule-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.schedule-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.schedule-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.schedule-card-head strong,
.schedule-card-head small {
  display: block;
}

.schedule-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
}

.schedule-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.schedule-meta strong {
  display: block;
  color: var(--text);
  font-size: 12px;
}

.day-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.day-picker legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.day-picker label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
}

.management-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.management-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.management-card h3 {
  margin: 0 0 2px;
  font-size: 17px;
}

.management-wide {
  grid-column: 1 / -1;
}

.form-help {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.form-section {
  display: grid;
  gap: 10px;
  padding-top: 6px;
}

.form-section + .form-section {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 14px;
}

.form-section h4 {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.checkbox-label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
}

.checkbox-label.compact {
  grid-template-columns: 18px max-content;
}

.template-list {
  display: grid;
  gap: 12px;
}

.template-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.template-row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.template-row-head strong,
.template-row-head span {
  display: block;
}

.template-row-head span {
  color: var(--muted);
  font-size: 12px;
}

.template-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
}

.handoff-controls {
  grid-template-columns: minmax(180px, 320px) minmax(160px, 260px) max-content;
}

.handoff-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.handoff-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.handoff-card h3 {
  margin: 0 0 12px;
  font-size: 17px;
}

.handoff-wide {
  grid-column: 1 / -1;
}

.handoff-endpoints {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.handoff-endpoints ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.handoff-endpoints li {
  margin: 4px 0;
}

.handoff-card code,
.handoff-code code {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.handoff-code {
  margin-top: 12px;
}

.handoff-code .data-row-actions {
  align-items: center;
  justify-content: space-between;
  margin: 0 0 6px;
}

.handoff-code pre {
  max-width: 100%;
  margin: 0;
  padding: 12px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  line-height: 1.5;
}

.inline-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.toolbar-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
  gap: 12px;
  margin-bottom: 16px;
}

.data-list {
  display: grid;
  gap: 10px;
}

.data-row {
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--muted);
  line-height: 1.45;
}

.data-row.is-clickable {
  cursor: pointer;
}

.data-row.is-clickable:hover {
  border-color: var(--line-strong);
  background: #ffffff;
  box-shadow: var(--soft-shadow);
}

.data-row strong {
  color: var(--text);
}

.data-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.inline-action {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-left: 8px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #0f172a;
  background: #e2e8f0;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  justify-items: end;
  background: rgba(15, 23, 42, 0.42);
}

.modal-panel {
  width: min(720px, 100%);
  height: 100vh;
  overflow-y: auto;
  padding: 24px;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.issue-detail-body {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.issue-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.issue-detail-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.issue-detail-item strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

.issue-message {
  white-space: pre-wrap;
}

.issue-action-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.issue-note-field {
  grid-column: 1 / -1;
}

.rider-detail-panel {
  width: min(780px, 100%);
}

.operations-detail-panel {
  width: min(760px, 100%);
}

.action-confirm-panel {
  width: min(560px, 100%);
}

#actionConfirmMessage {
  color: var(--text);
}

#actionConfirmNote {
  min-height: 118px;
}

.rider-detail-head {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: -24px -24px 18px;
  padding: 24px;
  background: var(--surface);
}

.rider-detail-subtitle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.rider-detail-form {
  display: grid;
  gap: 16px;
}

#operationsDrawerBody {
  display: grid;
  gap: 16px;
}

.drawer-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.drawer-section h3 {
  margin: 0;
  font-size: 16px;
}

.drawer-grid,
.metadata-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.drawer-current-assignment {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.drawer-current-assignment strong,
.metadata-grid strong {
  color: var(--text);
}

.metadata-grid div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.metadata-grid .parent-link-box {
  grid-column: 1 / -1;
}

.metadata-grid span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.parent-link-output {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.privacy-hint {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.drawer-feedback {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  line-height: 1.45;
}

.drawer-feedback[data-tone="success"] {
  border-color: #86efac;
  color: #052e16;
  background: #dcfce7;
}

.drawer-feedback[data-tone="error"] {
  border-color: #fecaca;
  color: #7f1d1d;
  background: #fee2e2;
}

.drawer-feedback[data-tone="warn"] {
  border-color: #fde68a;
  color: #713f12;
  background: #fef3c7;
}

.section-title {
  margin: 18px 0 10px;
  font-size: 17px;
}

.timeline-list {
  display: grid;
  gap: 10px;
}

.timeline-item {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.timeline-item p {
  margin: 6px 0 0;
  color: var(--muted);
  white-space: pre-wrap;
}

.api-key-reveal {
  border-color: #22c55e;
  background: #f0fdf4;
}

.api-key-reveal small {
  display: block;
  margin-top: 8px;
  color: #166534;
  line-height: 1.45;
}

.secret-box {
  display: block;
  max-width: 100%;
  margin-top: 8px;
  padding: 10px 11px;
  overflow-wrap: anywhere;
  border-radius: 8px;
  color: #052e16;
  background: #dcfce7;
  border: 1px solid #86efac;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

textarea.secret-box {
  min-height: 92px;
  white-space: pre-wrap;
  resize: vertical;
}

.vehicle-marker {
  position: relative;
  width: 132px;
  height: 44px;
  pointer-events: auto;
}

.vehicle-marker-pulse {
  position: absolute;
  left: 53px;
  bottom: 0;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.22);
  border: 1px solid rgba(22, 163, 74, 0.5);
  animation: livePulse 1.8s ease-out infinite;
}

.vehicle-marker-body {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  grid-template-columns: 12px 1fr;
  grid-template-rows: auto auto;
  column-gap: 7px;
  min-width: 132px;
  padding: 8px 10px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 8px 8px 8px 2px;
  color: #052e16;
  background: #86efac;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.3);
  transform: translateY(-8px);
}

.vehicle-marker-window {
  grid-row: 1 / 3;
  width: 12px;
  height: 20px;
  border-radius: 3px;
  background: rgba(5, 46, 22, 0.22);
  align-self: center;
}

.vehicle-marker strong,
.vehicle-marker small {
  display: block;
  line-height: 1.1;
  white-space: nowrap;
}

.vehicle-marker strong {
  max-width: 96px;
  overflow: visible;
  font-size: 11px;
  font-weight: 900;
}

.vehicle-marker small {
  font-size: 10px;
  font-weight: 800;
  opacity: 0.78;
}

@keyframes livePulse {
  0% {
    transform: scale(0.6);
    opacity: 0.9;
  }

  100% {
    transform: scale(1.9);
    opacity: 0;
  }
}

@media (max-width: 920px) {
  body {
    overflow: hidden;
  }

  .shell {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100vh;
    min-height: 100vh;
  }

  .hero {
    position: relative;
    z-index: 20;
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-right: 0;
  }

  .brand {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 8px;
  }

  .hero-copy {
    display: none;
  }

  h1 {
    font-size: 18px;
  }

  .app-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 15;
    grid-column: 1;
    grid-row: 3;
    display: flex;
    gap: 8px;
    height: 74px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    overflow-x: auto;
    overflow-y: hidden;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 0;
    scrollbar-width: none;
  }

  .app-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-group {
    display: contents;
  }

  .nav-group > span {
    display: none;
  }

  .app-nav button {
    flex: 0 0 auto;
    width: auto;
    min-width: 72px;
    min-height: 52px;
    padding: 0 10px;
    font-size: 12px;
    line-height: 1.1;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.035);
  }

  .app-nav button.is-active::before {
    display: none;
  }

  .app-nav button.is-active {
    border-color: rgba(134, 239, 172, 0.72);
    box-shadow: inset 3px 0 0 #052e16, 0 8px 18px rgba(0, 0, 0, 0.14);
  }

  .grid {
    grid-column: 1;
    grid-row: 2;
    height: 100%;
    min-height: calc(100vh - 66px);
    padding: 10px 10px 90px;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

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

  .trip-cell {
    padding-right: 0;
    padding-bottom: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .trip-actions {
    justify-content: stretch;
  }

  .modal-panel {
    width: 100%;
  }

  .issue-action-form {
    grid-template-columns: 1fr;
  }

  .rider-detail-head {
    margin: -14px -14px 14px;
    padding: 14px;
  }

  .rider-detail-head,
  .drawer-actions {
    align-items: stretch;
  }

  .drawer-actions {
    width: 100%;
  }

  .drawer-actions .button {
    flex: 1;
  }

  .panel {
    width: 100%;
    min-height: 0;
    padding: 14px;
    border-radius: 10px;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 14px;
  }

  .metrics,
  .summary-action-bar,
  .resource-columns,
  .demo-checklist > div,
  .schedule-meta,
  .management-grid,
  .handoff-grid,
  .handoff-endpoints,
  .drawer-grid,
  .metadata-grid,
  .inline-fields,
  .toolbar-row {
    grid-template-columns: 1fr;
  }

  #map {
    height: min(52vh, 420px);
    min-height: 280px;
  }
}

/* Keep the sidebar and content as independent scroll panes on desktop. */
.shell {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.app-nav {
  min-height: 0;
  scrollbar-gutter: stable;
  touch-action: pan-y;
  overscroll-behavior-y: contain;
}

.grid {
  min-height: 0;
}

@media (max-width: 920px) {
  .shell {
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100vh;
    min-height: 100vh;
  }

  .app-nav {
    align-self: auto;
    height: 74px;
    max-height: 74px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .grid {
    height: calc(100vh - 66px);
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }
}
