/* ============================================================================
   cloudtec Plattform-Konfigurator — App styles
   Builds on colors_and_type.css. All hex/values come from --ct- tokens.
   ============================================================================ */

* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
html { font-size: 16px; }

/* Skip-to-content (visible only on keyboard focus) */
.skip-link {
  position: absolute;
  top: -40px; left: 8px;
  z-index: 1000;
  padding: 8px 14px;
  background: var(--primary-50);
  color: var(--primary-95);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--border-radius-sm);
  transition: top 0.15s ease;
}
.skip-link:focus { top: 8px; outline: 2px solid var(--outline-color-focus); }
body {
  background: var(--page-background);
  color: var(--text-color);
  font-family: var(--font-family);
  font-size: var(--font-size-md);
  line-height: var(--font-line-height-md);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* The HTML carries data-theme="light" | "dark"; tokens flip via color-scheme */
html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"]  { color-scheme: dark; }

/* ----------------------------------------------------------------------------
   App shell — full-bleed, fixed header, fixed footer, 62/38 split body
   ---------------------------------------------------------------------------- */
.app {
  display: grid;
  grid-template-rows: 64px 1fr 64px;
  grid-template-areas: "head" "body" "foot";
  height: 100vh;
}
.app__head { grid-area: head; }
.app__body { grid-area: body; min-height: 0; overflow: hidden; }
.app__foot { grid-area: foot; }

/* Header
   ----------------------------------------------------------------------------*/
.header {
  height: 100%;
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  align-items: center;
  padding: 0 28px;
  background: var(--global-background);
  border-bottom: 1px solid var(--border-color-soft);
  gap: 16px;
}
.header__brand { display: flex; align-items: center; gap: 12px; color: var(--text-color); }
.header__brand svg { height: 22px; width: auto; }
.header__brand .label {
  font-size: 11px; font-weight: 600; color: var(--text-color-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  border-left: 1px solid var(--border-color);
  padding-left: 12px; line-height: 1.1;
}
.header__brand .label small { display: block; font-size: 11px; }
.header__steps { display: flex; justify-content: center; }
.header__meta  { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }

/* Stepper
   ----------------------------------------------------------------------------*/
.stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--global-background-raised);
  border: 1px solid var(--border-color-soft);
  border-radius: var(--border-radius-full);
  padding: 4px;
}
.stepper__btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px;
  background: transparent; border: 0;
  font: 600 13px var(--font-family);
  color: var(--text-color-muted);
  border-radius: var(--border-radius-full);
  cursor: pointer; white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.stepper__btn:hover:not(:disabled) { color: var(--text-color); }
.stepper__btn:disabled { cursor: not-allowed; opacity: 0.5; }
.stepper__btn.is-active {
  background: var(--global-background);
  color: var(--text-color);
  box-shadow: var(--box-shadow-sm);
}
.stepper__btn .ix {
  width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--global-background-elevated); color: var(--text-color-muted);
  border-radius: 50%; font-size: 11px; font-weight: 700;
}
.stepper__btn.is-active .ix { background: var(--primary-50); color: var(--primary-95); }
.stepper__btn.is-done .ix  { background: var(--primary-50); color: var(--primary-95); }
.stepper__btn.is-done      { color: var(--text-color); }
.stepper__sep { width: 8px; height: 1px; background: var(--border-color); }

/* Body — main + sidebar */
.body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 490px;
  height: 100%;
  min-height: 0;
}
@media (max-width: 1280px) {
  .body { grid-template-columns: minmax(0, 1fr) 430px; }
}
.body__main {
  overflow: auto;
  padding: 32px 40px 80px;
  scroll-behavior: smooth;
}
.body__side {
  border-left: 1px solid var(--border-color-soft);
  background:
    radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--primary-50), transparent 92%) 0%, transparent 60%),
    radial-gradient(120% 80% at 0% 100%, color-mix(in srgb, var(--secondary-50), transparent 94%) 0%, transparent 55%),
    var(--global-background);
  overflow: auto;
  position: relative;
}

/* Footer
   ----------------------------------------------------------------------------*/
.footer {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 28px;
  background: var(--global-background);
  border-top: 1px solid var(--border-color-soft);
  gap: 16px;
}
.footer__left  { justify-self: start; }
.footer__center{ justify-self: center; font-size: 12px; color: var(--text-color-muted); display: flex; gap: 14px; align-items: center; }
.footer__right { justify-self: end; display: flex; gap: 10px; align-items: center; }

/* ----------------------------------------------------------------------------
   Atoms
   ---------------------------------------------------------------------------- */

/* Button */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  font: 600 14px var(--font-family);
  color: var(--text-color);
  background: var(--global-background);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--accent-05); border-color: var(--border-color-hard); }
html[data-theme="dark"] .btn:hover:not(:disabled) { background: var(--gray-80); }
.btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--outline-color-focus); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn[data-size="sm"] { height: 32px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn[data-size="xs"] { height: 26px; padding: 0 10px; font-size: 12px; gap: 4px; }
.btn[data-size="lg"] { height: 48px; padding: 0 22px; font-size: 15px; }
.btn[data-variant="icon"] { width: 40px; padding: 0; }
.btn[data-variant="icon"][data-size="sm"] { width: 32px; }
.btn[data-variant="icon"][data-size="xs"] { width: 26px; }

.btn[data-kind="primary"] {
  background: var(--primary-50); border-color: var(--primary-50); color: var(--primary-95);
}
.btn[data-kind="primary"]:hover:not(:disabled) { background: var(--primary-40); border-color: var(--primary-40); }
.btn[data-kind="ghost"] { background: transparent; border-color: transparent; }
.btn[data-kind="ghost"]:hover:not(:disabled) { background: var(--global-background-raised); }
.btn[data-kind="link"] {
  height: auto; padding: 0; background: transparent; border: 0;
  color: var(--text-color); text-decoration: none;
  font-weight: 500;
}
.btn[data-kind="link"] > span {
  text-decoration: underline; text-underline-offset: 0.2em;
  text-decoration-color: var(--accent-50);
}
.btn[data-kind="link"]:hover { color: var(--link-color-hover); }
.btn[data-kind="link"].btn-violet { color: var(--tertiary-60); font-weight: 600; }
.btn[data-kind="link"].btn-violet > span { text-decoration-color: var(--tertiary-60); }
.btn[data-kind="link"].btn-violet:hover { color: var(--tertiary-70, var(--tertiary-60)); filter: brightness(0.92); }
.btn[data-kind="quiet"] {
  background: var(--global-background-raised);
  border-color: transparent;
}
.btn[data-kind="quiet"]:hover:not(:disabled) { background: var(--global-background-elevated); }

/* Inputs */
.input, .textarea {
  width: 100%;
  background: var(--global-background);
  border: 1px solid var(--border-color-hard);
  border-radius: var(--border-radius-sm);
  font: 400 14px var(--font-family);
  color: var(--text-color);
  padding: 10px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input { height: 40px; padding: 0 12px; }
.textarea { min-height: 120px; line-height: 1.5; resize: vertical; font-family: var(--font-family); }
.input::placeholder, .textarea::placeholder { color: var(--text-color-muted); }
.input:focus, .textarea:focus {
  outline: 0; border-color: var(--accent-50);
  box-shadow: 0 0 0 3px var(--outline-color-focus);
}
.input.is-invalid, .textarea.is-invalid { border-color: var(--danger-50); }
.input.is-invalid:focus, .textarea.is-invalid:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger-50), transparent 75%); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 13px; font-weight: 500; color: var(--text-color); }
.field__hint  { font-size: 12px; color: var(--text-color-muted); }
.field__error { font-size: 12px; color: var(--danger-60); display: flex; align-items: center; gap: 6px; }
.field__counter {
  text-align: right; font-size: 12px; color: var(--text-color-muted);
  font-variant-numeric: tabular-nums;
}

/* Section / block headings */
.block {
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}
/* When a .block contains direct content (not just a heading), give it a card surface */
.block.is-card {
  background: var(--global-background);
  border: 1px solid var(--border-color-soft);
  border-radius: var(--border-radius-md);
  padding: 24px 28px;
  box-shadow: var(--box-shadow-xs);
}
html[data-theme="dark"] .block.is-card {
  background: color-mix(in srgb, var(--global-background) 92%, transparent);
}
.block__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 16px;
}
.block__cat {
  font-size: 11px; font-weight: 600; color: var(--text-color-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.block__title { font-size: 18px; font-weight: 600; margin: 4px 0 10px; line-height: 1.3; }
.block__lead  { font-size: 14px; color: var(--text-color-soft); margin: 0; max-width: 60ch; }

.subblock { margin-top: 24px; }
.subblock__title {
  font-size: 16px; font-weight: 600; margin: 0 0 12px;
  display: flex; align-items: center; gap: 8px;
}
@media (max-width: 768px) {
  .pill.is-hide-mobile { display: none; }
}
.subblock__title .req { color: var(--danger-60); font-weight: 700; }

/* Card grids — Multi/Single-select */
.cardgrid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.cardgrid[data-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cardgrid[data-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.optcard {
  position: relative;
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 14px 12px;
  text-align: left;
  background: var(--global-background);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
  color: var(--text-color);
  min-height: 72px;
}
.optcard:hover { border-color: var(--border-color-hard); background: var(--accent-05); }
html[data-theme="dark"] .optcard:hover { background: var(--gray-80); }
.optcard:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--outline-color-focus); }
.optcard.is-selected {
  background: var(--primary-05);
  border-color: var(--primary-50);
  box-shadow: 0 0 0 1px var(--primary-50) inset;
}
html[data-theme="dark"] .optcard.is-selected {
  background: color-mix(in srgb, var(--primary-90) 60%, var(--gray-90));
}
.optcard.is-disabled { opacity: 0.6; cursor: not-allowed; background: var(--global-background-raised); }
.optcard__row { display: flex; align-items: center; gap: 8px; }
.optcard__icon {
  width: 28px; height: 28px; flex: 0 0 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--border-radius-sm);
  background: var(--global-background-raised);
  color: var(--text-color-soft);
  font-size: 13px;
}
.optcard.is-selected .optcard__icon { background: var(--primary-10); color: var(--primary-70); }
.optcard__title { font-size: 14px; font-weight: 600; line-height: 1.2; }
.optcard__sub   { font-size: 12px; color: var(--text-color-muted); line-height: 1.35; margin-top: 2px; }
.optcard__check {
  position: absolute; top: 10px; right: 10px;
  width: 18px; height: 18px; border-radius: 4px;
  border: 1px solid var(--border-color-hard);
  background: var(--global-background);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; color: transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.optcard.is-selected .optcard__check {
  background: var(--primary-50); border-color: var(--primary-50); color: var(--primary-95);
}
.optcard[data-radio="true"] .optcard__check { border-radius: 50%; }
.optcard__ai {
  position: absolute; top: 8px; right: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--warning-50);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning-50), transparent 75%);
  cursor: help;
}

/* Segmented control */
.segmented {
  display: inline-flex;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: var(--global-background-raised);
  padding: 3px;
  gap: 0;
  width: 100%;
  flex-wrap: wrap;
}
.segmented__seg {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 38px; padding: 4px 12px;
  background: transparent; border: 0;
  font: 600 13px var(--font-family); color: var(--text-color-muted);
  border-radius: var(--border-radius-xs);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: center;
}
.segmented__seg .seg-sub { font-weight: 400; font-size: 11px; color: var(--text-color-muted); margin-top: 1px; }
.segmented__seg:hover { color: var(--text-color); }
.segmented__seg.is-active {
  background: var(--global-background);
  color: var(--text-color);
  box-shadow: var(--box-shadow-sm);
}
.segmented[data-size="sm"] .segmented__seg { height: 30px; padding: 0 10px; font-size: 12px; }
.segmented[data-stack="true"] .segmented__seg { height: auto; min-height: 56px; padding: 8px 10px; }

/* Radio list */
.radiolist { display: flex; flex-direction: column; gap: 8px; }
.radiolist__opt {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px;
  background: var(--global-background);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-family: inherit; color: var(--text-color); text-align: left;
}
.radiolist__opt:hover { background: var(--accent-05); border-color: var(--border-color-hard); }
html[data-theme="dark"] .radiolist__opt:hover { background: var(--gray-80); }
.radiolist__opt.is-selected {
  background: var(--primary-05); border-color: var(--primary-50);
  box-shadow: 0 0 0 1px var(--primary-50) inset;
}
html[data-theme="dark"] .radiolist__opt.is-selected {
  background: color-mix(in srgb, var(--primary-90) 60%, var(--gray-90));
}
.radiolist__dot {
  flex: 0 0 16px; width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid var(--border-color-hard); background: var(--global-background);
  margin-top: 2px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.radiolist__opt.is-selected .radiolist__dot {
  border-color: var(--primary-50);
  background: var(--global-background);
}
.radiolist__opt.is-selected .radiolist__dot::after {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--primary-50);
}
.radiolist__body { flex: 1; }
.radiolist__title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.radiolist__sub   { font-size: 12px; color: var(--text-color-muted); line-height: 1.4; margin-top: 2px; margin-left: 5px; }

/* Chip group */
.chipgroup { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  background: var(--global-background);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-full);
  font: 500 13px var(--font-family); color: var(--text-color);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover { border-color: var(--border-color-hard); background: var(--accent-05); }
html[data-theme="dark"] .chip:hover { background: var(--gray-80); }
.chip.is-selected {
  background: var(--primary-50); border-color: var(--primary-50); color: var(--primary-95);
}
.chip.is-selected:hover { background: var(--primary-40); border-color: var(--primary-40); }
.chip[data-tone="warning"] { background: var(--warning-10); border-color: var(--warning-30); color: var(--warning-80); }
html[data-theme="dark"] .chip[data-tone="warning"] { background: var(--warning-90); color: var(--warning-30); border-color: var(--warning-70); }

/* Slider — custom-styled native range */
.slider-row { display: flex; flex-direction: column; gap: 8px; }
.slider-row .slider-meta {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  font-size: 12px; color: var(--text-color-muted);
}
.slider-row .slider-value {
  font-size: 18px; font-weight: 600; color: var(--text-color);
  font-variant-numeric: tabular-nums;
}
.slider-row .slider-recommend {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-color-muted);
}
.slider-row .slider-recommend strong { color: var(--text-color); font-weight: 600; }

input[type="range"].slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 32px;
  background: transparent; cursor: pointer;
  --slider-fill: var(--primary-50);
  --slider-track: color-mix(in srgb, var(--text-color), transparent 85%);
}
input[type="range"].slider:disabled { opacity: 0.5; cursor: not-allowed; }
input[type="range"].slider:focus { outline: 0; }
input[type="range"].slider::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(to right,
    var(--slider-fill) 0%, var(--slider-fill) var(--slider-pct, 50%),
    var(--slider-track) var(--slider-pct, 50%), var(--slider-track) 100%);
}
input[type="range"].slider::-moz-range-track {
  height: 6px; border-radius: 3px; background: var(--slider-track);
}
input[type="range"].slider::-moz-range-progress {
  height: 6px; border-radius: 3px; background: var(--slider-fill);
}
input[type="range"].slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; margin-top: -7px;
  background: var(--global-background);
  border: 2px solid var(--primary-50);
  border-radius: 50%;
  box-shadow: var(--box-shadow-sm);
  transition: transform 0.1s, box-shadow 0.15s;
}
input[type="range"].slider::-webkit-slider-thumb:hover { transform: scale(1.1); }
input[type="range"].slider:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px var(--outline-color-focus);
}
input[type="range"].slider::-moz-range-thumb {
  width: 20px; height: 20px;
  background: var(--global-background);
  border: 2px solid var(--primary-50);
  border-radius: 50%;
}

.slider-marker {
  position: relative; height: 6px; margin-top: -8px;
  pointer-events: none;
}
.slider-marker .mark {
  position: absolute; top: -2px; width: 2px; height: 10px;
  background: var(--text-color-muted);
  transform: translateX(-50%);
  border-radius: 1px;
}
.slider-marker .mark::after {
  content: attr(data-label);
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  white-space: nowrap;
  font-size: 11px; color: var(--text-color-muted);
}

/* Counter / repeater */
.repeater { display: flex; flex-direction: column; gap: 12px; }
.repeater-item {
  background: var(--global-background);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 16px;
  position: relative;
}
.repeater-item__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
  font-size: 13px; font-weight: 600; color: var(--text-color);
}
.repeater-add {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px;
  background: var(--global-background);
  border: 1px dashed var(--border-color-hard);
  border-radius: var(--border-radius-md);
  color: var(--text-color); font: 600 13px var(--font-family);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.repeater-add:hover { background: var(--accent-05); border-color: var(--accent-50); border-style: solid; }
html[data-theme="dark"] .repeater-add:hover { background: var(--gray-80); }

/* Collapsible block */
.collapsible {
  border: 1px solid var(--border-color-soft);
  background: var(--global-background);
  border-radius: var(--border-radius-md);
  overflow: hidden;
}
.collapsible + .collapsible { margin-top: 10px; }
.collapsible__head {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; background: transparent;
  border: 0; cursor: pointer;
  font: 600 14px var(--font-family); color: var(--text-color);
  text-align: left;
}
.collapsible__head:hover { background: var(--global-background-raised); }
.collapsible__chev { color: var(--text-color-muted); transition: transform 0.2s; font-size: 12px; }
.collapsible[data-open="true"] .collapsible__chev { transform: rotate(90deg); }
.collapsible__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--global-background-raised);
  color: var(--text-color-muted); font-size: 12px; font-weight: 600;
}
.collapsible[data-open="true"] .collapsible__num { background: var(--primary-10); color: var(--primary-70); }
html[data-theme="dark"] .collapsible[data-open="true"] .collapsible__num { background: var(--primary-90); color: var(--primary-30); }
.collapsible__hint { margin-left: auto; font-size: 12px; color: var(--text-color-muted); font-weight: 400; }
.collapsible__body {
  padding: 8px 18px 22px;
  border-top: 1px solid var(--border-color-soft);
  background: var(--global-background);
  display: none;
}
.collapsible[data-open="true"] .collapsible__body { display: block; }

/* Collapsible head wrap (button + action) */
.collapsible__head-wrap {
  display: flex; align-items: stretch; gap: 8px;
  padding-right: 12px;
}
.collapsible__head-wrap .collapsible__head { flex: 1; min-width: 0; }
.collapsible__action {
  display: flex; align-items: center;
  flex: 0 0 auto;
}

/* Consult toggle ("Weiss nicht, benötige Beratung") */
.consult-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 14px;
  border: 1px solid var(--border-color-soft);
  border-radius: 999px;
  background: var(--global-background);
  color: var(--text-color-muted);
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.consult-btn i { font-size: 13px; color: var(--text-color-muted); }
.consult-btn:hover {
  border-color: var(--accent-50);
  color: var(--accent-70);
  background: color-mix(in srgb, var(--accent-50), transparent 92%);
}
.consult-btn:hover i { color: var(--accent-50); }
.consult-btn.is-active {
  border-color: var(--accent-50);
  background: var(--accent-50);
  color: var(--global-background);
  font-weight: 600;
}
.consult-btn.is-active i { color: var(--global-background); }
html[data-theme="dark"] .consult-btn.is-active {
  background: var(--accent-50); color: #fff;
}
html[data-theme="dark"] .consult-btn.is-active i { color: #fff; }

/* Highlight section when consult mode is active */
.collapsible[data-consult="true"] {
  border-color: var(--accent-50);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-50), transparent 70%);
}
.collapsible[data-consult="true"] .collapsible__num {
  background: color-mix(in srgb, var(--accent-50), transparent 85%);
  color: var(--accent-70);
}
html[data-theme="dark"] .collapsible[data-consult="true"] .collapsible__num {
  background: color-mix(in srgb, var(--accent-50), transparent 75%);
  color: #fff;
}

/* Inline banner inside section body when consult is on */
.consult-banner {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 4px 0 16px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--accent-50), transparent 92%);
  border: 1px solid color-mix(in srgb, var(--accent-50), transparent 70%);
  border-radius: 8px;
  color: var(--text-color);
  font-size: 13px; line-height: 1.5;
}
.consult-banner i { color: var(--accent-50); margin-top: 2px; }
html[data-theme="dark"] .consult-banner {
  background: color-mix(in srgb, var(--accent-50), transparent 80%);
  color: #fff;
}

/* Banner / Alert */
.banner {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--info-10); border: 1px solid var(--info-30);
  border-radius: var(--border-radius-md);
  padding: 12px 14px;
  font-size: 13px; color: var(--info-80);
}
html[data-theme="dark"] .banner {
  background: color-mix(in srgb, var(--info-90), transparent 30%);
  border-color: var(--info-70); color: var(--info-30);
}
.banner i:first-child { margin-top: 2px; flex: 0 0 auto; color: var(--info-60); }
.banner.is-warning { background: var(--warning-10); border-color: var(--warning-30); color: var(--warning-80); }
.banner.is-warning i:first-child { color: var(--warning-60); }
html[data-theme="dark"] .banner.is-warning {
  background: color-mix(in srgb, var(--warning-90), transparent 30%);
  border-color: var(--warning-70); color: var(--warning-30);
}
.banner.is-success { background: var(--success-10); border-color: var(--success-30); color: var(--success-80); }
.banner.is-success i:first-child { color: var(--success-60); }
.banner__title { font-weight: 600; }
.banner__body  { margin-top: 2px; line-height: 1.45; }
.banner__close { margin-left: auto; background: transparent; border: 0; cursor: pointer; color: inherit; opacity: 0.7; padding: 0 4px; }
.banner__close:hover { opacity: 1; }

/* Tooltip helper text */
.helper-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 0; padding: 0;
  color: var(--text-color-muted); font: 500 12px var(--font-family);
  cursor: pointer; text-decoration: underline;
  text-decoration-color: var(--border-color-hard);
  text-underline-offset: 0.25em;
}
.helper-link:hover { color: var(--text-color); }

/* Pill (status badge) */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; padding: 3px 10px;
  border-radius: var(--border-radius-full);
  background: var(--global-background-raised); color: var(--text-color);
  letter-spacing: 0.02em;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill[data-tone="primary"] { background: var(--primary-10); color: var(--primary-70); }
html[data-theme="dark"] .pill[data-tone="primary"] { background: var(--primary-90); color: var(--primary-30); }
.pill[data-tone="warning"] { background: var(--warning-10); color: var(--warning-80); }
html[data-theme="dark"] .pill[data-tone="warning"] { background: var(--warning-90); color: var(--warning-30); }
.pill[data-tone="info"]    { background: var(--info-10); color: var(--info-70); }
html[data-theme="dark"] .pill[data-tone="info"]    { background: var(--info-90); color: var(--info-30); }
.pill[data-tone="muted"]   { background: var(--global-background-elevated); color: var(--text-color-muted); }

/* ----------------------------------------------------------------------------
   Live evaluation sidebar
   ---------------------------------------------------------------------------- */
.live {
  padding: 24px 24px 64px;
  display: flex; flex-direction: column; gap: 20px;
}
.live__head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; font-weight: 600; color: var(--text-color-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color-soft);
}
.live__head .live__live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: var(--success-70);
  text-transform: none; letter-spacing: 0;
}
html[data-theme="dark"] .live__head .live__live { color: var(--success-30); }
.live__live::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--success-50);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success-50), transparent 70%);
  animation: live-pulse 2s ease-in-out infinite;
}
@keyframes live-pulse {
  0%,100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--success-50), transparent 70%); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--success-50), transparent 85%); }
}

.live__row {
  display: flex; flex-direction: column; gap: 6px;
}
.live__label {
  font-size: 11px; font-weight: 600; color: var(--text-color-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.live__value {
  font-size: 28px; font-weight: 600; line-height: 1.1;
  font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: baseline; gap: 8px;
}
.live__value.live__value--lg { font-size: 32px; }
.live__value small { font-size: 13px; font-weight: 500; color: var(--text-color-muted); }
.live__sub  { font-size: 12px; color: var(--text-color-muted); line-height: 1.5; }
.live__divider { height: 1px; background: var(--border-color-soft); margin: 4px 0; }

/* Pulse on update */
.pulse-on-change {
  animation: value-pulse 0.4s ease-out;
}
@keyframes value-pulse {
  0% { background: color-mix(in srgb, var(--primary-50), transparent 65%); }
  100% { background: transparent; }
}

/* Complexity dots */
.complexity-dots { display: inline-flex; align-items: center; gap: 4px; }
.complexity-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: color-mix(in srgb, var(--text-color), transparent 80%);
}
.complexity-dots span.is-on { background: var(--primary-50); }

/* Confidence band bar */
.band {
  position: relative; height: 24px;
  background: var(--global-background-elevated);
  border-radius: 4px; overflow: hidden;
  margin-top: 8px;
}
.band__fill {
  position: absolute; top: 0; bottom: 0;
  background: linear-gradient(to right,
    color-mix(in srgb, var(--primary-50), transparent 70%),
    var(--primary-50),
    color-mix(in srgb, var(--primary-50), transparent 70%));
}
.band__pin {
  position: absolute; top: -2px; bottom: -2px;
  width: 3px; background: var(--text-color);
  border-radius: 2px;
}
.band__legend {
  margin-top: 6px;
  display: flex; justify-content: space-between; font-size: 11px; color: var(--text-color-muted);
  font-variant-numeric: tabular-nums;
}

/* Top driver bars */
.driver { display: flex; flex-direction: column; gap: 6px; }
.driver + .driver { margin-top: 8px; }
.driver__head { display: flex; justify-content: space-between; font-size: 12px; }
.driver__head strong { color: var(--text-color); font-weight: 600; }
.driver__head span { color: var(--text-color-muted); font-variant-numeric: tabular-nums; }
.driver__bar { height: 6px; background: var(--global-background-elevated); border-radius: 3px; overflow: hidden; }
.driver__bar > span { display: block; height: 100%; background: var(--primary-50); border-radius: 3px; transition: width 0.4s ease-out; }
.driver__bar > span[data-rank="2"] { background: var(--primary-40); }
.driver__bar > span[data-rank="3"] { background: var(--primary-30); }

/* Phase donut SVG */
.donut { display: flex; align-items: center; gap: 14px; }
.donut svg { flex: 0 0 96px; }
.donut__legend { display: flex; flex-direction: column; gap: 4px; font-size: 12px; flex: 1; min-width: 0; }
.donut__legend .row { display: flex; align-items: center; gap: 8px; }
.donut__legend .sw { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 8px; }
.donut__legend .lbl { flex: 1; color: var(--text-color); }
.donut__legend .pct { color: var(--text-color-muted); font-variant-numeric: tabular-nums; }

/* Empty state — Live eval before any input */
.empty-state {
  text-align: center; padding: 48px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.empty-state__art {
  width: 96px; height: 96px;
  display: flex; align-items: center; justify-content: center;
}
.empty-state__title { font-size: 14px; font-weight: 600; }
.empty-state__body  { font-size: 13px; color: var(--text-color-muted); line-height: 1.5; max-width: 28ch; }

/* ----------------------------------------------------------------------------
   Costs page (Seite 3) specifics
   ---------------------------------------------------------------------------- */
.cost-card {
  background: var(--global-background);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.cost-card__cat { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-color-muted); }
.cost-card__title { font-size: 16px; font-weight: 600; }
.cost-card__rate  { font-size: 13px; color: var(--text-color-muted); }
.cost-card__cat + .cost-card__title,
.cost-card__title + .cost-card__rate { margin-top: 3px; }
.cost-card__amount { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cost-card__body { font-size: 13px; color: var(--text-color-soft); line-height: 1.45; flex: 1; }

/* Cost-card sum row (Service-Optionen / Beratung) */
.cost-card--sum {
  background: var(--accent-05);
  border-color: var(--accent-30, var(--border-color-hard));
  flex-direction: row; align-items: center;
}
html[data-theme="dark"] .cost-card--sum { background: var(--gray-90); }

/* Optcard price badge — slot into existing OptCard `badge` prop */
.optcard__price {
  position: absolute; top: 10px; right: 10px;
  font-size: 11px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-color-soft);
  background: var(--global-background-raised);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 3px 8px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.optcard.is-selected .optcard__price {
  color: var(--primary-70);
  background: var(--primary-05);
  border-color: var(--primary-30, var(--primary-50));
}
html[data-theme="dark"] .optcard.is-selected .optcard__price {
  color: var(--primary-30);
  background: color-mix(in srgb, var(--primary-90) 50%, transparent);
}

/* Toggle switch (Service-Optionen on/off) */
.toggle-switch {
  position: relative;
  flex-shrink: 0;
  width: 44px; height: 24px;
  border-radius: 999px;
  background: var(--gray-30);
  border: 1px solid var(--border-color);
  padding: 0;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.toggle-switch:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--outline-color-focus); }
.toggle-switch__thumb {
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--global-background);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.18s ease, background 0.15s;
}
.toggle-switch.is-on { background: var(--primary-50); border-color: var(--primary-50); }
.toggle-switch.is-on .toggle-switch__thumb { transform: translateX(20px); background: var(--primary-95); }
html[data-theme="dark"] .toggle-switch { background: var(--gray-70); }
html[data-theme="dark"] .toggle-switch.is-on { background: var(--primary-50); }

/* Advisory card — recommended highlight */
.advisory-card.is-recommended {
  border-color: var(--primary-50);
  box-shadow: 0 0 0 1px var(--primary-50) inset;
}
.advisory-card__badge {
  display: inline-flex; align-items: center; gap: 4px;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px; font-weight: 700;
  background: var(--primary-50); color: var(--primary-95);
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.advisory-card__badge i { font-size: 9px; }

/* Year overview table */
.year-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 13px;
  background: var(--global-background);
  border: 1px solid var(--border-color-soft);
  border-radius: var(--border-radius-md);
  overflow: hidden;
}
.year-table thead th { background: var(--global-background-raised); }
.year-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--global-background-raised) 50%, var(--global-background)); }
.year-table thead th {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-color-muted); font-weight: 600;
  text-align: right; padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  background: var(--global-background-raised);
  position: sticky; top: 0; z-index: 1;
}
.year-table thead th:first-child { text-align: left; }
.year-table tbody td {
  padding: 10px 14px;
  text-align: right;
  border-bottom: 1px solid var(--border-color-soft);
  font-variant-numeric: tabular-nums;
}
.year-table tbody td:first-child { text-align: left; color: var(--text-color); }
.year-table tbody tr.is-total td {
  font-weight: 600; background: var(--global-background-raised);
  border-top: 1px solid var(--border-color);
}
.year-table tbody td.dim { color: var(--text-color-muted); }
.year-table tbody td.zero { color: var(--text-color-muted); }
.year-table[data-mode="chart"] thead th { display: none; }

/* Stacked-bar chart */
.barchart { display: grid; gap: 12px; padding: 12px 0; }
.barchart__row {
  display: grid; grid-template-columns: 60px 1fr 110px; gap: 10px; align-items: center;
}
.barchart__lbl { font-size: 13px; font-weight: 600; color: var(--text-color); }
.barchart__bar { height: 28px; border-radius: 4px; background: var(--global-background-elevated); display: flex; overflow: hidden; }
.barchart__seg { height: 100%; transition: width 0.3s; }
.barchart__total { font-size: 13px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------------------------
   Loading overlay
   ---------------------------------------------------------------------------- */
.loading {
  position: fixed; inset: 0;
  background: color-mix(in srgb, var(--page-background), transparent 15%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.loading__card {
  width: 480px; max-width: calc(100% - 48px);
  background: var(--global-background);
  border: 1px solid var(--border-color-soft);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--box-shadow-xl);
  padding: 36px 36px 32px;
  display: flex; flex-direction: column; gap: 20px;
  align-items: center; text-align: center;
}
.loading__diamond {
  width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
}
.loading__diamond svg { width: 56px; height: 56px; animation: diamond-pulse 1.6s ease-in-out infinite; }
@keyframes diamond-pulse {
  0%, 100% { transform: scale(1); opacity: 0.95; }
  50% { transform: scale(1.08); opacity: 1; }
}
.loading__title { font-size: 18px; font-weight: 600; }
.loading__body  { font-size: 14px; color: var(--text-color-muted); }
.loading__steps {
  width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 12px;
  text-align: left;
}
.loading__step {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: var(--text-color-muted);
}
.loading__step .ix {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--global-background-raised);
  border: 1px solid var(--border-color);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px;
}
.loading__step.is-done .ix { background: var(--primary-50); border-color: var(--primary-50); color: var(--primary-95); }
.loading__step.is-done { color: var(--text-color); }
.loading__step.is-active .ix {
  border-color: var(--primary-50);
  background: color-mix(in srgb, var(--primary-50), transparent 80%);
  color: var(--primary-50);
}
.loading__step.is-active { color: var(--text-color); }
.loading__step.is-active .ix .spinner {
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--primary-50); border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Violet variant — KI-Analyse Overlay mit Synapsen-Hintergrund ─────── */
.loading--violet {
  background: color-mix(in srgb, var(--page-background), transparent 15%);
  overflow: hidden;
}
.loading__synapses {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}
.loading--violet .loading__card {
  position: relative;
  z-index: 1;
  border-color: color-mix(in srgb, var(--tertiary-50) 35%, var(--border-color-soft));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--tertiary-50) 25%, transparent),
    0 20px 60px -20px hsla(270, 70%, 30%, 0.45),
    0 8px 24px -8px hsla(270, 60%, 25%, 0.35);
}
.loading--violet .loading__diamond svg { color: var(--tertiary-50); }
.loading--violet .loading__diamond svg rect { fill: var(--tertiary-50) !important; }
.loading--violet .loading__title {
  background: linear-gradient(90deg, var(--tertiary-70), var(--tertiary-50) 50%, var(--tertiary-40));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.loading--violet .loading__step.is-done .ix {
  background: var(--tertiary-50); border-color: var(--tertiary-50); color: #fff;
}
.loading--violet .loading__step.is-active .ix {
  border-color: var(--tertiary-50);
  background: color-mix(in srgb, var(--tertiary-50), transparent 80%);
  color: var(--tertiary-50);
}
.loading--violet .loading__step.is-active .ix .spinner {
  border-color: var(--tertiary-50); border-top-color: transparent;
}

/* 30-second countdown progress bar (violet variant) */
.loading__progress {
  width: 100%; max-width: 320px;
  height: 6px;
  margin: 14px auto 4px;
  background: color-mix(in srgb, var(--tertiary-50), transparent 85%);
  border-radius: 3px;
  overflow: hidden;
}
.loading__progress-fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--tertiary-50), var(--tertiary-60));
  border-radius: 3px;
  animation: loading-progress 30s linear forwards;
}
@keyframes loading-progress {
  from { width: 0; }
  to   { width: 100%; }
}

/* ----------------------------------------------------------------------------
   Drawer
   ---------------------------------------------------------------------------- */
.drawer-scrim {
  position: fixed; inset: 0; z-index: 90;
  background: color-mix(in srgb, var(--base-dark), transparent 55%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.drawer-scrim.is-open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 91;
  width: 600px; max-width: calc(100vw - 60px);
  background: var(--global-background);
  border-left: 1px solid var(--border-color-soft);
  box-shadow: var(--box-shadow-xl);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
  display: flex; flex-direction: column;
  min-height: 0;
}
.drawer.is-open { transform: translateX(0); }
.drawer__head {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border-color-soft);
}
.drawer__title {
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.015em;
  flex: 1;
}
.drawer__body  {
  flex: 1; overflow: auto;
  padding: 28px 32px 40px;
  display: flex; flex-direction: column;
  gap: 0;
}
.drawer__lead {
  font-size: 15px; line-height: 1.6;
  color: var(--text-color);
  margin: 0 0 12px;
  max-width: 56ch;
}
.drawer__lead:first-of-type {
  font-size: 16px; font-weight: 500;
  color: var(--text-color);
  line-height: 1.5;
}
.drawer__lead:last-of-type {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color-soft);
}
.drawer__section {
  padding: 18px 0 0;
}
.drawer__section + .drawer__section {
  margin-top: 6px;
  border-top: 1px solid color-mix(in srgb, var(--border-color-soft), transparent 40%);
}
.drawer__section h4 {
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary-70);
  margin: 0 0 10px;
}
html[data-theme="dark"] .drawer__section h4 { color: var(--primary-40); }
.drawer__section ul {
  margin: 0; padding-left: 20px;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13.5px; line-height: 1.55; color: var(--text-color);
}
.drawer__section ul li::marker {
  color: var(--primary-50);
}
.drawer__section-body {
  margin: 0;
  font-size: 14.5px; line-height: 1.6;
  color: var(--text-color);
  max-width: 56ch;
}
.drawer__section:last-child .drawer__section-body {
  color: var(--text-color-soft);
}
.drawer__tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border-color-soft);
  margin: -8px -24px 0;
  padding: 0 24px;
}
.drawer__tab {
  background: transparent; border: 0; cursor: pointer;
  padding: 10px 16px;
  font: 600 13px var(--font-family); color: var(--text-color-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.drawer__tab:hover { color: var(--text-color); }
.drawer__tab.is-active { color: var(--text-color); border-bottom-color: var(--primary-50); }

/* ----------------------------------------------------------------------------
   Result / Review screen
   ---------------------------------------------------------------------------- */
.result-hero {
  background: var(--global-background);
  border: 1px solid var(--border-color-soft);
  border-radius: var(--border-radius-lg);
  padding: 32px 36px 28px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.result-hero::before {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 220px; height: 220px;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--primary-50), transparent 80%) 0%, transparent 70%);
  pointer-events: none;
}
.result-hero__cat { font-size: 11px; font-weight: 600; color: var(--text-color-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.result-hero__title { font-size: 28px; font-weight: 600; margin: 6px 0 4px; line-height: 1.15; }
.result-hero__pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary-10); color: var(--primary-70); border-radius: var(--border-radius-full);
  padding: 4px 12px; font-size: 13px; font-weight: 600;
  margin-top: 8px;
}
html[data-theme="dark"] .result-hero__pill { background: var(--primary-90); color: var(--primary-30); }
.result-hero__pill::before {
  content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--primary-50); transform: rotate(45deg);
}
.kpi-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  margin-top: 24px;
}
.kpi {
  background: var(--global-background-raised);
  border: 1px solid var(--border-color-soft);
  border-radius: var(--border-radius-md);
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 4px;
}
.kpi__label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-color-muted); }
.kpi__value { font-size: 28px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi__sub   { font-size: 12px; color: var(--text-color-muted); }

.result-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.result-grid__col { display: flex; flex-direction: column; gap: 20px; }
.result-card {
  background: var(--global-background);
  border: 1px solid var(--border-color-soft);
  border-radius: var(--border-radius-md);
  padding: 22px 24px;
  display: flex; flex-direction: column; gap: 14px;
}
.result-card__title { font-size: 16px; font-weight: 600; }

/* Inputs review list */
.review-group { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-top: 1px solid var(--border-color-soft); }
.review-group:first-child { border-top: 0; padding-top: 0; }
.review-group__head {
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
  font-size: 12px; font-weight: 600; color: var(--text-color-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.review-group__head a { font-size: 11px; color: var(--text-color-muted); text-decoration: underline; text-decoration-color: var(--border-color); cursor: pointer; }
.review-group__head a:hover { color: var(--accent-50); }
.review-row { display: grid; grid-template-columns: 220px 1fr; gap: 12px; padding: 6px 0; font-size: 13px; }
.review-row .k { color: var(--text-color-muted); }
.review-row .v { color: var(--text-color); }
.review-row .v.is-empty { color: var(--text-color-muted); font-style: italic; }

/* ----------------------------------------------------------------------------
   Misc
   ---------------------------------------------------------------------------- */
.muted { color: var(--text-color-muted); }
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack-md { display: flex; flex-direction: column; gap: 16px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tabnum { font-variant-numeric: tabular-nums; }

/* Thin scrollbars */
.body__main, .body__side, .drawer__body, .year-table {
  scrollbar-width: thin;
  scrollbar-color: var(--border-color-hard) transparent;
}
.body__main::-webkit-scrollbar, .body__side::-webkit-scrollbar { width: 8px; height: 8px; }
.body__main::-webkit-scrollbar-thumb, .body__side::-webkit-scrollbar-thumb {
  background: var(--border-color-hard); border-radius: 4px;
}

/* Hide chrome on print (basic) */
@media print {
  .header, .footer, .body__side { display: none; }
  .body { grid-template-columns: 1fr; }
}


/* === HelpHint / Tooltip ===================================================== */
.helphint {
  display: inline-flex;
  position: relative;
  margin-left: 6px;
  vertical-align: middle;
}
.helphint__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--text-color-muted);
  border-radius: 50%;
  cursor: help;
  padding: 0;
  transition: color .12s, background .12s;
}
.helphint__btn:hover { color: var(--cloudtec-primary, #02b97e); background: var(--surface-hover, rgba(0,0,0,.04)); }
.helphint[data-open="true"] .helphint__btn { color: var(--cloudtec-primary, #02b97e); }
.helphint__pop {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  background: var(--text-color-strong, #0c1117);
  color: #fff;
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 400;
  width: 240px;
  max-width: 80vw;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  pointer-events: none;
  text-align: left;
  white-space: normal;
}
.helphint__pop::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text-color-strong, #0c1117);
}

/* RadioList — gap between options */
.radiolist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* === "Nächste Schritte" / Wie geht es weiter — violet card ================= */
.next-steps-card {
  background: linear-gradient(135deg, #5b50ff 0%, #7c69ff 100%);
  color: #fff;
  border: 0;
  border-radius: 14px;
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
}
.next-steps-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  background: rgba(255,255,255,.07);
  border-radius: 50%;
  pointer-events: none;
}
.next-steps-card .result-card__title { color: #fff; }
.next-steps-card ol { color: rgba(255,255,255,.92); }
.next-steps-card ol strong { color: #fff; }
.next-steps-card .muted { color: rgba(255,255,255,.7) !important; }
.next-steps-card .btn[data-kind="primary"] {
  background: #fff;
  color: #2a1f9c;
  border-color: #fff;
}
.next-steps-card .btn[data-kind="primary"]:hover { background: rgba(255,255,255,.92); }
.next-steps-card .btn[data-kind="ghost"],
.next-steps-card .btn:not([data-kind="primary"]) {
  background: rgba(255,255,255,.12);
  color: #fff;
  border-color: rgba(255,255,255,.25);
}
.next-steps-card .btn:not([data-kind="primary"]):hover { background: rgba(255,255,255,.2); }



/* Live-eval — Kostendach line */
.live__cap-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 6px;
  padding: 6px 10px;
  background: var(--surface-subtle, rgba(0,0,0,.03));
  border-radius: 8px;
  font-size: 12px;
}
.live__cap-label { color: var(--text-color-muted); }
.live__cap-value { font-weight: 600; color: var(--text-color); font-feature-settings: 'tnum' 1; }
:root[data-theme="dark"] .live__cap-row { background: rgba(255,255,255,.04); }


/* ============================================================================
   RESPONSIVE — tablet (≤1024) → mobile (≤768) → small mobile (≤480)
   Sidebar collapses into a sticky bottom mini-bar with an expandable sheet.
   ============================================================================ */

/* ---- ≤ 1280: tighter padding (already partially in original media query) ---- */
@media (max-width: 1280px) {
  .body__main { padding: 28px 32px 80px; }
}

/* ---- ≤ 1024: single-column, sidebar becomes bottom sheet ------------------ */
@media (max-width: 1024px) {
  .app {
    grid-template-rows: 56px 1fr 56px;
  }

  .header {
    grid-template-columns: auto 1fr auto;
    padding: 0 16px;
    gap: 8px;
  }
  .header__brand .label { display: none; }
  .header__brand svg { height: 18px; }
  .header__meta .btn { padding: 0 8px; }

  /* Stepper compact: numbers only, active step shows number + label inline */
  .stepper {
    padding: 4px 6px;
    gap: 4px;
    max-width: 100%;
    background: var(--global-background-raised);
    border: 1px solid var(--border-color-soft);
    border-radius: var(--border-radius-full);
  }
  .stepper__btn { height: 32px; padding: 0 8px; font-size: 13px; gap: 6px; font-weight: 600; }
  /* Inactive: just a flat number, no circle */
  .stepper__btn:not(.is-active) {
    padding: 0;
    width: 24px;
    background: transparent;
    box-shadow: none;
    color: var(--text-color-muted);
  }
  .stepper__btn:not(.is-active) .ix {
    width: auto; height: auto; background: transparent; color: inherit;
    font-size: 13px; font-weight: 600;
  }
  .stepper__btn:not(.is-active) > :not(.ix) { display: none; }
  /* Done steps: a touch stronger */
  .stepper__btn.is-done:not(.is-active) { color: var(--primary-50); }
  /* Active: number + label, pill background */
  .stepper__btn.is-active { padding: 0 12px 0 8px; }
  .stepper__btn.is-active .ix {
    width: 22px; height: 22px;
    background: var(--primary-50); color: var(--primary-95);
    border-radius: 50%; font-size: 11px; font-weight: 700;
  }
  .stepper__sep { display: none; }

  /* Body grid → single column */
  .body { grid-template-columns: 1fr; }
  .body__main {
    padding: 24px 24px 96px;
  }

  /* Sidebar leaves the grid; becomes a bottom sheet --- handled below in .body__side */
  .body__side {
    border-left: 0;
    border-top: 1px solid var(--border-color-soft);
    position: fixed;
    left: 0; right: 0; bottom: 56px;  /* above footer */
    top: auto;
    background: var(--global-background-raised);
    z-index: 40;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.08);
    overflow: hidden;        /* the inner .live becomes a sheet */
    backdrop-filter: none; -webkit-backdrop-filter: none;
    /* Default = collapsed: just enough room for the mini-bar */
    height: 64px;
    transition: height 0.28s cubic-bezier(0.2,0.7,0.2,1);
  }
  .body__side.is-open {
    height: min(85vh, 640px);
    max-height: 85vh;
  }
  html[data-theme="dark"] .body__side {
    box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
  }

  /* Live mini-bar (only rendered & visible at this BP) */
  .live__minibar {
    display: flex !important;
  }
  /* Hide original .live header/padding switch */
  .live {
    padding: 0;
    height: 100%;
    overflow: hidden;
    display: flex; flex-direction: column;
  }
  .live__content {
    flex: 1; overflow: auto;
    padding: 16px 20px 24px;
    -webkit-overflow-scrolling: touch;
  }
  .body__side:not(.is-open) .live__content { display: none; }

  /* Footer compact */
  .footer { padding: 0 12px; gap: 8px; }
  .footer__center { display: none; }
  .footer__left .btn, .footer__right .btn { padding: 0 12px; }
  .footer__left .btn span:not(.fa), .footer__right .btn span:not(.fa) { display: inline; }

  /* Headings shrink */
  .block__title { font-size: 17px; }
  .block__lead { font-size: 13px; }

  /* KPI grid → 1 col */
  .kpi-grid { grid-template-columns: 1fr; gap: 12px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr; }
  .cardgrid[data-cols="3"], .cardgrid[data-cols="4"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Drawer → full screen */
  .drawer { width: 100vw; max-width: 100vw; }
}

/* Backdrop scrim shown when bottom-sheet is open */
.live__sheet-scrim {
  display: none;
  position: fixed; inset: 0;
  background: color-mix(in srgb, var(--base-dark, #000), transparent 55%);
  z-index: 39;
  animation: scrim-in 0.2s ease-out;
}
@keyframes scrim-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 1024px) {
  .body__side.is-open ~ .live__sheet-scrim,
  .live__sheet-scrim.is-open { display: block; }
}

/* Mini-bar — hidden by default (desktop), shown ≤1024 */
.live__minibar {
  display: none;
  align-items: center; justify-content: space-between;
  width: 100%;
  height: 64px;
  padding: 8px 16px 8px 18px;
  background: var(--global-background-raised);
  border: 0; border-top: 1px solid transparent;
  cursor: pointer;
  text-align: left;
  font-family: inherit; color: var(--text-color);
  gap: 12px;
  flex: 0 0 auto;
}
.live__minibar:hover { background: var(--global-background-elevated); }
.live__minibar-left {
  display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1;
}
.live__minibar-cat {
  font-size: 10px; font-weight: 600; color: var(--text-color-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  display: inline-flex; align-items: center; gap: 8px;
}
.live__minibar-cat .live__live { padding: 0; border: 0; }
.live__minibar-value {
  font-size: 18px; font-weight: 600; line-height: 1.1;
  font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: baseline; gap: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.live__minibar-value small {
  font-size: 11px; font-weight: 500; color: var(--text-color-muted);
}
.live__minibar-meta {
  display: flex; align-items: center; gap: 10px; flex: 0 0 auto;
}
.live__minibar-meta .complexity-dots span { width: 7px; height: 7px; }
.live__minibar-chev {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--global-background-elevated);
  color: var(--text-color);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px;
  transition: transform 0.2s, background 0.15s;
  flex: 0 0 auto;
}
.body__side.is-open .live__minibar-chev { transform: rotate(180deg); background: var(--primary-50); color: var(--primary-95); }
.live__minibar-empty {
  font-size: 13px; color: var(--text-color-muted); font-weight: 500;
}

/* ---- ≤ 768: mobile ---------------------------------------------------------- */
@media (max-width: 768px) {
  html { font-size: 15px; }

  /* Header */
  .header {
    grid-template-columns: auto 1fr auto;
    padding: 0 12px;
  }
  .header__steps { justify-content: flex-end; }
  .header__meta { display: none; }     /* Reset/Theme moved to overflow */

  /* Show theme toggle in stepper area? Keep it simple: hide on mobile */

  /* Body */
  .body__main {
    padding: 16px 16px 88px;
  }

  /* Block heads stack on small */
  .block__head {
    flex-direction: column; align-items: flex-start; gap: 8px;
  }

  /* Cards 1 col on smallest grids */
  .cardgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

  /* Optcard tighter */
  .optcard { padding: 12px; min-height: 64px; }
  .optcard__title { font-size: 13px; }
  .optcard__sub { font-size: 11px; }

  /* Segmented stacks */
  .segmented { flex-wrap: wrap; }
  .segmented__seg { min-width: 33%; }
  .segmented[data-stack="true"] .segmented__seg { min-width: 100%; }

  /* Radio list more padding for touch */
  .radiolist__opt { padding: 14px; }

  /* Chips bigger touch */
  .chip { height: 36px; padding: 0 14px; font-size: 13px; }

  /* Slider thumb bigger touch */
  input[type="range"].slider { touch-action: manipulation; }
  input[type="range"].slider::-webkit-slider-thumb { width: 28px; height: 28px; margin-top: -11px; }
  input[type="range"].slider::-moz-range-thumb { width: 28px; height: 28px; }

  /* Repeater item more compact */
  .repeater-item { padding: 12px; }

  /* Collapsible */
  .collapsible__head { padding: 12px 14px; }
  .collapsible__body { padding: 6px 14px 18px; }
  .collapsible__hint { display: none; }
  .collapsible__head-wrap { padding-right: 8px; gap: 4px; }
  .consult-btn { height: 30px; padding: 0 10px; font-size: 11px; }
  .consult-btn span { display: none; }
  .consult-btn::after { content: 'Beratung'; }
  .consult-btn.is-active::after { content: 'Angefragt'; }

  /* === TCO Year table → cards (one card per year) ============================ */
  .year-table thead { display: none; }
  .year-table tbody { display: flex; flex-direction: column; gap: 10px; }
  .year-table tbody tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
    padding: 14px 16px;
    background: var(--global-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
  }
  .year-table tbody tr.is-total {
    background: var(--primary-05);
    border-color: var(--primary-50);
  }
  html[data-theme="dark"] .year-table tbody tr.is-total {
    background: color-mix(in srgb, var(--primary-90) 50%, var(--gray-90));
  }
  .year-table tbody td {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 0;
    text-align: right;
    border: 0;
    grid-column: 1 / -1;
    font-size: 13px;
  }
  .year-table tbody td:first-child {
    font-weight: 600; font-size: 15px;
    border-bottom: 1px solid var(--border-color-soft);
    padding-bottom: 8px;
    margin-bottom: 4px;
    grid-column: 1 / -1;
  }
  .year-table tbody td[data-label]::before {
    content: attr(data-label);
    color: var(--text-color-muted);
    font-weight: 500; font-size: 12px;
    text-align: left;
  }
  .year-table tbody td.zero { display: none; }   /* hide empty rows on mobile */
  .year-table tbody tr.is-total td:first-child { font-size: 14px; }
  .year-table tbody tr.is-total td.dim { display: none; }
  .year-table tbody tr.is-total td:last-child {
    font-size: 18px; font-weight: 700;
    border-top: 1px dashed var(--border-color);
    padding-top: 10px;
    margin-top: 6px;
  }

  /* Barchart compact */
  .barchart__row { grid-template-columns: 50px 1fr 80px; gap: 8px; }
  .barchart__lbl { font-size: 12px; }
  .barchart__bar { height: 24px; }
  .barchart__total { font-size: 12px; }

  /* KPI value smaller */
  .kpi__value, .live__value { font-size: 22px; }
  .live__value.live__value--lg { font-size: 26px; }
  .result-hero__title { font-size: 22px; }
  .result-hero { padding: 24px 22px 22px; }

  /* Cost cards full width */
  .cost-card { padding: 14px 16px; }

  /* Footer */
  .footer { padding: 0 10px; }
  .footer__left .btn[data-kind="quiet"] { padding: 0 10px; font-size: 12px; }
  .footer__right .btn { padding: 0 12px; font-size: 13px; }
  .footer__right .btn[data-kind="primary"] { height: 40px; }
  .footer__left .btn span:not(.fa) {
    /* On very narrow, hide the prev label */
  }

  /* Drawer body padding */
  .drawer__body { padding: 20px 22px 32px; gap: 0; }
  .drawer__head { padding: 14px 18px; }
  .drawer__title { font-size: 19px; }
  .drawer__lead, .drawer__section-body { max-width: none; }

  /* Live sheet content padding */
  .live__content { padding: 14px 16px 24px; }

  /* Loading card */
  .loading__card { width: calc(100% - 32px); padding: 28px 24px; }

  /* Tooltip pop wider */
  .helphint__pop { width: 220px; max-width: 88vw; }

  /* Result hero KPI */
  .result-hero__title { font-size: 22px; }
}

/* ---- ≤ 480: phone narrow ---------------------------------------------------- */
@media (max-width: 480px) {
  .body__main { padding: 14px 12px 92px; }
  .cardgrid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .stepper__btn:not(.is-active) { width: 22px; }
  .stepper__btn { font-size: 12px; }
  /* Ensure tap-targets remain at least 56px on phones */
  .optcard { min-height: 56px; }

  /* Mini-bar trims */
  .live__minibar { padding: 6px 12px; height: 60px; }
  .live__minibar-value { font-size: 16px; }
  .live__minibar-meta { gap: 6px; }
  .live__minibar-chev { width: 32px; height: 32px; }

  /* Footer: hide primary label on smallest, keep icon */
  .footer__right .btn { padding: 0 10px; }

  /* Stepper compact pill */
  .stepper { padding: 3px 4px; }
  .stepper__btn { height: 28px; }
  .stepper__btn.is-active { padding: 0 10px 0 6px; }
  .stepper__btn.is-active .ix { width: 18px; height: 18px; font-size: 10px; }

  /* Hide block lead on smallest to save space */
  /* (keep it — useful info; just smaller) */
  .block__lead { font-size: 12.5px; }
  .block { margin-bottom: 24px; }

  /* Tooltip: position fixed if would overflow */
  .helphint__pop { width: 200px; }
}

/* Background tile composition: relax/disable on small screens */
@media (max-width: 1024px) {
  .app__body::before {
    top: -100px;
    right: -120px;
    width: 70vw;
    opacity: 0.35;
  }
}
@media (max-width: 768px) {
  .app__body::before {
    width: 90vw;
    right: -180px;
    opacity: 0.25;
  }
}
@media (max-width: 480px) {
  .app__body::before { display: none; } /* too noisy on phones */
}

/* On open bottom-sheet: prevent body scroll? — leave native scroll, sheet caps height */


/* === Banner — violet "next-steps" tone (cloudtec brand purple) =============
   Matches the va__assessment look (violet border, violet eyebrow/title, soft
   body). Background is a solid white-based lavender so the violet tint reads
   identically in light and dark mode — i.e. there's effectively a white box
   sitting behind the card, derived from the brand colour rather than hardcoded. */
.banner.is-next-steps {
  padding: 20px 22px;
  background: color-mix(in srgb, var(--tertiary-50) 8%, #ffffff);
  border: 2px solid var(--tertiary-50);
  color: var(--text-color);
}
.banner.is-next-steps .banner__title {
  color: var(--tertiary-60);
  font-size: 19px; font-weight: 600; letter-spacing: -0.005em;
  margin: 0 0 10px;
}
.banner.is-next-steps .banner__body {
  color: var(--text-color-soft);
  font-size: 13px; line-height: 1.55;
}
.banner.is-next-steps i:first-child { color: var(--tertiary-60); }


/* === Configuration Code ==================================================== */
.config-code-load {
  margin-top: 16px;
  width: 100%;
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px;
  background: var(--global-background);
  border: 1px solid var(--border-color-soft);
  border-radius: var(--border-radius-md);
  text-align: left;
}
.config-code-load__label {
  font-size: 12px; font-weight: 600;
  color: var(--text-color);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.config-code-load__row {
  display: flex; gap: 8px; align-items: stretch;
}
.config-code-load__row .input { height: 36px; flex: 1 1 auto; min-width: 0; }
.config-code-load__row .btn { flex: 0 0 auto; }
.config-code-load__hint {
  font-size: 11px; line-height: 1.45;
  color: var(--text-color-muted);
  margin: 0;
}

/* Footer: numeric step counter (left side) */
.footer__step-counter {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-color-muted);
}
.footer__step-counter__num {
  font: 600 13px ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.04em;
  color: var(--text-color);
}
.footer__step-counter__total {
  font: 500 13px ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.04em;
  opacity: 0.55;
}
.footer__step-counter__sep { opacity: 0.45; margin: 0 4px; }
.footer__step-counter__label {
  font-weight: 500;
  color: var(--text-color);
}

/* Footer: Konfig-Code hero pill (center) */
.footer__code-hero {
  display: inline-flex; align-items: center; gap: 10px;
  height: 40px;
  padding: 0 6px 0 16px;
  background: var(--global-background-raised);
  border: 1px solid var(--border-color-soft);
  border-radius: var(--border-radius-full);
  box-shadow: var(--box-shadow-sm);
  color: var(--text-color);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px; font-weight: 500;
  letter-spacing: 0.04em;
}
.footer__code-hero__label {
  font-family: var(--font-family);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-color-muted);
  padding-right: 10px;
  border-right: 1px solid var(--border-color-soft);
}
.footer__code-hero__value { user-select: all; }
.footer__code-hero__copy {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: var(--global-background);
  border: 1px solid var(--border-color-soft);
  border-radius: 50%;
  color: var(--text-color-muted);
  cursor: pointer; padding: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.footer__code-hero__copy:hover {
  background: var(--primary-50);
  border-color: var(--primary-50);
  color: var(--primary-95);
}

/* Footer: paired-navigation capsule (right). Back + Next sit inside a single
   pill; on pre/result steps the capsule disappears (is-solo) and the lone
   button stands on its own. */
.footer__nav {
  background: var(--global-background-raised);
  border: 1px solid var(--border-color-soft);
  border-radius: var(--border-radius-md);
  padding: 4px;
  gap: 6px;
}
.footer__nav .btn { height: 36px; }
.footer__nav .btn[data-kind="quiet"] {
  background: transparent;
  border-color: transparent;
}
.footer__nav .btn[data-kind="quiet"]:hover:not(:disabled) {
  background: var(--global-background-elevated);
}
.footer__nav.is-solo {
  background: transparent;
  border: 0;
  padding: 0;
}
.footer__nav.is-solo .btn { height: 40px; }

/* Result page: prominent code card */
.config-code-card {
  margin: 0 0 20px;
  padding: 18px 22px;
  background: var(--global-background);
  border: 1px solid var(--border-color-soft);
  border-left: 4px solid var(--primary-50);
  border-radius: var(--border-radius-md);
  box-shadow: var(--box-shadow-xs);
  display: flex; flex-direction: column; gap: 8px;
}
.config-code-card__head {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-color-muted);
}
.config-code-card__head i { color: var(--primary-50); }
.config-code-card__row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.config-code-card__code {
  font: 600 22px ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.06em;
  color: var(--text-color);
  background: var(--global-background-raised);
  padding: 6px 14px;
  border-radius: var(--border-radius-sm);
  user-select: all;
}
.config-code-card__hint {
  font-size: 12px; line-height: 1.45;
  color: var(--text-color-muted);
  margin: 0; max-width: 64ch;
}

/* Mobile: condense footer code & step counter */
@media (max-width: 768px) {
  .footer__code-hero { font-size: 12px; padding: 0 4px 0 12px; height: 34px; gap: 8px; }
  .footer__code-hero__label { font-size: 10px; padding-right: 8px; }
  .footer__code-hero__copy { width: 24px; height: 24px; }
  .footer__step-counter__label { display: none; }
  .footer__step-counter__sep   { display: none; }
  .config-code-card__code { font-size: 18px; padding: 6px 10px; }
}


/* === Year cost — line chart =============================================== */
.linechart {
  width: 100%;
  display: flex; flex-direction: column; gap: 12px;
}
.linechart__svg {
  width: 100%; height: auto; max-width: 100%;
  font-family: var(--font-family);
  display: block;
}
.linechart__grid {
  stroke: var(--border-color-soft);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}
.linechart__axis { stroke: var(--border-color); stroke-width: 1; }
.linechart__tick {
  font-size: 11px;
  fill: var(--text-color-muted);
  font-weight: 500;
}
.linechart__tick--y { text-anchor: end; }
.linechart__line { transition: stroke-width 0.15s; }
.linechart__line--total {
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.08));
}
.linechart__area {
  fill: var(--primary-50);
  opacity: 0.07;
}
html[data-theme="dark"] .linechart__area { opacity: 0.14; }
.linechart__pointlabel {
  font-size: 10px; font-weight: 600;
  fill: var(--text-color);
  font-variant-numeric: tabular-nums;
}
.linechart__legend {
  display: flex; flex-wrap: wrap; gap: 16px;
  padding: 8px 4px 0;
  font-size: 12px; color: var(--text-color-muted);
}
.linechart__legend-item {
  display: inline-flex; align-items: center; gap: 8px;
}
.linechart__legend-swatch {
  display: inline-block; width: 18px; border-radius: 2px;
}

/* Make the year-toggle a bit wider and align icons with text */
.year-toggle.segmented .segmented__seg {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 0 14px;
  white-space: nowrap;
}
.year-toggle.segmented .segmented__seg i {
  display: inline-flex; align-items: center;
  font-size: 12px;
  line-height: 1;
}
.year-toggle.segmented .segmented__seg span {
  display: inline-block; line-height: 1;
}

/* ============================================================================
   Privacy Modal — shown before KI-Vorbefüllung
   ============================================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  z-index: 1000;
  padding: 20px;
  animation: modal-fadein 0.18s ease-out;
}
.modal {
  background: var(--global-background);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  max-width: 520px; width: 100%;
  max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal__head {
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--border-color-soft);
}
.modal__title {
  margin: 0;
  font-size: 18px; font-weight: 700;
  color: var(--text-color);
}
.modal__body {
  padding: 18px 24px;
  overflow-y: auto;
  font-size: 14px; line-height: 1.55;
  color: var(--text-color);
}
.modal__body p { margin: 0 0 10px 0; }
.modal__body strong { color: var(--text-color); }
.modal__foot {
  padding: 14px 24px 20px;
  display: flex; gap: 10px; justify-content: flex-end;
  border-top: 1px solid var(--border-color-soft);
}
@keyframes modal-fadein { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 480px) {
  .modal__foot { flex-direction: column-reverse; }
  .modal__foot .btn { width: 100%; }
}

/* ── Violet variant (KI-Hinweis Modal) ──────────────────────────────────── */
.modal--violet {
  border-color: color-mix(in srgb, var(--tertiary-50) 35%, var(--border-color-soft));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--tertiary-50) 25%, transparent),
    0 20px 60px -20px hsla(270, 70%, 30%, 0.45),
    0 8px 24px -8px hsla(270, 60%, 25%, 0.35);
}
.modal--violet .modal__head {
  border-bottom-color: color-mix(in srgb, var(--tertiary-50) 20%, var(--border-color-soft));
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--tertiary-50), transparent 94%) 0%,
    transparent 100%);
}
.modal--violet .modal__title {
  color: var(--tertiary-70);
}
html[data-theme="dark"] .modal--violet .modal__title { color: var(--tertiary-30); }
.modal--violet .modal__body ul li::marker { color: var(--tertiary-50); }
.modal--violet input[type="checkbox"]:checked {
  accent-color: var(--tertiary-50);
}
.modal--violet .btn[data-kind="primary"] {
  background: var(--tertiary-50);
  border-color: var(--tertiary-50);
  color: #fff;
}
.modal--violet .btn[data-kind="primary"]:hover {
  background: var(--tertiary-60);
  border-color: var(--tertiary-60);
}

/* ============================================================================
   KI-Banner — shown after AI prefill, dismissible
   ============================================================================ */
/* KI-Banner — matches the va__assessment look (violet border, eyebrow-style
   title, soft body text). The background is solid white with an 8 % violet
   tint mixed in, so the card looks identical in light and dark mode (a "white
   box behind"). Hardcoded #F8F3FF replaced with brand-derived color-mix(). */
.kibanner {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 20px 22px;
  margin-bottom: 20px;
  background: color-mix(in srgb, var(--tertiary-50) 8%, #ffffff);
  border: 2px solid var(--tertiary-50);
  border-radius: var(--border-radius-md);
  color: var(--text-color);
}
.kibanner > i { color: var(--tertiary-60); font-size: 18px; padding-top: 2px; }
.kibanner__body { flex: 1; }
.kibanner__title {
  color: var(--tertiary-60);
  font-size: 19px; font-weight: 600; letter-spacing: -0.005em;
  margin: 0 0 10px;
}
.kibanner__text {
  color: var(--text-color-soft);
  font-size: 13px; line-height: 1.55;
}
.kibanner__details { margin-top: 8px; font-size: 12.5px; }
.kibanner__details summary { cursor: pointer; color: var(--tertiary-60); font-weight: 600; }
.kibanner__details p { margin: 6px 0 0 0; color: var(--text-color-soft); }
.kibanner__dismiss {
  background: transparent; border: 0; cursor: pointer;
  color: var(--text-color-soft); opacity: 0.85;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
}
.kibanner__dismiss:hover { background: color-mix(in srgb, var(--tertiary-50), transparent 80%); opacity: 1; }

/* ============================================================================
   Language Switcher
   ============================================================================ */
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border-color-soft);
  border-radius: var(--border-radius-full);
  background: var(--global-background-raised);
  padding: 2px;
  gap: 2px;
}
.lang-switch__btn {
  background: transparent;
  border: 0;
  cursor: pointer;
  font: 600 11px var(--font-family);
  color: var(--text-color-muted);
  padding: 4px 10px;
  border-radius: var(--border-radius-full);
  letter-spacing: 0.04em;
  transition: background 0.15s, color 0.15s;
}
.lang-switch__btn:hover { color: var(--text-color); }
.lang-switch__btn.is-active {
  background: var(--global-background);
  color: var(--text-color);
  box-shadow: var(--box-shadow-sm);
}
@media (max-width: 768px) {
  .lang-switch { display: none; }   /* Mobile: hidden, available via reset menu later */
}

/* ============================================================================
   Dev-Mode "Calc Overlay" — PT-Badges
   ============================================================================ */
.pt-badge {
  display: inline-flex;
  align-items: center;
  font: 500 10px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--primary-10, rgba(2, 255, 161, 0.12));
  color: var(--primary-80, #006e44);
  white-space: nowrap;
  margin-left: 6px;
  vertical-align: middle;
}
.pt-badge.is-dim {
  background: transparent;
  color: var(--text-color-muted, #999);
  opacity: 0.75;
}
.pt-badge.is-neg {
  background: rgba(220, 80, 80, 0.10);
  color: #b04040;
}

/* OptCard: Badge floating top-right */
.optcard .pt-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  margin: 0;
}
.optcard { position: relative; }

/* Segmented seg: Badge under label */
.segmented__seg .pt-badge {
  display: block;
  margin: 4px 0 0 0;
  text-align: center;
  align-self: center;
}
.segmented[data-stack="true"] .segmented__seg .pt-badge {
  margin: 2px 0 0 6px;
  display: inline-block;
}

/* RadioList: Badge right-aligned */
.radiolist__opt { position: relative; }
.radiolist__opt .pt-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  margin: 0;
}

/* Chip: Badge inline */
.chip .pt-badge { margin-left: 4px; }

/* Slider meta */
.pt-slider-meta {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.pt-slider-meta .pt-badge { margin: 0; }

/* ============================================================================
   Block 1 Module — Card-Grid + Detail-Drawer (v4)
   ============================================================================ */
.mod-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 1024px) { .mod-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 768px)  { .mod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px)  { .mod-grid { grid-template-columns: 1fr; } }

.mod-card {
  position: relative;
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 14px 12px;
  background: var(--global-background);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--text-color);
  min-height: 96px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.1s;
}
.mod-card:hover {
  border-color: var(--primary-50);
  box-shadow: 0 4px 12px rgba(7,223,145,0.10);
  transform: translateY(-1px);
}
.mod-card:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--outline-color-focus); }
.mod-card.is-selected {
  background: var(--primary-05);
  border-color: var(--primary-50);
  box-shadow: 0 0 0 1px var(--primary-50) inset;
}
html[data-theme="dark"] .mod-card.is-selected {
  background: color-mix(in srgb, var(--primary-90) 60%, var(--gray-90));
}
.mod-card.is-locked {
  background: var(--global-background-raised);
  cursor: default;
}
.mod-card.is-locked:hover { transform: none; box-shadow: none; border-color: var(--border-color); }

.mod-card__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 2px;
}
.mod-card__icon {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--border-radius-sm);
  background: var(--global-background-raised);
  color: var(--text-color-soft);
  font-size: 13px;
}
.mod-card.is-selected .mod-card__icon,
.mod-card.is-locked .mod-card__icon {
  background: var(--primary-10); color: var(--primary-70);
}
html[data-theme="dark"] .mod-card.is-selected .mod-card__icon,
html[data-theme="dark"] .mod-card.is-locked .mod-card__icon {
  background: var(--primary-90); color: var(--primary-30);
}

.mod-card__info {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--global-background);
  border: 1px solid var(--border-color);
  color: var(--text-color-muted);
  font-size: 13px;
  line-height: 1;
  cursor: help;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  margin-right: -4px;
}
.mod-card__info > i { display: block; line-height: 1; transform: translateY(0.5px); }
.mod-card:hover .mod-card__info { border-color: var(--primary-50); color: var(--primary-60); }
.mod-card__info:hover,
.mod-card__info:focus-visible {
  background: var(--primary-05);
  border-color: var(--primary-50);
  color: var(--primary-70);
}
.mod-card__info:focus-visible { outline: 0; box-shadow: 0 0 0 2px var(--outline-color-focus); }

.mod-card__title {
  font-size: 14px; font-weight: 600; line-height: 1.25;
  margin-top: 6px;
}
.mod-card__sum {
  font-size: 12px; line-height: 1.4;
  color: var(--text-color-muted);
}
.mod-card__locked {
  position: absolute; bottom: 10px; right: 12px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--primary-50);
  color: var(--primary-95);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px;
  line-height: 1;
}
.mod-card__locked > i { display: block; line-height: 1; transform: translateY(0.5px); }

/* Mod-Card mit PT-Badge: Badge bekommt eigene Position (top-right, links vom info-icon) */
.mod-card .pt-badge {
  position: absolute;
  top: 10px;
  right: 44px;
  margin: 0;
  font-size: 9px;
  padding: 2px 5px;
}

/* ── AI banner ──────────────────────────────────────────────────────────── */
.mod-ai-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; margin-bottom: 12px;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary-50), transparent 92%) 0%,
    color-mix(in srgb, var(--secondary-50), transparent 92%) 100%);
  border: 1px solid color-mix(in srgb, var(--primary-50), transparent 78%);
  border-radius: var(--border-radius-md);
  font-size: 13px; color: var(--text-color);
  line-height: 1.45;
}
.mod-ai-banner i { color: var(--primary-60); font-size: 15px; flex-shrink: 0; }

.mod-ai-banner--violet {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--tertiary-50), transparent 92%) 0%,
    color-mix(in srgb, var(--tertiary-30), transparent 92%) 100%);
  border-color: color-mix(in srgb, var(--tertiary-50), transparent 78%);
}
.mod-ai-banner--violet i { color: var(--tertiary-60); }

/* ── Stack CMS Subblock (violet variant) ────────────────────────────────── */
/* Default-Look der inaktiven Cards: Icon bereits violett getönt, um die
   Sektions-Zugehörigkeit auch ohne Auswahl klar zu zeigen. */
.subblock.is-violet .mod-card__icon {
  background: var(--tertiary-05); color: var(--tertiary-60);
}
html[data-theme="dark"] .subblock.is-violet .mod-card__icon {
  background: color-mix(in srgb, var(--tertiary-90) 50%, var(--gray-90));
  color: var(--tertiary-40);
}
.subblock.is-violet .mod-card:hover {
  border-color: var(--tertiary-50);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--tertiary-50), transparent 90%);
}
.subblock.is-violet .mod-card.is-selected {
  background: color-mix(in srgb, var(--tertiary-50), transparent 90%);
  border-color: var(--tertiary-50);
  box-shadow: 0 0 0 1px var(--tertiary-50) inset;
}
html[data-theme="dark"] .subblock.is-violet .mod-card.is-selected {
  background: color-mix(in srgb, var(--tertiary-90) 60%, var(--gray-90));
}
.subblock.is-violet .mod-card.is-selected .mod-card__icon {
  background: var(--tertiary-10); color: var(--tertiary-70);
}
html[data-theme="dark"] .subblock.is-violet .mod-card.is-selected .mod-card__icon {
  background: var(--tertiary-90); color: var(--tertiary-30);
}
.subblock.is-violet .mod-card:hover .mod-card__info {
  border-color: var(--tertiary-50); color: var(--tertiary-60);
}
.subblock.is-violet .mod-card__info:hover,
.subblock.is-violet .mod-card__info:focus-visible {
  background: color-mix(in srgb, var(--tertiary-50), transparent 92%);
  border-color: var(--tertiary-50);
  color: var(--tertiary-70);
}
.subblock.is-violet .mod-card__locked {
  background: var(--tertiary-50); color: var(--tertiary-95);
}
/* PT-Badge in violet section — overrides default green tone */
.subblock.is-violet .mod-card .pt-badge {
  background: var(--tertiary-10);
  color: var(--tertiary-80, #422f7d);
}
.subblock.is-violet .mod-card .pt-badge.is-dim {
  background: transparent;
  color: var(--text-color-muted, #999);
}

/* ── Module Detail Drawer ───────────────────────────────────────────────── */
.mod-drawer-scrim {
  position: fixed; inset: 0; z-index: 90;
  background: color-mix(in srgb, var(--base-dark, #000), transparent 55%);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.mod-drawer-scrim.is-open { opacity: 1; pointer-events: auto; }

.mod-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 91;
  width: 480px; max-width: calc(100vw - 60px);
  background: var(--global-background);
  border-left: 1px solid var(--border-color-soft);
  box-shadow: -20px 0 40px rgba(15,25,52,0.18);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.2, 0.7, 0.2, 1);
  display: flex; flex-direction: column;
}
.mod-drawer.is-open { transform: translateX(0); }
@media (max-width: 1024px) { .mod-drawer { width: 100vw; max-width: 100vw; } }

.mod-drawer__head {
  flex: 0 0 auto;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px;
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--border-color-soft);
}
.mod-drawer__cat {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--primary-60);
  margin-bottom: 8px;
}
.mod-drawer__title {
  font-size: 22px; font-weight: 600; margin: 0;
  display: flex; align-items: center; gap: 12px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.mod-drawer__icon {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--border-radius-md);
  background: var(--primary-10); color: var(--primary-70);
  font-size: 16px;
}
html[data-theme="dark"] .mod-drawer__icon { background: var(--primary-90); color: var(--primary-30); }
.mod-drawer__close {
  width: 36px; height: 36px;
  border: 0; background: var(--global-background-raised);
  border-radius: var(--border-radius-md);
  font-size: 14px; color: var(--text-color);
  cursor: pointer; flex-shrink: 0;
}
.mod-drawer__close:hover { background: var(--global-background-elevated); }

.mod-drawer__body {
  flex: 1; overflow-y: auto;
  padding: 24px 28px;
  display: flex; flex-direction: column; gap: 24px;
}
.mod-drawer__lead {
  font-size: 14px; line-height: 1.6; color: var(--text-color);
  margin: 0;
}
.mod-drawer__block h4 {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-color-muted);
  margin: 0 0 10px;
}
.mod-drawer__block p {
  font-size: 13.5px; line-height: 1.6; color: var(--text-color);
  margin: 0 0 8px;
}
.mod-drawer__list {
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 8px;
}
.mod-drawer__list li {
  display: grid; grid-template-columns: 16px 1fr; gap: 10px;
  font-size: 13px; line-height: 1.5; color: var(--text-color);
}
.mod-drawer__list li::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary-50);
  margin-top: 8px; margin-left: 4px;
}

.mod-drawer__foot {
  flex: 0 0 auto;
  padding: 16px 28px 24px;
  border-top: 1px solid var(--border-color-soft);
  display: flex; gap: 8px; align-items: center;
}
.mod-drawer__locked-note {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-color-muted);
}
.mod-drawer__locked-note i { color: var(--primary-50); }

.mod-drawer.is-violet .mod-drawer__cat { color: var(--tertiary-60); }
.mod-drawer.is-violet .mod-drawer__icon { background: var(--tertiary-10); color: var(--tertiary-70); }
html[data-theme="dark"] .mod-drawer.is-violet .mod-drawer__icon {
  background: var(--tertiary-90); color: var(--tertiary-30);
}
.mod-drawer.is-violet .mod-drawer__list li::before { background: var(--tertiary-50); }
.mod-drawer.is-violet .mod-drawer__foot .btn[data-kind="primary"] {
  background: var(--tertiary-50); color: var(--tertiary-95);
  border-color: var(--tertiary-50);
}
.mod-drawer.is-violet .mod-drawer__foot .btn[data-kind="primary"]:hover {
  background: var(--tertiary-60); border-color: var(--tertiary-60);
}

/* ============================================================================
   AI-detected Eigenfunktionen — Block 2 / Page 1
   ============================================================================ */
.ai-taglist {
  margin-top: 14px;
  padding: 12px 14px 14px;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--tertiary-50), transparent 94%) 0%,
    color-mix(in srgb, var(--tertiary-50), transparent 97%) 100%);
  border: 1px dashed color-mix(in srgb, var(--tertiary-50), transparent 70%);
  border-radius: var(--border-radius-md);
}
.ai-taglist__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 10px;
}
.ai-taglist__title {
  display: inline-block;
  font-size: 12px; font-weight: 600;
  color: var(--tertiary-60); letter-spacing: 0.01em;
  line-height: 1.3;
}
.ai-taglist__title i { margin-right: 6px; font-size: 11px; }
html[data-theme="dark"] .ai-taglist__title { color: var(--tertiary-30); }
.ai-taglist__count {
  font-size: 11px; font-weight: 600;
  color: var(--text-color-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ai-taglist__chips {
  display: flex; flex-wrap: wrap; gap: 6px;
}

.ai-tag {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px 0 6px;
  border-radius: 999px;
  background: var(--global-background);
  border: 1px solid color-mix(in srgb, var(--tertiary-50), transparent 58%);
  color: var(--text-color);
  font-family: inherit; font-size: 12.5px; font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.08s;
}
.ai-tag:hover { border-color: var(--tertiary-50); transform: translateY(-1px); }
.ai-tag:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--outline-color-focus); }

.ai-tag__icon {
  width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px;
  background: color-mix(in srgb, var(--text-color), transparent 88%);
  color: var(--text-color-muted);
  transition: background 0.15s, color 0.15s;
}
.ai-tag.is-active {
  background: var(--tertiary-50);
  border-color: var(--tertiary-50);
  color: #fff;
}
.ai-tag.is-active:hover { background: var(--tertiary-60); border-color: var(--tertiary-60); }
.ai-tag.is-active .ai-tag__icon {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.ai-tag:not(.is-active) {
  color: var(--text-color-muted);
  background: var(--global-background);
}
.ai-tag:not(.is-active) .ai-tag__label {
  text-decoration: line-through; text-decoration-thickness: 1px;
}

/* Tooltip on hover/focus */
.ai-tag__tip {
  position: absolute;
  left: 50%; bottom: calc(100% + 8px);
  transform: translate(-50%, 4px);
  min-width: 200px; max-width: 280px;
  padding: 8px 10px;
  background: var(--text-color);
  color: var(--global-background);
  border-radius: var(--border-radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  font-size: 12px; line-height: 1.4;
  text-align: left;
  opacity: 0; pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
  z-index: 20;
  white-space: normal;
}
html[data-theme="dark"] .ai-tag__tip {
  background: var(--gray-10); color: var(--text-color);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.ai-tag__tip::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text-color);
}
html[data-theme="dark"] .ai-tag__tip::after { border-top-color: var(--gray-10); }
.ai-tag__tip-desc { display: block; font-weight: 400; text-decoration: none; }
.ai-tag:hover .ai-tag__tip,
.ai-tag:focus-visible .ai-tag__tip {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: none;
}
.ai-tag:not(.is-active) .ai-tag__tip-desc { text-decoration: none; }

/* Violet slider variant — Eigenfunktionen */
.slider--violet input[type="range"].slider {
  --slider-fill: var(--tertiary-50);
}
.slider--violet input[type="range"].slider::-webkit-slider-thumb {
  border-color: var(--tertiary-50);
}
.slider--violet input[type="range"].slider::-moz-range-thumb {
  border-color: var(--tertiary-50);
}
