:root {
  color-scheme: dark;
  font-family: "DM Sans", "Segoe UI", sans-serif;
  color: #eeedf3;
  background: #101114;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --muted: #898993;
  --subtle: #5e6069;
  --accent: #bd9af6;
  --line: rgba(255, 255, 255, 0.075);
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 68% 32%, rgba(108, 76, 158, 0.08), transparent 38%),
    #101114;
}

button, textarea { font: inherit; }
button { color: inherit; }

.app-shell { display: flex; height: 100vh; min-height: 520px; }
@supports (height: 100dvh) {
  .app-shell { height: 100dvh; }
}

.sidebar {
  width: 260px;
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
  padding: 27px 19px 22px;
  border-right: 1px solid var(--line);
  background: rgba(16, 17, 20, 0.82);
}

.brand, .mobile-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand { margin: 1px 0 43px 3px; }
.brand-logo {
  display: block;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  border-radius: 10px;
  object-fit: contain;
}
.brand-name { color: #f0edf5; font-family: "Manrope", sans-serif; font-size: 18px; font-weight: 700; letter-spacing: -0.8px; }
.brand-dot { color: var(--accent); }

.new-chat-button {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid rgba(197, 169, 239, 0.23);
  border-radius: 9px;
  background: rgba(177, 142, 225, 0.085);
  cursor: pointer;
  font-size: 13px;
  transition: background 160ms ease, border-color 160ms ease;
}
.new-chat-button:hover { border-color: rgba(197, 169, 239, 0.48); background: rgba(177, 142, 225, 0.14); }
.new-chat-button > span { color: #d2b7fa; font-size: 21px; font-weight: 400; line-height: 1; }
.sidebar-caption { margin: 38px 0 13px 5px; color: #666772; font-size: 10px; font-weight: 700; letter-spacing: 1.15px; }
.assistant-card { display: flex; align-items: center; gap: 10px; padding: 10px 7px; }
.assistant-avatar { display: block; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 11px; object-fit: contain; }
.assistant-details { display: grid; gap: 3px; }
.assistant-details strong { font-size: 12px; font-weight: 600; }
.assistant-details span { color: var(--muted); font-size: 10px; }
.online-indicator { width: 7px; height: 7px; margin-left: auto; border-radius: 50%; background: #e0a961; box-shadow: 0 0 9px rgba(224, 169, 97, 0.35); }
.online-indicator.is-online { background: #72c99b; box-shadow: 0 0 9px rgba(114, 201, 155, 0.45); }
.online-indicator.is-offline { background: #e07e7e; box-shadow: 0 0 9px rgba(224, 126, 126, 0.4); }
.sidebar-footer { display: flex; align-items: flex-start; gap: 10px; margin-top: auto; padding: 15px 7px 0; border-top: 1px solid var(--line); color: #777782; font-size: 11px; line-height: 1.6; }
.footer-sparkle { color: #c3a3f2; font-size: 14px; }

.main-panel { display: flex; min-width: 0; min-height: 0; height: 100%; flex: 1; flex-direction: column; }
.topbar { display: flex; height: 65px; flex: 0 0 65px; align-items: center; justify-content: flex-end; padding: 0 38px; border-bottom: 1px solid var(--line); }
.model-label { display: flex; align-items: center; gap: 8px; color: #c6c4cd; font-size: 12px; }
.model-dot { width: 7px; height: 7px; border-radius: 50%; background: #b69ae5; box-shadow: 0 0 10px rgba(182, 154, 229, 0.55); }
.mobile-brand, .mobile-new-chat { display: none; }

.conversation { display: flex; width: 100%; max-width: 850px; min-height: 0; flex: 1; align-self: center; flex-direction: column; overflow: hidden; padding: 45px 36px 0; }
.messages { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 24px; overflow-y: auto; scrollbar-color: #37343e transparent; scrollbar-width: thin; }
.welcome { width: 100%; max-width: 580px; margin: auto; padding: 6px 0 38px; }
.welcome-orbit { display: grid; width: 53px; height: 53px; place-items: center; margin-bottom: 29px; border: 1px solid rgba(194, 164, 242, 0.2); border-radius: 18px; background: linear-gradient(145deg, rgba(164, 128, 222, 0.16), rgba(164, 128, 222, 0.035)); box-shadow: 0 0 44px rgba(148, 112, 203, 0.08); color: #c9a9fc; font-size: 23px; }
.eyebrow { margin: 0 0 13px; color: #b79bdd; font-size: 10px; font-weight: 700; letter-spacing: 1.7px; }
.welcome h1 { margin: 0; font-family: "Manrope", sans-serif; font-size: clamp(36px, 5vw, 53px); font-weight: 600; letter-spacing: -2.4px; line-height: 1.15; }
.welcome h1 span { color: #9c9aa5; }
.welcome-copy { max-width: 445px; margin: 16px 0 29px; color: #92919b; font-size: 13px; line-height: 1.75; }
.suggestions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.suggestion { position: relative; display: flex; min-height: 91px; align-items: flex-start; gap: 9px; padding: 13px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.022); cursor: pointer; text-align: left; transition: background 160ms ease, border-color 160ms ease, transform 160ms ease; }
.suggestion:hover { transform: translateY(-2px); border-color: rgba(192, 166, 236, 0.3); background: rgba(177, 142, 225, 0.065); }
.suggestion-icon { color: #bd9af6; font-size: 13px; }
.suggestion > span:nth-child(2) { display: grid; gap: 6px; padding-top: 1px; }
.suggestion strong { font-size: 10px; font-weight: 600; }
.suggestion small { color: #82818b; font-size: 9px; line-height: 1.45; }
.suggestion-arrow { position: absolute; right: 10px; bottom: 8px; color: #706d79; font-size: 12px; }

.message-row { display: flex; width: 100%; align-items: flex-start; gap: 12px; animation: message-in 180ms ease-out; }
@keyframes message-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.message-row.user { justify-content: flex-end; }
.message-avatar { display: block; width: 29px; height: 29px; flex: 0 0 29px; border-radius: 9px; background: #292332; object-fit: contain; }
.message-content { max-width: min(680px, calc(100% - 45px)); padding: 5px 0; color: #d8d6de; font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; white-space: pre-wrap; }
.user .message-content { max-width: min(560px, 83%); padding: 11px 15px; border: 1px solid rgba(197, 169, 239, 0.12); border-radius: 14px 14px 4px 14px; background: rgba(171, 138, 220, 0.12); color: #eee9f5; }
.assistant-row .message-content { padding-top: 3px; }
.typing-indicator { display: flex; align-items: center; gap: 5px; height: 25px; }
.typing-indicator span { width: 5px; height: 5px; border-radius: 50%; background: #bb9be9; animation: typing 1s infinite ease-in-out; }
.typing-indicator span:nth-child(2) { animation-delay: 120ms; }
.typing-indicator span:nth-child(3) { animation-delay: 240ms; }
@keyframes typing { 0%, 60%, 100% { opacity: 0.35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }
.thinking-status { align-self: center; color: #92919b; font-size: 11px; line-height: 1.5; }

.composer-area { width: min(100% - 72px, 780px); align-self: center; padding: 14px 0 17px; }
.composer { display: flex; min-height: 55px; align-items: flex-end; gap: 10px; padding: 8px 9px 8px 17px; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 13px; background: #17181d; box-shadow: 0 8px 35px rgba(0, 0, 0, 0.16); transition: border-color 160ms ease, box-shadow 160ms ease; }
.composer:focus-within { border-color: rgba(190, 160, 237, 0.46); box-shadow: 0 0 0 3px rgba(173, 139, 221, 0.07); }
.composer textarea { width: 100%; min-height: 36px; max-height: 180px; resize: none; padding: 9px 0 7px; border: 0; outline: 0; background: transparent; color: #eeedf3; font-size: 12px; line-height: 1.6; }
.composer textarea::placeholder { color: #777781; }
.send-button { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border: 0; border-radius: 9px; background: #c0a0f1; color: #211b2a; cursor: pointer; transition: background 150ms ease, transform 150ms ease; }
.send-button:hover { transform: translateY(-1px); background: #d0b8f5; }
.send-button:disabled { cursor: wait; opacity: 0.55; }
.send-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.composer-note { margin: 9px 0 0; color: #666671; font-size: 9px; text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

.startup-screen { position: fixed; z-index: 5; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px; background: radial-gradient(ellipse at 50% 42%, rgba(108, 76, 158, 0.13), transparent 42%), #101114; text-align: center; }
.startup-screen[hidden] { display: none; }
.startup-logo { width: 58px; height: 58px; margin-bottom: 25px; border-radius: 17px; object-fit: contain; }
.startup-spinner { width: 28px; height: 28px; margin-bottom: 22px; border: 2px solid rgba(189, 154, 246, 0.18); border-top-color: #bd9af6; border-radius: 50%; animation: startup-spin 850ms linear infinite; }
@keyframes startup-spin { to { transform: rotate(360deg); } }
.startup-screen h1 { margin: 0; font-family: "Manrope", sans-serif; font-size: clamp(22px, 5vw, 29px); font-weight: 600; letter-spacing: -0.8px; }
.startup-screen p { max-width: 390px; margin: 12px 0 0; color: #92919b; font-size: 13px; line-height: 1.7; }
.startup-screen .startup-hint { margin-top: 20px; color: #666671; font-size: 11px; }
.startup-screen.is-error .startup-spinner { display: none; }
.startup-screen.is-error h1 { color: #e5b4b4; }

@media (max-width: 700px) {
  .sidebar { display: none; }
  .topbar { height: 57px; flex-basis: 57px; justify-content: space-between; padding: 0 18px; }
  .mobile-brand { display: flex; gap: 8px; }
  .mobile-brand .brand-logo { width: 28px; height: 28px; flex-basis: 28px; border-radius: 9px; }
  .mobile-brand .brand-name { font-size: 16px; }
  .mobile-new-chat { display: grid; width: 31px; height: 31px; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: #d1b8f5; cursor: pointer; font-size: 19px; }
  .conversation { padding: 28px 19px 0; }
  .welcome { padding: 4px 0 29px; }
  .welcome-orbit { width: 46px; height: 46px; margin-bottom: 24px; border-radius: 15px; }
  .welcome h1 { font-size: clamp(37px, 9vw, 49px); letter-spacing: -2px; }
  .welcome-copy { margin: 14px 0 24px; font-size: 12px; }
  .suggestions { grid-template-columns: 1fr; gap: 8px; }
  .suggestion { min-height: 63px; align-items: center; padding: 9px 12px; }
  .suggestion > span:nth-child(2) { gap: 3px; }
  .suggestion strong { font-size: 11px; }
  .suggestion small { font-size: 10px; }
  .suggestion-arrow { right: 12px; bottom: 23px; }
  .composer-area { width: calc(100% - 32px); padding: 10px 0 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
