@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=Hanken+Grotesk:wght@400;500;600;700&display=swap');
/* SIM Zentrale — Design „Arclon-Finish" (Redesign 01.08.2026, Etappe A). Hell = Standard,
   Dunkel bleibt vollwertig über den Toggle. Token-NAMEN bleiben stabil (andere Sessions bauen
   parallel Ansichten darauf) — nur die WERTE haben sich gedreht: früher war Dunkel der
   :root-Default, jetzt ist es Hell. Siehe docs/redesign-zentrale-2026-08.md. */
:root, html[data-theme="light"] {
  color-scheme: light;
  --sim-blue: #009FE3;
  --sim-blue-bright: #0072BC;
  --sim-blue-deep: #0084C2;
  --sim-grad: linear-gradient(135deg, #0072BC 0%, #009FE3 55%, #2CC1F5 100%);
  --bg-1: #F2F5F8;
  --bg-2: #EDF1F5;
  --s1: #FFFFFF;
  --s2: #F7F9FB;
  --s3: #EFF3F7;
  --l1: rgba(18,32,54,.07);
  --l2: rgba(18,32,54,.14);
  --fg-1: #1B2A41;
  --fg-2: #45536A;
  --fg-3: #7C8AA0;
  --green: #0E8A55;
  --warn: #A05A00;
  --red: #B23A2E;
  --nav-active-text: #0072BC;
  --header-bg: var(--s1);
  --bg-glow: rgba(0,159,227,.10);
  --glow-blue: 0 0 0 1px rgba(0,159,227,.25), 0 10px 32px -8px rgba(0,159,227,.28);
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 8px;
  --shadow: 0 1px 2px rgba(18,32,54,.04), 0 2px 10px rgba(18,32,54,.05);
  --shadow-lift: 0 2px 4px rgba(18,32,54,.06), 0 10px 26px -8px rgba(18,32,54,.13);
  --c1: #0087C9;
  --c2: #B26F00;
  --c3: #7C5FD3;
  --c4: #2E7D52;
  --good-bg: rgba(14,138,85,.12);
  --warn-bg: rgba(160,90,0,.12);
  --crit-bg: rgba(178,58,46,.12);
  --accent-bg: rgba(0,159,227,.10);
  --font: 'Hanken Grotesk', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display: 'Sora', 'Segoe UI', system-ui, sans-serif;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --sim-blue-bright: #2DB4EC;
  --bg-1: #0C0F16;
  --bg-2: #0A0D13;
  --s1: #121722;
  --s2: #181E2B;
  --s3: #1D2432;
  --l1: rgba(255,255,255,.07);
  --l2: rgba(255,255,255,.14);
  --fg-1: #F1F5FA;
  --fg-2: #B2BDCC;
  --fg-3: #7C889B;
  --green: #4ADE97;
  --warn: #F2C14E;
  --red: #F27E7E;
  --nav-active-text: #2DB4EC;
  --header-bg: var(--s1);
  --bg-glow: rgba(0,159,227,.12);
  --glow-blue: 0 0 0 1px rgba(0,159,227,.25), 0 10px 32px -8px rgba(0,159,227,.40);
  --shadow: 0 1px 2px rgba(0,0,0,.25), 0 4px 16px rgba(0,0,0,.35);
  --shadow-lift: 0 4px 10px rgba(0,0,0,.30), 0 14px 34px -10px rgba(0,0,0,.50);
  --c1: #009FE3;
  --c2: #BC7A10;
  --c3: #8B6FD9;
  --c4: #2E9E62;
  --good-bg: rgba(74,222,151,.14);
  --warn-bg: rgba(242,193,78,.14);
  --crit-bg: rgba(242,126,126,.14);
  --accent-bg: rgba(0,159,227,.14);
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  font: 14.5px/1.55 var(--font);
  color: var(--fg-2);
  min-height: 100vh;
  background: radial-gradient(circle at top left, var(--bg-glow), transparent 38rem), var(--bg-1);
}
.hidden { display: none !important; }
h2 { color: var(--fg-1); font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: -.01em; margin: 8px 0 10px; }
h3 { margin: 0 0 10px; font-size: 14.5px; font-family: var(--font-display); color: var(--fg-1); font-weight: 600; letter-spacing: 0; text-transform: none; }

/* ---------- Topbar ---------- */
.topbar { display: flex; justify-content: flex-start; align-items: center; gap: 8px; padding: 10px 22px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--l1); position: sticky; top: 0; z-index: 10; }
.themetoggle { width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--l1);
  background: transparent; color: var(--fg-2); font-size: 15px; cursor: pointer; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; transition: all .15s ease; margin-left: 12px; }
.themetoggle:hover { border-color: var(--sim-blue); color: var(--fg-1); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 26px; width: auto; display: block; }
.brand .appname { color: var(--fg-1); font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: .2px;
  padding-left: 12px; border-left: 1px solid var(--l2); }
.tag { font-size: 10.5px; background: rgba(0,159,227,.12); color: var(--sim-blue-bright);
  border: 1px solid rgba(0,159,227,.3); border-radius: 999px; padding: 2px 9px; margin-left: 10px; vertical-align: 2px; }
.meta { font-size: 12px; color: var(--fg-3); margin-left: auto; }
.kopf-spacer { flex: 1 1 auto; }

/* ---------- Backend-Layout: Navigation links, Inhalt rechts (22.07.2026) ----------
   Vorher lagen alle Menuepunkte in der Kopfzeile — bei 11 Punkten wurde die zu voll. */
.shell { display: grid; grid-template-columns: var(--nav-w, 224px) minmax(0, 1fr); align-items: start; }
.sidenav {
  position: sticky; top: var(--hdr-h, 56px); align-self: start;
  height: calc(100vh - var(--hdr-h, 56px)); overflow-y: auto;
  border-right: 1px solid var(--l1); background: var(--s1);
  padding: 14px 10px calc(20px + env(safe-area-inset-bottom));
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .nav-label { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--sim-blue-bright);
  font-weight: 700; padding: 14px 10px 6px; }
.nav .nav-label:first-child { padding-top: 4px; }
/* Werkzeug-Punkte sind gegenueber den Gruppen-Labels eingerueckt — sichtbarer Versatz macht die
   Gruppierung auf den ersten Blick klar (Feinschliff-Runde 2, 02.08.2026). */
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: var(--r-sm, 6px);
  color: var(--fg-2); text-decoration: none;
  font-size: 14px; transition: all .15s ease; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav a:hover { background: var(--bg-1); color: var(--fg-1); }
.nav a.active { background: rgba(0,159,227,.10); color: var(--nav-active-text); font-weight: 600; }
.nav a svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; flex: 0 0 auto; opacity: .75; }
.nav a:hover svg, .nav a.active svg { opacity: 1; }
.nav a .nav-text { overflow: hidden; text-overflow: ellipsis; }
.nav a .nav-extra:empty { display: none; }

main { margin: 0; padding: 24px 26px; width: 100%; }
/* Seitliche Scrollbalken der SEITE sind verboten (Rene, 02.08.): breite Inhalte scrollen in
   ihren eigenen Containern (.tablewrap u. a.). clip statt hidden = kein eigener Scroll-Kontext. */
main { overflow-x: clip; }
@media (min-width: 1800px) { main { padding: 32px; } }
/* Auf der Anmeldeseite gibt es keine Navigation. */
body.zeigt-login .shell { grid-template-columns: minmax(0, 1fr); }
body.zeigt-login .sidenav { display: none; }
.nav-backdrop { display: none; }
.hint { font-size: 13px; color: var(--fg-3); margin-bottom: 14px; }

/* ---------- Karten & Tabellen ---------- */
.card { background: var(--s1); border: 0; box-shadow: var(--shadow); border-radius: var(--r-lg); padding: 18px 20px; margin-bottom: 16px; }
/* Dezenter blauer Kartenkopf-Link (z. B. "Ticketsystem →" im Dashboard, Feinschliff-Runde 2). */
.more { font-size: 12.5px; font-weight: 600; color: var(--sim-blue-bright); text-decoration: none; white-space: nowrap; }
.more:hover { text-decoration: underline; }
.tablewrap { overflow-x: auto; background: var(--s1); border: 0; box-shadow: var(--shadow); border-radius: var(--r-lg); }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--l1); white-space: nowrap; font-size: 13.5px; }
th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--fg-3); background: var(--s2); font-weight: 600; }
tbody tr { cursor: pointer; transition: background .12s ease; }
tbody tr:hover { background: var(--s2); }
tbody tr:last-child td { border-bottom: 0; }
tr.testrow { opacity: .55; }
.cust b { display: block; color: var(--fg-1); font-weight: 600; }
.cust small { color: var(--fg-3); }
.cell .ago { display: block; font-size: 12px; color: var(--fg-3); }

/* ---------- Login (Split-Screen, Muster der Console) ---------- */
.login-shell { position: fixed; inset: 0; display: grid; grid-template-columns: 1fr 1fr; background: var(--bg-1); z-index: 50; }
.login-side { display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; background: var(--sim-grad); }
.login-side::before { content: ''; position: absolute; inset: -40%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.18), transparent 45%),
              radial-gradient(circle at 75% 80%, rgba(0,30,60,.28), transparent 55%); }
.login-side img { position: relative; width: min(68%, 540px); height: auto; filter: drop-shadow(0 18px 46px rgba(0,35,60,.35)); }
.login-box { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-box form { width: min(360px, 100%); display: flex; flex-direction: column; gap: 14px; }
.login-box .appname { color: var(--fg-1); font-size: 22px; font-weight: 700; letter-spacing: .3px; }
.login-box .appsub { color: var(--fg-3); font-size: 13.5px; margin-top: -8px; margin-bottom: 8px; }
.login-box label { font-size: 12px; color: var(--fg-3); margin-bottom: -8px; }
.login-box input { background: var(--s2); color: var(--fg-1); border: 1px solid var(--l2); border-radius: var(--r-md);
  padding: 11px 13px; font: inherit; font-size: 15px; width: 100%; }
.login-box input:focus { outline: none; border-color: var(--sim-blue); box-shadow: 0 0 0 3px rgba(0,159,227,.18); }
.login-box button { background: var(--sim-blue); color: #fff; font-weight: 600; border: 0; border-radius: var(--r-md);
  padding: 11px 16px; font-size: 15px; cursor: pointer; transition: all .15s ease; }
.login-box button:hover { background: var(--sim-blue-deep); box-shadow: var(--glow-blue); }
.login-box .version { color: var(--fg-3); font-size: 11.5px; margin-top: 12px; }
.error { color: var(--red); font-size: 13px; }
@media (max-width: 760px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-side { display: none; }
}

/* ---------- Detail / Listen ---------- */
.linkbtn { background: none; border: 0; color: var(--sim-blue-bright); cursor: pointer; font-size: 14px; padding: 0; margin-bottom: 12px; font-family: inherit; }
.linkbtn:hover { color: var(--sim-blue); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 820px) { .cols { grid-template-columns: 1fr; } }
pre { font-size: 12.5px; overflow-x: auto; background: var(--bg-2); border: 1px solid var(--l1); border-radius: var(--r-md); padding: 12px; color: var(--fg-2); }
.list .row { display: flex; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--l1); font-size: 13.5px; align-items: baseline; }
.list .row:last-child { border-bottom: 0; }
.list time { color: var(--fg-3); font-size: 12px; flex: 0 0 130px; font-variant-numeric: tabular-nums; }
.list .type { font-weight: 600; flex: 0 0 210px; color: var(--sim-blue-bright); }
.list .src { color: var(--fg-3); font-size: 12px; }
.list .jobacts { margin-left: auto; display: flex; gap: 6px; }
.list .jobacts .smallbtn { padding: 3px 12px; font-size: 12px; }
.list .payload { color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; }
.empty { color: var(--fg-3); font-size: 13.5px; padding: 6px 4px; }
.ok-text { color: var(--green); font-size: 12.5px; }

/* ---------- Ads: Freigabe-Queue ---------- */
.draftcard { border: 1px solid var(--l1); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 12px; background: var(--s2); }
.draftcard .adgroup { border-top: 1px solid var(--l1); margin-top: 8px; padding-top: 8px; }
.draftcard .rsatexts { font-size: 13px; color: var(--fg-2); margin-top: 3px; }
.draftcard .rsatexts b { color: var(--fg-3); font-weight: 600; }

/* ---------- Kundenakte: Content-Karten ---------- */
h3 .srcnote { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--fg-3); font-size: 11px; margin-left: 8px; }
.kv div { display: grid; grid-template-columns: 170px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--l1); }
.kv div:last-child { border-bottom: 0; }
.kv dt { color: var(--fg-3); font-size: 12.5px; }
.kv dd { margin: 0; color: var(--fg-1); font-size: 13.5px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; border: 0; border-radius: 999px;
  padding: 1px 9px; background: var(--accent-bg); color: var(--sim-blue-bright); }
.badge.ok { background: var(--good-bg); color: var(--green); }
.badge.off { background: var(--s3); color: var(--fg-3); }
.badge.blue { background: var(--accent-bg); color: var(--sim-blue-bright); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.chip { display: inline-block; font-size: 11.5px; border: 1px solid var(--l2); border-radius: 999px; padding: 1px 9px; margin: 2px 3px 2px 0; color: var(--fg-2); }
.chip.on { border-color: rgba(123,227,165,.4); color: var(--green); }
.chip.dim { opacity: .45; }
.muted2 { color: var(--fg-3); font-size: 11.5px; }
.tablewrap.inner { border-radius: var(--r-md); max-height: 420px; overflow-y: auto; }
.tablewrap.inner td { white-space: normal; }
tr.offrow { opacity: .55; }
tr.offrow:hover, #offerstable tbody tr:hover, .tablewrap.inner tbody tr:hover { background: none; }
.tablewrap.inner tbody tr { cursor: default; }
.tablewrap.inner tbody tr.clickrow { cursor: pointer; }
.tablewrap.inner tbody tr.clickrow:hover { background: var(--s2); }

/* ---------- Katalog / Fakten / Dateien ---------- */
.pagehead { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.pagehead h2 { margin: 0; }
.pagehead .spacer { flex: 1; }
.nowrap { white-space: nowrap; }
.smallbtn { background: var(--s1); color: var(--fg-1); border: 1px solid var(--l2); border-radius: var(--r-sm);
  padding: 6px 12px; cursor: pointer; font: inherit; font-size: 12.5px; transition: all .15s ease; line-height: 1.4; }
.smallbtn:hover { border-color: var(--sim-blue); color: var(--sim-blue-bright); }
.smallbtn.primary { background: var(--sim-blue); border-color: var(--sim-blue); color: #fff; font-weight: 600; }
.smallbtn.primary:hover { background: var(--sim-blue-deep); border-color: var(--sim-blue-deep); }
.smallbtn.danger { border-color: var(--red); color: var(--red); background: transparent; }
.smallbtn.danger:hover { background: var(--crit-bg); }
/* Freigabe-Knopf mit Kunden-Mailversand (René: „jeder sendende Button erkennbar", Etappe C
   01.08.2026) — ersetzt das frühere Inline-Style (#e0a800/#3a2e00) in app.js/freigebenBtn(). */
.smallbtn.sendet-kunde { background: var(--warn-bg); border-color: var(--warn); color: var(--warn); font-weight: 600; }
.smallbtn.sendet-kunde:hover { box-shadow: 0 0 0 2px var(--warn) inset; }
.smallbtn:disabled { opacity: .5; cursor: wait; }
.katsel, .kv input, .kv select, .factform select, .factform input, .uploadrow select, .uploadrow input[type=text] {
  background: var(--s2); color: var(--fg-1); border: 1px solid var(--l2); border-radius: var(--r-sm);
  padding: 6px 9px; font: inherit; font-size: 13px; }
.katsel:focus, .kv input:focus, .kv select:focus, .factform select:focus, .factform input:focus,
.uploadrow select:focus, .uploadrow input[type=text]:focus {
  outline: none; border-color: var(--sim-blue); box-shadow: 0 0 0 3px rgba(0,159,227,.15); }
.kv input { width: min(420px, 100%); }
.emailgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 18px; margin-bottom: 12px; }
.emailgrid label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--fg-3); }
.emailgrid input { background: var(--s2); color: var(--fg-1); border: 1px solid var(--l2); border-radius: var(--r-sm); padding: 7px 10px; font: inherit; font-size: 13px; }
.emailgrid input:focus { border-color: var(--sim-blue); outline: none; }
.emailactions { display: flex; align-items: center; gap: 12px; }
.emailactions .hint { margin: 0; }
.inboxcard { border-color: var(--warn); }
.factrow { display: flex; gap: 10px; align-items: baseline; padding: 8px 4px; border-bottom: 1px solid var(--l1); font-size: 13.5px; }
.factrow:last-child { border-bottom: 0; }
.factrow .facttext { flex: 1; color: var(--fg-1); }
.aspecthead { color: var(--sim-blue-bright); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; margin: 12px 0 2px; font-weight: 600; }
.factform { display: flex; gap: 8px; margin-top: 14px; align-items: center; }
.factform input { flex: 1; }
.uploadrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.uploadrow input[type=file] { color: var(--fg-2); font-size: 13px; }
.uploadrow button { background: var(--sim-blue); border: 0; border-radius: var(--r-sm); color: #fff; font-weight: 600; padding: 7px 14px; cursor: pointer; }
.uploadrow button:hover { background: var(--sim-blue-deep); color: #fff; }

/* ---------- SEO-Zentrale (v0.5.0) ---------- */
.up { color: var(--green); font-weight: 600; }
.down { color: var(--red); font-weight: 600; }
.searchfld { width: 100%; max-width: 340px; margin: 0 0 10px; background: var(--s1); border: 1px solid var(--l1);
  color: var(--fg-1); border-radius: var(--r-sm); padding: 6px 10px; }
.searchfld:focus, .obtext:focus, .oburl:focus, .obtype:focus {
  outline: none; border-color: var(--sim-blue); box-shadow: 0 0 0 3px rgba(0,159,227,.15); }
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stat { background: var(--s1); border: 1px solid var(--l1); border-radius: var(--r-md); padding: 12px 14px; }
.stat b { display: block; color: var(--fg-1); font-size: 22px; font-weight: 600; line-height: 1.2; }
.stat span { color: var(--fg-3); font-size: 11.5px; }
.trendrow { display: flex; align-items: center; gap: 10px; margin: 5px 0; }
.trendrow .tmonth { color: var(--fg-3); font-size: 12px; width: 62px; flex: none; font-variant-numeric: tabular-nums; }
.trendrow .bar { flex: 1; height: 16px; background: var(--s1); border-radius: 4px; overflow: hidden; display: flex; border: 1px solid var(--l1); }
.seg { height: 100%; display: inline-block; }
/* Trendbalken-Stufen (Etappe C, 01.08.2026): waren fest verdrahtete Hex-Werte, jetzt Tokens —
   top3=gut/grün, top10=Markenblau (traf exakt --sim-blue), top30=Warnung, top50=neutral/gedimmt. */
.b-top3 { background: var(--green); }
.b-top10 { background: var(--sim-blue); }
.b-top30 { background: var(--warn); }
.b-top50 { background: var(--fg-3); }
.legend, .steps { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.legend .lg { font-size: 11px; color: var(--fg-2); display: inline-flex; align-items: center; gap: 5px; }
.legend .lg::before { content: ''; width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.legend .lg.b-top3::before { background: var(--green); }
.legend .lg.b-top10::before { background: var(--sim-blue); }
.legend .lg.b-top30::before { background: var(--warn); }
.legend .lg.b-top50::before { background: var(--fg-3); }
.steppill { font-size: 12px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--l2); color: var(--fg-3); }
.steppill.active { border-color: var(--sim-blue); color: var(--sim-blue-bright); background: rgba(0,159,227,.08); }
.steppill.done { border-color: rgba(123,227,165,.4); color: var(--green); }
.obtext, .oburl { width: 100%; background: var(--s1); border: 1px solid var(--l1); color: var(--fg-1);
  border-radius: var(--r-sm); padding: 4px 7px; font: inherit; }
.obtype { background: var(--s1); border: 1px solid var(--l1); color: var(--fg-1); border-radius: var(--r-sm); padding: 4px 6px; }

/* ---- Artikel-Bibliothek ---- */
.badge.danger { background: var(--crit-bg); color: var(--red); }
.mcell { text-align: center; }
.codebox { background: var(--s1); border: 1px solid var(--l1); color: var(--fg-2); border-radius: var(--r-sm); padding: 10px 12px; font-size: 12px; line-height: 1.5; }

/* ---------- SIM Assistent (Chat) ---------- */
.asst-shell { display: grid; grid-template-columns: 230px 1fr; gap: 16px; align-items: start; }
.asst-side { position: sticky; top: 78px; }
.asst-convs { margin-top: 10px; display: flex; flex-direction: column; gap: 2px; max-height: 62vh; overflow-y: auto; }
.asst-conv { padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--fg-2); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  /* Ohne flex-shrink:0 quetscht der Flex-Container (max-height 62vh) die Eintraege bei vielen
     Unterhaltungen unter ihre Texthoehe — die Zeilen ueberlappen dann sichtbar. */
  flex: 0 0 auto; line-height: 1.35; display: flex; flex-direction: column; gap: 1px; }
.asst-conv-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asst-conv-d { font-size: 11px; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asst-conv:hover { background: var(--s2); color: var(--fg-1); }
.asst-conv.active { background: rgba(0,159,227,.12); color: var(--nav-active-text); box-shadow: inset 0 0 0 1px rgba(0,159,227,.3); }
.asst-main { display: flex; flex-direction: column; height: calc(100vh - 130px); min-height: 460px; padding: 0; overflow: hidden; }
.asst-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--l1); }
.asst-controls { display: flex; align-items: center; gap: 10px; }
.asst-modellbl { font-size: 11px; color: var(--fg-3); text-transform: uppercase; letter-spacing: .5px; display: flex; gap: 6px; align-items: center; }
.asst-messages { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.asst-msg { display: flex; }
.asst-msg.user { justify-content: flex-end; }
.asst-msg.user .asst-b { background: var(--sim-blue); color: #fff; border-radius: 14px 14px 4px 14px; }
.asst-msg.assistant { flex-direction: column; align-items: flex-start; gap: 6px; }
.asst-b { max-width: 78%; padding: 11px 15px; border-radius: 14px 14px 14px 4px; background: var(--s2);
  color: var(--fg-1); font-size: 14.5px; line-height: 1.55; border: 1px solid var(--l1); }
.asst-msg.user .asst-b { border-color: transparent; }
.asst-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.asst-chip { font-size: 12px; background: var(--s3); border: 1px solid var(--l2); color: var(--fg-3);
  border-radius: 999px; padding: 3px 10px; }
.asst-chip.ok { color: var(--green); border-color: rgba(123,227,165,.35); }
.asst-chip.err { color: var(--red); border-color: rgba(242,126,126,.4); }
.asst-chip .dots { animation: asstblink 1.2s infinite; }
@keyframes asstblink { 0%,100% { opacity: .3 } 50% { opacity: 1 } }
.asst-typing { color: var(--fg-3); animation: asstblink 1.2s infinite; }
.asst-confirm { margin-top: 8px; background: var(--s1); border: 1px solid var(--warn);
  border-radius: 12px; padding: 14px 16px; max-width: 78%; }
.asst-confirm-h { font-weight: 600; color: var(--warn); font-size: 13px; }
.asst-chips { padding: 0 20px; }
.asst-inputrow { display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--l1); align-items: flex-end; }
.asst-inputrow textarea { flex: 1; resize: none; max-height: 160px; background: var(--s1); border: 1px solid var(--l1);
  color: var(--fg-1); border-radius: 10px; padding: 11px 14px; font: inherit; font-size: 14.5px; }
.asst-inputrow textarea:focus { outline: none; border-color: var(--sim-blue); box-shadow: 0 0 0 3px rgba(0,159,227,.18); }
.asst-inputrow button { align-self: stretch; }
.ok-msg { color: var(--green); } .err { color: var(--red); }
@media (max-width: 820px) { .asst-shell { grid-template-columns: 1fr; } .asst-side { position: static; } }

/* ---------- Assistent: Schnell-Chips & Vorlagen (A3) ---------- */
.asst-chipsrow { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 4px; }
.asst-qchip { font: inherit; font-size: 12.5px; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  background: var(--s3); border: 1px solid var(--l2); color: var(--fg-2); transition: all .15s ease; }
.asst-qchip:hover { border-color: var(--sim-blue); color: var(--fg-1); }
.asst-qchip.tpl { color: var(--nav-active-text); }
.asst-qchip.save { border-style: dashed; color: var(--fg-3); }
.asst-tpl { display: inline-flex; align-items: center; }
.asst-tpl-x { font: inherit; font-size: 11px; background: none; border: 0; color: var(--fg-3); cursor: pointer; padding: 0 2px 0 4px; margin-left: -4px; }
.asst-tpl-x:hover { color: var(--red); }

/* Kosten-Ansicht: Ausreißer-Zeile im Trend (Monat > 2× Vormonat) — Etappe C: Token statt Hex. */
.rowalarm td { background: var(--crit-bg); }
.rowalarm td:first-child { box-shadow: inset 3px 0 0 var(--red); }

/* ============================================================================
   PWA / Mobile (additiv) — Desktop bleibt unverändert. Nur < 768px greift.
   ============================================================================ */
/* Burger-Buttons + Sidebar-Backdrop: auf dem Desktop unsichtbar */
.navburger, .asstburger { display: none; }
.asst-backdrop { display: none; }
.navburger, .asstburger {
  background: transparent; border: 1px solid var(--l1); color: var(--fg-1);
  width: 38px; height: 34px; border-radius: 9px; font-size: 17px; line-height: 1;
  cursor: pointer; flex: 0 0 auto; padding: 0;
}
.asstburger { width: 34px; height: 32px; font-size: 15px; }

@media (max-width: 767px) {
  /* ---- Kopf / Hauptnavigation einklappen ---- */
  .topbar {
    position: sticky; top: 0; z-index: 60; flex-wrap: nowrap;
    padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top));
    gap: 10px;
  }
  .navburger { display: inline-flex; align-items: center; justify-content: center; }
  .topbar .meta { display: none; }              /* Health-Zeile mobil ausblenden (Platz) */
  .brand { min-width: 0; }
  .brand img { max-height: 26px; }
  /* ---- Seitenleiste mobil: ausfahrbar statt fest ---- */
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidenav {
    position: fixed; top: var(--hdr-h, 52px); bottom: 0; left: 0; width: 78vw; max-width: 280px;
    z-index: 59; transform: translateX(-100%); transition: transform .18s ease;
    border-right: 1px solid var(--l1); height: auto;
  }
  body.navopen .sidenav { transform: translateX(0); }
  body.navopen .nav-backdrop {
    display: block; position: fixed; inset: var(--hdr-h, 52px) 0 0 0; z-index: 58;
    background: rgba(0,0,0,.45);
  }
  body.navopen .nav { display: flex; }
  .nav a { font-size: 15.5px; padding: 11px 14px; border-radius: 10px; }

  main { max-width: 100%; margin: 14px auto; padding: 0 14px; }

  /* ---- Assistenten-Chat: Vollbild, bedienbar ---- */
  #assistent { margin: 0; }
  .asst-shell { display: block; }
  .asstburger { display: inline-flex; align-items: center; justify-content: center; margin-right: 4px; }

  /* Chat füllt den Bereich unter dem Header komplett aus */
  .asst-main {
    position: fixed; left: 0; right: 0; top: var(--hdr-h, 52px); bottom: 0;
    height: auto; min-height: 0; margin: 0; border-radius: 0; border-left: 0; border-right: 0;
    z-index: 30;
  }
  /* Kompakte, einzeilige Chat-Titelleiste (Titel + Modellwahl) statt gestauchter Block */
  .asst-head { padding: 7px 10px; align-items: center; gap: 8px; flex-wrap: nowrap; min-height: 0; }
  .asst-head > div:first-of-type { min-width: 0; flex: 1 1 auto; }
  .asst-head h2 { font-size: 15px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #asst-sub { display: none; }                     /* langer Untertitel mobil ausblenden */
  .asst-controls { gap: 6px; flex: 0 0 auto; }
  .asst-modellbl { font-size: 0; gap: 0; letter-spacing: 0; }   /* Wort „Modell" ausblenden, Select bleibt */
  .asst-modellbl select { font-size: 16px; max-width: 38vw; padding: 6px 8px; }
  /* Kopfzeile ist mobil eng (iPhone): der grüne Normalzustand-Badge („Aktionen aktiv …") fliegt
     raus — NUR die orange Kill-Switch-Warnung bleibt sichtbar. Push-Knopf schrumpft aufs Symbol. */
  #asst-actions-badge .badge.ok { display: none; }
  #asst-push { flex: 0 0 auto; padding: 6px 9px; font-size: 15px; }
  #asst-push .asst-push-lbl { display: none; }
  .asst-messages { padding: 14px 14px; }

  /* Verlaufs-Sidebar als einschiebbares Overlay */
  .asst-side {
    position: fixed; top: 0; bottom: 0; left: 0; width: 82%; max-width: 300px;
    transform: translateX(-105%); transition: transform .22s ease; z-index: 70;
    background: var(--s1); border-right: 1px solid var(--l1); box-shadow: 2px 0 24px rgba(0,0,0,.28);
    padding: calc(14px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom));
    overflow-y: auto; margin: 0;
  }
  .asst-shell.sideopen .asst-side { transform: translateX(0); }
  .asst-convs { max-height: none; }
  .asst-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 65; }
  .asst-shell.sideopen .asst-backdrop { display: block; }

  /* Feste Eingabeleiste unten inkl. Safe-Area; Verlauf scrollt darüber */
  .asst-inputrow {
    padding: 12px 14px; padding-bottom: calc(12px + env(safe-area-inset-bottom));
    background: var(--s1); position: relative; z-index: 1;
  }
  /* Handy: Eingabefeld allein in voller Breite oben, darunter die Knopf-Zeile (🎤 📎 links,
     Senden rechts) — vorher quetschten sich alle vier in eine Zeile und man sah beim Tippen
     kaum den eigenen Text (René, 01.08.). Gilt für Assistent-Seite UND Widget (gleiche Klasse). */
  .asst-inputrow { flex-wrap: wrap; gap: 8px; }
  .asst-inputrow textarea { flex: 1 1 100%; order: 1; min-height: 44px; }
  .asst-inputrow .asst-mic { order: 2; align-self: auto; height: 40px; }
  .asst-inputrow button[type="submit"] { order: 3; margin-left: auto; align-self: auto; height: 40px; padding: 0 22px; }
  /* iOS zoomt bei Fokus nur, wenn Schrift < 16px — daher überall >= 16px */
  .asst-inputrow textarea, input, select, textarea { font-size: 16px; }
}

/* ============================ Voice-Modus ============================ */
.asst-mic { flex: 0 0 auto; width: 40px; align-self: stretch; background: var(--s2); border: 1px solid var(--l1);
  border-radius: var(--r-sm); font-size: 18px; cursor: pointer; color: var(--fg-1); line-height: 1; }
.asst-mic:hover { border-color: var(--sim-blue); }

.voice-overlay { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 22px; text-align: center;
  padding: calc(24px + env(safe-area-inset-top)) 22px calc(24px + env(safe-area-inset-bottom));
  background: radial-gradient(circle at 50% 38%, rgba(0,114,188,.28), transparent 60%), rgba(8,11,17,.92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #fff; }
.voice-overlay.hidden { display: none; }
.voice-x { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 16px; width: 40px; height: 40px;
  border-radius: 999px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; font-size: 18px; cursor: pointer; }
.voice-orb { width: 128px; height: 128px; border-radius: 999px; display: flex; align-items: center; justify-content: center;
  font-size: 46px; background: var(--sim-grad); box-shadow: 0 0 0 0 rgba(0,159,227,.55); transition: transform .15s ease; }
.voice-orb.connecting { opacity: .7; }
.voice-orb.listening { animation: voicePulse 1.8s ease-in-out infinite; }
.voice-orb.speaking { animation: voiceSpeak .7s ease-in-out infinite; }
.voice-orb.thinking { animation: voiceThink 1s linear infinite; }
.voice-orb.error { background: #7f1d1d; }
@keyframes voicePulse { 0%,100% { box-shadow: 0 0 0 0 rgba(0,159,227,.5); } 50% { box-shadow: 0 0 0 26px rgba(0,159,227,0); } }
@keyframes voiceSpeak { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes voiceThink { 0% { transform: rotate(0); } 100% { transform: rotate(360deg); } }
.voice-state { font-size: 18px; font-weight: 600; letter-spacing: .2px; }
.voice-live { font-size: 15.5px; line-height: 1.5; color: rgba(255,255,255,.82); max-width: 560px;
  min-height: 2.6em; max-height: 34vh; overflow-y: auto; }
.voice-live .vt-user { color: #cfe8ff; }
.voice-voicepick { display: flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(255,255,255,.7); }
.voice-voicepick select { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px; padding: 7px 14px; font-size: 14px; font-family: inherit; cursor: pointer; }
.voice-voicepick select option { color: #111; }
.voice-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.voice-end { background: #dc2626; color: #fff; border: 0; border-radius: 999px; padding: 13px 30px;
  font-size: 16px; font-weight: 700; cursor: pointer; font-family: inherit; }
.voice-end:hover { background: #b91c1c; }

/* SEO-Aufgaben: Begründung auf 2 Zeilen kürzen, Klick auf die Zelle klappt sie auf (Paket 5). */
.aufg-grund { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
  color:var(--fg-3); font-size:12.5px; line-height:1.35; }
td.offen .aufg-grund { -webkit-line-clamp:unset; display:block; }

/* ---- Konsolen-Ansicht (portiert 22.07.2026) --------------------------------
   Alle Regeln haengen bewusst an #konsolen: chip/err/ok/pagehead/primary/row/spacer
   gibt es oben schon mit anderer Bedeutung. */
/* Portiert aus sim-agent-console/admin (17.07.2026) — Studios-in-Motion-Dark wie style.css. */
  :root {
  --nav-w: 224px;      /* Breite der Seitenleiste (Backend-Layout) */ --fg1: var(--fg-1); --fg2: var(--fg-2); --fg3: var(--fg-3);
    --blue: var(--sim-blue); --blue2: var(--sim-blue-bright); }
#konsolen h4 { color: var(--fg1); margin: 0 0 8px; }
#konsolen a { color: var(--blue2); text-decoration: none; } a:hover { color: var(--blue); }
#konsolen button { background: var(--s3); color: var(--fg1); border: 1px solid var(--l2); border-radius: 999px; padding: 6px 15px; cursor: pointer; font: inherit; font-size: 13px; transition: all .15s ease; }
#konsolen button:hover { border-color: var(--blue); color: var(--blue2); }
#konsolen button.primary { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
#konsolen button.primary:hover { background: var(--sim-blue-deep); color: #fff; box-shadow: var(--glow-blue); }
#konsolen button.danger:hover { border-color: var(--red); color: var(--red); }
#konsolen input, select, textarea { background: var(--s2); color: var(--fg1); border: 1px solid var(--l2); border-radius: 8px; padding: 7px 11px; font: inherit; width: 100%; }
#konsolen input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,159,227,.15); }
#konsolen textarea { resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
#konsolen .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
#konsolen .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--red); margin-right: 7px; }
#konsolen .dot.ok { background: var(--green); }
#konsolen .chip { display: inline-block; font-size: 11.5px; border: 1px solid var(--l2); border-radius: 999px; padding: 1px 9px; margin: 2px 3px 2px 0; color: var(--fg2); }
#konsolen .chip.b { border-color: rgba(0,159,227,.4); color: var(--blue2); }
#konsolen .chip.w { border-color: rgba(242,193,78,.45); color: var(--warn); }
#konsolen .muted { color: var(--fg3); font-size: 12px; }
#konsolen .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#konsolen .field { margin-bottom: 10px; }
#konsolen .field label { display: block; font-size: 12px; color: var(--fg3); margin-bottom: 4px; }
#konsolen .cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#konsolen table { border-collapse: collapse; width: 100%; font-size: 13px; }
#konsolen th { text-align: left; color: var(--fg3); font-size: 11.5px; padding: 6px 9px; border-bottom: 1px solid var(--l2); background: none; text-transform: none; }
#konsolen td { padding: 7px 9px; border-bottom: 1px solid var(--l1); color: var(--fg1); white-space: normal; }
#konsolen tbody tr { cursor: default; }
#konsolen .err { color: var(--red); font-size: 13px; }
#konsolen .back { margin-bottom: 14px; display: inline-block; }
#konsolen .pagehead { display: flex; align-items: center; gap: 14px; margin: 8px 0 16px; }
#konsolen .pagehead h2 { margin: 0; }
#konsolen .pagehead .spacer { flex: 1; }
  @media (max-width: 700px) { .cols2 { grid-template-columns: 1fr; } }

/* ---- Artikel-Leseansicht (22.07.2026) ---- */
.artikel-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.55);
  display: flex; align-items: flex-start; justify-content: center; padding: 4vh 16px; overflow-y: auto; }
.artikel-box { background: var(--s1); border: 1px solid var(--l1); border-radius: var(--r-lg);
  max-width: 820px; width: 100%; display: flex; flex-direction: column; max-height: 92vh; }
.artikel-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--l1); }
.artikel-text { padding: 18px 20px; overflow-y: auto; flex: 1 1 auto; line-height: 1.65; }
.artikel-fuss { padding: 14px 20px; border-top: 1px solid var(--l1); display: flex; align-items: center;
  gap: 8px; flex-wrap: wrap; }

/* ---- Hinweise in der Navigation (22.07.2026) ---- */
.navbadge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--sim-blue); color: #fff; font-size: 11px; font-weight: 700; text-align: center; }
.navpuls { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--warn);
  animation: arbeitpuls 1.2s ease-in-out infinite; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 300; max-width: 320px;
  background: var(--s1); border: 1px solid var(--sim-blue); border-radius: var(--r-lg);
  padding: 14px 16px; box-shadow: 0 8px 30px rgba(0,0,0,.35); font-size: 13.5px; }
.toast a { display: inline-block; margin-top: 8px; color: var(--sim-blue); }

/* ---- Assistent-Widget (schwebend, W1) — nutzt .asst-messages/.asst-inputrow für gleiche Optik ---- */
.wgt-btn { position: fixed; right: 20px; bottom: 20px; z-index: 120; width: 56px; height: 56px;
  border-radius: 50%; border: none; cursor: pointer; background: var(--sim-grad); color: #fff;
  font-size: 24px; box-shadow: var(--glow-blue); display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease; }
.wgt-btn:hover { transform: translateY(-2px) scale(1.04); }
.wgt-btn.open { transform: scale(.9); opacity: .9; }
.wgt-panel { position: fixed; right: 20px; bottom: 88px; z-index: 120; width: 400px;
  max-width: calc(100vw - 40px); height: 620px; max-height: calc(100vh - 120px);
  display: flex; flex-direction: column; background: var(--s1); border: 1px solid var(--l2);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: 0 24px 60px -12px rgba(0,0,0,.55), var(--glow-blue); }
.wgt-panel[hidden] { display: none; }
.wgt-head { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--l1); font-family: var(--font-display);
  font-weight: 600; color: var(--fg-1); }
.wgt-head-l { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.wgt-ctx { font-family: var(--font); font-weight: 500; font-size: 11.5px; color: var(--sim-blue-bright);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wgt-head-r { display: flex; gap: 2px; flex: 0 0 auto; }
.wgt-ic { background: none; border: 0; color: var(--fg-3); cursor: pointer; font-size: 15px;
  padding: 4px 7px; border-radius: 7px; line-height: 1; }
.wgt-ic:hover { background: var(--s3); color: var(--fg-1); }
.wgt-messages { flex: 1; }
.wgt-inputrow { padding: 10px 12px; }
/* Kontext-Badge in der Konversationsliste (Assistent-Seite) */
.asst-ctx-badge { display: inline-block; font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .3px; color: var(--sim-blue-bright); border: 1px solid rgba(0,159,227,.35);
  border-radius: 999px; padding: 0 6px; margin-right: 6px; vertical-align: middle; }
@media (max-width: 767px) {
  .wgt-btn { right: 14px; bottom: 14px; }
  .wgt-panel { right: 0; left: 0; bottom: 0; top: var(--hdr-h, 52px); width: 100%; max-width: 100%;
    height: auto; max-height: none; border-radius: 0; border-left: 0; border-right: 0; }
  .wgt-inputrow { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
}
/* Wissensbasis: Bereichs-Chips als Filter, veraltete Quellen gedimmt */
.chipbar .chip { cursor: pointer; background: none; font: inherit; }
.tablewrap tr.wveraltet td { opacity: .55; }

/* Chat-Screenshots (28.07.2026): Anhang-Chips über der Eingabezeile + Bilder in der User-Bubble */
.asst-attrow { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 2px 6px; }
.asst-attrow:empty { display: none; }
.asst-att-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  padding: 3px 8px; border-radius: 8px; background: rgba(0,159,227,.12);
  border: 1px solid rgba(0,159,227,.35); }
.asst-att-chip img { width: 26px; height: 26px; object-fit: cover; border-radius: 4px; }
.asst-att-chip button { background: none; border: 0; cursor: pointer; color: inherit; opacity: .7; }
.asst-att-chip button:hover { opacity: 1; }
.asst-b-imgs { display: flex; flex-wrap: wrap; gap: 6px; background: transparent !important;
  padding: 0 !important; border: 0 !important; }
.asst-img { max-width: 240px; max-height: 180px; border-radius: 10px; display: block;
  border: 1px solid rgba(127,127,127,.35); cursor: zoom-in; }

/* ---- Chat-Optimierungen (01.08.2026): Markdown, Kopieren, Tool-Details, Verlaufs-Verwaltung ---- */
/* Markdown in den Antwort-Bubbles */
.asst-b p { margin: 0 0 8px; }
.asst-b p:last-child { margin-bottom: 0; }
.asst-b ul, .asst-b ol { margin: 4px 0 8px; padding-left: 20px; }
.asst-b li { margin: 2px 0; }
.asst-b a { color: var(--sim-blue); text-decoration: underline; }
.asst-b code { background: var(--s3); border: 1px solid var(--l1); border-radius: 4px; padding: 0 4px; font-size: .92em; }
.asst-b hr { border: 0; border-top: 1px solid var(--l1); margin: 8px 0; }
.asst-md-code { background: var(--s3); border: 1px solid var(--l1); border-radius: 8px; padding: 10px 12px; margin: 6px 0 10px; overflow-x: auto; font-size: 12.5px; line-height: 1.45; }
.asst-md-code code { background: none; border: 0; padding: 0; }
.asst-md-h1, .asst-md-h2, .asst-md-h3 { font-weight: 700; margin: 10px 0 6px; }
.asst-md-h1 { font-size: 16px; }
.asst-md-h2 { font-size: 14.5px; }
.asst-md-h3 { font-size: 13.5px; }
.asst-md-quote { border-left: 3px solid var(--l1); padding-left: 10px; color: var(--fg-3); margin: 4px 0 8px; }
.asst-md-tablewrap { overflow-x: auto; margin: 6px 0 10px; }
.asst-md-tablewrap table { border-collapse: collapse; font-size: 12.5px; }
.asst-md-tablewrap th, .asst-md-tablewrap td { border: 1px solid var(--l1); padding: 4px 8px; text-align: left; }
.asst-md-tablewrap th { background: var(--s3); }
/* Antwort kopieren */
.asst-copybtn { display: inline-block; margin-top: 6px; background: none; border: 1px solid var(--l1); border-radius: 6px;
  color: var(--fg-3); font-size: 11px; padding: 2px 8px; cursor: pointer; }
.asst-copybtn:hover { border-color: var(--sim-blue); color: var(--fg-1); }
/* Tool-Chips mit Ergebnis-Vorschau */
.asst-chip.hasinfo { cursor: pointer; }
.asst-tooldetail { background: var(--s3); border: 1px solid var(--l1); border-radius: 8px; padding: 8px 10px;
  margin: 4px 0 6px; font-size: 11.5px; line-height: 1.4; max-height: 220px; overflow: auto;
  white-space: pre-wrap; word-break: break-word; }
/* Verlaufs-Sidebar: Suche + Zeilen-Aktionen */
.asst-search { width: 100%; margin: 8px 0 6px; padding: 7px 10px; font-size: 13px; background: var(--s1);
  border: 1px solid var(--l1); border-radius: var(--r-sm); color: var(--fg-1); }
.asst-search:focus { outline: none; border-color: var(--sim-blue); }
.asst-conv { position: relative; }
.asst-conv-acts { position: absolute; right: 6px; top: 6px; display: none; gap: 2px; }
.asst-conv:hover .asst-conv-acts { display: inline-flex; }
.asst-conv-acts button { background: var(--s2); border: 1px solid var(--l1); border-radius: 6px;
  font-size: 11px; padding: 2px 6px; cursor: pointer; color: var(--fg-3); }
.asst-conv-acts button:hover { border-color: var(--sim-blue); color: var(--fg-1); }
/* Touch-Geräte haben kein Hover — Aktionen dort immer zeigen */
@media (hover: none) { .asst-conv-acts { display: inline-flex; } .asst-conv-t { padding-right: 64px; display: block; } }

/* ============================================================================
   Redesign „Arclon-Finish" (Etappe A, 01.08.2026) — NEUE, additive Komponenten.
   Diese Klassen legen nur den Baustein an; verwendet werden sie erst ab Etappe B
   (Startseite) bzw. Etappe C. Siehe docs/redesign-zentrale-2026-08.md.
   ============================================================================ */

/* ---- KPI-Kachel ----
   Markup-Erwartung:
   <div class="kpi [good|warn|crit]">
     <div class="kpi-head"><span class="kpi-label">…</span><span class="kpi-menu">⋯</span></div>
     <div class="kpi-body"><span class="kpi-delta [up|down]">…</span><span class="kpi-num">…</span></div>
     <div class="kpi-sub">…</div>
   </div> */
.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi { position: relative; background: var(--s1); box-shadow: var(--shadow); border-radius: var(--r-lg);
  padding: 16px 18px 14px; overflow: hidden; display: flex; flex-direction: column; gap: 8px;
  cursor: pointer; transition: box-shadow .18s ease, transform .18s ease; }
.kpi::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--sim-blue); }
.kpi.good::after { background: var(--green); }
.kpi.warn::after { background: var(--warn); }
.kpi.crit::after { background: var(--red); }
/* Klickbar (Feinschliff-Runde 2, 02.08.2026): Hover-Lift + Fokusring fuer Tastaturbedienung. */
.kpi:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.kpi:focus-visible { outline: 2px solid var(--sim-blue); outline-offset: 2px; }
.kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-head::after { content: '→'; color: var(--fg-3); font-size: 13px; line-height: 1; }
.kpi-label { font-size: 14px; font-weight: 600; color: var(--fg-2); }
.kpi-menu { color: var(--fg-3); font-size: 15px; line-height: 1; cursor: default; }
.kpi-body { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.kpi-delta { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-bg); color: var(--sim-blue-bright); }
.kpi-delta.up { background: var(--good-bg); color: var(--green); }
.kpi-delta.down { background: var(--crit-bg); color: var(--red); }
.kpi-num { font-family: var(--font-display); font-size: 27px; font-weight: 700; color: var(--fg-1);
  font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi-sub { font-size: 12px; color: var(--fg-3); }
@media (max-width: 900px) { .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .kpi-row { grid-template-columns: 1fr; } }

/* ---- Feed (Zeitleisten-Liste) ----
   Markup-Erwartung:
   <div class="feed">
     <div class="feed-row"><span class="feed-dot [good|warn|crit]"></span>
       <div class="feed-body"><div class="feed-title">…</div><div class="feed-text">…</div></div>
       <span class="feed-time">…</span></div>
   </div> */
.feed { display: flex; flex-direction: column; }
.feed-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 2px; border-bottom: 1px solid var(--l1); }
.feed-row:last-child { border-bottom: 0; }
.feed-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; flex: 0 0 auto; background: var(--sim-blue); }
.feed-dot.good { background: var(--green); }
.feed-dot.warn { background: var(--warn); }
.feed-dot.crit { background: var(--red); }
.feed-body { flex: 1 1 auto; min-width: 0; }
.feed-title { font-size: 12.5px; font-weight: 600; color: var(--fg-1); }
.feed-text { font-size: 12px; color: var(--fg-2); margin-top: 2px; }
.feed-time { flex: 0 0 auto; font-size: 11px; color: var(--fg-3); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---- Pill-Varianten (Status-Pillen, unabhängig von .badge) ---- */
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700;
  padding: 2px 10px; border-radius: 999px; background: var(--accent-bg); color: var(--sim-blue-bright); }
.pill.good { background: var(--good-bg); color: var(--green); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.crit { background: var(--crit-bg); color: var(--red); }
.pill.neutral { background: var(--s3); color: var(--fg-3); }

/* „Läuft gerade"-Punkte (Dashboard): drei sanft pulsierende Punkte — Klasse wird von
   loadDashboard() genutzt; war bei einer früheren Design-Runde verloren gegangen. */
.arbeit-punkte { display: inline-flex; gap: 3px; }
.arbeit-punkte i { width: 6px; height: 6px; border-radius: 999px; background: var(--sim-blue); animation: arbeitp 1.2s ease-in-out infinite; }
.arbeit-punkte i:nth-child(2) { animation-delay: .2s; }
.arbeit-punkte i:nth-child(3) { animation-delay: .4s; }
@keyframes arbeitp { 0%, 100% { opacity: .25 } 50% { opacity: 1 } }
@media (prefers-reduced-motion: reduce) { .arbeit-punkte i { animation: none } }

/* ---- Startseite: zweispaltiges Grid (Etappe B, 01.08.2026) ----
   Links die bestehenden .card-Bloecke, rechts Ereignis-Feed + Ticket-Triage. */
.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.dash-grid > div { display: grid; gap: 16px; align-content: start; min-width: 0; }
/* Karten in Grid-Spalten duerfen ihre Spalte NIE aufdruecken (min-width:auto-Falle) —
   breite Tabellen scrollen im .tablewrap, nicht die Seite. */
.dash-grid .card, .dash-grid .tablewrap { min-width: 0; max-width: 100%; }
/* 14-Zoll-Laptop (Renes Ruege 02.08.): unter 1280px stapeln statt quetschen. */
@media (max-width: 1280px) { .dash-grid { grid-template-columns: 1fr; } }

/* Brücken-Tokens (02.08.2026): kursplan-editor.js nutzt die Portal-Token-Namen (--ink/--line/--bg)
   und läuft AUCH in der Kundenakte — hier auf die Zentrale-Tokens gemappt, folgt beiden Themes. */
:root { --ink: var(--fg-1); --ink-2: var(--fg-2); --ink-3: var(--fg-3); --line: var(--l1); --line-2: var(--l2); --bg: var(--bg-1); }
