/* ═══════════════════════════════════════════════════════════════════════════
   SchlossLimo Organizer — Oberfläche im Markendesign von schlosslimo.de
   Grundlage: design-system/tokens.css + BRAND_GUIDE.md der Hauptseite.

   Drei Prinzipien, aus denen hier alles folgt:
     1. Papier statt Bildschirm — Creme-Grund, nie reines Weiß.
     2. Linien statt Kästen — 1-px-Haarlinien, keine Schatten, keine Radien.
     3. Ein Signal pro Fläche — Grün ist Aussage, kein Dekor.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── 1. TOKENS ─────────────────────────────────────────────────────────── */

:root {
  /* Flächen */
  --paper:        #F4F1EA;
  --paper-2:      #EAE5D9;
  --deep:         #0A0C0A;
  --deep-2:       #141814;

  /* Tinte
     --ink-3 weicht bewusst vom Marken-Grauton #8A8E82 ab: der erreicht auf
     Creme nur 3.0:1 und trägt hier die Meta-Zeilen in 10-px-Versalmono.
     #63675C ist derselbe Farbton bei 5.1:1 — WCAG AA auch für Kleinschrift. */
  --ink:          #101210;
  --ink-2:        #40443C;
  --ink-3:        #63675C;

  /* Signal — die leuchtenden Werte sind Flächen- und Rahmenfarben,
     die -ink-Werte sind für Text auf Creme (jeweils ≥ 4.5:1). */
  --fresh:        #0F9D58;
  --fresh-ink:    #0A7C43;
  --fresh-lum:    #35F08C;
  --spoiled:      #D93A22;
  --spoiled-ink:  #C4321A;
  --spoiled-lum:  #FF5A3C;
  --amber:        #9A4708;
  --amber-lum:    #FFB454;

  /* Signalflächen — leise Tönung hinter Warnungen, damit sie als Fläche
     gelesen werden und nicht nur als andersfarbige Zeile. */
  --tint-spoil:   #F6E9E2;
  --tint-amber:   #F5ECDE;
  --tint-fresh:   #E8F0E6;

  /* Linien */
  --rule:         rgba(16, 18, 16, .20);
  --rule-strong:  rgba(16, 18, 16, .40);
  --rule-inv:     rgba(244, 241, 234, .22);
  --rule-inv-str: rgba(244, 241, 234, .44);

  /* Schrift */
  --display: 'Cabinet Grotesk', 'Outfit', system-ui, sans-serif;
  --body:    'General Sans', 'Inter', system-ui, sans-serif;
  --mono:    'Red Hat Mono', ui-monospace, 'SFMono-Regular', monospace;

  --ls-mono: .1em;

  /* Raster — Buttons und Chips sind rund, alles andere kantig. */
  --radius-pill: 999px;
  --radius-box: 0;

  /* Bewegung */
  --ease:    cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, .05, .36, 1);
  --dur-fast: .25s;
  --dur-base: .45s;

  /* Semantik — wird auf dunklen Flächen umgehängt */
  --bg:        var(--paper);
  --bg-2:      var(--paper-2);
  --fg:        var(--ink);
  --fg-2:      var(--ink-2);
  --fg-3:      var(--ink-3);
  --line:      var(--rule);
  --line-str:  var(--rule-strong);
  --sig-fresh: var(--fresh);
  --sig-spoil: var(--spoiled);
  /* Textvarianten der Signale — überall dort, wo Farbe gelesen wird. */
  --sig-fresh-ink: var(--fresh-ink);
  --sig-spoil-ink: var(--spoiled-ink);
  --sig-warn:      var(--amber);
  --sig-warn-bg:   var(--tint-amber);
  --sig-spoil-bg:  var(--tint-spoil);
  --sig-fresh-bg:  var(--tint-fresh);

  /* Aliasse: einige Ansichten setzen diese Namen noch inline im HTML. */
  --text:       var(--fg);
  --text-muted: var(--fg-3);
  --border:     var(--line);
  --border-strong: var(--line-str);
  --accent:     var(--sig-fresh-ink);
  --danger:     var(--sig-spoil-ink);
  --warning:    var(--sig-warn);
  --bg-elevated: var(--paper-2);
  --radius:     0;
  --radius-sm:  0;
  --font-display: var(--display);
}

/* Dunkle Flächen (Seitenleiste, Splash) erben invertierte Semantik. */
.theme-deep {
  --bg:        var(--deep);
  --bg-2:      var(--deep-2);
  --fg:        var(--paper);
  /* Auf Tiefschwarz war .68/.44 zu schwach — .82/.64 halten die Hierarchie
     und bringen die dritte Stufe von 4.0:1 auf 7.4:1. */
  --fg-2:      rgba(244, 241, 234, .82);
  --fg-3:      rgba(244, 241, 234, .64);
  --line:      var(--rule-inv);
  --line-str:  var(--rule-inv-str);
  --sig-fresh: var(--fresh-lum);
  --sig-spoil: var(--spoiled-lum);
  --sig-fresh-ink: var(--fresh-lum);
  --sig-spoil-ink: var(--spoiled-lum);
  --sig-warn:      var(--amber-lum);
  --sig-warn-bg:   rgba(255, 180, 84, .14);
  --sig-spoil-bg:  rgba(255, 90, 60, .14);
  --sig-fresh-bg:  rgba(53, 240, 140, .12);

  --text:       var(--fg);
  --text-muted: var(--fg-3);
  --border:     var(--line);
  --border-strong: var(--line-str);
  --accent:     var(--sig-fresh);
  --danger:     var(--sig-spoil);
  --warning:    var(--sig-warn);
  --bg-elevated: var(--bg-2);
}

/* ─── 2. RESET & GRUNDLAGEN ─────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--rule-strong) transparent;
  scrollbar-width: thin;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rule-strong); border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); background-clip: padding-box; }

::selection { background: var(--ink); color: var(--paper); }
.theme-deep ::selection { background: var(--fresh-lum); color: var(--deep); }

#app { min-height: 100vh; display: flex; flex-direction: column; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.04;
  text-wrap: balance;
}

a { color: inherit; text-decoration: none; }

/* Textlink mit Unterstrich-Sweep — das Linkverhalten der Hauptseite. */
.markdown-body a, .attachment-row a, .breadcrumb-link {
  position: relative;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1px;
  background-position: 100% 100%;
  background-repeat: no-repeat;
  transition: background-size .4s var(--ease), color var(--dur-fast) var(--ease);
}
.markdown-body a:hover, .attachment-row a:hover, .breadcrumb-link:hover {
  background-size: 100% 1px;
  background-position: 0 100%;
}

/* Nur eine Bewegung im Haus: 12 px von unten, weich herein. */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

.boot-loading {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  height: 100vh;
  font-family: var(--mono); font-size: .72rem;
  letter-spacing: var(--ls-mono); text-transform: uppercase;
  color: var(--fg-3);
}
.boot-loading::before {
  content: ''; width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid var(--line-str); border-top-color: var(--sig-fresh);
  animation: spin .8s linear infinite;
}

/* Versal-Mono-Zeile mit Strich — stärkstes Wiedererkennungsmerkmal. */
.eyebrow {
  display: flex; align-items: center; gap: .7rem;
  font-family: var(--mono);
  font-size: .74rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.eyebrow::before {
  content: ''; width: 1.8rem; height: 1px;
  background: currentColor; opacity: .55; flex: none;
}
.eyebrow--signal { color: var(--sig-fresh-ink); }

/* ─── 3. BUTTONS ────────────────────────────────────────────────────────── */

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  cursor: pointer;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line-str);
  border-radius: var(--radius-pill);
  padding: .5rem 1.15rem;
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  transition: color var(--dur-base) var(--ease), border-color var(--dur-fast) var(--ease);
}

/* Füllung wischt von unten ein — nie currentColor, sonst verschwindet sie. */
button::before {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background: var(--fg);
  transform: translateY(101%);
  transition: transform var(--dur-base) var(--ease);
}
button:hover::before { transform: translateY(0); }
button:hover { color: var(--bg); border-color: var(--fg); }

button.primary {
  background: var(--sig-fresh);
  border-color: var(--sig-fresh);
  color: #06210F;
}
button.primary::before { background: var(--fg); }
button.primary:hover { color: var(--bg); border-color: var(--fg); }

button.danger { color: var(--sig-spoil-ink); border-color: color-mix(in srgb, var(--sig-spoil) 45%, transparent); }
button.danger::before { background: var(--sig-spoil); }
button.danger:hover { color: var(--paper); border-color: var(--sig-spoil); }

button.ghost {
  border-color: transparent;
  color: var(--fg-2);
  padding: .35rem .7rem;
}
button.ghost::before { background: var(--bg-2); }
button.ghost:hover { color: var(--fg); border-color: transparent; }
.theme-deep button.ghost::before { background: rgba(244, 241, 234, .1); }
.theme-deep button.ghost:hover { color: var(--fg); }
button.ghost.danger { color: var(--sig-spoil-ink); }
button.ghost.danger::before { background: color-mix(in srgb, var(--sig-spoil) 14%, transparent); }
button.ghost.danger:hover { color: var(--sig-spoil-ink); }

button:disabled { opacity: .5; cursor: not-allowed; }
button:disabled::before { transform: translateY(101%); }

:focus-visible {
  outline: 2px solid var(--sig-fresh);
  outline-offset: 3px;
}
button:focus-visible, a:focus-visible, .nav-link:focus-visible, .folder-item:focus-visible {
  outline: 2px solid var(--sig-fresh);
  outline-offset: 3px;
}

/* ─── 4. FORMULARE ──────────────────────────────────────────────────────── */

input, select, textarea {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-str);
  border-radius: 0;
  padding: .55rem 0;
  width: 100%;
  color: var(--fg);
  transition: border-color var(--dur-fast) var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--fg-3); }
input:hover, select:hover, textarea:hover { border-bottom-color: var(--fg-3); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-bottom-color: var(--sig-fresh);
}
input[type=checkbox], input[type=radio] {
  width: auto;
  accent-color: var(--sig-fresh);
  border: 0;
}
input[type=file] { border-bottom: 0; padding-left: 0; }
select {
  appearance: none;
  padding-right: 1.4rem;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 9px) center, calc(100% - 4px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

label {
  display: block;
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: .4rem;
}
.field { margin-bottom: 1.15rem; }

/* ─── 5. ANMELDUNG ──────────────────────────────────────────────────────── */

.login-screen {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(1.25rem, 5vw, 4rem);
  background: var(--paper);
}
.login-card {
  width: 100%; max-width: 420px;
  background: var(--paper);
  border-top: 1px solid var(--rule-strong);
  padding-top: 2.2rem;
  animation: riseIn .7s var(--ease) both;
}
.login-card .eyebrow { margin-bottom: 1.4rem; }
.login-card h1 {
  margin: 0 0 .6rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  letter-spacing: -.035em;
  line-height: .95;
}
.login-card .brand-accent { color: var(--fresh-ink); }
.login-card p.sub {
  margin: 0 0 2.4rem;
  color: var(--ink-2);
  font-size: 1rem;
  max-width: 34ch;
}
.login-card button[type=submit] { width: 100%; padding-block: .85rem; margin-top: .5rem; }

.error-banner, .success-banner {
  border-left: 2px solid currentColor;
  padding: .7rem 0 .7rem .9rem;
  margin-bottom: 1rem;
  font-size: .88rem;
}
.error-banner { color: var(--sig-spoil-ink); }
.success-banner { color: var(--sig-fresh-ink); }

/* ─── 6. APP-GERÜST ─────────────────────────────────────────────────────── */

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

.sidebar {
  width: 244px; flex-shrink: 0;
  background: var(--deep);
  color: var(--paper);
  border-right: 1px solid var(--rule-inv);
  display: flex; flex-direction: column;
  padding: 1.9rem 1.25rem 1.25rem;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand {
  display: flex; align-items: center; gap: .65rem;
  font-family: var(--display);
  font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em;
  padding: 0 .25rem 2.4rem;
}
.sidebar .brand .accent { color: var(--fresh-lum); }
.brand-mark { width: 24px; height: 24px; flex: none; }
.brand-mark .arc { stroke: currentColor; }
.brand-mark .sig { fill: var(--fresh-lum); }
.brand-mark .sig-stroke { stroke: var(--fresh-lum); }

.nav-link {
  position: relative;
  display: flex; align-items: center; gap: .8rem;
  padding: .62rem .25rem;
  color: rgba(244, 241, 234, .62);
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--rule-inv);
  transition: color var(--dur-fast) var(--ease), padding-left var(--dur-base) var(--ease);
}
.nav-link:first-child { border-top: 1px solid var(--rule-inv-str); }
.nav-link .nav-icon { font-size: .8rem; opacity: .6; transition: opacity var(--dur-fast) var(--ease); }
.nav-link:hover { color: var(--paper); padding-left: .6rem; }
.nav-link:hover .nav-icon { opacity: 1; }
.nav-link.active { color: var(--paper); }
.nav-link.active .nav-icon { color: var(--fresh-lum); opacity: 1; }
.nav-link.active::before {
  content: ''; position: absolute; left: -1.25rem; top: 50%; transform: translateY(-50%);
  width: 3px; height: 1.05rem; background: var(--fresh-lum);
}

.sidebar-footer { margin-top: auto; padding-top: 1.1rem; border-top: 1px solid var(--rule-inv-str); }
.user-chip {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .25rem;
  font-family: var(--mono); font-size: .74rem;
  letter-spacing: .1em; text-transform: uppercase;
  color: rgba(244, 241, 234, .68);
}
.avatar-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--fresh);
}
.sidebar-footer button {
  width: 100%; margin-top: .6rem;
  color: rgba(244, 241, 234, .68);
  border-color: var(--rule-inv-str);
}
.sidebar-footer button::before { background: var(--paper); }
.sidebar-footer button:hover { color: var(--deep); border-color: var(--paper); }

.main-content {
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(1.6rem, 3.5vw, 3.2rem) clamp(1.25rem, 4vw, 3.6rem) 5rem;
}
.mobile-topbar { display: none; }

/* Kopf einer Ansicht: Eyebrow über der Displayzeile, Aktionen rechts daneben.
   Bewusst ohne Trennlinie — die erste Fläche darunter bringt ihre eigene,
   zwei Linien im Abstand von 30 px lesen sich wie ein Fehler. */
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
  margin-bottom: 1.8rem;
  animation: riseIn .6s var(--ease) both;
}
.page-header h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.9rem, 3.4vw, 2.9rem);
  letter-spacing: -.035em;
  line-height: .96;
}
/* Aktionsleiste rechts liegt nebeneinander, der Titelblock stapelt. */
.page-header > div { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.page-header > div:has(h1) { display: block; }
.page-header .eyebrow { margin-bottom: .8rem; }

/* ─── 7. FLÄCHEN, KENNZAHLEN, MARKER ────────────────────────────────────── */

/* Es gibt keine Karten mehr — es gibt Felder, getrennt durch Haarlinien. */
.card {
  position: relative;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--rule-strong);
  border-radius: 0;
  padding: 1.5rem 0 1.7rem;
  animation: riseIn .6s var(--ease) both;
}
.card h3 {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.015em;
  margin: 0 0 1rem;
}

.grid { display: grid; gap: 0 clamp(1.5rem, 3vw, 3rem); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid > .card:nth-child(1) { animation-delay: .02s; }
.grid > .card:nth-child(2) { animation-delay: .1s; }
.grid > .card:nth-child(3) { animation-delay: .18s; }
.grid > .card:nth-child(4) { animation-delay: .26s; }
@media (max-width: 900px) {
  .grid-cols-3, .grid-cols-2 { grid-template-columns: 1fr; }
}

.stat-value {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 3.4vw, 3rem);
  letter-spacing: -.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin-top: .5rem;
}
.stat-label {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--fg-3);
}
/* Versalmono trägt Kennzeichnungen, keine Sätze. Wo .stat-label auf einem
   Fließtext-Element sitzt (immer ein ganzer Erklärsatz), fällt sie auf die
   Textschrift zurück — Großbuchstaben ohne Oberlängen sind über eine Zeile
   hinaus kaum noch zu lesen. */
p.stat-label, small.stat-label {
  font-family: var(--body);
  font-size: .84rem;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.55;
  color: var(--fg-2);
}
small.stat-label { display: block; }

.progress-bar {
  height: 2px;
  background: var(--line);
  overflow: hidden;
  margin-top: .9rem;
}
.progress-bar-fill {
  height: 100%;
  background: var(--sig-fresh);
  transition: width .9s var(--ease);
}

/* Zustandsmarker: Mono-Versalien mit Punkt, immer mit Textlabel. */
.badge {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .18rem .6rem .18rem .5rem;
  border: 1px solid var(--line-str);
  border-radius: var(--radius-pill);
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-2);
  white-space: nowrap;
}
.badge::before {
  content: ''; width: .38rem; height: .38rem; border-radius: 50%;
  background: currentColor; flex: none;
}
.badge-high { color: var(--sig-spoil-ink); border-color: color-mix(in srgb, var(--sig-spoil) 45%, transparent); }
.badge-medium { color: var(--fg-2); border-color: var(--line-str); }
.badge-low { color: var(--sig-fresh-ink); border-color: color-mix(in srgb, var(--sig-fresh) 45%, transparent); }
.badge-cat { color: var(--fg-3); border-color: var(--line); }
.badge-cat::before { display: none; }

/* Fristzustände in den Meta-Zeilen. Überfällig bekommt eine eigene Fläche —
   das ist die eine Information, die man im Überfliegen finden muss. */
.pill-overdue {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .16rem .55rem;
  border-radius: var(--radius-pill);
  background: var(--sig-spoil-bg);
  border: 1px solid color-mix(in srgb, var(--sig-spoil) 50%, transparent);
  color: var(--sig-spoil-ink);
  font-weight: 700;
}
.pill-overdue::before { content: '⚠'; font-size: .9em; }
/* „Läuft bald ab" — Deadline in ≤ 3 Tagen, Abstimmung in < 3 Stunden.
   Warnstufe, deshalb Bernstein statt Rot. */
.pill-soon {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .16rem .55rem;
  border-radius: var(--radius-pill);
  background: var(--sig-warn-bg);
  border: 1px solid color-mix(in srgb, var(--sig-warn) 45%, transparent);
  color: var(--sig-warn);
  font-weight: 700;
}
.pill-soon::before { content: '◷'; font-size: .95em; }

/* ─── 8. TO-DOS ─────────────────────────────────────────────────────────── */

.filter-bar {
  display: flex; gap: 1.4rem; flex-wrap: wrap; align-items: flex-end;
  margin-bottom: 1.8rem;
}
/* Kontrollkästchen ausnehmen — sonst würde min-width sie 150 px breit ziehen. */
.filter-bar select, .filter-bar input:not([type=checkbox]) {
  width: auto; min-width: 150px;
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.filter-bar label { margin-bottom: 0; align-items: center; }

.todo-list {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--rule-strong);
}
.todo-row {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 1.1rem .6rem 1.1rem 0;
  display: flex; align-items: flex-start; gap: 1rem;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), padding-left var(--dur-base) var(--ease);
  animation: riseIn .5s var(--ease) both;
}
.todo-list .todo-row:nth-child(1) { animation-delay: .02s; }
.todo-list .todo-row:nth-child(2) { animation-delay: .05s; }
.todo-list .todo-row:nth-child(3) { animation-delay: .08s; }
.todo-list .todo-row:nth-child(4) { animation-delay: .11s; }
.todo-list .todo-row:nth-child(5) { animation-delay: .14s; }
.todo-row:hover { background: var(--paper-2); padding-left: .6rem; }
/* Erledigtes tritt zurück, bleibt aber lesbar — .45 lag unter 3:1. */
.todo-row.done { opacity: .62; }
.todo-row.done .todo-title { text-decoration: line-through; color: var(--fg-2); }

.todo-check {
  width: 18px; height: 18px; flex-shrink: 0; margin-top: .18rem;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  background: transparent;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .68rem;
  overflow: visible;
}
.todo-check::before { display: none; }
.todo-check:hover { border-color: var(--fresh); }
.todo-check.checked {
  background: var(--fresh);
  border-color: var(--fresh);
  color: var(--paper);
}

.todo-main { flex: 1; min-width: 0; }
.todo-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -.015em;
  line-height: 1.25;
  margin-bottom: .4rem;
}
.todo-meta {
  display: flex; gap: .9rem; flex-wrap: wrap; align-items: center;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.assignee-tag { display: flex; align-items: center; gap: .4rem; }

/* ─── 9. FENSTER ────────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(10, 12, 10, .72);
  display: flex; align-items: flex-start; justify-content: center;
  padding: clamp(1rem, 5vh, 3.5rem) 1rem;
  overflow-y: auto;
  animation: fadeIn .2s var(--ease);
}
.modal {
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  padding: clamp(1.6rem, 4vw, 2.6rem);
  width: 100%; max-width: 620px;
  animation: riseIn .35s var(--ease);
}
.modal h2 {
  margin: 0 0 1.6rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  letter-spacing: -.035em;
  line-height: 1;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule-strong);
}
.modal-actions {
  display: flex; justify-content: flex-end; gap: .7rem;
  margin-top: 1.8rem; padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
@media (max-width: 600px) { .two-col { grid-template-columns: 1fr; } }

.penalty-box {
  border-left: 2px solid var(--sig-spoil);
  padding: .1rem 0 .1rem 1rem;
  margin-bottom: 1.2rem;
}
.penalty-box label { color: var(--sig-spoil-ink); }

/* Punktetabellen im Strafsystem-Fenster (Werte kommen vom Server). */
.rules-table {
  width: 100%;
  border-collapse: collapse;
  margin: .5rem 0 1rem;
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
}
.rules-table th,
.rules-table td {
  padding: .4rem .6rem;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.rules-table th {
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.rules-table th:first-child,
.rules-table td:first-child { text-align: left; font-weight: 600; }
.penalty-box small { display: block; margin-top: .5rem; color: var(--fg-2); line-height: 1.5; }

.checklist-item { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.checklist-item input[type=text] { flex: 1; }

.comment-thread { margin-top: 1.4rem; border-top: 1px solid var(--line); padding-top: 1.1rem; }
.comment { padding: .7rem 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.comment:last-child { border-bottom: none; }
.comment-header {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: .68rem;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: .3rem;
}

/* To-do-Fenster: Abschnitte durch Linien getrennt, keine Kästen. */
#todo-form > .two-col { margin-bottom: 1.4rem; }
#todo-form .result-file-field,
#todo-form > .field:has(#checklist-items),
#todo-form > .field:has(#attached-files) {
  border-top: 1px solid var(--line);
  padding: 1.1rem 0 .2rem;
  margin-bottom: .8rem;
}
#todo-form .result-file-field > label:first-of-type,
#todo-form > .field:has(#checklist-items) > label:first-of-type,
#todo-form > .field:has(#attached-files) > label:first-of-type,
#todo-form .comment-thread > label:first-of-type,
#todo-form .penalty-box > label:first-of-type {
  display: block;
  margin-bottom: .7rem;
}
#todo-form .comment-thread {
  margin-top: 0;
  padding: 1.1rem 0 .2rem;
  margin-bottom: .8rem;
}
#attached-files > div { border-bottom: 1px solid var(--line); }
#attached-files > div:last-child { border-bottom: none; }
#attach-results { margin-top: .6rem; }

/* ─── 10. AKTIVITÄT & MEILENSTEINE ──────────────────────────────────────── */

.activity-feed {
  display: flex; flex-direction: column;
  max-height: 440px; overflow-y: auto; padding-right: .4rem;
}
.activity-item {
  display: flex; gap: .7rem; align-items: flex-start;
  font-size: .88rem;
  padding: .7rem 0;
  border-bottom: 1px solid var(--line);
}
.activity-item:last-child { border-bottom: none; }
.activity-item time {
  font-family: var(--mono); font-size: .68rem;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--fg-3); white-space: nowrap;
}

.milestone-card {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1.5rem;
  padding: 1.3rem 0;
}
.countdown {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 3.2vw, 2.8rem);
  letter-spacing: -.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--sig-fresh-ink);
}
.countdown-label {
  font-family: var(--mono); font-size: .68rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-3);
}

/* ─── 11. KALENDER ──────────────────────────────────────────────────────── */

.calendar-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  overflow: hidden;
  margin-bottom: .6rem;
  width: 100%;
}
.calendar-weekdays {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-bottom: .6rem; width: 100%;
}
.calendar-weekdays div {
  text-align: center;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.calendar-cell {
  background: var(--paper);
  padding: .6rem; min-height: 128px; min-width: 0;
  font-size: .82rem;
  display: flex; flex-direction: column; gap: .25rem;
  transition: background var(--dur-fast) var(--ease);
  overflow: hidden;
}
.calendar-cell:hover { background: var(--paper-2); }
.calendar-cell[data-action=open-day] { cursor: pointer; }
.calendar-cell.weekend { background: #F0ECE3; }
.calendar-cell .day-num {
  font-family: var(--mono); font-size: .72rem;
  letter-spacing: .06em; color: var(--fg-3);
}
.calendar-cell.other-month { opacity: .55; }
.calendar-cell.today { box-shadow: inset 0 2px 0 var(--fresh); }
.calendar-cell.today .day-num { color: var(--fresh-ink); font-weight: 700; }
.calendar-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.4rem; }

.calendar-event {
  display: flex; align-items: center; gap: .4rem;
  width: 100%; text-align: left;
  background: transparent;
  border: 0; border-left: 2px solid var(--rule-strong);
  border-radius: 0;
  padding: .15rem .4rem;
  font-family: var(--body);
  font-size: .72rem; font-weight: 500;
  letter-spacing: 0; text-transform: none;
  color: var(--fg);
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
}
.calendar-event::before { background: var(--paper-2); }
.calendar-event:hover { color: var(--fg); border-color: var(--fg); }
.calendar-event-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.calendar-event.done { opacity: .58; }
.calendar-event.done .calendar-event-label { text-decoration: line-through; }
.event-priority-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.event-priority-dot.badge-high { background: var(--spoiled); }
.event-priority-dot.badge-medium { background: var(--ink-2); }
.event-priority-dot.badge-low { background: var(--fresh); }
.event-priority-dot::before { display: none; }
.calendar-more {
  width: 100%; text-align: left;
  background: transparent; border: none; padding: .1rem .4rem;
  font-family: var(--mono); font-size: .68rem;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--fg-3);
}
.calendar-more:hover { color: var(--fg); }

.agenda-list { display: none; flex-direction: column; gap: 1.2rem; }
.agenda-day { display: flex; flex-direction: column; gap: .5rem; }
.agenda-day-label {
  font-family: var(--mono); font-size: .72rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-3);
  padding-bottom: .4rem; border-bottom: 1px solid var(--line);
}
.agenda-events { display: flex; flex-direction: column; gap: .4rem; }

.ics-details summary {
  cursor: pointer;
  font-family: var(--mono); font-size: .74rem;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--fg-2);
}
.ics-details p { margin-top: 1rem; }
@media (max-width: 800px) {
  .calendar-grid#calendar-cells, .calendar-weekdays { display: none !important; }
  .agenda-list { display: flex !important; }
}

/* ─── 12. DATEIEN ───────────────────────────────────────────────────────── */

.files-layout { display: grid; grid-template-columns: 300px 1fr; gap: clamp(1.5rem, 3vw, 3rem); }
@media (max-width: 800px) { .files-layout { grid-template-columns: 1fr; } }

.folder-tree { display: flex; flex-direction: column; }
.folder-item {
  padding: .5rem .6rem; cursor: pointer;
  font-size: .88rem; color: var(--fg-2);
  display: flex; align-items: center; gap: .4rem;
  border-left: 2px solid transparent;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.folder-item:hover { background: var(--paper-2); color: var(--fg); }
.folder-item.active {
  color: var(--fg); font-weight: 600;
  border-left-color: var(--fresh);
  background: var(--paper-2);
}
.folder-item.folder-root {
  font-family: var(--mono); font-size: .72rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: .5rem; padding-left: .6rem;
  border-bottom: 1px solid var(--rule-strong); padding-bottom: .6rem;
}
.folder-item.drop-target { background: color-mix(in srgb, var(--fresh) 12%, transparent); border-left-color: var(--fresh); }
.folder-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-chevron { padding: 0 .25rem; font-size: .68rem; color: var(--fg-3); transition: transform var(--dur-fast) var(--ease); }
.folder-chevron.open { transform: rotate(90deg); }
.folder-chevron-spacer { width: 18px; flex-shrink: 0; }
.folder-count {
  font-family: var(--mono); font-size: .68rem;
  letter-spacing: .06em; color: var(--fg-3);
  flex-shrink: 0;
}
.folder-actions { display: flex; flex-shrink: 0; opacity: 0; transition: opacity var(--dur-fast); }
.folder-item:hover .folder-actions, .folder-item:focus-within .folder-actions { opacity: 1; }

.files-breadcrumb {
  margin-bottom: 1.5rem;
  font-family: var(--display); font-weight: 700;
  font-size: 1.2rem; letter-spacing: -.02em;
  min-height: 28px; display: flex; align-items: center;
}
.file-table tr[draggable=true] { cursor: grab; }
.file-table { width: 100%; border-collapse: collapse; font-size: .86rem; margin-top: .6rem; }
.file-table th {
  text-align: left;
  font-family: var(--mono); font-size: .68rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-3);
  padding: 0 1rem .7rem 0;
  border-bottom: 1px solid var(--rule-strong);
}
.file-table td {
  padding: .8rem 1rem .8rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--fg-2);
  transition: background var(--dur-fast);
}
.file-table td:first-child { color: var(--fg); }
.file-table tr:hover td { background: var(--paper-2); }
.file-row-actions { text-align: right; white-space: nowrap; opacity: 0; transition: opacity var(--dur-fast); }
.file-table tr:hover .file-row-actions, .file-row-actions:focus-within { opacity: 1; }

.breadcrumb {
  margin-top: 0;
  font-family: var(--mono); font-size: .7rem;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--fg-3);
  display: flex; align-items: center;
}
.breadcrumb-link { cursor: pointer; color: var(--fg-2); padding: .2rem .35rem; }
.breadcrumb-link:hover { color: var(--fg); }
.breadcrumb-sep { margin: 0 .2rem; color: var(--fg-3); opacity: .5; }

.files-main { position: relative; }
.files-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding-bottom: 1rem; margin-bottom: 1rem;
  border-bottom: 1px solid var(--rule-strong);
}
.files-toolbar .files-breadcrumb { margin-bottom: 0; }

.view-toggle {
  display: inline-flex; gap: 0;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-pill);
  overflow: hidden;
  flex-shrink: 0;
}
.view-toggle button {
  border: 0; border-radius: 0;
  color: var(--fg-3);
  padding: .4rem 1rem;
}
.view-toggle button::before { background: var(--fg); }
.view-toggle button:hover { color: var(--bg); }
.view-toggle button.active { background: var(--ink); color: var(--paper); }
.view-toggle button.active::before { display: none; }

/* Ganzes Fenster ist Ablagefläche: Overlay erscheint beim Ziehen von Dateien. */
.upload-overlay {
  position: absolute; inset: 0; z-index: 20;
  display: none; align-items: center; justify-content: center;
  border: 1px dashed var(--fresh);
  background: color-mix(in srgb, var(--paper) 88%, var(--fresh));
  pointer-events: none;
}
.files-main.drag-active .upload-overlay { display: flex; }
.upload-overlay-inner { text-align: center; color: var(--ink); }
.upload-overlay-icon { font-size: 2.4rem; line-height: 1; margin-bottom: .8rem; }
.upload-overlay-text {
  font-family: var(--mono); font-size: .8rem;
  letter-spacing: .14em; text-transform: uppercase;
}
.upload-overlay-hint { font-size: .82rem; color: var(--ink-2); margin-top: .5rem; }

/* Kachelansicht */
.file-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1px; background: var(--line);
  margin-top: .6rem;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
}
.file-tile {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  padding: 1.3rem .8rem 1rem;
  border: 0; border-radius: 0;
  background: var(--paper);
  text-align: center;
  transition: background var(--dur-fast) var(--ease);
}
.file-tile:hover { background: var(--paper-2); }
.tile-icon-link { text-decoration: none; }
.tile-icon { font-size: 2.2rem; line-height: 1; }
.tile-name { font-size: .82rem; color: var(--fg); word-break: break-word; line-height: 1.3; max-height: 2.6em; overflow: hidden; }
.tile-breadcrumb { justify-content: center; font-size: .66rem; }
.tile-open {
  font-family: var(--mono); font-size: .68rem;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--fg-3);
  opacity: 0; transition: opacity var(--dur-fast);
}
.tile-open.office { color: var(--fresh-ink); }
.file-tile:hover .tile-open { opacity: 1; }
.tile-drag-handle {
  position: absolute; top: .4rem; left: .5rem;
  color: var(--fg-3); cursor: grab; font-size: .75rem;
  opacity: 0; transition: opacity var(--dur-fast);
}
.file-tile:hover .tile-drag-handle { opacity: .7; }

/* Rechtsklick-Menü */
.context-menu {
  position: fixed; z-index: 200; min-width: 200px; padding: .3rem;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  display: flex; flex-direction: column;
  animation: fadeIn .12s var(--ease);
}
.context-item {
  display: flex; align-items: center; gap: .7rem;
  width: 100%; text-align: left; justify-content: flex-start;
  background: transparent; border: 0; border-radius: 0;
  color: var(--fg);
  font-family: var(--body); font-size: .85rem; font-weight: 500;
  letter-spacing: 0; text-transform: none;
  padding: .5rem .6rem;
}
.context-item::before { background: var(--paper-2); }
.context-item:hover { color: var(--fg); }
.context-item.danger { color: var(--spoiled-ink); }
.context-item.danger::before { background: color-mix(in srgb, var(--spoiled) 14%, transparent); }
.context-item.danger:hover { color: var(--spoiled-ink); }
.context-icon { width: 18px; text-align: center; flex-shrink: 0; }
.context-sep { height: 1px; background: var(--line); margin: .3rem .5rem; }

/* ─── 13. MOBIL ─────────────────────────────────────────────────────────── */

@media (max-width: 800px) {
  .app-shell { flex-direction: column; }
  .sidebar { display: none; }
  .sidebar.open {
    display: flex; position: fixed; inset: 0; z-index: 40;
    width: 100%; height: 100vh;
    background: var(--deep);
  }
  .mobile-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: .9rem 1.2rem;
    background: var(--deep); color: var(--paper);
    border-bottom: 1px solid var(--rule-inv);
    position: sticky; top: 0; z-index: 30;
  }
  .mobile-topbar strong {
    font-family: var(--display); font-weight: 800;
    font-size: 1.05rem; letter-spacing: -.02em;
  }
  .mobile-topbar button { color: var(--paper); border-color: var(--rule-inv-str); }
  .mobile-topbar button::before { background: var(--paper); }
  .mobile-topbar button:hover { color: var(--deep); }
  .main-content { padding: 1.4rem 1.25rem 4rem; }

  .files-layout { grid-template-columns: 1fr; gap: 1.2rem; }
  .folder-actions, .file-row-actions { opacity: 1 !important; }

  .file-table, .file-table tbody { display: block; width: 100%; }
  .file-table thead { display: none; }
  .file-table tr { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); padding: 1rem 0; gap: .4rem; }
  .file-table td { border: none; padding: 0; display: flex; align-items: center; justify-content: space-between; text-align: right; }
  .file-table td:first-child { justify-content: flex-start; margin-bottom: .3rem; font-weight: 600; text-align: left; }
  .file-table td:nth-child(2)::before { content: "Größe"; }
  .file-table td:nth-child(3)::before { content: "Von"; }
  .file-table td:nth-child(4)::before { content: "Datum"; }
  .file-table td:nth-child(2)::before,
  .file-table td:nth-child(3)::before,
  .file-table td:nth-child(4)::before {
    font-family: var(--mono); font-size: .66rem;
    letter-spacing: .14em; text-transform: uppercase;
    color: var(--fg-3);
  }
  .file-row-actions { margin-top: .8rem; justify-content: flex-start !important; gap: .8rem; padding-top: .8rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
  .file-drag-handle { display: none; }

  .page-header { flex-direction: column; align-items: stretch; gap: 1rem; }
  .page-header > div { flex-wrap: wrap; }
  #file-search { width: 100% !important; }
}

/* ─── 14. LEERZUSTAND & HINWEISE ────────────────────────────────────────── */

.empty-state {
  font-family: var(--mono); font-size: .74rem;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--fg-3);
  padding: 2.5rem 0; text-align: center;
}
.toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 100;
  display: flex; flex-direction: column; gap: .6rem;
}
.toast {
  background: var(--deep); color: var(--paper);
  border: 0; border-left: 2px solid var(--fresh-lum);
  border-radius: 0;
  padding: .8rem 1.2rem;
  font-size: .85rem;
  animation: riseIn .3s var(--ease);
}
.toast.error { border-left-color: var(--spoiled-lum); }

/* ─── 15. TAGESIMPULS (MOTD) ────────────────────────────────────────────── */

.motd-overlay {
  position: fixed; inset: 0; z-index: 999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: clamp(1.5rem, 5vw, 5.5rem);
  background: var(--deep);
  color: var(--paper);
  overflow: hidden;
  transition: opacity .6s var(--ease);
}
.motd-overlay.motd-leaving { opacity: 0; pointer-events: none; }
/* Einziger Farbeffekt: ein weicher Signalschein, kein Blob-Gewitter. */
.motd-overlay::before {
  content: ''; position: absolute; inset: -20%;
  background: radial-gradient(42% 38% at 50% 55%, color-mix(in srgb, var(--fresh-lum) 12%, transparent), transparent 70%);
  pointer-events: none;
}
.motd-inner { position: relative; z-index: 1; max-width: 980px; width: 100%; }
.motd-kicker {
  display: flex; align-items: center; gap: .7rem;
  font-family: var(--mono); font-size: .7rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase;
  color: rgba(244, 241, 234, .44);
  margin-bottom: 2.2rem;
  opacity: 0; animation: riseIn .7s var(--ease) .15s forwards;
}
.motd-kicker::before {
  content: ''; width: 1.8rem; height: 1px; background: currentColor; opacity: .55; flex: none;
}
.motd-kicker .motd-day { color: var(--fresh-lum); }
.motd-quote {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.2rem, 6.4vw, 5.4rem);
  line-height: .95;
  letter-spacing: -.035em;
  margin: 0;
  hyphens: auto;
  overflow-wrap: break-word;
}
.motd-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(.4em);
  animation: motdWordIn .7s var(--ease) forwards;
}
@keyframes motdWordIn { to { opacity: 1; transform: none; } }
.motd-word.motd-hot { color: var(--fresh-lum); }
.motd-author {
  margin-top: 2.2rem;
  font-family: var(--mono); font-size: .7rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase;
  color: rgba(244, 241, 234, .44);
  opacity: 0; animation: riseIn .7s var(--ease) forwards;
}
.motd-line {
  width: 0; height: 1px; margin: 2.4rem 0 0;
  background: var(--fresh-lum);
  animation: motdLine .9s var(--ease) forwards;
}
@keyframes motdLine { to { width: 120px; } }
.motd-progress {
  position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--rule-inv); z-index: 2;
}
.motd-progress-fill {
  height: 100%; width: 0; background: var(--fresh-lum);
  animation-name: motdProgress; animation-timing-function: linear; animation-fill-mode: forwards;
}
@keyframes motdProgress { to { width: 100%; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .motd-word, .card, .todo-row, .page-header, .login-card { opacity: 1; transform: none; }
}

/* ─── 16. MARKDOWN-INHALTE ──────────────────────────────────────────────── */

.md-hint {
  font-family: var(--mono); font-size: .66rem;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--fg-3);
  margin-left: .5rem;
}
textarea.md-input { font-family: var(--body); line-height: 1.55; resize: vertical; }
.md-preview {
  margin-top: .6rem;
  border-top: 1px solid var(--line);
  padding: .8rem 0 0;
}
.md-preview-label {
  font-family: var(--mono); font-size: .66rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: .5rem;
}
.markdown-body { line-height: 1.6; word-break: break-word; }
.markdown-body > *:first-child { margin-top: 0; }
.markdown-body > *:last-child { margin-bottom: 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin: 1.1rem 0 .5rem;
}
.markdown-body h1 { font-size: 1.4rem; }
.markdown-body h2 { font-size: 1.2rem; }
.markdown-body h3 { font-size: 1.05rem; }
.markdown-body p { margin: .6rem 0; }
.markdown-body ul, .markdown-body ol { margin: .6rem 0; padding-left: 1.3rem; }
.markdown-body li { margin: .2rem 0; }
.markdown-body a { color: var(--fresh-ink); }
.markdown-body strong { font-weight: 600; color: var(--fg); }
.markdown-body blockquote {
  margin: .8rem 0;
  padding: .1rem 0 .1rem 1rem;
  border-left: 2px solid var(--fresh);
  color: var(--fg-2);
}
.markdown-body hr { border: none; border-top: 1px solid var(--line); margin: 1.1rem 0; }
.markdown-body code {
  font-family: var(--mono);
  font-size: .85em;
  background: var(--paper-2);
  padding: .05rem .3rem;
}
.md-table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: .88rem; }
.md-table th, .md-table td {
  border-bottom: 1px solid var(--line);
  padding: .5rem .8rem .5rem 0;
  text-align: left;
}
.md-table th {
  font-family: var(--mono); font-size: .68rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-3);
  border-bottom-color: var(--rule-strong);
}
.md-code { position: relative; margin: 1rem 0; }
.md-code pre {
  margin: 0;
  padding: .9rem 1rem;
  background: var(--paper-2);
  border-left: 2px solid var(--rule-strong);
  overflow-x: auto;
}
.md-code pre code {
  background: none; padding: 0;
  font-family: var(--mono);
  font-size: .78rem; line-height: 1.55;
  white-space: pre;
  color: var(--fg);
}
.md-copy {
  position: absolute; top: .3rem; right: .3rem;
  font-family: var(--mono); font-size: .64rem;
  letter-spacing: .1em; text-transform: uppercase;
  padding: .2rem .6rem;
  border: 1px solid var(--line-str);
  border-radius: var(--radius-pill);
  color: var(--fg-3);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease);
}
.md-code:hover .md-copy, .md-copy:focus { opacity: 1; }

/* ─── 17. RICH-TEXT-EDITOR ──────────────────────────────────────────────── */

.rt-editor {
  border: 1px solid var(--line-str);
  background: var(--paper);
  overflow: hidden;
}
.rt-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .1rem;
  padding: .3rem .4rem;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}
.rt-btn {
  min-width: 26px; height: 26px;
  padding: 0 .45rem;
  font-family: var(--body);
  font-size: .78rem; line-height: 1;
  letter-spacing: 0; text-transform: none;
  color: var(--fg-2);
  background: transparent;
  border: 0; border-radius: 0;
}
.rt-btn::before { background: var(--ink); }
.rt-btn:hover { color: var(--paper); }
.rt-sep { width: 1px; height: 16px; margin: 0 .3rem; background: var(--line-str); }
.rt-content {
  min-height: 130px; max-height: 340px; overflow-y: auto;
  padding: .7rem .8rem;
  font-size: .92rem; line-height: 1.55;
  color: var(--fg);
  outline: none;
}
.rt-content:empty::before { content: attr(data-placeholder); color: var(--fg-3); pointer-events: none; }
.rt-editor:focus-within { border-color: var(--fresh); }
.rt-content p { margin: 0 0 .5rem; }
.rt-content h1, .rt-content h2, .rt-content h3,
.rt-content h4, .rt-content h5, .rt-content h6 { font-family: var(--display); letter-spacing: -.02em; }
.rt-content h1 { font-size: 1.4rem; margin: .6rem 0 .4rem; font-weight: 700; }
.rt-content h2 { font-size: 1.2rem; margin: .6rem 0 .4rem; font-weight: 700; }
.rt-content h3 { font-size: 1.05rem; margin: .5rem 0 .3rem; font-weight: 700; }
.rt-content h4, .rt-content h5, .rt-content h6 { font-size: .95rem; margin: .5rem 0 .3rem; font-weight: 700; }
.rt-content ul, .rt-content ol { margin: .4rem 0 .5rem; padding-left: 1.3rem; }
.rt-content li { margin: .15rem 0; }
.rt-content a { color: var(--fresh-ink); text-decoration: underline; }
.rt-content blockquote {
  margin: .5rem 0;
  padding: .1rem 0 .1rem .8rem;
  border-left: 2px solid var(--line-str);
  color: var(--fg-2);
}
.rt-content table { border-collapse: collapse; width: 100%; margin: .6rem 0; font-size: .86rem; }
.rt-content th, .rt-content td {
  border: 1px solid var(--line-str);
  padding: .4rem .6rem; text-align: left; min-width: 40px;
}
.rt-content th { background: var(--paper-2); font-weight: 600; }
.rt-content pre {
  margin: .5rem 0; padding: .7rem .8rem;
  background: var(--paper-2);
  border-left: 2px solid var(--line-str);
  overflow-x: auto;
}
.rt-content pre code { font-family: var(--mono); font-size: .78rem; white-space: pre; }
.rt-content code { font-family: var(--mono); font-size: .85em; background: var(--paper-2); padding: .05rem .3rem; }

/* ─── 18. ORDNER-AUSWAHL ────────────────────────────────────────────────── */

.fp-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 12, 10, .72);
  padding: 1.25rem;
}
.fp-modal {
  width: min(540px, 100%); max-height: 80vh;
  display: flex; flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  overflow: hidden;
}
.fp-head {
  padding: 1.1rem 1.3rem;
  font-family: var(--mono); font-size: .74rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-3);
  border-bottom: 1px solid var(--rule-strong);
}
.fp-search { margin: 1rem 1.3rem .5rem; padding: .5rem 0; width: auto; }
.fp-list { flex: 1; overflow-y: auto; padding: .3rem .8rem .8rem; }
.fp-row {
  padding: .5rem .6rem; cursor: pointer; font-size: .88rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-left: 2px solid transparent;
}
.fp-row:hover { background: var(--paper-2); }
.fp-row.selected { background: var(--paper-2); border-left-color: var(--fresh); font-weight: 600; }
.fp-empty {
  padding: 1rem .6rem;
  font-family: var(--mono); font-size: .72rem;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--fg-3);
}
.fp-foot {
  display: flex; justify-content: flex-end; gap: .6rem;
  padding: 1rem 1.3rem;
  border-top: 1px solid var(--line);
}

/* ─── 19. UPLOAD & ERGEBNISDATEI ────────────────────────────────────────── */

.upload-progress { display: flex; align-items: center; gap: .7rem; margin-top: .6rem; }
.upload-bar { flex: 1; height: 2px; background: var(--line); overflow: hidden; }
.upload-bar-fill { width: 0; height: 100%; background: var(--fresh); transition: width .15s var(--ease); }
.upload-pct {
  font-family: var(--mono); font-size: .7rem;
  letter-spacing: .08em; color: var(--fg-3);
  min-width: 42px; text-align: right;
}
.result-folder-pick { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: .3rem 0; }

.result-file-field select:disabled { opacity: .4; }
/* Hinweisband — ein Signal bekommt Fläche, Kante und Tinte auf einmal.
   Vorher trugen Warnungen die Aussage allein über die Textfarbe; bei 10-px-
   Kleinschrift ging das im Formular unter. */
.notice {
  padding: .7rem .9rem .7rem 1rem;
  margin: .5rem 0 .9rem;
  border-left: 3px solid var(--line-str);
  background: var(--bg-2);
  color: var(--fg);
  font-size: .88rem;
  line-height: 1.5;
}
.notice strong { font-weight: 700; }
.notice--danger { border-left-color: var(--sig-spoil); background: var(--sig-spoil-bg); }
.notice--danger strong { color: var(--sig-spoil-ink); }
.notice--warn   { border-left-color: var(--sig-warn);  background: var(--sig-warn-bg); }
.notice--warn strong { color: var(--sig-warn); }
.notice--ok     { border-left-color: var(--sig-fresh); background: var(--sig-fresh-bg); }
.notice--ok strong { color: var(--sig-fresh-ink); }

.result-req {
  padding: .7rem .9rem .7rem 1rem;
  margin: .3rem 0 .8rem;
  border-left: 3px solid currentColor;
  font-size: .88rem; line-height: 1.5;
  font-weight: 500;
}
.result-req.met { color: var(--fresh-ink); background: var(--sig-fresh-bg); }
.result-req.unmet { color: var(--spoiled-ink); background: var(--sig-spoil-bg); }

.attachment-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: .8rem; padding: .5rem 0;
  font-size: .88rem;
}
.attachment-row a { color: var(--fg); }
.attachment-row a:hover { color: var(--fresh-ink); }

/* ─── 20. STRAFPUNKTE & EINSPRÜCHE ──────────────────────────────────────── */

.penalty-row {
  display: flex; align-items: center; gap: 1.1rem;
  padding: .9rem 0;
  border-bottom: 1px solid var(--line);
}
.penalty-row:last-child { border-bottom: none; }
.penalty-row-main { flex: 1; min-width: 0; }
.penalty-row-title { font-weight: 600; margin-bottom: .25rem; }
.penalty-row-weight {
  font-family: var(--display);
  font-size: 1.5rem; font-weight: 800;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  color: var(--spoiled);
  min-width: 52px; text-align: right;
}
.penalty-row-weight.waived { color: var(--fg-3); text-decoration: line-through; }
.penalty-row.waived .penalty-row-title { color: var(--fg-3); text-decoration: line-through; }
.penalty-row-action {
  min-width: 180px; text-align: right;
  font-family: var(--mono); font-size: .7rem;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--fg-3);
}

.claim-card { animation: none; padding-left: 1.1rem; border-left: 2px solid var(--line-str); border-top: 0; }
.claim-card.claim-approved { border-left-color: var(--fresh); }
.claim-card.claim-rejected { border-left-color: var(--spoiled); }
.claim-card.claim-open { border-left-color: var(--ink-2); }
.claim-reason {
  margin: 0 0 .8rem;
  padding: .3rem 0 .3rem 1rem;
  border-left: 1px solid var(--line);
  color: var(--fg-2);
  font-style: italic; line-height: 1.5;
  white-space: pre-wrap;
}
.claim-votes { display: flex; flex-direction: column; gap: .6rem; }
.claim-vote { display: flex; gap: .7rem; align-items: flex-start; font-size: .86rem; }
.vote-yes { color: var(--fresh-ink); font-weight: 600; }
.vote-no { color: var(--spoiled-ink); font-weight: 600; }

/* ─── 21. ABSTIMMUNGEN & SITZUNGEN ──────────────────────────────────────── */

.vote-tabs { display: flex; gap: 1.6rem; margin-bottom: 1.8rem; border-bottom: 1px solid var(--rule-strong); }
.vote-tab {
  padding: 0 0 .8rem;
  font-family: var(--mono); font-size: .74rem;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--fg-3);
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  transition: color var(--dur-fast) var(--ease);
}
.vote-tab:hover { color: var(--fg); }
.vote-tab.active { color: var(--fg); border-bottom-color: var(--fresh); }

.poll-list { display: flex; flex-direction: column; }
.poll-card, .meeting-card { padding-left: 1.1rem; border-left: 2px solid var(--line-str); }
.poll-card.poll-open { border-left-color: var(--ink-2); }
.poll-card.poll-decided { border-left-color: var(--fresh); }
.poll-card.poll-rejected { border-left-color: var(--spoiled); }
.poll-card.poll-tied, .poll-card.poll-cancelled { border-left-color: var(--line-str); }
.meeting-card.meeting-planned { border-left-color: var(--fresh); }
.meeting-card.meeting-done { border-left-color: var(--line-str); }

.poll-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.2rem; flex-wrap: wrap; }
.poll-title {
  font-family: var(--display);
  font-size: 1.25rem; font-weight: 700;
  letter-spacing: -.025em; line-height: 1.1;
  margin-bottom: .4rem;
}
.poll-description { color: var(--fg-2); line-height: 1.55; margin: .8rem 0; white-space: pre-wrap; max-width: 68ch; }
.poll-links { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .8rem; }

.poll-options { display: flex; flex-direction: column; margin-top: 1rem; border-top: 1px solid var(--line); }
.poll-option { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.poll-option-head {
  display: flex; justify-content: space-between; gap: 1rem;
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
}
.poll-option-winner { border-left: 2px solid var(--fresh); padding-left: .8rem; }
/* Termin, an dem alle können — bei der Terminsuche die einzig interessante Zeile. */
.poll-option-fits { border-left: 2px solid var(--fresh); padding-left: .8rem; }
.poll-option-abstain .poll-option-head { color: var(--fg-3); }

.poll-vote-form { margin-top: 1.2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.poll-choices { display: flex; flex-wrap: wrap; gap: .6rem; }
.poll-choice {
  display: flex; align-items: center; gap: .5rem;
  padding: .45rem 1rem;
  border: 1px solid var(--line-str);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: var(--mono); font-size: .72rem;
  letter-spacing: .08em; text-transform: uppercase;
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.poll-choice:hover { border-color: var(--fg); }
.poll-choice:has(input:checked) { border-color: var(--fresh); color: var(--fresh); }
.poll-choice input { width: auto; margin: 0; }

.poll-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.2rem; }
.poll-result {
  margin-top: 1rem;
  padding: .5rem 0 .5rem 1rem;
  border-left: 2px solid var(--fresh);
}
.poll-switches { display: flex; flex-direction: column; gap: .6rem; margin: 1rem 0; font-size: .88rem; }
.poll-switches label {
  display: flex; align-items: center; gap: .5rem; cursor: pointer;
  font-family: var(--body); font-size: .88rem;
  letter-spacing: 0; text-transform: none; color: var(--fg-2);
  margin-bottom: 0;
}
.poll-switches input { width: auto; margin: 0; }
.poll-option-field { margin-bottom: .5rem; }

.poll-followup { border: 0; border-top: 1px solid var(--line); padding: .8rem 0 0; margin: 1rem 0; }
.poll-followup legend { font-size: .88rem; padding: 0; }
.poll-followup legend label {
  display: flex; align-items: center; gap: .5rem; cursor: pointer;
  font-family: var(--body); font-size: .88rem;
  letter-spacing: 0; text-transform: none; color: var(--fg-2);
  margin-bottom: 0;
}
.poll-followup legend input { width: auto; margin: 0; }

.agenda-items { display: flex; flex-direction: column; }
.agenda-item {
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  font-size: .9rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--line);
}
.agenda-item:last-child { border-bottom: none; }
.meeting-decisions { margin: 0; padding-left: 1.2rem; color: var(--fg-2); line-height: 1.6; }

.dashboard-poll {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; padding: .6rem 0; font-size: .9rem;
}
.dashboard-poll + .dashboard-poll { border-top: 1px solid var(--line); }

/* Terminraster: Zeitfenster × Tage, zum Anklicken */
.slot-week-nav { display: flex; gap: .5rem; margin-bottom: .8rem; flex-wrap: wrap; }
.slot-week.active { border-color: var(--fresh); color: var(--fresh); }
.slot-grid { width: 100%; border-collapse: collapse; margin-bottom: .6rem; }
.slot-grid th {
  font-family: var(--mono); font-size: .64rem; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--fg-3);
  padding: .25rem; text-align: center; white-space: nowrap;
}
.slot-grid thead th.weekend { color: var(--fg-2); }
.slot-grid tbody th { text-align: right; padding-right: .6rem; line-height: 1.2; }
.slot-grid td { padding: 1px; }
.slot-cell {
  width: 100%; min-width: 24px; height: 24px; padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0;
  cursor: pointer;
}
.slot-cell::before { background: var(--ink-3); }
.slot-cell:hover { border-color: var(--fg-3); }
.slot-cell.weekend { background: var(--paper-2); }
.slot-cell.active { background: var(--fresh); border-color: var(--fresh); }
.slot-cell.active::before { display: none; }

.minutes-upload {
  border-top: 1px solid var(--line);
  padding: .9rem 0 0;
  display: flex; flex-direction: column; gap: .6rem; align-items: flex-start;
}

.slot-day-row { display: flex; gap: 1rem; align-items: baseline; flex-wrap: wrap; margin-bottom: .6rem; }
.slot-day-label {
  min-width: 120px;
  font-family: var(--mono); font-size: .72rem;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--fg-2);
}

/* ─── 16. TAGESORDNUNG ──────────────────────────────────────────────────── */
/*
   Der Reiter für die Sitzungspunkte (TAGESORDNUNG.md). Eigenes Präfix `top-`
   (Tagesordnungspunkt), weil `.agenda-*` schon der Tagesplan im Kalender ist.
   Gebaut nach denselben drei Prinzipien wie der Rest: Creme statt Weiß,
   Haarlinien statt Kästen, Grün nur dort, wo etwas ausgesagt wird.
*/

.top-header-actions { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
/* Formularfelder sind in dieser App 100 % breit — in der Kopfzeile soll die
   Auswahl aber nur so breit sein wie nötig, sonst rutscht der Knopf daneben in
   die nächste Zeile. */
.top-header-actions select { width: auto; max-width: min(320px, 45vw); }

.top-summary-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
}
.top-meeting-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.45rem, 2.6vw, 2.1rem);
  letter-spacing: -.03em;
  line-height: 1.04;
  margin: .8rem 0 .5rem;
}
.top-when { font-size: .95rem; color: var(--fg-2); }
.top-countdown { text-align: right; min-width: 130px; }
/* Umbricht der Kopf auf schmalen Schirmen, steht die Restzeit unter dem Titel —
   dort gehört sie an denselben linken Rand wie alles andere. */
@media (max-width: 700px) { .top-countdown { text-align: left; } }

/* Vier Kennzahlen unter dem Kopf: wie viel steht drauf, wie viel Zeit ist
   verplant, wer hat schon etwas beigetragen. */
.top-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem 1.5rem;
  margin: 1.5rem 0 1.1rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.top-stats .stat-value { font-size: clamp(1.3rem, 2vw, 1.9rem); margin-top: .35rem; }
@media (max-width: 760px) { .top-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.top-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: 1.1rem; }
.top-actions select { max-width: 220px; }

/* Ein Link, der sich wie ein Button anfühlt — für das PDF, das in einem neuen
   Tab aufgeht (ein echtes <a>, damit Rechtsklick/Speichern funktioniert). */
.button-link {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .5rem 1.15rem;
  border: 1px solid var(--line-str);
  border-radius: var(--radius-pill);
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg);
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
}
.button-link:hover { background: var(--fg); border-color: var(--fg); color: var(--bg); }

/* Eingabemaske: vier schmale Felder nebeneinander, Titel und Beschreibung über
   die volle Breite. */
.top-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 1.5rem; }
.top-field-wide { grid-column: 1 / -1; }
.top-form-head h2 {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(1.2rem, 2vw, 1.6rem); letter-spacing: -.025em;
  margin: .7rem 0 1.2rem;
}
.top-form-actions { display: flex; justify-content: flex-end; }
.top-form--modal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .top-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .top-form, .top-form--modal { grid-template-columns: 1fr; }
}

/* Interaktiver Rundgang direkt auf der echten Oberfläche */
.tour-layer { position: fixed; inset: 0; z-index: 2100; pointer-events: none; transition: opacity .28s ease; }
.tour-layer.leaving { opacity: 0; }
.tour-shade { position: absolute; inset: 0; background: transparent; }
.tour-target {
  position: relative !important;
  z-index: 2099 !important;
  border-radius: 14px;
  box-shadow: 0 0 0 3px #FFB000, 0 10px 30px rgba(255,167,0,.28) !important;
  transition: box-shadow .25s ease, transform .25s ease !important;
}
.tour-tooltip {
  position: fixed;
  z-index: 2101;
  pointer-events: auto;
  padding: 1.35rem;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 22px;
  background: rgba(255,252,245,.96);
  box-shadow: 0 24px 70px rgba(26,21,18,.3);
  backdrop-filter: blur(18px);
  animation: riseIn .3s var(--ease) both;
}
.tour-tooltip::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: rgba(255,252,245,.98);
  transform: rotate(45deg);
}
.tour-tooltip[data-placement="right"]::before { left: -9px; top: calc(50% - 9px); border-left: 1px solid rgba(20,18,16,.1); border-bottom: 1px solid rgba(20,18,16,.1); }
.tour-tooltip[data-placement="left"]::before { right: -9px; top: calc(50% - 9px); border-right: 1px solid rgba(20,18,16,.1); border-top: 1px solid rgba(20,18,16,.1); }
.tour-tooltip[data-placement="bottom"]::before { top: -9px; left: 28px; border-left: 1px solid rgba(20,18,16,.1); border-top: 1px solid rgba(20,18,16,.1); }
.tour-count { color: #9A5800; font-size: .73rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.tour-tooltip h2 { margin: .45rem 0 .55rem; font-size: 1.5rem; font-weight: 600; letter-spacing: -.025em; }
.tour-tooltip p { margin: 0; color: #514A42; font-size: .94rem; line-height: 1.55; }
.tour-progress { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; margin: 1.2rem 0; }
.tour-progress span { height: 4px; border-radius: 999px; background: rgba(20,18,16,.1); }
.tour-progress span.active { background: linear-gradient(90deg, #FFDF00, #FFA700); }
.tour-actions { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.tour-actions > div { display: flex; gap: .45rem; }
.tour-actions button { min-height: 36px; padding: .5rem .8rem; font-size: .82rem; }
.profile-help {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .7rem;
  margin-top: 1rem;
  color: var(--fg-3);
  font-size: .82rem;
}
.profile-help button { min-height: 32px; padding: .35rem .7rem; font-size: .78rem; opacity: .78; }
.profile-help button:hover { opacity: 1; }
@media (max-width: 640px) {
  .tour-tooltip { left: 12px !important; right: 12px; width: auto !important; }
  .tour-progress { grid-template-columns: repeat(6, 1fr); }
  .profile-help { align-items: flex-start; flex-direction: column; }
}

/* Die Punkte selbst: Nummer, Inhalt, Aktionen — getrennt durch Haarlinien. */
.top-list { display: flex; flex-direction: column; margin-bottom: 1.5rem; }
.top-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0 1.2rem; align-items: start;
  padding: 1.15rem 0;
  border-top: 1px solid var(--line);
  animation: riseIn .5s var(--ease) both;
}
.top-item:first-child { border-top: 1px solid var(--rule-strong); }
.top-num {
  font-family: var(--mono); font-weight: 500; font-size: .95rem;
  letter-spacing: .08em;
  color: var(--sig-fresh-ink);
  padding-top: .2rem;
  font-variant-numeric: tabular-nums;
}
.top-title {
  display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
  font-family: var(--display); font-weight: 700;
  font-size: 1.05rem; letter-spacing: -.015em; line-height: 1.3;
}
.top-meta {
  display: flex; gap: 1.1rem; flex-wrap: wrap; align-items: center;
  margin-top: .5rem;
  font-family: var(--mono); font-size: .7rem;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--fg-3);
}
.top-desc { margin: .65rem 0 0; max-width: 72ch; font-size: .92rem; line-height: 1.6; color: var(--fg-2); }

/* Aktionen erscheinen beim Überfahren — auf Touchgeräten (kein Hover) stehen
   sie dauerhaft, sonst wären sie dort unerreichbar. */
.top-item-actions { display: flex; gap: .15rem; opacity: 0; transition: opacity var(--dur-fast) var(--ease); }
.top-item:hover .top-item-actions,
.top-item:focus-within .top-item-actions { opacity: 1; }
@media (hover: none) { .top-item-actions { opacity: 1; } }

/* Fester Rahmen (Begrüßung, Protokollgenehmigung, Sonstiges): gehört dazu, ist
   aber nicht das, worum es in der Sitzung geht — deshalb leiser gesetzt. */
.top-item--fixed .top-num { color: var(--fg-3); }
.top-item--fixed .top-title { font-weight: 600; color: var(--fg-2); }

.top-archive { display: flex; flex-direction: column; margin-top: 1rem; }
.top-archive-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; padding: .75rem 0;
  border-top: 1px solid var(--line);
  color: var(--fg); text-decoration: none;
}
.top-archive-row:hover { color: var(--sig-fresh-ink); }

/* SchlossLimo brand layer */
:root {
  --paper: #FBF7EE;
  --paper-2: #F3EDE0;
  --deep: #1A1512;
  --deep-2: #251D18;
  --ink: #141210;
  --ink-2: #514A42;
  --ink-3: #6B6357;
  --fresh: #FFA700;
  --fresh-ink: #9A5800;
  --fresh-lum: #FFBF3F;
  --amber: #B41E3A;
  --amber-lum: #F25A72;
  --tint-fresh: #FFF0CE;
  --tint-amber: #F8E3E6;
  --rule: rgba(20, 18, 16, .14);
  --rule-strong: rgba(20, 18, 16, .32);
}

::selection { background: #FFA700; color: #141210; }
.sidebar { background: linear-gradient(165deg, #1A1512 0%, #2B1D12 100%); }
.brand { gap: .75rem; }
.schlosslimo-mark { width: 46px; height: 46px; object-fit: contain; }
.brand-accent, .top-num, .top-archive-row:hover { color: #A55B00; }
.primary { background: #FFA700; border-color: #FFA700; color: #141210; }
.primary:hover { background: #FFB72D; border-color: #FFB72D; }
.login-screen {
  background:
    radial-gradient(circle at 78% 16%, rgba(255, 167, 0, .28), transparent 34rem),
    linear-gradient(145deg, #FBF7EE, #F3E2C3);
}
.login-card { border-top: 4px solid #FFA700; }
.login-logo { width: 88px; height: 88px; object-fit: contain; margin-bottom: 1.25rem; }
.admin-layout { align-items: start; }
.admin-user-list { border-top: 1px solid var(--line-str); }
.admin-user-row { display: grid; grid-template-columns: auto 1fr auto; gap: .85rem; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.danger-action { color: var(--sig-spoil-ink); }
@media (max-width: 760px) { .admin-layout { grid-template-columns: 1fr; } }

/* ========================================================================
   SchlossLimo UI — dieselbe visuelle Sprache wie schlosslimo.de
   ======================================================================== */
@font-face { font-family: 'Outfit'; src: url('/fonts/Outfit-normal-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Outfit'; src: url('/fonts/Outfit-normal-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Outfit'; src: url('/fonts/Outfit-normal-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Outfit'; src: url('/fonts/Outfit-normal-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --display: 'Outfit', sans-serif;
  --body: 'Outfit', sans-serif;
  --mono: 'Outfit', sans-serif;
  --radius-box: 22px;
  --radius: 22px;
  --radius-sm: 14px;
}

body {
  background:
    radial-gradient(circle at 82% -5%, rgba(255, 167, 0, .18), transparent 32rem),
    radial-gradient(circle at 22% 105%, rgba(180, 30, 58, .08), transparent 28rem),
    #FBF7EE;
  background-attachment: fixed;
}

.app-shell { gap: 1.1rem; padding: 1.1rem; }
.sidebar {
  width: 260px;
  height: calc(100vh - 2.2rem);
  top: 1.1rem;
  padding: 1.5rem 1rem 1rem;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 28px;
  background:
    radial-gradient(circle at 20% 0%, rgba(255,167,0,.22), transparent 17rem),
    linear-gradient(155deg, #1A1512, #2A1B12 72%, #3A210E);
  box-shadow: 0 24px 60px rgba(42, 28, 17, .2);
  overflow: hidden auto;
}
.sidebar .brand {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -.03em;
  padding: .25rem .55rem 1.4rem;
}
.schlosslimo-mark { width: 52px; height: 52px; filter: drop-shadow(0 8px 14px rgba(255,167,0,.22)); }
.nav-link {
  margin: .2rem 0;
  padding: .72rem .8rem;
  border: 0;
  border-radius: 14px;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .025em;
  text-transform: none;
  color: rgba(255,250,240,.7);
}
.nav-link:first-child { border: 0; }
.nav-link:hover { padding-left: 1rem; background: rgba(255,255,255,.07); }
.nav-link.active { color: #1A1512; background: linear-gradient(135deg, #FFDF00, #FFA700); box-shadow: 0 8px 22px rgba(255,167,0,.22); }
.nav-link.active::before { display: none; }
.nav-link.active .nav-icon { color: #1A1512; }
.sidebar-footer { border-top-color: rgba(255,255,255,.12); }

.main-content { max-width: 1450px; padding: 2.2rem clamp(1.1rem, 3vw, 3rem) 5rem; }
.page-header { margin-bottom: 2.1rem; }
.page-header h1 {
  font-weight: 600;
  font-size: clamp(2.4rem, 4.6vw, 4.6rem);
  line-height: .98;
  letter-spacing: -.045em;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: .42rem .72rem;
  border-radius: 999px;
  background: rgba(255,167,0,.13);
  color: #8A4D00;
  font-weight: 600;
  letter-spacing: .08em;
}

.grid { gap: 1.15rem; }
.card {
  padding: 1.45rem;
  border: 1px solid rgba(20,18,16,.08);
  border-radius: 22px;
  background: rgba(255,255,255,.66);
  box-shadow: 0 16px 45px rgba(43,31,19,.07), inset 0 1px 0 rgba(255,255,255,.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.card:hover { transform: translateY(-3px); border-color: rgba(255,167,0,.25); box-shadow: 0 22px 54px rgba(43,31,19,.11); }
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.3), transparent 38%);
}
.card h2, .card h3 { font-weight: 600; }
.stat-value { font-weight: 600; color: #1A1512; }

button, .button-link {
  min-height: 42px;
  padding: .65rem 1.05rem;
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
button::before { border-radius: inherit; }
button.primary {
  color: #1A1512;
  background: linear-gradient(135deg, #FFDF00, #FFA700);
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(255,167,0,.2);
}
button.primary::before { background: #1A1512; }
button.primary:hover { color: #fff; transform: translateY(-2px); }
input, select, textarea {
  padding: .75rem .9rem;
  border: 1px solid rgba(20,18,16,.13);
  border-radius: 12px;
  background: rgba(255,255,255,.72);
}
input:hover, select:hover, textarea:hover { border-color: rgba(255,167,0,.5); }
input:focus, select:focus, textarea:focus { border-color: #FFA700; box-shadow: 0 0 0 4px rgba(255,167,0,.12); }
label { text-transform: none; letter-spacing: .02em; font-weight: 500; }

.todo-list, .activity-list, .folder-list { border-radius: 18px; overflow: hidden; }
.todo-row { padding: 1rem; border-color: rgba(20,18,16,.08); }
.todo-row:hover { padding-left: 1.25rem; background: rgba(255,167,0,.08); }
.todo-check { border-radius: 50%; }
.modal-overlay { background: rgba(26,21,18,.52); backdrop-filter: blur(8px); }
.modal { border-radius: 26px; border: 1px solid rgba(255,255,255,.5); box-shadow: 0 30px 90px rgba(26,21,18,.3); }

.login-screen {
  padding: 1.2rem;
  background:
    radial-gradient(circle at 75% 25%, rgba(255,223,0,.55), transparent 25rem),
    radial-gradient(circle at 25% 85%, rgba(180,30,58,.18), transparent 28rem),
    #FBF7EE;
}
.login-card {
  max-width: 480px;
  padding: 2.4rem;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 30px;
  background: rgba(255,255,255,.68);
  box-shadow: 0 28px 80px rgba(42,28,17,.15);
  backdrop-filter: blur(20px);
}
.login-card h1 { font-weight: 600; font-size: clamp(2.6rem, 6vw, 4rem); }
.login-logo { width: 108px; height: 108px; }

@media (max-width: 760px) {
  .app-shell { display: block; padding: 0; }
  .mobile-topbar { background: rgba(251,247,238,.88); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(20,18,16,.08); }
  .sidebar { height: 100vh; top: 0; border-radius: 0 26px 26px 0; }
  .main-content { padding-top: 1.5rem; }
}

/* Onboarding für neu angelegte Konten */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background:
    radial-gradient(circle at 75% 18%, rgba(255,223,0,.55), transparent 28rem),
    radial-gradient(circle at 18% 88%, rgba(180,30,58,.18), transparent 30rem),
    #FBF7EE;
  transition: opacity .35s ease, transform .35s ease;
}
.onboarding-overlay.leaving { opacity: 0; transform: scale(1.015); }
.onboarding-card {
  width: min(680px, 100%);
  max-height: calc(100vh - 2.4rem);
  overflow: auto;
  padding: clamp(1.5rem, 4vw, 2.8rem);
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 32px;
  background: rgba(255,255,255,.7);
  box-shadow: 0 30px 90px rgba(42,28,17,.16);
  backdrop-filter: blur(22px);
  animation: riseIn .5s var(--ease) both;
}
.onboarding-brand { display: flex; align-items: center; gap: .7rem; font-size: 1.1rem; font-weight: 600; }
.onboarding-brand img { width: 44px; height: 44px; object-fit: contain; }
.onboarding-progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: .45rem; margin: 1.6rem 0 2rem; }
.onboarding-progress span { height: 5px; border-radius: 999px; background: rgba(20,18,16,.1); transition: background .3s ease; }
.onboarding-progress span.active { background: linear-gradient(90deg, #FFDF00, #FFA700); }
.onboarding-icon {
  display: grid; place-items: center;
  width: 62px; height: 62px; margin-bottom: 1.2rem;
  border-radius: 19px;
  color: #1A1512; background: linear-gradient(135deg, #FFDF00, #FFA700);
  box-shadow: 0 12px 28px rgba(255,167,0,.22);
  font-size: 1.45rem;
}
.onboarding-card h1 { margin: .8rem 0 .8rem; font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.onboarding-card > p { color: #514A42; font-size: 1.05rem; line-height: 1.6; }
.onboarding-card ul { list-style: none; padding: 0; margin: 1.5rem 0 2rem; display: grid; gap: .65rem; }
.onboarding-card li { display: flex; align-items: center; gap: .7rem; color: #332B25; }
.onboarding-card li span { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: rgba(255,167,0,.16); color: #935200; font-size: .75rem; font-weight: 700; }
.onboarding-actions { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding-top: 1.2rem; border-top: 1px solid rgba(20,18,16,.09); }
@media (max-width: 560px) {
  .onboarding-overlay { padding: .6rem; }
  .onboarding-card { max-height: calc(100vh - 1.2rem); border-radius: 24px; }
  .onboarding-actions button { padding-inline: .8rem; }
}
