/* Ruhige Arbeitsfläche, ein Akzent (Tannengrün), Prio als farbige Kante */
:root {
  --bg: #f4f5f2; --surface: #ffffff; --ink: #1a1d1b; --muted: #6b716c; --line: #e2e5e0;
  --accent: #2c6a4c; --accent-soft: #e3efe8; --on-accent: #ffffff; --p1: #c2410c; --p2: #b7791f; --danger: #b42318;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141614; --surface: #1d201e; --ink: #ecefeb; --muted: #9aa29c; --line: #2c312d;
    --accent: #6fbf95; --accent-soft: #223329; --on-accent: #0f1a14; --p1: #f08a5d; --p2: #e3b55b; --danger: #f2877b;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.4 var(--font); -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

#app { max-width: 720px; margin: 0 auto; padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) calc(84px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 10px; }
.top h1 { margin: 0; font-size: 28px; letter-spacing: -0.02em; }
.filter { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 2px; }
.filter button { border: 0; background: none; padding: 5px 10px; border-radius: 8px; font-size: 13px; color: var(--muted); }
.filter button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.capture { position: sticky; top: env(safe-area-inset-top); z-index: 5; display: grid; grid-template-columns: 1fr 48px; gap: 8px; padding: 8px 0; background: var(--bg); }
.capture input { width: 100%; min-width: 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 16px; }
.capture button { border: 0; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-size: 24px; line-height: 1; }
.preview { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; min-height: 0; }
.preview:empty { display: none; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; white-space: nowrap; border: 0; }
.chip.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.chip.p1 { background: color-mix(in srgb, var(--p1) 14%, transparent); color: var(--p1); }
.chip.p2 { background: color-mix(in srgb, var(--p2) 16%, transparent); color: var(--p2); }

h2.sec { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 22px 0 8px; font-weight: 600; display: flex; justify-content: space-between; }
.empty { color: var(--muted); padding: 14px 2px; font-size: 15px; }

.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.item { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; padding: 12px 12px 12px 10px; border-top: 1px solid var(--line); position: relative; }
.item:first-child { border-top: 0; }
.item.p1::before, .item.p2::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--p1); }
.item.p2::before { background: var(--p2); }
.check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--muted); background: none; padding: 0; margin-top: 1px; }
.item.done .check { background: var(--accent); border-color: var(--accent); }
.item.done .title { color: var(--muted); text-decoration: line-through; }
.body { min-width: 0; cursor: pointer; }
.title { overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.meta .late { color: var(--danger); }
.star { border: 0; background: none; font-size: 20px; color: var(--line); padding: 0 2px; line-height: 1; }
.star.on { color: var(--p2); }
.quick { grid-column: 2 / -1; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.quick .chip { cursor: pointer; }

.top3 { border-color: color-mix(in srgb, var(--p2) 45%, var(--line)); }

.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.proj { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; }
.proj .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.back { border: 0; background: none; color: var(--accent); padding: 4px 0; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 10px; }
.panel p { margin: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; overflow-wrap: anywhere; background: var(--bg); padding: 8px; border-radius: 8px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn { border: 1px solid var(--line); background: var(--surface); padding: 9px 14px; border-radius: 10px; text-decoration: none; display: inline-block; color: inherit; text-align: center; }
.primary { background: var(--accent) !important; color: var(--on-accent) !important; border-color: var(--accent) !important; }
.danger { color: var(--danger); }
.ok { color: var(--accent); font-weight: 600; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); z-index: 10; }
.tabs button { border: 0; background: none; color: var(--muted); font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 0; position: relative; }
.tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs button.on { color: var(--accent); font-weight: 600; }
.badge { position: absolute; top: 0; left: calc(50% + 8px); background: var(--p1); color: #fff; font-size: 10px; border-radius: 999px; padding: 0 5px; min-width: 16px; }

.sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg { position: absolute; inset: 0; background: rgb(0 0 0 / 0.35); }
.sheet-card { position: relative; width: 100%; max-width: 720px; max-height: 92vh; overflow: auto; background: var(--surface); border-radius: 18px 18px 0 0; padding: 18px max(16px, env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); display: grid; gap: 12px; }
.f-title { font-size: 19px; font-weight: 600; border: 0; border-bottom: 1px solid var(--line); padding: 6px 0; background: none; width: 100%; }
textarea, .grid input, .grid select, .panel input { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; background: var(--bg); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); min-width: 0; }
.hint { margin: 0; font-size: 13px; color: var(--muted); }
.actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.actions button { border: 1px solid var(--line); background: var(--surface); padding: 10px 16px; border-radius: 10px; }
.actions .danger { margin-right: auto; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form { width: 100%; max-width: 320px; display: grid; gap: 10px; }
.login input { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.login button { padding: 12px; border-radius: 10px; border: 0; }
.err { color: var(--danger); margin: 0; }

.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 30; max-width: calc(100% - 32px); }
@media (prefers-reduced-motion: no-preference) { .toast { animation: up .2s ease-out; } @keyframes up { from { transform: translate(-50%, 8px); opacity: 0; } } }
