/* vOCUS.1 - Gestaltung. Bereichsfarbe = Reiter links an jedem Task. */
@font-face { font-family: "Plex"; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex"; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex"; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }

:root {
  --bg: #EDF0F3;
  --flaeche: #FFFFFF;
  --flaeche-2: #F4F6F8;
  --tinte: #17212B;
  --tinte-2: #586673;
  --linie: #DCE2E8;
  --linie-stark: #B4BFCA;
  --akzent: #0C6B70;
  --akzent-tinte: #FFFFFF;
  --akzent-weich: #DDEFEF;
  --warn: #B3311C;
  --warn-weich: #FBE9E5;
  --heute: #8A5200;
  --schatten: 0 1px 2px rgba(23, 33, 43, .06), 0 8px 24px rgba(23, 33, 43, .10);
  --nav-hoehe: 58px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F151B;
    --flaeche: #182029;
    --flaeche-2: #1F2933;
    --tinte: #E6EBF0;
    --tinte-2: #9BA9B6;
    --linie: #2A3540;
    --linie-stark: #485867;
    --akzent: #56BFB9;
    --akzent-tinte: #062322;
    --akzent-weich: #143335;
    --warn: #FF8F78;
    --warn-weich: #3A1D18;
    --heute: #F0B45A;
    --schatten: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--tinte);
  font: 400 15px/1.45 "Plex", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
code { font-family: ui-monospace, "Cascadia Mono", Menlo, monospace; font-size: .92em; background: var(--flaeche-2); padding: 1px 5px; border-radius: 4px; }

.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.start { padding: 48px 24px; color: var(--tinte-2); }
.wortmarke { font-size: 17px; font-weight: 600; letter-spacing: .01em; }
.wortmarke span { font-weight: 400; color: var(--tinte-2); }

/* ---------- Eingabefelder und Knoepfe ---------- */
input[type="text"], input[type="search"], input[type="email"], input[type="password"],
input[type="date"], input[type="datetime-local"], select, textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  background: var(--flaeche);
  border: 1px solid var(--linie-stark);
  border-radius: 6px;
  font-size: 16px;
}
textarea { resize: vertical; line-height: 1.4; }
input::placeholder, textarea::placeholder { color: var(--tinte-2); opacity: .8; }
input[type="color"] { width: 40px; height: 40px; padding: 2px; border: 1px solid var(--linie-stark); border-radius: 6px; background: var(--flaeche); }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 14px;
  background: var(--flaeche); border: 1px solid var(--linie-stark); border-radius: 6px;
  font-weight: 500; white-space: nowrap;
}
.knopf:hover:not(:disabled) { border-color: var(--tinte-2); }
.knopf:disabled { opacity: .45; cursor: default; }
.knopf.an { background: var(--akzent-weich); border-color: var(--akzent); }
.knopf-haupt { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-tinte); }
.knopf-haupt.an { background: var(--akzent); box-shadow: 0 0 0 3px var(--akzent-weich); }
.knopf-still { border-color: transparent; background: transparent; padding: 0 10px; color: var(--tinte-2); }
.knopf-still:hover:not(:disabled) { background: var(--flaeche-2); border-color: transparent; color: var(--tinte); }

.feld { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; color: var(--tinte-2); }
.feld-hinweis { font-size: 13px; font-weight: 400; color: var(--tinte-2); }
.reihe { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px; }
.wachsen { flex: 1 1 200px; }
.schalter { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--tinte-2); white-space: nowrap; }
.schalter input { width: 18px; height: 18px; accent-color: var(--akzent); }

.zahl { font-size: 12px; font-weight: 500; color: var(--tinte-2); background: var(--flaeche-2); border-radius: 10px; padding: 1px 7px; }
.zahl-akzent { background: var(--akzent); color: var(--akzent-tinte); }
.hinweis { font-size: 13px; color: var(--tinte-2); }
.hinweis-warn { color: var(--warn); font-weight: 500; }
.hinweis-heute { color: var(--heute); font-weight: 500; }
.mit-icon { display: inline-flex; align-items: center; gap: 3px; }
.mit-icon .icon { width: 14px; height: 14px; }
.marke {
  font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 4px;
  color: color-mix(in srgb, var(--farbe) 72%, var(--tinte));
  background: color-mix(in srgb, var(--farbe) 14%, var(--flaeche));
}
.leer { padding: 20px 4px; color: var(--tinte-2); }
.ansicht-hinweis { color: var(--tinte-2); font-size: 14px; margin-bottom: 10px; max-width: 70ch; }

/* ---------- Grundaufbau (Handy zuerst) ---------- */
.app { min-height: 100vh; min-height: 100dvh; padding-bottom: calc(var(--nav-hoehe) + env(safe-area-inset-bottom)); }
.haupt { padding: 0 12px 24px; }
.kopf { position: sticky; top: 0; z-index: 5; margin: 0 -12px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; background: var(--bg); border-bottom: 1px solid var(--linie); }

.nav { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; background: var(--flaeche); border-top: 1px solid var(--linie); padding-bottom: env(safe-area-inset-bottom); }
.nav .wortmarke { display: none; }
.nav ul { display: flex; }
.nav li { flex: 1 1 0; min-width: 0; }
.nav button {
  position: relative; width: 100%; height: var(--nav-hoehe);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: none; border: 0; color: var(--tinte-2); font-size: 10.5px; font-weight: 500;
}
.nav button.an { color: var(--akzent); }
.nav .nav-name { display: none; }
.nav .zahl { position: absolute; top: 5px; left: calc(50% + 4px); font-size: 10.5px; padding: 0 5px; }

/* ---------- Erfassung ---------- */
.erfassung-zeile { display: flex; gap: 6px; }
.erfassung-zeile input { flex: 1 1 auto; min-width: 0; border-color: var(--linie-stark); }
.erfassung-zeile input:focus { border-color: var(--akzent); outline: 2px solid var(--akzent-weich); outline-offset: 0; }
.erfassung-vorschau { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.erfassung-hilfe { margin-top: 6px; font-size: 13px; color: var(--tinte-2); line-height: 1.7; }
.erfassung .knopf-still { display: none; }

/* ---------- Ansichtskopf und Filter ---------- */
.ansicht-kopf { padding: 16px 0 12px; }
.ansicht-kopf h1 { font-size: 24px; font-weight: 600; line-height: 1.2; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.ansicht-kopf .datum { font-size: 15px; font-weight: 400; color: var(--tinte-2); }
.filter { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.filter-bereiche { display: flex; gap: 6px; overflow-x: auto; margin: 0 -12px; padding: 2px 12px; scrollbar-width: none; }
.filter-bereiche::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  min-height: 32px; padding: 0 11px; border-radius: 16px;
  background: var(--flaeche); border: 1px solid var(--linie); font-size: 14px; white-space: nowrap;
}
.chip .punkt { width: 9px; height: 9px; border-radius: 2px; background: var(--farbe); }
.chip-an { border-color: var(--tinte); background: var(--tinte); color: var(--bg); }
.filter-rest { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-items: center; }
.filter-rest input[type="search"] { grid-column: 1 / -1; }
.filter-rest select, .filter-rest input { min-height: 36px; padding: 5px 8px; }

/* ---------- Tasks ---------- */
.spalte-schmal { max-width: 820px; }
.liste { display: flex; flex-direction: column; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; overflow: hidden; }
.liste:empty { display: none; }
.task { position: relative; display: flex; align-items: flex-start; border-top: 1px solid var(--linie); padding-left: 6px; }
.task:first-child { border-top: 0; }
.task::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--farbe); }
.haken {
  flex: none; width: 22px; height: 22px; margin: 13px 4px 0 12px; padding: 0;
  border: 1.5px solid var(--linie-stark); border-radius: 50%; background: var(--flaeche);
  display: flex; align-items: center; justify-content: center; color: var(--akzent-tinte);
}
.haken::after { content: ""; position: absolute; width: 44px; height: 44px; margin: 0; }
.haken:hover { border-color: var(--akzent); background: var(--akzent-weich); }
.haken .icon { width: 14px; height: 14px; stroke-width: 2.6; }
.task-erledigt .haken { background: var(--akzent); border-color: var(--akzent); }
.task-inhalt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; text-align: left; background: none; border: 0; padding: 11px 12px 11px 8px; }
.task-inhalt:hover .task-titel { text-decoration: underline; text-decoration-color: var(--linie-stark); text-underline-offset: 3px; }
.task-titel { font-size: 16px; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.task-hoch .task-titel { font-weight: 600; }
.task-erledigt .task-titel { color: var(--tinte-2); font-weight: 400; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 9px; }
.bereich-name { font-size: 13px; font-weight: 600; color: color-mix(in srgb, var(--farbe) 75%, var(--tinte)); }
.bereich-fehlt { font-weight: 400; color: var(--tinte-2); }
.task-zusatz { font-size: 13px; color: var(--tinte-2); overflow-wrap: anywhere; }

.gruppe { margin-top: 22px; }
.gruppe:first-child { margin-top: 0; }
.gruppe h2 { font-size: 15px; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.gruppe-ueber h2 { color: var(--warn); }
.gruppe > .knopf { margin-bottom: 10px; }
.band { display: block; width: 100%; text-align: left; margin-bottom: 18px; padding: 10px 12px; background: var(--akzent-weich); border: 1px solid color-mix(in srgb, var(--akzent) 35%, transparent); border-radius: 8px; font-weight: 500; }

/* ---------- Board ---------- */
.segment { display: flex; background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: 8px; padding: 3px; gap: 2px; margin-bottom: 10px; }
.segment button { flex: 1 1 0; min-width: 0; min-height: 34px; border: 0; border-radius: 6px; background: none; font-size: 13px; font-weight: 500; color: var(--tinte-2); display: flex; align-items: center; justify-content: center; gap: 5px; padding: 0 4px; }
.segment button.an { background: var(--flaeche); color: var(--tinte); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.segment .zahl { background: none; padding: 0; }
.segment-klein { margin-bottom: 0; }
.board-spalte { display: none; }
.board-spalte.mobil-an { display: block; }
.board-spalte h2 { display: none; }
.spalten-hinweis { font-size: 13px; color: var(--tinte-2); margin-bottom: 6px; }
.board .liste { background: none; border: 0; border-radius: 0; overflow: visible; gap: 6px; }
.task-karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 6px; overflow: hidden; }
.task-karte:first-child { border-top: 1px solid var(--linie); }
.task-karte[draggable="true"] { cursor: grab; }

/* ---------- Stammdaten, Einstellungen ---------- */
.tabelle-rahmen { overflow-x: auto; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; }
.stamm table { width: 100%; border-collapse: collapse; min-width: 560px; }
.stamm th { text-align: left; font-size: 13px; font-weight: 500; color: var(--tinte-2); padding: 8px 8px 4px; }
.stamm td { padding: 5px 8px; border-top: 1px solid var(--linie); vertical-align: middle; }
.stamm tr.inaktiv input[type="text"] { color: var(--tinte-2); }
.stamm .aktionen { white-space: nowrap; text-align: right; }
.stamm .kurz { width: 110px; }
.stamm-neu { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.stamm-neu input[type="text"] { flex: 1 1 140px; width: auto; }
.stamm-neu .kurz { flex: 0 1 110px; }
.geraete { margin-top: 12px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; }
.geraete li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 6px 6px 12px; border-top: 1px solid var(--linie); }
.geraete li:first-child { border-top: 0; }
.changelog { margin: 10px 0; }
.changelog ul { list-style: disc; padding-left: 20px; color: var(--tinte-2); }

/* ---------- Editor ---------- */
.editor-huelle { position: fixed; inset: 0; z-index: 20; background: rgba(15, 21, 27, .45); display: flex; justify-content: flex-end; }
.editor-huelle.mitte { align-items: center; justify-content: center; padding: 16px; }
.editor { width: 100%; max-width: 560px; height: 100%; background: var(--bg); display: flex; flex-direction: column; border-top: 6px solid var(--farbe, var(--linie-stark)); box-shadow: var(--schatten); animation: herein .16s ease-out; }
@keyframes herein { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .editor { animation: none; } }
.editor-kopf { display: flex; align-items: center; justify-content: space-between; padding: calc(6px + env(safe-area-inset-top)) 6px 0 16px; }
.editor-status { font-size: 13px; font-weight: 500; color: var(--tinte-2); }
.editor-inhalt { flex: 1 1 auto; overflow-y: auto; padding: 4px 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.editor-titel { font-size: 20px; font-weight: 600; line-height: 1.25; border-color: transparent; background: transparent; padding: 6px 8px; margin: 0 -8px; width: calc(100% + 16px); resize: none; }
.editor-titel:hover, .editor-titel:focus { border-color: var(--linie-stark); background: var(--flaeche); }
.wechsel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.frage { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; padding: 12px; background: var(--akzent-weich); border-radius: 8px; }
.frage .feld { color: var(--tinte); }
.raster { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.raster .feld { min-width: 0; }
.verlauf h3 { font-size: 15px; font-weight: 600; }
.verlauf .reihe { margin-top: 8px; }
.verlauf ol { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.verlauf li { display: flex; flex-direction: column; padding-left: 10px; border-left: 2px solid var(--akzent); overflow-wrap: anywhere; white-space: pre-wrap; }
.verlauf li.system { border-left-color: var(--linie-stark); color: var(--tinte-2); font-size: 14px; }
.verlauf time { font-size: 12px; color: var(--tinte-2); }
.editor-fuss { display: flex; justify-content: space-between; gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--linie); background: var(--flaeche); }
.dialog { width: 100%; max-width: 440px; background: var(--flaeche); border-radius: 10px; padding: 18px; box-shadow: var(--schatten); }
.dialog .reihe { justify-content: flex-end; }

/* ---------- Meldungen, Anmeldung ---------- */
.meldungen { position: fixed; z-index: 30; left: 12px; right: 12px; bottom: calc(var(--nav-hoehe) + env(safe-area-inset-bottom) + 10px); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.meldung { padding: 9px 14px; border-radius: 8px; background: var(--tinte); color: var(--bg); font-size: 14px; font-weight: 500; box-shadow: var(--schatten); max-width: 520px; }
.meldung-fehler { background: var(--warn-weich); color: var(--warn); border: 1px solid var(--warn); }
p.meldung { box-shadow: none; max-width: none; }
.anmeldung { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.anmeldung form { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 14px; }
.anmeldung .wortmarke { font-size: 26px; }

/* ---------- Ab Tablet/Desktop ---------- */
@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 212px minmax(0, 1fr); padding-bottom: 0; }
  .nav { position: sticky; top: 0; height: 100vh; border-top: 0; border-right: 1px solid var(--linie); background: var(--bg); padding: 18px 10px; }
  .nav .wortmarke { display: block; padding: 0 10px 18px; }
  .nav ul { flex-direction: column; gap: 2px; }
  .nav li { flex: none; }
  .nav li.nav-trenner { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--linie); }
  .nav button { flex-direction: row; justify-content: flex-start; gap: 10px; height: 38px; padding: 0 10px; border-radius: 6px; font-size: 15px; color: var(--tinte); }
  .nav button:hover { background: var(--flaeche-2); }
  .nav button.an { background: var(--flaeche); color: var(--tinte); font-weight: 600; box-shadow: inset 3px 0 0 var(--akzent); }
  .nav .nav-name { display: inline; flex: 1 1 auto; text-align: left; }
  .nav .nav-kurz { display: none; }
  .nav .zahl { position: static; font-size: 12px; padding: 1px 7px; }
  .haupt { padding: 0 28px 40px; }
  .kopf { margin: 0 -28px; padding: 14px 28px 12px; }
  .erfassung { max-width: 820px; }
  .erfassung .knopf-still { display: inline-flex; }
  .ansicht-kopf { padding-top: 22px; }
  .filter { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
  .filter-bereiche { margin: 0; padding: 2px 0; flex-wrap: wrap; overflow: visible; }
  .filter-rest { display: flex; gap: 6px; }
  .filter-rest select { width: auto; }
  .filter-rest input[type="search"] { width: 180px; }
  input[type="text"], input[type="search"], input[type="email"], input[type="password"],
  input[type="date"], input[type="datetime-local"], select, textarea { font-size: 15px; }
  .task-titel { font-size: 15px; }
  .segment[role="tablist"] { display: none; }
  .board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
  .board-spalte, .board-spalte.mobil-an { display: block; min-height: 240px; padding: 10px 8px; margin: -10px -8px; border-radius: 10px; }
  .board-spalte.ziel { background: var(--akzent-weich); }
  .board-spalte h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; margin-bottom: 10px; }
  .board .task-inhalt { padding: 9px 10px 9px 6px; }
  .board .haken { margin: 10px 2px 0 9px; }
  .meldungen { bottom: 20px; left: auto; right: 24px; align-items: flex-end; }
}
