:root {
    --bg: #eef1f4;
    --seite: #ffffff;
    --leiste: #f6f8fa;
    --chat-bg: #e9e4de;
    --text: #111b21;
    --dezent: #667781;
    --linie: #e1e5e9;
    --akzent: #d97757;
    --akzent-text: #ffffff;
    --blase-ich: #d9fdd3;
    --blase-routine: #fdf3d0;
    --blase-bot: #ffffff;
    --blase-auftrag: #eef2ff;
    --hover: #f0f2f5;
    --gefahr: #c0392b;
    --warnung: #d97706;
    --ok: #16a34a;
    --schatten: 0 1px 2px rgba(0, 0, 0, .12);
    --radius: 14px;
    --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
    --code-bg: rgba(0, 0, 0, .07);
    --link: #027eb5;
    --muster: rgba(0, 0, 0, .035);
    --werkzeug-hover: rgba(0, 0, 0, .05);
    color-scheme: light;
}
/* Dunkel: automatisch nach System (außer „hell“ ist gewählt) oder fest per Schalter (data-theme auf <html>) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0b141a;
        --seite: #111b21;
        --leiste: #202c33;
        --chat-bg: #0b141a;
        --text: #e9edef;
        --dezent: #8696a0;
        --linie: #2a3942;
        --blase-ich: #005c4b;
        --blase-routine: #4a3b10;
        --blase-bot: #202c33;
        --blase-auftrag: #1e2747;
        --hover: #2a3942;
        --schatten: 0 1px 2px rgba(0, 0, 0, .4);
        --code-bg: rgba(255, 255, 255, .08);
        --link: #53bdeb;
        --muster: rgba(255, 255, 255, .025);
        --werkzeug-hover: rgba(255, 255, 255, .06);
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #0b141a;
    --seite: #111b21;
    --leiste: #202c33;
    --chat-bg: #0b141a;
    --text: #e9edef;
    --dezent: #8696a0;
    --linie: #2a3942;
    --blase-ich: #005c4b;
    --blase-routine: #4a3b10;
    --blase-bot: #202c33;
    --blase-auftrag: #1e2747;
    --hover: #2a3942;
    --schatten: 0 1px 2px rgba(0, 0, 0, .4);
    --code-bg: rgba(255, 255, 255, .08);
    --link: #53bdeb;
    --muster: rgba(255, 255, 255, .025);
    --werkzeug-hover: rgba(255, 255, 255, .06);
    color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
    font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    overscroll-behavior: none;
}
button { font: inherit; color: inherit; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
pre { white-space: pre-wrap; word-break: break-word; }

/* ---------------------------------------------------------------- Grundraster */
.app {
    display: grid;
    grid-template-columns: 360px 1fr;
    height: 100dvh;
    max-width: 1500px;
    margin: 0 auto;
    background: var(--seite);
}
.seite { display: flex; flex-direction: column; border-right: 1px solid var(--linie); min-width: 0; min-height: 0; }
.chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--chat-bg); }
.chat-inhalt { display: flex; flex-direction: column; height: 100%; min-height: 0; }

.leiste {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top));
    background: var(--leiste); border-bottom: 1px solid var(--linie);
    min-height: 60px; position: relative;
}
.leiste .titel { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.titel-knopf { background: none; border: 0; text-align: left; padding: 0; cursor: pointer; }
.leiste .titel strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leiste .titel span { font-size: 12.5px; color: var(--dezent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status { display: inline-flex; align-items: center; gap: 6px; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: #9aa5ad; }
.status.online i { background: #25d366; }
.status.offline i { background: var(--gefahr); }

.rund {
    width: 40px; height: 40px; border: 0; border-radius: 50%;
    background: transparent; display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--dezent); flex: 0 0 auto;
}
.rund:hover { background: var(--hover); color: var(--text); }
.zurueck { display: none; }

.avatar {
    width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto;
    background: var(--akzent); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 17px; overflow: hidden; user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.gross { width: 88px; height: 88px; font-size: 32px; }
.avatar.mini { width: 22px; height: 22px; font-size: 10px; }
.avatar.gruppe { border-radius: 14px; }

/* ---------------------------------------------------------------- Seitenleiste */
.chatliste { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; }
.chatliste li {
    display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center;
    padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--linie);
}
.chatliste li:hover, .chatliste li.aktiv { background: var(--hover); }
.chatliste .avatar { width: 48px; height: 48px; }
.chatliste .info { min-width: 0; }
.chatliste .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chatliste .name small { font-weight: 400; color: var(--dezent); font-size: 12px; }
.chatliste .letzte { color: var(--dezent); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chatliste .letzte.arbeitet { color: var(--akzent); }
.chatliste .letzte.wartet { color: var(--warnung); font-weight: 600; }
.chatliste .meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.punkt { width: 9px; height: 9px; border-radius: 50%; background: transparent; display: inline-block; }
.punkt.thinking { background: var(--akzent); animation: puls 1.2s infinite; }
.punkt.waiting { background: var(--warnung); }
.punkt.error { background: var(--gefahr); }
.badge { background: var(--warnung); color: #fff; border-radius: 10px; min-width: 20px; height: 20px; padding: 0 6px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
@keyframes puls { 50% { opacity: .3; } }
.chatliste li.abschnitt {
    display: block; cursor: default; padding: 10px 14px 4px; border-bottom: 0;
    font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--dezent);
}
.chatliste li.abschnitt:hover { background: none; }
.stern { border: 0; background: none; cursor: pointer; font-size: 17px; line-height: 1; padding: 2px; color: var(--dezent); opacity: 0; }
.stern.an { opacity: 1; color: #e0a800; }
.chatliste li:hover .stern, .stern:focus-visible { opacity: 1; }
/* Ohne Maus (Handy) nur gesetzte Sterne zeigen; markieren geht dort über das Chat-Menü */
@media (hover: none) { .stern:not(.an) { display: none; } }
.chatliste .leerhinweis { padding: 30px 20px; color: var(--dezent); text-align: center; cursor: default; display: block; }

.fuss { border-top: 1px solid var(--linie); padding: 8px 14px calc(8px + env(safe-area-inset-bottom)); font-size: 12px; color: var(--dezent); display: flex; flex-direction: column; gap: 6px; }
.fuss-zeile { display: flex; justify-content: space-between; gap: 8px; align-items: center; min-height: 18px; }
.link { background: none; border: 0; color: var(--akzent); cursor: pointer; padding: 0; font-size: 12px; font-weight: 600; }
.auslastung { display: flex; flex-direction: column; gap: 4px; }
.balken { display: grid; grid-template-columns: 44px 1fr 40px; gap: 8px; align-items: center; }
.balken .bahn { height: 6px; background: var(--hover); border-radius: 3px; overflow: hidden; }
.balken .fuellung { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.balken.warnung .fuellung { background: var(--warnung); }
.balken.kritisch .fuellung { background: var(--gefahr); }
.balken .wert { text-align: right; font-variant-numeric: tabular-nums; }
.limit { color: var(--gefahr); font-weight: 600; }

/* Rechner und Wecken */
.rechner { display: flex; flex-direction: column; gap: 3px; padding-bottom: 4px; border-bottom: 1px solid var(--linie); margin-bottom: 2px; }
.rechner-zeile { display: flex; align-items: center; gap: 8px; min-height: 20px; }
.rechner-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rechner-text strong { color: var(--text); font-weight: 600; }
.rechner-fehler { color: var(--gefahr); }
.punkt.an { background: #25d366; }
.punkt.halb { background: var(--warnung); }
.punkt.aus { background: transparent; border: 1.5px solid var(--dezent); }
.rechner-marke { font-size: 10.5px; font-weight: 700; letter-spacing: .03em; color: var(--dezent); border: 1px solid var(--linie); border-radius: 6px; padding: 0 5px; }
.chatliste .letzte.schlaeft { color: var(--dezent); font-style: italic; }
.schlaf {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
    padding: 10px 14px; background: var(--blase-routine); border-top: 1px solid var(--linie); font-size: 14px;
}

.leer {
    height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 16px; color: var(--dezent); text-align: center; padding: 20px;
}

.menue {
    position: absolute; right: 10px; top: calc(100% - 4px); z-index: 5;
    background: var(--seite); border: 1px solid var(--linie); border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .18); padding: 6px; min-width: 240px;
}
.menue button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 6px; cursor: pointer; }
.menue button:hover { background: var(--hover); }
.menue .gefahr { color: var(--gefahr); }

/* ---------------------------------------------------------------- Nachrichten */
.nachrichten-rahmen { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.nach-unten {
    position: absolute; right: 14px; bottom: 12px; width: 42px; height: 42px; border-radius: 50%;
    border: 1px solid var(--linie); background: var(--seite); color: var(--text); cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .18); display: flex; align-items: center; justify-content: center;
}
.nachrichten {
    flex: 1; min-height: 0; overflow-y: auto; padding: 14px 12px;
    display: flex; flex-direction: column; gap: 4px;
    background-image: radial-gradient(var(--muster) 1px, transparent 1px);
    background-size: 22px 22px;
}
.antwort { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; max-width: min(82%, 760px); }
.sprecher { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; margin-top: 6px; }
.blase {
    max-width: min(78%, 720px); padding: 7px 11px 6px; border-radius: var(--radius);
    box-shadow: var(--schatten); position: relative; overflow-wrap: anywhere;
}
.antwort .blase { max-width: 100%; }
.blase.ich { align-self: flex-end; background: var(--blase-ich); border-bottom-right-radius: 4px; }
.blase.ich .text { white-space: pre-wrap; }
.blase.routine { background: var(--blase-routine); }
.blase.bot { align-self: flex-start; background: var(--blase-bot); border-bottom-left-radius: 4px; }
.blase.auftrag { background: var(--blase-auftrag); white-space: pre-wrap; }
.absender { font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.blase .zeit { display: block; text-align: right; font-size: 11px; color: var(--dezent); margin-top: 2px; }
.blase.leerlauf::after { content: ''; display: inline-block; width: 8px; height: 15px; background: var(--akzent); animation: puls .9s infinite; vertical-align: text-bottom; margin-left: 2px; border-radius: 2px; }
.blase .inhalt > :first-child { margin-top: 0; }
.blase .inhalt > :last-child { margin-bottom: 0; }
.blase .inhalt p { margin: .4em 0; }
.blase .inhalt pre { background: var(--code-bg); padding: 8px 10px; border-radius: 8px; overflow-x: auto; font: 13px/1.4 var(--mono); white-space: pre; }
.blase .inhalt code { font: 13px var(--mono); background: var(--code-bg); padding: 1px 4px; border-radius: 4px; }
.blase .inhalt pre code { background: none; padding: 0; }
.blase .inhalt ul, .blase .inhalt ol { padding-left: 22px; }
.blase .inhalt table { border-collapse: collapse; font-size: 14px; display: block; overflow-x: auto; }
.blase .inhalt td, .blase .inhalt th { border: 1px solid var(--linie); padding: 3px 7px; }
.blase .inhalt a { color: var(--link); }

/* Werkzeugzeilen: aufklappbar mit Ergebnis */
.werkzeug { font: 12px/1.35 var(--mono); color: var(--dezent); max-width: 100%; }
.werkzeug summary { display: flex; gap: 6px; align-items: baseline; cursor: pointer; padding: 1px 8px; list-style: none; border-radius: 6px; }
.werkzeug summary::-webkit-details-marker { display: none; }
.werkzeug summary::before { content: '⚙'; }
.werkzeug.laeuft summary::before { content: '◌'; animation: puls 1s infinite; color: var(--akzent); }
.werkzeug.fehlgeschlagen summary::before { content: '✗'; color: var(--gefahr); }
.werkzeug summary:hover { background: var(--werkzeug-hover); }
.werkzeug b { font-weight: 600; color: var(--text); opacity: .75; flex: 0 0 auto; }
.werkzeug .was { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.werkzeug .dauer { margin-left: auto; padding-left: 8px; flex: 0 0 auto; opacity: .8; }
.werkzeug pre { margin: 2px 0 6px 18px; padding: 6px 8px; max-height: 260px; overflow: auto; background: var(--seite); border: 1px solid var(--linie); border-radius: 6px; color: var(--text); font-size: 11.5px; }

.ereignis { align-self: center; font-size: 12px; color: var(--dezent); background: var(--leiste); padding: 3px 12px; border-radius: 10px; margin: 6px 0; text-align: center; max-width: 90%; }
.ereignis.fehler { color: var(--gefahr); }

/* Anhänge */
.anhang-leiste { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.anhang {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px;
    border: 1px solid var(--linie); background: var(--seite); cursor: pointer; max-width: 260px; font-size: 13px;
}
.anhang .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.anhang .groesse { color: var(--dezent); font-size: 11.5px; flex: 0 0 auto; }
.anhang.bild { padding: 0; overflow: hidden; border: 0; }
.anhang.bild img { display: block; max-width: 220px; max-height: 220px; border-radius: 10px; }

/* Freigabe- und Frage-Karten */
.freigabe {
    align-self: stretch; max-width: 640px; margin: 8px auto; width: 100%;
    background: var(--seite); border: 2px solid var(--warnung); border-radius: 14px; padding: 12px 14px;
    display: flex; flex-direction: column; gap: 8px; box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
}
.freigabe.gesendet { opacity: .5; pointer-events: none; }
.freigabe-kopf { display: flex; align-items: center; gap: 8px; }
.freigabe-was { margin: 0; font-weight: 600; }
.freigabe pre { margin: 0; max-height: 220px; overflow: auto; background: var(--leiste); padding: 8px 10px; border-radius: 8px; font: 12.5px/1.4 var(--mono); }
.freigabe .frei { font: inherit; color: var(--text); background: var(--leiste); border: 1px solid var(--linie); border-radius: 8px; padding: 8px 10px; width: 100%; }
.frage-text { margin: 0 0 6px; font-weight: 600; }
.optionen { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.option { text-align: left; border: 1px solid var(--linie); background: var(--leiste); border-radius: 10px; padding: 8px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.option span { font-size: 13px; color: var(--dezent); }
.option:hover { border-color: var(--akzent); }
.option.gewaehlt { border-color: var(--akzent); background: color-mix(in srgb, var(--akzent) 14%, var(--seite)); }

/* Eingabe */
.mitglieder, .anhaenge { display: flex; gap: 6px; padding: 6px 10px 0; background: var(--leiste); border-top: 1px solid var(--linie); overflow-x: auto; }
.anhaenge + .eingabe, .mitglieder + .anhaenge { border-top: 0; }
.chip { flex: 0 0 auto; border: 1px solid var(--linie); border-left-width: 3px; background: var(--seite); border-radius: 14px; padding: 3px 10px; cursor: pointer; font-size: 13px; }
.upload { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; background: var(--seite); border: 1px solid var(--linie); border-radius: 10px; padding: 4px 6px; font-size: 12.5px; max-width: 220px; }
.upload img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; }
.upload .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload .weg { border: 0; background: none; cursor: pointer; font-size: 18px; line-height: 1; color: var(--dezent); }
.eingabe {
    display: flex; align-items: flex-end; gap: 6px; padding: 8px 10px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    background: var(--leiste); border-top: 1px solid var(--linie);
}
.mitglieder:not([hidden]) ~ .eingabe, .anhaenge:not([hidden]) + .eingabe { border-top: 0; }
.eingabe textarea {
    flex: 1; resize: none; border: 0; border-radius: 20px; padding: 10px 14px; max-height: 40dvh;
    font: inherit; background: var(--seite); color: var(--text); outline: none; min-width: 0;
}
.eingabe .senden { background: var(--akzent); color: var(--akzent-text); }
.eingabe .senden:hover { background: var(--akzent); filter: brightness(1.08); color: var(--akzent-text); }
.eingabe .senden:disabled { opacity: .45; cursor: default; }
.eingabe .stop { background: var(--gefahr); color: #fff; }

/* Sprachaufnahme */
.aufnahme { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.aufnahme-punkt { width: 10px; height: 10px; border-radius: 50%; background: var(--gefahr); animation: puls 1s infinite; flex: 0 0 auto; }
.aufnahme-punkt.pausiert { animation: none; background: var(--dezent); }
.aufnahme-zeit { font-variant-numeric: tabular-nums; min-width: 38px; }
.aufnahme-pegel { flex: 1; height: 28px; display: flex; align-items: center; gap: 2px; min-width: 0; overflow: hidden; }
.aufnahme-pegel i { flex: 1; min-width: 2px; max-width: 4px; background: var(--akzent); border-radius: 2px; height: 8%; transition: height .1s; }
.blase.sprach { min-width: 220px; }
.blase.wartend { opacity: .7; font-style: italic; }
.sprach-player { display: flex; align-items: center; gap: 10px; margin: 2px 0 4px; }
.sprach-knopf { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--akzent); color: #fff; cursor: pointer; font-size: 14px; flex: 0 0 auto; }
.sprach-bahn { flex: 1; height: 4px; border-radius: 2px; background: rgba(0, 0, 0, .15); overflow: hidden; min-width: 80px; }
.sprach-fuellung { display: block; height: 100%; width: 0; background: var(--akzent); }
.sprach-zeit { font-size: 12px; color: var(--dezent); font-variant-numeric: tabular-nums; }
.geraeteliste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.geraeteliste li { display: flex; align-items: center; gap: 8px; border: 1px solid var(--linie); border-radius: 10px; padding: 8px 10px; }
.geraeteliste li.dieses { border-color: var(--akzent); }
.g-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.g-text span { font-size: 12.5px; color: var(--dezent); }
.marke { font-size: 11px; font-weight: 600; color: var(--akzent); margin-left: 8px; }
.aktionen.links { justify-content: flex-start; }
.dialog code { font: 12.5px var(--mono); background: var(--leiste); padding: 1px 4px; border-radius: 4px; }
.abschrift { font-size: 13.5px; white-space: pre-wrap; opacity: .9; }
.eingabe .stop svg { fill: currentColor; stroke: none; }

/* ---------------------------------------------------------------- Dialoge */
.overlay {
    position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .45);
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.overlay.rechts { justify-content: flex-end; padding: 0; }
.dialog {
    background: var(--seite); border-radius: 16px; padding: 22px; width: 100%; max-width: 460px;
    max-height: calc(100dvh - 32px); overflow-y: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
    display: flex; flex-direction: column; gap: 12px;
}
.dialog.panel { max-width: 440px; height: 100dvh; max-height: 100dvh; border-radius: 0; padding-top: calc(18px + env(safe-area-inset-top)); }
.panel-kopf { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
.panel-kopf h2 { margin: 0; }
.panel-kopf p { margin: 2px 0 0; }
.dialog h1, .dialog h2 { margin: 0; }
.dialog h3 { margin: 10px 0 0; font-size: 15px; }
.dialog h3 small { font-weight: 400; color: var(--dezent); }
.dialog p { margin: 0; color: var(--dezent); }
.dialog label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--dezent); }
.dialog label.haken { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.dialog input:not([type=checkbox]), .dialog select, .dialog textarea {
    font: inherit; color: var(--text); background: var(--leiste); border: 1px solid var(--linie);
    border-radius: 8px; padding: 9px 11px; width: 100%;
}
.dialog input:focus, .dialog textarea:focus, .dialog select:focus { outline: 2px solid var(--akzent); border-color: transparent; }
.dialog pre { font: 12px/1.4 var(--mono); background: var(--leiste); padding: 10px; border-radius: 8px; max-height: 320px; overflow: auto; }
.zweispaltig { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auswahl { border: 1px solid var(--linie); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.auswahl legend { font-size: 13px; color: var(--dezent); padding: 0 4px; }
.login { align-items: center; text-align: center; max-width: 380px; }
.login input { text-align: center; }
.fehler { color: var(--gefahr) !important; font-size: 13px; }
.hinweis { font-size: 12.5px; }
.primaer { background: var(--akzent); color: var(--akzent-text); border: 0; border-radius: 10px; padding: 10px 18px; cursor: pointer; font-weight: 600; }
.knopf { background: var(--leiste); border: 1px solid var(--linie); border-radius: 10px; padding: 9px 14px; cursor: pointer; color: var(--text); display: inline-block; text-align: center; }
.knopf.klein { padding: 4px 10px; font-size: 12.5px; }
.knopf.gefahr { color: var(--gefahr); }
.aktionen { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.avatar-wahl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mit-knopf { display: flex; gap: 6px; align-items: stretch; }
.mit-knopf input { flex: 1; min-width: 0; }
.mit-knopf .knopf { flex: 0 0 auto; white-space: nowrap; }
.vorschlaege { display: flex; gap: 6px; flex-wrap: wrap; margin-top: -6px; }
.vorschlaege .chip { border-left-color: var(--akzent); }
.knopf:disabled { opacity: .55; cursor: progress; }

.fakten { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 13.5px; }
.fakten dt { color: var(--dezent); }
.fakten dd { margin: 0; overflow-wrap: anywhere; }
.routinen { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.routinen li { display: flex; align-items: center; gap: 6px; border: 1px solid var(--linie); border-radius: 10px; padding: 8px 10px; }
.routinen li.aus { opacity: .6; }
.routinen .r-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.routinen .r-text span { font-size: 12.5px; color: var(--dezent); }
.leer-klein { color: var(--dezent); font-size: 13px; border: 0 !important; padding: 0 !important; }
.skills { font-size: 13px; }
details summary { cursor: pointer; }

/* ---------------------------------------------------------------- Handy */
@media (max-width: 760px) {
    .app { grid-template-columns: 1fr; }
    .seite { border-right: 0; }
    .chat { display: none; }
    .app.chat-offen .seite { display: none; }
    .app.chat-offen .chat { display: flex; }
    .zurueck { display: inline-flex; }
    .blase { max-width: 88%; }
    .antwort { max-width: 92%; }
    .dialog.panel { max-width: none; }
    .overlay:not(.rechts) { padding: 0; align-items: flex-end; }
    .overlay:not(.rechts) .dialog { border-radius: 16px 16px 0 0; max-height: 92dvh; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
    .zweispaltig { grid-template-columns: 1fr; }
    #btn-anhang { width: 36px; }
}
