/* Skill-it Design-System - matte UI, Orbit-Motiv, Sandstein + Bordeaux
 *
 * Zwei Ansichten, ein Farbklang: "Sandstein" ist der Tag (warmes Beige, dunkle
 * Schrift) und steht in :root, weil er der Normalfall ist. "Abend-Beige" ist
 * dieselbe Familie nach Einbruch der Dunkelheit und haengt an
 * html[data-theme="dark"].
 *
 * Alles, was sich zwischen beiden unterscheidet, steht ausschliesslich in
 * diesen zwei Bloecken. Weiter unten wird nur noch mit Variablen gearbeitet -
 * wer die Farbe der App aendern will, muss nichts anderes anfassen.
 */

:root {
    --bordeaux: #6A1F2A;
    --bordeaux-hover: #7D2733;
    --bordeaux-pressed: #541821;
    /* Warmes Gebrochen-Weiss statt reinem Weiss - auf Bordeaux und in der
       dunklen Ansicht wirkt ein kaltes #FFF wie ein Fremdkoerper. */
    --soft-white: #F7F2E8;
    --success: #2F7F4F;
    --warning: #C89A2B;
    --error: #8A1F2A;
    /* Dieselben Bedeutungen noch einmal als Schriftfarbe. Ein Gruen, das als
       Knopfflaeche richtig ist, ist als Schrift auf dunklem Grund zu dunkel -
       und umgekehrt. Deshalb zwei Werte statt einer Notloesung. */
    --success-text: #175A33;
    --error-text: #8A1F2A;

    --radius: 16px;
    --radius-sm: 10px;

    --font-head: "Inter", "Inter SemiBold", "Segoe UI", system-ui, sans-serif;
    --font-ui: "Nunito", "Segoe UI", system-ui, sans-serif;

    /* ---- Sandstein: die helle Ansicht, zugleich die Vorgabe ----
       Der Grund liegt bewusst tiefer als die Flaechen darauf. Vorher trennten
       Karte und Hintergrund nur 1,7:1 - zu wenig, um eine Kante zu sehen; die
       Seite wirkte wie durch Milchglas. Jetzt sind es 2,6:1, und die Karte ist
       deckend statt zu 92 Prozent durchsichtig. */
    --bg: radial-gradient(1100px 640px at 12% -14%, #C0AF90 0%, #AC9A79 48%, #9E8B69 100%);
    --panel: #FBF8F1;
    --panel-2: #F2ECDF;
    --line: rgba(74, 56, 34, 0.16);
    --text: #241E17;
    --text-dim: #57493A;
    --muted: #6B5C47;
    --tile: #FBF8F1;
    /* Neutrale Schleier fuer Hover, Balken und Sprechblasen: in der hellen
       Ansicht dunkeln sie ab, in der dunklen hellen sie auf. */
    --tint-1: rgba(74, 56, 34, 0.08);
    --tint-2: rgba(74, 56, 34, 0.17);
    --scrim: rgba(43, 32, 18, 0.52);
    /* Ein Schatten hebt etwas heraus. Wenn ihn alles traegt, hebt er nichts
       heraus - deshalb ist der weiche jetzt nur noch ein Hauch, und der tiefe
       bleibt den wenigen Flaechen vorbehalten, die wirklich vorne liegen. */
    --shadow-soft: 0 1px 2px rgba(74, 56, 34, 0.07);
    --shadow-deep: 0 10px 26px rgba(43, 32, 18, 0.16);

    /* Zustandsfarben als Flaeche und Schrift. Die Schriftfarbe ist die
       dunklere von beiden - sie steht auf der getoenten Flaeche, nicht auf
       der Karte. */
    --warn-bg: rgba(200, 154, 43, 0.20);
    --warn-text: #7A5A12;
    --ok-bg: rgba(47, 127, 79, 0.15);
    --ok-text: #1C6B45;
}

html[data-theme="dark"] {
    /* ---- Abend-Beige ---- */
    --bg: radial-gradient(1100px 640px at 12% -14%, #241E15 0%, #1B1710 50%, #141009 100%);
    --panel: #3D3427;
    --panel-2: #332B20;
    --line: rgba(237, 227, 209, 0.20);
    --text: #F3EADA;
    --text-dim: #BEB199;
    --muted: #B0A48D;
    --tile: #3D3427;
    --tint-1: rgba(237, 227, 209, 0.07);
    --tint-2: rgba(237, 227, 209, 0.18);
    --scrim: rgba(18, 14, 8, 0.68);
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.30);
    --shadow-deep: 0 12px 30px rgba(0, 0, 0, 0.45);
    --warn-bg: rgba(227, 184, 90, 0.16);
    --warn-text: #E3B85A;
    --ok-bg: rgba(127, 214, 161, 0.15);
    --ok-text: #7FD6A1;
    /* Bordeaux aufgehellt: der Tagton verschwindet auf dem dunklen Braun fast,
       Knopf und Hintergrund waeren kaum noch zu unterscheiden. */
    --bordeaux: #8E2C3A;
    --bordeaux-hover: #A13748;
    --bordeaux-pressed: #732330;
    --success-text: #6FBE90;
    --error-text: #E8909A;
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0; min-height: 100%;
    background: var(--bg); background-attachment: fixed;
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; margin: 0 0 8px; letter-spacing: -0.01em; }
/* Eine Leiter mit sechs Sprossen: 12 / 13 / 15 / 18 / 24 / 32. Vorher lagen
   elf Groessen zwischen 11,5 und 28 Pixeln, viele nur ein Pixel auseinander -
   das liest sich als Unordnung, nicht als Rangfolge. */
h1 { font-size: 32px; letter-spacing: -0.025em; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
p { margin: 0 0 10px; color: var(--text-dim); line-height: 1.55; }
a { color: inherit; }
small { color: var(--text-dim); font-size: 13px; }

/* ---------------------------------------------------------------- Layout */
#app { min-height: 100vh; }

.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 232px; flex: 0 0 232px; padding: 20px 14px;
    background: var(--panel-2); border-right: 1px solid var(--line);
    display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.sidebar .brand b { font-family: var(--font-head); font-size: 18px; letter-spacing: -0.02em; }
.sidebar .brand small { display: block; font-size: 10.5px; color: var(--text-dim); }

.navlink {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
    cursor: pointer; color: var(--text-dim); font-weight: 600; font-size: 14px; border: 1px solid transparent;
    transition: background .15s, color .15s;
}
.navlink:hover { background: var(--tint-1); color: var(--text); }
.navlink.active { background: rgba(106, 31, 42, 0.20); color: var(--text); border-color: rgba(106,31,42,.55); }
.navlink .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bordeaux); opacity: 0; }
.navlink.active .dot { opacity: 1; }
.navlink .ic { opacity: .85; }
.navlink.active .ic { opacity: 1; }

/* Die Spalte hat eine Hoechstbreite - aber ohne 'margin-inline: auto' klebte
   sie am linken Rand, und auf breiten Schirmen stand rechts daneben eine
   leere Flaeche. */
.main { flex: 1; min-width: 0; padding: 26px 32px 90px; max-width: 1240px; margin-inline: auto; }

.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    margin-bottom: 20px; flex-wrap: wrap;
}
.topbar .who { display: flex; align-items: center; gap: 12px; }

/* Auf dem Dashboard steht hier kein Datensatz, sondern eine Anrede und eine
   Zeile Lage. Es war die einzige Ansicht ohne Titelzeile - man fiel mitten in
   die Kacheln hinein. */
.greet h1 { margin: 0 0 4px; }
.greet .sub { margin: 0; font-size: 15px; color: var(--text-dim); }
.greet .sub b { color: var(--text); font-weight: 700; }

/* Hinweisband ueber dem Inhalt - zurzeit nur fuer die noch offene Bestaetigung
   der E-Mail-Adresse. Es soll auffallen und trotzdem niemanden aufhalten:
   deshalb warme Farbe statt Rot, und kein Weg, es wegzuklicken - es geht von
   selbst, sobald bestaetigt ist. */
.banner {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin-bottom: 18px; padding: 12px 14px; border-radius: var(--radius);
    border: 1px solid rgba(200, 154, 43, .55); background: rgba(200, 154, 43, .13);
}
.banner .ic { color: var(--warn-text); }
.banner .grow { flex: 1; min-width: 220px; }
.banner .grow b { font-family: var(--font-head); }
.banner .grow small { color: var(--text-dim); }

.avatar {
    width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
    font-family: var(--font-head); font-weight: 600; font-size: 14px; color: var(--soft-white);
    background: linear-gradient(150deg, #5C4A34, #362A1D); border: 1px solid rgba(247, 242, 232, 0.22);
    box-shadow: var(--shadow-soft); flex: 0 0 auto;
}
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.avatar.has-img { background: var(--panel-2); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

/* Profilbild aendern: Kreis mit kleinem Stift am Rand */
.avatar-edit { position: relative; cursor: pointer; flex: 0 0 auto; border-radius: 50%; }
.avatar-edit .avatar { width: 84px; height: 84px; font-size: 24px; }
.avatar-edit:hover .avatar { border-color: var(--bordeaux-hover); }
.avatar-edit:focus-visible { outline: 2px solid var(--bordeaux-hover); outline-offset: 3px; }
.avatar-badge {
    position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%;
    display: grid; place-items: center; font-size: 13px;
    background: var(--bordeaux); color: var(--soft-white); border: 2px solid var(--panel);
}

/* Zuschnitt-Dialog */
.crop-wrap { display: grid; place-items: center; margin: 4px 0 14px; }
.crop-wrap canvas {
    border-radius: var(--radius-sm); background: var(--panel-2);
    touch-action: none; cursor: grab; max-width: 100%;
}
.crop-wrap canvas:active { cursor: grabbing; }
input[type="range"] { padding: 0; background: none; border: none; accent-color: var(--bordeaux); }
.hidden-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.pill {
    display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px;
    background: var(--panel); border: 1px solid var(--line); font-size: 13px; font-weight: 700;
}
.pill.accent { border-color: rgba(106,31,42,.6); background: rgba(106,31,42,.18); }
.pill.ghost { background: transparent; }

/* ---------------------------------------------------------------- Karten */
.card {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 20px;
}
/* Genau eine Flaeche darf vorne liegen: die, die sagt, was als Naechstes
   ansteht. Alles andere traegt nur noch seinen Rand. Vorher hatten acht
   gleich laute Kisten je einen Schatten - und keine stach heraus. */
.card.hoch { box-shadow: var(--shadow-deep); border-color: rgba(106, 31, 42, .34); }
html[data-theme="dark"] .card.hoch { border-color: rgba(161, 55, 72, .55); }

.card + .card { margin-top: 16px; }
/* ... aber nicht im Raster: Dort sorgt schon 'gap' fuer den Abstand. Der
   Randabstand wuerde jede Karte ab der zweiten nach unten schieben - und weil
   ein Rasterfeld seine Hoehe abzueglich der Raender fuellt, waere sie zugleich
   um diese 14 Pixel kuerzer als ihre Nachbarin. */
.grid > .card + .card { margin-top: 0; }
/* Der Kartentitel ist eine Beschriftung, kein Konkurrent zum Inhalt: klein,
   gesperrt, gedaempft - und mit einer Linie darunter, die den Kopf vom Inhalt
   trennt. Vorher stand er in 17 Pixeln fast so gross da wie die Eintraege. */
.card h3 {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    font-family: var(--font-head); font-size: 13px; font-weight: 700;
    letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
    margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
/* Ein Knopf im Kartenkopf schreibt sich weiter normal. */
.card h3 .btn { text-transform: none; letter-spacing: 0; }

/* Die Ausnahmen: Wo das h3 keinen Kartenteil benennt, sondern selbst der
   Inhalt ist - ein Skillname, ein Fenstertitel, eine Ueberschrift aus dem
   Handbuch -, bleibt es eine Ueberschrift. Die Klasse "titel" sagt das dort,
   wo man es der Stelle nicht ansieht. */
.card h3.titel, .card.empty h3, .modal h3, .auth-card h3, .doc-body h3 {
    display: block; font-size: 18px; letter-spacing: -0.01em; text-transform: none;
    color: var(--text); border-bottom: none; padding-bottom: 0; margin: 0 0 8px;
}

.grid { display: grid; gap: 14px; }
.grid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Links die Listen, rechts die Kennwerte: zwei gleich breite Spalten machten
   die dichte Orbit-Karte enger als noetig und die Listen breiter als noetig. */
.grid.split { grid-template-columns: 1.45fr 1fr; }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* Vier Kennzahlen statt drei grosser Kacheln.
 *
 * Die Kacheln waren Wege - und die Wege stehen links in der Leiste und unten
 * am Rand ohnehin schon. Ihre eigentliche Aussage, die Zahl, stand klein und
 * als Fliesstext unter der Ueberschrift. Jetzt steht sie vorn und gross, in
 * tabellarischen Ziffern, damit die vier Felder untereinander fluchten. */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi {
    display: flex; flex-direction: column; gap: 2px; text-align: left;
    background: var(--tile); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px 18px; cursor: pointer; color: var(--text);
    font-family: var(--font-ui); font-size: 15px;
    transition: border-color .15s, background .15s;
}
.kpi:hover { border-color: rgba(106, 31, 42, .45); background: var(--panel-2); }
.kpi .wert {
    font-family: var(--font-head); font-size: 32px; font-weight: 600; line-height: 1.05;
    letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.kpi .was { font-size: 13px; font-weight: 700; }
.kpi .dazu { font-size: 12px; color: var(--muted); }

/* Der Rand um das Orbit-Zeichen - nur in der dunklen Ansicht, und nur dort, wo
   das Zeichen auf einer Flaeche sitzt, die fast so dunkel ist wie es selbst. */
html[data-theme="dark"] .sidebar .brand .orbit-logo .rim {
    stroke: rgba(237, 227, 209, 0.30);
    stroke-width: 1;
}

/* --------------------------------------------------------------- 4: Anker
 * Was als Naechstes ansteht - die eine Zeile, wegen der man morgens
 * hereinschaut. Der Tag steht als Scheibe vorn, nicht im Fliesstext. */
.next { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.next:last-child { border-bottom: none; }
.next .wann {
    flex: 0 0 76px; text-align: center; padding: 8px 4px;
    background: var(--tint-1); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.next .wann b {
    display: block; font-family: var(--font-head); font-size: 12px; font-weight: 600;
    letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.next .wann span {
    display: block; font-family: var(--font-head); font-size: 19px; font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.next .grow { flex: 1; min-width: 0; }
.next .grow b { display: block; font-family: var(--font-head); font-size: 17px; }
.next .grow small { display: block; margin-top: 3px; }

/* ---------------------------------------------------------------- Buttons */
.btn {
    font-family: var(--font-ui); font-weight: 700; font-size: 14px; cursor: pointer;
    border-radius: var(--radius-sm); padding: 10px 16px; border: 1px solid transparent;
    background: var(--bordeaux); color: var(--soft-white); transition: background .15s, transform .1s;
    display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { background: var(--bordeaux-hover); }
.btn:active { background: var(--bordeaux-pressed); transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: transparent; border-color: var(--line); color: var(--text); }
.btn.secondary:hover { background: var(--tint-1); }
.btn.ghost { background: transparent; color: var(--text-dim); border-color: transparent; }
.btn.ghost:hover { color: var(--text); }
.btn.sm { padding: 7px 11px; font-size: 13px; }
.btn.block { width: 100%; justify-content: center; }
.btn.success { background: var(--success); }
.btn.success:hover { filter: brightness(1.08); }

/* ---------------------------------------------------------------- Formulare */
label.field { display: block; margin-bottom: 12px; }
label.field span { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-dim); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em; }
input, select, textarea {
    width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); font-family: var(--font-ui);
    font-size: 14.5px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
    outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--bordeaux-hover); }

/* Wer mit der Tastatur geht, muss sehen, wo er steht. Vorher hatten genau drei
   Stellen einen Fokusrahmen - der Rest blieb unsichtbar. */
.btn:focus-visible, .kpi:focus-visible, .navlink:focus-visible, .chip:focus-visible,
.item [data-open-trade]:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--bordeaux-hover); outline-offset: 2px;
}
textarea { resize: vertical; min-height: 74px; }
select option { color: #2A231B; }
html[data-theme="dark"] select option { background: #2D261C; color: #EDE3D1; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer;
    font-size: 13px; font-weight: 700; color: var(--text-dim); background: transparent; user-select: none;
}
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip.on { background: rgba(106,31,42,.25); border-color: var(--bordeaux); color: var(--text); }

/* ---------------------------------------------------------------- Zeichen */
/* Eine Familie, eine Strichstaerke, eine Groesse.
 *
 * Vorher standen hier Schriftzeichen aus verschiedenen Unicode-Bloecken -
 * ⌂ ▦ ∞ ⇄ ◎ ⚇ ☺ ❑. Jedes brachte seine eigene Strichstaerke und Hoehe mit,
 * und zwei davon zeichnen Windows und Android als farbiges Emoji. Jetzt sind
 * es gezeichnete Linien, die sich die Schriftfarbe der Umgebung nehmen. */
.ic {
    width: 20px; height: 20px; flex: 0 0 auto; display: block;
    fill: none; stroke: currentColor; stroke-width: 1.75;
    stroke-linecap: round; stroke-linejoin: round;
}
.ic.sm { width: 16px; height: 16px; }
/* Ein Zeichen mitten in einer Zeile Text - es sitzt auf der Schriftlinie
   statt darueber. */
.ic.mit { display: inline-block; vertical-align: -0.2em; }
.ic.gross { width: 22px; height: 22px; }

/* ---------------------------------------------------------------- Orbit */
.orbit-logo { display: block; }
/* Gedreht wird nur, wo das Zeichen fuer die Marke steht - in der Seitenleiste,
   auf der Anmeldeseite - oder wo es sagt, dass gerade etwas laedt. In einer
   leeren Liste steht es still: dort ist es Zierat, und Zierat muss sich nicht
   bewegen. Auf dem Dashboard liefen vorher vier Orbits gleichzeitig; das war
   kein Motiv mehr, sondern Unruhe. */
.orbit-logo.dreht .spin { transform-origin: 32px 32px; animation: orbit-spin 14s linear infinite; }
.orbit-logo.dreht .spin-rev { transform-origin: 32px 32px; animation: orbit-spin 22s linear infinite reverse; }
@keyframes orbit-spin { to { transform: rotate(360deg); } }

/* Tausch-Ringe */
.ring-chain { display: flex; flex-direction: column; }
.ring-node {
    display: flex; align-items: center; gap: 10px; padding: 9px 11px;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--tint-1);
}
.ring-node.me { border-color: rgba(106, 31, 42, .6); background: rgba(106, 31, 42, .18); }
.ring-conn {
    display: flex; align-items: center; gap: 8px; padding: 6px 0 6px 20px;
    color: var(--text-dim); font-size: 12.5px;
}
.ring-conn .ring-arrow { font-size: 15px; color: var(--bordeaux); }
html[data-theme="dark"] .ring-conn .ring-arrow { color: var(--bordeaux-hover); }
.ring-close { padding: 8px 0 0 20px; font-size: 12px; color: var(--text-dim); }

.score-ring {
    --p: 0; width: 62px; height: 62px; border-radius: 50%; flex: 0 0 auto;
    background: conic-gradient(var(--bordeaux) calc(var(--p) * 1%), var(--tint-2) 0);
    display: grid; place-items: center; position: relative;
}
.score-ring::after {
    content: ""; position: absolute; inset: 6px; border-radius: 50%;
    background: var(--panel-2); border: 1px solid var(--line);
}
.score-ring b { position: relative; z-index: 1; font-family: var(--font-head); font-size: 15px; }
.score-ring.lg { width: 84px; height: 84px; }
.score-ring.lg b { font-size: 19px; }

.bar { height: 7px; border-radius: 999px; background: var(--tint-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--warning), var(--bordeaux)); }

.tag {
    display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800;
    letter-spacing: .03em; border: 1px solid var(--line); color: var(--text-dim);
}
.tag.perfect { background: rgba(47,127,79,.18); border-color: rgba(47,127,79,.55); color: #1E5C37; }
.tag.strong { background: rgba(106,31,42,.16); border-color: rgba(106,31,42,.5); color: #6A1F2A; }
.tag.possible { background: rgba(200,154,43,.18); border-color: rgba(200,154,43,.5); color: #7A5E10; }
html[data-theme="dark"] .tag.perfect { color: #9EE0B8; }
html[data-theme="dark"] .tag.strong { color: #F0B9C1; }
html[data-theme="dark"] .tag.possible { color: #E8CD8A; }

/* Der Stand eines Trades - als Chip, nicht als blosse Farbe.
 *
 * Vorher stand "offen" in 11,5 Pixeln Versalschrift im Warnton auf der Karte:
 * 2,2:1. "Bestaetigt" im gedaempften Ton: 3,4:1. Beides ist zu wenig, um
 * gelesen zu werden. Jetzt traegt der Chip eine getoente Flaeche und die
 * dunklere Schriftfarbe dazu - 6:1 und darueber.
 *
 * Der Punkt davor traegt dieselbe Aussage noch einmal in der Form: Kreis,
 * Raute, Quadrat, Ring, Strich. Wer Farben nicht unterscheiden kann, sieht
 * den Unterschied trotzdem. */
.status {
    display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; white-space: nowrap;
    padding: 4px 10px 4px 8px; border-radius: 999px;
    font-size: 12.5px; font-weight: 700; letter-spacing: 0; text-transform: none;
    border: 1px solid var(--line); background: var(--tint-1); color: var(--text-dim);
}
.status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.status.pending { background: var(--warn-bg); border-color: rgba(200, 154, 43, .45); color: var(--warn-text); }
.status.accepted i { border-radius: 2px; transform: rotate(45deg); }
.status.active { background: var(--ok-bg); border-color: rgba(47, 127, 79, .40); color: var(--ok-text); }
.status.active i { border-radius: 2px; }
.status.completed { color: var(--success-text); }
.status.completed i { background: none; border: 2px solid currentColor; }
.status.declined, .status.cancelled { color: var(--error-text); }
.status.declined i, .status.cancelled i { width: 9px; height: 3px; border-radius: 2px; }

/* ---------------------------------------------------------------- Listen */
.list { display: flex; flex-direction: column; gap: 1px; }
.item {
    display: flex; align-items: center; gap: 12px; padding: 12px 4px;
    border-bottom: 1px solid var(--line);
}
.item:last-child { border-bottom: none; }
.item .grow { flex: 1; min-width: 0; }
.item .grow b { display: block; font-family: var(--font-head); }
.item .grow small { display: block; color: var(--text-dim); }

.empty { text-align: center; padding: 26px 10px; color: var(--text-dim); }
.empty .orbit-logo { margin: 0 auto 10px; opacity: .5; }

/* ---------------------------------------------------------------- Etappen */
/* Wie .item, aber mit einer Nummernscheibe vorn: Sie traegt den Stand. Eine
   erledigte Etappe tritt zurueck, die naechste tritt hervor - so sieht man
   ohne Lesen, wo man steht. */
.etappe {
    display: flex; align-items: flex-start; gap: 12px; padding: 10px 4px;
    border-bottom: 1px solid var(--line);
}
.etappe:last-child { border-bottom: none; }
.etappe .grow { flex: 1; min-width: 0; }
.etappe .grow b { display: block; font-family: var(--font-head); }
.etappe .grow small { display: block; color: var(--text-dim); }
.etappe-nr {
    flex: none; width: 26px; height: 26px; border-radius: 999px;
    display: grid; place-items: center; font-size: 12.5px; font-weight: 800;
    font-family: var(--font-head); background: var(--tint-2); color: var(--text-dim);
    border: 1px solid var(--line);
}
.etappe.done { opacity: .62; }
.etappe.done .etappe-nr { background: rgba(47,127,79,.2); border-color: rgba(47,127,79,.5); color: #1E5C37; }
.etappe.dran .etappe-nr { background: var(--bordeaux); border-color: var(--bordeaux); color: #fff; }
html[data-theme="dark"] .etappe.done .etappe-nr { color: #9EE0B8; }

/* Der Streifen ueber der laufenden Session: welche Etappe, und was danach kommt. */
.etappe-band { border-left: 3px solid var(--bordeaux); }

/* ---------------------------------------------------------------- Aktivitaeten */
/* Die Liste unter Community. Ein Eintrag ist ein Satz, kein Datensatz -
   deshalb steht der Name im Text und nicht als Ueberschrift darueber. */
.akt .grow b { font-family: var(--font-ui); font-size: 14px; }
/* Name und Skill stehen als <b> *im* Satz. Ohne dieses inline erben sie das
   display:block der Item-Regel, und aus einem Satz werden vier Zeilen. */
.akt .grow b b { display: inline; font-family: var(--font-head); font-weight: 700; }
/* Ein Weggang hat kein Gesicht mehr: Das Konto ist geloescht, der Name mit ihm. */
.akt.left { opacity: .7; }
.avatar.leer { background: var(--tint-2); color: var(--text-dim); border: 1px solid var(--line); }

/* ---------------------------------------------------------------- Auth + Onboarding */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(440px, 100%); text-align: center; }
.auth-card .orbit-logo { margin: 0 auto 14px; }
.slogan { font-family: var(--font-ui); font-size: 15px; color: var(--muted); margin-bottom: 22px; letter-spacing: .02em; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 18px; }
.auth-tabs .chip { flex: 1; text-align: center; }
.hint { font-size: 12.5px; color: var(--text-dim); margin-top: 14px; }

.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.steps i { flex: 1; height: 4px; border-radius: 999px; background: var(--tint-2); }
.steps i.on { background: var(--bordeaux); }

/* ---------------------------------------------------------------- Session */
.session { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; align-items: start; }
.wb-wrap { position: relative; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
/* Die Zeichenflaeche bleibt in beiden Ansichten dasselbe helle Papier. Sonst
   saehe ein dunkler Strich beim einen auf Weiss und beim anderen auf Braun aus -
   und beide zeichnen auf demselben Blatt. */
#whiteboard { width: 100%; display: block; touch-action: none; background: #F3EDE1; cursor: crosshair; }
.wb-tools { display: flex; gap: 8px; align-items: center; padding: 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
/* Der Ring um die gewaehlte Stiftfarbe muss sich von der Leiste abheben -
   ein helles Weiss taete das auf hellem Grund nicht. */
.swatch.on { border-color: var(--text); }

.video-box {
    position: relative; background: #1E1810; border: 1px solid var(--line); border-radius: var(--radius-sm);
    aspect-ratio: 16/10; display: grid; place-items: center; overflow: hidden;
}
.video-box video { width: 100%; height: 100%; object-fit: cover; }
.video-box video.pip {
    position: absolute; right: 8px; bottom: 8px; width: 32%; height: auto; aspect-ratio: 16/10;
    border-radius: 8px; border: 1px solid var(--line); box-shadow: var(--shadow-deep);
    transform: scaleX(-1); object-fit: cover; background: #1E1810;
}
/* Die Videoflaeche ist in beiden Ansichten fast schwarz - der Hinweis darauf
   braucht deshalb seine eigene helle Farbe und nicht die der Umgebung. */
.video-box .ph, .video-box .ph small {
    color: rgba(237, 227, 209, .72); font-size: 12.5px; text-align: center; padding: 14px;
}
.video-box .ph small { padding: 0; }
#rtc-hint { color: var(--text-dim); font-size: 12px; line-height: 1.45; }

.timer { font-family: var(--font-head); font-size: 34px; letter-spacing: .02em; }
.chat { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; }
.msg { padding: 8px 11px; border-radius: 12px; background: var(--tint-1); font-size: 14px; max-width: 88%; }
.msg.me { background: rgba(106,31,42,.28); align-self: flex-end; }
.msg b { display: block; font-size: 11px; color: var(--text-dim); font-family: var(--font-head); }

.task { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.task input { width: auto; }
.task.done span { text-decoration: line-through; color: var(--text-dim); }

/* ---------------------------------------------------------------- Toast + Modal */
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 90; }
.toast {
    background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--bordeaux);
    border-radius: var(--radius-sm); padding: 12px 16px; box-shadow: var(--shadow-deep); max-width: 340px;
    font-size: 14px; animation: pop .2s ease;
}
.toast.ok { border-left-color: var(--success); }
.toast.err { border-left-color: var(--error); }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }

.modal-bg { position: fixed; inset: 0; background: var(--scrim); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal { width: min(560px, 100%); max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-deep); }

/* ---------------------------------------------------------------- Mobile */
.mobilenav { display: none; }

/* Das "Mehr"-Blatt faehrt von unten ein: Bereiche, die nicht in die
   Leiste passen, dazu Sprache, Theme und Abmelden. */
.sheet-bg {
    position: fixed; inset: 0; background: var(--scrim); z-index: 100;
    display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
    width: min(560px, 100%); max-height: 82vh; overflow-y: auto;
    background: var(--panel-2); border: 1px solid var(--line); border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0; box-shadow: var(--shadow-deep);
    padding: 10px 14px calc(16px + env(safe-area-inset-bottom));
    animation: sheet-up .18s ease;
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } }
.sheet-grip {
    width: 42px; height: 4px; border-radius: 999px; background: var(--line);
    margin: 2px auto 12px;
}
.sheet-sep { border-top: 1px solid var(--line); margin: 10px 0; }
.sheet-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; padding: 6px 12px 10px;
}
.sheet .btn.block { margin-top: 10px; }

.topbar .who[data-go] { cursor: pointer; border-radius: var(--radius-sm); padding: 4px 6px; margin: -4px -6px; }
.topbar .who[data-go]:hover { background: var(--tint-1); }
.topbar .who[data-go]:focus-visible { outline: 2px solid var(--bordeaux-hover); outline-offset: 2px; }

/* Wer Bewegung abbestellt hat, bekommt keine. Vorher drehte sich der Orbit
   auch dann - die Ausnahme stand nur im Skript, nicht im Stylesheet. */
@media (prefers-reduced-motion: reduce) {
    .orbit-logo.dreht .spin, .orbit-logo.dreht .spin-rev { animation: none; }
    .kpi, .btn, .navlink, .card { transition: none; }
    .toast, .sheet { animation: none; }
}

/* Zwischen Seitenleiste und schmalem Fenster lag bisher nichts: Bis 900 Pixel
   quetschten sich drei Spalten neben die Leiste. */
@media (max-width: 1180px) {
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid.g3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
    .grid.split { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .sidebar { display: none; }
    .main { padding: 16px 14px 96px; }
    .grid.g3, .grid.g2 { grid-template-columns: 1fr; }
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .session { grid-template-columns: 1fr; }
    .mobilenav {
        display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
        background: var(--panel-2); border-top: 1px solid var(--line); padding: 8px 4px 10px;
        justify-content: space-around; backdrop-filter: blur(8px);
    }
    .mobilenav .navlink { flex-direction: column; gap: 3px; font-size: 10.5px; padding: 6px 8px; }
    .mobilenav .navlink .ic { width: 22px; height: 22px; }
    .mobilenav .navlink .dot { display: none; }
    .mobilenav .navlink .spacer { display: none; }
}

/* ---------------------------------------------------------------- Dokumente */
.doc-body { line-height: 1.65; }
.doc-body h2 { font-size: 22px; margin: 26px 0 10px; }
.doc-body h3 { font-size: 17px; margin: 22px 0 8px; }
.doc-body h4, .doc-body h5 { font-size: 15px; margin: 18px 0 6px; }
.doc-body h2:first-child, .doc-body h3:first-child { margin-top: 0; }
.doc-body p { color: var(--text); }
.doc-body ul, .doc-body ol { padding-left: 22px; margin: 8px 0 14px; }
.doc-body li { margin-bottom: 5px; }
.doc-body hr { border: none; border-top: 1px solid var(--line); margin: 22px 0; }
.doc-body code {
    background: var(--tint-1); padding: 2px 6px; border-radius: 5px;
    font-size: 13px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}
.doc-body pre {
    background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 12px 14px; overflow-x: auto;
}
.doc-body pre code { background: none; padding: 0; }
.doc-body blockquote {
    border-left: 3px solid var(--bordeaux); padding: 6px 14px; margin: 12px 0;
    background: rgba(106, 31, 42, .10); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.doc-table { overflow-x: auto; margin: 12px 0 18px; }
.doc-body table { border-collapse: collapse; width: 100%; font-size: 14px; }
.doc-body th, .doc-body td {
    border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top;
}
.doc-body th { background: var(--tint-1); font-family: var(--font-head); }
.doc-body a { color: var(--bordeaux); }
html[data-theme="dark"] .doc-body a { color: var(--bordeaux-hover); }
