:root {
  --ink: #13211f;
  --muted: #66736f;
  --line: #d9e1dc;
  --paper: #f6f2ea;
  --panel: #ffffff;
  --panel-soft: #fbf8f1;
  --mint: #d8eee5;
  --mint-strong: #08745c;
  --coral: #e8654f;
  --sun: #f3bc41;
  --blue: #276fa7;
  --violet: #7552a8;
  --sand: #eadbc5;
  --shadow: 0 18px 50px rgba(26, 42, 38, 0.1);
  --shadow-soft: 0 10px 30px rgba(26, 42, 38, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(8, 116, 92, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(232, 101, 79, 0.1), transparent 30%),
    var(--paper);
}

button,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 304px 1fr;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px;
  min-width: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #12302b 0%, #16453c 52%, #f6f2ea 52%);
  border-right: 1px solid rgba(19, 33, 31, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--sun), var(--coral) 54%, var(--blue));
  color: #fff;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
}

.brand h1,
.topbar h2,
.section-heading h3,
.sync-panel h2 {
  margin: 0;
  letter-spacing: 0;
}

.brand h1 {
  font-size: 26px;
  color: #fff;
}

.brand .eyebrow {
  color: rgba(255, 255, 255, 0.62);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-groups {
  display: grid;
  gap: 18px;
}

.nav-label {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.secondary-nav {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.secondary-nav .nav-item {
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.055);
}

.nav-item {
  min-height: 42px;
  padding: 0 14px;
  text-align: left;
  color: rgba(255, 255, 255, 0.86);
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 800;
}

.nav-item.is-active {
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.7);
  background: #fff;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
}

.nav-item:hover {
  transform: translateY(-1px);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.breadcrumb-link {
  padding: 0;
  border: 0;
  color: var(--mint-strong);
  background: transparent;
  font-weight: 800;
}

.sync-panel,
.panel,
.map-panel,
.metrics article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.sync-panel {
  padding: 18px;
  margin-top: auto;
  background: rgba(255, 255, 255, 0.92);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.sync-panel h2 {
  font-size: 18px;
  line-height: 1.25;
}

dl {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
}

dl div {
  display: grid;
  grid-template-columns: minmax(92px, auto) minmax(0, 1fr);
  gap: 12px;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
  overflow-wrap: anywhere;
}

.workspace {
  padding: 28px;
  min-width: 0;
}

.topbar,
.section-heading,
.actions,
.segmented,
.source-meta,
.topic-meta,
.conclusion-actions {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.topbar h2 {
  max-width: 850px;
  font-size: 30px;
  line-height: 1.15;
}

.actions {
  gap: 10px;
}

.icon-button,
.primary-button,
.secondary-button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.icon-button {
  width: 40px;
  font-size: 20px;
  box-shadow: var(--shadow-soft);
}

.primary-button,
.secondary-button {
  padding: 0 15px;
  font-weight: 800;
}

.primary-button {
  border-color: var(--mint-strong);
  background: linear-gradient(135deg, var(--mint-strong), #0b8b9b);
  color: white;
}

.secondary-button:hover,
.primary-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(19, 33, 31, 0.14);
}

.trip-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 20px;
  align-items: end;
  margin-bottom: 20px;
  padding: 24px;
  overflow: hidden;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(13, 44, 39, 0.96), rgba(8, 116, 92, 0.88) 48%, rgba(39, 111, 167, 0.9)),
    linear-gradient(45deg, transparent, rgba(243, 188, 65, 0.24));
  box-shadow: 0 24px 70px rgba(19, 33, 31, 0.22);
}

.trip-hero::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -92px;
  width: 330px;
  height: 210px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  transform: rotate(-18deg);
}

.trip-hero-copy,
.trip-quick-facts,
.quick-actions {
  position: relative;
  z-index: 1;
}

.trip-hero .eyebrow {
  color: rgba(255, 255, 255, 0.68);
}

.trip-hero h2 {
  max-width: 760px;
  margin: 0;
  font-size: 54px;
  line-height: 0.98;
  letter-spacing: 0;
}

.trip-hero p {
  max-width: 680px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 17px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.trip-quick-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.trip-quick-facts article {
  min-height: 92px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.trip-quick-facts span {
  display: block;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.trip-quick-facts strong {
  display: block;
  margin-top: 9px;
  color: #fff;
  font-size: 21px;
  line-height: 1.1;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  gap: 10px;
}

.quick-actions .secondary-button {
  border-color: rgba(255, 255, 255, 0.34);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metrics article {
  padding: 16px;
  background:
    linear-gradient(180deg, #fff, #fbf8f1);
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  color: var(--mint-strong);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
}

body[data-active-view]:not([data-active-view="overview"]) .trip-hero,
body[data-active-view]:not([data-active-view="overview"]) .metrics {
  display: none;
}

body[data-active-view]:not([data-active-view="overview"]) .topbar {
  margin-bottom: 10px;
}

body[data-active-view]:not([data-active-view="overview"]) .topbar h2 {
  font-size: 24px;
}

body[data-active-view]:not([data-active-view="overview"]) .toolbar {
  position: static;
  margin-bottom: 12px;
  padding-top: 0;
}

body[data-active-view="map"] .content-grid,
body[data-active-view="sources"] .content-grid,
body[data-active-view="messages"] .content-grid {
  grid-template-columns: 1fr;
}

body[data-active-view="map"] .side-column,
body[data-active-view="sources"] .side-column,
body[data-active-view="messages"] .side-column {
  display: none;
}

body[data-active-view="timeline"] [data-side-panel="map"],
body[data-active-view="timeline"] [data-side-panel="messages"],
body[data-active-view="destinations"] [data-side-panel="messages"],
body[data-active-view="activities"] [data-side-panel="messages"],
body[data-active-view="activity-page"] [data-side-panel="messages"] {
  display: none;
}

body[data-active-view="map"] .map-layout {
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
}

.main-column,
.side-column {
  display: grid;
  align-content: start;
  gap: 18px;
}

.side-column {
  position: sticky;
  top: 86px;
}

.panel,
.map-panel {
  padding: 18px;
  background: rgba(255, 255, 255, 0.94);
  min-width: 0;
}

.section-heading {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.section-heading h3 {
  font-size: 20px;
}

.segmented {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.segmented button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  background: white;
  color: var(--muted);
}

.segmented button.is-selected {
  background: var(--ink);
  color: white;
}

.conclusion-list,
.topic-list,
.source-list,
.timeline-list,
.destination-list,
.activity-list {
  display: grid;
  gap: 12px;
}

.conclusion-card,
.topic-card,
.source-card,
.timeline-card,
.message {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(26, 42, 38, 0.05);
}

.conclusion-card,
.topic-card,
.source-card,
.timeline-card {
  padding: 16px;
}

.conclusion-card[data-status="ready"] {
  border-left: 5px solid var(--mint-strong);
}

.conclusion-card[data-status="research"] {
  border-left: 5px solid var(--sun);
}

.conclusion-card[data-status="blocked"] {
  border-left: 5px solid var(--coral);
}

.conclusion-card h4,
.topic-card h4,
.source-card h4,
.timeline-card h4 {
  margin: 0;
  font-size: 18px;
}

.conclusion-card p,
.topic-card p,
.source-card p,
.timeline-card p {
  color: var(--muted);
  line-height: 1.55;
}

.chip-row,
.evidence-list,
.message-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: #f0f3f0;
  color: #39443f;
  font-size: 12px;
  font-weight: 800;
}

a.chip {
  text-decoration: none;
}

a.chip:hover {
  outline: 2px solid rgba(8, 116, 92, 0.18);
}

.chip.official {
  background: var(--mint);
  color: #07553f;
}

.chip.experience {
  background: #e7eef6;
  color: #164b73;
}

.chip.commercial {
  background: #fff0df;
  color: #835009;
}

.chip.editorial {
  background: #efe9ff;
  color: #55318e;
}

.chip.document {
  background: #e8f3f2;
  color: #075c63;
}

.confidence {
  display: grid;
  grid-template-columns: 120px 1fr 44px;
  gap: 10px;
  align-items: center;
  margin: 14px 0;
}

.meter {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #eef0ed;
}

.meter span {
  display: block;
  height: 100%;
  background: var(--mint-strong);
}

.conclusion-actions {
  justify-content: flex-end;
  gap: 8px;
}

.topic-meta,
.source-meta {
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.map-canvas {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  border: 1px solid #cfd8d2;
  border-radius: 8px;
  background: #e7efea;
}

.question-list {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.question-card {
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f7faf8);
  color: #3f4944;
  line-height: 1.45;
}

.question-card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.question-card strong {
  color: var(--ink);
  line-height: 1.3;
}

.question-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.question-action {
  justify-self: start;
  min-height: 34px;
  padding-inline: 12px;
}

.question-card.is-empty {
  background: #f6f4ef;
}

.message-list {
  max-height: 420px;
  overflow: auto;
}

.message {
  width: 100%;
  padding: 12px;
}

.message.is-highlighted,
.topic-card.is-highlighted {
  border-color: var(--mint-strong);
  box-shadow: 0 0 0 3px rgba(15, 122, 91, 0.14);
}

.message strong {
  display: block;
  margin-bottom: 4px;
}

.message p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.is-hidden {
  display: none;
}

dialog {
  width: min(560px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  box-shadow: 0 30px 90px rgba(20, 28, 24, 0.25);
}

dialog::backdrop {
  background: rgba(23, 32, 27, 0.42);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  background: white;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: 0;
    background: #12302b;
  }

  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-groups {
    gap: 14px;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .side-column {
    position: static;
  }

  .trip-hero {
    grid-template-columns: 1fr;
  }

  .trip-hero h2 {
    font-size: 46px;
  }
}

@media (max-width: 760px) {
  .workspace,
  .sidebar {
    padding: 16px;
    width: 100%;
    max-width: 100vw;
  }

  .sidebar > * {
    max-width: calc(100vw - 32px);
  }

  .topbar,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar h2 {
    font-size: 24px;
  }

  .metrics,
  .primary-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .secondary-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 10px;
  }

  .secondary-nav .nav-label {
    grid-column: 1 / -1;
  }

  .sync-panel {
    display: none;
  }

  .trip-hero {
    padding: 18px;
    width: 100%;
    max-width: calc(100vw - 32px);
  }

  .sync-panel dl div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .sync-panel dd {
    text-align: left;
  }

  .trip-hero h2 {
    font-size: 36px;
  }

  .trip-hero p {
    max-width: 300px;
    word-break: break-word;
  }

  .trip-quick-facts {
    grid-template-columns: 1fr;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
  }
}

@media (max-width: 460px) {
  .metrics {
    grid-template-columns: 1fr;
  }

  .confidence {
    grid-template-columns: 1fr;
  }

  .quick-actions .primary-button,
  .quick-actions .secondary-button {
    width: 100%;
  }
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: 8px 0;
  backdrop-filter: blur(14px);
}

.search-control,
.data-status {
  min-height: 58px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.search-control {
  display: grid;
  gap: 4px;
}

.search-control span,
.data-status span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.search-control input {
  width: 100%;
  min-height: 28px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 16px;
}

.data-status {
  display: grid;
  align-content: center;
  gap: 3px;
}

.data-status strong {
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--mint);
  color: #07553f;
  font-size: 12px;
  font-weight: 800;
}

.status-pill[data-status="research"],
.status-pill[data-status="option"],
.status-pill[data-status="idea"] {
  background: #fff0d1;
  color: #77500b;
}

.status-pill[data-status="blocked"] {
  background: #ffe3dc;
  color: #9a2f20;
}

.status-pill[data-status="booked"],
.status-pill[data-status="confirmed"],
.status-pill[data-status="fixed"],
.status-pill[data-status="pinned"] {
  background: #dff0ff;
  color: #174c75;
}

.topic-card h5 {
  margin: 16px 0 0;
  font-size: 14px;
}

.topic-message-links {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.message-link {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.message-link span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.message-link strong {
  color: var(--ink);
  line-height: 1.35;
}

.timeline-card h5 {
  margin: 14px 0 0;
  font-size: 14px;
}

.timeline-phase {
  display: grid;
  gap: 10px;
}

.timeline-phase-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.timeline-phase-heading h4 {
  margin: 0;
  font-size: 16px;
}

.timeline-phase-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.timeline-card.is-confirmed {
  border-left: 5px solid var(--mint-strong);
}

.timeline-card.is-flexible {
  border-left: 5px solid var(--sun);
}

.location-line {
  margin-top: 8px;
  color: var(--ink);
  font-weight: 800;
}

.inline-list {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.inline-list a {
  color: var(--blue);
  font-weight: 800;
}

.score-grid {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.score-row {
  display: grid;
  grid-template-columns: 76px 1fr 42px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.source-actions,
.message-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.source-actions a,
.message-footer a {
  color: var(--blue);
  font-weight: 800;
}

.file-badge {
  display: inline-flex;
  max-width: 100%;
  margin-top: 12px;
  padding: 6px 8px;
  overflow: hidden;
  border-radius: 6px;
  background: #f3f5f2;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.all-message-list {
  display: grid;
  gap: 8px;
}

.message-footer {
  margin: 10px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.empty-state {
  color: var(--muted);
}

.inactive-section {
  border: 1px dashed #c9c4b8;
  border-radius: 8px;
  background: rgba(251, 248, 241, 0.82);
}

.inactive-section summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.inactive-section summary::marker {
  color: var(--muted);
}

.inactive-section summary strong {
  display: inline-grid;
  min-width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: #ece8de;
  color: #665f52;
  font-size: 12px;
}

.inactive-section-content {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.inactive-notice {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px dashed #c9c4b8;
  border-radius: 8px;
  background: #f6f4ef;
  color: #665f52;
}

.inactive-notice span {
  color: var(--muted);
  line-height: 1.45;
}

.map-workbench {
  display: grid;
  gap: 16px;
}

.map-workbench.is-hidden {
  display: none;
}

.map-levels button {
  min-width: 92px;
}

.map-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(160px, 0.8fr) auto;
  gap: 12px;
  align-items: end;
}

.map-select {
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.map-select select {
  min-height: 32px;
  padding: 4px 0;
  border: 0;
  outline: 0;
}

.map-stat {
  display: grid;
  align-content: center;
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f7f4;
}

.map-stat span,
.map-description,
.map-list-item span {
  color: var(--muted);
}

.map-description {
  margin: 0;
  line-height: 1.5;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.map-legend-item {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #344039;
  font-size: 12px;
  font-weight: 800;
}

.map-legend-item i,
.route-swatch,
.place-kind-dot {
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 999px;
}

.map-legend-item i {
  width: 22px;
  height: 4px;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  align-items: start;
}

.real-map {
  height: min(68vh, 620px);
  min-height: 460px;
}

.side-map-canvas {
  height: 290px;
}

.leaflet-container {
  font: inherit;
}

.map-marker {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 11px 11px 11px 3px;
  rotate: -45deg;
  color: #fff;
  background: var(--coral);
  box-shadow: 0 12px 24px rgba(23, 32, 27, 0.22);
}

.map-marker::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 14px 14px 14px 4px;
}

.map-marker svg {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  rotate: 45deg;
  fill: currentColor;
}

.map-marker.is-option {
  border-style: dashed;
}

.map-marker.kind-airport {
  background: var(--blue);
}

.map-marker.kind-hotel,
.map-marker.kind-stay {
  background: #0f7a5b;
}

.map-marker.kind-port,
.map-marker.kind-island,
.map-marker.kind-cruise_terminal {
  background: #0f7a8a;
}

.map-marker.kind-transport-option,
.map-marker.kind-transport_option {
  background: var(--coral);
}

.map-marker.kind-poi,
.map-marker.kind-activity {
  background: #b27a1c;
}

.activity-marker {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: var(--violet);
  box-shadow: 0 12px 26px rgba(23, 32, 27, 0.24);
}

.activity-marker::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 2px solid rgba(255, 255, 255, 0.74);
  border-radius: 999px;
}

.activity-marker svg {
  position: relative;
  z-index: 1;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.activity-marker.is-option {
  border-style: dashed;
}

.activity-marker.type-art,
.activity-legend.type-art svg,
.fallback-activity-marker.type-art {
  background: var(--violet);
}

.activity-marker.type-boat,
.activity-marker.type-water,
.activity-legend.type-boat svg,
.activity-legend.type-water svg,
.fallback-activity-marker.type-boat,
.fallback-activity-marker.type-water {
  background: #0f7a8a;
}

.activity-marker.type-cable-car,
.activity-marker.type-walk,
.activity-legend.type-cable-car svg,
.activity-legend.type-walk svg,
.fallback-activity-marker.type-cable-car,
.fallback-activity-marker.type-walk {
  background: #b27a1c;
}

.activity-marker.type-culture,
.activity-legend.type-culture svg,
.fallback-activity-marker.type-culture {
  background: var(--coral);
}

.activity-marker.type-memorial,
.activity-legend.type-memorial svg,
.fallback-activity-marker.type-memorial {
  background: #39443f;
}

.activity-marker.type-observation,
.activity-legend.type-observation svg,
.fallback-activity-marker.type-observation {
  background: var(--blue);
}

.activity-marker.type-park,
.activity-legend.type-park svg,
.fallback-activity-marker.type-park {
  background: var(--mint-strong);
}

.activity-legend svg {
  width: 22px;
  height: 22px;
  padding: 4px;
  border-radius: 999px;
  color: #fff;
  fill: currentColor;
}

.leaflet-popup-content {
  display: grid;
  gap: 8px;
  min-width: 220px;
  margin: 12px;
}

.leaflet-popup-content p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.leaflet-popup-content a {
  color: var(--mint-strong);
  font-weight: 800;
}

.map-details {
  display: grid;
  gap: 14px;
  max-height: min(68vh, 620px);
  overflow: auto;
}

.map-details h4 {
  margin: 0 0 8px;
  font-size: 16px;
}

.map-list {
  display: grid;
  gap: 10px;
}

.map-list-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.map-list-item div:first-child {
  display: grid;
  gap: 3px;
}

.map-list-item strong {
  display: flex;
  gap: 8px;
  align-items: center;
}

.place-kind-dot {
  width: 11px;
  height: 11px;
  background: #b27a1c;
}

.place-kind-dot.kind-airport {
  background: #2563a6;
}

.place-kind-dot.kind-hotel,
.place-kind-dot.kind-stay {
  background: #0f7a5b;
}

.place-kind-dot.kind-port,
.place-kind-dot.kind-island,
.place-kind-dot.kind-cruise_terminal {
  background: #0f7a8a;
}

.place-kind-dot.kind-transport-option,
.place-kind-dot.kind-transport_option {
  background: #e6785c;
}

.place-kind-dot.kind-activity {
  background: #b27a1c;
}

.route-swatch {
  width: 24px;
  height: 5px;
}

.map-list-item a {
  color: var(--mint-strong);
  font-weight: 800;
  text-decoration: none;
}

.map-list-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
}

.full-width-button {
  width: 100%;
  margin-top: 12px;
}

.activities-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.activities-toolbar label {
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.activities-toolbar select {
  min-height: 32px;
  padding: 4px 0;
  border: 0;
  outline: 0;
}

.destination-list {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-bottom: 14px;
}

.destination-card {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 86px;
  padding: 13px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, var(--panel-soft));
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.destination-card.is-active {
  border-color: var(--mint-strong);
  box-shadow: 0 0 0 3px rgba(8, 116, 92, 0.12), 0 12px 26px rgba(23, 32, 27, 0.08);
}

.destination-card:hover,
.activity-card:hover,
.message-link:hover {
  transform: translateY(-1px);
  border-color: #afbeb6;
}

.destination-card span {
  color: var(--muted);
  font-size: 13px;
}

.destination-detail {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.destination-detail h5 {
  margin: 12px 0 0;
  font-size: 14px;
}

.destination-item-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.destination-item {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.destination-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.destination-item span {
  color: var(--muted);
  font-size: 12px;
}


.activity-card {
  display: grid;
  gap: 8px;
  width: 100%;
  min-height: 150px;
  padding: 14px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.activity-card.is-active {
  border-color: var(--mint-strong);
  box-shadow: 0 0 0 3px rgba(8, 116, 92, 0.12), 0 8px 24px rgba(23, 32, 27, 0.08);
}

.activity-card.is-inactive,
.destination-item.is-inactive,
.map-list-item.is-inactive {
  border-style: dashed;
  background: #f6f4ef;
  opacity: 0.78;
}

.activity-card strong {
  font-size: 17px;
}

.activity-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.meta-line {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.activity-detail {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.activity-detail h5 {
  margin: 12px 0 0;
  font-size: 14px;
}

.activity-detail p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.activity-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.activity-images a {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.activity-images img {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.image-evidence {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.image-evidence.is-compact {
  grid-template-columns: repeat(auto-fill, minmax(96px, 128px));
  gap: 8px;
}

.image-evidence-item {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  color: var(--muted);
  border: 0;
  background: transparent;
  cursor: zoom-in;
  text-decoration: none;
  text-align: left;
  font-size: 11px;
  font-weight: 800;
}

.image-evidence img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef0ed;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.image-evidence-item:hover img {
  border-color: var(--mint-strong);
  box-shadow: 0 12px 28px rgba(19, 33, 31, 0.14);
  transform: translateY(-1px);
}

.image-evidence-item:focus-visible {
  outline: 3px solid rgba(8, 116, 92, 0.22);
  outline-offset: 3px;
  border-radius: 8px;
}

.image-evidence span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-lightbox {
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
}

.image-lightbox::backdrop {
  background: rgba(14, 22, 19, 0.78);
  backdrop-filter: blur(6px);
}

.image-lightbox-shell {
  position: relative;
  display: grid;
  min-height: min(760px, calc(100vh - 32px));
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(246, 242, 234, 0.98);
  box-shadow: 0 36px 110px rgba(0, 0, 0, 0.38);
}

.image-lightbox figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 0;
  margin: 0;
}

.image-lightbox-stage {
  display: grid;
  min-height: 0;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #101715;
}

.image-lightbox-stage img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(72vh, 760px);
  object-fit: contain;
}

.image-lightbox figcaption {
  display: grid;
  gap: 4px;
  min-height: 48px;
  padding: 0 54px;
  color: var(--muted);
}

.image-lightbox figcaption strong {
  color: var(--ink);
  line-height: 1.25;
}

.image-lightbox figcaption span {
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 800;
}

.image-lightbox-close,
.image-lightbox-nav {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 1px solid rgba(19, 33, 31, 0.18);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.image-lightbox-close:hover,
.image-lightbox-nav:hover {
  background: #fff;
}

.image-lightbox-close {
  top: 24px;
  right: 24px;
  width: 42px;
  height: 42px;
  font-size: 24px;
}

.image-lightbox-nav {
  top: 50%;
  width: 46px;
  height: 58px;
  transform: translateY(-50%);
  font-size: 34px;
}

.image-lightbox-nav.is-prev {
  left: 24px;
}

.image-lightbox-nav.is-next {
  right: 24px;
}

.map-canvas.is-fallback {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.68) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.68) 1px, transparent 1px),
    #dfe9e3;
  background-size: 34px 34px;
}

.fallback-map-grid {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 25% 45%, rgba(47, 111, 159, 0.22), transparent 22%),
    radial-gradient(circle at 66% 52%, rgba(15, 122, 91, 0.22), transparent 20%),
    radial-gradient(circle at 46% 35%, rgba(244, 201, 93, 0.24), transparent 18%);
}

.fallback-marker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  position: absolute;
  z-index: 2;
  max-width: 150px;
  transform: translate(-50%, -50%);
  padding: 6px 8px 6px 6px;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: var(--coral);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(23, 32, 27, 0.16);
}

.fallback-marker svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.fallback-marker span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fallback-marker.is-confirmed {
  background: var(--mint-strong);
}

.fallback-marker.is-option {
  background: var(--blue);
}

.fallback-activity-marker {
  position: absolute;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 150px;
  transform: translate(-50%, -50%);
  padding: 5px 8px 5px 6px;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: var(--violet);
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(23, 32, 27, 0.18);
}

.fallback-activity-marker svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.fallback-activity-marker span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fallback-map-note {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(23, 32, 27, 0.12);
}

.fallback-map-note div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1100px) {
  .toolbar {
    grid-template-columns: 1fr;
  }

  .primary-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .map-controls,
  .map-layout {
    grid-template-columns: 1fr;
  }

  .map-details {
    max-height: none;
  }
}

@media (max-width: 760px) {
  .primary-nav,
  .secondary-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .activities-toolbar {
    grid-template-columns: 1fr;
  }

  .image-lightbox {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .image-lightbox-shell {
    min-height: calc(100vh - 16px);
    padding: 8px;
  }

  .image-lightbox-stage img {
    max-height: 70vh;
  }

  .image-lightbox figcaption {
    padding: 0 6px;
  }

  .image-lightbox-close {
    top: 14px;
    right: 14px;
  }

  .image-lightbox-nav {
    width: 40px;
    height: 50px;
  }

  .image-lightbox-nav.is-prev {
    left: 14px;
  }

  .image-lightbox-nav.is-next {
    right: 14px;
  }
}
