/* Cockpit – ruhig, dunkel/hell, Statusfarben als einzige Akzente. Farben kommen aus branding.json (CSS-Variablen). */
:root {
  --erledigt: #2f9e66; --wartet: #d9822b; --arbeitet: #3b7dd8; --fehler: #d64545;
  --grund: #0a0a0a; --flaeche: #121212; --linie: #222; --text: #ededed; --leise: #8a8a8a; --akzent: #ededed; --augen: #0a0a0a;
  --rad: 14px; font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; color-scheme: dark;
}
:root[data-thema="hell"] { --grund: #fafafa; --flaeche: #ffffff; --linie: #e6e6e6; --text: #141414; --leise: #6b6b6b; --akzent: #141414; --augen: #fafafa; color-scheme: light; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--grund); color: var(--text); font-size: 15px; line-height: 1.5; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--linie); background: var(--akzent); color: var(--grund); border-radius: 10px; padding: .55rem 1rem; font-weight: 600; }
button.zweit, button.symbol, button.link { background: transparent; color: var(--text); }
button.symbol { width: 2rem; height: 2rem; padding: 0; border-radius: 8px; }
button.link { border: 0; padding: 0; color: var(--leise); font-weight: 400; text-decoration: underline; }
:focus-visible { outline: 2px solid var(--arbeitet); outline-offset: 2px; }
h2 { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--leise); margin: 1.4rem 0 .5rem; font-weight: 600; }
.leise { color: var(--leise); } .klein { font-size: .85rem; }
[hidden] { display: none !important; }

/* Krake + Orbit (kreisende Arme als Arbeits-Anzeige) */
.krake { background: currentColor; -webkit-mask: url(/krake.svg) center/contain no-repeat; mask: url(/krake.svg) center/contain no-repeat; }
.krake.klein { width: 26px; height: 26px; } .krake.gross { width: 92px; height: 92px; position: relative; z-index: 1; }
.orbit { position: relative; width: 14px; height: 14px; display: inline-block; vertical-align: middle; }
.orbit span { position: absolute; inset: 0; animation: kreisen 2.4s linear infinite; }
.orbit span::after { content: ""; position: absolute; top: -1px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--arbeitet); }
.orbit span:nth-child(2) { animation-delay: -.3s; opacity: .85 } .orbit span:nth-child(3) { animation-delay: -.6s; opacity: .7 }
.orbit span:nth-child(4) { animation-delay: -.9s; opacity: .55 } .orbit span:nth-child(n+5) { display: none; }
.orbit.gross { position: absolute; width: 260px; height: 260px; top: calc(50% - 320px); left: calc(50% - 130px); }
.orbit.gross span { animation-duration: 18s; } .orbit.gross span:nth-child(n) { display: block; }
.orbit.gross span::after { width: 10px; height: 10px; margin-left: -5px; background: var(--leise); opacity: .5; }
.orbit.gross span:nth-child(2) { animation-delay: -2.25s } .orbit.gross span:nth-child(3) { animation-delay: -4.5s } .orbit.gross span:nth-child(4) { animation-delay: -6.75s }
.orbit.gross span:nth-child(5) { animation-delay: -9s } .orbit.gross span:nth-child(6) { animation-delay: -11.25s } .orbit.gross span:nth-child(7) { animation-delay: -13.5s } .orbit.gross span:nth-child(8) { animation-delay: -15.75s }
@keyframes kreisen { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .orbit span { animation: none; } }

/* Anmeldung */
.tor { min-height: 100%; display: grid; place-items: center; align-content: center; gap: .4rem; padding: 2rem; text-align: center; position: relative; overflow: hidden; }
.tor .marke { font-size: 1.8rem; margin: .8rem 0 0; letter-spacing: -.02em; } .tor .slogan { color: var(--leise); margin: 0 0 1.4rem; }
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--rad); padding: 1.4rem; width: min(360px, 92vw); display: grid; gap: .9rem; text-align: left; }
label { display: grid; gap: .3rem; font-size: .88rem; color: var(--leise); }
input, textarea { background: var(--grund); border: 1px solid var(--linie); border-radius: 10px; padding: .6rem .7rem; color: var(--text); }
.fehler { color: var(--fehler); min-height: 1.2em; margin: 0; font-size: .88rem; }

/* Cockpit: drei Spalten */
.cockpit { display: grid; grid-template-columns: 270px 1fr 330px; height: 100%; }
.cockpit:not(.details-offen) { grid-template-columns: 270px 1fr 0; } .cockpit:not(.details-offen) .rechts { display: none; }
.links, .rechts { background: var(--flaeche); border-right: 1px solid var(--linie); padding: 1rem; overflow: auto; display: flex; flex-direction: column; }
.rechts { border-right: 0; border-left: 1px solid var(--linie); }
.kopf { display: flex; align-items: center; gap: .6rem; } .kopf strong { flex: 1; font-size: 1.05rem; letter-spacing: -.01em; }
.inbox { margin-top: 1rem; display: flex; justify-content: space-between; align-items: center; background: transparent; color: var(--text); border-radius: 12px; }
.inbox b { min-width: 1.6rem; padding: 0 .45rem; border-radius: 99px; background: var(--linie); color: var(--text); font-size: .8rem; line-height: 1.6rem; }
.inbox.hat b { background: var(--wartet); color: #111; font-weight: 700; }
.rollen, .gespraeche, .entwuerfe, .verlauf { list-style: none; margin: 0; padding: 0; }
.rollen li button, .gespraeche li button { width: 100%; text-align: left; background: transparent; color: var(--text); border: 0; border-radius: 10px; padding: .5rem .6rem; font-weight: 500; display: flex; align-items: center; gap: .6rem; }
.rollen li button:hover, .gespraeche li button:hover { background: var(--linie); }
.rollen li button[aria-current="true"], .gespraeche li button[aria-current="true"] { background: var(--linie); }
.arm { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 700; color: #fff; flex: none; }
.punkt { width: 8px; height: 8px; border-radius: 50%; background: var(--erledigt); margin-left: auto; flex: none; }
.punkt.wartet { background: var(--wartet); } .punkt.arbeitet { background: transparent; width: 14px; height: 14px; }
.gespraeche li button { font-weight: 400; font-size: .9rem; color: var(--leise); } .gespraeche li button[aria-current="true"] { color: var(--text); }
.gespraeche li button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gespraeche-kopf { display: flex; align-items: center; justify-content: space-between; } .gespraeche-kopf h2 { margin-bottom: .5rem; }
.fuss { margin-top: auto; padding-top: 1rem; display: flex; justify-content: space-between; font-size: .85rem; color: var(--leise); }

.mitte { display: flex; flex-direction: column; min-width: 0; height: 100%; }
.mitte-kopf { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.6rem; border-bottom: 1px solid var(--linie); }
.mitte-kopf h1 { margin: 0; font-size: 1.1rem; text-transform: capitalize; } .mitte-kopf p { margin: 0; font-size: .85rem; }
.verlauf { flex: 1; overflow: auto; padding: 1.6rem; display: flex; flex-direction: column; gap: 1.1rem; }
.verlauf li { max-width: 46rem; white-space: pre-wrap; word-wrap: break-word; }
.verlauf .nutzer { align-self: flex-end; background: var(--linie); padding: .6rem .9rem; border-radius: 14px 14px 4px 14px; }
.verlauf .agent { display: grid; grid-template-columns: 26px 1fr; gap: .7rem; }
.verlauf .agent .text { padding-top: .1rem; }
.verlauf .hinweis { align-self: center; color: var(--leise); font-size: .85rem; display: flex; gap: .5rem; align-items: center; }
.verlauf .hinweis.unterbrochen { color: var(--wartet); } .verlauf .hinweis.fehler { color: var(--fehler); }
.leer { margin: auto; text-align: center; color: var(--leise); }
.eingabe { display: flex; gap: .6rem; padding: 1rem 1.6rem 1.4rem; border-top: 1px solid var(--linie); align-items: flex-end; }
.eingabe textarea { flex: 1; resize: none; max-height: 12rem; }

.entwuerfe li { border: 1px solid var(--linie); border-radius: 12px; padding: .8rem; margin-bottom: .7rem; display: grid; gap: .4rem; }
.entwuerfe .an { font-size: .8rem; color: var(--leise); } .entwuerfe .betreff { font-weight: 600; }
.entwuerfe .text { font-size: .88rem; white-space: pre-wrap; max-height: 9rem; overflow: auto; color: var(--leise); }
.entwuerfe .knoepfe { display: flex; gap: .5rem; } .entwuerfe .knoepfe button { padding: .4rem .8rem; font-size: .85rem; }
.entwuerfe .zustand { font-size: .8rem; font-weight: 600; } .zustand.gesendet { color: var(--erledigt); }
:root[data-thema="hell"] .zustand.gesendet { color: #1d6b44; } :root[data-thema="hell"] .zustand.zustellung_unklar { color: #9a4d0c; }
.schliessen { display: none; }
.punkt.fehler { background: var(--fehler); } .punkt.braucht { background: var(--wartet); box-shadow: 0 0 0 3px color-mix(in srgb, var(--wartet) 30%, transparent); } .zustand.zustellung_unklar { color: var(--wartet); }

@media (max-width: 900px) {
  .cockpit, .cockpit:not(.details-offen) { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .links { max-height: 40vh; border-right: 0; border-bottom: 1px solid var(--linie); }
  .rechts { position: fixed; inset: auto 0 0 0; max-height: 70vh; border-top: 1px solid var(--linie); border-radius: 16px 16px 0 0; z-index: 5; }
  .cockpit:not(.details-offen) .rechts { display: none; }
  .cockpit.details-offen .rechts { display: flex; }
  .schliessen { display: block; position: sticky; top: 0; margin-left: auto; z-index: 1; background: var(--flaeche); }
}

.rollen li button > span:nth-child(2) { text-transform: capitalize; }

.team-liste { list-style: none; padding: 0; margin: 0 0 .8rem; display: grid; gap: .4rem; font-size: .88rem; }
.team-liste small { color: var(--leise); display: block; }
.einladen { display: grid; gap: .5rem; } .einladen .zeile { display: flex; gap: .5rem; align-items: center; color: var(--text); }
.einladen .hinweis-text { word-break: break-all; user-select: all; }
select { background: var(--grund); border: 1px solid var(--linie); border-radius: 10px; padding: .55rem .6rem; color: var(--text); font: inherit; }
.team-liste .loeschen { float: right; padding: 0 .4rem; font-size: .8rem; }
.balken { height: 8px; border-radius: 4px; background: var(--linie); overflow: hidden; margin-bottom: .4rem; }
.balken span { display: block; height: 100%; background: var(--erledigt); width: 0; }
.balken span.knapp { background: var(--wartet); } .balken span.voll { background: var(--fehler); }
.datei { display: inline-block; border: 1px solid var(--linie); border-radius: 10px; padding: .45rem .9rem; color: var(--text); cursor: pointer; font-weight: 600; font-size: .88rem; }
.datei:focus-within { outline: 2px solid var(--arbeitet); }
