/* Jarvis – Gestaltung angelehnt an iOS: ruhig, gruppierte Listen, klare Typografie */
:root {
  --bg: #f2f2f7; --card: #fff; --card-2: #f2f2f7; --text: #000; --muted: #8e8e93;
  --sep: rgba(60, 60, 67, .18); --tint: #007aff; --green: #34c759; --red: #ff3b30; --orange: #ff9500;
  --fill: rgba(118, 118, 128, .12); --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000; --card: #1c1c1e; --card-2: #2c2c2e; --text: #fff; --muted: #8e8e93;
    --sep: rgba(84, 84, 88, .6); --tint: #0a84ff; --green: #30d158; --red: #ff453a; --orange: #ff9f0a;
    --fill: rgba(118, 118, 128, .24);
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 17px/1.3 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; max-width: 680px; margin: 0 auto;
  padding: env(safe-area-inset-top) 16px calc(32px + env(safe-area-inset-bottom));
}
button { font: inherit; border: 0; background: none; color: inherit; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: var(--text); }
[hidden] { display: none !important; }

/* Kopfbereich */
.navbar { display: flex; justify-content: space-between; align-items: center; height: 44px; }
.large-title { font-size: 34px; font-weight: 700; letter-spacing: .01em; margin: 0 0 12px; }
.link { color: var(--tint); }
.bold { font-weight: 600; }
.intro { color: var(--muted); margin: 0 4px 16px; font-size: 15px; }
.footnote { color: var(--muted); font-size: 13px; margin: 6px 16px 12px; min-height: 1em; }

/* Gruppierte Liste */
.group { background: var(--card); border-radius: var(--radius); overflow: hidden; margin-bottom: 8px; }
.group > * + * { box-shadow: inset 16px .5px 0 var(--card), inset 0 .5px 0 var(--sep); }
.group-title { font-size: 13px; text-transform: uppercase; color: var(--muted); margin: 22px 16px 6px; letter-spacing: .02em; }
.row-input { display: block; width: 100%; border: 0; background: transparent; padding: 12px 16px; outline: none; }
.stack { display: flex; flex-direction: column; gap: 12px; align-items: center; margin-top: 20px; }
.primary { width: 100%; background: var(--tint); color: #fff; font-weight: 600; padding: 14px; border-radius: var(--radius); }
.primary:active { opacity: .7; }

/* Fragenkatalog */
.choice { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .check { color: var(--tint); font-weight: 600; visibility: hidden; }
.choice input:checked ~ .check { visibility: visible; }

/* Eingabe (wie iMessage) */
.composer { display: flex; align-items: flex-end; gap: 8px; background: var(--card); border-radius: 22px; padding: 6px 6px 6px 16px; }
.composer textarea { flex: 1; border: 0; background: transparent; resize: none; outline: none; padding: 8px 0; max-height: 160px; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; font-size: 18px; }
.icon-btn.listening { background: var(--red); animation: pulse 1s infinite; }
.send-btn { width: 34px; height: 34px; border-radius: 50%; background: var(--tint); color: #fff; font-weight: 700; font-size: 18px; }
.send-btn:disabled { opacity: .35; }
@keyframes pulse { 50% { opacity: .5; } }

/* Segment-Schalter */
.segmented { display: flex; background: var(--fill); border-radius: 9px; padding: 2px; margin: 4px 0 10px; }
.segmented button { flex: 1; padding: 6px 4px; border-radius: 7px; font-size: 13px; font-weight: 500; }
.segmented button.active { background: var(--card); box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04); }
@media (prefers-color-scheme: dark) { .segmented button.active { background: #636366; } }
.area-filter select { appearance: none; -webkit-appearance: none; border: 0; background: var(--fill); color: var(--tint);
  border-radius: 99px; padding: 6px 28px 6px 12px; font-size: 15px;
  background-image: linear-gradient(45deg, transparent 50%, var(--tint) 50%), linear-gradient(135deg, var(--tint) 50%, transparent 50%);
  background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }

/* Einträge */
.item { display: flex; align-items: center; gap: 12px; padding: 11px 16px; min-height: 52px; cursor: pointer; }
.item:active { background: var(--fill); }
.item .body { flex: 1; min-width: 0; }
.item .title { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.item .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.item.done .title { color: var(--muted); text-decoration: line-through; }
.circle { width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%; border: 1.5px solid var(--muted); display: grid; place-items: center; color: #fff; font-size: 14px; }
.item.done .circle { background: var(--tint); border-color: var(--tint); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }
.dot.high { background: var(--red); } .dot.mid { background: var(--orange); } .dot.low { background: var(--muted); }
.chev { color: var(--muted); opacity: .6; font-size: 20px; }
.pill { background: var(--green); color: #fff; font-size: 15px; font-weight: 600; padding: 5px 14px; border-radius: 99px; flex-shrink: 0; }
.pill:active { opacity: .7; }
.group-title .action { float: right; text-transform: none; color: var(--tint); font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }

/* Bottom Sheet */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 10; animation: fade .2s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-width: 680px; margin: 0 auto; max-height: 90vh; overflow: auto;
  background: var(--bg); border-radius: 12px 12px 0 0; z-index: 11; padding: 0 16px calc(24px + env(safe-area-inset-bottom)); animation: up .25s ease-out; }
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--muted); opacity: .5; margin: 6px auto 0; }
.sheet-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 44px; }
.sheet-bar button { justify-self: end; }
.sheet textarea.row-input { resize: none; font-weight: 600; }
.field { display: flex; justify-content: space-between; align-items: center; padding: 0 16px; min-height: 44px; position: relative; }
.field select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: var(--muted); text-align: right;
  text-align-last: right; padding: 11px 18px 11px 0; outline: none; }
.field::after { content: "›"; position: absolute; right: 14px; color: var(--muted); opacity: .6; pointer-events: none; font-size: 20px; }
.info { padding: 12px 16px; font-size: 15px; }
.info small { display: block; color: var(--muted); font-size: 13px; margin-bottom: 2px; }
.btn-row { display: block; width: 100%; text-align: center; padding: 12px; color: var(--tint); }
.btn-row.green { color: var(--green); font-weight: 600; } .btn-row.red { color: var(--red); }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
