:root {
  --bg:        #04040f;
  --bg-card:   #0c0c1c;
  --bg-deep:   #08081a;
  --border:    rgba(30,27,75,0.7);
  --border-hi: rgba(99,102,241,0.25);
  --text:      #e2e8f0;
  --text-muted:#475569;
  --text-dim:  #334155;
  --purple:    #7c3aed;
  --purple-lt: #a78bfa;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(99,57,220,.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 10%, rgba(6,182,212,.07) 0%, transparent 50%);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ────────────────────────────── */
.app-header {
  text-align: center;
  padding: 40px 20px 28px;
  position: relative;
  margin-bottom: 20px;
}
.app-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(124,58,237,.15) 0%, transparent 70%);
  border-radius: 20px;
  pointer-events: none;
}
.header-wordmark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}
.header-bus {
  font-size: 32px;
  filter: drop-shadow(0 0 14px rgba(124,58,237,.6));
}
@keyframes title-sweep {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.header-title {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -1.5px;
  background: linear-gradient(120deg, #ffffff 0%, #a78bfa 35%, #06b6d4 65%, #ffffff 100%);
  background-size: 300% 300%;
  animation: title-sweep 6s ease-in-out infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.header-sub { color: var(--text-muted); font-size: 13px; margin-top: 6px; }
.header-sub span { color: var(--purple); font-weight: 600; }
.header-badges { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.header-badge {
  background: rgba(124,58,237,.1);
  border: 1px solid rgba(124,58,237,.2);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--purple-lt);
}
.header-badge.cyan  { background: rgba(6,182,212,.08);  border-color: rgba(6,182,212,.2);  color: #06b6d4; }
.header-badge.green { background: rgba(16,185,129,.08); border-color: rgba(16,185,129,.2); color: #10b981; }

/* ── Nav tabs ───────────────────────────── */
.app-nav {
  display: flex;
  gap: 3px;
  justify-content: center;
  margin-top: 22px;
  background: rgba(8,8,20,.7);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
.nav-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 8px 22px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s, background .15s;
  letter-spacing: .2px;
}
.nav-tab:hover { color: var(--text); }
.nav-tab.active {
  background: rgba(124,58,237,.18);
  color: var(--purple-lt);
  border: 1px solid rgba(124,58,237,.25);
}

/* ── Paste area ─────────────────────────── */
.paste-section {
  background: rgba(12,12,28,.9);
  border: 1px solid var(--border-hi);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 24px;
  display: flex;
  gap: 14px;
  align-items: flex-end;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 24px rgba(0,0,0,.4), 0 0 0 1px rgba(99,102,241,.05);
}
.paste-inner { flex: 1; }
.paste-label {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
}
.paste-textarea {
  width: 100%;
  background: rgba(4,4,15,.8);
  border: 1.5px dashed rgba(99,102,241,.25);
  border-radius: 12px;
  padding: 14px;
  color: #94a3b8;
  font-size: 12px;
  font-family: 'Courier New', monospace;
  line-height: 1.7;
  resize: vertical;
  transition: border-color .2s;
}
.paste-textarea:focus { outline: none; border-color: rgba(124,58,237,.5); }

/* ── Analizar button ────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.analyze-btn {
  position: relative;
  background: linear-gradient(135deg, #7c3aed 0%, #6366f1 60%, #4f46e5 100%);
  color: #fff;
  border: 1px solid rgba(167,139,250,.2);
  border-radius: 14px;
  padding: 14px 32px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .3px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .15s, box-shadow .15s, filter .15s;
  box-shadow: 0 4px 20px rgba(99,102,241,.35), 0 1px 3px rgba(0,0,0,.3);
  overflow: hidden;
}
.analyze-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(99,102,241,.45);
}
.analyze-btn:active { transform: translateY(0) scale(.97); }
.btn-loader {
  display: none;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -7.5px 0 0 -7.5px;
  animation: spin .6s linear infinite;
}
.analyze-btn.loading .btn-text { opacity: 0; }
.analyze-btn.loading .btn-loader { display: block; }
.analyze-btn.loading { pointer-events: none; }

/* ── Dashboard sections ─────────────────── */
.tab-content { flex: 1; }
.section-block { margin-bottom: 14px; }
.section-label {
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: rgba(30,27,75,.6); }
.panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 18px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-title { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); }
.panel-hint { color: var(--text-dim); font-size: 10px; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 12px; }
.kpi-hero {
  background: linear-gradient(135deg, rgba(124,58,237,.2), rgba(6,182,212,.12));
  border: 1px solid rgba(124,58,237,.25);
  border-radius: 16px;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.kpi-hero::after {
  content: '🚌';
  position: absolute;
  right: 16px;
  bottom: 10px;
  font-size: 56px;
  opacity: .05;
  pointer-events: none;
}
.kpi-hero-num {
  font-size: 56px;
  font-weight: 900;
  background: linear-gradient(135deg, #a78bfa, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  letter-spacing: -2px;
}
.kpi-hero-label { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.kpi-hero-sub { color: var(--purple-lt); font-size: 11px; font-weight: 600; margin-top: 6px; opacity: .9; }
.kpi-card {
  background: rgba(12,12,28,.8);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}
.kpi-val { font-size: 30px; font-weight: 800; line-height: 1; }
.kpi-lbl { color: var(--text-muted); font-size: 11px; font-weight: 500; margin-top: 5px; }
.kpi-trend { font-size: 10px; margin-top: 4px; font-weight: 600; }

/* Lines grid */
.lines-grid { display: grid; grid-template-columns: 5fr 3fr; gap: 14px; }
.side-panels { display: grid; grid-template-rows: auto auto; gap: 14px; }

/* Top lines list */
.bus-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 5px;
  background: rgba(8,8,20,.5);
  border: 1px solid transparent;
  transition: border-color .15s;
}
.bus-rank { color: var(--text-dim); font-size: 11px; font-weight: 700; width: 14px; text-align: center; }
.bus-thumb {
  width: 32px;
  height: 32px;
  background: rgba(12,12,28,.9);
  border-radius: 6px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  overflow: hidden;
}
.bus-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bus-badge { min-width: 44px; padding: 5px 8px; border-radius: 7px; font-weight: 900; font-size: 13px; text-align: center; }
.bus-info { flex: 1; }
.bus-name { color: var(--text-muted); font-size: 11px; }
.bus-bar-track { background: rgba(255,255,255,.04); border-radius: 3px; height: 5px; margin-top: 5px; overflow: hidden; }
.bus-bar-fill { height: 100%; border-radius: 3px; }
.bus-trips { font-size: 13px; font-weight: 800; }

/* Activity grid */
.activity-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; }
.legend-dots { display: flex; align-items: center; gap: 4px; }
.legend-dot { width: 9px; height: 9px; border-radius: 2px; }

/* Records */
.record-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: rgba(8,8,20,.5);
  border-radius: 10px;
  margin-bottom: 8px;
  border-left: 2px solid transparent;
}
.record-val { font-size: 18px; font-weight: 800; line-height: 1; }
.record-label { color: var(--text-muted); font-size: 10px; margin-top: 3px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; }
.record-detail { color: var(--text-dim); font-size: 10px; margin-top: 3px; }

/* Curiosities */
.curiosities-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fun-card {
  background: rgba(8,8,20,.5);
  border-radius: 10px;
  padding: 12px;
  border: 1px solid var(--border);
}
.fun-val { font-size: 16px; font-weight: 800; }
.fun-lbl { color: var(--text-dim); font-size: 9px; margin-top: 2px; text-transform: uppercase; letter-spacing: .5px; }

/* Map */
.map-panel { position: relative; }
.map-container { height: 400px; border-radius: 10px; overflow: hidden; margin-bottom: 10px; }
.map-legend { display: flex; gap: 14px; flex-wrap: wrap; border-top: 1px solid rgba(30,27,75,.4); padding-top: 10px; }
.map-legend-item { display: flex; align-items: center; gap: 5px; }
.map-legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.map-legend-label { color: var(--text-muted); font-size: 10px; }
.map-loading {
  position: absolute;
  top: calc(50% + 20px);
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(10, 10, 26, 0.85);
  color: #d1d5db;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 400;
  pointer-events: none;
  display: none;
  border: 1px solid rgba(124,58,237,.3);
}
.map-loading.visible { display: block; }

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.gallery-card { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: rgba(10,10,24,.9); transition: transform .2s; }
.gallery-card:hover { transform: translateY(-2px); }
.gallery-card-top { height: 60px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.gallery-card-img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.gallery-card-num { font-size: 24px; font-weight: 900; position: relative; z-index: 1; }
.gallery-card-num-bg { position: absolute; font-size: 52px; font-weight: 900; opacity: .06; z-index: 0; pointer-events: none; }
.gallery-card-body { padding: 10px; }
.gallery-trips { font-size: 13px; font-weight: 800; }
.gallery-since { color: var(--text-dim); font-size: 9px; margin-top: 2px; }
.gallery-sparkline { margin-top: 6px; }

/* Leaflet */
.leaflet-container { background: #05090f !important; }
.leaflet-tile-pane { filter: brightness(0.85); }

/* ── Detail tab ─────────────────────────── */
.detail-month-block { margin-bottom: 28px; }
.detail-month-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 4px 8px;
  border-bottom: 1px solid rgba(30,27,75,.6);
  margin-bottom: 2px;
}
.detail-month-name { font-size: 11px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--purple-lt); }
.detail-month-total { font-size: 11px; color: var(--text-dim); }
.detail-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  border-bottom: 1px solid rgba(30,27,75,.2);
}
.detail-row:last-child { border-bottom: none; }
.detail-dow { width: 28px; font-size: 10px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; flex-shrink: 0; }
.detail-date { width: 34px; font-size: 12px; font-weight: 600; color: var(--text-muted); flex-shrink: 0; }
.detail-lines { flex: 1; display: flex; gap: 5px; flex-wrap: wrap; }
.detail-badge { padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 800; }
.detail-count { font-size: 10px; color: var(--text-dim); flex-shrink: 0; }

/* ── BondiWrapped ───────────────────────── */
.wrapped-outer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
}
.wrapped-card {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 4/5;
  background: #050510;
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 28px 26px 22px;
  position: relative;
  border: 1px solid rgba(124,58,237,.25);
  box-shadow: 0 0 80px rgba(124,58,237,.15), 0 0 40px rgba(6,182,212,.08);
}
.wrapped-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(124,58,237,.25) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 100%, rgba(6,182,212,.15) 0%, transparent 50%);
  pointer-events: none;
}
.wc-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  position: relative;
}
.wc-logo { font-size: 20px; }
.wc-brand {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #a78bfa, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.wc-year { font-size: 11px; color: var(--text-dim); margin-left: auto; font-weight: 600; }
.wc-hero { position: relative; margin-bottom: 20px; }
.wc-hero-num {
  font-size: 80px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -3px;
  background: linear-gradient(135deg, #fff 30%, #a78bfa 70%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.wc-hero-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.wc-stat-row {
  background: rgba(124,58,237,.1);
  border: 1px solid rgba(124,58,237,.2);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  position: relative;
}
.wc-stat-label { font-size: 9px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.wc-stat-val { font-size: 22px; font-weight: 900; }
.wc-stat-sub { font-size: 10px; color: var(--text-dim); margin-top: 2px; }
.wc-top3 {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.wc-top3-item {
  flex: 1;
  text-align: center;
  background: rgba(8,8,20,.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 6px;
}
.wc-top3-rank { font-size: 9px; color: var(--text-dim); font-weight: 700; margin-bottom: 4px; }
.wc-top3-line { font-size: 20px; font-weight: 900; }
.wc-top3-count { font-size: 9px; color: var(--text-dim); margin-top: 2px; }
.wc-divider { height: 1px; background: rgba(30,27,75,.7); margin-bottom: 14px; }
.wc-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex: 1;
}
.wc-stat-block {
  background: rgba(8,8,20,.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.wc-footer {
  text-align: center;
  font-size: 10px;
  color: rgba(71,85,105,.6);
  margin-top: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  position: relative;
}

/* Wrapped download button */
.wrapped-dl-btn {
  background: rgba(124,58,237,.15);
  border: 1px solid rgba(124,58,237,.3);
  color: var(--purple-lt);
  border-radius: 12px;
  padding: 12px 28px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .3px;
  transition: background .15s, transform .15s;
}
.wrapped-dl-btn:hover { background: rgba(124,58,237,.25); transform: translateY(-1px); }

/* ── Footer ─────────────────────────────── */
.app-footer {
  margin-top: 48px;
  padding: 18px 20px;
  border-top: 1px solid rgba(30,27,75,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: color .15s;
}
.footer-link:hover { color: var(--purple-lt); }
.footer-sep, .footer-copy { color: var(--text-dim); font-size: 12px; }

/* ── Responsive ─────────────────────────── */
@media (max-width: 640px) {
  body { padding: 12px; }
  .header-title { font-size: 28px; letter-spacing: -1px; }
  .header-bus { font-size: 26px; }
  .kpi-hero-num { font-size: 40px; }
  .paste-section { flex-direction: column; align-items: stretch; }
  .analyze-btn { width: 100%; padding: 15px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-hero { grid-column: 1 / -1; }
  .kpi-hero-num { font-size: 48px; }
  .lines-grid { grid-template-columns: 1fr; }
  .activity-grid { grid-template-columns: 1fr; }
  .map-container { height: 260px; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .app-nav { width: 100%; }
  .nav-tab { padding: 8px 14px; font-size: 12px; }
  .wrapped-card { aspect-ratio: auto; min-height: 520px; }
}

/* === Login screen === */
.login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 0%, rgba(139, 92, 246, 0.15), transparent 60%), #04040f;
  z-index: 1000;
  padding: 24px;
}
.login-card {
  background: #0a0a1a;
  border: 1px solid #1f1f3a;
  border-radius: 16px;
  padding: 40px 32px;
  max-width: 380px;
  width: 100%;
  text-align: center;
}
.login-brand { margin-bottom: 24px; }
.login-icon { font-size: 48px; display: block; }
.login-title {
  font-size: 28px;
  font-weight: 700;
  margin: 8px 0 4px;
  background: linear-gradient(90deg, #f59e0b, #8b5cf6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-sub { color: #6b7280; font-size: 13px; margin: 0; }
.login-form { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.login-input {
  background: #04040f;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 12px 14px;
  color: #e5e7eb;
  font-size: 15px;
  font-family: inherit;
}
.login-input:focus { outline: none; border-color: #8b5cf6; }
.login-btn {
  background: linear-gradient(90deg, #8b5cf6, #6366f1);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.login-msg { color: #10b981; font-size: 13px; min-height: 18px; margin: 4px 0; }
.login-msg.error { color: #f43f5e; }
.login-hint { color: #6b7280; font-size: 12px; line-height: 1.5; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.error-banner {
  background: #4c1d2a;
  color: #fecaca;
  padding: 12px 16px;
  text-align: center;
  font-size: 14px;
}
.empty-state {
  max-width: 720px;
  margin: 80px auto;
  text-align: center;
  padding: 0 24px;
}
.empty-title {
  font-size: 22px;
  color: #d1d5db;
  font-weight: 500;
  margin-bottom: 32px;
}
.empty-ctas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  max-width: 500px;
  margin: 0 auto;
}
.empty-cta {
  padding: 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #2a2a4a;
  background: #0a0a1a;
  color: #e5e7eb;
  transition: border-color 150ms;
  font-family: inherit;
}
.empty-cta:hover { border-color: #8b5cf6; }
.empty-cta-primary {
  background: linear-gradient(90deg, #8b5cf6, #6366f1);
  border-color: transparent;
  color: white;
}

/* === FAB === */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: white;
  font-size: 28px;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
  z-index: 500;
  font-family: inherit;
}
.fab:hover { transform: scale(1.05); }

/* === Modal === */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 15, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 600;
  padding: 24px;
}
.modal-card {
  background: #0a0a1a;
  border: 1px solid #1f1f3a;
  border-radius: 12px;
  padding: 28px 24px;
  max-width: 380px;
  width: 100%;
  box-sizing: border-box;
}
.modal-card-wide { max-width: 600px; }
.modal-card h3 {
  margin: 0 0 16px;
  font-size: 18px;
  color: #e5e7eb;
}
.modal-label {
  display: block;
  font-size: 12px;
  color: #9ca3af;
  margin-top: 12px;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.modal-input {
  width: 100%;
  background: #04040f;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  padding: 10px 12px;
  color: #e5e7eb;
  font-size: 15px;
  font-family: inherit;
  box-sizing: border-box;
}
.modal-input:focus { outline: none; border-color: #8b5cf6; }
.modal-when {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #d1d5db;
  font-size: 14px;
  padding: 10px 12px;
  background: #04040f;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
}
.modal-link {
  background: none;
  border: none;
  color: #8b5cf6;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.modal-buttons {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.modal-btn-primary,
.modal-btn-secondary,
.modal-btn-ghost {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  border: none;
}
.modal-btn-primary {
  background: linear-gradient(90deg, #8b5cf6, #6366f1);
  color: white;
}
.modal-btn-secondary {
  background: #2a2a4a;
  color: #e5e7eb;
  border: 1px solid #3a3a5a;
}
.modal-btn-ghost {
  background: transparent;
  color: #9ca3af;
  border: 1px solid transparent;
}
.modal-btn-primary:disabled,
.modal-btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }
.modal-msg {
  color: #10b981;
  font-size: 13px;
  margin: 8px 0 0;
  min-height: 18px;
}
.modal-msg.error { color: #f43f5e; }
.modal-hint { color: #9ca3af; font-size: 13px; margin: 0 0 12px; }
.migration-textarea {
  width: 100%;
  background: #04040f;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  padding: 12px;
  color: #e5e7eb;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  resize: vertical;
  box-sizing: border-box;
}
.migration-preview {
  margin-top: 12px;
  padding: 12px;
  background: #04040f;
  border-radius: 6px;
  color: #d1d5db;
  font-size: 14px;
  display: none;
}
.migration-preview.visible { display: block; }

/* ── Trip actions popup ─────────────────── */
.trip-popup {
  background: #0a0a1a;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 12px;
  min-width: 220px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.trip-popup-info {
  color: #e5e7eb;
  font-size: 14px;
  margin-bottom: 10px;
}
.trip-popup-date {
  color: #9ca3af;
  font-size: 12px;
}
.trip-popup-actions {
  display: flex;
  gap: 8px;
}
.trip-popup-btn {
  flex: 1;
  background: #2a2a4a;
  color: #e5e7eb;
  border: 1px solid #3a3a5a;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.trip-popup-btn-danger {
  background: #4c1d2a;
  border-color: #6b2a3a;
  color: #fecaca;
}
.line-badge-clickable {
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.line-badge-clickable:hover {
  filter: brightness(1.2);
}

/* ── Header Menu ────────────────────────── */
.header-menu {
  position: absolute;
  top: 16px;
  right: 16px;
}
.menu-trigger {
  background: rgba(10, 10, 26, 0.7);
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  color: #e5e7eb;
  font-size: 20px;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
}
.menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #0a0a1a;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  min-width: 220px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  z-index: 800;
  padding: 8px 0;
}
.menu-item {
  display: block;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 10px 16px;
  font-size: 14px;
  color: #e5e7eb;
  cursor: pointer;
  font-family: inherit;
}
.menu-item:hover { background: #1a1a2a; }
.menu-email {
  padding: 6px 16px;
  font-size: 12px;
  color: #9ca3af;
  word-break: break-all;
}
.menu-divider {
  height: 1px;
  background: #1f1f3a;
  margin: 4px 0;
}
.menu-item-danger { color: #fca5a5; }
.menu-item-danger:hover { background: #4c1d2a; color: #fecaca; }
.modal-btn-danger {
  background: #b91c1c;
  color: white;
  border: none;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.modal-btn-danger:hover { background: #dc2626; }
.modal-btn-danger:disabled { opacity: 0.5; cursor: not-allowed; }
.reset-warning { color: #d1d5db; font-size: 14px; margin: 0 0 12px; line-height: 1.4; }
.reset-warning strong { color: #fca5a5; }
