/* Layout governance sits after legacy page styles and resolves only the
   documented conflicts. It does not alter persisted business information. */

/* The overview previously had contradictory fixed heights: its map could be
   600px high inside a much shorter clipped panel. Keep the map useful without
   hiding the operations list beneath it. */
#overview-view.ec-overview-map-only,
#overview-view.ec-overview-map-only:not(.hidden) {
  display: flex !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

#overview-view.ec-overview-map-only .overview-map-full-panel {
  height: auto !important;
  min-height: 0 !important;
}

#overview-view.ec-overview-map-only .panel-body,
#overview-view.ec-overview-map-only .panel-body-compact {
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

#overview-view .live-map-command-layout {
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

#overview-view .live-map-shell.live-map-shell-full,
#overview-view #live-tour-map {
  height: clamp(440px, 56vh, 640px) !important;
  min-height: 0 !important;
}

#overview-view .live-map-side-panel {
  max-height: clamp(440px, 56vh, 640px);
  overflow: auto;
}

/* Tour composition now begins with the customer-facing tour form. Resource,
   amenity and internal assignment tools remain available but no longer make a
   new tour appear as a wall of unrelated controls. */
#programs-view .ec-layout-disclosure {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

#programs-view .ec-layout-disclosure > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
}

#programs-view .ec-layout-disclosure > summary::-webkit-details-marker { display: none; }
#programs-view .ec-layout-disclosure > summary > .material-icons-outlined:first-child {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  color: var(--accent);
  background: var(--accent-soft);
}

#programs-view .ec-layout-disclosure-copy { display: grid; gap: 2px; min-width: 0; }
#programs-view .ec-layout-disclosure-copy strong { color: var(--text); font-size: 13px; font-weight: 950; }
#programs-view .ec-layout-disclosure-copy small { color: var(--muted); font-size: 11px; font-weight: 750; line-height: 1.5; }
#programs-view .ec-layout-disclosure-chevron { margin-left: auto; color: var(--muted); transition: transform .18s ease; }
#programs-view .ec-layout-disclosure[open] > summary { border-bottom: 1px solid var(--border); }
#programs-view .ec-layout-disclosure[open] > summary .ec-layout-disclosure-chevron { transform: rotate(180deg); }

#programs-view .ec-layout-disclosure > .ec-layout-disclosure-content {
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

#programs-view #ec-tour-workflow-assignment { margin-top: 14px; }
#programs-view #ec-tour-amenities { margin-top: 14px; }

.ec-data-state.ec-data-state-partial {
  border-left: 3px solid var(--warning);
  color: var(--text) !important;
  background: color-mix(in srgb, var(--warning) 10%, var(--surface));
}

@media (max-width: 900px) {
  #overview-view .live-map-command-layout {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
    grid-template-columns: 1fr !important;
    background: transparent;
  }
  #overview-view .live-map-shell.live-map-shell-full,
  #overview-view #live-tour-map { height: clamp(310px, 46vh, 420px) !important; }
  #overview-view .live-map-side-panel {
    position: static !important;
    width: 100% !important;
    max-height: 360px;
    border-color: var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
  }
}

@media (max-width: 620px) {
  #programs-view .ec-layout-disclosure > summary { align-items: flex-start; padding: 12px; }
  #programs-view .ec-layout-disclosure-copy small { line-height: 1.45; }
}
