/* 100MCQs — Accessible Educational Diagram Viewer v1.1 (UI-F02-FIX1: native <dialog>) */
.dv-enlarge-btn {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 10px; min-height: 44px; padding: 8px 14px;
  font: inherit; font-weight: 600; font-size: .92rem;
  color: #0a5c48; background: #eef4f1; border: 1px solid #0e7a5f;
  border-radius: 10px; cursor: pointer;
}
.dv-enlarge-btn::before { content: "🔍"; font-size: 1rem; }
.dv-enlarge-btn:hover, .dv-enlarge-btn:focus-visible { background: #dcefe7; }
.dv-enlarge-btn:focus-visible, .dv-btn-ctl:focus-visible, .dv-viewport:focus-visible { outline: 3px solid #f4b942; outline-offset: 2px; }

/* The viewer is a native <dialog> shown with showModal(): the browser traps
   focus inside it and makes the background inert. */
dialog.dv-dialog {
  border: none; padding: 0; margin: auto;
  background: #fff; color: #17233b; border-radius: 14px;
  width: min(1100px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
  overflow: hidden;
}
dialog.dv-dialog[open] { display: flex; flex-direction: column; }
dialog.dv-dialog::backdrop { background: rgba(10, 18, 32, .78); }

.dv-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; padding: 10px 12px;
  border-bottom: 1px solid #dde5ee; background: #f7fafc;
}
.dv-title { font-weight: 700; font-size: 1rem; }
.dv-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dv-btn-ctl {
  min-width: 44px; min-height: 44px; padding: 8px 12px;
  font: inherit; font-weight: 700; font-size: 1rem;
  color: #17233b; background: #fff; border: 1px solid #b9c6da;
  border-radius: 10px; cursor: pointer;
}
.dv-btn-ctl:hover { background: #eef4f1; border-color: #0e7a5f; }
.dv-zoom-label { min-width: 48px; text-align: center; font-weight: 600; color: #44546c; }
.dv-viewport {
  overflow: auto; padding: 14px; background: #fbfcfe;
  -webkit-overflow-scrolling: touch;
}
.dv-stage { margin: 0 auto; }
.dv-stage svg { width: 100%; height: auto; display: block; }
.dv-caption {
  margin: 0; padding: 10px 14px; font-size: .92rem; line-height: 1.5;
  color: #44546c; border-top: 1px solid #dde5ee; background: #fff;
}
.dv-caption:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
  dialog.dv-dialog { transition: none; animation: none; }
}
