@import url("https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@500;600&family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600&display=swap");
/* Lebens-Cockpit – Apple-Designsprache (iOS/macOS) */
:root {
  --bg: #f2f2f7;            /* systemGroupedBackground */
  --surface: #ffffff;       /* secondarySystemGroupedBackground */
  --sunk: #e9e9ee;          /* tertiary fill */
  --fill: rgba(118, 118, 128, 0.12);
  --ink: #000000;
  --muted: rgba(60, 60, 67, 0.62);   /* secondaryLabel */
  --faint: rgba(60, 60, 67, 0.32);   /* tertiaryLabel */
  --line: rgba(60, 60, 67, 0.18);    /* separator */
  --accent: #007aff;        /* systemBlue */
  --accent-soft: rgba(0, 122, 255, 0.12);
  --biz: #007aff;
  --biz-soft: rgba(0, 122, 255, 0.12);
  --priv: #af52de;          /* systemPurple */
  --priv-soft: rgba(175, 82, 222, 0.13);
  --today: #ff9500;         /* systemOrange */
  --today-soft: rgba(255, 149, 0, 0.14);
  --late: #ff3b30;          /* systemRed */
  --late-soft: rgba(255, 59, 48, 0.12);
  --green: #34c759;
  --green-soft: rgba(52, 199, 89, 0.14);
  --focus: #007aff;
  --bar: rgba(249, 249, 249, 0.78);
  --sidebar: rgba(242, 242, 247, 0.85);
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 20px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", system-ui, sans-serif;
  --nav-w: 250px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --sunk: #2c2c2e;
    --fill: rgba(118, 118, 128, 0.24);
    --ink: #ffffff;
    --muted: rgba(235, 235, 245, 0.6);
    --faint: rgba(235, 235, 245, 0.3);
    --line: rgba(84, 84, 88, 0.6);
    --accent: #0a84ff;
    --accent-soft: rgba(10, 132, 255, 0.2);
    --biz: #0a84ff;
    --biz-soft: rgba(10, 132, 255, 0.2);
    --priv: #bf5af2;
    --priv-soft: rgba(191, 90, 242, 0.2);
    --today: #ff9f0a;
    --today-soft: rgba(255, 159, 10, 0.2);
    --late: #ff453a;
    --late-soft: rgba(255, 69, 58, 0.2);
    --green: #30d158;
    --green-soft: rgba(48, 209, 88, 0.2);
    --focus: #0a84ff;
    --bar: rgba(22, 22, 24, 0.8);
    --sidebar: rgba(28, 28, 30, 0.88);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
@media (min-width: 900px) { body { font-size: 15px; } }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 55%, transparent); outline-offset: 1px; border-radius: 8px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 14px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Gerüst: Seitenleiste (macOS) ---------- */
.shell { min-height: 100vh; min-height: 100dvh; }
.nav {
  position: fixed; inset: 0 auto 0 0; width: var(--nav-w); z-index: 10;
  padding: 18px 12px; display: flex; flex-direction: column; gap: 1px;
  background: var(--sidebar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-right: 0.5px solid var(--line);
}
.brand { font-weight: 700; font-size: 17px; padding: 4px 10px 16px; display: flex; gap: 10px; align-items: center; color: var(--ink); }
.brand svg { width: 30px; height: 30px; border-radius: 7px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px;
  color: var(--ink); font-weight: 500; font-size: 14px;
}
.nav a svg { width: 19px; height: 19px; flex: none; color: var(--accent); }
.nav a:hover { background: var(--fill); }
.nav a.on { background: var(--accent); color: #fff; }
.nav a.on svg { color: #fff; }
.nav a.on .badge { background: #fff; color: var(--accent); }
.nav .badge { margin-left: auto; }
.nav .spacer { flex: 1; }
.nav .capture-btn { margin: 0 0 14px; justify-content: center; color: #fff; }
.nav .capture-btn svg { color: #fff; }

.main { margin-left: var(--nav-w); padding: 34px 44px 80px; }
.page { max-width: 860px; margin: 0 auto; }
.page.wide { max-width: 1200px; }

.tabbar { display: none; }

/* ---------- iPhone: Tab-Leiste ---------- */
@media (max-width: 899px) {
  .nav { display: none; }
  .main { margin-left: 0; padding: calc(12px + env(safe-area-inset-top)) 16px calc(100px + env(safe-area-inset-bottom)); }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    padding: 6px 4px calc(4px + env(safe-area-inset-bottom));
    background: var(--bar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 0.5px solid var(--line);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0 2px;
    color: #8e8e93; font-size: 10px; font-weight: 500; position: relative; letter-spacing: 0;
  }
  .tabbar a svg { width: 25px; height: 25px; }
  .tabbar a.on { color: var(--accent); }
  .tabbar .cap {
    width: 54px; height: 54px; margin: -20px auto 0; border-radius: 50%;
    background: var(--accent); color: #fff; display: grid; place-items: center;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 45%, transparent);
  }
  .tabbar .cap svg { width: 26px; height: 26px; }
  .tabbar .badge { position: absolute; top: -1px; right: calc(50% - 22px); }
}

/* ---------- Titel ---------- */
.head { display: flex; align-items: flex-end; gap: 12px; margin: 0 0 18px; flex-wrap: wrap; }
.head h1 { font-size: 34px; line-height: 1.12; letter-spacing: -0.025em; margin: 0; font-weight: 700; }
.head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
h2.sec {
  font-size: 13px; font-weight: 400; color: var(--muted); margin: 26px 16px 7px;
  display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: 0.01em;
}
h2.sec .count { color: var(--faint); }
h2.sec.late { color: var(--late); }
h2.sec.today { color: var(--today); }
h2.sec .btn { text-transform: none; letter-spacing: -0.01em; }
@media (min-width: 900px) { h2.sec { margin-left: 12px; } }

/* ---------- Heute: großer Titel + Wochenleiste (Kalender) ---------- */
.dayhead { margin: 2px 0 20px; }
.dayhead .wd { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; }
.dayhead .date { font-size: clamp(34px, 6vw, 44px); line-height: 1.05; letter-spacing: -0.03em; font-weight: 700; margin-top: 2px; }
.dayhead .line { margin-top: 8px; color: var(--muted); font-size: 15px; }
.dayhead .line b { color: var(--ink); font-weight: 600; }

.strip {
  display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 2px;
  padding: 10px 8px; background: var(--surface); border-radius: var(--radius-m);
}
.strip .d {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 4px 0 6px; border-radius: 10px;
  border: 0; background: none; cursor: pointer; min-width: 0;
}
.strip .d:hover { background: var(--fill); }
.strip .d.sel { background: var(--fill); }
.strip .d .wd { font-size: 11px; color: var(--muted); font-weight: 500; }
.strip .d .n { font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; }
.strip .d.t .n { color: #fff; background: var(--late); font-weight: 600; }
.strip .d.we .n { color: var(--muted); }
.strip .dots { display: flex; gap: 3px; height: 6px; }
.strip .dots i { width: 6px; height: 6px; border-radius: 50%; display: block; }
.dot-task { background: var(--muted); }
.dot-inv { background: var(--priv); }
.dot-ev { background: var(--accent); }
.dot-late { background: var(--late); }
.strip-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin: 8px 12px 0; flex-wrap: wrap; }
.strip-legend i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 5px; vertical-align: 1px; }
@media (max-width: 600px) {
  .strip { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .strip .d:nth-child(n+8) { display: none; }
}

/* ---------- Gruppierte Listen (inset grouped) ---------- */
.list { background: var(--surface); border-radius: var(--radius-m); overflow: hidden; }
.list > .item + .item::after {
  content: ""; position: absolute; top: 0; right: 0; left: 16px; border-top: 0.5px solid var(--line);
}
.list > .item:has(.check, .tl-icon, .avatar) + .item::after { left: 54px; }
.item {
  display: flex; gap: 12px; align-items: flex-start; padding: 11px 16px; position: relative; min-height: 44px;
  color: inherit; background: none; border: 0; width: 100%; text-align: left; font-size: inherit;
}
a.item, button.item { cursor: pointer; }
a.item:active, button.item:active { background: var(--fill); }
@media (hover: hover) { a.item:hover, button.item:hover { background: color-mix(in srgb, var(--fill) 60%, transparent); } }
a.item { padding-right: 32px; }
a.item::before {
  content: ""; position: absolute; right: 16px; top: 50%; width: 7px; height: 7px; margin-top: -4px;
  border-right: 2px solid var(--faint); border-top: 2px solid var(--faint); transform: rotate(45deg); border-radius: 1px;
}
.item .title { font-weight: 400; overflow-wrap: anywhere; }
.item .sub { font-size: 14px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.item .meta { font-size: 14px; color: var(--muted); white-space: nowrap; text-align: right; }
.item.unread .title { font-weight: 600; }
.item.unread .grow::before {
  content: ""; position: absolute; left: 5px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}
.item.done .title { color: var(--faint); }
/* Bereich (geschäftlich/privat): kleiner Farbpunkt vor dem Inhalt */
.item.area-private .title::after {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--priv); margin-left: 7px; vertical-align: 2px;
}
.empty { padding: 30px 18px; text-align: center; color: var(--muted); font-size: 15px; }
.empty b { color: var(--ink); display: block; margin-bottom: 4px; font-weight: 600; font-size: 17px; }

/* Erinnerungen-Kreis */
.check {
  flex: none; width: 23px; height: 23px; margin-top: 0; border-radius: 50%;
  border: 1.5px solid var(--faint); background: none; cursor: pointer; display: grid; place-items: center; padding: 0;
  transition: background 0.15s, border-color 0.15s;
}
.check:hover { border-color: var(--accent); }
.check.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.check svg { width: 14px; height: 14px; stroke-width: 2.6; }

.avatar {
  flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 600; font-size: 15px; color: #fff;
  background: linear-gradient(180deg, #a3aab4, #858b94);
}
.avatar.private { background: linear-gradient(180deg, #c98be8, #a855d6); }
.avatar.lg { width: 76px; height: 76px; font-size: 30px; }

/* ---------- Kennzeichen ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; line-height: 1;
  padding: 4px 8px; border-radius: 6px; background: var(--fill); color: var(--muted); white-space: nowrap; letter-spacing: 0;
}
.chip svg { width: 13px; height: 13px; }
.chip.biz { background: var(--accent-soft); color: var(--accent); }
.chip.priv { background: var(--priv-soft); color: var(--priv); }
.chip.late, .chip.high { background: var(--late-soft); color: var(--late); }
.chip.today { background: var(--today-soft); color: var(--today); }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--late); color: #fff;
  font-size: 12px; font-weight: 600; display: inline-grid; place-items: center; letter-spacing: 0;
}
.nav .badge { background: var(--fill); color: var(--muted); }

/* ---------- Tasten & Formulare ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px;
  border-radius: 10px; border: 0; background: var(--fill); color: var(--accent); cursor: pointer;
  font-weight: 600; white-space: nowrap; min-height: 38px; font-size: 15px;
}
.btn:hover { filter: brightness(0.97); }
.btn:active { opacity: 0.7; }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.danger { color: var(--late); }
.btn.ghost { background: none; padding-left: 8px; padding-right: 8px; }
.btn.ghost:hover { background: var(--fill); }
.btn.sm { padding: 5px 12px; min-height: 30px; font-size: 14px; border-radius: 8px; }
.btn:disabled { opacity: 0.4; cursor: default; }
.iconbtn { border: 0; background: none; padding: 7px; border-radius: 50%; cursor: pointer; color: var(--accent); display: inline-grid; place-items: center; }
.iconbtn:hover { background: var(--fill); }
.iconbtn svg { width: 20px; height: 20px; }

label.f { display: block; }
label.f > span, .f > span.small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); margin: 0 0 6px 4px; text-transform: none; }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 0;
  background: var(--fill); min-height: 42px; font-size: 16px; color: var(--ink);
}
.panel .input, .dialog .input { background: var(--fill); }
select.input { appearance: none; -webkit-appearance: none; padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea.input { resize: vertical; min-height: 120px; line-height: 1.45; }
.input::placeholder { color: var(--faint); }
.input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }
.hint { font-size: 13px; color: var(--muted); margin: 6px 4px 0; }

/* Segmented Control */
.seg { display: inline-flex; background: var(--fill); border-radius: 9px; padding: 2px; gap: 0; flex-wrap: wrap; }
.seg button {
  border: 0; background: none; padding: 6px 14px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink);
  letter-spacing: 0;
}
.seg button.on { background: var(--surface); font-weight: 600; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04); }
@media (prefers-color-scheme: dark) { .seg button.on { background: #636366; } }

/* Schalter statt Kästchen */
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: none; width: 51px; height: 31px; border-radius: 999px; margin: 0;
  background: var(--fill); position: relative; cursor: pointer; transition: background 0.2s;
}
input[type="checkbox"]::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 3px 1px rgba(0, 0, 0, 0.06); transition: transform 0.2s;
}
input[type="checkbox"]:checked { background: var(--green); }
input[type="checkbox"]:checked::after { transform: translateX(20px); }
label.row:has(input[type="checkbox"]) { justify-content: space-between; flex-direction: row-reverse; gap: 14px; padding: 4px 0; }
label.row:has(input[type="checkbox"]) > :not(input) { flex: 1; }

.panel { background: var(--surface); border-radius: var(--radius-m); padding: 18px; }
.panel h3 { margin: 0 0 4px; font-size: 17px; font-weight: 600; }
.panel + .panel { margin-top: 18px; }
.callout { border-radius: var(--radius-m); padding: 14px 16px; background: var(--today-soft); font-size: 15px; }
.callout.err { background: var(--late-soft); }
.callout.ok { background: var(--green-soft); }
.callout b { display: block; margin-bottom: 2px; }
.steps { margin: 8px 0 0; padding-left: 20px; }
.steps li { margin: 6px 0; }
code.k { background: var(--fill); padding: 2px 6px; border-radius: 6px; font-size: 13px; word-break: break-all; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
details summary { color: var(--accent); }

/* ---------- Mail-Detail ---------- */
.split { display: grid; grid-template-columns: minmax(300px, 390px) 1fr; gap: 22px; align-items: start; }
@media (max-width: 1099px) {
  .split { grid-template-columns: 1fr; }
  .split.has-detail > .split-list { display: none; }
  .split:not(.has-detail) > .split-detail { display: none; }
}
@media (min-width: 1100px) { .split-detail { position: sticky; top: 24px; } }
.mailhead h2 { font-size: 24px; letter-spacing: -0.02em; margin: 0 0 8px; line-height: 1.2; font-weight: 700; }
.summary { padding: 13px 16px; border-radius: var(--radius-m); background: var(--accent-soft); color: var(--ink); font-size: 15px; }
.summary.private { background: var(--priv-soft); }
.mailbody { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.5; }
iframe.mailhtml { width: 100%; border: 0; min-height: 300px; background: #fff; border-radius: 10px; }
.att { display: flex; gap: 8px; flex-wrap: wrap; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.search { flex: 1; min-width: 180px; }

/* ---------- Erfassen ---------- */
.dropzone {
  border-radius: var(--radius-l); padding: 38px 16px; text-align: center;
  background: var(--surface); cursor: pointer; display: block; color: var(--ink);
  border: 1.5px dashed var(--line);
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone svg { width: 46px; height: 46px; color: var(--accent); }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.thumbs .t { position: relative; width: 86px; height: 112px; border-radius: 10px; overflow: hidden; background: var(--fill); display: grid; place-items: center; font-size: 13px; color: var(--muted); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .t button { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; display: grid; place-items: center; padding: 0; }
.thumbs .t button svg { width: 12px; height: 12px; }

/* ---------- Sheets / Dialoge ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.32); z-index: 50; display: grid; place-items: center; padding: 16px; animation: fade 0.2s; }
.dialog { background: var(--bg); border-radius: 14px; width: min(560px, 100%); max-height: 90vh; overflow: auto; padding: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.dialog h3 { margin: 0 0 16px; font-size: 17px; font-weight: 600; text-align: center; }
.dialog .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
@media (max-width: 600px) {
  .overlay { place-items: end stretch; padding: 0; }
  .dialog { border-radius: 14px 14px 0 0; width: 100%; padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); animation: up 0.28s cubic-bezier(.2,.8,.2,1); }
  .dialog::before { content: ""; display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--faint); margin: 0 auto 12px; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0.6; } }

/* ---------- Hinweise ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); top: calc(12px + env(safe-area-inset-top)); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100% - 32px)); }
.toast {
  background: var(--bar); color: var(--ink); padding: 12px 16px; border-radius: 16px; font-size: 15px; font-weight: 500;
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 10px 30px rgba(0,0,0,.18); animation: drop 0.3s cubic-bezier(.2,.8,.2,1);
}
.toast.error { color: var(--late); }
@keyframes drop { from { transform: translateY(-16px); opacity: 0; } }

/* ---------- Anmeldung ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.auth .box { width: min(380px, 100%); text-align: left; }
.auth .box > div:first-child svg { width: 64px; height: 64px; border-radius: 15px; }
.auth h1 { font-size: 34px; letter-spacing: -0.025em; margin: 14px 0 4px; font-weight: 700; }

.spin { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: sp .7s linear infinite; display: inline-block; vertical-align: -3px; }
@keyframes sp { to { transform: rotate(360deg); } }
.loading { padding: 40px; text-align: center; color: var(--muted); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.timeline .item { align-items: center; }
.tl-icon { flex: none; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: #fff; }
.tl-icon svg { width: 17px; height: 17px; }
.total { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 700px) { .cards3 { grid-template-columns: 1fr; } }

/* ---------- Assistent ---------- */
.assistant { display: flex; flex-direction: column; min-height: calc(100dvh - 120px); }
.chat { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 4px 0 12px; }
.bubble { max-width: min(78%, 560px); padding: 9px 14px; border-radius: 19px; font-size: 16px; line-height: 1.38; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.bubble.assistant { align-self: flex-start; background: var(--surface); color: var(--ink); border-bottom-left-radius: 6px; }
.bubble.err { color: var(--late); }
.bubble .cards { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; white-space: normal; }
.bubble .cards .btn { justify-content: flex-start; }
.draft { background: var(--bg); border-radius: 12px; padding: 12px; }
.typing { display: flex; gap: 5px; padding: 14px 16px; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.suggest { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.chipbtn { border: 0; background: var(--surface); color: var(--accent); padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; cursor: pointer; }
.chipbtn:active { opacity: .6; }
.composer { position: sticky; bottom: 0; padding: 10px 0 4px; background: linear-gradient(transparent, var(--bg) 18px); }
@media (max-width: 899px) { .composer { bottom: calc(64px + env(safe-area-inset-bottom)); } }
.composer .input { border-radius: 999px; padding-left: 16px; background: var(--surface); }
.composer .btn.primary { border-radius: 50%; width: 42px; height: 42px; padding: 0; }
.microw { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 12px; }
.microw .mini { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.microw .mini:first-child { justify-self: end; }
.microw .mini input[type="checkbox"] { transform: scale(.75); }
.mic {
  width: 68px; height: 68px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff;
  background: var(--accent); box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 40%, transparent); transition: transform .15s;
}
.mic svg { width: 30px; height: 30px; }
.mic:active { transform: scale(.94); }
.mic.listening { background: var(--late); animation: pulse 1.4s ease-out infinite; }
.mic.speaking { background: var(--green); }
.mic.thinking { background: var(--faint); cursor: default; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--late) 55%, transparent); } 100% { box-shadow: 0 0 0 22px transparent; } }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 18px; }
.quick a { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: var(--radius-m); background: var(--surface); color: var(--ink); font-weight: 600; }
.quick a .tl-icon { width: 34px; height: 34px; border-radius: 50%; }

/* =====================================================================
   Assistent (beide Erscheinungsbilder)
   ===================================================================== */
.nova { max-width: 1180px; --core: var(--accent); --core-2: var(--today); }
.nova-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 0 0 18px; flex-wrap: wrap; }
.nova-name { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.nova-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; margin-top: 4px; }
.nova-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.nova-status.s-listen .dot { background: var(--late); animation: nova-blink 1s infinite; }
.nova-status.s-think .dot, .nova-status.s-research .dot { background: var(--today); animation: nova-blink .8s infinite; }
.nova-status.s-speak .dot { background: var(--accent); animation: nova-blink .6s infinite; }
@keyframes nova-blink { 50% { opacity: .3; } }

.nova-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr); gap: 26px; align-items: start; }
@media (max-width: 899px) { .nova-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; } }
.nova-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.core-wrap { position: relative; width: min(100%, 380px); aspect-ratio: 1; margin: 0 auto; }
@media (max-width: 899px) { .core-wrap { width: min(72vw, 300px); } }
.core-wrap canvas { width: 100%; height: 100%; display: block; }
.core-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.core-center .n { font-size: clamp(44px, 9vw, 64px); font-weight: 600; line-height: 1; color: var(--ink); }
.core-center .l { font-size: 12px; color: var(--muted); margin-top: 6px; text-transform: uppercase; letter-spacing: .08em; }

.nova-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.nova-stats a { background: var(--surface); border-radius: var(--radius-m); padding: 12px 14px; color: var(--ink); min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nova-stats a b { font-size: 20px; font-weight: 650; }
.nova-stats a span { font-size: 13px; color: var(--muted); }
.nova-stats a.late b { color: var(--late); }
.nova-stats a.today b { color: var(--today); }

.nova-talk { background: var(--surface); border-radius: var(--radius-m); padding: 14px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.nova-log { display: flex; flex-direction: column; gap: 14px; min-height: 220px; max-height: min(56vh, 560px); overflow-y: auto; padding: 4px 4px 4px 2px; }
@media (max-width: 899px) { .nova-log { max-height: none; min-height: 140px; } }
.msg { max-width: 64ch; overflow-wrap: anywhere; }
.msg .who { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 3px; }
.msg .who .tag { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; letter-spacing: .04em; }
.msg .who .tag svg { width: 12px; height: 12px; }
.msg .txt { white-space: pre-wrap; line-height: 1.5; }
.msg.me { align-self: flex-end; background: var(--accent); color: #fff; padding: 9px 13px; border-radius: 16px 16px 4px 16px; }
.msg.err .txt { color: var(--late); }
.msg.pending .txt { color: var(--muted); }
.msg .cards { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: flex-start; }
.msg .cards .src { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; font-size: 13px; padding: 5px 10px; border-radius: 8px; background: var(--fill); color: var(--ink); }
.msg .cards .src svg { width: 14px; height: 14px; flex: none; color: var(--accent); }
.msg .cards .btn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

.nova-cmd { display: flex; gap: 8px; align-items: center; }
.nova-cmd .input { flex: 1; min-width: 0; }
.nova-cmd .mic { flex: none; width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; background: var(--accent); color: #fff; position: relative; }
.nova-cmd .mic svg { width: 24px; height: 24px; }
.nova-cmd .mic.on { background: var(--late); }
.nova-cmd .mic.on::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--late); animation: ring 1.2s infinite; }
@keyframes ring { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { border: 0; background: var(--fill); color: var(--ink); padding: 6px 11px; border-radius: 999px; font-size: 13px; cursor: pointer; text-align: left; }
.chip-btn:hover { background: var(--accent-soft); }

.nova-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 30; width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: #fff;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 40%, transparent);
}
.nova-fab svg { width: 26px; height: 26px; }
@media (max-width: 899px) { .nova-fab { right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); width: 52px; height: 52px; } }

/* =====================================================================
   Erscheinungsbild „HUD“ (Jarvis) – per Einstellungen umschaltbar
   ===================================================================== */
:root[data-skin="hud"] {
  --bg: #050b12;
  --surface: rgba(12, 34, 50, 0.62);
  --sunk: rgba(79, 216, 255, 0.08);
  --fill: rgba(79, 216, 255, 0.1);
  --ink: #d4f1ff;
  --muted: #86aabb;
  --faint: rgba(134, 170, 187, 0.55);
  --line: rgba(80, 210, 255, 0.2);
  --accent: #4fd8ff;
  --accent-soft: rgba(79, 216, 255, 0.14);
  --biz: #4fd8ff;
  --biz-soft: rgba(79, 216, 255, 0.14);
  --priv: #b9a0ff;
  --priv-soft: rgba(185, 160, 255, 0.16);
  --today: #ffb84d;
  --today-soft: rgba(255, 184, 77, 0.16);
  --late: #ff5d6c;
  --late-soft: rgba(255, 93, 108, 0.16);
  --green: #4be3ad;
  --green-soft: rgba(75, 227, 173, 0.16);
  --focus: #4fd8ff;
  --bar: rgba(5, 14, 22, 0.88);
  --sidebar: rgba(6, 16, 26, 0.92);
  --on-accent: #03121b;
  --radius-s: 2px;
  --radius-m: 3px;
  --radius-l: 4px;
  --font: "IBM Plex Sans", -apple-system, "Segoe UI", system-ui, sans-serif;
  --display: "Chakra Petch", "Eurostile", "Bahnschrift", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
[data-skin="hud"] body {
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 700px at 60% 20%, rgba(40, 140, 190, 0.16), transparent 60%),
    linear-gradient(rgba(80, 210, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 210, 255, 0.035) 1px, transparent 1px);
  background-size: auto, 40px 40px, 40px 40px;
  background-attachment: fixed;
  letter-spacing: 0;
}
[data-skin="hud"] .num, [data-skin="hud"] .meta, [data-skin="hud"] .chip { font-family: var(--mono); }
[data-skin="hud"] .head h1, [data-skin="hud"] .dayhead .date, [data-skin="hud"] .nova-name, [data-skin="hud"] .brand, [data-skin="hud"] .auth h1 {
  font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent);
  text-shadow: 0 0 18px rgba(79, 216, 255, 0.35);
}
[data-skin="hud"] .head h1, [data-skin="hud"] .nova-name { font-size: 28px; }
[data-skin="hud"] .dayhead .date { font-size: clamp(28px, 5vw, 38px); }
[data-skin="hud"] h2.sec, [data-skin="hud"] .dayhead .wd, [data-skin="hud"] .core-center .l, [data-skin="hud"] .msg .who {
  font-family: var(--display); letter-spacing: 0.16em; font-weight: 500;
}
[data-skin="hud"] h2.sec { color: var(--accent); }
[data-skin="hud"] h2.sec.late { color: var(--late); }
[data-skin="hud"] h2.sec.today { color: var(--today); }

/* Flächen mit HUD-Rahmen und Eckwinkeln */
[data-skin="hud"] .list, [data-skin="hud"] .panel, [data-skin="hud"] .strip, [data-skin="hud"] .nova-talk,
[data-skin="hud"] .nova-stats a, [data-skin="hud"] .dropzone, [data-skin="hud"] .dialog {
  border: 1px solid var(--line); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); position: relative;
}
[data-skin="hud"] .list, [data-skin="hud"] .panel, [data-skin="hud"] .strip, [data-skin="hud"] .nova-talk {
  background-image: linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--accent), var(--accent)),
    linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--accent), var(--accent));
  background-size: 12px 2px, 2px 12px, 12px 2px, 2px 12px;
  background-position: 0 0, 0 0, 100% 100%, 100% 100%;
  background-repeat: no-repeat;
  background-color: var(--surface);
}
[data-skin="hud"] .dialog { background: #07131d; }
[data-skin="hud"] .nova-stats a b { font-family: var(--mono); font-weight: 500; }

/* Aufgaben-Zeilen mit Statusstreifen */
[data-skin="hud"] .item:has(.chip.late)::before, [data-skin="hud"] .item:has(.chip.today)::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border: 0; transform: none; margin: 0; right: auto; border-radius: 0;
}
[data-skin="hud"] .item:has(.chip.late)::before { background: var(--late); box-shadow: 0 0 8px var(--late); }
[data-skin="hud"] .item:has(.chip.today)::before { background: var(--today); }

/* Akzentflächen: dunkle Schrift auf hellem Cyan */
[data-skin="hud"] .btn.primary, [data-skin="hud"] .nav a.on, [data-skin="hud"] .nav .capture-btn, [data-skin="hud"] .tabbar .cap,
[data-skin="hud"] .check.on, [data-skin="hud"] .tl-icon, [data-skin="hud"] .strip .d.t .n, [data-skin="hud"] .nova-cmd .mic,
[data-skin="hud"] .nova-fab, [data-skin="hud"] .msg.me { color: var(--on-accent); }
[data-skin="hud"] .nav a.on svg, [data-skin="hud"] .nav .capture-btn svg { color: var(--on-accent); }
[data-skin="hud"] .nav a.on .badge { background: var(--on-accent); color: var(--accent); }
[data-skin="hud"] .strip .d.t .n { background: var(--accent); }
[data-skin="hud"] .btn { border-radius: 2px; text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--display); font-weight: 500; font-size: 13px; }
[data-skin="hud"] .btn.primary { box-shadow: 0 0 16px rgba(79, 216, 255, 0.35); }
[data-skin="hud"] .btn.sm { font-size: 12px; }
[data-skin="hud"] .input, [data-skin="hud"] select.input, [data-skin="hud"] textarea.input {
  background: rgba(3, 10, 16, 0.75); border: 1px solid var(--line); border-radius: 2px;
}
[data-skin="hud"] .input:focus { outline: 1px solid var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
[data-skin="hud"] .seg { border-radius: 2px; border: 1px solid var(--line); background: rgba(3, 10, 16, 0.6); }
[data-skin="hud"] .seg button { border-radius: 1px; font-family: var(--display); letter-spacing: 0.08em; }
[data-skin="hud"] .seg button.on { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
[data-skin="hud"] .chip { border-radius: 2px; }
[data-skin="hud"] .check { border-radius: 2px; border-color: var(--accent); }
[data-skin="hud"] .avatar { border-radius: 3px; background: linear-gradient(180deg, #1d6e88, #0f3e52); color: var(--ink); }
[data-skin="hud"] .msg.me { border-radius: 2px; }
[data-skin="hud"] .chip-btn { border-radius: 2px; border: 1px solid var(--line); background: transparent; color: var(--muted); }
[data-skin="hud"] .chip-btn:hover { color: var(--ink); border-color: var(--accent); }
[data-skin="hud"] .nova-cmd .mic { background: radial-gradient(circle, rgba(79, 216, 255, 0.9), rgba(79, 216, 255, 0.55) 70%); box-shadow: 0 0 22px rgba(79, 216, 255, 0.45); }
[data-skin="hud"] .nova-cmd .mic.on { background: var(--late); box-shadow: 0 0 22px rgba(255, 93, 108, 0.5); }
[data-skin="hud"] .nova-fab { border-radius: 50%; box-shadow: 0 0 0 1px var(--accent), 0 0 24px rgba(79, 216, 255, 0.5); }
[data-skin="hud"] .core-center .n { font-family: var(--display); font-weight: 500; text-shadow: 0 0 24px rgba(79, 216, 255, 0.6); }
[data-skin="hud"] .nav, [data-skin="hud"] .tabbar { border-color: var(--line); }
[data-skin="hud"] .nav a { font-family: var(--display); letter-spacing: 0.06em; border-radius: 2px; }
[data-skin="hud"] .tabbar a { color: var(--muted); font-family: var(--display); letter-spacing: 0.06em; }
[data-skin="hud"] .tabbar a.on { color: var(--accent); }
[data-skin="hud"] .toast { border: 1px solid var(--line); border-radius: 3px; }
[data-skin="hud"] .callout { border: 1px solid var(--line); }
[data-skin="hud"] .summary { border-left: 3px solid var(--accent); border-radius: 2px; }
[data-skin="hud"] input[type="checkbox"]::after { background: #d4f1ff; }
[data-skin="hud"] .badge { font-family: var(--mono); }
[data-skin="hud"] ::selection { background: rgba(79, 216, 255, 0.35); }

.nova-head .btn.on { background: var(--accent-soft); color: var(--accent); }
