#open-pdf-map { margin-left: auto; border: 1px solid #bdd0df; border-radius: 6px; padding: 5px 9px; background: #fff; color: var(--blue); font-weight: 650; }
#preliminary-map-dialog { width: min(1600px, 97vw); height: 95vh; height: 95dvh; max-width: 100vw; max-height: 100dvh; padding: 0; border: 1px solid #a6b9c8; border-radius: 12px; color: var(--ink); box-shadow: var(--shadow); }
#preliminary-map-dialog[open] { display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
#preliminary-map-dialog::backdrop { background: rgb(19 37 55 / 62%); }
#preliminary-map-dialog [hidden] { display: none !important; }
.pdf-map-heading, .pdf-map-footer { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: white; }
.pdf-map-heading { justify-content: space-between; border-bottom: 1px solid var(--line); }
.pdf-map-heading h2 { margin: 0; font-size: 18px; }
.pdf-map-heading small, #pdf-save-state { color: var(--muted); overflow-wrap: anywhere; }
.pdf-map-body { display: grid; grid-template-columns: clamp(240px,22vw,330px) minmax(0,1fr); min-height: 0; }
.pdf-settings { min-height: 0; overflow: auto; padding: 16px; background: #fafcfd; }
.pdf-settings fieldset { min-width: 0; border: 0; border-bottom: 1px solid var(--line); padding: 0 0 14px; margin: 0 0 14px; }
.pdf-settings fieldset:last-child { border-bottom: 0; margin: 0; }
.pdf-settings legend { padding: 0; margin-bottom: 8px; font-weight: 650; }
.pdf-fields, .pdf-note > div { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 8px; }
.pdf-settings .field { margin-bottom: 8px; }
.pdf-settings .pdf-check { display: flex; align-items: center; gap: 7px; min-height: 30px; cursor: pointer; }
.pdf-check input { width: 16px; height: 16px; padding: 0; margin: 0; accent-color: var(--blue); }
#pdf-basemap-settings, #pdf-table-settings { margin: 6px 0 0; }
#pdf-transparency { width: 100%; padding: 0; accent-color: var(--blue); }
#pdf-transparency-value { float: right; font-variant-numeric: tabular-nums; }
.pdf-settings .meta { margin: 6px 0; }
.pdf-settings button, #pdf-map-close, #pdf-map-pages button, #pdf-map-retry { border: 1px solid var(--line); border-radius: 6px; padding: 5px 9px; background: white; color: var(--blue); font-size: 13px; }
#pdf-map-auto { margin: 0 0 10px; }
.pdf-note { margin: 0 0 12px; }
.pdf-note textarea { resize: vertical; min-height: 48px; }
.pdf-note > div button { margin-bottom: 8px; justify-self: end; }
.pdf-canvas { display: grid; place-items: center; min-width: 0; min-height: 0; overflow: hidden; background: #d9e0e7; }
.pdf-sheet { position: relative; background: white; box-shadow: 0 1px 8px #1d344838; }
.pdf-sheet > img, .pdf-hit-areas { position: absolute; inset: 0; height: 100%; width: 100%; }
.pdf-hit-areas { pointer-events: none; }
.pdf-drag { position: absolute; pointer-events: auto; touch-action: none; user-select: none; min-width: 1px; min-height: 1px; margin: 0; border: 1px dashed #2874ab80; padding: 0; background: transparent; cursor: grab; }
.pdf-drag:hover, .pdf-drag:focus-visible, .pdf-drag.dragging { outline: 2px dashed #1767ad; background: #2495d118; }
.pdf-drag.dragging { cursor: grabbing; }
.pdf-map-footer { border-top: 1px solid var(--line); flex-wrap: wrap; }
.pdf-map-feedback { flex: 1 1 180px; min-width: 0; font-size: 13px; }
#pdf-save-state { display: block; }
#pdf-map-pages { display: flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 13px; }
@media (max-width: 720px) {
  #preliminary-map-dialog { width: 100vw; height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .pdf-map-heading, .pdf-map-footer { padding: 8px 10px; gap: 6px; }
  .pdf-map-heading h2 { font-size: 16px; }
  .pdf-map-body { grid-template-columns: 1fr; grid-template-rows: minmax(120px, 40%) minmax(0, 1fr); }
  .pdf-canvas { grid-row: 1; }
  .pdf-settings { grid-row: 2; padding: 10px; }
  .pdf-map-feedback { flex-basis: 65%; }
}
