/* ---------- Erklär-Popover (core/ui/info-popover.js: infoPopover): immer dasselbe Fragezeichen, ein Klick zeigt die Erklärung.
   Lange Hinweistexte zu Feldern, Karten oder Bereichen stehen hier statt als Fließtext im Layout (Vorgabe Nutzer 13.11.2026).

   Warum ein eigenes Symbol (fa-circle-question) und nicht das „i“ der Hinweis-Badges (aqc-info-note): Das „i“ markiert sichtbaren
   Hinweistext, das Fragezeichen ein anklickbares Element mit verborgenem Text – beides darf nicht verwechselt werden.

   Zwei Formen: an Feldern als Aktion rechts im Feld (aqc-icon-btn + aqc-input-action, Gestaltung wie die übrigen Feld-Buttons in aqc-ui.css),
   sonst als Symbol im Text (Kartenkopf); dieses nimmt die Schriftgröße seiner Umgebung (em). */

body .aqc-info-btn:not(.aqc-input-action) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.3em;
    padding: 0;
    border: 0;
    background: none;
    font-size: 1em;
    line-height: 1;
    vertical-align: baseline;
    color: var(--aqc-text-subtle);
    cursor: pointer;
    transition: color 0.15s ease-in-out;
}

body .aqc-info-btn:not(.aqc-input-action) > i {
    font-size: 1.05em;
}

body .aqc-info-btn:not(.aqc-input-action):hover,
body .aqc-info-btn.is-open {
    color: var(--mdb-primary);
}

/* Nur bei Tastaturbedienung eine Kontur; ein Mausklick soll keinen Rahmen hinterlassen */
body .aqc-info-btn:not(.aqc-input-action):focus {
    outline: none;
}

body .aqc-info-btn:not(.aqc-input-action):focus-visible {
    border-radius: 50%;
    outline: 2px solid var(--mdb-primary);
    outline-offset: 2px;
}

/* Offenes Popover: Symbol im Feld blau, damit klar ist, zu welchem Feld der Text gehört */
body .aqc-input-actions > .aqc-info-btn.aqc-input-action.is-open {
    color: var(--mdb-primary);
}

/* Im Kartenkopf als einzelnes Symbol hinter dem Titel: etwas kleiner als der Titeltext, damit es nicht wie ein zweites Titelsymbol wirkt */
body .card-title .aqc-info-btn {
    margin-left: 0.4em;
    font-size: 0.8em;
}

/* ---------- Das Popover selbst */
body .popover.aqc-info-popover {
    --mdb-popover-max-width: 22rem;
    --mdb-popover-arrow-border: var(--aqc-border);
    max-width: min(22rem, calc(100vw - 2rem));
    border: 1px solid var(--aqc-border-subtle);
    border-radius: var(--aqc-radius-card);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.16);
}

/* MDB blendet den Pfeil aus; er zeigt hier, zu welchem Feld die Erklärung gehört */
body .popover.aqc-info-popover > .popover-arrow {
    display: block;
}

body .popover.aqc-info-popover .popover-header {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--aqc-text);
    background-color: var(--aqc-surface-muted);
    border-bottom: 1px solid var(--aqc-border-subtle);
    border-radius: var(--aqc-radius-card) var(--aqc-radius-card) 0 0;
}

body .popover.aqc-info-popover .popover-body {
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--aqc-text);
}

body .aqc-info-popover-text > p {
    margin-bottom: 0.5rem;
}

body .aqc-info-popover-text > p:last-child {
    margin-bottom: 0;
}
