:root {
  --bg: #1c2b46;
  --paper: #263754;
  --ink: #f4f7fb;
  --muted: #8b97ad;
  --leaf: #2ad4c0;
  --gold: #3aa7ef;
  --line: #3a4d70;
  --teal: #2ad4c0;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: system-ui, sans-serif; color-scheme: dark; }
.shell { max-width: 1200px; margin: 0 auto; padding: 24px 20px 40px; }
header h1 { color: #f7fbff; margin: 0; font-size: clamp(1.9rem, 4vw, 2.7rem); letter-spacing: -0.03em; font-weight: 650; }
header p { color: #9aa6bb; margin: 8px 0 0; font-size: 0.95rem; }
.brand {
  background: transparent !important;
  border: 0 !important;
  padding: 0;
  text-align: left;
  color: inherit;
  border-radius: 0;
}
.text-link, .remove-cost {
  background: transparent !important;
  border: 0 !important;
  padding: 8px 0;
  font-weight: 550;
}
.text-link { color: #9aa6bb !important; }
.remove-cost { color: #ff8b8b !important; }
.saved-page { margin-top: 16px; display: grid; gap: 10px; }
.page-head h2 { margin: 4px 0 8px; }
#cost-msg { color: #9aa6bb; min-height: 1.2em; }
#brief {
  display: grid;
  grid-template-columns: 2fr 1fr 0.6fr auto;
  gap: 10px;
  background: var(--paper);
  padding: 16px;
  align-items: end;
  border-radius: 16px;
  border: 1px solid var(--line);
  margin-top: 16px;
}
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.search { position: relative; z-index: 30; }
#brief { overflow: visible; }
#suggest, #origin-suggest {
  position: absolute;
  z-index: 80;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 4px;
  list-style: none;
  background: #263754;
  border: 1px solid #2a3654;
  max-height: 280px;
  overflow: auto;
}
#suggest button, #origin-suggest button {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--ink);
  padding: 10px 12px;
  font-weight: 500;
}
#suggest button:hover, #suggest button.on, #origin-suggest button:hover { background: #1c2844; }
input, textarea, select {
  font: 15px system-ui, sans-serif;
  padding: 10px 12px;
  border: 1px solid #2f3d5c;
  background: #1a2944;
  color: #f4f7fb;
  border-radius: 12px;
}
.styles { display: flex; gap: 8px; grid-column: 1 / -1; }
.styles label { flex-direction: row; align-items: center; gap: 6px; color: var(--ink); font-size: 14px; }
button {
  background: #1c2742;
  color: #f4f7fb;
  border: 1px solid #2f3d5c;
  padding: 12px 16px;
  font: 600 14px system-ui, sans-serif;
  letter-spacing: 0.01em;
  cursor: pointer;
  border-radius: 999px;
}
button:hover { border-color: #3d5278; }
#status { color: #9aa6bb; min-height: 1.2em; }
.poster {
  margin-top: 16px;
  padding: 0;
  overflow: hidden;
  background: #22324e;
  border: 1px solid #243049;
  box-shadow: none;
  border-radius: 18px;
}
.poster-head {
  background: linear-gradient(90deg, #2ad4c0, #3aa7ef);
  color: #fff;
  padding: 18px 22px 16px;
}
.poster-head h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.3rem); color: #fff; }
#route-line { margin: 6px 0 0; font-size: 1.05rem; font-weight: 650; }
#summary { margin: 4px 0 0; color: rgba(255, 255, 255, 0.88); font-size: 0.95rem; }
.poster-body {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 340px;
  min-height: 560px;
  align-items: stretch;
}
.poster-map { position: relative; min-height: 560px; background: #1a2944; }
#map {
  height: 100%;
  min-height: 560px;
  width: 100%;
  border: 0;
  background: #1a2944;
  margin: 0;
}
.map-legend {
  position: absolute;
  z-index: 500;
  left: 12px;
  top: 12px;
  background: #263754;
  color: #f4f7fb;
  border: 1px solid #2a3654;
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  font-size: 13px;
}
.map-legend b { display: block; margin-bottom: 6px; }
.map-legend span { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.swatch { width: 22px; height: 4px; display: inline-block; border-radius: 2px; }
.swatch.flight { background: transparent; border-top: 3px dashed #e23b3b; height: 0; }
.swatch.road { background: #2ad4c0; }
.swatch.stop { width: 10px; height: 10px; border-radius: 50%; background: #e23b3b; }
.itinerary {
  background: #22324e;
  border-left: 1px solid #3a4d70;
  padding: 14px 12px 16px;
  overflow: auto;
  max-height: 720px;
  min-height: 560px;
}
.itinerary .day .why {
  display: block;
  margin-top: 6px;
  color: #c5d0e4;
  font-size: 13px;
  font-weight: 450;
}
.itinerary .empty { margin: 8px 4px; }
.itinerary h3, .glance-wrap h3 {
  margin: 0 0 10px;
  color: #f4f7fb;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.days { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.day {
  text-align: left;
  color: var(--ink);
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
}
.day b { color: #2ad4c0; }
.day.on { outline: 2px solid #2ad4c0; }
.glance-wrap { padding: 14px 16px 8px; background: #22324e; border-top: 1px solid #243049; }
.glance {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.glance-stop {
  min-width: 120px;
  text-align: center;
  background: #1c2742;
  border: 0;
  color: var(--ink);
  border-radius: 12px;
  padding: 8px;
}
.glance-stop span {
  width: 54px; height: 54px; border-radius: 50%;
  margin: 0 auto 6px;
  display: flex; align-items: center; justify-content: center;
  background: #2ad4c0; color: #082028; font-weight: 700;
}
.glance-stop strong { display: block; font-size: 13px; }
.glance-stop small { display: block; color: var(--muted); font-size: 11px; }
.highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 12px 16px;
  background: #1a2944;
  color: #f4f7fb;
  font-size: 13px;
}
.highlights b { margin-right: 8px; }
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.account, .trip-tools, #account-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.trip-pick {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #9aa6bb;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.trip-pick select {
  min-width: 180px;
  background: #1c2742;
  color: #f4f7fb;
  border: 1px solid #2f3d5c;
  border-radius: 999px;
  padding: 10px 14px;
}
.account button, .trip-tools button, .panel button, .expenses button, .profile-edit button, #brief button[type="submit"] {
  background: #2ad4c0;
  color: #082028;
  border-color: transparent;
}
button.ghost, .account .ghost {
  background: #1c2742;
  color: #f4f7fb;
  border: 1px solid #2f3d5c;
}
.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1c2742 !important;
  color: #f4f7fb !important;
  border: 1px solid #2f3d5c;
  border-radius: 999px;
  padding: 6px 14px 6px 6px;
}
.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #2ad4c0, #3aa7ef);
  color: #082028;
  font-size: 24px;
  letter-spacing: 0;
}
.avatar.sm { width: 28px; height: 28px; font-size: 13px; }
.profile {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}
.profile-card, .profile-trips {
  background: #263754;
  border: 1px solid #2a3654;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(21, 32, 51, 0.06);
}
.profile-card {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  padding: 26px;
}
.profile-id { display: flex; gap: 16px; align-items: center; }
.eyebrow {
  margin: 0;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 11px;
  color: #2ad4c0;
  font-family: system-ui, sans-serif;
}
.profile-id h2 { margin: 4px 0; font-size: 1.9rem; letter-spacing: -0.03em; font-weight: 500; }
#open-cost-profile { margin-top: 0; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.notes-app {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 640px;
  background: #1a2944;
  border: 1px solid #3a4d70;
  border-radius: 18px;
  overflow: hidden;
}
.notes-side {
  background: #22324e;
  border-right: 1px solid #3a4d70;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.notes-side-head { display: flex; justify-content: space-between; gap: 8px; }
.notes-folder { margin: 4px 4px 0; color: #f4f7fb; font-weight: 650; }
.notes-folder span { color: #8b97ad; font-weight: 500; }
#note-list { overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.note-row {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
}
.note-row.on, .note-row:hover { background: #2c4164; }
.note-row strong { display: block; font-size: 15px; }
.note-row span { display: block; margin-top: 3px; color: #9aa6bb; font-size: 13px; font-weight: 450; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-row time { color: #c5d0e4; }
.notes-editor { display: flex; flex-direction: column; padding: 16px 22px 18px; }
.notes-tools { display: flex; justify-content: flex-end; gap: 8px; }
#note-date { margin: 10px 0 0; color: #8b97ad; font-size: 13px; }
#note-title {
  border: 0;
  background: transparent;
  font-size: 2rem;
  font-weight: 650;
  padding: 8px 0 4px;
  border-radius: 0;
}
#note-body {
  flex: 1;
  min-height: 420px;
  border: 0;
  background: transparent;
  resize: none;
  font-size: 17px;
  line-height: 1.5;
  padding: 8px 0;
  border-radius: 0;
}
#note-msg { min-height: 1.2em; color: #8b97ad; }
.expense-row strong { white-space: pre-wrap; }
#profile-email { margin: 0; color: var(--muted); font-family: system-ui, sans-serif; }
.profile-edit {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  background: transparent;
  padding: 0;
  grid-template-columns: 1fr;
}
.profile-edit button { align-self: flex-start; }
.profile-trips { padding: 22px; }
.profile-trips-head h3 { margin: 0 0 4px; }
.profile-trips-head p, .empty { color: var(--muted); }
.saved-trip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  background: #263754;
  border: 1px solid #2a3654;
  border-radius: 14px;
  padding: 14px;
  margin-top: 10px;
}
.trip-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1c2742;
  color: #2ad4c0;
  font-weight: 650;
}
.trip-copy { display: flex; flex-direction: column; gap: 3px; text-align: left; }
.trip-copy span, .trip-meta { color: var(--muted); font-size: 13px; font-weight: 450; }
.trip-meta { text-align: right; }
.panel, .expenses, .trip-tools {
  margin-top: 12px;
  background: var(--paper);
  padding: 18px;
  border-radius: 16px;
}
.panel h2, .expenses h3, .profile-trips-head h3 {
  margin: 0 0 6px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
#auth-form, #expense-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: transparent;
  padding: 0;
}
#auth-form { grid-template-columns: 1fr; max-width: 420px; }
#expense-form button, #auth-form button { justify-self: start; }
.panel label, .expenses label { margin-bottom: 8px; }
.panel input, .expenses input, .expenses select { width: 100%; }
#auth-msg, #save-msg { color: var(--ink); }
.expense-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  background: #263754;
  border: 1px solid #2a3654;
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 8px;
  text-align: left;
  width: 100%;
}
#saved-trips .saved-trip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  width: 100%;
  background: #1c2742;
}
#saved-trips .saved-trip:hover { border-color: #2ad4c0; }
.expense-row a { color: var(--leaf); }
#map img, #map canvas, .leaflet-container img, .leaflet-container svg { max-width: none !important; }
.leaflet-container { height: 100%; min-height: 560px; background: #1a2944; font: 14px system-ui, sans-serif; }
.legend { color: #8b97ad; font-size: 13px; margin: 8px 0 0; }
.pin { background: none !important; border: 0 !important; }
.dot {
  width: 24px; height: 24px; border-radius: 50%;
  background: #2ad4c0; color: #082028;
  display: flex; align-items: center; justify-content: center;
  font: 700 11px system-ui; border: 2px solid #1a2944;
}
.dot.origin { background: #3aa7ef; color: #fff; font-size: 16px; }
.dot.spot { background: #2ad4c0; color: #082028; }
.tour { margin-top: 12px; background: var(--paper); padding: 16px; }
.tour h2 { margin: 0 0 6px; }
.days {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.day, .spot-card {
  text-align: left;
  background: #1c2742;
  color: var(--ink);
  border: 1px solid #2a3654;
  padding: 12px;
  width: 100%;
}
.day.on, .spot-card:hover { border-color: #2ad4c0; background: #1a2c48; }
.day b, .spot-card b { display: block; color: var(--gold); font-size: 12px; }
.day strong { display: block; margin: 4px 0; }
.day p, .spot-card span, .tip { margin: 4px 0 0; color: var(--muted); font-size: 13px; font-weight: 400; }
.spots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.spot-card .why { display: block; color: var(--ink); font-size: 14px; line-height: 1.4; margin-top: 6px; }
.spot-card .meta { display: block; margin-top: 8px; color: var(--leaf); font-size: 13px; }
.spot-card small { display: inline-block; margin-top: 8px; color: var(--gold); }
#guide { font-size: 1.05rem; margin: 10px 0; }
#road-link { margin: 0 0 12px; }
#road-link a { color: var(--leaf); font-weight: 600; }
.trip-tools .ghost, #close-cost {
  background: #1c2742;
  color: #f4f7fb;
  border: 1px solid #2f3d5c;
}
.cost-page { margin-top: 16px; display: grid; gap: 14px; }
.cost-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(90deg, #2ad4c0, #3aa7ef);
  color: #fff;
}
.cost-head h2 { margin: 2px 0 0; color: #fff; font-size: 1.7rem; }
.cost-head .eyebrow { color: rgba(255, 255, 255, 0.85); }
.report-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.stat {
  background: #263754;
  border: 1px solid #2a3654;
  border-radius: 16px;
  padding: 16px;
}
.stat span {
  display: block;
  color: #8b97ad;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.stat strong { display: block; margin-top: 8px; font-size: 1.6rem; }
.report-panel, .cost-page .expenses {
  background: #263754;
  border: 1px solid #2a3654;
  border-radius: 16px;
  padding: 18px;
}
.cat-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}
.cat-row i {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2ad4c0, #3aa7ef);
}
.cat-row b { color: #f4f7fb; font-size: 13px; }
@media (max-width: 800px) {
  #brief, #expense-form, .report-cards { grid-template-columns: 1fr; }
  .poster-body, .profile-card, .notes-app { grid-template-columns: 1fr; }
  .poster-map, #map { min-height: 380px; height: 380px; }
  .topbar { flex-direction: column; }
}
