:root {
  --bg: #0D0D0C; --panel: #161614; --line: rgba(255, 255, 255, .1); --text: rgba(255, 255, 255, .92);
  --muted: rgba(255, 255, 255, .55); --gold: #E79E02; --ink: #0D0D0C; --err: #ff8a7a; --ok: #6EE7A0;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
.btn { border: 0; border-radius: 6px; background: var(--gold); color: var(--ink); font-weight: 700; padding: .7rem 1.1rem; cursor: pointer; }
.btn:disabled { opacity: .5; cursor: default; }
.app { height: 100%; }

/* Anmeldung */
.login { max-width: 360px; margin: 0 auto; padding: 12vh 16px 2rem; text-align: center; }
.login__logo { width: 180px; height: auto; }
.login h1 { font-size: 1.1rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin: .6rem 0 1.6rem; }
.login form { display: grid; gap: .9rem; text-align: left; }
.login label { display: grid; gap: .3rem; font-size: .85rem; color: var(--muted); }
.login input { font: inherit; font-size: 16px; padding: .7rem .8rem; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: #fff; }
.login input:focus { outline: 2px solid var(--gold); border-color: transparent; }
.login__link { justify-self: center; border: 0; background: none; color: var(--gold); text-decoration: underline; font-size: .9rem; cursor: pointer; padding: .3rem; }
.login__info { color: var(--muted); font-size: .95rem; margin: -.6rem 0 1.4rem; }
.login__err { color: var(--err); min-height: 1.5em; margin: 0; font-size: .9rem; }

/* Hauptansicht */
.main { display: flex; flex-direction: column; height: 100%; }
.top { position: relative; display: flex; align-items: center; gap: .5rem; padding: calc(.5rem + env(safe-area-inset-top)) 12px .5rem; border-bottom: 1px solid rgba(231, 158, 2, .35); background: #0a0a09; }
.top__logo { height: 22px; width: auto; }
.top__sites { display: flex; margin-left: auto; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.top__sites button { border: 0; background: none; padding: .35rem .7rem; font-size: .85rem; color: var(--muted); cursor: pointer; }
.top__sites button.is-on { background: var(--gold); color: var(--ink); font-weight: 700; }
.top__btn { border: 1px solid var(--line); background: none; border-radius: 6px; padding: .35rem .6rem; font-size: .85rem; cursor: pointer; }
.menu { position: absolute; right: 12px; top: 100%; z-index: 10; display: grid; min-width: 190px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .3rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.menu button, .menu a { text-align: left; background: none; border: 0; padding: .6rem .7rem; border-radius: 6px; color: var(--text); text-decoration: none; font-size: .92rem; cursor: pointer; }
.menu button:hover, .menu a:hover { background: rgba(255, 255, 255, .06); }

.body { flex: 1; display: flex; min-height: 0; }
.chat { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.log { flex: 1; overflow-y: auto; padding: 1rem 16px; display: flex; flex-direction: column; gap: .9rem; }
.msg { max-width: 100%; word-wrap: break-word; }
.msg--me { align-self: flex-end; max-width: 85%; background: rgba(255, 255, 255, .08); padding: .55rem .9rem; border-radius: 14px 14px 4px 14px; white-space: pre-wrap; }
.msg--bot { padding-left: .9rem; border-left: 2px solid rgba(231, 158, 2, .45); }
.msg--bot p { margin: 0 0 .6rem; } .msg--bot p:last-child { margin-bottom: 0; }
.msg--bot ul, .msg--bot ol { margin: .2rem 0 .6rem; padding-left: 1.2rem; }
.msg--bot h4 { margin: .6rem 0 .3rem; color: var(--gold); font-size: .95rem; }
.msg--bot code { background: rgba(255, 255, 255, .08); padding: 0 .25rem; border-radius: 3px; font-size: .88em; }
.msg--err { color: var(--err); font-size: .92rem; }
.msg--note { color: var(--muted); font-size: .85rem; }
.steps { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .5rem; }
.steps span { font-size: .72rem; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: .1rem .5rem; }
.fin { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; font-size: .78rem; color: var(--ok); }
.fin button { border: 0; background: none; color: var(--gold); text-decoration: underline; cursor: pointer; font-size: .78rem; padding: 0; }
.typing { color: var(--muted); font-size: .85rem; }
.typing::after { content: " …"; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* Auswahl zum Anklicken */
.choice { display: flex; flex-direction: column; gap: .4rem; margin-top: .7rem; }
.choice__hint { font-size: .74rem; color: var(--muted); }
.choice__opt { display: flex; align-items: flex-start; gap: .6rem; width: 100%; padding: .65rem .75rem; border: 1px solid rgba(231, 158, 2, .35); border-radius: 8px; background: rgba(231, 158, 2, .05); font-size: .92rem; line-height: 1.4; text-align: left; cursor: pointer; }
.choice__opt i { flex: none; width: 1rem; height: 1rem; margin-top: .12rem; border: 2px solid rgba(231, 158, 2, .7); border-radius: 50%; }
.choice--multi .choice__opt:not(.choice__other) i { border-radius: 4px; }
.choice__opt.is-on { background: rgba(231, 158, 2, .18); border-color: var(--gold); }
.choice__opt.is-on i { background: var(--gold); box-shadow: inset 0 0 0 2px var(--ink); }
.choice__other { border-style: dashed; color: var(--muted); }
.choice__other i { border-style: dashed; }
.choice__go { align-self: flex-start; padding: .45rem .9rem; }
.choice.is-done .choice__opt { cursor: default; }
.choice.is-done .choice__opt:not(.is-on) { opacity: .45; }

.composer { display: flex; gap: .5rem; align-items: flex-end; padding: .6rem 12px calc(.6rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #0a0a09; }
.composer textarea { flex: 1; resize: none; max-height: 40vh; font: inherit; font-size: 16px; padding: .65rem .8rem; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: #fff; }
.composer textarea:focus { outline: 1px solid var(--gold); }
.composer__send { width: 44px; height: 44px; padding: 0; font-size: 1.2rem; border-radius: 10px; }

/* Vorschau */
.preview { display: flex; flex-direction: column; flex: 1.2; border-left: 1px solid var(--line); min-width: 0; }
.preview__bar { display: flex; align-items: center; gap: .5rem; padding: .4rem 12px; border-bottom: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.preview__bar span { margin-right: auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview__bar .top__btn { white-space: nowrap; flex: none; }
.preview iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.preview__close { display: none; }
#btn-preview { display: none; }

@media (max-width: 900px) {
  .preview { display: none; position: fixed; inset: 0; z-index: 20; background: var(--bg); border: 0; padding-top: env(safe-area-inset-top); }
  .preview.is-open { display: flex; }
  .preview__close { display: inline-block; }
  #btn-preview { display: inline-block; }
  .top__logo { display: none; }
  .top__sites { margin-left: 0; }
  #btn-preview { margin-left: auto; }
}
