/* The location with Google Maps (maps.js), the plan of the place (plan.js) and the location's fitxa in columns
   (entities.js, ronda 5), light and dark */
.place-map {
  margin: -8px 0 18px;
}
.place-coords {
  margin: 0 0 4px;
  font-size: 13.5px;
  color: var(--muted);
}
#dialog-body .place-coords {
  margin: 0 0 4px;
  font-size: 13.5px;
}
.place-coords b {
  color: var(--ink);
}
.place-map .row-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 10px;
}
.place-embed {
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.place-embed iframe {
  display: block;
  width: 100%;
  height: 320px;
  border: 0;
}
.place-embed-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  font-size: 13px;
  border-top: 1px solid var(--line);
}
.place-photo-gps,
#dialog-body .place-photo-gps {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #eef6f0;
  color: #284d33;
  font-size: 13.5px;
  line-height: 1.5;
}
.place-photo-gps .button {
  margin-left: 6px;
}
.place-subhead {
  margin: 6px 0 10px;
  font-size: 14px;
  font-weight: 650;
}
#dialog-body .place-inline {
  margin: -12px 0 16px;
}
.place-hospital {
  padding: 10px 12px;
  border-radius: 8px;
  background: #fdf3f2;
  color: #5a1d17;
}
#dialog-body .place-hospital {
  color: #5a1d17;
}
.place-plan-view {
  margin: 0 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #f3f1ea;
}
.place-plan-view .plan-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 60vh;
}
.place-plan .row-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 6px;
}

/* ---- the plan's editor: a dialog over the fitxa ---- */
dialog.plan-dialog {
  width: min(1440px, calc(100vw - 24px));
  max-width: none;
  height: calc(100vh - 24px);
  max-height: none;
  padding: 0;
  overflow: hidden;
}
dialog.plan-dialog[open] {
  display: flex;
  flex-direction: column;
}
.plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}
.plan-head h2 {
  font-size: 17px;
}
.plan-head-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.plan-discard {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid #f1dfb5;
  background: #fff4dd;
  color: #7a4f06;
  font-size: 14px;
  font-weight: 600;
}
.plan-discard[hidden] {
  display: none;
}
.plan-discard span {
  margin-right: auto;
}
.plan-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 300px;
}
.plan-tools {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 8px;
  border-right: 1px solid var(--line);
  overflow: auto;
}
.plan-tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 9px 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}
.plan-tool:hover {
  background: #f0f3f5;
}
.plan-tool[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.plan-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: #26333d;
}
.plan-stage:focus {
  outline: none;
}
.plan-stage:focus-visible {
  outline: 3px solid #18944a;
  outline-offset: -3px;
}
.plan-stage .plan-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.plan-stage .plan-svg [data-shape] {
  cursor: move;
}
.plan-stage .plan-svg.is-drawing,
.plan-stage .plan-svg.is-drawing [data-shape] {
  cursor: crosshair;
}
.plan-stage .plan-handle {
  cursor: grab;
}
.plan-side {
  min-width: 0;
  overflow: auto;
  padding: 14px 16px;
  border-left: 1px solid var(--line);
}
.plan-side h3 {
  margin: 0 0 12px;
  font-size: 15px;
}
.plan-side input:not([type="checkbox"]):not([type="range"]),
.plan-side select {
  margin-bottom: 12px;
  padding: 8px 10px;
  font-size: 15px;
}
.plan-side input[type="range"] {
  width: 100%;
  margin: 2px 0 12px;
}
.plan-field {
  display: block;
}
.plan-label {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
}
.plan-hint {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.plan-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 14px;
}
.plan-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 14px;
}
.plan-color {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--swatch);
}
.plan-color.is-on {
  outline: 3px solid #1d4ed8;
  outline-offset: 2px;
}
.plan-icons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.plan-icon {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 13.5px;
  text-align: left;
}
.plan-icon.is-on {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.plan-icon span {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--swatch);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.plan-scenes {
  max-height: 240px;
  overflow: auto;
  margin: 0 0 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.plan-scenes label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
  font-size: 13.5px;
  line-height: 1.35;
}
.plan-scenes label[hidden] {
  display: none;
}
.plan-scenes input {
  margin-top: 2px;
}
.plan-file {
  cursor: pointer;
}
.plan-steps {
  margin: 4px 0 14px;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}
.plan-steps a {
  color: var(--ink);
  font-weight: 600;
}
.plan-side .button.danger {
  margin: 4px 0 8px;
}
.plan-status {
  min-height: 20px;
  margin: 0;
  padding: 6px 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
@media (max-width: 860px) {
  dialog.plan-dialog {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }
  .plan-main {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(260px, 1fr) auto;
  }
  .plan-tools {
    flex-direction: row;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 6px;
  }
  .plan-tool {
    min-width: 62px;
  }
  .plan-side {
    max-height: 36vh;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .plan-icons {
    grid-template-columns: 1fr 1fr;
  }
}
html.dark .plan-tool:hover {
  background: #273449;
}
html.dark .plan-tool[aria-pressed="true"] {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #e2e8f0;
}
html.dark .plan-discard {
  background: #3b2f1a;
  border-color: #5c4620;
  color: #f0c674;
}
html.dark .place-photo-gps,
html.dark #dialog-body .place-photo-gps {
  background: #173323;
  color: #bfe3c9;
}
html.dark .place-hospital,
html.dark #dialog-body .place-hospital {
  background: #3a1f1d;
  color: #f3c9c4;
}
html.dark .place-plan-view {
  background: #273449;
}

/* ---- the location's fitxa in tabs (Daniel, 2026-10-28; before, three columns): La localització, Contacte i permís de
   rodatge, Per al rodatge, Plànol del lloc, Fotos, Documents (entities.js: locationTabsNiu) ---- */
dialog.location-editor,
#dialog.wide-editor.location-editor {
  width: min(960px, calc(100vw - 32px));
  max-width: none;
}
.location-form {
  min-width: 0;
}
.location-tabs {
  margin: 0 0 18px;
}
/* on a phone, every tab in sight (in two or three rows), not hidden to the right (R3 proposta 11, the Festival Hub's) */
@media (max-width: 760px) {
  .location-tabs {
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 0 2px;
  }
  .location-tabs .tab-button {
    padding: 10px;
  }
}
.location-panel {
  min-width: 0;
  min-height: 220px;
}
.location-panel > .field-hint:first-child {
  margin-top: 0;
}
.location-panel .media-grid.location-photos {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin: 0 0 14px;
}
.location-panel .media-grid.location-photos:empty {
  display: none;
}
.location-panel .media-grid.location-photos label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}
.location-panel .document-cards {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 0;
  margin: 0 0 10px;
  max-width: none;
}
.location-panel .document-cards > .document-row {
  padding: 10px 12px;
  gap: 8px;
}
.location-panel .document-cards .document-title {
  flex: 1 1 140px;
}
.permit-new {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: -10px 0 18px;
}
#dialog-body .permit-made {
  margin: -12px 0 16px;
  color: #25623b;
  font-weight: 600;
}
/* «Veure» the permit's document, and what saving does with one of Documents → Rodatge (entities.js, permitPickedNiu) */
.permit-new [data-permit-view][hidden],
#dialog-body .permit-loose[hidden] {
  display: none;
}
#dialog-body .permit-loose {
  margin: -12px 0 16px;
}
.location-doc-menu {
  margin: 4px 0 0;
}
.location-panel .new-doc-list {
  min-width: 280px;
  right: auto;
  left: 0;
} /* the buttons are at the left of the tab: the menu opens to the right */
.location-archive-row {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
/* «Fusionar amb…» under the other names (entities.js, forms/character.js) */
.entity-merge-row {
  margin: -8px 0 16px;
}
#dialog-body .shrink-note {
  margin: -14px 0 16px;
}
/* ---- a question before doing something (confirmNiu, entities.js) ---- */
dialog.confirm-dialog {
  width: min(460px, calc(100vw - 32px));
}
.confirm-body {
  padding: 20px 25px 6px;
}
.confirm-body p {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}
/* what «Fusionar» does to the cues, under «Es queda» (pickMergeIntoNiu) */
.confirm-body .merge-note {
  margin: 12px 0 4px;
  color: var(--ink);
}
html.dark #dialog-body .permit-made {
  color: #86c79a;
}
/* «Triar al mapa» and «Capturar per al plànol»: the map of Google in Turonet (maps.js, mapPickerNiu; N8) */
.map-picker {
  width: min(980px, 94vw);
  max-width: 94vw;
  padding: 0;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 20px 60px #0005;
  background: var(--panel, #fff);
  color: var(--ink);
}
.map-picker::backdrop {
  background: #0007;
}
.map-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 8px;
}
.map-picker-head h2 {
  margin: 0;
  font-size: 17px;
}
.map-picker-search {
  padding: 0 18px 10px;
}
.map-picker-search gmp-place-autocomplete {
  width: 100%;
}
.map-picker-map {
  height: min(62vh, 620px);
  margin: 0 18px;
  border-radius: 8px;
  overflow: hidden;
  background: #e8ece9;
  display: grid;
  place-items: center;
}
.map-picker-wait {
  color: var(--muted);
}
.map-picker-point {
  margin: 10px 18px 0;
  font-size: 13px;
  color: var(--muted);
}
.map-picker .dialog-actions {
  padding: 12px 18px 16px;
}
