:root {
  color-scheme: dark;
  font-family: 'Manrope', sans-serif;
  color: #e9edf5;
  background: #0b0f17;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #e9edf5;
  --muted: #9ca8b8;
  --line: #232a3b;
  --panel: #161b26;
  --accent: #2563eb;
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: #0b0f17; }
button, textarea { font: inherit; }
button { color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }

.sidebar { position: sticky; top: 0; height: 100vh; min-height: 620px; display: flex; flex-direction: column; padding: 25px 16px 17px; background: #0d121c; color: #e9edf5; }
.brand { display: flex; align-items: center; gap: 11px; margin: 1px 8px 35px; color: inherit; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border: 1px solid #2d4364; border-radius: 11px; background: #121c2c; box-shadow: 0 0 18px rgba(37, 99, 235, .16); }
.prism-logo-image { width: 100%; height: 100%; display: block; object-fit: contain; filter: drop-shadow(0 0 3px rgba(126, 176, 255, .28)); animation: logo-shimmer 3.2s ease-in-out infinite; }
.brand-copy { display: flex; flex-direction: column; gap: 3px; }
.brand-copy strong { font-size: 10px; font-weight: 800; }
.brand-copy small { color: #8691a3; font: 9px 'DM Mono', monospace; }
.new-chat { width: 100%; height: 43px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid #2a3344; border-radius: 8px; background: var(--panel); color: #e3e9f2; font-size: 12px; font-weight: 700; cursor: pointer; transition: background .16s, transform .16s; }
.new-chat:hover { transform: translateY(-1px); background: #202939; }
.new-chat svg { width: 16px; height: 16px; }
.new-chat kbd { margin-left: auto; color: #8b97a8; }
kbd { font: 10px 'DM Mono', monospace; }
.nav-group { margin-top: 37px; }
.nav-label { margin: 0 10px 10px; color: #8490a2; font: 9px 'DM Mono', monospace; }
.nav-item { height: 39px; display: flex; align-items: center; gap: 11px; padding: 0 10px; border-radius: 7px; color: #aab4c2; text-decoration: none; font-size: 12px; }
.nav-item svg { width: 16px; height: 16px; color: #8490a2; }
.nav-item.active { background: #1b2433; color: #f5f7fb; }
.nav-item.active svg { color: #70a5ff; }
.nav-indicator { width: 5px; height: 5px; margin-left: auto; border-radius: 50%; background: #70a5ff; }
.sidebar-spacer { flex: 1; min-height: 42px; }
.model-card { padding: 13px 12px 11px; border: 1px solid #252d3c; border-radius: 8px; background: #141a24; }
.model-card-heading { display: flex; align-items: center; justify-content: space-between; color: #8e9aac; font: 9px 'DM Mono', monospace; }
.model-live { display: inline-flex; align-items: center; gap: 5px; color: #8cc99b; font-size: 8px; }
.model-live i { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: #72c28a; }
.model-identity { display: flex; align-items: center; gap: 9px; margin-top: 15px; }
.model-avatar, .composer-model-mark { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; background: #252e3e; color: #cbd6e5; font: 500 12px 'DM Mono', monospace; }
.model-identity strong { color: #e5eaf2; font-size: 11px; }

.main-area { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; background: #0b0f17; }
.topbar { height: 64px; flex: 0 0 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 36px; border-bottom: 1px solid #1e2634; background: #0d121b; }
.breadcrumb, .topbar-right { display: flex; align-items: center; }
.breadcrumb { gap: 10px; color: #8e99aa; font-size: 11px; }
.breadcrumb > span:first-child { color: #f5f8ff; font-size: 13px; font-weight: 800; text-shadow: 0 0 9px rgba(91, 154, 255, .42); animation: breadcrumb-glow 2.8s ease-in-out infinite alternate; }
.breadcrumb-divider { color: #465164; }
.breadcrumb strong { color: #edf4ff; font-weight: 700; text-shadow: 0 0 8px rgba(91, 154, 255, .32); animation: breadcrumb-glow 3.2s ease-in-out .45s infinite alternate; }
.topbar-right { gap: 13px; }
.endpoint-control { display: flex; align-items: center; gap: 6px; color: #8995a7; font: 9px 'DM Mono', monospace; }
.endpoint-control select { max-width: 102px; padding: 7px 22px 7px 9px; border: 1px solid #293244; border-radius: 8px; background: var(--panel); color: #dbe3ee; font: 10px 'DM Mono', monospace; }
.connection { display: flex; align-items: center; gap: 7px; color: #9aa5b5; font-size: 10px; }
.status-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: #72c28a; box-shadow: 0 0 0 3px rgba(114, 194, 138, .12); }
.topbar-separator { width: 1px; height: 16px; background: #293244; }
.model-tag { padding: 7px 10px; border: 1px solid #293244; border-radius: 8px; background: var(--panel); color: #cbd5e1; font: 9px 'DM Mono', monospace; }
.new-chat-mobile { display: none; }

.conversation { width: min(960px, 100%); min-height: calc(100vh - 64px); display: flex; flex: 1; flex-direction: column; margin: 0 auto; padding: 0 36px; }
.messages { width: 100%; min-height: 0; display: flex; flex: 1; flex-direction: column; gap: 16px; overflow-y: auto; padding: 32px 0 22px; }
.welcome-message { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: auto 0; padding: 28px 0 32px; animation: welcome-in .45s ease-out both; }
.welcome-brand { width: 112px; height: 112px; display: grid; place-items: center; margin: 0 auto 22px; padding: 17px; border: 1px solid #303b50; border-radius: 27px; background: #121a28; box-shadow: 0 18px 44px rgba(0, 0, 0, .24), 0 0 28px rgba(37, 99, 235, .12); }
.welcome-title { margin: 0 0 28px; color: #f2f5fa; font-size: 25px; font-weight: 700; line-height: 1.2; }
.suggestion-grid { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.suggestion { min-width: 0; min-height: 70px; display: flex; align-items: center; gap: 10px; padding: 12px 11px; border: 1px solid #293244; border-radius: 8px; background: var(--panel); text-align: left; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.suggestion:hover { transform: translateY(-2px); border-color: #3a5274; background: #1a2230; }
.suggestion-icon { width: 29px; height: 29px; flex: 0 0 29px; display: grid; place-items: center; border-radius: 6px; font-size: 13px; }
.idea-icon { background: #1c2e4b; color: #79adff; }
.edit-icon { background: #3a2d22; color: #efb877; font: 600 10px 'DM Mono', monospace; }
.plan-icon { background: #3b321f; color: #edc968; font-size: 19px; }
.suggestion strong, .suggestion small { display: block; }
.suggestion strong { color: #e7edf5; font-size: 11px; font-weight: 700; }
.suggestion small { margin-top: 4px; color: #929daf; font-size: 9px; line-height: 1.35; }
.suggestion-arrow { margin-left: auto; align-self: flex-start; color: #7f8a9a; font-size: 12px; }
.message { max-width: min(78%, 680px); padding: 13px 15px; border-radius: 8px; font-size: 13px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; animation: message-in .2s ease-out both; }
.message.user { align-self: flex-end; background: #2563eb; color: #fff; }
.message.assistant { align-self: flex-start; border: 0; background: transparent; color: #dce3ed; }
.message.error { border: 1px solid #59332f; background: #2a1918; color: #ff9f91; }

.composer-wrap { width: 100%; padding: 0 0 15px; }
.composer { padding: 13px 14px 10px; border: 1px solid #293244; border-radius: 10px; background: var(--panel); box-shadow: 0 15px 38px rgba(0, 0, 0, .2); transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: #3c67a4; box-shadow: 0 0 0 3px rgba(37, 99, 235, .14), 0 15px 38px rgba(0, 0, 0, .2); }
textarea { width: 100%; min-height: 37px; max-height: 130px; resize: none; border: 0; outline: 0; background: transparent; color: #eef2f7; font-size: 13px; line-height: 1.6; }
textarea::placeholder { color: #737f90; }
.composer-footer, .composer-meta, .composer-actions { display: flex; align-items: center; }
.composer-footer { justify-content: space-between; margin-top: 7px; padding-top: 8px; border-top: 1px solid rgba(41, 50, 68, .7); }
.composer-meta { gap: 7px; color: #9ba7b7; font-size: 9px; }
.composer-model-mark { width: 21px; height: 21px; border-radius: 6px; font-size: 9px; }
.composer-actions { gap: 9px; }
.keyboard-hint { color: #788598; font-size: 9px; }
.keyboard-hint kbd { color: #a9b4c3; font-size: 9px; }
.voice-button { width: 33px; height: 33px; flex: 0 0 33px; display: grid; place-items: center; border: 1px solid #30394a; border-radius: 8px; background: #202735; color: #aab6c6; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.voice-button:hover, .voice-button[aria-pressed="true"] { border-color: #45618a; background: #26354a; color: #a9cbff; }
.voice-button.is-listening { border-color: #8c493f; background: #35211f; color: #ff9f91; }
.voice-button svg { width: 17px; height: 17px; }
.voice-button:disabled { cursor: wait; opacity: .55; }
.send-button { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 9px; background: var(--accent); color: #fff; cursor: pointer; transition: background .15s, transform .15s; }
.send-button:hover { transform: translateY(-1px); background: #3475f5; }
.send-button:disabled { cursor: wait; opacity: .55; }
.send-button svg { width: 16px; height: 16px; }
.voice-status { margin: 6px 14px 0; color: #a0acbc; text-align: left; font-size: 10px; line-height: 1.4; }
.voice-status[data-state="error"] { color: #ff9f91; }
.privacy-note { margin: 9px 0 0; color: #778396; text-align: center; font-size: 9px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@keyframes welcome-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes message-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes breadcrumb-glow { from { text-shadow: 0 0 6px rgba(91, 154, 255, .24); } to { text-shadow: 0 0 12px rgba(91, 154, 255, .58); } }
@keyframes logo-shimmer { 0%, 100% { filter: drop-shadow(0 0 3px rgba(126, 176, 255, .22)); } 50% { filter: drop-shadow(0 0 9px rgba(110, 166, 255, .66)); } }

@media (prefers-reduced-motion: reduce) {
  .breadcrumb > span:first-child, .breadcrumb strong, .prism-logo-image { animation: none; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .sidebar { padding-right: 13px; padding-left: 13px; }
  .topbar { padding: 0 24px; }
  .conversation { padding: 0 24px; }
  .suggestion-grid { grid-template-columns: 1fr; }
  .suggestion { min-height: 62px; }
}

@media (max-width: 640px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-area { min-height: 100vh; min-height: 100dvh; }
  .topbar { height: 58px; flex-basis: 58px; gap: 8px; padding: 0 17px; }
  .breadcrumb { gap: 6px; font-size: 10px; white-space: nowrap; }
  .topbar-right { gap: 8px; }
  .new-chat-mobile { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border: 1px solid #293244; border-radius: 8px; background: var(--panel); color: #d5deea; cursor: pointer; }
  .new-chat-mobile svg { width: 17px; height: 17px; }
  .new-chat-mobile:hover { border-color: #45618a; background: #202a3b; color: #fff; }
  .model-tag, .topbar-separator { display: none; }
  .endpoint-control select { max-width: 82px; padding-right: 16px; }
  .conversation { min-height: calc(100vh - 58px); min-height: calc(100dvh - 58px); padding: 0 17px; }
  .messages { padding-top: 18px; }
  .welcome-brand { width: 92px; height: 92px; margin-bottom: 17px; padding: 14px; border-radius: 23px; }
  .welcome-title { margin-bottom: 22px; font-size: 22px; }
  .suggestion-grid { gap: 8px; }
  .suggestion { min-height: 58px; padding: 9px 10px; }
  .suggestion-icon { width: 32px; height: 32px; flex-basis: 32px; }
  .suggestion strong { font-size: 10px; }
  .suggestion small { font-size: 8px; }
  .composer-wrap { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .composer { padding: 11px 11px 9px; }
  .keyboard-hint { display: none; }
  .message { max-width: 91%; }
}