:root {
  color-scheme: light;
  --bg: #f7f9fe;
  --bg-strong: #ffffff;
  --sidebar: rgba(248, 250, 255, 0.74);
  --surface: rgba(255, 255, 255, 0.76);
  --surface-solid: #ffffff;
  --surface-hover: rgba(91, 107, 255, 0.065);
  --text: #11172a;
  --muted: #6f778d;
  --faint: #6d7890;
  --line: rgba(35, 49, 86, 0.09);
  --line-strong: rgba(35, 49, 86, 0.14);
  --primary: #5b65ee;
  --primary-strong: #4854e4;
  --primary-soft: #eef0ff;
  --cyan: #29bad0;
  --violet: #8b5cf6;
  --green: #20b985;
  --shadow: 0 28px 80px rgba(37, 48, 87, 0.11), 0 5px 20px rgba(37, 48, 87, 0.045);
  --shadow-soft: 0 12px 40px rgba(37, 48, 87, 0.08);
  --sidebar-width: 286px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080b13;
  --bg-strong: #0f1420;
  --sidebar: rgba(10, 14, 24, 0.82);
  --surface: rgba(21, 27, 42, 0.76);
  --surface-solid: #151b2a;
  --surface-hover: rgba(126, 139, 255, 0.1);
  --text: #f3f5fc;
  --muted: #9ca6bd;
  --faint: #98a4bb;
  --line: rgba(190, 201, 230, 0.09);
  --line-strong: rgba(190, 201, 230, 0.15);
  --primary: #8189ff;
  --primary-strong: #9198ff;
  --primary-soft: rgba(105, 115, 255, 0.14);
  --cyan: #52cee0;
  --violet: #a47bf8;
  --green: #42d6a3;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.38), 0 5px 20px rgba(0, 0, 0, 0.24);
  --shadow-soft: 0 12px 40px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s ease, color .35s ease;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
a,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 26%, transparent);
  outline-offset: 2px;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ambient {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  filter: blur(4px);
  pointer-events: none;
  opacity: .62;
}

.ambient-one {
  width: min(56vw, 780px);
  height: min(42vw, 580px);
  left: 35%;
  top: -27%;
  background: radial-gradient(ellipse, rgba(115, 128, 255, .17), rgba(92, 201, 227, .06) 52%, transparent 72%);
}

.ambient-two {
  width: min(38vw, 520px);
  height: min(52vw, 680px);
  right: -15%;
  bottom: -27%;
  background: radial-gradient(ellipse, rgba(139, 92, 246, .13), rgba(39, 196, 218, .05) 58%, transparent 72%);
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  height: 100dvh;
}

.sidebar {
  position: relative;
  z-index: 20;
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: 22px 17px 18px;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
  backdrop-filter: blur(28px) saturate(1.3);
  -webkit-backdrop-filter: blur(28px) saturate(1.3);
}

.brand-row {
  display: flex;
  align-items: center;
  height: 42px;
  padding: 0 5px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark,
.welcome-mark {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 75% 25%, rgba(255,255,255,.5), transparent 22%),
    linear-gradient(145deg, #596cf7 6%, #7b5af2 52%, #2bc0da 100%);
  box-shadow: 0 9px 22px rgba(82, 93, 227, .25);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 12px 12px 12px 7px;
  transform: rotate(-3deg);
}

.brand-mark span {
  color: white;
  font-size: 17px;
  font-weight: 750;
  transform: rotate(3deg);
}

.brand-mark i {
  position: absolute;
  width: 5px;
  height: 5px;
  right: 6px;
  bottom: 6px;
  border: 1.5px solid rgba(255,255,255,.9);
  border-radius: 50%;
}

.brand-name {
  font-size: .98rem;
  font-weight: 760;
  letter-spacing: -.025em;
}

.brand-name b {
  color: var(--primary);
  font-weight: 800;
}

.demo-badge {
  margin-left: 8px;
  padding: 3px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--faint);
  font-size: .75rem;
  font-weight: 750;
  letter-spacing: .08em;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .2s ease;
}

.icon-button:hover {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.icon-button:active {
  transform: scale(.94);
}

.sidebar-close,
.menu-button {
  display: none;
}

.new-chat {
  display: flex;
  align-items: center;
  width: 100%;
  height: 48px;
  margin-top: 22px;
  padding: 0 12px 0 9px;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 3px 14px rgba(47, 60, 95, .035);
  cursor: pointer;
  font-size: .88rem;
  font-weight: 650;
  text-align: left;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.new-chat:hover {
  border-color: color-mix(in srgb, var(--primary) 25%, var(--line));
  box-shadow: 0 8px 24px rgba(58, 69, 137, .08);
  transform: translateY(-1px);
}

.new-chat-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
}

.new-chat-icon svg {
  width: 17px;
  height: 17px;
}

.new-chat kbd {
  margin-left: auto;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--faint);
  font-family: inherit;
  font-size: .75rem;
}

.history-search {
  display: flex;
  align-items: center;
  height: 40px;
  margin: 13px 5px 5px;
  gap: 9px;
  color: var(--faint);
}

.history-search svg {
  width: 17px;
  height: 17px;
}

.history-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: .82rem;
}

.history-search input::placeholder {
  color: var(--faint);
}

.history {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 7px 0 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.history-group + .history-group {
  margin-top: 22px;
}

.history-label {
  margin: 0 11px 7px;
  color: var(--faint);
  font-size: .75rem;
  font-weight: 650;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.history-item {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 22px;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 6px 8px 6px 10px;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: background-color .2s ease, color .2s ease;
}

.history-item:hover,
.history-item.active {
  background: var(--surface-hover);
  color: var(--text);
}

.history-item.active::before {
  position: absolute;
  width: 3px;
  height: 18px;
  left: -1px;
  border-radius: 4px;
  background: linear-gradient(var(--primary), var(--cyan));
  content: "";
}

.history-item > svg:first-child {
  width: 16px;
  height: 16px;
  opacity: .7;
}

.history-item span {
  overflow: hidden;
  font-size: .875rem;
  font-weight: 520;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item .more-icon {
  width: 17px;
  height: 17px;
  opacity: 0;
  transition: opacity .2s ease;
}

.history-item:hover .more-icon {
  opacity: .7;
}

.history-empty {
  display: none;
  margin: 24px 10px;
  color: var(--faint);
  font-size: .8rem;
  text-align: center;
}

.sidebar-footer {
  position: relative;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.server-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 20px;
  align-items: center;
  width: 100%;
  padding: 6px;
  gap: 9px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background-color .2s ease;
}

.server-card:hover {
  background: var(--surface-hover);
}

.server-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--primary) 15%, var(--line));
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
}

.server-icon svg {
  width: 18px;
  height: 18px;
}

.server-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.server-copy strong {
  font-size: .81rem;
  font-weight: 700;
}

.server-copy small {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: .75rem;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border: 2px solid color-mix(in srgb, var(--green) 20%, transparent);
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 10%, transparent);
}

.server-chevron {
  width: 16px;
  height: 16px;
  color: var(--faint);
  transition: transform .25s var(--ease);
}

.server-card[aria-expanded="true"] .server-chevron {
  transform: rotate(180deg);
}

.server-details {
  position: absolute;
  right: 0;
  bottom: 58px;
  left: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
  animation: pop .2s var(--ease);
}

.server-details[hidden] {
  display: none;
}

.server-details div {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  gap: 10px;
  font-size: .75rem;
}

.server-details span {
  color: var(--muted);
}

.server-details strong {
  font-weight: 650;
  text-align: right;
}

.main-panel {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
}

.topbar {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 76px;
  padding: 0 25px;
}

.model-wrap {
  position: relative;
  grid-column: 2;
}

.model-button {
  display: flex;
  align-items: center;
  min-width: 202px;
  padding: 7px 10px 7px 8px;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 15px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: border-color .2s ease, background-color .2s ease;
}

.model-button:hover,
.model-button[aria-expanded="true"] {
  border-color: var(--line);
  background: var(--surface);
}

.model-orb {
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #ffffff 0 7%, transparent 8%),
    conic-gradient(from 210deg, #25bfd6, #6675ff, #9363f5, #25bfd6);
  box-shadow: 0 5px 15px rgba(84, 94, 226, .26), inset 0 0 13px rgba(255,255,255,.22);
}

.model-button > span:nth-child(2) {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1px;
}

.model-button strong {
  font-size: .875rem;
  font-weight: 730;
  letter-spacing: -.01em;
}

.model-button small {
  color: var(--muted);
  font-size: .75rem;
}

.model-button > svg {
  width: 16px;
  height: 16px;
  color: var(--faint);
  transition: transform .2s ease;
}

.model-button[aria-expanded="true"] > svg {
  transform: rotate(180deg);
}

.model-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  width: 286px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: color-mix(in srgb, var(--surface-solid) 94%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
  transform: translateX(-50%);
  animation: popCenter .22s var(--ease);
}

.model-popover[hidden] {
  display: none;
}

.popover-eyebrow {
  margin: 1px 4px 10px;
  color: var(--faint);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.model-option {
  display: grid;
  grid-template-columns: 38px 1fr 20px;
  align-items: center;
  gap: 10px;
}

.model-option-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 13px 13px 13px 8px;
  background: linear-gradient(145deg, var(--primary), var(--violet) 60%, var(--cyan));
  color: white;
  font-size: .95rem;
  font-weight: 750;
}

.model-option > span:nth-child(2) {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.model-option strong {
  font-size: .8rem;
}

.model-option small {
  color: var(--muted);
  font-size: .75rem;
}

.model-option > svg {
  width: 18px;
  color: var(--primary);
}

.popover-divider {
  height: 1px;
  margin: 13px 0 10px;
  background: var(--line);
}

.popover-status {
  display: flex;
  align-items: center;
  padding: 3px 4px;
  gap: 8px;
  color: var(--muted);
  font-size: .75rem;
}

.topbar-actions {
  display: flex;
  grid-column: 3;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}

.online-pill {
  display: inline-flex;
  align-items: center;
  height: 31px;
  margin-right: 5px;
  padding: 0 10px;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  color: var(--muted);
  font-size: .75rem;
  font-weight: 600;
}

.online-pill .status-dot {
  width: 6px;
  height: 6px;
  border: 0;
}

.moon-icon {
  display: none;
}

html[data-theme="dark"] .sun-icon {
  display: none;
}

html[data-theme="dark"] .moon-icon {
  display: block;
}

.chat-stage {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.chat-feed {
  width: 100%;
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 20px max(24px, calc((100% - 820px) / 2)) 28px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.welcome {
  display: flex;
  min-height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 32px 0 56px;
  text-align: center;
  animation: welcomeIn .7s var(--ease) both;
}

.welcome-mark {
  width: 68px;
  height: 68px;
  margin-bottom: 24px;
  border-radius: 25px 25px 25px 13px;
  box-shadow: 0 18px 45px rgba(83, 93, 222, .22);
  transform: rotate(-4deg);
}

.welcome-mark span {
  color: white;
  font-size: 30px;
  font-weight: 720;
  transform: rotate(4deg);
}

.welcome-mark i {
  position: absolute;
  border: 1.5px solid rgba(255,255,255,.84);
  border-radius: 50%;
}

.welcome-mark i:nth-of-type(1) {
  width: 8px;
  height: 8px;
  right: 13px;
  bottom: 14px;
}

.welcome-mark i:nth-of-type(2) {
  width: 4px;
  height: 4px;
  right: 23px;
  bottom: 10px;
  background: white;
}

.welcome h1 {
  margin: 0;
  font-size: clamp(2.05rem, 4vw, 3.15rem);
  font-weight: 660;
  letter-spacing: -.055em;
  line-height: 1.08;
}

.welcome > p {
  margin: 13px 0 34px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.suggestions {
  display: grid;
  width: min(100%, 680px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.suggestion {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  min-height: 68px;
  padding: 10px 15px;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  box-shadow: 0 3px 14px rgba(46, 58, 98, .025);
  cursor: pointer;
  text-align: left;
  transition: border-color .25s ease, background-color .25s ease, box-shadow .25s ease, transform .25s var(--ease);
}

.suggestion:hover {
  border-color: color-mix(in srgb, var(--primary) 22%, var(--line));
  background: var(--surface-solid);
  box-shadow: 0 12px 30px rgba(47, 60, 112, .08);
  transform: translateY(-2px);
}

.suggestion-symbol {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 11px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: .8rem;
  font-weight: 750;
}

.suggestion:nth-child(2) .suggestion-symbol {
  background: color-mix(in srgb, var(--cyan) 13%, transparent);
  color: var(--cyan);
}

.suggestion:nth-child(3) .suggestion-symbol {
  background: color-mix(in srgb, var(--violet) 12%, transparent);
  color: var(--violet);
  font-size: .75rem;
}

.suggestion:nth-child(4) .suggestion-symbol {
  background: color-mix(in srgb, var(--green) 12%, transparent);
  color: var(--green);
}

.suggestion > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.suggestion strong {
  overflow: hidden;
  font-size: .875rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion small {
  overflow: hidden;
  color: var(--muted);
  font-size: .75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message {
  display: grid;
  width: 100%;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 15px;
  padding: 19px 0;
  animation: messageIn .38s var(--ease) both;
}

.message-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 13px 13px 13px 7px;
  background: linear-gradient(145deg, var(--primary), var(--violet) 58%, var(--cyan));
  color: white;
  box-shadow: 0 7px 17px rgba(82, 93, 227, .18);
  font-size: .8rem;
  font-weight: 740;
}

.message.user {
  grid-template-columns: minmax(0, 1fr) 38px;
}

.message.user .message-avatar {
  grid-column: 2;
  grid-row: 1;
  border-radius: 50%;
  background: var(--primary-soft);
  box-shadow: none;
  color: var(--primary);
}

.message-content {
  min-width: 0;
  padding-top: 1px;
}

.message.user .message-content {
  display: flex;
  grid-column: 1;
  grid-row: 1;
  justify-content: flex-end;
}

.message-content p {
  margin: 6px 0;
  font-size: 1rem;
  line-height: 1.68;
}

.message.user .message-content p {
  max-width: min(86%, 620px);
  margin: 0;
  padding: 11px 16px;
  border: 1px solid color-mix(in srgb, var(--primary) 12%, transparent);
  border-radius: 19px 19px 5px 19px;
  background: var(--primary-soft);
  line-height: 1.55;
}

.message-name {
  display: block;
  margin-bottom: 4px;
  font-size: .77rem;
  font-weight: 700;
}

.message-actions {
  display: flex;
  margin-top: 8px;
  gap: 2px;
  opacity: 0;
  transition: opacity .2s ease;
}

.message:hover .message-actions {
  opacity: 1;
}

.message-action {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
}

.message-action:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.message-action svg {
  width: 15px;
  height: 15px;
}

.typing {
  display: flex;
  align-items: center;
  height: 28px;
  gap: 4px;
}

.typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  animation: typing 1.15s infinite ease-in-out;
}

.typing i:nth-child(2) {
  animation-delay: .14s;
}

.typing i:nth-child(3) {
  animation-delay: .28s;
}

.composer-zone {
  position: relative;
  z-index: 6;
  width: 100%;
  padding: 8px max(24px, calc((100% - 820px) / 2)) 18px;
  background: linear-gradient(0deg, var(--bg) 72%, transparent);
}

.composer {
  position: relative;
  padding: 13px 13px 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface-solid) 90%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.composer:focus-within {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--line));
  box-shadow: 0 24px 68px rgba(47, 59, 117, .13), 0 0 0 4px color-mix(in srgb, var(--primary) 7%, transparent);
}

.composer textarea {
  display: block;
  width: 100%;
  min-height: 31px;
  max-height: 160px;
  resize: none;
  overflow-y: auto;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.55;
}

.composer textarea::placeholder {
  color: var(--faint);
}

.composer-tools {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 7px;
}

.composer-left {
  display: flex;
  align-items: center;
  gap: 5px;
}

.composer-icon,
.mode-button {
  display: inline-flex;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}

.composer-icon {
  width: 34px;
  padding: 0;
}

.composer-icon:hover,
.mode-button:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.composer-icon svg {
  width: 18px;
  height: 18px;
}

.mode-button {
  padding: 0 9px;
  gap: 6px;
  font-size: .75rem;
  font-weight: 630;
}

.mode-button svg {
  width: 13px;
  height: 13px;
}

.mode-spark {
  color: var(--primary);
  font-size: .75rem;
}

.send-button {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(145deg, var(--primary), var(--primary-strong));
  box-shadow: 0 7px 17px color-mix(in srgb, var(--primary) 24%, transparent);
  color: white;
  cursor: pointer;
  transition: opacity .2s ease, transform .2s ease, box-shadow .2s ease;
}

.send-button:hover:not(:disabled) {
  box-shadow: 0 9px 22px color-mix(in srgb, var(--primary) 34%, transparent);
  transform: translateY(-1px);
}

.send-button:active:not(:disabled) {
  transform: scale(.94);
}

.send-button:disabled {
  box-shadow: none;
  cursor: default;
  opacity: .34;
}

.send-button svg {
  width: 18px;
  height: 18px;
}

.composer-note {
  margin: 9px 0 0;
  color: var(--faint);
  font-size: .75rem;
  text-align: center;
}

.settings-panel {
  position: fixed;
  z-index: 60;
  top: 0;
  right: 0;
  width: min(390px, 92vw);
  height: 100dvh;
  padding: 27px 24px;
  border-left: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-solid) 94%, transparent);
  box-shadow: -30px 0 80px rgba(29, 38, 74, .13);
  backdrop-filter: blur(30px);
  transform: translateX(104%);
  transition: transform .42s var(--ease);
}

.settings-panel.open {
  transform: translateX(0);
}

.settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 36px;
}

.settings-head p {
  margin: 1px 0 5px;
  color: var(--primary);
  font-size: .75rem;
  font-weight: 740;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.settings-head h2 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 680;
  letter-spacing: -.035em;
}

.setting-block {
  margin-bottom: 28px;
}

.setting-block > label,
.setting-line label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 650;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--bg);
}

.segmented button {
  height: 38px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: .875rem;
  font-weight: 630;
}

.segmented button.active {
  background: var(--surface-solid);
  box-shadow: 0 3px 12px rgba(34, 45, 80, .08);
  color: var(--text);
}

.setting-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.setting-line label {
  margin: 0;
}

.setting-line output {
  color: var(--primary);
  font-size: .75rem;
  font-weight: 680;
}

.range-block input {
  width: 100%;
  height: 5px;
  margin: 18px 0 8px;
  appearance: none;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--primary) 0 45%, var(--line-strong) 45% 100%);
}

.range-block input::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  appearance: none;
  border: 3px solid var(--surface-solid);
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(44, 54, 110, .24);
  cursor: pointer;
}

.range-block input::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 3px solid var(--surface-solid);
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(44, 54, 110, .24);
  cursor: pointer;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  color: var(--faint);
  font-size: .75rem;
}

.switch-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  gap: 15px;
}

.switch-line > span {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.switch-line strong {
  font-size: .84rem;
}

.switch-line small {
  color: var(--muted);
  font-size: .75rem;
}

.switch {
  position: relative;
  width: 43px;
  height: 25px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: var(--line-strong);
  cursor: pointer;
  transition: background-color .2s ease;
}

.switch i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 6px rgba(20, 28, 55, .18);
  transition: transform .25s var(--ease);
}

.switch.active {
  background: var(--primary);
}

.switch.active i {
  transform: translateX(18px);
}

.info-block {
  display: flex;
  padding: 16px;
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--green) 20%, var(--line));
  border-radius: 17px;
  background: color-mix(in srgb, var(--green) 6%, var(--surface));
}

.info-block .server-icon {
  border-color: color-mix(in srgb, var(--green) 18%, transparent);
  background: color-mix(in srgb, var(--green) 12%, transparent);
  color: var(--green);
}

.info-block strong {
  font-size: .81rem;
}

.info-block p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.55;
}

.panel-scrim,
.sidebar-scrim {
  position: fixed;
  z-index: 50;
  inset: 0;
  visibility: hidden;
  background: rgba(7, 10, 20, .28);
  opacity: 0;
  backdrop-filter: blur(3px);
  transition: opacity .3s ease, visibility .3s ease;
}

.panel-scrim.open,
.sidebar-scrim.open {
  visibility: visible;
  opacity: 1;
}

.mode-menu {
  position: fixed;
  z-index: 45;
  width: 220px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-solid);
  box-shadow: var(--shadow);
  animation: pop .2s var(--ease);
}

.mode-menu[hidden] {
  display: none;
}

.mode-menu button {
  display: flex;
  width: 100%;
  padding: 10px 11px;
  flex-direction: column;
  gap: 3px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.mode-menu button:hover,
.mode-menu button.active {
  background: var(--surface-hover);
}

.mode-menu button span {
  font-size: .76rem;
  font-weight: 650;
}

.mode-menu button small {
  color: var(--muted);
  font-size: .75rem;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-solid);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: .75rem;
  font-weight: 570;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .25s ease, transform .25s var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@keyframes welcomeIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes messageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pop {
  from { opacity: 0; transform: translateY(7px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes popCenter {
  from { opacity: 0; transform: translateX(-50%) translateY(7px) scale(.98); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: .34; }
  30% { transform: translateY(-4px); opacity: 1; }
}

@media (max-width: 960px) {
  :root {
    --sidebar-width: 266px;
  }

  .suggestions {
    width: min(100%, 620px);
  }
}

@media (max-width: 800px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(310px, 88vw);
    box-shadow: 30px 0 70px rgba(20, 28, 55, .18);
    transform: translateX(-104%);
    transition: transform .4s var(--ease);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-scrim {
    z-index: 19;
  }

  .sidebar-close {
    display: grid;
    margin-left: auto;
  }

  .main-panel {
    height: 100dvh;
  }

  .topbar {
    grid-template-columns: 42px 1fr auto;
    height: 68px;
    padding: 0 13px;
  }

  .menu-button {
    display: grid;
    grid-column: 1;
  }

  .model-wrap {
    grid-column: 2;
    justify-self: center;
  }

  .model-button {
    min-width: 0;
  }

  .model-button small,
  .online-pill {
    display: none;
  }

  .topbar-actions {
    grid-column: 3;
  }

  .chat-feed,
  .composer-zone {
    padding-right: 18px;
    padding-left: 18px;
  }

  .sidebar-scrim.open {
    visibility: visible;
    opacity: 1;
  }
}

@media (max-width: 590px) {
  .topbar {
    height: 62px;
  }

  .model-button {
    padding: 6px 8px;
    gap: 7px;
  }

  .model-orb {
    width: 28px;
    height: 28px;
  }

  .model-button strong {
    font-size: .76rem;
  }

  .model-popover {
    width: min(286px, calc(100vw - 28px));
  }

  .chat-feed {
    padding: 8px 14px 22px;
  }

  .welcome {
    justify-content: flex-start;
    padding-top: clamp(54px, 13vh, 102px);
    padding-bottom: 30px;
  }

  .welcome-mark {
    width: 58px;
    height: 58px;
    margin-bottom: 20px;
    border-radius: 21px 21px 21px 11px;
  }

  .welcome-mark span {
    font-size: 26px;
  }

  .welcome h1 {
    font-size: 2rem;
  }

  .welcome > p {
    margin: 10px 0 25px;
    font-size: .89rem;
  }

  .suggestions {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .suggestion {
    min-height: 58px;
    border-radius: 16px;
  }

  .suggestion:nth-child(n+4) {
    display: none;
  }

  .composer-zone {
    padding: 7px 11px 10px;
  }

  .composer {
    padding: 11px 10px 9px 15px;
    border-radius: 21px;
  }

  .composer-note {
    margin-top: 7px;
    font-size: .75rem;
  }

  .message {
    grid-template-columns: 33px minmax(0, 1fr);
    gap: 11px;
    padding: 15px 0;
  }

  .message.user {
    grid-template-columns: minmax(0, 1fr) 33px;
  }

  .message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 11px 11px 11px 6px;
  }

  .message-content p {
    font-size: 1rem;
  }
}

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

/* Complete the interactive prototype without implying a live connection. */
[hidden] { display: none !important; }
.history-item { grid-template-columns: 20px minmax(0, 1fr); }
.history-empty.visible { display: block; }
.status-dot { background: #b18644; border-color: #b1864433; box-shadow: 0 0 0 3px #b1864414; }
.brand-row { padding: 0 1px; }
.demo-badge { margin-left: 5px; padding: 3px 4px; letter-spacing: 0; }
.model-size { margin-left: 4px; font-size: .75rem; color: var(--muted); font-weight: 600; }
.model-button small, .model-option small { line-height: 1.4; }
.detail-note { margin: 9px 0 0; font-size: .75rem; color: var(--muted); line-height: 1.5; }
.server-details { width: 100%; padding: 14px 12px; }
.server-details div { gap: 8px; }
.server-copy small { line-height: 1.6; }
.online-pill { white-space: nowrap; }
.new-chat, .history-search input, .server-copy strong, .mode-button, .switch-line strong,
.mode-menu button span, .setting-label, .setting-line label, .model-option strong,
.setting-block > label { font-size: .875rem; }
.setting-label { color: var(--muted); margin: 0 0 10px; font-weight: 650; }
.suggestion strong, .suggestion small { white-space: normal; overflow: visible; line-height: 1.45; }
.message-content p { white-space: pre-wrap; overflow-wrap: anywhere; }
.message-name small { margin-left: 8px; color: var(--muted); font-size: .75rem; font-weight: 400; }
.message-actions { opacity: .75; }
.message-action { width: 36px; height: 36px; }
.message:focus-within .message-actions { opacity: 1; }
.composer-icon:disabled { opacity: .42; cursor: not-allowed; }
.stop-symbol { width: 12px; height: 12px; border-radius: 3px; background: currentColor; }
.settings-panel { margin: 0 0 0 auto; left: auto; bottom: auto; max-height: 100dvh; max-width: 100vw; overflow: auto; color: var(--text); border: 0; border-left: 1px solid var(--line); }
.settings-panel::backdrop { background: rgba(7,10,20,.28); backdrop-filter: blur(3px); }
.noscript-message { position: fixed; z-index: 110; bottom: 20px; left: 20px; right: 20px; padding: 16px; background: var(--surface-solid); border: 1px solid var(--line); border-radius: 16px; }
.composer-zone { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
.toast { max-width: calc(100vw - 44px); }
@media (max-width: 1080px) and (min-width: 801px) {
  .online-pill { display: none; }
}
@media (max-width: 800px) {
  .topbar { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .model-wrap { max-width: 100%; }
  .model-button { max-width: 100%; }
  .model-popover { position: fixed; top: 68px; left: 50%; }
  .sidebar-close { flex: 0 0 38px; }
}
@media (max-width: 590px) {
  .welcome > p { font-size: 1rem; }
  .model-button strong { font-size: .875rem; white-space: nowrap; }
  .composer-note { font-size: .75rem; line-height: 1.5; padding: 0 5px; }
  .suggestion { padding: 12px 15px; }
  .chat-feed { scroll-padding-bottom: 18px; }
  .composer-zone { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) {
  .model-orb { display: none; }
  .topbar { padding: 0 8px; }
  .topbar-actions { gap: 0; }
}
@media (max-height: 650px) {
  .welcome { padding-top: 24px; padding-bottom: 24px; }
  .welcome-mark { width: 48px; height: 48px; margin-bottom: 16px; border-radius: 17px 17px 17px 8px; }
  .welcome-mark span { font-size: 24px; }
}
