/* Gemeinsame Dialoge, Optionsdetails und begrenzte Optionskarten; Farben aus den Seitentokens. */
dialog.help, dialog#glossar { max-height: calc(100dvh - 24px); overflow: hidden; overflow-wrap: anywhere; }
dialog .help-head, dialog#glossar .g-head { position: static; flex: none; flex-wrap: wrap-reverse; align-items: start; background: var(--surface); z-index: 2; }
dialog :focus-visible, dialog h3:focus { outline: 2px solid var(--focus); outline-offset: 2px; }
dialog.dialog-fallback { position: fixed; inset: 12px; margin: auto; z-index: 1000; box-shadow: 0 0 0 100vmax var(--bg); }
.option-groups { display: flex; flex-direction: column; gap: 24px; }
.option-groups h4 { margin: 0 0 10px; font-family: "Archivo", sans-serif; font-size: 16px; }
.option-groups dl { margin: 0; display: grid; grid-template-columns: minmax(110px, 1fr) minmax(0, 3fr); gap: 10px 16px; }
dialog .option-groups dt { font-weight: 600; white-space: normal; }
dialog .help-list > dd { min-width: 0; }
dialog .help-head h3, dialog .g-head h3 { min-width: 0; }
.option-groups dd { margin: 0; min-width: 0; }
.option-groups p { margin: 4px 0; }
dialog .help-head > :first-child, dialog .g-head > :first-child { min-width: 0; flex: 1 1 12em; }
dialog .dialog-close { flex: none; align-self: start; margin: 0 0 0 auto; min-width: 44px; min-height: 44px; max-width: 100%; padding: 8px 12px; border: 1px solid var(--muted); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; line-height: 1.25; white-space: normal; overflow-wrap: anywhere; cursor: pointer; appearance: none; -webkit-tap-highlight-color: transparent; }
dialog .dialog-close:hover { background: var(--surface-2); }
dialog .dialog-close:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 760px) {
  dialog.help, dialog.help.wide, dialog#glossar { width: calc(100vw - 16px); max-width: none; max-height: calc(100dvh - 16px); margin: auto 8px; }
  .option-groups dl { grid-template-columns: 1fr; gap: 4px; }
  .option-groups dd { margin-bottom: 12px; }
}

.field-caption { display: flex; align-items: center; gap: 6px; }
.field-caption label { min-width: 0; }

/* Kopf und scrollender Inhalt belegen getrennte Flaechen, auch bei grosser Schrift. */
dialog .help-body, dialog#glossar .g-body { max-height: calc(100dvh - 28px); overflow: hidden; }
.dialog-scroll { min-height: 0; flex: 1 1 auto; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.dialog-scroll > * { flex: none; }

/* Optionskarten: eine Liste auf allen Breiten, keine Wirkung auf Rechenseiten. */
.option-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.option-list > li { min-width: 0; }
.option-card { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px 24px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); font-size: 16px; overflow-wrap: anywhere; }
.option-card > *, .option-main { min-width: 0; }
.option-card .option-name { font-size: 24px; line-height: 1.3; font-weight: 700; text-wrap: pretty; }
.option-card .option-label { margin: 0 0 8px; color: var(--muted); font-size: 16px; }
.option-card .option-value { margin: 0; font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.option-list .option-card .real-btn { min-height: 44px; min-width: 44px; max-width: 100%; padding: 10px 12px; white-space: normal; font-size: 20px; color: var(--ink); background: var(--surface-2); border: 1px solid currentColor; }
.option-card.excluded .option-name { text-decoration: line-through; text-decoration-color: var(--muted); }
.option-qualifications { grid-column: 1 / -1; color: var(--muted); }
.option-evidence { margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.option-context { margin: 8px 0 0; color: var(--ink); }
.option-card button { min-width: 44px; min-height: 44px; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.option-card .btn.more { grid-column: 1 / -1; justify-self: start; margin: 0; padding: 10px 16px; font-size: 16px; border-color: var(--accent); color: var(--accent); }
.option-card :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
#feeHelp { min-width: 44px; min-height: 44px; margin-top: 8px; }
@media (max-width: 900px) {
  .option-card { grid-template-columns: minmax(0, 1fr); }
  .option-card .btn.more { justify-self: stretch; }
}
@media (max-width: 760px) {
  .options-section { padding-inline: 16px; }
}

.option-card button.beleg { color: var(--ink); border-color: currentColor; }
#feeHelp { border-color: var(--accent); }

/* Kartenstatus: spezifisch genug fuer die Kartenbasis, bestehende semantische Tokens. */
.option-list .option-card .real-btn.gut { background: var(--good-soft); border-color: var(--good); }
.option-list .option-card .real-btn.moeglich { background: var(--accent-soft); border-color: var(--accent); }
.option-list .option-card .real-btn.schwer { background: var(--warn-soft); border-color: var(--warn); }
.option-list .option-card .real-btn.aus { background: var(--bad-soft); border-color: var(--bad); }
.option-list .option-card .real-btn.unk { background: var(--surface-2); border-color: var(--muted); }

/* Kostenlink der Karte: zweite Aktion nach "Details ansehen", optisch zurueckhaltender. */
.option-card .cost-link { grid-column: 1 / -1; justify-self: start; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; max-width: 100%; margin: 0; padding: 10px 16px; border: 1px solid var(--muted); border-radius: 8px; color: var(--accent); font-size: 16px; font-weight: 600; text-underline-offset: 3px; }
.option-card .cost-link:hover { background: var(--surface-2); }
@media (max-width: 900px) {
  .option-card .cost-link { justify-self: stretch; }
}
