:root {
  --bg: #f4f6f9;
  --card: #fff;
  --ink: #1c2430;
  --muted: #5d6b7e;
  --line: #d8dee8;
  --accent: #1f5fbf;
  --accent-ink: #fff;
  --ok: #1d7a3e;
  --ok-bg: #e6f5ec;
  --bad: #b3261e;
  --bad-bg: #fcebea;
  --follow: #8a5a00;
  --follow-bg: #fff4d6;
  --neutral-bg: #eef1f5;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family:
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}
header {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
header h1 {
  margin: 0;
  font-size: 1.25rem;
}
header .calc-toggle {
  font: inherit;
  font-size: 0.9rem;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: transparent;
  color: var(--accent-ink);
  cursor: pointer;
}
header .calc-toggle[aria-pressed='true'] {
  background: #fff;
  color: var(--accent);
}
main {
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 16px 60px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.tab {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
}
.tab.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent) inset;
}
.tab small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.task {
  font-size: 1.02rem;
  margin: 0;
  white-space: pre-line;
  line-height: 1.55;
}
.tnote {
  display: block;
  font-size: 0.88rem;
  color: #587084;
  margin: 3px 0 0 1.4em;
  line-height: 1.45;
}
.task-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 12px;
}
.task-hint:empty {
  display: none;
}
.konto {
  margin: 12px 0;
  font-size: 0.86rem;
  white-space: normal;
  container-type: inline-size;
}
.konto-wide {
  display: none;
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
}
.konto-wide {
  font-size: 0.84rem;
}
.konto-wide th {
  border-bottom: 2px solid var(--ink);
  padding: 4px 6px;
  text-align: left;
}
.konto-wide td {
  padding: 4px 6px;
  vertical-align: top;
}
.konto-wide td.lb {
  white-space: normal;
  overflow-wrap: anywhere;
}
.konto-wide td.n {
  padding-right: 12px;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.konto-wide .hv {
  border-left: 2px solid var(--ink);
}
.konto-wide tr.sum td {
  border-top: 1px solid var(--ink);
  border-bottom: 3px double var(--ink);
  font-weight: 600;
}
@container (min-width: 460px) {
  .konto .konto-wide {
    display: table;
  }
  .konto .konto-grid {
    display: none;
  }
}
.datatab {
  border-collapse: collapse;
  width: 100%;
  margin: 12px 0;
  font-size: 0.86rem;
  white-space: normal;
}
.datatab th {
  border-bottom: 2px solid var(--ink);
  padding: 5px 6px;
  text-align: left;
  vertical-align: bottom;
  font-weight: 600;
}
.datatab th.n,
.datatab td.n {
  text-align: right;
}
.datatab td {
  padding: 5px 6px;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 560px) {
  .datatab {
    font-size: 0.74rem;
  }
  .datatab th,
  .datatab td {
    padding: 4px 2px;
  }
  .datatab th {
    hyphens: auto;
    -webkit-hyphens: auto;
  }
}
.konto-title {
  font-weight: 600;
  text-align: center;
  padding-bottom: 6px;
}
.konto-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 0;
}
.konto-side {
  border-collapse: collapse;
  flex: 1 1 230px;
  min-width: 0;
}
.konto-side.ha {
  margin-left: 0;
}
.konto-side th {
  border-bottom: 2px solid var(--ink);
  padding: 4px 6px;
  text-align: left;
}
.konto-side td {
  padding: 4px 6px;
  vertical-align: top;
}
.konto-side td.n {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.konto-side tr.sum td {
  border-top: 1px solid var(--ink);
  border-bottom: 3px double var(--ink);
  font-weight: 600;
}
@media (max-width: 560px) {
  .konto {
    font-size: 0.74rem;
  }
  .konto-side td,
  .konto-side th {
    padding: 3px 3px;
  }
}

.pct-opt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin: 4px 0 8px;
  font-size: 0.88rem;
}
.pct-opt label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 600;
}
.pct-opt input {
  width: auto;
}
.sheet.nopct col.col-p,
.sheet.nopct .c-p,
.sheet.nopct th.hp {
  display: none;
}
.wrap {
  overflow-x: auto;
}
table.sheet {
  table-layout: fixed;
  width: var(--tw, 640px);
  border-collapse: collapse;
}
.sheet th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 4px 6px;
}
.sheet td {
  padding: 3px 4px;
  vertical-align: middle;
}
.sheet input,
.sheet select {
  width: 100%;
  font: inherit;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
.sheet input:focus,
.sheet select:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
}
.sheet input.amt,
.sheet input.p1,
.sheet input.p2 {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.c-vz {
  width: var(--w-vz, 78px);
}
.c-p {
  width: var(--w-p, 84px);
}
.c-amt {
  width: var(--w-amt, 140px);
}
.c-act {
  width: var(--w-act, 76px);
  white-space: nowrap;
}
.sheet select.vz-empty {
  color: #9aa5b5;
}
.sheet select.vz-empty option {
  color: var(--ink);
}
.sheet .ok {
  border-color: var(--ok);
  background: var(--ok-bg);
}
.sheet .bad {
  border-color: var(--bad);
  background: var(--bad-bg);
}
.sheet .follow {
  border-color: #c98a00;
  background: var(--follow-bg);
}
.sheet .neutral {
  border-color: #9aa5b5;
  background: var(--neutral-bg);
}

button.ico {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 6px;
  padding: 5px 8px;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  color: var(--muted);
}
button.ico:hover {
  color: var(--ink);
  border-color: var(--muted);
}
.bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.bar-actions.top {
  margin: 0 0 8px;
}
button.btn {
  font: inherit;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
button.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 600;
}
button.btn.small {
  padding: 6px 12px;
  font-size: 0.88rem;
}

.result {
  display: none;
}
.result.show {
  display: block;
}
.score {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}
.score .big {
  font-size: 1.8rem;
  font-weight: 700;
}
.score .note {
  font-size: 1.05rem;
  color: var(--muted);
}
.meter {
  height: 10px;
  background: var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin: 10px 0 14px;
}
.meter > div {
  height: 100%;
  background: var(--ok);
  width: 0;
  transition: width 0.4s;
}
table.res {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 700px;
}
.res th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 2px solid var(--line);
  padding: 5px 6px;
}
.res td {
  padding: 6px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.res .t-ok,
.ansline .t-ok {
  color: var(--ok);
  font-weight: 600;
}
.res .t-bad,
.ansline .t-bad {
  color: var(--bad);
  font-weight: 600;
}
.res .t-follow,
.ansline .t-follow {
  color: var(--follow);
  font-weight: 600;
}
.res .muted {
  color: var(--muted);
}
.res tr.missing td {
  background: var(--bad-bg);
}
.notes {
  margin: 12px 0 0;
  padding-left: 18px;
  font-size: 0.88rem;
}
.legend {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 10px 0 0;
}
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 28, 40, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}
.overlay.show {
  display: flex;
}
.dialog {
  background: var(--card);
  border-radius: 12px;
  padding: 20px 22px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
.dialog p {
  margin: 0 0 16px;
}
.dialog .row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Kennzahlen (Bruch) */
.kz {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.kz:first-child {
  border-top: 0;
  padding-top: 0;
}
.kz h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}
.frac {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.frac .parts {
  display: flex;
  flex-direction: column;
  width: 300px;
  max-width: 100%;
}
.frac .parts .bar {
  border-top: 2px solid var(--ink);
  margin: 6px 0;
}
.frac .eq {
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
  min-width: 130px;
}
.frac .eq .live {
  color: var(--muted);
}
.kz input {
  font: inherit;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  width: 100%;
}
.kz input:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
}
.kz .parts input {
  text-align: center;
}
.kz .sent {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.kz .sent input {
  width: 120px;
  text-align: right;
}
.kz .sent .lbl {
  white-space: nowrap;
}
.kz .ok {
  border-color: var(--ok);
  background: var(--ok-bg);
}
.kz .bad {
  border-color: var(--bad);
  background: var(--bad-bg);
}
.kz .follow {
  border-color: #c98a00;
  background: var(--follow-bg);
}
.res-kz {
  margin-top: 16px;
}
.res-kz {
  container-type: inline-size;
}
.res-kz table.res {
  min-width: 0;
}
/* Kennzahlen (Zuschlag, Faktor, Spanne ...) immer untereinander als Karten, auch am Computer */
@container (min-width: 0px) {
  .res-kz .res thead {
    display: none;
  }
  .res-kz .res tbody,
  .res-kz .res tr,
  .res-kz .res td {
    display: block;
  }
  .res-kz .res tr {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 8px;
  }
  .res-kz .res td {
    border: 0;
    padding: 2px 0;
  }
  .res-kz .res td::before {
    content: attr(data-l);
    display: inline-block;
    min-width: 80px;
    color: var(--muted);
    font-size: 0.76rem;
  }
  .res-kz .res td:first-child::before {
    display: none;
  }
  .res-kz .res td:first-child {
    font-size: 0.95rem;
    margin-bottom: 4px;
  }
}
.res-kz h4,
.res-h {
  margin: 0 0 6px;
  font-size: 0.9rem;
}
.res-kz h4:not(:first-child) {
  margin-top: 16px;
}
.part-title {
  margin: 0 0 12px;
  font-size: 1.05rem;
}
.kz-sub {
  margin: 0 0 8px;
  font-size: 0.95rem;
}
.part-title + .kz {
  border-top: 0;
  padding-top: 0;
}
.parts-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 0.88rem;
  color: var(--muted);
  margin: -4px 0 14px;
}
.parts-line .t-ok {
  color: var(--ok);
  font-weight: 600;
}

/* Taschenrechner */
.calc {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 270px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  padding: 12px;
  z-index: 40;
  display: none;
}
.calc.show {
  display: block;
}
.calc:focus {
  outline: none;
}
.calc .hist {
  min-height: 96px;
  max-height: 96px;
  overflow: hidden;
  font-size: 0.78rem;
  line-height: 1.3;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}
.calc .hist div {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.calc .disp {
  background: var(--bg);
  border-radius: 8px;
  padding: 10px 12px;
  text-align: right;
  font-size: 1.4rem;
  font-variant-numeric: tabular-nums;
  min-height: 46px;
  overflow: hidden;
  white-space: nowrap;
  margin-bottom: 10px;
}
.calc .keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.calc .keys button {
  font: inherit;
  font-size: 1.05rem;
  padding: 10px 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.calc .keys button:hover {
  background: var(--bg);
}
.calc .keys button.op {
  background: #eef2fa;
}
.calc .keys button.eq {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.calc .keys button.wide {
  grid-column: span 2;
}
@media (max-width: 560px) {
  .calc {
    width: 200px;
    right: 10px;
    bottom: 10px;
    padding: 8px;
    border-radius: 12px;
  }
  .calc .hist {
    min-height: 50px;
    max-height: 50px;
    font-size: 0.7rem;
    margin-bottom: 2px;
  }
  .calc .hist div:nth-child(n + 4) {
    display: none;
  }
  .calc .disp {
    font-size: 1.1rem;
    min-height: 34px;
    padding: 6px 8px;
    margin-bottom: 6px;
  }
  .calc .keys {
    gap: 4px;
  }
  .calc .keys button {
    font-size: 1rem;
    padding: 8px 0;
    border-radius: 6px;
    line-height: 1.1;
  }
  .calc .disp {
    line-height: 1.2;
  }
}
/* Aufgabenkarte, Platzhalter, Handy-Ansicht */
.sheet input::placeholder {
  color: transparent;
}
.task-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.task-head strong {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

@media (max-width: 380px) {
  .kz .sent {
    font-size: 0.76rem;
    gap: 4px;
  }
  .kz .sent input {
    width: 70px !important;
    flex-basis: 70px !important;
  }
}

/* Computer: Aufgabentext links fest, Tabelle rechts */
@media (min-width: 1000px) {
  /* Die rechte Spalte ist höchstens so breit wie ihr Inhalt (--rechts), kein leerer Streifen daneben */
  main {
    --links: clamp(400px, 36vw, 560px);
    --rechts: 760px;
    max-width: calc(var(--links) + 18px + var(--rechts) + 32px);
    display: grid;
    grid-template-columns: var(--links) minmax(0, 1fr);
    column-gap: 18px;
    align-items: start;
  }
  /* Regel: Enthält die Aufgabe eine Tabelle (z. B. Konto), wird die Aufgabenkarte breiter */
  main:has(.konto),
  main:has(.datatab) {
    --links: 600px;
  }
  main > .tabs {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  main > .task-card {
    grid-column: 1;
    grid-row: 1 / span 30;
    position: sticky;
    top: 12px;
    max-height: calc(100vh - 198px);
    overflow: auto;
  }
  main > :not(.tabs):not(.task-card) {
    grid-column: 2;
  }
}

/* Handy: Tabelle zweireihig, Auswertung als Karten */
@media (max-width: 560px) {
  header {
    padding: 12px 14px;
  }
  main {
    padding: 12px 10px 50px;
  }
  .card {
    padding: 12px;
  }
  .sheet input::placeholder {
    color: #9aa5b5;
  }
  table.sheet {
    width: 100% !important;
    table-layout: auto;
  }
  .sheet colgroup,
  .sheet thead {
    display: none;
  }
  .sheet tbody,
  .sheet tr,
  .sheet td {
    display: block;
  }
  .sheet td {
    padding: 0;
    width: auto !important;
  }
  .sheet tr {
    display: grid;
    grid-template-columns: 76px 1fr 100px 36px;
    grid-template-areas: 'vz nm amt act' '. p1 p2 act';
    gap: 4px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
  }
  .sheet td.c-vz {
    grid-area: vz;
  }
  .sheet td.c-nm {
    grid-area: nm;
  }
  .sheet td.c-amt {
    grid-area: amt;
  }
  .sheet td.c-p1 {
    grid-area: p1;
  }
  .sheet td.c-p2 {
    grid-area: p2;
  }
  .sheet td.c-act {
    grid-area: act;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .sheet td.c-act button.ico {
    padding: 6px 0;
    text-align: center;
  }
  .sheet.nopct tr {
    grid-template-areas: 'vz nm amt act';
  }
  .sheet.nopct td.c-p {
    display: none;
  }
  .sheet td.c-p1 input,
  .sheet td.c-p2 input {
    padding: 5px 8px;
    font-size: 0.88rem;
  }
  .sheet select {
    padding-left: 6px;
    padding-right: 2px;
  }
  .kz .sent {
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.88rem;
  }
  .kz .sent input {
    width: 76px;
    flex: 0 0 76px;
    padding: 6px 8px;
  }
  table.res {
    min-width: 0;
  }
  .res thead {
    display: none;
  }
  .res tbody,
  .res tr,
  .res td {
    display: block;
  }
  .res tr {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 8px;
  }
  .res tr.missing {
    background: var(--bad-bg);
  }
  .res tr.missing td {
    background: transparent;
  }
  .res td {
    border: 0;
    padding: 2px 0;
  }
  .res td::before {
    content: attr(data-l);
    display: inline-block;
    min-width: 96px;
    color: var(--muted);
    font-size: 0.76rem;
  }
  .res td:first-child::before {
    display: none;
  }
  .res td:first-child {
    font-size: 0.95rem;
    margin-bottom: 4px;
  }
}
/* Auswertungstabelle: bei schmaler Fläche (nicht nur auf dem Handy) als Karten statt seitlich scrollen */
#res-table-wrap {
  container-type: inline-size;
}
@container (max-width: 720px) {
  #res-table-wrap table.res {
    min-width: 0;
  }
  #res-table-wrap .res thead {
    display: none;
  }
  #res-table-wrap .res tbody,
  #res-table-wrap .res tr,
  #res-table-wrap .res td {
    display: block;
  }
  #res-table-wrap .res tr {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 8px;
  }
  #res-table-wrap .res tr.missing {
    background: var(--bad-bg);
  }
  #res-table-wrap .res tr.missing td {
    background: transparent;
  }
  #res-table-wrap .res td {
    border: 0;
    padding: 2px 0;
  }
  #res-table-wrap .res td::before {
    content: attr(data-l);
    display: inline-block;
    min-width: 96px;
    color: var(--muted);
    font-size: 0.76rem;
  }
  #res-table-wrap .res td:first-child::before {
    display: none;
  }
  #res-table-wrap .res td:first-child {
    font-size: 0.95rem;
    margin-bottom: 4px;
  }
}
/* sehr kleine Handys (ab 320 px) */
@media (max-width: 400px) {
  header {
    padding: 12px;
  }
  header h1 {
    font-size: 1.05rem;
    min-width: 0;
  }
  header .calc-toggle {
    flex: 0 0 auto;
    padding: 6px 10px;
    font-size: 0.82rem;
  }
}
@media (max-width: 560px) {
  .kz .sent .lbl {
    white-space: normal;
  }
}
table.way td:first-child {
  width: 34%;
  vertical-align: top;
}
.vr {
  margin: 10px 0;
}
.vr label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}
.vr small {
  font-weight: 400;
  color: var(--muted);
}
.vr-in {
  display: flex;
  align-items: center;
  gap: 10px;
}
.vr-in input {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 160px;
}
.vr .live {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.reveal {
  font: inherit;
  font-size: 0.8rem;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: #fff;
  color: var(--accent);
  cursor: pointer;
  margin-left: 6px;
}
.reveal:hover {
  background: var(--accent);
  color: #fff;
}
.hidenote,
.lock-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 10px;
}
.lock-note {
  margin: 0 0 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--ink);
}
/* Vorrechnung in der Karte des ersten Teils */
.vr-box {
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.vr-h {
  margin: 0 0 6px;
  font-size: 0.98rem;
}
#parts > .card {
  margin-bottom: 14px;
}
/* Teilaufgaben mit hängendem Einzug: a) links, Text und graue Hinweise in einer Spalte */
.tpart {
  display: grid;
  grid-template-columns: 1.7em minmax(0, 1fr);
  margin: 10px 0 0;
}
.tpart .tl {
  font-weight: 600;
}
.tpart .tnote {
  margin-left: 0;
}
.tpart + .tpart {
  margin-top: 12px;
}
.tpart:first-child {
  margin-top: 0;
}
.altsw {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.alt-b {
  font: inherit;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.alt-b.on {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent) inset;
  font-weight: 600;
}
.alt-kw[hidden],
.alt-tab[hidden] {
  display: none;
}
.kz.kwbox {
  border-top: 0;
  padding-top: 0;
}
.kz.ansbox {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-bottom: 0;
}

/* Breite Fenster: Ist der Taschenrechner offen, bekommt die Seite rechts seinen Platz, nichts liegt darunter */
@media (min-width: 1500px) {
  body.calc-open #v-task main {
    margin-left: auto;
    margin-right: 302px;
  }
}
/* Kostenarten: jedes Beispiel ist eine Karte mit zwei Knopfpaaren */
.ka-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px 16px;
  align-items: center;
  padding: 12px 14px;
  margin: 0 0 10px;
}
.ka-text {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
  overflow-wrap: anywhere;
}
.ka-nr {
  flex: none;
  width: 1.8em;
  height: 1.8em;
  border-radius: 50%;
  background: var(--neutral-bg);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ka-btns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
.ka-grp {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 3px;
  border: 2px solid transparent;
  border-radius: 12px;
}
.ka-b {
  font: inherit;
  font-size: 0.92rem;
  min-height: 44px;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.ka-b.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.ka-grp.ok {
  border-color: var(--ok);
  background: var(--ok-bg);
}
.ka-grp.bad,
.ka-grp.empty {
  border-color: var(--bad);
  background: var(--bad-bg);
}
.ka-grp.empty {
  border-style: dashed;
}
.ka-res {
  grid-column: 1 / -1;
  font-size: 0.92rem;
}
.ka-res .t-ok {
  color: var(--ok);
  font-weight: 600;
}
.ka-res .t-bad {
  color: var(--bad);
  font-weight: 600;
}
.ka-res .muted {
  color: var(--muted);
}
@media (min-width: 720px) {
  .ka-item {
    grid-template-columns: minmax(0, 1fr) 330px;
  }
  .ka-btns {
    grid-template-columns: 1fr 1fr;
  }
  .ka-grp {
    grid-template-columns: 1fr;
  }
}
/* Fenster „Neu in Version …“ */
.dialog.neu {
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
}
.dialog.neu h2 {
  margin: 0 0 10px;
  font-size: 1.15rem;
}
.dialog.neu h3 {
  margin: 12px 0 4px;
  font-size: 0.95rem;
  color: var(--muted);
}
.dialog.neu ul {
  margin: 0 0 16px;
  padding-left: 1.2em;
}
.dialog.neu li {
  margin: 0 0 6px;
}
