.bv-dialog {
  box-sizing: border-box;
  width: min(1100px, calc(100% - 40px));
  height: min(94dvh, 1100px);
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 1px solid var(--line, #e5eef2);
  border-radius: 24px;
  background: var(--paper, #fff);
  color: var(--ink, #1e293b);
  box-shadow: 0 30px 100px #0005;
  overflow: hidden;
  overscroll-behavior: contain;
}
.bv-dialog[open] { display: flex; flex-direction: column; }
.bv-dialog::backdrop { background: #061424c9; backdrop-filter: blur(6px); }
.bv-dialog *, .bv-dialog *::before, .bv-dialog *::after { box-sizing: border-box; }
.bv-dialog button { -webkit-tap-highlight-color: transparent; }
.bv-header {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line, #e5eef2);
}
.bv-heading { flex: 1; min-width: 0; }
.bv-kicker { display: block; margin-bottom: 3px; color: var(--primary, #014c78); font-size: 10px; font-weight: 800; letter-spacing: 1.3px; }
.bv-title { margin: 0; font-size: 17px; line-height: 1.35; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.bv-header-actions { display: flex; align-items: center; gap: 8px; }
.bv-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  min-width: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line, #e5eef2);
  border-radius: 13px;
  color: var(--ink, #1e293b);
  background: var(--paper, #fff);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}
.bv-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.bv-button:hover { background: var(--soft, #f1f6f8); }
.bv-button:focus-visible, .bv-thumbnail:focus-visible { outline: 3px solid var(--turquoise, #00c5d4); outline-offset: 2px; }
.bv-button:disabled { opacity: .36; cursor: default; }
.bv-button[aria-pressed="true"] { color: #e14165; border-color: #e1416544; background: #e1416512; }
.bv-button[aria-pressed="true"] svg { fill: currentColor; }
.bv-close { background: var(--soft, #f1f6f8); }
.bv-stage { position: relative; flex: 1; min-height: 0; background: var(--bg, #f9fafb); overflow: hidden; }
.bv-viewport { position: absolute; inset: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.bv-viewport.is-dragging { cursor: grabbing; }
.bv-track { display: flex; height: 100%; width: 100%; transition: transform 280ms cubic-bezier(.22, .61, .36, 1); will-change: transform; }
.bv-track.is-dragging { transition: none; }
.bv-slide { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; flex: 0 0 100%; overflow: hidden; }
.bv-image { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; flex: 0 0 auto; object-fit: contain; transform-origin: center; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; touch-action: none; }
.bv-image.is-zooming { will-change: transform; }
.bv-image-error { max-width: 270px; padding: 24px; margin: 0; text-align: center; color: var(--muted, #6f7f89); font-size: 14px; line-height: 1.7; }
.bv-page-arrow { position: absolute; z-index: 2; top: 50%; transform: translateY(-50%); width: 44px; height: 52px; padding: 0; background: var(--paper, #fff); box-shadow: 0 3px 20px #0002; }
.bv-prev { left: 12px; }
.bv-next { right: 12px; }
.bv-page-indicator { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 2; padding: 7px 13px; border-radius: 999px; background: #152639e8; color: #fff; font-size: 12px; font-weight: 700; pointer-events: none; }
.bv-pagination { flex: none; padding: 10px 16px 8px; border-top: 1px solid var(--line, #e5eef2); }
.bv-hint { display: flex; justify-content: center; align-items: center; gap: 7px; margin: 0; color: var(--muted, #6f7f89); font-size: 11px; line-height: 1.5; }
.bv-hint svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bv-thumbnails { display: flex; align-items: center; justify-content: safe center; gap: 7px; overflow-x: auto; padding: 8px 2px 2px; scrollbar-width: thin; scrollbar-color: var(--line, #e5eef2) transparent; overscroll-behavior-x: contain; }
.bv-thumbnail { position: relative; display: flex; justify-content: center; width: 37px; height: 49px; flex: none; border: 2px solid transparent; border-radius: 6px; padding: 2px; background: var(--soft, #f1f6f8); cursor: pointer; }
.bv-thumbnail[aria-current="true"] { border-color: var(--primary, #014c78); background: var(--paper, #fff); }
.bv-thumbnail img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 2px; }
.bv-thumbnail span { position: absolute; right: -2px; bottom: -2px; min-width: 14px; padding: 2px; border-radius: 4px; background: var(--primary, #014c78); color: var(--on-primary, #fff); font-size: 8px; font-weight: 700; }
.bv-tools { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 20px 14px; }
.bv-zoom-tools { display: flex; align-items: center; gap: 5px; }
.bv-zoom-level { width: 43px; text-align: center; color: var(--muted, #6f7f89); font-size: 11px; font-variant-numeric: tabular-nums; }
.bv-share { color: var(--on-primary, #fff); background: var(--primary, #014c78); border-color: var(--primary, #014c78); }
.bv-share:hover { color: var(--on-primary, #fff); background: var(--primary, #014c78); filter: brightness(1.1); }
.bv-share-panel { flex: none; padding: 12px 20px; background: var(--soft, #f1f6f8); border-top: 1px solid var(--line, #e5eef2); }
.bv-share-panel label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 700; }
.bv-share-row { display: flex; gap: 8px; }
.bv-share-link { min-width: 0; width: 100%; border: 1px solid var(--line, #e5eef2); border-radius: 10px; background: var(--paper, #fff); color: var(--ink, #1e293b); padding: 10px; font: inherit; font-size: 12px; }
.bv-share-note { margin: 7px 0 0; color: var(--muted, #6f7f89); font-size: 11px; line-height: 1.5; }
.bv-status { margin: 0; padding: 0 20px; color: var(--primary, #014c78); font-size: 12px; text-align: center; }
.bv-status:not(:empty) { padding-bottom: 10px; }
.bv-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 600px) {
  .bv-dialog { width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
  .bv-header { gap: 9px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; }
  .bv-title { font-size: 14px; }
  .bv-kicker { font-size: 9px; }
  .bv-header-actions { gap: 5px; }
  .bv-header-actions .bv-button { padding: 10px; }
  .bv-page-arrow { top: auto; bottom: 8px; transform: none; width: 44px; height: 44px; }
  .bv-prev { left: 9px; }
  .bv-next { right: 9px; }
  .bv-page-indicator { bottom: 14px; }
  .bv-pagination { padding: 8px 10px 4px; }
  .bv-tools { gap: 6px; padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); }
  .bv-zoom-tools { gap: 3px; }
  .bv-zoom-level { width: 35px; font-size: 10px; }
  .bv-tools .bv-button { padding-inline: 10px; }
  .bv-tools .bv-reset { padding-inline: 8px; font-size: 11px; }
  .bv-share-panel { padding: 10px 12px; }
  .bv-share-note { font-size: 10px; }
}
@media (max-height: 520px) {
  .bv-header { padding-block: 7px; }
  .bv-pagination { padding-block: 5px; }
  .bv-thumbnails { display: none; }
  .bv-tools { padding-block: 6px; }
}
@media (max-width: 360px) {
  .bv-tools { gap: 4px; padding-inline: 8px; }
  .bv-zoom-level { width: 30px; }
  .bv-tools .bv-share { gap: 5px; padding-inline: 8px; font-size: 11px; }
  .bv-tools .bv-reset { gap: 4px; padding-inline: 6px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { .bv-track { transition: none; } }
