.modal:not([open]) {
  display: none;
}
.modal {
  position: fixed;
  inset: 0;
  background: #071a4675;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
}
.modal-card {
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  background: #fff;
  border-radius: 12px;
  padding: 22px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
}
.modal-head h2 {
  margin: 0;
}
.modal-head p {
  margin: 4px 0 18px;
  color: var(--muted);
}
.close {
  border: 0;
  background: transparent;
  font-size: 26px;
  cursor: pointer;
}
.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.required-mark { color: var(--red); }
.control.invalid { border-color: var(--red); box-shadow: 0 0 0 2px #ed1c2b18; }
.full {
  grid-column: 1/-1;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}
.details-card {
  width: min(1080px, 100%);
  max-height: calc(100vh - 36px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 70px #071a4655;
}
.details-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 21px 24px;
  border-bottom: 1px solid var(--border);
}
.details-title { display: flex; align-items: center; gap: 13px; min-width: 0; }
.details-title > div { min-width: 0; }
.details-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 9px; background: #fdebed; color: var(--red); font-size: 18px; }
.eyebrow { display: block; margin-bottom: 2px; color: var(--red); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.details-title h2 { margin: 0; font-size: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.details-title p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.details-header-actions { display: flex; align-items: center; gap: 12px; }
.details-body { min-height: 0; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .75fr); }
.details-content { padding: 22px 24px; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.info-item { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 11px; border: 1px solid var(--border); border-radius: 8px; background: #fafbfc; }
.info-item > span { width: 31px; height: 31px; flex: none; display: grid; place-items: center; border-radius: 7px; background: #edf1f7; color: var(--navy); font-size: 12px; }
.info-item > div { min-width: 0; }
.info-item small,.info-item strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info-item small { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.info-item strong { margin-top: 2px; font-size: 12px; }
.detail-section { margin-top: 22px; }
.detail-section h3,.map-heading h3 { margin: 0 0 12px; font-size: 14px; }
.detail-section h3 i,.map-heading h3 i { margin-right: 7px; color: var(--red); }
.text-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.text-grid article { min-height: 100px; padding: 13px; border: 1px solid var(--border); border-radius: 8px; }
.text-grid h4 { margin: 0 0 7px; font-size: 11px; text-transform: uppercase; color: #4e596b; }
.text-grid p { margin: 0; color: #273142; font-size: 13px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.text-grid p.not-informed { color: #929baa; font-style: italic; }
.map-panel { padding: 22px; background: #f8f9fb; border-left: 1px solid var(--border); }
.map-heading p { margin: -7px 0 14px; color: var(--muted); font-size: 11px; }
.map-switch { display: flex; gap: 6px; margin-bottom: 10px; }
.map-switch button { flex: 1; border: 1px solid var(--border); border-radius: 6px; background: #fff; padding: 7px; color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.map-switch button.active { border-color: var(--navy); background: var(--navy); color: #fff; }
.map-switch button i { margin-right: 5px; }
.map-frame { height: 310px; overflow: hidden; border: 1px solid var(--border); border-radius: 9px; background: #e9edf3; }
.map-frame iframe { width: 100%; height: 100%; border: 0; }
.map-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; color: var(--muted); font-size: 12px; }
.map-empty i { font-size: 26px; }
.coordinates { display: flex; justify-content: space-between; gap: 10px; margin: 10px 0; color: var(--muted); font-size: 10px; }
.coordinates span { min-width: 0; }
.coordinates b { display: block; margin-top: 2px; color: var(--text); font-size: 11px; }
.map-link { width: 100%; }
.details-footer { display: flex; align-items: center; justify-content: space-between; padding: 13px 24px; border-top: 1px solid var(--border); background: #fff; }
.details-footer span { color: var(--muted); font-size: 11px; font-weight: 700; }

.modal { width:100vw; height:100dvh; max-width:none; max-height:none; margin:0; border:0; color:var(--text); }
.modal::backdrop { background:transparent; }
@media(max-width:800px){.details-body{grid-template-columns:1fr}.map-panel{border-left:0;border-top:1px solid var(--border)}.info-grid{grid-template-columns:1fr 1fr}}
@media(max-width:480px){.modal-grid,.info-grid,.text-grid{grid-template-columns:1fr}.details-header,.details-content,.map-panel{padding:16px}.map-frame{height:260px}.coordinates{flex-direction:column}}
