:root {
  color-scheme: light;
  --background: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f8f7fb;
  --surface-strong: #f1eff7;
  --text: #15171a;
  --muted: #687078;
  --dim: #8a929a;
  --line: #e7e3ee;
  --line-strong: #d7d0e3;
  --accent: #6d28f2;
  --accent-soft: #f1ebff;
  --accent-ink: #5820c5;
  --mint: #0ca7aa;
  --mint-soft: #e3f8f7;
  --violet: #8b5cf6;
  --violet-soft: #f0ebff;
  --brand-cyan: #12b9d7;
  --brand-pink: #c93fa4;
  --grid-line: rgba(109, 40, 242, 0.045);
  --danger: #d93f55;
  --danger-soft: #fff0f2;
  --warning: #bd7a00;
  --warning-soft: #fff6df;
  --shadow: 0 14px 36px rgba(20, 29, 40, 0.08);
  --sidebar-width: 208px;
  --topbar-height: 56px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #000000;
  --surface: #000000;
  --surface-soft: #101013;
  --surface-strong: #18181d;
  --text: #f7f5fb;
  --muted: #aaa4b4;
  --dim: #7f7889;
  --line: #27232d;
  --line-strong: #3b3445;
  --accent: #9b79ff;
  --accent-soft: #211638;
  --accent-ink: #c5b2ff;
  --mint: #37d4d0;
  --mint-soft: #102e2e;
  --violet: #b298ff;
  --violet-soft: #2a2040;
  --brand-cyan: #35d4df;
  --brand-pink: #ef74ca;
  --grid-line: rgba(167, 139, 250, 0.075);
  --danger: #ff7285;
  --danger-soft: #4b252c;
  --warning: #f1bd55;
  --warning-soft: #473a20;
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

body {
  min-height: 100vh;
  overflow: hidden;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.icon-symbols {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar {
  position: relative;
  z-index: 30;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr auto;
  align-items: center;
  height: var(--topbar-height);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.topbar::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0 58%, var(--brand-cyan) 76%, var(--brand-pink) 100%);
  content: "";
  pointer-events: none;
}

.topbar-brand-group,
.topbar-tools,
.top-links,
.brand,
.command-search,
.sidebar-account,
.page-header,
.panel-heading.inline-heading,
.balance-title,
.endpoint-row,
.detail-actions,
.key-actions,
.view-toolbar,
.pagination,
.form-actions,
.modal-title-row,
.profile-line,
.reward-copy-row,
.payment-methods,
.tab-switcher {
  display: flex;
  align-items: center;
}

.topbar-brand-group {
  min-width: 0;
  gap: 6px;
  padding: 0 18px;
}

.brand {
  min-width: 0;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
}

.brand-logo {
  display: block;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  object-fit: contain;
  image-rendering: auto;
  filter: none;
  transform: translateZ(0);
}

:root[data-theme="dark"] .brand-logo {
  filter: brightness(1.38) contrast(1.28) saturate(1.2) drop-shadow(0 0 3px rgba(226, 214, 255, 0.26));
}

.brand-name {
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-links {
  justify-content: center;
  gap: 28px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.top-links a:hover,
.top-links a:focus-visible,
.top-links button:hover,
.top-links button:focus-visible,
.top-links button.active {
  color: var(--text);
}

.top-links button {
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
  cursor: pointer;
}

.topbar-tools {
  gap: 8px;
  padding-right: 14px;
}

.icon-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: var(--line);
  background: var(--surface-soft);
  outline: none;
}

.sidebar-toggle {
  display: none;
}

.command-search {
  position: relative;
  width: 255px;
  height: 34px;
  gap: 7px;
  padding: 0 7px 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted);
}

.command-search:focus-within {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.command-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
}

.command-search input::placeholder {
  color: var(--dim);
}

.command-search kbd {
  flex: 0 0 auto;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--dim);
  font-family: inherit;
  font-size: 10px;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  z-index: 50;
  overflow: hidden;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-results button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.search-results button:hover,
.search-results button:focus-visible {
  background: var(--surface-soft);
  outline: none;
}

.theme-sun {
  display: none;
}

:root[data-theme="dark"] .theme-sun {
  display: block;
}

:root[data-theme="dark"] .theme-moon {
  display: none;
}

.theme-toggle {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--accent-ink);
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  color: var(--accent);
}

.top-avatar,
.sidebar-avatar,
.profile-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  box-sizing: border-box;
  border-radius: 50%;
  background: #c93fa4;
  color: #ffffff;
  font-weight: 800;
}

.top-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  flex: 0 0 32px;
  padding: 0;
  border: 0;
  outline: 0;
  aspect-ratio: 1;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  clip-path: circle(50% at 50% 50%);
}

.top-avatar img,
.sidebar-avatar img,
.profile-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  clip-path: circle(50% at 50% 50%);
}

.dashboard-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  height: calc(100vh - var(--topbar-height));
}

.dash-sidebar {
  display: flex;
  min-height: 0;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.sidebar-nav {
  overflow-y: auto;
  padding: 15px 12px;
}

.nav-label {
  margin: 8px 10px 5px;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.4;
  text-transform: uppercase;
}

.personal-label {
  margin-top: 24px;
}

.nav-item {
  display: flex;
  width: 100%;
  height: 36px;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.nav-item:hover,
.nav-item:focus-visible {
  background: var(--surface-soft);
  outline: none;
}

.nav-item.active {
  position: relative;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 650;
}

.nav-item.active::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
  content: "";
}

.nav-item .icon {
  width: 17px;
  height: 17px;
}

.sidebar-account {
  min-width: 0;
  gap: 9px;
  padding: 12px 14px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

.sidebar-account:hover,
.sidebar-account:focus-visible {
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}

.sidebar-account:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 44%, transparent);
  outline-offset: -2px;
}

.sidebar-footer {
  border-top: 1px solid var(--line);
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  font-size: 11px;
}

.sidebar-user-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.sidebar-user-copy strong,
.sidebar-user-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-copy strong {
  font-size: 12px;
}

.sidebar-user-copy small {
  color: var(--muted);
  font-size: 10px;
}

.sidebar-backdrop {
  display: none;
}

.dashboard-main {
  min-width: 0;
  overflow: auto;
  padding: 0;
  background-color: var(--background);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
}

.console-surface {
  width: 100%;
  min-height: calc(100vh - var(--topbar-height));
  margin: 0;
  padding: 22px 18px 32px;
  border: 0;
  border-radius: 0;
  background: var(--surface);
}

.view[hidden] {
  display: none !important;
}

.page-header {
  min-height: 42px;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.page-header > div:first-child {
  position: relative;
  min-width: 0;
  padding-left: 13px;
}

.page-header > div:first-child::before {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 0;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--brand-cyan));
  content: "";
}

.page-header h1,
.page-header p,
.panel-heading h2,
.panel-heading p,
.modal h2,
.modal p {
  margin: 0;
}

.page-header h1 {
  font-size: 18px;
  line-height: 1.25;
}

.page-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.button:hover,
.button:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  outline: none;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.button-primary:hover,
.button-primary:focus-visible {
  border-color: var(--accent-ink);
  background: var(--accent-ink);
}

.button-secondary {
  background: var(--surface-soft);
}

.button-danger {
  border-color: color-mix(in srgb, var(--danger) 30%, var(--line));
  background: var(--danger-soft);
  color: var(--danger);
}

.button-small {
  min-height: 28px;
  padding: 0 9px;
  font-size: 11px;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 16px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.setup-panel,
.recommended-panel,
.api-info-panel,
.notice-panel,
.faq-panel,
.uptime-panel {
  padding: 18px;
}

.panel-heading {
  margin-bottom: 14px;
}

.panel-heading h2 {
  font-size: 16px;
  line-height: 1.35;
}

.panel-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.inline-heading {
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.eyebrow .icon {
  width: 13px;
  height: 13px;
}

.setup-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(300px, 1.15fr);
  gap: 18px;
}

.setup-steps {
  display: grid;
  align-content: start;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.setup-steps li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  border-bottom: 1px solid var(--line);
}

.setup-steps li:last-child {
  border-bottom: 0;
}

.step-index {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.setup-steps li.complete .step-index {
  border-color: var(--mint);
  background: var(--mint-soft);
  color: var(--mint);
}

.setup-steps strong,
.setup-steps small,
.action-list strong,
.action-list small {
  display: block;
}

.setup-steps strong,
.action-list strong {
  font-size: 12px;
}

.setup-steps small,
.action-list small {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setup-steps li > button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.setup-steps li > button:hover,
.setup-steps li > button:focus-visible {
  background: var(--surface-soft);
  color: var(--text);
  outline: none;
}

.request-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.request-preview-head {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.request-preview-head > span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 650;
}

.request-preview pre {
  min-height: 126px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  background: var(--surface);
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 10px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-all;
}

.route-checks {
  margin: 0;
  padding: 0 12px;
  background: var(--surface);
}

.route-checks > div {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
}

.route-checks > div:last-child {
  border-bottom: 0;
}

.route-checks dt {
  display: flex;
  align-items: center;
  gap: 7px;
}

.route-checks dd {
  margin: 0;
  color: var(--muted);
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--dim);
}

.status-online,
.service-badge i,
.health i {
  background: var(--mint);
}

.status-auth {
  background: var(--warning);
}

.action-list {
  display: grid;
}

.action-list > button,
.action-list > a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  min-height: 70px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.action-list > :last-child {
  border-bottom: 0;
}

.action-list > button:hover,
.action-list > button:focus-visible,
.action-list > a:hover,
.action-list > a:focus-visible {
  color: var(--accent-ink);
  outline: none;
}

.action-icon,
.metric-icon,
.endpoint-icon {
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--surface-strong);
}

.action-icon {
  width: 32px;
  height: 32px;
}

.action-arrow {
  color: var(--dim);
}

.usage-overview-panel {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) 310px;
  overflow: hidden;
}

.usage-summary-main {
  padding: 18px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.metric {
  display: grid;
  min-width: 0;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 3px 9px;
  padding: 14px 10px;
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.metric-icon {
  grid-row: 1 / 3;
  width: 30px;
  height: 30px;
}

.metric-icon .icon {
  width: 15px;
  height: 15px;
}

.metric-icon.blue {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.metric-icon.mint {
  background: var(--mint-soft);
  color: var(--mint);
}

.metric-icon.violet {
  background: var(--violet-soft);
  color: var(--violet);
}

.metric > span:not(.metric-icon),
.metric small {
  color: var(--muted);
  font-size: 10px;
}

.metric strong {
  grid-column: 2;
  margin-top: 4px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 18px;
}

.metric small {
  grid-column: 2;
}

.balance-summary {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-left: 1px solid var(--line);
  background: var(--surface-soft);
}

.balance-title {
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}

.health,
.service-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.health i,
.service-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.health.is-warning i {
  background: var(--warning);
}

.health.is-danger i {
  background: var(--danger);
}

.balance-summary > strong {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 24px;
}

.balance-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.balance-detail span {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  font-size: 9px;
}

.balance-detail b {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: var(--text);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.balance-summary .button {
  justify-content: space-between;
}

.api-info-panel,
.faq-panel {
  grid-column: 1;
}

.notice-panel,
.uptime-panel {
  grid-column: 2;
}

.service-badge {
  color: var(--mint);
}

.endpoint-row {
  min-width: 0;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.endpoint-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.endpoint-row > span:nth-child(2) {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 4px;
}

.endpoint-row strong {
  font-size: 11px;
}

.endpoint-row code {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  padding: 0;
  background: transparent;
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.text-link .icon {
  width: 14px;
  height: 14px;
}

.heading-icon {
  color: var(--accent-ink);
}

.notice-content {
  min-height: 80px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.notice-content.is-empty {
  display: grid;
  place-items: center;
  color: var(--dim);
}

.skeleton-line {
  display: block;
  width: 100%;
  height: 10px;
  margin: 9px 0;
  border-radius: 3px;
  background: var(--surface-strong);
}

.skeleton-line.short {
  width: 62%;
}

.faq-list {
  border-top: 1px solid var(--line);
}

.faq-list details {
  border-bottom: 1px solid var(--line);
}

.faq-list summary {
  padding: 12px 2px;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.faq-list p {
  margin: -3px 0 13px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.uptime-list {
  display: grid;
  gap: 8px;
}

.uptime-row {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 10px;
}

.uptime-row span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.uptime-row b {
  color: var(--mint);
  font-size: 10px;
}

.service-fab {
  display: flex;
  width: calc(100% - 24px);
  height: 34px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 10px 12px 0;
  padding: 0 12px;
  border-radius: 7px;
  background: #13b8c8;
  color: #ffffff;
  box-shadow: none;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.service-fab .status-dot {
  width: 9px;
  height: 9px;
  background: #ffffff;
}

.detail-view {
  min-height: calc(100vh - var(--topbar-height));
}

.detail-page-header {
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.detail-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.detail-content {
  min-width: 0;
}

.aggregate-detail-mode {
  display: flex;
  height: calc(100vh - var(--topbar-height));
  min-height: 620px;
  flex-direction: column;
  padding-top: 10px;
  padding-bottom: 10px;
  overflow: hidden;
}

.aggregate-detail-mode .detail-page-header {
  display: none;
}

.aggregate-detail-mode .detail-content {
  min-height: 0;
  flex: 1;
}

.aggregate-workspace {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  grid-template-columns: minmax(220px, 238px) minmax(0, 1fr) minmax(210px, 226px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.aggregate-workspace::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 4;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--brand-cyan) 72%, var(--brand-pink));
  content: "";
  pointer-events: none;
}

.aggregate-browser,
.aggregate-sessions,
.aggregate-chat {
  min-width: 0;
  min-height: 0;
}

.aggregate-browser,
.aggregate-sessions {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.aggregate-browser {
  border-right: 1px solid var(--line);
}

.aggregate-sessions {
  border-left: 1px solid var(--line);
}

.aggregate-panel-head,
.aggregate-chat-head,
.aggregate-active-model,
.aggregate-chat-actions,
.aggregate-composer-row,
.aggregate-session-item,
.aggregate-session-open,
.aggregate-new-session-wide {
  display: flex;
  align-items: center;
}

.aggregate-panel-head {
  min-height: 62px;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.aggregate-panel-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.aggregate-panel-symbol {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.aggregate-panel-symbol .icon {
  width: 14px;
  height: 14px;
}

.aggregate-panel-head > div {
  min-width: 0;
}

.aggregate-panel-head strong,
.aggregate-panel-head small {
  display: block;
}

.aggregate-panel-head strong {
  font-size: 13px;
}

.aggregate-panel-head small {
  max-width: 180px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aggregate-panel-close,
.aggregate-models-toggle,
.aggregate-history-toggle {
  display: none;
}

.aggregate-categories {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 12px 12px 9px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.aggregate-categories button {
  min-width: 0;
  height: 27px;
  padding: 0 2px;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
}

.aggregate-categories button:hover,
.aggregate-categories button:focus-visible,
.aggregate-categories button.active {
  background: var(--surface);
  color: var(--accent-ink);
  box-shadow: 0 1px 4px rgba(20, 29, 40, 0.1);
  outline: none;
}

.aggregate-model-search {
  display: flex;
  height: 34px;
  align-items: center;
  gap: 7px;
  margin: 0 12px 10px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
}

.aggregate-model-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.aggregate-model-search .icon {
  width: 14px;
  height: 14px;
}

.aggregate-model-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 11px;
}

.aggregate-model-list,
.aggregate-session-list {
  min-height: 0;
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
}

.aggregate-model-list {
  padding: 0 8px 12px;
}

.aggregate-model-item {
  display: grid;
  width: 100%;
  min-height: 54px;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.aggregate-model-item:hover,
.aggregate-model-item:focus-visible {
  background: var(--surface-soft);
  outline: none;
}

.aggregate-model-item.active {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.aggregate-model-mark {
  display: inline-grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
  border-radius: 7px;
  background: var(--surface);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 800;
}

.aggregate-model-copy {
  min-width: 0;
}

.aggregate-model-copy strong,
.aggregate-model-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aggregate-model-copy strong {
  font-size: 11px;
}

.aggregate-model-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 8px;
}

.aggregate-model-type {
  padding: 3px 5px;
  border-radius: 4px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 8px;
}

.aggregate-chat {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--surface-soft);
  background-image:
    linear-gradient(color-mix(in srgb, var(--accent) 7%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--brand-cyan) 6%, transparent) 1px, transparent 1px);
  background-size: 42px 42px;
}

.aggregate-chat-head {
  position: relative;
  min-height: 62px;
  flex: 0 0 auto;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.aggregate-chat-head::after {
  position: absolute;
  right: 14px;
  bottom: -1px;
  left: 14px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), var(--brand-cyan) 46%, transparent 86%);
  content: "";
  opacity: 0.72;
  pointer-events: none;
}

.aggregate-active-model {
  min-width: 0;
  gap: 10px;
}

.aggregate-active-model > span:last-child {
  min-width: 0;
}

.aggregate-active-model strong,
.aggregate-active-model small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aggregate-active-model strong {
  font-size: 13px;
}

.aggregate-active-model small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.aggregate-chat-actions {
  flex: 0 0 auto;
  gap: 7px;
}

.aggregate-messages {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 22px max(18px, 5%);
  overscroll-behavior: contain;
}

.aggregate-chat-empty {
  display: grid;
  width: min(600px, 100%);
  min-height: 100%;
  margin: 0 auto;
  align-content: center;
  justify-items: center;
  padding: 28px 12px;
  text-align: center;
}

.aggregate-brand-visual {
  display: inline-flex;
  min-width: 0;
  min-height: 0;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0;
}

.aggregate-brand-logo {
  display: block;
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.aggregate-brand-word {
  color: var(--text);
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

:root[data-theme="dark"] .aggregate-brand-logo {
  filter: brightness(1.18) contrast(1.12) saturate(1.08) drop-shadow(0 0 4px rgba(226,214,255,.28));
}

:root[data-theme="dark"] .aggregate-brand-word {
  color: #f2eaff;
  text-shadow: 0 0 8px rgba(167,139,250,.45);
}

.aggregate-empty-kicker {
  margin-top: 15px;
  color: var(--accent-ink);
  font-size: 9px;
  font-weight: 800;
}

.aggregate-chat-empty h3 {
  margin: 5px 0 0;
  font-size: 15px;
}

.aggregate-empty-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 5px 16px rgba(20, 29, 40, 0.06);
}

.aggregate-starters {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.aggregate-starters button {
  display: grid;
  min-height: 52px;
  grid-template-columns: 28px minmax(0, 1fr) 15px;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--muted);
  font-size: 10px;
  text-align: left;
  cursor: pointer;
}

.aggregate-starters button:hover,
.aggregate-starters button:focus-visible {
  border-color: var(--accent);
  color: var(--accent-ink);
  outline: none;
}

.aggregate-starter-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.aggregate-starter-icon .icon {
  width: 14px;
  height: 14px;
}

.aggregate-starter-arrow {
  width: 13px;
  height: 13px;
  color: var(--dim);
}

.aggregate-message {
  display: flex;
  width: min(760px, 100%);
  align-items: flex-start;
  gap: 9px;
  margin: 0 auto 18px;
}

.aggregate-message.user {
  flex-direction: row-reverse;
}

.aggregate-message-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--accent-ink);
  font-size: 9px;
  font-weight: 800;
}

.aggregate-message.user .aggregate-message-avatar {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.aggregate-message-avatar-image {
  overflow: hidden;
  padding: 0;
  background: var(--surface);
}

.aggregate-message-avatar-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.aggregate-message-content {
  min-width: 0;
  max-width: min(82%, 650px);
}

.aggregate-message-body {
  min-height: 34px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.aggregate-message.user .aggregate-message-body {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.aggregate-thinking,
.aggregate-thinking-dots {
  display: inline-flex;
  align-items: center;
}

.aggregate-thinking {
  min-height: 20px;
  gap: 7px;
  color: var(--muted);
}

.aggregate-thinking-dots {
  gap: 3px;
}

.aggregate-thinking-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  animation: aggregate-thinking-dot 1.1s ease-in-out infinite;
}

.aggregate-thinking-dots i:nth-child(2) {
  animation-delay: 0.14s;
}

.aggregate-thinking-dots i:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes aggregate-thinking-dot {
  0%,
  70%,
  100% {
    opacity: 0.28;
    transform: translateY(0);
  }

  35% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.aggregate-message-content time {
  display: block;
  margin-top: 4px;
  color: var(--dim);
  font-size: 8px;
}

.aggregate-message.user .aggregate-message-content time {
  text-align: right;
}

.aggregate-message-images {
  display: grid;
  max-width: 440px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 6px;
}

.aggregate-message-images img,
.aggregate-generated-image {
  display: block;
  max-width: 100%;
  max-height: 420px;
  border: 1px solid var(--line);
  border-radius: 7px;
  object-fit: contain;
  background: var(--surface);
}

.aggregate-generated-image {
  margin: 8px 0;
}

.aggregate-composer {
  flex: 0 0 auto;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.aggregate-composer-row {
  width: min(780px, 100%);
  min-height: 46px;
  margin: 0 auto;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
}

.aggregate-composer-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 11%, transparent);
}

.aggregate-composer-row textarea {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  max-height: 150px;
  padding: 6px 4px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
  line-height: 20px;
}

.aggregate-upload {
  flex: 0 0 auto;
  border-color: transparent;
}

.aggregate-send {
  min-width: 72px;
  flex: 0 0 auto;
}

.aggregate-stream-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: aggregate-pulse 1s ease-in-out infinite alternate;
}

@keyframes aggregate-pulse {
  to { opacity: 0.35; }
}

.aggregate-attachments {
  display: flex;
  width: min(780px, 100%);
  gap: 8px;
  margin: 0 auto 8px;
  overflow-x: auto;
}

.aggregate-attachments[hidden] {
  display: none;
}

.aggregate-attachment {
  position: relative;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
}

.aggregate-attachment img {
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  object-fit: cover;
}

.aggregate-attachment button {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--danger);
  cursor: pointer;
}

.aggregate-attachment button .icon {
  width: 11px;
  height: 11px;
}

.aggregate-new-session-wide {
  min-height: 36px;
  justify-content: center;
  gap: 7px;
  margin: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.aggregate-new-session-wide:hover,
.aggregate-new-session-wide:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.aggregate-session-list {
  padding: 0 8px 12px;
}

.aggregate-session-item {
  min-height: 52px;
  gap: 3px;
  margin-bottom: 3px;
  padding: 3px;
  border-radius: 7px;
}

.aggregate-session-item:hover,
.aggregate-session-item.active {
  background: var(--surface-soft);
}

.aggregate-session-item.active {
  box-shadow: inset 2px 0 0 var(--accent);
}

.aggregate-session-open {
  min-width: 0;
  flex: 1;
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
  padding: 7px 6px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.aggregate-session-open strong,
.aggregate-session-open small {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aggregate-session-open strong {
  font-size: 10px;
}

.aggregate-session-open small {
  color: var(--muted);
  font-size: 8px;
}

.aggregate-session-delete {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 6px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  opacity: 0;
}

.aggregate-session-item:hover .aggregate-session-delete,
.aggregate-session-item:focus-within .aggregate-session-delete {
  opacity: 1;
}

.aggregate-session-delete:hover,
.aggregate-session-delete:focus-visible {
  background: var(--danger-soft);
  color: var(--danger);
  outline: none;
}

.aggregate-session-delete .icon {
  width: 13px;
  height: 13px;
}

.aggregate-panel-empty {
  padding: 28px 12px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
}

.aggregate-panel-empty.error {
  color: var(--danger);
}

.aggregate-workspace-backdrop {
  display: none;
}

.detail-grid,
.dashboard-metrics,
.reward-grid,
.profile-grid {
  display: grid;
  gap: 14px;
}

.dashboard-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.stat-card,
.content-block,
.reward-stat,
.profile-card,
.wallet-plan {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.stat-card {
  display: grid;
  min-height: 106px;
  align-content: space-between;
  padding: 14px;
}

.stat-card span,
.stat-card small,
.reward-stat span {
  color: var(--muted);
  font-size: 10px;
}

.stat-card strong,
.reward-stat strong {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 20px;
}

.content-block {
  overflow: hidden;
}

.block-header {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.block-header h2,
.block-header p {
  margin: 0;
}

.block-header h2 {
  font-size: 13px;
}

.block-header p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.table-scroll {
  width: 100%;
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.data-table th,
.data-table td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table td code {
  font-size: 10px;
}

.log-cost-formula {
  display: inline;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.empty-state,
.loading-state,
.error-state {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 28px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.error-state {
  color: var(--danger);
}

.key-list {
  display: grid;
}

.key-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(220px, 1.4fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 70px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.key-row:last-child {
  border-bottom: 0;
}

.key-name,
.key-value {
  min-width: 0;
}

.key-name strong,
.key-name small {
  display: block;
}

.key-name strong {
  font-size: 12px;
}

.key-name small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.key-value code {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-actions {
  justify-content: flex-end;
  gap: 5px;
}

.view-toolbar {
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.range-switcher,
.tab-switcher {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.range-switcher button,
.tab-switcher button {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.range-switcher button.active,
.tab-switcher button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(20, 29, 40, 0.08);
}

.pagination {
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

.pagination span {
  color: var(--muted);
  font-size: 10px;
}

.chart-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.chart-row {
  display: grid;
  grid-template-columns: minmax(90px, 160px) minmax(120px, 1fr) auto;
  align-items: center;
  gap: 12px;
  font-size: 10px;
}

.chart-row > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-track {
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--surface-strong);
}

.chart-fill {
  width: var(--bar, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.catalog-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.catalog-search {
  position: relative;
  display: flex;
  height: 38px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
}

.catalog-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.catalog-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
}

.catalog-filters {
  display: flex;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.catalog-filter {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.catalog-filter:hover,
.catalog-filter:focus-visible,
.catalog-filter.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
  outline: none;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.catalog-card {
  display: grid;
  min-width: 0;
  min-height: 216px;
  grid-template-rows: auto auto minmax(48px, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.catalog-card-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.catalog-vendor-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 7px;
  background: var(--surface-strong);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 800;
}

.catalog-card-head > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.catalog-card-head strong,
.catalog-card-head small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-card-head strong {
  font-size: 12px;
}

.catalog-card-head small {
  color: var(--muted);
  font-size: 9px;
}

.catalog-type {
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 9px;
  font-style: normal;
}

.catalog-model-name {
  overflow: hidden;
  margin: 0;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-summary {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.catalog-specs {
  display: grid;
  grid-template-columns: minmax(54px, 0.7fr) minmax(0, 1.6fr);
  gap: 8px;
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.catalog-specs > div {
  min-width: 0;
}

.catalog-specs dt,
.catalog-specs dd {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-specs dt {
  color: var(--muted);
  font-size: 8px;
}

.catalog-specs dd {
  margin-top: 3px;
  font-size: 9px;
}

.catalog-tooltip-trigger {
  cursor: help;
}

.catalog-tooltip-trigger:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

.catalog-floating-tooltip {
  position: fixed;
  z-index: 1000;
  max-width: min(440px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 8px 10px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.26);
  color: var(--text);
  font-size: 10px;
  line-height: 1.55;
  opacity: 0;
  overflow-wrap: anywhere;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  visibility: hidden;
  white-space: normal;
}

.catalog-floating-tooltip.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

.catalog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 10px;
}

.pricing-model-cell {
  display: grid;
  gap: 3px;
}

.pricing-model-cell small {
  color: var(--muted);
  font-size: 9px;
}

.price-value {
  display: block;
  max-width: 460px;
  color: var(--accent-ink);
  font-size: 10px;
  line-height: 1.45;
  white-space: normal;
}

.price-value-compact {
  display: grid;
  gap: 2px;
  font-size: 9px;
  line-height: 1.35;
}

.tiered-price-value {
  width: min(420px, 100%);
  max-width: none;
  gap: 4px;
  color: var(--text);
}

.tiered-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.tiered-price-row em {
  color: var(--muted);
  font-style: normal;
}

.tiered-price-row strong {
  color: var(--accent-ink);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.seedance-price-value {
  gap: 7px;
}

.seedance-price-group {
  display: grid;
  gap: 2px;
  padding: 2px 0 4px;
  border-bottom: 1px solid var(--border);
}

.seedance-price-group:last-of-type {
  border-bottom: 0;
}

.seedance-price-group > strong {
  color: var(--text);
  font-size: 10px;
  font-weight: 800;
}

.seedance-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.seedance-price-row em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}

.seedance-price-row b {
  color: var(--accent-ink);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.official-price-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 400;
  line-height: 1.45;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field-full {
  grid-column: 1 / -1;
}

.field > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  background: var(--surface);
  font-size: 12px;
}

.field textarea {
  min-height: 90px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.form-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.wallet-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 16px;
}

.wallet-balance {
  padding: 18px;
  background: var(--surface-soft);
}

.wallet-balance span,
.wallet-balance small {
  color: var(--muted);
  font-size: 11px;
}

.wallet-balance strong {
  display: block;
  margin: 10px 0 4px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 28px;
}

.wallet-plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  padding: 14px;
}

.wallet-plan {
  min-height: 72px;
  padding: 10px;
  cursor: pointer;
}

.wallet-plan:hover,
.wallet-plan:focus-visible,
.wallet-plan.selected {
  border-color: var(--accent);
  outline: none;
}

.wallet-plan strong,
.wallet-plan span {
  display: block;
}

.wallet-plan strong {
  font-size: 16px;
}

.wallet-plan span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.payment-box {
  padding: 14px;
}

.payment-box > h3 {
  margin: 0 0 10px;
  font-size: 12px;
}

.payment-methods {
  gap: 8px;
  margin-bottom: 14px;
}

.payment-method {
  display: flex;
  min-height: 38px;
  flex: 1;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  font-size: 11px;
  cursor: pointer;
}

.payment-method.selected {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.payment-box .button {
  width: 100%;
}

.reward-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}

.reward-stat {
  display: grid;
  min-height: 104px;
  align-content: space-between;
  padding: 15px;
}

.reward-copy-box {
  padding: 16px;
}

.reward-copy-box h2,
.reward-copy-box p {
  margin: 0;
}

.reward-copy-box h2 {
  font-size: 13px;
}

.reward-copy-box p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.reward-copy-row {
  gap: 8px;
  margin-top: 14px;
}

.reward-copy-row code {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reward-transfer {
  width: max-content;
  min-height: 30px;
  padding: 0 10px;
  font-size: 10px;
}

.reward-rule-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 10px;
}

.reward-rules ul {
  margin: 0;
  padding: 14px 18px 16px 28px;
  color: var(--text);
  font-size: 11px;
  line-height: 1.8;
}

.reward-detail-block {
  margin-top: 16px;
}

.invite-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px auto auto;
  gap: 8px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.invite-search {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 0 10px;
}

.invite-search .icon {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.invite-search input,
.invite-toolbar select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 11px;
}

.invite-toolbar select {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: var(--surface);
}

.invite-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 14px 0;
}

.invite-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 0 10px;
  font-size: 11px;
  cursor: pointer;
}

.invite-tabs button.active {
  border-color: var(--accent);
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.invite-table td strong,
.invite-table td small {
  display: block;
}

.invite-table td small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.reward-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 0 8px;
  font-size: 10px;
}

.reward-status.success {
  background: rgba(20, 184, 166, 0.12);
  color: #0f766e;
}

.profile-shell {
  display: grid;
  gap: 14px;
}

.profile-grid {
  grid-template-columns: minmax(420px, 0.9fr) minmax(0, 1.1fr);
}

.profile-card {
  overflow: hidden;
}

.profile-hero {
  display: flex;
  min-height: 118px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, var(--surface)) 0%, var(--surface) 52%),
    radial-gradient(circle at 92% 18%, color-mix(in srgb, var(--brand-cyan) 18%, transparent), transparent 34%);
}

.profile-identity,
.profile-quick-actions {
  display: flex;
  align-items: center;
}

.profile-identity {
  min-width: 0;
  gap: 16px;
}

.profile-summary {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 18px;
}

.account-flow-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-color: color-mix(in srgb, var(--accent) 18%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 7%, var(--surface)) 0%, var(--surface) 62%),
    radial-gradient(circle at 96% 0%, color-mix(in srgb, var(--brand-cyan) 14%, transparent), transparent 32%);
}

.account-step-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.account-step-list li {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 126px;
  align-content: start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 88%, var(--surface-soft));
}

.account-step-index {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}

.account-step-list strong,
.account-step-list small,
.account-step-list b {
  display: block;
}

.account-step-list strong {
  font-size: 13px;
}

.account-step-list small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.account-step-list .account-step-state {
  display: flex;
  width: 100%;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  padding: 0 10px;
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
}

.account-step-list button.account-step-state {
  cursor: pointer;
}

.account-step-list button.account-step-state:hover,
.account-step-list button.account-step-state:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.profile-avatar {
  display: grid;
  width: 76px;
  height: 76px;
  min-width: 76px;
  flex: 0 0 76px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  border-radius: 18px;
  background:
    linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--brand-pink) 80%, var(--accent)));
  color: #ffffff;
  font-size: 28px;
  font-weight: 850;
  box-shadow: 0 16px 36px color-mix(in srgb, var(--accent) 20%, transparent);
}

.top-avatar.has-avatar-image,
.sidebar-avatar.has-avatar-image,
.profile-avatar.has-avatar-image {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.top-avatar.has-avatar-image {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.profile-title {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.profile-title strong {
  overflow: hidden;
  font-size: 22px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-title small {
  color: var(--muted);
  font-size: 12px;
}

.profile-quick-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.profile-summary-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-summary-head > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.profile-summary-head .icon {
  width: 17px;
  height: 17px;
}

.profile-summary h2,
.profile-summary p {
  margin: 0;
}

.profile-summary h2 {
  font-size: 15px;
}

.profile-summary p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.profile-stats {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  text-align: left;
}

.profile-stat {
  min-width: 0;
  padding: 0 14px;
  border-left: 1px solid var(--line);
}

.profile-stat:first-child {
  padding-left: 0;
  border-left: 0;
}

.profile-stat:last-child {
  padding-right: 0;
}

.profile-stat span,
.profile-stat small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.profile-stat strong {
  display: block;
  margin: 7px 0 3px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 20px;
  white-space: nowrap;
}

.profile-meter {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.profile-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--brand-cyan));
}

.settings-card {
  padding: 0;
}

.settings-card .block-header {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.settings-card .profile-lines {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 10px 18px;
}

.settings-card .profile-line {
  min-height: 74px;
  padding: 14px 16px;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.settings-card .profile-line:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.settings-card .profile-line:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.profile-line > span:first-child {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.profile-line > span:first-child > .icon {
  width: 18px;
  height: 18px;
  min-width: 18px;
  color: var(--accent-ink);
}

.profile-line > span:first-child > span {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.profile-line strong {
  font-size: 12px;
}

.profile-line small {
  color: var(--muted);
  font-size: 10px;
}

.binding-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.1);
  color: var(--mint);
  padding: 0 9px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.binding-state.warning {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

.profile-line-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(16, 20, 25, 0.52);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  position: relative;
  width: min(520px, 100%);
  max-height: min(760px, calc(100vh - 32px));
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal.modal-wide {
  width: min(760px, 100%);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
}

.modal h2 {
  padding-right: 36px;
  font-size: 17px;
}

.modal > div > p,
.modal-title-row p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.modal-form {
  margin-top: 18px;
}

.service-modal {
  display: grid;
  justify-items: center;
  text-align: center;
}

.service-modal img {
  width: min(220px, 72vw);
  aspect-ratio: 1;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
}

.qr-modal {
  display: grid;
  justify-items: center;
  text-align: center;
}

.qr-amount {
  margin: 16px 0 12px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 28px;
  font-weight: 800;
}

.qr-canvas {
  display: grid;
  width: 224px;
  height: 224px;
  place-items: center;
  padding: 2px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.qr-status {
  margin-top: 12px !important;
}

.toast-region {
  position: fixed;
  top: calc(var(--topbar-height) + 12px);
  right: 16px;
  z-index: 150;
  display: grid;
  width: min(340px, calc(100vw - 32px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--mint);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 11px;
  animation: toast-in 0.18s ease both;
}

.toast.error {
  border-left-color: var(--danger);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1260px) {
  .aggregate-workspace {
    grid-template-columns: minmax(215px, 232px) minmax(0, 1fr);
  }

  .aggregate-sessions {
    position: absolute;
    inset: 0 0 0 auto;
    z-index: 6;
    width: min(280px, 78%);
    border-left: 1px solid var(--line);
    box-shadow: var(--shadow);
    transform: translateX(105%);
    transition: transform 0.2s ease;
  }

  .aggregate-workspace.sessions-open .aggregate-sessions {
    transform: translateX(0);
  }

  .aggregate-history-toggle {
    display: inline-flex;
  }

  .aggregate-sessions .aggregate-panel-close {
    display: inline-grid;
  }

  .aggregate-workspace.sessions-open .aggregate-workspace-backdrop {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: block;
    background: rgba(16, 20, 25, 0.36);
    cursor: pointer;
  }
}

@media (max-width: 1050px) {
  .top-links {
    gap: 16px;
  }

  .command-search {
    width: 210px;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .usage-overview-panel,
  .api-info-panel,
  .notice-panel,
  .faq-panel,
  .uptime-panel {
    grid-column: 1;
  }

  .wallet-layout,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  :root {
    --topbar-height: 52px;
  }

  body {
    overflow: auto;
  }

  .topbar {
    position: sticky;
    top: 0;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .topbar-brand-group {
    padding-left: 8px;
  }

  .sidebar-toggle {
    display: inline-grid;
  }

  .top-links {
    display: none;
  }

  .topbar-tools {
    padding-right: 8px;
  }

  .command-search {
    width: 38px;
    padding: 0;
    justify-content: center;
    border-color: transparent;
    background: transparent;
  }

  .command-search input,
  .command-search kbd {
    display: none;
  }

  .command-search.mobile-active {
    position: fixed;
    top: 8px;
    right: 8px;
    left: 8px;
    z-index: 60;
    width: auto;
    padding: 0 10px;
    justify-content: flex-start;
    border-color: var(--accent);
    background: var(--surface);
  }

  .command-search.mobile-active input {
    display: block;
  }

  .command-search.mobile-active .search-results {
    display: block;
  }

  .dashboard-shell {
    display: block;
    height: auto;
  }

  .dash-sidebar {
    position: fixed;
    inset: var(--topbar-height) auto 0 0;
    z-index: 45;
    width: min(82vw, 280px);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow);
  }

  body.sidebar-open .dash-sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: var(--topbar-height) 0 0;
    z-index: 44;
    display: block;
    width: 100%;
    height: calc(100vh - var(--topbar-height));
    background: rgba(16, 20, 25, 0.45);
  }

  .sidebar-backdrop[hidden] {
    display: none;
  }

  .dashboard-main {
    overflow: visible;
    padding: 0;
  }

  .console-surface,
  .detail-view {
    min-height: calc(100vh - var(--topbar-height));
    padding: 16px 10px 72px;
    border: 0;
    border-radius: 0;
  }

  .aggregate-detail-mode {
    height: calc(100vh - var(--topbar-height));
    min-height: 0;
    padding-bottom: 8px;
  }

  .aggregate-detail-mode .detail-page-header {
    min-height: 48px;
    margin-bottom: 10px;
  }

  .aggregate-detail-mode .detail-page-header p,
  .aggregate-detail-mode .detail-actions span {
    display: none;
  }

  .aggregate-workspace {
    grid-template-columns: minmax(0, 1fr);
    border-radius: 7px;
  }

  .aggregate-browser {
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 6;
    width: min(290px, 86%);
    border-right: 1px solid var(--line);
    box-shadow: var(--shadow);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }

  .aggregate-workspace.models-open .aggregate-browser {
    transform: translateX(0);
  }

  .aggregate-models-toggle,
  .aggregate-browser .aggregate-panel-close {
    display: inline-grid;
  }

  .aggregate-workspace.models-open .aggregate-workspace-backdrop,
  .aggregate-workspace.sessions-open .aggregate-workspace-backdrop {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: block;
    background: rgba(16, 20, 25, 0.36);
  }

  .aggregate-chat-head {
    padding: 0 12px;
  }

  .aggregate-messages {
    padding-right: max(14px, 4%);
    padding-left: max(14px, 4%);
  }

  .setup-layout,
  .usage-overview-panel {
    grid-template-columns: 1fr;
  }

  .profile-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-quick-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .profile-stats {
    grid-template-columns: 1fr;
  }

  .account-step-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .balance-summary {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

}

@media (max-width: 580px) {
  .brand {
    gap: 6px;
  }

  .brand-name {
    display: block;
    max-width: 64px;
    font-size: 15px;
  }

  .page-header {
    align-items: flex-start;
  }

  .refresh-overview span {
    display: none;
  }

  .overview-grid {
    gap: 10px;
  }

  .profile-hero,
  .profile-summary {
    padding: 14px;
  }

  .profile-identity {
    align-items: flex-start;
  }

  .account-step-list {
    grid-template-columns: 1fr;
  }

  .settings-card .profile-lines {
    grid-template-columns: 1fr;
    padding: 4px 14px;
  }

  .settings-card .profile-line {
    padding: 14px 0;
  }

  .settings-card .profile-line:nth-child(odd) {
    border-right: 0;
  }

  .settings-card .profile-line:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .settings-card .profile-line:last-child {
    border-bottom: 0;
  }

  .profile-avatar {
    width: 58px;
    height: 58px;
    min-width: 58px;
    flex-basis: 58px;
    border-radius: 14px;
    font-size: 22px;
  }

  .profile-title strong {
    font-size: 18px;
  }

  .profile-quick-actions .button {
    flex: 1 1 auto;
  }

  .setup-panel,
  .recommended-panel,
  .api-info-panel,
  .notice-panel,
  .faq-panel,
  .uptime-panel,
  .usage-summary-main,
  .balance-summary {
    padding: 14px;
  }

  .setup-layout {
    gap: 10px;
  }

  .request-preview pre {
    min-height: 112px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .metric {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric:last-child {
    border-bottom: 0;
  }

  .dashboard-metrics,
  .reward-grid {
    grid-template-columns: 1fr;
  }

  .invite-toolbar {
    grid-template-columns: 1fr;
  }

  .invite-tabs {
    overflow-x: auto;
  }

  .key-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .key-value {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .key-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .wallet-plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-toolbar {
    grid-template-columns: 1fr;
  }

  .catalog-grid {
    grid-template-columns: 1fr;
  }

  .aggregate-chat-head {
    min-height: 58px;
    gap: 7px;
    padding: 0 8px;
  }

  .aggregate-active-model {
    gap: 7px;
  }

  .aggregate-active-model .aggregate-model-mark {
    width: 28px;
    height: 28px;
  }

  .aggregate-active-model strong {
    max-width: 32vw;
    font-size: 11px;
  }

  .aggregate-active-model small {
    display: none;
  }

  .aggregate-chat-actions {
    gap: 4px;
  }

  .aggregate-chat-actions .button {
    width: 34px;
    min-width: 34px;
    padding: 0;
  }

  .aggregate-chat-actions .button span {
    display: none;
  }

  .aggregate-messages {
    padding: 14px 10px;
  }

  .aggregate-starters {
    grid-template-columns: 1fr;
    margin-top: 14px;
  }

  .aggregate-message {
    gap: 7px;
    margin-bottom: 14px;
  }

  .aggregate-message-content {
    max-width: calc(100% - 38px);
  }

  .aggregate-message-body {
    padding: 8px 10px;
    font-size: 11px;
  }

  .aggregate-composer {
    padding: 8px;
  }

  .aggregate-composer-row {
    gap: 4px;
  }

  .aggregate-composer-row textarea {
    font-size: 16px;
    line-height: 22px;
  }

  .aggregate-send {
    width: 36px;
    min-width: 36px;
    padding: 0;
  }

  .aggregate-send span {
    display: none;
  }

  .aggregate-session-delete {
    opacity: 1;
  }

  .pricing-table-block .table-scroll {
    overflow: visible;
  }

  .pricing-table-block .data-table,
  .pricing-table-block .data-table tbody,
  .pricing-table-block .data-table tr,
  .pricing-table-block .data-table td {
    display: block;
    width: 100%;
  }

  .pricing-table-block .data-table thead {
    display: none;
  }

  .pricing-table-block .data-table tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
  }

  .pricing-table-block .data-table tr:last-child {
    border-bottom: 0;
  }

  .pricing-table-block .data-table td {
    min-width: 0;
    padding: 0;
    border: 0;
    white-space: normal;
  }

  .pricing-table-block .data-table td::before {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    content: attr(data-label);
    font-size: 8px;
  }

  .pricing-table-block .data-table td:nth-child(2),
  .pricing-table-block .data-table td:nth-child(5) {
    grid-column: 1 / -1;
  }

  .pricing-table-block .data-table td:nth-child(2) {
    grid-row: 1;
  }

  .price-value {
    display: block;
    max-width: none;
    overflow: visible;
    line-height: 1.55;
    text-overflow: clip;
    white-space: normal;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .field-full,
  .form-actions {
    grid-column: 1;
  }

  .chart-row {
    grid-template-columns: minmax(80px, 110px) minmax(90px, 1fr);
  }

  .chart-row > b {
    grid-column: 2;
    font-size: 9px;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@supports (height: 100dvh) {
  .dashboard-shell {
    height: calc(100dvh - var(--topbar-height));
  }

  @media (max-width: 820px) {
    .sidebar-backdrop,
    .dash-sidebar {
      height: calc(100dvh - var(--topbar-height));
    }

    .console-surface,
    .detail-view {
      min-height: calc(100dvh - var(--topbar-height));
    }

    .aggregate-detail-mode {
      height: calc(100dvh - var(--topbar-height));
    }
  }
}

/* Keep brand marks transparent everywhere. */
.brand-logo,
.aggregate-brand-logo {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
