/* ─────────────────────────────────────────────────────────────────────────
   AI-Partner-Grafiken (apx-*) — gebaute Produkt-Grafiken statt Screenshots.
   Genutzt auf /ai-partner/, der Startseite (AI-Abschnitt) und One View.
   Zahlen sind Beispielwerte im Stil der Startseite (Nord/Mitte/Süd), nie
   echte Kunden- oder Demo-Account-Daten.
   ───────────────────────────────────────────────────────────────────────── */
:root {
  --apx-night: #0C2124;
  --apx-deep: #12383C;
  --apx-teal: #6CABB0;
  --apx-teal-soft: rgba(108, 171, 176, .16);
  --apx-light: #F7FAFA;
  --apx-dim: rgba(247, 250, 250, .66);
  --apx-faint: rgba(247, 250, 250, .4);
  --apx-line: rgba(247, 250, 250, .12);
  --apx-glow: #D9A176;
  --apx-ok: #8FC49B;
  --apx-warn: #E5BC85;
  --apx-mono: 'JetBrains Mono', ui-monospace, monospace;
  --apx-serif: 'Instrument Serif', Georgia, serif;
  --apx-sans: 'DM Sans', system-ui, sans-serif;
}

/* ── App-Fenster ─────────────────────────────────────────────────────────── */
.apx {
  position: relative;
  background: linear-gradient(180deg, rgba(12, 33, 36, .82) 0%, rgba(18, 56, 60, .78) 100%);
  border: 1px solid rgba(108, 171, 176, .28);
  border-radius: 20px;
  color: var(--apx-light);
  font-family: var(--apx-sans);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(247, 250, 250, .1);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
  text-align: left;
}
.apx::before { /* weiches Kupfer-Glimmen oben rechts: "hier denkt etwas" */
  content: ""; position: absolute; width: 420px; height: 420px; right: -160px; top: -220px; pointer-events: none;
  background: radial-gradient(circle, rgba(217, 161, 118, .22) 0%, transparent 65%);
}
.apx-bar { display: flex; align-items: center; gap: 18px; padding: 14px 18px; border-bottom: 1px solid var(--apx-line); position: relative; }
.apx-brand { display: flex; align-items: center; gap: 8px; font-family: var(--apx-mono); font-size: 10px; letter-spacing: .18em; color: var(--apx-dim); white-space: nowrap; }
.apx-spark { width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; color: var(--apx-night);
  background: linear-gradient(135deg, var(--apx-glow), #F2D2B4); box-shadow: 0 0 18px rgba(217, 161, 118, .55); }
.apx-tabs { display: flex; gap: 4px; margin-left: auto; background: rgba(247, 250, 250, .06); border-radius: 10px; padding: 3px; }
.apx-tab { font-size: 12px; padding: 6px 12px; border-radius: 8px; color: var(--apx-dim); white-space: nowrap; transition: background .4s, color .4s; display: flex; align-items: center; gap: 6px; }
.apx-tab .n { font-family: var(--apx-mono); font-size: 9px; background: var(--apx-glow); color: var(--apx-night); border-radius: 99px; padding: 1px 6px; }
.apx[data-tab="chat"] .apx-tab[data-for="chat"],
.apx[data-tab="workspace"] .apx-tab[data-for="workspace"],
.apx[data-tab="analysen"] .apx-tab[data-for="analysen"] { background: rgba(247, 250, 250, .14); color: var(--apx-light); }
.apx-body { position: relative; padding: 22px; min-height: 360px; }
.apx-pane { position: absolute; inset: 22px; opacity: 0; transform: translateY(10px); transition: opacity .6s ease, transform .6s ease; pointer-events: none; }
.apx[data-tab="chat"] .apx-pane[data-pane="chat"],
.apx[data-tab="workspace"] .apx-pane[data-pane="workspace"],
.apx[data-tab="analysen"] .apx-pane[data-pane="analysen"] { opacity: 1; transform: none; pointer-events: auto; }
.apx-solo .apx-body { min-height: 0; }
.apx-solo .apx-pane { position: static; opacity: 1; transform: none; }
.apx-progress { position: absolute; left: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, var(--apx-teal), var(--apx-glow)); width: 0; }
.apx.is-cycling .apx-progress { animation: apxProgress var(--apx-cycle, 6s) linear infinite; }
@keyframes apxProgress { from { width: 0; } to { width: 100%; } }

/* ── Chat ────────────────────────────────────────────────────────────────── */
.apx-q { margin-left: auto; max-width: 78%; background: rgba(247, 250, 250, .12); border: 1px solid var(--apx-line); border-radius: 14px 14px 4px 14px; padding: 10px 14px; font-size: 13.5px; line-height: 1.45; width: fit-content; }
.apx-a { margin-top: 14px; display: flex; gap: 10px; }
.apx-a .apx-spark { flex-shrink: 0; margin-top: 2px; }
.apx-a-body { flex: 1; min-width: 0; }
.apx-a p { font-size: 13.5px; line-height: 1.55; color: var(--apx-light); margin: 0 0 12px; }
.apx-a p b { color: var(--apx-glow); font-weight: 600; }
.apx-chart { background: rgba(247, 250, 250, .05); border: 1px solid var(--apx-line); border-radius: 12px; padding: 12px 14px 10px; }
.apx-chart-head { flex-wrap: wrap; display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.apx-chart-title { font-family: var(--apx-mono); font-size: 9.5px; letter-spacing: .12em; color: var(--apx-dim); }
.apx-chips { display: flex; gap: 4px; }
.apx-chip { white-space: nowrap; font-family: var(--apx-mono); font-size: 9px; padding: 3px 7px; border-radius: 99px; border: 1px solid var(--apx-line); color: var(--apx-faint); }
.apx-chip.on { background: var(--apx-teal-soft); border-color: rgba(108, 171, 176, .45); color: var(--apx-light); }
.apx-bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; align-items: end; height: 92px; position: relative; }
.apx-bars::after { /* Plan-Linie */
  content: ""; position: absolute; left: 0; right: 0; bottom: 58%; border-top: 1px dashed rgba(247, 250, 250, .32);
}
.apx-col { position: relative; height: var(--h); background: linear-gradient(180deg, rgba(108, 171, 176, .85), rgba(108, 171, 176, .35)); border-radius: 5px 5px 2px 2px; transform-origin: bottom; }
.apx-col.hot { background: linear-gradient(180deg, var(--apx-glow), rgba(217, 161, 118, .35)); }
.apx-col span { position: absolute; bottom: -16px; left: 50%; transform: translateX(-50%); font-family: var(--apx-mono); font-size: 8.5px; color: var(--apx-faint); white-space: nowrap; }
.apx-col.hot b { position: absolute; top: -17px; left: 50%; transform: translateX(-50%); font-family: var(--apx-mono); font-size: 9px; color: var(--apx-glow); font-weight: 500; white-space: nowrap; }
.apx-legend { display: flex; justify-content: space-between; margin-top: 22px; font-family: var(--apx-mono); font-size: 8.5px; letter-spacing: .08em; color: var(--apx-faint); }
.apx-src { margin-top: 10px; font-family: var(--apx-mono); font-size: 9px; letter-spacing: .06em; color: var(--apx-faint); display: flex; gap: 6px; flex-wrap: wrap; }
.apx-src span { border: 1px solid var(--apx-line); border-radius: 6px; padding: 2px 6px; }
.apx-follow { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.apx-follow span { font-size: 11.5px; padding: 5px 10px; border-radius: 99px; background: rgba(247, 250, 250, .07); border: 1px solid var(--apx-line); color: var(--apx-dim); }
.apx-cursor { display: inline-block; width: 7px; height: 14px; background: var(--apx-glow); margin-left: 2px; vertical-align: -2px; animation: apxBlink 1s steps(1) infinite; }
@keyframes apxBlink { 50% { opacity: 0; } }
.apx.is-animated .apx-pane[data-pane="chat"] .apx-col { animation: apxGrow .9s cubic-bezier(.22, 1, .36, 1) both; }
.apx.is-animated .apx-pane[data-pane="chat"] .apx-col:nth-child(2) { animation-delay: .06s; }
.apx.is-animated .apx-pane[data-pane="chat"] .apx-col:nth-child(3) { animation-delay: .12s; }
.apx.is-animated .apx-pane[data-pane="chat"] .apx-col:nth-child(4) { animation-delay: .18s; }
.apx.is-animated .apx-pane[data-pane="chat"] .apx-col:nth-child(5) { animation-delay: .24s; }
.apx.is-animated .apx-pane[data-pane="chat"] .apx-col:nth-child(6) { animation-delay: .3s; }
@keyframes apxGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* ── AI Workspace ────────────────────────────────────────────────────────── */
.apx-greet { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.apx-greet h4 { font-family: var(--apx-serif); font-weight: 400; font-size: 24px; margin: 0; color: var(--apx-light); }
.apx-greet small { font-family: var(--apx-mono); font-size: 9.5px; letter-spacing: .12em; color: var(--apx-dim); white-space: nowrap; }
.apx-cards { display: flex; flex-direction: column; gap: 10px; }
.apx-card { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; padding: 13px 15px; border-radius: 12px; background: rgba(247, 250, 250, .06); border: 1px solid var(--apx-line); }
.apx-card .meta { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; font-family: var(--apx-mono); font-size: 9px; letter-spacing: .1em; color: var(--apx-faint); }
.apx-card .prio { color: var(--apx-warn); }
.apx-card .t { font-size: 14px; font-weight: 600; line-height: 1.35; }
.apx-card .d { grid-column: 1; font-size: 12px; color: var(--apx-dim); line-height: 1.45; }
.apx-card .eur { grid-row: 2 / span 2; grid-column: 2; align-self: center; text-align: right; font-family: var(--apx-serif); font-size: 21px; color: var(--apx-ok); white-space: nowrap; line-height: 1; }
.apx-card .eur small { display: block; font-family: var(--apx-mono); font-size: 8.5px; letter-spacing: .08em; color: var(--apx-faint); margin-top: 4px; }
.apx-card .act { grid-column: 1 / -1; display: flex; gap: 6px; margin-top: 8px; }
.apx-card .act span { font-size: 11.5px; padding: 5px 11px; border-radius: 8px; border: 1px solid var(--apx-line); color: var(--apx-dim); }
.apx-card .act span.go { background: var(--apx-light); color: var(--apx-night); border-color: transparent; font-weight: 600; }
.apx.is-animated .apx-pane[data-pane="workspace"] .apx-card { animation: apxIn .7s cubic-bezier(.22, 1, .36, 1) both; }
.apx.is-animated .apx-pane[data-pane="workspace"] .apx-card:nth-child(2) { animation-delay: .12s; }
.apx.is-animated .apx-pane[data-pane="workspace"] .apx-card:nth-child(3) { animation-delay: .24s; }
@keyframes apxIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.apx-log { margin-top: 14px; border-top: 1px solid var(--apx-line); padding-top: 12px; }
.apx-log .h { font-family: var(--apx-mono); font-size: 9.5px; letter-spacing: .14em; color: var(--apx-teal); margin-bottom: 8px; }
.apx-log .r { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--apx-dim); padding: 4px 0; }
.apx-log .r b { color: var(--apx-ok); font-weight: 500; font-family: var(--apx-mono); font-size: 10.5px; white-space: nowrap; }

/* ── AI Analysen ─────────────────────────────────────────────────────────── */
.apx-occ { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 12px; }
.apx-occ span { font-size: 11px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--apx-line); color: var(--apx-dim); }
.apx-occ span.on { background: var(--apx-light); color: var(--apx-night); border-color: transparent; font-weight: 600; }
.apx-lib { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.apx-tpl { padding: 11px 12px; border-radius: 11px; background: rgba(247, 250, 250, .05); border: 1px solid var(--apx-line); }
.apx-tpl .t { font-size: 13px; font-weight: 600; }
.apx-tpl .r { font-family: var(--apx-mono); font-size: 8.5px; letter-spacing: .1em; color: var(--apx-faint); margin-top: 4px; }
.apx-tpl.run { border-color: rgba(217, 161, 118, .5); background: rgba(217, 161, 118, .08); }
.apx-tpl.run .r { color: var(--apx-glow); }
.apx-tpl.own { border-style: dashed; border-color: rgba(108, 171, 176, .55); }
.apx-tpl.own .r { color: var(--apx-teal); }
.apx-checks { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 10px; font-family: var(--apx-mono); font-size: 9.5px; letter-spacing: .06em; color: var(--apx-dim); }
.apx-checks span::before { content: "✓ "; color: var(--apx-ok); }
.apx-result { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.apx-result > div { padding: 10px 11px; border-radius: 10px; background: rgba(247, 250, 250, .06); border: 1px solid var(--apx-line); }
.apx-result .k { font-family: var(--apx-mono); font-size: 8.5px; letter-spacing: .14em; color: var(--apx-teal); margin-bottom: 5px; }
.apx-result p { margin: 0; font-size: 12px; line-height: 1.45; color: var(--apx-light); }
.apx-out { display: flex; gap: 6px; margin-top: 10px; }
.apx-out span { font-size: 11px; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--apx-line); color: var(--apx-dim); }
.apx.is-animated .apx-pane[data-pane="analysen"] .apx-result > div { animation: apxIn .7s cubic-bezier(.22, 1, .36, 1) both; }
.apx.is-animated .apx-pane[data-pane="analysen"] .apx-result > div:nth-child(2) { animation-delay: .15s; }
.apx.is-animated .apx-pane[data-pane="analysen"] .apx-result > div:nth-child(3) { animation-delay: .3s; }

/* ── Startseite: Bühne mit drei Mini-Grafiken über dem Laufband ──────────── */
.apx-stage { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.apx-stage-item { display: flex; flex-direction: column; gap: 16px; }
.apx-stage-item .apx-body { padding: 16px; }
.apx-stage-item h3 { font-family: var(--apx-serif); font-weight: 400; font-size: 1.55rem; color: var(--apx-light); margin: 0; }
.apx-stage-item p { font-size: .92rem; line-height: 1.6; color: rgba(247, 250, 250, .72); margin: 6px 0 0; }
.apx-stage-kicker { font-family: var(--apx-mono); font-size: 10px; letter-spacing: .2em; color: var(--apx-glow); }
.apx-more { display: inline-flex; align-items: center; gap: 8px; margin-top: 40px; font-weight: 600; color: var(--apx-light); text-decoration: none; border-bottom: 1px solid rgba(247, 250, 250, .35); padding-bottom: 3px; }
.apx-more:hover { border-color: var(--apx-glow); color: #fff; }
@media (max-width: 960px) { .apx-stage { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; } }

/* ── Aufgedeckt / Gespart (Vertrauen) ────────────────────────────────────── */
.apx-ledger { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.apx-ledger > div { padding: 14px; border-radius: 12px; background: rgba(247, 250, 250, .06); border: 1px solid var(--apx-line); }
.apx-ledger .k { font-family: var(--apx-mono); font-size: 9px; letter-spacing: .14em; color: var(--apx-dim); }
.apx-ledger .v { font-family: var(--apx-serif); font-size: 28px; margin-top: 6px; line-height: 1; }
.apx-ledger .s { font-size: 11.5px; color: var(--apx-faint); margin-top: 6px; line-height: 1.4; }
.apx-ledger .ok .v { color: var(--apx-ok); }
.apx-ledger .pot .v { color: var(--apx-glow); }

@media (max-width: 640px) {
  .apx-bar { flex-wrap: wrap; gap: 10px; }
  .apx-tabs { margin-left: 0; width: 100%; justify-content: space-between; }
  .apx-tab { padding: 6px 8px; font-size: 11px; }
  .apx-body { min-height: 470px; padding: 16px; }
  .apx-pane { inset: 16px; }
  .apx-lib { grid-template-columns: 1fr; }
  .apx-lib .apx-tpl:nth-child(n+3) { display: none; }
  .apx-greet { flex-direction: column; align-items: flex-start; gap: 4px; }
  .apx-greet h4 { white-space: nowrap; }
  .apx-result, .apx-ledger { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .apx-pane, .apx-tab { transition: none; }
  .apx.is-animated .apx-col, .apx.is-animated .apx-card, .apx.is-animated .apx-result > div { animation: none !important; }
  .apx.is-cycling .apx-progress, .apx-cursor { animation: none; }
}

/* Kompakte Bühnen-Variante (Startseite) */
.apx-mini { height: 100%; }
.apx-mini .apx-body { padding: 16px; }
.apx-mini .apx-bars { height: 70px; }
.apx-mini .apx-a p, .apx-mini .apx-q { font-size: 12.5px; }
.apx-mini .apx-card .t { font-size: 13px; }
.apx-mini .apx-card .eur { font-size: 18px; }
.apx-mini .apx-greet h4 { font-size: 20px; }
.apx-mini .apx-tpl { margin-bottom: 4px; }
.apx-marquee-label { font-family: var(--apx-mono); font-size: 10.5px; letter-spacing: .22em; color: rgba(247, 250, 250, .55); margin: 88px auto 22px; max-width: 1180px; padding: 0 24px; }
