/* ==========================================================================
   KI-Reifegrad-Check
   ========================================================================== */
.rg-page { --ok: #1E7A3E; }

/* ---------- Einstieg ---------- */
.rg-hero {
  position: relative; overflow: clip; isolation: isolate;
  margin-top: calc(-1 * var(--header-h));
  padding: calc(var(--header-h) * 2 + 8px) 0 clamp(64px, 8vw, 110px);
  background: var(--dark); color: var(--on-dark); --cover: var(--dark);
}
.rg-hero .tess-bg { opacity: .3; }
.rg-hero-glow { position: absolute; z-index: -1; right: -10%; top: 0; width: 65%; aspect-ratio: 1; background: radial-gradient(closest-side, rgba(255, 91, 31, .18), rgba(255, 91, 31, 0)); pointer-events: none; }
.rg-hero-inner { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.rg-in { display: inline-block; opacity: 0; transform: translateY(16px); animation: rg-in .9s cubic-bezier(.16, 1, .3, 1) forwards; animation-delay: calc(var(--d) * 90ms + 120ms); }
.rg-hero-copy > .rg-in { display: flex; }
@keyframes rg-in { to { opacity: 1; transform: none; } }
.rg-eyebrow { align-items: center; gap: 10px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(242, 242, 240, .16); font-size: .8125rem; color: var(--on-dark-2); width: max-content; }
.rg-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px rgba(255, 91, 31, .2); }
.rg-title { margin-top: 24px; font-size: clamp(2.5rem, 4.6vw, 4.25rem); letter-spacing: -0.045em; line-height: 1.02; color: #fff; }
.rg-title em { font-style: normal; color: var(--brand-hi); }
.rg-lead { margin-top: 24px; max-width: 32em; font-size: clamp(1.0625rem, 1.5vw, 1.25rem); line-height: 1.55; color: var(--on-dark-2); }
.rg-facts { flex-wrap: wrap; gap: 8px; margin: 28px 0 0; padding: 0; list-style: none; }
.rg-facts li { padding: 7px 13px; border-radius: 999px; background: rgba(242, 242, 240, .06); border: 1px solid rgba(242, 242, 240, .1); font-size: .875rem; color: var(--on-dark-2); }
.rg-facts b { color: #fff; font-weight: 600; }
.rg-actions { flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* Treppe der Stufen */
.rg-stairs { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; gap: 8px; height: 340px; margin: 0; padding: 0; list-style: none; }
.rg-stairs li {
  position: relative; height: calc(24% + var(--k) * 19%); display: flex; flex-direction: column; justify-content: flex-start; gap: 6px;
  padding: 12px 10px; border-radius: 12px 12px 4px 4px; font-size: .75rem; font-weight: 600; color: var(--on-dark-2);
  background: linear-gradient(180deg, rgba(255, 91, 31, calc(.08 + var(--k) * .06)), rgba(255, 91, 31, .02)); border: 1px solid rgba(255, 122, 69, calc(.18 + var(--k) * .1));
  transform-origin: bottom; animation: rg-rise 1s cubic-bezier(.16, 1, .3, 1) both; animation-delay: calc(var(--k) * 120ms + 500ms);
}
.rg-stairs li span { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 1.25rem; font-weight: 500; color: var(--brand-hi); }
@keyframes rg-rise { from { transform: scaleY(.2); opacity: 0; } }
.rg-stairs-pin { position: absolute; left: 50%; top: 18px; padding: 7px 12px; border-radius: 999px; background: #fff; color: var(--ink); font-size: .8125rem; white-space: nowrap; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .6); animation: rg-pin 6s cubic-bezier(.65, 0, .35, 1) infinite; }
.rg-stairs-pin::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; margin-left: -5px; background: #fff; transform: rotate(45deg); }
@keyframes rg-pin { 0%, 12% { transform: translate(-190%, 190px); } 30%, 42% { transform: translate(-100%, 130px); } 60%, 72% { transform: translate(-10%, 70px); } 90%, 100% { transform: translate(-190%, 190px); } }

/* ---------- Test ---------- */
.rg-test { padding-top: clamp(64px, 8vw, 110px); }
.rg-app { max-width: 920px; margin: 0 auto; }
.rg-view { animation: rg-fade .5s var(--ease); }
@keyframes rg-fade { from { opacity: 0; transform: translateY(8px); } }
.rg-kicker { font-size: .875rem; font-weight: 600; color: var(--accent); margin-bottom: 10px; }

.rg-start { text-align: center; padding: clamp(40px, 6vw, 72px) clamp(20px, 5vw, 64px); border-radius: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.rg-start h2 { font-size: clamp(2rem, 4vw, 3.25rem); letter-spacing: -0.04em; line-height: 1.05; }
.rg-start-text { max-width: 36em; margin: 20px auto 0; color: var(--ink-2); line-height: 1.6; }
.rg-start-btn { margin-top: 32px; }

.rg-progress { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; font-size: .8125rem; font-weight: 600; color: var(--muted); }
.rg-progress i { position: relative; flex: 1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.rg-progress i::after { content: ""; position: absolute; inset: 0; background: var(--brand); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform .6s cubic-bezier(.16, 1, .3, 1); }
.rg-qcard { padding: clamp(28px, 4vw, 48px); border-radius: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.rg-qcard.is-in { animation: rg-fade .45s var(--ease); }
.rg-qdim { display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px; border-radius: 999px; background: var(--brand-soft); color: var(--accent); font-size: .8125rem; font-weight: 600; }
.rg-qdim .icon { width: 16px; height: 16px; }
.rg-q { margin: 18px 0 26px; font-size: clamp(1.5rem, 2.8vw, 2.25rem); letter-spacing: -0.035em; line-height: 1.12; }
.rg-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rg-opt {
  display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 14px 16px; text-align: left;
  border-radius: 14px; border: 1px solid var(--line); background: #FAFAF8; font: inherit; font-size: .9688rem; color: var(--ink); cursor: pointer;
  transition: border-color .2s var(--ease), background-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.rg-opt:hover { border-color: var(--ink); background: #fff; transform: translateY(-2px); box-shadow: 0 10px 24px -16px rgba(11, 11, 12, .35); }
.rg-opt:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.rg-opt-n { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); font-size: .8125rem; font-weight: 700; color: var(--muted); transition: all .2s var(--ease); }
.rg-opt.is-picked { border-color: var(--brand); background: var(--brand-soft); }
.rg-opt.is-picked .rg-opt-n { background: var(--brand); border-color: var(--brand); color: var(--ink); }
.rg-quiz-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; min-height: 36px; }
.rg-back { border: 0; background: none; font: inherit; font-size: .875rem; font-weight: 600; color: var(--ink-2); cursor: pointer; padding: 8px 0; }
.rg-back:hover { color: var(--ink); }
.rg-hint { margin-left: auto; font-size: .75rem; color: var(--muted); }

/* ---------- Ergebnis ---------- */
.rg-res-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: center; padding: clamp(28px, 4vw, 48px); border-radius: 28px; background: var(--dark); color: var(--on-dark); box-shadow: 0 40px 80px -40px rgba(11, 11, 12, .6); }
.rg-res-head .rg-kicker { color: var(--brand-hi); }
.rg-res-big { display: flex; align-items: baseline; gap: 10px; font-size: 1.125rem; color: var(--on-dark-2); }
.rg-res-big b { font-size: clamp(4.5rem, 9vw, 7rem); font-weight: 600; line-height: .9; letter-spacing: -0.06em; background: linear-gradient(120deg, #FFC2A6, #FF7A45 45%, #FF5B1F 70%, #D9480F); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rg-res-big span { font-size: 1rem; }
.rg-res-head h2 { margin-top: 6px; font-size: clamp(2rem, 3.6vw, 2.75rem); letter-spacing: -0.04em; color: #fff; }
.rg-res-text { margin-top: 12px; line-height: 1.6; color: var(--on-dark-2); }
.rg-res-steps { display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; gap: 6px; height: 240px; margin: 0; padding: 0; list-style: none; }
.rg-res-steps li { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 10px 8px; border-radius: 10px 10px 3px 3px; font-size: .6875rem; font-weight: 600; color: #6E6E76; background: rgba(242, 242, 240, .04); border: 1px solid #26262B; }
.rg-res-steps li:nth-child(1) { height: 26%; } .rg-res-steps li:nth-child(2) { height: 44%; } .rg-res-steps li:nth-child(3) { height: 62%; } .rg-res-steps li:nth-child(4) { height: 80%; } .rg-res-steps li:nth-child(5) { height: 98%; }
.rg-res-steps span { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 1rem; }
.rg-res-steps li.is-done { background: rgba(255, 91, 31, .12); border-color: rgba(255, 122, 69, .35); color: var(--on-dark-2); }
.rg-res-steps li.is-here { background: var(--brand); border-color: var(--brand); color: var(--ink); box-shadow: 0 0 40px -6px rgba(255, 91, 31, .7); }
.rg-res-steps li.is-here::after { content: "Sie"; position: absolute; left: 50%; top: -34px; transform: translateX(-50%); padding: 4px 10px; border-radius: 999px; background: #fff; color: var(--ink); font-size: .75rem; }
.rg-app:not(.is-scored) .rg-res-steps li { opacity: 0; transform: scaleY(.3); }
.rg-res-steps li { transform-origin: bottom; transition: opacity .6s var(--ease), transform .9s cubic-bezier(.16, 1, .3, 1); }
.rg-res-steps li:nth-child(2) { transition-delay: .08s; } .rg-res-steps li:nth-child(3) { transition-delay: .16s; } .rg-res-steps li:nth-child(4) { transition-delay: .24s; } .rg-res-steps li:nth-child(5) { transition-delay: .32s; }

.rg-res-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; }
.rg-panel { padding: clamp(24px, 3vw, 36px); border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.rg-panel h3 { font-size: 1.25rem; letter-spacing: -0.02em; margin-bottom: 20px; }
.rg-dims { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.rg-dims li { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n s" "b b"; gap: 8px 12px; align-items: center; }
.rg-dim-name { grid-area: n; display: flex; align-items: center; gap: 8px; font-size: .875rem; font-weight: 600; }
.rg-dim-name .icon { width: 16px; height: 16px; color: var(--accent); flex: none; }
.rg-dim-name em { font-style: normal; font-size: .625rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; }
.rg-dim-name em.is-strong { background: rgba(30, 122, 62, .12); color: var(--ok); }
.rg-dim-name em.is-lever { background: var(--brand-soft); color: var(--accent); }
.rg-dim-stage { grid-area: s; font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.rg-dim-bar { grid-area: b; position: relative; height: 8px; border-radius: 4px; background: var(--bg-alt); overflow: hidden; }
.rg-dim-bar i { position: absolute; inset: 0 auto 0 0; width: var(--v); border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand-hi)); transform-origin: left; transform: scaleX(0); transition: transform 1.1s cubic-bezier(.16, 1, .3, 1) .3s; }
.rg-app.is-scored .rg-dim-bar i { transform: scaleX(1); }
.rg-tips { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; }
.rg-tips li { display: flex; gap: 14px; }
.rg-tip-n { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; font-size: .8125rem; font-weight: 700; }
.rg-tips li:first-child .rg-tip-n { background: var(--brand); color: var(--ink); }
.rg-tips b { display: block; font-size: .9375rem; margin-bottom: 4px; }
.rg-tips p { font-size: .875rem; line-height: 1.55; color: var(--ink-2); }

.rg-next { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px; margin-top: 20px; }
.rg-form { padding: clamp(24px, 3vw, 36px); border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.rg-form h3 { font-size: 1.25rem; letter-spacing: -0.02em; }
.rg-form > p { margin-top: 8px; font-size: .9375rem; color: var(--ink-2); line-height: 1.55; }
.rg-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.rg-fields .rg-wide { grid-column: 1 / -1; }
.rg-fields label { min-width: 0; display: grid; gap: 6px; font-size: .8125rem; font-weight: 600; }
.rg-fields small { font-weight: 400; color: var(--muted); }
.rg-fields input { width: 100%; min-width: 0; box-sizing: border-box; height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-strong); background: #FAFAF8; font: inherit; font-size: .9375rem; color: var(--ink); }
.rg-fields input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; background: #fff; }
.rg-consent { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 20px; font-size: .8125rem; line-height: 1.5; color: var(--ink-2); }
.rg-consent input { margin-top: 3px; accent-color: var(--brand); }
.rg-consent a { color: var(--accent); }
.rg-done { margin-top: 14px; font-size: .875rem; font-weight: 600; color: var(--ok); }
.rg-cta-check { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: clamp(24px, 3vw, 36px); border-radius: 24px; background: var(--dark); color: var(--on-dark); }
.rg-cta-check .rg-kicker { color: var(--brand-hi); margin-bottom: 0; }
.rg-cta-check h3 { font-size: 1.375rem; letter-spacing: -0.025em; color: #fff; }
.rg-cta-check p { font-size: .9375rem; color: var(--on-dark-2); line-height: 1.55; }
.rg-cta-check .btn { margin-top: 8px; }
.rg-restart { margin-top: auto; padding-top: 16px; border: 0; background: none; font: inherit; font-size: .8125rem; color: var(--on-dark-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- Modell ---------- */
.rg-model-stages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 0; padding: 0; list-style: none; }
.rg-model-stages li { padding: 22px 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.rg-model-stages span { display: block; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 1.5rem; color: var(--accent); margin-bottom: 10px; }
.rg-model-stages b { display: block; font-size: 1.0625rem; margin-bottom: 6px; }
.rg-model-stages p { font-size: .875rem; color: var(--ink-2); line-height: 1.5; }
.rg-model-dims { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 0; padding: 0; list-style: none; }
.rg-model-dims li { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .875rem; font-weight: 500; }
.rg-model-dims .icon { width: 16px; height: 16px; color: var(--accent); }
.rg-model-note { margin-top: 24px; font-size: .8125rem; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .rg-hero-inner, .rg-res-head, .rg-res-grid, .rg-next { grid-template-columns: 1fr; }
  .rg-stairs { height: 260px; max-width: 520px; }
  .rg-model-stages { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .rg-opts, .rg-fields { grid-template-columns: 1fr; }
  .rg-hint { display: none; }
  .rg-stairs li { font-size: .625rem; padding: 8px 6px; }
  .rg-stairs-pin { display: none; }
  .rg-res-steps { height: 200px; }
  .rg-res-steps li { font-size: .5625rem; padding: 8px 4px; }
  .rg-model-stages { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .rg-in, .rg-stairs li { animation: none; opacity: 1; transform: none; }
  .rg-stairs-pin { animation: none; transform: translate(-50%, 70px); }
}

/* ---------- Ergebnis nur per E-Mail ---------- */
.rg-gate { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 20px; align-items: stretch; }
.rg-gate-preview { position: relative; display: flex; flex-direction: column; padding: clamp(28px, 4vw, 44px); border-radius: 28px; background: var(--dark); color: var(--on-dark); overflow: hidden; }
.rg-gate-preview .rg-kicker { color: var(--brand-hi); }
.rg-gate-preview .rg-res-big b { filter: blur(10px); }
.rg-gate-preview .rg-res-steps { height: 190px; margin-top: 18px; filter: blur(5px); opacity: .85; }
.rg-gate-preview .rg-res-steps li { opacity: 1; transform: none; }
.rg-gate-preview .rg-res-steps li.is-here::after { display: none; }
.rg-gate-list { display: grid; gap: 10px; margin: auto 0 0; padding: 24px 0 0; list-style: none; }
.rg-gate-list li { display: flex; align-items: center; gap: 10px; font-size: .9375rem; color: #fff; }
.rg-gate-list li::before { content: "✓"; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 91, 31, .18); color: var(--brand-hi); font-size: .75rem; font-weight: 700; flex: none; }
.rg-gate-form { display: flex; flex-direction: column; justify-content: center; }
.rg-gate-form h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); letter-spacing: -0.04em; line-height: 1.08; }
.rg-gate-form > p:not(.rg-kicker):not(.rg-error) { margin-top: 10px; font-size: 1rem; color: var(--ink-2); line-height: 1.55; }
.rg-gate-form .btn { align-self: flex-start; }
.rg-gate-form .btn:disabled { opacity: .6; }
.rg-error { margin-top: 12px; font-size: .875rem; font-weight: 600; color: #B42318; }
.rg-sent { text-align: center; padding: clamp(40px, 6vw, 72px) clamp(20px, 5vw, 64px); border-radius: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.rg-sent-ic { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--brand-soft); color: var(--accent); animation: rg-pop .7s cubic-bezier(.34, 1.56, .64, 1); }
.rg-sent-ic .icon { width: 30px; height: 30px; }
@keyframes rg-pop { from { transform: scale(.4); opacity: 0; } }
.rg-sent h2 { margin-top: 20px; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.04em; }
.rg-sent > p { max-width: 34em; margin: 14px auto 0; color: var(--ink-2); line-height: 1.6; }
.rg-sent-next { max-width: 34em; margin: 36px auto 0; padding-top: 28px; border-top: 1px solid var(--line); }
.rg-sent-next h3 { font-size: 1.375rem; letter-spacing: -0.025em; }
.rg-sent-next > p:not(.rg-kicker) { margin: 8px 0 20px; color: var(--ink-2); }
@media (max-width: 960px) { .rg-gate { grid-template-columns: 1fr; } .rg-gate-form { order: -1; } }
.rg-view[hidden] { display: none !important; }
.rg-gate-preview .rg-res-steps li { opacity: 1 !important; transform: none !important; }
.rg-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ==========================================================================
   KI-Check als Agent
   ========================================================================== */
.ag-section { padding-top: clamp(56px, 7vw, 96px); }
.ag { --ag-bg: #0E0E10; --ag-panel: #151518; --ag-line: #26262B; --ag-ink: #F2F2F0; --ag-mut: #9A9AA0;
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 340px; height: min(760px, calc(100svh - 120px)); min-height: 560px;
  border-radius: 28px; background: var(--ag-bg); color: var(--ag-ink); isolation: isolate;
  box-shadow: 0 60px 120px -60px rgba(11, 11, 12, .8), 0 0 0 1px rgba(255, 255, 255, .06); }
.ag::before { content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: 29px; padding: 1px; opacity: 0; transition: opacity .5s var(--ease);
  background: linear-gradient(120deg, rgba(255, 91, 31, .9), rgba(255, 170, 120, .2) 30%, rgba(94, 92, 230, .7) 60%, rgba(255, 91, 31, .9)) 0 0 / 300% 100%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.ag.is-thinking::before { opacity: 1; animation: ag-border 3s linear infinite; }
@keyframes ag-border { to { background-position: 300% 0; } }
.ag::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: var(--grain) 0 0 / 128px 128px, radial-gradient(ellipse at 20% 0%, rgba(255, 91, 31, .12), transparent 55%); }

/* Chat */
.ag-chat { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--ag-line); }
.ag-head { position: relative; display: flex; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--ag-line); }
.ag-av { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #1B1B1F; box-shadow: inset 0 0 0 1px #2C2C32; }
.ag-av svg { width: 26px; height: 26px; fill: var(--brand); transition: transform .6s var(--ease); }
.ag.is-thinking .ag-av svg { animation: ag-breathe 1.4s ease-in-out infinite; }
@keyframes ag-breathe { 50% { transform: scale(.86) rotate(20deg); opacity: .8; } }
.ag-who { display: grid; }
.ag-who b { font-size: 1rem; letter-spacing: -0.01em; }
.ag-who small { display: flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--ag-mut); }
.ag-who small i { width: 7px; height: 7px; border-radius: 50%; background: #34C759; box-shadow: 0 0 0 3px rgba(52, 199, 89, .18); }
.ag-step { margin-left: auto; padding: 6px 11px; border-radius: 999px; background: #1B1B1F; font-size: .75rem; font-weight: 600; color: var(--ag-mut); font-variant-numeric: tabular-nums; }
.ag-restart { width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--ag-line); background: none; color: var(--ag-mut); font-size: 1rem; cursor: pointer; }
.ag-restart:hover { color: #fff; border-color: #3A3A40; }
.ag-prog { position: absolute; left: 0; bottom: -1px; height: 2px; width: calc(var(--prog, 0) * 100%); background: linear-gradient(90deg, var(--brand), #FFB08F); transition: width .8s cubic-bezier(.16, 1, .3, 1); }

.ag-log { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 26px 26px 18px; scrollbar-width: thin; scrollbar-color: #2C2C32 transparent; }
.ag-msg { max-width: min(560px, 88%); font-size: 1.0625rem; line-height: 1.55; animation: ag-in .45s cubic-bezier(.16, 1, .3, 1); }
@keyframes ag-in { from { opacity: 0; transform: translateY(8px); } }
.ag-bot { color: var(--ag-ink); }
.ag-bot p + p, .ag-bot blockquote + p, .ag-bot p + blockquote { margin-top: 10px; }
.ag-bot blockquote { margin: 10px 0 0; padding: 12px 16px; border-left: 3px solid var(--brand); border-radius: 0 12px 12px 0; background: #1B1B1F; font-size: 1rem; color: #E6E6E2; }
.ag-note { font-size: .875rem; color: var(--ag-mut); }
.ag-me { align-self: flex-end; padding: 10px 16px; border-radius: 18px 18px 6px 18px; background: #F2F2F0; color: var(--ink); font-size: 1rem; }
.ag-typing { display: inline-flex; gap: 5px; padding: 6px 0; }
.ag-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ag-mut); animation: ag-dot 1s ease-in-out infinite; }
.ag-typing i:nth-child(2) { animation-delay: .15s; } .ag-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ag-dot { 40% { transform: translateY(-4px); opacity: 1; } 0%, 80%, 100% { opacity: .35; } }
.ag-marker { align-self: center; margin: 6px 0 -2px; padding: 5px 12px; border-radius: 999px; background: #1B1B1F; font-size: .75rem; font-weight: 600; color: var(--ag-mut); letter-spacing: .01em; animation: ag-in .4s var(--ease); }

/* Werkzeug-Karte */
.ag-tool { align-self: flex-start; width: min(460px, 100%); padding: 14px 16px; border-radius: 16px; background: #141417; border: 1px solid var(--ag-line); font-size: .875rem; animation: ag-in .45s cubic-bezier(.16, 1, .3, 1); }
.ag-tool-h { display: flex; align-items: center; gap: 9px; margin: 0 0 10px; font-weight: 600; color: #fff; }
.ag-tool ol { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.ag-tool li { display: grid; grid-template-columns: 18px auto 1fr; align-items: center; gap: 8px; color: #6A6A70; transition: color .3s var(--ease); }
.ag-tool li b { font-weight: 500; }
.ag-tool li small { justify-self: end; font-size: .75rem; color: #6A6A70; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ag-st { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid #3A3A40; }
.ag-tool li.run { color: #fff; }
.ag-tool li.run .ag-st, .ag-spin { border: 2px solid rgba(255, 91, 31, .25); border-top-color: var(--brand); animation: ag-spin .8s linear infinite; }
.ag-spin { width: 14px; height: 14px; border-radius: 50%; }
@keyframes ag-spin { to { transform: rotate(360deg); } }
.ag-tool li.ok { color: #D8D8D4; }
.ag-tool li.ok .ag-st { border: 0; background: #34C759 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2.6 5.2l1.7 1.7 3.2-3.6' fill='none' stroke='%23fff' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") center / 100%; }
.ag-tool li.err .ag-st { border: 0; background: #FF453A; }
.ag-tool li.err small { color: #FF8A80; }
.ag-tool.is-done .ag-spin { animation: none; border: 0; background: #34C759 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2.6 5.2l1.7 1.7 3.2-3.6' fill='none' stroke='%23fff' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") center / 100%; }
.ag-tool.is-failed .ag-spin { animation: none; border: 0; background: #FF453A; }

/* Auswahl */
.ag-choices { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-end; justify-content: flex-end; max-width: 92%; animation: ag-in .4s cubic-bezier(.16, 1, .3, 1); }
.ag-choices.is-vertical { flex-direction: column; align-items: stretch; width: min(520px, 100%); }
.ag-chip { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px; border: 1px solid #34343A; background: #18181B; color: var(--ag-ink); font: inherit; font-size: .9375rem; text-align: left; cursor: pointer; transition: border-color .2s var(--ease), background-color .2s var(--ease), transform .2s var(--ease); }
.is-vertical .ag-chip { border-radius: 14px; padding: 12px 16px; }
.ag-chip:hover { border-color: var(--brand); background: #1E1A18; }
.ag-chip:active { transform: scale(.98); }
.ag-chip kbd { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: #26262B; font: 600 .75rem/1 ui-monospace, Consolas, monospace; color: var(--ag-mut); }
.ag-chip em { font-style: normal; padding: 2px 8px; border-radius: 999px; background: rgba(255, 91, 31, .16); color: var(--brand-hi); font-size: .6875rem; font-weight: 700; }
.ag-chip.is-hint { border-color: rgba(255, 91, 31, .6); }
.ag-chip.is-picked { background: var(--brand); border-color: var(--brand); color: #fff; }
.ag-chip.is-picked kbd { background: rgba(255, 255, 255, .25); color: #fff; }
.ag-choices.is-multi, .ag-choices.is-scale { flex-direction: column; align-items: flex-end; }
.ag-multi { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.ag-go { padding: 11px 20px; border-radius: 999px; border: 0; background: var(--brand); color: #fff; font: inherit; font-weight: 700; font-size: .9375rem; cursor: pointer; transition: opacity .2s var(--ease), transform .2s var(--ease); }
.ag-go:disabled { opacity: .35; cursor: default; }
.ag-go:not(:disabled):hover { transform: translateY(-1px); }
.ag-scale { display: grid; gap: 8px; width: min(560px, 100%); }
.ag-srow { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 12px; }
.ag-srow > span { font-size: .875rem; color: #D8D8D4; text-align: right; }
.ag-srow > div { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 3px; border-radius: 12px; background: #18181B; border: 1px solid #2C2C32; }
.ag-srow button { padding: 7px 4px; border-radius: 9px; border: 0; background: none; color: var(--ag-mut); font: inherit; font-size: .8125rem; cursor: pointer; }
.ag-srow button:hover { color: #fff; }
.ag-srow button.is-picked { background: var(--brand); color: #fff; font-weight: 600; }

/* Eingabe */
.ag-compose { display: flex; gap: 8px; margin: 0 18px 18px; padding: 6px 6px 6px 18px; border-radius: 999px; background: #18181B; border: 1px solid #34343A; animation: ag-in .4s var(--ease); }
.ag-compose:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(255, 91, 31, .15); }
.ag-compose input { flex: 1; min-width: 0; border: 0; background: none; color: #fff; font: inherit; font-size: 1rem; outline: none; }
.ag-compose input::placeholder { color: #6A6A70; }
.ag-skip { flex: none; padding: 0 14px; border-radius: 999px; border: 1px solid #34343A; background: none; color: var(--ag-mut); font: inherit; font-size: .8125rem; cursor: pointer; }
.ag-skip:hover { color: #fff; }
.ag-send { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; cursor: pointer; }
.ag-send .icon { width: 18px; height: 18px; }

/* Karten im Chat */
.ag-card { align-self: stretch; max-width: 560px; padding: 20px; border-radius: 18px; background: #F4F4F2; color: var(--ink); animation: ag-in .45s cubic-bezier(.16, 1, .3, 1); }
.ag-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ag-form label { display: grid; gap: 5px; font-size: .8125rem; font-weight: 600; color: var(--ink-2); }
.ag-form label:nth-of-type(3) { grid-column: 1 / -1; }
.ag-form input:not([type=checkbox]) { padding: 11px 13px; border-radius: 11px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 1rem; color: var(--ink); }
.ag-form input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.ag-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ag-consent { grid-column: 1 / -1; display: flex !important; align-items: flex-start; gap: 10px; font-weight: 400 !important; font-size: .8125rem !important; line-height: 1.45; color: var(--ink-2); }
.ag-consent input { margin-top: 2px; accent-color: var(--brand); }
.ag-form .ag-go { grid-column: 1 / -1; justify-self: start; }
.ag-err { grid-column: 1 / -1; margin: 0; font-size: .875rem; color: #C62828; }
.ag-card.is-sent { opacity: .5; pointer-events: none; }
.ag-next { display: grid; gap: 6px; justify-items: start; background: linear-gradient(135deg, #FFF3EC, #F4F4F2); }
.ag-next-k { margin: 0; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.ag-next-h { margin: 0; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.ag-next p:not([class]) { margin: 0 0 8px; color: var(--ink-2); }

/* Gedächtnis */
.ag-mem { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; padding: 20px 18px; background: rgba(255, 255, 255, .015); border-radius: 0 28px 28px 0; scrollbar-width: none; }
.ag-mem-h { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ag-mut); }
.ag-mem-h span { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px rgba(255, 91, 31, .2); }
.ag.is-thinking .ag-mem-h span { animation: ag-dot 1s ease-in-out infinite; }
.ag-mi { padding: 11px 13px; border-radius: 14px; background: #141417; border: 1px solid #222227; transition: border-color .4s var(--ease), background-color .4s var(--ease); }
.ag-mi small { display: block; margin-bottom: 4px; font-size: .6875rem; font-weight: 600; letter-spacing: .03em; color: #6A6A70; }
.ag-mv { font-size: .8125rem; line-height: 1.45; color: #4A4A50; }
.ag-mi.is-set { border-color: #2E2E34; }
.ag-mi.is-set .ag-mv { color: #D8D8D4; }
.ag-mi.is-flash { animation: ag-flash 1.2s var(--ease); }
@keyframes ag-flash { 0% { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(255, 91, 31, .15); } 100% { border-color: #2E2E34; box-shadow: none; } }
.ag-mv b { display: block; color: #fff; font-size: .875rem; }
.ag-mv span { display: block; }
.ag-tags { display: flex !important; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ag-tags i, .ag-chain i { font-style: normal; padding: 2px 7px; border-radius: 999px; background: #222227; font-size: .6875rem; color: #BDBDB8; }
.ag-chain { display: flex !important; flex-wrap: wrap; gap: 4px; }
.ag-chain i.hot { background: var(--brand); color: #fff; font-weight: 600; }
.ag-bars { display: grid !important; gap: 5px; }
.ag-bars > span { display: grid; grid-template-columns: 1fr 70px; align-items: center; gap: 8px; }
.ag-bars b { font-size: .75rem !important; font-weight: 500; color: #D8D8D4 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-bars i { height: 5px; border-radius: 5px; background: linear-gradient(90deg, var(--brand) calc(var(--v) * 100%), #26262B calc(var(--v) * 100%)); }
.ag-dims { display: grid !important; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.ag-dims span { display: flex; align-items: center; gap: 6px; font-size: .75rem; color: #6A6A70; }
.ag-dims i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid #3A3A40; }
.ag-dims .half { color: #BDBDB8; } .ag-dims .half i { border-color: var(--brand); background: linear-gradient(90deg, var(--brand) 50%, transparent 50%); }
.ag-dims .full { color: #fff; } .ag-dims .full i { border-color: var(--brand); background: var(--brand); }
.ag-mem-foot { margin: auto 0 0; padding-top: 10px; font-size: .75rem; line-height: 1.45; color: #5A5A60; }

@media (max-width: 960px) {
  .ag { grid-template-columns: 1fr; height: calc(100svh - 96px); min-height: 520px; border-radius: 22px; }
  .ag-chat { border-right: 0; }
  .ag-mem { display: none; }
  .ag-log { padding: 20px 16px 14px; }
  .ag-head { padding: 12px 14px; }
  .ag-step { font-size: .6875rem; }
  .ag-srow { grid-template-columns: 1fr; gap: 4px; }
  .ag-srow > span { text-align: left; }
  .ag-form { grid-template-columns: 1fr; }
  .ag-compose { margin: 0 10px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .ag.is-thinking::before, .ag-typing i, .ag-av svg, .ag-spin, .ag-tool li.run .ag-st { animation: none !important; }
}
.ag-compose[hidden] { display: none; }
.ag-step, .ag-who b { white-space: nowrap; }
@media (max-width: 640px) { .ag-step span { display: none; } .ag-who b { font-size: .9375rem; } .ag-av { width: 34px; height: 34px; } .ag-av svg { width: 22px; height: 22px; } }

/* ==========================================================================
   Agent v2: Bildkarten, Ablaufdiagramm, Entscheidungen von Jev
   ========================================================================== */
.ag-ico { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ag-choices.is-cards { align-self: stretch; max-width: none; align-items: flex-end; flex-direction: column; }
.ag-cards { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 10px; width: min(620px, 100%); }
.ag-card-o { position: relative; display: grid; justify-items: start; align-content: start; gap: 6px; min-height: 104px; padding: 14px; border-radius: 16px; border: 1px solid #2E2E34; background: linear-gradient(180deg, #1A1A1E, #151518); color: var(--ag-ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .2s var(--ease), transform .25s cubic-bezier(.16, 1, .3, 1), background-color .2s var(--ease); animation: ag-in .45s cubic-bezier(.16, 1, .3, 1) both; }
.ag-card-o:nth-child(2) { animation-delay: .04s; } .ag-card-o:nth-child(3) { animation-delay: .08s; } .ag-card-o:nth-child(4) { animation-delay: .12s; } .ag-card-o:nth-child(5) { animation-delay: .16s; } .ag-card-o:nth-child(6) { animation-delay: .2s; } .ag-card-o:nth-child(7) { animation-delay: .24s; }
.ag-card-o .ag-ico { color: var(--brand-hi); }
.ag-card-o b { font-size: .9375rem; line-height: 1.25; letter-spacing: -0.01em; }
.ag-card-o small { font-size: .75rem; line-height: 1.35; color: var(--ag-mut); }
.ag-card-o em { position: absolute; top: 10px; right: 10px; padding: 2px 7px; border-radius: 999px; background: rgba(255, 91, 31, .16); color: var(--brand-hi); font-style: normal; font-size: .625rem; font-weight: 700; }
.ag-card-o.is-hint { border-color: rgba(255, 91, 31, .55); }
.ag-card-o:hover { border-color: var(--brand); transform: translateY(-2px); }
.ag-card-o.is-picked { border-color: var(--brand); background: linear-gradient(180deg, rgba(255, 91, 31, .22), rgba(255, 91, 31, .08)); box-shadow: 0 0 0 3px rgba(255, 91, 31, .18); }
.ag-card-o.is-picked::after { content: "✓"; position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: #fff; font-size: .6875rem; font-weight: 800; }
.ag-card-o.is-picked em { display: none; }
.ag-people { display: flex; gap: 3px; height: 26px; align-items: flex-end; }
.ag-people i { width: 9px; height: 18px; border-radius: 5px 5px 2px 2px; background: var(--brand-hi); box-shadow: 0 -5px 0 -1px #1A1A1E, 0 -9px 0 -1px var(--brand-hi); opacity: .9; }
.ag-people i:nth-child(n+2) { opacity: .75; } .ag-people i:nth-child(n+3) { opacity: .6; } .ag-people i:nth-child(n+4) { opacity: .45; }

/* Ablaufdiagramm */
.ag-choices.is-flow { align-self: stretch; max-width: none; flex-direction: column; align-items: flex-end; }
.ag-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 6px; width: 100%; padding: 16px; border-radius: 18px; background: #131316; border: 1px solid #26262B; }
.ag-node { display: grid; gap: 2px; min-width: 92px; padding: 10px 12px; border-radius: 12px; border: 1px solid #34343A; background: #1B1B1F; color: var(--ag-ink); font: inherit; font-size: .875rem; font-weight: 600; text-align: left; cursor: pointer; transition: all .2s var(--ease); animation: ag-in .4s cubic-bezier(.16, 1, .3, 1) both; }
.ag-node small { font-family: ui-monospace, Consolas, monospace; font-size: .625rem; font-weight: 500; color: var(--ag-mut); }
.ag-node:hover { border-color: var(--brand); }
.ag-node.is-picked { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 4px rgba(255, 91, 31, .2), 0 10px 24px -10px rgba(255, 91, 31, .8); transform: translateY(-2px); }
.ag-node.is-picked small { color: rgba(255, 255, 255, .8); }
.ag-arrow { width: 16px; height: 2px; background: #3A3A40; position: relative; }
.ag-arrow::after { content: ""; position: absolute; right: -1px; top: -3px; width: 6px; height: 6px; border-top: 2px solid #3A3A40; border-right: 2px solid #3A3A40; transform: rotate(45deg); }

/* Entscheidungen (Jev) */
.ag-dec { align-self: flex-start; width: min(520px, 100%); padding: 14px 16px; border-radius: 16px; background: linear-gradient(180deg, #16161A, #121215); border: 1px solid rgba(255, 91, 31, .35); box-shadow: 0 0 0 1px rgba(255, 91, 31, .05), 0 18px 40px -24px rgba(255, 91, 31, .5); animation: ag-in .35s cubic-bezier(.16, 1, .3, 1); }
.ag-dec-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 10px; font-size: .875rem; font-weight: 600; color: #fff; }
.ag-dec-src { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; background: rgba(255, 91, 31, .14); color: var(--brand-hi); font: 600 .75rem/1.3 ui-monospace, "SFMono-Regular", Consolas, monospace; white-space: nowrap; }
.ag-dec-src strong { color: #fff; }
.ag-bolt { font-size: .8125rem; }
.ag-dec ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ag-dec li { display: grid; grid-template-columns: minmax(0, 11em) minmax(0, 1fr) 70px 38px; align-items: center; gap: 10px; font-size: .8125rem; }
.ag-dec li span { color: var(--ag-mut); }
.ag-dec li b { color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-dec li i { height: 5px; border-radius: 5px; background: #26262B; position: relative; overflow: hidden; }
.ag-dec li i::after { content: ""; position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, var(--brand), #FFB08F); transition: transform .5s cubic-bezier(.16, 1, .3, 1); }
.ag-dec.is-in li i::after { transform: scaleX(var(--p, 0)); }
.ag-dec li:nth-child(2) i::after { transition-delay: .06s; } .ag-dec li:nth-child(3) i::after { transition-delay: .12s; } .ag-dec li:nth-child(4) i::after { transition-delay: .18s; }
.ag-dec li i.na { opacity: .3; }
.ag-dec li em { font-style: normal; font: 600 .75rem/1 ui-monospace, Consolas, monospace; color: var(--ag-mut); text-align: right; }
.ag-dec.is-compact { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: auto; max-width: 92%; padding: 8px 10px; border-radius: 12px; }
.ag-dec-pill { padding: 3px 8px; border-radius: 999px; background: #1F1F24; font-size: .75rem; color: var(--ag-mut); }
.ag-dec-pill b { color: #fff; font-weight: 600; }
.ag-dec-pill em { font-style: normal; color: var(--brand-hi); font-family: ui-monospace, Consolas, monospace; }

/* Reifegrad: Stufen-Symbol an den Antworten */
.ag-lvl { flex: none; display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.ag-lvl i { width: 4px; border-radius: 1px; background: #34343A; }
.ag-lvl i:nth-child(1) { height: 5px; } .ag-lvl i:nth-child(2) { height: 8px; } .ag-lvl i:nth-child(3) { height: 12px; } .ag-lvl i:nth-child(4) { height: 16px; }
.ag-lvl[style*="--l:1"] i:nth-child(-n+1), .ag-lvl[style*="--l:2"] i:nth-child(-n+2), .ag-lvl[style*="--l:3"] i:nth-child(-n+3), .ag-lvl[style*="--l:4"] i:nth-child(-n+4) { background: var(--brand-hi); }
.ag-chip.is-picked .ag-lvl i { background: rgba(255, 255, 255, .5); }

/* Gedächtnis v2 */
.ag-mi-key.is-set { border-color: rgba(255, 91, 31, .45); background: linear-gradient(180deg, rgba(255, 91, 31, .08), #141417); }
.ag-basis { display: flex !important; align-items: center; gap: 10px; }
.ag-basis .ag-ico { width: 22px; height: 22px; color: var(--brand-hi); flex: none; }
.ag-basis b { display: block; }
.ag-chain i b { display: block; margin-top: 1px; font-size: .625rem; font-weight: 700; color: #fff; opacity: .85; }
.ag-qa { display: grid !important; gap: 6px; }
.ag-qa i { display: grid; font-style: normal; font-size: .75rem; color: #D8D8D4; }
.ag-qa small { font-size: .6875rem; color: #6A6A70; }
.ag-mi-dec.is-set { border-color: rgba(255, 91, 31, .3); }
.ag-dstat { display: block; font-size: .8125rem; color: #D8D8D4; }
.ag-dstat b { color: var(--brand-hi); font-family: ui-monospace, Consolas, monospace; }
.ag-dlog { display: grid !important; gap: 3px; margin-top: 6px; }
.ag-dlog i { display: grid; font-style: normal; font-size: .6875rem; color: #9A9AA0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-dlog em { font-style: normal; font-family: ui-monospace, Consolas, monospace; font-size: .625rem; color: var(--brand-hi); }
@media (max-width: 640px) {
  .ag-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ag-card-o { min-height: 92px; padding: 12px; }
  .ag-dec li { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px; }
  .ag-dec li i { display: none; }
  .ag-node { min-width: 0; }
  .ag-arrow { width: 10px; }
}
/* Vorgedachter Ablauf auf den Typ-Karten und KI-Hebel im Diagramm */
.ag-mini { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin-top: 4px; font-size: .625rem; color: #8A8A90; }
.ag-mini i { width: 8px; height: 1px; background: #4A4A50; }
.ag-card-o.is-picked .ag-mini { color: #FFD9C8; }
.ag-node em { display: block; margin-top: 3px; max-width: 150px; font-style: normal; font-size: .6875rem; font-weight: 500; line-height: 1.3; color: var(--brand-hi); }
.ag-node.is-picked em { color: #fff; }
.ag-cards { width: min(680px, 100%); }

/* ---------- Scan-Fenster: dem Agenten beim Lesen zusehen ---------- */
.ag-scan { --site: var(--brand); align-self: flex-start; width: min(520px, 100%); display: grid; gap: 12px; animation: ag-in .45s cubic-bezier(.16, 1, .3, 1); }
.ag-scan-win { position: relative; border-radius: 14px; overflow: hidden; background: #F4F4F2; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .08); }
.ag-scan-bar { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; background: #E6E6E1; }
.ag-scan-bar > i { width: 9px; height: 9px; border-radius: 50%; background: #FF6159; } .ag-scan-bar > i:nth-child(2) { background: #FFBD2E; } .ag-scan-bar > i:nth-child(3) { background: #28C941; }
.ag-scan-url { flex: 1; display: flex; align-items: center; margin-left: 10px; padding: 3px 10px; border-radius: 7px; background: #fff; font-size: .75rem; color: #3A3A3F; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; overflow: hidden; white-space: nowrap; }
.ag-scan-url em { width: 1px; height: 12px; margin-left: 1px; background: #3A3A3F; animation: ag-caret 1s steps(1) infinite; }
.ag-scan.is-done .ag-scan-url em { display: none; }
@keyframes ag-caret { 50% { opacity: 0; } }
.ag-scan-tabs { display: flex; gap: 4px; padding: 0 10px; background: #E6E6E1; min-height: 0; }
.ag-scan-tabs span { margin-bottom: -1px; padding: 4px 10px; border-radius: 7px 7px 0 0; background: #EFEFEA; font-size: .6875rem; color: #55555A; font-family: ui-monospace, Consolas, monospace; animation: ag-in .35s cubic-bezier(.16, 1, .3, 1); }
.ag-scan-tabs:not(:empty) { padding-top: 5px; }
.ag-scan-view { position: relative; min-height: 230px; padding: 14px; color: #141416; }
.ag-scan-hero { position: relative; display: grid; align-items: end; height: 110px; padding: 12px; border-radius: 10px; background: linear-gradient(135deg, #E9E9E4, #DADAD3); background-size: cover; background-position: center; overflow: hidden; }
.ag-scan-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .6), transparent); transform: translateX(-100%); animation: ag-shimmer 1.4s ease-in-out infinite; }
.ag-scan-hero.is-on::before { display: none; }
.ag-scan-hero.has-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, .55)); }
.ag-scan-hero.is-on { animation: ag-hero .7s cubic-bezier(.16, 1, .3, 1); }
@keyframes ag-hero { from { filter: blur(10px) saturate(.3); transform: scale(1.04); } }
@keyframes ag-shimmer { to { transform: translateX(100%); } }
.ag-scan-title { position: relative; z-index: 1; font-size: 1rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; color: #141416; opacity: 0; transition: opacity .5s var(--ease) .2s; }
.ag-scan-hero.has-img .ag-scan-title { color: #fff; }
.ag-scan-hero.is-on .ag-scan-title { opacity: 1; }
.ag-scan-sk { display: grid; gap: 8px; margin-top: 12px; }
.ag-scan-sk i { display: block; width: var(--w); height: 8px; border-radius: 4px; background: #E3E3DD; }
.ag-scan.is-read .ag-scan-sk { display: none; }
.ag-scan-heads { display: grid; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.ag-scan-heads li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; background: #fff; font-size: .8125rem; font-weight: 600; box-shadow: 0 0 0 1px #E6E6E1; animation: ag-mark .6s cubic-bezier(.16, 1, .3, 1); }
.ag-scan-heads li i { flex: none; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: var(--site); color: #fff; font-style: normal; font-size: .625rem; font-weight: 800; }
@keyframes ag-mark { from { opacity: 0; transform: translateX(-8px); box-shadow: 0 0 0 2px var(--site); } 60% { box-shadow: 0 0 0 2px var(--site); } }
.ag-scan-line { position: absolute; left: 0; right: 0; top: 0; height: 60px; background: linear-gradient(180deg, transparent, rgba(255, 91, 31, .16) 70%, rgba(255, 91, 31, .9) 98%, transparent); pointer-events: none; animation: ag-scan 1.6s cubic-bezier(.45, 0, .55, 1) infinite; }
.ag-scan.is-done .ag-scan-line, .ag-scan.is-failed .ag-scan-line { opacity: 0; transition: opacity .4s var(--ease); animation-play-state: paused; }
@keyframes ag-scan { 0% { transform: translateY(-60px); } 100% { transform: translateY(260px); } }
.ag-scan-tags { position: absolute; right: 10px; top: 10px; display: grid; justify-items: end; gap: 5px; }
.ag-scan-tags span { padding: 4px 9px; border-radius: 999px; background: #141416; color: #fff; font-size: .6875rem; font-weight: 600; box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .6); animation: ag-pop .45s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes ag-pop { from { opacity: 0; transform: scale(.6) translateY(6px); } }
.ag-scan-steps { display: grid; gap: 6px; margin: 0; padding: 12px 14px; list-style: none; border-radius: 14px; background: #141417; border: 1px solid var(--ag-line); font-size: .8125rem; }
.ag-scan-steps li { display: grid; grid-template-columns: 18px auto 1fr; align-items: center; gap: 8px; color: #6A6A70; }
.ag-scan-steps li b { font-weight: 500; }
.ag-scan-steps li small { justify-self: end; font-size: .6875rem; color: #6A6A70; font-family: ui-monospace, Consolas, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ag-scan-steps li.run { color: #fff; }
.ag-scan-steps li.run .ag-st { border: 2px solid rgba(255, 91, 31, .25); border-top-color: var(--brand); animation: ag-spin .8s linear infinite; }
.ag-scan-steps li.ok { color: #D8D8D4; }
.ag-scan-steps li.ok .ag-st { border: 0; background: #34C759 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2.6 5.2l1.7 1.7 3.2-3.6' fill='none' stroke='%23fff' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") center / 100%; }
.ag-scan-steps li.err .ag-st { border: 0; background: #FF453A; }
.ag-scan-steps li.err small { color: #FF8A80; }
@media (prefers-reduced-motion: reduce) { .ag-scan-line, .ag-scan-hero::before { animation: none; display: none; } }
.ag-scan-tags span { max-width: 230px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Echter Screenshot im Scan-Fenster ---------- */
.ag-scan-shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; filter: blur(8px); transform: scale(1.03); transition: opacity .8s var(--ease), filter .9s var(--ease), transform 1.2s cubic-bezier(.16, 1, .3, 1); }
.ag-scan.has-shot .ag-scan-shot { opacity: 1; filter: none; transform: none; }
.ag-scan.has-shot .ag-scan-view { min-height: 300px; }
.ag-scan.has-shot .ag-scan-hero, .ag-scan.has-shot .ag-scan-sk { opacity: 0; }
.ag-scan.has-shot .ag-scan-heads { position: absolute; z-index: 2; left: 10px; right: 10px; bottom: 10px; margin: 0; }
.ag-scan.has-shot .ag-scan-heads li { background: rgba(255, 255, 255, .94); backdrop-filter: none; box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .5); }
.ag-scan.has-shot .ag-scan-heads li:nth-child(n+4) { display: none; }
.ag-scan-line, .ag-scan-tags { z-index: 3; }

/* ---------- Fragenbank ---------- */
.ag-bank { align-self: flex-start; width: min(520px, 100%); padding: 14px 16px; border-radius: 16px; background: linear-gradient(180deg, #16161A, #121215); border: 1px solid rgba(255, 91, 31, .35); animation: ag-in .35s cubic-bezier(.16, 1, .3, 1); }
.ag-bank-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 12px; font-size: .8125rem; font-weight: 600; color: #fff; }
.ag-bank-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.ag-bank-grid div { display: grid; gap: 4px; }
.ag-bank-grid small { font-size: .6875rem; color: var(--ag-mut); }
.ag-bank-grid span { display: flex; gap: 4px; }
.ag-bank-grid i { width: 14px; height: 14px; border-radius: 4px; background: rgba(255, 91, 31, calc(.08 + var(--p) * .3)); border: 1px solid #2E2E34; transform: scale(.4); opacity: 0; transition: transform .4s cubic-bezier(.34, 1.56, .64, 1), opacity .3s var(--ease), background-color .4s var(--ease); }
.ag-bank.is-in .ag-bank-grid i { transform: none; opacity: 1; }
.ag-bank-grid div:nth-child(2) i { transition-delay: .05s; } .ag-bank-grid div:nth-child(3) i { transition-delay: .1s; } .ag-bank-grid div:nth-child(4) i { transition-delay: .15s; } .ag-bank-grid div:nth-child(5) i { transition-delay: .2s; } .ag-bank-grid div:nth-child(6) i { transition-delay: .25s; } .ag-bank-grid div:nth-child(7) i { transition-delay: .3s; } .ag-bank-grid div:nth-child(8) i { transition-delay: .35s; } .ag-bank-grid div:nth-child(9) i { transition-delay: .4s; } .ag-bank-grid div:nth-child(10) i { transition-delay: .45s; }
.ag-bank-grid i.on { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 91, 31, .25), 0 0 12px rgba(255, 91, 31, .7); }
.ag-bank.is-in .ag-bank-grid i.on { animation: ag-pick .9s cubic-bezier(.34, 1.56, .64, 1) .6s both; }
@keyframes ag-pick { 0% { transform: scale(1); } 40% { transform: scale(1.5); } 100% { transform: scale(1); } }
.ag-bank-foot { margin: 12px 0 0; font-size: .75rem; color: var(--ag-mut); }
.ag-dec-follow { font-size: .8125rem; color: #D8D8D4; }
.ag-dec-follow b { color: #fff; }
@media (max-width: 640px) { .ag-bank-grid { grid-template-columns: 1fr; } }
.ag-scan.has-shot .ag-scan-heads li:nth-child(n+3) { display: none; }

/* ---------- Bericht: Vorschau des Titelblatts ---------- */
.ag-pdf-card { display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: center; background: #141417; color: var(--ag-ink); border: 1px solid var(--ag-line); }
.ag-pdf { position: relative; width: 150px; aspect-ratio: 210 / 297; border-radius: 6px; overflow: hidden; box-shadow: 0 24px 40px -18px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .08); transform: perspective(700px) rotateY(12deg) rotateX(4deg) scale(.9); opacity: 0; transition: transform 1s cubic-bezier(.16, 1, .3, 1), opacity .6s var(--ease); }
.ag-pdf-card.is-in .ag-pdf { transform: perspective(700px) rotateY(-8deg) rotateX(2deg); opacity: 1; }
.ag-pdf img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ag-pdf-tag { position: absolute; left: 8px; bottom: 8px; padding: 3px 8px; border-radius: 999px; background: var(--brand); color: #fff; font-size: .6875rem; font-weight: 700; }
.ag-pdf-meta { display: grid; gap: 6px; }
.ag-pdf-meta b { font-size: 1.125rem; letter-spacing: -0.02em; }
.ag-pdf-meta span { font-size: .8125rem; color: var(--ag-mut); line-height: 1.5; }
.ag-bg { display: flex !important; align-items: center; gap: 8px; color: #D8D8D4; }
.ag-bg i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid rgba(255, 91, 31, .25); border-top-color: var(--brand); animation: ag-spin .8s linear infinite; }
@media (max-width: 640px) { .ag-pdf-card { grid-template-columns: 110px 1fr; } .ag-pdf { width: 110px; } }

/* ---------- KI-Check als eigenständige App-Ansicht: nur Kopfzeile und Chat, kein Scrollen der Seite ---------- */
html:has(body.rg-app-page) { height: 100%; overflow: hidden; }
.rg-app-page { height: 100svh; overflow: hidden; display: flex; flex-direction: column; background: var(--bg); }
.rg-app-page .site-header { flex: none; position: relative; border-bottom-color: var(--line); }
.rg-app-page main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.rg-app-page .ag-section { flex: 1; min-height: 0; display: flex; padding: 14px 0 0; margin: 0; }
.rg-app-page .ag-section > .container { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.rg-app-page .ag { flex: 1; height: auto; min-height: 0; }
.rg-legal { flex: none; display: flex; justify-content: center; gap: 8px; margin: 0; padding: 8px 16px 10px; font-size: .75rem; color: var(--muted); }
.rg-legal a { color: var(--muted); text-decoration: none; }
.rg-legal a:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 960px) {
  .rg-app-page .ag-section { padding: 8px 0 0; }
  .rg-app-page .ag-section > .container { padding-left: 8px; padding-right: 8px; }
  .rg-app-page .ag { height: auto; min-height: 0; border-radius: 18px; }
  .rg-legal { padding: 6px 12px 8px; }
}
@media (max-width: 960px) { .rg-app-page .ag { grid-template-columns: minmax(0, 1fr); width: 100%; max-width: 100%; } .ag-chat { min-width: 0; } .ag-compose input { width: 0; } .ag-skip { white-space: nowrap; font-size: .75rem; padding: 0 10px; } }

/* ---------- Notizen für den Bericht (Einordnungen von Jev) ---------- */
.ag-note { align-self: flex-start; width: min(500px, 100%); padding: 12px 14px 12px; border-radius: 14px; background: #131316; border: 1px solid #2A2A30; border-left: 3px solid var(--brand); animation: ag-in .35s cubic-bezier(.16, 1, .3, 1); }
.ag-note-h { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-hi); }
.ag-note-ic { flex: none; width: 14px; height: 14px; border-radius: 3px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 3h10l4 4v14H5z M14 3v5h5' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M8 12h8M8 16h6' stroke='black' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 3h10l4 4v14H5z M14 3v5h5' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M8 12h8M8 16h6' stroke='black' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat; }
.ag-note-t { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 91, 31, .12); font: 600 .6875rem/1.4 ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: 0; text-transform: none; color: var(--brand-hi); white-space: nowrap; }
.ag-note-t.is-rule { background: #1F1F24; color: var(--ag-mut); }
.ag-note-s { margin: 0; font-size: .9375rem; line-height: 1.45; color: #E6E6E2; }
.ag-note-s b { color: #fff; }
.ag-note ul { display: grid; gap: 6px; margin: 10px 0 0; padding: 10px 0 0; list-style: none; border-top: 1px solid #24242A; }
.ag-note li { display: grid; grid-template-columns: minmax(0, 12em) minmax(0, 1fr) 56px 64px; align-items: center; gap: 10px; font-size: .8125rem; }
.ag-note li span { color: var(--ag-mut); }
.ag-note li b { color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-note li i { height: 4px; border-radius: 4px; background: #26262B; position: relative; overflow: hidden; }
.ag-note li i::after { content: ""; position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, var(--brand), #FFB08F); transition: transform .5s cubic-bezier(.16, 1, .3, 1); }
.ag-note.is-in li i::after { transform: scaleX(var(--p, 0)); }
.ag-note li i.na { opacity: .3; }
.ag-note li em { font-style: normal; font-size: .6875rem; color: var(--ag-mut); text-align: right; white-space: nowrap; }
.ag-note-f { margin: 10px 0 0; font-size: .75rem; color: var(--ag-mut); }
.ag-note-f b { color: #D8D8D4; font-weight: 600; }
.ag-note-f::before { content: "→ "; color: var(--brand-hi); }
.ag-note.is-compact { display: flex; align-items: center; gap: 8px; width: auto; max-width: 92%; padding: 8px 12px; border-radius: 12px; }
.ag-note.is-compact .ag-note-ic { color: var(--brand-hi); width: 13px; height: 13px; }
.ag-note-k { font-size: .6875rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--brand-hi); }
.ag-note.is-compact .ag-note-s { font-size: .8125rem; color: #D8D8D4; }
.ag-note.is-compact .ag-note-t { margin-left: 6px; }
.ag-dlog i { display: flex !important; justify-content: space-between; gap: 8px; }
.ag-dlog em { flex: none; }
@media (max-width: 640px) {
  .ag-note li { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 54px; }
  .ag-note li i { display: none; }
  .ag-note.is-compact { flex-wrap: wrap; }
}

/* Hinweis zur Speicherung in der Begrüßung */
.ag-bot .ag-hint { font-size: .8125rem; line-height: 1.45; color: var(--ag-mut); }
.ag-bot .ag-hint a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
