/* Shared hint presentation for pages that opt into the Hypatia design.
   Keep role selection in layout.pug so additional roles can reuse this unchanged.
   Bootstrap retains placement, visibility, triggers, and rich-content rendering. */
body[data-hypatia-design="modern"] {
  --ht-hint-bg: var(--ht-paper, #fff);
  --ht-hint-ink: var(--ht-ink, #293743);
  --ht-hint-line: var(--ht-line, #e3e7eb);
  --ht-hint-accent: var(--ht-blue, #146397);
  --ht-hint-shadow: 0 8px 28px #172f421a, 0 2px 6px #172f420a;
  --ht-hint-radius: 10px;
  --ht-hint-font: 400 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body[data-hypatia-design="modern"] :is(.tooltip, .popover) {
  font: var(--ht-hint-font);
  letter-spacing: normal;
  text-transform: none;
  text-align: left;
  overflow-wrap: anywhere;
}
/* The native green tooltip rules use !important. Override only their visuals. */
body[data-hypatia-design="modern"] .tooltip > .tooltip-inner {
  max-width: min(320px, calc(100vw - 32px)) !important;
  padding: 11px 14px;
  background-color: var(--ht-hint-bg) !important;
  color: var(--ht-hint-ink) !important;
  border: 1px solid var(--ht-hint-line) !important;
  border-radius: var(--ht-hint-radius) !important;
  box-shadow: var(--ht-hint-shadow);
  font: inherit;
  text-align: left;
  white-space: normal;
}
body[data-hypatia-design="modern"] .tooltip:is(.bs-tooltip-top, .bs-tooltip-auto[x-placement^="top"]) > .arrow::before { border-top-color: var(--ht-hint-line) !important; }
body[data-hypatia-design="modern"] .tooltip:is(.bs-tooltip-right, .bs-tooltip-auto[x-placement^="right"]) > .arrow::before { border-right-color: var(--ht-hint-line) !important; }
body[data-hypatia-design="modern"] .tooltip:is(.bs-tooltip-bottom, .bs-tooltip-auto[x-placement^="bottom"]) > .arrow::before { border-bottom-color: var(--ht-hint-line) !important; }
body[data-hypatia-design="modern"] .tooltip:is(.bs-tooltip-left, .bs-tooltip-auto[x-placement^="left"]) > .arrow::before { border-left-color: var(--ht-hint-line) !important; }
body[data-hypatia-design="modern"] .popover {
  max-width: min(352px, calc(100vw - 32px));
  padding: 0;
  background: var(--ht-hint-bg);
  color: var(--ht-hint-ink);
  border: 1px solid var(--ht-hint-line);
  border-radius: var(--ht-hint-radius);
  box-shadow: var(--ht-hint-shadow);
}
body[data-hypatia-design="modern"] .popover-header {
  margin: 0;
  padding: 11px 14px;
  background: var(--ht-soft, #f7f8fa);
  color: var(--ht-hint-accent);
  border-bottom: 1px solid var(--ht-hint-line);
  border-radius: calc(var(--ht-hint-radius) - 1px) calc(var(--ht-hint-radius) - 1px) 0 0;
  font: var(--ht-hint-font);
  font-weight: 600;
}
body[data-hypatia-design="modern"] .popover-body {
  padding: 12px 14px;
  color: var(--ht-hint-ink);
  text-align: left;
}
body[data-hypatia-design="modern"] :is(.tooltip-inner, .popover-body) > :is(p, ul, ol):last-child { margin-bottom: 0; }
body[data-hypatia-design="modern"] :is(.tooltip-inner, .popover-body) img { max-width: 100%; height: auto; }
body[data-hypatia-design="modern"] .popover .arrow::after { background: transparent; }
body[data-hypatia-design="modern"] .popover:is(.bs-popover-top, .bs-popover-auto[x-placement^="top"]) > .arrow::before { border-top-color: var(--ht-hint-line); }
body[data-hypatia-design="modern"] .popover:is(.bs-popover-top, .bs-popover-auto[x-placement^="top"]) > .arrow::after { border-top-color: var(--ht-hint-bg); }
body[data-hypatia-design="modern"] .popover:is(.bs-popover-right, .bs-popover-auto[x-placement^="right"]) > .arrow::before { border-right-color: var(--ht-hint-line); }
body[data-hypatia-design="modern"] .popover:is(.bs-popover-right, .bs-popover-auto[x-placement^="right"]) > .arrow::after { border-right-color: var(--ht-hint-bg); }
body[data-hypatia-design="modern"] .popover:is(.bs-popover-bottom, .bs-popover-auto[x-placement^="bottom"]) > .arrow::before { border-bottom-color: var(--ht-hint-line); }
body[data-hypatia-design="modern"] .popover:is(.bs-popover-bottom, .bs-popover-auto[x-placement^="bottom"]) > .arrow::after { border-bottom-color: var(--ht-hint-bg); }
body[data-hypatia-design="modern"] .popover:is(.bs-popover-left, .bs-popover-auto[x-placement^="left"]) > .arrow::before { border-left-color: var(--ht-hint-line); }
body[data-hypatia-design="modern"] .popover:is(.bs-popover-left, .bs-popover-auto[x-placement^="left"]) > .arrow::after { border-left-color: var(--ht-hint-bg); }
body[data-hypatia-design="modern"] .popover .popover-header::before { border-bottom-color: var(--ht-hint-bg); }
