:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --text: #172033;
  --muted: #667085;
  --line: #d9e2ec;
  --accent: #2364d8;
  --accent-2: #0f9f8f;
  --danger: #c2413b;
  --shadow: 0 18px 45px rgba(30, 50, 80, 0.08);
  --radius: 8px;
  --chat-sidebar-width: 292px;
  --chat-content-width: 940px;
  --chat-side-gutter: clamp(24px, 6vw, 80px);
  --chat-composer-height: 122px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

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

button {
  border: 0;
  cursor: pointer;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(460px, 0.9fr) 1.1fr;
  background: #f4f7fb;
}

.login-panel {
  padding: 56px 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #fff;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 760;
  letter-spacing: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  font-weight: 800;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.avatar-badge {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  background: #e8f7ef;
  border: 1px solid #bfe7d0;
  color: #087443;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  user-select: none;
}

.login-card {
  margin-top: 54px;
  max-width: 430px;
}

.login-card h1 {
  margin: 0 0 14px;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: 0;
}

.login-card p {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.6;
}

.login-kicker {
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-submit {
  width: 100%;
  min-height: 46px;
}

.login-footnote {
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field label {
  color: #344054;
  font-size: 13px;
  font-weight: 650;
}

.field input,
.field select,
.field textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 13px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(35, 100, 216, 0.12);
}

.primary-btn,
.ghost-btn,
.danger-btn {
  border-radius: var(--radius);
  padding: 11px 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primary-btn {
  background: var(--accent);
  color: #fff;
}

.ghost-btn {
  background: #edf3fa;
  color: #203047;
}

.danger-btn {
  background: #fdebea;
  color: var(--danger);
}

.login-visual {
  padding: 64px;
  display: flex;
  align-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(244, 247, 251, 0.92)),
    #edf3fa;
}

.preview-board {
  width: 100%;
  max-width: 680px;
  min-height: 560px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(217, 226, 236, 0.95);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 26px;
  display: grid;
  align-content: start;
  gap: 22px;
}

.preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.login-brand-row,
.status-dashboard,
.model-status-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 22px;
}

.login-brand-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.login-brand-row img {
  width: 230px;
  max-width: 32%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  flex: 0 0 auto;
}

.login-brand-row strong,
.dashboard-summary strong,
.model-status-card .preview-top strong {
  display: block;
  font-size: 20px;
}

.login-brand-row span,
.dashboard-summary p {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.status-dashboard {
  display: grid;
  gap: 16px;
}

.dashboard-summary {
  display: grid;
  gap: 8px;
}

.dashboard-summary .status-dot {
  justify-self: start;
}

.dashboard-summary p {
  margin: 0;
}

.service-status-card {
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 16px;
}

.service-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #1f2937;
  font-weight: 750;
}

.service-status-head > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.service-status-head > span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.service-ok {
  color: #22c55e;
}

.service-ok.degraded {
  color: #f59e0b;
}

.service-ok.loading {
  color: #64748b;
}

.service-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.service-metrics span {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 750;
  padding: 8px 10px;
  text-align: center;
}

.uptime-bars {
  display: grid;
  grid-template-columns: repeat(42, 1fr);
  gap: 4px;
  margin-top: 16px;
}

.uptime-bars span {
  height: 24px;
  border-radius: 999px;
  background: #22c55e;
}

.uptime-bars .warn {
  background: #f59e0b;
}

.uptime-bars .off {
  background: #ef4444;
}

.service-legend {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.service-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.service-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
}

.service-legend i.warn {
  background: #f59e0b;
}

.service-legend i.off {
  background: #ef4444;
}

.model-status-card {
  display: grid;
  gap: 14px;
}

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

.model-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  background: #f8fafc;
}

.model-status-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.model-status-row span > strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #111827;
  font-size: 14px;
  font-weight: 800;
  background: transparent;
  padding: 0;
}

.model-status-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.model-status-row > strong {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}

.model-status-row.online > strong {
  background: #ecfdf3;
  color: #067647;
}

.model-status-row.offline > strong {
  background: #f1f5f9;
  color: #64748b;
}

.status-dot {
  border: 1px solid #b7dbc9;
  border-radius: 999px;
  background: #ecfdf3;
  color: #067647;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 750;
}

.status-dot.degraded {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #b45309;
}

.status-dot.loading {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

.login-info-list {
  display: grid;
  gap: 14px;
}

.login-info-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.login-info-item span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.login-info-item strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
}

.login-info-item p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.consent-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.46);
}

.consent-modal {
  width: min(620px, 100%);
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
  padding: 24px;
}

.consent-modal h2 {
  margin: 0 0 14px;
  font-size: 22px;
}

.consent-modal p {
  margin: 0 0 14px;
  color: #344054;
  line-height: 1.7;
}

.consent-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.share-modal {
  width: min(520px, 100%);
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
  padding: 24px;
}

.share-modal h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.model-permissions-dialog {
  width: min(920px, 100%);
}

.model-permissions-dialog form {
  display: grid;
  gap: 16px;
}

.model-permissions-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.model-permissions-scroll {
  max-height: min(58vh, 560px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 4px 0;
}

.model-permissions-empty {
  margin: 0;
  padding: 18px;
}

.model-permission-group + .model-permission-group {
  border-top: 1px solid var(--line);
}

.model-permission-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 8px;
  color: #344054;
}

.model-permission-group-header strong {
  font-size: 14px;
}

.model-permission-group-header span {
  color: var(--muted);
  font-size: 12px;
}

.model-permission-list {
  display: grid;
  gap: 4px;
  padding: 0 12px 12px;
}

.model-permission-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 8px;
}

.model-permission-row:hover {
  background: #eef5ff;
}

.model-permission-row input {
  margin-top: 2px;
  accent-color: var(--accent);
}

.model-permission-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.model-permission-meta strong {
  font-size: 14px;
  font-weight: 650;
}

.model-permission-meta small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.ui-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(2px);
}

.ui-dialog-card {
  width: min(520px, 100%);
  border: 1px solid #d0d7de;
  border-radius: 18px;
  background: #fff;
  color: #24292f;
  box-shadow: 0 24px 80px rgba(31, 35, 40, 0.2);
  padding: 18px;
}

.ui-dialog-card.compact {
  width: min(440px, 100%);
}

.python-dialog {
  width: min(880px, 100%);
}

.ui-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.ui-dialog-header h2 {
  margin: 0;
  color: #24292f;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: 0;
}

.ui-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  background: transparent;
  color: #57606a;
  font-size: 24px;
  line-height: 1;
}

.ui-icon-btn:hover {
  background: #f6f8fa;
  color: #24292f;
}

.ui-dialog-copy {
  margin: 0 0 16px;
  color: #57606a;
  font-size: 14px;
  line-height: 1.6;
}

.ui-dialog-field {
  display: grid;
  gap: 8px;
}

.ui-dialog-field span {
  color: #57606a;
  font-size: 13px;
  font-weight: 600;
}

.ui-dialog-field input,
.ui-dialog-field select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #d0d7de;
  border-radius: 12px;
  background: #fff;
  color: #24292f;
  padding: 0 14px;
  outline: none;
  font-size: 15px;
}

.ui-dialog-field input:focus,
.ui-dialog-field select:focus {
  border-color: #8c959f;
  box-shadow: 0 0 0 3px rgba(140, 149, 159, 0.18);
}

.ui-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
}

.python-result-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  color: #57606a;
  font-size: 13px;
}

.python-result-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.python-result-badge.success {
  background: #e8f8ef;
  color: #067647;
}

.python-result-badge.error {
  background: #fdebea;
  color: #b42318;
}

.python-result-section {
  margin-bottom: 14px;
}

.python-result-label {
  margin-bottom: 8px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.python-result-pre {
  margin: 0;
  max-height: 180px;
  overflow: auto;
  border: 1px solid #d0d7de;
  border-radius: 12px;
  background: #f8fafc;
  color: #24292f;
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.python-result-pre.error {
  background: #fff5f5;
  color: #9f1239;
  border-color: #f5c2c7;
}

.ui-primary-btn,
.ui-secondary-btn {
  min-height: 40px;
  border-radius: 999px;
  padding: 0 16px;
  font-weight: 650;
}

.ui-primary-btn {
  background: #24292f;
  color: #fff;
}

.ui-primary-btn:hover {
  background: #111827;
}

.ui-primary-btn.danger {
  background: #dc2626;
}

.ui-primary-btn.danger:hover {
  background: #b91c1c;
}

.ui-secondary-btn {
  border: 1px solid #d0d7de;
  background: #fff;
  color: #24292f;
}

.ui-secondary-btn:hover {
  background: #f6f8fa;
}

.ui-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 1300;
  transform: translateX(-50%);
  min-height: 42px;
  max-width: min(420px, calc(100vw - 32px));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d0d7de;
  border-radius: 999px;
  background: #24292f;
  color: #fff;
  padding: 0 16px;
  box-shadow: 0 16px 48px rgba(31, 35, 40, 0.22);
  font-size: 14px;
  font-weight: 600;
}

.ui-toast.success {
  background: #24292f;
}

.ui-toast.error {
  background: #b42318;
  border-color: #b42318;
}

.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 16px;
}

.mini-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.mini-panel h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.metric {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid #edf1f5;
}

.metric strong {
  font-size: 24px;
}

.app-shell {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: 256px 1fr;
  overflow: hidden;
}

.user-chat-shell {
  grid-template-columns: var(--chat-sidebar-width) minmax(0, 1fr);
  background: #fff;
  color: #1f2328;
}

.mobile-sidebar-backdrop,
.mobile-menu-btn {
  display: none;
}

.public-share-shell {
  min-height: 100vh;
  background: var(--bg);
  display: grid;
  grid-template-rows: auto 1fr;
}

.public-share-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.public-share-header > div:first-child {
  display: grid;
  gap: 4px;
}

.public-share-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.public-share-panel {
  margin: 24px auto;
  width: min(1120px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 0;
  overflow: hidden;
}

.project-share-panel {
  width: min(980px, calc(100vw - 32px));
}

.conversation-share-panel {
  width: min(980px, calc(100vw - 32px));
}

.public-share-note {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: #f8fafc;
}

.public-share-messages {
  width: 100%;
  max-height: none;
  overflow: visible;
  padding: 22px 24px 28px;
  gap: 18px;
}

.public-share-single-messages {
  max-height: none;
}

.public-share-project-list {
  display: grid;
  gap: 18px;
  padding: 18px;
  background: #f6f8fb;
}

.public-shared-conversation {
  overflow: hidden;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #fff;
}

.public-shared-conversation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid #e7edf5;
  background: #fbfcfe;
}

.public-shared-conversation-header span {
  display: block;
  margin-bottom: 4px;
  color: #667085;
  font-size: 12px;
  font-weight: 750;
}

.public-shared-conversation-header h2 {
  margin: 0;
  color: #172033;
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: 0;
}

.public-shared-conversation-header small {
  flex: 0 0 auto;
  color: #667085;
  font-size: 13px;
}

.public-share-empty {
  margin: 0;
  padding: 18px;
  background: #fff;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
}

.public-share-shell .message {
  max-width: min(78%, 680px);
  min-width: 0;
  color: #172033;
  font-size: 15px;
  line-height: 1.68;
  overflow-wrap: anywhere;
}

.public-share-shell .message.assistant {
  justify-self: start;
  background: #fff;
}

.public-share-shell .message.user {
  justify-self: end;
  background: #edf5ff;
}

.public-share-shell .message-content p:first-child {
  margin-top: 0;
}

.public-share-shell .message-content p:last-child {
  margin-bottom: 0;
}

.public-share-shell .attachment {
  max-width: 100%;
}

.public-share-shell .attachment img {
  width: min(220px, 100%);
  height: auto;
  max-height: 220px;
}

.public-share-shell .markdown-table-wrap {
  max-width: 100%;
}

.public-share-shell .markdown-table {
  min-width: 100%;
}

.sidebar {
  background: #14213a;
  color: #e7eef9;
  padding: 18px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow: hidden;
}

.user-chat-shell .sidebar {
  background: #000;
  color: #f4f4f4;
  border-right: 1px solid #202123;
  padding: 16px 14px 12px;
  gap: 16px;
}

.sidebar .brand {
  color: #fff;
}

.user-chat-shell .brand {
  min-height: 42px;
  justify-content: space-between;
}

.user-chat-shell .brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: transparent;
  border: 1.5px solid #f4f4f4;
  color: #f4f4f4;
  font-size: 14px;
}

.user-chat-shell .brand span {
  display: none;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  text-align: left;
  background: transparent;
  color: #c8d4e8;
  border-radius: 8px;
  padding: 11px 12px;
  font-weight: 650;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.conversation-sidebar {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
}

.user-chat-shell .conversation-sidebar {
  gap: 18px;
}

.conversation-sidebar-top {
  display: grid;
  gap: 10px;
}

.sidebar-create-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.user-chat-shell .sidebar-create-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.new-chat-btn {
  width: 100%;
}

.user-chat-shell .new-chat-btn,
.user-chat-shell .new-project-btn {
  justify-content: flex-start;
  width: 100%;
  min-height: 40px;
  border-radius: 8px;
  padding: 9px 12px;
  background: transparent;
  color: #f4f4f4;
  font-size: 15px;
  font-weight: 520;
}

.user-chat-shell .new-chat-btn {
  background: transparent;
}

.user-chat-shell .new-project-btn:hover,
.user-chat-shell .new-chat-btn:hover {
  background: #1f1f1f;
}

.sidebar-action-icon {
  width: 22px;
  display: inline-grid;
  place-items: center;
  font-size: 17px;
  color: currentColor;
}

.new-project-btn {
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.conversation-search {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 10px 11px;
  outline: none;
}

.conversation-search-wrap {
  display: block;
}

.conversation-search-wrap span {
  display: none;
}

.user-chat-shell .conversation-search-wrap {
  min-height: 40px;
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  padding: 0 12px;
  color: #f4f4f4;
}

.user-chat-shell .conversation-search-wrap:hover {
  background: #1f1f1f;
}

.user-chat-shell .conversation-search-wrap span {
  display: inline;
  color: #f4f4f4;
  font-size: 20px;
  line-height: 1;
}

.user-chat-shell .conversation-search {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #f4f4f4;
  padding: 0;
  font-size: 15px;
}

.conversation-search::placeholder {
  color: #9aa8bd;
}

.conversation-projects {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 14px;
  padding-right: 4px;
}

.user-chat-shell .conversation-projects {
  gap: 20px;
  padding-right: 0;
  scrollbar-color: #3a3a3a transparent;
}

.project-group {
  position: relative;
}

.project-title-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
}

.project-title {
  color: #9aa8bd;
  font-size: 12px;
  font-weight: 800;
}

.user-chat-shell .project-title-row {
  min-height: 28px;
  padding: 0 10px;
}

.user-chat-shell .project-title {
  color: #b4b4b4;
  font-size: 13px;
  font-weight: 650;
}

.project-conversations {
  display: grid;
  gap: 6px;
}

.sidebar-conversation-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border-radius: 8px;
}

.sidebar-conversation-row:hover,
.sidebar-conversation-row.active {
  background: rgba(255, 255, 255, 0.1);
}

.user-chat-shell .sidebar-conversation-row {
  grid-template-columns: minmax(0, 1fr) 30px;
}

.user-chat-shell .sidebar-conversation-row:hover,
.user-chat-shell .sidebar-conversation-row.active {
  background: #1f1f1f;
}

.sidebar-conversation {
  display: grid;
  gap: 4px;
  width: 100%;
  text-align: left;
  border-radius: 8px;
  background: transparent;
  color: #dbe6f5;
  padding: 10px 11px;
}

.user-chat-shell .sidebar-conversation {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 8px 10px 8px 12px;
  color: #f4f4f4;
  font-size: 14px;
}

.sidebar-conversation-row:hover .sidebar-conversation,
.sidebar-conversation-row.active .sidebar-conversation {
  color: #fff;
}

.user-chat-shell .sidebar-conversation-row:hover .sidebar-conversation,
.user-chat-shell .sidebar-conversation-row.active .sidebar-conversation {
  color: #fff;
}

.more-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: transparent;
  color: #9aa8bd;
  font-size: 18px;
  line-height: 1;
}

.user-chat-shell .more-btn {
  color: #b4b4b4;
  opacity: 0;
}

.user-chat-shell .project-title-row .more-btn,
.user-chat-shell .sidebar-conversation-row:hover .more-btn,
.user-chat-shell .sidebar-conversation-row.active .more-btn {
  opacity: 1;
}

.user-chat-shell .more-btn:hover {
  background: #2f2f2f;
  color: #fff;
}

.more-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.sidebar-menu {
  position: absolute;
  right: 0;
  top: 30px;
  z-index: 50;
  width: 150px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #20304a;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
  padding: 6px;
}

.user-chat-shell .sidebar-menu {
  width: 168px;
  border: 1px solid #3a3a3a;
  background: #171717;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
}

.user-chat-shell .sidebar-menu button {
  color: #f4f4f4;
}

.sidebar-menu button {
  width: 100%;
  border-radius: 6px;
  background: transparent;
  color: #e7eef9;
  padding: 9px 10px;
  text-align: left;
}

.sidebar-menu button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.user-chat-shell .sidebar-menu button:hover {
  background: #2f2f2f;
}

.sidebar-conversation span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.sidebar-conversation small,
.sidebar-empty {
  color: #9aa8bd;
}

.user-chat-shell .sidebar-conversation small {
  display: none;
}

.user-chat-shell .sidebar-empty {
  color: #b4b4b4;
  padding: 0 10px;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
  flex-shrink: 0;
}

.user-chat-shell .sidebar-footer {
  min-height: 64px;
  margin: 0 -14px -14px;
  padding: 12px 14px;
  border-top: 1px solid #202123;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}

.sidebar-footer-profile {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-footer-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.sidebar-footer-avatar {
  width: 34px;
  height: 34px;
  font-size: 13px;
}

.user-chat-shell .sidebar-footer .sidebar-footer-meta strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f4f4f4;
  font-weight: 600;
}

.user-chat-shell .sidebar-footer .muted {
  color: #b4b4b4;
  font-size: 13px;
}

.user-chat-shell .sidebar-footer .ghost-btn {
  min-height: 34px;
  border: 1px solid #3a3a3a;
  border-radius: 999px;
  background: #000;
  color: #f4f4f4;
  padding: 7px 12px;
  font-weight: 600;
}

.content {
  min-width: 0;
  display: grid;
  grid-template-rows: 64px 1fr;
}

.user-chat-shell .content {
  background: #fff;
  grid-template-rows: 64px minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.topbar {
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-topbar {
  background: #fff;
  border-bottom: 0;
  color: #24292f;
  padding: 0 20px;
}

.chat-top-model-select {
  flex: 1 1 auto;
  min-width: 0;
  max-width: min(460px, 52vw);
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #24292f;
  padding: 7px 34px 7px 10px;
  font-size: 20px;
  font-weight: 650;
  outline: none;
}

.chat-top-model-select:hover,
.chat-top-model-select:focus {
  background: #f6f8fa;
}

.chat-top-model-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.chat-top-model-select option {
  background: #fff;
  color: #24292f;
}

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

.chat-top-btn {
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid #d0d7de;
  background: #fff;
  color: #24292f;
  padding: 7px 12px;
  font-weight: 650;
}

.chat-top-btn:hover {
  background: #f6f8fa;
}

.quota-mini {
  flex: 0 1 auto;
  min-height: 30px;
  max-width: 360px;
  border: 1px solid #d0d7de;
  border-radius: 999px;
  padding: 6px 10px;
  color: #57606a;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quota-mini.warning {
  border-color: #f2c94c;
  color: #8a6500;
  background: #fff8db;
}

.page {
  overflow: auto;
  padding: 24px;
  min-height: 0;
}

.user-chat-shell .page {
  overflow: hidden;
  padding: 0;
  background: #fff;
}

.chat-layout {
  height: calc(100vh - 112px);
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 18px;
}

.user-chat-shell .chat-layout {
  height: calc(100vh - 64px);
  display: block;
}

.single-chat-layout {
  grid-template-columns: 1fr;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(30, 50, 80, 0.04);
  min-width: 0;
}

.user-chat-shell .chat-panel {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #fff;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}

.panel-header {
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-body {
  padding: 16px;
}

.admin-scroll-panel {
  height: calc(100vh - 112px);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.admin-scroll-panel .panel-body {
  min-height: 0;
  overflow: auto;
}

.conversation-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.conversation-item {
  border: 1px solid transparent;
  background: #f8fafc;
  padding: 11px;
  border-radius: 8px;
  text-align: left;
}

.conversation-item.active {
  border-color: rgba(35, 100, 216, 0.4);
  background: #eef5ff;
}

.chat-panel {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 0;
}

.model-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.chat-title-editor {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(160px, 0.8fr) auto auto;
  gap: 8px;
  align-items: center;
  flex: 1;
}

.chat-title-editor input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
}

.messages {
  overflow: auto;
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 14px;
}

.user-chat-shell .messages {
  width: 100%;
  justify-self: center;
  padding: 28px var(--chat-side-gutter) 22px;
  gap: 26px;
  color: #24292f;
  scrollbar-color: #d0d7de transparent;
}

.messages-empty {
  place-content: center;
}

.chat-empty-state {
  align-self: center;
  justify-self: center;
  width: min(100%, 760px);
  transform: translateY(-36px);
  text-align: center;
}

.chat-empty-state h1 {
  margin: 0 0 70px;
  color: #24292f;
  font-size: 29px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: 0;
}

.chat-access-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.chat-suggestion-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.chat-suggestion-row button {
  min-height: 46px;
  border-radius: 999px;
  border: 1px solid #d0d7de;
  background: #fff;
  color: #24292f;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 560;
}

.chat-suggestion-row button:hover {
  background: #f6f8fa;
}

.message {
  max-width: 82%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  line-height: 1.55;
}

.user-chat-shell .message {
  width: min(100%, var(--chat-content-width));
  min-width: 0;
  max-width: 100%;
  justify-self: center;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: #24292f;
  font-size: 16px;
  line-height: 1.72;
}

.user-chat-shell .message-content {
  min-width: 0;
  max-width: 100%;
}

.message.user {
  justify-self: end;
  background: #edf5ff;
}

.user-chat-shell .message.user {
  justify-self: end;
  width: auto;
  max-width: min(74%, 620px);
  border-radius: 18px;
  background: #f0f2f5;
  padding: 11px 15px;
}

.user-chat-shell .message.user.has-attachments {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
}

.message.assistant {
  justify-self: start;
  background: #fff;
}

.user-chat-shell .message.assistant {
  justify-self: stretch;
  background: transparent;
}

.user-chat-shell .message-content p:first-child {
  margin-top: 0;
}

.user-chat-shell .message-content p:last-child {
  margin-bottom: 0;
}

.user-chat-shell .formula-block {
  border-color: #d0d7de;
  background: #f6f8fa;
  color: #24292f;
}

.markdown-heading {
  margin: 14px 0 8px;
  color: #1f2328;
  font-weight: 760;
  line-height: 1.35;
  letter-spacing: 0;
}

.markdown-heading:first-child {
  margin-top: 0;
}

.markdown-heading-1 {
  font-size: 1.18em;
}

.markdown-heading-2 {
  font-size: 1.08em;
}

.markdown-heading-3,
.markdown-heading-4,
.markdown-heading-5,
.markdown-heading-6 {
  font-size: 1em;
}

.markdown-hr {
  height: 1px;
  margin: 14px 0;
  border: 0;
  background: #d0d7de;
}

.message-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  opacity: 0.82;
}

.message-action-btn {
  min-height: 28px;
  border: 1px solid #d0d7de;
  border-radius: 999px;
  background: #fff;
  color: #57606a;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 650;
}

.message-action-btn:hover {
  background: #f6f8fa;
  color: #24292f;
}

.message-action-btn.danger {
  border-color: #ffb3b3;
  color: #cf222e;
}

.user-chat-shell .formula-inline {
  color: #24292f;
}

.user-chat-shell .inline-code {
  border-color: #d0d7de;
  background: #f6f8fa;
  color: #24292f;
}

.markdown-table-wrap {
  max-width: 100%;
  margin: 12px 0;
  overflow-x: auto;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #fff;
}

.user-chat-shell .markdown-table-wrap {
  width: 100%;
  max-width: 100%;
}

.markdown-table {
  width: max-content;
  min-width: min(100%, 560px);
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.5;
}

.user-chat-shell .markdown-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.markdown-table th,
.markdown-table td {
  border: 1px solid #d0d7de;
  padding: 8px 11px;
  text-align: left;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
}

.markdown-table.generated-grid th,
.markdown-table.generated-grid td,
.markdown-table.loose-table td {
  text-align: center;
}

.markdown-table.loose-table td:empty {
  background: #fbfcfe;
}

.markdown-table th {
  background: #f6f8fa;
  color: #24292f;
  font-weight: 700;
}

.markdown-table td {
  color: #24292f;
}

.markdown-table .align-center {
  text-align: center;
}

.markdown-table .align-right {
  text-align: right;
}

.formula-block {
  display: block;
  margin: 10px 0;
  padding: 12px;
  overflow-x: auto;
  border: 1px solid #dce8f5;
  border-radius: 8px;
  background: #f7fbff;
  color: #132238;
  font-family: "Times New Roman", Times, serif;
  font-size: 18px;
  line-height: 1.5;
  white-space: nowrap;
}

.code-block {
  margin: 10px 0;
  max-width: 100%;
  overflow: auto;
  border: 1px solid #d5dee9;
  border-radius: 8px;
  background: #111827;
  color: #e5e7eb;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre;
}

.code-block code {
  font-family: inherit;
}

.code-block-shell {
  margin: 10px 0;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.code-block-header {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
}

.code-block-lang {
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

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

.code-block-btn {
  min-height: 30px;
  border: 1px solid #d0d7de;
  border-radius: 999px;
  background: #fff;
  color: #24292f;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 650;
}

.code-block-btn:hover {
  background: #f6f8fa;
}

.code-block-btn.primary {
  border-color: #c7d7fe;
  background: #eef4ff;
  color: #1d4ed8;
}

.code-block-btn.primary:hover {
  background: #e0eaff;
}

.code-block-shell .code-block {
  margin: 0;
  border: 0;
  border-radius: 0;
}

.inline-code {
  border: 1px solid #d5dee9;
  border-radius: 6px;
  background: #f3f6fa;
  padding: 1px 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.formula-inline {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  vertical-align: middle;
  color: #132238;
  font-family: "Times New Roman", Times, serif;
  white-space: nowrap;
}

.formula-text {
  font-family: inherit;
  font-style: normal;
}

.formula-boxed {
  display: inline-block;
  border: 1px solid currentColor;
  padding: 2px 7px;
  border-radius: 3px;
}

.frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  margin: 0 2px;
  line-height: 1.05;
}

.frac span:first-child {
  border-bottom: 1px solid currentColor;
  padding: 0 4px 2px;
}

.frac span:last-child {
  padding: 2px 4px 0;
}

.fallback-sqrt::before {
  content: "√";
  padding-right: 2px;
}

.fallback-sqrt span {
  border-top: 1px solid currentColor;
  padding: 1px 4px 0;
}

.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

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

.attachment {
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 8px;
  padding: 8px;
  font-size: 12px;
  color: #344054;
}

.user-chat-shell .attachment {
  border-color: #d0d7de;
  background: #f6f8fa;
  color: #24292f;
}

.user-chat-shell .message.user .attachments {
  justify-content: flex-end;
}

.user-chat-shell .message.user .attachment {
  width: min(100%, 470px);
  border-radius: 14px;
  background: #f6f8fa;
}

.attachment img {
  width: 120px;
  height: 88px;
  object-fit: cover;
  display: block;
  margin-bottom: 6px;
  border-radius: 6px;
}

.attachment video {
  width: min(420px, 72vw);
  max-height: 260px;
  display: block;
  margin-bottom: 8px;
  border-radius: 6px;
  background: #101828;
}

.video-attachment {
  max-width: min(440px, 78vw);
}

.user-chat-shell .message.user .attachment video {
  width: 100%;
  max-height: 310px;
  border-radius: 10px;
}

.composer {
  border-top: 1px solid var(--line);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.user-chat-shell .composer {
  position: relative;
  z-index: 30;
  width: 100%;
  margin: 0 auto;
  border-top: 0;
  padding: 16px var(--chat-side-gutter) 24px;
  background: #fff;
}

.chat-access-banner {
  border-top: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  padding: 12px 18px;
  font-size: 13px;
  line-height: 1.5;
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.user-chat-shell .composer-actions {
  width: min(100%, var(--chat-content-width));
  margin: 0 auto;
  min-height: 70px;
  border: 1px solid #d0d7de;
  border-radius: 34px;
  background: #f0f2f5;
  padding: 10px 11px 10px 13px;
  gap: 10px;
  box-shadow: 0 14px 36px rgba(31, 35, 40, 0.12);
}

.composer-actions textarea {
  flex: 1;
  min-height: 52px;
  max-height: 140px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  resize: vertical;
}

.user-chat-shell .composer-actions textarea {
  min-height: 34px;
  max-height: 160px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #24292f;
  padding: 11px 4px;
  resize: none;
  outline: none;
  font-size: 16px;
  line-height: 1.45;
}

.user-chat-shell .composer-actions textarea::placeholder {
  color: #8c959f;
}

.composer-model-select {
  width: 170px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  flex-shrink: 0;
}

.user-chat-shell .composer-model-select {
  width: 150px;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #24292f;
  padding: 0 12px;
  font-size: 13px;
  outline: none;
}

.attach-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

.attach-btn {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: #edf3fa;
  color: #203047;
  font-size: 28px;
  line-height: 1;
  font-weight: 500;
}

.user-chat-shell .attach-btn {
  width: 38px;
  height: 38px;
  border: 1px solid #d0d7de;
  background: #fff;
  color: #24292f;
  font-size: 28px;
}

.user-chat-shell .attach-btn:hover {
  background: #f6f8fa;
}

.attach-menu {
  position: absolute;
  left: 0;
  bottom: 52px;
  z-index: 20;
  width: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(30, 50, 80, 0.16);
  padding: 6px;
}

.user-chat-shell .attach-menu {
  left: -2px;
  bottom: 52px;
  width: 168px;
  border: 1px solid #d0d7de;
  background: #fff;
  box-shadow: 0 18px 50px rgba(31, 35, 40, 0.16);
}

.attach-menu button {
  width: 100%;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 10px;
  text-align: left;
}

.user-chat-shell .attach-menu button {
  color: #24292f;
}

.attach-menu button:hover {
  background: #f3f6fa;
}

.user-chat-shell .attach-menu button:hover {
  background: #f6f8fa;
}

.send-btn {
  flex-shrink: 0;
}

.user-chat-shell .send-btn {
  width: 46px;
  height: 46px;
  min-height: 46px;
  border-radius: 999px;
  padding: 0;
  background: #24292f;
  color: #fff;
  font-size: 24px;
  font-weight: 760;
}

.user-chat-shell .send-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.hidden-file-input {
  display: none;
}

.image-options-modal {
  max-width: 620px;
}

.image-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.image-options-grid .wide {
  grid-column: 1 / -1;
}

.camera-modal {
  max-width: 720px;
}

.camera-preview-wrap {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101828;
  aspect-ratio: 4 / 3;
}

.camera-preview-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.file-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.user-chat-shell .file-strip {
  width: min(100%, var(--chat-content-width));
  margin: 0 auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
}

.table th {
  color: #475467;
  background: #f8fafc;
  font-size: 12px;
  text-transform: uppercase;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.form-grid .wide {
  grid-column: span 2;
}

.table-input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 9px;
  background: #fff;
  color: var(--text);
}

.url-input {
  min-width: 220px;
}

.password-input {
  max-width: 130px;
}

.accounts-panel .form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.account-table {
  min-width: 1220px;
}

.admin-table-scroll {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-table-scroll .table th,
.admin-table-scroll .table td {
  padding: 9px 8px;
}

.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.model-config-panel {
  max-width: 100%;
  overflow: hidden;
}

.model-config-panel .panel-body {
  overflow: auto;
}

.model-config-panel .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 980px;
}

.model-config-panel .form-grid .wide {
  grid-column: span 1;
}

.model-config-panel .form-grid > .primary-btn {
  grid-column: 1 / -1;
}

.channel-prompt-input {
  min-height: 92px;
  resize: vertical;
  line-height: 1.45;
}

.mini-input {
  min-width: 0;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.field-hint {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.35;
}

.error-hint {
  color: #b42318;
}

.channel-list {
  display: grid;
  gap: 14px;
}

.channel-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
  padding: 16px;
}

.channel-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.channel-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.channel-title strong,
.channel-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-title span,
.channel-status {
  color: var(--muted);
  font-size: 13px;
}

.channel-status {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.channel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
}

.channel-field {
  display: grid;
  gap: 6px;
  align-content: start;
  min-width: 0;
}

.channel-field > span {
  color: #475467;
  font-size: 12px;
  font-weight: 700;
}

.channel-field.wide,
.channel-field.prompt {
  grid-column: span 2;
}

.channel-price-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.field-note {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.channel-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 14px;
}

@media (max-width: 1280px) {
  .channel-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 760px) {
  .channel-card {
    padding: 13px;
  }

  .channel-card-head {
    display: grid;
  }

  .channel-status {
    justify-content: flex-start;
  }

  .channel-grid {
    grid-template-columns: 1fr;
  }

  .channel-field.wide,
  .channel-field.prompt {
    grid-column: auto;
  }

  .channel-actions > * {
    flex: 1 1 100%;
  }
}

.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

.compact-btn {
  min-height: 38px;
  padding: 8px 10px;
}

.user-review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.quota-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 18px;
}

.quota-grid h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.content-audit-filters {
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.content-audit-filters input,
.content-audit-filters select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
}

.user-card {
  display: grid;
  gap: 6px;
  min-height: 104px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  color: var(--text);
}

.user-card:hover {
  border-color: rgba(35, 100, 216, 0.45);
  box-shadow: 0 8px 18px rgba(30, 50, 80, 0.08);
}

.user-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-card-avatar {
  width: 36px;
  height: 36px;
  font-size: 14px;
}

.user-card-top strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-card span,
.user-card small {
  color: var(--muted);
}

.audit-conversation-list {
  padding: 0;
}

.audit-conversation-title {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}

.audit-delete-note {
  white-space: nowrap;
}

.content-audit-detail {
  height: calc(100vh - 112px);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.content-audit-detail .panel-body {
  min-height: 0;
  overflow: hidden;
}

.audit-messages {
  height: 100%;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 12px;
  padding-right: 6px;
}

.audit-message {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 13px;
}

.audit-message-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.audit-message-body {
  line-height: 1.65;
}

.audit-message-files {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #edf1f5;
}

.audit-message-files .attachments {
  margin-top: 0;
}

.section-title {
  margin: 18px 0 10px;
  font-size: 15px;
}

.file-link {
  color: inherit;
  text-decoration: none;
}

.audit-filters select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.audit-panel {
  height: calc(100vh - 112px);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.audit-panel .panel-body {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 10px;
  overflow: hidden;
}

.audit-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.audit-summary-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
}

.audit-summary-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.audit-summary-item strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.1;
}

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

.audit-scroll {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.audit-timeline {
  display: grid;
  gap: 10px;
}

.audit-pagination {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

.audit-pagination select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.audit-log-item {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) 1.2fr;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  background: #e7f7ef;
  color: #067647;
  font-size: 12px;
  font-weight: 700;
}

.badge.danger {
  background: #fdebea;
  color: var(--danger);
}

.badge.neutral {
  background: #edf3fa;
  color: var(--muted);
}

.audit-detail {
  margin-top: 8px;
  color: #344054;
  word-break: break-word;
}

.error {
  color: var(--danger);
  margin-top: 12px;
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none;
}

[hidden] {
  display: none !important;
}

/* Light theme polish for the ChatGPT-style workspace. */
.sidebar,
.user-chat-shell .sidebar {
  background: #f7f7f8;
  color: #1f2328;
  border-right: 1px solid #e5e7eb;
}

.sidebar .brand,
.user-chat-shell .brand {
  color: #1f2328;
}

.user-chat-shell .brand-mark {
  background: #fff;
  border-color: #d0d7de;
  color: #1f2328;
}

.nav button {
  color: #475467;
}

.nav button.active,
.nav button:hover {
  background: #ececf1;
  color: #1f2328;
}

.user-chat-shell .new-chat-btn,
.user-chat-shell .new-project-btn,
.user-chat-shell .conversation-search-wrap,
.user-chat-shell .conversation-search,
.user-chat-shell .conversation-search-wrap span,
.user-chat-shell .sidebar-conversation,
.user-chat-shell .sidebar-footer .sidebar-footer-meta strong {
  color: #1f2328;
}

.user-chat-shell .new-project-btn:hover,
.user-chat-shell .new-chat-btn:hover,
.user-chat-shell .conversation-search-wrap:hover,
.user-chat-shell .sidebar-conversation-row:hover,
.user-chat-shell .sidebar-conversation-row.active {
  background: #ececf1;
}

.new-project-btn {
  background: #fff;
  color: #1f2328;
  border: 1px solid #e5e7eb;
}

.conversation-search {
  background: #fff;
  color: #1f2328;
  border-color: #d0d7de;
}

.conversation-search::placeholder,
.project-title,
.user-chat-shell .project-title,
.sidebar-conversation small,
.sidebar-empty,
.user-chat-shell .sidebar-empty,
.user-chat-shell .sidebar-footer .muted {
  color: #667085;
}

.sidebar-conversation {
  color: #1f2328;
}

.sidebar-conversation-row:hover,
.sidebar-conversation-row.active {
  background: #ececf1;
}

.sidebar-conversation-row:hover .sidebar-conversation,
.sidebar-conversation-row.active .sidebar-conversation,
.user-chat-shell .sidebar-conversation-row:hover .sidebar-conversation,
.user-chat-shell .sidebar-conversation-row.active .sidebar-conversation {
  color: #1f2328;
}

.more-btn,
.user-chat-shell .more-btn {
  color: #667085;
}

.more-btn:hover,
.user-chat-shell .more-btn:hover {
  background: #e5e7eb;
  color: #1f2328;
}

.sidebar-menu,
.user-chat-shell .sidebar-menu {
  border: 1px solid #d0d7de;
  background: #fff;
  box-shadow: 0 18px 50px rgba(31, 35, 40, 0.12);
}

.sidebar-menu button,
.user-chat-shell .sidebar-menu button {
  color: #1f2328;
}

.sidebar-menu button:hover,
.user-chat-shell .sidebar-menu button:hover {
  background: #f6f8fa;
}

.user-chat-shell .sidebar-footer {
  border-top: 1px solid #e5e7eb;
  background: #f7f7f8;
}

.user-chat-shell .sidebar-footer .ghost-btn {
  border-color: #d0d7de;
  background: #fff;
  color: #1f2328;
}

.user-chat-shell .sidebar-footer .ghost-btn:hover {
  background: #ececf1;
}

.ui-dialog-backdrop,
.consent-backdrop {
  background: rgba(248, 250, 252, 0.74);
}

.ui-primary-btn,
.ui-toast,
.ui-toast.success {
  background: #eef2f7;
  color: #1f2328;
  border: 1px solid #d0d7de;
}

.ui-primary-btn:hover {
  background: #e5e7eb;
}

.ui-primary-btn.danger {
  background: #fdebea;
  color: #b42318;
  border-color: #fecdca;
}

.ui-primary-btn.danger:hover,
.ui-toast.error {
  background: #fee4e2;
  color: #b42318;
  border-color: #fecdca;
}

.code-block {
  border-color: #d0d7de;
  background: #f6f8fa;
  color: #1f2328;
}

.attachment video,
.camera-preview-wrap {
  background: #f1f5f9;
}

.user-chat-shell .send-btn {
  border: 1px solid #d0d7de;
  background: #fff;
  color: #1f2328;
}

.user-chat-shell .send-btn:hover:not(:disabled) {
  background: #ececf1;
}

.primary-btn {
  background: #eef4ff;
  color: #1d4ed8;
  border: 1px solid #c7d7fe;
}

.primary-btn:hover {
  background: #e0eaff;
}

@media (max-width: 1024px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-panel {
    padding: 44px 32px 40px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    align-items: center;
  }

  .login-panel .brand,
  .login-card {
    width: min(100%, 560px);
  }

  .login-card {
    margin-top: 32px;
  }

  .login-visual {
    display: none;
  }

  .public-share-header {
    padding: 16px 20px;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .public-share-header > div:first-child {
    width: 100%;
  }

  .public-share-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .public-share-actions > * {
    flex: 1 1 220px;
  }

  .public-share-panel,
  .project-share-panel,
  .conversation-share-panel {
    width: min(100%, calc(100vw - 24px));
    margin: 20px auto;
  }

  .public-share-messages {
    padding: 20px 20px 24px;
  }

  .public-share-shell .message {
    max-width: min(84%, 640px);
  }

  .app-shell.admin-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .admin-shell .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    top: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid #e5e7eb;
    padding: 16px 18px;
    gap: 14px;
  }

  .admin-shell .brand {
    width: 100%;
  }

  .admin-shell .nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .admin-shell .nav button {
    text-align: center;
  }

  .admin-shell .sidebar-footer {
    gap: 12px;
  }

  .admin-shell .sidebar-footer-profile {
    align-items: center;
  }

  .admin-shell .sidebar-footer .ghost-btn {
    width: 100%;
  }

  .admin-shell .content {
    min-height: 0;
  }

  .admin-scroll-panel,
  .content-audit-detail,
  .audit-panel {
    height: auto;
    min-height: 0;
  }

  .admin-scroll-panel .panel-body,
  .model-config-panel .panel-body,
  .content-audit-detail .panel-body,
  .audit-panel .panel-body {
    overflow: auto;
  }

  .chat-layout {
    grid-template-columns: 1fr;
  }

  .user-chat-shell {
    --chat-side-gutter: 22px;
    position: relative;
    grid-template-columns: 1fr;
    overflow: hidden;
  }

  .user-chat-shell .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 80;
    width: min(86vw, 340px);
    height: 100dvh;
    max-height: none;
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: 24px 0 60px rgba(31, 35, 40, 0.12);
  }

  .user-chat-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: none;
    background: rgba(31, 35, 40, 0.24);
  }

  .user-chat-shell.sidebar-open .mobile-sidebar-backdrop {
    display: block;
  }

  .user-chat-shell .content {
    min-height: 100dvh;
    height: 100dvh;
    grid-template-rows: 64px minmax(0, 1fr);
  }

  .mobile-menu-btn {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    background: #fff;
    color: #24292f;
    border: 1px solid #e5e5e5;
    font-size: 22px;
    line-height: 1;
  }

  .chat-topbar {
    height: 64px;
    padding: 8px 12px;
    gap: 7px;
  }

  .chat-top-model-select {
    max-width: none;
    flex: 1 1 auto;
    font-size: 18px;
    padding: 7px 26px 7px 8px;
  }

  .chat-top-actions {
    flex: 0 0 auto;
    gap: 6px;
  }

  .chat-top-btn {
    min-width: 44px;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 999px;
    font-size: 0;
  }

  #topNewConversationBtn::before {
    content: "+";
    font-size: 22px;
    font-weight: 650;
  }

  #topShareConversationBtn::before {
    content: "↗";
    font-size: 20px;
    font-weight: 650;
  }

  .user-chat-shell .page {
    min-height: calc(100dvh - 64px);
    height: calc(100dvh - 64px);
  }

  .user-chat-shell .chat-layout {
    height: calc(100dvh - 64px);
  }

  .user-chat-shell .composer {
    width: 100%;
    padding: 10px var(--chat-side-gutter) calc(14px + env(safe-area-inset-bottom));
  }

  .user-chat-shell .messages {
    width: 100%;
    padding: 18px var(--chat-side-gutter) 14px;
  }

  .user-chat-shell .message.user {
    max-width: min(86%, 620px);
  }

  .user-chat-shell .markdown-table {
    width: max-content;
    min-width: 640px;
    table-layout: auto;
  }

  .user-chat-shell .markdown-table th,
  .user-chat-shell .markdown-table td {
    white-space: nowrap;
    overflow-wrap: normal;
  }

  .ui-dialog-backdrop {
    align-items: end;
    padding: 12px;
  }

  .ui-dialog-card,
  .ui-dialog-card.compact,
  .python-dialog,
  .share-modal,
  .model-permissions-dialog,
  .consent-modal {
    width: 100%;
    max-width: none;
    border-radius: 18px;
    padding: 16px;
  }

  .ui-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .ui-primary-btn,
  .ui-secondary-btn {
    min-height: 44px;
  }

  .chat-empty-state {
    transform: translateY(-12px);
  }

  .chat-empty-state h1 {
    margin-bottom: 32px;
    font-size: 26px;
  }

  .grid-2,
  .form-grid,
  .image-options-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .accounts-panel .form-grid,
  .model-config-panel .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid .wide {
    grid-column: 1 / -1;
  }

  .composer-actions {
    flex-wrap: wrap;
  }

  .user-chat-shell .composer-actions {
    flex-wrap: nowrap;
    min-height: 64px;
    border-radius: 28px;
    padding: 8px 9px 8px 10px;
  }

  .user-chat-shell .composer-actions textarea {
    min-width: 0;
    font-size: 16px;
  }

  .user-chat-shell .attach-btn {
    width: 44px;
    height: 44px;
    font-size: 28px;
  }

  .user-chat-shell .send-btn {
    width: 48px;
    height: 48px;
    min-height: 48px;
  }

  .user-chat-shell .attach-menu {
    left: 0;
    bottom: 58px;
  }

  .chat-title-editor {
    grid-template-columns: 1fr;
  }

  .table-scroll {
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable both-edges;
  }

  .model-config-panel .table {
    min-width: 1320px;
  }

  .account-table {
    min-width: 1120px;
  }
}

@media (max-width: 640px) {
  .login-panel {
    padding: 28px 18px 32px;
  }

  .login-card {
    margin-top: 24px;
    max-width: 100%;
  }

  .login-card h1 {
    font-size: 26px;
  }

  .login-card p {
    margin-bottom: 20px;
  }

  .consent-backdrop {
    padding: 12px;
  }

  .consent-modal {
    padding: 18px;
    border-radius: 14px;
    max-height: calc(100dvh - 24px);
    overflow: auto;
  }

  .consent-modal h2 {
    font-size: 20px;
  }

  .consent-actions {
    flex-direction: column;
  }

  .consent-actions > * {
    width: 100%;
  }

  .public-share-header {
    padding: 14px 16px;
  }

  .public-share-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .public-share-actions > * {
    width: 100%;
  }

  .public-share-panel,
  .project-share-panel,
  .conversation-share-panel {
    width: calc(100vw - 16px);
    margin: 12px auto 16px;
  }

  .public-share-note {
    padding: 10px 14px;
  }

  .public-share-messages {
    padding: 16px 14px 20px;
    gap: 14px;
  }

  .public-share-shell .message {
    max-width: 100%;
    font-size: 14px;
    line-height: 1.6;
  }

  .public-shared-conversation-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px;
  }

  .public-shared-conversation-header h2 {
    font-size: 17px;
  }

  .public-share-shell .attachment img {
    width: min(100%, 180px);
    max-height: 180px;
  }

  .public-share-shell .markdown-table {
    min-width: 520px;
  }

  .app-shell.admin-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .admin-shell .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    top: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid #e5e7eb;
    padding: 14px 16px;
    gap: 12px;
  }

  .admin-table-scroll {
    border: 0;
  }

  .admin-shell .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .admin-shell .nav button {
    padding: 10px 10px;
  }

  .admin-shell .sidebar-footer {
    gap: 10px;
  }

  .admin-shell .sidebar-footer-profile {
    align-items: flex-start;
  }

  .admin-shell .sidebar-footer .ghost-btn {
    width: 100%;
  }

  .admin-shell .content {
    min-height: 0;
  }

  .user-chat-shell {
    --chat-side-gutter: 14px;
  }

  .user-chat-shell .sidebar {
    width: min(88vw, 320px);
  }

  .user-chat-shell .content {
    grid-template-rows: 56px minmax(0, 1fr);
  }

  .chat-topbar {
    height: 56px;
    padding: 6px 10px;
  }

  .user-chat-shell .page {
    min-height: calc(100dvh - 56px);
    height: calc(100dvh - 56px);
  }

  .topbar,
  .chat-topbar {
    padding: 0 12px;
  }

  .chat-topbar {
    gap: 8px;
  }

  .mobile-menu-btn {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }

  .chat-top-model-select {
    font-size: 16px;
    padding: 7px 22px 7px 8px;
  }

  .chat-top-actions {
    gap: 6px;
  }

  .chat-top-btn {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    font-size: 0;
  }

  #topNewConversationBtn::before {
    content: "+";
    font-size: 20px;
    font-weight: 650;
  }

  #topShareConversationBtn::before {
    content: "↗";
    font-size: 18px;
    font-weight: 650;
  }

  .user-chat-shell .messages {
    padding: 16px var(--chat-side-gutter) 12px;
    gap: 18px;
  }

  .user-chat-shell .message {
    font-size: 15px;
  }

  .user-chat-shell .message.user {
    max-width: 100%;
    padding: 10px 12px;
    border-radius: 16px;
  }

  .user-chat-shell .message.user.has-attachments {
    padding: 10px;
  }

  .user-chat-shell .message.user .attachment {
    width: 100%;
  }

  .user-chat-shell .message.user .attachment video {
    max-height: 240px;
  }

  .user-chat-shell .composer {
    padding: 10px var(--chat-side-gutter) calc(12px + env(safe-area-inset-bottom));
  }

  .user-chat-shell .composer-actions {
    min-height: 60px;
    border-radius: 24px;
    padding: 8px 9px 8px 10px;
    gap: 8px;
  }

  .user-chat-shell .composer-actions textarea {
    min-height: 30px;
    padding: 10px 2px;
    font-size: 16px;
  }

  .user-chat-shell .composer-model-select {
    width: 120px;
    min-height: 38px;
    padding: 0 10px;
    font-size: 12px;
  }

  .user-chat-shell .attach-btn {
    width: 38px;
    height: 38px;
    font-size: 26px;
  }

  .user-chat-shell .send-btn {
    width: 42px;
    height: 42px;
    min-height: 42px;
    font-size: 22px;
  }

  .user-chat-shell .attach-menu {
    left: 0;
    bottom: 50px;
    width: 156px;
  }

  .user-chat-shell .file-strip {
    width: 100%;
  }

  .chat-empty-state {
    width: 100%;
    transform: none;
  }

  .chat-empty-state h1 {
    margin-bottom: 38px;
    font-size: 24px;
  }

  .chat-suggestion-row {
    gap: 10px;
  }

  .chat-suggestion-row button {
    min-height: 42px;
    padding: 0 14px;
    font-size: 14px;
  }

  .grid-2,
  .form-grid,
  .image-options-grid {
    grid-template-columns: 1fr;
  }

  .accounts-panel .form-grid,
  .model-config-panel .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid > .primary-btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .table thead {
    display: none;
  }

  .table-scroll {
    overflow-x: visible;
  }

  .account-table,
  .model-config-panel .table {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .account-table tbody,
  .model-config-panel .table tbody {
    display: grid;
    gap: 12px;
  }

  .account-table tr,
  .model-config-panel .table tr {
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 12px;
  }

  .account-table td,
  .model-config-panel .table td {
    display: grid;
    gap: 6px;
    border: 0;
    padding: 0;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .account-table td::before,
  .model-config-panel .table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
  }

  .account-table td:last-child .row-actions,
  .model-config-panel .table td:last-child .row-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .account-table td:last-child .row-actions > *,
  .model-config-panel .table td:last-child .row-actions > * {
    flex: 1 1 100%;
  }

  .account-table .password-input,
  .model-config-panel .password-input,
  .model-config-panel .url-input,
  .model-config-panel .channel-prompt-input {
    max-width: none;
    min-width: 0;
    width: 100%;
  }

  .model-config-panel .channel-prompt-input {
    min-height: 110px;
    resize: vertical;
  }

  .admin-scroll-panel,
  .content-audit-detail,
  .audit-panel {
    height: auto;
    min-height: calc(100dvh - 56px);
  }

  .admin-scroll-panel .panel-body,
  .model-config-panel .panel-body,
  .content-audit-detail .panel-body,
  .audit-panel .panel-body {
    overflow: visible;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .content-audit-detail {
    overflow: visible;
  }

  .audit-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .audit-summary-item strong {
    font-size: 20px;
  }

  .audit-list-header,
  .audit-pagination {
    flex-direction: column;
    align-items: flex-start;
  }

  .audit-scroll {
    padding: 8px;
  }

  .audit-log-item {
    gap: 10px;
    padding: 12px;
  }

  .audit-message {
    padding: 12px;
  }

  .audit-message-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .user-review-grid {
    grid-template-columns: 1fr;
  }

  .user-card {
    min-height: 92px;
    padding: 12px;
  }

  .user-card-top {
    gap: 8px;
  }

  .user-card-avatar {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }

  .ui-dialog-backdrop {
    padding: 10px;
    align-items: end;
  }

  .ui-dialog-card,
  .ui-dialog-card.compact,
  .python-dialog,
  .share-modal,
  .model-permissions-dialog,
  .consent-modal {
    width: 100%;
    max-width: none;
    border-radius: 16px;
    padding: 16px;
  }

  .ui-dialog-header {
    align-items: flex-start;
  }

  .ui-dialog-actions {
    grid-template-columns: 1fr;
  }

  .model-permissions-summary {
    gap: 6px;
  }

  .model-permission-group-header,
  .model-permission-list {
    padding-left: 12px;
    padding-right: 12px;
  }
}
