/* Lean overlay styles for the native modal/popover runtime. */

:root {
  --mley-overlay-touch-size: 44px;
  --mley-overlay-heading-padding: .25rem .375rem;
  --mley-overlay-mobile-radius: 18px;
  --mley-overlay-safe-left: env(safe-area-inset-left, 0px);
  --mley-overlay-safe-right: env(safe-area-inset-right, 0px);
  --mley-overlay-safe-top: env(safe-area-inset-top, 0px);
  --mley-overlay-safe-bottom: env(safe-area-inset-bottom, 0px);
  --mley-overlay-gap-x: max(12px, var(--mley-overlay-safe-left), var(--mley-overlay-safe-right));
  --mley-overlay-gap-y: max(12px, var(--mley-overlay-safe-top), var(--mley-overlay-safe-bottom));
}

.modal.mley-article-window {
  overflow: visible;
  inset: auto;
  max-width: none;
  padding: 0;
}
.mley-article-window[hidden], .mley-article-dock[hidden], .mley-window-control[hidden] { display: none !important; }
.mley-article-window .modal-dialog {
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0;
  transform: none !important; transition: none;
}
.mley-article-window .modal-content {
  height: 100%; max-height: none; min-width: 0;
  box-shadow: 0 8px 26px #0002;
}
.modal.mley-article-window.is-active .modal-content {
  border-color: var(--accent-color, #0d52bf); box-shadow: 0 14px 38px #0003;
}
.mley-article-window .modal-header {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
  position: relative;
  flex-shrink: 0; align-items: center; gap: .5rem; padding: .4375rem .5rem;
  cursor: grab; touch-action: none;
}
.mley-article-window .modal-title { display: flex; align-items: center; gap: .3rem; flex: 1; min-width: 0; margin: 0; font-size: .88rem; line-height: 1.25; overflow: visible; }
.mley-window-article { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; color: var(--text-color, #1f2d3d); }
.mley-window-control-help.mley-window-law-help { position: static; min-width: 0; max-width: 45%; flex-shrink: 1; }
.mley-window-law {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 0; border-bottom: 1px dotted var(--text-muted, #667789); border-radius: 0;
  background: transparent; color: var(--text-muted, #667789); padding: 2px 0; font: inherit; cursor: pointer;
}
.mley-window-law:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 2px; }
.mley-window-law-help .mley-window-control-tooltip { left: 8px; right: auto; width: min(300px, calc(100% - 16px)); }
.mley-window-primary-actions { display: flex; align-items: center; gap: .3rem; flex-shrink: 0; }
.mley-window-primary-actions:empty { display: none; }
.mley-article-window .mley-view-pdf-action { margin: 0; gap: 0; flex-wrap: nowrap; }
.mley-article-window .mley-window-primary-actions .btn,
.mley-article-window .mley-window-primary-actions .mley-view-pdf {
  height: 32px; min-height: 32px; max-width: 88px; margin: 0; padding: .25rem .5rem;
  border: 1px solid var(--border-color, #dce3eb); border-radius: 7px;
  font-weight: 500; font-family: inherit; font-size: .76rem; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mley-window-primary-actions .mley-view-pdf-label { overflow: hidden; text-overflow: ellipsis; }
.mley-article-window .mley-window-primary-actions [data-overlay-button="go-to-article"] { display: inline-flex; align-items: center; max-width: none; flex-shrink: 0; text-decoration: none; }
.mley-window-actions {
  position: absolute; top: calc(100% + 4px); right: 8px; z-index: 6;
  width: 248px; max-width: calc(100% - 16px); overflow: auto; overscroll-behavior: contain;
  padding: .35rem; border: 1px solid var(--border-color, #dce3eb); border-radius: 10px;
  background: var(--bg-surface-2, #f8fafc); color: var(--text-color, #1f2d3d); box-shadow: 0 8px 26px #0002; cursor: default;
}
.mley-window-actions[hidden] { display: none !important; }
.mley-window-actions [hidden] { display: none !important; }
.mley-window-menu-primary:empty { display: none; }
.mley-window-menu-primary:not(:empty) { padding-bottom: .3rem; margin-bottom: .3rem; border-bottom: 1px solid var(--border-color, #dce3eb); }
.mley-window-actions .mley-view-pdf-action { display: flex; width: 100%; }
.mley-article-window .mley-window-actions button,
.mley-article-window .mley-window-actions a[href] {
  display: flex; justify-content: flex-start; align-items: center; width: 100%; min-height: 38px;
  margin: 0; padding: .5rem .65rem; border: 0; border-radius: 6px; background: transparent;
  color: inherit; font: inherit; font-size: .8rem; line-height: 1.3; text-align: left; text-decoration: none; white-space: normal; cursor: pointer;
}
.mley-article-window .mley-window-actions button:hover,
.mley-article-window .mley-window-actions a[href]:hover { background: var(--accent-color-soft, #edf4fc); color: var(--accent-color, #0d52bf); }
.mley-window-actions button:focus-visible,
.mley-window-actions a[href]:focus-visible { outline: 2px solid var(--accent-color); outline-offset: -2px; }
.mley-article-window .modal-title .mley-modal-law-name {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.mley-article-window .modal-body { min-height: 0; overscroll-behavior: contain; }
.mley-article-window[data-window-kind="article"] .modal-body { overflow-wrap: anywhere; }
.mley-article-window .modal-body img { max-width: 100%; height: auto; }
.mley-article-window .modal-body table { display: block; max-width: 100%; overflow-x: auto; }
.mley-article-window .modal-footer { flex-shrink: 0; gap: .4rem; padding: .6rem 1rem; }
.mley-article-window__controls { display: flex; gap: .15rem; flex-shrink: 0; align-items: center; }
.mley-window-control-help { position: relative; display: inline-flex; }
.mley-window-control-tooltip {
  position: absolute; top: 100%; right: 0; z-index: 4; width: 230px;
  padding: .65rem .8rem; border: 1px solid var(--border-color); border-radius: 9px;
  background: var(--bg-surface-2, #f8fafc); color: var(--text-color, #1f2d3d);
  box-shadow: 0 5px 16px #0002; font: 400 .78rem/1.5 "Comfortaa", sans-serif;
  text-align: left; cursor: default;
}
.mley-window-control-tooltip[hidden] { display: none !important; }
.mley-article-window .mley-window-control {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; margin: 0;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--text-muted, #667789); font: 22px/1 system-ui, sans-serif; cursor: pointer; opacity: 1;
}
.mley-article-window .mley-window-control:hover,
.mley-article-window .mley-window-control[aria-pressed="true"] { background: var(--accent-color-soft); color: var(--accent-color); }
.mley-window-control:focus-visible, .mley-article-dock button:focus-visible { outline: 2px solid var(--accent-color); outline-offset: -2px; }
.mley-article-window .mley-window-pin { width: var(--mley-overlay-touch-size, 44px); font-size: .78rem; font-weight: 650; letter-spacing: .02em; }
.mley-window-pin[aria-pressed="true"]::before { content: ""; width: 5px; height: 5px; margin-right: 4px; border-radius: 50%; background: currentColor; }
.mley-window-pin-help { position: static; }
.mley-window-pin + .mley-window-control-tooltip { right: auto; left: 12px; width: min(260px, calc(100% - 24px)); }
.mley-pin-recovery {
  position: fixed; z-index: 1049; box-sizing: border-box; max-width: calc(100vw - 24px);
  padding: 1rem 2.4rem 1rem 1rem; border: 1px solid var(--border-color, #dce3eb); border-radius: 12px;
  background: var(--bg-surface-2, #f8fafc); color: var(--text-color, #1f2d3d); box-shadow: 0 8px 26px #0002;
  font-size: .85rem; overflow-wrap: anywhere;
}
.mley-pin-recovery p { margin: .5rem 0; }
.mley-pin-recovery button { cursor: pointer; color: var(--accent-color, #0d52bf); background: transparent; border: 0; border-radius: 6px; padding: .5rem; }
.mley-pin-recovery__close { position: absolute; right: .25rem; top: .25rem; font-size: 1.25rem; min-width: 36px; min-height: 36px; }
.mley-pin-recovery button:focus-visible { outline: 2px solid var(--accent-color, #0d52bf); }
.mley-window-adjusting { user-select: none; }
.mley-window-adjusting iframe { pointer-events: none; }
.mley-article-window.is-adjusting .modal-header { cursor: grabbing; }
.mley-window-resize { position: absolute; z-index: 2; touch-action: none; }
.mley-window-resize--n, .mley-window-resize--s { left: 12px; right: 12px; height: 10px; cursor: ns-resize; }
.mley-window-resize--n { top: -4px; } .mley-window-resize--s { bottom: -4px; }
.mley-window-resize--e, .mley-window-resize--w { top: 12px; bottom: 12px; width: 10px; cursor: ew-resize; }
.mley-window-resize--e { right: -4px; } .mley-window-resize--w { left: -4px; }
.mley-window-resize--ne, .mley-window-resize--nw, .mley-window-resize--se, .mley-window-resize--sw { width: 18px; height: 18px; }
.mley-window-resize--ne { right: -4px; top: -4px; cursor: nesw-resize; }
.mley-window-resize--nw { left: -4px; top: -4px; cursor: nwse-resize; }
.mley-window-resize--se { right: -4px; bottom: -4px; cursor: nwse-resize; }
.mley-window-resize--sw { left: -4px; bottom: -4px; cursor: nesw-resize; }
.mley-window-resize--se::after { content: ""; position: absolute; right: 8px; bottom: 8px; width: 7px; height: 7px; border-right: 2px solid var(--text-subtle); border-bottom: 2px solid var(--text-subtle); border-radius: 0 0 2px; }
.mley-article-dock {
  z-index: 1050;
  position: fixed; bottom: 0; left: 0; right: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: .5rem;
  padding: .5rem max(.75rem, env(safe-area-inset-right)) max(.5rem, env(safe-area-inset-bottom)) max(.75rem, env(safe-area-inset-left));
  background: var(--bg-surface, #fff); color: var(--text-color, #273445);
  border-top: 1px solid var(--border-color, #dbe2ea); box-shadow: 0 -4px 18px #0001;
  overscroll-behavior-x: contain;
}
.mley-article-dock__bar { display: flex; align-items: center; gap: .5rem; min-width: 0; min-height: 40px; }
.mley-article-dock__bar > * { flex: 0 0 auto; max-width: 100%; min-width: 0; }
.mley-article-dock__measure { position: fixed; top: -10000px; left: 0; width: 10000px; display: flex; gap: .5rem; visibility: hidden; pointer-events: none; }
.mley-article-dock__item { display: flex; flex: 0 0 auto; max-width: 290px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-surface-2); }
.mley-article-dock button { border: 0; background: transparent; color: inherit; cursor: pointer; min-height: 40px; border-radius: 9px; }
.mley-article-dock button:hover { background: var(--accent-color-soft); color: var(--accent-color); }
.mley-article-dock button[aria-busy="true"] { cursor: progress; opacity: .65; }
.mley-article-dock button.mley-article-dock__save { min-height: var(--mley-overlay-touch-size, 44px); padding: .4rem .8rem; font-size: .85rem; font-weight: 700; background: var(--accent-color-soft); color: var(--accent-color); white-space: nowrap; }
.mley-article-dock button:disabled { cursor: wait; opacity: .65; }
.mley-article-dock__restore { padding: .4rem .7rem; font-size: .85rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mley-article-dock__item.is-open { box-shadow: inset 0 -3px var(--accent-color); }
.mley-article-dock__item.is-open .mley-article-dock__restore { color: var(--accent-color); }
.mley-article-dock__close { flex: 0 0 36px; font: 22px/1 system-ui, sans-serif; }
/* Loading uses the existing close-button space without resizing the dock. */
.mley-article-dock__restore[aria-busy="true"] + .mley-article-dock__close { position: relative; font-size: 0; }
.mley-article-dock__restore[aria-busy="true"] + .mley-article-dock__close::after {
  content: ""; position: absolute; top: calc(50% - 7px); left: calc(50% - 7px);
  width: 14px; height: 14px; box-sizing: border-box; border: 2px solid currentColor;
  border-right-color: transparent; border-radius: 50%; animation: mley-dock-spin .7s linear infinite;
}
.mley-article-dock__restore[aria-busy="true"] ~ .dof-reader-message { display: none; }
@keyframes mley-dock-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .mley-article-dock__restore[aria-busy="true"] + .mley-article-dock__close::after { animation: none; }
}
.mley-article-dock button.mley-article-dock__group {
  display: inline-flex; align-items: center; gap: .5rem; flex: 0 0 auto; max-width: 240px;
  padding: .4rem .7rem; border: 1px solid var(--border-color); background: var(--bg-surface-2);
  font-size: .85rem; font-weight: 700;
}
.mley-article-dock__group-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mley-article-dock__count { flex: 0 0 auto; min-width: 1.5rem; padding: .1rem .35rem; border-radius: 999px; background: var(--accent-color-soft, #eef4fb); color: var(--accent-color, #0d52bf); font-size: .75rem; }
.mley-article-dock button[aria-expanded="true"] { border-color: var(--accent-color); color: var(--accent-color); }
.mley-article-dock__popup {
  position: fixed; display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--border-color, #dbe2ea); border-radius: 12px;
  background: var(--bg-surface, #fff); color: var(--text-color, #273445); box-shadow: 0 8px 30px #0003;
}
.mley-article-dock__popup[hidden] { display: none !important; }
.mley-article-dock__popup > header { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; padding: .35rem .6rem .35rem .9rem; border-bottom: 1px solid var(--border-color); }
.mley-article-dock__popup h2 { flex: 1; margin: 0; font-size: .85rem; font-weight: 700; line-height: 1.5; }
.mley-article-dock__popup-close { flex: 0 0 40px; font: 22px/1 system-ui, sans-serif; }
.mley-article-dock__popup-body { min-height: 0; padding: .35rem .5rem .5rem; overflow-y: auto; overscroll-behavior: contain; }
.mley-article-dock__popup-body > section + section { margin-top: .4rem; padding-top: .4rem; border-top: 1px solid var(--border-color); }
.mley-article-dock__law { margin: 0; padding: .5rem .4rem; font-size: .78rem; font-weight: 700; line-height: 1.6; overflow-wrap: anywhere; color: var(--text-muted, #667789); }
.mley-article-dock__item.is-in-popup { width: 100%; max-width: none; border: 0; background: transparent; border-radius: 8px; }
.mley-article-dock__item.is-in-popup .mley-article-dock__restore { flex: 1; min-width: 0; text-align: left; font-weight: 400; }
.mley-article-dock__item.is-in-popup .mley-article-dock__close { flex-basis: 40px; }
body.mley-has-article-dock { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
.mley-has-article-dock .mley-pdf-panel { bottom: calc(68px + env(safe-area-inset-bottom)); }
.mley-article-window--mobile .modal-header { cursor: default; touch-action: auto; }
.mley-article-window--mobile .mley-window-resize { display: none; }
.mley-article-window--mobile .mley-window-control { width: var(--mley-overlay-touch-size, 44px); height: var(--mley-overlay-touch-size, 44px); }
.mley-article-window--mobile .mley-window-law-help { min-width: var(--mley-overlay-touch-size, 44px); }
.mley-article-window--mobile .mley-window-law { min-width: var(--mley-overlay-touch-size, 44px); min-height: var(--mley-overlay-touch-size, 44px); }
.mley-article-window--mobile .mley-window-article[href] { min-width: var(--mley-overlay-touch-size, 44px); min-height: var(--mley-overlay-touch-size, 44px); line-height: var(--mley-overlay-touch-size, 44px); }
.mley-article-window--mobile .modal-header { padding: var(--mley-overlay-heading-padding, .25rem .375rem); gap: .375rem; }
.mley-article-window--mobile .modal-body { padding: .65rem; }
.mley-article-window--mobile .modal-title { font-size: .8rem; gap: .2rem; }
.mley-article-window--mobile .mley-window-actions {
  position: relative; inset: auto; order: 1; grid-column: 1 / -1; width: 100%; max-width: 100%;
  margin: 0; box-shadow: none;
}
.mley-article-window--mobile .mley-window-actions button,
.mley-article-window--mobile .mley-window-actions a[href] { min-height: var(--mley-overlay-touch-size, 44px); touch-action: manipulation; }
.mley-article-window--mobile .modal-footer { padding: .5rem .65rem; }
@media (prefers-reduced-motion: reduce) { .mley-article-window, .mley-article-window * { scroll-behavior: auto !important; } }

body.modal-open {
  overflow: hidden;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1050;
  display: none;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
}

.modal.show {
  display: block;
}

.modal:not(.mley-article-window) {
  box-sizing: border-box;
  padding: var(--mley-overlay-gap-y) var(--mley-overlay-gap-x);
  height: 100dvh;
  overflow: hidden;
}

.modal.show:not(.mley-article-window) { display: grid; place-items: center; }
.modal:not(.mley-article-window) :is(.modal-dialog, .modal-content) {
  max-height: calc(var(--mley-modal-viewport-height, 100dvh) - var(--mley-overlay-gap-y) * 2);
}

.modal.fade .modal-dialog {
  transform: translate(0, -24px);
  transition: transform 0.25s ease-out;
}

.modal.show .modal-dialog,
.modal.modal-static .modal-dialog {
  transform: none;
}

.modal-dialog {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 780px;
  min-width: 0;
  max-height: 100%;
  margin: 0;
  pointer-events: none;
}

.modal-dialog-scrollable {
  display: flex;
  max-height: 100%;
}

.modal-dialog-scrollable .modal-content {
  max-height: 100%;
  overflow: hidden;
}

.modal-dialog-scrollable .modal-body {
  overflow-y: auto;
}

.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: 0;
}

.modal-content {
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  max-height: 100%;
  pointer-events: auto;
  background: #ffffff;
  color: #273445;
  background-clip: padding-box;
  border: 1px solid rgba(39, 52, 69, 0.14);
  border-radius: var(--mley-overlay-mobile-radius, 18px);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.24);
}

.modal-header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(39, 52, 69, 0.08);
}

.modal-header .close {
  margin-left: auto;
  flex-shrink: 0;
}

.modal-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
  line-height: 1.3;
}

.modal-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-wrap: anywhere;
  padding: 1rem;
}

.modal-footer {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid rgba(39, 52, 69, 0.08);
}

.modal-footer > * {
  margin: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(8, 14, 22, 0.48);
}

.modal-backdrop.fade {
  opacity: 0;
}

.modal-backdrop.show,
.modal-backdrop.in {
  opacity: 1;
}

.modal-lg {
  max-width: 820px;
}

.modal-sm {
  max-width: 320px;
}

.close {
  appearance: none;
  border: 0;
  background: transparent;
  color: #273445;
  font-size: 1.6rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  opacity: 0.72;
  text-shadow: none;
}

.close:hover,
.close:focus {
  color: #273445;
  opacity: 1;
  text-decoration: none;
}

.popover {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1060;
  display: block;
  max-width: 320px;
  font-family: "Comfortaa", sans-serif;
  font-size: 14px;
  text-align: left;
  background: #ffffff;
  color: #273445;
  background-clip: padding-box;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
}

.popover-header {
  padding: 0.7rem 0.9rem;
  margin-bottom: 0;
  font-size: 0.95rem;
  font-weight: 700;
  background: #f5f8fc;
  border-bottom: 1px solid #dbe2ea;
  border-top-left-radius: calc(12px - 1px);
  border-top-right-radius: calc(12px - 1px);
}

.popover-body {
  padding: 10px;
}

.popover-body.mley-popover-actions-body {
  align-items: center;
  display: flex;
  gap: 0.35rem;
  padding: 0.45rem 0.55rem;
}

.popover .popover-body .s-share {
  align-items: center;
  border-radius: 999px;
  color: #31445c;
  cursor: pointer;
  border: none;
  background: transparent;
  display: inline-flex;
  height: 2.5rem;
  justify-content: center;
  margin: 0;
  padding: 0;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
  width: 2.5rem;
}

.popover .popover-body .s-share:hover,
.popover .popover-body .s-share:focus {
  background-color: #eef4fb;
  color: #0d52bf;
  outline: none;
  transform: translateY(-1px);
}

.popover .popover-body .s-share .mley-icon-svg {
  height: 1.3rem;
  width: 1.3rem;
}

.popover .popover-body .close {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  height: 2.5rem;
  justify-content: center;
  margin: 0 0 0 0.15rem;
  padding: 0;
  width: 2.5rem;
  cursor: pointer;
}

.popover .popover-body .close:hover,
.popover .popover-body .close:focus {
  background-color: #eef4fb;
  outline: none;
}

.popover .arrow {
  position: absolute;
  display: block;
  width: 1rem;
  height: 0.5rem;
}

.popover .arrow::before,
.popover .arrow::after {
  position: absolute;
  display: block;
  content: "";
  border-style: solid;
  border-color: transparent;
}

.bs-popover-auto[x-placement^="top"],
.bs-popover-top {
  margin-bottom: 0.5rem;
}

.bs-popover-auto[x-placement^="top"] .arrow,
.bs-popover-top .arrow {
  bottom: calc((0.5rem + 1px) * -1);
}

.bs-popover-auto[x-placement^="top"] .arrow::before,
.bs-popover-top .arrow::before {
  border-width: 0.5rem 0.5rem 0;
  border-top-color: #dbe2ea;
}

.bs-popover-auto[x-placement^="top"] .arrow::after,
.bs-popover-top .arrow::after {
  bottom: 1px;
  border-width: 0.5rem 0.5rem 0;
  border-top-color: #ffffff;
}

.bs-popover-auto[x-placement^="right"],
.bs-popover-right {
  margin-left: 0.5rem;
}

.bs-popover-auto[x-placement^="right"] .arrow,
.bs-popover-right .arrow {
  left: calc((0.5rem + 1px) * -1);
  width: 0.5rem;
  height: 1rem;
}

.bs-popover-auto[x-placement^="right"] .arrow::before,
.bs-popover-right .arrow::before {
  border-width: 0.5rem 0.5rem 0.5rem 0;
  border-right-color: #dbe2ea;
}

.bs-popover-auto[x-placement^="right"] .arrow::after,
.bs-popover-right .arrow::after {
  left: 1px;
  border-width: 0.5rem 0.5rem 0.5rem 0;
  border-right-color: #ffffff;
}

.bs-popover-auto[x-placement^="bottom"],
.bs-popover-bottom {
  margin-top: 0.5rem;
}

.bs-popover-auto[x-placement^="bottom"] .arrow,
.bs-popover-bottom .arrow {
  top: calc((0.5rem + 1px) * -1);
}

.bs-popover-auto[x-placement^="bottom"] .arrow::before,
.bs-popover-bottom .arrow::before {
  border-width: 0 0.5rem 0.5rem;
  border-bottom-color: #dbe2ea;
}

.bs-popover-auto[x-placement^="bottom"] .arrow::after,
.bs-popover-bottom .arrow::after {
  top: 1px;
  border-width: 0 0.5rem 0.5rem;
  border-bottom-color: #ffffff;
}

.bs-popover-auto[x-placement^="left"],
.bs-popover-left {
  margin-right: 0.5rem;
}

.bs-popover-auto[x-placement^="left"] .arrow,
.bs-popover-left .arrow {
  right: calc((0.5rem + 1px) * -1);
  width: 0.5rem;
  height: 1rem;
}

.bs-popover-auto[x-placement^="left"] .arrow::before,
.bs-popover-left .arrow::before {
  border-width: 0.5rem 0 0.5rem 0.5rem;
  border-left-color: #dbe2ea;
}

.bs-popover-auto[x-placement^="left"] .arrow::after,
.bs-popover-left .arrow::after {
  right: 1px;
  border-width: 0.5rem 0 0.5rem 0.5rem;
  border-left-color: #ffffff;
}

.tooltip {
  position: absolute;
  z-index: 1070;
  display: block;
  margin: 0;
  opacity: 0;
  font-family: "Comfortaa", sans-serif;
  font-size: 0.8rem;
}

.tooltip.show {
  opacity: 0.96;
}

.tooltip .arrow {
  position: absolute;
  display: block;
  width: 0.8rem;
  height: 0.4rem;
}

.tooltip .arrow::before {
  position: absolute;
  content: "";
  border-color: transparent;
  border-style: solid;
}

.tooltip-inner {
  max-width: 220px;
  padding: 0.35rem 0.5rem;
  color: #ffffff;
  text-align: center;
  background: rgba(17, 24, 39, 0.92);
  border-radius: 0.45rem;
}

.bs-tooltip-top,
.bs-tooltip-auto[x-placement^="top"] {
  padding: 0.4rem 0;
}

.bs-tooltip-top .arrow,
.bs-tooltip-auto[x-placement^="top"] .arrow {
  bottom: 0;
}

.bs-tooltip-top .arrow::before,
.bs-tooltip-auto[x-placement^="top"] .arrow::before {
  top: 0;
  border-width: 0.4rem 0.4rem 0;
  border-top-color: rgba(17, 24, 39, 0.92);
}

.bs-tooltip-right,
.bs-tooltip-auto[x-placement^="right"] {
  padding: 0 0.4rem;
}

.bs-tooltip-right .arrow,
.bs-tooltip-auto[x-placement^="right"] .arrow {
  left: 0;
  width: 0.4rem;
  height: 0.8rem;
}

.bs-tooltip-right .arrow::before,
.bs-tooltip-auto[x-placement^="right"] .arrow::before {
  right: 0;
  border-width: 0.4rem 0.4rem 0.4rem 0;
  border-right-color: rgba(17, 24, 39, 0.92);
}

.bs-tooltip-bottom,
.bs-tooltip-auto[x-placement^="bottom"] {
  padding: 0.4rem 0;
}

.bs-tooltip-bottom .arrow,
.bs-tooltip-auto[x-placement^="bottom"] .arrow {
  top: 0;
}

.bs-tooltip-bottom .arrow::before,
.bs-tooltip-auto[x-placement^="bottom"] .arrow::before {
  bottom: 0;
  border-width: 0 0.4rem 0.4rem;
  border-bottom-color: rgba(17, 24, 39, 0.92);
}

.bs-tooltip-left,
.bs-tooltip-auto[x-placement^="left"] {
  padding: 0 0.4rem;
}

.bs-tooltip-left .arrow,
.bs-tooltip-auto[x-placement^="left"] .arrow {
  right: 0;
  width: 0.4rem;
  height: 0.8rem;
}

.bs-tooltip-left .arrow::before,
.bs-tooltip-auto[x-placement^="left"] .arrow::before {
  left: 0;
  border-width: 0.4rem 0 0.4rem 0.4rem;
  border-left-color: rgba(17, 24, 39, 0.92);
}

:root[data-theme="dark"] .popover {
  background: #1f2b38;
  border-color: #314150;
  color: #e6edf5;
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.38);
}

:root[data-theme="dark"] .popover-header {
  background: #263645;
  color: #e6edf5;
  border-bottom-color: #314150;
}

:root[data-theme="dark"] .popover .popover-body .s-share,
:root[data-theme="dark"] .popover .popover-body .close,
:root[data-theme="dark"] .close {
  color: #e6edf5;
}

:root[data-theme="dark"] .popover .popover-body .s-share:hover,
:root[data-theme="dark"] .popover .popover-body .s-share:focus,
:root[data-theme="dark"] .popover .popover-body .close:hover,
:root[data-theme="dark"] .popover .popover-body .close:focus {
  background-color: #2b3a49;
  color: #ffffff;
}

:root[data-theme="dark"] .bs-popover-top .arrow::before,
:root[data-theme="dark"] .bs-popover-auto[x-placement^="top"] .arrow::before {
  border-top-color: #314150;
}

:root[data-theme="dark"] .bs-popover-top .arrow::after,
:root[data-theme="dark"] .bs-popover-auto[x-placement^="top"] .arrow::after {
  border-top-color: #1f2b38;
}

:root[data-theme="dark"] .bs-popover-right .arrow::before,
:root[data-theme="dark"] .bs-popover-auto[x-placement^="right"] .arrow::before {
  border-right-color: #314150;
}

:root[data-theme="dark"] .bs-popover-right .arrow::after,
:root[data-theme="dark"] .bs-popover-auto[x-placement^="right"] .arrow::after {
  border-right-color: #1f2b38;
}

:root[data-theme="dark"] .bs-popover-bottom .arrow::before,
:root[data-theme="dark"] .bs-popover-auto[x-placement^="bottom"] .arrow::before {
  border-bottom-color: #314150;
}

:root[data-theme="dark"] .bs-popover-bottom .arrow::after,
:root[data-theme="dark"] .bs-popover-auto[x-placement^="bottom"] .arrow::after {
  border-bottom-color: #1f2b38;
}

:root[data-theme="dark"] .bs-popover-left .arrow::before,
:root[data-theme="dark"] .bs-popover-auto[x-placement^="left"] .arrow::before {
  border-left-color: #314150;
}

:root[data-theme="dark"] .bs-popover-left .arrow::after,
:root[data-theme="dark"] .bs-popover-auto[x-placement^="left"] .arrow::after {
  border-left-color: #1f2b38;
}

:root[data-theme="dark"] .modal-content {
  background: #1f2b38;
  color: #e6edf5;
  border-color: #314150;
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.38);
}

:root[data-theme="dark"] .modal-header,
:root[data-theme="dark"] .modal-footer {
  border-color: #314150;
}

:root[data-theme="dark"] .close:hover,
:root[data-theme="dark"] .close:focus,
:root[data-theme="dark"] .bootbox-close-button:hover,
:root[data-theme="dark"] .bootbox-close-button:focus {
  color: #e6edf5;
}

@media (max-width: 767px), (max-width: 1099px) and (max-height: 500px) and (pointer: coarse) {
  .modal-header { box-sizing: border-box; min-height: 53px; gap: .375rem; padding: var(--mley-overlay-heading-padding, .25rem .375rem); }
  .modal-title { font-size: .85rem; }
  .modal-header .close { width: var(--mley-overlay-touch-size, 44px); height: var(--mley-overlay-touch-size, 44px); padding: 0; margin: 0; }
  .modal .modal-footer > :is(button, a[href]) { min-width: var(--mley-overlay-touch-size, 44px); min-height: var(--mley-overlay-touch-size, 44px); }
}
