/* slothboard. Gestaltung wie im Konzept: weiß, Amber als einzige Akzentfarbe,
   Mono für Titel und Zahlen. Keine fremden Schriften, das Board lädt nichts
   von außen. */
:root {
  --bg: #ffffff; --ink: #1d1b17; --muted: #6a645a; --line: #e2ddd3; --surface: #f8f6f1; --card: #ffffff;
  --accent: #eb9a12; --accent-ink: #8f5400; --accent-soft: #fdf0d3;
  --claude: #2c6f91; --claude-soft: #e2eff6;
  --warn: #b3261e; --warn-soft: #fbe8e5;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15140f; --ink: #ece7dc; --muted: #a69f91; --line: #37332b; --surface: #1d1b16; --card: #23211b;
    --accent: #f0a630; --accent-ink: #f5bd62; --accent-soft: #3b2d12;
    --claude: #86c3e0; --claude-soft: #173240;
    --warn: #f08c82; --warn-soft: #3f1d1a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0; min-height: 100%;
  background: var(--surface); color: var(--ink);
  font-family: var(--font-body); font-size: 16px; line-height: 1.5;
  display: flex; flex-direction: column;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Kopfzeile */
.bar {
  display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; align-items: center;
  padding: .7rem 1rem; background: var(--card); border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; white-space: nowrap; }
.cursor { display: inline-block; width: .55em; height: .9em; background: var(--accent); margin-left: .08em; vertical-align: -0.06em; animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

.filter { display: flex; flex-wrap: wrap; gap: .15rem .3rem; }
.filter button {
  font-family: var(--font-mono); font-size: .74rem; color: var(--muted);
  background: none; border: 0; border-bottom: 2px solid transparent; padding: .2rem .35rem; cursor: pointer;
}
.filter button:hover { color: var(--ink); }
.filter button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--accent); }

.stand { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); display: flex; gap: .4rem; align-items: center; white-space: nowrap; }
.stand .punkt { width: .5rem; height: .5rem; border-radius: 50%; background: var(--muted); }
.stand.live .punkt { background: var(--accent); }
.stand.weg { color: var(--warn); }
.stand.weg .punkt { background: var(--warn); }

.meters { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-left: auto; align-items: flex-end; }
.meter { width: 10.5rem; font-family: var(--font-mono); font-size: .68rem; display: flex; flex-direction: column; gap: .25rem; font-variant-numeric: tabular-nums; }
.meter .row { display: flex; justify-content: space-between; gap: .5rem; }
.meter .row span:last-child { font-weight: 700; }
.meter .track { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.meter .fill { height: 100%; background: var(--ink); border-radius: 3px; }
.meter.hoch .fill { background: var(--accent); }
.meter .reset { color: var(--muted); }
.meters.alt .meter { opacity: .55; }
.meters-notiz { font-family: var(--font-mono); font-size: .68rem; color: var(--muted); max-width: 16rem; line-height: 1.4; }
.meters.alt .meters-notiz { color: var(--warn); }

/* Zahl in der Kopfzeile: wartet auf dich */
.warten { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); display: flex; gap: .45rem; align-items: baseline; white-space: nowrap; cursor: default; }
.warten[hidden] { display: none; }
.warten b { color: var(--accent-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.warten.nichts b { color: var(--muted); }

.abmelden { margin: 0; }
.abmelden button {
  font-family: var(--font-mono); font-size: .72rem; color: var(--muted); background: none;
  border: 1px solid var(--line); border-radius: 4px; padding: .15rem .55rem; cursor: pointer; white-space: nowrap;
}
.abmelden button:hover { color: var(--ink); border-color: var(--ink); }

/* Login-Seite */
main.login { align-items: center; justify-content: center; padding: 1.5rem 1rem; }
.login-form {
  width: min(22rem, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1.4rem 1.3rem;
  display: flex; flex-direction: column; gap: .7rem;
}
.login-form h1 { font-family: var(--font-mono); font-size: .8rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: .2rem 0 .3rem; }
.login-form label { font-size: .86rem; font-weight: 600; }
.login-form input[type="password"] {
  font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--muted); border-radius: 6px; padding: .5rem .6rem; width: 100%;
}
.login-form button {
  font-family: var(--font-mono); font-size: .86rem; font-weight: 700; color: #1d1b17; background: var(--accent);
  border: 1px solid var(--accent); border-radius: 6px; padding: .5rem .8rem; cursor: pointer;
}
.login-form button:hover { border-color: var(--ink); }
.login-meldung { margin: 0; padding: .5rem .65rem; border-radius: 6px; background: var(--warn-soft); color: var(--warn); font-size: .86rem; }
.login-hinweis { margin: 0; color: var(--muted); font-size: .76rem; }

/* Hinweis, solange es kein Board gibt */
main { flex: 1; display: flex; flex-direction: column; }
.hinweis { margin: 2.5rem auto; max-width: 40rem; padding: 0 1rem; color: var(--muted); }
.hinweis[hidden] { display: none; }
.hinweis.problem {
  color: var(--ink); border: 1px dashed var(--muted); border-radius: 8px; padding: 1rem 1.1rem; background: var(--card);
  display: flex; flex-direction: column; gap: .5rem;
}
.hinweis.problem b { font-family: var(--font-mono); font-size: .85rem; }
.hinweis.problem span { color: var(--muted); font-size: .92rem; }

/* Bahnen: eine Zeile je aktivem Projekt, Spalten Zuletzt, Jetzt, Danach */
.bahnen { padding: 0 1rem; display: flex; flex-direction: column; }
.bahnen[hidden] { display: none; }
.bahn-kopf, .bahn {
  display: grid; column-gap: 1.2rem;
  grid-template-columns: minmax(10rem, 15rem) minmax(0, 1.25fr) minmax(0, 1.15fr) minmax(0, 1.25fr);
}
.bahn-kopf { position: sticky; top: 0; z-index: 1; background: var(--surface); padding-top: 1rem; }
.bahn-spalte > span:first-child { white-space: nowrap; }
.bahn-spalte, .col-head {
  font-family: var(--font-mono); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  display: flex; justify-content: space-between; gap: .5rem; align-items: baseline;
  padding-bottom: .4rem; border-bottom: 2px solid var(--line); margin: 0;
}
.bahn-spalte span:last-child, .col-head span:last-child {
  color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; letter-spacing: 0; text-transform: none; white-space: nowrap;
}
.bahn-spalte.jetzt { border-bottom-color: var(--accent); }
.bahn { padding: .9rem 0; row-gap: .8rem; border-bottom: 1px solid var(--line); align-items: start; }
.bahn-leer { margin: 0; padding: .9rem 0; color: var(--muted); font-size: .86rem; border-bottom: 1px solid var(--line); }

.bahn-projekt { display: flex; flex-direction: column; gap: .55rem; align-items: flex-start; min-width: 0; }
.bahn-titel {
  background: none; border: 0; padding: 0; text-align: left; cursor: pointer; min-width: 0;
  display: flex; flex-direction: column; gap: .3rem; align-items: flex-start;
}
.bahn-titel .t { font-weight: 600; font-size: .95rem; line-height: 1.3; overflow-wrap: anywhere; }
.bahn-titel:hover .t { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .2em; }
.bahn-titel .b, .kcard .b { font-family: var(--font-mono); font-size: .64rem; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }

/* Offene Entscheidungen: nur ein Zähler am Projekt, die Liste klappt auf */
.zaehler {
  font-family: var(--font-mono); font-size: .68rem; line-height: 1.5; color: var(--accent-ink);
  background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 4px; padding: .05rem .45rem;
  display: inline-flex; gap: .4rem; align-items: center; white-space: nowrap; cursor: pointer;
}
.zaehler:hover { border-color: var(--ink); }
.zaehler .pfeil { font-size: .6rem; transition: transform .12s; }
.zaehler[aria-expanded="true"] .pfeil { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .zaehler .pfeil { transition: none; } }
.bahn-offen {
  grid-column: 2 / -1; grid-row: 2; min-width: 0;
  display: flex; flex-direction: column; gap: .6rem; border-left: 2px solid var(--accent); padding: .1rem 0 .1rem .8rem;
}
.bahn-offen[hidden] { display: none; }
.eliste { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .6rem 1.2rem; }
.eliste li { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.eliste .q { font-weight: 600; font-size: .82rem; line-height: 1.35; overflow-wrap: anywhere; }
.eliste .q b { font-family: var(--font-mono); font-size: .72rem; color: var(--accent-ink); margin-right: .4rem; }
.eliste .s { color: var(--muted); font-size: .76rem; line-height: 1.4; overflow-wrap: anywhere; }
.bahn-offen .wie { margin: 0; color: var(--muted); font-size: .76rem; }

.zelle { display: flex; flex-direction: column; gap: .45rem; min-width: 0; align-items: flex-start; }
.zelle > .scard { width: 100%; }
.zelle-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: 0; }
.leer { color: var(--muted); font-size: .76rem; padding: .2rem .1rem; }

/* Zuletzt: Einträge aus dem Log */
.lcard { display: grid; grid-template-columns: 2.7rem minmax(0, 1fr); column-gap: .5rem; align-items: start; width: 100%; }
.lcard .k { font-family: var(--font-mono); font-size: .68rem; line-height: 1.12rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.lcard .n { font-size: .8rem; line-height: 1.12rem; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }

/* Jetzt: Arbeitspaket und nächster Schritt */
.paket { font-weight: 700; font-size: .95rem; line-height: 1.3; overflow-wrap: anywhere; }
.scard {
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 6px; padding: .55rem .65rem;
  display: flex; flex-direction: column; gap: .3rem; align-items: flex-start; text-align: left; cursor: pointer;
}
.scard:hover { border-color: var(--ink); }
.scard .n { font-size: .86rem; line-height: 1.4; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; line-clamp: 6; overflow: hidden; }
.scard.vorschlag { border-style: dashed; border-color: var(--accent); }

/* Danach: Rest des nächsten Schritts und Punkte aus "Offen" */
.punkte { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; width: 100%; }
.punkte li { position: relative; padding-left: .85rem; display: flex; flex-direction: column; gap: .2rem; align-items: flex-start; min-width: 0; }
.punkte li::before { content: ""; position: absolute; left: .05rem; top: .42rem; width: .32rem; height: .32rem; border-radius: 50%; background: var(--muted); }
.punkte .n { font-size: .8rem; line-height: 1.12rem; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.mehr { font-family: var(--font-mono); font-size: .68rem; color: var(--muted); background: none; border: 0; padding: 0; text-align: left; }
button.mehr { cursor: pointer; text-decoration: underline dotted; text-underline-offset: .2em; }
button.mehr:hover { color: var(--ink); }

/* Übrige Projekte: Spalten nach Status */
.abschnitt {
  font-family: var(--font-mono); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin: 0; padding: 1.6rem 1rem 0;
}
.abschnitt[hidden] { display: none; }
.board { display: grid; gap: .9rem; padding: .8rem 1rem 1.5rem; overflow-x: auto; align-items: start; }
.board[hidden] { display: none; }
.col { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.col-karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .5rem; align-items: start; }

.kcard {
  background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: .6rem .65rem;
  display: flex; flex-direction: column; gap: .35rem; text-align: left; cursor: pointer; width: 100%;
}
.kcard:hover { border-color: var(--muted); }
.kcard .t { font-weight: 600; font-size: .86rem; line-height: 1.3; overflow-wrap: anywhere; }
.kcard .n { color: var(--muted); font-size: .76rem; line-height: 1.4; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.tag { font-family: var(--font-mono); font-size: .66rem; font-weight: 500; line-height: 1.5; padding: 0 .4rem; border-radius: 4px; border: 1px solid transparent; white-space: nowrap; }
.tag.entscheidung { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); }
.tag.still, .tag.warnung { background: var(--warn-soft); color: var(--warn); }
.tag.alter { color: var(--muted); padding-left: 0; }

/* Detailansicht */
dialog {
  width: min(58rem, calc(100vw - 1.5rem)); max-height: calc(100dvh - 1.5rem);
  border: 1px solid var(--line); border-radius: 10px; padding: 0; background: var(--bg); color: var(--ink);
}
dialog::backdrop { background: rgb(0 0 0 / .45); }
.detail { display: flex; flex-direction: column; max-height: calc(100dvh - 1.5rem); }
.detail-head { display: flex; gap: 1rem; align-items: flex-start; padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); background: var(--card); }
.detail-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.detail-head h2 { font-family: var(--font-mono); font-weight: 700; font-size: 1.1rem; line-height: 1.3; margin: 0; overflow-wrap: anywhere; }
.detail-head .m { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); overflow-wrap: anywhere; }
.zu { font-family: var(--font-mono); font-size: .74rem; border: 1px solid var(--ink); border-radius: 4px; padding: .2rem .6rem; background: var(--card); cursor: pointer; white-space: nowrap; }
.detail-body { overflow-y: auto; padding: 1.1rem; display: flex; flex-direction: column; gap: 1.25rem; }
.block { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.block-label { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0; font-weight: 500; }
.block > p { margin: 0; font-size: .95rem; }
.dlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.dlist li { background: var(--card); border: 1px solid var(--accent); border-radius: 6px; padding: .6rem .75rem; display: flex; flex-direction: column; gap: .25rem; }
.dlist .q { font-weight: 600; font-size: .9rem; }
.dlist .q b { font-family: var(--font-mono); font-size: .76rem; color: var(--accent-ink); margin-right: .4rem; }
.dlist .s { color: var(--muted); font-size: .82rem; }
.dlist li.vorschlag { border-style: dashed; }
.block > p.wie { color: var(--muted); font-size: .8rem; }

.md { font-size: .9rem; line-height: 1.55; display: flex; flex-direction: column; gap: .6rem; min-width: 0; overflow-wrap: anywhere; }
.md p, .md ul, .md ol, .md blockquote, .md pre { margin: 0; }
.md ul, .md ol { padding-left: 1.2rem; display: flex; flex-direction: column; gap: .3rem; }
.md li > ul, .md li > ol { margin-top: .3rem; }
.md li.kasten { list-style: none; position: relative; }
.md li.kasten::before { content: ""; position: absolute; left: -1.15rem; top: .32em; width: .7em; height: .7em; border: 1.5px solid var(--accent); border-radius: 2px; }
.md li.kasten.erledigt { color: var(--muted); }
.md li.kasten.erledigt::before { background: var(--muted); border-color: var(--muted); }
.md h2, .md h3, .md h4, .md h5, .md h6 { font-family: var(--font-mono); font-size: .86rem; margin: .3rem 0 0; }
.md code { font-family: var(--font-mono); font-size: .86em; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: .05em .3em; }
.md pre { font-family: var(--font-mono); font-size: .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .8rem; overflow-x: auto; }
.md pre code { background: none; border: 0; padding: 0; }
.md blockquote { border-left: 3px solid var(--line); padding-left: .8rem; color: var(--muted); }
.md a { color: var(--accent-ink); }
.md .wl { border-bottom: 1px dashed var(--muted); }
.md hr { border: 0; border-top: 1px dashed var(--line); width: 100%; margin: .2rem 0; }
.md .tabelle { overflow-x: auto; }
.md table { border-collapse: collapse; font-size: .85rem; }
.md th, .md td { text-align: left; padding: .35rem .7rem .35rem 0; border-bottom: 1px dashed var(--line); vertical-align: top; }
.md th { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--ink); }

@media (max-width: 1150px) {
  .bahn-spalte:not(.projekt) span:last-child { display: none; }
}

/* Schmale Fenster: Die Bahn wird zum Stapel, jede Zelle zeigt ihre Überschrift. */
@media (max-width: 900px) {
  .meters { margin-left: 0; }
  .bahn-kopf { display: none; }
  .bahnen { padding-top: .4rem; }
  .bahn { display: flex; flex-direction: column; gap: .8rem; align-items: stretch; padding: 1rem 0; }
  .zelle.nichts { display: none; }
  .zelle-label {
    position: static; width: auto; height: auto; overflow: visible; clip-path: none;
    font-family: var(--font-mono); font-size: .66rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  }
  .eliste { grid-template-columns: 1fr; }
  .board { display: flex; flex-direction: column; gap: 1.2rem; }
}
