/* Setter-App: Design-System Thomas (dunkel, Karten #141414, Orange nur für das, was auf dich wartet, DM Sans, max. 480 px) */
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 100 1000; font-display: swap; src: url('/fonts/dm-sans-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 100 1000; font-display: swap; src: url('/fonts/dm-sans-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #0a0a0a; --karte: #141414; --karte2: #1c1c1c; --linie: #242424; --text: #f2f2f2; --leise: #9a9a9a; --matt: #6b6b6b;
  --orange: #ee4f00; --orange-weich: rgba(238, 79, 0, 0.14); --rot: #ff6b5a; --gruen: #4cc38a; --gruen-weich: rgba(76, 195, 138, 0.13);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.45 'DM Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
#app {
  max-width: 480px; margin: 0 auto; min-height: 100vh;
  padding: calc(env(safe-area-inset-top) + 12px) 16px calc(env(safe-area-inset-bottom) + 24px);
}
h1 { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: 15px; font-weight: 600; margin: 0; display: flex; gap: 8px; align-items: baseline; }
h2 span { color: var(--matt); font-weight: 500; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
.klein { font-size: 13px; color: var(--leise); }
.karte { background: var(--karte); border-radius: 16px; padding: 16px; }
.fehler { color: var(--rot); font-size: 14px; }
.fehler.oben { margin: 0 0 12px; }

/* Knöpfe */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px; border: 0; border-radius: 12px;
  background: var(--text); color: #0a0a0a; font-weight: 600; font-size: 15px;
}
.knopf.voll { width: 100%; }
.knopf.zweit { background: var(--karte2); color: var(--text); }
.knopf.leise { color: var(--leise); }
.knopf:disabled { opacity: 0.5; }
.knopf:active { transform: scale(0.98); }

/* Anmeldung */
.anmeldung { display: flex; flex-direction: column; gap: 16px; padding-top: 10vh; }
.marke { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.marke img { border-radius: 14px; }
.marke p { color: var(--leise); }
#anmelden { display: flex; flex-direction: column; gap: 12px; }
#anmelden label { font-weight: 600; }
#anmelden input {
  width: 100%; min-height: 52px; padding: 0 14px; border: 1px solid var(--linie); border-radius: 12px; background: var(--bg); color: var(--text);
  font: 500 17px/1 'DM Sans', system-ui, sans-serif; letter-spacing: 0.06em; text-transform: uppercase;
}
#anmelden input:focus { outline: none; border-color: var(--leise); }
.hinweis b { display: block; margin-bottom: 4px; }
.hinweis p { color: var(--leise); font-size: 14px; }
.teilen { display: inline-block; width: 14px; height: 16px; vertical-align: -2px; border: 1.5px solid var(--leise); border-top: 0; border-radius: 0 0 3px 3px; position: relative; margin-right: 2px; }
.teilen::before { content: ''; position: absolute; left: 50%; top: -6px; width: 1.5px; height: 11px; background: var(--leise); transform: translateX(-50%); }

/* Kopf */
.kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin-bottom: 14px; }
.nutzer { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--karte2); font-weight: 600; }
.zurueck { color: var(--leise); font-size: 16px; padding: 8px 8px 8px 0; white-space: nowrap; }
.chatkopf { justify-content: flex-start; position: sticky; top: 0; z-index: 2; background: var(--bg); margin: 0 -16px 12px; padding: calc(env(safe-area-inset-top) + 4px) 16px 8px; }
.wer { display: flex; flex-direction: column; min-width: 0; }
.wer b, .wer span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wer span { color: var(--leise); font-size: 13px; }

.banner { background: var(--karte); border-radius: 12px; padding: 10px 14px; font-size: 13px; color: var(--leise); margin-bottom: 12px; }
.banner b { color: var(--text); font-weight: 600; }

/* Kacheln */
.kacheln { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.kachel { min-width: 0; background: var(--karte); border: 1px solid transparent; border-radius: 14px; padding: 12px 8px 10px; text-align: left; display: flex; flex-direction: column; justify-content: flex-start; }
.kachel b { display: block; font-size: 24px; font-weight: 650; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kachel span { display: block; font-size: 11.5px; color: var(--leise); line-height: 1.25; margin-top: 4px; }
.kachel.warm b { color: var(--orange); }
.kachel.an { border-color: var(--leise); }

.werkzeuge { display: flex; gap: 8px; margin-bottom: 18px; }
.werkzeuge input {
  flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--karte); color: var(--text);
  font: inherit; font-size: 15px;
}
.werkzeuge input:focus { outline: 1px solid var(--linie); }
.filter { height: 40px; padding: 0 12px; border: 1px solid transparent; border-radius: 10px; background: var(--karte); color: var(--leise); font-size: 14px; white-space: nowrap; }
.filter.an { color: var(--text); border-color: var(--leise); }

/* Abschnitte und Zeilen */
.abschnitt { margin-bottom: 22px; }
.erkl { font-size: 13px; color: var(--matt); margin: 2px 0 10px; }
.liste { padding: 4px 0; }
.zeile { display: flex; gap: 12px; padding: 12px 16px; align-items: flex-start; }
.zeile + .zeile { border-top: 1px solid var(--linie); }
.zeile:active { background: var(--karte2); }
.avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--karte2); display: grid; place-items: center;
  font-weight: 600; color: var(--leise);
}
.avatar.warm { background: var(--orange-weich); color: var(--orange); }
.mitte { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.oben { display: flex; justify-content: space-between; gap: 8px; }
.oben b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oben time { flex: none; color: var(--matt); font-size: 13px; }
.text { color: var(--leise); font-size: 14px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.du { color: var(--matt); }
.unten { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 2px; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--karte2); color: var(--leise); }
.chip.warm { background: var(--orange-weich); color: var(--orange); }
.chip.gut { background: var(--gruen-weich); color: var(--gruen); }
.fenster { font-size: 12px; color: var(--matt); }
.grund { font-size: 13px; color: var(--leise); overflow-wrap: anywhere; }
.mehr { width: 100%; margin-top: 8px; height: 44px; border: 0; border-radius: 12px; background: var(--karte); color: var(--leise); }
.nichts { color: var(--matt); font-size: 14px; padding: 4px 0; }
.leer { text-align: center; color: var(--leise); padding: 48px 12px; display: flex; flex-direction: column; gap: 16px; align-items: center; }
.stand { text-align: center; color: var(--matt); font-size: 12px; margin-top: 8px; }

/* Laden */
.skelett { pointer-events: none; }
.zeile.skelett { background: var(--karte); border-radius: 16px; margin-bottom: 8px; }
.zeile.skelett .mitte span { height: 12px; border-radius: 6px; background: var(--karte2); }
.zeile.skelett .mitte span:first-child { width: 45%; }
.zeile.skelett .mitte span:last-child { width: 80%; margin-top: 6px; }
.lade { animation: pulsieren 1.4s ease-in-out infinite alternate; }
@keyframes pulsieren { from { opacity: 0.55; } to { opacity: 1; } }

/* Chat */
.lage { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.lage > div { display: flex; flex-wrap: wrap; gap: 6px; }
.lage.warm { box-shadow: inset 0 0 0 1px rgba(238, 79, 0, 0.35); }
.call { display: flex; align-items: center; gap: 12px; margin: -8px 0 16px; padding: 12px 12px 12px 16px; }
.call > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.call .knopf { flex: none; min-height: 40px; padding: 0 14px; font-size: 14px; }
.call.ja b { color: var(--gruen); }
.verlauf { display: flex; flex-direction: column; gap: 6px; padding-bottom: 180px; }
.tag { align-self: center; font-size: 12px; color: var(--matt); margin: 12px 0 4px; }
.blase { max-width: 82%; padding: 9px 12px 6px; border-radius: 18px; background: var(--karte2); align-self: flex-start; overflow-wrap: anywhere; }
.blase.raus { align-self: flex-end; background: #2b2b2b; }
.blase p { white-space: pre-wrap; }
.blase time { display: block; font-size: 11px; color: var(--matt); margin-top: 2px; text-align: right; }
.blase.skelett { width: 60%; height: 44px; }
.anhang { display: inline-block; font-size: 13px; color: var(--leise); font-style: italic; }
.entwurf {
  align-self: flex-end; max-width: 82%; border: 1px dashed #3a3a3a; border-radius: 16px; padding: 8px 12px 10px; margin: 2px 0 6px;
  display: flex; flex-direction: column; gap: 6px;
}
.entwurf .etikett { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--matt); }
.entwurf p { color: var(--leise); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.entwurf.stopp { border-color: rgba(238, 79, 0, 0.5); }
.entwurf.stopp .etikett { color: var(--orange); }

.leiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; background: rgba(10, 10, 10, 0.96); border-top: 1px solid var(--linie);
  padding: 12px max(16px, calc(50vw - 224px)) calc(env(safe-area-inset-bottom) + 12px);
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.leiste > a { grid-column: 1 / -1; }
.leiste > button:only-of-type { grid-column: 1 / -1; }
.leiste .klein { grid-column: 1 / -1; text-align: center; }

/* Blatt und Meldung */
.blatt { position: fixed; inset: 0; z-index: 10; background: rgba(0, 0, 0, 0.6); display: flex; align-items: flex-end; justify-content: center; padding: 16px 16px calc(env(safe-area-inset-bottom) + 16px); }
.blatt .karte { width: 100%; max-width: 448px; display: flex; flex-direction: column; gap: 10px; }
#toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 150px); transform: translateX(-50%); z-index: 20;
  background: var(--text); color: #0a0a0a; font-weight: 600; font-size: 14px; padding: 10px 16px; border-radius: 12px; max-width: calc(100vw - 32px);
}
#toast[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .lade { animation: none; } .knopf:active { transform: none; } }
