:root {
  color-scheme: dark;
  --bg: #090914;
  --panel: rgba(21, 21, 38, .68);
  --panel-strong: rgba(29, 29, 51, .86);
  --line: rgba(255,255,255,.10);
  --line-soft: rgba(255,255,255,.07);
  --text: #f7f6ff;
  --muted: #9795ae;
  --muted-strong: #c4c1d6;
  --primary: #9575ff;
  --primary-strong: #b59cff;
  --cyan: #7fe7ee;
  --pink: #ff8bc9;
  font-family: 'DM Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
body::before, body::after { content: ''; position: fixed; z-index: -1; width: 46vw; height: 46vw; border-radius: 50%; filter: blur(100px); opacity: .16; pointer-events: none; }
body::before { top: -16vw; left: 30%; background: #704dff; }
body::after { right: -18vw; bottom: -20vw; background: #0fa6c0; }

.app-shell { display: flex; min-height: 100vh; max-width: 1600px; margin: auto; }
.glass-panel { border: 1px solid var(--line); background: var(--panel); box-shadow: 0 18px 70px rgba(0,0,0,.22), inset 0 1px rgba(255,255,255,.04); backdrop-filter: blur(22px); }
.sidebar { width: 256px; flex: 0 0 256px; min-height: 100vh; border-width: 0 1px 0 0; border-radius: 0; padding: 27px 15px 18px; display: flex; flex-direction: column; background: rgba(13,13,26,.72); }
.brand, .mobile-brand { display: flex; align-items: center; gap: 11px; }
.brand strong, .mobile-brand strong { display: block; font: 700 18px 'Space Grotesk', sans-serif; letter-spacing: -.03em; }
.brand span { display: block; margin-top: 3px; color: #8f87bb; font-size: 11px; letter-spacing: .01em; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; color: #0c0b17; border-radius: 12px; background: linear-gradient(145deg, #cab9ff, #7760ef); box-shadow: 0 8px 25px rgba(136,103,255,.3); }
.brand-mark.large { width: 50px; height: 50px; font-size: 26px; }
.new-chat { width: 100%; display: flex; justify-content: center; align-items: center; gap: 8px; margin: 38px 0 25px; min-height: 44px; border: 1px solid rgba(180,156,255,.35); border-radius: 13px; color: #eeeaff; background: linear-gradient(135deg, rgba(140,103,250,.45), rgba(91,74,170,.3)); transition: .2s ease; }
.new-chat:hover, .primary-button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.nav-list { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 13px; width: 100%; min-height: 45px; padding: 0 13px; border: 1px solid transparent; border-radius: 12px; color: var(--muted); background: transparent; text-align: left; transition: .2s ease; }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.05); }
.nav-item.active { color: #f4efff; border-color: rgba(159,131,255,.2); background: linear-gradient(90deg, rgba(135,105,240,.22), rgba(135,105,240,.07)); }
.nav-item.active svg { color: var(--primary-strong); }
.sidebar-bottom { margin-top: auto; display: grid; gap: 16px; }
.kio-badge { display: flex; align-items: center; gap: 8px; padding: 11px 13px; border-top: 1px solid var(--line-soft); color: #88859d; font-size: 11px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #70e0b2; box-shadow: 0 0 12px #70e0b2; }
.main-area { min-width: 0; flex: 1; }
.topbar { height: 96px; display: flex; align-items: center; justify-content: space-between; padding: 0 5.2%; border-bottom: 1px solid var(--line-soft); }
.mobile-brand { display: none; }
.topbar-title h1 { margin: 4px 0 0; font: 600 23px 'Space Grotesk', sans-serif; letter-spacing: -.04em; }
.eyebrow, .section-kicker { color: var(--primary-strong); text-transform: uppercase; letter-spacing: .15em; font-size: 10px; font-weight: 700; }
.top-actions { display: flex; align-items: center; gap: 15px; }
.model-pill { display: flex; align-items: center; gap: 6px; padding: 8px 11px; border: 1px solid rgba(142,219,218,.16); border-radius: 20px; color: #a8dedb; background: rgba(84,180,181,.08); font-size: 11px; }
.model-pill svg { color: #79dfba; }
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted-strong); background: rgba(255,255,255,.04); }
.icon-button:hover { color: var(--text); background: rgba(255,255,255,.08); }
.content-area { width: min(1040px, 90%); margin: 0 auto; padding: 52px 0 64px; }
.chat-layout { width: min(820px, 100%); margin: auto; }
.chat-intro { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 41px; }
.intro-icon, .hero-icon { display: grid; place-items: center; flex: 0 0 51px; width: 51px; height: 51px; border: 1px solid rgba(177,147,255,.25); border-radius: 16px; color: #c1b0ff; background: linear-gradient(145deg, rgba(140,105,255,.27), rgba(140,105,255,.08)); }
.chat-intro h2, .tool-hero h2 { margin: 5px 0 7px; font: 600 30px 'Space Grotesk', sans-serif; letter-spacing: -.045em; }
.chat-intro p:last-child, .tool-hero > p:last-child { max-width: 550px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.message-list { display: grid; gap: 27px; }
.message { display: flex; align-items: flex-start; gap: 13px; }
.message.user { flex-direction: row-reverse; }
.avatar { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 11px; color: #aaa5bf; background: rgba(255,255,255,.07); font-size: 10px; font-weight: 700; }
.ai-avatar { color: #c1b0ff; border-color: rgba(167,135,255,.35); background: rgba(139,100,244,.18); }
.bubble { max-width: min(680px, 82%); }
.message.user .bubble { text-align: right; }
.message-meta { margin: 1px 0 8px; color: #dad7e8; font-size: 12px; font-weight: 600; }
.message-meta span { margin-left: 8px; color: #6e6b82; font-size: 10px; font-weight: 400; }
.bubble p { margin: 0; color: #aba9bb; font-size: 14px; line-height: 1.7; }
.message.user .bubble p { display: inline-block; padding: 11px 15px; border: 1px solid rgba(150,126,255,.25); border-radius: 16px 5px 16px 16px; color: #efecff; background: rgba(116,87,221,.22); text-align: left; }
.composer { margin-top: 37px; padding: 14px 15px 11px; border-radius: 17px; }
.composer textarea, .tool-card textarea, .tool-card input, .tool-card select, .setting-card select { display: block; width: 100%; border: 0; outline: none; resize: vertical; color: var(--text); background: transparent; font-size: 14px; line-height: 1.6; }
.composer textarea { min-height: 38px; max-height: 150px; resize: none; }
textarea::placeholder, input::placeholder { color: #6f6c80; }
.composer-footer, .form-row, .voice-controls { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.composer-hint { display: flex; align-items: center; gap: 7px; color: #77738b; font-size: 11px; }
.composer-hint svg { color: var(--primary); }
.send-button { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 12px; color: #0b0916; background: linear-gradient(145deg, #bda8ff, #8568f0); }
.send-button:hover { box-shadow: 0 5px 20px rgba(155,117,255,.35); }
.tool-layout, .settings-layout { max-width: 900px; margin: auto; }
.tool-hero { margin-bottom: 34px; }
.tool-hero .hero-icon { margin-bottom: 23px; }
.hero-icon.purple { color: #cbbcff; background: rgba(140,105,255,.18); }
.hero-icon.pink { color: #ffabd7; border-color: rgba(255,139,201,.25); background: rgba(255,107,180,.13); }
.hero-icon.blue { color: #9deaf0; border-color: rgba(127,231,238,.25); background: rgba(64,181,196,.13); }
.hero-icon.neutral { color: #d7d3e5; background: rgba(255,255,255,.07); }
.tool-card { padding: 25px; border-radius: 21px; }
.tool-card > label, .video-fields label, .voice-controls label { display: block; margin-bottom: 10px; color: #dfdced; font-size: 12px; font-weight: 600; }
.tool-card textarea { min-height: 115px; padding: 13px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.form-row { margin-top: 17px; justify-content: flex-end; }
.select-label { margin-right: auto; color: var(--muted); font-size: 12px; }
select { min-height: 42px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted-strong); background: #181729; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 11px; font-size: 12px; font-weight: 700; transition: .2s ease; }
.primary-button { border: 1px solid rgba(190,169,255,.35); color: #0d0b19; background: linear-gradient(135deg, #c2afff, #8f6fff); box-shadow: 0 7px 22px rgba(114,78,233,.2); }
.secondary-button { border: 1px solid var(--line); color: #d3d0e1; background: rgba(255,255,255,.06); }
.secondary-button:hover { background: rgba(255,255,255,.1); }
.results-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 26px; min-height: 190px; }
.results-grid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); }
.empty-state { border: 1px dashed rgba(255,255,255,.12); border-radius: 15px; }
.empty-state > div { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; min-height: 190px; padding: 25px; color: #716d84; text-align: center; }
.empty-state strong { color: #bdb8ca; font-size: 13px; }
.empty-state span { max-width: 260px; font-size: 11px; line-height: 1.5; }
.result-tile { position: relative; }
.result-download { position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.25); border-radius: 10px; color: white; background: rgba(10,8,22,.7); }
.upload-zone { display: flex; align-items: center; flex-direction: column; gap: 8px; padding: 26px 15px; border: 1px dashed rgba(255,255,255,.18); border-radius: 15px; text-align: center; }
.upload-zone strong { color: #dcd8e9; font-size: 13px; }
.upload-zone > span { color: var(--muted); font-size: 11px; }
.upload-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 3px; border-radius: 13px; color: #ffabd7; background: rgba(255,109,182,.1); }
.upload-zone .secondary-button { margin-top: 5px; min-height: 37px; }
.file-name { color: #a99aff; font-size: 11px; }
.video-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 23px; }
.video-fields input { min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.03); }
.video-results { margin-top: 25px; }
.video-results video { display: block; width: 100%; max-height: 500px; border-radius: 14px; background: #05050b; }
.voice-card { max-width: 760px; }
.voice-orb { display: grid; place-items: center; width: 130px; height: 130px; margin: 4px auto 28px; padding: 10px; border: 1px solid rgba(126,229,238,.33); border-radius: 50%; background: radial-gradient(circle, rgba(77,211,220,.27), rgba(99,76,214,.17) 53%, transparent 55%); box-shadow: 0 0 55px rgba(93,170,255,.15); }
.voice-orb > div { display: grid; place-items: center; width: 75px; height: 75px; border-radius: 50%; color: #b2f2f1; background: linear-gradient(145deg, #4d9fdc, #765de5); }
.voice-orb.speaking { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.05); box-shadow: 0 0 75px rgba(99,212,235,.38); } }
.voice-card textarea { min-height: 120px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.03); }
.voice-controls { align-items: flex-end; margin-top: 18px; }
.voice-controls > div:first-child { min-width: 180px; }
.voice-buttons { display: flex; gap: 9px; }
.micro-note, .setting-foot { display: flex; align-items: center; gap: 6px; margin: 18px 0 0; color: #7c788e; font-size: 11px; }
.micro-note svg, .setting-foot svg { color: #70e0b2; }
.settings-grid { display: grid; gap: 15px; }
.setting-card { padding: 21px; border-radius: 17px; }
.setting-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.setting-card h3 { margin: 0 0 6px; font: 600 15px 'Space Grotesk', sans-serif; }
.setting-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.setting-card select { width: 100%; border: 1px solid var(--line); }
.live-tag { padding: 5px 8px; border: 1px solid rgba(112,224,178,.2); border-radius: 7px; color: #7ce2b7; background: rgba(112,224,178,.08); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.theme-options { display: flex; gap: 10px; }
.theme-choice { display: flex; align-items: center; gap: 9px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.03); font-size: 12px; }
.theme-choice.active { border-color: rgba(170,143,255,.45); color: var(--text); }
.theme-dot { width: 15px; height: 15px; border-radius: 50%; }
.violet-dot { background: linear-gradient(135deg, #bd9fff, #6351d9); }
.aurora-dot { background: linear-gradient(135deg, #65e7d4, #5683f0); }
.danger-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.danger-button { color: #f09cad; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 5; max-width: min(360px, calc(100vw - 32px)); padding: 12px 15px; border: 1px solid var(--line); border-radius: 12px; color: #eae7f5; background: rgba(25,23,45,.95); box-shadow: 0 12px 35px rgba(0,0,0,.3); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .25s ease; font-size: 12px; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { border-color: rgba(255,128,157,.35); }
.boot-screen { display: grid; place-items: center; align-content: center; min-height: 100vh; gap: 8px; color: #eeeaff; font: 600 20px 'Space Grotesk', sans-serif; }
.boot-screen small { color: #9188b8; font: 400 11px 'DM Sans', sans-serif; }
.loading { display: grid; place-items: center; gap: 13px; min-height: 150px; color: var(--muted); font-size: 12px; }
.spinner { width: 22px; height: 22px; border: 2px solid rgba(255,255,255,.15); border-top-color: var(--primary-strong); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
body.aurora { --primary: #64d9d1; --primary-strong: #8dece0; }
body.aurora::before { background: #248eaa; }

@media (max-width: 800px) {
  .sidebar { width: 72px; flex-basis: 72px; padding: 20px 10px 14px; align-items: center; }
  .brand { justify-content: center; }
  .brand > div:last-child, .new-chat span, .nav-item span, .kio-badge span:last-child { display: none; }
  .new-chat { margin: 30px 0 20px; width: 45px; }
  .nav-item { justify-content: center; padding: 0; width: 45px; }
  .kio-badge { padding: 13px 0; border-top: 1px solid var(--line-soft); }
  .topbar { padding: 0 4%; }
  .topbar-title { margin-right: auto; margin-left: 14px; }
  .model-pill { display: none; }
  .content-area { width: min(92%, 650px); padding-top: 35px; }
}
@media (max-width: 560px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; bottom: 0; z-index: 4; display: flex; flex-direction: row; width: 100%; height: 66px; min-height: 0; padding: 8px 10px; border-width: 1px 0 0; background: rgba(12,12,25,.9); }
  .brand, .new-chat, .sidebar-bottom .nav-item { display: none; }
  .nav-list { display: flex; flex: 1; justify-content: space-around; gap: 2px; }
  .nav-item, .nav-item.active { width: 48px; height: 48px; border-radius: 12px; }
  .sidebar-bottom { margin: 0; }
  .sidebar-bottom .kio-badge { display: none; }
  .main-area { padding-bottom: 66px; }
  .topbar { height: 80px; }
  .mobile-brand { display: flex; }
  .topbar-title { display: none; }
  .top-actions { margin-left: auto; }
  .content-area { padding-top: 29px; }
  .chat-intro h2, .tool-hero h2 { font-size: 26px; }
  .chat-intro { margin-bottom: 30px; }
  .tool-card { padding: 18px; }
  .form-row, .voice-controls { align-items: stretch; flex-wrap: wrap; }
  .form-row .select-label { display: none; }
  .form-row select { flex: 1; }
  .primary-button { flex: 1; }
  .video-fields { grid-template-columns: 1fr; gap: 15px; }
  .voice-controls > div:first-child { width: 100%; }
  .voice-buttons { width: 100%; }
  .voice-buttons button { flex: 1; }
  .danger-card { align-items: flex-start; flex-direction: column; }
}
