:root {
  --bg: #0b0c0f;
  --bg-2: #13151a;
  --bg-3: #1b1e25;
  --linie: #262a33;
  --text: #ece8e1;
  --text-2: #9a968f;
  --gold: #c9a96e;
  --gold-hell: #e6cf9f;
  --gold-dunkel: #8a7044;
  --rot: #e07a6f;
  --radius: 18px;
  --sicher-oben: env(safe-area-inset-top, 0px);
  --sicher-unten: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.5; overscroll-behavior: none;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.screen { height: 100dvh; display: flex; flex-direction: column; }
.marke { font-family: "Didot", "Bodoni 72", Georgia, serif; letter-spacing: .14em; text-transform: uppercase; font-weight: 400; color: var(--gold-hell); margin: 0; }
.marke.klein { font-size: 15px; }
.leise { color: var(--text-2); margin: 0; }
.klein-text { font-size: 13px; padding: 0 20px 20px; }
.fehler { color: var(--rot); min-height: 1.5em; font-size: 14px; margin: 0; }

/* ---------- Orb ---------- */
.orb { position: relative; width: 38px; height: 38px; flex: none; }
.orb span {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid var(--gold); opacity: .9;
}
.orb span:nth-child(1) { background: radial-gradient(circle at 50% 45%, var(--gold-hell) 0 14%, var(--gold) 15% 22%, transparent 24%); border-color: var(--gold-dunkel); }
.orb span:nth-child(2) { inset: 18%; border-style: dashed; border-color: var(--gold); opacity: .7; }
.orb span:nth-child(3) { inset: -10%; border-color: var(--gold-dunkel); opacity: .35; }
.orb { animation: atmen 4s ease-in-out infinite; }
.orb.denkt span:nth-child(2) { animation: drehen 1.4s linear infinite; opacity: 1; }
.orb.denkt span:nth-child(3) { animation: drehen 3s linear infinite reverse; border-style: dotted; opacity: .8; }
.orb.spricht span:nth-child(1) { animation: puls .5s ease-in-out infinite alternate; }
.orb.spricht span:nth-child(3) { animation: welle 1.2s ease-out infinite; }
.orb.hoert span:nth-child(1) { border-color: var(--rot); }
.orb.hoert span:nth-child(3) { border-color: var(--rot); animation: welle 1s ease-out infinite; }
.orb-gross { width: 120px; height: 120px; margin: 0 auto 28px; }
.orb-gross span:nth-child(2) { animation: drehen 12s linear infinite; }
@keyframes atmen { 50% { transform: scale(1.05); } }
@keyframes drehen { to { transform: rotate(360deg); } }
@keyframes puls { to { transform: scale(1.12); filter: brightness(1.3); } }
@keyframes welle { from { transform: scale(.9); opacity: .9; } to { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .orb, .orb span { animation: none !important; } }

/* ---------- Login ---------- */
#login { align-items: center; justify-content: center; padding: 24px; }
.login-box { width: 100%; max-width: 340px; text-align: center; }
.login-box .marke { font-size: 30px; }
.login-box form { margin-top: 36px; display: grid; gap: 12px; }
input, textarea {
  font: inherit; color: var(--text); background: var(--bg-2);
  border: 1px solid var(--linie); border-radius: 14px; padding: 13px 16px; outline: none; width: 100%;
}
input:focus, textarea:focus { border-color: var(--gold-dunkel); }
.knopf-gold { background: var(--gold); color: #17140e; border-radius: 14px; padding: 13px; font-weight: 600; }
.knopf-gold:active { background: var(--gold-hell); }

/* ---------- Kopf ---------- */
.kopf {
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(10px + var(--sicher-oben)) 14px 10px 16px;
  border-bottom: 1px solid var(--linie); background: rgba(11, 12, 15, .92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); position: relative; z-index: 3;
}
.kopf-links { display: flex; align-items: center; gap: 12px; }
.kopf-rechts { display: flex; gap: 2px; }
.status { font-size: 12px; color: var(--text-2); }
.icon-knopf { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); position: relative; }
.icon-knopf:active { background: var(--bg-3); }
.icon-knopf.an { color: var(--gold); }
#btn-ton:not(.an) .welle { opacity: .25; }
#anzahl { position: absolute; top: 6px; right: 5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--gold); color: #17140e; font-size: 11px; line-height: 17px; font-weight: 700; }

.menu { position: absolute; right: 12px; top: calc(62px + var(--sicher-oben)); z-index: 5; background: var(--bg-3); border: 1px solid var(--linie); border-radius: 14px; overflow: hidden; display: grid; min-width: 190px; }
.menu button { text-align: left; padding: 13px 16px; }
.menu button + button { border-top: 1px solid var(--linie); }
.menu button:active { background: var(--bg-2); }

/* ---------- Verlauf ---------- */
.verlauf { flex: 1; overflow-y: auto; padding: 18px 14px 8px; display: flex; flex-direction: column; gap: 10px; -webkit-overflow-scrolling: touch; }
.blase { max-width: 84%; padding: 10px 14px; border-radius: var(--radius); word-wrap: break-word; overflow-wrap: anywhere; animation: rein .2s ease-out; }
.blase.user { align-self: flex-end; background: #2a2418; border: 1px solid #3d3322; border-bottom-right-radius: 6px; }
.blase.assistant { align-self: flex-start; background: var(--bg-2); border: 1px solid var(--linie); border-bottom-left-radius: 6px; }
.blase.fehler-blase { border-color: #5a2d29; color: var(--rot); }
.blase p { margin: 0 0 .5em; } .blase p:last-child { margin: 0; }
.blase ul { margin: .2em 0 .5em; padding-left: 1.2em; }
.blase strong { color: var(--gold-hell); font-weight: 600; }
.blase code { background: var(--bg-3); padding: 1px 5px; border-radius: 5px; font-size: .92em; }
.zeit { font-size: 11px; color: var(--text-2); align-self: center; margin: 6px 0; }
.werkzeug { font-size: 12px; color: var(--gold); align-self: flex-start; padding-left: 6px; }
.tippt { display: inline-flex; gap: 4px; padding: 4px 0; }
.tippt i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); opacity: .4; animation: tipp 1s infinite; }
.tippt i:nth-child(2) { animation-delay: .15s; } .tippt i:nth-child(3) { animation-delay: .3s; }
@keyframes tipp { 50% { opacity: 1; transform: translateY(-3px); } }
@keyframes rein { from { opacity: 0; transform: translateY(6px); } }

.leer { margin: auto; text-align: center; padding: 30px; }
.leer .orb-gross { width: 90px; height: 90px; }
.vorschlaege { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.vorschlaege button { border: 1px solid var(--linie); border-radius: 20px; padding: 7px 13px; font-size: 14px; color: var(--text-2); }
.vorschlaege button:active { border-color: var(--gold-dunkel); color: var(--text); }

/* ---------- Eingabe ---------- */
.eingabe { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px calc(10px + var(--sicher-unten)); border-top: 1px solid var(--linie); background: var(--bg); }
.eingabe textarea { resize: none; max-height: 140px; border-radius: 22px; padding: 10px 16px; line-height: 1.4; }
.senden { width: 42px; height: 42px; flex: none; border-radius: 50%; background: var(--gold); color: #17140e; display: grid; place-items: center; }
.senden:disabled { opacity: .4; }
.mic { flex: none; }
.mic.an { color: var(--rot); background: #2a1715; }

/* ---------- Erinnerungen ---------- */
.panel { position: absolute; inset: 0; z-index: 10; background: var(--bg); display: flex; flex-direction: column; padding-top: var(--sicher-oben); animation: rein .2s ease-out; }
.panel-kopf { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px 10px 20px; border-bottom: 1px solid var(--linie); }
.panel-kopf h2 { font-size: 18px; font-weight: 500; margin: 0; }
.liste { list-style: none; margin: 0; padding: 8px 12px; overflow-y: auto; flex: 1; }
.liste li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 8px; border-bottom: 1px solid var(--linie); }
.liste .haken { width: 24px; height: 24px; flex: none; border-radius: 50%; border: 1.5px solid var(--gold-dunkel); margin-top: 1px; }
.liste .haken:active { background: var(--gold); }
.liste .faellig { display: block; font-size: 13px; color: var(--text-2); }
.liste .faellig.ueberfaellig { color: var(--rot); }
.liste .leer-text { color: var(--text-2); border: 0; justify-content: center; padding: 40px 0; }

/* ---------- Gespräch (Anruf-Bildschirm) ---------- */
#btn-anruf { color: var(--gold); }
.anruf {
  position: absolute; inset: 0; z-index: 20; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: calc(48px + var(--sicher-oben)) 24px calc(40px + var(--sicher-unten)); animation: rein .25s ease-out;
}
.anruf-oben { text-align: center; }
.anruf-oben .marke { font-size: 24px; }
.anruf-oben .status { font-size: 15px; margin-top: 6px; }
.orb-anruf { width: 190px; height: 190px; }
.anruf-text { min-height: 4.5em; max-width: 420px; text-align: center; color: var(--text-2); font-size: 16px; margin: 0; }
.anruf-knoepfe { display: flex; gap: 48px; }
.rund { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-3); color: var(--text); }
.rund svg { width: 28px; height: 28px; }
.rund.rot { background: #c0453a; color: #fff; }
.rund.rot svg { fill: currentColor; stroke: none; }
#btn-stumm .strich { opacity: 0; }
#btn-stumm.an { background: var(--text); color: var(--bg); }
#btn-stumm.an .strich { opacity: 1; }

@media (min-width: 760px) {
  .verlauf, .eingabe { padding-left: calc(50% - 360px); padding-right: calc(50% - 360px); }
  .blase { max-width: 70%; }
}
