.backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 999;
  backdrop-filter: blur(2px);
}

.panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background-color: var(--color-bg, #ffffff);
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  background-color: var(--color-bg-secondary, #f9fafb);
}

.title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text, #111827);
}

.closeButton {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary, #6b7280);
  border-radius: 4px;
  transition: background-color 0.2s;
}

.closeButton:hover {
  background-color: var(--color-hover, #f3f4f6);
  color: var(--color-text, #111827);
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.section {
  margin-bottom: 2rem;
}

.section:last-child {
  margin-bottom: 0;
}

.sectionHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-primary, #3b82f6);
}

.sectionTitle {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text, #111827);
}

.removeButton {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-error, #ef4444);
  border-radius: 4px;
  transition: background-color 0.2s;
}

.removeButton:hover {
  background-color: var(--color-error-light, #fee2e2);
  color: var(--color-error-dark, #dc2626);
}

.aggregatedSection {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: var(--color-bg-secondary, #f9fafb);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 6px;
}

.aggregatedTitle {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-secondary, #6b7280);
}

.aggregatedValue {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text, #111827);
}

.bauzoneSection {
  margin-bottom: 1rem;
}

.bauzoneTitle {
  margin: 0 0 0.75rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary, #3b82f6);
}

.bauzoneArea {
  font-weight: 400;
  color: var(--color-text-secondary, #6b7280);
}

.parcelsList {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.mapViewSection {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border, #e5e7eb);
}

.subSectionTitle {
  margin: 0 0 0.75rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-secondary, #6b7280);
}

.documentsSection {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--color-primary, #3b82f6);
  background-color: var(--color-bg-secondary, #f9fafb);
  padding: 1.5rem;
  border-radius: 8px;
  margin-left: -1.5rem;
  margin-right: -1.5rem;
}

.documentsSectionTitle {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text, #111827);
}

.infoGrid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.infoItem {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.value {
  font-size: 1rem;
  color: var(--color-text, #111827);
  word-break: break-word;
}

.subValue {
  color: var(--color-text-secondary, #6b7280);
  font-size: 0.875rem;
}

.link {
  color: var(--color-primary, #3b82f6);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.link:hover {
  color: var(--color-primary-dark, #2563eb);
  text-decoration: underline;
}

.adjacentList {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.adjacentItem {
  padding: 0.75rem;
  background-color: var(--color-bg-secondary, #f9fafb);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 6px;
  transition: background-color 0.2s, border-color 0.2s;
}

.adjacentItem:hover {
  background-color: var(--color-hover, #f3f4f6);
  border-color: var(--color-primary, #3b82f6);
}

.adjacentHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.adjacentNumber {
  font-weight: 600;
  color: var(--color-text, #111827);
  font-size: 1rem;
}

.adjacentEgrid {
  font-size: 0.875rem;
  color: var(--color-text-secondary, #6b7280);
  font-family: monospace;
}

.zoneDetails {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background-color: var(--color-bg-secondary, #f9fafb);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 4px;
}

.zoneSummary {
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--color-primary, #3b82f6);
  font-weight: 500;
  user-select: none;
}

.zoneSummary:hover {
  color: var(--color-primary-dark, #2563eb);
  text-decoration: underline;
}

.zoneData {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background-color: var(--color-bg, #ffffff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: monospace;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow-y: auto;
}

.setupSection {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  background-color: var(--color-bg-secondary, #f9fafb);
}

.setupHint {
  margin: 0 0 0.75rem 0;
  font-size: 0.8rem;
  color: var(--color-text-secondary, #6b7280);
}

.setupButtons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.bzoButton {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  background-color: var(--color-primary, #3b82f6);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
}

.bzoButton:hover:not(:disabled) {
  background-color: var(--color-primary-dark, #2563eb);
}

.bzoButton:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.setupMessage {
  margin: 0.5rem 0 0 0;
  font-size: 0.85rem;
  color: var(--color-text-secondary, #6b7280);
}

.bzoSection {
  margin-top: 1rem;
  padding: 0.75rem;
  background-color: var(--color-bg-secondary, #f9fafb);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 6px;
}

.bzoHint {
  margin: 0 0 0.5rem 0;
  font-size: 0.85rem;
  color: var(--color-text-secondary, #6b7280);
}

.docList {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.docItem {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background-color: var(--color-bg, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 6px;
}

.docIcon {
  color: var(--color-primary, #3b82f6);
  flex-shrink: 0;
}

.docLabel {
  flex: 1;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docOpenBtn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  background-color: var(--color-primary, #3b82f6);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.docOpenBtn:hover {
  background-color: var(--color-primary-dark, #2563eb);
}

.bzoSection .bzoButton {
  width: 100%;
  justify-content: center;
}

.bzoError {
  margin: 0.5rem 0 0 0;
  font-size: 0.85rem;
  color: var(--color-error, #ef4444);
}

.bzoResult {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border, #e5e7eb);
}

.bzoSummary {
  margin-bottom: 0.5rem;
}

.bzoRules {
  margin-top: 0.5rem;
}

.bzoFakten {
  margin-bottom: 1rem;
}

.bzoSuggestions {
  margin-top: 0.5rem;
}

.bzoMachbarkeit {
  margin-top: 0.75rem;
}

.machbarkeitSection {
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}

.machbarkeitSection h5 {
  margin: 0 0 0.25rem 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-secondary, #6b7280);
  text-transform: capitalize;
}

.machbarkeitSection ul {
  margin: 0;
  padding-left: 1rem;
  font-size: 0.9rem;
}

.rulesList {
  margin: 0.25rem 0 0 0;
  padding-left: 1.25rem;
  font-size: 0.9rem;
  color: var(--color-text, #111827);
}

.sourceHint {
  font-size: 0.8rem;
  color: var(--color-text-secondary, #6b7280);
  font-style: italic;
}

.workflowSection {
  font-weight: 600;
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
  color: var(--color-primary, #3b82f6);
}

.bzoZusatzinfo {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border, #e5e7eb);
}

.zusatzinfoList {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.zusatzinfoItem {
  background-color: var(--color-bg-secondary, #f9fafb);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
}

.zusatzinfoItem summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--color-text, #111827);
}

.zusatzinfoItem summary:hover {
  color: var(--color-primary, #3b82f6);
}

.zusatzinfoText {
  margin: 0.75rem 0 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border, #e5e7eb);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--color-text-secondary, #6b7280);
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 768px) {
  .panel {
    width: 100vw;
    max-width: 100vw;
  }
}

