/* Help tooltips: pointer input must only react on the 18x18 help button itself. */
.legend-inline,.field-title{pointer-events:none}
.legend-inline>.help-tip,.field-title>.help-tip{pointer-events:auto}
.help-tip{box-sizing:border-box;align-self:center;flex:0 0 18px!important;width:18px!important;height:18px!important;min-width:18px!important;max-width:18px!important;min-height:18px!important;max-height:18px!important;cursor:help}

/* Native disclosure marker would double the custom "?" glyph. */
.help-tip>summary{display:grid;place-items:center;width:100%;height:100%;outline:0;list-style:none}
.help-tip>summary::-webkit-details-marker{display:none}
.help-tip>summary::marker{content:""}
.help-tip>span{position:absolute;z-index:120;left:50%;bottom:calc(100% + 9px);width:min(300px,72vw);padding:10px 12px;color:#edf7f1;border:1px solid rgba(255,255,255,.12);border-radius:10px;background:#183f2a;box-shadow:0 12px 28px rgba(15,48,31,.25);font:500 12px/1.45 system-ui,sans-serif;text-align:left;white-space:normal;opacity:0;visibility:hidden;transform:translate(-50%,5px);transition:opacity .14s,transform .14s,visibility .14s;pointer-events:none}

/* Desktop/mouse: never keep a tooltip latched open. It is visible only while the
   pointer is directly over the help button. Keyboard focus remains accessible. */
@media (hover:hover) and (pointer:fine){
  .help-tip[open]{color:var(--primary);border-color:#b9d7c5;background:#f4faf6}
  .help-tip:hover,.help-tip:focus-visible{color:#fff;border-color:var(--primary);background:var(--primary)}
  .help-tip:hover>span,.help-tip:focus-visible>span,.help-tip[open]>span{opacity:1;visibility:visible;transform:translate(-50%,0)}
}

/* Touch/coarse pointers keep the tap-to-toggle behaviour of the details element. */
@media (hover:none),(pointer:coarse){
  .help-tip[open]{color:#fff;border-color:var(--primary);background:var(--primary)}
  .help-tip[open]>span{opacity:1;visibility:visible;transform:translate(-50%,0)}
}

@media (max-width:680px){
  .help-tip>span{left:auto;right:-8px;transform:translateY(5px)}
  .help-tip[open]>span,.help-tip:hover>span,.help-tip:focus-visible>span{transform:translateY(0)}
}
