/* Plan section */
.plan-section { position: relative; }

.plan-dates {
  padding: 64px 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
  background: rgba(255,255,255,0.5) !important;
  max-width: 600px;
  margin: 0 auto;
}
.plan-dates > * { width: 100%; max-width: 460px; }
.plan-dates p { text-align: center; margin: 0 auto; }
.date-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 460px;
}
.date-fields label { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.date-fields .field-label { text-align: center; }
.date-fields .btn { margin-top: 8px; align-self: stretch; justify-content: center; }
.date-fields .btn:disabled { opacity: 0.4; cursor: not-allowed; }

.plan-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 32px;
  align-items: start;
}

.bento {
  background: var(--bone);
  border-radius: var(--r-lg);
  padding: 28px;
  border: 1px solid rgba(31,30,26,0.06);
}
.bento-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(31,30,26,0.08);
}
.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

/* AI Prompt */
.ai-prompt {
  background: var(--paper);
  border: 1px dashed color-mix(in oklch, var(--accent) 40%, transparent);
  border-radius: var(--r-md);
  padding: 18px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai-intro {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
}
.ai-row { display: flex; gap: 8px; }
.ai-row .field-input { flex: 1; padding: 12px 16px; font-size: 13px; }
.ai-row .btn { white-space: nowrap; padding: 12px 18px; }

.bento-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.reco {
  position: relative;
  background: var(--paper);
  border: 1px solid rgba(31,30,26,0.07);
  border-radius: var(--r-md);
  padding: 18px;
  cursor: grab;
  transition: all 0.25s;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 140px;
}
.reco:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }
.reco::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  opacity: 0.7;
}
.reco-olive::before { background: var(--olive); }
.reco-aegean::before { background: var(--aegean); }
.reco-ochre::before { background: var(--ochre); }
.reco-terracotta::before { background: var(--terracotta); }

.reco-top { display: flex; align-items: center; gap: 10px; }
.reco-glyph {
  font-family: var(--serif);
  font-size: 22px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bone-warm);
  border-radius: 50%;
  color: var(--accent);
}
.reco-kind { font-size: 10px; }
.ai-tag {
  margin-left: auto;
  font-size: 9px;
  padding: 3px 7px;
  background: var(--accent);
  color: var(--paper);
  border-radius: 4px;
  letter-spacing: 0.16em;
}
.reco-name {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.15;
  flex: 1;
}
.reco-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--ink-mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-top: 1px solid rgba(31,30,26,0.06);
  padding-top: 10px;
}
.drag-hint { margin-left: auto; font-family: var(--mono); opacity: 0.5; }

/* Calendar */
.calendar {
  background: var(--paper);
  border: 1px solid rgba(31,30,26,0.08);
  border-radius: var(--r-lg);
  padding: 28px;
  position: sticky;
  top: 100px;
}
.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(31,30,26,0.08);
}
.cal-days { display: flex; flex-direction: column; gap: 12px; }
.cal-day {
  background: var(--bone);
  border-radius: var(--r-md);
  padding: 18px 20px;
  border: 1.5px dashed transparent;
  transition: all 0.2s;
}
.cal-day-highlight {
  background: linear-gradient(135deg, color-mix(in oklch, var(--accent) 12%, var(--bone)), var(--bone));
  border: 1px solid color-mix(in oklch, var(--accent) 30%, transparent);
}
.cal-day-over {
  border: 1.5px dashed var(--accent);
  background: color-mix(in oklch, var(--accent) 8%, var(--paper));
}
.cal-day-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.cal-day-num { font-family: var(--serif); font-size: 22px; }
.cal-day-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.cal-pin { color: var(--accent); font-size: 18px; }
.cal-items { display: flex; flex-direction: column; gap: 6px; }
.cal-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--paper);
  border-radius: 8px;
  font-size: 13px;
  border: 1px solid rgba(31,30,26,0.05);
}
.cal-item.cal-item-event { border-left: 3px solid var(--accent); }
.cal-item.cal-item-plan { background: color-mix(in oklch, var(--accent) 8%, var(--paper)); border-left: 3px solid var(--accent-soft); }
.cal-item.locked .ci-rm { display: none; }
.ci-time { font-size: 10px; color: var(--ink-mute); letter-spacing: 0.12em; min-width: 38px; }
.ci-label { flex: 1; font-weight: 500; font-size: 13px; }
.ci-rm {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(31,30,26,0.06);
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.ci-rm:hover { background: var(--terracotta); color: white; }
.cal-empty {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-align: center;
  padding: 14px 0;
  opacity: 0.5;
}
.cal-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(31,30,26,0.08);
  gap: 12px;
}

/* Date row + time inputs */
.date-row { display: flex; gap: 16px; width: 100%; margin-bottom: 8px; }
.date-row label { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.date-row .field-input { width: 100%; }
.date-hint {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-mute); margin: 8px 0 16px; line-height: 1.6;
}

/* Custom search */
.custom-search {
  margin-top: 18px; padding-top: 18px;
  border-top: 1px solid rgba(31,30,26,0.08);
}
.search-results {
  margin-top: 12px; display: flex; flex-direction: column; gap: 6px;
  max-height: 280px; overflow-y: auto;
}
.search-row {
  display: grid; grid-template-columns: 28px 1fr auto;
  gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(31,30,26,0.04); border: 1px solid rgba(31,30,26,0.08);
  text-align: left; cursor: pointer; transition: all 0.15s;
}
.search-row:hover { background: rgba(122,138,92,0.12); border-color: var(--accent); }
.sr-glyph { color: var(--accent); font-size: 18px; }
.sr-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sr-name { font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--ink); }
.sr-meta { font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); }
.sr-full { font-size: 11px; color: var(--ink-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-add {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent);
}
.custom-tag { background: var(--accent) !important; color: white !important; }

/* Inline time editor */
.ci-time-input {
  background: transparent; border: 1px dashed rgba(31,30,26,0.2);
  border-radius: 4px; font-size: 11px; padding: 2px 4px;
  color: var(--ink); font-family: var(--mono); width: 70px;
}
.ci-time-input:hover, .ci-time-input:focus {
  border-color: var(--accent); border-style: solid; outline: none;
}
.ci-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; color: var(--accent); font-size: 12px;
}
.cal-kind-flight { background: rgba(106,140,184,0.10) !important; }
.cal-kind-car { background: rgba(180,140,90,0.10) !important; }
.cal-kind-checkin, .cal-kind-checkout { background: rgba(122,138,92,0.10) !important; }

/* ATH map pin */
.map-ath-pin { display: flex !important; align-items: center; justify-content: center; }
.map-ath-pin .ath-dot {
  width: 30px; height: 30px; border-radius: 50%;
  background: #6a8cb8; color: white; display: inline-flex;
  align-items: center; justify-content: center; font-size: 14px;
  border: 3px solid white; box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.map-stop-ath .ms-pin { background: #6a8cb8; color: white; font-size: 14px; }

/* Globe overlay */
.globe-overlay {
  position: fixed; inset: 0;
  background: rgba(31,30,26,0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  animation: fadeIn 0.3s;
}

/* Map shell — replaces the abstract globe */
.map-shell {
  position: relative;
  background: var(--paper);
  border-radius: var(--r-xl);
  padding: 0;
  max-width: 1180px;
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 40px 80px -20px rgba(31,30,26,0.5);
}
.map-shell .reco-close {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 1100;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.96);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  transition: transform 0.15s;
}
.map-shell .reco-close:hover { transform: scale(1.08); }

.map-head {
  padding: 28px 36px 22px;
  border-bottom: 1px solid rgba(31,30,26,0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.map-title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(28px, 3.2vw, 38px);
  letter-spacing: -0.01em;
  margin: 4px 0 0;
  color: var(--ink);
}
.map-title em { color: var(--accent); font-style: italic; }
.map-meta {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 6px;
}

.map-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  flex: 1;
  min-height: 0;
}
.map-canvas {
  width: 100%;
  height: 100%;
  min-height: 480px;
  background: #e8e4d8;
}
.map-list {
  border-left: 1px solid rgba(31,30,26,0.08);
  background: color-mix(in oklch, var(--paper) 92%, var(--ink) 0%);
  padding: 22px 22px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.map-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(31,30,26,0.08);
}

.map-stop {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 8px;
  border-radius: 8px;
  transition: background 0.15s;
}
.map-stop:hover { background: rgba(31,30,26,0.04); }
.ms-pin {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-family: var(--mono, ui-monospace, monospace);
  font-weight: 500;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.map-stop-venue .ms-pin {
  background: var(--ink);
  color: var(--paper);
  font-size: 16px;
}
.ms-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ms-label {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--ink);
  line-height: 1.2;
}
.ms-sub {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.map-empty {
  padding: 24px 12px;
  font-size: 13px;
  color: var(--ink-mute);
  font-style: italic;
  line-height: 1.5;
}

/* Leaflet pin overrides */
.map-venue-pin {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: center;
}
.map-venue-pin .vp-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(122, 138, 92, 0.25);
  animation: pulse-pin 2.4s ease infinite;
}
.map-venue-pin .vp-dot {
  position: relative;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 3px solid white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
@keyframes pulse-pin {
  0%, 100% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.4); opacity: 0; }
}
.map-stop-pin {
  display: flex !important;
  align-items: center;
  justify-content: center;
}
.map-stop-pin .sp-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-family: var(--mono, ui-monospace, monospace);
  font-weight: 500;
  border: 2px solid white;
  box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}
.leaflet-popup-content {
  font-family: var(--sans, system-ui);
  font-size: 13px;
  margin: 10px 14px !important;
}
.leaflet-popup-content strong {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 16px;
}

@media (max-width: 820px) {
  .globe-overlay { padding: 16px; }
  .map-body { grid-template-columns: 1fr; grid-template-rows: 320px 1fr; }
  .map-list { border-left: none; border-top: 1px solid rgba(31,30,26,0.08); max-height: 280px; }
  .map-head { padding: 22px 24px 16px; }
}

/* Legacy globe shell — kept for safety, hidden when map-shell is used */
.globe-shell {
  position: relative;
  background: var(--paper);
  border-radius: var(--r-xl);
  padding: 48px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.globe-head { text-align: center; margin-bottom: 32px; }
.globe-stage {
  display: flex;
  justify-content: center;
  margin: 0 auto 32px;
}
.globe-sphere {
  position: relative;
  width: 400px; height: 400px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #6FA3B8 0%, #4A7B8C 40%, #2F5868 80%, #1B3A48 100%);
  overflow: hidden;
  box-shadow: inset -30px -40px 80px rgba(0,0,0,0.4), 0 30px 60px rgba(0,0,0,0.3);
  color: var(--accent);
}
.globe-grid {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    repeating-linear-gradient(0deg, transparent 0 24px, rgba(255,255,255,0.08) 24px 25px),
    repeating-linear-gradient(90deg, transparent 0 24px, rgba(255,255,255,0.08) 24px 25px);
  animation: globeSpin 60s linear infinite;
}
.globe-grid-2 {
  background:
    repeating-radial-gradient(circle at 50% 50%, transparent 0 30px, rgba(255,255,255,0.06) 30px 31px);
  animation: none;
}
@keyframes globeSpin {
  from { transform: rotate(0deg); } to { transform: rotate(360deg); }
}
.globe-shine {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.25), transparent 40%);
  pointer-events: none;
}
.globe-continent {
  position: absolute;
  background: rgba(110, 130, 80, 0.55);
  border-radius: 50% 30% 60% 40% / 40% 60% 30% 50%;
}
.c1 { top: 35%; left: 30%; width: 28%; height: 18%; }
.c2 { top: 55%; left: 50%; width: 20%; height: 14%; transform: rotate(-25deg); }
.c3 { top: 22%; left: 55%; width: 14%; height: 10%; border-radius: 50%; }
.globe-path {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.globe-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid rgba(31,30,26,0.08);
  padding-top: 24px;
}
.globe-stop {
  display: grid;
  grid-template-columns: 32px 80px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 10px 0;
  font-size: 13px;
}
.globe-stop-num { font-size: 10px; color: var(--ink-mute); letter-spacing: 0.1em; }
.globe-stop-day { font-size: 10px; color: var(--accent); letter-spacing: 0.14em; text-transform: uppercase; }
.globe-stop-label { font-family: var(--serif); font-size: 18px; font-style: italic; }
.globe-stop-time { font-size: 11px; color: var(--ink-mute); }

/* ===== Reco expand button + modal ===== */
.reco-expand {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(31,30,26,0.1);
  background: rgba(245,241,232,0.9);
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.18s;
  z-index: 2;
}
.reco-expand:hover { background: var(--accent); color: var(--paper); border-color: var(--accent); }

.reco-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 12, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: reco-fade 0.18s ease;
}
@keyframes reco-fade { from { opacity: 0; } to { opacity: 1; } }
.reco-modal {
  position: relative;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--paper);
  border-radius: var(--r-lg);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.45);
  animation: reco-rise 0.22s ease;
}
@keyframes reco-rise { from { transform: translateY(14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.reco-modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--accent);
  z-index: 3;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.reco-modal.reco-olive::before { background: var(--olive); }
.reco-modal.reco-aegean::before { background: var(--aegean); }
.reco-modal.reco-ochre::before { background: var(--ochre); }
.reco-modal.reco-terracotta::before { background: var(--terracotta); }

.reco-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 0;
  background: rgba(245,241,232,0.85);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  z-index: 4;
  display: flex; align-items: center; justify-content: center;
  transition: 0.18s;
}
.reco-close:hover { background: var(--accent); color: var(--paper); }

.reco-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bone-warm);
}
.reco-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }

.reco-modal-body { padding: 28px 32px 32px; }
.reco-modal-top { display: flex; align-items: center; gap: 12px; }

.reco-facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0 0 22px;
  padding: 18px 0;
  border-top: 1px solid rgba(31,30,26,0.08);
  border-bottom: 1px solid rgba(31,30,26,0.08);
}
.reco-facts > div { display: grid; grid-template-columns: 140px 1fr; gap: 12px; align-items: baseline; }
.reco-facts dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0;
}
.reco-facts dd {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
}
.reco-facts dd a { color: var(--accent); text-decoration: none; border-bottom: 1px solid currentColor; }
.reco-facts dd a:hover { opacity: 0.7; }

.reco-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

@media (max-width: 640px) {
  .reco-modal-body { padding: 22px 20px 24px; }
  .reco-facts > div { grid-template-columns: 1fr; gap: 4px; }
}
