/* Lisa — Design-System. Deep Void + Phosphor. Mobile-first. */

:root {
  --bg: #08090c;
  --surface: #0f1217;
  --surface-2: #151922;
  --surface-3: #1b2029;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --text: #ecedf0;
  --text-dim: #8b919c;
  --text-faint: #5b6069;
  --phosphor: #00d97e;
  --phosphor-soft: rgba(0, 217, 126, 0.13);
  --phosphor-line: rgba(0, 217, 126, 0.45);
  --amber: #ffb454;
  --red: #ff7a7a;
  --blue: #5b9dff;
  --purple: #c792ea;
  --radius: 14px;
  --radius-sm: 9px;
  --nav-h: 62px;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  background:
    radial-gradient(ellipse 900px 600px at 80% -10%, rgba(0, 217, 126, 0.05), transparent 65%),
    radial-gradient(ellipse 700px 500px at 0% 105%, rgba(0, 217, 126, 0.03), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; }
a { color: var(--phosphor); }

/* ---------- Shell ---------- */

.shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px calc(var(--nav-h) + 28px);
  min-width: 0;
  width: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 2px 14px;
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(to bottom, var(--bg) 78%, transparent);
}

.topbar h1 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.topbar .sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: -2px;
}
.topbar .spacer { flex: 1; }

.topbar .date-chip {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
  border: 1px solid var(--line);
  padding: 5px 10px;
  border-radius: 99px;
  white-space: nowrap;
}

/* ---------- Orb — Lisas Präsenz ---------- */

.orb {
  width: 34px; height: 34px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  background: radial-gradient(circle at 35% 30%, #4dffb0, var(--phosphor) 55%, #007a47 100%);
  box-shadow:
    0 0 14px rgba(0, 217, 126, 0.55),
    0 0 44px rgba(0, 217, 126, 0.18),
    inset 0 -4px 9px rgba(0, 0, 0, 0.35);
  animation: orb-breathe 4.5s ease-in-out infinite;
}
.orb.small { width: 24px; height: 24px; }
.orb.thinking { animation: orb-think 0.9s ease-in-out infinite; }

@keyframes orb-breathe {
  0%, 100% { transform: scale(1); box-shadow: 0 0 12px rgba(0,217,126,.45), 0 0 40px rgba(0,217,126,.14), inset 0 -4px 9px rgba(0,0,0,.35); }
  50%       { transform: scale(1.07); box-shadow: 0 0 20px rgba(0,217,126,.7), 0 0 60px rgba(0,217,126,.25), inset 0 -4px 9px rgba(0,0,0,.35); }
}
@keyframes orb-think {
  0%, 100% { transform: scale(0.92); }
  50%      { transform: scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
  .orb, .orb.thinking { animation: none; }
}

/* ---------- Cards / Sections ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  margin: 22px 2px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- Kalender ---------- */

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cal-head .month {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.cal-nav {
  display: flex;
  gap: 6px;
}
.cal-nav button {
  width: 34px; height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 16px;
  transition: border-color .15s, color .15s;
}
.cal-nav button:hover { border-color: var(--phosphor-line); color: var(--phosphor); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-dow {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  text-align: center;
  padding: 4px 0 8px;
}
.cal-cell {
  aspect-ratio: 1 / 1.06;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 7px;
  gap: 4px;
  position: relative;
  color: var(--text);
  transition: background .12s, border-color .12s;
}
.cal-cell:hover { background: var(--surface-2); }
.cal-cell .num {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1;
}
.cal-cell.other { color: var(--text-faint); }
.cal-cell.other .num { opacity: 0.5; }
.cal-cell.today {
  border-color: var(--phosphor-line);
  background: var(--phosphor-soft);
  box-shadow: 0 0 16px rgba(0, 217, 126, 0.12) inset;
}
.cal-cell.today .num { color: var(--phosphor); font-weight: 700; }
.cal-cell.selected { border-color: var(--line-strong); background: var(--surface-3); }

.cal-dots {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 80%;
}
.cal-dots i {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--phosphor);
  box-shadow: 0 0 5px rgba(0, 217, 126, 0.6);
}
.cal-dots i.ext { background: var(--blue); box-shadow: 0 0 5px rgba(91,157,255,.5); }
.cal-dots i.more { background: var(--text-faint); box-shadow: none; }

/* Agenda unter dem Kalender */
.agenda-item {
  display: flex;
  gap: 12px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.agenda-item:last-child { border-bottom: none; }
.agenda-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--phosphor);
  min-width: 76px;
  white-space: nowrap;
}
.agenda-time.allday { color: var(--amber); }
.agenda-body { min-width: 0; flex: 1; }
.agenda-title { font-size: 14.5px; font-weight: 500; overflow-wrap: break-word; }
.agenda-meta { font-size: 12px; color: var(--text-dim); overflow-wrap: break-word; }
.agenda-cal {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  white-space: nowrap;
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agenda-del {
  background: none; border: none;
  color: var(--text-faint);
  font-size: 15px;
  padding: 2px 4px;
}
.agenda-del:hover { color: var(--red); }

/* ---------- Heute-Liste ---------- */

.today-greeting {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 6px 2px 2px;
}
.today-greeting .accent { color: var(--phosphor); }
.today-sub { color: var(--text-dim); font-size: 13.5px; margin: 0 2px 16px; }

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line);
}
.check-item:last-child { border-bottom: none; }
.checkbox {
  width: 22px; height: 22px;
  border-radius: 7px;
  border: 1.5px solid var(--line-strong);
  background: transparent;
  flex-shrink: 0;
  margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  color: transparent;
  font-size: 13px;
  transition: all .15s;
}
.checkbox.done {
  background: var(--phosphor);
  border-color: var(--phosphor);
  color: #05130c;
}
.check-body { flex: 1; min-width: 0; }
.check-title { font-size: 14.5px; overflow-wrap: anywhere; }
.check-title.done { text-decoration: line-through; color: var(--text-faint); }
.check-meta { font-size: 12px; color: var(--text-dim); display: flex; gap: 8px; flex-wrap: wrap; }

.pill {
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 99px;
  border: 1px solid var(--line);
  color: var(--text-dim);
  white-space: nowrap;
}
.pill.urgent { color: var(--red); border-color: rgba(255,122,122,.4); background: rgba(255,122,122,.08); }
.pill.high { color: var(--amber); border-color: rgba(255,180,84,.4); background: rgba(255,180,84,.07); }
.pill.low { color: var(--text-faint); }
.pill.proj { border-style: dashed; }

.empty {
  color: var(--text-faint);
  font-size: 13.5px;
  text-align: center;
  padding: 22px 10px;
}
.empty .big { font-size: 26px; display: block; margin-bottom: 6px; }

/* Tagesplan-Card */
.plan-card { border-color: var(--phosphor-line); background: linear-gradient(160deg, rgba(0,217,126,.06), transparent 55%), var(--surface); }
.plan-card h3 { font-family: var(--font-display); font-size: 15px; margin-bottom: 8px; display:flex; align-items:center; gap:8px; }
.plan-card ol { margin: 4px 0 10px 20px; }
.plan-card li { margin: 3px 0; font-size: 14px; }
.plan-card p { font-size: 13.5px; color: var(--text-dim); margin-top: 6px; }
.plan-card p strong { color: var(--text); }

/* ---------- Kanban ---------- */

.board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 10px;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
}
.board::-webkit-scrollbar { height: 6px; }
.board::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }

.col {
  min-width: 258px;
  max-width: 258px;
  scroll-snap-align: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  align-self: flex-start;
}
.col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.col-head .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.col-head .name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  flex: 1;
  overflow-wrap: anywhere;
}
.col-head .count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
}

.task-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 11px;
  margin-bottom: 8px;
  width: 100%;
  text-align: left;
  color: var(--text);
  display: block;
  transition: border-color .12s, transform .12s;
}
.task-card:hover { border-color: var(--line-strong); }
.task-card:active { transform: scale(0.985); }
.task-card.doing { border-left: 2px solid var(--phosphor); }
.task-card .t { font-size: 13.5px; line-height: 1.4; overflow-wrap: anywhere; }
.task-card .m { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; align-items: center; }
.task-card .due { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-dim); }
.task-card .due.over { color: var(--red); }

.col-add {
  width: 100%;
  background: none;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text-faint);
  padding: 8px;
  font-size: 13px;
  transition: color .12s, border-color .12s;
}
.col-add:hover { color: var(--phosphor); border-color: var(--phosphor-line); }

/* ---------- Chat ---------- */

.chat-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 175px);
  min-height: 320px;
}
.chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 4px 2px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.msg {
  max-width: 86%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg.user {
  align-self: flex-end;
  background: var(--phosphor-soft);
  border: 1px solid var(--phosphor-line);
  border-bottom-right-radius: 5px;
}
.msg.assistant {
  align-self: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
}
.msg .ch {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-faint);
  margin-top: 5px;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.chat-input {
  display: flex;
  gap: 8px;
  padding-top: 10px;
  align-items: flex-end;
}
.chat-input textarea {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  color: var(--text);
  padding: 11px 14px;
  resize: none;
  max-height: 120px;
  min-height: 44px;
  outline: none;
}
.chat-input textarea:focus { border-color: var(--phosphor-line); }
.chat-send {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--phosphor);
  color: #05130c;
  font-size: 17px;
  flex-shrink: 0;
  transition: transform .12s, opacity .12s;
}
.chat-send:active { transform: scale(0.92); }
.chat-send:disabled { opacity: 0.4; }

/* ---------- Settings ---------- */

.set-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.set-row:last-child { border-bottom: none; }
.set-row .k { color: var(--text-dim); }
.set-row .v { font-family: var(--font-mono); font-size: 12.5px; text-align: right; overflow-wrap: anywhere; }
.set-row .v.ok { color: var(--phosphor); }
.set-row .v.bad { color: var(--red); }

.mono-box {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 8px 0;
  color: var(--text-dim);
}
.mono-box b { color: var(--phosphor); font-weight: 500; }

/* ---------- Buttons / Forms ---------- */

.btn {
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: 11px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  transition: border-color .12s, background .12s;
}
.btn:hover { border-color: var(--phosphor-line); }
.btn.primary {
  background: var(--phosphor);
  border-color: var(--phosphor);
  color: #05130c;
  font-weight: 600;
}
.btn.primary:hover { background: #00c471; }
.btn.danger { color: var(--red); border-color: rgba(255,122,122,.35); }
.btn.small { padding: 6px 12px; font-size: 12.5px; border-radius: 9px; }
.btn.ghost { background: none; border-color: transparent; color: var(--text-dim); }
.btn.ghost:hover { color: var(--phosphor); }

.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-faint);
  margin-bottom: 5px;
}
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--phosphor-line); }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }

/* ---------- Modal ---------- */

.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(3, 4, 6, 0.72);
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 20px 20px 0 0;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  width: 100%;
  max-width: 560px;
  max-height: 86dvh;
  overflow-y: auto;
}
.modal h2 {
  font-family: var(--font-display);
  font-size: 17px;
  margin-bottom: 16px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.modal-actions .btn { flex: 1; }
@media (min-width: 640px) {
  .modal-back { align-items: center; padding: 20px; }
  .modal { border-radius: 20px; }
}

/* ---------- Bottom-Nav ---------- */

.nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(10, 12, 16, 0.92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: flex;
  z-index: 80;
}
.nav button {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: color .12s;
}
.nav button .ico { font-size: 19px; line-height: 1; }
.nav button.active { color: var(--phosphor); }
.nav button.active .ico { filter: drop-shadow(0 0 6px rgba(0, 217, 126, 0.6)); }

/* ---------- Login ---------- */

.login-back {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box { width: min(330px, 88vw); text-align: center; }
.login-box .orb { width: 62px; height: 62px; margin: 0 auto 18px; }
.login-box h1 {
  font-family: var(--font-display);
  font-size: 30px;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.login-box .sub { color: var(--text-dim); font-size: 13.5px; margin-bottom: 26px; }
.login-box input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--text);
  padding: 13px 15px;
  text-align: center;
  font-size: 16px;
  outline: none;
  margin-bottom: 12px;
}
.login-box input:focus { border-color: var(--phosphor-line); }
.login-box .btn { width: 100%; padding: 13px; }
.login-err { color: var(--red); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 18px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-3);
  border: 1px solid var(--phosphor-line);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 18px;
  font-size: 13.5px;
  z-index: 150;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  max-width: 88vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Proposals ---------- */

.proposal-card {
  border-color: rgba(255, 180, 84, 0.4);
  background: linear-gradient(160deg, rgba(255,180,84,.06), transparent 50%), var(--surface);
}
.proposal-card .t { font-weight: 600; font-size: 14.5px; margin-bottom: 3px; }
.proposal-card .m { font-size: 12.5px; color: var(--text-dim); margin-bottom: 10px; }
.proposal-card .conf { color: var(--red); font-size: 12.5px; margin-bottom: 8px; }
.proposal-card .row { display: flex; gap: 8px; }
.proposal-card .row .btn { flex: 1; }

.fab {
  position: fixed;
  right: 18px;
  bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom));
  width: 52px; height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--phosphor);
  color: #05130c;
  font-size: 26px;
  line-height: 1;
  z-index: 70;
  box-shadow: 0 4px 22px rgba(0, 217, 126, 0.35);
  transition: transform .12s;
}
.fab:active { transform: scale(0.9); }

.hidden { display: none !important; }

:focus-visible { outline: 2px solid var(--phosphor-line); outline-offset: 2px; }
