/* ============================ verse popups (assets/verse-popup.js) ============================ */
.vref{ color: inherit; text-decoration: underline dotted var(--brass, #9C7F3F); text-decoration-thickness: 1.4px; text-underline-offset: 3px; cursor: pointer; }
.vref:hover, .vref[aria-expanded="true"]{ color: var(--forest-dark, #2C3626); text-decoration-style: solid; }
.vref:focus-visible{ outline: 2px solid var(--brass, #9C7F3F); outline-offset: 2px; border-radius: 2px; }

.vpop{
  position: fixed; z-index: 1500; display: flex; flex-direction: column;
  width: min(430px, calc(100vw - 16px)); max-height: min(60vh, 440px);
  background: var(--paper, #F1EFE7); color: var(--ink, #262519);
  border: 1px solid var(--line-strong, #C7BFA6); border-radius: 12px;
  box-shadow: 0 14px 38px rgba(0,0,0,.22), 0 2px 6px rgba(0,0,0,.10);
  font-size: .95rem; line-height: 1.55; text-align: left; font-weight: 400;
  animation: vpopIn .14s ease-out;
}
.vpop[hidden]{ display: none; }
@keyframes vpopIn{ from{ opacity: 0; transform: translateY(4px); } to{ opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce){ .vpop{ animation: none; } }

.vpop-head{ display: flex; align-items: center; gap: 10px; padding: 9px 8px 8px 16px; border-bottom: 1px solid var(--line, #D9D3C0); flex: none; }
.vpop-ref{ flex: 1; min-width: 0; font-weight: 600; color: var(--ink, #262519); }
.vpop-tr{ display: flex; gap: 2px; }
.vpop-tr button{ font: inherit; font-size: .74rem; letter-spacing: .06em; padding: 3px 8px; border: 1px solid transparent; border-radius: 999px; background: none; color: var(--ink-soft, #57544A); cursor: pointer; }
.vpop-tr button:hover{ border-color: var(--line-strong, #C7BFA6); }
.vpop-tr button[aria-pressed="true"]{ background: var(--paper-alt, #EAE5D6); border-color: var(--line-strong, #C7BFA6); color: var(--ink, #262519); font-weight: 600; }
.vpop-tr-one{ font-size: .74rem; letter-spacing: .08em; color: var(--ink-faint, #8A8674); text-transform: uppercase; }
.vpop-x{ flex: none; width: 30px; height: 30px; border: 0; border-radius: 50%; background: none; color: var(--ink-soft, #57544A); font-size: 1.35rem; line-height: 1; cursor: pointer; }
.vpop-x:hover{ background: var(--paper-alt, #EAE5D6); }

.vpop-body{ padding: 10px 16px 12px; overflow-y: auto; overscroll-behavior: contain; }
.vpop-text, .vpop-msg{ margin: 0; }
.vpop-msg{ color: var(--ink-soft, #57544A); font-style: italic; }
.vpop-n{ font-size: .7em; font-weight: 600; vertical-align: super; line-height: 0; color: var(--brass, #9C7F3F); margin-right: 2px; }
.vpop-ch{ display: inline-block; margin: 4px 0 2px; font-weight: 600; font-size: .85em; letter-spacing: .04em; color: var(--ink-soft, #57544A); }
.vpop-more{ color: var(--ink-faint, #8A8674); }
.vpop-foot{ flex: none; padding: 9px 16px 11px; border-top: 1px solid var(--line, #D9D3C0); font-size: .88rem; }
.vpop-foot a{ color: var(--forest, #3E4A34); font-weight: 600; text-decoration: none; }
.vpop-foot a:hover{ text-decoration: underline; }

/* phones and tablets: a sheet along the bottom of the screen */
.vpop.vpop-sheet{ left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 55vh; border-radius: 16px 16px 0 0; border-width: 1px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); animation-name: vpopUp; }
@keyframes vpopUp{ from{ transform: translateY(24px); opacity: 0; } to{ transform: none; opacity: 1; } }
@media (hover: none){ .vpop-x{ width: 38px; height: 38px; } .vpop-tr button{ padding: 6px 11px; } }

@media print{ .vpop{ display: none !important; } .vref{ text-decoration: none; } }

/* dark mode: a lighter, bordered surface so the popup doesn't melt into the page */
:root[data-theme="dark"] .vpop{
  background: #29261C; border-color: #5E5842;
  box-shadow: 0 -10px 36px rgba(0,0,0,.65), 0 14px 38px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.04);
}
:root[data-theme="dark"] .vpop-head, :root[data-theme="dark"] .vpop-foot{ border-color: #44402F; }
:root[data-theme="dark"] .vpop-tr button[aria-pressed="true"], :root[data-theme="dark"] .vpop-x:hover{ background: #3A3626; border-color: #5E5842; }
