/* ── Reset & base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: #f1f5f9;
}

/* ── Map ──────────────────────────────────────────────────────────── */
#map {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Keep Google Places autocomplete dropdown above everything */
.pac-container { z-index: 9999 !important; }

/* ── Hamburger FAB ──────────────────────────────────────────────── */
#menu-btn {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 250;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(255,255,255,0.18);
  color: #f1f5f9;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  transition: background 0.15s;
  padding: 0;
}
#menu-btn:hover { background: rgba(30, 41, 59, 0.96); }
#menu-btn svg { width: 18px; height: 18px; }

/* ── Dropdown menu ──────────────────────────────────────────────── */
#dropdown-menu {
  position: absolute;
  top: 60px;
  left: 10px;
  z-index: 250;
  background: rgba(15,23,42,0.97);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  min-width: 260px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  overflow: hidden;
  transition: opacity 0.15s, transform 0.15s;
  transform-origin: top left;
}
#dropdown-menu.hidden {
  opacity: 0;
  transform: scale(0.94);
  pointer-events: none;
}

/* ── Search row ──────────────────────────────────────────────────── */
#search-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
#search-wrapper:focus-within { background: rgba(255,255,255,0.04); }

.search-icon {
  width: 16px; height: 16px;
  color: #64748b;
  flex-shrink: 0;
}

#search-input {
  background: transparent;
  border: none;
  outline: none;
  color: #f1f5f9;
  font-size: 14px;
  width: 100%;
  min-width: 0;
}
#search-input::placeholder { color: #475569; }

/* ── Dropdown items ──────────────────────────────────────────────── */
.dropdown-divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: #e2e8f0;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}
.dropdown-item:hover:not(:disabled) { background: rgba(255,255,255,0.07); }
.dropdown-item.active { color: #93c5fd; }
.dropdown-item:disabled { color: #334155; cursor: default; }

.dropdown-item-icon { font-size: 14px; line-height: 1; flex-shrink: 0; width: 16px; text-align: center; color: #fff; }
.dropdown-item-label { flex: 1; }

.dropdown-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(239,68,68,0.2);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,0.3);
  letter-spacing: 0.05em;
}
.dropdown-badge.on {
  background: rgba(34,197,94,0.2);
  color: #86efac;
  border-color: rgba(34,197,94,0.35);
}

.dropdown-item--save.saving { opacity: 0.5; cursor: default; }

/* ── Menu stats ───────────────────────────────────────────────────── */
.menu-stats {
  display: flex;
  justify-content: space-around;
  padding: 10px 14px 12px;
}
.menu-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.menu-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1;
}
.menu-stat-label {
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Status Banner ────────────────────────────────────────────────── */
#status-banner {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: #1d4ed8;
  color: #eff6ff;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(29,78,216,0.4);
  white-space: nowrap;
  pointer-events: auto;
  transition: top 0.2s ease, opacity 0.2s;
}
#status-banner.hidden { display: none; }
#status-banner.error { background: #b91c1c; }

#btn-status-cancel {
  background: transparent;
  border: none;
  color: rgba(239,246,255,0.7);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}
#btn-status-cancel:hover { color: #fff; }

/* ── Side Panels (agenda only) ─────────────────────────────────────── */
.side-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 150;
  width: 340px;
  background: #0f172a;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 24px rgba(0,0,0,0.4);
  transition: transform 0.25s ease;
}

/* Agenda panel slides in from left */
#agenda-panel {
  left: 0;
  width: 300px;
  border-right: 1px solid rgba(255,255,255,0.08);
}
#agenda-panel.hidden { transform: translateX(-100%); }

.side-panel.hidden {
  display: flex !important;
  pointer-events: none;
}
.side-panel:not(.hidden) { pointer-events: auto; }

/* ── Modal backdrop ────────────────────────────────────────────────── */
#modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 290;
  background: rgba(0,0,0,0.55);
}
#modal-backdrop.active { display: block; }

/* ── Right panel (bottom-sheet modal) ─────────────────────────────── */
#right-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 85dvh;
  z-index: 300;
  background: #0f172a;
  border-radius: 16px 16px 0 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
  transition: transform 0.3s ease;
}
#right-panel.hidden {
  transform: translateY(100%);
  pointer-events: none;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.panel-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: #f1f5f9;
}

.btn-close-panel {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.btn-close-panel:hover { color: #f1f5f9; background: rgba(255,255,255,0.08); }

.panel-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.panel-view.hidden { display: none; }

.panel-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.panel-scroll::-webkit-scrollbar { width: 4px; }
.panel-scroll::-webkit-scrollbar-track { background: transparent; }
.panel-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

/* ── Form elements ────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group textarea {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: 8px 10px;
  color: #f1f5f9;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.form-group textarea {
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  line-height: 1.5;
  min-height: 64px;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: #3b82f6;
  background: rgba(255,255,255,0.1);
}
.form-group input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.5);
  cursor: pointer;
}

.form-hint {
  font-size: 11px;
  color: #475569;
}

.label-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #475569;
  font-size: 10px;
}

.date-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.date-row input { flex: 1; }
.date-sep { color: #64748b; font-size: 12px; flex-shrink: 0; }

/* ── Icon picker ──────────────────────────────────────────────────── */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 4px;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  border: 1.5px solid transparent;
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  padding: 7px;
  color: #64748b;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
}
.icon-btn svg { width: 100%; height: 100%; display: block; overflow: visible; }
.icon-btn:hover { background: rgba(255,255,255,0.1); color: #94a3b8; }
.icon-btn.selected {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  color: #93c5fd;
}

/* ── Color picker ─────────────────────────────────────────────────── */
.color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.color-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.1s;
  outline: 2px solid transparent;
  outline-offset: 2px;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected {
  outline-color: #f1f5f9;
}

/* ── Panel actions ────────────────────────────────────────────────── */
.panel-actions {
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.btn-primary, .btn-secondary, .btn-danger, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, background 0.15s;
}
.btn-block { width: 100%; }

.btn-primary  { background: #3b82f6; color: #fff; }
.btn-primary:hover  { background: #2563eb; }

.btn-secondary { background: rgba(255,255,255,0.1); color: #cbd5e1; border: 1px solid rgba(255,255,255,0.15); }
.btn-secondary:hover { background: rgba(255,255,255,0.16); }

.btn-danger   { background: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.25); }
.btn-danger:hover   { background: rgba(239,68,68,0.28); }

.btn-ghost { background: transparent; color: #64748b; border: 1px solid rgba(255,255,255,0.08); }
.btn-ghost:hover { background: rgba(255,255,255,0.06); color: #94a3b8; }

/* ── Journey panels ───────────────────────────────────────────────── */
.journey-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
}
.journey-node {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: #f1f5f9;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.journey-arrow {
  color: #64748b;
  font-size: 16px;
  flex-shrink: 0;
}

.journey-meta {
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
  padding: 4px 0;
  line-height: 1.6;
}

/* ── Route options ────────────────────────────────────────────────── */
.route-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.route-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.route-option:hover { background: rgba(255,255,255,0.08); }
.route-option.selected {
  background: rgba(59,130,246,0.2);
  border-color: #3b82f6;
}
.route-option input[type="radio"] { accent-color: #3b82f6; }
.route-option-info { flex: 1; }
.route-option-summary {
  font-size: 13px;
  font-weight: 500;
  color: #f1f5f9;
}
.route-option-detail {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}
.route-option-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(34,197,94,0.2);
  color: #86efac;
  border: 1px solid rgba(34,197,94,0.3);
  white-space: nowrap;
}

/* ── Agenda ───────────────────────────────────────────────────────── */
#agenda-content {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.agenda-day {
  margin-bottom: 4px;
}

.agenda-day-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  padding: 8px 4px 4px;
}

.agenda-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  margin-bottom: 4px;
  cursor: pointer;
  transition: background 0.15s;
}
.agenda-item:hover { background: rgba(255,255,255,0.08); }

.agenda-item-icon { font-size: 18px; line-height: 1.3; flex-shrink: 0; }

.agenda-item-icon-svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-top: 3px;
}
.agenda-item-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.agenda-item-body { flex: 1; min-width: 0; }
.agenda-item-title {
  font-size: 13px;
  font-weight: 500;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agenda-item-detail {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.agenda-item-notes {
  font-size: 11px;
  color: #475569;
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 3px;
  line-height: 1.4;
}

.agenda-journey-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.agenda-empty {
  text-align: center;
  color: #475569;
  font-size: 13px;
  padding: 32px 0;
  line-height: 1.8;
}

.agenda-stats {
  display: flex;
  justify-content: space-around;
  padding: 14px 10px 10px;
  border-top: 1px solid rgba(255,255,255,0.07);
  margin-top: 8px;
}
.agenda-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.agenda-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1;
}
.agenda-stat-label {
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Info Modal (view-only) ──────────────────────────────────────── */
#info-modal {
  position: fixed;
  inset: 0;
  z-index: 350;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  padding: 20px;
}
#info-modal.hidden { display: none; }

.info-modal-card {
  background: #1e293b;
  border-radius: 16px;
  padding: 24px 20px 20px;
  width: 100%;
  max-width: 320px;
  position: relative;
  box-shadow: 0 8px 40px rgba(0,0,0,0.65);
  border: 1px solid rgba(255,255,255,0.1);
}
.info-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.08);
  border: none;
  color: #94a3b8;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.info-modal-close:hover { background: rgba(255,255,255,0.14); color: #f1f5f9; }

.info-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  padding-right: 28px;
}
.info-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.3;
}
.info-modal-dates {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 10px;
}
.info-modal-notes {
  font-size: 13px;
  color: #cbd5e1;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}
.info-modal-meta {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 8px;
}
.info-modal-journey-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-right: 28px;
  font-size: 15px;
  font-weight: 600;
  color: #f1f5f9;
}
.info-modal-journey-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}
.info-modal-btn {
  display: block;
  width: 100%;
  padding: 9px 14px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #93c5fd;
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  margin-top: 8px;
}
.info-modal-btn:hover { background: rgba(255,255,255,0.12); }
.info-modal-btn--edit { color: #a5f3fc; border-color: rgba(165,243,252,0.25); }
.info-modal-btn--edit:hover { background: rgba(165,243,252,0.1); }

/* ── Map journey labels ───────────────────────────────────────────── */
.map-journey-label {
  position: absolute;
  transform: translate(-50%, -150%);
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.25);
  text-align: center;
  line-height: 1.35;
}
.map-journey-label div + div {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.9;
}

/* ── Map location title labels ────────────────────────────────────── */
.map-location-label {
  position: absolute;
  transform: translate(-50%, calc(-100% - 24px));
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 1px 5px rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.15);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── PWA install banner ──────────────────────────────────────────── */
#install-banner {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 18px;
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  color: #e2e8f0;
  font-size: 13px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.5);
  white-space: nowrap;
}
#install-banner.hidden { display: none; }
#btn-install {
  padding: 5px 12px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
#btn-install:hover { background: #2563eb; }
#btn-install-dismiss {
  background: transparent;
  border: none;
  color: rgba(226,232,240,0.6);
  font-size: 14px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
#btn-install-dismiss:hover { color: #e2e8f0; }

/* ── GPS location dot ───────────────────────────────────────────── */
.gps-dot {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #4285F4;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  pointer-events: auto;
  transform: translate(-50%, -50%);
}
.gps-dot::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: rgba(66,133,244,0.4);
  animation: gps-pulse 2s ease-out infinite;
}
@keyframes gps-pulse {
  0%   { transform: scale(1);   opacity: 1; }
  100% { transform: scale(4);   opacity: 0; }
}

/* ── Remote user overlays (Share Mode) ───────────────────────────── */
.remote-user-wrap {
  position: absolute;
  transform: translate(-50%, -100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  pointer-events: none;
}
.remote-user-label {
  background: rgba(15,23,42,0.82);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.remote-user-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f97316;
  border: 2px solid #fff;
  box-shadow: 0 1px 5px rgba(0,0,0,0.4);
}

/* ── Toast ────────────────────────────────────────────────────────── */
#toast {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
  pointer-events: none;
  transition: opacity 0.3s;
  white-space: nowrap;
}
#toast.hidden { display: none; }
#toast.success { background: #15803d; }
#toast.error   { background: #b91c1c; }
#toast.info    { background: #1d4ed8; }

/* ── Loading overlay ──────────────────────────────────────────────── */
#loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 500;
  background: #0f172a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #94a3b8;
  font-size: 14px;
  transition: opacity 0.4s;
}
#loading-overlay.hidden { opacity: 0; pointer-events: none; }

.spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error screen ─────────────────────────────────────────────────── */
#error-screen {
  position: absolute;
  inset: 0;
  z-index: 500;
  background: #0f172a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px;
  text-align: center;
}
#error-screen.hidden { display: none; }
#error-screen h2 { font-size: 20px; color: #f87171; }
#error-screen p { font-size: 14px; color: #94a3b8; max-width: 400px; line-height: 1.6; }
#error-screen pre {
  font-size: 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 12px 16px;
  color: #f87171;
  max-width: 480px;
  white-space: pre-wrap;
  word-break: break-word;
}
