:root {
  color-scheme: light;
  --bg: #f7f2e8;
  --surface: #fffdf9;
  --surface-2: #fff7ea;
  --line: #e8dccb;
  --text: #33291f;
  --muted: #81776b;
  --amber: #c9892b;
  --amber-2: #a66f1f;
  --teal: #118c80;
  --danger: #c95f46;
  --shadow: 0 18px 50px rgba(83, 61, 34, 0.12);
  font-family: Inter, "Segoe UI", "Microsoft YaHei UI", system-ui, sans-serif;
}

.api-doc-panel {
  margin-top: 14px;
}

.docs-list {
  display: grid;
  gap: 12px;
}

.docs-list article {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.docs-list b {
  font-size: 14px;
}

.admin-row strong.positive,
.admin-ledger-row strong.positive {
  color: var(--teal);
}

.admin-row strong.negative,
.admin-ledger-row strong.negative {
  color: var(--danger);
}

.key-row {
  align-items: center;
}

.admin-user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 240px);
  gap: 10px;
  align-items: start;
  min-height: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-user-list,
.admin-ledger-list,
.admin-list {
  align-content: start;
}

.admin-user-row > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-points {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
}

.admin-points input,
.admin-points button {
  min-height: 30px;
}

.admin-card-row {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.asset-card-copy span,
.asset-upload-status,
.task-result span {
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .admin-user-row,
  .admin-points {
    grid-template-columns: 1fr;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d0e;
  --surface: #151719;
  --surface-2: #1b1e20;
  --line: #303438;
  --text: #f1f3f4;
  --muted: #929ba0;
  --amber: #d4aa65;
  --amber-2: #e2b96f;
  --teal: #4bc9bf;
  --danger: #ff8d79;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

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

html {
  scrollbar-gutter: stable;
}

body.modal-scroll-locked {
  position: fixed;
  right: 0;
  left: 0;
  overflow: hidden;
}

.session-boot {
  display: none;
}

html.session-pending body {
  overflow: hidden;
  background: #0b0d0e;
}

html.session-pending .shell {
  visibility: hidden;
}

html.session-pending .session-boot {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  background: #0b0d0e;
}

.session-boot img {
  width: 56px;
  height: 56px;
  border: 1px solid #303438;
  border-radius: 8px;
}

.session-boot > span {
  position: relative;
  display: block;
  width: 88px;
  height: 2px;
  overflow: hidden;
  background: #25292c;
}

.session-boot i {
  position: absolute;
  inset: 0;
  width: 42%;
  background: #4bc9bf;
  animation: session-boot-slide 900ms ease-in-out infinite alternate;
}

@keyframes session-boot-slide {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(138%);
  }
}

.shell {
  width: min(1540px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  margin: 0 auto;
  padding: 12px 0 20px;
  overflow-x: clip;
}

.hidden {
  display: none !important;
}

.topbar,
.panel,
.modal-card {
  border: 1px solid rgba(226, 210, 184, 0.9);
  border-radius: 9px;
  background: rgba(255, 253, 249, 0.92);
  box-shadow: var(--shadow);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(0, 2.2fr);
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 10px 14px;
  backdrop-filter: blur(18px);
}

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

.brand > div {
  min-width: 0;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border: 1px solid rgba(201, 137, 43, 0.28);
  border-radius: 9px;
  background: #090b12;
}

.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
}

.brand p,
.intro p,
.asset-box p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.brand p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  white-space: nowrap;
  scrollbar-width: none;
}

.top-actions > * {
  flex: 0 0 auto;
}

.top-actions::-webkit-scrollbar {
  display: none;
}

.announcement-strip {
  display: grid;
  gap: 1px;
  width: 100%;
  min-width: 0;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.announcement-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 10px;
  align-items: start;
  min-width: 0;
  padding: 10px 10px 10px 12px;
  border-left: 4px solid var(--teal);
  background: #f1faf7;
}

.announcement-item.announcement-important {
  border-left-color: #c95f46;
  background: #fff3ef;
}

.announcement-item.announcement-maintenance {
  border-left-color: #c9892b;
  background: #fff7e8;
}

.announcement-copy {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 9px;
  min-width: 0;
}

.announcement-copy strong,
.announcement-copy p {
  min-width: 0;
  overflow-wrap: anywhere;
}

.announcement-copy strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.announcement-copy p {
  grid-column: 1 / -1;
  color: #665b4e;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.announcement-level {
  align-self: start;
  min-height: 20px;
  padding: 2px 6px;
  border: 1px solid rgba(17, 140, 128, 0.23);
  border-radius: 5px;
  color: #0f766d;
  font-size: 10px;
  font-weight: 700;
  line-height: 14px;
  white-space: nowrap;
}

.announcement-important .announcement-level {
  border-color: rgba(201, 95, 70, 0.28);
  color: #a94431;
}

.announcement-maintenance .announcement-level {
  border-color: rgba(201, 137, 43, 0.3);
  color: #95621c;
}

.announcement-dismiss {
  display: grid;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  box-shadow: none;
}

.announcement-dismiss:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
}

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

.topup-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex: 0 0 auto;
}

.pill,
.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(201, 137, 43, 0.24);
  border-radius: 8px;
  background: #fffaf1;
  color: var(--amber-2);
  font-size: 12px;
}

.pill::before,
.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.green {
  border-color: rgba(17, 140, 128, 0.18);
  color: var(--teal);
}

.points-button {
  min-height: 30px;
  padding: 0 10px;
  border-color: rgba(201, 137, 43, 0.24);
  background: #fffaf1;
  color: var(--amber-2);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  box-shadow: none;
}

.language-toggle {
  min-width: 78px;
  font-weight: 700;
}

.theme-toggle {
  flex: 0 0 36px;
  width: 36px;
  min-width: 36px;
  padding: 0;
}

.theme-toggle-icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}

html.theme-switching body,
html.theme-switching .topbar,
html.theme-switching .panel,
html.theme-switching .modal-card,
html.theme-switching .auth-card,
html.theme-switching input,
html.theme-switching textarea,
html.theme-switching select,
html.theme-switching .prompt-editor,
html.theme-switching .asset-panel,
html.theme-switching .drop-zone,
html.theme-switching .task-card,
html.theme-switching .admin-row {
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.auth-layout {
  position: relative;
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 88px 20px 30px;
  overflow: auto;
  background: #0b0d0e;
  isolation: isolate;
}

.auth-layout::before {
  position: absolute;
  top: 50%;
  left: max(28px, calc(50% - 710px));
  width: min(40vw, 520px);
  aspect-ratio: 1;
  background: url("assets/jinghong-logo.png") center / contain no-repeat;
  content: "";
  opacity: 0.08;
  pointer-events: none;
  transform: translateY(-46%);
}

body.auth-mode {
  color-scheme: dark;
  background: #0b0d0e;
}

.auth-mode .shell {
  width: 100%;
  min-height: 100svh;
  padding: 0;
}

.auth-mode .topbar {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 30;
  width: 100%;
  min-height: 72px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.auth-mode .brand h1 {
  color: #f5f6f7;
}

.auth-mode .brand p {
  color: #8f989d;
}

.auth-mode #pointsPill,
.auth-mode #upstreamPill {
  display: none;
}

.auth-mode .topbar .link-button,
.auth-mode .topbar button.secondary {
  min-height: 34px;
  border-color: #303438;
  background: #17191b;
  color: #c5cbce;
  box-shadow: none;
}

.auth-mode .topbar .link-button:hover,
.auth-mode .topbar button.secondary:hover {
  border-color: #4b5358;
  color: #fff;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(424px, calc(100vw - 32px));
  padding: 28px 32px 24px;
  border: 1px solid #303438;
  border-radius: 8px;
  background: #151719;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.48);
  color: #f5f6f7;
}

.auth-brand-lockup {
  display: flex;
  align-items: center;
  gap: 11px;
}

.auth-brand-lockup > div {
  display: grid;
  gap: 2px;
}

.auth-brand-lockup strong {
  font-size: 16px;
}

.auth-brand-lockup > div > span {
  color: #8f989d;
  font-size: 11px;
}

.auth-logo {
  display: block;
  width: 46px;
  height: 46px;
  overflow: hidden;
  border: 1px solid #383c41;
  border-radius: 8px;
  background: #050607;
}

.auth-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-heading {
  margin: 24px 0 22px;
}

.auth-heading h2 {
  color: #f7f8f9;
  font-size: 24px;
  line-height: 1.25;
}

.auth-heading p {
  margin-top: 7px;
  color: #98a0a5;
  font-size: 13px;
}

.auth-fields {
  display: grid;
  gap: 15px;
}

.auth-field {
  display: grid;
  gap: 7px;
  margin: 0;
  color: #c4c9cc;
  font-size: 12px;
}

.auth-field input {
  height: 46px;
  padding: 0 12px;
  border-color: #34383c;
  border-radius: 8px;
  background: #0c0e0f;
  color: #f5f6f7;
  font-size: 14px;
}

.auth-field input::placeholder {
  color: #666f74;
}

.auth-field input:focus {
  border-color: #4bc9bf;
  background: #0c0e0f;
  box-shadow: 0 0 0 3px rgba(75, 201, 191, 0.13);
}

.auth-field input:-webkit-autofill {
  box-shadow: 0 0 0 1000px #0c0e0f inset;
  -webkit-text-fill-color: #f5f6f7;
}

.auth-password-wrap {
  position: relative;
  display: block;
}

.auth-password-wrap input {
  padding-right: 112px;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  min-height: 34px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: #7ecfc8;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: none;
  transform: translateY(-50%);
}

.auth-password-toggle:hover {
  color: #b2eee9;
}

.auth-primary {
  width: 100%;
  min-height: 46px;
  margin-top: 22px;
  border: 0;
  border-radius: 8px;
  background: #f4f6f6;
  color: #111315;
  font-size: 14px;
  box-shadow: none;
}

.auth-primary:hover {
  background: #dff5f2;
}

.auth-register-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 38px;
  color: #8f989d;
  font-size: 12px;
}

.auth-register-button {
  min-height: 30px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: #72d5cd;
  font-size: 12px;
  font-weight: 700;
  box-shadow: none;
}

.auth-register-button:hover {
  color: #b2eee9;
}

.auth-toast {
  min-height: 20px;
  margin: 0;
  color: #ff9d8c;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.auth-divider {
  height: 1px;
  margin: 16px 0 7px;
  background: #2c3033;
}

.auth-rates {
  display: grid;
}

.auth-rate {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #8f989d;
  font-size: 11px;
}

.auth-rate + .auth-rate {
  border-top: 1px solid #25282b;
}

.auth-rate b {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  color: #d4aa65;
  font-size: 11px;
  white-space: nowrap;
}

.auth-rate b small {
  color: #c8863b;
  font-size: 9px;
  font-weight: 600;
}

.auth-support {
  margin-top: 12px;
  color: #747d82;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  overflow-wrap: anywhere;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(620px, 1.35fr) minmax(420px, 0.85fr);
  gap: 14px;
  align-items: start;
  margin-top: 12px;
  min-width: 0;
}

.workspace > * {
  min-width: 0;
}

.tasks {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 102px);
  max-height: calc(100dvh - 102px);
}

.points-view {
  margin-top: 12px;
}

.panel {
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 247, 234, 0.58);
}

.panel-head h2 {
  font-size: 15px;
}

.panel-body {
  padding: 13px;
}

.intro .panel-body {
  display: grid;
  gap: 12px;
}

.model-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 54px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 246, 228, 0.72), rgba(239, 252, 248, 0.48));
}

label {
  display: block;
  margin: 9px 0 5px;
  color: #665b4e;
  font-size: 12px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #e8dccb;
  border-radius: 8px;
  background: #fffefa;
  color: var(--text);
  outline: 0;
  font: inherit;
  font-size: 13px;
}

input,
select {
  height: 36px;
  padding: 0 10px;
}

textarea {
  min-height: 156px;
  resize: vertical;
  padding: 10px;
  line-height: 1.48;
}

.small-textarea {
  min-height: 82px;
  margin-top: 10px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(201, 137, 43, 0.52);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(201, 137, 43, 0.12);
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid #d79a42;
  border-radius: 8px;
  background: linear-gradient(180deg, #dfa650, #bd7a24);
  color: #fffaf0;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 760;
  box-shadow: 0 10px 22px rgba(201, 137, 43, 0.2);
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid #e5d8c5;
  border-radius: 8px;
  background: #fffaf1;
  color: #5f5345;
  text-decoration: none;
  font-size: 13px;
}

button.secondary {
  border-color: #e5d8c5;
  background: #fffaf1;
  color: #5f5345;
  font-weight: 500;
  box-shadow: none;
}

button.danger {
  border-color: rgba(201, 95, 70, 0.26);
  background: #fff1ed;
  color: #b44d36;
  box-shadow: none;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.asset-box,
.notice {
  margin-top: 12px;
  padding: 10px;
  border: 1px dashed rgba(201, 137, 43, 0.35);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 244, 221, 0.74), rgba(239, 252, 248, 0.56));
}

.notice {
  border-style: solid;
  color: #7a5a2c;
  font-size: 12px;
  line-height: 1.55;
}

.prompt-wrap {
  position: relative;
}

.prompt-editor {
  height: clamp(220px, 34vh, 380px);
  min-height: 220px;
  max-height: 380px;
  width: 100%;
  padding: 10px;
  border: 1px solid #e8dccb;
  border-radius: 8px;
  background: #fffefa;
  color: var(--text);
  outline: 0;
  font: inherit;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  overflow-anchor: none;
}

.prompt-editor:empty::before {
  content: attr(data-placeholder);
  opacity: 0.42;
  pointer-events: none;
}

.prompt-editor img,
.prompt-editor video,
.prompt-editor table,
.prompt-editor svg,
.prompt-editor canvas,
.prompt-editor iframe,
.prompt-editor object,
.prompt-editor embed {
  max-inline-size: 100%;
}

.prompt-editor::-webkit-scrollbar {
  width: 9px;
}

.prompt-editor::-webkit-scrollbar-track {
  background: rgba(255, 247, 232, 0.72);
  border-radius: 999px;
}

.prompt-editor::-webkit-scrollbar-thumb {
  border: 2px solid rgba(255, 247, 232, 0.72);
  border-radius: 999px;
  background: rgba(201, 137, 43, 0.5);
}

.prompt-editor::-webkit-scrollbar-thumb:hover {
  background: rgba(167, 102, 24, 0.62);
}

.prompt-editor:focus {
  border-color: rgba(201, 137, 43, 0.52);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(201, 137, 43, 0.12);
}

.ref-token {
  display: inline-block;
  max-width: min(320px, calc(100% - 18px));
  margin: 0 4px;
  padding: 1px 8px 2px;
  border: 1px solid rgba(17, 140, 128, 0.48);
  border-radius: 999px;
  background: linear-gradient(180deg, #eefcf8, #fff8e9);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.96),
    0 0 0 3px rgba(17, 140, 128, 0.14),
    0 0 0 5px rgba(201, 137, 43, 0.11),
    inset 0 0 0 1px rgba(255, 255, 255, 0.74);
  color: #0f766d;
  font-weight: 800;
  line-height: 1.38;
  vertical-align: text-bottom;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: normal;
  white-space: nowrap;
}

.ref-token-image {
  border-color: rgba(17, 140, 128, 0.56);
  color: #0f766d;
}

.ref-token-audio {
  border-color: rgba(104, 95, 212, 0.5);
  background: linear-gradient(180deg, #f3f0ff, #fff8e9);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.96),
    0 0 0 3px rgba(104, 95, 212, 0.13),
    0 0 0 5px rgba(201, 137, 43, 0.1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.74);
  color: #5148b8;
}

.ref-token-video {
  border-color: rgba(201, 137, 43, 0.58);
  background: linear-gradient(180deg, #fff8e9, #eefcf8);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.96),
    0 0 0 3px rgba(201, 137, 43, 0.16),
    0 0 0 5px rgba(17, 140, 128, 0.1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.74);
  color: #9b6518;
}

.mention-menu {
  position: fixed;
  z-index: 90;
  display: grid;
  gap: 3px;
  width: min(270px, calc(100vw - 24px));
  max-height: min(220px, calc(100vh - 24px));
  padding: 5px;
  border: 1px solid #d9be93;
  border-radius: 8px;
  background: #fffdf9;
  box-shadow: 0 12px 30px rgba(101, 75, 38, 0.15);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.mention-menu::-webkit-scrollbar {
  width: 6px;
}

.mention-menu::-webkit-scrollbar-thumb {
  border: 1px solid #fffdf9;
  border-radius: 999px;
  background: rgba(201, 137, 43, 0.42);
}

.mention-option {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  width: 100%;
  align-items: center;
  justify-content: start;
  gap: 7px;
  min-height: 34px;
  padding: 3px 7px;
  border-color: transparent;
  border-radius: 6px;
  background: transparent;
  color: #5f5345;
  box-shadow: none;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.mention-option.active,
.mention-option:hover {
  border-color: rgba(17, 140, 128, 0.22);
  background: linear-gradient(90deg, rgba(17, 140, 128, 0.1), rgba(201, 137, 43, 0.08));
  color: #0f766d;
  transform: translateX(1px);
}

.mention-option img,
.mention-option video,
.mention-glyph {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: #fff7e8;
}

.mention-option img,
.mention-option video {
  object-fit: cover;
}

.mention-glyph {
  display: grid;
  place-items: center;
  border: 1px solid rgba(17, 140, 128, 0.22);
  color: #0f766d;
  font-size: 12px;
  font-weight: 800;
}

.mention-option span {
  display: grid;
  gap: 1px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mention-option span small {
  overflow: hidden;
  color: #8a8074;
  font-size: 9px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mention-option.pending:disabled {
  border-color: transparent;
  background: transparent;
  color: #756b60;
  cursor: default;
  opacity: 0.68;
  transform: none;
}

.asset-panel {
  margin-top: 12px;
  padding: 10px;
  border: 1px dashed rgba(201, 137, 43, 0.35);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 244, 221, 0.74), rgba(239, 252, 248, 0.56));
}

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

.asset-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

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

.drop-zone {
  position: relative;
  min-height: 164px;
  padding: 11px;
  border: 1px dashed rgba(201, 137, 43, 0.42);
  border-radius: 8px;
  background: rgba(255, 250, 243, 0.78);
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s, box-shadow 0.16s;
}

.drop-zone.drag,
.drop-zone:hover {
  border-color: rgba(17, 140, 128, 0.5);
  background: #effbf8;
  box-shadow: 0 0 0 3px rgba(17, 140, 128, 0.08);
}

.drop-zone.model-over-limit,
.drop-zone.model-over-limit:hover {
  border-color: rgba(190, 65, 55, 0.72);
  background: #fff4f1;
  box-shadow: 0 0 0 3px rgba(190, 65, 55, 0.1);
}

.drop-zone.model-over-limit > span {
  color: #a43e36;
  font-weight: 700;
}

.drop-zone.upload-disabled:not(.model-over-limit),
.drop-zone.upload-disabled:not(.model-over-limit):hover {
  border-color: rgba(129, 119, 107, 0.3);
  background: rgba(245, 241, 234, 0.72);
  cursor: not-allowed;
  box-shadow: none;
}

.drop-zone.upload-disabled:not(.model-over-limit) > b,
.drop-zone.upload-disabled:not(.model-over-limit) > span {
  color: #8f867b;
}

.drop-zone input[type="file"] {
  display: none;
}

.drop-zone b {
  display: block;
  color: #3c3328;
  font-size: 13px;
}

.drop-zone > span {
  display: block;
  margin-top: 3px;
  color: #81776b;
  font-size: 11px;
}

.asset-list {
  display: grid;
  gap: 7px;
  margin-top: 9px;
  max-height: 420px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.retry-draft-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid rgba(17, 140, 128, 0.28);
  border-radius: 8px;
  background: #eef8f6;
  color: #285f59;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.retry-draft-notice > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.retry-draft-close {
  flex: 0 0 28px;
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0 !important;
  border-radius: 6px;
  font-size: 17px !important;
  line-height: 1;
}

.asset-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 52px;
  max-height: 82px;
  padding: 6px;
  border: 1px solid #eadfce;
  border-radius: 8px;
  background: #fffdf9;
  overflow: hidden;
  animation: asset-card-in 160ms ease-out;
  transition: opacity 160ms ease, transform 160ms ease, max-height 160ms ease, min-height 160ms ease, padding 160ms ease, border-width 160ms ease;
}

.asset-card.asset-retry-selected {
  border-color: rgba(17, 140, 128, 0.48);
  background: #f0faf7;
  box-shadow: inset 3px 0 #118c80;
}

.asset-card.asset-retry-excluded {
  border-style: dashed;
  border-color: #d4cbbb;
  background: #f5f2ed;
  opacity: 0.62;
}

.asset-retry-state {
  color: #0f766d;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}

.asset-retry-excluded .asset-retry-state {
  color: #756d62;
}

.asset-card img,
.asset-card video,
.asset-glyph {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  background: #fff7e8;
}

.asset-card img,
.asset-card video {
  object-fit: cover;
}

.asset-card video {
  display: block;
}

.asset-glyph {
  display: grid;
  place-items: center;
  border: 1px solid rgba(17, 140, 128, 0.2);
  color: #0f766d;
  font-size: 13px;
  font-weight: 800;
}

.asset-card-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.asset-card-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #5f5345;
  font-size: 12px;
}

.asset-upload-status {
  overflow: hidden;
  color: #81776b;
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-upload-progress {
  display: block;
  width: 100%;
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: #eadfce;
}

.asset-upload-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #118c80;
  transition: width 100ms linear;
}

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

.asset-remove-button {
  width: 26px;
  min-width: 26px;
  padding: 0 !important;
  font-size: 16px !important;
  line-height: 1;
}

.asset-failed {
  border-color: rgba(201, 95, 70, 0.38);
  background: #fff7f4;
}

.asset-failed .asset-upload-status {
  color: #b44d36;
}

.asset-card.asset-removing {
  min-height: 0;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  opacity: 0;
  transform: translateY(-4px) scale(0.985);
}

@keyframes asset-card-in {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.small {
  min-height: 26px !important;
  padding: 0 8px !important;
  font-size: 11px !important;
}

.param-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(112px, 1fr));
  gap: 8px;
  align-items: end;
}

.toast {
  min-height: 18px;
  margin-top: 9px;
  color: var(--teal);
  font-size: 13px;
  white-space: pre-wrap;
}

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

.tasks > .task-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  overflow-anchor: none;
}

.tasks > .task-list::-webkit-scrollbar {
  width: 9px;
}

.tasks > .task-list::-webkit-scrollbar-track {
  background: rgba(255, 247, 232, 0.72);
  border-radius: 999px;
}

.tasks > .task-list::-webkit-scrollbar-thumb {
  border: 2px solid rgba(255, 247, 232, 0.72);
  border-radius: 999px;
  background: rgba(201, 137, 43, 0.5);
}

.tasks > .task-list::-webkit-scrollbar-thumb:hover {
  background: rgba(167, 102, 24, 0.62);
}

.cache-notice {
  margin: 12px 13px 0;
  padding: 9px 10px;
  border: 1px solid rgba(201, 137, 43, 0.26);
  border-radius: 8px;
  background: #fff7e8;
  color: #8b5b1e;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.task-card,
.key-card {
  padding: 10px;
  border: 1px solid #eadfce;
  border-radius: 8px;
  background: #fffaf3;
}

.task-card {
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.task-card.task-card-downloaded {
  border-color: #9bcfc5;
  background: #edf8f5;
  box-shadow: inset 3px 0 #2f9488;
}

.task-card-compact {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 10px;
  padding: 9px;
}

.task-video-card {
  display: grid;
  gap: 6px;
}

.task-video-card video {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(139, 91, 30, 0.16);
  border-radius: 7px;
  background: #17130f;
  object-fit: contain;
}

.task-video-empty {
  min-height: 86px;
  place-items: center;
  padding: 8px;
  border: 1px dashed rgba(139, 91, 30, 0.24);
  border-radius: 7px;
  background: #fff7e8;
  color: var(--muted);
  text-align: center;
}

.task-video-empty span {
  color: #8b5b1e;
  font-size: 13px;
  font-weight: 800;
}

.task-video-empty small {
  font-size: 11px;
}

.video-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.task-info-col {
  min-width: 0;
}

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

.task-title,
.task-state-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.task-state-actions {
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.task-unread-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border: 2px solid #fffaf3;
  border-radius: 50%;
  background: #dc5f3f;
  box-shadow: 0 0 0 1px rgba(174, 65, 40, 0.26);
}

.task-cancel {
  min-width: 76px;
  white-space: nowrap;
}

.task-retry {
  min-width: 58px;
  white-space: nowrap;
}

.task-id {
  color: #8b5b1e;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
}

.task-card-compact .task-id {
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  word-break: normal;
}

.task-meta {
  margin-top: 7px;
  color: #81776b;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.compact-meta {
  margin-top: 5px;
}

.task-prompt {
  max-height: 88px;
  margin-top: 6px;
  padding: 7px;
  border: 1px solid rgba(234, 223, 206, 0.72);
  border-radius: 7px;
  background: #fffefa;
  color: #4f463b;
  font-size: 11px;
  line-height: 1.45;
  overflow: auto;
  overflow-x: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow-anchor: none;
}

.asset-preflight-state {
  display: block;
  color: var(--teal);
  font-size: 11px;
}

.refs-line {
  max-height: 32px;
  overflow: hidden;
}

.task-result {
  margin-top: 7px;
  padding: 7px;
  border-radius: 7px;
  background: #fff7e8;
  color: #7a5a2c;
  font-size: 12px;
}

.task-result b {
  display: block;
  color: #3c3328;
}

.task-result.completed {
  background: #eefaf7;
  color: #0f766d;
}

.task-result.failed {
  background: #fff1ed;
  color: #b44d36;
}

.task-warning {
  color: #a05a00;
  font-weight: 700;
}

.task-failure {
  display: grid;
  gap: 2px;
  color: #7a4032;
  line-height: 1.45;
}

.task-failure-title {
  color: #a94431;
  font-size: 12px;
}

.task-failure-detail {
  color: #765b51;
  font-weight: 500;
}

.admin-failure-diagnostics {
  margin-top: 7px;
  color: #81776b;
  font-size: 11px;
}

.admin-failure-diagnostics summary {
  width: fit-content;
  color: #8b5b1e;
  cursor: pointer;
  font-weight: 700;
}

.admin-failure-diagnostics span {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.admin-failure-diagnostics code {
  font-size: 11px;
}

.task-refund {
  color: #0f766d;
  font-weight: 800;
}

.points-summary {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 246, 228, 0.72), rgba(239, 252, 248, 0.48));
}

.points-summary span,
.points-summary p,
.ledger-meta,
.ledger-row small,
.ledger-row time {
  color: var(--muted);
  font-size: 12px;
}

.points-summary b {
  display: block;
  margin-top: 3px;
  color: var(--teal);
  font-size: 26px;
}

.ledger-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

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

.ledger-row b {
  color: #3c3328;
  font-size: 13px;
}

.ledger-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.ledger-row small {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.ledger-row strong {
  font-size: 15px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.ledger-row .positive {
  color: var(--teal);
}

.ledger-row .negative {
  color: var(--danger);
}

.ledger-empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.progress {
  height: 8px;
  margin-top: 9px;
  border-radius: 999px;
  background: #efe4d4;
  overflow: hidden;
}

.bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--amber), var(--teal));
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(47, 37, 25, 0.32);
  backdrop-filter: blur(14px);
}

.modal-card {
  width: min(980px, calc(100vw - 28px));
  max-height: min(86vh, 820px);
  overflow: hidden;
}

.preflight-modal-card {
  width: min(680px, calc(100vw - 28px));
}

.preflight-body {
  display: grid;
  gap: 12px;
}

.preflight-summary,
.preflight-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.preflight-warning-list {
  display: grid;
  gap: 8px;
  max-height: min(42vh, 320px);
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
}

.preflight-warning-list li {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(201, 95, 70, 0.22);
  border-radius: 8px;
  background: rgba(255, 241, 237, 0.82);
  color: #7f3f2e;
  font-size: 12px;
  line-height: 1.45;
}

.preflight-warning-list b {
  color: #b44d36;
}

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

.video-modal-card {
  width: min(980px, calc(100vw - 28px));
  min-width: min(420px, calc(100vw - 28px));
  min-height: 320px;
  resize: both;
  overflow: auto;
}

.video-modal-body {
  padding: 12px;
  background: #11100e;
  overflow: auto;
}

.video-modal-body video {
  display: block;
  width: 100%;
  max-height: min(72vh, 720px);
  border-radius: 8px;
  background: #000;
}

.video-playback-status {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 2px 0;
  color: #d7cec2;
  font-size: 12px;
  line-height: 1.45;
}

.video-playback-status.loading {
  color: #e5c27e;
}

.video-playback-status.failed {
  color: #ffad9c;
}

.api-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(340px, 1.1fr);
  gap: 16px;
  overflow: auto;
  max-height: calc(86vh - 48px);
}

.api-key-intro {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.api-base-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 12px;
}

.api-base-row code {
  flex: 1 1 190px;
  color: var(--teal);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
}

.api-base-row .link-button {
  min-height: 32px;
}

.secret-box,
pre {
  margin-top: 12px;
  padding: 11px;
  border: 1px solid rgba(17, 140, 128, 0.22);
  border-radius: 8px;
  background: #eefaf7;
  color: #0f766d;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

pre {
  border-color: #e7dac8;
  background: #fff7e8;
  color: #5e5448;
}

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

.admin-view {
  display: grid;
  gap: 14px;
  margin-top: 12px;
  min-width: 0;
}

.admin-management-band {
  min-width: 0;
  margin-inline: -13px;
  padding: 18px 13px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fbf7ef;
}

.admin-management-band + .admin-management-band {
  border-top: 0;
}

.admin-management-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin-bottom: 12px;
}

.admin-management-head > div {
  min-width: 0;
}

.admin-management-head h3 {
  color: #3c3328;
  font-size: 14px;
}

.admin-management-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.admin-model-list,
.admin-announcement-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.admin-model-list {
  max-height: min(680px, 66vh);
  padding-right: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

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

.admin-model-group + .admin-model-group {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e5d8c6;
}

.admin-model-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 4px;
}

.admin-model-group-head div {
  display: grid;
  gap: 2px;
}

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

.admin-model-group-head span {
  color: var(--muted);
  font-size: 11px;
}

.admin-model-group-head b {
  min-width: 28px;
  color: #8b5b1e;
  text-align: right;
}

.admin-model-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.65fr) minmax(0, 2.35fr);
  grid-template-areas:
    "identity technical"
    "controls controls";
  gap: 12px 16px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e5d8c6;
  border-radius: 8px;
  background: #fffdf9;
}

.admin-model-row.pending,
.admin-announcement-row.pending {
  border-color: rgba(17, 140, 128, 0.46);
}

.admin-model-row.pending .admin-model-controls,
.admin-announcement-row.pending > :not(.admin-announcement-heading) {
  opacity: 0.62;
}

.admin-model-identity {
  grid-area: identity;
  min-width: 0;
}

.admin-model-identity > strong {
  display: block;
  min-width: 0;
  color: #33291f;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.admin-model-flags,
.admin-announcement-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
  margin-top: 6px;
}

.admin-state {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid rgba(17, 140, 128, 0.24);
  border-radius: 6px;
  background: #eef9f6;
  color: #0f766d;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
}

.admin-state.warning,
.admin-state.announcement-maintenance {
  border-color: rgba(201, 137, 43, 0.28);
  background: #fff5df;
  color: #95621c;
}

.admin-state.announcement-important {
  border-color: rgba(201, 95, 70, 0.28);
  background: #fff0ec;
  color: #a94431;
}

.admin-state.muted {
  border-color: #dfd6ca;
  background: #f5f1ea;
  color: #81776b;
}

.admin-model-technical {
  grid-area: technical;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 0.75fr)) minmax(0, 2fr);
  gap: 8px;
  min-width: 0;
  margin: 0;
}

.admin-model-detail {
  min-width: 0;
}

.admin-model-detail dt {
  color: #938572;
  font-size: 10px;
  font-weight: 700;
}

.admin-model-detail dd {
  min-width: 0;
  margin: 4px 0 0;
  color: #51473b;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.admin-model-capability-detail {
  min-width: 270px;
}

.admin-model-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
}

.admin-model-capabilities label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  color: #766a5c;
  font-family: Inter, "Segoe UI", "Microsoft YaHei UI", system-ui, sans-serif;
  font-size: 10px;
  font-weight: 700;
}

.admin-model-capabilities input {
  width: 48px;
  min-width: 0;
  height: 30px;
  padding: 0 5px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  text-align: center;
}

.admin-model-controls {
  grid-area: controls;
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) minmax(220px, 1.15fr) minmax(110px, 0.45fr) minmax(150px, 0.55fr);
  gap: 9px;
  align-items: end;
  min-width: 0;
  padding-top: 10px;
  border-top: 1px solid #eee4d6;
}

.admin-model-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  margin: 0;
}

.admin-model-field > span {
  color: #766a5c;
  font-size: 10px;
  font-weight: 700;
}

.admin-model-field input,
.admin-model-field select {
  min-width: 0;
  font-variant-numeric: tabular-nums;
}

.admin-model-visible,
.admin-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 36px;
  margin: 0;
}

.admin-model-visible input,
.admin-check-row input {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--teal);
}

.admin-model-visible span,
.admin-check-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-model-save {
  min-width: 112px;
  min-height: 36px;
  white-space: nowrap;
}

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

.admin-model-delete {
  min-width: 104px;
  min-height: 36px;
  border-color: rgba(201, 95, 70, 0.26);
  background: #fff1ed;
  color: #b44d36;
  box-shadow: none;
  white-space: nowrap;
}

.admin-management-empty {
  padding: 16px 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.admin-announcement-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  gap: 16px;
  min-width: 0;
}

.announcement-editor {
  display: grid;
  align-content: start;
  min-width: 0;
  padding-right: 16px;
  border-right: 1px solid var(--line);
}

.announcement-editor label {
  min-width: 0;
}

.announcement-editor textarea {
  min-height: 116px;
  max-height: 280px;
}

.announcement-body-field {
  min-width: 0;
}

.admin-announcement-list {
  align-content: start;
  max-height: min(540px, 62vh);
  padding-right: 3px;
  overflow-y: auto;
}

.admin-announcement-row {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 11px;
  border: 1px solid #e5d8c6;
  border-radius: 8px;
  background: #fffdf9;
}

.admin-announcement-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.admin-announcement-heading > strong {
  min-width: 0;
  color: #33291f;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.admin-announcement-badges {
  flex: 0 0 auto;
  justify-content: flex-end;
  margin-top: 0;
}

.admin-announcement-body {
  color: #665b4e;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.admin-announcement-row time {
  color: #938572;
  font-size: 10px;
}

.admin-announcement-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.admin-management-band > .toast,
.announcement-editor > .toast {
  min-height: 18px;
  margin-top: 7px;
}

.task-model-label {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.compact-modal-card {
  width: min(460px, calc(100vw - 28px));
  min-width: 0;
}

.confirm-dialog-body {
  display: grid;
  gap: 18px;
}

.confirm-dialog-body > p {
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

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

.admin-media-block {
  margin-top: 10px;
}

.admin-media-block b {
  display: block;
  margin-bottom: 6px;
  color: #3c3328;
  font-size: 12px;
}

.admin-media-grid,
.admin-media-list {
  display: grid;
  gap: 8px;
}

.admin-media-grid {
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
}

.media-thumb {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  color: #5f5345;
  text-decoration: none;
  font-size: 12px;
}

.media-thumb.compact {
  padding: 7px;
}

.media-thumb img,
.media-thumb video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: #15120f;
  object-fit: cover;
}

.media-thumb audio {
  width: 100%;
  height: 32px;
}

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

.media-glyph {
  display: grid;
  place-items: center;
  height: 48px;
  border: 1px dashed rgba(17, 140, 128, 0.24);
  border-radius: 6px;
  background: #eefaf7;
  color: var(--teal);
  font-weight: 800;
}

.admin-asset-row {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf3;
}

.admin-asset-row > div:last-child {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.admin-asset-row b {
  color: #3c3328;
  font-size: 13px;
}

.admin-asset-row span,
.admin-asset-row small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.stat-card {
  padding: 12px;
  border: 1px solid #eadfce;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 246, 228, 0.72), rgba(239, 252, 248, 0.48));
}

.stat-card b {
  display: block;
  color: #2d261d;
  font-size: 22px;
}

.stat-card span {
  color: #81776b;
  font-size: 12px;
}

.admin-ledger-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.18fr);
  gap: 14px;
}

.admin-ledger-column {
  min-width: 0;
}

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

.admin-ledger-head h3 {
  margin: 0;
}

.admin-ledger-head .task-meta {
  margin-top: 3px;
}

.admin-search {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
}

.admin-search .task-meta {
  margin-top: 0;
  white-space: nowrap;
}

.admin-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  max-height: min(360px, 42vh);
  padding-right: 4px;
  overflow-y: auto;
}

.admin-user-list,
.admin-ledger-list {
  height: min(520px, 58vh);
  max-height: none;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.admin-user-row {
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.admin-user-row:hover,
.admin-user-row:focus-visible {
  border-color: rgba(17, 140, 128, 0.42);
  outline: none;
}

.admin-user-row.selected {
  border-color: rgba(17, 140, 128, 0.56);
  background: #eef9f6;
  box-shadow: inset 3px 0 0 var(--teal);
}

.admin-ledger-list {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.72);
}

.admin-ledger-row {
  margin: 0;
}

.admin-ledger-more {
  display: block;
  min-width: 120px;
  min-height: 34px;
  margin: 10px auto 0;
}

#adminTasks {
  max-height: min(760px, 70vh);
  overflow-y: auto;
  resize: vertical;
}

.admin-row {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #eadfce;
  border-radius: 8px;
  background: #fffaf3;
}

.admin-row b {
  color: #3c3328;
  font-size: 13px;
}

.admin-row span,
.admin-row small {
  color: #81776b;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.admin-audit-row {
  grid-template-columns: minmax(150px, 1.15fr) minmax(180px, 1.35fr) minmax(86px, auto);
  align-items: start;
}

.audit-field {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.audit-label {
  color: #9b8b77;
  font-size: 11px;
}

.audit-time {
  text-align: right;
}

.audit-time b {
  color: #8b5b1e;
  font-size: 14px;
}

.admin-points {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 7px;
  margin-top: 6px;
  align-items: center;
}

.admin-points input {
  height: 32px;
  font-size: 12px;
}

.admin-card-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #eadfce;
}

.admin-card-tools {
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(100px, 140px) auto;
  gap: 10px;
  align-items: end;
}

.generated-cards {
  min-height: 96px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.admin-card-row {
  grid-template-columns: minmax(90px, 0.8fr) minmax(150px, 1fr);
}

/* Authenticated surfaces keep the existing layout and adopt the login visual system. */
html[data-theme="dark"] body:not(.auth-mode) {
  background: #0b0d0e;
  color: var(--text);
}

html[data-theme="dark"] body:not(.auth-mode) ::selection {
  background: rgba(75, 201, 191, 0.28);
  color: #fff;
}

html[data-theme="dark"] body:not(.auth-mode) *,
html[data-theme="dark"] body:not(.auth-mode) *::before,
html[data-theme="dark"] body:not(.auth-mode) *::after {
  scrollbar-color: #4a5358 #171a1c;
}

html[data-theme="dark"] body:not(.auth-mode) .topbar,
html[data-theme="dark"] body:not(.auth-mode) .panel,
html[data-theme="dark"] body:not(.auth-mode) .modal-card {
  border-color: #303438;
  background: #151719;
  box-shadow: var(--shadow);
}

html[data-theme="dark"] body:not(.auth-mode) .topbar {
  background: rgba(21, 23, 25, 0.94);
  backdrop-filter: blur(18px);
}

html[data-theme="dark"] body:not(.auth-mode) .announcement-strip {
  border-color: #303438;
  background: #303438;
}

html[data-theme="dark"] body:not(.auth-mode) .announcement-item {
  border-left-color: #4bc9bf;
  background: #13211f;
}

html[data-theme="dark"] body:not(.auth-mode) .announcement-item.announcement-important {
  border-left-color: #ff8d79;
  background: #271918;
}

html[data-theme="dark"] body:not(.auth-mode) .announcement-item.announcement-maintenance {
  border-left-color: #d4aa65;
  background: #242016;
}

html[data-theme="dark"] body:not(.auth-mode) .announcement-copy strong {
  color: #eef1f2;
}

html[data-theme="dark"] body:not(.auth-mode) .announcement-copy p {
  color: #aab2b6;
}

html[data-theme="dark"] body:not(.auth-mode) .announcement-level {
  border-color: rgba(75, 201, 191, 0.3);
  color: #72d5cd;
}

html[data-theme="dark"] body:not(.auth-mode) .announcement-important .announcement-level {
  border-color: rgba(255, 141, 121, 0.32);
  color: #ffab9b;
}

html[data-theme="dark"] body:not(.auth-mode) .announcement-maintenance .announcement-level {
  border-color: rgba(212, 170, 101, 0.34);
  color: #dfbd83;
}

html[data-theme="dark"] body:not(.auth-mode) .announcement-dismiss {
  border-color: transparent;
  background: transparent;
  color: #929ba0;
  box-shadow: none;
}

html[data-theme="dark"] body:not(.auth-mode) .announcement-dismiss:hover {
  border-color: #3a3f43;
  background: #202427;
  color: #fff;
}

html[data-theme="dark"] body:not(.auth-mode) .brand h1,
html[data-theme="dark"] body:not(.auth-mode) .panel-head h2,
html[data-theme="dark"] body:not(.auth-mode) h3 {
  color: #f3f5f6;
}

html[data-theme="dark"] body:not(.auth-mode) .brand p,
html[data-theme="dark"] body:not(.auth-mode) .asset-head p {
  color: var(--muted);
}

html[data-theme="dark"] body:not(.auth-mode) .panel-head {
  border-bottom-color: #303438;
  background: #1a1d1f;
}

html[data-theme="dark"] body:not(.auth-mode) .panel-head h2::before {
  display: inline-block;
  width: 3px;
  height: 14px;
  margin-right: 8px;
  border-radius: 1px;
  background: var(--teal);
  content: "";
  vertical-align: -2px;
}

html[data-theme="dark"] body:not(.auth-mode) label {
  color: #bbc2c6;
}

html[data-theme="dark"] body:not(.auth-mode) input,
html[data-theme="dark"] body:not(.auth-mode) textarea,
html[data-theme="dark"] body:not(.auth-mode) select,
html[data-theme="dark"] body:not(.auth-mode) .prompt-editor {
  border-color: #34383c;
  background: #0d0f10;
  color: #eef1f2;
}

html[data-theme="dark"] body:not(.auth-mode) input::placeholder,
html[data-theme="dark"] body:not(.auth-mode) textarea::placeholder {
  color: #677177;
}

html[data-theme="dark"] body:not(.auth-mode) input:disabled,
html[data-theme="dark"] body:not(.auth-mode) textarea:disabled,
html[data-theme="dark"] body:not(.auth-mode) select:disabled {
  background: #191c1e;
  color: #727b80;
}

html[data-theme="dark"] body:not(.auth-mode) input:focus,
html[data-theme="dark"] body:not(.auth-mode) textarea:focus,
html[data-theme="dark"] body:not(.auth-mode) select:focus,
html[data-theme="dark"] body:not(.auth-mode) .prompt-editor:focus {
  border-color: var(--teal);
  background: #0d0f10;
  box-shadow: 0 0 0 3px rgba(75, 201, 191, 0.12);
}

html[data-theme="dark"] body:not(.auth-mode) input:-webkit-autofill {
  box-shadow: 0 0 0 1000px #0d0f10 inset;
  -webkit-text-fill-color: #eef1f2;
}

html[data-theme="dark"] body:not(.auth-mode) option {
  background: #151719;
  color: #eef1f2;
}

html[data-theme="dark"] body:not(.auth-mode) button {
  border-color: #4bc9bf;
  background: #4bc9bf;
  color: #071210;
  box-shadow: 0 10px 24px rgba(75, 201, 191, 0.13);
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

html[data-theme="dark"] body:not(.auth-mode) button:hover {
  border-color: #79dcd4;
  background: #79dcd4;
}

html[data-theme="dark"] body:not(.auth-mode) button:focus-visible,
html[data-theme="dark"] body:not(.auth-mode) .link-button:focus-visible {
  outline: 2px solid rgba(75, 201, 191, 0.7);
  outline-offset: 2px;
}

html[data-theme="dark"] body:not(.auth-mode) .link-button,
html[data-theme="dark"] body:not(.auth-mode) button.secondary {
  border-color: #3a3f43;
  background: #1b1e20;
  color: #c5cbce;
  box-shadow: none;
}

html[data-theme="dark"] body:not(.auth-mode) .link-button:hover,
html[data-theme="dark"] body:not(.auth-mode) button.secondary:hover {
  border-color: #566067;
  background: #222629;
  color: #fff;
}

html[data-theme="dark"] body:not(.auth-mode) button.danger {
  border-color: #653d39;
  background: #2a1918;
  color: #ff9d8c;
}

html[data-theme="dark"] body:not(.auth-mode) button.danger:hover {
  border-color: #8b5149;
  background: #351e1c;
}

html[data-theme="dark"] body:not(.auth-mode) .pill,
html[data-theme="dark"] body:not(.auth-mode) .status {
  border-color: #3a3f43;
  background: #1b1e20;
  color: #c5cbce;
}

html[data-theme="dark"] body:not(.auth-mode) .green {
  border-color: rgba(75, 201, 191, 0.32);
  background: #142422;
  color: #72d5cd;
}

html[data-theme="dark"] body:not(.auth-mode) .points-button {
  border-color: rgba(212, 170, 101, 0.38);
  background: #241f17;
  color: #e4bd79;
}

html[data-theme="dark"] body:not(.auth-mode) .asset-box,
html[data-theme="dark"] body:not(.auth-mode) .notice {
  border-color: rgba(212, 170, 101, 0.34);
  background: #1e1b16;
}

html[data-theme="dark"] body:not(.auth-mode) .notice {
  color: #dfc28d;
}

html[data-theme="dark"] body:not(.auth-mode) .prompt-editor::-webkit-scrollbar-track,
html[data-theme="dark"] body:not(.auth-mode) .tasks > .task-list::-webkit-scrollbar-track,
html[data-theme="dark"] body:not(.auth-mode) .mention-menu::-webkit-scrollbar-thumb {
  background: #171a1c;
}

html[data-theme="dark"] body:not(.auth-mode) .prompt-editor::-webkit-scrollbar-thumb,
html[data-theme="dark"] body:not(.auth-mode) .tasks > .task-list::-webkit-scrollbar-thumb {
  border-color: #171a1c;
  background: #4a5358;
}

html[data-theme="dark"] body:not(.auth-mode) .prompt-editor::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] body:not(.auth-mode) .tasks > .task-list::-webkit-scrollbar-thumb:hover {
  background: #657077;
}

  html[data-theme="dark"] body:not(.auth-mode) .ref-token {
    border-color: rgba(75, 201, 191, 0.5);
    background: linear-gradient(180deg, #132a27, #251f13);
    box-shadow:
      0 0 0 1px rgba(13, 15, 16, 0.96),
      0 0 0 3px rgba(75, 201, 191, 0.16),
      0 0 0 5px rgba(226, 159, 58, 0.11),
      inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    color: #8de1da;
  }

  html[data-theme="dark"] body:not(.auth-mode) .ref-token-audio {
    border-color: rgba(158, 148, 255, 0.48);
    background: linear-gradient(180deg, #201d34, #251f13);
    color: #b9b2ff;
  }

  html[data-theme="dark"] body:not(.auth-mode) .ref-token-video {
    border-color: rgba(226, 159, 58, 0.52);
    background: linear-gradient(180deg, #261e12, #132a27);
    color: #f3c46e;
  }

html[data-theme="dark"] body:not(.auth-mode) .mention-menu {
  border-color: #3a3f43;
  background: #171a1c;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.46);
}

html[data-theme="dark"] body:not(.auth-mode) .mention-menu::-webkit-scrollbar-thumb {
  border-color: #171a1c;
  background: #4a5358;
}

html[data-theme="dark"] body:not(.auth-mode) .mention-option {
  color: #c3c9cc;
}

html[data-theme="dark"] body:not(.auth-mode) .mention-option.active,
html[data-theme="dark"] body:not(.auth-mode) .mention-option:hover {
  border-color: rgba(75, 201, 191, 0.34);
  background: #1a2a28;
  color: #8de1da;
}

html[data-theme="dark"] body:not(.auth-mode) .mention-option img,
html[data-theme="dark"] body:not(.auth-mode) .mention-option video,
html[data-theme="dark"] body:not(.auth-mode) .mention-glyph {
  background: #101314;
}

html[data-theme="dark"] body:not(.auth-mode) .mention-glyph,
html[data-theme="dark"] body:not(.auth-mode) .asset-glyph {
  border-color: rgba(75, 201, 191, 0.34);
  color: #72d5cd;
}

html[data-theme="dark"] body:not(.auth-mode) .asset-panel {
  border-color: #384247;
  background: #121618;
}

html[data-theme="dark"] body:not(.auth-mode) .drop-zone {
  border-color: #3c4347;
  background: #101214;
}

html[data-theme="dark"] body:not(.auth-mode) .drop-zone.drag,
html[data-theme="dark"] body:not(.auth-mode) .drop-zone:hover {
  border-color: rgba(75, 201, 191, 0.65);
  background: #12201f;
  box-shadow: 0 0 0 3px rgba(75, 201, 191, 0.08);
}

html[data-theme="dark"] body:not(.auth-mode) .drop-zone.model-over-limit,
html[data-theme="dark"] body:not(.auth-mode) .drop-zone.model-over-limit:hover {
  border-color: #a6534d;
  background: #251817;
  box-shadow: 0 0 0 3px rgba(216, 96, 87, 0.1);
}

html[data-theme="dark"] body:not(.auth-mode) .drop-zone.model-over-limit > span {
  color: #ef938b;
}

html[data-theme="dark"] body:not(.auth-mode) .drop-zone.upload-disabled:not(.model-over-limit),
html[data-theme="dark"] body:not(.auth-mode) .drop-zone.upload-disabled:not(.model-over-limit):hover {
  border-color: #303438;
  background: #15181a;
  box-shadow: none;
}

html[data-theme="dark"] body:not(.auth-mode) .drop-zone.upload-disabled:not(.model-over-limit) > b,
html[data-theme="dark"] body:not(.auth-mode) .drop-zone.upload-disabled:not(.model-over-limit) > span {
  color: #697277;
}

html[data-theme="dark"] body:not(.auth-mode) .drop-zone b,
html[data-theme="dark"] body:not(.auth-mode) .asset-card b {
  color: #e7eaeb;
}

html[data-theme="dark"] body:not(.auth-mode) .drop-zone > span {
  color: #838d92;
}

html[data-theme="dark"] body:not(.auth-mode) .asset-card {
  border-color: #34383c;
  background: #191c1e;
}

html[data-theme="dark"] body:not(.auth-mode) .retry-draft-notice {
  border-color: rgba(75, 201, 191, 0.36);
  background: #142422;
  color: #9addd7;
}

html[data-theme="dark"] body:not(.auth-mode) .asset-card.asset-retry-selected {
  border-color: #376f67;
  background: #142421;
  box-shadow: inset 3px 0 #4bc9bf;
}

html[data-theme="dark"] body:not(.auth-mode) .asset-card.asset-retry-excluded {
  border-color: #42474a;
  background: #141617;
  opacity: 0.58;
}

html[data-theme="dark"] body:not(.auth-mode) .asset-retry-state {
  color: #72d5cd;
}

html[data-theme="dark"] body:not(.auth-mode) .asset-retry-excluded .asset-retry-state {
  color: #8f989d;
}

html[data-theme="dark"] body:not(.auth-mode) .asset-card img,
html[data-theme="dark"] body:not(.auth-mode) .asset-card video,
html[data-theme="dark"] body:not(.auth-mode) .asset-glyph {
  background: #0f1112;
}

html[data-theme="dark"] body:not(.auth-mode) .asset-card span {
  color: #c2c8cb;
}

html[data-theme="dark"] body:not(.auth-mode) .asset-upload-status {
  color: #838d92;
}

html[data-theme="dark"] body:not(.auth-mode) .asset-upload-progress {
  background: #2a2f32;
}

html[data-theme="dark"] body:not(.auth-mode) .asset-upload-progress i {
  background: #4bc9bf;
}

html[data-theme="dark"] body:not(.auth-mode) .asset-failed {
  border-color: #653d39;
  background: #211716;
}

html[data-theme="dark"] body:not(.auth-mode) .asset-failed .asset-upload-status {
  color: #ff9d8c;
}

html[data-theme="dark"] body:not(.auth-mode) .mention-option.pending:disabled,
html[data-theme="dark"] body:not(.auth-mode) .mention-option.pending:disabled small {
  color: #788287;
}

html[data-theme="dark"] body:not(.auth-mode) .cache-notice {
  border-color: rgba(212, 170, 101, 0.34);
  background: #211d16;
  color: #e1c58f;
}

html[data-theme="dark"] body:not(.auth-mode) .task-card,
html[data-theme="dark"] body:not(.auth-mode) .key-card,
html[data-theme="dark"] body:not(.auth-mode) .ledger-row,
html[data-theme="dark"] body:not(.auth-mode) .admin-ledger-list,
html[data-theme="dark"] body:not(.auth-mode) .admin-row,
html[data-theme="dark"] body:not(.auth-mode) .admin-asset-row,
html[data-theme="dark"] body:not(.auth-mode) .admin-model-row,
html[data-theme="dark"] body:not(.auth-mode) .admin-announcement-row {
  border-color: #303438;
  background: #191c1e;
}

html[data-theme="dark"] body:not(.auth-mode) .admin-management-band {
  border-color: #303438;
  background: #121516;
}

html[data-theme="dark"] body:not(.auth-mode) .admin-model-group + .admin-model-group {
  border-color: #303438;
}

html[data-theme="dark"] body:not(.auth-mode) .admin-model-group-head b {
  color: #dfb66f;
}

html[data-theme="dark"] body:not(.auth-mode) .admin-user-row.selected {
  border-color: rgba(75, 201, 191, 0.56);
  background: #142422;
  box-shadow: inset 3px 0 #4bc9bf;
}

html[data-theme="dark"] body:not(.auth-mode) .admin-model-delete {
  border-color: rgba(255, 141, 121, 0.34);
  background: #2a1918;
  color: #ffab9b;
}

html[data-theme="dark"] body:not(.auth-mode) .announcement-editor,
html[data-theme="dark"] body:not(.auth-mode) .admin-model-controls {
  border-color: #303438;
}

html[data-theme="dark"] body:not(.auth-mode) .admin-model-identity > strong,
html[data-theme="dark"] body:not(.auth-mode) .admin-announcement-heading > strong,
html[data-theme="dark"] body:not(.auth-mode) .confirm-dialog-body > p {
  color: #eef1f2;
}

html[data-theme="dark"] body:not(.auth-mode) .admin-model-detail dt,
html[data-theme="dark"] body:not(.auth-mode) .admin-announcement-row time {
  color: #838d92;
}

html[data-theme="dark"] body:not(.auth-mode) .admin-model-detail dd,
html[data-theme="dark"] body:not(.auth-mode) .admin-announcement-body,
html[data-theme="dark"] body:not(.auth-mode) .task-model-label {
  color: #a8b0b4;
}

html[data-theme="dark"] body:not(.auth-mode) .admin-state {
  border-color: rgba(75, 201, 191, 0.3);
  background: #142422;
  color: #72d5cd;
}

html[data-theme="dark"] body:not(.auth-mode) .admin-state.warning,
html[data-theme="dark"] body:not(.auth-mode) .admin-state.announcement-maintenance {
  border-color: rgba(212, 170, 101, 0.34);
  background: #241f17;
  color: #dfbd83;
}

html[data-theme="dark"] body:not(.auth-mode) .admin-state.announcement-important {
  border-color: rgba(255, 141, 121, 0.32);
  background: #2a1918;
  color: #ffab9b;
}

html[data-theme="dark"] body:not(.auth-mode) .admin-state.muted {
  border-color: #3a3f43;
  background: #202326;
  color: #929ba0;
}

html[data-theme="dark"] body:not(.auth-mode) .task-card.task-card-downloaded {
  border-color: #376f67;
  background: #142421;
  box-shadow: inset 3px 0 #4bc9bf;
}

html[data-theme="dark"] body:not(.auth-mode) .task-unread-dot {
  border-color: #191c1e;
  background: #ff8f72;
  box-shadow: 0 0 0 1px rgba(255, 143, 114, 0.35);
}

html[data-theme="dark"] body:not(.auth-mode) .task-video-card video {
  border-color: #34383c;
  background: #050607;
}

html[data-theme="dark"] body:not(.auth-mode) .task-video-empty {
  border-color: #3a3f43;
  background: #101214;
}

html[data-theme="dark"] body:not(.auth-mode) .task-video-empty span,
html[data-theme="dark"] body:not(.auth-mode) .task-id,
html[data-theme="dark"] body:not(.auth-mode) .audit-time b {
  color: #dfb66f;
}

html[data-theme="dark"] body:not(.auth-mode) .task-meta,
html[data-theme="dark"] body:not(.auth-mode) .admin-row span,
html[data-theme="dark"] body:not(.auth-mode) .admin-row small,
html[data-theme="dark"] body:not(.auth-mode) .admin-asset-row span,
html[data-theme="dark"] body:not(.auth-mode) .admin-asset-row small {
  color: #8f989d;
}

html[data-theme="dark"] body:not(.auth-mode) .task-prompt {
  border-color: #303438;
  background: #0f1112;
  color: #c7cdd0;
}

html[data-theme="dark"] body:not(.auth-mode) .task-result {
  background: #211d16;
  color: #d5bb87;
}

html[data-theme="dark"] body:not(.auth-mode) .task-result b,
html[data-theme="dark"] body:not(.auth-mode) .ledger-row b,
html[data-theme="dark"] body:not(.auth-mode) .admin-row b,
html[data-theme="dark"] body:not(.auth-mode) .admin-asset-row b,
html[data-theme="dark"] body:not(.auth-mode) .admin-media-block b {
  color: #e8ebec;
}

html[data-theme="dark"] body:not(.auth-mode) .task-result.completed {
  background: #142422;
  color: #7bd8d0;
}

html[data-theme="dark"] body:not(.auth-mode) .task-result.failed {
  background: #2a1918;
  color: #ff9d8c;
}

html[data-theme="dark"] body:not(.auth-mode) .task-warning {
  color: #e4b86d;
}

html[data-theme="dark"] body:not(.auth-mode) .task-failure {
  color: #d6a397;
}

html[data-theme="dark"] body:not(.auth-mode) .task-failure-title {
  color: #ff9d8c;
}

html[data-theme="dark"] body:not(.auth-mode) .task-failure-detail,
html[data-theme="dark"] body:not(.auth-mode) .admin-failure-diagnostics {
  color: #aeb5b8;
}

html[data-theme="dark"] body:not(.auth-mode) .admin-failure-diagnostics summary {
  color: #dfb66f;
}

html[data-theme="dark"] body:not(.auth-mode) .task-refund {
  color: #72d5cd;
}

html[data-theme="dark"] body:not(.auth-mode) .points-summary,
html[data-theme="dark"] body:not(.auth-mode) .model-preview {
  border-color: #303438;
  background: #171c1c;
}

html[data-theme="dark"] body:not(.auth-mode) .ledger-empty {
  border-color: #34383c;
  background: #121416;
}

html[data-theme="dark"] body:not(.auth-mode) .progress {
  background: #292e31;
}

html[data-theme="dark"] body:not(.auth-mode) .bar {
  background: #4bc9bf;
}

html[data-theme="dark"] body:not(.auth-mode) .modal {
  background: rgba(2, 3, 4, 0.74);
}

html[data-theme="dark"] body:not(.auth-mode) .preflight-warning-list li {
  border-color: rgba(255, 141, 121, 0.22);
  background: rgba(70, 34, 29, 0.55);
  color: #ffd8cf;
}

html[data-theme="dark"] body:not(.auth-mode) .preflight-warning-list b {
  color: #ffab9b;
}

html[data-theme="dark"] body:not(.auth-mode) .video-modal-body {
  background: #090b0c;
}

html[data-theme="dark"] body:not(.auth-mode) .secret-box,
html[data-theme="dark"] body:not(.auth-mode) pre {
  border-color: #35464a;
  background: #101718;
  color: #88dcd5;
}

html[data-theme="dark"] body:not(.auth-mode) pre {
  border-color: #3d3a32;
  background: #111315;
  color: #c7cdd0;
}

html[data-theme="dark"] body:not(.auth-mode) .media-thumb {
  border-color: #303438;
  background: #111315;
  color: #c1c8cb;
}

html[data-theme="dark"] body:not(.auth-mode) .media-thumb img,
html[data-theme="dark"] body:not(.auth-mode) .media-thumb video {
  background: #050607;
}

html[data-theme="dark"] body:not(.auth-mode) .media-glyph {
  border-color: rgba(75, 201, 191, 0.32);
  background: #142422;
  color: #72d5cd;
}

html[data-theme="dark"] body:not(.auth-mode) .stat-card {
  border-color: #303438;
  background: #181b1d;
  box-shadow: inset 0 2px 0 rgba(75, 201, 191, 0.72);
}

html[data-theme="dark"] body:not(.auth-mode) .stat-card:nth-child(3n + 2) {
  box-shadow: inset 0 2px 0 rgba(212, 170, 101, 0.78);
}

html[data-theme="dark"] body:not(.auth-mode) .stat-card:nth-child(3n) {
  box-shadow: inset 0 2px 0 rgba(116, 170, 236, 0.68);
}

html[data-theme="dark"] body:not(.auth-mode) .stat-card b {
  color: #f0f2f3;
}

html[data-theme="dark"] body:not(.auth-mode) .stat-card span,
html[data-theme="dark"] body:not(.auth-mode) .audit-label {
  color: #8f989d;
}

html[data-theme="dark"] body:not(.auth-mode) .admin-card-panel {
  border-top-color: #303438;
}

html[data-theme="dark"] body:not(.auth-mode) a:not(.link-button) {
  color: #72d5cd;
}

html[data-theme="light"].session-pending body,
html[data-theme="light"].session-pending .session-boot {
  background: #f7f2e8;
}

html[data-theme="light"].session-pending .session-boot img {
  border-color: #d9c7ac;
}

html[data-theme="light"].session-pending .session-boot > span {
  background: #e7dac8;
}

html[data-theme="light"].session-pending .session-boot i {
  background: #118c80;
}

html[data-theme="light"] body.auth-mode {
  color-scheme: light;
  background: #f7f2e8;
}

html[data-theme="light"] .auth-layout {
  background: #f7f2e8;
}

html[data-theme="light"] .auth-layout::before {
  opacity: 0.045;
}

html[data-theme="light"] .auth-mode .brand h1 {
  color: #33291f;
}

html[data-theme="light"] .auth-mode .brand p {
  color: #81776b;
}

html[data-theme="light"] .auth-mode .topbar .link-button,
html[data-theme="light"] .auth-mode .topbar button.secondary {
  border-color: #e2d2b8;
  background: rgba(255, 253, 249, 0.88);
  color: #5f5345;
}

html[data-theme="light"] .auth-mode .topbar .link-button:hover,
html[data-theme="light"] .auth-mode .topbar button.secondary:hover {
  border-color: #c9a875;
  background: #fffdf9;
  color: #33291f;
}

html[data-theme="light"] .auth-card {
  border-color: #e2d2b8;
  background: #fffdf9;
  box-shadow: 0 26px 72px rgba(83, 61, 34, 0.15);
  color: #33291f;
}

html[data-theme="light"] .auth-logo {
  border-color: #dac7a8;
  background: #090b12;
}

html[data-theme="light"] .auth-brand-lockup > div > span,
html[data-theme="light"] .auth-heading p,
html[data-theme="light"] .auth-register-row,
html[data-theme="light"] .auth-rate {
  color: #81776b;
}

html[data-theme="light"] .auth-heading h2 {
  color: #33291f;
}

html[data-theme="light"] .auth-field {
  color: #665b4e;
}

html[data-theme="light"] .auth-field input {
  border-color: #e3d6c4;
  background: #fffefa;
  color: #33291f;
}

html[data-theme="light"] .auth-field input::placeholder {
  color: #9b8b77;
}

html[data-theme="light"] .auth-field input:focus {
  border-color: #118c80;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(17, 140, 128, 0.11);
}

html[data-theme="light"] .auth-field input:-webkit-autofill {
  box-shadow: 0 0 0 1000px #fffefa inset;
  -webkit-text-fill-color: #33291f;
}

html[data-theme="light"] .auth-password-toggle,
html[data-theme="light"] .auth-register-button {
  color: #0f766d;
}

html[data-theme="light"] .auth-password-toggle:hover,
html[data-theme="light"] .auth-register-button:hover {
  color: #095c55;
}

html[data-theme="light"] .auth-primary {
  background: #bd7a24;
  color: #fffdf8;
}

html[data-theme="light"] .auth-primary:hover {
  background: #a96b1c;
}

html[data-theme="light"] .auth-toast {
  color: #b44d36;
}

html[data-theme="light"] .auth-divider {
  background: #eadfce;
}

html[data-theme="light"] .auth-rate + .auth-rate {
  border-color: #eadfce;
  background: transparent;
}

html[data-theme="light"] .auth-rate b {
  color: #a66f1f;
}

html[data-theme="light"] .auth-support {
  color: #81776b;
}

@media (prefers-reduced-motion: reduce) {
  .session-boot i {
    animation: none;
    transform: translateX(70%);
  }

  .asset-card,
  .task-card,
  .prompt-editor,
  .asset-upload-progress i {
    animation: none;
    transition: none;
  }
}

@media (max-width: 1180px) {
  .workspace,
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .tasks {
    max-height: min(720px, calc(100vh - 96px));
    max-height: min(720px, calc(100dvh - 96px));
  }

  .preflight-actions {
    justify-content: stretch;
  }

  .preflight-actions button {
    width: 100%;
  }

  .topbar {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 40px 36px;
    align-items: center;
    gap: 8px;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .auth-mode .top-actions {
    width: auto;
    justify-content: flex-end;
    margin-left: auto;
  }
}

@media (max-width: 900px) {
  .param-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .drop-grid,
  .admin-ledger-grid {
    grid-template-columns: 1fr;
  }

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

  .admin-model-row {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "identity"
      "technical"
      "controls";
  }

  .admin-model-technical {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-model-detail:last-child {
    grid-column: 1 / -1;
  }

  .admin-model-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .announcement-editor {
    padding-right: 0;
    padding-bottom: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-announcement-list {
    max-height: none;
    padding-right: 0;
    overflow-y: visible;
  }
}

@media (max-width: 620px) {
  .tasks {
    max-height: none;
  }

  .tasks > .task-list {
    overflow-y: visible;
    overscroll-behavior: auto;
    scrollbar-gutter: auto;
  }

  .retry-draft-notice {
    align-items: flex-start;
    font-size: 11px;
  }

  .task-line {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .task-state-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .auth-mode .topbar {
    min-height: 66px;
    flex-wrap: nowrap;
    padding: 11px 12px;
  }

  .auth-mode .brand {
    flex: 0 0 auto;
  }

  .auth-mode .brand-icon {
    width: 36px;
    height: 36px;
  }

  .auth-mode .brand p {
    display: none;
  }

  .auth-mode .top-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
    margin-left: auto;
  }

  .auth-mode .topbar .link-button,
  .auth-mode .topbar button.secondary {
    min-height: 32px;
    padding: 0 9px;
    font-size: 12px;
  }

  .auth-mode .language-toggle {
    min-width: 68px;
  }

  .auth-layout {
    place-items: start center;
    padding: 78px 12px 18px;
  }

  .auth-layout::before {
    display: none;
  }

  .auth-card {
    width: 100%;
    padding: 22px 20px 20px;
  }

  .auth-heading {
    margin: 20px 0 19px;
  }

  .auth-heading h2 {
    font-size: 22px;
  }

  .prompt-editor {
    height: clamp(190px, 38vh, 300px);
    min-height: 190px;
    max-height: 300px;
  }

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

  .admin-search,
  .admin-card-tools,
  .points-summary,
  .ledger-row,
  .task-card-compact,
  .admin-audit-row,
  .admin-card-row,
  .admin-asset-row {
    grid-template-columns: 1fr;
  }

  .admin-model-technical,
  .admin-model-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-model-detail:last-child {
    grid-column: auto;
  }

  .admin-model-save,
  .admin-model-delete {
    width: 100%;
  }

  .admin-model-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-announcement-heading {
    flex-direction: column;
  }

  .admin-announcement-badges {
    justify-content: flex-start;
  }

  .admin-announcement-actions > button {
    flex: 1 1 112px;
  }

  .confirm-dialog-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .confirm-dialog-actions button {
    width: 100%;
  }

  .audit-time {
    text-align: left;
  }
}

@media (max-width: 460px) {
  .auth-mode .topbar .link-button {
    display: none;
  }
}
