/* Web map workspace: route inspection, regional candidate selection and day regeneration. */
.desktop-map-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(25, 29, 28, .58);
  backdrop-filter: blur(8px);
}

.desktop-map-overlay[hidden],
.desktop-photo-overlay[hidden] {
  display: none;
}

.desktop-map-shell {
  width: min(1440px, 100%);
  height: min(900px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  background: #fff;
  border: 1px solid #e8ebe9;
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(18, 27, 25, .24);
}

.desktop-map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 14px 20px;
  border-bottom: 1px solid #eceeed;
}

.desktop-map-head h2,
.desktop-photo-head h2 {
  margin: 2px 0 0;
  color: #222;
  font-size: 20px;
  letter-spacing: 0;
}

.desktop-map-kicker,
.desktop-editor-kicker {
  color: #999;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

.desktop-map-head-actions {
  display: flex;
  gap: 8px;
}

.desktop-icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #3e4744;
  background: #fff;
  border: 1px solid #e4e7e5;
  border-radius: 8px;
  cursor: pointer;
}

.desktop-icon-button:hover {
  color: #e67a30;
  border-color: #ffb07d;
  background: #fff8f3;
}

.desktop-map-day-tabs,
.desktop-region-tabs,
.desktop-candidate-tabs,
.desktop-route-summary {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.desktop-map-day-tabs {
  min-height: 52px;
  align-items: center;
  padding: 8px 20px;
  border-bottom: 1px solid #eceeed;
}

.desktop-map-day-tab,
.desktop-region-tab,
.desktop-candidate-tab {
  min-height: 34px;
  padding: 7px 12px;
  color: #66706d;
  white-space: nowrap;
  background: #f4f6f5;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.desktop-map-day-tab.active,
.desktop-region-tab.active,
.desktop-candidate-tab.active {
  color: #fff;
  background: #273d38;
}

.desktop-map-content {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, .75fr);
}

.desktop-map-canvas-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #e9eeea;
}

.desktop-route-summary {
  min-height: 46px;
  align-items: center;
  padding: 7px 14px;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid #e2e6e3;
}

.desktop-route-summary-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 9px;
  color: #59635f;
  white-space: nowrap;
  background: #f2f5f3;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
}

.desktop-route-summary-number {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #e36d4a;
  border-radius: 50%;
  font-size: 9px;
}

.desktop-route-summary-item.hotel .desktop-route-summary-number {
  background: #5577ad;
}

.desktop-route-map {
  min-width: 0;
  min-height: 420px;
  background: #e9eeea;
}

.desktop-map-editor {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  padding: 18px;
  border-left: 1px solid #e6e9e7;
  background: #fff;
}

.desktop-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.desktop-editor-title {
  margin-top: 3px;
  color: #27332f;
  font-size: 14px;
  font-weight: 700;
}

.desktop-unsaved-badge {
  padding: 5px 8px;
  color: #bd5c2d;
  background: #fff2e8;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
}

.desktop-region-tabs {
  padding-bottom: 10px;
}

.desktop-region-count {
  margin-left: 5px;
  opacity: .72;
  font-size: 9px;
}

.desktop-candidate-tabs {
  padding: 8px 0;
  border-top: 1px solid #eef0ef;
  border-bottom: 1px solid #eef0ef;
}

.desktop-candidate-list {
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.desktop-candidate-empty {
  padding: 22px 4px;
  color: #929a97;
  font-size: 12px;
  text-align: center;
}

.desktop-candidate-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 24px;
  gap: 11px;
  align-items: center;
  min-height: 76px;
  padding: 9px 2px;
  border-bottom: 1px solid #eef0ef;
  cursor: pointer;
}

.desktop-candidate-row:hover {
  background: #fafbfa;
}

.desktop-candidate-photo,
.desktop-candidate-photo-button {
  width: 58px;
  height: 58px;
  border-radius: 7px;
}

.desktop-candidate-photo {
  display: block;
  object-fit: cover;
  background: #eef1ef;
}

.desktop-candidate-photo.empty {
  display: grid;
  place-items: center;
  color: #8a9490;
  font-size: 12px;
  font-weight: 700;
}

.desktop-candidate-photo-button {
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.desktop-candidate-copy {
  min-width: 0;
}

.desktop-candidate-name {
  display: block;
  overflow: hidden;
  color: #293632;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desktop-candidate-meta {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: #929a97;
  font-size: 10px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desktop-candidate-check {
  width: 18px;
  height: 18px;
  accent-color: #e36d4a;
}

.desktop-map-actions {
  display: grid;
  grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr);
  gap: 9px;
  padding-top: 12px;
}

.desktop-primary-button,
.desktop-secondary-button,
.btn-map-preview,
.btn-text-modify {
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.desktop-primary-button,
.btn-map-preview {
  color: #fff;
  background: #ff8a3d;
  border: 1px solid #ff8a3d;
}

.desktop-primary-button:hover,
.btn-map-preview:hover {
  background: #e67a30;
}

.desktop-secondary-button,
.btn-text-modify {
  color: #49534f;
  background: #f4f6f5;
  border: 1px solid #e3e7e5;
}

.desktop-primary-button:disabled,
.desktop-secondary-button:disabled {
  opacity: .55;
  cursor: wait;
}

.itinerary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.itinerary-actions .btn-download-img {
  width: auto;
  margin: 0;
}

.day-section-header {
  display: flex;
  align-items: center;
}

.day-map-button {
  margin-left: auto;
  padding: 5px 9px;
  color: #d96f31;
  background: #fff7f2;
  border: 1px solid #ffd9c1;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.desktop-poi-marker {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(26, 45, 40, .28);
  font-size: 10px;
  font-weight: 800;
}

.desktop-poi-marker.attraction { background: #e38a3c; }
.desktop-poi-marker.food { background: #d75d43; }
.desktop-poi-marker.hotel { background: #5577ad; }
.desktop-leaflet-icon { background: transparent; border: 0; }

.desktop-route-tooltip {
  padding: 4px 7px;
  color: #27332f;
  background: rgba(255, 255, 255, .96);
  border: 1px solid #e0e5e2;
  box-shadow: 0 3px 9px rgba(18, 42, 35, .12);
  font-size: 11px;
  font-weight: 700;
}

.desktop-route-tooltip::before { display: none; }

.desktop-map-popup-title {
  display: block;
  margin-bottom: 4px;
  color: #26342f;
  font-size: 13px;
}

.desktop-map-popup-meta {
  color: #727c78;
  font-size: 10px;
  line-height: 1.5;
}

.desktop-map-popup-photos {
  display: grid;
  grid-template-columns: repeat(3, 74px);
  gap: 5px;
  margin-top: 8px;
}

.desktop-map-popup-photo {
  width: 74px;
  height: 56px;
  object-fit: cover;
  border-radius: 5px;
}

.desktop-photo-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 32px;
  background: rgba(19, 24, 22, .78);
  backdrop-filter: blur(8px);
}

.desktop-photo-dialog {
  width: min(1120px, 100%);
  max-height: calc(100vh - 64px);
  overflow: hidden;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .28);
}

.desktop-photo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid #e7eae8;
}

.desktop-photo-head p {
  margin: 4px 0 0;
  color: #8c9692;
  font-size: 11px;
}

.desktop-photo-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 18px;
  overflow: auto;
  background: #f5f7f6;
}

.desktop-photo-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #e8ece9;
  border-radius: 7px;
}

@media (max-width: 980px) {
  .desktop-map-overlay { padding: 12px; }
  .desktop-map-shell { height: calc(100vh - 24px); }
  .desktop-map-content { grid-template-columns: 1fr; grid-template-rows: minmax(360px, 1fr) minmax(320px, .9fr); overflow-y: auto; }
  .desktop-map-editor { min-height: 420px; border-top: 1px solid #e6e9e7; border-left: 0; }
  .desktop-photo-gallery { grid-template-columns: 1fr; }
}
