/* Entscheidungskarte (#44): Stil fuer web/entscheidung.js, nach web/prototype/entscheidung.html. Nur Variablen der App
   (--surface, --raised, --sel, --ink, --mute, --line, --edge, --accent, --on-accent, --accent2, --ok, --warn, --r, --r-lg, --sans, --mono);
   was die App nicht hat, mit Ersatzwert. Gemeinsame Tokens aus web/ui.css (--bad, --r-sm, --r-card, --tap, --scrim, --z-sheet) mit Ersatzwert in den --ek-* Variablen des ersten Blocks. */
.ekq, .ek-card, .ek-tq, .ek-tools, .ek-bulk, .ek-h, .ek-pick {
  --ek-bad: var(--bad, #F07C6A); --ek-faint: var(--faint, var(--mute)); --ek-r: var(--r-sm, var(--r, 6px)); --ek-rl: var(--r-card, var(--r-lg, 8px));
  --ek-tap: var(--tap, 44px); --ek-scrim: var(--scrim, rgba(0,0,0,.55)); --ek-z: var(--z-sheet, 70);
  font-family: var(--sans); font-size: 14px; line-height: 1.5;
}
.ek-card kbd, .ekq kbd { font: var(--t-xs) var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--mute); background: var(--raised); margin-left: 6px; }

/* Warteschlange: Liste links, Karte rechts */
.ekq { display: grid; grid-template-columns: minmax(240px, 330px) minmax(0, 1fr); gap: 14px; align-items: start; }
.ek-queue { background: var(--surface); border: 1px solid var(--line); border-radius: var(--ek-rl); overflow: hidden; position: sticky; top: 8px; }
.ek-qhead { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ek-qhead h2 { font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--mute); margin: 0 auto 0 0; }
.ek-count { color: var(--mute); font-size: 12px; }
.ek-list { max-height: 70vh; overflow-y: auto; }
.ek-qrow { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; padding: 10px 12px; border: 0; border-top: 1px solid var(--line); border-left: 3px solid transparent;
  background: none; width: 100%; text-align: left; color: var(--ink); font: inherit; cursor: pointer; align-items: start; }
.ek-qrow:first-child { border-top: 0; }
.ek-qrow:hover { background: var(--raised); }
.ek-qrow[aria-current="true"] { background: var(--sel); border-left-color: var(--accent); }
.ek-t { min-width: 0; } .ek-t b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ek-t span { color: var(--mute); font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ek-n { font: 12px var(--mono); color: var(--mute); }
.ek-qfoot { padding: 10px 12px; border-top: 1px solid var(--line); color: var(--ek-faint); font-size: 12px; }
.ek-empty { padding: 24px 14px; color: var(--mute); text-align: center; }
.ek-scrim, .ek-grip { display: none; }

/* Die Karte */
.ek-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--ek-rl); overflow: hidden; margin: 0 0 12px; color: var(--ink); }
.ek-head { padding: 12px 16px 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ek-kind { font-size: var(--t-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.ek-who, .ek-sure, .ek-flag { font-size: 12px; border-radius: 999px; padding: 1px 8px; border: 1px solid var(--line); color: var(--mute); white-space: nowrap; }
.ek-sure.sicher { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.ek-sure.vermutlich { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.ek-sure.unsicher { color: var(--ek-bad); border-color: color-mix(in srgb, var(--ek-bad) 45%, transparent); }
.ek-flag.frisch { color: var(--ok); } .ek-flag.veraltet, .ek-flag.dublette, .ek-flag.ueberlappt { color: var(--warn); } .ek-flag.widerspricht { color: var(--ek-bad); }
.ek-title { padding: 0 16px 10px; font-size: 17px; font-weight: 600; letter-spacing: -.01em; margin: 0; line-height: 1.3; outline: none; }
.ek-sec { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); }
.ek-sec > h3 { font: 600 var(--t-xs) var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--mute); margin: 3px 0 0; }
.ek-body { min-width: 0; }
.ek-muster { color: var(--mute); font-size: 12.5px; margin-bottom: 4px; }
.ek-gilt { color: var(--mute); font-size: var(--t-s); margin-bottom: 4px; font-weight: 600; }
.ek-items { display: grid; gap: 5px; }
.ek-item { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.ek-item.odd b { color: var(--warn); }
.ek-ic { color: var(--mute); text-align: center; }
.ek-tt { min-width: 0; } .ek-tt b { font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ek-tt small { display: block; font-size: 12px; color: var(--mute); } .ek-odd { color: var(--warn) !important; }
.ek-link, .ek-more { background: none; border: 0; padding: 0; color: var(--link, var(--accent2)); font: inherit; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.ek-more { color: var(--mute); text-decoration: underline dotted; }
.ek-crumb { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-weight: 500; }
.ek-crumb span + span::before { content: "›"; color: var(--ek-faint); margin-right: 4px; }
.ek-crumb.target, .ek-target { color: var(--accent); font-weight: 600; }
.ek-status { font-size: 12px; color: var(--mute); margin-top: 2px; }
.ek-why { margin: 6px 0 8px; }
.ek-ev { display: flex; flex-wrap: wrap; gap: 6px; }
.ek-evc { font-size: 12px; background: var(--raised); border-radius: var(--ek-r); padding: 2px 8px; }
.ek-evc em { font-style: normal; color: var(--mute); margin-right: 4px; }
.ek-opts { display: grid; gap: 6px; }
.ek-opt { display: grid; grid-template-columns: 20px minmax(0, 1fr) 100px; gap: 10px; align-items: center; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--ek-r);
  background: var(--surface); color: var(--ink); text-align: left; width: 100%; font: inherit; cursor: pointer; }
.ek-opt[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.ek-k { font: var(--t-xs) var(--mono); color: var(--ek-faint); } .ek-l small { display: block; font-size: 12px; color: var(--mute); }
.ek-share { height: 6px; background: var(--raised); border-radius: 3px; position: relative; display: block; }
.ek-share i { position: absolute; inset: 0 auto 0 0; background: var(--accent2); border-radius: 3px; }
.ek-impact { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.ek-num { background: var(--raised); border-radius: var(--ek-r); padding: 6px 10px; }
.ek-num b { font-size: 17px; display: block; font-weight: 600; font-variant-numeric: tabular-nums; } .ek-num span { font-size: 12px; color: var(--mute); }
.ek-num.warn b { color: var(--warn); }
.ek-actions { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; background: var(--surface); }
.ek-btn { background: var(--raised); border: 1px solid var(--line); border-radius: var(--ek-r); padding: 7px 12px; white-space: nowrap; color: var(--ink); font: inherit; cursor: pointer; min-height: 36px; }
.ek-btn:hover { border-color: var(--edge); } .ek-btn:disabled { opacity: .45; cursor: not-allowed; }
.ek-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.ek-btn.primary kbd { background: transparent; color: var(--on-accent); border-color: color-mix(in srgb, var(--on-accent) 40%, transparent); }
.ek-btn.danger { color: var(--ek-bad); }
.ek-always { display: flex; gap: 6px; align-items: center; margin-left: auto; font-size: 13px; color: var(--mute); }
.ek-switch { width: 34px; height: 20px; border-radius: 10px; background: var(--sel); border: 1px solid var(--line); position: relative; padding: 0; cursor: pointer; }
.ek-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 1px var(--edge); transition: left .15s; }
.ek-switch[aria-checked="true"] { background: var(--accent2); } .ek-switch[aria-checked="true"]::after { left: 16px; }
.ek-switch:disabled { opacity: .4; cursor: not-allowed; }
.ek-note { padding: 0 16px 10px; font-size: 12.5px; color: var(--mute); }
.ek-pattern { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 16px 12px; }
.ek-pattern button, .ek-lvl button, .ek-chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--ek-r); padding: 3px 9px; font: inherit; font-size: 12.5px; cursor: pointer; }
.ek-pattern button[aria-pressed="true"], .ek-lvl button[aria-pressed="true"], .ek-chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.ek-pattern small { color: var(--ek-faint); font: var(--t-xs) var(--mono); margin-left: 4px; }
details.ek-more-d { border-top: 1px solid var(--line); }
details.ek-more-d > summary { padding: 10px 16px; cursor: pointer; color: var(--mute); font-size: 13px; }
.ek-dbody { padding: 0 16px 12px; display: grid; gap: 10px; }
.ek-check { display: grid; gap: 2px; max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: var(--ek-r); padding: 4px; }
.ek-check label { display: grid; grid-template-columns: 18px 18px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 3px 6px; border-radius: 4px; cursor: pointer; }
.ek-check label:hover { background: var(--raised); }
.ek-check label span:nth-child(3) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ek-check small { color: var(--mute); font-size: 12px; }
.ek-hist { margin: 0; padding-left: 18px; color: var(--mute); font-size: 13px; }
.ek-src { font: var(--t-xs) var(--mono); color: var(--ek-faint); }
.ek-h { font: 600 var(--t-xs) var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--mute); margin: 28px 0 8px; display: flex; gap: 8px; align-items: baseline; }
.ek-h .c { font-weight: 400; letter-spacing: 0; text-transform: none; } .ek-h .ek-more { margin-left: auto; text-transform: none; letter-spacing: 0; }
dialog.ek-pick { border: 1px solid var(--line); border-radius: var(--ek-rl); background: var(--surface); color: var(--ink); padding: 14px; width: min(420px, calc(100vw - 32px)); }
dialog.ek-pick::backdrop { background: rgb(0 0 0 / .45); }
.ek-picklist { display: grid; gap: 4px; margin: 8px 0; }
.ek-picklist button { text-align: left; background: none; border: 1px solid var(--line); border-radius: var(--ek-r); padding: 8px 10px; color: var(--ink); font: inherit; cursor: pointer; }
.ek-picklist button.spec { color: var(--accent2); }

/* Warteschlange aufraeumen */
.ek-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; } .ek-tools .sp { flex: 1; }
.ek-tools select { background: var(--surface); border: 1px solid var(--line); border-radius: var(--ek-r); padding: 5px 8px; color: var(--ink); }
.ek-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ek-bulk { display: none; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--raised); border: 1px solid var(--line); border-radius: var(--ek-rl); padding: 8px 12px; margin-bottom: 10px; position: sticky; top: 0; z-index: 2; }
.ek-bulk.on { display: flex; }
table.ek-tq { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
.ek-tq th, .ek-tq td { padding: 7px 8px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; }
.ek-tq th { font: 600 var(--t-xs) var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--mute); background: var(--raised); border-top: 0; }
.ek-tq td.num2 { font-variant-numeric: tabular-nums; text-align: right; }
.ek-tq tr.grp td { background: var(--raised); font-weight: 600; font-size: 12.5px; }
.ek-edit { background: none; border: 1px dashed transparent; border-radius: 4px; padding: 1px 4px; text-align: left; color: var(--ink); font: inherit; cursor: pointer; max-width: 100%; }
.ek-edit:hover { border-color: var(--edge); }
.ek-lvl { display: inline-flex; gap: 2px; margin-left: 6px; } .ek-lvl button { padding: 0 5px; font-size: var(--t-xs); }

/* Telefon: Liste fuellt den Bildschirm, die Karte ist ein Blatt von unten, Aktionen im Daumenbereich */
@media (max-width: 760px) {
  .ekq { display: block; }
  .ek-queue { position: static; } .ek-list { max-height: none; }
  .ek-pane { position: fixed; left: 0; right: 0; bottom: 0; height: 92vh; overflow-y: auto; z-index: var(--ek-z); background: var(--surface); border-radius: 14px 14px 0 0;
    transform: translateY(105%); transition: transform .2s; padding-bottom: env(safe-area-inset-bottom); }
  .ekq.sheet .ek-pane, .sheet > .ekq .ek-pane { transform: none; }
  .sheet > .ekq .ek-scrim { display: block; position: fixed; inset: 0; background: var(--ek-scrim); z-index: calc(var(--ek-z) - 1); }
  .ek-grip { display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--edge); margin: 8px auto; }
  .ek-pane .ek-card { border: 0; border-radius: 0; margin: 0; }
  .ek-pane .ek-actions { position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr 1fr; }
  .ek-pane .ek-btn { min-height: var(--ek-tap); font-size: 15px; }
  .ek-always { grid-column: 1 / -1; margin: 0; }
  .ek-sec { grid-template-columns: 1fr; gap: 4px; }
  .ek-qfoot { display: none; }
  table.ek-tq thead { display: none; } .ek-tq tr { display: grid; grid-template-columns: 28px 1fr; } .ek-tq td { border-top: 0; }
  .ek-tq tr td:first-child { grid-row: span 5; border-top: 1px solid var(--line); }
}

/* Klaeren-Stapel (web/klaerstapel.js): eine Frage auf einmal, grosse Ziele, Daumenreichweite am Telefon */
.ks { --ek-r: var(--r-sm, var(--r, 6px)); --ek-rl: var(--r-card, var(--r-lg, 8px)); --ek-tap: var(--tap, 44px); --ek-faint: var(--faint, var(--mute));
  font-family: var(--sans); font-size: 15px; line-height: 1.5; max-width: 720px; margin: 0 0 18px; outline: none; }
.ks kbd { font: var(--t-xs) var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--mute); background: var(--raised); margin-right: 8px; }
.ks-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.ks-head h2 { margin: 0; }
.ks-noch { color: var(--mute); font: 13px var(--mono); }
.ks-head { flex-wrap: wrap; } .ks-hint { color: var(--ek-faint); font-size: 12px; flex-basis: 100%; } .ks-hint:empty { display: none; }
/* Ein Kartenrahmen (#79 V11): Stapel-Karten nutzen die Abschnitte der Entscheidungskarte, ohne doppelten Rand */
.ks-card .ek-sec { padding: 8px 0; grid-template-columns: 92px minmax(0, 1fr); }
.ks-card .ek-sec .ks-opts, .ks-card .ek-sec .ks-why { margin-top: 0; }
.ks-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--ek-rl); padding: 16px; touch-action: pan-y; }
.ks-group { border-color: var(--accent); }
.ks-meta { display: flex; gap: 8px; flex-wrap: wrap; font: 12px var(--sans); color: var(--mute); text-transform: uppercase; letter-spacing: .05em; }
.ks-prot { color: var(--warn); }
.ks-title { margin: 6px 0 4px; font-size: 18px; line-height: 1.35; }
.ks-open { all: unset; cursor: pointer; } .ks-open:hover, .ks-open:focus-visible { text-decoration: underline; }
.ks-route { color: var(--mute); overflow-wrap: anywhere; }
.ks-dst { color: var(--ink); }
.ks-why { margin: 8px 0 10px; padding-left: 18px; color: var(--mute); font-size: 13.5px; }
.ks-items { margin: 0 0 10px; padding-left: 18px; font-size: 13.5px; } .ks-items .more { color: var(--mute); list-style: none; }
.ks-opts { display: grid; gap: 8px; }
.ks-opt { display: flex; align-items: center; gap: 4px; min-height: var(--ek-tap); width: 100%; text-align: left; font: inherit; color: var(--ink); cursor: pointer;
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--ek-r); padding: 10px 12px; }
.ks-opt span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ks-opt small { color: var(--mute); font-size: 12px; }
.ks-opt.first { border-color: var(--accent); }
.ks-opt.else { color: var(--mute); }
.ks-opt:hover, .ks-opt:focus-visible { background: var(--sel); outline: 2px solid var(--accent); outline-offset: -1px; }
.ks-effect { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; color: var(--mute); font-size: 13.5px; }
.ks-mit { font: inherit; font-size: 13px; color: var(--ink); background: none; border: 1px dashed var(--line); border-radius: var(--ek-r); padding: 4px 10px; min-height: 32px; cursor: pointer; }
.ks-mit[aria-pressed="true"] { border-style: solid; border-color: var(--accent); background: var(--sel); }
.ks-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ks-btn { font: inherit; font-size: 13px; color: var(--mute); background: none; border: 1px solid var(--line); border-radius: var(--ek-r); padding: 6px 10px; min-height: 36px; cursor: pointer; }
.ks-done { padding: 22px 14px; color: var(--mute); text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--ek-rl); }
.ks-done b { color: var(--ink); display: block; }
.ks-foot { color: var(--ek-faint); font-size: 12px; margin-top: 8px; }
.ks-learned:empty { display: none; }
.ks-learned { margin-bottom: 12px; } .ks-lhead { margin: 0 0 6px; color: var(--mute); font-size: 13px; }
@media (max-width: 860px) {
  .ks-card { padding: 14px; }
  .ks-title { font-size: 17px; }
  .ks-foot { display: none; }
  .ks-opt { min-height: 52px; }
}
/* Nachdenker (#44): sein Grund steht oben in "Warum", sein Ziel vorn und markiert */
.ks-why .ks-nd { color: var(--ink); list-style: none; margin-left: -18px; padding: var(--s1) var(--s2); border-left: 2px solid var(--info); background: var(--info-bg); border-radius: var(--r-sm); }
.ks-opt small.ks-ndmark { color: var(--info); }
/* Teilweise (#62): Liste mit Haken in der Buendel-Karte; die ganze Zeile ist das Ziel (Telefon) */
.ks-tw { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 10px 0 0; }
.ks-tw legend { font-size: var(--t-xs); color: var(--mute); padding: 0 4px; }
.ks-tw-list { max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; }
.ks-tw-row { display: flex; gap: 10px; align-items: center; min-height: var(--ek-tap); padding: 2px 4px; cursor: pointer; border-radius: 6px; }
.ks-tw-row:hover { background: var(--raised); }
.ks-tw-row input { width: 20px; height: 20px; flex: none; }
/* "Nein, weil ..." (#63): ein Feld unter Nein, in jeder Karte gleich */
.ek-nein-grund { padding: 0 16px 12px; background: var(--surface); }
.ks-card .ek-nein-grund { padding: 8px 0 0; background: none; }
.ek-grund { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--raised); color: inherit; font: inherit; }
.ek-busy { opacity: .85; }
.ek-spin { display: inline-block; width: 1em; height: 1em; margin-right: .4em; vertical-align: -.15em; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: ek-spin .8s linear infinite; }
@keyframes ek-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ek-spin { animation: none; border-top-color: var(--line); } }
.ek-extern { display: inline-block; margin-top: 6px; text-decoration: none; }
