/* help.css: the "?" help tip and its popup (core/help.js, F16; EUDR
 * css/operator-react.css:1526-1585, 1632-1636 and css/phone-kit.css:813-844).
 *
 * The "?" is drawn (an SVG: a soft disc, the hook, the dot), sharp at any
 * zoom and centred by its geometry; the font's "?" in a border was blurred
 * and off centre (EUDR, the owner, 2026-11-08). Its middle sits on the middle
 * of the words' capitals: 0.35em above their baseline. It fills when focused
 * or pressed, and on hover only where there is a real hover.
 *   --help-tip-size  20px beside a title, 16px beside a field
 *   --help-tip-disc  the resting disc's strength
 *   --help-tip-on    the mark's colour on the filled disc
 * Colours are tokens (--link: green-700 on white 8.8:1, sage on dark), so it
 * flips with dark.css and needs no dark block. */

.ct-help-tip {
  --help-tip-size: 20px;
  --help-tip-disc: 0.14;
  --help-tip-on: var(--text-invert);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--help-tip-size);
  height: var(--help-tip-size);
  /* mobile.css gives phone buttons 44px: the round "?" keeps its size, and
     its ::after below is the touch area */
  min-width: 0;
  min-height: 0;
  margin: 0;
  margin-inline-start: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--link);
  font: inherit;
  line-height: 1;
  vertical-align: calc(0.35em - var(--help-tip-size) / 2);
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.ct-help-tip svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.ct-help-disc {
  fill: currentColor;
  fill-opacity: var(--help-tip-disc);
  transition: fill-opacity 0.15s ease;
}
.ct-help-q {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ct-help-dot {
  fill: currentColor;
}
/* Filled (focused, pressed, or its popup open): on the disc itself, whatever
   strength a place gives it. */
.ct-help-tip:focus-visible .ct-help-disc,
.ct-help-tip:active .ct-help-disc,
.ct-help-tip[aria-expanded="true"] .ct-help-disc {
  fill-opacity: 1;
}
.ct-help-tip:focus-visible .ct-help-q,
.ct-help-tip:active .ct-help-q,
.ct-help-tip[aria-expanded="true"] .ct-help-q {
  stroke: var(--help-tip-on);
}
.ct-help-tip:focus-visible .ct-help-dot,
.ct-help-tip:active .ct-help-dot,
.ct-help-tip[aria-expanded="true"] .ct-help-dot {
  fill: var(--help-tip-on);
}
@media (hover: hover) {
  .ct-help-tip:hover .ct-help-disc {
    fill-opacity: 1;
  }
  .ct-help-tip:hover .ct-help-q {
    stroke: var(--help-tip-on);
  }
  .ct-help-tip:hover .ct-help-dot {
    fill: var(--help-tip-on);
  }
}
/* Beside a field's label (fieldTip): smaller, in the label's line without
   moving the field. */
.ct-help-tip.ct-help-tip--field {
  --help-tip-size: 16px;
  margin-inline-start: 6px;
}
/* A bigger target on touch screens, the same look: a tap within 12px of the
   mark opens it. Above a row's covering control (the phone kit's
   .ph-row-hit), so the tap is the "?"'s, not the row's. */
@media (pointer: coarse) {
  .ct-help-tip {
    position: relative;
    z-index: 1;
  }
  .ct-help-tip::after {
    content: "";
    position: absolute;
    inset: -12px;
  }
}

/* The label's last word and its "?" never wrap apart (help.js glue(), the
   phone kit's own .ph-glue does the same). */
.ct-glue {
  white-space: nowrap;
}

/* On the chrome (the topbar, the phone kit's green band, EUDR phone-kit.css
   .ph-title .help-tip): the bar's ink, and the bar's green on the filled
   disc. */
.ct-topbar .ct-help-tip,
.ph-title .ct-help-tip {
  --help-tip-size: 22px;
  --help-tip-disc: 0.2;
  --help-tip-on: var(--chrome-bg);
  color: var(--chrome-ink);
}
/* Quiet in a phone group's heading. */
.ph-gh .ct-help-tip {
  color: var(--text-muted);
}

/* ═══════════════════════════ The popup ═══════════════════════════
   A dialog on a computer (EUDR .modal-box.help-tip-box), solid, never glass:
   it is text to read. Above drawers (4000) and confirmations (4100): a "?"
   may sit inside either. On a phone it is a bottom sheet (core/sheet.js);
   without that module the dialog itself becomes a sheet, below. */
.ct-help-wrap {
  position: fixed;
  inset: 0;
  z-index: 4200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.ct-help-scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.ct-help-box {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100dvh - 2 * var(--space-4));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-5);
  border-radius: var(--radius-glass);
  background: var(--glass-strong);
  color: var(--text);
  box-shadow: inset 0 0 0 0.5px var(--glass-edge), var(--shadow-lg);
  text-align: start;
  animation: ct-help-in 0.16s ease-out;
}
.ct-help-handle {
  display: none;
}
.ct-help-title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--text);
}
.ct-help-text {
  margin: 0 0 var(--space-3);
  color: var(--text-muted);
  line-height: 1.55;
}
/* More under the text (an upload's file specifications). */
.ct-help-extra {
  margin: 0 0 var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--text);
}
.ct-help-extra ul,
.ct-help-extra ol {
  margin: 0 0 var(--space-2);
  padding-inline-start: 18px;
}
.ct-help-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-4);
}
@keyframes ct-help-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* The text inside the phone's bottom sheet (core/sheet.js). */
.ct-help-sheet {
  padding: var(--space-1) var(--space-4) var(--space-4);
}
.ct-help-sheet .ct-help-text {
  font-size: 1rem;
}

@media (max-width: 600px) {
  .ct-help-wrap {
    align-items: flex-end;
    padding: 0;
  }
  .ct-help-box {
    width: 100%;
    max-height: 85dvh;
    border-radius: 18px 18px 0 0;
    padding: var(--space-3) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
    animation-name: ct-help-sheet-in;
    animation-duration: 0.24s;
  }
  .ct-help-handle {
    display: block;
    width: 36px;
    height: 5px;
    margin: 0 auto var(--space-3);
    border-radius: 3px;
    background: var(--border-strong);
  }
  .ct-help-close {
    width: 100%;
    min-height: 48px;
  }
  @keyframes ct-help-sheet-in {
    from {
      transform: translateY(100%);
    }
    to {
      transform: none;
    }
  }
}
