:root {
  --bg: #f4ecdf; --paper: #fffdf8; --line: #ebe1d0; --ink: #4a423a;
  --accent: #d98b6f; --sage: #8ca583; --gold: #e0b25c; --muted: #9b8f7f;
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  min-height: 100dvh; display: flex; flex-direction: column;
}
/* Topbar */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; background: var(--paper);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.topbar .brand { flex: 1; display: flex; align-items: baseline; gap: 10px; overflow: hidden; }
.topbar .logo { font-family: "Caveat", "Comic Sans MS", cursive; font-size: 30px; color: var(--accent); }
.topbar .hello { font-size: 15px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar #burger { font-size: 26px; border: 0; background: none; cursor: pointer; }
.topbar .ghost { font-size: 14px; color: var(--ink); background: none; border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; cursor: pointer; }

/* Drawer (Burgermenü) */
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 280px; max-width: 85vw;
  background: var(--paper); border-right: 1px solid var(--line);
  padding: 20px 16px; display: flex; flex-direction: column; gap: 6px;
  z-index: 40; overflow-y: auto; box-shadow: 4px 0 24px rgba(0,0,0,.08);
}
.drawer h3 { margin: 0 0 8px; font-size: 18px; }
.drawer a, .drawer button.ghost {
  display: block; padding: 12px 10px; color: var(--ink); text-decoration: none;
  border-radius: 12px; font-size: 16px; text-align: left; background: none; border: 0; cursor: pointer;
}
.drawer a:hover { background: var(--bg); }
.drawer hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }

/* View */
.view { flex: 1; padding: 14px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card h3 { margin: 0 0 10px; font-size: 17px; }
.muted { color: var(--muted); font-size: 13px; }
.inp {
  width: 100%; padding: 12px; margin: 6px 0; font-size: 16px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--paper);
}
.btn {
  width: 100%; padding: 14px; font-size: 16px; font-weight: 600; color: #fff;
  background: var(--accent); border: 0; border-radius: 12px; cursor: pointer; margin-top: 8px;
}

/* Fußzeile / Tab-Leiste – bewusst groß */
.tabbar {
  display: flex; background: var(--paper); border-top: 1px solid var(--line);
  position: sticky; bottom: 0; z-index: 20; padding: 6px 2px calc(6px + env(safe-area-inset-bottom));
  gap: 2px;
}
.tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 72px; gap: 4px;
  font-size: 22px; line-height: 1; color: var(--muted); background: none; border: 0;
  border-radius: 14px; cursor: pointer; padding: 8px 2px;
}
.tabbar button span { font-size: 13px; font-weight: 600; letter-spacing: .2px; }
.tabbar button.active { color: var(--accent); background: var(--bg); }

/* Chat */
.chat { min-height: 260px; max-height: 45vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.msg { max-width: 86%; padding: 10px 12px; border-radius: 14px; font-size: 15px; }
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; }
.msg.betti { align-self: flex-start; background: var(--bg); }
.hidden { display: none !important; }
body.locked .topbar, body.locked .tabbar, body.locked .drawer { display: none !important; }
body.locked .view { align-items: center; justify-content: center; }
body.locked .view .card { max-width: 420px; width: 100%; }