:root {
  color-scheme: only light;
  --bg: #fffff8;
  --panel: rgba(255, 255, 251, 0.96);
  --panel-2: rgba(248, 248, 239, 0.92);
  --panel-3: rgba(243, 239, 230, 0.92);
  --surface: rgba(255, 255, 251, 0.92);
  --surface-input: rgba(255, 255, 251, 0.96);
  --text: #1f1912;
  --muted: #6f6257;
  --line: rgba(31, 25, 18, 0.1);
  --accent: #3b82f6;
  --accent-strong: #2563eb;
  --danger: #b45c5c;
  --success: #2f855a;
  --shadow: 0 18px 42px rgba(31, 25, 18, 0.08);
}

html[data-theme="dark"] {
  color-scheme: only dark;
  --bg: #1a1714;
  --panel: rgba(30, 26, 22, 0.96);
  --panel-2: rgba(38, 34, 28, 0.92);
  --panel-3: rgba(44, 40, 34, 0.92);
  --surface: rgba(38, 34, 28, 0.92);
  --surface-input: rgba(42, 38, 32, 0.96);
  --text: #e8e0d8;
  --muted: #9a8b7f;
  --line: rgba(255, 255, 248, 0.1);
  --accent: #3b82f6;
  --accent-strong: #60a5fa;
  --danger: #e06b6b;
  --success: #48bb78;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100dvh;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.12), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}

.hidden { display: none !important; }
.container { width: min(1440px, calc(100% - 32px)); margin: 0 auto; padding: 16px 0 18px; }
.page-header { margin-bottom: 8px; }
.page-footer { margin-top: 14px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--muted); }
.footer-version { font-variant-numeric: tabular-nums; }
.footer-sep { margin: 0 4px; }
.footer-home { color: var(--muted); text-decoration: none; }
.footer-home:hover { color: var(--accent); text-decoration: underline; }
.app-title { font-size: clamp(2.2rem, 4vw, 3.8rem); letter-spacing: -0.05em; }
.app-subtitle { margin: 4px 0 0; color: var(--muted); max-width: 720px; font-size: 0.92rem; }

.auth-bar,
.panel,
.subpanel {
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-bar { padding: 10px; margin-bottom: 10px; }
.auth-logged-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.app-shell { display: grid; gap: 10px; }

.tab-bar {
  display: inline-flex;
  gap: 0;
  padding: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  align-self: start;
}

.tab-button,
.button,
.text-input,
.text-area,
.color-input,
select {
  font: inherit;
}

.tab-button,
.button {
  border: 1px solid var(--line);
  border-radius: 0;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.tab-button {
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
}

.tab-button.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.button {
  padding: 7px 11px;
  background: var(--panel-2);
  color: var(--text);
}

.button:hover,
.tab-button:hover { transform: translateY(-1px); }
.button-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button-primary:hover,
.tab-button.is-active:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.button-danger { background: rgba(180, 92, 92, 0.1); border-color: rgba(180, 92, 92, 0.24); color: var(--danger); }

.panel { padding: 14px; }
.subpanel { padding: 12px; background: var(--panel-2); }
.subpanel-head,
.section-head-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.subpanel-head { margin-bottom: 10px; }
.section-head-inline { margin-bottom: 12px; }
h2, h3, p { margin: 0; }
.muted { color: var(--muted); }

.accordion-table {
  display: grid;
  gap: 0;
}

.accordion-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.accordion-toolbar .text-input {
  flex: 1;
  min-width: 0;
}

.accordion-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: background 100ms ease;
}

.accordion-table .accordion-row:first-child {
  border-radius: 0;
}

.accordion-table .accordion-row:last-child,
.accordion-table .accordion-detail:last-child {
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.accordion-table .accordion-row:first-child:last-child {
  border-radius: 0;
}

.accordion-row:hover {
  background: rgba(59, 130, 246, 0.04);
}

.accordion-row.is-selected {
  background: rgba(59, 130, 246, 0.06);
  border-bottom: 1px solid rgba(59, 130, 246, 0.18);
}

.accordion-row .route-chip {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.accordion-row-info {
  flex: 1;
  min-width: 0;
}

.accordion-row-info .item-title {
  font-size: 0.88rem;
}

.accordion-row-info .item-subtitle {
  font-size: 0.78rem;
}

.accordion-detail {
  padding: 10px;
  border: none;
  border-top: 1px solid rgba(59, 130, 246, 0.12);
  border-bottom: 1px solid rgba(59, 130, 246, 0.12);
  background: var(--panel-2);
}

.accordion-detail + .accordion-row {
  border-top: none;
}

.accordion-row .route-chip.home-chip {
  background: #1d4ed8;
}

.accordion-row .service-swatch {
  width: 12px;
  height: 12px;
}

.route-name-edit {
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  border: 1px solid transparent;
  background: transparent;
  padding: 2px 6px;
  margin: -2px -6px;
  border-radius: 0;
  width: auto;
  max-width: 100%;
  color: var(--text);
  outline: none;
}

.route-name-edit:focus {
  background: var(--surface-input);
  border-color: var(--line);
}

.route-editor-body {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 12px;
  align-items: start;
}

.route-editor-aside {
  position: sticky;
  top: 0;
  display: grid;
  gap: 8px;
}

.route-map-container {
  height: 380px;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f0ede4;
}

.route-map-container .waypoint-marker {
  background: transparent;
}

.route-map-container .waypoint-marker-dot {
  width: 22px;
  height: 22px;
  color: #000;
  border: 2px solid #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 10px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.button-row,
.badge-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.form-grid-home { grid-template-columns: 220px minmax(0, 1fr); }

.home-editor-body {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 12px;
  align-items: start;
}
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 0.85rem; color: var(--muted); }
.field-wide { grid-column: 1 / -1; }
.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
}

.text-input,
.text-area,
.color-input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface-input);
  color: var(--text);
}

.text-input,
.color-input,
select { padding: 8px 10px; }
.text-area { padding: 8px 10px; resize: vertical; min-height: 60px; }
.color-input { min-height: 40px; padding: 4px; }

.editor-section {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel-2);
}

.editor-section-full { margin-top: 10px; }

.waypoint-editor-body {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 10px;
  align-items: start;
}

.map-picker {
  height: 300px;
  border-radius: 0;
  border: 1px solid var(--line);
  overflow: hidden;
}

.map-picker .leaflet-container {
  height: 100%;
  border-radius: 0;
}

.stop-row-add {
  cursor: pointer;
  border-style: dashed;
  background: rgba(59, 130, 246, 0.03);
}

.stop-row-add:hover {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.3);
}

.stop-row-adding,
.stop-row-creating {
  border-color: rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.04);
}

.inline-select {
  font: inherit;
  font-size: 0.85rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0;
  padding: 1px 4px;
  cursor: pointer;
  outline: none;
  max-width: 180px;
}

.inline-select:hover {
  border-color: var(--line);
}

.inline-select:focus {
  border-color: var(--accent);
  background: var(--surface-input);
}

.rnew-client-wrapper {
  position: relative;
  display: inline-block;
  width: 700px;
  max-width: 100%;
  min-width: 200px;
}

.rnew-client-wrapper .inline-input {
  font-size: 0.85rem;
  padding: 1px 4px;
  margin: 0;
  width: 100%;
}

.rnew-client-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 200;
  margin-top: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  box-shadow: var(--shadow), 0 4px 12px rgba(31, 25, 18, 0.1);
  max-height: 240px;
  overflow-y: auto;
}

.rnew-client-dropdown:empty {
  display: none;
}


.route-add-dropdown {
  display: grid;
  gap: 2px;
  max-height: 240px;
  overflow-y: auto;
}

.route-add-result {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 0;
  cursor: pointer;
  transition: background 80ms ease;
}

.route-add-result:hover {
  background: rgba(59, 130, 246, 0.08);
}

.inline-input {
  font: inherit;
  font-size: 0.85rem;
  border: 1px solid transparent;
  background: transparent;
  padding: 4px 8px;
  margin: -2px 0;
  border-radius: 0;
  width: 100%;
  color: var(--text);
  outline: none;
}

.inline-input:hover {
  border-color: var(--line);
}

.inline-input:focus {
  background: var(--surface-input);
  border-color: var(--accent);
}

.inline-input::placeholder {
  color: var(--muted);
  font-style: italic;
  font-size: 0.8rem;
}

.inline-label {
  font-size: 0.78rem;
  color: var(--muted);
}

.inline-field {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.inline-field-wide {
  grid-column: 1 / -1;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  align-self: start;
  padding-top: 4px;
}

.inline-check input { margin: 0; }

.client-expanded {
  align-items: stretch;
  flex-direction: column;
  cursor: default;
}

.client-inline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 4px;
}

.client-waypoints-inline {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(31, 25, 18, 0.06);
  display: grid;
  gap: 4px;
}

.wp-stop-row {
  flex-wrap: wrap;
}

.wp-address-display {
  cursor: pointer;
  transition: color 100ms ease;
}

.wp-address-display:hover {
  color: var(--accent);
  text-decoration: underline;
}

.wp-address-editor {
  margin: -2px 0 4px;
  padding: 6px 10px;
  border: 1px solid rgba(59, 130, 246, 0.12);
  border-radius: 0;
  background: rgba(248, 248, 239, 0.8);
  display: grid;
  gap: 8px;
}

.wp-address-editor-inner {
  display: grid;
  gap: 6px;
  position: relative;
  z-index: 60;
}

.wp-inline-map {
  height: 200px;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  position: relative;
  z-index: 0;
}

.service-checks-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 1px 0;
}

.service-check-sm {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  font-size: 0.78rem;
  cursor: pointer;
}

.service-check-sm input { margin: 0; }

.button-sm {
  padding: 4px 8px !important;
  font-size: 0.82rem !important;
}

.stop-row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.stop-label-edit {
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  border: 1px solid transparent;
  background: transparent;
  padding: 2px 6px;
  margin: -2px -6px;
  border-radius: 0;
  width: calc(100% + 12px);
  color: var(--text);
  outline: none;
}

.stop-label-edit:hover {
  border-color: var(--line);
}

.stop-label-edit:focus {
  background: var(--surface-input);
  border-color: var(--accent);
}

.stop-list-unified {
  margin-top: 8px;
  display: grid;
  gap: 3px;
}

.stop-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  min-height: 36px;
}

.stop-row.is-home {
  background: rgba(29, 78, 216, 0.06);
  border-color: rgba(29, 78, 216, 0.1);
}

.stop-row.is-home-end {
  opacity: 0.55;
}

.stop-row.is-draggable {
  cursor: grab;
}

.stop-row.is-draggable:active {
  cursor: grabbing;
}

.stop-row.is-dragging {
  opacity: 0.35;
  border-style: dashed;
}

.stop-row.drag-over {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.3);
}

.drag-handle {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1;
  flex-shrink: 0;
  cursor: grab;
  user-select: none;
  padding: 0 1px;
}

.stop-row-info {
  flex: 1;
  min-width: 0;
}

.stop-remove-btn {
  width: 22px;
  height: 22px;
  border-radius: 0;
  border: 1px solid rgba(180, 92, 92, 0.2);
  background: rgba(180, 92, 92, 0.08);
  color: var(--danger);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background 100ms ease;
}

.stop-remove-btn:hover {
  background: rgba(180, 92, 92, 0.18);
}

.add-waypoint-panel {
  margin-top: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel-2);
  display: grid;
  gap: 6px;
}

.add-waypoint-results {
  max-height: 260px;
  overflow-y: auto;
}

.add-create-btn {
  justify-self: start;
}

.create-waypoint-form {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(248, 248, 239, 0.6);
  display: grid;
  gap: 8px;
}

.scroll-panel {
  max-height: min(58dvh, 620px);
  overflow-y: auto;
  padding-right: 4px;
}

.client-list,
.service-list,
.route-stop-list,
.search-result-list,
.waypoint-list { display: grid; gap: 6px; }

.client-item,
.service-item,
.route-stop-item,
.search-result-item,
.waypoint-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  display: grid;
  gap: 6px;
}

.client-item.is-selected,
.service-item.is-selected {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.client-item-head,
.service-item-head,
.route-stop-item-head,
.waypoint-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.item-title { font-weight: 700; font-size: 0.88rem; }
.item-subtitle { color: var(--muted); font-size: 0.82rem; }

.pill,
.service-pill,
.route-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 0;
  border: 1px solid var(--line);
  background: rgba(59, 130, 246, 0.1);
  color: var(--text);
  font-size: 0.78rem;
}

.service-pill {
  background: var(--surface);
}

.service-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.service-check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.service-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
}

.service-check input { margin: 0; }

.route-stop-row-meta,
.search-result-meta,
.waypoint-meta-block {
  display: grid;
  gap: 4px;
}

.route-reuse-note { font-size: 0.82rem; color: var(--muted); }

.route-stop-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.stop-chip {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.72rem;
  flex-shrink: 0;
}

.stop-chip.home-chip { background: #1d4ed8; }

.route-stop-item-head-left,
.search-result-head,
.waypoint-item-head-left {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.search-result-item { cursor: pointer; }
.search-result-item:hover { border-color: rgba(59, 130, 246, 0.3); }

.empty-state {
  min-height: 80px;
  display: grid;
  place-items: center;
  padding: 14px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 0;
  background: var(--panel-3);
}


.address-field-wrapper {
  position: relative;
}

.address-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  margin-top: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  box-shadow: var(--shadow), 0 4px 16px rgba(31, 25, 18, 0.12);
  max-height: 280px;
  overflow-y: auto;
}

.address-dropdown-item {
  padding: 6px 8px;
  border-radius: 0;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text);
  transition: background 80ms ease;
}

.address-dropdown-item:hover,
.address-dropdown-item.is-active {
  background: rgba(59, 130, 246, 0.08);
}

.address-dropdown-item .address-main {
  font-weight: 600;
}

.address-dropdown-item .address-context {
  color: var(--muted);
  font-size: 0.84rem;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(31, 25, 18, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.hidden { display: none; }

.modal-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: 0 12px 40px rgba(31, 25, 18, 0.25);
  padding: 16px 20px;
  width: min(440px, 100%);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.modal-title {
  font-weight: 700;
  font-size: 1.1rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.modal-close:hover { color: var(--text); }

.driver-route-slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.driver-route-slot {
  padding: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: center;
}

.driver-route-slot .item-subtitle {
  font-size: 0.72rem;
  margin-bottom: 4px;
}

.driver-route-slot select {
  width: 100%;
  font-size: 0.82rem;
  padding: 4px 6px;
}

@media (max-width: 760px) {
  .container { width: min(100% - 16px, 1440px); padding: 12px 0 14px; }
  .form-grid,
  .form-grid-home,
  .route-editor-body,
  .home-editor-body,
  .waypoint-editor-body,
  .client-inline-fields { grid-template-columns: 1fr; }
  .auth-logged-in,
  .subpanel-head,
  .section-head-inline { align-items: stretch; flex-direction: column; }
  .tab-bar { width: 100%; justify-content: stretch; }
  .tab-button { flex: 1; padding: 6px 8px; }
  .accordion-row { padding: 6px 10px; }
  .stop-row { padding: 4px 8px; }
  .panel { padding: 10px; }
}

/* Offline status badges */
.offline-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 6px;
}
.offline-ready {
  background: #16a34a;
  color: #fff;
}
.offline-missing {
  background: #dc2626;
  color: #fff;
}

/* Sync all row */
.sync-all-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.sync-all-status {
  font-size: 11px;
  color: var(--muted);
}

/* Route row: progress + SYNC / Synced (SYNC uses same .button.button-primary as EDIT) */
.route-row-sync {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.route-sync-action {
  flex-shrink: 0;
}
.route-sync-synced {
  cursor: default;
  pointer-events: none;
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.4);
  color: #15803d;
  font-weight: 600;
}

/* Sync progress bar in route row — inline to the left of SYNC button */
.route-sync-bar {
  position: relative;
  min-width: 0;
  flex: 1 1 120px;
  max-width: 200px;
  height: 20px;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.08);
}
.route-sync-bar:empty {
  display: none;
  flex: 0;
}
.route-sync-bar .sync-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: rgba(37, 99, 235, 0.18);
  border-radius: 3px 0 0 3px;
  transition: width 0.2s ease;
}
.route-sync-bar .sync-label {
  position: relative;
  z-index: 1;
  display: block;
  text-align: center;
  font-size: 9.5px;
  font-weight: 600;
  color: #2563eb;
  line-height: 20px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 6px;
}
.route-sync-bar.sync-done {
  border-color: rgba(22,163,74,0.25);
}
.route-sync-bar.sync-done .sync-fill {
  background: rgba(22, 163, 74, 0.15);
}
.route-sync-bar.sync-done .sync-label {
  color: #16a34a;
}

html[data-theme="dark"] body {
  background-image:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.15), transparent 28%),
    linear-gradient(180deg, #1f1b16 0%, var(--bg) 100%);
}

html[data-theme="dark"] .route-map-container {
  background: #2a2620;
}

html[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.6);
}

html[data-theme="dark"] .wp-address-editor {
  background: var(--panel-3);
}

html[data-theme="dark"] .create-waypoint-form {
  background: var(--panel-3);
}

@media (forced-colors: active) {
  body, .panel, .subpanel, .text-input, .text-area, select {
    forced-color-adjust: none;
  }
  .button-primary, .tab-button.is-active {
    forced-color-adjust: none;
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
  }
}
