:root {
  color-scheme: dark;
  --bg: #171717;
  --panel: #202020;
  --panel-soft: #262626;
  --border: rgba(255, 255, 255, .1);
  --text: #f3f3f3;
  --muted: #a7a7a7;
  --accent: #10a37f;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { font: 15px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }

.app { display: flex; min-height: 100vh; }
.sidebar { width: 245px; flex: 0 0 245px; display: flex; flex-direction: column; padding: 14px 10px; background: #111; border-right: 1px solid var(--border); }
.side-nav, .side-bot { display: grid; gap: 4px; }
.side-bot { margin-top: auto; }
.side-ico { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: 8px; background: transparent; text-align: left; }
.side-ico:hover { background: var(--panel-soft); }
.side-ico i { width: 20px; color: var(--muted); font-size: 20px; }
.side-sec { margin: 25px 12px 8px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.side-empty { padding: 8px 12px; color: #777; font-size: 13px; }

.stage { display: flex; min-width: 0; flex: 1; min-height: 100vh; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; border-bottom: 1px solid var(--border); }
.model-btn, .ghost, .primary { border: 0; border-radius: 8px; padding: 9px 12px; background: transparent; }
.model-btn { font-weight: 650; }
.model-btn:hover, .ghost:hover { background: var(--panel-soft); }
.top-actions { display: flex; gap: 6px; }
.primary { background: var(--text); color: #111; font-weight: 600; }
.primary:hover { background: #d8d8d8; }
.scroll { width: min(900px, 100%); flex: 1; margin: 0 auto; padding: 48px 24px 180px; overflow-y: auto; }
.splash { display: grid; min-height: 42vh; place-items: center; }
.splash h1 { margin: 0; font-size: clamp(26px, 4vw, 38px); letter-spacing: -.03em; }
.msgs { display: flex; flex-direction: column; gap: 18px; width: 100%; }
.ras-row { display: flex; width: 100%; }
.ras-row.user { justify-content: flex-end; }
.ras-bubble { max-width: min(700px, 90%); padding: 11px 15px; border-radius: 18px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.ras-row.user .ras-bubble { background: #343434; }
.ras-row.bot .ras-bubble { padding-left: 2px; }
.ras-bubble code { padding: 2px 5px; border-radius: 5px; background: rgba(255,255,255,.1); }
.ras-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ras-chip { border: 1px solid var(--border); border-radius: 999px; padding: 7px 13px; background: transparent; }
.ras-chip:hover { border-color: var(--accent); background: rgba(16,163,127,.12); }
.ras-typing { color: var(--muted); font-style: italic; }
.ras-card { margin-top: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); }
.ras-card h3 { margin: 0 0 10px; font-size: 16px; }
.ras-items { display: grid; gap: 8px; }

.dock { position: fixed; right: 0; bottom: 0; left: 245px; padding: 18px max(24px, calc((100vw - 900px) / 2 + 24px)) 14px; background: linear-gradient(transparent, var(--bg) 22%); }
.composer { display: flex; align-items: flex-end; gap: 8px; max-width: 900px; margin: 0 auto; padding: 9px 10px 9px 14px; border: 1px solid #444; border-radius: 18px; background: var(--panel); box-shadow: 0 4px 25px rgba(0,0,0,.25); }
.c-input { min-height: 24px; max-height: 160px; flex: 1; resize: none; border: 0; outline: 0; background: transparent; color: var(--text); }
.c-input::placeholder { color: #888; }
.c-btn, .c-voice, .c-send { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; }
.c-btn:hover, .c-voice:hover { background: var(--panel-soft); }
.c-voice { gap: 5px; padding: 0 9px; }
.c-send { background: var(--text); color: #111; }
.c-send:disabled { opacity: .35; cursor: default; }
.disclaimer { margin: 8px auto 0; color: #777; font-size: 11px; text-align: center; }

@media (max-width: 720px) {
  .sidebar { display: none; }
  .dock { left: 0; padding-right: 12px; padding-left: 12px; }
  .topbar { padding: 12px 14px; }
  .scroll { padding-right: 14px; padding-left: 14px; }
  .c-voice span { display: none; }
}
