/* Momo Zeitleiste - rechtes Panel
 *
 * WARUM EINE GRID-SPALTE UND KEIN UEBERLAGE: das Panel ist aufgeklappt die Vorgabe.
 * Ein fest liegendes Panel (wie .artifact-panel) wuerde den Chat dauerhaft verdecken,
 * und man muesste es zuerst zuklappen, um zu arbeiten. Als dritte Spalte im Raster
 * rueckt der Chat stattdessen zur Seite - beides ist gleichzeitig benutzbar.
 * Erst auf schmalen Schirmen wird daraus ein Ueberlage, weil dort keine Spalte
 * mehr hineinpasst.
 */
:root{ --timeline:336px }

body.timeline-open .app{ grid-template-columns:var(--sidebar) minmax(0,1fr) var(--timeline) }

.timeline-panel{
  min-width:0;
  display:none;
  grid-template-rows:auto minmax(0,1fr) auto;
  height:100dvh;
  border-left:1px solid rgba(255,255,255,.10);
  background:#0a0a0a;
}
body.timeline-open .timeline-panel{ display:grid }

/* --- Kopf */
.timeline-head{
  padding:13px 14px 10px;
  border-bottom:1px solid rgba(255,255,255,.08);
  background:#0c0c0c;
}
.timeline-title{ display:flex; align-items:center; gap:10px }
.timeline-title strong{ font-size:11px; font-weight:500; letter-spacing:.01em }
.timeline-presence{
  margin-left:auto;
  display:inline-flex; align-items:center; gap:5px;
  color:#606060; font-size:8px; text-transform:uppercase; letter-spacing:.12em; white-space:nowrap;
}
.timeline-presence .dot{ width:5px; height:5px; border-radius:50%; background:#3a3a3a }
.timeline-presence.live .dot{ background:#5bd16b; box-shadow:0 0 6px rgba(91,209,107,.6) }

/* Der Schliessen-Knopf im Panel selbst. Angedockt braucht es ihn nicht - dort
 * steht der Kopfknopf frei sichtbar daneben. Als Ueberlage schon: da liegt das
 * Panel ueber der Kopfzeile, und ohne diesen Knopf ist es nicht mehr zuzukriegen.
 * Genau das ist auf dem Handy passiert. */
.timeline-close{
  display:none; width:24px; height:24px; flex:0 0 auto;
  place-items:center; border:1px solid rgba(255,255,255,.12); border-radius:7px;
  background:transparent; color:#b4b4b4; font-size:15px; line-height:1;
}
.timeline-close:hover{ color:#fff; border-color:rgba(255,255,255,.28) }

/* Schleier hinter der Ueberlage: tippt man daneben, geht das Panel zu. */
.timeline-backdrop{ display:none }

.timeline-filters{ display:flex; flex-wrap:wrap; gap:5px; margin-top:10px }
.timeline-chip{
  padding:3px 8px; border:1px solid rgba(255,255,255,.10); border-radius:999px;
  background:transparent; color:#7a7a7a; font-size:8.5px; letter-spacing:.06em;
  text-transform:uppercase; transition:.15s ease;
}
.timeline-chip:hover{ color:#c8c8c8; border-color:rgba(255,255,255,.2) }
.timeline-chip.active{ color:#111; background:#e8e8e8; border-color:#e8e8e8 }

/* --- Strom
 * Neuestes unten, wie in einem Gespraech; nach oben laedt es Aelteres nach.
 *
 * NICHT mit flex-direction:column-reverse. Das haelt den Rollbalken zwar von
 * selbst unten, aber scrollTop zaehlt dann je nach Browser von unten und teils
 * negativ - und damit wird "bin ich unten?" und "halte die Stelle beim
 * Nachladen" unzuverlaessig. Beides macht timeline.js stattdessen von Hand,
 * mit gewoehnlicher Richtung: berechenbar in jedem Browser. */
.timeline-feed{
  overflow-y:auto; overflow-x:hidden;
  display:flex; flex-direction:column;
  padding:12px 12px 14px;
  scrollbar-width:thin; overscroll-behavior:contain;
}
.timeline-items{ display:flex; flex-direction:column; gap:8px }
/* Wenig Inhalt soll UNTEN stehen, nicht oben: das Neueste liegt am unteren Rand,
 * dort kommt auch das Naechste an. Der automatische Aussenabstand am ersten Kind
 * schiebt beide Teile nach unten - anders als justify-content:flex-end, das in
 * einem Rollkasten den oberen Teil abschneidet, sobald es doch ueberlaeuft. */
.timeline-aelter{ margin-top:auto }

.timeline-eintrag{
  padding:9px 10px;
  border:1px solid rgba(255,255,255,.07);
  border-radius:10px;
  background:#101010;
  animation:timeline-auf .2s ease;
}
@keyframes timeline-auf{ from{opacity:0;transform:translateY(4px)} to{opacity:1;transform:none} }
.timeline-eintrag .kopf{ display:flex; align-items:center; gap:6px; margin-bottom:5px }
.timeline-eintrag .marke{
  padding:1px 5px; border-radius:4px; font-size:7.5px; letter-spacing:.11em;
  text-transform:uppercase; border:1px solid currentColor; opacity:.85;
}
.timeline-eintrag .wer{ font-size:9px; color:#b4b4b4; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.timeline-eintrag .zeit{ margin-left:auto; font-size:8px; color:#4c4c4c; white-space:nowrap }
.timeline-eintrag .text{ font-size:10.5px; line-height:1.5; color:#d2d2d2; overflow-wrap:anywhere }
.timeline-eintrag .fuss{ margin-top:6px; display:flex; gap:8px; align-items:center }
.timeline-eintrag .fuss a{ font-size:8.5px; color:#6f6f6f; text-decoration:none; border-bottom:1px solid rgba(255,255,255,.14) }
.timeline-eintrag .fuss a:hover{ color:#ddd }
.timeline-eintrag .fuss .nurhier{ font-size:8px; color:#4a4a4a; letter-spacing:.08em; text-transform:uppercase }

.timeline-eintrag[data-art="room"]    .marke{ color:#7aa2f7 }
.timeline-eintrag[data-art="news"]    .marke{ color:#c3a06a }
.timeline-eintrag[data-art="empfehlung"] .marke{ color:#7fc8a9 }
.timeline-eintrag[data-art="suggests"]  .marke{ color:#c98fc0 }
.timeline-eintrag[data-art="momo"]{ border-color:rgba(255,255,255,.14); background:#131313 }
.timeline-eintrag[data-art="momo"] .marke{ color:#e0e0e0 }

/* --- Zustaende */
.timeline-feed.ist-leer .timeline-items{ margin:auto 0 }
.timeline-lade, .timeline-leer{
  padding:14px 4px; text-align:center; color:#555; font-size:9px; line-height:1.6;
}
.timeline-leer b{ display:block; color:#8a8a8a; font-size:10px; font-weight:500; margin-bottom:4px }
.timeline-aelter{ display:flex; justify-content:center; padding:8px 0 4px }
.timeline-aelter button{
  padding:3px 10px; border:1px solid rgba(255,255,255,.12); border-radius:999px;
  background:transparent; color:#6a6a6a; font-size:8.5px; letter-spacing:.08em; text-transform:uppercase;
}
.timeline-aelter button:hover{ color:#ccc }
.timeline-ende{ text-align:center; color:#3c3c3c; font-size:8px; letter-spacing:.12em;
  text-transform:uppercase; padding:10px 0 4px }

/* --- Fuss: Hinweis, woher die Eintraege kommen. Steht da, damit niemand
 *     lokale Eintraege fuer den globalen Strom haelt. */
.timeline-foot{
  padding:7px 12px; border-top:1px solid rgba(255,255,255,.08);
  color:#4a4a4a; font-size:8px; letter-spacing:.06em;
  display:flex; align-items:center; justify-content:space-between; gap:8px;
}
.timeline-foot button{ background:none; border:0; color:#6a6a6a; font-size:8px; letter-spacing:.06em }
.timeline-foot button:hover{ color:#ccc }

/* --- «neu» Knopf, wenn unten nicht sichtbar ist */
.timeline-neu{
  position:absolute; left:50%; bottom:58px; transform:translateX(-50%) translateY(8px);
  z-index:5; padding:4px 11px; border-radius:999px; border:1px solid rgba(255,255,255,.14);
  background:#2b2b2b; color:#eee; font-size:8.5px; letter-spacing:.08em; text-transform:uppercase;
  opacity:0; pointer-events:none; transition:.18s ease;
}
.timeline-neu.show{ opacity:1; pointer-events:auto; transform:translateX(-50%) translateY(0) }
.timeline-panel{ position:relative }

/* --- Kopfknopf */
#timelineToggleBtn.active{ background:rgba(255,255,255,.1) }

/* --- schmal: Ueberlage statt Spalte */
@media(max-width:1100px){
  body.timeline-open .app{ grid-template-columns:var(--sidebar) minmax(0,1fr) }
  .timeline-panel{
    position:fixed; top:0; right:0; bottom:0; z-index:260;
    width:min(340px,92vw); box-shadow:-28px 0 80px rgba(0,0,0,.5);
  }
  .timeline-close{ display:grid }
  body.timeline-open .timeline-backdrop{
    display:block; position:fixed; inset:0; z-index:259;
    background:rgba(0,0,0,.55); backdrop-filter:blur(3px);
  }
}
@media(max-width:720px){
  .timeline-panel{ width:100vw }
  /* Bei voller Breite ist vom Schleier nichts zu sehen und nichts danebenzutippen -
     das Weichzeichnen ueber den ganzen Schirm kostet dann nur Rechenzeit. */
  body.timeline-open .timeline-backdrop{ display:none }
}


/* --- Helles Thema
 * Die Werte oben sind fuer die dunkle Flaeche geschrieben. Ohne diesen Block
 * bliebe das Panel im Tag-Thema ein schwarzer Balken neben einer weissen App.
 * Genommen werden dieselben Grundwerte wie im uebrigen hellen Thema
 * (momo/theme-light.css), damit es nicht daneben liegt. */
:root[data-theme="light"] .timeline-panel{ background:var(--bg,#fbfbfc); border-left-color:var(--line,rgba(17,20,26,.14)) }
:root[data-theme="light"] .timeline-head{ background:var(--panel,#fff); border-bottom-color:var(--line,rgba(17,20,26,.14)) }
:root[data-theme="light"] .timeline-title strong{ color:var(--text,#14161a) }
:root[data-theme="light"] .timeline-presence{ color:var(--dim,#8b9099) }
:root[data-theme="light"] .timeline-presence .dot{ background:#c5c8cc }
:root[data-theme="light"] .timeline-presence.live .dot{ background:#2f9e44; box-shadow:0 0 6px rgba(47,158,68,.45) }
:root[data-theme="light"] .timeline-chip{ border-color:var(--line,rgba(17,20,26,.14)); color:var(--muted,#5b6068) }
:root[data-theme="light"] .timeline-chip:hover{ color:var(--text,#14161a); border-color:rgba(17,20,26,.3) }
:root[data-theme="light"] .timeline-chip.active{ background:#14161a; border-color:#14161a; color:#fff }
:root[data-theme="light"] .timeline-eintrag{ background:var(--panel,#fff); border-color:var(--line,rgba(17,20,26,.14)) }
:root[data-theme="light"] .timeline-eintrag[data-art="momo"]{ background:var(--panel-2,#f3f4f6); border-color:rgba(17,20,26,.22) }
:root[data-theme="light"] .timeline-eintrag[data-art="momo"] .marke{ color:#14161a }
:root[data-theme="light"] .timeline-eintrag[data-art="room"] .marke{ color:#2f5fd0 }
:root[data-theme="light"] .timeline-eintrag[data-art="news"] .marke{ color:#8a6320 }
:root[data-theme="light"] .timeline-eintrag[data-art="empfehlung"] .marke{ color:#1f7a57 }
:root[data-theme="light"] .timeline-eintrag[data-art="suggests"] .marke{ color:#8f4f86 }
:root[data-theme="light"] .timeline-eintrag .wer{ color:var(--muted,#5b6068) }
:root[data-theme="light"] .timeline-eintrag .zeit{ color:var(--dim,#8b9099) }
:root[data-theme="light"] .timeline-eintrag .text{ color:var(--text,#14161a) }
:root[data-theme="light"] .timeline-eintrag .fuss a{ color:var(--muted,#5b6068); border-bottom-color:rgba(17,20,26,.2) }
:root[data-theme="light"] .timeline-eintrag .fuss a:hover{ color:var(--text,#14161a) }
:root[data-theme="light"] .timeline-eintrag .fuss .nurhier{ color:var(--dim,#8b9099) }
:root[data-theme="light"] .timeline-lade,
:root[data-theme="light"] .timeline-leer{ color:var(--dim,#8b9099) }
:root[data-theme="light"] .timeline-leer b{ color:var(--muted,#5b6068) }
:root[data-theme="light"] .timeline-aelter button{ border-color:var(--line,rgba(17,20,26,.14)); color:var(--muted,#5b6068) }
:root[data-theme="light"] .timeline-aelter button:hover{ color:var(--text,#14161a) }
:root[data-theme="light"] .timeline-ende{ color:var(--dim,#8b9099) }
:root[data-theme="light"] .timeline-foot{ border-top-color:var(--line,rgba(17,20,26,.14)); color:var(--dim,#8b9099) }
:root[data-theme="light"] .timeline-foot button{ color:var(--muted,#5b6068) }
:root[data-theme="light"] .timeline-foot button:hover{ color:var(--text,#14161a) }
:root[data-theme="light"] .timeline-neu{ background:#14161a; color:#fff; border-color:#14161a }
:root[data-theme="light"] #timelineToggleBtn.active{ background:rgba(17,20,26,.08) }
:root[data-theme="light"] .timeline-close{ border-color:var(--line,rgba(17,20,26,.14)); color:var(--muted,#5b6068) }
:root[data-theme="light"] .timeline-close:hover{ color:var(--text,#14161a); border-color:rgba(17,20,26,.3) }

/* --- Griff: Breite der Spalte ziehen (280–900 px, wird gemerkt)
   Achtung: KEIN position:relative mehr hier — die Regel ueberschrieb auf
   schmalen Schirmen position:fixed aus dem Media-Block oben, und das Panel
   landete ausserhalb des Schirms (Fehler vom 20.10.). position:relative
   kommt nur noch aus dem Block weiter oben. */
#timelineHandle{ position:absolute; left:-6px; top:0; bottom:0; width:12px; cursor:ew-resize; z-index:30; touch-action:none }
#timelineHandle:hover{ background:linear-gradient(to right, transparent 40%, rgba(255,255,255,.14) 50%, transparent 60%) }

/* --- Vollbild: das Panel deckt die ganze App, Chat und Seitenleiste weg */
body.timeline-full .app{ grid-template-columns:0 0 100vw }
body.timeline-full .timeline-panel{ height:100dvh }
/* Die Null-Spalten dürfen nichts durchbluten: sonst sehen Kopfzeile und
   Rail-Logo wie Grafikfehler aus (Fehler vom 20.10.). */
body.timeline-full .sidebar,
body.timeline-full .sidebar-rail,
body.timeline-full .main{ visibility:hidden; overflow:hidden; min-width:0 }
.timeline-full{ display:none; width:24px; height:24px; flex:0 0 auto; place-items:center;
  border:1px solid rgba(255,255,255,.12); border-radius:7px; background:transparent; color:#b4b4b4; font-size:13px; line-height:1 }
.timeline-full:hover{ color:#fff; border-color:rgba(255,255,255,.28) }
@media(min-width:1101px){ .timeline-full{ display:grid } }
body.timeline-full #timelineHandle{ display:none }

/* --- Vorschau-Modus: Apps, Games, Websites, Shops spielbar im Panel */
.timeline-vorschau{ display:flex; flex-direction:column; min-height:0; grid-row:2 }
.timeline-vorschau[hidden]{ display:none }
.timeline-panel.zeigt-vorschau .timeline-feed,
.timeline-panel.zeigt-vorschau .timeline-foot,
.timeline-panel.zeigt-vorschau .timeline-neu{ display:none }
.timeline-vorschau-leiste{ display:flex; align-items:center; gap:8px; padding:8px 12px;
  border-bottom:1px solid rgba(255,255,255,.08); background:#0c0c0c }
.timeline-vorschau-leiste strong{ font-size:11px; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:40% }
.timeline-vorschau-url{ flex:1; min-width:0; color:#606060; font-size:9px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.timeline-vorschau-leiste button{ padding:3px 8px; border:1px solid rgba(255,255,255,.12); border-radius:7px;
  background:transparent; color:#b4b4b4; font-size:10px; cursor:pointer }
.timeline-vorschau-leiste button:hover{ color:#fff; border-color:rgba(255,255,255,.28) }
#timelineVorschauFrame{ flex:1; width:100%; border:none; background:#fff; min-height:0 }
.timeline-vorschau-hinweis{ padding:8px 12px; color:#f5b942; font-size:10px; border-top:1px solid rgba(255,255,255,.08) }
.timeline-vorschau-hinweis.hidden{ display:none }

/* --- Fortschritt: Kimi-artige Aufgaben-Uebersicht laufender Momo-Arbeit --- */
.timeline-fortschritt{ padding:10px 12px 0; flex:0 0 auto }
.timeline-fortschritt[hidden]{ display:none }
.timeline-fortschritt-gruppe{ border:1px solid rgba(255,255,255,.09); border-radius:16px;
  padding:12px 14px; background:rgba(255,255,255,.025); margin-bottom:10px }
.timeline-fortschritt-titel{ font-size:12px; font-weight:600; letter-spacing:.02em; margin-bottom:8px }
.timeline-fortschritt-liste{ display:grid; gap:2px }
.timeline-fortschritt-eintrag{ display:flex; align-items:center; gap:10px;
  padding:5px 8px; border-radius:10px; font-size:12.5px; line-height:1.35; color:#c9c9c9 }
.timeline-fortschritt-eintrag.laeuft{ background:rgba(255,255,255,.045); color:#ececec }
.timeline-fortschritt-eintrag.fertig{ color:#8a8a8a }
.timeline-fortschritt-haken{ flex:0 0 20px; width:20px; height:20px; border-radius:50%;
  display:grid; place-items:center; font-size:11px; font-weight:700;
  border:1px solid rgba(255,255,255,.16); color:transparent }
.timeline-fortschritt-eintrag.fertig .timeline-fortschritt-haken{ background:#3ecf8e; border-color:#3ecf8e; color:#08130c }
.timeline-fortschritt-eintrag.laeuft .timeline-fortschritt-haken{ border-color:rgba(255,255,255,.4);
  animation:momoFortschrittPuls 1.6s ease-in-out infinite }
.timeline-fortschritt-eintrag.fertig .timeline-fortschritt-text{ text-decoration:line-through; text-decoration-thickness:1px }
.timeline-fortschritt-text{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.timeline-fortschritt-erledigt-titel{ margin:10px 0 4px; padding-top:8px;
  border-top:1px dashed rgba(255,255,255,.1); font-size:10px; text-transform:uppercase;
  letter-spacing:.06em; color:#7a7a7a }
.timeline-fortschritt-erledigt-titel[hidden]{ display:none }
@keyframes momoFortschrittPuls{ 0%,100%{opacity:1} 50%{opacity:.35} }
