:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, "Segoe UI", system-ui, -apple-system, sans-serif;
  --bg: #060913;
  --panel: rgba(14, 22, 39, .82);
  --panel-strong: #111a2c;
  --line: rgba(148, 163, 184, .16);
  --ink: #f8fafc;
  --muted: #93a4bd;
  --yellow: #ffd43b;
  --orange: #ff9f1c;
  --blue: #5b8cff;
  --cyan: #2de2e6;
  --green: #34d399;
  --danger: #fb7185;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 10%, rgba(43, 108, 255, .17), transparent 28rem),
    radial-gradient(circle at 82% 26%, rgba(250, 204, 21, .10), transparent 26rem),
    radial-gradient(circle at 50% 110%, rgba(34, 211, 238, .08), transparent 30rem),
    linear-gradient(160deg, #080d18 0%, #050812 64%, #070b15 100%);
}

button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { width: min(1080px, calc(100% - 30px)); margin: 0 auto; padding: 22px 0 30px; }
.topbar { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; gap: 11px; align-items: center; color: var(--ink); text-decoration: none; }
.brand > span:last-child { display: grid; line-height: 1.05; }
.brand strong { font-size: 1.06rem; }
.brand small { margin-top: 4px; color: var(--muted); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.brand-mark {
  position: relative; width: 42px; height: 42px; overflow: hidden; border: 2px solid rgba(255,255,255,.8);
  border-radius: 15px; background: repeating-linear-gradient(90deg, var(--yellow) 0 9px, #172033 9px 15px);
  box-shadow: 0 10px 28px rgba(250, 204, 21, .12); transform: rotate(-5deg);
}
.brand-mark i { position: absolute; top: 12px; width: 6px; height: 6px; border-radius: 50%; background: #07111f; }
.brand-mark i:first-child { left: 10px; }
.brand-mark i:last-child { right: 10px; }
.language { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: rgba(15,23,42,.66); }
.language-button { min-width: 46px; height: 36px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-weight: 850; }
.language-button.active { color: #111827; background: var(--yellow); }

.voice-stage {
  min-height: 510px;
  display: grid;
  grid-template-columns: minmax(300px, .86fr) minmax(390px, 1.14fr);
  align-items: center;
  gap: clamp(28px, 6vw, 82px);
  padding: 45px clamp(10px, 3vw, 32px) 42px;
}
.robot-zone { position: relative; display: grid; justify-items: center; min-height: 390px; align-content: center; }
.robot-glow {
  position: absolute; width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(45,226,230,.14), rgba(91,140,255,.08) 42%, transparent 72%);
  filter: blur(4px); transition: .35s ease;
}
.voice-stage[data-voice-state="listening"] .robot-glow { background: radial-gradient(circle, rgba(52,211,153,.20), rgba(45,226,230,.07) 46%, transparent 72%); }
.voice-stage[data-voice-state="speaking"] .robot-glow { background: radial-gradient(circle, rgba(45,226,230,.24), rgba(91,140,255,.11) 46%, transparent 72%); transform: scale(1.08); }
.voice-stage[data-voice-state="switching"] .robot-glow { background: radial-gradient(circle, rgba(255,212,59,.22), rgba(255,159,28,.07) 46%, transparent 72%); }
.voice-stage[data-voice-state="error"] .robot-glow { background: radial-gradient(circle, rgba(251,113,133,.18), rgba(91,140,255,.05) 46%, transparent 72%); }
.bee-robot { position: relative; width: 278px; height: 340px; filter: drop-shadow(0 26px 32px rgba(0,0,0,.32)); animation: robot-float 4s ease-in-out infinite; }
.robot-head {
  position: absolute; z-index: 5; top: 45px; left: 39px; width: 200px; height: 166px;
  border: 4px solid #ffe889; border-radius: 46% 46% 42% 42% / 50% 50% 42% 42%;
  background: linear-gradient(145deg, #fff16c 0%, #ffc629 48%, #f59e0b 100%);
  box-shadow: inset 0 8px 12px rgba(255,255,255,.35), inset 0 -12px 18px rgba(145,73,0,.15), 0 16px 34px rgba(245,158,11,.22);
}
.face-screen {
  position: absolute; inset: 22px 21px 25px; overflow: hidden; border: 3px solid rgba(77,49,4,.74);
  border-radius: 42px; background: radial-gradient(circle at 50% 20%, #173857 0%, #0b1a2b 58%, #07101c 100%);
  box-shadow: inset 0 0 28px rgba(34,211,238,.10), 0 3px 0 rgba(255,255,255,.35);
}
.eye { position: absolute; top: 47px; width: 34px; height: 38px; border-radius: 50%; background: #dffcff; box-shadow: 0 0 14px rgba(45,226,230,.78); transition: .22s ease; }
.eye-left { left: 31px; }
.eye-right { right: 31px; }
.eye i { position: absolute; left: 10px; top: 10px; width: 14px; height: 18px; border-radius: 50%; background: #07101c; transition: .22s ease; }
.eye i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 4px; height: 4px; border-radius: 50%; background: white; }
.brow { position: absolute; z-index: 2; top: 35px; width: 28px; height: 5px; border-radius: 99px; background: #69f4f5; opacity: .86; transition: .25s ease; }
.brow-left { left: 34px; transform: rotate(-4deg); }
.brow-right { right: 34px; transform: rotate(4deg); }
.robot-mouth { position: absolute; left: 50%; top: 91px; width: 42px; height: 22px; border-bottom: 5px solid #69f4f5; border-radius: 0 0 42px 42px; transform: translateX(-50%); filter: drop-shadow(0 0 5px rgba(45,226,230,.65)); transition: .22s ease; }
.cheek { position: absolute; top: 88px; width: 17px; height: 7px; border-radius: 50%; background: #ff7697; opacity: .55; filter: blur(.2px); }
.cheek-left { left: 14px; }
.cheek-right { right: 14px; }
.ear { position: absolute; z-index: -1; top: 62px; width: 24px; height: 52px; border: 4px solid #ffe889; background: linear-gradient(#ffcf2c, #f59e0b); }
.ear-left { left: -18px; border-radius: 16px 5px 5px 16px; }
.ear-right { right: -18px; border-radius: 5px 16px 16px 5px; }
.antenna { position: absolute; z-index: 4; top: 12px; width: 5px; height: 55px; border-radius: 99px; background: linear-gradient(#6c7f98, #ffcf2c); transform-origin: bottom; }
.antenna-left { left: 82px; transform: rotate(-22deg); }
.antenna-right { right: 82px; transform: rotate(22deg); }
.antenna i { position: absolute; left: -7px; top: -7px; width: 19px; height: 19px; border: 3px solid #fff09b; border-radius: 50%; background: #ffb411; box-shadow: 0 0 16px rgba(255,196,35,.7); }
.robot-neck { position: absolute; z-index: 3; left: 117px; top: 207px; width: 44px; height: 23px; border: 3px solid #607087; border-radius: 8px; background: #25354c; }
.robot-body {
  position: absolute; z-index: 2; left: 70px; top: 220px; width: 138px; height: 102px; overflow: hidden;
  border: 4px solid #ffe889; border-radius: 44% 44% 50% 50%; background: linear-gradient(145deg, #ffd83d, #f59e0b);
  box-shadow: inset 0 6px 9px rgba(255,255,255,.24), 0 18px 30px rgba(245,158,11,.17);
}
.body-stripe { position: absolute; left: -6%; width: 112%; height: 17px; background: #172235; transform: rotate(-3deg); }
.stripe-one { top: 28px; }
.stripe-two { top: 63px; }
.body-core { position: absolute; z-index: 2; left: 50%; top: 50%; width: 32px; height: 32px; display: grid; place-items: center; border: 3px solid #86fbff; border-radius: 50%; background: #0b1828; transform: translate(-50%, -50%); box-shadow: 0 0 18px rgba(45,226,230,.72); }
.body-core i { width: 10px; height: 10px; border-radius: 50%; background: #c9ffff; box-shadow: 0 0 10px var(--cyan); }
.wing { position: absolute; z-index: 1; top: 202px; width: 82px; height: 100px; border: 3px solid rgba(164,239,255,.72); background: linear-gradient(145deg, rgba(214,249,255,.39), rgba(91,140,255,.09)); box-shadow: inset 0 0 18px rgba(45,226,230,.13); transform-origin: center top; }
.wing-left { left: 20px; border-radius: 76% 24% 70% 30%; transform: rotate(19deg); }
.wing-right { right: 20px; border-radius: 24% 76% 30% 70%; transform: rotate(-19deg); }
.robot-shadow { position: absolute; left: 70px; bottom: 1px; width: 140px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.34); filter: blur(9px); }
.robot-mood { position: relative; z-index: 7; margin-top: 4px; padding: 7px 13px; border: 1px solid rgba(45,226,230,.2); border-radius: 99px; color: #9df8fb; background: rgba(7,16,28,.72); font-size: .72rem; font-weight: 850; letter-spacing: .05em; }

/* Bee expressions */
.bee-robot[data-expression="listening"] .eye { transform: scale(1.08); }
.bee-robot[data-expression="listening"] .eye i { top: 8px; }
.bee-robot[data-expression="listening"] .robot-mouth { width: 19px; height: 22px; border: 4px solid #69f4f5; border-radius: 50%; }
.bee-robot[data-expression="listening"] .wing-left { animation: wing-left .24s ease-in-out infinite alternate; }
.bee-robot[data-expression="listening"] .wing-right { animation: wing-right .24s ease-in-out infinite alternate; }
.bee-robot[data-expression="thinking"] .eye i { animation: look-around 1.5s ease-in-out infinite; }
.bee-robot[data-expression="thinking"] .robot-mouth { width: 13px; height: 8px; border: 0; border-radius: 50%; background: #69f4f5; }
.bee-robot[data-expression="thinking"] .antenna i { animation: antenna-pulse .65s ease-in-out infinite alternate; }
.bee-robot[data-expression="speaking"] .eye { height: 22px; top: 55px; border-radius: 50% 50% 45% 45%; }
.bee-robot[data-expression="speaking"] .robot-mouth { top: 92px; width: 38px; height: 26px; border: 4px solid #69f4f5; border-radius: 8px 8px 50% 50%; animation: mouth-talk .3s ease-in-out infinite alternate; }
.bee-robot[data-expression="speaking"] .body-core { animation: core-pulse .46s ease-in-out infinite alternate; }
.bee-robot[data-expression="muted"] { filter: grayscale(.65) drop-shadow(0 26px 32px rgba(0,0,0,.32)); }
.bee-robot[data-expression="muted"] .eye { top: 60px; height: 5px; border-radius: 99px; box-shadow: none; }
.bee-robot[data-expression="muted"] .eye i { display: none; }
.bee-robot[data-expression="muted"] .robot-mouth { width: 32px; height: 5px; border: 0; border-radius: 99px; background: #8293a8; filter: none; }
.bee-robot[data-expression="error"] .brow-left { transform: rotate(18deg); background: #fb7185; }
.bee-robot[data-expression="error"] .brow-right { transform: rotate(-18deg); background: #fb7185; }
.bee-robot[data-expression="error"] .robot-mouth { top: 104px; width: 38px; height: 20px; border-top: 5px solid #fb7185; border-bottom: 0; border-radius: 36px 36px 0 0; filter: none; }
.bee-robot[data-expression="error"] .body-core { border-color: #fb7185; box-shadow: 0 0 18px rgba(251,113,133,.72); }
.bee-robot[data-expression="error"] .body-core i { background: #ffd1d9; box-shadow: 0 0 10px #fb7185; }
.bee-robot[data-expression="switching"] .eye { animation: robot-blink .55s ease-in-out infinite alternate; }
.bee-robot[data-expression="switching"] .antenna { animation: antenna-search .8s ease-in-out infinite alternate; }

.voice-console { max-width: 600px; }
.kicker { margin: 0 0 11px; color: var(--cyan); font-size: .75rem; font-weight: 900; letter-spacing: .16em; }
h1 { margin: 0; font-size: clamp(2.45rem, 5.8vw, 4.55rem); line-height: .98; letter-spacing: -.057em; }
.hero-copy { max-width: 560px; margin: 18px 0 0; color: #b0bfd2; line-height: 1.58; }
.status { min-height: 25px; margin: 18px 0 17px; color: var(--muted); font-weight: 700; }
.status::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 9px; border-radius: 50%; background: #64748b; }
.status.online::before { background: var(--green); box-shadow: 0 0 0 5px rgba(52,211,153,.09); }
.status.error::before { background: var(--danger); box-shadow: 0 0 0 5px rgba(251,113,133,.08); }

.voice-orb { max-width: 560px; margin: 0 0 18px; padding: 14px 17px 12px; border: 1px solid var(--line); border-radius: 19px; background: rgba(8,15,28,.68); box-shadow: inset 0 0 30px rgba(91,140,255,.04); transition: .25s ease; }
.wave-bars { height: 56px; display: flex; align-items: center; justify-content: center; gap: clamp(4px, .8vw, 8px); }
.wave-bars span { width: 5px; height: 5px; border-radius: 999px; background: #64748b; box-shadow: 0 0 0 transparent; transition: height .09s linear, background .2s, box-shadow .2s; }
.voice-orb.listening { border-color: rgba(52,211,153,.28); background: rgba(8,29,28,.54); }
.voice-orb.listening .wave-bars span { background: linear-gradient(#86efac, #2dd4bf); box-shadow: 0 0 10px rgba(52,211,153,.32); }
.voice-orb.speaking { border-color: rgba(45,226,230,.28); background: rgba(7,27,40,.58); }
.voice-orb.speaking .wave-bars span { background: linear-gradient(#cffafe, #22d3ee); animation: output-wave .58s ease-in-out infinite alternate; }
.voice-orb.speaking .wave-bars span:nth-child(3n) { animation-delay: -.3s; }
.voice-orb.speaking .wave-bars span:nth-child(2n) { animation-delay: -.15s; }
.level-caption { display: flex; justify-content: space-between; gap: 12px; color: #75869d; font-size: .71rem; font-weight: 800; }

.talk-button {
  min-width: 230px; min-height: 58px; display: inline-flex; align-items: center; justify-content: center; gap: 11px;
  padding: 0 25px; border: 0; border-radius: 18px; color: #121827;
  background: linear-gradient(115deg, var(--yellow), var(--orange)); font-weight: 900;
  box-shadow: 0 18px 42px rgba(245,158,11,.19); transition: .2s ease;
}
.talk-button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 22px 48px rgba(245,158,11,.25); }
.talk-button.active { color: white; background: linear-gradient(115deg, #ef4444, #fb7185); box-shadow: 0 18px 42px rgba(239,68,68,.18); }
.talk-button:disabled { opacity: .45; cursor: wait; }
.mic-icon { position: relative; width: 24px; height: 24px; display: inline-grid; place-items: center; }
.mic-icon svg { width: 24px; height: 24px; overflow: visible; }
.mic-icon path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.talk-button:not(.active) .mic-icon::after { content: ""; position: absolute; width: 28px; height: 2px; border-radius: 99px; background: currentColor; transform: rotate(-45deg); box-shadow: 0 0 0 2px rgba(255,183,28,.55); }
.talk-hint { max-width: 610px; margin: 13px 0 0; color: var(--muted); font-size: .84rem; line-height: 1.5; }

.panel { border: 1px solid var(--line); border-radius: 28px; background: var(--panel); box-shadow: 0 24px 80px rgba(0,0,0,.22); backdrop-filter: blur(18px); overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.section-label { margin: 0 0 4px; color: var(--muted); font-size: .7rem; font-weight: 900; letter-spacing: .14em; }
h2 { margin: 0; font-size: 1rem; }
.search-badge { padding: 7px 10px; border: 1px solid rgba(52,211,153,.24); border-radius: 999px; color: #a7f3d0; background: rgba(16,185,129,.08); font-size: .72rem; font-weight: 750; white-space: nowrap; }
.conversation { min-height: 270px; max-height: 48vh; overflow-y: auto; padding: 24px; scroll-behavior: smooth; }
.message { display: flex; align-items: flex-start; gap: 11px; max-width: 84%; margin-bottom: 19px; }
.message.user-message { flex-direction: row-reverse; margin-left: auto; }
.avatar { width: 31px; height: 31px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; color: #111827; background: var(--yellow); font-size: .75rem; font-weight: 950; }
.user-message .avatar { color: white; background: var(--blue); }
.bubble { padding: 12px 15px; border: 1px solid var(--line); border-radius: 6px 18px 18px 18px; background: var(--panel-strong); line-height: 1.48; }
.user-message .bubble { border-radius: 18px 6px 18px 18px; border-color: transparent; background: #244c9f; }
.bubble p { margin: 4px 0 0; white-space: pre-wrap; }
.label { display: block; color: var(--muted); font-size: .67rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.user-message .label { color: rgba(255,255,255,.68); }
.message.partial .bubble { opacity: .76; }
.message.partial .bubble p::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 7px; border-radius: 50%; background: currentColor; animation: blink .8s infinite; }
.meta { display: block; margin-top: 8px; color: var(--muted); font-size: .7rem; }
.sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.sources a { max-width: 230px; overflow: hidden; padding: 5px 8px; border-radius: 8px; color: #bae6fd; background: rgba(14,165,233,.10); font-size: .7rem; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.composer { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 18px 20px 20px; border-top: 1px solid var(--line); }
.composer input { min-width: 0; min-height: 52px; padding: 0 16px; border: 1px solid var(--line); border-radius: 15px; outline: 0; color: var(--ink); background: rgba(2,6,23,.58); }
.composer input:focus { border-color: rgba(91,140,255,.72); box-shadow: 0 0 0 4px rgba(91,140,255,.08); }
.composer button { min-width: 78px; border: 0; border-radius: 15px; color: #111827; background: var(--yellow); font-weight: 900; }
.composer button:disabled { opacity: .45; cursor: wait; }
footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; padding: 18px 10px 0; color: #64748b; font-size: .74rem; }
footer a { color: #94a3b8; }

@keyframes robot-float { 0%,100% { transform: translateY(0) rotate(-.4deg); } 50% { transform: translateY(-8px) rotate(.4deg); } }
@keyframes wing-left { from { transform: rotate(19deg); } to { transform: rotate(41deg) scaleY(.92); } }
@keyframes wing-right { from { transform: rotate(-19deg); } to { transform: rotate(-41deg) scaleY(.92); } }
@keyframes look-around { 0%,100% { transform: translateX(-5px); } 50% { transform: translateX(5px); } }
@keyframes antenna-pulse { to { transform: scale(1.28); box-shadow: 0 0 25px rgba(255,196,35,.9); } }
@keyframes antenna-search { to { transform: rotate(8deg); } }
@keyframes mouth-talk { from { transform: translateX(-50%) scaleY(.5); } to { transform: translateX(-50%) scaleY(1.12); } }
@keyframes core-pulse { to { transform: translate(-50%, -50%) scale(1.18); } }
@keyframes robot-blink { to { height: 5px; top: 63px; } }
@keyframes output-wave { from { height: 9px; } to { height: 46px; } }
@keyframes blink { 50% { opacity: .18; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
@media (max-width: 820px) {
  .voice-stage { grid-template-columns: 1fr; gap: 8px; padding-top: 30px; text-align: center; }
  .robot-zone { min-height: 330px; }
  .bee-robot { scale: .86; margin: -20px 0; }
  .voice-console { margin: 0 auto; width: min(100%, 600px); }
  .hero-copy { margin-inline: auto; }
  .voice-orb { margin-inline: auto; }
}
@media (max-width: 640px) {
  .app-shell { width: min(100% - 18px, 1080px); padding-top: 12px; }
  .voice-stage { min-height: 0; padding: 25px 6px 33px; }
  .robot-zone { min-height: 282px; }
  .bee-robot { scale: .75; margin: -43px 0; }
  .robot-mood { margin-top: -10px; }
  h1 { font-size: clamp(2.3rem, 13vw, 3.25rem); }
  .hero-copy { font-size: .9rem; }
  .panel-heading { align-items: flex-start; padding: 18px; }
  .search-badge { display: none; }
  .conversation { min-height: 300px; padding: 18px 14px; }
  .message { max-width: 94%; }
  .composer { padding: 13px; }
  .talk-button { width: 100%; }
}
