:root {
  color-scheme: dark;
  --font-sans: "SF Pro Text", "SF Pro", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
  --rail-width: 58px;
  --sidebar-width: 244px;
  --topbar-height: 54px;
  --mobile-safe-top: env(safe-area-inset-top, 0px);
}

.theme-liquid-black {
  --c-bg: 8 11 15;
  --c-panel: 22 27 34;
  --c-card: 24 30 38;
  --c-border: 109 127 149;
  --c-fg: 235 241 247;
  --c-sub: 174 188 205;
  --c-dim: 119 133 150;
  --c-accent: 68 190 255;
  --c-accent-fg: 4 17 27;
  --c-ok: 85 208 154;
  --c-warn: 236 182 83;
  --c-err: 236 97 104;
  --liquid-window: 8 11 15;
  --liquid-surface: 27 33 42;
  --liquid-rail: 15 20 27;
  --liquid-fill: 34 41 52;
  --liquid-line: 132 151 174;
  --liquid-shine: 255 255 255;
  --liquid-shadow: 0 0 0;
  --liquid-blur: 28px;
  --liquid-saturate: 158%;
  --liquid-alpha: 1;
}

.theme-liquid-white {
  color-scheme: light;
  --c-bg: 238 241 246;
  --c-panel: 255 255 255;
  --c-card: 255 255 255;
  --c-border: 170 180 194;
  --c-fg: 24 31 40;
  --c-sub: 76 87 103;
  --c-dim: 116 126 140;
  --c-accent: 33 119 255;
  --c-accent-fg: 255 255 255;
  --c-ok: 35 164 113;
  --c-warn: 179 121 25;
  --c-err: 208 62 72;
  --liquid-window: 238 241 246;
  --liquid-surface: 255 255 255;
  --liquid-rail: 255 255 255;
  --liquid-fill: 255 255 255;
  --liquid-line: 145 158 176;
  --liquid-shine: 255 255 255;
  --liquid-shadow: 61 76 94;
  --liquid-blur: 28px;
  --liquid-saturate: 158%;
  --liquid-alpha: 0.92;
}

.theme-liquid-gray {
  --c-bg: 16 18 21;
  --c-panel: 34 37 42;
  --c-card: 38 42 48;
  --c-border: 124 135 150;
  --c-fg: 232 236 241;
  --c-sub: 178 187 198;
  --c-dim: 126 136 148;
  --c-accent: 83 129 180;
  --c-accent-fg: 255 255 255;
  --c-ok: 104 197 154;
  --c-warn: 218 169 87;
  --c-err: 225 95 105;
  --liquid-window: 16 18 21;
  --liquid-surface: 38 42 48;
  --liquid-rail: 28 31 36;
  --liquid-fill: 47 52 60;
  --liquid-line: 137 148 162;
  --liquid-shine: 255 255 255;
  --liquid-shadow: 0 0 0;
  --liquid-blur: 28px;
  --liquid-saturate: 150%;
  --liquid-alpha: 1;
}

.theme-liquid-sage {
  --c-bg: 12 18 17;
  --c-panel: 28 39 37;
  --c-card: 31 45 42;
  --c-border: 105 143 135;
  --c-fg: 232 241 237;
  --c-sub: 174 199 192;
  --c-dim: 119 150 143;
  --c-accent: 28 139 124;
  --c-accent-fg: 246 255 252;
  --c-ok: 102 205 151;
  --c-warn: 224 178 87;
  --c-err: 224 91 102;
  --liquid-window: 12 18 17;
  --liquid-surface: 31 45 42;
  --liquid-rail: 23 33 31;
  --liquid-fill: 41 58 54;
  --liquid-line: 118 154 146;
  --liquid-shine: 244 255 251;
  --liquid-shadow: 0 0 0;
  --liquid-blur: 28px;
  --liquid-saturate: 150%;
  --liquid-alpha: 1;
}

.theme-liquid-coral {
  --c-bg: 23 15 17;
  --c-panel: 45 31 34;
  --c-card: 52 35 39;
  --c-border: 154 114 120;
  --c-fg: 247 235 236;
  --c-sub: 211 180 184;
  --c-dim: 158 124 129;
  --c-accent: 224 89 102;
  --c-accent-fg: 255 249 250;
  --c-ok: 102 201 153;
  --c-warn: 238 180 82;
  --c-err: 245 95 102;
  --liquid-window: 23 15 17;
  --liquid-surface: 52 35 39;
  --liquid-rail: 37 24 27;
  --liquid-fill: 63 42 47;
  --liquid-line: 169 126 133;
  --liquid-shine: 255 246 247;
  --liquid-shadow: 0 0 0;
  --liquid-blur: 28px;
  --liquid-saturate: 150%;
  --liquid-alpha: 1;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  overflow: hidden;
  background:
    linear-gradient(135deg, rgb(var(--c-bg)), rgb(var(--liquid-surface) / 0.58) 52%, rgb(var(--c-bg))),
    rgb(var(--c-bg));
  color: rgb(var(--c-fg));
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 450;
  letter-spacing: 0;
}

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

button {
  color: inherit;
}

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

.app-shell {
  min-height: 100vh;
}

.top-bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  height: var(--topbar-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 18px 0 78px;
  border-bottom: 1px solid rgb(var(--liquid-line) / calc(0.36 * var(--liquid-alpha)));
  background:
    linear-gradient(145deg, rgb(var(--liquid-fill) / calc(0.40 * var(--liquid-alpha))), rgb(var(--liquid-fill) / calc(0.18 * var(--liquid-alpha)))),
    linear-gradient(28deg, rgb(var(--c-accent) / 0.06), transparent 42%, rgb(var(--liquid-shine) / calc(0.10 * var(--liquid-alpha))));
  box-shadow: 0 1px 0 rgb(var(--liquid-shine) / calc(0.58 * var(--liquid-alpha))) inset;
  backdrop-filter: blur(var(--liquid-blur)) saturate(var(--liquid-saturate));
  -webkit-backdrop-filter: blur(var(--liquid-blur)) saturate(var(--liquid-saturate));
  user-select: none;
}

.traffic-lights {
  position: absolute;
  left: 16px;
  top: 50%;
  display: flex;
  gap: 8px;
  transform: translateY(-50%);
}

.traffic {
  width: 12px;
  height: 12px;
  padding: 0;
  border: 1px solid rgb(0 0 0 / 0.10);
  border-radius: 50%;
  cursor: pointer;
}

.traffic.close {
  background: #ff5f57;
}

.traffic.minimize {
  background: #ffbd2e;
}

.traffic.zoom {
  background: #28c840;
}

.top-context,
.user-chip,
.nav-item,
.btn,
.web-toggle,
.icon-btn,
.model-row,
.conversation-item,
.status-card,
.attachment-chip {
  border: 1px solid rgb(var(--liquid-line) / calc(0.24 * var(--liquid-alpha)));
  background: rgb(var(--liquid-fill) / calc(0.16 * var(--liquid-alpha)));
  box-shadow: 0 1px 0 rgb(var(--liquid-shine) / calc(0.24 * var(--liquid-alpha))) inset;
  backdrop-filter: blur(20px) saturate(148%);
  -webkit-backdrop-filter: blur(20px) saturate(148%);
}

.top-context,
.user-chip {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 28px;
  padding: 0 11px;
  border-radius: 14px;
  color: rgb(var(--c-sub));
}

.top-context strong,
.brand-lockup strong {
  color: rgb(var(--c-fg));
}

.brand-lockup {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: rgb(var(--c-accent-fg));
  background: rgb(var(--c-accent));
  font-size: 12px;
  font-weight: 750;
}

.brand-lockup span {
  display: block;
  margin-top: 1px;
  color: rgb(var(--c-dim));
  font-size: 10px;
}

.user-chip {
  justify-self: end;
  gap: 9px;
  min-width: 138px;
  justify-content: flex-start;
  text-align: left;
  cursor: pointer;
}

.user-chip span:last-child {
  display: grid;
  gap: 1px;
  line-height: 1.1;
}

.user-chip small {
  color: rgb(var(--c-dim));
  font-size: 10px;
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgb(var(--c-accent)), rgb(var(--c-ok))),
    rgb(var(--c-accent));
  color: rgb(var(--c-accent-fg));
  font-size: 11px;
  font-weight: 750;
}

.app-rail {
  position: fixed;
  z-index: 9;
  inset: var(--topbar-height) auto 0 0;
  width: var(--rail-width);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px;
  border-right: 1px solid rgb(var(--liquid-line) / calc(0.30 * var(--liquid-alpha)));
  background: rgb(var(--liquid-rail) / calc(0.54 * var(--liquid-alpha)));
  backdrop-filter: blur(28px) saturate(158%);
  -webkit-backdrop-filter: blur(28px) saturate(158%);
}

.rail-item,
.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: rgb(var(--c-sub));
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, transform 140ms ease, border-color 160ms ease;
}

.rail-note {
  height: 42px;
  gap: 2px;
}

.rail-note small {
  color: currentColor;
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
}

.rail-item:hover,
.icon-btn:hover,
.rail-item.is-active,
.icon-btn.send-btn {
  border-color: rgb(var(--c-accent) / 0.42);
  background: rgb(var(--c-accent) / 0.14);
  color: rgb(var(--c-fg));
}

.rail-item:active,
.icon-btn:active,
.btn:active {
  transform: scale(0.98);
}

.traffic:active {
  transform: translateY(1px);
}

.rail-settings {
  margin-top: auto;
}

.context-sidebar {
  position: fixed;
  z-index: 8;
  inset: var(--topbar-height) auto 0 var(--rail-width);
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px 12px;
  border-right: 1px solid rgb(var(--liquid-line) / calc(0.34 * var(--liquid-alpha)));
  background:
    linear-gradient(145deg, rgb(var(--liquid-fill) / calc(0.30 * var(--liquid-alpha))), rgb(var(--liquid-fill) / calc(0.14 * var(--liquid-alpha)))),
    rgb(var(--liquid-surface) / calc(0.34 * var(--liquid-alpha)));
  backdrop-filter: blur(28px) saturate(158%);
  -webkit-backdrop-filter: blur(28px) saturate(158%);
}

.sidebar-section {
  display: grid;
  gap: 8px;
}

.eyebrow {
  margin: 0;
  color: rgb(var(--c-dim));
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  color: rgb(var(--c-sub));
  text-align: left;
  cursor: pointer;
}

.nav-note-mobile {
  display: none;
}

.nav-item.is-active {
  color: rgb(var(--c-fg));
  border-color: rgb(var(--c-accent) / 0.46);
  background: rgb(var(--c-accent) / 0.15);
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 999px;
  background: rgb(var(--c-accent));
}

.model-list {
  display: grid;
  gap: 8px;
}

.mobile-model-section {
  display: none;
}

.model-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border-radius: 9px;
  color: rgb(var(--c-sub));
  text-align: left;
  cursor: pointer;
}

.model-row strong {
  overflow: hidden;
  color: rgb(var(--c-fg));
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-row span {
  color: rgb(var(--c-dim));
  font-size: 10px;
}

.model-row .model-tags {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
}

.model-row .model-tags em {
  border-radius: 999px;
  background: rgb(var(--c-accent) / 0.13);
  color: rgb(var(--c-accent));
  font-size: 9px;
  font-style: normal;
  font-weight: 760;
  line-height: 1;
  padding: 4px 6px;
  white-space: nowrap;
}

.model-row.is-active {
  color: rgb(var(--c-fg));
  border-color: rgb(var(--c-accent) / 0.32);
  background: rgb(var(--c-accent) / 0.09);
}

.sidebar-footer {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.balance-panel {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgb(var(--liquid-line) / calc(0.46 * var(--liquid-alpha)));
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgb(var(--c-panel) / calc(0.50 * var(--liquid-alpha))), rgb(var(--c-card) / calc(0.28 * var(--liquid-alpha)))),
    linear-gradient(30deg, rgb(var(--c-accent) / 0.06), transparent 54%);
  box-shadow:
    0 1px 0 rgb(var(--liquid-shine) / calc(0.44 * var(--liquid-alpha))) inset,
    0 10px 24px rgb(var(--liquid-shadow) / 0.08);
  backdrop-filter: blur(28px) saturate(158%);
  -webkit-backdrop-filter: blur(28px) saturate(158%);
}

.balance-panel.mobile-balance-panel {
  display: none;
}

.balance-head,
.balance-main,
.balance-row,
.balance-head-right {
  display: flex;
  align-items: center;
  min-width: 0;
}

.balance-head,
.balance-row {
  justify-content: space-between;
  gap: 8px;
}

.balance-label {
  color: rgb(var(--c-sub));
  font-size: 12px;
  font-weight: 650;
}

.balance-head-right {
  justify-content: flex-end;
  gap: 6px;
}

.balance-head-right strong {
  max-width: 92px;
  overflow: hidden;
  padding: 2px 6px;
  border: 1px solid rgb(var(--c-accent) / 0.22);
  border-radius: 7px;
  background: rgb(var(--c-accent) / 0.10);
  color: rgb(var(--c-accent));
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-icon-btn {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgb(var(--c-border) / 0.24);
  border-radius: 7px;
  background: rgb(var(--c-panel) / 0.24);
  color: rgb(var(--c-sub));
  cursor: pointer;
}

.mini-icon-btn:hover {
  border-color: rgb(var(--c-accent) / 0.38);
  color: rgb(var(--c-fg));
}

.mini-icon-btn svg {
  width: 13px;
  height: 13px;
}

.balance-main {
  justify-content: space-between;
  gap: 10px;
  margin-top: 1px;
}

.balance-main span {
  color: rgb(var(--c-dim));
  font-size: 10px;
  font-weight: 650;
}

.balance-main strong {
  min-width: 0;
  overflow: hidden;
  color: rgb(var(--c-fg));
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.balance-row {
  min-height: 15px;
  line-height: 1.2;
}

.balance-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.balance-row span:last-child {
  text-align: right;
}

.dim {
  color: rgb(var(--c-dim));
  font-size: 11px;
}

.meter {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(var(--c-border) / 0.18);
}

.balance-meter {
  height: 5px;
  margin-top: 1px;
  background: rgb(var(--c-border) / 0.30);
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgb(var(--c-accent)), rgb(var(--c-ok)));
  transition: width 260ms ease;
}

.balance-source {
  min-width: 0;
  overflow: hidden;
  color: rgb(var(--c-dim));
  font-size: 10px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-swatches {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 1px;
}

.swatch {
  position: relative;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.swatch::before {
  content: "";
  width: 20px;
  height: 20px;
  border: 1px solid rgb(var(--c-border) / 0.42);
  border-radius: inherit;
  box-shadow: 0 1px 2px rgb(var(--liquid-shadow) / 0.10);
}

.swatch.is-active::before {
  box-shadow:
    0 0 0 2px rgb(var(--liquid-fill) / calc(0.58 * var(--liquid-alpha))),
    0 0 0 3px rgb(var(--c-accent) / 0.76),
    0 1px 2px rgb(var(--liquid-shadow) / 0.10);
}

.swatch[data-theme="black"]::before { background: #111820; }
.swatch[data-theme="white"]::before { background: #f4f7fb; }
.swatch[data-theme="gray"]::before { background: #3a414a; }
.swatch[data-theme="sage"]::before { background: #1c8b7c; }
.swatch[data-theme="coral"]::before { background: #e05966; }

.shell-content {
  height: 100vh;
  padding: calc(var(--topbar-height) + 16px) 18px 18px calc(var(--rail-width) + var(--sidebar-width) + 18px);
  overflow: hidden;
}

.auth-status {
  min-height: 36px;
  padding: 9px 10px;
  border: 1px solid rgb(var(--c-border) / 0.30);
  border-radius: 9px;
  background: rgb(var(--c-panel) / 0.28);
  color: rgb(var(--c-sub));
  font-size: 12px;
  line-height: 1.35;
}

.route-status {
  min-height: 30px;
  padding: 7px 10px;
  border: 1px solid rgb(var(--c-border) / 0.22);
  border-radius: 9px;
  background: rgb(var(--c-panel) / 0.20);
  color: rgb(var(--c-dim));
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.35;
}

.key-sync-state {
  min-height: 30px;
  padding: 7px 10px;
  border: 1px solid rgb(var(--c-border) / 0.22);
  border-radius: 9px;
  background: rgb(var(--c-panel) / 0.18);
  color: rgb(var(--c-dim));
  font-size: 11px;
  line-height: 1.35;
}

.auth-status[data-tone="ok"] {
  color: rgb(var(--c-ok));
}

.auth-status[data-tone="warn"] {
  color: rgb(var(--c-warn));
}

.settings-notice[data-tone="ok"] {
  color: rgb(var(--c-ok));
}

.settings-notice[data-tone="warn"] {
  color: rgb(var(--c-warn));
}

body.is-locked .llm-page {
  opacity: 0.42;
  filter: blur(2px);
  pointer-events: none;
}

.login-overlay {
  position: fixed;
  z-index: 24;
  inset: var(--topbar-height) 0 0 calc(var(--rail-width) + var(--sidebar-width));
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
}

.login-overlay[hidden],
.settings-backdrop[hidden],
.settings-sheet[hidden] {
  display: none;
}

.login-card {
  display: grid;
  gap: 14px;
  width: min(430px, 100%);
  padding: 22px;
  border-radius: 20px;
  pointer-events: auto;
}

.login-card h2 {
  font-size: 22px;
}

.login-subtitle {
  margin: 8px 0 0;
  color: rgb(var(--c-sub));
  line-height: 1.5;
}

.login-form,
.settings-form {
  display: grid;
  gap: 12px;
}

.settings-backdrop {
  position: fixed;
  z-index: 38;
  inset: 0;
  background: rgb(var(--c-bg) / 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.settings-sheet {
  position: fixed;
  z-index: 39;
  top: calc(var(--topbar-height) + 12px);
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(440px, calc(100vw - 28px));
  padding: 16px;
  overflow: auto;
  border-radius: 20px;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-header .icon-btn span {
  transform: rotate(45deg);
}

.settings-notice {
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid rgb(var(--c-border) / 0.26);
  border-radius: 10px;
  background: rgb(var(--c-panel) / 0.24);
  color: rgb(var(--c-sub));
  font-size: 12px;
  line-height: 1.4;
}

.settings-group {
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgb(var(--c-border) / 0.28);
  border-radius: 14px;
  background: rgb(var(--c-panel) / 0.20);
}

details.settings-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

details.settings-group > summary::-webkit-details-marker {
  display: none;
}

details.settings-group > summary em {
  color: rgb(var(--c-dim));
  font-size: 11px;
  font-style: normal;
}

.settings-group-title {
  display: grid;
  gap: 3px;
}

.settings-group-title strong,
details.settings-group summary strong {
  color: rgb(var(--c-fg));
  font-size: 14px;
}

.settings-status-grid {
  display: grid;
  gap: 8px;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-dialog-backdrop[hidden] {
  display: none;
}

.app-dialog-backdrop {
  position: fixed;
  z-index: 42;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgb(var(--c-bg) / 0.24);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}

.app-dialog {
  width: min(360px, 100%);
  padding: 18px;
}

.app-dialog form {
  display: grid;
  gap: 14px;
}

.app-dialog h2 {
  margin-top: -8px;
}

.app-dialog-copy {
  margin: 0;
  color: rgb(var(--c-sub));
  font-size: 12px;
  line-height: 1.55;
}

.app-dialog-actions {
  justify-content: flex-end;
}

.llm-page {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(440px, 1fr) minmax(260px, 320px);
  gap: 14px;
  width: min(100%, 1620px);
  height: calc(100vh - var(--topbar-height) - 34px);
  min-height: 0;
  margin: 0 auto;
  overflow: hidden;
  transition: grid-template-columns 180ms ease;
}

.llm-page.is-conversations-collapsed {
  grid-template-columns: 58px minmax(440px, 1fr) minmax(260px, 320px);
}

.llm-page.is-inspector-collapsed {
  grid-template-columns: minmax(220px, 280px) minmax(440px, 1fr) 58px;
}

.llm-page.is-conversations-collapsed.is-inspector-collapsed {
  grid-template-columns: 58px minmax(440px, 1fr) 58px;
}

.card {
  border: 1px solid rgb(var(--liquid-line) / calc(0.44 * var(--liquid-alpha)));
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgb(var(--liquid-fill) / calc(0.34 * var(--liquid-alpha))), rgb(var(--liquid-fill) / calc(0.16 * var(--liquid-alpha)))),
    linear-gradient(28deg, rgb(var(--c-accent) / 0.045), transparent 48%, rgb(var(--liquid-shine) / calc(0.10 * var(--liquid-alpha))));
  box-shadow: 0 1px 0 rgb(var(--liquid-shine) / calc(0.58 * var(--liquid-alpha))) inset, 0 16px 42px rgb(var(--liquid-shadow) / 0.055);
  backdrop-filter: blur(34px) saturate(162%);
  -webkit-backdrop-filter: blur(34px) saturate(162%);
}

.conversation-panel,
.chat-panel,
.inspector-panel {
  height: 100%;
  min-height: 0;
}

.conversation-panel,
.inspector-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  overflow: hidden;
}

.panel-header,
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.side-panel.is-collapsed {
  padding: 10px;
}

.side-panel.is-collapsed .panel-header {
  justify-content: center;
}

.side-panel.is-collapsed .panel-header > div,
.side-panel.is-collapsed #newConversation,
.side-panel.is-collapsed > :not(.panel-header) {
  display: none;
}

h1,
h2 {
  margin: 4px 0 0;
  letter-spacing: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.16;
}

h2 {
  font-size: 15px;
}

.search-wrap {
  position: relative;
}

.search-wrap span {
  position: absolute;
  left: 10px;
  top: 50%;
  color: rgb(var(--c-dim));
  transform: translateY(-50%);
}

.input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgb(var(--c-border) / 0.40);
  border-radius: 8px;
  background: rgb(var(--c-panel) / 0.32);
  color: rgb(var(--c-fg));
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.input:focus {
  border-color: rgb(var(--c-accent) / 0.78);
  box-shadow: 0 0 0 3px rgb(var(--c-accent) / 0.16);
}

.search-wrap .input {
  height: 34px;
  padding: 0 10px 0 33px;
}

.conversation-list {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.conversation-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  height: 56px;
  min-height: 56px;
  padding: 8px 9px;
  border-radius: 10px;
  color: rgb(var(--c-sub));
  text-align: left;
}

.conversation-open {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.conversation-open > span {
  min-width: 0;
}

.conversation-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.conversation-action {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgb(var(--liquid-line) / calc(0.30 * var(--liquid-alpha)));
  border-radius: 8px;
  background: rgb(var(--liquid-fill) / calc(0.18 * var(--liquid-alpha)));
  color: rgb(var(--c-dim));
  cursor: pointer;
}

.conversation-action:hover {
  border-color: rgb(var(--c-accent) / 0.44);
  color: rgb(var(--c-fg));
  background: rgb(var(--c-accent) / 0.10);
}

.conversation-action svg {
  width: 13px;
  height: 13px;
}

.conversation-item strong,
.conversation-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-item strong {
  color: rgb(var(--c-fg));
  font-size: 13px;
}

.conversation-item small,
.conversation-item em {
  color: rgb(var(--c-dim));
  font-size: 11px;
  font-style: normal;
}

.conversation-item em {
  justify-self: end;
  max-width: 58px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-item.is-active {
  border-color: rgb(var(--c-accent) / 0.54);
  background: rgb(var(--c-accent) / 0.12);
}

.panel-empty {
  padding: 12px;
  border: 1px dashed rgb(var(--liquid-line) / calc(0.34 * var(--liquid-alpha)));
  border-radius: 10px;
  color: rgb(var(--c-dim));
  font-size: 12px;
  line-height: 1.55;
}

.library-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  border-radius: 10px;
  color: rgb(var(--c-sub));
}

.library-open {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 62px;
  padding: 9px;
  border: 1px solid rgb(var(--liquid-line) / calc(0.34 * var(--liquid-alpha)));
  border-radius: 10px;
  background: rgb(var(--liquid-fill) / calc(0.16 * var(--liquid-alpha)));
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.library-open strong,
.library-open small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.library-open strong {
  color: rgb(var(--c-fg));
  font-size: 13px;
  white-space: nowrap;
}

.library-open small {
  display: -webkit-box;
  color: rgb(var(--c-dim));
  font-size: 11px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.library-item.is-active .library-open {
  border-color: rgb(var(--c-accent) / 0.52);
  background: rgb(var(--c-accent) / 0.12);
}

.library-action {
  flex: 0 0 auto;
}

.chat-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 16px;
  overflow: hidden;
}

.conversation-restore-tab {
  position: absolute;
  left: 0;
  top: 50%;
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 34px;
  min-height: 118px;
  padding: 9px 0;
  border: 1px solid rgb(var(--c-accent) / 0.34);
  border-left: 0;
  border-radius: 0 10px 10px 0;
  background:
    linear-gradient(145deg, rgb(var(--liquid-fill) / calc(0.46 * var(--liquid-alpha))), rgb(var(--liquid-fill) / calc(0.22 * var(--liquid-alpha)))),
    rgb(var(--c-accent) / 0.10);
  color: rgb(var(--c-fg));
  box-shadow:
    0 1px 0 rgb(var(--liquid-shine) / calc(0.40 * var(--liquid-alpha))) inset,
    0 10px 24px rgb(var(--liquid-shadow) / 0.08);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.1;
  writing-mode: vertical-rl;
  cursor: pointer;
  transform: translateY(-50%);
}

.conversation-restore-tab svg {
  width: 14px;
  height: 14px;
  transform: rotate(90deg);
}

.llm-page.is-conversations-collapsed .conversation-restore-tab {
  display: inline-flex;
}

.workspace-hero {
  min-height: 104px;
  margin: -1px -1px 0;
  padding: 18px;
  border: 1px solid rgb(var(--liquid-line) / calc(0.30 * var(--liquid-alpha)));
  border-radius: 13px;
  background:
    linear-gradient(112deg, rgb(var(--liquid-shine) / calc(0.30 * var(--liquid-alpha))), rgb(var(--liquid-fill) / calc(0.12 * var(--liquid-alpha))) 46%, rgb(var(--c-accent) / 0.10)),
    linear-gradient(180deg, rgb(var(--liquid-fill) / calc(0.20 * var(--liquid-alpha))), rgb(var(--liquid-fill) / calc(0.08 * var(--liquid-alpha))));
  box-shadow: 0 1px 0 rgb(var(--liquid-shine) / calc(0.74 * var(--liquid-alpha))) inset;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  color: rgb(var(--c-sub));
  font-size: 11px;
}

.hero-meta span {
  position: relative;
}

.hero-meta span + span::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 50%;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: rgb(var(--c-dim));
  transform: translateY(-50%);
}

.header-actions {
  display: flex;
  gap: 8px;
}

.btn.mobile-panel-toggle,
.btn.panel-restore-toggle,
.mobile-panel-backdrop {
  display: none;
}

.web-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgb(var(--liquid-line) / calc(0.30 * var(--liquid-alpha)));
  border-radius: 8px;
  background: rgb(var(--liquid-fill) / calc(0.16 * var(--liquid-alpha)));
  color: rgb(var(--c-sub));
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  user-select: none;
}

.web-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.web-toggle svg {
  width: 15px;
  height: 15px;
}

.web-toggle.is-active {
  border-color: rgb(var(--c-accent) / 0.58);
  background: rgb(var(--c-accent) / 0.14);
  color: rgb(var(--c-fg));
}

.web-toggle.is-disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  cursor: pointer;
}

.btn:disabled,
.icon-btn:disabled,
.input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn-primary {
  border-color: rgb(var(--c-accent) / 0.72);
  background: rgb(var(--c-accent));
  color: rgb(var(--c-accent-fg));
}

.btn-ghost {
  color: rgb(var(--c-sub));
}

.message-stream {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: 18px 2px 14px;
  overflow: auto;
}

.message {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  max-width: 820px;
}

.message.user {
  align-self: end;
  grid-template-columns: minmax(0, 1fr) 32px;
}

.message.user .avatar {
  grid-column: 2;
  grid-row: 1;
}

.message.user .message-body {
  grid-column: 1;
  grid-row: 1;
  background: rgb(var(--c-accent) / 0.16);
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgb(var(--c-accent) / 0.18);
  color: rgb(var(--c-fg));
  font-size: 12px;
  font-weight: 700;
}

.message-body {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgb(var(--c-border) / 0.34);
  border-radius: 12px;
  background: rgb(var(--c-panel) / 0.30);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.message-body p {
  margin: 0;
  color: rgb(var(--c-fg));
  line-height: 1.65;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.message-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-bottom: 7px;
  color: rgb(var(--c-dim));
  font-size: 10px;
  line-height: 1.2;
}

.message.user .message-meta {
  justify-content: flex-end;
}

.message-meta span,
.message-meta em {
  max-width: 100%;
  padding: 2px 6px;
  border: 1px solid rgb(var(--liquid-line) / calc(0.24 * var(--liquid-alpha)));
  border-radius: 999px;
  background: rgb(var(--liquid-fill) / calc(0.13 * var(--liquid-alpha)));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-meta em {
  color: rgb(var(--c-warn));
  font-style: normal;
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
}

.message-star,
.message-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0;
  border: 1px solid rgb(var(--liquid-line) / calc(0.34 * var(--liquid-alpha)));
  border-radius: 8px;
  background: rgb(var(--liquid-fill) / calc(0.18 * var(--liquid-alpha)));
  color: rgb(var(--c-dim));
  cursor: pointer;
}

.message-star {
  width: 28px;
}

.message-save {
  gap: 5px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 720;
}

.message-save svg,
.message-star svg {
  width: 14px;
  height: 14px;
}

.message-star:hover,
.message-star.is-active {
  border-color: rgb(var(--c-warn) / 0.56);
  background: rgb(var(--c-warn) / 0.14);
  color: rgb(var(--c-warn));
}

.message-save:hover {
  border-color: rgb(var(--c-accent) / 0.48);
  background: rgb(var(--c-accent) / 0.13);
  color: rgb(var(--c-fg));
}

.library-detail,
.notes-editor {
  display: grid;
  gap: 14px;
  width: min(780px, 100%);
  padding: 18px;
  border: 1px solid rgb(var(--liquid-line) / calc(0.34 * var(--liquid-alpha)));
  border-radius: 13px;
  background: rgb(var(--liquid-fill) / calc(0.16 * var(--liquid-alpha)));
}

.library-detail.empty-state {
  color: rgb(var(--c-sub));
}

.library-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.library-detail-head > div:first-child {
  flex: 1;
  min-width: 0;
}

.library-detail-head h2 {
  margin-top: 4px;
}

.library-title-input {
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: rgb(var(--c-fg));
  font: inherit;
  font-size: 20px;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.25;
}

.library-title-input:focus {
  outline: none;
}

.library-title-input:focus-visible {
  box-shadow: 0 2px 0 rgb(var(--c-accent) / 0.45);
}

.library-detail-head small {
  display: block;
  margin-top: 5px;
  color: rgb(var(--c-dim));
  font-size: 11px;
}

.library-detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.danger-action {
  border-color: rgb(var(--c-err) / 0.36);
  color: rgb(var(--c-err));
}

.danger-action:hover {
  border-color: rgb(var(--c-err) / 0.60);
  background: rgb(var(--c-err) / 0.12);
  color: rgb(var(--c-err));
}

.favorite-content {
  color: rgb(var(--c-fg));
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: normal;
}

.note-content-field {
  min-height: 0;
}

.note-content-input {
  min-height: 320px;
  padding: 11px 12px;
  line-height: 1.6;
  resize: none;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.web-source-card {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 9px;
  border: 1px solid rgb(var(--liquid-line) / calc(0.28 * var(--liquid-alpha)));
  border-radius: 10px;
  background: rgb(var(--liquid-fill) / calc(0.15 * var(--liquid-alpha)));
}

.web-source-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: rgb(var(--c-sub));
  font-size: 11px;
  line-height: 1.2;
}

.web-source-head span {
  display: inline-grid;
  place-items: center;
}

.web-source-head svg {
  width: 14px;
  height: 14px;
}

.web-source-head strong {
  color: rgb(var(--c-fg));
  font-size: 12px;
  font-weight: 720;
}

.web-source-head em {
  margin-left: auto;
  color: rgb(var(--c-dim));
  font-style: normal;
  white-space: nowrap;
}

.web-source-query {
  color: rgb(var(--c-dim));
  font-size: 10px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.web-source-list {
  display: grid;
  gap: 6px;
}

.web-source-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 4px 7px;
  padding: 7px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  background: rgb(var(--c-panel) / 0.24);
}

.web-source-row:hover {
  background: rgb(var(--c-panel) / 0.34);
}

.web-source-row span {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgb(var(--c-accent) / 0.18);
  color: rgb(var(--c-sub));
  font-size: 10px;
  font-weight: 720;
}

.web-source-row strong,
.web-source-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.web-source-row strong {
  color: rgb(var(--c-fg));
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.web-source-row small {
  display: -webkit-box;
  color: rgb(var(--c-dim));
  font-size: 10px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.message.is-streaming .message-body {
  border-color: rgb(var(--c-accent) / 0.44);
}

.message-image {
  display: block;
  width: min(260px, 100%);
  max-height: 220px;
  border: 1px solid rgb(var(--c-border) / 0.34);
  border-radius: 10px;
  object-fit: contain;
  background: rgb(var(--c-card) / 0.26);
}

.message-media {
  width: fit-content;
  max-width: min(320px, 100%);
  margin: 0 0 9px;
}

.message-media figcaption {
  margin-top: 5px;
  color: rgb(var(--c-dim));
  font-size: 10px;
  line-height: 1.2;
}

.image-placeholder {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 178px;
  aspect-ratio: 16 / 10;
  margin-bottom: 9px;
  padding: 12px;
  border: 1px solid rgb(var(--c-border) / 0.34);
  border-radius: 10px;
  background: rgb(var(--c-card) / 0.26);
  color: rgb(var(--c-sub));
}

.composer {
  display: grid;
  gap: 8px;
}

.composer.is-disabled {
  opacity: 0.78;
}

.composer.is-dragging {
  outline: 2px solid rgb(var(--c-accent) / 0.44);
  outline-offset: 4px;
  border-radius: var(--radius-panel);
}

.composer-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: end;
}

.composer.is-text-mode .composer-row {
  grid-template-columns: minmax(0, 1fr) 38px;
}

.composer-input-stack {
  display: grid;
  grid-column: 2;
  gap: 8px;
  min-width: 0;
}

.composer.is-text-mode .composer-input-stack {
  grid-column: 1;
}

.send-btn {
  grid-column: 3;
}

.composer.is-text-mode .send-btn {
  grid-column: 2;
}

.image-url-row {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 28px;
  gap: 7px;
  align-items: center;
}

.image-url-row > span {
  display: grid;
  place-items: center;
  color: rgb(var(--c-dim));
}

.image-url-row .mini-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.image-url-input {
  height: 32px;
  padding: 0 9px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.prompt-input {
  min-height: 76px;
  max-height: 180px;
  padding: 10px 12px;
  line-height: 1.5;
  resize: none;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}

.attachment-strip {
  min-height: 42px;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 38px;
  padding: 5px 8px 5px 5px;
  border-radius: 10px;
}

.attachment-chip img {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  object-fit: cover;
}

.attachment-chip span {
  max-width: 260px;
  overflow: hidden;
  color: rgb(var(--c-sub));
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-chip button {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgb(var(--c-border) / 0.18);
  color: rgb(var(--c-sub));
  cursor: pointer;
}

.field {
  display: grid;
  gap: 7px;
  color: rgb(var(--c-sub));
}

.field span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.field .input {
  height: 36px;
  padding: 0 10px;
}

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
}

.range-field input {
  width: 100%;
  accent-color: rgb(var(--c-accent));
}

.status-stack {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.status-card {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 9px 10px;
  border-radius: 10px;
  color: rgb(var(--c-dim));
}

.status-card strong {
  color: rgb(var(--c-sub));
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}

.quota-detail {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgb(var(--c-border) / 0.26);
  border-radius: 10px;
  background: rgb(var(--c-panel) / 0.18);
}

.quota-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: rgb(var(--c-dim));
  font-size: 11px;
}

.quota-detail-head strong {
  color: rgb(var(--c-sub));
  font-family: var(--font-mono);
  font-weight: 650;
}

.estimate-list {
  display: grid;
  gap: 6px;
  max-height: 190px;
  overflow: auto;
}

.estimate-list[hidden] {
  display: none;
}

.estimate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  min-height: 30px;
  padding: 6px 7px;
  border: 1px solid rgb(var(--c-border) / 0.24);
  border-radius: 8px;
  background: rgb(var(--c-card) / 0.20);
}

.estimate-row span {
  min-width: 0;
  overflow: hidden;
  color: rgb(var(--c-sub));
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.estimate-row strong {
  color: rgb(var(--c-fg));
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.estimate-price {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 0;
  text-align: right;
}

.estimate-price small {
  max-width: 168px;
  overflow: hidden;
  color: rgb(var(--c-dim));
  font-size: 9px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.estimate-note {
  color: rgb(var(--c-dim));
  font-size: 11px;
  line-height: 1.45;
}

/* Darkroom liquid sync -------------------------------------------------- */
:root {
  --card-opacity: 0.88;
  --bg-image: none;
  --bg-pos-x: 50%;
  --bg-pos-y: 50%;
  --bg-zoom: 100;
  --liquid-alpha: 1;
  --liquid-transparency: 0.5;
  --rail-width: 58px;
  --sidebar-width: 248px;
  --topbar-height: 58px;
  --radius-window: 22px;
  --radius-panel: 16px;
  --radius-card: 14px;
  --radius-control: 10px;
  --radius-tight: 8px;
}

:root,
html.theme-liquid-black,
.theme-liquid-black {
  color-scheme: dark;
  --card-opacity: 0.42;
  --c-bg: 10 11 13;
  --c-panel: 19 21 25;
  --c-card: 25 28 33;
  --c-border: 67 74 86;
  --c-fg: 236 238 241;
  --c-sub: 166 174 186;
  --c-dim: 106 116 130;
  --c-accent: 68 190 255;
  --c-accent-fg: 5 15 24;
  --c-ok: 52 211 153;
  --c-warn: 245 158 11;
  --c-err: 248 113 113;
  --liquid-window: 10 11 13;
  --liquid-surface: 23 25 30;
  --liquid-rail: 16 18 22;
  --liquid-fill: 23 25 30;
  --liquid-line: 255 255 255;
  --liquid-shine: 255 255 255;
  --liquid-shadow: 0 0 0;
  --liquid-blur: 48px;
  --liquid-saturate: 188%;
}

html.theme-liquid-white,
.theme-liquid-white {
  color-scheme: light;
  --card-opacity: 0.46;
  --c-bg: 233 239 248;
  --c-panel: 252 254 255;
  --c-card: 255 255 255;
  --c-border: 196 207 224;
  --c-fg: 24 27 33;
  --c-sub: 93 103 118;
  --c-dim: 145 153 166;
  --c-accent: 33 119 255;
  --c-accent-fg: 255 255 255;
  --c-ok: 36 180 126;
  --c-warn: 229 139 53;
  --c-err: 232 75 75;
  --liquid-window: 255 255 255;
  --liquid-surface: 255 255 255;
  --liquid-rail: 246 250 255;
  --liquid-fill: 255 255 255;
  --liquid-line: 255 255 255;
  --liquid-shine: 255 255 255;
  --liquid-shadow: 55 69 92;
  --liquid-blur: 42px;
  --liquid-saturate: 176%;
}

html.theme-liquid-gray,
.theme-liquid-gray {
  color-scheme: light;
  --card-opacity: 0.44;
  --c-bg: 128 134 144;
  --c-panel: 221 225 231;
  --c-card: 238 241 245;
  --c-border: 170 178 190;
  --c-fg: 28 31 36;
  --c-sub: 80 88 100;
  --c-dim: 124 132 144;
  --c-accent: 83 129 180;
  --c-accent-fg: 255 255 255;
  --c-ok: 34 197 94;
  --c-warn: 217 119 6;
  --c-err: 220 38 38;
  --liquid-window: 225 228 233;
  --liquid-surface: 244 246 249;
  --liquid-rail: 211 216 224;
  --liquid-fill: 244 246 249;
  --liquid-line: 255 255 255;
  --liquid-shine: 255 255 255;
  --liquid-shadow: 55 60 70;
  --liquid-blur: 44px;
  --liquid-saturate: 150%;
}

html.theme-liquid-sage,
.theme-liquid-sage {
  color-scheme: light;
  --card-opacity: 0.44;
  --c-bg: 218 233 227;
  --c-panel: 248 252 250;
  --c-card: 255 255 253;
  --c-border: 178 204 195;
  --c-fg: 20 34 31;
  --c-sub: 74 96 91;
  --c-dim: 120 143 137;
  --c-accent: 28 139 124;
  --c-accent-fg: 255 255 255;
  --c-ok: 22 163 74;
  --c-warn: 202 138 4;
  --c-err: 220 38 38;
  --liquid-window: 241 249 246;
  --liquid-surface: 255 255 253;
  --liquid-rail: 226 239 234;
  --liquid-fill: 255 255 253;
  --liquid-line: 255 255 255;
  --liquid-shine: 255 255 255;
  --liquid-shadow: 47 78 70;
  --liquid-blur: 44px;
  --liquid-saturate: 162%;
}

html.theme-liquid-coral,
.theme-liquid-coral {
  color-scheme: light;
  --card-opacity: 0.44;
  --c-bg: 246 231 228;
  --c-panel: 255 250 247;
  --c-card: 255 252 249;
  --c-border: 221 190 186;
  --c-fg: 39 31 33;
  --c-sub: 99 77 82;
  --c-dim: 151 124 129;
  --c-accent: 224 89 102;
  --c-accent-fg: 255 255 255;
  --c-ok: 22 163 74;
  --c-warn: 217 119 6;
  --c-err: 220 38 38;
  --liquid-window: 255 244 241;
  --liquid-surface: 255 252 249;
  --liquid-rail: 247 229 226;
  --liquid-fill: 255 252 249;
  --liquid-line: 255 255 255;
  --liquid-shine: 255 255 255;
  --liquid-shadow: 96 59 64;
  --liquid-blur: 44px;
  --liquid-saturate: 160%;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  background-color: rgb(var(--c-bg));
  background-image: var(--bg-image);
  background-size: calc(var(--bg-zoom) * 1%) auto;
  background-position: var(--bg-pos-x) var(--bg-pos-y);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 8% 6%, rgb(var(--c-accent) / 0.12) 0%, transparent 42%),
    radial-gradient(circle at 96% 94%, rgb(var(--c-accent) / 0.08) 0%, transparent 46%);
}

html.theme-liquid body::before {
  background-image:
    linear-gradient(180deg, rgb(var(--liquid-fill) / calc(0.68 * var(--liquid-alpha))), transparent 34%),
    linear-gradient(90deg, rgb(var(--liquid-fill) / calc(0.38 * var(--liquid-alpha))), transparent 24%, transparent 74%, rgb(var(--liquid-fill) / calc(0.34 * var(--liquid-alpha)))),
    repeating-linear-gradient(112deg, rgb(var(--liquid-line) / calc(0.18 * var(--liquid-alpha))) 0 1px, transparent 1px 11px),
    linear-gradient(118deg, transparent 0%, rgb(var(--liquid-shine) / calc(0.52 * var(--liquid-alpha))) 17%, transparent 31%, transparent 58%, rgb(var(--c-accent) / 0.18) 70%, transparent 84%);
  opacity: 0.24;
}

html.theme-liquid body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, transparent 0%, rgb(var(--liquid-shine) / calc(0.42 * var(--liquid-alpha))) 22%, transparent 42%, rgb(var(--liquid-shine) / calc(0.22 * var(--liquid-alpha))) 62%, transparent 78%),
    repeating-linear-gradient(0deg, rgb(var(--liquid-line) / calc(0.07 * var(--liquid-alpha))) 0 1px, transparent 1px 3px);
  mix-blend-mode: screen;
  opacity: 0.12;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  overflow: hidden;
  border: 1px solid rgb(var(--liquid-line) / calc(0.32 * var(--liquid-alpha)));
  border-radius: var(--radius-window);
  background:
    linear-gradient(145deg, rgb(var(--liquid-window) / calc(0.36 * var(--liquid-alpha))), rgb(var(--liquid-surface) / calc(0.12 * var(--liquid-alpha)))),
    rgb(var(--liquid-window) / calc(0.16 * var(--liquid-alpha)));
  box-shadow:
    0 1px 0 rgb(var(--liquid-shine) / calc(0.54 * var(--liquid-alpha))) inset,
    0 18px 56px rgb(var(--liquid-shadow) / 0.12);
}

.top-bar {
  height: var(--topbar-height);
  padding: 0 18px 0 96px;
  border-bottom-color: rgb(var(--liquid-line) / calc(0.44 * var(--liquid-alpha)));
  border-radius: var(--radius-window) var(--radius-window) 0 0;
  background:
    linear-gradient(180deg, rgb(var(--liquid-fill) / calc(0.48 * var(--liquid-alpha))), rgb(var(--liquid-fill) / calc(0.20 * var(--liquid-alpha)))),
    linear-gradient(100deg, rgb(var(--c-accent) / 0.12), transparent 36%, rgb(var(--liquid-shine) / calc(0.20 * var(--liquid-alpha))));
  box-shadow:
    0 1px 0 rgb(var(--liquid-shine) / calc(0.72 * var(--liquid-alpha))) inset,
    0 12px 30px rgb(var(--liquid-shadow) / 0.06);
  backdrop-filter: blur(var(--liquid-blur)) saturate(var(--liquid-saturate));
  -webkit-backdrop-filter: blur(var(--liquid-blur)) saturate(var(--liquid-saturate));
}

.traffic-lights {
  left: 18px;
}

.top-context,
.user-chip,
.nav-item,
.model-row,
.conversation-item,
.status-card,
.attachment-chip,
.mini-icon-btn,
.web-toggle,
.route-status,
.key-sync-state,
.auth-status,
.settings-notice {
  border-color: rgb(var(--liquid-line) / calc(0.46 * var(--liquid-alpha)));
  background:
    linear-gradient(180deg, rgb(var(--liquid-fill) / calc(0.50 * var(--liquid-alpha))), rgb(var(--liquid-fill) / calc(0.24 * var(--liquid-alpha))));
  box-shadow:
    0 1px 0 rgb(var(--liquid-shine) / calc(0.70 * var(--liquid-alpha))) inset,
    0 8px 24px rgb(var(--liquid-shadow) / 0.07);
  backdrop-filter: blur(var(--liquid-blur)) saturate(var(--liquid-saturate));
  -webkit-backdrop-filter: blur(var(--liquid-blur)) saturate(var(--liquid-saturate));
}

.top-context,
.user-chip {
  height: 32px;
  border-radius: 18px;
}

.top-context {
  gap: 6px;
  min-width: 110px;
  padding: 0 12px;
}

.top-context span {
  color: rgb(var(--c-dim));
  font-size: 11px;
}

.brand-lockup {
  height: 34px;
}

.brand-lockup > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-mark {
  width: 24px;
  height: 24px;
  background:
    radial-gradient(circle at 32% 26%, rgb(var(--liquid-shine) / 0.75), transparent 30%),
    linear-gradient(135deg, rgb(var(--c-accent)), rgb(var(--c-warn)));
  box-shadow:
    0 1px 0 rgb(var(--liquid-shine) / 0.58) inset,
    0 8px 18px rgb(var(--c-accent) / 0.22);
}

.brand-lockup span {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin: 0;
  padding: 0 7px;
  border: 1px solid rgb(var(--c-accent) / 0.38);
  border-radius: 999px;
  background: rgb(var(--c-accent) / 0.10);
  color: rgb(var(--c-accent));
  font-size: 10px;
  font-weight: 700;
}

.user-chip {
  min-width: 154px;
  padding: 0 11px 0 8px;
}

.user-avatar {
  width: 25px;
  height: 25px;
  background:
    radial-gradient(circle at 32% 24%, rgb(var(--liquid-shine) / 0.78), transparent 28%),
    linear-gradient(135deg, rgb(var(--c-accent)), rgb(var(--c-warn)));
}

.app-rail {
  gap: 10px;
  padding: 14px 8px;
  border-right-color: rgb(var(--liquid-line) / calc(0.40 * var(--liquid-alpha)));
  background:
    linear-gradient(180deg, rgb(var(--liquid-rail) / calc(0.46 * var(--liquid-alpha))), rgb(var(--liquid-rail) / calc(0.24 * var(--liquid-alpha)))),
    linear-gradient(90deg, rgb(var(--liquid-shine) / calc(0.22 * var(--liquid-alpha))), transparent);
  box-shadow: 1px 0 0 rgb(var(--liquid-shine) / calc(0.18 * var(--liquid-alpha))) inset;
  backdrop-filter: blur(var(--liquid-blur)) saturate(var(--liquid-saturate));
  -webkit-backdrop-filter: blur(var(--liquid-blur)) saturate(var(--liquid-saturate));
}

.rail-item,
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-control);
}

.rail-item.is-active,
.rail-item:hover,
.icon-btn:hover,
.icon-btn.send-btn {
  border-color: rgb(var(--c-accent) / 0.46);
  background:
    linear-gradient(180deg, rgb(var(--c-accent) / 0.18), rgb(var(--c-accent) / 0.10));
  box-shadow:
    0 1px 0 rgb(var(--liquid-shine) / calc(0.54 * var(--liquid-alpha))) inset,
    0 8px 20px rgb(var(--c-accent) / 0.12);
}

.context-sidebar {
  gap: 18px;
  padding: 16px 12px;
  border-right-color: rgb(var(--liquid-line) / calc(0.40 * var(--liquid-alpha)));
  background:
    linear-gradient(145deg, rgb(var(--liquid-fill) / calc(0.30 * var(--liquid-alpha))), rgb(var(--liquid-fill) / calc(0.14 * var(--liquid-alpha)))),
    rgb(var(--liquid-rail) / calc(0.30 * var(--liquid-alpha)));
  box-shadow: 1px 0 0 rgb(var(--liquid-shine) / calc(0.18 * var(--liquid-alpha))) inset;
  backdrop-filter: blur(var(--liquid-blur)) saturate(var(--liquid-saturate));
  -webkit-backdrop-filter: blur(var(--liquid-blur)) saturate(var(--liquid-saturate));
}

.nav-item,
.model-row,
.conversation-item,
.status-card,
.attachment-chip {
  border-radius: var(--radius-control);
}

.nav-item.is-active,
.conversation-item.is-active,
.model-row.is-active {
  border-color: rgb(var(--c-accent) / 0.48);
  background:
    linear-gradient(180deg, rgb(var(--c-accent) / 0.16), rgb(var(--c-accent) / 0.08)),
    linear-gradient(90deg, rgb(var(--liquid-shine) / calc(0.24 * var(--liquid-alpha))), transparent);
  box-shadow:
    0 1px 0 rgb(var(--liquid-shine) / calc(0.62 * var(--liquid-alpha))) inset,
    0 8px 22px rgb(var(--c-accent) / 0.10);
}

.balance-panel,
.card,
.settings-sheet,
.login-card {
  border-color: rgb(var(--liquid-line) / calc(0.58 * var(--liquid-alpha)));
  background:
    linear-gradient(145deg, rgb(var(--liquid-fill) / calc(0.42 * var(--liquid-alpha))), rgb(var(--liquid-fill) / calc(0.20 * var(--liquid-alpha)))),
    linear-gradient(28deg, rgb(var(--c-accent) / 0.07), transparent 42%, rgb(var(--liquid-shine) / calc(0.12 * var(--liquid-alpha))));
  box-shadow:
    0 1px 0 rgb(var(--liquid-shine) / calc(0.68 * var(--liquid-alpha))) inset,
    0 10px 26px rgb(var(--liquid-shadow) / 0.06);
  backdrop-filter: blur(28px) saturate(158%);
  -webkit-backdrop-filter: blur(28px) saturate(158%);
}

.card {
  border-radius: var(--radius-panel);
}

.balance-panel {
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
}

.balance-head-right strong {
  max-width: 78px;
  border-radius: 999px;
  background: rgb(var(--c-accent) / 0.12);
}

.balance-meter {
  height: 5px;
  background: rgb(var(--c-border) / 0.22);
}

.meter span {
  background: linear-gradient(90deg, rgb(var(--c-accent)), rgb(70 150 255), rgb(var(--c-ok)));
}

.swatch::before {
  width: 21px;
  height: 21px;
  border-color: rgb(var(--liquid-line) / calc(0.52 * var(--liquid-alpha)));
  box-shadow:
    0 1px 0 rgb(var(--liquid-shine) / calc(0.54 * var(--liquid-alpha))) inset,
    0 2px 6px rgb(var(--liquid-shadow) / 0.12);
}

.swatch[data-theme="black"]::before { background: #101216; }
.swatch[data-theme="white"]::before { background: #f7faff; }
.swatch[data-theme="gray"]::before { background: #e1e4e9; }
.swatch[data-theme="sage"]::before { background: #dceee7; }
.swatch[data-theme="coral"]::before { background: #fff0ee; }

.shell-content {
  padding: calc(var(--topbar-height) + 12px) 16px 16px calc(var(--rail-width) + var(--sidebar-width) + 12px);
}

body.is-notes-mode .context-sidebar,
body.is-notes-mode .inspector-panel {
  display: none;
}

body.is-notes-mode .shell-content {
  padding-left: calc(var(--rail-width) + 12px);
}

body.is-notes-mode .llm-page,
body.is-notes-mode .llm-page.is-conversations-collapsed,
body.is-notes-mode .llm-page.is-inspector-collapsed,
body.is-notes-mode .llm-page.is-conversations-collapsed.is-inspector-collapsed {
  grid-template-columns: minmax(240px, 320px) minmax(520px, 1fr);
  max-width: 1280px;
}

.llm-page {
  gap: 12px;
  max-width: 1580px;
  height: calc(100vh - var(--topbar-height) - 28px);
}

.conversation-panel,
.inspector-panel,
.chat-panel {
  min-height: 0;
}

.conversation-panel,
.inspector-panel {
  padding: 14px;
}

.chat-panel {
  padding: 16px;
}

.workspace-hero {
  min-height: 114px;
  padding: 18px;
  border-color: rgb(var(--liquid-line) / calc(0.56 * var(--liquid-alpha)));
  border-radius: var(--radius-card);
  background:
    linear-gradient(112deg, rgb(var(--liquid-shine) / calc(0.42 * var(--liquid-alpha))), rgb(var(--liquid-fill) / calc(0.16 * var(--liquid-alpha))) 46%, rgb(var(--c-accent) / 0.14)),
    linear-gradient(180deg, rgb(var(--liquid-fill) / calc(0.24 * var(--liquid-alpha))), rgb(var(--liquid-fill) / calc(0.10 * var(--liquid-alpha))));
  box-shadow:
    0 1px 0 rgb(var(--liquid-shine) / calc(0.78 * var(--liquid-alpha))) inset,
    0 10px 26px rgb(var(--liquid-shadow) / 0.05);
}

h1 {
  font-size: 24px;
  font-weight: 760;
}

h2 {
  font-size: 15px;
  font-weight: 700;
}

.input,
select.input,
textarea.input {
  border-color: rgb(var(--liquid-line) / calc(0.50 * var(--liquid-alpha)));
  border-radius: var(--radius-control);
  background:
    linear-gradient(180deg, rgb(var(--liquid-fill) / calc(0.40 * var(--liquid-alpha))), rgb(var(--liquid-fill) / calc(0.18 * var(--liquid-alpha))));
  box-shadow:
    0 1px 0 rgb(var(--liquid-shine) / calc(0.58 * var(--liquid-alpha))) inset,
    0 8px 18px rgb(var(--liquid-shadow) / 0.04);
}

.input:focus {
  border-color: rgb(var(--c-accent) / 0.72);
  box-shadow:
    0 0 0 3px rgb(var(--c-accent) / 0.18),
    0 1px 0 rgb(var(--liquid-shine) / calc(0.60 * var(--liquid-alpha))) inset;
}

.btn {
  min-height: 34px;
  border-radius: var(--radius-control);
  border-color: rgb(var(--liquid-line) / calc(0.46 * var(--liquid-alpha)));
  background:
    linear-gradient(180deg, rgb(var(--liquid-fill) / calc(0.44 * var(--liquid-alpha))), rgb(var(--liquid-fill) / calc(0.22 * var(--liquid-alpha))));
  box-shadow:
    0 1px 0 rgb(var(--liquid-shine) / calc(0.62 * var(--liquid-alpha))) inset,
    0 8px 20px rgb(var(--liquid-shadow) / 0.06);
}

.btn-primary {
  border-color: rgb(var(--c-accent) / 0.68);
  background:
    linear-gradient(180deg, rgb(var(--c-accent) / 0.94), rgb(var(--c-accent) / 0.86));
  color: rgb(var(--c-accent-fg));
}

.btn-ghost {
  color: rgb(var(--c-sub));
}

.message-body,
.quota-detail,
.settings-group,
.estimate-row,
.message-image,
.image-placeholder {
  border-color: rgb(var(--liquid-line) / calc(0.48 * var(--liquid-alpha)));
  border-radius: var(--radius-card);
  background:
    linear-gradient(145deg, rgb(var(--liquid-fill) / calc(0.34 * var(--liquid-alpha))), rgb(var(--liquid-fill) / calc(0.16 * var(--liquid-alpha))));
  box-shadow: 0 1px 0 rgb(var(--liquid-shine) / calc(0.52 * var(--liquid-alpha))) inset;
}

.message.user .message-body {
  border-color: rgb(var(--c-accent) / 0.34);
  background:
    linear-gradient(145deg, rgb(var(--c-accent) / 0.18), rgb(var(--c-accent) / 0.09));
}

.settings-backdrop {
  background:
    radial-gradient(circle at 78% 18%, rgb(var(--c-accent) / 0.12), transparent 36%),
    rgb(var(--c-bg) / 0.20);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
}

.settings-sheet {
  top: calc(var(--topbar-height) + 12px);
  right: 14px;
  bottom: 14px;
  width: min(444px, calc(100vw - 28px));
  padding: 16px;
  border-radius: 20px;
}

.settings-group {
  padding: 13px;
}

.login-overlay {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.login-card {
  width: min(430px, calc(100vw - 32px));
  border-radius: 20px;
}

body.is-locked .llm-page {
  opacity: 0.36;
  filter: blur(2.6px);
}

html.theme-liquid {
  overflow: hidden;
  background: transparent;
  border-radius: var(--radius-window);
}

html.theme-liquid body {
  overflow: hidden;
  background-color: transparent;
  border-radius: inherit;
  clip-path: inset(0 round var(--radius-window));
}

html.theme-liquid body::before,
html.theme-liquid body::after {
  position: absolute;
}

html.theme-liquid .app-shell {
  height: 100vh;
  min-height: 0;
  isolation: isolate;
  clip-path: inset(0 round var(--radius-window));
}

html.theme-liquid .top-bar,
html.theme-liquid .app-rail,
html.theme-liquid .context-sidebar,
html.theme-liquid .login-overlay,
html.theme-liquid .settings-backdrop,
html.theme-liquid .settings-sheet {
  position: absolute;
}

@media (max-width: 1180px) {
  .llm-page {
    grid-template-columns: minmax(220px, 280px) minmax(420px, 1fr);
  }

  .inspector-panel {
    grid-column: 1 / -1;
    min-height: auto;
  }
}

@media (max-width: 900px) {
  :root {
    color-scheme: light;
    --topbar-height: 52px;
    --mobile-tab-height: 72px;
    --radius-window: 0px;
    --radius-panel: 22px;
    --radius-card: 16px;
    --radius-control: 12px;
    --mobile-safe-top: env(safe-area-inset-top, 0px);
    --c-bg: 242 242 247;
    --c-panel: 255 255 255;
    --c-card: 255 255 255;
    --c-border: 209 213 219;
    --c-fg: 17 24 39;
    --c-sub: 88 97 112;
    --c-dim: 132 142 157;
    --c-accent: 0 122 255;
    --c-accent-fg: 255 255 255;
    --c-ok: 52 199 89;
    --c-warn: 255 149 0;
    --c-err: 255 59 48;
    --liquid-window: 242 242 247;
    --liquid-surface: 255 255 255;
    --liquid-rail: 255 255 255;
    --liquid-fill: 255 255 255;
    --liquid-line: 209 213 219;
    --liquid-shine: 255 255 255;
    --liquid-shadow: 18 28 45;
    --liquid-blur: 22px;
    --liquid-saturate: 180%;
    --liquid-alpha: 0.96;
  }

  html.platform-android {
    --mobile-safe-top: max(env(safe-area-inset-top, 0px), 24px);
  }

  html.theme-liquid,
  html.theme-liquid body,
  html.theme-liquid .app-shell {
    border-radius: 0;
  }

  html.theme-liquid .app-shell,
  .app-shell {
    height: 100dvh;
    min-height: 100dvh;
    background: rgb(var(--c-bg));
  }

  body {
    background: rgb(var(--c-bg));
    overflow: hidden;
    overscroll-behavior: none;
  }

  .top-bar {
    height: calc(var(--topbar-height) + var(--mobile-safe-top));
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: var(--mobile-safe-top) 16px 0;
    border-bottom: 0;
    border-radius: 0;
    background: rgb(249 249 251 / 0.86);
    box-shadow: 0 1px 0 rgb(0 0 0 / 0.08);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
  }

  .traffic-lights {
    display: none;
  }

  .top-context {
    display: grid;
    gap: 1px;
    min-width: 0;
    width: auto;
    max-width: none;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgb(var(--c-fg));
  }

  .top-context span {
    display: block;
    color: rgb(var(--c-dim));
    font-size: 11px;
    font-weight: 650;
    line-height: 1.1;
  }

  .top-context strong {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.1;
  }

  .brand-lockup {
    display: none;
  }

  .user-chip {
    justify-self: end;
    min-width: 0;
    max-width: 148px;
    min-height: 36px;
    padding: 4px 6px 4px 4px;
    border: 0;
    border-radius: 999px;
    background: rgb(255 255 255 / 0.72);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 0 0 1px rgb(0 0 0 / 0.06) inset;
  }

  .user-chip span:last-child {
    min-width: 0;
  }

  .user-avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(145deg, rgb(0 122 255), rgb(88 86 214));
    color: white;
    font-size: 12px;
  }

  .user-chip strong,
  .user-chip small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-rail {
    display: none;
  }

  .context-sidebar {
    position: fixed;
    z-index: 22;
    inset: auto 0 0 0;
    width: auto;
    min-height: calc(var(--mobile-tab-height) + env(safe-area-inset-bottom, 0px));
    display: block;
    padding: 7px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    border: 0;
    border-top: 1px solid rgb(0 0 0 / 0.08);
    border-radius: 0;
    background: rgb(249 249 251 / 0.90);
    box-shadow: 0 -12px 30px rgb(0 0 0 / 0.06);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
  }

  .context-sidebar .sidebar-section:first-of-type {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
  }

  .context-sidebar .sidebar-section:first-of-type .eyebrow,
  .context-sidebar .sidebar-section:nth-of-type(2),
  .context-sidebar .sidebar-footer {
    display: none;
  }

  .nav-item {
    display: grid;
    grid-template-rows: 22px 16px;
    place-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 50px;
    padding: 4px 2px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: rgb(var(--c-dim));
    font-size: 11px;
    font-weight: 650;
    line-height: 1;
  }

  .nav-note-mobile {
    display: grid;
  }

  .nav-item svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.2;
  }

  .nav-item.is-active {
    background: transparent;
    color: rgb(var(--c-accent));
  }

  .nav-item.is-active::before {
    display: none;
  }

  .btn.mobile-panel-toggle,
  .btn.panel-restore-toggle {
    display: inline-flex;
  }

  .conversation-restore-tab {
    display: none !important;
  }

  .mobile-panel-backdrop {
    position: absolute;
    z-index: 29;
    inset: calc(var(--topbar-height) + var(--mobile-safe-top)) 0 calc(var(--mobile-tab-height) + env(safe-area-inset-bottom, 0px));
    width: 100%;
    padding: 0;
    border: 0;
    background: rgb(0 0 0 / 0.18);
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
  }

  .mobile-panel-backdrop:not([hidden]) {
    display: block;
  }

  .shell-content {
    height: 100dvh;
    padding: calc(var(--topbar-height) + var(--mobile-safe-top) + 10px) 10px calc(var(--mobile-tab-height) + env(safe-area-inset-bottom, 0px) + 10px);
    overflow: hidden;
  }

  body.is-notes-mode .context-sidebar {
    display: block;
  }

  body.is-notes-mode .shell-content {
    padding: calc(var(--topbar-height) + var(--mobile-safe-top) + 10px) 10px calc(var(--mobile-tab-height) + env(safe-area-inset-bottom, 0px) + 10px);
  }

  .login-overlay {
    inset: calc(var(--topbar-height) + var(--mobile-safe-top)) 0 0 0;
    align-items: start;
    padding: 18px 16px calc(var(--mobile-tab-height) + env(safe-area-inset-bottom, 0px) + 18px);
    background: rgb(var(--c-bg));
  }

  .login-card {
    width: 100%;
    max-width: 390px;
    margin-top: 18px;
    padding: 22px 18px 18px;
    border: 0;
    border-radius: 28px;
    background: rgb(255 255 255);
    box-shadow: 0 18px 45px rgb(18 28 45 / 0.10);
  }

  .login-card .eyebrow {
    color: rgb(var(--c-accent));
  }

  .login-card h2 {
    margin-top: 3px;
    font-size: 24px;
    line-height: 1.15;
  }

  .login-subtitle {
    font-size: 13px;
  }

  .login-form {
    gap: 10px;
  }

  .login-form .field {
    gap: 6px;
  }

  .login-form .field span {
    color: rgb(var(--c-dim));
    font-size: 11px;
    font-weight: 700;
  }

  .login-form .input {
    height: 46px;
    border: 0;
    border-radius: 14px;
    background: rgb(242 242 247);
    font-size: 15px;
  }

  .login-form .btn,
  .login-card > .btn {
    min-height: 46px;
    border-radius: 14px;
  }

  .settings-sheet {
    inset: calc(var(--topbar-height) + var(--mobile-safe-top) + 10px) 10px calc(10px + env(safe-area-inset-bottom, 0px));
    width: auto;
    padding: 28px 16px 16px;
    border: 0;
    border-radius: 26px;
    background: rgb(255 255 255);
    box-shadow: 0 18px 48px rgb(18 28 45 / 0.16);
  }

  .llm-page {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    overflow: hidden;
  }

  .chat-panel {
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 26px;
    background: rgb(255 255 255);
    box-shadow: 0 12px 36px rgb(18 28 45 / 0.08);
    overflow: hidden;
  }

  .workspace-hero {
    min-height: 0;
    margin: 0;
    padding: 14px 14px 10px;
    border: 0;
    border-bottom: 1px solid rgb(0 0 0 / 0.06);
    border-radius: 0;
    align-items: flex-start;
    gap: 10px;
    background: rgb(255 255 255 / 0.92);
    box-shadow: none;
  }

  .workspace-hero > div {
    min-width: 0;
  }

  .workspace-hero .eyebrow {
    display: none;
  }

  h1 {
    margin-top: 0;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.2;
  }

  .hero-meta {
    display: none;
  }

  .header-actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 7px;
  }

  .web-toggle {
    min-width: 34px;
    min-height: 34px;
    padding: 0 9px;
    border: 0;
    border-radius: 50%;
    background: rgb(242 242 247);
    color: rgb(var(--c-sub));
  }

  .web-toggle span:last-child,
  .header-actions .btn span:last-child {
    display: none;
  }

  .header-actions .btn {
    width: 34px;
    min-width: 36px;
    min-height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgb(242 242 247);
    color: rgb(var(--c-sub));
  }

  .web-toggle.is-active,
  .header-actions .btn[aria-expanded="true"] {
    background: rgb(var(--c-accent));
    color: white;
  }

  .message-stream {
    gap: 11px;
    padding: 14px 12px 12px;
    background: rgb(247 247 250);
  }

  .message {
    display: flex;
    align-items: flex-end;
    gap: 0;
    max-width: 100%;
  }

  .message.user {
    align-self: stretch;
    justify-content: flex-end;
    grid-template-columns: minmax(0, 1fr) 28px;
    max-width: 94%;
  }

  .message .avatar {
    display: none;
  }

  .message-body {
    width: fit-content;
    max-width: min(86%, 680px);
    padding: 10px 12px;
    border: 0;
    border-radius: 18px 18px 18px 7px;
    background: rgb(255 255 255);
    box-shadow: 0 1px 1px rgb(0 0 0 / 0.04), 0 0 0 1px rgb(0 0 0 / 0.04);
  }

  .message.user .message-body {
    border-radius: 18px 18px 7px 18px;
    background: rgb(var(--c-accent));
    color: white;
    box-shadow: none;
  }

  .message-body p {
    line-height: 1.58;
  }

  .message.user .message-body p,
  .message.user .message-meta,
  .message.user .message-meta em,
  .message.user .message-meta span {
    color: rgb(255 255 255 / 0.88);
  }

  .message-meta {
    gap: 4px;
    margin-bottom: 6px;
  }

  .message-meta span,
  .message-meta em {
    padding: 0;
    border: 0;
    background: transparent;
  }

  .message-image {
    width: min(220px, 100%);
    max-height: 190px;
    border-radius: 14px;
  }

  .message-actions {
    margin-top: 7px;
  }

  .message-star,
  .message-save {
    border: 0;
    border-radius: 999px;
    background: rgb(242 242 247);
  }

  .message.user .message-star,
  .message.user .message-save {
    background: rgb(255 255 255 / 0.18);
    color: white;
  }

  .composer {
    gap: 8px;
    padding: 10px 12px 12px;
    border-top: 1px solid rgb(0 0 0 / 0.06);
    background: rgb(255 255 255 / 0.94);
  }

  .composer-row {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    gap: 8px;
  }

  .composer.is-text-mode .composer-row {
    grid-template-columns: minmax(0, 1fr) 38px;
  }

  .composer .icon-btn {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: rgb(242 242 247);
  }

  .composer .send-btn {
    background: rgb(var(--c-accent));
    color: white;
  }

  .image-url-row {
    grid-template-columns: 16px minmax(0, 1fr) 28px;
    gap: 6px;
  }

  .image-url-input {
    height: 34px;
    border: 0;
    border-radius: 13px;
    background: rgb(242 242 247);
    font-size: 10px;
  }

  .prompt-input {
    min-height: 44px;
    max-height: 118px;
    padding: 11px 12px;
    border: 0;
    border-radius: 18px;
    background: rgb(242 242 247);
    resize: none;
    font-size: 15px;
    line-height: 1.45;
  }

  .attachment-strip {
    min-height: 36px;
    overflow-x: auto;
    white-space: nowrap;
  }

  .attachment-chip {
    min-height: 34px;
    border: 0;
    border-radius: 999px;
    background: rgb(242 242 247);
  }

  .attachment-chip img {
    width: 26px;
    height: 26px;
  }

  .conversation-panel,
  .inspector-panel {
    position: fixed;
    z-index: 30;
    left: 10px;
    right: 10px;
    bottom: calc(var(--mobile-tab-height) + env(safe-area-inset-bottom, 0px) + 8px);
    height: auto;
    max-height: min(76dvh, 640px);
    min-height: 0;
    padding: 24px 14px 14px;
    border: 0;
    border-radius: 28px;
    background: rgb(255 255 255);
    box-shadow: 0 20px 60px rgb(18 28 45 / 0.24);
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + 20px));
    visibility: hidden;
    transition: transform 180ms ease, opacity 180ms ease, visibility 180ms ease;
  }

  .conversation-panel::before,
  .inspector-panel::before,
  .settings-sheet::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 8px;
    width: 38px;
    height: 5px;
    border-radius: 999px;
    background: rgb(209 213 219);
    transform: translateX(-50%);
  }

  body.mobile-conversations-open .conversation-panel,
  body.mobile-inspector-open .inspector-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    visibility: visible;
  }

  .conversation-panel .panel-header,
  .inspector-panel .panel-header {
    align-items: center;
  }

  .panel-header h2 {
    font-size: 18px;
  }

  .conversation-list,
  .inspector-panel {
    overflow: auto;
  }

  .search-wrap .input,
  .field .input {
    min-height: 40px;
    border: 0;
    border-radius: 13px;
    background: rgb(242 242 247);
  }

  .mobile-model-section {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 0;
    border-radius: 16px;
    background: rgb(242 242 247);
  }

  .mobile-model-list {
    max-height: 178px;
    overflow: auto;
  }

  .mobile-model-list .model-row {
    min-height: 42px;
    border: 0;
    border-radius: 13px;
    background: rgb(255 255 255 / 0.72);
  }

  .balance-panel.mobile-balance-panel {
    display: grid;
    border: 0;
    border-radius: 18px;
    background: rgb(242 242 247);
    box-shadow: none;
  }

  .conversation-item {
    height: 58px;
    min-height: 58px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px;
    border-radius: 15px;
    background: rgb(242 242 247 / 0.70);
  }

  .conversation-open {
    gap: 8px;
  }

  .conversation-actions {
    gap: 3px;
  }

  .conversation-action {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: rgb(255 255 255);
  }

  .status-stack {
    margin-top: 0;
  }

  .status-card,
  .quota-detail {
    border: 0;
    border-radius: 16px;
    background: rgb(242 242 247);
  }

  .estimate-row {
    border: 0;
    border-radius: 14px;
    background: rgb(255 255 255 / 0.74);
  }

  .library-detail,
  .notes-editor {
    width: 100%;
    padding: 16px;
    border: 0;
    border-radius: 22px;
    background: rgb(255 255 255);
    box-shadow: 0 10px 28px rgb(18 28 45 / 0.07);
  }

  body.is-notes-mode .message-stream {
    padding: 12px;
  }

  .notes-editor {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    gap: 12px;
  }

  .note-content-field {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .note-content-input {
    flex: 1 1 auto;
    min-height: 64dvh;
    height: 100%;
    border: 0;
    border-radius: 16px;
    background: rgb(242 242 247);
    overflow: auto;
  }
}

@media (max-width: 430px) {
  .top-bar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .user-chip {
    width: auto;
    max-width: 126px;
  }

  .user-chip small {
    display: none;
  }

  .workspace-hero {
    display: flex;
    align-items: center;
  }

  .header-actions {
    justify-content: flex-end;
  }

  .header-actions .btn,
  .header-actions .web-toggle {
    flex: 0 0 auto;
    gap: 4px;
    padding: 0;
    font-size: 12px;
  }

  .nav-item {
    min-height: 50px;
    font-size: 11px;
  }

  .nav-item svg {
    width: 20px;
    height: 20px;
  }
}
