:root {
  color-scheme: light;
  --paper: #fbfaf5;
  --side: #f4f2ec;
  --hover: #ebe9e2;
  --ink: #111111;
  --muted: #77756f;
  --soft: #d9d6ce;
  --line: #e7e3da;
  --card: #ffffff;
  --danger: #b3261e;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.chatgpt-theme {
  --paper: #ffffff;
  --side: #f9f9f9;
  --hover: #ececec;
  --line: #e5e5e5;
  --card: #ffffff;
  --muted: #676767;
  --ink: #0d0d0d;
}

body.deepseek-theme {
  --paper: #f7f9ff;
  --side: #f4f7ff;
  --hover: #eef4ff;
  --line: #dbe6f8;
  --card: #ffffff;
  --muted: #64748b;
  --ink: #162033;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  min-height: 100svh;
  overflow: auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 22px clamp(18px, 4vw, 54px) 42px;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.92), transparent 28%),
    linear-gradient(135deg, #fbfaf5 0%, #eef4f1 46%, #f8f1e8 100%);
}

.landing-topbar {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #050505;
  font-size: 24px;
  font-weight: 800;
}

.landing-brand img {
  width: 30px;
  height: 30px;
}

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

.landing-link-button,
.landing-login-button,
.top-doc-button,
.login-pill {
  min-height: 36px;
  padding: 0 15px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #111;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.08);
}

.landing-login-button,
.login-pill {
  background: #050505;
  color: #fff;
  box-shadow: none;
}

.landing-hero {
  width: min(1120px, 100%);
  align-self: center;
  justify-self: center;
  display: grid;
  gap: 28px;
  padding: 7vh 0 4vh;
}

.landing-copy-wrap {
  display: grid;
  gap: 22px;
}

.landing-copy {
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
}

.landing-eyebrow,
.feature-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.08);
  color: #5f5a50;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.landing-copy h1 {
  margin: 0;
  font-size: clamp(46px, 7vw, 86px);
  line-height: 0.94;
  letter-spacing: -0.04em;
}

.landing-copy p {
  width: min(760px, 100%);
  margin: 0 auto;
  color: #56544f;
  font-size: 19px;
  line-height: 1.7;
}

.landing-cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.landing-primary-button,
.landing-secondary-button {
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
}

.landing-primary-button {
  background: #050505;
  color: #fff;
  box-shadow: 0 18px 40px rgba(5, 5, 5, 0.16);
}

.landing-secondary-button {
  background: rgba(255, 255, 255, 0.82);
  color: #121212;
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.1);
}

.landing-composer {
  min-height: 124px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 28px 80px rgba(35, 33, 28, 0.14);
}

.landing-composer-label {
  color: #4e4a42;
  font-size: 13px;
  font-weight: 700;
}

.landing-composer textarea {
  min-height: 72px;
  max-height: 180px;
  padding: 6px 4px;
  border: 0;
  background: transparent;
  font-size: 18px;
}

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

.landing-composer-hint {
  color: #7a756b;
  font-size: 13px;
}

.landing-composer button {
  width: 50px;
  height: 50px;
  margin-left: auto;
  border-radius: 999px;
  background: #050505;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
}

.landing-trust-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.landing-trust-list span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: #494641;
  font-size: 13px;
  font-weight: 700;
}

.landing-feature-band,
.landing-journey {
  width: min(1120px, 100%);
  justify-self: center;
}

.landing-feature-band {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding-bottom: 18px;
}

.landing-feature-card,
.landing-journey-grid article {
  padding: 24px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 40px rgba(35, 33, 28, 0.06);
}

.landing-feature-card {
  display: grid;
  align-content: start;
  gap: 14px;
}

.landing-feature-card h2,
.landing-feature-card h3,
.landing-journey-copy h2,
.landing-journey-grid h3 {
  margin: 0;
}

.landing-feature-card p,
.landing-journey-grid p {
  margin: 0;
  color: #605c54;
  line-height: 1.7;
}

.feature-highlight {
  padding: 28px;
}

.feature-highlight h2 {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.feature-index {
  color: #8f887d;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.landing-journey {
  display: grid;
  gap: 18px;
  padding-bottom: 54px;
}

.landing-journey-copy {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.landing-journey-copy h2 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.landing-journey-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.landing-journey-grid article {
  display: grid;
  gap: 12px;
}

.landing-journey-grid strong {
  color: #8f887d;
  font-size: 13px;
  letter-spacing: 0.14em;
}

.login-panel {
  width: min(380px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 24px 80px rgba(25, 23, 18, 0.08);
}

.brand-mark,
.bai-center-mark {
  color: #7f7d78;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: transparent;
  font-size: 28px;
}

.brand-mark img {
  width: 38px;
  height: 38px;
  display: block;
}

.login-panel h1 {
  margin: 18px 0 6px;
  font-size: 34px;
  letter-spacing: 0;
}

.login-panel p,
.chat-subtitle,
.settings-note,
.api-hero p,
.profile-card p {
  color: var(--muted);
}

label {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  color: #56544f;
  font-size: 13px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffefa;
  color: var(--ink);
  outline: none;
}

input,
select {
  height: 42px;
  padding: 0 13px;
}

textarea {
  min-height: 48px;
  max-height: 180px;
  resize: none;
  padding: 13px 6px;
  border: 0;
  background: transparent;
}

input:focus,
textarea:focus {
  border-color: #aaa59a;
}

.login-panel button,
.primary {
  width: 100%;
  min-height: 44px;
  margin-top: 22px;
  border-radius: 999px;
  background: #050505;
  color: #fff;
  font-weight: 700;
}

.inline-primary {
  width: auto;
  min-width: 112px;
  margin-top: 18px;
  padding: 0 18px;
}

.error {
  min-height: 20px;
  margin-top: 14px;
  color: var(--danger);
  font-size: 13px;
}

.app {
  height: 100vh;
  height: 100svh;
  min-height: 0;
  display: grid;
  grid-template-columns: 255px minmax(0, 1fr);
  overflow: hidden;
  background: var(--paper);
}

.sidebar {
  height: 100vh;
  height: 100svh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  padding: 20px 10px 14px;
  overflow: hidden;
  background: var(--side);
  border-right: 1px solid var(--line);
}

.sidebar-scrim {
  display: none;
}

.bai-logo {
  height: 58px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  color: #050505;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 0;
}

.bai-logo img {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
}

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

.bai-nav-item {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-radius: 7px;
  background: transparent;
  color: #151515;
  font-size: 14px;
  text-align: left;
}

.bai-nav-item span {
  width: 16px;
  display: inline-grid;
  place-items: center;
  color: #111;
  font-size: 15px;
}

.bai-nav-item.active,
.bai-nav-item:hover {
  background: var(--hover);
}

.bai-nav-item.compact {
  height: 34px;
  color: #383631;
}

.search-wrap {
  padding: 14px 0 6px;
}

.search-wrap input {
  height: 34px;
  border-radius: 7px;
  background: #efede7;
  font-size: 13px;
}

.thread-list {
  min-height: 0;
  overflow: auto;
}

.thread-group {
  display: grid;
  gap: 6px;
  margin: 8px 0 12px;
}

.thread-group-title {
  width: 100%;
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 6px;
  border-radius: 8px;
  background: #e9e5da;
  color: #332f29;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  text-transform: uppercase;
}

.thread-group-title:hover {
  background: #ddd8ca;
  color: var(--ink);
}

.thread-group-chevron {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  background: #fffaf0;
  color: inherit;
}

.thread-group-chevron svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.thread-group-label {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0;
}

.thread-group-count {
  min-width: 22px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: #fffaf0;
  color: #6f6758;
  font-size: 11px;
  font-weight: 800;
}

.thread-group-items {
  display: grid;
  gap: 2px;
  padding-left: 2px;
}

.thread-empty {
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
}

.thread-row {
  width: 100%;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border-radius: 7px;
  background: transparent;
}

.thread-row.active,
.thread-row:hover {
  background: var(--hover);
}

.thread-item {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 8px 8px 8px 12px;
  border-radius: inherit;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

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

.thread-item strong {
  font-size: 13px;
  font-weight: 500;
}

.thread-item span {
  color: var(--muted);
  font-size: 12px;
}

.thread-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1px;
  padding-right: 5px;
  opacity: 0;
  pointer-events: none;
}

.thread-row:hover .thread-actions,
.thread-row.active .thread-actions,
.thread-actions:focus-within {
  opacity: 1;
  pointer-events: auto;
}

.thread-actions button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: transparent;
  color: #6d6960;
}

.thread-actions button:hover {
  background: #dedbd2;
  color: #111;
}

.thread-actions button.danger:hover {
  background: #f5e4df;
  color: var(--danger);
}

.thread-actions svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.thread-menu {
  position: absolute;
  top: 30px;
  right: 4px;
  z-index: 30;
  width: 164px;
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.16);
}

.thread-menu::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 10px;
  width: 100%;
  height: 10px;
}

.thread-menu button {
  width: 100%;
  height: 36px;
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 10px;
  border-radius: 8px;
  color: #0d0d0d;
  font-size: 14px;
  text-align: left;
}

.thread-menu button:hover {
  background: #f2f2f2;
}

.thread-menu button.danger {
  color: var(--danger);
}

.thread-menu button.danger:hover {
  background: #fff0ed;
}

.thread-menu svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.thread-rename-form {
  grid-column: 1 / -1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px 28px;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px #d9d9d9;
}

.thread-rename-form input {
  height: 30px;
  min-width: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
}

.thread-rename-form input:focus {
  border-color: transparent;
}

.thread-rename-form button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: transparent;
  color: #5f5f5f;
}

.thread-rename-form button:hover {
  background: #f2f2f2;
  color: #0d0d0d;
}

.thread-rename-form svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-bottom {
  display: grid;
  gap: 4px;
}

.lang-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  color: #111;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(20, 20, 20, 0.08);
}

.chat-area,
.page-view {
  min-width: 0;
  min-height: 0;
  height: 100vh;
  height: 100svh;
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr) auto;
  overflow: hidden;
  background: var(--paper);
}

.page-view {
  grid-template-rows: 64px minmax(0, 1fr);
}

.chat-header {
  min-height: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  background: var(--paper);
}

.top-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-sidebar-button {
  width: 36px;
  height: 36px;
  display: none;
  place-items: center;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
}

.mobile-sidebar-button:hover {
  background: var(--hover);
}

.mobile-sidebar-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}


.top-skeleton {
  display: flex;
  align-items: center;
  gap: 16px;
}

.top-skeleton span {
  width: 28px;
  height: 28px;
  display: block;
  border-radius: 999px;
  background: transparent url("/chatgpt-pink.svg") center / 20px 20px no-repeat;
}

.top-skeleton i {
  width: 200px;
  height: 18px;
  display: block;
  border-radius: 5px;
  background: #efede7;
}

.chat-meta {
  min-width: 0;
  opacity: 0;
  pointer-events: none;
}

.chat-title {
  font-weight: 700;
}

.chat-subtitle {
  margin-top: 3px;
  font-size: 12px;
}

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

.model-picker {
  position: relative;
}

.model-button {
  width: 220px;
  height: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 14px;
  border-radius: 5px;
  background: #efede7;
  color: #27241f;
  font-size: 13px;
  text-align: left;
}

.model-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #efede7;
  color: #33302b;
  font-size: 11px;
  font-weight: 800;
}

.model-icon img {
  width: 17px;
  height: 17px;
  display: block;
}

.model-icon.claude {
  background: #f4e4d3;
  color: #9a4d22;
}

.model-icon.gemini {
  background: #e8f0ff;
  color: #3157b7;
}

.model-icon.deepseek {
  background: #e8f3ff;
  color: #2266aa;
}

.model-icon.deepseek img {
  width: 20px;
  height: auto;
}

.model-icon.kimi {
  background: #f0eaff;
  color: #5f3cad;
}

.model-icon.glm {
  background: #e8f8ee;
  color: #16834b;
}

.model-icon.minimax {
  background: #fff3df;
  color: #a66200;
}

.model-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-button #modelButtonText {
  min-width: 0;
  flex: 1;
}

.model-button b {
  color: #76736d;
  font-size: 12px;
}

.model-menu {
  position: absolute;
  top: 28px;
  left: 0;
  width: 310px;
  max-height: 280px;
  overflow: auto;
  z-index: 20;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  box-shadow: 0 16px 48px rgba(25, 23, 18, 0.12);
}

.model-option {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px;
  border-radius: 6px;
  background: transparent;
  color: #111;
  font-size: 13px;
  text-align: left;
}

.model-option-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.model-option-copy strong,
.model-option-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-option-copy strong {
  font-size: 13px;
  font-weight: 700;
}

.model-option-copy small {
  color: var(--muted);
  font-size: 11px;
}

.model-option:hover,
.model-option.active {
  background: #efede7;
}

.login-pill {
  min-width: 62px;
  height: 33px;
  padding: 0 18px;
  border-radius: 999px;
  background: #030303;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.top-doc-button {
  height: 33px;
  min-width: 54px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffefa;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.top-doc-button:hover {
  background: #efede7;
}

.ghost-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffefa;
  color: var(--ink);
}

.backChat {
  justify-self: end;
}

.messages {
  position: relative;
  min-height: 0;
  overflow: auto;
  padding: 18px max(22px, calc((100vw - 1020px) / 2)) 118px;
}

.empty-state {
  min-height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}

.empty-state strong {
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  line-height: 1;
}

.empty-state strong img {
  width: 64px;
  height: 64px;
  display: block;
}

.empty-state strong img.deepseek {
  width: 76px;
  height: 76px;
}

.message {
  display: flex;
  gap: 12px;
  margin: 0 auto 16px;
  max-width: 820px;
}

.avatar {
  flex: 0 0 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #efede7;
  color: #5f5c56;
  font-weight: 800;
}

.avatar img {
  width: 22px;
  height: 22px;
  display: block;
}

.avatar.deepseek {
  background: #e8f3ff;
}

.avatar.deepseek img {
  width: 28px;
  height: auto;
}

.message.user {
  flex-direction: row-reverse;
}

.message.user .avatar {
  background: #050505;
  color: #fff;
}

.bubble {
  max-width: min(680px, 88%);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffefa;
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.markdown-body {
  white-space: normal;
}

.markdown-body > *:first-child {
  margin-top: 0;
}

.markdown-body > *:last-child {
  margin-bottom: 0;
}

.markdown-body p {
  margin: 0 0 12px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 18px 0 8px;
  color: #0d0d0d;
  font-weight: 700;
  line-height: 1.3;
}

.markdown-body h1 {
  font-size: 24px;
}

.markdown-body h2 {
  font-size: 21px;
}

.markdown-body h3 {
  font-size: 18px;
}

.markdown-body h4 {
  font-size: 16px;
}

.markdown-body ul,
.markdown-body ol {
  margin: 0 0 12px;
  padding-left: 24px;
}

.markdown-body li {
  margin: 4px 0;
}

.markdown-body code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #f1f1f1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.markdown-body pre {
  margin: 12px 0;
  overflow: auto;
  border-radius: 10px;
  background: #171717;
}

.markdown-body pre code {
  display: block;
  padding: 14px;
  background: transparent;
  color: #f7f7f7;
  line-height: 1.55;
  white-space: pre;
}

.markdown-body blockquote {
  margin: 12px 0;
  padding-left: 14px;
  border-left: 3px solid #d7d7d7;
  color: #555;
}

.markdown-body hr {
  margin: 18px 0;
  border: 0;
  border-top: 1px solid #dedede;
}

.markdown-body a {
  color: #0b57d0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.markdown-body .table-scroll {
  max-width: 100%;
  margin: 12px 0;
  overflow: auto;
}

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

.markdown-body th,
.markdown-body td {
  padding: 9px 11px;
  border: 1px solid #dedede;
  text-align: left;
  vertical-align: top;
}

.markdown-body th {
  background: #f7f7f7;
  font-weight: 700;
}

.message-body {
  max-width: min(680px, 88%);
  display: grid;
  gap: 6px;
}

.message-body .bubble {
  max-width: 100%;
}

.thinking-panel {
  width: fit-content;
  max-width: 100%;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 14px;
}

.thinking-panel summary {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  border-radius: 999px;
  color: #6d6960;
}

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

.thinking-panel summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: 2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
}

.thinking-panel[open] summary::after {
  transform: rotate(225deg) translateY(-1px);
}

.thinking-panel summary i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  animation: thinkingPulse 1.1s ease-in-out infinite;
}

.thinking-content {
  margin-top: 8px;
  padding: 10px 12px;
  border-left: 2px solid #d7d7d7;
  color: #555;
  font-size: 14px;
}

.search-results-panel {
  width: min(680px, 100%);
  display: grid;
  gap: 8px;
  margin: 0 0 8px;
  color: #0d0d0d;
}

.search-results-title {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}

.search-results-title::-webkit-details-marker {
  display: none;
}

.search-results-title::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: 2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
}

.search-results-panel[open] .search-results-title::after {
  transform: rotate(225deg) translateY(-1px);
}

.search-result-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.search-result-card {
  min-width: 0;
  min-height: 74px;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 10px 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffefa;
  color: inherit;
  text-decoration: none;
}

.search-result-card:hover {
  background: #f6f6f6;
}

.search-result-card strong,
.search-result-card span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-card strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 13px;
  line-height: 1.35;
}

.search-result-card span {
  display: block;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.stream-cursor {
  width: 7px;
  height: 18px;
  display: inline-block;
  border-radius: 999px;
  background: currentColor;
  vertical-align: -3px;
  animation: streamCursor 1s ease-in-out infinite;
}

@keyframes streamCursor {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 1;
  }
}

@keyframes thinkingPulse {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}

.message.user .bubble {
  background: #050505;
  color: #fff;
}

.message.user .message-body {
  justify-items: end;
}

.message.user .message-actions {
  justify-content: flex-end;
  width: 100%;
}

.message-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.message-action-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.message-icon-button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  color: #6d6960;
}

.message-icon-button:hover {
  background: #efede7;
  color: #111;
}

.message-icon-button.danger {
  color: var(--danger);
}

.message-icon-button.danger:hover {
  background: #f5e4df;
}

.message-icon-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-action-buttons time {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  transition: max-width 160ms ease, opacity 160ms ease, margin-left 160ms ease;
}

.message-actions:hover time,
.message-action-buttons:focus-within time {
  max-width: 130px;
  margin-left: 4px;
  opacity: 1;
}

.message-actions span {
  margin-left: auto;
  white-space: nowrap;
}

body.chatgpt-theme .sidebar {
  background: #f9f9f9;
}

body.chatgpt-theme .bai-logo {
  height: 50px;
  font-size: 21px;
  font-weight: 600;
}

body.chatgpt-theme .bai-nav {
  gap: 2px;
}

body.chatgpt-theme .bai-nav-item {
  height: 36px;
  border-radius: 9px;
  color: #0d0d0d;
  font-weight: 500;
}

body.chatgpt-theme .search-wrap input {
  background: #ffffff;
}

body.chatgpt-theme .thread-group {
  gap: 6px;
  margin: 8px 0 12px;
}

body.chatgpt-theme .thread-group-title {
  min-height: 32px;
  padding: 0 8px 0 6px;
  background: #f3f3f3;
  color: #555;
  font-size: 12px;
  font-weight: 800;
}

body.chatgpt-theme .thread-group-title:hover {
  background: #e9e9e9;
  color: #0d0d0d;
}

body.chatgpt-theme .thread-group-chevron,
body.chatgpt-theme .thread-group-count {
  background: #ffffff;
}

body.chatgpt-theme .thread-row {
  border-radius: 9px;
}

body.chatgpt-theme .thread-row.active,
body.chatgpt-theme .thread-row:hover {
  background: #ececec;
}

body.chatgpt-theme .thread-item {
  padding: 8px 8px 8px 12px;
}

body.chatgpt-theme .thread-item strong {
  color: #0d0d0d;
  font-size: 14px;
  font-weight: 400;
}

body.chatgpt-theme .thread-item > span {
  display: none;
}

body.chatgpt-theme .thread-actions button:hover,
body.chatgpt-theme .thread-rename-form button:hover {
  background: #dedede;
}

body.chatgpt-theme .thread-menu {
  border-color: rgba(0, 0, 0, 0.08);
  background: #ffffff;
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.18);
}

body.chatgpt-theme .thread-rename-form {
  background: #ffffff;
}

body.chatgpt-theme .usage-chart-card {
  border-color: #e5e5e5;
  background: #ffffff;
}

body.chatgpt-theme .usage-chart-header h3 span {
  background: #f4f4f4;
}

body.chatgpt-theme .usage-toggle {
  border-color: #e5e5e5;
  background: #f4f4f4;
}

body.chatgpt-theme .usage-toggle button.active {
  background: #0d0d0d;
}

body.chatgpt-theme .usage-month-bar i,
body.chatgpt-theme .usage-hour-bar i {
  background: #e7e7e7;
}

body.chatgpt-theme .usage-month-bar:hover i,
body.chatgpt-theme .usage-month-bar.active i,
body.chatgpt-theme .usage-hour-bar:hover i {
  background: #0d0d0d;
}

body.chatgpt-theme .chat-header,
body.chatgpt-theme .chat-area,
body.chatgpt-theme .page-view {
  background: #ffffff;
}

body.chatgpt-theme .messages {
  padding: 18px max(22px, calc((100vw - 1020px) / 2)) 118px;
}

body.chatgpt-theme .message {
  max-width: 820px;
  gap: 12px;
  margin-bottom: 16px;
}

body.chatgpt-theme .message.assistant {
  justify-content: flex-start;
}

body.chatgpt-theme .message.user {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

body.chatgpt-theme .bubble {
  max-width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffefa;
  color: #0d0d0d;
  font-size: 15px;
  line-height: 1.55;
}

body.chatgpt-theme .message.assistant .bubble {
  background: #fffefa;
  border-color: var(--line);
  padding: 12px 14px;
}

body.chatgpt-theme .message.user .bubble {
  background: #050505;
  color: #ffffff;
  border-color: #050505;
  max-width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
}

body.chatgpt-theme .message-body {
  max-width: min(680px, 88%);
  display: grid;
  gap: 6px;
}

body.chatgpt-theme .message.assistant .message-body {
  width: auto;
}

body.chatgpt-theme .message.user .message-body {
  max-width: min(680px, 88%);
  justify-items: end;
}

body.chatgpt-theme .avatar {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  background: #efede7;
  color: #5f5c56;
}

body.chatgpt-theme .avatar img {
  width: 22px;
  height: 22px;
}

body.chatgpt-theme .avatar.deepseek img {
  width: 28px;
  height: auto;
}

body.chatgpt-theme .message.user .avatar,
body.chatgpt-theme .message.user .message-actions time {
  display: grid;
}

body.chatgpt-theme .message.user .avatar {
  background: #050505;
  color: #ffffff;
}

body.chatgpt-theme .message-actions {
  min-height: 0;
  padding: 0 4px;
  color: var(--muted);
}

body.chatgpt-theme .thinking-panel {
  margin-bottom: 8px;
  color: #8f8f8f;
}

body.chatgpt-theme .thinking-panel summary {
  min-height: 28px;
  padding: 0;
  color: #8f8f8f;
  font-size: 14px;
}

body.chatgpt-theme .thinking-content {
  max-width: 680px;
  padding: 8px 0 8px 14px;
  border-left-color: #d9d9d9;
  color: #5f5f5f;
}

body.chatgpt-theme .search-results-panel {
  width: min(680px, 100%);
  margin-bottom: 12px;
}

body.chatgpt-theme .search-results-title {
  color: #6f6f6f;
  font-size: 14px;
}

body.chatgpt-theme .search-result-card {
  border-color: #e3e3e3;
  border-radius: 12px;
  background: #ffffff;
}

body.chatgpt-theme .search-result-card:hover {
  background: #f7f7f7;
}

body.chatgpt-theme .message.user .message-actions {
  padding-right: 2px;
}

body.chatgpt-theme .message-icon-button {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: #6b6b6b;
}

body.chatgpt-theme .message-icon-button:hover {
  background: #f2f2f2;
}

body.chatgpt-theme .composer {
  right: max(24px, calc((100vw - 255px - 768px) / 2));
  left: calc(255px + max(24px, calc((100vw - 255px - 768px) / 2)));
  max-width: 768px;
  gap: 6px;
  padding: 12px;
  border-color: #d9d9d9;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.10);
}

body.chatgpt-theme .composer textarea {
  min-height: 48px;
  padding: 10px 8px 4px;
  color: #0d0d0d;
  font-size: 16px;
  line-height: 1.5;
}

body.chatgpt-theme .composer textarea::placeholder {
  color: #8f8f8f;
}

body.chatgpt-theme .tool-button,
body.chatgpt-theme .tool-pill {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #f4f4f4;
  color: #2f2f2f;
  font-weight: 600;
}

body.chatgpt-theme .tool-button {
  width: 36px;
  font-size: 22px;
  font-weight: 400;
}

body.chatgpt-theme .tool-pill svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.chatgpt-theme .send-button,
body.chatgpt-theme .tool-pill.active {
  background: #0d0d0d;
  color: #ffffff;
}

body.chatgpt-theme .send-button {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  font-size: 18px;
}

body.chatgpt-theme .model-button {
  background: #f4f4f4;
  border-radius: 999px;
  height: 28px;
}

body.chatgpt-theme .codex-button {
  background: #f4f4f4;
  border-radius: 999px;
  height: 28px;
}

body.deepseek-theme .chat-header {
  background: #f7f9ff;
}

body.deepseek-theme .composer {
  right: max(24px, calc((100vw - 255px - 840px) / 2));
  left: calc(255px + max(24px, calc((100vw - 255px - 840px) / 2)));
  max-width: 840px;
  gap: 8px;
  padding: 14px 16px 12px;
  border-color: #d6e2f4;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 32px rgba(28, 82, 164, 0.12);
}

body.deepseek-theme .composer textarea {
  min-height: 44px;
  padding: 8px 2px 2px;
  color: #111827;
  font-size: 15px;
  line-height: 1.55;
}

body.deepseek-theme .composer textarea::placeholder {
  color: #8a96aa;
}

body.deepseek-theme .composer-toolbar {
  padding-top: 2px;
}

body.deepseek-theme .composer-tools,
body.deepseek-theme .composer-actions {
  gap: 7px;
}

body.deepseek-theme .tool-button {
  width: 32px;
  height: 32px;
  border: 1px solid #d8e2f0;
  background: #ffffff;
  color: #516276;
  font-size: 18px;
  font-weight: 400;
}

body.deepseek-theme #attach {
  font-size: 16px;
}

body.deepseek-theme .tool-pill {
  height: 32px;
  padding: 0 12px;
  border: 1px solid #d8e2f0;
  background: #ffffff;
  color: #4f6075;
  font-size: 13px;
  font-weight: 600;
}

body.deepseek-theme .tool-button:hover,
body.deepseek-theme .tool-pill:hover {
  border-color: #b8cff0;
  background: #f5f9ff;
  color: #2563d9;
}

body.deepseek-theme .tool-pill.active {
  border-color: #8db7ff;
  background: #eaf3ff;
  color: #1f6feb;
}

body.deepseek-theme .codex-picker {
  display: none;
}

body.deepseek-theme .send-button {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  background: #2563eb;
  color: #ffffff;
  font-size: 18px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

body.deepseek-theme .send-button:hover {
  background: #1d4ed8;
}

body.deepseek-theme .send-button.is-stop span {
  width: 11px;
  height: 11px;
  border-radius: 3px;
}

body.deepseek-theme .model-button {
  height: 30px;
  border: 1px solid #d8e2f0;
  border-radius: 999px;
  background: #ffffff;
  color: #1f2a44;
}

body.deepseek-theme .attachment-list {
  gap: 6px;
}

body.deepseek-theme .attachment-card {
  width: min(216px, 100%);
  grid-template-columns: 36px minmax(0, 1fr) 20px;
  gap: 8px;
  padding: 6px;
  border-color: #d6e2f4;
  border-radius: 10px;
  background: #f7faff;
  color: #1f2a44;
}

body.deepseek-theme .attachment-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #ffffff;
  color: #4b6fae;
}

body.deepseek-theme .attachment-meta strong {
  font-size: 11px;
}

body.deepseek-theme .attachment-meta span {
  color: #71809a;
  font-size: 10px;
}

body.deepseek-theme .attachment-meta i {
  background: #2563eb;
}

body.deepseek-theme .attachment-card button {
  background: #e4edf9;
  color: #53677f;
}

.composer {
  position: fixed;
  right: max(18px, calc((100vw - 255px - 820px) / 2));
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 14px));
  left: calc(255px + max(18px, calc((100vw - 255px - 820px) / 2)));
  z-index: 10;
  display: grid;
  gap: 8px;
  width: auto;
  max-width: 820px;
  margin: 0 auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffefa;
  box-shadow: 0 16px 50px rgba(25, 23, 18, 0.08);
}

.composer textarea {
  min-height: 42px;
  max-height: 150px;
  padding: 8px 10px;
  font-size: 15px;
  line-height: 1.5;
}

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

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

.composer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.tool-button,
.send-button {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #efede7;
  color: #111;
  font-size: 20px;
}

.tool-pill {
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: #efede7;
  color: #2f2d28;
  font-size: 13px;
  font-weight: 700;
}

.tool-pill.active {
  background: #050505;
  color: #fff;
}

.codex-picker {
  position: relative;
}

.codex-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: #efede7;
  color: #2f2d28;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.codex-picker:focus-within .codex-menu {
  display: grid;
}

.codex-button b {
  font-size: 12px;
  line-height: 1;
}

.codex-button.disabled,
.codex-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.codex-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  min-width: 186px;
  padding: 6px;
  border: 1px solid #ded8cb;
  border-radius: 14px;
  background: #fffefa;
  box-shadow: 0 16px 42px rgba(25, 23, 18, 0.16);
  z-index: 20;
}

.codex-section-label {
  padding: 8px 10px 6px;
  color: #6a6458;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.codex-option {
  width: 100%;
  display: grid;
  gap: 2px;
  padding: 9px 11px;
  border-radius: 10px;
  text-align: left;
  background: transparent;
  color: #2f2d28;
}

.codex-option span {
  font-size: 13px;
  font-weight: 700;
}

.codex-option small {
  font-size: 11px;
  color: #726b5f;
}

.codex-option:hover,
.codex-option.active {
  background: #f4f1e8;
}

.send-button {
  background: #050505;
  color: #fff;
}

.send-button.is-stop {
  display: grid;
  place-items: center;
}

.send-button.is-stop span {
  width: 12px;
  height: 12px;
  display: block;
  border-radius: 3px;
  background: currentColor;
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-card {
  width: min(230px, 100%);
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border: 1px solid #e0ddd5;
  border-radius: 12px;
  background: #efede7;
  color: #37342f;
}

.attachment-card.error {
  border-color: #efc4bc;
  background: #fff2ef;
}

.attachment-thumb {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  background: #fffefa;
  color: #6d6960;
  font-size: 12px;
  font-weight: 800;
}

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

.attachment-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}

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

.attachment-meta strong {
  font-size: 12px;
}

.attachment-meta span {
  color: #77736a;
  font-size: 11px;
}

.attachment-card.error .attachment-meta span {
  color: var(--danger);
}

.attachment-meta i {
  height: 3px;
  border-radius: 999px;
  background: #050505;
}

.attachment-card.ready .attachment-meta i,
.attachment-card.error .attachment-meta i {
  display: none;
}

.attachment-card button {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #d8d4cb;
  color: #111;
  font-size: 12px;
  line-height: 1;
}

.page-error {
  min-height: 20px;
  margin: 12px 0;
  color: var(--danger);
  font-size: 13px;
}

.page-error.success-message {
  color: #237a3b;
}

.page-content {
  width: min(980px, calc(100% - 40px));
  min-height: 0;
  margin: 0 auto;
  padding: 34px 0;
  overflow: auto;
}

.api-hero,
.profile-card,
.history-card,
.info-grid article {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffefa;
}

.api-hero {
  padding: 26px;
}

.provider-card {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.api-hero h2,
.profile-card h2 {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: 0;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.info-grid article {
  min-height: 104px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
}

.info-grid span,
.history-card span {
  color: var(--muted);
  font-size: 12px;
}

.info-grid strong {
  overflow-wrap: anywhere;
}

.usage-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.usage-summary-grid article {
  min-height: 116px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffefa;
}

.usage-summary-grid span {
  color: #9c9588;
  font-size: 13px;
  font-weight: 700;
}

.usage-summary-grid small {
  color: var(--muted);
  font-size: 13px;
}

.usage-summary-grid strong {
  color: var(--ink);
  font-size: 26px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.usage-summary-grid em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.usage-chart-card {
  display: grid;
  gap: 16px;
  margin: 14px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffefa;
}

.usage-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

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

.usage-toggle {
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f6f4ee;
}

.usage-toggle button {
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.usage-toggle button.active {
  background: #050505;
  color: #ffffff;
}

.usage-chart-header h3 {
  margin: 0 0 5px;
  font-size: 17px;
}

.usage-chart-header h3 span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: 4px;
  border-radius: 7px;
  background: #efede7;
  font-size: 14px;
}

.usage-chart-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.usage-chart {
  min-height: 252px;
  overflow-x: auto;
  padding: 8px 0 0;
}

.usage-chart-frame {
  min-width: 680px;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
}

.usage-y-axis {
  height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-bottom: 28px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.usage-plot {
  position: relative;
  min-height: 220px;
}

.usage-grid-lines {
  position: absolute;
  inset: 0 0 28px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.usage-grid-lines i {
  display: block;
  border-top: 1px solid #ece7dc;
}

.usage-month-bars {
  position: relative;
  z-index: 1;
  height: 220px;
  display: grid;
  grid-template-columns: repeat(12, minmax(44px, 1fr));
  align-items: end;
  gap: 10px;
}

.usage-month-bar {
  min-width: 0;
  height: 220px;
  display: grid;
  grid-template-rows: 24px 1fr 22px;
  align-items: end;
  justify-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.usage-bar-value,
.usage-hour-bar span {
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
}

.usage-month-bar:hover .usage-bar-value,
.usage-month-bar.active .usage-bar-value,
.usage-hour-bar:hover span {
  opacity: 1;
}

.usage-month-bar i,
.usage-hour-bar i {
  width: 100%;
  max-width: 42px;
  min-height: 5px;
  display: block;
  border-radius: 8px 8px 4px 4px;
  background: #d8d4cb;
  transition: background 160ms ease, transform 160ms ease;
}

.usage-month-bar:hover i,
.usage-month-bar.active i,
.usage-hour-bar:hover i {
  background: #050505;
  transform: translateY(-2px);
}

.usage-month-bar b,
.usage-hour-bar b {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.usage-hour-chart,
.usage-hour-bar {
  display: none;
}

.usage-month-bar.active b {
  color: #050505;
}

.usage-detail-title {
  margin: 18px 0 10px;
  font-size: 18px;
}

.usage-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffefa;
}

.usage-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 13px;
}

.usage-table th,
.usage-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.usage-table th {
  color: var(--muted);
  font-weight: 700;
  background: #faf8f1;
}

.usage-table tr:last-child td {
  border-bottom: 0;
}

.usage-type-pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #efede7;
  color: #111;
  font-weight: 700;
}

.usage-token-cell {
  display: grid;
  gap: 4px;
}

.usage-token-cell strong {
  font-size: 14px;
}

.usage-token-cell small {
  color: var(--muted);
  font-size: 11px;
}

.usage-token-cell b {
  color: var(--ink);
  font-weight: 700;
}

.usage-table-note {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 12px;
}

.code-block {
  margin: 14px 0 0;
  padding: 18px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #111;
  color: #f6f1e7;
  line-height: 1.55;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
}

.api-key-toolbar {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 14px;
}

.key-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 12px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffefa;
}

.key-form label {
  margin-top: 0;
}

.key-form .primary {
  width: auto;
  min-width: 120px;
  margin-top: 0;
  padding: 0 18px;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.22);
}

.api-key-modal {
  width: min(365px, calc(100vw - 24px));
  gap: 18px;
  padding: 14px;
  border: 0;
  border-radius: 3px;
  background: #2b2b2d;
  color: #f5f5f5;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.36);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.modal-header p {
  margin: 18px 0 0;
  color: #b8b8bb;
  font-size: 15px;
  line-height: 1.7;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: transparent;
  color: #e7e7e7;
  font-size: 26px;
  line-height: 1;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.account-modal {
  width: min(440px, calc(100vw - 28px));
  gap: 16px;
  border-radius: 18px;
}

.account-modal .modal-header p,
.account-modal .modal-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.account-modal .modal-close {
  color: #111;
}

.account-modal .modal-close:hover {
  background: #f1f0eb;
  color: #111;
}

.account-modal label {
  margin-top: 0;
}

.account-modal input {
  height: 46px;
  border-radius: 12px;
}

.split-actions {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.account-result-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  background: #f6f4ee;
}

.account-result-box div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.account-result-box span {
  color: var(--muted);
}

.account-result-box p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.account-bind-panel {
  width: min(560px, 100%);
  display: grid;
  gap: 14px;
  margin-top: 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffefa;
}

.account-bind-panel label {
  margin-top: 0;
}

.success-text {
  color: #167a3d !important;
}

.api-key-name-area label {
  margin-top: 0;
  gap: 10px;
  color: #b8b8bb;
  font-size: 15px;
}

.api-key-name-area input {
  height: 44px;
  border: 0;
  border-radius: 9px;
  background: #5a5a5a;
  color: #ffffff;
  font-size: 15px;
}

.api-key-name-area input:focus {
  border-color: transparent;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.16);
}

.api-key-secret-box {
  display: grid;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.api-key-secret-box textarea {
  max-height: 92px;
  min-height: 66px;
  overflow: auto;
  padding: 12px 14px;
  border: 0;
  border-radius: 9px;
  background: #5a5a5a;
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  resize: none;
  white-space: pre-wrap;
}

.api-key-secret-box textarea:focus {
  border-color: transparent;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.16);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 18px;
}

.modal-actions .primary {
  min-width: 126px;
  min-height: 44px;
  margin-top: 0;
  padding: 0 18px;
  border-radius: 11px;
  background: #ffffff;
  color: #111111;
  font-weight: 500;
}

.modal-actions .primary:disabled {
  opacity: 0.65;
  cursor: default;
}

.modal-actions .ghost-button {
  min-height: 38px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #f1f1f1;
  font-weight: 700;
}

.modal-actions .ghost-button:hover {
  color: #ffffff;
  background: transparent;
}

.api-key-modal .page-error {
  min-height: 0;
  margin: -6px 0 0;
  color: #ff9b90;
}

.new-key-box,
.key-card {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffefa;
}

.new-key-box {
  display: grid;
  gap: 8px;
}

.new-key-box span {
  color: var(--danger);
  font-size: 12px;
}

.new-key-box code {
  overflow-wrap: anywhere;
  color: #111;
}

.key-list {
  margin-top: 12px;
}

.api-key-empty {
  display: grid;
  gap: 6px;
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffefa;
}

.api-key-empty span {
  color: var(--muted);
  font-size: 13px;
}

.api-key-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffefa;
}

.api-key-table-head,
.api-key-table-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(150px, 1fr) minmax(130px, 0.75fr) minmax(64px, 0.36fr);
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
}

.api-key-table-head {
  border-bottom: 1px solid var(--line);
  background: #faf8f1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.api-key-table-row {
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
}

.api-key-table-row:last-child {
  border-bottom: 0;
}

.api-key-table-row strong,
.api-key-table-row code,
.api-key-table-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-key-table-row code {
  font-family: inherit;
  color: var(--muted);
}

.api-key-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.api-key-copy,
.api-key-doc,
.api-key-delete {
  justify-self: start;
  min-height: 34px;
  padding: 0;
  background: transparent;
  font-weight: 700;
}

.api-key-copy,
.api-key-doc {
  color: var(--ink);
}

.api-key-delete {
  color: var(--danger);
}

.config-help-section {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.section-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.config-help-card {
  min-height: 118px;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  color: var(--ink);
  text-align: left;
}

.config-help-card:hover {
  border-color: #d8cbb8;
  background: #fffaf0;
}

.config-help-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.config-help-card strong {
  font-size: 16px;
}

.config-help-card small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.config-help-card.disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.doc-layout {
  display: grid;
  grid-template-columns: minmax(190px, 0.32fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.doc-nav {
  display: grid;
  gap: 10px;
}

.doc-nav-item {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  color: var(--ink);
  text-align: left;
}

.doc-nav-item.active {
  border-color: #1f1f1f;
  background: #111;
  color: #fff;
}

.doc-nav-item:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.doc-nav-item span {
  color: inherit;
  opacity: 0.66;
  font-size: 12px;
}

.doc-panel {
  min-width: 0;
}

.doc-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}

.doc-steps article {
  display: flex;
  gap: 10px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
}

.doc-steps span {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.doc-steps p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.doc-steps code {
  color: var(--ink);
}

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

.openclaw-key-form {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
}

.openclaw-key-form label {
  flex: 1;
}

.openclaw-key-form input {
  margin-top: 7px;
}

.openclaw-command-card {
  display: grid;
  gap: 10px;
}

.openclaw-command-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.openclaw-model-picker {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.openclaw-model-picker select {
  height: 38px;
  width: min(360px, 100%);
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  color: var(--ink);
  font: inherit;
}

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

.ghost-button.tiny {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.openclaw-model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.openclaw-model-check {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.openclaw-model-check.checked {
  border-color: #cdbf9e;
  background: #fff8e7;
}

.openclaw-model-check input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.openclaw-model-check span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.openclaw-command-card strong {
  color: var(--ink);
  font-size: 14px;
}

.doc-card-note {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.doc-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
}

.doc-list li::marker {
  color: #111;
  font-weight: 800;
}

.doc-tip {
  padding: 9px 10px;
  border: 1px solid #e7dfcc;
  border-radius: 8px;
  background: #fff8e7;
  color: #514633;
  font-size: 12px;
  line-height: 1.5;
}

.doc-table {
  width: min(620px, 100%);
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  font-size: 12px;
}

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

.doc-table th {
  background: #f3f0e7;
  color: #35312b;
  font-weight: 800;
}

.doc-table tr:last-child td {
  border-bottom: 0;
}

.doc-table code,
.doc-tip code {
  color: var(--ink);
}

.openclaw-code-wrap {
  position: relative;
}

.openclaw-code-actions {
  position: absolute;
  top: 24px;
  right: 10px;
  z-index: 2;
}

.copy-icon-button {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: 7px;
  background: rgba(255, 250, 240, 0.94);
  color: #111;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.copy-icon-button:hover {
  background: #ffffff;
}

.copy-icon-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.openclaw-code-wrap .code-block {
  padding-right: 88px;
}

.danger-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f5e4df;
  color: var(--danger);
}

.admin-toolbar,
.admin-create-user {
  display: grid;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
}

.admin-toolbar input,
.admin-toolbar select,
.admin-create-user input,
.admin-create-user select,
.admin-pool-form input,
.admin-pool-form select,
.admin-plan-grid input,
.admin-plan-grid select,
.admin-pool-grid input,
.admin-pool-grid select,
.admin-pool-calibration input,
.admin-pool-calibration select,
.admin-pool-member-add input,
.admin-pool-member-add select {
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
}

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

.admin-create-user {
  grid-template-columns: minmax(130px, 1fr) minmax(150px, 1fr) minmax(100px, 0.7fr) auto;
  margin-top: 10px;
}

.admin-toolbar .inline-primary,
.admin-create-user .inline-primary {
  margin-top: 0;
}

#modelConfigView .chat-title {
  font-size: 15px;
}

#modelConfigView .chat-subtitle {
  font-size: 11px;
}

#modelConfigView .page-content {
  padding-top: 18px;
}

#modelConfigView .admin-toolbar {
  gap: 6px;
  padding: 8px;
}

#modelConfigView .admin-toolbar input {
  height: 30px;
  font-size: 11px;
}

#modelConfigView .admin-toolbar button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 11px;
}

.admin-user-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.admin-model-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.admin-model-provider-row {
  margin-top: 8px;
  padding: 4px 2px 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-model-row {
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffefa;
}

.admin-model-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.admin-model-main input {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.admin-model-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}

.admin-model-main span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.admin-model-main strong,
.admin-model-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-model-main strong {
  font-size: 12px;
  line-height: 1.25;
}

.admin-model-main small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.admin-model-main small b {
  color: var(--ink);
  font-weight: 800;
}

.admin-model-weight {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
}

.admin-model-weight input {
  width: 100%;
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11px;
}

.admin-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.admin-section .api-hero {
  margin-top: 0;
  padding: 10px 12px;
  border-radius: 6px;
}

.admin-section .api-hero h2 {
  margin-bottom: 3px;
  font-size: 15px;
}

.admin-section .api-hero p {
  font-size: 11px;
  line-height: 1.4;
}

.admin-plan-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.admin-plan-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
}

.admin-plan-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
}

.admin-plan-head strong {
  font-size: 14px;
}

.admin-plan-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.admin-plan-head code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.admin-plan-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #efede7;
  color: #111;
  font-size: 11px;
  line-height: 1.2;
}

.admin-plan-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 0.75fr) minmax(120px, 0.55fr) minmax(150px, 0.7fr);
  gap: 8px;
}

.admin-plan-grid label {
  margin-top: 0;
}

.plan-toggle {
  align-content: start;
}

.plan-toggle span {
  color: #56544f;
  font-size: 12px;
}

.plan-toggle input {
  width: 18px;
  height: 18px;
  margin-top: 11px;
}

.admin-plan-json-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.admin-plan-json-grid label {
  margin-top: 0;
}

.admin-plan-json-grid textarea {
  min-height: 150px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
}

.admin-plan-actions {
  display: flex;
  justify-content: flex-end;
}

.admin-pool-form {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(120px, 0.9fr) minmax(160px, 1.1fr) minmax(100px, 0.7fr) minmax(220px, 1fr) minmax(110px, 0.7fr) minmax(120px, 0.8fr) minmax(110px, 0.8fr) minmax(140px, 0.9fr) auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
}

.admin-pool-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.admin-pool-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
}

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

.admin-pool-grid label,
.admin-pool-calibration label {
  margin-top: 0;
}

.admin-pool-stats {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 8px;
  background: #f7f5ef;
  color: #3f3d39;
  font-size: 12px;
}

.admin-pool-members {
  display: grid;
  gap: 8px;
}

.admin-pool-members-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.admin-pool-member-add {
  display: flex;
  gap: 6px;
  align-items: center;
}

.admin-pool-member-add select {
  min-width: 180px;
}

.admin-pool-member-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pool-member-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f0ede4;
  color: #222;
  font-size: 12px;
}

.pool-member-chip button {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: transparent;
  color: inherit;
}

.pool-empty-hint {
  color: var(--muted);
  font-size: 12px;
}

.admin-pool-calibration {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(140px, 0.8fr) minmax(140px, 0.8fr) minmax(180px, 1fr) minmax(220px, 1.2fr);
  padding: 10px;
  border-radius: 8px;
  background: #faf8f2;
}

.admin-pool-calibration-summary {
  display: grid;
  gap: 4px;
  align-content: center;
  color: #3f3d39;
  font-size: 12px;
}

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

.admin-user-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
}

.admin-user-card strong {
  font-size: 14px;
}

.admin-user-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

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

.redeem-code-form {
  grid-template-columns: minmax(150px, 1fr) minmax(120px, 0.8fr) minmax(90px, 0.6fr) minmax(130px, 0.8fr) minmax(160px, 1fr) auto;
}

.redeem-code-search {
  margin-top: 10px;
  grid-template-columns: minmax(120px, 0.5fr) minmax(220px, 1fr) auto auto;
}

.redeem-code-summary {
  margin: 12px 0;
}

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

.redeem-code-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
}

.redeem-code-card.used {
  background: #f5f3ed;
}

.redeem-code-card strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
}

.redeem-code-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.admin-user-actions input {
  width: 118px;
  height: 34px;
}

.quota-money-hint {
  min-width: 74px;
  align-self: center;
  color: var(--muted);
  font-size: 12px;
}

.recharge-form .quota-money-hint {
  display: block;
  min-height: 16px;
  margin-top: 6px;
}

.mini-button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #efede7;
  color: #111;
  font-size: 12px;
}

.danger-mini {
  background: #f5e4df;
  color: var(--danger);
}

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

.history-card {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 16px;
  color: var(--ink);
  text-align: left;
}

.history-card strong {
  display: block;
  margin-bottom: 6px;
}

.history-card p {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 740px) {
  .login-shell {
    padding: 14px 14px 28px;
  }

  .landing-topbar {
    height: auto;
    align-items: flex-start;
  }

  .landing-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
  }

  .landing-link-button,
  .landing-login-button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }

  .landing-hero {
    padding: 7vh 0 8vh;
  }

  .landing-copy h1 {
    font-size: 44px;
  }

  .landing-copy p {
    font-size: 15px;
  }

  .landing-composer {
    grid-template-columns: minmax(0, 1fr) 44px;
    border-radius: 22px;
  }

  .landing-composer button {
    width: 44px;
    height: 44px;
  }

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

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: min(306px, calc(100vw - 42px));
    display: grid;
    transform: translateX(-105%);
    border-right: 1px solid var(--line);
    box-shadow: 18px 0 60px rgba(0, 0, 0, 0.18);
    transition: transform 180ms ease;
  }

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

  .sidebar-scrim {
    position: fixed;
    inset: 0 0 0 min(306px, calc(100vw - 42px));
    z-index: 55;
    display: block;
    opacity: 0;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.28);
    transition: opacity 180ms ease;
  }

  .app.sidebar-open .sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .chat-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 0 12px;
  }

  .top-left {
    min-width: 0;
    gap: 8px;
  }

  .mobile-sidebar-button {
    display: grid;
    flex: 0 0 36px;
  }

  .top-actions {
    gap: 6px;
  }

  .model-button {
    width: min(168px, calc(100vw - 198px));
  }

  .model-menu {
    width: min(310px, calc(100vw - 24px));
  }

  .top-skeleton i {
    width: 140px;
  }

  .chat-meta {
    display: none;
  }

  .messages {
    padding: 22px 14px 172px;
  }

  body.chatgpt-theme .messages {
    padding: 22px 14px 206px;
  }

  body.chatgpt-theme .message {
    max-width: 100%;
    margin-bottom: 22px;
  }

  body.chatgpt-theme .message.user .bubble {
    max-width: min(320px, 82vw);
  }

  .bubble {
    max-width: 84%;
  }

  .search-result-list {
    grid-template-columns: 1fr;
  }

  .page-content {
    width: calc(100% - 24px);
    padding: 22px 0;
  }

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

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

  .usage-summary-grid article {
    min-height: 96px;
    padding: 14px;
  }

  .usage-summary-grid strong {
    font-size: 20px;
  }

  .usage-chart-card {
    padding: 14px;
  }

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

  .usage-chart-actions {
    width: 100%;
    justify-content: space-between;
  }

  .usage-chart-frame {
    min-width: 620px;
  }

  .usage-month-bars {
    gap: 8px;
  }

  .api-key-toolbar {
    justify-content: stretch;
  }

  .api-key-toolbar .primary {
    width: 100%;
  }

  .api-key-table {
    overflow-x: auto;
  }

  .api-key-table-head,
  .api-key-table-row {
    min-width: 620px;
    grid-template-columns: minmax(90px, 0.9fr) minmax(100px, 1fr) 82px 190px;
    gap: 6px;
    padding: 10px;
    font-size: 12px;
  }

  .api-key-table-head {
    font-size: 11px;
  }

  .api-key-actions {
    gap: 8px;
  }

  .api-key-copy,
  .api-key-doc,
  .api-key-delete {
    font-size: 11px;
  }

  .config-help-list,
  .doc-layout,
  .doc-steps {
    grid-template-columns: 1fr;
  }

  .openclaw-key-form {
    display: grid;
  }

  .key-form {
    grid-template-columns: 1fr;
  }

  .key-form .primary {
    width: 100%;
  }

  .modal-layer {
    padding: 12px;
  }

  .modal-panel {
    padding: 18px;
  }

  .api-key-modal {
    padding: 14px;
  }

  .api-key-modal .modal-actions {
    flex-direction: row;
  }

  .api-key-modal .modal-actions .ghost-button,
  .api-key-modal .modal-actions .primary {
    width: auto;
  }

  .history-card {
    grid-template-columns: 1fr;
  }

  .admin-toolbar,
  .admin-create-user,
  .admin-model-row,
  .admin-user-card {
    grid-template-columns: 1fr;
  }

  .admin-plan-grid,
  .admin-plan-json-grid {
    grid-template-columns: 1fr;
  }
  .admin-pool-form,
  .admin-pool-grid,
  .admin-pool-calibration {
    grid-template-columns: 1fr;
  }
  .admin-pool-members-head {
    align-items: start;
    flex-direction: column;
  }
  .admin-pool-member-add {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .admin-pool-member-add select,
  .admin-pool-member-add .mini-button {
    width: 100%;
  }

  .admin-user-actions {
    justify-content: flex-start;
  }

  .composer {
    right: 10px;
    bottom: max(78px, calc(env(safe-area-inset-bottom) + 72px));
    left: 10px;
    width: auto;
    max-width: none;
  }

  body.chatgpt-theme .composer {
    right: 22px;
    left: 10px;
    max-width: calc(100% - 32px);
  }

  body.deepseek-theme .composer {
    right: 10px;
    left: 10px;
    max-width: none;
    padding: 12px;
  }
}
