.authoring-block {
  padding: 0.85rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.app-shell:not(.is-admin) {
  grid-template-columns: 304px 1fr;
}

.app-shell:not(.is-admin) .sidebar {
  gap: 0.9rem;
  padding: 1rem 1rem 1.05rem;
}

.app-shell:not(.is-admin) .brand-block {
  gap: 0.5rem;
}

.app-shell:not(.is-admin) h1 {
  font-size: clamp(1.65rem, 2.4vw, 2.2rem);
}

.app-shell:not(.is-admin) .section-meta {
  display: none;
}

.app-shell:not(.is-admin) .admin-only {
  display: none;
}

.app-shell:not(.is-admin) .control-group {
  gap: 0.6rem;
}

.app-shell:not(.is-admin) .section-block {
  gap: 0.65rem;
}

.app-shell:not(.is-admin) .lede,
.app-shell:not(.is-admin) .legend-list li {
  font-size: 0.92rem;
  line-height: 1.55;
}

.public-summary {
  padding: 0.88rem 0.95rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.lede-compact {
  font-size: 0.91rem;
  line-height: 1.58;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  justify-content: flex-start;
  padding-top: 0.2rem;
}

.admin-toggle {
  min-height: 30px;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(243, 239, 230, 0.72);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.admin-toggle:hover,
.admin-toggle:focus-visible {
  transform: translateY(-1px);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.app-shell.is-admin .admin-toggle {
  color: var(--text);
  border-color: rgba(198, 146, 83, 0.28);
  background: rgba(198, 146, 83, 0.1);
}

.authoring-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.authoring-grid-tools {
  grid-template-columns: 1fr 1fr;
}

.authoring-grid-save {
  grid-template-columns: 1fr 1fr;
}

.control-button-authoring {
  background: linear-gradient(180deg, rgba(116, 213, 223, 0.2), rgba(116, 213, 223, 0.08));
  border-color: rgba(116, 213, 223, 0.45);
}

.control-button.is-active,
.mini-button.is-active {
  border-color: rgba(116, 213, 223, 0.72);
  background: rgba(116, 213, 223, 0.16);
}

.authoring-readout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.readout-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.authoring-readout code {
  color: var(--text);
  font-size: 0.8rem;
}

.mini-button {
  min-height: 36px;
  padding: 0.55rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.mini-button:hover,
.mini-button:focus-visible,
.mini-button-primary:hover,
.mini-button-primary:focus-visible {
  transform: translateY(-1px);
}

.mini-button:disabled,
.control-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.mini-button-primary {
  background: rgba(198, 146, 83, 0.16);
  border-color: rgba(198, 146, 83, 0.45);
}

.authoring-status {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.detail-form {
  display: grid;
  gap: 0.7rem;
}

.detail-field {
  display: grid;
  gap: 0.35rem;
}

.detail-field label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-field input,
.detail-field select,
.detail-field textarea {
  width: 100%;
  min-height: 38px;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.detail-field textarea {
  min-height: 72px;
  resize: vertical;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.detail-help {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.detail-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(116, 213, 223, 0.26);
  background: rgba(116, 213, 223, 0.1);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.boundary-selected {
  filter: drop-shadow(0 0 12px rgba(116, 213, 223, 0.18));
}

.site-marker {
  width: 22px;
  height: 22px;
  color: #f6f1e5;
}

.site-marker__glyph {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.site-marker__glyph svg {
  width: 13px;
  height: 13px;
}

.site-marker--site {
  background: #d89049;
}

.site-marker--camera {
  background: #63c6ff;
}

.site-marker--access {
  background: #f4b868;
}

.compact-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.compact-panel-header .compact-label {
  margin-bottom: 0;
}

.compact-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(243, 239, 230, 0.9);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.compact-close:hover,
.compact-close:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.modal {
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.modal-backdrop {
  background: rgba(7, 11, 15, 0.34);
  backdrop-filter: blur(3px);
}

.modal-card {
  width: min(960px, 58vw, calc(100vw - 3rem));
  max-height: min(78vh, 940px);
  margin: 0;
  padding: 1.35rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  float: none;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 12, 17, 0.72);
  color: rgba(243, 239, 230, 0.92);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.modal-close:hover,
.modal-close:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.modal-content {
  gap: 1rem;
}

.modal-copy {
  padding-right: 3rem;
}

.modal-title {
  font-size: clamp(1.7rem, 2.8vw, 2.55rem);
  line-height: 1.08;
}

.modal-media-hero {
  aspect-ratio: 16 / 10;
  max-height: 60vh;
}

.modal-media-hero img,
.modal-media-hero video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-helper,
.modal-credit {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

@media (max-width: 640px) {
  .authoring-grid,
  .authoring-grid-save {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 0.75rem;
  }

  .modal-card {
    width: calc(100vw - 1.5rem);
    max-height: calc(100vh - 1.5rem);
    padding: 1rem;
  }

  .modal-copy {
    padding-right: 2.6rem;
  }
}

/* Warm sidebar treatment for public and authoring blocks */
.sidebar .public-summary,
.sidebar .authoring-block {
  background: linear-gradient(180deg, rgba(42, 42, 42, 0.76), rgba(26, 26, 26, 0.82));
  border-color: rgba(196, 168, 130, 0.12);
}

.sidebar .authoring-readout {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(196, 168, 130, 0.12);
}

.sidebar .readout-label,
.sidebar .authoring-status,
.sidebar .detail-field label {
  color: #c4a882;
}

.sidebar .authoring-readout code,
.sidebar .detail-field input,
.sidebar .detail-field select,
.sidebar .detail-field textarea {
  color: #f0ede8;
}

.sidebar .mini-button,
.sidebar .mini-button-primary,
.sidebar .control-button-authoring,
.app-shell.is-admin .sidebar .admin-toggle {
  border-color: rgba(196, 168, 130, 0.15);
  background: linear-gradient(180deg, rgba(42, 42, 42, 0.92), rgba(26, 26, 26, 0.94));
  color: #f0ede8;
}

.sidebar .mini-button:hover,
.sidebar .mini-button:focus-visible,
.sidebar .mini-button-primary:hover,
.sidebar .mini-button-primary:focus-visible,
.sidebar .control-button-authoring:hover,
.sidebar .control-button-authoring:focus-visible {
  border-color: rgba(232, 98, 43, 0.6);
  background: linear-gradient(180deg, rgba(232, 98, 43, 0.18), rgba(232, 98, 43, 0.08));
}

.sidebar .control-button.is-active,
.sidebar .mini-button.is-active,
.sidebar .detail-badge {
  border-color: rgba(232, 98, 43, 0.45);
  background: rgba(232, 98, 43, 0.12);
}

.sidebar .detail-field input,
.sidebar .detail-field select,
.sidebar .detail-field textarea {
  border-color: rgba(196, 168, 130, 0.15);
  background: rgba(255, 255, 255, 0.03);
}

