:root {
  --bg: #05040a;
  --glass: rgba(20, 16, 36, .55);
  --glass2: rgba(34, 28, 58, .55);
  --line: rgba(255, 255, 255, .09);
  --line2: rgba(255, 255, 255, .16);
  --text: #f1eefb;
  --muted: #a39dbd;
  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --pink: #ec4899;
  --gold: #f59e0b;
  --c-normal: linear-gradient(135deg, #22d3ee, #3b82f6);
  --c-comfort: linear-gradient(135deg, #a78bfa, #d946ef);
  --c-ultra: linear-gradient(135deg, #f59e0b, #ec4899, #8b5cf6, #f59e0b);
  --accent: #22d3ee;
  --accent-grad: var(--c-normal);
  --radius: 18px;
  --display: "Segoe UI Variable Display", "SF Pro Display", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --shadow: 0 24px 70px rgba(0, 0, 0, .55);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
body[data-model="comfort"] { --accent: #c084fc; --accent-grad: var(--c-comfort); }
body[data-model="ultra"] { --accent: #f472b6; --accent-grad: var(--c-ultra); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { font: 15.5px/1.6 system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
::selection { background: rgba(139, 92, 246, .45); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .1); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }

/* ---------- Hintergrund: Polarlicht ---------- */
.aurora { position: fixed; inset: -20%; z-index: 0; filter: blur(80px) saturate(140%); opacity: .55; pointer-events: none; }
.aurora i { position: absolute; border-radius: 50%; mix-blend-mode: screen; animation: drift 26s var(--ease) infinite alternate; }
.aurora .a1 { width: 55vmax; height: 55vmax; left: -5%; top: -10%; background: radial-gradient(circle, #6d28d9 0%, transparent 65%); }
.aurora .a2 { width: 45vmax; height: 45vmax; right: -5%; top: 5%; background: radial-gradient(circle, #0e7490 0%, transparent 65%); animation-duration: 32s; animation-delay: -8s; }
.aurora .a3 { width: 50vmax; height: 50vmax; left: 25%; bottom: -25%; background: radial-gradient(circle, #be185d 0%, transparent 65%); animation-duration: 38s; animation-delay: -14s; opacity: .7; }
.aurora .a4 { width: 30vmax; height: 30vmax; right: 20%; bottom: 0; background: radial-gradient(circle, #b45309 0%, transparent 65%); animation-duration: 30s; opacity: 0; transition: opacity 1.2s; }
body[data-model="ultra"] .aurora .a4 { opacity: .8; }
body[data-model="comfort"] .aurora .a1 { background: radial-gradient(circle, #9333ea 0%, transparent 65%); }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  50% { transform: translate(8vw, 6vh) scale(1.15) rotate(25deg); }
  100% { transform: translate(-6vw, -4vh) scale(.95) rotate(-15deg); }
}
.grain { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E"); }

.glass { background: var(--glass); backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%); border: 1px solid var(--line); }

.app { position: relative; z-index: 1; display: flex; height: 100dvh; }

/* ---------- Seitenleiste ---------- */
.side { width: 280px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; padding: 16px; border-width: 0 1px 0 0; border-radius: 0; }
.side-top { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 600 19px var(--display); letter-spacing: -.01em; }
.brand img { width: 36px; height: 36px; border-radius: 11px; box-shadow: 0 8px 26px rgba(139, 92, 246, .55); }
.brand b { background: var(--accent-grad); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: flow 6s linear infinite; }
@keyframes flow { to { background-position: 300% 0; } }
.new-chat { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 14px; border: 1px solid var(--line2); background: rgba(255, 255, 255, .04); font-weight: 600; transition: .25s var(--ease); position: relative; overflow: hidden; }
.new-chat::before { content: ""; position: absolute; inset: 0; background: var(--accent-grad); opacity: 0; transition: opacity .3s; }
.new-chat:hover::before { opacity: .18; }
.new-chat:hover { transform: translateY(-1px); border-color: var(--accent); }
.new-chat .plus { font-size: 18px; line-height: 1; position: relative; }
.chats { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -6px; padding: 0 6px; }
.chats .label { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 12px 8px 4px; font-weight: 600; opacity: .8; }
.chat-item { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 11px; border: 0; background: none; color: var(--muted); text-align: left; font-size: 14px; width: 100%; transition: .2s; }
.chat-item .m { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.chat-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item:hover, .chat-item.active { background: rgba(255, 255, 255, .06); color: var(--text); }
.chat-item .del { opacity: 0; border: 0; background: none; color: var(--muted); padding: 0 4px; transition: .2s; }
.chat-item:hover .del { opacity: .7; }
.chat-item .del:hover { color: #fb7185; opacity: 1; }

.wallet { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.ring { position: relative; width: 48px; height: 48px; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.2; }
.ring .bg { stroke: rgba(255, 255, 255, .08); }
.ring .fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 97.4; stroke-dashoffset: 97.4; transition: stroke-dashoffset 1s var(--ease), stroke .6s; filter: drop-shadow(0 0 6px var(--accent)); }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.wallet-txt { flex: 1; display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.wallet-txt small { color: var(--muted); font-size: 11.5px; }
.wallet-txt b { font: 700 20px var(--display); }
.redeem { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(255, 255, 255, .05); font-size: 18px; transition: .2s; }
.redeem:hover { transform: rotate(-8deg) scale(1.08); border-color: var(--gold); }
.side-foot { font-size: 12.5px; color: var(--muted); }
.status { display: flex; align-items: center; gap: 8px; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; }
.status.ok i { background: #22c55e; box-shadow: 0 0 10px #22c55e; animation: pulse 2s infinite; }
.status.bad i { background: #ef4444; }
@keyframes pulse { 50% { box-shadow: 0 0 2px #22c55e; } }

.icon { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(255, 255, 255, .05); display: grid; place-items: center; }
.only-m { display: none; }
.backdrop { display: none; }

/* ---------- Kopfzeile ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; }
.model-pick { position: relative; margin: 0 auto; }
.model-btn { display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-radius: 99px; border: 1px solid var(--line2); background: rgba(20, 16, 36, .6); backdrop-filter: blur(14px); font: 600 15px var(--display); transition: .25s var(--ease); }
.model-btn:hover { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 255, 255, .03), 0 8px 30px rgba(0, 0, 0, .4); }
.model-btn .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent-grad); background-size: 300% 100%; animation: flow 4s linear infinite; box-shadow: 0 0 12px var(--accent); }
.model-btn .chev { color: var(--muted); font-size: 12px; transition: transform .25s; }
.model-btn.open .chev { transform: rotate(180deg); }
.model-menu { position: absolute; top: calc(100% + 10px); left: 50%; width: min(420px, 92vw); transform: translateX(-50%); border-radius: 22px; padding: 8px; z-index: 30; box-shadow: var(--shadow); transform-origin: top center; animation: menuIn .28s var(--ease); background: rgba(16, 13, 30, .85); }
@keyframes menuIn { from { opacity: 0; transform: translateX(-50%) translateY(-8px) scale(.96); } }
.mcard { display: flex; gap: 14px; align-items: flex-start; width: 100%; text-align: left; padding: 14px; border-radius: 16px; border: 1px solid transparent; background: none; transition: .2s var(--ease); animation: cardIn .4s var(--ease) backwards; position: relative; }
.mcard:nth-child(2) { animation-delay: .05s; } .mcard:nth-child(3) { animation-delay: .1s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } }
.mcard:hover { background: rgba(255, 255, 255, .05); }
.mcard.on { background: rgba(255, 255, 255, .07); border-color: var(--line2); }
.mcard.off { opacity: .45; pointer-events: none; }
.mcard .mico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 21px; flex-shrink: 0; background-size: 300% 100% !important; animation: flow 5s linear infinite; }
.mcard .mt { flex: 1; min-width: 0; }
.mcard .mt b { font: 600 16px var(--display); display: flex; align-items: center; gap: 8px; }
.mcard .mt p { margin: 2px 0 8px; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.mcard .meta { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: rgba(255, 255, 255, .07); color: var(--muted); }
.tag.cost { color: #fde68a; background: rgba(245, 158, 11, .12); }
.mcard .check { color: var(--accent); font-weight: 800; opacity: 0; }
.mcard.on .check { opacity: 1; }
.bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; margin-left: 2px; }
.bars i { width: 3px; border-radius: 2px; background: rgba(255, 255, 255, .2); }
.bars i.f { background: #fff; }
.pill { display: flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line2); background: rgba(20, 16, 36, .6); backdrop-filter: blur(14px); font-weight: 700; font-variant-numeric: tabular-nums; }
.coin { color: var(--gold); text-shadow: 0 0 10px rgba(245, 158, 11, .8); animation: spin 6s linear infinite; display: inline-block; }
@keyframes spin { 50% { transform: rotateY(180deg); } }
.credits-pill.bump { animation: bump .5s var(--ease); }
@keyframes bump { 40% { transform: scale(1.12); } }

/* ---------- Willkommen ---------- */
.scroll { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.welcome { max-width: 820px; margin: 0 auto; padding: 7vh 20px 30px; text-align: center; animation: fadeUp .8s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); filter: blur(6px); } }
.orb-hero { position: relative; width: 104px; height: 104px; margin: 0 auto 26px; display: grid; place-items: center; }
.orb-hero img { width: 66px; height: 66px; border-radius: 20px; position: relative; z-index: 1; box-shadow: 0 16px 50px rgba(139, 92, 246, .6); animation: float 5s ease-in-out infinite; }
.orb { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, #22d3ee, #8b5cf6, #ec4899, #f59e0b, #22d3ee); filter: blur(18px); opacity: .7; animation: rot 8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
@keyframes float { 50% { transform: translateY(-7px); } }
.welcome h1 { font: 700 clamp(30px, 5vw, 48px)/1.1 var(--display); letter-spacing: -.03em; margin: 0 0 12px; }
.grad-text { background: linear-gradient(90deg, #fff, #c4b5fd, #67e8f9, #f9a8d4, #fff); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: flow 10s linear infinite; }
.sub { color: var(--muted); margin: 0 auto 34px; max-width: 520px; }
.ideas { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; text-align: left; }
.idea { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border-radius: 18px; border: 1px solid var(--line); background: rgba(20, 16, 36, .5); backdrop-filter: blur(14px); transition: .3s var(--ease); overflow: hidden; animation: fadeUp .7s var(--ease) backwards; }
.idea:nth-child(2) { animation-delay: .08s; } .idea:nth-child(3) { animation-delay: .16s; } .idea:nth-child(4) { animation-delay: .24s; }
.idea::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: var(--accent-grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .3s; }
.idea:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.idea:hover::after { opacity: 1; }
.idea .ico { font-size: 22px; margin-bottom: 4px; }
.idea b { font-weight: 650; }
.idea span:last-child { color: var(--muted); font-size: 13.5px; }

/* ---------- Nachrichten ---------- */
.msgs { max-width: 820px; margin: 0 auto; padding: 8px 20px 40px; display: flex; flex-direction: column; gap: 26px; }
.msg { display: flex; gap: 14px; animation: msgIn .45s var(--ease) backwards; }
@keyframes msgIn { from { opacity: 0; transform: translateY(12px); filter: blur(4px); } }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { max-width: 78%; padding: 11px 17px; border-radius: 20px 20px 6px 20px; background: rgba(255, 255, 255, .08); border: 1px solid var(--line2); white-space: pre-wrap; word-break: break-word; backdrop-filter: blur(10px); }
.av { position: relative; width: 34px; height: 34px; flex-shrink: 0; margin-top: 2px; }
.av img { width: 34px; height: 34px; border-radius: 11px; position: relative; z-index: 1; }
.av::before { content: ""; position: absolute; inset: -4px; border-radius: 14px; background: conic-gradient(from 0deg, transparent, var(--accent), transparent 60%); opacity: 0; transition: opacity .3s; animation: rot 1.4s linear infinite; }
.msg.live .av::before { opacity: 1; }
.content { flex: 1; min-width: 0; }
.mhead { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 12.5px; color: var(--muted); }
.mhead b { color: var(--text); font: 600 13.5px var(--display); }
.badge { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; padding: 2px 8px; border-radius: 99px; color: #fff; background-size: 300% 100% !important; }
.b-normal { background: var(--c-normal); } .b-comfort { background: var(--c-comfort); } .b-ultra { background: var(--c-ultra); animation: flow 4s linear infinite; }
.body { word-break: break-word; }
.body > :first-child { margin-top: 0; } .body > :last-child { margin-bottom: 0; }
.body p { margin: 0 0 12px; }
.body h1, .body h2, .body h3 { font-family: var(--display); margin: 20px 0 8px; line-height: 1.25; letter-spacing: -.01em; }
.body h1 { font-size: 22px; } .body h2 { font-size: 19px; } .body h3 { font-size: 17px; }
.body ul, .body ol { margin: 0 0 12px; padding-left: 24px; }
.body li { margin: 4px 0; }
.body li::marker { color: var(--accent); }
.body a { color: var(--cyan); }
.body strong { color: #fff; }
.body blockquote { margin: 0 0 12px; padding: 6px 14px; border-left: 3px solid var(--accent); background: rgba(255, 255, 255, .03); border-radius: 0 10px 10px 0; color: var(--muted); }
.body hr { border: 0; height: 1px; background: var(--line2); margin: 18px 0; }
.body code { background: rgba(255, 255, 255, .08); padding: 1px 6px; border-radius: 6px; font: 13.5px "JetBrains Mono", ui-monospace, Consolas, monospace; }
.body table { border-collapse: collapse; margin: 0 0 12px; display: block; overflow-x: auto; font-size: 14px; }
.body th, .body td { border: 1px solid var(--line2); padding: 7px 11px; text-align: left; }
.body th { background: rgba(255, 255, 255, .05); }
.codebox { margin: 0 0 14px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line2); background: rgba(5, 4, 12, .85); }
.codebox .bar { display: flex; justify-content: space-between; align-items: center; padding: 7px 12px; font-size: 12px; color: #a59fc2; background: rgba(255, 255, 255, .04); }
.codebox .bar .acts { display: flex; gap: 4px; }
.codebox .bar button { border: 0; background: none; color: #c4bfdc; font-size: 12px; padding: 3px 8px; border-radius: 7px; }
.codebox .bar button:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.codebox .bar .run { color: #34d399; font-weight: 700; }
.codebox pre { margin: 0; padding: 14px; overflow-x: auto; }
.codebox code { background: none; padding: 0; color: #e8e4f8; font-size: 13.5px; line-height: 1.6; }
.think { margin: 0 0 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .03); font-size: 13.5px; color: var(--muted); overflow: hidden; }
.think summary { cursor: pointer; padding: 9px 13px; list-style: none; display: flex; align-items: center; gap: 8px; user-select: none; }
.think summary::-webkit-details-marker { display: none; }
.think div { padding: 0 14px 12px; white-space: pre-wrap; max-height: 280px; overflow-y: auto; }
.shimmer { background: linear-gradient(90deg, var(--muted) 30%, #fff 50%, var(--muted) 70%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shim 1.6s linear infinite; }
@keyframes shim { from { background-position: 125% 0; } to { background-position: -125% 0; } }
.dots { display: inline-flex; gap: 5px; padding: 8px 0; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }
.cursor > :last-child::after, .cursor:not(:has(*))::after { content: ""; display: inline-block; width: 8px; height: 17px; margin-left: 3px; vertical-align: -3px; border-radius: 2px; background: var(--accent); animation: caret 1s steps(2) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.foot { display: flex; align-items: center; gap: 4px; margin-top: 8px; flex-wrap: wrap; opacity: 0; transition: opacity .25s; }
.msg.bot:hover .foot, .msg.bot:last-child .foot { opacity: 1; }
.foot button { border: 0; background: none; color: var(--muted); padding: 4px 9px; border-radius: 8px; font-size: 13px; }
.foot button:hover { background: rgba(255, 255, 255, .07); color: var(--text); }
.foot .info { font-size: 12px; color: var(--muted); margin-left: 6px; }
.foot .info b { color: #fde68a; font-weight: 600; }
.err-msg { color: #fda4af; }
.err-msg button { margin-top: 8px; }

/* ---------- Eingabe ---------- */
.composer { padding: 0 20px 16px; }
.box { max-width: 820px; margin: 0 auto; border-radius: 24px; padding: 14px 14px 12px 18px; box-shadow: var(--shadow); transition: border-color .3s, box-shadow .3s; position: relative; }
.box:focus-within { border-color: rgba(255, 255, 255, .22); box-shadow: var(--shadow), 0 0 0 4px rgba(255, 255, 255, .03), 0 0 40px -10px var(--accent); }
textarea { width: 100%; border: 0; outline: 0; resize: none; background: none; color: var(--text); font: inherit; max-height: 240px; line-height: 1.55; }
textarea::placeholder { color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.efforts { flex: 1; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.efforts::-webkit-scrollbar { display: none; }
.eff { position: relative; flex-shrink: 0; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); color: var(--muted); border-radius: 99px; padding: 5px 11px; font-size: 12.5px; font-weight: 600; transition: .25s var(--ease); display: flex; align-items: center; gap: 5px; }
.eff .lv { display: inline-flex; gap: 1.5px; align-items: flex-end; height: 10px; }
.eff .lv i { width: 2.5px; border-radius: 1px; background: currentColor; opacity: .35; }
.eff .lv i.f { opacity: 1; }
.eff:hover { color: var(--text); border-color: var(--line2); }
.eff.on { color: #fff; border-color: transparent; background: var(--accent-grad); background-size: 300% 100%; animation: flow 6s linear infinite; box-shadow: 0 4px 20px -4px var(--accent); }
.eff.locked { opacity: .45; }
.eff.locked::after { content: "🔒"; font-size: 10px; }
.eff[data-e="ultra"].on, .eff[data-e="ultracode"].on { background: var(--c-ultra); background-size: 300% 100%; animation: flow 3s linear infinite; }
.send { width: 42px; height: 42px; flex-shrink: 0; border-radius: 14px; border: 0; color: #fff; background: var(--accent-grad); background-size: 300% 100%; display: grid; place-items: center; transition: .25s var(--ease); box-shadow: 0 8px 24px -6px var(--accent); }
.send svg { width: 20px; height: 20px; }
.send:not(:disabled):hover { transform: translateY(-2px) scale(1.05); animation: flow 3s linear infinite; }
.send:disabled { opacity: .3; cursor: default; box-shadow: none; }
.send.stop { background: rgba(255, 255, 255, .1); box-shadow: none; font-size: 13px; }
.note { text-align: center; font-size: 12px; color: var(--muted); margin: 9px 0 0; transition: color .3s; }
.note.warn { color: #fcd34d; }

/* ---------- Dialoge ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(3, 2, 8, .6); backdrop-filter: blur(8px); animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.modal-box { position: relative; width: 100%; max-width: 420px; border-radius: 26px; padding: 30px; text-align: center; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); animation: pop .35s var(--ease); background: rgba(18, 14, 34, .9); }
@keyframes pop { from { opacity: 0; transform: scale(.92) translateY(10px); } }
.modal-box h2 { margin: 0; font: 700 24px var(--display); }
.modal-box p { margin: 0; font-size: 14px; }
.x { position: absolute; top: 14px; right: 14px; border: 0; background: none; color: var(--muted); font-size: 18px; }
.x.static { position: static; }
.gift { font-size: 46px; animation: float 3s ease-in-out infinite; }
.modal-box input { border: 1px solid var(--line2); background: rgba(255, 255, 255, .05); color: var(--text); border-radius: 14px; padding: 14px; font: 600 17px "JetBrains Mono", ui-monospace, Consolas, monospace; text-align: center; letter-spacing: .08em; outline: 0; text-transform: uppercase; }
.modal-box input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(245, 158, 11, .12); }
.err { color: #fda4af; font-size: 13.5px; min-height: 18px; }
.btn-grad { border: 0; border-radius: 14px; padding: 13px; font-weight: 700; color: #fff; background: var(--c-ultra); background-size: 300% 100%; animation: flow 5s linear infinite; transition: transform .2s; }
.btn-grad:hover { transform: translateY(-2px); }
.preview { max-width: 1040px; height: min(86vh, 780px); padding: 0; overflow: hidden; text-align: left; gap: 0; }
.preview-bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.preview iframe { flex: 1; border: 0; background: #fff; width: 100%; }
#confetti { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.toast { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); z-index: 80; padding: 10px 18px; border-radius: 99px; background: rgba(20, 16, 36, .92); border: 1px solid var(--line2); box-shadow: var(--shadow); font-size: 14px; animation: toastIn .35s var(--ease); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }

@media (max-width: 860px) {
  .only-m { display: grid; }
  .side { position: fixed; inset: 0 auto 0 0; z-index: 40; transform: translateX(-105%); transition: transform .3s var(--ease); width: 86%; max-width: 310px; background: rgba(12, 10, 24, .92); }
  .side.open { transform: none; }
  .backdrop.show { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, .5); }
  .top { padding: 10px 12px; }
  .model-pick { margin: 0; }
  .model-btn { padding: 8px 12px; font-size: 14px; }
  .credits-pill { padding: 7px 10px; font-size: 13px; }
  .ideas { grid-template-columns: 1fr; }
  .welcome { padding-top: 3vh; }
  .msgs { padding: 6px 14px 30px; }
  .av { display: none; }
  .msg.user .bubble { max-width: 88%; }
  .composer { padding: 0 10px calc(10px + env(safe-area-inset-bottom)); }
  .box { padding: 12px 10px 10px 14px; border-radius: 20px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ================= Version 2 ================= */
kbd { font: 600 10.5px ui-monospace, Consolas, monospace; padding: 2px 6px; border-radius: 6px; background: rgba(255,255,255,.07); border: 1px solid var(--line); color: var(--muted); margin-left: auto; position: relative; }
.new-chat { justify-content: flex-start; }

/* Intro */
.intro { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: var(--bg); animation: introOut .7s var(--ease) 1.1s forwards; }
.intro-logo { position: relative; width: 120px; height: 120px; display: grid; place-items: center; animation: introPop .9s var(--ease); }
.intro-logo img { width: 76px; height: 76px; border-radius: 22px; position: relative; z-index: 1; }
.intro-txt { font: 700 30px var(--display); letter-spacing: -.02em; opacity: 0; animation: fadeUp .6s var(--ease) .35s forwards; }
.intro-txt b { background: var(--c-ultra); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: flow 3s linear infinite; }
@keyframes introPop { from { transform: scale(.4) rotate(-20deg); opacity: 0; filter: blur(10px); } }
@keyframes introOut { to { opacity: 0; visibility: hidden; transform: scale(1.04); } }
.intro.skip { display: none; }

/* Farb-Blitz beim Modellwechsel */
.flash { position: fixed; inset: 0; z-index: 90; pointer-events: none; background: radial-gradient(circle at 50% 0%, var(--accent), transparent 60%); opacity: 0; }
.flash.go { animation: flashGo .9s var(--ease); }
@keyframes flashGo { 15% { opacity: .35; } 100% { opacity: 0; } }

/* Hintergrund lebt, waehrend die KI schreibt */
body.generating .aurora { opacity: .8; }
body.generating .aurora i { animation-duration: 9s; }

/* Suche */
.search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--line); transition: border-color .2s; }
.search:focus-within { border-color: var(--accent); }
.search span { color: var(--muted); font-size: 16px; }
.search input { flex: 1; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 14px; padding: 9px 0; min-width: 0; }

/* Nutzungsbalken (wie bei Claude) */
.usage { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 16px; background: rgba(255,255,255,.04); border: 1px solid var(--line); text-align: left; transition: .25s var(--ease); }
.usage:hover { border-color: var(--line2); transform: translateY(-1px); }
.u-top, .u-sub, .u-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.u-top span { font-size: 13px; color: var(--muted); }
.u-top b { font: 700 15px var(--display); font-variant-numeric: tabular-nums; }
.u-sub { font-size: 11.5px; color: var(--muted); }
.u-bar { position: relative; height: 8px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.u-bar.big { height: 12px; margin: 10px 0 8px; }
.u-bar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, #22d3ee, #8b5cf6); transition: width 1s var(--ease), background .5s; overflow: hidden; }
.u-bar i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); transform: translateX(-100%); animation: sweep 2.4s ease-in-out infinite; }
@keyframes sweep { 60%, 100% { transform: translateX(100%); } }
.u-bar i.mid { background: linear-gradient(90deg, #8b5cf6, #f59e0b); }
.u-bar i.high { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.top-r { display: flex; align-items: center; gap: 8px; }
.ghost-ico { color: var(--muted); font-size: 17px; transition: .2s; }
.ghost-ico:hover { color: var(--text); border-color: var(--accent); }
.credits-pill { cursor: pointer; transition: .2s var(--ease); }
.credits-pill:hover { border-color: var(--gold); }
.credits-pill .mini { width: 34px; height: 5px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.credits-pill .mini i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #22d3ee, #8b5cf6); border-radius: inherit; transition: width 1s var(--ease); }
.credits-pill .mini i.mid { background: linear-gradient(90deg, #8b5cf6, #f59e0b); }
.credits-pill .mini i.high { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.limit { max-width: 820px; margin: 0 auto 8px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 14px; border-radius: 14px; font-size: 13px; background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.35); color: #fde68a; animation: fadeUp .4s var(--ease); }
.limit.full { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.4); color: #fecaca; }
.limit button { border: 0; background: rgba(255,255,255,.08); border-radius: 9px; padding: 4px 10px; font-size: 12.5px; }
.cost-hint { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* Nutzungs-Dialog */
.usage-box { max-width: 480px; text-align: left; gap: 0; padding: 26px; }
.usage-box h2 { margin-bottom: 14px; }
.u-sec { padding: 16px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.u-row b { font-size: 15px; }
.u-row span { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.left-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 6px; }
.left-grid div { padding: 12px 8px; border-radius: 14px; text-align: center; background: rgba(255,255,255,.04); border: 1px solid var(--line); animation: fadeUp .5s var(--ease) backwards; }
.left-grid div:nth-child(2) { animation-delay: .07s; } .left-grid div:nth-child(3) { animation-delay: .14s; }
.left-grid .n { display: block; font: 700 24px var(--display); font-variant-numeric: tabular-nums; }
.left-grid small { color: var(--muted); font-size: 12px; }
.redeem-row .r2 { display: flex; gap: 8px; margin-top: 8px; }
.redeem-row input { flex: 1; min-width: 0; padding: 11px; font-size: 14.5px; }
.redeem-row .btn-grad { padding: 11px 16px; }

/* Einfuehrung */
.tour-box { max-width: 440px; overflow: hidden; }
.tour-steps { display: flex; transition: transform .5s var(--ease); }
.step { flex: 0 0 100%; padding: 4px 6px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.t-ico { font-size: 44px; animation: float 3s ease-in-out infinite; letter-spacing: 4px; }
.tour-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.tour-dots { display: flex; gap: 6px; }
.tour-dots i { width: 8px; height: 8px; border-radius: 99px; background: rgba(255,255,255,.15); transition: .3s var(--ease); }
.tour-dots i.on { width: 24px; background: var(--accent); }
.tour-nav .btn-grad { padding: 11px 22px; }

/* Nachrichten-Extras */
.msg.user { position: relative; align-items: center; gap: 6px; }
.msg.user .edit { opacity: 0; border: 0; background: none; color: var(--muted); padding: 6px; transition: .2s; }
.msg.user:hover .edit { opacity: 1; }
.msg.user .edit:hover { color: var(--text); }
.foot .fb.on { color: var(--accent); }
.main { position: relative; }
.to-bottom { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); z-index: 5; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line2); background: rgba(20,16,36,.85); backdrop-filter: blur(10px); font-size: 18px; box-shadow: var(--shadow); animation: bounceIn .4s var(--ease); }
.to-bottom:hover { border-color: var(--accent); }
@keyframes bounceIn { from { opacity: 0; transform: translate(-50%, 10px); } }
.pv-btn { border: 0; background: rgba(255,255,255,.07); color: var(--text); border-radius: 9px; padding: 5px 10px; font-size: 13px; margin-right: 8px; }

/* Code-Farben */
.tk-k { color: #c4b5fd; } .tk-s { color: #86efac; } .tk-c { color: #7c7a8f; font-style: italic; } .tk-n { color: #fdba74; } .tk-t { color: #67e8f9; }

/* Tipp-Animation der Ueberschrift */
.type-caret { display: inline-block; width: 3px; height: .9em; margin-left: 4px; vertical-align: -0.08em; background: var(--accent); border-radius: 2px; animation: caret 1s steps(2) infinite; }
.idea { will-change: transform; }
.legal { font-size: 11.5px; }
.legal a { color: var(--muted); text-decoration: none; }
.legal a:hover { color: var(--text); }
.side-foot { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 860px) { kbd, .cost-hint { display: none; } .to-bottom { bottom: 130px; } .left-grid .n { font-size: 20px; } }
.tour-box { padding: 30px 0 26px; }
.tour-box .step { padding: 4px 30px; }
.tour-box .tour-nav { padding: 0 30px; }

/* ================= Version 3: Steuerung wie bei Claude ================= */
.top { justify-content: space-between; }
.top-title { flex: 1; text-align: center; font: 600 15px var(--display); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 10px; }
.row { gap: 6px; }
.row-hint { flex: 1; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop-wrap { position: relative; }
.ctl { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 11px; border: 1px solid transparent; background: none; color: var(--text); font-weight: 600; font-size: 13.5px; transition: .2s var(--ease); white-space: nowrap; }
.ctl:hover, .ctl.open { background: rgba(255,255,255,.07); border-color: var(--line); }
.ctl .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent-grad); background-size: 300% 100%; animation: flow 4s linear infinite; box-shadow: 0 0 10px var(--accent); }
.ctl .chev { color: var(--muted); font-size: 11px; transition: transform .25s; }
.ctl.open .chev { transform: rotate(180deg); }
.eff-btn { position: relative; }
.eff-btn.hot { color: #fff; background: rgba(139,92,246,.18); border-color: rgba(167,139,250,.35); }
.eff-btn.hot::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: var(--c-ultra); background-size: 300% 100%; animation: flow 3s linear infinite; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }

/* Popover oberhalb des Eingabefelds */
.model-menu { top: auto; bottom: calc(100% + 12px); left: auto; right: -60px; transform: none; animation: popUp .28s var(--ease); width: min(420px, 92vw); }
@keyframes popUp { from { opacity: 0; transform: translateY(8px) scale(.97); } }
.effort-pop { position: absolute; bottom: calc(100% + 12px); right: -50px; width: 340px; border-radius: 20px; padding: 16px 18px 12px; z-index: 30; background: rgba(16,13,30,.92); box-shadow: var(--shadow); animation: popUp .28s var(--ease); transform-origin: bottom right; }
.ep-head { display: flex; justify-content: space-between; align-items: baseline; }
.ep-head b { font: 700 16px var(--display); }
.ep-head span { font-size: 12.5px; color: #fde68a; }
.ep-desc { margin: 4px 0 14px; font-size: 13px; color: var(--muted); min-height: 38px; line-height: 1.45; }

/* Der Schieberegler */
.slider { position: relative; height: 30px; cursor: pointer; touch-action: none; outline: 0; }
.slider .track { position: absolute; left: 0; right: 0; top: 4px; height: 22px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; border: 1px solid var(--line); }
.slider .fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 99px; background: linear-gradient(90deg, rgba(255,255,255,.12), rgba(167,139,250,.55)); transition: width .35s var(--ease), background .4s; overflow: hidden; }
.slider.dragging .fill { transition: none; }
.slider .fill.hot { background: linear-gradient(90deg, rgba(255,255,255,.1), #8b5cf6 55%, #c084fc); }
.slider .fill canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .4s; }
.slider .fill.hot canvas { opacity: 1; }
.slider .stops { position: absolute; inset: 0 11px; }
.slider .stops i { position: absolute; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: rgba(255,255,255,.35); }
.slider .stops i.rec { width: 2px; height: 10px; margin: -5px 0 0 -1px; border-radius: 1px; background: rgba(255,255,255,.55); }
.slider .stops i.lock { background: rgba(255,255,255,.12); }
.slider .knob { position: absolute; top: 4px; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.5), 0 0 0 4px rgba(255,255,255,.08); transition: left .35s var(--ease), transform .15s; }
.slider.dragging .knob { transition: transform .15s; transform: scale(1.12); }
.slider:focus-visible .knob { box-shadow: 0 0 0 4px var(--accent); }
.ep-marks { position: relative; height: 34px; margin: 4px 11px 0; font-size: 11.5px; color: var(--muted); }
.ep-marks span { position: absolute; transform: translateX(-50%); white-space: nowrap; transition: color .2s; }
.ep-marks span.lbl { top: 0; font-size: 10.5px; opacity: .65; }
.ep-marks span.lbl.on { opacity: 1; color: var(--text); font-weight: 600; }
.ep-marks span.rec { top: 16px; color: #c4b5fd; }

/* App-Download */
.get-app { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 14px; text-decoration: none; color: var(--text); border: 1px solid var(--line); background: linear-gradient(135deg, rgba(34,211,238,.08), rgba(139,92,246,.12)); transition: .25s var(--ease); }
.get-app:hover { border-color: var(--accent); transform: translateY(-1px); }
.get-app .ga-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-grad); background-size: 300% 100%; animation: flow 5s linear infinite; font-size: 15px; color: #fff; }
.get-app b { display: block; font-size: 13.5px; }
.get-app small { color: var(--muted); font-size: 11.5px; }
body.in-app .get-app { display: none; }

@media (max-width: 860px) {
  .row-hint { display: none; }
  .row { justify-content: flex-end; }
  .effort-pop { position: fixed; left: 10px; right: 10px; bottom: 120px; width: auto; }
  .model-menu { position: fixed; left: 10px; right: 10px; bottom: 120px; width: auto; }
  .ctl { padding: 0 9px; font-size: 13px; }
}
