/* Jarvis – Design 3 „Jarvis-HUD“ */
:root {
  --bg-0: #050b16;
  --bg-1: #081427;
  --bg-2: #14315a;
  --text: #e6f0ff;
  --muted: #7fa6d6;
  --dim: #5d7ca6;
  --cyan: #4fd1ff;
  --glass: rgba(120, 170, 255, 0.07);
  --line: rgba(79, 209, 255, 0.18);
  --swdski: #ff9a3c;
  --autohaus: #5b8cff;
  --privat: #3ddc97;
  --danger: #ff6b7a;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Space Grotesk', system-ui, sans-serif;
  --nav-h: 64px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg-0); }
body {
  min-height: 100dvh;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  background: radial-gradient(120% 70% at 50% 0%, var(--bg-2) 0%, var(--bg-1) 55%, var(--bg-0) 100%) fixed;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
.hidden { display: none !important; }

.app { max-width: 480px; margin: 0 auto; min-height: 100dvh; position: relative; }
main {
  padding: calc(env(safe-area-inset-top) + 16px) 20px calc(var(--nav-h) + env(safe-area-inset-bottom) + 28px);
}

/* Ring */
.core {
  --p: 0;
  margin: 8px auto 0;
  width: 188px; height: 188px;
  border-radius: 50%;
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.core::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--cyan) 0 calc(var(--p) * 1%), rgba(79, 209, 255, 0.12) calc(var(--p) * 1%) 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  filter: drop-shadow(0 0 10px rgba(79, 209, 255, 0.45));
  transition: background 0.4s;
}
.core::after { content: ''; position: absolute; inset: 18px; border-radius: 50%; border: 1px dashed rgba(79, 209, 255, 0.35); }
.core b { font-size: 44px; font-weight: 500; line-height: 1; }
.core span { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }

.greet { text-align: center; margin-top: 16px; color: #9fbbe0; line-height: 1.45; }
.greet b { color: #fff; font-weight: 500; }

h1.title { font-size: 28px; font-weight: 500; letter-spacing: -0.02em; margin-top: 8px; display: flex; align-items: baseline; gap: 10px; }
h1.title small { font-family: var(--mono); font-size: 12px; color: var(--muted); font-weight: 400; }

/* Glas-Karten */
.glass {
  margin-top: 14px;
  border-radius: 20px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: 14px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.glass h3 {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; color: var(--cyan); font-weight: 500;
  margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center;
}
.glass h3 a, .glass h3 button { color: var(--dim); text-decoration: none; font-size: 11px; letter-spacing: 0.08em; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.45; }

/* To-do-Zeilen */
.todo { display: flex; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid rgba(79, 209, 255, 0.07); }
.glass h3 + .todo, .group-title + .todo { border-top: 0; }
.chk {
  flex: none; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--cyan);
  display: flex; align-items: center; justify-content: center; transition: background 0.15s, box-shadow 0.15s;
}
.chk::after { content: ''; width: 9px; height: 5px; border: 2px solid transparent; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.todo.done .chk { background: var(--cyan); box-shadow: 0 0 10px rgba(79, 209, 255, 0.6); }
.todo.done .chk::after { border-color: var(--bg-0); }
.todo.done .t-title { color: var(--dim); text-decoration: line-through; }
.t-body { flex: 1; min-width: 0; cursor: pointer; }
.t-title { display: block; overflow-wrap: anywhere; line-height: 1.35; }
.t-meta { display: flex; gap: 8px; align-items: center; font-family: var(--mono); font-size: 10.5px; color: var(--dim); margin-top: 3px; letter-spacing: 0.04em; }
.t-meta .late { color: var(--danger); }
.t-meta .now { color: var(--cyan); }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot.swdski { background: var(--swdski); box-shadow: 0 0 6px var(--swdski); }
.dot.autohaus { background: var(--autohaus); box-shadow: 0 0 6px var(--autohaus); }
.dot.privat { background: var(--privat); box-shadow: 0 0 6px var(--privat); }

.dot.cal-arbeit { background: var(--swdski); box-shadow: 0 0 6px var(--swdski); }
.dot.cal-privat { background: var(--privat); box-shadow: 0 0 6px var(--privat); }
.dot[class*='cal-']:not(.cal-arbeit):not(.cal-privat) { background: var(--cyan); }

/* Termine */
.ev { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; border-top: 1px solid rgba(79, 209, 255, 0.07); }
.glass h3 + .ev, .group-title + .ev { border-top: 0; }
.ev time { font-family: var(--mono); font-size: 13px; color: var(--cyan); width: 50px; flex: none; padding-top: 2px; }
.ev.past { opacity: 0.45; }
.group-title.now { color: var(--cyan); }
a.inline { color: var(--cyan); text-decoration: none; }
.steps { margin: 10px 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.5; display: flex; flex-direction: column; gap: 8px; }
code { font-family: var(--mono); font-size: 12px; color: var(--text); background: rgba(5, 11, 22, 0.6); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
input[type='time'].field { flex: none; width: auto; color-scheme: dark; font-size: 14px; padding: 9px 10px; }
.btn:disabled { opacity: 0.5; }

.group-title {font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; color: var(--dim); margin: 14px 0 2px; text-transform: uppercase; }
.group-title:first-child { margin-top: 0; }
.group-title.late { color: var(--danger); }

/* Bereiche-Zähler */
.stats { display: flex; justify-content: space-between; }
.stats div { display: flex; flex-direction: column; gap: 4px; }
.stats b { font-size: 24px; font-weight: 500; }
.stats span { font-family: var(--mono); font-size: 10px; color: var(--muted); display: flex; gap: 6px; align-items: center; letter-spacing: 0.08em; }

/* Eingaben */
.quick { display: flex; gap: 10px; align-items: center; }
.field {
  flex: 1; min-width: 0; background: rgba(5, 11, 22, 0.55); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 12px; outline: none; font-size: 16px;
}
.field:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(79, 209, 255, 0.15); }
.field::placeholder { color: var(--dim); }
input[type='date'].field { flex: none; width: auto; color-scheme: dark; font-size: 14px; padding: 9px 10px; }
.btn {
  flex: none; border-radius: 12px; padding: 11px 14px; background: var(--cyan); color: var(--bg-0); font-weight: 700;
  box-shadow: 0 0 16px rgba(79, 209, 255, 0.35);
}
.btn.ghost { background: transparent; color: var(--cyan); border: 1px solid var(--line); box-shadow: none; font-weight: 500; }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid rgba(255, 107, 122, 0.35); box-shadow: none; font-weight: 500; }
.btn.round { width: 44px; height: 44px; padding: 0; font-size: 22px; line-height: 1; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; padding: 7px 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); display: inline-flex; gap: 6px; align-items: center;
}
.chips.filter { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid rgba(79, 209, 255, 0.07); }
.chip.on { border-color: var(--cyan); color: var(--text); background: rgba(79, 209, 255, 0.12); }

.edit { padding: 4px 0 12px 32px; }
.edit .field { width: 100%; }

.links { text-align: center; margin-top: 26px; font-family: var(--mono); font-size: 11px; color: var(--dim); }
.links button { color: var(--dim); letter-spacing: 0.06em; padding: 6px; }
.links button:hover { color: var(--cyan); }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
  background: rgba(8, 20, 39, 0.95); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px;
  font-size: 14px; z-index: 20; max-width: 90vw;
}

/* Leiste unten */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(5, 11, 22, 0.85);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(79, 209, 255, 0.08);
}
.nav-inner { max-width: 480px; margin: 0 auto; height: var(--nav-h); display: flex; justify-content: space-around; align-items: center; }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--dim); text-decoration: none; font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; min-width: 56px; }
.nav i { display: block; width: 20px; height: 20px; border: 1.5px solid #2b4a75; border-radius: 50%; transition: all 0.2s; }
.nav a.on { color: var(--cyan); }
.nav a.on i { border-color: var(--cyan); box-shadow: 0 0 12px var(--cyan); }

/* Login */
.login { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; gap: 18px; text-align: center; }
.login h1 { font-size: 30px; font-weight: 500; letter-spacing: 0.04em; }
.login .glass { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.login .btn { width: 100%; }
.err { color: var(--danger); font-size: 14px; min-height: 1.2em; }

/* Einstellungen */
.setting { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid rgba(79, 209, 255, 0.07); flex-wrap: wrap; }
.setting:first-child { border-top: 0; }
.setting span { flex: 1; min-width: 140px; }
.setting input[type='checkbox'] { width: 20px; height: 20px; accent-color: var(--cyan); flex: none; }
select.field { flex: none; width: auto; font-size: 14px; padding: 9px 10px; color-scheme: dark; }
.small { font-size: 12px; }
.bell { color: var(--cyan); }
a.inline-link { color: var(--dim); text-decoration: none; letter-spacing: 0.06em; padding: 6px; }
a.inline-link:hover { color: var(--cyan); }

.core.core-full { --p: 100; }

/* Checklisten, Wiederholung, Fristen, Vorlagen */
.items { padding: 0 0 8px 32px; }
.edit .items { padding-left: 0; margin-top: 12px; }
.item { display: flex; gap: 10px; align-items: center; padding: 6px 0; font-size: 14px; }
.item span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.item.done span { color: var(--dim); text-decoration: line-through; }
.chk.small-chk { width: 16px; height: 16px; border-radius: 5px; }
.item.done .chk { background: var(--cyan); }
.item.done .chk::after { border-color: var(--bg-0); }
.item .x { color: var(--dim); font-size: 18px; padding: 0 6px; }
.item-add { margin-top: 6px; }
.item-add .btn { padding: 9px 14px; }
.t-meta .rep, .t-meta .lead { color: var(--muted); }
.notes { margin-top: 10px; white-space: pre-wrap; }
.tpl { padding: 10px 0; border-top: 1px solid rgba(79, 209, 255, 0.07); }
.glass h3 + .tpl { border-top: 0; }

/* Vault */
textarea.field { width: 100%; resize: vertical; min-height: 84px; line-height: 1.4; }
.inbox-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid rgba(79, 209, 255, 0.07); }
.group-title + .inbox-item { border-top: 0; }
.inbox-item .t-body { flex: 1; min-width: 0; }
.inbox-item .t-title { overflow-wrap: anywhere; }
.inbox-item .x { color: var(--dim); font-size: 18px; padding: 0 6px; }
.inbox-item.einsortiert .t-title { color: var(--muted); }
.inbox-note { display: block; font-size: 13px; color: var(--cyan); margin-top: 6px; }
a.wl { color: var(--cyan); text-decoration: none; }
a.wl.target { display: block; font-family: var(--mono); font-size: 11px; margin-top: 5px; overflow-wrap: anywhere; }
.answer { margin-top: 8px; }
.hit { padding: 10px 0; border-top: 1px solid rgba(79, 209, 255, 0.07); cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.group-title + .hit { border-top: 0; }
.hit .snip { font-size: 13px; color: var(--muted); line-height: 1.4; overflow-wrap: anywhere; }
.note-back { text-align: left; margin: 0 0 6px; }
.md { font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.md p { margin: 0 0 10px; }
.md ul, .md ol { margin: 0 0 10px 20px; padding: 0; }
.md li { margin: 3px 0; }
.md li.task { list-style: none; margin-left: -18px; }
.md li.task.on { color: var(--muted); }
.md-h { font-weight: 500; margin: 16px 0 8px; color: var(--text); }
.md-h1 { font-size: 20px; } .md-h2 { font-size: 17px; color: var(--cyan); } .md-h3, .md-h4 { font-size: 15px; color: var(--cyan); }
.md > .md-h:first-child { margin-top: 0; }
.md pre { background: rgba(5, 11, 22, 0.6); border-radius: 8px; padding: 10px; overflow-x: auto; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; }
.md blockquote { border-left: 2px solid var(--line); margin: 0 0 10px; padding-left: 10px; color: var(--muted); }
.md-row { display: flex; gap: 10px; font-size: 13px; padding: 5px 0; border-top: 1px solid rgba(79, 209, 255, 0.07); }
.md-row span { flex: 1; min-width: 0; }
.att { font-family: var(--mono); font-size: 12px; color: var(--muted); }
