:root {
  color-scheme: dark;
  --bg: #1b1c1f;
  --side: #131416;
  --panel: #232529;
  --hover: #2c2e32;
  --line: #33353a;
  --text: #f0f1f3;
  --muted: #a6a8b0;
  --soft: #757983;
  --accent: #92dfc4;
  --on-accent: #15382b;
  --danger: #ff8585;
  --shadow: 0 18px 65px #0005;
  --sidebar: 276px;
  font:
    16px/1.65 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Microsoft YaHei",
    sans-serif;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fff;
  --side: #f4f5f7;
  --panel: #f7f8fa;
  --hover: #e9ebef;
  --line: #dce0e6;
  --text: #20242c;
  --muted: #626a77;
  --soft: #78808e;
  --accent: #13795b;
  --on-accent: #fff;
  --danger: #c43d45;
  --shadow: 0 16px 55px #2632481c;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
  border: 0;
  background: none;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
textarea,
select,
a {
  -webkit-tap-highlight-color: transparent;
}
svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.7;
  flex-shrink: 0;
}
[hidden] {
  display: none !important;
}
.provider-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}
.provider-error {
  color: var(--danger, #e97878);
  overflow-wrap: anywhere;
}
.callback-guide {
  margin: 20px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.callback-guide summary {
  cursor: pointer;
  font-weight: 600;
}
.callback-guide p {
  margin-top: 14px;
}
#plus-feedback {
  margin: 16px 0;
  overflow-wrap: anywhere;
}
#plus-status .account-card {
  flex-wrap: wrap;
}
#plus-status .account-card > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
#plus-status .badge {
  margin-left: auto;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 2rem;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.04em;
}
h2 {
  font-size: 1.25rem;
  font-weight: 600;
}
h3 {
  font-size: 1rem;
  font-weight: 600;
}
small,
.small {
  font-size: 0.8125rem;
  color: var(--muted);
}
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.boot {
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--muted);
}
.brand-mark {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 12px;
  font-size: 23px;
  font-weight: 750;
  line-height: 1;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.brand .brand-mark {
  width: 29px;
  height: 29px;
  border-radius: 9px;
  font-size: 19px;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 9px;
  color: var(--muted);
}
.icon-btn:hover {
  background: var(--hover);
  color: var(--text);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 17px;
  border-radius: 10px;
  font-size: 0.875rem;
  border: 1px solid var(--line);
  background: var(--panel);
  font-weight: 500;
}
.btn:hover {
  background: var(--hover);
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.btn.primary:hover {
  filter: brightness(1.06);
}
.btn.danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
}
.btn.flat {
  background: transparent;
}
.btn.small {
  padding: 5px 10px;
  min-height: 34px;
  font-size: 0.8125rem;
}
.wide {
  width: 100%;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.between {
  justify-content: space-between;
}
.stack {
  display: grid;
  gap: 18px;
}
.spacer {
  flex: 1;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--hover);
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}
.badge.good {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.badge.bad {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #39473f;
  color: #b7e0ca;
  display: inline-grid;
  place-items: center;
  font-size: 0.875rem;
  font-weight: 600;
  flex-shrink: 0;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.empty-state {
  padding: 65px 20px;
  text-align: center;
  color: var(--muted);
}
.empty-state > svg {
  width: 35px;
  height: 35px;
  margin-bottom: 15px;
  opacity: 0.6;
}
.empty-state h2 {
  color: var(--text);
  margin-bottom: 7px;
}
.empty-state p {
  font-size: 0.875rem;
}
.spinner {
  width: 17px;
  height: 17px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  display: inline-block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  height: 100dvh;
  overflow: hidden;
  transition: grid-template-columns 0.2s ease;
}
.sidebar {
  background: var(--side);
  border-right: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px 12px 12px;
  overflow: hidden;
}
.sidebar-head {
  height: 35px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 8px;
  margin-bottom: 22px;
}
.sidebar-head .brand {
  flex: 1;
}
.sidebar-controls {
  display: flex;
  gap: 1px;
}
.new-chat {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 0.875rem;
  background: var(--panel);
  white-space: nowrap;
}
.new-chat:hover {
  background: var(--hover);
}
.new-chat kbd {
  margin-left: auto;
  color: var(--soft);
  font-size: 0.75rem;
}
.nav-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 13px;
  width: 100%;
  text-align: left;
  border-radius: 9px;
  white-space: nowrap;
  font-size: 0.875rem;
  color: var(--muted);
}
.nav-btn:hover,
.nav-btn.active {
  background: var(--hover);
  color: var(--text);
}
.nav-btn svg {
  width: 18px;
  height: 18px;
}
.nav-btn .count {
  margin-left: auto;
  color: var(--soft);
  font-size: 0.75rem;
}
.sidebar-scroll {
  overflow: auto;
  min-height: 0;
  flex: 1;
  margin-top: 17px;
  padding-right: 2px;
}
.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--soft);
  font-size: 0.75rem;
  padding: 12px 12px 6px;
}
.section-label .icon-btn {
  height: 24px;
  width: 24px;
}
.section-label .icon-btn svg {
  width: 15px;
  height: 15px;
}
.chat-row {
  display: flex;
  align-items: center;
  position: relative;
  gap: 3px;
  border-radius: 8px;
  min-height: 40px;
}
.chat-row:hover,
.chat-row.active {
  background: var(--hover);
}
.chat-title {
  min-width: 0;
  text-align: left;
  flex: 1;
  font-size: 0.875rem;
  padding: 9px 10px 9px 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-trailing {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding-right: 5px;
  gap: 2px;
}
.chat-trailing > svg {
  width: 13px;
  height: 13px;
  color: var(--soft);
}
.chat-trailing .icon-btn {
  width: 27px;
  height: 29px;
  opacity: 0;
}
.chat-trailing .icon-btn svg {
  width: 17px;
  height: 17px;
}
.chat-row:hover .chat-trailing .icon-btn,
.chat-row:focus-within .chat-trailing .icon-btn,
.chat-row.active .chat-trailing .icon-btn {
  opacity: 1;
}
.sidebar-empty {
  font-size: 0.8125rem;
  color: var(--soft);
  padding: 12px;
  line-height: 1.8;
}
.sidebar-footer {
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--line);
}
.user-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 8px 5px;
  border-radius: 9px;
  text-align: left;
}
.user-button:hover {
  background: var(--hover);
}
.user-copy {
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}
.user-copy strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
}
.user-copy span {
  font-size: 0.75rem;
  color: var(--soft);
}
.sidebar-collapsed {
  --sidebar: 72px;
}
.sidebar-collapsed .sidebar {
  padding: 16px 10px 12px;
}
.sidebar-collapsed .sidebar-head {
  padding: 0;
  margin: 0 0 20px;
  justify-content: center;
}
.sidebar-collapsed .sidebar-head .brand,
.sidebar-collapsed .sidebar-search,
.sidebar-collapsed .sidebar-scroll,
.sidebar-collapsed .sidebar-footer > .nav-btn,
.sidebar-collapsed .user-copy,
.sidebar-collapsed .user-button > svg,
.sidebar-collapsed .new-chat span,
.sidebar-collapsed .new-chat kbd {
  display: none;
}
.sidebar-collapsed .new-chat {
  padding: 12px;
  justify-content: center;
  border-color: transparent;
  background: none;
}
.sidebar-collapsed .sidebar-footer {
  margin-top: auto;
  border: 0;
}
.sidebar-collapsed .user-button {
  padding: 6px;
  justify-content: center;
}
.sidebar-collapsed .sidebar-controls {
  display: flex;
}
.sidebar-collapsed .collapse-button svg {
  transform: scaleX(-1);
}
.sidebar-scrim {
  display: none;
}
.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
}
.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  flex-shrink: 0;
}
.mobile-menu {
  display: none;
}
.model-select {
  appearance: none;
  border: 0;
  color: var(--text);
  padding: 8px 30px 8px 8px;
  background: transparent;
  max-width: 225px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239da0a8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.model-select:hover {
  background-color: var(--panel);
}
.model-select option {
  background: var(--panel);
  color: var(--text);
}
.top-title {
  font-size: 0.8125rem;
  color: var(--soft);
  max-width: 40%;
  margin-left: 4px;
}
.topbar .icon-btn {
  margin-left: auto;
}
.topbar .share-button {
  margin-left: auto;
}
.scroll-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scroll-behavior: smooth;
}
.welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 810px;
  margin: auto;
  min-height: calc(100dvh - 300px);
  padding: 50px 28px 35px;
  text-align: center;
}
.welcome-logo {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 16px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}
.welcome-logo svg {
  width: 27px;
  height: 27px;
}
.welcome h1 {
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  margin-bottom: 10px;
}
.welcome-sub {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-bottom: 34px;
}
.suggestions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: min(100%, 580px);
  text-align: left;
}
.suggestion {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: color-mix(in srgb, var(--panel) 60%, transparent);
  padding: 15px 17px;
  text-align: left;
  transition:
    border-color 0.15s,
    transform 0.15s;
}
.suggestion:hover {
  border-color: var(--soft);
  transform: translateY(-2px);
}
.suggestion svg {
  color: var(--muted);
  width: 18px;
  height: 18px;
  margin-bottom: 7px;
}
.suggestion strong {
  font-size: 0.875rem;
  font-weight: 500;
  display: block;
}
.suggestion span {
  color: var(--soft);
  font-size: 0.8125rem;
}
.notice-bar {
  margin: 0 28px 12px;
  padding: 10px 15px;
  border-radius: 9px;
  font-size: 0.8125rem;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 9px;
}
.notice-bar svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.messages {
  max-width: 850px;
  margin: 0 auto;
  padding: 20px 35px 40px;
}
.message {
  margin: 0 0 32px;
  min-width: 0;
}
.message.user {
  display: flex;
  justify-content: flex-end;
}
.user-bubble {
  background: var(--hover);
  padding: 11px 18px;
  border-radius: 20px 20px 5px 20px;
  max-width: 85%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.7;
}
.assistant-body {
  font-size: 1rem;
  line-height: 1.85;
  overflow-wrap: anywhere;
}
.assistant-body p {
  margin-bottom: 14px;
}
.assistant-body > :last-child {
  margin-bottom: 0;
}
.assistant-body h1,
.assistant-body h2,
.assistant-body h3 {
  margin: 28px 0 12px;
  letter-spacing: 0;
}
.assistant-body h1 {
  font-size: 1.6rem;
}
.assistant-body h2 {
  font-size: 1.35rem;
}
.assistant-body h3 {
  font-size: 1.1rem;
}
.assistant-body ol,
.assistant-body ul {
  padding-left: 25px;
}
.assistant-body li {
  padding-left: 3px;
  margin-bottom: 7px;
}
.assistant-body blockquote {
  border-left: 3px solid var(--soft);
  margin: 20px 0;
  padding: 2px 20px;
  color: var(--muted);
}
.assistant-body code {
  background: var(--hover);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.875em;
}
.assistant-body pre {
  position: relative;
  overflow: auto;
  background: var(--side);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 40px 18px 18px;
  line-height: 1.65;
}
.assistant-body pre code {
  padding: 0;
  background: none;
  font-size: 0.8125rem;
  white-space: pre;
}
.code-copy {
  position: absolute;
  top: 7px;
  right: 8px;
  font-size: 0.75rem;
  color: var(--muted);
  padding: 3px 8px;
  border-radius: 5px;
}
.code-copy:hover {
  background: var(--hover);
}
.assistant-body table {
  display: block;
  overflow: auto;
  border-collapse: collapse;
  font-size: 0.875rem;
  max-width: 100%;
}
.assistant-body td,
.assistant-body th {
  padding: 10px 14px;
  border: 1px solid var(--line);
  text-align: left;
}
.message-footer {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  color: var(--soft);
  font-size: 0.75rem;
}
.message-footer .icon-btn {
  width: 30px;
  height: 28px;
}
.message-footer .icon-btn svg {
  width: 16px;
  height: 16px;
}
.message-footer .model-label {
  margin-left: 6px;
}
.pending-label {
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 0.875rem;
}
.message.interrupted .assistant-body {
  color: var(--muted);
}
.interrupted-note {
  font-size: 0.8125rem;
  color: var(--soft);
  margin-top: 7px;
}
.generated-image {
  display: block;
  max-width: 100%;
  max-height: 640px;
  border-radius: 12px;
  border: 1px solid var(--line);
  margin: 12px 0;
  cursor: zoom-in;
}
.image-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
.composer-area {
  padding: 8px 28px 18px;
  flex-shrink: 0;
  background: linear-gradient(transparent, var(--bg) 12%);
}
.composer-wrap {
  max-width: 790px;
  margin: auto;
}
.composer {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 20px;
  padding: 17px 18px 12px;
  box-shadow: 0 4px 22px #0000000d;
}
.composer:focus-within {
  border-color: var(--soft);
}
.composer textarea {
  display: block;
  width: 100%;
  resize: none;
  background: none;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.7;
  min-height: 48px;
  max-height: 210px;
  padding: 0 0 10px;
}
.composer textarea:focus-visible {
  outline: none;
}
.composer textarea::placeholder {
  color: var(--soft);
}
.composer-tools {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 35px;
}
.mode-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  font-size: 0.8125rem;
  color: var(--muted);
  border-radius: 8px;
  white-space: nowrap;
}
.mode-btn svg {
  width: 16px;
  height: 16px;
}
.mode-btn:hover {
  background: var(--hover);
}
.mode-btn.active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.send-btn {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 7px 14px;
  border-radius: 11px;
  min-height: 36px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.8125rem;
  margin-left: auto;
}
.send-btn svg {
  width: 17px;
  height: 17px;
}
.send-btn.stop {
  background: var(--hover);
  color: var(--text);
}
.aspect-select {
  appearance: none;
  padding: 5px 22px 5px 9px;
  font-size: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel);
  max-width: 100px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239da0a8'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
}
.composer-hint {
  text-align: center;
  color: var(--soft);
  font-size: 0.75rem;
  margin: 9px 0 0;
}
.blocked-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0 auto 12px;
  max-width: 790px;
}
.locked-note {
  text-align: center;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  font-size: 0.875rem;
  color: var(--muted);
}
.locked-note .btn {
  margin-left: 14px;
}
.popover {
  position: fixed;
  z-index: 80;
  width: 216px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
  animation: appear 0.1s ease;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  font-size: 0.875rem;
  padding: 9px 11px;
  border-radius: 8px;
  min-height: 40px;
}
.menu-item:hover {
  background: var(--hover);
}
.menu-item svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}
.menu-item.danger,
.menu-item.danger svg {
  color: var(--danger);
}
.menu-separator {
  height: 1px;
  background: var(--line);
  margin: 5px;
}
.menu-caption {
  padding: 9px 11px;
  font-size: 0.75rem;
  color: var(--soft);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  color: var(--text);
  padding: 0;
  width: min(92vw, 500px);
  max-height: 88dvh;
  box-shadow: var(--shadow);
  overflow: auto;
}
dialog::backdrop {
  background: #0009;
  backdrop-filter: blur(4px);
}
.modal-head {
  padding: 20px 24px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.modal-head h2 {
  margin: 0;
  font-size: 1.125rem;
}
.modal-body {
  padding: 0 24px 24px;
}
.modal-body > p {
  font-size: 0.875rem;
  color: var(--muted);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}
.field {
  display: grid;
  gap: 7px;
  font-size: 0.875rem;
}
.field input,
.field textarea,
.field select,
.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.875rem;
  min-height: 43px;
}
.field textarea {
  resize: vertical;
  min-height: 100px;
}
.field label {
  font-size: 0.875rem;
  font-weight: 500;
}
.field small {
  font-weight: 400;
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--soft);
}
.field input[readonly] {
  color: var(--muted);
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
}
.checkbox input {
  accent-color: var(--accent);
  width: 17px;
  height: 17px;
}
.form-error {
  color: var(--danger);
  font-size: 0.8125rem;
  min-height: 0;
}
.form-error:empty {
  display: none;
}
.info-box {
  padding: 12px 14px;
  border-radius: 9px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.8125rem;
}
.usage-meter {
  height: 7px;
  border-radius: 10px;
  background: var(--hover);
  overflow: hidden;
  margin-top: 9px;
}
.usage-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}
.usage-grid {
  display: grid;
  gap: 24px;
  padding-top: 10px;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--line);
  padding: 18px 22px;
}
.search-box svg {
  color: var(--soft);
}
.search-box input {
  background: none;
  color: var(--text);
  border: 0;
  outline: 0;
  flex: 1;
  min-width: 0;
  font-size: 1rem;
}
.search-results {
  padding: 8px 10px;
  max-height: 52dvh;
  overflow: auto;
}
.search-result {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 12px;
  border-radius: 9px;
}
.search-result:hover {
  background: var(--hover);
}
.search-result svg {
  color: var(--muted);
  width: 17px;
  height: 17px;
}
.search-result span {
  font-size: 0.875rem;
}
.search-result small {
  margin-left: auto;
}
.search-empty {
  padding: 24px;
  color: var(--soft);
  font-size: 0.875rem;
  text-align: center;
}
.code-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
  margin-top: 14px;
}
.invite-code {
  font-family: ui-monospace, monospace;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: var(--bg);
  border-radius: 7px;
  font-size: 0.875rem;
  justify-content: space-between;
}
.account-card {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 23px;
}
.account-card .avatar {
  width: 46px;
  height: 46px;
  font-size: 1.1rem;
}
.account-card strong {
  display: block;
}
.account-card small {
  display: block;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(15px);
  z-index: 150;
  background: var(--text);
  color: var(--bg);
  font-size: 0.875rem;
  padding: 11px 18px;
  border-radius: 11px;
  box-shadow: var(--shadow);
  max-width: min(90vw, 600px);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
}
#toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.auth-page {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(350px, 1fr) minmax(460px, 1fr);
}
.auth-story {
  padding: 42px 9%;
  background: var(--side);
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  border-right: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.auth-story:after {
  content: "";
  position: absolute;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  right: -120px;
  bottom: -200px;
  border: 1px solid color-mix(in srgb, var(--accent) 15%, transparent);
  box-shadow:
    0 0 0 65px color-mix(in srgb, var(--accent) 3%, transparent),
    0 0 0 130px color-mix(in srgb, var(--accent) 2%, transparent);
  pointer-events: none;
}
.story-content {
  margin: auto 0;
  padding: 70px 0;
  max-width: 440px;
}
.story-content h1 {
  font-size: 2.65rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.03em;
}
.story-content h1 em {
  font-style: normal;
  color: var(--accent);
}
.story-content > p {
  color: var(--muted);
  font-size: 0.9375rem;
  max-width: 340px;
}
.story-features {
  display: grid;
  gap: 18px;
  margin-top: 45px;
}
.story-feature {
  display: flex;
  gap: 13px;
  align-items: center;
  font-size: 0.875rem;
  color: var(--muted);
}
.story-feature svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}
.story-footer {
  font-size: 0.75rem;
  color: var(--soft);
  padding-top: 30px;
}
.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px 36px;
  position: relative;
}
.auth-card {
  width: 100%;
  max-width: 350px;
}
.auth-card h2 {
  font-size: 1.65rem;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
}
.auth-card > p {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 28px;
}
.auth-tabs {
  display: flex;
  background: var(--side);
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 26px;
}
.auth-tabs button {
  flex: 1;
  padding: 7px;
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--muted);
}
.auth-tabs button.active {
  background: var(--hover);
  color: var(--text);
}
.auth-card .btn {
  min-height: 45px;
  margin-top: 7px;
}
.auth-footnote {
  text-align: center;
  font-size: 0.75rem;
  color: var(--soft);
  margin-top: 23px;
}
.auth-theme {
  position: absolute;
  top: 24px;
  right: 25px;
}
.mobile-brand {
  display: none;
  margin-bottom: 35px;
}
.list-page {
  max-width: 950px;
  width: 100%;
  margin: 0 auto;
  padding: 30px 40px 80px;
}
.page-title {
  margin-bottom: 30px;
}
.page-title h1 {
  font-size: 1.6rem;
  margin-bottom: 5px;
}
.page-title p {
  color: var(--muted);
  font-size: 0.875rem;
}
.record-card {
  display: flex;
  gap: 15px;
  align-items: center;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 10px;
  background: var(--panel);
}
.record-card > svg {
  color: var(--soft);
  width: 20px;
  height: 20px;
}
.record-card > div {
  min-width: 0;
  flex: 1;
}
.record-card strong {
  font-size: 0.9375rem;
  display: block;
  font-weight: 500;
}
.record-card small {
  font-size: 0.75rem;
}
.record-card .btn {
  flex-shrink: 0;
}
.record-card > .record-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
@media (max-width: 620px) {
  .record-card {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .record-card > .record-actions {
    flex-basis: 100%;
    justify-content: flex-end;
  }
  .record-card > .record-copy {
    flex: 1;
  }
}
.admin-content {
  flex: 1;
  overflow: auto;
  padding: 24px 35px 60px;
}
.admin-inner {
  max-width: 1180px;
  margin: auto;
}
.admin-tabs {
  display: flex;
  gap: 5px;
  border-bottom: 1px solid var(--line);
  margin: 0 0 28px;
  overflow: auto;
}
.admin-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 14px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  white-space: nowrap;
  font-size: 0.875rem;
}
.admin-tab svg {
  width: 17px;
  height: 17px;
}
.admin-tab.active {
  border-bottom-color: var(--accent);
  color: var(--text);
}
.admin-page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 23px;
}
.admin-page-head h1 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}
.admin-page-head p {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
}
.history-filter {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.user-history-link {
  text-align: left;
  color: var(--accent);
  padding: 0;
}
.user-history-link:hover {
  text-decoration: underline;
}
.history-filter .field {
  flex: 1;
  min-width: 160px;
  margin: 0;
}
.history-filter .field:first-child {
  flex: 2;
}
.history-list {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.history-row {
  display: flex;
  width: 100%;
  align-items: center;
  text-align: left;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.history-row:last-child {
  border-bottom: 0;
}
.history-row:hover {
  background: var(--hover);
}
.history-row-copy {
  flex: 1;
  min-width: 0;
}
.history-row strong {
  display: block;
  font-size: 1rem;
  overflow-wrap: anywhere;
}
.history-row-copy > span {
  display: block;
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 4px;
}
.history-badges {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.history-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.history-reader-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}
.history-reader-meta .history-badges {
  margin: 0;
}
.history-reader-meta > button {
  margin-left: auto;
}
.admin-transcript .messages {
  max-width: 900px;
  padding: 20px 0;
}
.history-message-meta {
  color: var(--muted);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
  margin-bottom: 10px;
}
.history-message {
  min-width: 0;
}
.history-message + .history-message {
  margin-top: 28px;
}
.admin-transcript .message {
  width: 100%;
}
.admin-transcript .message.user {
  justify-content: flex-start;
}
.admin-transcript .user-bubble {
  max-width: 100%;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
  margin: 22px 0;
}
.stat-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  background: var(--panel);
}
.stat-card .row {
  color: var(--muted);
  font-size: 0.8125rem;
  gap: 8px;
}
.stat-card .row svg {
  width: 16px;
  height: 16px;
}
.stat-card strong {
  display: block;
  font-size: 1.9rem;
  letter-spacing: -0.04em;
  margin: 9px 0 0;
  font-weight: 550;
}
.stat-card small {
  font-size: 0.75rem;
}
.panel {
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
}
.panel h2 {
  font-size: 1rem;
  margin-bottom: 18px;
}
.panel > p {
  font-size: 0.875rem;
  color: var(--muted);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 18px;
}
.chart {
  height: 190px;
  display: flex;
  gap: 13px;
  align-items: flex-end;
  padding-top: 25px;
}
.chart-col {
  flex: 1;
  text-align: center;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}
.chart-bars {
  height: 135px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  width: 100%;
}
.chart-bar {
  width: 15px;
  max-width: 35%;
  background: var(--accent);
  min-height: 2px;
  border-radius: 4px 4px 0 0;
}
.chart-bar.image {
  background: var(--soft);
  opacity: 0.75;
}
.chart-col small {
  font-size: 0.6875rem;
  white-space: nowrap;
}
.legend {
  display: flex;
  gap: 16px;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 15px;
}
.legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
}
.legend i.gray {
  background: var(--soft);
}
.activity-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.8125rem;
}
.activity-row:last-child {
  border: 0;
}
.activity-row span {
  color: var(--muted);
}
.activity-row small {
  display: block;
  font-size: 0.75rem;
  margin-top: 2px;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  white-space: nowrap;
}
.data-table th {
  text-align: left;
  color: var(--muted);
  background: var(--panel);
  font-weight: 500;
  padding: 13px 17px;
  border-bottom: 1px solid var(--line);
}
.data-table td {
  padding: 14px 17px;
  border-bottom: 1px solid var(--line);
}
.data-table tbody tr:last-child td {
  border: 0;
}
.data-table tbody tr:hover {
  background: color-mix(in srgb, var(--hover) 35%, transparent);
}
.data-table .sub {
  display: block;
  font-size: 0.75rem;
  color: var(--soft);
  margin-top: 2px;
}
.settings-form {
  max-width: 690px;
}
.settings-form .panel {
  margin-bottom: 18px;
}
.settings-form .field {
  margin-bottom: 18px;
}
.settings-form .field:last-child {
  margin-bottom: 0;
}
.settings-form textarea.mono {
  font-family: ui-monospace, monospace;
  min-height: 130px;
}
.admin-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  font-size: 0.875rem;
}
.admin-status > svg {
  color: var(--accent);
}
.share-page {
  max-width: 900px;
  margin: auto;
  padding-bottom: 70px;
}
.share-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 30px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.share-header h1 {
  font-size: 1.25rem;
  margin: 0;
}
.share-header .btn {
  margin-left: auto;
}
.share-page .messages {
  padding-top: 28px;
}
.image-preview {
  max-width: 100%;
  max-height: 72dvh;
  display: block;
  margin: auto;
}
.no-data {
  padding: 30px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--soft);
}
@media (min-width: 1400px) {
  .welcome {
    min-height: calc(100dvh - 340px);
  }
  .welcome h1 {
    font-size: 2.15rem;
  }
}
@media (max-width: 1050px) {
  .top-title {
    display: none;
  }
  .admin-content {
    padding: 18px 22px 40px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .auth-story {
    padding-left: 10%;
    padding-right: 10%;
  }
  .story-content h1 {
    font-size: 2.1rem;
  }
}
@media (max-width: 760px) {
  .shell,
  .shell.sidebar-collapsed {
    display: block;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(85vw, 290px);
    z-index: 55;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    padding: 16px 12px 12px !important;
  }
  .sidebar-open .sidebar {
    transform: translateX(0);
  }
  .sidebar-open .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: #0008;
    z-index: 50;
  }
  .sidebar-collapsed .sidebar-head .brand {
    display: flex;
  }
  .sidebar-collapsed .sidebar-head {
    padding-left: 8px;
    justify-content: initial;
    margin-bottom: 22px;
  }
  .sidebar-collapsed .sidebar-search,
  .sidebar-collapsed .sidebar-footer > .nav-btn {
    display: flex;
  }
  .sidebar-collapsed .sidebar-scroll {
    display: block;
  }
  .sidebar-collapsed .sidebar-footer {
    border-top: 1px solid var(--line);
    margin-top: 10px;
  }
  .sidebar-collapsed .user-copy {
    display: block;
  }
  .sidebar-collapsed .user-button > svg {
    display: block;
  }
  .sidebar-collapsed .user-button {
    padding: 10px 8px 5px;
    justify-content: initial;
  }
  .sidebar-collapsed .new-chat {
    padding: 11px 13px;
    border: 1px solid var(--line);
    background: var(--panel);
    justify-content: initial;
  }
  .sidebar-collapsed .new-chat span,
  .sidebar-collapsed .new-chat kbd {
    display: block;
  }
  .workspace {
    height: 100dvh;
  }
  .mobile-menu {
    display: inline-grid;
  }
  .topbar {
    height: 62px;
    padding: 0 13px;
    gap: 8px;
  }
  .model-select {
    font-size: 0.9375rem;
    max-width: 210px;
  }
  .topbar > .icon-btn:not(.mobile-menu) {
    margin-left: auto;
  }
  .topbar .share-button {
    padding: 7px 9px;
    min-height: 34px;
    border: 0;
    background: none;
    font-size: 0;
    gap: 0;
  }
  .share-button svg {
    width: 18px;
    height: 18px;
  }
  .welcome {
    padding: 25px 22px;
    min-height: calc(100dvh - 280px);
  }
  .welcome h1 {
    font-size: 1.7rem;
  }
  .welcome-sub {
    font-size: 0.875rem;
    margin-bottom: 25px;
  }
  .welcome-logo {
    margin-bottom: 19px;
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }
  .suggestions {
    gap: 9px;
  }
  .suggestion {
    padding: 13px;
    border-radius: 11px;
  }
  .suggestion span {
    display: none;
  }
  .suggestion strong {
    font-size: 0.8125rem;
  }
  .suggestion svg {
    margin-bottom: 3px;
  }
  .composer-area {
    padding: 6px 12px max(12px, env(safe-area-inset-bottom));
  }
  .composer {
    padding: 14px 13px 10px;
    border-radius: 17px;
  }
  .composer textarea {
    min-height: 45px;
  }
  .mode-btn {
    padding: 5px 7px;
    font-size: 0.75rem;
    gap: 5px;
  }
  .send-btn {
    padding: 7px 11px;
    gap: 5px;
  }
  .send-btn svg {
    display: none;
  }
  .aspect-select {
    font-size: 0.6875rem;
    max-width: 78px;
    padding-left: 6px;
  }
  .composer-hint {
    font-size: 0.6875rem;
    margin-top: 7px;
  }
  .messages {
    padding: 15px 20px 30px;
  }
  .message {
    margin-bottom: 25px;
  }
  .user-bubble {
    max-width: 92%;
    padding: 10px 15px;
  }
  .assistant-body {
    font-size: 1rem;
    line-height: 1.8;
  }
  .notice-bar {
    margin: 0 14px 10px;
  }
  .blocked-banner {
    font-size: 0.75rem;
    padding: 9px 11px;
  }
  .blocked-banner .btn {
    font-size: 0.75rem;
    padding: 5px 9px;
    min-height: 30px;
  }
  .chat-trailing .icon-btn {
    opacity: 1;
  }
  .topbar .mobile-menu {
    margin-left: 0;
  }
  .sidebar-head .brand {
    flex: 1;
  }
  .auth-page {
    display: block;
  }
  .auth-story {
    display: none;
  }
  .auth-form-panel {
    min-height: 100dvh;
    padding: 70px 28px 35px;
  }
  .mobile-brand {
    display: flex;
  }
  .auth-card h2 {
    font-size: 1.5rem;
  }
  .admin-content {
    padding: 14px 17px 40px;
  }
  .admin-tabs {
    margin-bottom: 22px;
  }
  .admin-tab {
    padding: 10px 11px;
    font-size: 0.8125rem;
    gap: 5px;
  }
  .admin-tab svg {
    display: none;
  }
  .admin-page-head {
    align-items: flex-start;
  }
  .admin-page-head h1 {
    font-size: 1.3rem;
  }
  .admin-page-head p {
    font-size: 0.8125rem;
  }
  .admin-page-head .btn {
    font-size: 0.75rem;
    min-height: 35px;
    padding: 7px 10px;
  }
  .stat-card {
    padding: 14px;
  }
  .stats {
    gap: 9px;
  }
  .stat-card strong {
    font-size: 1.65rem;
  }
  .panel {
    padding: 17px;
  }
  .list-page {
    padding: 22px 18px 40px;
  }
  .record-card {
    padding: 13px;
    gap: 10px;
  }
  .record-card > .btn {
    font-size: 0.75rem;
    padding: 6px 9px;
    min-height: 34px;
  }
  .record-card strong {
    font-size: 0.875rem;
  }
  .field-row {
    gap: 10px;
  }
  .share-header {
    padding: 20px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .share-header h1 {
    font-size: 1.05rem;
    width: 100%;
    order: 3;
  }
  .share-header .btn {
    font-size: 0.75rem;
  }
  .generated-image {
    max-height: 500px;
  }
  .modal-head {
    padding: 17px 19px 12px;
  }
  .modal-body {
    padding: 0 19px 21px;
  }
  .welcome .eyebrow {
    font-size: 0.75rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
.scroll-area {
  display: flex;
  flex-direction: column;
}
#chat-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.welcome {
  flex: 1;
  min-height: 0;
  width: 100%;
}
.messages {
  width: 100%;
}
.new-chat kbd {
  display: none !important;
}
.auth-reset {
  display: block;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 0.8125rem;
}
.auth-reset:hover {
  color: var(--text);
}
.admin-content,
.admin-inner,
.dashboard-grid > .panel {
  min-width: 0;
}
.admin-tabs {
  scrollbar-width: none;
}
.admin-tabs::-webkit-scrollbar {
  display: none;
}
.admin-status > span {
  flex: 1;
  min-width: 0;
}
.admin-status > .btn {
  flex-shrink: 0;
  white-space: nowrap;
}
.topbar > strong {
  white-space: nowrap;
}
.new-chat {
  position: relative;
}
@media (max-width: 760px) {
  .chart {
    gap: 6px;
  }
  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .admin-status {
    flex-wrap: wrap;
  }
  .admin-status > .btn {
    margin-left: 31px;
  }
}
