:root {
  --bg: #060a12;
  --bg-soft: #0a101c;
  --panel: rgba(12, 19, 31, 0.82);
  --panel-solid: #0d1522;
  --panel-raised: #111c2b;
  --line: rgba(173, 203, 224, 0.11);
  --line-strong: rgba(173, 203, 224, 0.18);
  --text: #eef5f5;
  --text-soft: #a7b6bf;
  --text-dim: #6f808b;
  --mint: #73e5c1;
  --mint-bright: #9af5d8;
  --mint-ink: #041b16;
  --blue: #7297ff;
  --danger: #ff7e7e;
  --warning: #f4c66e;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --font-sans: "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei",
    "Noto Sans CJK SC", sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Code", "JetBrains Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 48% -20%, rgba(54, 115, 122, 0.24), transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(48, 75, 143, 0.13), transparent 40%),
    var(--bg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
}

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

button {
  color: inherit;
}

svg {
  display: block;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.11;
  pointer-events: none;
}

.ambient-a {
  top: -190px;
  left: 18%;
  background: #59e7c2;
}

.ambient-b {
  right: -180px;
  bottom: -180px;
  background: #6385ff;
}

.app-shell {
  display: grid;
  grid-template-columns: 278px minmax(0, 1fr);
  gap: 14px;
  width: 100%;
  height: 100dvh;
  padding: 14px;
}

.sidebar,
.chat-shell {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 21px 16px 17px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(18, 31, 43, 0.74), rgba(8, 14, 23, 0.78)),
    var(--panel);
  border-radius: var(--radius-xl);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

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

.brand-mark {
  display: grid;
  width: 37px;
  height: 37px;
  color: var(--mint);
  place-items: center;
  background: linear-gradient(145deg, rgba(115, 229, 193, 0.18), rgba(115, 229, 193, 0.04));
  border: 1px solid rgba(115, 229, 193, 0.26);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 5px 20px rgba(35, 181, 145, 0.1);
}

.brand-mark svg {
  width: 27px;
  height: 27px;
  stroke-width: 2.25;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-copy strong {
  font-size: 15px;
  font-weight: 680;
  letter-spacing: -0.02em;
}

.brand-copy small {
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.125em;
  text-transform: uppercase;
}

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

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--text-soft);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: 160ms ease;
  place-items: center;
}

.icon-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--line-strong);
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.new-chat-button {
  display: flex;
  align-items: center;
  width: 100%;
  height: 49px;
  padding: 0 12px;
  margin-top: 25px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 620;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(115, 229, 193, 0.14), rgba(115, 229, 193, 0.06));
  border: 1px solid rgba(115, 229, 193, 0.25);
  border-radius: 14px;
  transition: 180ms ease;
}

.new-chat-button:hover {
  background: linear-gradient(135deg, rgba(115, 229, 193, 0.2), rgba(115, 229, 193, 0.08));
  border-color: rgba(115, 229, 193, 0.38);
  transform: translateY(-1px);
}

.new-chat-icon {
  display: grid;
  width: 27px;
  height: 27px;
  margin-right: 10px;
  color: var(--mint);
  background: rgba(115, 229, 193, 0.11);
  border-radius: 8px;
  place-items: center;
}

.new-chat-icon svg {
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

.new-chat-button kbd {
  padding: 3px 6px;
  margin-left: auto;
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.history-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  margin-top: 25px;
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 9px;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.history-count {
  display: grid;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  font-size: 9px;
  letter-spacing: 0;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  place-items: center;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}

.history-list::-webkit-scrollbar {
  display: none;
}

.history-item {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 38px;
  padding: 7px 34px 7px 10px;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  transition: 150ms ease;
}

.history-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

.history-item.active {
  color: var(--text);
  background: rgba(115, 229, 193, 0.075);
  border-color: rgba(115, 229, 193, 0.13);
}

.history-item-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item::before {
  width: 5px;
  height: 5px;
  margin-right: 9px;
  content: "";
  background: var(--text-dim);
  border-radius: 50%;
  flex: 0 0 auto;
}

.history-item.active::before {
  background: var(--mint);
  box-shadow: 0 0 8px rgba(115, 229, 193, 0.7);
}

.delete-chat {
  position: absolute;
  top: 50%;
  right: 7px;
  display: grid;
  width: 22px;
  height: 22px;
  padding: 0;
  color: var(--text-dim);
  cursor: pointer;
  visibility: hidden;
  background: rgba(7, 12, 20, 0.8);
  border: 0;
  border-radius: 6px;
  opacity: 0;
  transform: translateY(-50%);
  transition: 140ms ease;
  place-items: center;
}

.history-item:hover .delete-chat,
.history-item:focus-within .delete-chat {
  visibility: visible;
  opacity: 1;
}

.delete-chat:hover {
  color: var(--danger);
  background: rgba(255, 126, 126, 0.09);
}

.delete-chat svg {
  width: 12px;
  height: 12px;
}

.history-empty {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  padding: 34px 18px;
  color: var(--text-dim);
  text-align: center;
}

.history-empty[hidden] {
  display: none;
}

.history-empty-icon {
  display: grid;
  width: 38px;
  height: 38px;
  color: #536974;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 12px;
  place-items: center;
}

.history-empty-icon svg {
  width: 19px;
  height: 19px;
}

.history-empty p {
  max-width: 135px;
  margin: 0;
  font-size: 11px;
  line-height: 1.65;
}

.sidebar-foot {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.model-mini-card {
  display: flex;
  align-items: center;
  padding: 10px 8px;
}

.model-mini-icon {
  display: grid;
  width: 34px;
  height: 34px;
  margin-right: 10px;
  color: var(--mint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: -0.04em;
  background:
    linear-gradient(145deg, rgba(115, 229, 193, 0.15), rgba(114, 151, 255, 0.08)),
    rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(115, 229, 193, 0.19);
  border-radius: 10px;
  place-items: center;
}

.model-mini-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.model-mini-copy strong {
  font-size: 12px;
  font-weight: 650;
}

.model-mini-copy span {
  color: var(--text-dim);
  font-size: 10px;
}

.online-dot {
  width: 6px;
  height: 6px;
  margin-left: auto;
  background: var(--mint);
  border-radius: 50%;
  box-shadow: 0 0 9px rgba(115, 229, 193, 0.7);
}

.model-link {
  display: flex;
  align-items: center;
  padding: 8px;
  color: var(--text-dim);
  font-size: 10.5px;
  text-decoration: none;
  transition: color 150ms ease;
}

.model-link:hover {
  color: var(--mint);
}

.model-link svg {
  width: 12px;
  height: 12px;
  margin-left: auto;
}

.sidebar-scrim {
  display: none;
}

.chat-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(13, 22, 34, 0.74), rgba(7, 12, 20, 0.82)),
    var(--panel);
  border-radius: var(--radius-xl);
}

.chat-header {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 0 25px;
  background: rgba(8, 13, 22, 0.44);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-main {
  display: flex;
  align-items: center;
  min-width: 0;
}

.model-identity {
  display: flex;
  align-items: center;
  min-width: 0;
}

.model-avatar {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  margin-right: 11px;
  overflow: visible;
  color: var(--mint-bright);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 255, 255, 0.14), transparent 38%),
    linear-gradient(145deg, #183e38, #132131 74%);
  border: 1px solid rgba(115, 229, 193, 0.24);
  border-radius: 13px;
  box-shadow: 0 6px 24px rgba(24, 86, 73, 0.24);
  place-items: center;
}

.model-avatar i {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 10px;
  height: 10px;
  background: var(--mint);
  border: 2px solid #0a111c;
  border-radius: 50%;
}

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

.title-line {
  display: flex;
  gap: 7px;
  align-items: center;
}

.title-line h1 {
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  font-weight: 670;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-chip {
  padding: 2px 6px;
  color: var(--mint);
  font-size: 8.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
  background: rgba(115, 229, 193, 0.09);
  border: 1px solid rgba(115, 229, 193, 0.15);
  border-radius: 5px;
}

.model-title p {
  display: flex;
  gap: 5px;
  align-items: center;
  margin: 3px 0 0;
  color: var(--text-dim);
  font-size: 9.5px;
  font-weight: 530;
  letter-spacing: 0.025em;
}

.live-dot {
  width: 5px;
  height: 5px;
  background: var(--mint);
  border-radius: 50%;
  box-shadow: 0 0 7px rgba(115, 229, 193, 0.65);
}

.title-divider {
  color: #3f4f59;
}

.vision-label {
  color: #8399a4;
}

.header-actions {
  display: flex;
  gap: 9px;
  align-items: center;
}

.token-status {
  display: flex;
  gap: 7px;
  align-items: center;
  height: 34px;
  padding: 0 11px;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: 160ms ease;
}

.token-status:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.token-status-dot {
  width: 6px;
  height: 6px;
  background: var(--warning);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(244, 198, 110, 0.5);
}

.token-status.configured .token-status-dot {
  background: var(--mint);
  box-shadow: 0 0 8px rgba(115, 229, 193, 0.6);
}

.settings-button {
  color: #a5b4bd;
  background: rgba(255, 255, 255, 0.025);
}

.messages {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
  scrollbar-width: thin;
}

.messages::-webkit-scrollbar {
  width: 8px;
}

.messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.09);
  border: 2px solid transparent;
  border-radius: 10px;
  background-clip: padding-box;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(840px, calc(100% - 48px));
  min-height: 100%;
  padding: 50px 0 26px;
  margin: 0 auto;
  text-align: center;
  animation: enter 650ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.empty-state[hidden] {
  display: none;
}

.hero-orb {
  position: relative;
  display: grid;
  width: 88px;
  height: 88px;
  margin-bottom: 24px;
  place-items: center;
}

.orb-core {
  position: relative;
  z-index: 2;
  display: grid;
  width: 61px;
  height: 61px;
  color: var(--mint-bright);
  background:
    radial-gradient(circle at 34% 23%, rgba(255, 255, 255, 0.14), transparent 36%),
    linear-gradient(145deg, rgba(30, 92, 79, 0.98), rgba(13, 27, 40, 0.98));
  border: 1px solid rgba(115, 229, 193, 0.36);
  border-radius: 20px;
  box-shadow:
    0 0 42px rgba(73, 220, 180, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transform: rotate(-4deg);
  place-items: center;
}

.orb-coresvg,
.orb-core svg {
  width: 39px;
  height: 39px;
  stroke-width: 2.1;
}

.orb-ring {
  position: absolute;
  border: 1px solid rgba(115, 229, 193, 0.13);
  border-radius: 50%;
}

.ring-one {
  width: 78px;
  height: 78px;
  border-right-color: rgba(115, 229, 193, 0.4);
  animation: spin 12s linear infinite;
}

.ring-two {
  width: 91px;
  height: 91px;
  border-top-color: rgba(114, 151, 255, 0.28);
  border-left-color: rgba(114, 151, 255, 0.12);
  animation: spin 18s linear infinite reverse;
}

.hero-kicker {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 13px;
  color: var(--mint);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.2em;
}

.hero-kicker span {
  width: 17px;
  height: 1px;
  background: var(--mint);
}

.empty-state h2 {
  max-width: 650px;
  margin: 0;
  font-size: clamp(30px, 3.5vw, 42px);
  font-weight: 680;
  letter-spacing: -0.055em;
  line-height: 1.16;
  background: linear-gradient(180deg, #f6fbfa, #b8c8c8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  max-width: 590px;
  margin: 15px 0 0;
  color: #84959f;
  font-size: 12.5px;
  line-height: 1.8;
}

.suggestion-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 690px;
  margin-top: 32px;
}

.suggestion-card {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 19px;
  gap: 11px;
  align-items: center;
  min-height: 72px;
  padding: 12px 15px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.016)),
    rgba(9, 16, 26, 0.55);
  border: 1px solid var(--line);
  border-radius: 15px;
  transition: 180ms ease;
}

.suggestion-card:hover {
  background:
    linear-gradient(130deg, rgba(115, 229, 193, 0.065), rgba(255, 255, 255, 0.018)),
    rgba(9, 16, 26, 0.65);
  border-color: rgba(115, 229, 193, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

.suggestion-icon {
  display: grid;
  width: 36px;
  height: 36px;
  border: 1px solid;
  border-radius: 11px;
  place-items: center;
}

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

.icon-code {
  color: #92aaff;
  background: rgba(114, 151, 255, 0.08);
  border-color: rgba(114, 151, 255, 0.15);
}

.icon-eye {
  color: #7ee0c5;
  background: rgba(115, 229, 193, 0.07);
  border-color: rgba(115, 229, 193, 0.14);
}

.icon-bulb {
  color: #f2ca7a;
  background: rgba(244, 198, 110, 0.07);
  border-color: rgba(244, 198, 110, 0.14);
}

.icon-chart {
  color: #dc9eff;
  background: rgba(211, 139, 255, 0.07);
  border-color: rgba(211, 139, 255, 0.14);
}

.suggestion-card > span:nth-child(2) {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.suggestion-card strong {
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 620;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-card small {
  overflow: hidden;
  color: var(--text-dim);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-arrow {
  width: 15px;
  height: 15px;
  color: #52636d;
  transition: 160ms ease;
}

.suggestion-card:hover .suggestion-arrow {
  color: var(--mint);
  transform: translateX(2px);
}

.message-list {
  width: min(880px, calc(100% - 48px));
  padding: 26px 0 96px;
  margin: 0 auto;
}

.message {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 17px 0;
  animation: messageIn 350ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.message + .message {
  border-top: 1px solid rgba(173, 203, 224, 0.045);
}

.message-avatar {
  display: grid;
  width: 31px;
  height: 31px;
  color: var(--mint);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(145deg, rgba(115, 229, 193, 0.13), rgba(114, 151, 255, 0.06));
  border: 1px solid rgba(115, 229, 193, 0.18);
  border-radius: 10px;
  flex: 0 0 auto;
  place-items: center;
}

.message.user .message-avatar {
  color: #c6d2ff;
  background: linear-gradient(145deg, rgba(114, 151, 255, 0.14), rgba(114, 151, 255, 0.04));
  border-color: rgba(114, 151, 255, 0.17);
}

.message-body {
  min-width: 0;
  max-width: calc(100% - 43px);
  flex: 1;
}

.message-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  height: 20px;
  margin-bottom: 6px;
}

.message-author {
  font-size: 11.5px;
  font-weight: 670;
  letter-spacing: -0.01em;
}

.message-time {
  color: #52636d;
  font-size: 9px;
}

.message-content {
  color: #cfdadc;
  font-size: 13.5px;
  line-height: 1.82;
  overflow-wrap: anywhere;
}

.message.user .message-content {
  display: inline-block;
  padding: 11px 15px;
  white-space: pre-wrap;
  color: #dce7e8;
  background: rgba(113, 150, 255, 0.075);
  border: 1px solid rgba(113, 150, 255, 0.11);
  border-radius: 5px 14px 14px 14px;
}

.message.error .message-content {
  padding: 11px 14px;
  color: #ffc1c1;
  background: rgba(255, 126, 126, 0.06);
  border: 1px solid rgba(255, 126, 126, 0.14);
  border-radius: 10px;
}

.message-content:empty {
  display: none;
}

.message-content > :first-child {
  margin-top: 0;
}

.message-content > :last-child {
  margin-bottom: 0;
}

.message-content p {
  margin: 0 0 0.85em;
}

.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4 {
  margin: 1.35em 0 0.55em;
  color: #eff7f7;
  font-weight: 660;
  letter-spacing: -0.025em;
  line-height: 1.35;
}

.message-content h1 {
  font-size: 1.55em;
}

.message-content h2 {
  font-size: 1.28em;
}

.message-content h3 {
  font-size: 1.1em;
}

.message-content ul,
.message-content ol {
  padding-left: 1.35em;
  margin: 0.55em 0 0.9em;
}

.message-content li {
  margin: 0.25em 0;
}

.message-content li::marker {
  color: var(--mint);
}

.message-content strong {
  color: #f0f7f7;
  font-weight: 650;
}

.message-content em {
  color: #cad8dc;
}

.message-content a {
  color: var(--mint);
  text-decoration: underline;
  text-decoration-color: rgba(115, 229, 193, 0.3);
  text-underline-offset: 3px;
}

.message-content a:hover {
  text-decoration-color: var(--mint);
}

.message-content blockquote {
  padding: 4px 0 4px 13px;
  margin: 0.8em 0;
  color: #a2b3b8;
  border-left: 2px solid rgba(115, 229, 193, 0.45);
}

.message-content code:not(pre code) {
  padding: 0.16em 0.42em;
  color: #a9f0dc;
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(115, 229, 193, 0.075);
  border: 1px solid rgba(115, 229, 193, 0.09);
  border-radius: 5px;
}

.message-content hr {
  margin: 1.4em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.message-content table {
  width: 100%;
  margin: 1em 0;
  font-size: 0.9em;
  border-spacing: 0;
  border-collapse: separate;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.message-content th,
.message-content td {
  padding: 8px 10px;
  text-align: left;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.message-content th {
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

.message-content th:last-child,
.message-content td:last-child {
  border-right: 0;
}

.message-content tr:last-child td {
  border-bottom: 0;
}

.code-block {
  margin: 12px 0;
  overflow: hidden;
  background: #070d16;
  border: 1px solid rgba(173, 203, 224, 0.12);
  border-radius: 12px;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding: 0 7px 0 13px;
  color: #6f858e;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid rgba(173, 203, 224, 0.08);
}

.copy-code {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 4px 7px;
  color: #738892;
  font-family: var(--font-sans);
  font-size: 9px;
  letter-spacing: 0;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 5px;
  transition: 140ms ease;
}

.copy-code:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.copy-code svg {
  width: 11px;
  height: 11px;
}

.code-block pre {
  padding: 15px;
  margin: 0;
  overflow-x: auto;
  color: #c6d5d8;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.72;
  tab-size: 2;
  scrollbar-width: thin;
}

.message-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.message-images:empty {
  display: none;
}

.message-image {
  position: relative;
  width: 130px;
  height: 98px;
  overflow: hidden;
  cursor: zoom-in;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.message-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.message-image:hover img {
  transform: scale(1.035);
}

.message-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  min-height: 0;
  margin-top: 7px;
  color: #53646d;
  font-size: 9px;
}

.message-footer:empty {
  display: none;
}

.message-actions {
  display: flex;
  gap: 3px;
  align-items: center;
  opacity: 0;
  transition: opacity 150ms ease;
}

.message:hover .message-actions,
.message-actions:focus-within {
  opacity: 1;
}

.message-action {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px 6px;
  color: #61737d;
  font-size: 9px;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 5px;
}

.message-action:hover {
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.04);
}

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

.usage-label {
  color: #50616a;
}

.error-label {
  color: #da8585;
}

.reasoning-panel {
  margin: 0 0 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.018);
  border: 1px solid rgba(173, 203, 224, 0.075);
  border-radius: 10px;
}

.reasoning-panel[hidden] {
  display: none;
}

.reasoning-panel summary {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 8px 11px;
  color: #778a92;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.reasoning-panel summary::-webkit-details-marker {
  display: none;
}

.reasoning-panel summary svg {
  width: 12px;
  height: 12px;
  margin-left: auto;
  transition: transform 160ms ease;
}

.reasoning-panel[open] summary svg {
  transform: rotate(180deg);
}

.reasoning-spark {
  width: 6px;
  height: 6px;
  background: var(--mint);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(115, 229, 193, 0.55);
}

.reasoning-content {
  max-height: 320px;
  padding: 0 12px 11px;
  overflow-y: auto;
  color: #74858d;
  font-size: 10.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  scrollbar-width: thin;
}

.typing-cursor {
  display: inline-block;
  width: 5px;
  height: 14px;
  margin-left: 3px;
  vertical-align: -2px;
  background: var(--mint);
  border-radius: 2px;
  animation: blink 0.9s steps(2, start) infinite;
}

.typing-placeholder {
  display: flex;
  gap: 5px;
  align-items: center;
  height: 30px;
}

.typing-placeholder i {
  width: 5px;
  height: 5px;
  background: #637b82;
  border-radius: 50%;
  animation: bounce 1.2s ease-in-out infinite;
}

.typing-placeholder i:nth-child(2) {
  animation-delay: 120ms;
}

.typing-placeholder i:nth-child(3) {
  animation-delay: 240ms;
}

.composer-wrap {
  position: relative;
  z-index: 3;
  padding: 0 24px 13px;
  background: linear-gradient(180deg, transparent, rgba(7, 12, 20, 0.94) 22%);
}

.composer-shell {
  width: min(880px, 100%);
  padding: 7px;
  margin: 0 auto;
  background:
    linear-gradient(145deg, rgba(22, 34, 47, 0.92), rgba(12, 20, 31, 0.95));
  border: 1px solid rgba(173, 203, 224, 0.16);
  border-radius: 19px;
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.27),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.composer-shell:focus-within {
  border-color: rgba(115, 229, 193, 0.3);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.3),
    0 0 0 3px rgba(115, 229, 193, 0.035),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.attachment-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 7px 9px;
}

.attachment-strip[hidden] {
  display: none;
}

.attachment-item {
  position: relative;
  width: 62px;
  height: 62px;
  overflow: hidden;
  background: #0a111b;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
}

.attachment-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.remove-attachment {
  position: absolute;
  top: 3px;
  right: 3px;
  display: grid;
  width: 17px;
  height: 17px;
  padding: 0;
  color: white;
  cursor: pointer;
  background: rgba(5, 9, 14, 0.78);
  border: 0;
  border-radius: 50%;
  place-items: center;
  backdrop-filter: blur(4px);
}

.remove-attachment svg {
  width: 9px;
  height: 9px;
  stroke-width: 2.2;
}

.composer {
  display: flex;
  flex-direction: column;
}

.composer-top {
  padding: 5px 8px 0;
}

.composer textarea {
  display: block;
  width: 100%;
  max-height: 190px;
  min-height: 36px;
  padding: 7px 3px;
  overflow-y: auto;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.55;
  resize: none;
  background: transparent;
  border: 0;
  outline: 0;
  scrollbar-width: thin;
}

.composer textarea::placeholder {
  color: #63757e;
}

.composer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  padding: 1px 2px 0 4px;
}

.composer-tools {
  display: flex;
  gap: 7px;
  align-items: center;
}

.tool-button {
  display: grid;
  width: 29px;
  height: 29px;
  padding: 0;
  color: #82959d;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 8px;
  transition: 150ms ease;
  place-items: center;
}

.tool-button:hover {
  color: var(--mint);
  background: rgba(115, 229, 193, 0.07);
}

.tool-button svg {
  width: 17px;
  height: 17px;
}

.tool-divider {
  width: 1px;
  height: 13px;
  background: var(--line);
}

.composer-model {
  color: #788b94;
  font-size: 9px;
  font-weight: 600;
}

.composer-capability {
  padding: 2px 5px;
  color: #4f646d;
  font-size: 7.5px;
  font-weight: 750;
  letter-spacing: 0.07em;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(173, 203, 224, 0.08);
  border-radius: 4px;
}

.send-area {
  display: flex;
  gap: 9px;
  align-items: center;
}

.keyboard-hint {
  color: #4d5e67;
  font-size: 8.5px;
}

.send-button {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--mint-ink);
  cursor: pointer;
  background: linear-gradient(145deg, var(--mint-bright), #63d4b1);
  border: 0;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(66, 211, 170, 0.16);
  transition: 160ms ease;
  place-items: center;
}

.send-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(66, 211, 170, 0.24);
}

.send-button:disabled {
  color: #51636b;
  cursor: default;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
}

.send-button svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
}

.send-button .stop-icon,
.send-button.generating .send-icon {
  display: none;
}

.send-button.generating .stop-icon {
  display: block;
  width: 15px;
  height: 15px;
  fill: currentColor;
  stroke: none;
}

.send-button.generating {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
}

.disclaimer {
  margin: 8px auto 0;
  color: #43555e;
  font-size: 8.5px;
  text-align: center;
  letter-spacing: 0.01em;
}

.settings-dialog {
  width: min(670px, calc(100vw - 30px));
  max-height: min(820px, calc(100dvh - 30px));
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(19, 31, 46, 0.98), rgba(10, 17, 27, 0.99));
  border: 1px solid rgba(173, 203, 224, 0.17);
  border-radius: 23px;
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.65);
}

.settings-dialog::backdrop {
  background: rgba(2, 5, 9, 0.72);
  backdrop-filter: blur(8px);
}

.settings-dialog[open] {
  animation: dialogIn 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.dialog-glow {
  position: absolute;
  top: -170px;
  right: -120px;
  width: 330px;
  height: 330px;
  pointer-events: none;
  background: rgba(74, 205, 168, 0.11);
  border-radius: 50%;
  filter: blur(90px);
}

.dialog-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 26px 20px;
  border-bottom: 1px solid var(--line);
}

.dialog-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--mint);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.19em;
}

.dialog-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 670;
  letter-spacing: -0.04em;
}

.settings-dialog form {
  padding: 0 26px 24px;
}

.settings-section {
  padding: 21px 0;
  border-bottom: 1px solid var(--line);
}

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

.settings-section h3 {
  margin: 0;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.settings-section-head p {
  margin: 4px 0 0;
  color: var(--text-dim);
  font-size: 10px;
  line-height: 1.5;
}

.server-key-badge {
  flex: 0 0 auto;
  padding: 4px 7px;
  color: var(--mint);
  font-size: 8.5px;
  font-weight: 650;
  background: rgba(115, 229, 193, 0.07);
  border: 1px solid rgba(115, 229, 193, 0.13);
  border-radius: 6px;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: #9babb3;
  font-size: 10px;
  font-weight: 600;
}

.secret-input {
  position: relative;
}

.secret-input input,
.settings-textarea,
.select-field select {
  width: 100%;
  color: var(--text);
  background: rgba(5, 10, 17, 0.48);
  border: 1px solid var(--line);
  outline: 0;
  transition: 150ms ease;
}

.secret-input input {
  height: 43px;
  padding: 0 42px 0 13px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  border-radius: 11px;
}

.secret-input input:focus,
.settings-textarea:focus,
.select-field select:focus {
  border-color: rgba(115, 229, 193, 0.32);
  box-shadow: 0 0 0 3px rgba(115, 229, 193, 0.04);
}

.secret-input input::placeholder,
.settings-textarea::placeholder {
  color: #4e6069;
}

.secret-input button {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  width: 31px;
  height: 31px;
  padding: 0;
  color: #61737c;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 7px;
  transform: translateY(-50%);
  place-items: center;
}

.secret-input button:hover {
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.04);
}

.secret-input button svg {
  width: 16px;
  height: 16px;
}

.secret-input .eye-closed,
.secret-input.revealed .eye-open {
  display: none;
}

.secret-input.revealed .eye-closed {
  display: block;
}

.field-help {
  margin: 9px 0 0;
  color: #60717a;
  font-size: 9.5px;
  line-height: 1.65;
}

.field-help code {
  padding: 1px 3px;
  color: #8fb6ac;
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: rgba(115, 229, 193, 0.05);
  border-radius: 3px;
}

.field-help a {
  color: #72bda7;
  text-decoration: none;
}

.field-help.compact {
  margin-top: 7px;
}

.settings-textarea {
  padding: 11px 13px;
  font-size: 11.5px;
  line-height: 1.65;
  resize: vertical;
  border-radius: 11px;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.field-row output {
  color: var(--mint);
  font-family: var(--font-mono);
  font-size: 10px;
}

input[type="range"] {
  width: 100%;
  height: 4px;
  margin: 13px 0 6px;
  accent-color: var(--mint);
  background: var(--line);
  border-radius: 5px;
  outline: 0;
  appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  cursor: pointer;
  background: var(--mint);
  border: 3px solid #122a25;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(115, 229, 193, 0.32);
  appearance: none;
}

input[type="range"]::-moz-range-thumb {
  width: 9px;
  height: 9px;
  cursor: pointer;
  background: var(--mint);
  border: 3px solid #122a25;
  border-radius: 50%;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  color: #4e6069;
  font-size: 8.5px;
}

.select-field select {
  height: 39px;
  padding: 0 35px 0 11px;
  font-size: 11px;
  cursor: pointer;
  border-radius: 10px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #6c7f87 50%),
    linear-gradient(135deg, #6c7f87 50%, transparent 50%);
  background-position:
    calc(100% - 15px) 17px,
    calc(100% - 11px) 17px;
  background-repeat: no-repeat;
  background-size: 4px 4px, 4px 4px;
}

.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 22px;
}

.dialog-action-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.text-button,
.secondary-button,
.primary-button {
  height: 37px;
  padding: 0 14px;
  font-size: 10px;
  font-weight: 620;
  cursor: pointer;
  border-radius: 9px;
  transition: 150ms ease;
}

.text-button {
  padding-left: 2px;
  color: #63757e;
  background: transparent;
  border: 0;
}

.text-button:hover {
  color: var(--text-soft);
}

.secondary-button {
  color: #9fb0b7;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
}

.secondary-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.primary-button {
  min-width: 94px;
  color: var(--mint-ink);
  background: linear-gradient(145deg, var(--mint-bright), #62d4b0);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 6px 20px rgba(65, 207, 167, 0.13);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(65, 207, 167, 0.2);
}

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  z-index: 100;
  max-width: min(420px, calc(100vw - 30px));
  padding: 10px 14px;
  color: var(--text);
  font-size: 11px;
  line-height: 1.5;
  pointer-events: none;
  visibility: hidden;
  background: rgba(20, 33, 45, 0.96);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: 180ms ease;
}

.toast.visible {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  color: #ffd2d2;
  border-color: rgba(255, 126, 126, 0.2);
}

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

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

@keyframes dialogIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes bounce {
  0%,
  60%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@media (max-width: 1000px) {
  .app-shell {
    grid-template-columns: 246px minmax(0, 1fr);
  }

  .suggestion-grid {
    max-width: 620px;
  }

  .token-status {
    width: 34px;
    padding: 0;
    justify-content: center;
  }

  .token-status span:last-child {
    display: none;
  }
}

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

  .sidebar {
    position: fixed;
    top: 8px;
    bottom: 8px;
    left: 8px;
    z-index: 30;
    width: min(286px, calc(100vw - 40px));
    transform: translateX(calc(-100% - 18px));
    transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
  }

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

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 29;
    display: block;
    visibility: hidden;
    background: rgba(2, 5, 9, 0.62);
    opacity: 0;
    transition: 200ms ease;
    backdrop-filter: blur(3px);
  }

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

  .sidebar-close,
  .menu-button {
    display: grid !important;
  }

  .menu-button {
    width: 34px;
    height: 34px;
    margin-right: 10px;
  }

  .chat-shell {
    height: 100%;
  }

  .message-list {
    width: min(880px, calc(100% - 30px));
  }

  .empty-state {
    width: calc(100% - 32px);
  }

  .composer-wrap {
    padding-right: 13px;
    padding-left: 13px;
  }
}

@media (max-width: 600px) {
  .app-shell {
    padding: 0;
  }

  .chat-shell {
    border: 0;
    border-radius: 0;
  }

  .chat-header {
    min-height: 66px;
    padding: 0 13px;
  }

  .model-avatar {
    width: 35px;
    height: 35px;
    margin-right: 9px;
    border-radius: 11px;
  }

  .title-line h1 {
    max-width: 160px;
    font-size: 13.5px;
  }

  .model-title p {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .title-divider,
  .vision-label {
    display: none;
  }

  .model-chip {
    display: none;
  }

  .settings-button {
    width: 34px;
    height: 34px;
  }

  .token-status {
    width: 32px;
    height: 32px;
  }

  .empty-state {
    width: calc(100% - 30px);
    padding-top: 36px;
  }

  .hero-orb {
    margin-bottom: 19px;
    transform: scale(0.9);
  }

  .empty-state h2 {
    font-size: 29px;
  }

  .hero-subtitle {
    font-size: 11.5px;
  }

  .suggestion-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 24px;
  }

  .suggestion-card {
    min-height: 62px;
  }

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

  .message-list {
    width: calc(100% - 20px);
    padding-top: 12px;
    padding-bottom: 80px;
  }

  .message {
    gap: 9px;
    padding: 14px 2px;
  }

  .message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 9px;
  }

  .message-body {
    max-width: calc(100% - 37px);
  }

  .message-content {
    font-size: 13px;
    line-height: 1.76;
  }

  .composer-wrap {
    padding: 0 9px 8px;
  }

  .composer-shell {
    border-radius: 17px;
  }

  .keyboard-hint,
  .composer-capability,
  .tool-divider {
    display: none;
  }

  .disclaimer {
    display: none;
  }

  .dialog-head {
    padding: 21px 19px 17px;
  }

  .settings-dialog form {
    padding: 0 19px 20px;
  }

  .settings-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .dialog-actions {
    align-items: flex-end;
  }

  .dialog-action-right {
    flex-direction: column;
    align-items: stretch;
  }

  .text-button {
    align-self: flex-start;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }
}

@media (max-height: 700px) and (min-width: 601px) {
  .hero-orb {
    width: 70px;
    height: 70px;
    margin-bottom: 16px;
    transform: scale(0.88);
  }

  .empty-state h2 {
    font-size: 33px;
  }

  .hero-subtitle {
    margin-top: 10px;
  }

  .suggestion-grid {
    margin-top: 21px;
  }

  .suggestion-card {
    min-height: 62px;
  }
}

@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;
  }
}
