:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #f1efea;
  --border: #e3e0d8;
  --text: #1f1e1c;
  --muted: #6b6860;
  --accent: #c96442;
  --accent-text: #ffffff;
  --accent-soft: #f7e6de;
  --ok: #1f7a4d;
  --ok-soft: #dcf1e5;
  --warn: #9a6200;
  --warn-soft: #fbedd0;
  --danger: #b4321f;
  --danger-soft: #f9dfda;
  --info: #2a5fa8;
  --info-soft: #dfe9f8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .04);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}
[hidden] { display: none !important; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.3; }
h1 { font-size: 18px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0; }
.boot { padding: 48px 16px; text-align: center; color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }

/* 布局 */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 24px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 26px; height: 26px; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav button {
  border: 0; background: none; color: var(--muted); cursor: pointer;
  padding: 7px 12px; border-radius: 8px; font: inherit; white-space: nowrap;
}
.nav button:hover { background: var(--surface-2); color: var(--text); }
.nav button[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.account { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.account .who { color: var(--muted); }
main { max-width: 1120px; margin: 0 auto; padding: 24px; }
.view { display: grid; gap: 16px; }
.onboard-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }

.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head .hint { margin-top: 2px; }

/* 表单 */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > label { font-weight: 600; font-size: 13px; }
.hint { color: var(--muted); font-size: 12.5px; }
input, textarea, select {
  width: 100%; min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible, a.btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 1px;
}
input[readonly] { background: var(--surface-2); }
input:disabled, textarea:disabled, select:disabled { opacity: .6; }
.input-group { display: flex; }
.input-group > * { border-radius: 0; }
.input-group > :first-child { border-radius: 8px 0 0 8px; }
.input-group > :last-child { border-radius: 0 8px 8px 0; }
.input-group > :not(:first-child) { margin-left: -1px; }
.addon {
  display: flex; align-items: center; padding: 0 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--muted); font-family: var(--mono); font-size: 12.5px; white-space: nowrap;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.check input { width: auto; margin-top: 3px; }
details.advanced { margin-bottom: 14px; }
details.advanced summary { cursor: pointer; color: var(--muted); margin-bottom: 10px; }
.form-error { color: var(--danger); font-size: 13px; min-height: 0; }
.form-error:empty { display: none; }

fieldset.step { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.step + fieldset.step { margin-top: 22px; padding-top: 20px; border-top: 1px dashed var(--border); }
fieldset.step:disabled .step-body { opacity: .5; }
.step-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.step-num {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: var(--accent-text); font-size: 12px; font-weight: 700;
}
fieldset.step:disabled .step-num { background: var(--border); color: var(--muted); }
.linkbox { display: grid; gap: 6px; margin-top: 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text);
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, black); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12.5px; }
.btn-link { border: 0; background: none; color: var(--muted); padding: 4px 6px; }
.btn-link:hover { color: var(--text); background: none; }

.stack { display: grid; gap: 16px; min-width: 0; }
.project-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.project {
  display: grid; gap: 2px; text-align: left; cursor: pointer;
  padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; box-shadow: var(--shadow);
}
.project span { color: var(--muted); font-size: 12.5px; }
.project:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.project[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.project[aria-checked="true"] strong { color: var(--accent); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 14px; margin-top: 8px; }
.checks .check { font-size: 13px; align-items: center; }
.checks .check input { margin-top: 0; }
ul.plain { margin: 0; padding-left: 18px; display: grid; gap: 2px; }
.upstream { display: grid; gap: 6px; margin-top: 6px; }

.segmented { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: 9px; gap: 2px; margin-bottom: 20px; }
.segmented button {
  border: 0; background: none; padding: 6px 14px; border-radius: 7px;
  color: var(--muted); font: inherit; cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.key-format { margin-bottom: 0; width: fit-content; max-width: 100%; flex-wrap: wrap; }
.field-label, .json-field-head label { font-weight: 600; font-size: 13px; }
.json-field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.json-upload { border-radius: 8px; min-width: 0; }
.json-upload.dragging { outline: 2px dashed var(--accent); outline-offset: 6px; }
.json-upload [role=status]:empty { display: none; }
.json-upload [role=status], .json-upload [role=alert] { overflow-wrap: anywhere; }

/* 提示 */
.alert { border-radius: 8px; padding: 12px 14px; display: grid; gap: 8px; margin-top: 14px; }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.danger-text { color: var(--danger); font-weight: 600; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-muted { background: var(--surface-2); color: var(--muted); }
.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px;
  border: 1px solid var(--border); border-radius: 999px; font-size: 12px; margin: 0 4px 4px 0;
}
.tag i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.rules { display: grid; gap: 12px; }
.rules dt { color: var(--muted); font-size: 12.5px; }
.rules dd { margin: 2px 0 0; }

/* 表格 */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td .sub { color: var(--muted); font-size: 12px; margin-top: 2px; word-break: break-all; }
td.nowrap { white-space: nowrap; }
.empty { color: var(--muted); padding: 24px 0; text-align: center; }
.user-pricing-summary {
  display: flex; align-items: baseline; gap: 8px 12px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 16px;
  border-radius: 8px; background: var(--surface-2);
}
.user-pricing-summary strong, .user-price { font-variant-numeric: tabular-nums; }
.users-table td { min-width: 58px; }
.earnings-totals {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px;
  margin-top: 16px;
}
.earnings-metric {
  display: grid; align-content: start; gap: 6px;
  padding: 14px; border-radius: 8px; background: var(--surface-2); min-width: 0;
}
.earnings-metric strong { font-size: 22px; line-height: 1.3; overflow-wrap: anywhere; }
.earnings-profit { background: var(--accent-soft); }
.earnings-metric strong, .earnings-money { font-variant-numeric: tabular-nums; }
.earnings-footnote { margin-top: 12px; }
.earnings-view .alert { overflow-wrap: anywhere; }
.pool-selection-hint { margin: -4px 0 16px; }
.pool-unavailable { color: var(--warn); }
.pool-management-note { margin-bottom: 16px; }
.pool-base-url { min-width: 160px; max-width: 300px; overflow-wrap: anywhere; }
.pools-table { min-width: 980px; }
.pools-table td:nth-child(1) { min-width: 100px; }
.pools-table td:nth-child(2) { min-width: 125px; }
.pools-table td:nth-child(4) { min-width: 145px; }
.pools-table td:nth-child(5) { white-space: nowrap; }
.pool-test-result { min-width: 130px; max-width: 260px; }
.pool-auth-actions { display: grid; justify-items: start; gap: 8px; }
.pool-sync-result { min-width: 140px; max-width: 230px; }
.records-pagination {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-top: 16px;
}
.pools-table .actions { min-width: 110px; }

/* 登录 */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); }
.login-card .brand { margin-bottom: 20px; }
.login-card .btn { width: 100%; margin-top: 4px; }

/* 对话框 */
dialog.modal {
  border: 1px solid var(--border); border-radius: 12px; padding: 0;
  background: var(--surface); color: var(--text);
  width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
}
dialog.modal::backdrop { background: rgba(0, 0, 0, .45); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 18px 20px; display: grid; gap: 12px; }
.modal-body .field { margin-bottom: 0; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 100; }
.toast {
  padding: 10px 14px; border-radius: 8px; background: var(--text); color: var(--bg);
  box-shadow: 0 6px 20px rgba(0,0,0,.18); max-width: min(360px, calc(100vw - 32px));
}
.toast-error { background: var(--danger); color: #fff; }

.spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 860px) {
  .onboard-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; padding: 10px 16px; gap: 8px; }
  .nav { order: 3; flex-basis: 100%; }
  .account .who { display: none; }
  main { padding: 16px; }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* 官方 Key：渠道卡片 */
.crumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.crumb { border: 0; background: none; padding: 0; font: inherit; color: var(--muted); }
button.crumb { cursor: pointer; }
button.crumb:hover { color: var(--text); }
.crumb.active { color: var(--text); font-weight: 600; }
.crumb-sep { color: var(--muted); }
.step-question { color: var(--muted); margin-bottom: 12px; }
.channel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.channel {
  display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
  padding: 14px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit;
}
.channel:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.channel-icon {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  color: #fff; font-weight: 700; font-size: 14px; letter-spacing: .02em;
}
.channel-text { display: grid; gap: 2px; min-width: 0; }
.channel-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-text span { color: var(--muted); font-size: 12.5px; }

.provider-usage-card { margin: 10px 0; padding: 14px; border: 1px solid var(--border, #e5e1dc); border-radius: 12px; background: #faf9f7; min-width: 290px; max-width: 520px; }
.usage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 20px; margin: 12px 0; }
.usage-grid > div { display: flex; justify-content: space-between; gap: 12px; }
.usage-window { display: flex; align-items: center; gap: 9px; margin-top: 10px; flex-wrap: wrap; }
.usage-window progress { width: 110px; height: 8px; accent-color: #cc6946; }

.account-record-list { display: grid; gap: 16px; margin-top: 18px; }
.account-record { border: 1px solid var(--border, #e5e1dc); border-radius: 12px; overflow: hidden; background: #fff; }
.account-record-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 26px; padding: 10px 18px; background: #f7f5f2; color: #827b73; font-size: 12px; border-bottom: 1px solid #eee9e3; }
.account-record-meta strong { color: #49433d; font-weight: 500; margin-left: 5px; }
.account-record-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 18px 4px; }
.account-record-name { display: flex; align-items: center; gap: 14px; overflow-wrap: anywhere; }
.account-record-name > strong { font-size: 16px; }
.account-record-body { padding: 8px 18px 16px; display: grid; gap: 5px; overflow-wrap: anywhere; font-size: 13px; }
.account-record .provider-usage-card { max-width: none; min-width: 0; margin: 8px 0; padding: 16px; display: grid; grid-template-columns: minmax(190px, 1fr) minmax(300px, 2fr); gap: 8px 28px; background: #faf9f7; }
.account-record .provider-usage-card > strong { grid-column: 1; }
.account-record .usage-window { grid-column: 1; margin: 0; font-size: 12px; }
.account-record .usage-grid { grid-column: 2; grid-row: 1 / span 4; margin: 0; align-content: center; gap: 12px 26px; }
.account-record .provider-usage-card > .hint { grid-column: 1 / -1; font-size: 11px; padding-top: 6px; }
@media (max-width: 760px) {
 .account-record .provider-usage-card { display: flex; flex-direction: column; gap: 12px; }
 .account-record-meta { gap: 7px 16px; padding: 10px 12px; }
 .account-record-heading { padding: 12px 12px 4px; }
 .account-record-body { padding: 8px 12px 12px; }
 .account-record .usage-grid { gap: 10px 16px; }
}

.records-search { display: flex; align-items: center; gap: 8px; margin: 16px 0; }
.records-search input { flex: 1; min-width: 0; max-width: 520px; }
@media (max-width: 540px) { .records-search { flex-wrap: wrap; } .records-search input { flex-basis: 100%; max-width: none; } }

.records-overview { padding: 14px 16px; background: #f7f5f2; border-radius: 10px; margin: 12px 0; display: grid; gap: 10px; }
.overview-heading { font-weight: 600; font-size: 13px; }
.overview-counts { display: flex; flex-wrap: wrap; gap: 10px; }
.account-record .usage-grid > div { align-items: baseline; }
.account-record .usage-grid strong { text-align: right; }
.account-record-name { flex-wrap: wrap; }

.records-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0; }
.records-filters select { width: auto; max-width: 100%; }
.record-select-all { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.records-filters input[type=checkbox], .account-record-meta input[type=checkbox] { width: 16px; height: 16px; margin: 0; accent-color: #cc6946; }

.account-record .compact-points-card { padding: 12px 14px; gap: 7px 24px; grid-template-columns: minmax(180px, 1fr) minmax(280px, 2fr); }
.account-record .compact-points-card .usage-grid { gap: 8px 24px; grid-row: 1 / span 3; }
.account-record .compact-points-card .usage-grid strong { font-size: 13px; }
.account-record .compact-points-card > .hint { padding-top: 3px; }
.account-record-heading { padding-top: 11px; }
.account-record-body { padding-top: 5px; padding-bottom: 11px; gap: 4px; }
@media (max-width: 760px) {
 .account-record .compact-points-card { gap: 9px; }
 .account-record .compact-points-card .usage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

select.target-pool-select {
 appearance: none; -webkit-appearance: none; width: 100%; min-height: 52px;
 padding: 13px 46px 13px 16px; border: 1px solid #ded7cf; border-radius: 12px;
 background-color: #fcfbf9; color: #39332d; font-size: 14px; font-weight: 500;
 background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23938578' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
 background-repeat: no-repeat; background-position: right 16px center;
 box-shadow: 0 2px 5px #49332105; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
select.target-pool-select:hover { border-color: #c8a995; background-color: #fffdfa; }
select.target-pool-select:focus { border-color: #cf7956; outline: none; box-shadow: 0 0 0 3px #cf795614; }
select.target-pool-select option { background: #fffdfa; color: #39332d; font-weight: 400; }

/* White / blue workspace */
:root {
 color-scheme: light;
 --bg: #f5f7fb; --surface: #fff; --surface-2: #f0f4fa;
 --border: #e5eaf2; --text: #202c40; --muted: #7b879a;
 --accent: #246bfa; --accent-text: #fff; --accent-soft: #edf3ff;
 --ok: #168462; --ok-soft: #e8f7f0; --warn: #af7715; --warn-soft: #fff6e3;
 --danger: #d14f61; --danger-soft: #fff0f2; --info: #3476da; --info-soft: #edf4ff;
 --radius: 18px; --shadow: 0 4px 24px rgba(38,66,110,.035);
}
body { font-size: 14px; letter-spacing: .1px; }
h2 { font-size: 20px; font-weight: 650; letter-spacing: -.4px; }
.app-shell { min-height: 100vh; }
.app-shell .topbar {
 position: fixed; inset: 0 auto 0 0; width: 220px; height: 100vh;
 display: flex; flex-direction: column; align-items: stretch; gap: 30px;
 padding: 30px 18px 20px; background: #fff; border: 0; border-right: 1px solid var(--border);
 backdrop-filter: none;
}
.brand { gap: 12px; padding: 0 8px 16px; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: var(--accent); color: white; font-size: 26px; font-weight: 500; box-shadow: 0 5px 12px #246bfa25; }
.brand h1 { font-size: 19px; letter-spacing: 1px; }
.brand-subtitle { font-size: 8px; letter-spacing: 1.5px; color: #98a4b8; }
.app-shell .nav { flex-direction: column; gap: 8px; overflow: visible; justify-content: flex-start; }
.app-shell .nav button { text-align: left; padding: 13px 16px; border-radius: 12px; color: #7b879a; font-weight: 500; transition: background .15s; }
.app-shell .nav button[aria-current=page] { color: var(--accent); background: var(--accent-soft); }
.app-shell .account { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid var(--border); flex-wrap: wrap; white-space: normal; }
.app-shell .account .who { width: 100%; font-size: 12px; color: #52617a; overflow-wrap: anywhere; margin-bottom: 5px; }
.app-shell main { margin: 0 0 0 220px; padding: 34px 32px; max-width: 1640px; }
.card { border-color: #e9edf5; padding: 26px; box-shadow: var(--shadow); }
.card-head { margin-bottom: 22px; }
.card-head .hint { margin-top: 7px; }
.onboard-layout { gap: 22px; grid-template-columns: minmax(0, 1fr) 280px; }
input, textarea, select { background-color: #fbfcfe; border-color: #e2e8f1; border-radius: 11px; padding: 11px 13px; }
input:focus, textarea:focus, select:focus { border-color: #7aa6ff; outline: none; box-shadow: 0 0 0 3px #246bfa0c; }
.btn { border-radius: 10px; border-color: #e3e9f2; padding: 9px 15px; box-shadow: none; }
.btn-primary { background: var(--accent); color: white; border-color: var(--accent); box-shadow: 0 3px 8px #246bfa18; }
.btn-primary:hover { background: #175de7; }
.btn-link { color: var(--accent); background: transparent; border-color: transparent; }
.project { border-radius: 14px; box-shadow: none; padding: 17px; }
.project[aria-checked=true] { background: #f3f7ff; border-color: #8ab0ff; }
.segmented { padding: 4px; border-radius: 11px; background: #f0f3f8; }
.segmented button { padding: 8px 18px; border-radius: 8px; }
.segmented button[aria-pressed=true] { color: var(--accent); }
select.target-pool-select { background-color: #f8faff; border-color: #dce6fa; color: #2b456c; border-radius: 12px; box-shadow: none; }
select.target-pool-select:hover { background-color: #f3f7ff; border-color: #99bafa; }
select.target-pool-select:focus { border-color: #7aa6ff; box-shadow: 0 0 0 3px #246bfa0c; }
select.target-pool-select option { background: white; color: var(--text); }
.records-search { margin: 20px 0 12px; }
.records-search input { max-width: 620px; background: #f7f9fc; }
.records-filters { gap: 10px; padding-bottom: 8px; }
.records-overview { background: #f7faff; border: 1px solid #e7effc; border-radius: 14px; padding: 16px 18px; gap: 12px; }
.overview-counts { gap: 8px; }
.overview-counts .badge { border-radius: 8px; padding: 6px 10px; }
.badge { font-size: 11px; padding: 3px 9px; font-weight: 550; }
.account-record-list { gap: 14px; }
.account-record { border: 1px solid #e5ebf4; border-radius: 15px; box-shadow: 0 2px 6px #24477303; }
.account-record-meta { background: #f9fbfe; border-bottom-color: #edf1f7; color: #8b97aa; padding: 10px 18px; gap: 8px 23px; font-size: 11px; }
.account-record-meta strong { color: #5f7089; }
.account-record-heading { padding: 14px 18px 4px; }
.account-record-name > strong { font-size: 15px; letter-spacing: -.15px; }
.account-record-body { padding: 6px 18px 14px; gap: 5px; }
.account-record-body > .sub { color: #8a96a8; font-size: 11px; }
.account-record .compact-points-card { background: #f8faff; border: 1px solid #edf2fc; border-radius: 12px; padding: 13px 15px; gap: 8px 24px; margin: 7px 0 0; }
.account-record .compact-points-card .usage-grid strong { color: #29466d; font-variant-numeric: tabular-nums; }
.account-record .compact-points-card .usage-grid .hint { font-size: 12px; }
.account-record .compact-points-card > .hint { color: #99a5b6; font-size: 10px; }
.usage-window progress { accent-color: #4286ff; }
.usage-window progress::-webkit-progress-bar { background: #e5ebf5; border-radius: 6px; }
.usage-window progress::-webkit-progress-value { background: #4286ff; border-radius: 6px; }
.records-filters input[type=checkbox], .account-record-meta input[type=checkbox] { accent-color: var(--accent); }
.records-pagination { padding-top: 18px; }
@media (min-width: 1500px) { .app-shell main { padding: 40px 48px; } }
@media (max-width: 1100px) {
 .app-shell .topbar { width: 184px; padding: 25px 12px 18px; }
 .app-shell main { margin-left: 184px; padding: 24px 20px; }
 .onboard-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
 .app-shell .topbar { position: sticky; inset: auto; top: 0; width: 100%; height: auto; padding: 12px 16px; gap: 12px; border-right: none; border-bottom: 1px solid var(--border); }
 .brand { padding: 0; }
 .brand-mark { width: 32px; height: 32px; font-size: 22px; border-radius: 10px; }
 .brand h1 { font-size: 16px; }
 .app-shell .nav { flex-direction: row; gap: 5px; overflow-x: auto; }
 .app-shell .nav button { padding: 8px 12px; font-size: 12px; }
 .app-shell .account { position: absolute; top: 12px; right: 12px; margin: 0; padding: 0; border: 0; }
 .app-shell .account .who { display: none; }
 .app-shell .account .btn { padding: 5px 8px; font-size: 11px; }
 .app-shell main { margin: 0; padding: 18px 12px; }
 .card { padding: 18px 14px; border-radius: 15px; }
 h2 { font-size: 18px; }
 .account-record .compact-points-card { display: flex; gap: 10px; }
}

.pool-rpm-panel { background: #f3f7ff; border: 1px solid #e1ebff; border-radius: 14px; padding: 18px; margin-bottom: 24px; display: grid; gap: 12px; }
.rpm-total { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.rpm-total > strong { font-size: 30px; font-weight: 650; color: #246bfa; font-variant-numeric: tabular-nums; }
.rpm-pools { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.rpm-pools > div { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.rpm-pools .hint { font-size: 10px; }

.points-summary { display: flex; flex-wrap: wrap; gap: 20px 48px; padding: 20px; border-radius: 14px; background: #f4f8ff; margin: 18px 0; }
.points-summary > div { display: grid; gap: 6px; }
.points-summary strong { font-size: 28px; color: #246bfa; }
.points-summary > p { width: 100%; }

/* Panda graphite workspace */
:root {
 color-scheme: dark;
 --bg: #080b10; --surface: #10151d; --surface-2: #1a212c; --border: #242d39;
 --text: #e8edf5; --muted: #8693a5; --accent: #38a8f5; --accent-text: #07111b;
 --accent-soft: #102d43; --ok: #6bc9b2; --ok-soft: #132e2c;
 --warn: #ebbd61; --warn-soft: #30291a; --danger: #fb7c99; --danger-soft: #351d29;
 --info: #63b6ef; --info-soft: #142a3e; --shadow: 0 4px 24px #00000018;
}
.app-shell .topbar { background: #0c1118; border-color: #202733; }
.brand-subtitle { color: #68778b; }
.brand img.panda-mark { width: 40px; height: 40px; border-radius: 13px; box-shadow: none; background: none; }
.app-shell .nav button { color: #8f9caf; }
.app-shell .nav button[aria-current=page] { background: #1b2634; color: #80ceff; }
.app-shell .account .who { color: #a4b1c3; }
.card { border-color: #202936; }
input, textarea, select, .records-search input { background-color: #0d121a; border-color: #293342; color: var(--text); }
.btn { background: #171f2b; border-color: #2a3545; color: #c3d0e1; }
.btn-primary { background: #2696e5; border-color: #2696e5; color: #fff; }
.btn-primary:hover { background: #39a8f5; }
.btn-link { background: transparent; border-color: transparent; color: #66bdf7; }
.project[aria-checked=true] { background: #132235; border-color: #37618a; }
.segmented { background: #0b111a; }
select.target-pool-select, select.target-pool-select:hover { background-color: #121e2d; border-color: #2a435f; color: #b5daf8; }
select.target-pool-select option { background: #111a26; color: #e8edf5; }
.records-overview, .points-summary, .pool-rpm-panel { background: #111b29; border-color: #26374c; }
.points-summary strong, .rpm-total > strong { color: #67bfff; }
.account-record { background: #0e141d; border-color: #252f3d; box-shadow: none; }
.account-record-meta { background: #121a25; border-color: #202b3b; color: #718199; }
.account-record-meta strong { color: #a8b7ca; }
.account-record .compact-points-card { background: #101925; border-color: #233246; grid-template-columns: 1fr; gap: 10px; }
.account-record .compact-points-card > strong { grid-column: auto; font-size: 12px; }
.account-record .compact-points-card .usage-grid { grid-column: auto; grid-row: auto; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px 24px; }
.account-record .compact-points-card .usage-grid strong { color: #d6e4f6; }
.account-record .compact-points-card > .hint { color: #687c96; }
.account-windows { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 18px; order: 3; }
.account-record .slim-window { display: grid; gap: 7px; grid-column: auto; margin: 0; }
.window-caption { display: flex; align-items: baseline; gap: 8px; font-size: 11px; color: #92a3ba; }
.window-caption strong { font-size: 11px; color: #d8e4f3; font-weight: 500; }
.window-remaining { margin-left: auto; font-size: 10px; color: #74859e; }
.account-record .slim-window progress { display: block; appearance: none; width: 100%; height: 4px; border: 0; border-radius: 9px; overflow: hidden; background: #252e3c; color: #52a9de; }
.account-record .slim-window progress::-webkit-progress-bar { background: #252e3c; border-radius: 9px; }
.account-record .slim-window progress::-webkit-progress-value { background: #52a9de; border-radius: 9px; }
.account-record .slim-window progress::-moz-progress-bar { background: #52a9de; border-radius: 9px; }
.account-record .window-warn progress::-webkit-progress-value { background: #e5b551; }
.account-record .window-danger progress::-webkit-progress-value { background: #f47e9e; }
.account-record .window-warn progress::-moz-progress-bar { background: #e5b551; }
.account-record .window-danger progress::-moz-progress-bar { background: #f47e9e; }
.window-empty { height: 4px; background: #252e3c; border-radius: 9px; }
@media (max-width:760px) {
 .account-record .compact-points-card .usage-grid { grid-template-columns: 1fr; }
 .account-windows { width: 100%; grid-template-columns: 1fr; }
 .brand img.panda-mark { width: 32px; height: 32px; }
}

/* Usage totals retain independent group subtotals for manual settlement. */
.group-usage-section { grid-column: 1 / -1; width: 100%; }
.group-usage-section h3 { font-size: 14px; margin: 0 0 10px; }
.group-usage-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); gap: 10px; width: 100%; }
.group-usage-item { display: flex; flex-direction: column; gap: 5px; padding: 12px 14px; border: 1px solid var(--border, #293849); border-radius: 12px; background: rgba(70,155,225,.04); font-size: 13px; }
.group-usage-item strong { font-size: 13px !important; overflow-wrap: anywhere; }
.group-usage-item span { font-size: 12px; }
.group-usage-list.compact { display: flex; flex-direction: column; min-width: 220px; margin-top: 10px; gap: 6px; white-space: normal; }
.group-usage-list.compact .group-usage-item { padding: 8px 10px; }

/* Compact user directory, with detailed accounting kept in a focused dialog. */
.users-toolbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; margin-bottom:20px; }
.users-toolbar form { flex-wrap:nowrap; max-width:420px; flex:1; }
.users-toolbar input { min-width:150px; }
.user-dashboard,.user-detail-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin:0 0 24px; }
.user-stat { display:flex; flex-direction:column; gap:9px; padding:22px; border:1px solid var(--border); border-radius:18px; background:var(--surface-2); }
.user-stat > strong { font-size:28px; line-height:1.25; font-weight:650; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.users-compact-table { width:100%; min-width:850px; table-layout:auto; }
.users-compact-table th { font-size:12px; padding:14px 12px; }
.users-compact-table td { padding:18px 12px; vertical-align:middle; }
.users-compact-table tbody tr:hover { background:var(--surface-2); }
.user-identity { display:flex; gap:12px; align-items:center; min-width:170px; }
.user-avatar { width:38px; height:38px; flex-shrink:0; border-radius:50%; display:grid; place-items:center; background:rgba(48,163,234,.13); color:var(--accent); font-size:12px; font-weight:700; }
.user-amount { font-variant-numeric:tabular-nums; font-weight:600; }
.users-compact-table .user-amount { max-width:190px; overflow-wrap:anywhere; }
.user-more { border:0; font-size:26px; line-height:1; padding:8px 12px; background:transparent; }
dialog.modal.user-action-dialog { width:min(360px,calc(100vw - 32px)); }
.user-action-dialog .modal-body { display:flex; flex-direction:column; gap:10px; }
.user-action-item { width:100%; text-align:left; padding:14px; }
dialog.modal.user-detail-dialog { width:min(1000px,calc(100vw - 32px)); max-width:1000px; }
.user-detail-stats { margin-top:18px; }
.user-detail-stats .user-stat > strong { font-size:24px; }
.user-detail-group-head { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; margin:24px 0 14px; }
.user-detail-group-head h3 { margin:0; }
.user-settings-details { margin-top:20px; border-top:1px solid var(--border); padding-top:14px; }
@media(max-width:720px) { .user-dashboard,.user-detail-stats { grid-template-columns:repeat(2,minmax(0,1fr)); } .user-stat { padding:16px; } .user-stat > strong { font-size:22px; } .users-toolbar { align-items:stretch; } }
@media(max-width:420px) { .user-dashboard { grid-template-columns:1fr; } }

.user-group-table-wrap { overflow-x:auto; border:1px solid var(--border); border-radius:12px; }
.user-group-table { width:100%; min-width:780px; border-collapse:collapse; }
.user-group-table th,.user-group-table td { padding:14px 12px; text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; border-bottom:1px solid var(--border); }
.user-group-table th { color:var(--muted); font-size:12px; }
.user-group-table th:first-child,.user-group-table td:first-child { text-align:left; white-space:normal; min-width:150px; }
.user-group-table tr:last-child td { border-bottom:0; }
.user-group-table td:nth-last-child(-n+2) { color:var(--accent); font-weight:600; }

.user-inline-notebook h3 { margin:0 0 10px; }
.user-inline-notebook textarea { width:100%; box-sizing:border-box; min-height:130px; resize:vertical; }
.user-notebook-actions { display:flex; justify-content:flex-end; margin-top:10px; }

.app-shell .nav button { display:flex; align-items:center; gap:14px; }
.nav-icon { width:22px; height:22px; flex:0 0 22px; }

/* Mobile layouts: keep page width bounded; wide accounting grids scroll locally. */
@media (max-width:760px) {
 html,body,#app,.app-shell { width:100%; min-width:0; }
 .app-shell .topbar { box-sizing:border-box; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px; z-index:20; padding:12px; }
 .app-shell .brand { min-width:0; }
 .brand-subtitle { display:none; }
 .app-shell .account { position:static; display:flex; align-items:center; flex-wrap:nowrap; grid-column:2; grid-row:1; }
 .app-shell .nav { grid-column:1 / -1; grid-row:2; display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); width:100%; min-width:0; gap:3px; overflow:visible; }
 .app-shell .nav button { flex-direction:column; justify-content:center; gap:5px; padding:8px 2px; font-size:11px; white-space:nowrap; min-width:0; }
 .nav-icon { width:20px; height:20px; flex-basis:20px; }
 .app-shell main,.view,.card,.stack,.modal-body { min-width:0; max-width:100%; box-sizing:border-box; }
 .app-shell main { padding:12px 10px; }
 .card { padding:16px 12px; }
 .actions,.users-toolbar,.records-toolbar { flex-wrap:wrap; }
 input,select,textarea { font-size:16px; max-width:100%; }
 .form-grid,.grid,.two-col { grid-template-columns:minmax(0,1fr); }
 .user-dashboard,.user-detail-stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-bottom:12px; }
 .user-stat { padding:12px; border-radius:12px; min-width:0; }
 .user-stat > strong,.user-detail-stats .user-stat > strong { font-size:19px; overflow-wrap:anywhere; }
 .user-stat small { font-size:11px; }
 .users-toolbar input { width:100%; min-width:0; }
 .users-list-wrap { overflow:visible; }
 .users-compact-table { min-width:0; width:100%; }
 .users-compact-table thead { display:none; }
 .users-compact-table tbody { display:grid; gap:10px; }
 .users-compact-table tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); border:1px solid var(--border); border-radius:12px; padding:12px; position:relative; gap:8px; }
 .users-compact-table td { display:block; min-width:0; padding:4px; border:0; white-space:normal; overflow-wrap:anywhere; }
 .users-compact-table td:first-child { grid-column:1 / -1; padding-right:40px; }
 .users-compact-table td:last-child { position:absolute; right:8px; top:10px; }
 .users-compact-table td:nth-child(3)::before { content:'今日积分'; }
 .users-compact-table td:nth-child(4)::before { content:'累计积分'; }
 .users-compact-table td:nth-child(5)::before { content:'下级人数'; }
 .users-compact-table td:nth-child(6)::before { content:'注册时间'; }
 .users-compact-table td::before { display:block; color:var(--muted); font-size:11px; margin-bottom:4px; }
 .user-identity { min-width:0; }
 dialog.modal,dialog.modal.user-detail-dialog { width:calc(100vw - 16px); max-width:calc(100vw - 16px); max-height:calc(100dvh - 16px); margin:auto; border-radius:14px; }
 .modal-head,.modal-body,.modal-foot { padding:12px; }
 .modal-head h2 { font-size:17px; overflow-wrap:anywhere; }
 .modal-foot { position:sticky; bottom:0; background:var(--surface); }
 .user-detail-group-head { margin:12px 0 6px; }
 .table-wrap,.user-group-table-wrap { width:100%; max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
 .group-usage-list { grid-template-columns:minmax(0,1fr); }
 .account-record { min-width:0; padding:12px; }
 .account-record-heading,.account-record-meta { flex-wrap:wrap; gap:8px; }
 .account-record-name { min-width:0; overflow-wrap:anywhere; }
 .account-record .provider-usage-card { grid-template-columns:minmax(0,1fr); }
 .pool-rpm-panel { padding:12px; margin-bottom:14px; }
}
@media (max-width:360px) { .user-detail-stats { grid-template-columns:minmax(0,1fr); } }
@media (max-width:760px) {
 .users-compact-table td:nth-child(2) { grid-column:1 / -1; display:flex; gap:8px; align-items:center; }
 .user-dashboard .user-stat:first-child { grid-column:1 / -1; }
}

/* Form controls must not inherit text-input dimensions on checkboxes. */
.check input[type=checkbox],.check input[type=radio] { width:18px; height:18px; min-width:18px; flex:0 0 18px; padding:0; margin:2px 0 0; border-radius:4px; accent-color:var(--accent); }
.modal-body .grid-2 { min-width:0; gap:14px; }
.modal-body .field { min-width:0; }
.modal-body .field > label,.modal-body .hint,.modal-body .check { overflow-wrap:anywhere; }
.user-edit-dialog .modal-body { gap:18px; }
.user-edit-dialog .check { padding:12px; border:1px solid var(--border); border-radius:10px; line-height:1.5; }
@media(max-width:760px) {
 .modal-body .grid-2 { grid-template-columns:minmax(0,1fr); gap:16px; }
 .modal-body .field { gap:7px; }
 .modal-body input:not([type=checkbox]):not([type=radio]),.modal-body select { min-height:44px; font-size:16px; }
 .modal-body input[type=checkbox],.modal-body input[type=radio] { min-height:0; }
 .modal-body .input-group { min-width:0; flex-wrap:wrap; gap:8px; }
 .modal-body .input-group > * { border-radius:8px; margin-left:0; }
 .modal-foot { gap:10px; padding-bottom:max(12px,env(safe-area-inset-bottom)); }
 .modal-foot .btn { min-height:44px; flex:1; }
 dialog.modal { scroll-padding-bottom:80px; }
}

/* Account workspace: totals → health → search → focused account rows. */
.records-workspace > .card { padding:24px; }
.records-workspace .points-summary { display:grid; grid-template-columns:1fr 1fr; gap:12px; border:0; background:transparent; padding:0; margin:20px 0 12px; }
.records-workspace .points-summary > div:not(.group-usage-section) { padding:20px; background:linear-gradient(135deg,#14273b,#142031); border:1px solid #2a4058; border-radius:14px; }
.records-workspace .points-summary > div > strong { display:block; font-size:30px; margin-top:8px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.records-workspace .points-summary > p { grid-column:1 / -1; margin:0; font-size:11px; }
.records-group-breakdown { grid-column:1 / -1; border:1px solid var(--border); border-radius:10px; padding:12px 14px; }
.records-group-breakdown summary { cursor:pointer; color:var(--accent); font-weight:600; }
.records-group-breakdown .group-usage-list { margin-top:14px; }
.records-workspace .records-overview { background:transparent; border:0; padding:12px 0; margin:0; }
.overview-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.health-shortcuts { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:8px; margin:12px 0; }
.health-filter { border:1px solid var(--border); background:var(--surface); color:var(--muted); border-radius:10px; padding:12px; cursor:pointer; text-align:left; }
.health-filter strong { display:block; margin-top:6px; font-size:22px; color:var(--text); }
.health-filter.active { background:#142b40; border-color:var(--accent); color:var(--accent); }
.records-tools { border:1px solid var(--border); border-radius:12px; padding:16px; background:#0c121b; }
.records-workspace .records-search { margin:0 0 14px; display:flex; gap:8px; }
.records-workspace .records-search input { max-width:none; }
.records-primary-filters { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); align-items:start; margin:0; padding:0; }
.records-primary-filters .field { margin:0; }
.records-primary-filters label { font-size:11px; color:var(--muted); }
.records-advanced { margin-top:14px; }
.records-advanced summary { cursor:pointer; font-size:12px; color:var(--muted); }
.records-advanced .records-filters { padding:12px 0 0; }
.records-workspace .account-record-list { gap:10px; }
.records-workspace .account-record { padding:0; overflow:hidden; background:#0f1620; border-color:var(--border); }
.record-main { display:grid; grid-template-columns:minmax(0,1fr) 170px minmax(140px,200px); align-items:center; padding:18px; gap:18px; }
.record-identity { display:flex; gap:12px; align-items:center; min-width:0; }
.record-identity input { width:16px; height:16px; padding:0; flex:0 0 16px; }
.record-identity > div { min-width:0; }
.record-account-name { display:block; overflow-wrap:anywhere; font-size:15px; }
.record-source { color:var(--muted); font-size:12px; margin-top:6px; overflow-wrap:anywhere; }
.record-health { display:flex; flex-wrap:wrap; gap:5px; }
.record-points { text-align:right; min-width:0; }
.record-points strong { display:block; font-size:21px; margin-top:5px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.record-issue { display:flex; gap:10px; padding:10px 18px; background:#30241950; color:#e7c28a; font-size:12px; overflow-wrap:anywhere; }
.record-issue > span { white-space:nowrap; font-weight:600; }
.record-details { border-top:1px solid var(--border); }
.record-details > summary { cursor:pointer; padding:10px 18px; color:var(--muted); font-size:12px; }
.record-detail-inner { padding:0 18px 18px; display:grid; gap:10px; }
.record-detail-inner .account-record-meta { padding:10px 0; background:transparent; }
.record-detail-inner .provider-usage-card { margin:0; }
@media(max-width:760px) {
 .records-workspace > .card { padding:14px 12px; }
 .records-workspace .points-summary > div:not(.group-usage-section) { padding:14px; }
 .records-workspace .points-summary > div > strong { font-size:23px; }
 .health-shortcuts { grid-template-columns:repeat(3,minmax(0,1fr)); }
 .health-filter { padding:10px; font-size:12px; }
 .health-filter strong { font-size:20px; }
 .records-tools { padding:12px; }
 .records-primary-filters { grid-template-columns:minmax(0,1fr); gap:12px; }
 .record-main { grid-template-columns:minmax(0,1fr) minmax(95px,120px); padding:14px; gap:12px; }
 .record-identity { grid-column:1 / -1; }
 .record-health { grid-column:1; }
 .record-points { grid-column:2; }
 .record-points strong { font-size:19px; }
 .record-issue { padding:10px 14px; }
 .record-detail-inner { padding:0 14px 14px; }
 .record-detail-inner .usage-grid { grid-column:auto; grid-row:auto; }
}
.records-primary-filters { grid-template-columns:minmax(180px,300px); }
@media(max-width:760px) { .records-primary-filters { grid-template-columns:minmax(0,1fr); } }
/* Always-visible usage details and compact record controls. */
.records-workspace .btn { padding:6px 11px; font-size:12px; border-radius:8px; min-height:32px; }
.records-workspace .record-detail-inner { padding-top:12px; gap:8px; }
.records-workspace .record-detail-inner .actions { gap:6px; }
.records-workspace .record-detail-inner .btn { padding:5px 9px; min-height:30px; }
.records-workspace .health-filter { padding:9px 11px; }
.records-workspace .health-filter strong { font-size:19px; margin-top:4px; }
@media(max-width:760px) {
 .records-workspace .btn { padding:6px 10px; min-height:32px; }
 .records-workspace .record-main { padding:12px; gap:8px; }
 .records-workspace .record-detail-inner { padding:10px 12px 12px; }
 .records-workspace .record-detail-inner .account-record-meta { padding:6px 0; }
}

/* Unified controls: quiet surfaces, clear intent, immediate physical feedback. */
:root { --control-bg:#192330; --control-hover:#243347; --control-edge:#334257; --control-ring:#65bdfb; }
.btn,.records-workspace .btn { min-height:34px; padding:7px 12px; border:1px solid var(--control-edge); border-radius:9px; background:linear-gradient(180deg,#1d2a3b,#172231); color:#dce6f4; font-size:12px; font-weight:600; line-height:1.25; box-shadow:inset 0 1px 0 #ffffff08,0 1px 2px #00000020; transition:background .16s,border-color .16s,box-shadow .16s,transform .1s; -webkit-tap-highlight-color:transparent; touch-action:manipulation; }
.btn-primary,.records-workspace .btn-primary { background:linear-gradient(180deg,#37aafa,#208ce3); border-color:#4aaef4; color:#fff; box-shadow:inset 0 1px 0 #ffffff22,0 3px 9px #0789ed24; }
.btn-link,.records-workspace .btn-link { background:#15314b60; border-color:#2d526e; color:#87ccff; box-shadow:none; }
.btn-destructive,.records-workspace .btn-destructive { color:#f2a6ae; background:#3b222b80; border-color:#69404c; }
.btn-danger { background:#b63c52; color:white; border-color:#d76779; }
.btn:disabled { opacity:.4; filter:saturate(.5); box-shadow:none; transform:none; }
.btn[aria-busy=true] { opacity:.85; cursor:progress; filter:none; }
.btn:focus-visible,.health-filter:focus-visible,.nav button:focus-visible,.segmented button:focus-visible,summary:focus-visible { outline:2px solid var(--control-ring); outline-offset:3px; box-shadow:0 0 0 4px #51aafa15; }
.btn:not(:disabled):active,.health-filter:active,.nav button:active,.segmented button:active { transform:translateY(1px) scale(.98); box-shadow:inset 0 2px 4px #00000025; }
.btn[aria-busy=true]::before { display:none; }
.btn[data-icon]::before { content:''; display:block; width:14px; height:14px; flex:0 0 14px; background:currentColor; mask:center/contain no-repeat var(--button-icon); -webkit-mask:center/contain no-repeat var(--button-icon); }
.btn[data-icon=refresh] { --button-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 7v5h-5M4 17v-5h5M6 7a7 7 0 0 1 12-1l2 3M18 17a7 7 0 0 1-12 1l-2-3'/%3E%3C/svg%3E"); }
.btn[data-icon=search] { --button-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m16 16 5 5'/%3E%3C/svg%3E"); }
.btn[data-icon=check] { --button-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 4 4L19 6'/%3E%3C/svg%3E"); }
.btn[data-icon=delete] { --button-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M9 6V3h6v3M6 6l1 15h10l1-15M10 10v7m4-7v7'/%3E%3C/svg%3E"); }
.btn[data-icon=close] { --button-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 7 10 10M17 7 7 17'/%3E%3C/svg%3E"); }
.btn[data-icon=previous] { --button-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m14 6-6 6 6 6'/%3E%3C/svg%3E"); }
.btn[data-icon=next] { --button-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m10 6 6 6-6 6'/%3E%3C/svg%3E"); }
.btn[data-icon=copy] { --button-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Crect x='8' y='8' width='12' height='13' rx='2'/%3E%3Cpath d='M16 8V3H3v13h5'/%3E%3C/svg%3E"); }
.health-filter { transition:background .16s,border-color .16s,transform .1s; position:relative; }
.health-filter.active { background:linear-gradient(145deg,#193b57,#152b40); box-shadow:inset 0 0 0 1px #65bdfb22; }
.app-shell .nav button { transition:color .16s,background .16s,transform .1s; }
.app-shell .nav button[aria-current=page] { box-shadow:inset 3px 0 0 #69c1ff; }
.segmented button { transition:background .16s,color .16s,transform .1s,box-shadow .16s; }
.segmented button[aria-pressed=true],.segmented button.active { background:#20334b; color:#9bd6ff; box-shadow:0 2px 5px #0004,inset 0 1px 0 #ffffff0c; }
.toast { border:1px solid #3d5770; border-radius:12px; background:#192a3c; color:#e4f2ff; box-shadow:0 8px 32px #0005; padding:12px 18px; animation:control-toast-in .2s ease-out; }
.toast-error { border-color:#934758; background:#36212b; color:#ffc5cf; }
@keyframes control-toast-in { from {opacity:0;transform:translateY(8px);} to {opacity:1;transform:translateY(0);} }
@media(hover:hover) {
 .btn:not(:disabled):hover { background:#293a51; border-color:#557397; box-shadow:0 3px 10px #0003,inset 0 1px 0 #ffffff0b; transform:translateY(-1px); }
 .btn-primary:not(:disabled):hover { background:linear-gradient(180deg,#53b9ff,#2999ec); border-color:#87ceff; box-shadow:0 4px 14px #188fe43a; }
 .btn-destructive:not(:disabled):hover { background:#512b37; border-color:#ae6477; color:#ffd0d8; }
 .health-filter:hover { border-color:#517293; background:#1b2b3e; }
 .app-shell .nav button:hover { background:#182637; color:#d6e9fb; }
}
@media(max-width:760px) {
 .btn,.records-workspace .btn { min-height:36px; padding:7px 11px; }
 .modal-foot .btn { min-height:42px; }
 .app-shell .nav button[aria-current=page] { box-shadow:inset 0 -2px 0 #69c1ff; }
 .record-detail-inner .actions { gap:8px; }
 #toasts { right:12px; left:12px; bottom:max(16px,env(safe-area-inset-bottom)); }
}
@media(prefers-reduced-motion:reduce) { .btn,.health-filter,.app-shell .nav button,.segmented button,.toast { transition:none; animation:none; } }
.btn[data-icon][aria-busy=true]::before { display:none; }
.btn:not(:disabled):active { transform:translateY(1px) scale(.98); }
.modal-body .grid-2 { align-items:start; }

/* Refined dashboard surfaces and semantic account states. */
:root { --bg:#0b1120; --surface:#111827; --surface-2:#1e293b; --text:#f1f5f9; --muted:#94a3b8; --border:#334155; }
body { background:#0b1120; }
.card,.records-workspace .account-record,.records-tools,.records-group-breakdown,
.records-workspace .points-summary > div:not(.group-usage-section) {
 border:0; border-radius:16px; background:#111827; box-shadow:0 8px 24px rgb(0 0 0 / .2);
}
.records-workspace > .card { background:transparent; box-shadow:none; }
.records-workspace .points-summary > div > strong,.record-points strong,.usage-grid strong,
.users-compact-table td:nth-child(n+4),.user-usage-stats strong,.group-usage-list span,.metric-value {
 font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace; font-variant-numeric:tabular-nums; letter-spacing:-.035em;
}
.records-workspace .points-summary > div > strong,.record-points strong { font-size:30px; line-height:1.2; font-weight:700; }
.records-workspace .points-summary > div > .hint,.record-points > .hint { font-size:14px; color:#94a3b8; }
.records-workspace .points-summary > div:not(.group-usage-section) { padding:22px 24px; }
.badge { display:inline-flex; align-items:center; gap:6px; border:0; border-radius:999px; padding:4px 12px; font-size:12px; font-weight:500; line-height:1.5; }
.status-pill::before { content:''; width:6px; height:6px; flex:0 0 6px; border-radius:50%; background:currentColor; }
.badge-ok { background:rgb(16 185 129 / .1); color:#34d399; }
.badge-warn { background:rgb(245 158 11 / .1); color:#fbbf24; }
.badge-danger { background:rgb(244 63 94 / .1); color:#fb7185; }
.badge-info { background:rgb(14 165 233 / .1); color:#38bdf8; }
.badge-muted { background:rgb(148 163 184 / .1); color:#94a3b8; }
.health-filter { border:0; background:#111827; border-radius:16px; transition:background .16s,box-shadow .16s; }
.health-filter > span { display:inline-block; border-radius:999px; padding:4px 10px; font-size:12px; background:rgb(148 163 184 / .1); }
.health-all > span { color:#38bdf8; background:rgb(14 165 233 / .1); }
.health-healthy > span { color:#34d399; background:rgb(16 185 129 / .1); }
.health-abnormal > span,.health-possible_ban > span { color:#fbbf24; background:rgb(245 158 11 / .1); }
.health-banned > span { color:#fb7185; background:rgb(244 63 94 / .1); }
.health-filter strong { font-family:ui-monospace,monospace; }
.health-filter:hover { background:#1e293b; }
.health-filter.active { background:#172638; box-shadow:inset 0 0 0 2px rgb(56 189 248 / .5); }
.records-toolbar { display:flex; align-items:center; gap:16px; }
.records-workspace .records-toolbar .records-search { flex:1; min-width:0; margin:0; align-items:center; }
.records-toolbar .records-primary-filters { display:block; flex:0 0 210px; }
.records-toolbar .records-primary-filters label { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.records-toolbar input,.records-toolbar select { min-height:40px; background:#0b1120; border-color:#334155; border-radius:10px; }
.records-workspace .account-record { transition:background .16s; }
.records-workspace .account-record:hover { background:rgb(30 41 59 / .5); }
.record-details { border:0; }
.record-detail-inner { padding-top:4px; }
.record-issue { background:rgb(244 63 94 / .05); color:#fda4af; align-items:flex-start; }
.record-issue > span { background:rgb(244 63 94 / .1); color:#fb7185; border-radius:999px; padding:3px 10px; font-size:12px; }
.account-record .provider-usage-card { border:0; border-radius:12px; background:rgb(11 17 32 / .6); }
.app-shell .account .btn { background:transparent; border:1px solid #334155; color:#cbd5e1; box-shadow:none; }
.app-shell .account .btn:hover { background:#1e293b; color:#f8fafc; border-color:#64748b; }
@media(min-width:761px) {
 .app-shell .nav button { border-left:4px solid transparent; }
 .app-shell .nav button[aria-current=page] { border-left-color:#0ea5e9; background:rgb(14 165 233 / .1); color:#38bdf8; box-shadow:none; }
}
@media(max-width:760px) {
 .records-toolbar { flex-wrap:wrap; gap:10px; }
 .records-workspace .records-toolbar .records-search { flex-basis:100%; flex-wrap:wrap; }
 .records-toolbar .records-search input { flex:1 1 100%; width:100%; }
 .records-toolbar .records-primary-filters { flex:1 1 100%; }
 .records-workspace .points-summary > div:not(.group-usage-section) { padding:16px 12px; }
 .records-workspace .points-summary > div > strong { font-size:26px; }
 .record-points strong { font-size:26px; }
}

/* Dense account rows: identity | health and usage windows | point balance. */
.records-workspace .account-record-list { gap:0; border-radius:16px; overflow:hidden; background:#111827; box-shadow:0 8px 24px #0003; }
.records-workspace .account-record { border-radius:0; box-shadow:none; border-bottom:1px solid rgb(148 163 184 / .12); background:transparent; }
.records-workspace .account-record:last-child { border-bottom:0; }
.records-workspace .account-record:hover { background:#1e293b66; }
.record-main { grid-template-columns:minmax(190px,1fr) minmax(340px,1.8fr) minmax(120px,.55fr); align-items:start; gap:28px; padding:22px 24px 12px; }
.record-identity { align-items:flex-start; padding-top:3px; }
.record-identity input { margin-top:4px; }
.record-account-name { font-size:16px; line-height:1.5; }
.record-source { line-height:1.8; margin-top:8px; }
.record-observation { min-width:0; }
.record-health { min-height:28px; margin-bottom:10px; }
.record-points { padding-top:5px; }
.record-points strong { font-size:26px; margin-top:8px; }
.account-record .provider-usage-card.compact-points-card { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(0,1fr); gap:10px 24px; padding:0; margin:0; background:transparent; border:0; }
.account-record .compact-points-card .account-windows { display:grid; gap:12px; min-width:0; }
.account-record .compact-points-card .usage-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:10px; align-content:start; }
.account-record .compact-points-card .usage-grid > div { display:flex; align-items:baseline; justify-content:space-between; gap:10px; }
.account-record .compact-points-card .usage-grid strong { font-size:14px; }
.account-record .slim-window { position:relative; display:grid; grid-template-columns:28px minmax(45px,1fr) 52px; align-items:center; column-gap:8px; row-gap:5px; }
.account-record .window-caption { display:contents; }
.account-record .window-caption > span:first-child { grid-column:1; grid-row:1; font-size:12px; }
.account-record .window-caption strong { grid-column:3; grid-row:1; text-align:right; font-family:ui-monospace,monospace; font-size:13px; font-weight:600; }
.account-record .window-caption .window-remaining { grid-column:2 / 4; grid-row:2; font-size:11px; text-align:right; }
.account-record .slim-window progress,.account-record .slim-window .window-empty { grid-column:2; grid-row:1; height:5px; width:100%; border-radius:999px; background:#334155; }
.account-record .record-sync { grid-column:1 / -1; font-size:11px; color:#94a3b8; }
.record-detail-inner { gap:6px; padding:0 24px 16px 52px; }
.record-detail-inner .account-record-meta { padding:0; font-size:11px; border:0; }
.record-footer { display:flex; justify-content:flex-end; }
.record-footer .actions { justify-content:flex-end; gap:6px; flex-wrap:wrap; }
.record-footer .btn { min-height:30px; font-size:12px; padding:5px 9px; }
.record-detail-inner > .sub { font-size:11px; line-height:1.7; color:#94a3b8; }
@media(min-width:1200px) {
 .record-detail-inner { position:relative; }
 .record-footer { margin-top:-19px; padding-left:280px; min-height:30px; }
}
@media(max-width:1100px) and (min-width:761px) {
 .record-main { grid-template-columns:minmax(150px,.9fr) minmax(250px,1.4fr) minmax(95px,.5fr); gap:16px; padding:18px; }
 .account-record .provider-usage-card.compact-points-card { grid-template-columns:minmax(0,1fr); }
 .account-record .compact-points-card .usage-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .account-record .compact-points-card .usage-grid > div { flex-wrap:wrap; gap:4px; }
}
@media(max-width:760px) {
 .record-main { grid-template-columns:minmax(0,1fr) minmax(95px,.5fr); gap:16px 12px; padding:18px 14px 12px; }
 .record-identity { grid-column:1; grid-row:1; }
 .record-points { grid-column:2; grid-row:1; }
 .record-observation { grid-column:1 / -1; grid-row:2; }
 .account-record .provider-usage-card.compact-points-card { grid-template-columns:minmax(0,1fr); }
 .account-record .compact-points-card .usage-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .account-record .compact-points-card .usage-grid > div { flex-wrap:wrap; gap:4px; }
 .record-detail-inner { padding:0 14px 16px; }
 .record-footer { justify-content:flex-start; margin:6px 0; }
 .record-footer .actions { justify-content:flex-start; }
 .record-footer .btn { min-height:38px; padding:7px 10px; }
 .record-points strong { font-size:23px; }
}

/* Compact row correction: explicitly reset legacy order and grid placement. */
.record-main { grid-template-columns:minmax(150px,.85fr) minmax(380px,2fr) minmax(100px,.5fr); gap:20px; padding:14px 18px 8px; }
.record-account-name { font-size:14px; line-height:1.4; }
.record-source { font-size:11px; line-height:1.5; margin-top:5px; }
.record-health { min-height:0; margin:0 0 7px; }
.record-health .badge { padding:2px 9px; font-size:11px; }
.record-points { padding-top:0; }
.record-points > .hint { font-size:11px; }
.record-points strong { font-size:23px; margin-top:4px; }
.account-record .provider-usage-card.compact-points-card { grid-template-columns:minmax(0,1.5fr) minmax(110px,1fr); gap:6px 20px; }
.account-record .compact-points-card .account-windows { order:0; grid-column:1; grid-row:1; grid-template-columns:minmax(0,1fr); gap:8px; align-content:start; }
.account-record .compact-points-card .usage-grid { order:0; grid-column:2; grid-row:1; grid-template-columns:minmax(0,1fr); gap:8px; }
.account-record .compact-points-card .usage-grid .hint { font-size:11px; }
.account-record .compact-points-card .usage-grid strong { font-size:12px; }
.account-record .compact-points-card .record-sync { order:0; grid-column:1 / -1; grid-row:2; padding:0; line-height:1.4; font-size:10px; }
.account-record .slim-window { grid-template-columns:22px minmax(35px,1fr) 46px; gap:3px 6px; }
.account-record .window-caption strong { font-size:12px; }
.account-record .window-caption .window-remaining { font-size:10px; line-height:1.2; }
.record-detail-inner { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:6px 16px; padding:0 18px 10px 46px; }
.record-detail-inner .account-record-meta { font-size:10px; line-height:1.5; gap:5px 14px; }
.record-footer { display:flex; align-items:center; justify-content:flex-end; gap:12px; margin:0; padding:0; min-height:26px; }
.record-footer .btn { min-height:26px; padding:3px 7px; font-size:11px; }
.record-extra { font-size:11px; color:#94a3b8; }
.record-extra > summary { cursor:pointer; padding:5px 0; white-space:nowrap; }
.record-extra[open] { flex-basis:100%; order:2; }
.record-extra-content { display:grid; gap:6px; padding:8px 0; overflow-wrap:anywhere; }
.record-extra-content > * { margin:0; font-size:11px; line-height:1.6; }
.record-footer:has(.record-extra[open]) { flex-wrap:wrap; flex:1 1 100%; }
.record-issue { padding:6px 18px; font-size:11px; line-height:1.5; }
@media(max-width:1100px) and (min-width:761px) {
 .record-main { grid-template-columns:minmax(135px,.8fr) minmax(250px,1.6fr) minmax(90px,.45fr); gap:12px; }
 .account-record .provider-usage-card.compact-points-card { grid-template-columns:minmax(0,1fr); gap:6px; }
 .account-record .compact-points-card .usage-grid { grid-column:1; grid-row:2; display:flex; flex-wrap:wrap; gap:6px 14px; }
 .account-record .compact-points-card .record-sync { grid-row:3; }
}
@media(max-width:760px) {
 .record-main { grid-template-columns:minmax(0,1fr) 100px; gap:10px 12px; padding:12px 12px 8px; }
 .record-observation { display:grid; grid-template-columns:minmax(0,1fr); }
 .record-health { margin-bottom:6px; }
 .account-record .provider-usage-card.compact-points-card { grid-template-columns:minmax(0,1fr); gap:6px; }
 .account-record .compact-points-card .account-windows { grid-column:1; grid-row:1; gap:7px; }
 .account-record .compact-points-card .usage-grid { grid-column:1; grid-row:2; display:flex; flex-wrap:wrap; gap:5px 16px; }
 .account-record .compact-points-card .record-sync { grid-row:3; }
 .account-record .slim-window { grid-template-columns:22px minmax(40px,1fr) 46px minmax(85px,1fr); }
 .account-record .window-caption .window-remaining { grid-column:4; grid-row:1; }
 .record-detail-inner { padding:0 12px 10px; gap:4px; }
 .record-footer { width:100%; justify-content:space-between; gap:8px; }
 .record-footer .btn { min-height:34px; padding:5px 8px; }
 .record-footer .actions { margin-left:auto; }
}

/* Final density pass: one compact line per usage window. */
.records-workspace .account-record .provider-usage-card.compact-points-card { display:block; }
.account-record .compact-points-card .account-windows { display:grid; grid-template-columns:minmax(0,1fr); gap:5px; }
.account-record .compact-points-card .slim-window { grid-template-columns:24px minmax(45px,1fr) 44px minmax(110px,1fr); grid-template-rows:18px; align-items:center; gap:0 7px; height:18px; }
.account-record .compact-points-card .window-caption > span:first-child { grid-column:1; grid-row:1; }
.account-record .compact-points-card .window-caption strong { grid-column:3; grid-row:1; }
.account-record .compact-points-card .window-caption .window-remaining { grid-column:4; grid-row:1; text-align:left; white-space:nowrap; }
.account-record .compact-points-card .slim-window progress,.account-record .compact-points-card .slim-window .window-empty { grid-column:2; grid-row:1; }
.account-record .compact-points-card .record-sync { display:block; margin-top:4px; }
@media(max-width:760px) {
 .account-record .compact-points-card .slim-window { grid-template-columns:22px minmax(35px,1fr) 42px minmax(90px,1fr); height:18px; }
 .account-record .compact-points-card .window-caption .window-remaining { grid-column:4; grid-row:1; }
}

.check-result-list { display:grid; gap:12px; margin:0; }
.check-result-list > div { display:grid; grid-template-columns:100px minmax(0,1fr); gap:12px; font-size:13px; line-height:1.6; }
.check-result-list dt { color:#94a3b8; }
.check-result-list dd { margin:0; overflow-wrap:anywhere; color:#e2e8f0; }
.record-check-feedback { padding:4px 18px; font-size:11px; color:#7dd3fc; overflow-wrap:anywhere; }
.record-check-feedback.check-failed { color:#fda4af; }
@media(max-width:760px) { .check-result-list > div { grid-template-columns:minmax(0,1fr); gap:2px; } }

/* Mobile user directory: align cards with the toolbar and summary edges. */
@media(max-width:760px) {
 .users-workspace .users-list-wrap { width:100%; max-width:100%; margin:0; padding:0; overflow:visible; }
 .users-workspace .users-compact-table { display:block; width:100%; min-width:0; border-spacing:0; }
 .users-workspace .users-compact-table tbody { display:grid; width:100%; grid-template-columns:minmax(0,1fr); gap:10px; }
 .users-workspace .users-compact-table tbody tr { display:grid; width:100%; box-sizing:border-box; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:auto auto auto auto; align-items:start; gap:10px 12px; padding:12px; background:#111827; }
 .users-workspace .users-compact-table td { padding:0; min-width:0; max-width:none; margin:0; font-family:inherit; }
 .users-workspace .users-compact-table td:first-child { grid-column:1 / -1; grid-row:1; padding:0 46px 0 0; min-height:40px; }
 .users-workspace .users-compact-table td:nth-child(2) { grid-column:1 / -1; grid-row:2; display:flex; flex-wrap:wrap; align-items:center; gap:8px; font-size:12px; }
 .users-workspace .users-compact-table td:nth-child(3) { grid-column:1; grid-row:3; }
 .users-workspace .users-compact-table td:nth-child(4) { grid-column:2; grid-row:3; }
 .users-workspace .users-compact-table td:nth-child(5) { grid-column:1; grid-row:4; font-size:12px; }
 .users-workspace .users-compact-table td:nth-child(6) { grid-column:2; grid-row:4; font-size:12px; }
 .users-workspace .users-compact-table td:last-child { position:static; grid-column:2; grid-row:1; justify-self:end; align-self:start; z-index:1; }
 .users-workspace .users-compact-table .user-more { display:grid; place-items:center; width:40px; height:40px; min-height:40px; padding:0; border-radius:10px; font-size:24px; }
 .users-workspace .user-identity { min-width:0; gap:9px; align-items:flex-start; }
 .users-workspace .user-identity > div { min-width:0; }
 .users-workspace .user-identity strong { display:block; overflow-wrap:anywhere; font-size:14px; line-height:1.4; }
 .users-workspace .user-identity .hint { font-size:10px; line-height:1.5; overflow-wrap:anywhere; }
 .users-workspace .user-avatar { width:34px; height:34px; flex:0 0 34px; }
 .users-workspace .users-compact-table .user-amount { padding:10px; border-radius:9px; background:#0b1120; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:16px; line-height:1.4; font-variant-numeric:tabular-nums; align-self:stretch; }
 .users-workspace .user-amount::before,.users-workspace .user-amount .hint { font-family:system-ui,sans-serif; font-size:10px; font-weight:400; }
 .users-workspace .users-toolbar { align-items:stretch; gap:8px; }
 .users-workspace .users-toolbar form { flex:1 1 100%; max-width:none; margin:0; gap:8px; }
 .users-workspace .users-toolbar input { flex:1; width:0; min-width:0; }
 .users-workspace .users-toolbar form .btn { flex:0 0 auto; }
 .users-workspace .user-dashboard { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:stretch; }
 .users-workspace .user-dashboard .user-stat { min-width:0; box-sizing:border-box; }
 .users-workspace .records-pagination { flex-wrap:wrap; gap:10px; }
 .users-workspace .records-pagination > .actions { display:grid; width:100%; grid-template-columns:minmax(0,1fr) auto auto; gap:6px; }
 .users-workspace .records-pagination select { min-width:0; width:100%; }
}

/* Distinguish model-specific quotas without adding vertical padding. */
.account-record .compact-points-card .slim-window { grid-template-columns:68px minmax(35px,1fr) 44px minmax(95px,1fr); }
.account-record .compact-points-card .window-caption > span:first-child { font-size:10px; overflow-wrap:anywhere; line-height:1.1; }
@media(max-width:760px) {
 .account-record .compact-points-card .slim-window { grid-template-columns:62px minmax(20px,1fr) 40px minmax(75px,1fr); }
}

.official-platforms { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.official-platform { min-width:0; padding:16px; border-radius:12px; background:#0b1120; }
.official-platform .card-head { margin-bottom:8px; }
.official-platform-url { overflow-wrap:anywhere; }
.official-channel-list { display:grid; gap:8px; }
.official-channel { display:flex; gap:10px; align-items:center; padding:10px; background:#111827; border-radius:10px; min-width:0; }
.official-channel > div { min-width:0; overflow-wrap:anywhere; }
.official-channel strong { font-size:13px; }
@media(max-width:760px) { .official-platforms { grid-template-columns:minmax(0,1fr); } }
.key-record-metrics { display:grid; gap:6px; font-size:12px; }
.key-revenue { display:flex; flex-wrap:wrap; gap:8px 20px; }
.key-revenue strong { font-family:ui-monospace,monospace; color:#e2e8f0; }
@media(max-width:760px) {
 .app-shell .nav { grid-template-columns:repeat(6,minmax(0,1fr)); }
 .app-shell .nav button { min-width:0; padding-left:3px; padding-right:3px; font-size:10px; }
}

.record-type-tabs { display:flex; gap:6px; width:fit-content; max-width:100%; padding:4px; margin:0 0 14px; border-radius:12px; background:#111827; }
.record-type-tabs button { border:0; border-radius:9px; background:transparent; color:#94a3b8; padding:9px 22px; font-size:13px; cursor:pointer; }
.record-type-tabs button[aria-selected=true] { background:#1e3a50; color:#7dd3fc; box-shadow:0 2px 6px #0003; }
.record-type-tabs button:focus-visible { outline:2px solid #38bdf8; outline-offset:2px; }
@media(max-width:760px) {
 .app-shell .nav { grid-template-columns:repeat(5,minmax(0,1fr)); }
 .record-type-tabs { width:100%; box-sizing:border-box; }
 .record-type-tabs button { flex:1; min-height:40px; }
}
.key-buckets button[aria-pressed=true] { background:#1e3a50; color:#7dd3fc; }

/* Account-type switch: a single quiet segmented control. */
.record-tabs-workspace > .record-type-tabs {
 display:inline-flex; align-items:center; width:fit-content; justify-self:start; gap:4px; padding:5px;
 border:1px solid #ffffff0a; border-radius:15px; background:#151e2d;
 box-shadow:inset 0 1px 2px #0003,0 4px 12px #00000012;
}
.record-tabs-workspace > .record-type-tabs > button {
 appearance:none; -webkit-appearance:none; display:flex; justify-content:center; align-items:center;
 min-width:130px; min-height:40px; padding:9px 22px; margin:0; border:0; border-radius:10px;
 font:600 13px/1.4 system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
 letter-spacing:.01em; color:#94a3b8; background:transparent; box-shadow:none;
 cursor:pointer; touch-action:manipulation; transition:background .16s,color .16s,box-shadow .16s,transform .12s;
}
.record-tabs-workspace > .record-type-tabs > button[aria-selected=true] {
 color:#e0f2fe; background:linear-gradient(180deg,#294964,#203c54);
 box-shadow:inset 0 1px 0 #ffffff15,0 2px 6px #0004;
}
.record-tabs-workspace > .record-type-tabs > button:not([aria-selected=true]):hover { color:#e2e8f0; background:#ffffff06; }
.record-tabs-workspace > .record-type-tabs > button:active { transform:scale(.98); }
.record-tabs-workspace > .record-type-tabs > button:focus-visible { outline:2px solid #7dd3fc; outline-offset:2px; }
@media(max-width:760px) {
 .record-tabs-workspace > .record-type-tabs { display:flex; width:100%; }
 .record-tabs-workspace > .record-type-tabs > button { flex:1; min-width:0; min-height:42px; padding:10px 16px; }
}
@media(prefers-reduced-motion:reduce) { .record-tabs-workspace > .record-type-tabs > button { transition:none; } }
.user-key-amount { display:flex; gap:5px; align-items:baseline; margin-top:6px; color:#7dd3fc; font:600 12px/1.5 ui-monospace,monospace; }
.user-key-amount > span { font:400 11px/1.5 system-ui,sans-serif; color:#94a3b8; }
.key-detail-stats .user-stat > strong { color:#7dd3fc; }

/* OOKO provider artwork, kept local and independent of upstream availability. */
.channel-icon { background: transparent; color: var(--text); }
.channel-icon img, .channel-icon svg { display: block; width: 24px; height: 24px; object-fit: contain; }

.channel-icon-monochrome { filter: brightness(0) invert(1); }

/* Language switching keeps forms and the current workspace intact. */
.language-toggle { min-width: 66px; white-space: nowrap; font-size: 12px; }
.login-language { display: flex; justify-content: flex-end; margin-top: -6px; }
html[lang="en"] .channel-text strong { white-space: normal; }
html[lang="en"] .nav button { white-space: normal; }
html[lang="en"] .record-health .badge { white-space: normal; }
html[lang="en"] .field label, html[lang="en"] .stat-label { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  html[lang="en"] .nav button { font-size: 11px; padding-inline: 8px; }
  html[lang="en"] .record-type-tabs button { padding-inline: 10px; }
  .language-toggle { min-width: 58px; }
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h2 { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.modal-head .language-toggle { flex: none; }
@media (max-width: 640px) {
  html[lang="en"] .users-compact-table td:nth-child(3)::before { content: "Today's points"; }
  html[lang="en"] .users-compact-table td:nth-child(4)::before { content: 'Total points'; }
  html[lang="en"] .users-compact-table td:nth-child(5)::before { content: 'Team size'; }
  html[lang="en"] .users-compact-table td:nth-child(6)::before { content: 'Created'; }
}

/* Compact workspace rhythm: shared spacing, not oversized dashboard tiles. */
.app-shell main { padding:22px 24px; max-width:none; }
.view { gap:12px; align-content:start; }
.card { padding:18px; }
.card-head { margin-bottom:12px; gap:10px; }
.card-head .hint { margin-top:4px; }
.field { margin-bottom:12px; }
.project { padding:12px 14px; }
.users-toolbar { margin-bottom:12px; gap:10px; }
.user-stat { padding:12px 14px; }
.user-dashboard { gap:10px; }
.record-tabs-workspace { gap:10px; }
.record-tabs-workspace > .record-type-tabs { padding:4px; border-radius:12px; }
.record-tabs-workspace > .record-type-tabs > button { min-height:34px; min-width:112px; padding:6px 16px; border-radius:8px; }
.records-workspace > .card { padding:12px 0 0; }
.records-workspace .card-head { margin-bottom:8px; }
.records-workspace .card-head h2 { font-size:20px; }
.records-workspace .card-head + .hint { display:flex; align-items:center; flex-wrap:wrap; gap:6px 10px; margin:0 0 10px; }
.records-workspace .points-summary { gap:8px 10px; margin:10px 0; }
.records-workspace .points-summary > div:not(.group-usage-section) { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 18px; border-radius:12px; min-height:68px; }
.records-workspace .points-summary > div > strong { margin:0; font-size:28px; line-height:1.2; }
.records-workspace .points-summary > div > .hint { font-size:12px; }
.records-workspace .records-group-breakdown { padding:9px 12px; border-radius:10px; }
.records-workspace .records-group-breakdown .group-usage-list { margin-top:10px; }
.records-workspace .records-overview { padding:8px 0; }
.overview-heading { gap:6px; }
.health-shortcuts { gap:7px; margin:8px 0; }
.health-filter { display:flex; align-items:center; justify-content:space-between; gap:6px; padding:10px; border-radius:10px; min-height:46px; }
.health-filter > span { padding:3px 7px; font-size:11px; }
.health-filter strong { margin:0; font-size:20px; line-height:1.15; }
.records-workspace .records-tools { padding:12px; margin:0 0 12px; border-radius:12px; }
.records-workspace .records-toolbar { gap:10px; }
.records-workspace .records-primary-filters { grid-template-columns:1fr; }
.records-workspace .records-primary-filters .field { display:flex; align-items:center; gap:8px; }
.records-workspace .records-primary-filters label { white-space:nowrap; margin:0; }
.records-workspace .records-primary-filters select { min-width:140px; }
.records-advanced { margin-top:8px; }
.records-pagination { padding-top:12px; }
.key-buckets { margin:8px 0; }
.channel { padding:10px 12px; }
@media (min-width: 761px) {
 .app-shell .topbar { width:200px; padding:22px 14px 16px; gap:18px; }
 .app-shell main { margin-left:200px; }
 .app-shell .brand { padding:0 6px 8px; }
 .app-shell .nav { gap:5px; }
 .app-shell .nav button { padding:10px 12px; min-height:42px; }
 .app-shell .brand-subtitle { letter-spacing:1px; }
}
@media (min-width:1500px) { .app-shell main { padding:24px 32px; } }
@media (max-width:1000px) and (min-width:761px) {
 .health-shortcuts { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width:760px) {
 .app-shell main { margin-left:0; padding:14px 12px; }
 .card { padding:14px; }
 .records-workspace > .card { padding:4px 0 0; }
 .record-tabs-workspace > .record-type-tabs > button { min-height:38px; padding:7px 12px; }
 .records-workspace .points-summary > div:not(.group-usage-section) { padding:12px; gap:6px; min-height:72px; flex-direction:column; align-items:flex-start; }
 .records-workspace .points-summary > div > strong { font-size:26px; }
 .health-shortcuts { grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
 .health-filter { padding:9px 7px; min-height:44px; }
 .health-filter > span { font-size:10px; padding:3px 5px; }
 .health-filter strong { font-size:18px; }
 .records-workspace .records-toolbar { flex-wrap:wrap; }
 .records-workspace .records-primary-filters { width:100%; }
 .records-workspace .records-primary-filters .field { flex:1; }
 .records-workspace .records-primary-filters select { flex:1; min-width:0; }
 .records-workspace .records-tools { padding:10px; }
 .records-workspace .card-head h2 { font-size:18px; }
 html[lang="en"] .health-filter { flex-wrap:wrap; align-content:center; }
 html[lang="en"] .health-filter > span { white-space:normal; }
}

/* Official Key routing: a single compact configuration surface. */
.official-platforms { display:flex; flex-direction:column; gap:14px; }
.official-routing { min-width:0; overflow:hidden; background:#0b1120; border-radius:14px; }
.official-routing-summary { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:18px 20px; }
.official-routing-summary strong { font-size:15px; }
.official-routing-summary .hint { margin:4px 0 0; font-size:12px; }
.official-routing-columns,.official-route-row { display:grid; grid-template-columns:minmax(190px,1fr) minmax(200px,1fr) 130px 84px; align-items:center; gap:20px; padding:10px 20px; }
.official-routing-columns { background:#ffffff03; color:#8492a6; font-size:11px; }
.official-route-row { min-height:58px; box-sizing:border-box; transition:background .16s ease; }
.official-route-row + .official-route-row { box-shadow:0 -1px 0 #ffffff05; }
.official-route-row:hover { background:#ffffff03; }
.official-route-identity { display:flex; align-items:center; gap:12px; min-width:0; }
.official-route-identity strong { font-size:13px; font-weight:600; overflow-wrap:anywhere; }
.official-route-identity > :first-child { width:28px!important; height:28px!important; min-width:28px; flex-shrink:0; }
.official-route-identity img,.official-route-identity svg { width:26px!important; height:26px!important; }
.official-route-control { min-width:0; }
.official-route-control select { width:100%; max-width:100%; height:34px; min-height:34px; padding:5px 30px 5px 10px; border:1px solid #ffffff12; border-radius:8px; background-color:#111827; font-size:12px; cursor:pointer; transition:border-color .16s,box-shadow .16s; }
.official-route-control select:hover { border-color:#64748b; }
.official-route-control select:focus-visible { outline:0; border-color:#60a5fa; box-shadow:0 0 0 3px #3b82f61a; }
.official-route-status { display:inline-flex; align-items:center; justify-content:center; gap:6px; border-radius:20px; padding:5px 8px; font-size:11px; white-space:nowrap; color:#94a3b8; background:#64748b12; }
.official-route-status::before { content:''; width:5px; height:5px; border-radius:50%; background:currentColor; }
.official-route-status[data-enabled="true"] { color:#34d399; background:#10b9810d; }
.official-connections { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr)); gap:10px; }
.official-connection { min-width:0; border-radius:12px; background:#0b1120; }
.official-connection summary { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px 18px; cursor:pointer; list-style:none; }
.official-connection summary::-webkit-details-marker { display:none; }
.official-connection summary::after { content:'⌄'; color:#94a3b8; transition:transform .16s; }
.official-connection[open] summary::after { transform:rotate(180deg); }
.official-connection-title { display:flex; align-items:center; gap:12px; flex:1; min-width:0; flex-wrap:wrap; }
.official-connection-title strong { font-size:13px; }
.official-connection-title .hint { font-size:11px; }
.official-connection .badge { font-size:11px; padding:4px 9px; }
.official-connection-detail { padding:0 18px 16px; }
.official-connection-tags { display:flex; gap:6px; flex-wrap:wrap; }
.official-connection-tags > span { font-size:11px; color:#94a3b8; padding:4px 8px; border-radius:6px; background:#ffffff04; }
@media(max-width:640px) {
 .official-routing-summary { padding:14px; }
 .official-routing-columns { display:none; }
 .official-route-row { grid-template-columns:minmax(0,1fr) auto; gap:10px; padding:12px 14px; }
 .official-route-control { grid-column:1 / -1; grid-row:2; }
 .official-route-status { grid-column:2; grid-row:1; }
 .official-route-demand { grid-column:1 / -1; grid-row:3; }
 .official-route-identity strong { font-size:12px; }
 .official-connection summary { padding:12px 14px; gap:8px; }
}

/* Optional white and blue theme. Dark appearance remains independently selectable. */
.login-story { display:none; }
.login-welcome { margin:12px 0 22px; }
.login-welcome h2 { margin-top:5px; font-size:24px; }
.login-language { display:flex; justify-content:flex-end; gap:8px; flex-wrap:wrap; }
html[data-theme="light"] { color-scheme:light; --bg:#f3f6fc; --surface:#fff; --surface-2:#f1f5fc; --border:#e0e7f2; --text:#243b60; --muted:#71829d; --accent:#466be8; --accent-text:#fff; --accent-soft:#eaf0ff; --ok:#178667; --ok-soft:#e7f6ef; --danger:#c34962; --danger-soft:#fff0f3; --warn:#ad761d; --warn-soft:#fff6e7; --info:#4169cc; --info-soft:#edf3ff; --shadow:0 8px 30px #345b9b08; }
html[data-theme="light"] body { background:#f3f6fc; color:#243b60; }
html[data-theme="light"] :is(.topbar,.card,.modal,.dialog,.account-record-list,.official-routing,.official-connection,.official-platform,.health-filter,.record-type-tabs,.records-workspace .account-record-list,.users-compact-table tbody tr) { background:#fff; color:#243b60; border-color:#e0e7f2; box-shadow:0 6px 28px #345b9b07; }
html[data-theme="light"] :is(h1,h2,h3,strong,.brand,.record-title,.user-name,.who,.nav button,.stat-value,.points-value,.key-revenue strong) { color:#243b60; }
html[data-theme="light"] :is(.hint,.sub,.muted,.brand-subtitle,.official-routing-columns,th,label) { color:#71829d; }
html[data-theme="light"] :is(input,select,textarea,.records-toolbar input,.records-toolbar select,.official-route-control select) { background:#f9fbff; color:#243b60; border:1px solid #dce5f3; box-shadow:none; }
html[data-theme="light"] :is(input,select,textarea):focus { border-color:#6685ee; box-shadow:0 0 0 3px #466be814; outline:none; }
html[data-theme="light"] ::placeholder { color:#8c9cb6; }
html[data-theme="light"] :is(.btn,.account .btn,.segmented button,.record-type-tabs button,.key-buckets button) { background:#f6f8fd; color:#526b91; border-color:#e0e7f2; box-shadow:none; }
html[data-theme="light"] :is(.btn:hover,.account .btn:hover,.app-shell .nav button:hover) { background:#edf2ff; color:#365dce; border-color:#cbd8fa; }
html[data-theme="light"] :is(.btn-primary,.btn-primary:hover) { background:#466be8; color:white; border-color:transparent; box-shadow:0 4px 12px #466be81c; }
html[data-theme="light"] :is(.app-shell .nav button.active,.app-shell .nav button[aria-current=page],.record-type-tabs button[aria-selected=true],.segmented button.active,.segmented button[aria-pressed=true],.health-filter.active,.key-buckets button[aria-pressed=true]) { background:#eaf0ff; color:#4268df; border-color:#466be8; box-shadow:none; }
html[data-theme="light"] :is(.account-record,.official-route-row,.users-compact-table td) { background:transparent; border-color:#edf1f8; color:#334a6b; }
html[data-theme="light"] :is(.account-record:hover,.official-route-row:hover,tbody tr:hover) { background:#f7faff; }
html[data-theme="light"] :is(.official-channel,.user-amount,.compact-points-card,.slim-window,.record-points,.points-card,.official-routing-columns,.official-connection-tags > span) { background:#f3f6fc; color:#526b91; }
html[data-theme="light"] :is(.official-route-status[data-enabled=true],.badge-ok,.status-healthy) { background:#e9f8f1; color:#198366; }
html[data-theme="light"] :is(.badge-danger,.form-error,.text-danger) { color:#bf4662; }
html[data-theme="light"] .official-route-status { color:#8090a6; background:#f0f3f8; }
html[data-theme="light"] .channel-icon-monochrome { filter:none; }
html[data-theme="light"] .toast { background:#fff; color:#243b60; border-color:#dce5f3; box-shadow:0 8px 32px #345b9b18; }
html[data-theme="light"] .toast-error { background:#fff3f5; color:#b13d56; }
html[data-theme="light"] .login-wrap { display:grid; grid-template-columns:minmax(0,1fr) minmax(320px,440px); align-items:center; gap:70px; max-width:1180px; padding:72px 48px; min-height:100dvh; margin:auto; background:radial-gradient(ellipse at 25% 65%,#dfE9ff80,transparent 65%); }
html[data-theme="light"] .login-story { display:block; position:relative; }
html[data-theme="light"] .login-story-brand { display:inline-block; vertical-align:top; margin:10px 12px; font-weight:700; letter-spacing:2px; }
html[data-theme="light"] .login-story h2 { font-size:clamp(30px,3.5vw,48px); line-height:1.65; font-weight:550; margin:70px 0 28px; letter-spacing:1px; }
html[data-theme="light"] .login-story h2 span { color:#5678cc; }
html[data-theme="light"] .login-story p { color:#7386a6; line-height:1.9; font-size:14px; }
html[data-theme="light"] .login-card { width:100%; max-width:none; padding:36px; border:0; border-radius:28px; box-shadow:0 24px 80px #476fba0b; }
html[data-theme="light"] .login-card .brand { margin-bottom:18px; }
html[data-theme="light"] .login-card input { height:46px; border-radius:12px; }
html[data-theme="light"] .login-card .btn-primary { min-height:46px; border-radius:12px; }
@media(max-width:760px) {
 html[data-theme="light"] .login-wrap { grid-template-columns:minmax(0,1fr); gap:28px; padding:28px 18px; max-width:480px; }
 html[data-theme="light"] .login-story h2 { margin:20px 0 8px; font-size:27px; line-height:1.45; }
 html[data-theme="light"] .login-story p { font-size:12px; }
 html[data-theme="light"] .login-story > img,html[data-theme="light"] .login-story-brand { display:none; }
 html[data-theme="light"] .login-card { padding:26px 22px; border-radius:22px; }
}
.login-card .login-language .btn { width:auto; flex:0 0 auto; }
html[data-theme="light"] .login-card .login-language { margin-bottom:14px; }
html[data-theme="light"] .app-shell .topbar { background:#fff; border-color:#e0e7f2; }
html[data-theme="light"] :is(.project[aria-checked=true],.health-filter.active) { background:#eaf0ff; border-color:#b8c9fa; }
html[data-theme="light"] :is(.records-overview,.points-summary,.pool-rpm-panel,.segmented,.account-record-meta,.account-record .compact-points-card,.account-record .slim-window,.user-amount) { background:#f1f5fd; border-color:#e0e7f2; color:#526b91; }
html[data-theme="light"] :is(.points-summary strong,.rpm-total > strong,.account-record-meta strong,.account-record .compact-points-card .usage-grid strong,.window-caption strong) { color:#4268d3; }
html[data-theme="light"] :is(select.target-pool-select,select.target-pool-select:hover,select.target-pool-select option) { background:#f9fbff; border-color:#dce5f3; color:#243b60; }
html[data-theme="light"] :is(.window-empty,.account-record .slim-window progress,.account-record .slim-window progress::-webkit-progress-bar) { background:#e4ebf7; }
html[data-theme="light"] .project { color:#243b60; }

/* Refined light palette: neutral surfaces, ink typography, restrained blue. */
html[data-theme="light"] { --bg:#f7f8fc; --surface:#fff; --surface-2:#f5f6f9; --text:#202d45; --muted:#657087; --border:#e6e9f0; --accent:#4569e6; --accent-soft:#edf2ff; }
html[data-theme="light"] body { background:#f7f8fc; color:#202d45; }
html[data-theme="light"] :is(h1,h2,h3,strong,.brand,.record-title,.user-name,.who,.stat-value,.points-value,.key-revenue strong) { color:#202d45; }
html[data-theme="light"] :is(.hint,.sub,.muted,.brand-subtitle,.official-routing-columns,th,label) { color:#657087; }
html[data-theme="light"] :is(.card,.modal,.dialog,.health-filter,.official-routing,.official-connection) { background:#fff; color:#202d45; border:1px solid #e9ecf3; box-shadow:0 2px 5px #1f365003,0 12px 32px #1f365005; }
html[data-theme="light"] .app-shell .topbar { background:#fff; border-color:#e9ecf3; box-shadow:none; }
html[data-theme="light"] .app-shell .nav button { color:#657087; font-weight:500; }
html[data-theme="light"] .app-shell .nav button[aria-current=page] { color:#375bd1; background:#eef2ff; font-weight:650; }
html[data-theme="light"] :is(.records-overview,.points-summary,.pool-rpm-panel,.account-record-meta,.account-record .compact-points-card,.user-amount,.points-card,.record-points) { background:#f8f9fc; color:#4c5870; border-color:#e9ecf3; box-shadow:none; }
html[data-theme="light"] :is(.points-summary strong,.rpm-total > strong,.account-record-meta strong,.account-record .compact-points-card .usage-grid strong,.window-caption strong) { color:#202d45; }
html[data-theme="light"] :is(input,textarea,select,.official-route-control select,select.target-pool-select,select.target-pool-select:hover) { background:#fcfdff; color:#202d45; border-color:#dfe5ef; }
html[data-theme="light"] :is(input,select,textarea):disabled { opacity:1; background:#f7f8fa; color:#8992a3; border-color:#edf0f4; }
html[data-theme="light"] :is(.btn,.app-shell .account .btn) { background:#fff; color:#4c5870; border-color:#e3e7ef; font-weight:500; }
html[data-theme="light"] .btn-primary { background:#4569e6; color:#fff; border-color:#4569e6; box-shadow:0 4px 10px #4569e61a; }
html[data-theme="light"] .btn-primary:hover { background:#385bd5; color:#fff; }
html[data-theme="light"] .btn:disabled { opacity:.55; }
html[data-theme="light"] :is(.badge-danger,.status-error) { background:#fff0f2; color:#b63a53; }
html[data-theme="light"] :is(.badge-warn,.status-warning) { background:#fff6e5; color:#946011; }
html[data-theme="light"] :is(.badge-ok,.official-route-status[data-enabled=true]) { background:#edf8f2; color:#207b59; }
html[data-theme="light"] .health-filter > strong { color:#202d45; }
html[data-theme="light"] .official-routing-columns { background:#fafbfe; }
html[data-theme="light"] .official-route-row + .official-route-row { box-shadow:0 -1px 0 #eef0f5; }
html[data-theme="light"] .login-wrap { max-width:1320px; grid-template-columns:minmax(0,1fr) minmax(360px,460px); padding:80px 64px; gap:100px; background:none; }
html[data-theme="light"] body:has(.login-wrap) { background:radial-gradient(ellipse at 24% 72%,#eaf0ff 0,transparent 55%),#f7f9fd; }
html[data-theme="light"] .login-story { padding-bottom:24px; isolation:isolate; }
html[data-theme="light"] .login-story::after { content:''; position:absolute; z-index:-1; inset:-80px -50px -100px 38%; opacity:.45; background-image:radial-gradient(#b5c8f1 .8px,transparent .9px); background-size:10px 10px; mask-image:radial-gradient(ellipse at center,#0008,transparent 68%); transform:rotate(10deg); pointer-events:none; }
html[data-theme="light"] .login-story h2 { font-size:clamp(32px,3.7vw,50px); line-height:1.6; font-weight:500; letter-spacing:2px; margin:82px 0 30px; }
html[data-theme="light"] .login-story h2 span { color:#5778c2; }
html[data-theme="light"] .login-story p { color:#657795; font-size:14px; max-width:320px; }
html[data-theme="light"] .login-card { position:relative; padding:42px; border:1px solid #ffffff; border-radius:30px; box-shadow:0 24px 80px #2f50800a; }
html[data-theme="light"] .login-card .brand { margin:0 0 42px; }
html[data-theme="light"] .login-card .brand h1 { font-size:21px; }
html[data-theme="light"] .login-card .brand-subtitle { font-size:9px; letter-spacing:1.5px; }
html[data-theme="light"] .login-card .login-language { position:absolute; right:26px; top:26px; gap:5px; }
html[data-theme="light"] .login-card .login-language .btn { border:0; background:transparent; padding:5px 7px; min-height:26px; font-size:11px; box-shadow:none; }
html[data-theme="light"] .login-welcome { margin:0 0 32px; }
html[data-theme="light"] .login-welcome > .hint { font-size:12px; letter-spacing:1px; }
html[data-theme="light"] .login-welcome h2 { font-size:28px; letter-spacing:.5px; font-weight:650; margin-top:8px; }
html[data-theme="light"] .login-card .field { margin-bottom:22px; }
html[data-theme="light"] .login-card label { color:#4c5e7c; font-weight:500; font-size:12px; margin-bottom:8px; }
html[data-theme="light"] .login-card input { height:50px; border-radius:12px; background:#fbfcff; padding:12px 15px; font-size:14px; }
html[data-theme="light"] .login-card .btn-primary { min-height:50px; margin-top:8px; font-size:14px; font-weight:550; letter-spacing:2px; box-shadow:none; }
@media(max-width:760px) {
 html[data-theme="light"] .login-wrap { grid-template-columns:minmax(0,1fr); padding:32px 20px; gap:26px; max-width:480px; }
 html[data-theme="light"] .login-story { padding:0 8px; }
 html[data-theme="light"] .login-story h2 { margin:10px 0 12px; font-size:29px; line-height:1.45; }
 html[data-theme="light"] .login-story p { font-size:12px; }
 html[data-theme="light"] .login-story::after { inset:-20px 0 -40px 40%; }
 html[data-theme="light"] .login-card { padding:32px 24px; border-radius:24px; }
 html[data-theme="light"] .login-card .login-language { right:16px; top:18px; }
 html[data-theme="light"] .login-card .brand { margin-bottom:30px; }
 html[data-theme="light"] .login-welcome h2 { font-size:24px; }
}
html[data-theme="light"] .login-card .btn.btn-primary { background:#4569e6; border-color:#4569e6; color:#fff; }
html[data-theme="light"] .login-card .btn.btn-primary:hover { background:#385bd5; border-color:#385bd5; color:#fff; }

/* Record pages: explicit scoped light surfaces override legacy dark components. */
html[data-theme="light"] .records-workspace > .card { padding:18px; background:#fff; border:1px solid #e9ecf3; box-shadow:none; }
html[data-theme="light"] .records-workspace .points-summary { background:transparent; border:0; box-shadow:none; }
html[data-theme="light"] .records-workspace .points-summary > div:not(.group-usage-section) { background:#f6f8fc; border:1px solid #e9edf5; box-shadow:none; border-radius:12px; }
html[data-theme="light"] .records-workspace .points-summary > div > strong { color:#202d45; }
html[data-theme="light"] .records-workspace .points-summary > div > .hint { color:#657087; }
html[data-theme="light"] .records-workspace .records-group-breakdown { background:#f8f9fc; border:1px solid #e9edf5; color:#4c5870; box-shadow:none; }
html[data-theme="light"] .records-workspace .records-group-breakdown summary { color:#4667c5; font-weight:550; }
html[data-theme="light"] .records-workspace .records-tools { background:#f8f9fc; border:1px solid #e9edf5; box-shadow:none; border-radius:12px; }
html[data-theme="light"] .records-workspace .records-overview { background:transparent; border:0; box-shadow:none; }
html[data-theme="light"] .records-workspace .health-filter { background:#fff; border:1px solid #e4e9f2; box-shadow:none; border-radius:10px; }
html[data-theme="light"] .records-workspace .health-filter.active { background:#edf2ff; border-color:#8299eb; }
html[data-theme="light"] .health-all > span { color:#365abf; background:#e8efff; }
html[data-theme="light"] .health-healthy > span { color:#207b59; background:#e9f7ef; }
html[data-theme="light"] :is(.health-abnormal,.health-possible_ban) > span { color:#916113; background:#fff4df; }
html[data-theme="light"] .health-banned > span { color:#b63a53; background:#ffedf1; }
html[data-theme="light"] .records-workspace .account-record-list { background:#fff; box-shadow:none; border:1px solid #e9edf5; }
html[data-theme="light"] .records-workspace .account-record { background:#fff; color:#202d45; border-color:#edf0f5; }
html[data-theme="light"] .records-workspace .account-record:hover { background:#fbfcff; }
html[data-theme="light"] .records-workspace .account-record .provider-usage-card.compact-points-card { background:#f8f9fc; color:#202d45; box-shadow:none; }
html[data-theme="light"] .group-usage-item { background:#fff; border-color:#e9edf5; color:#4c5870; }
html[data-theme="light"] .record-issue { background:#fff2f4; color:#a93d54; }
html[data-theme="light"] .record-issue > span { background:#ffe5eb; color:#b63a53; }
html[data-theme="light"] .records-workspace .records-toolbar .btn.btn-primary { background:#4569e6; color:#fff; border-color:#4569e6; }
@media(max-width:760px) { html[data-theme="light"] .records-workspace > .card { padding:12px; } }

/* Search-scoped account counts and subscription controls. */
.record-upload-summary { display:flex; flex-wrap:wrap; align-items:center; gap:8px 18px; padding:12px 14px; margin:4px 0 12px; border:1px solid var(--border); border-radius:12px; background:var(--surface-2); }
.record-upload-summary > strong { color:var(--text); font-size:16px; font-variant-numeric:tabular-nums; }
.record-upload-summary > small { flex:1 1 100%; line-height:1.6; }
.records-workspace .records-toolbar .records-primary-filters { display:flex; flex:0 1 auto; flex-wrap:wrap; gap:10px; }
.records-workspace .records-toolbar .records-primary-filters .field { display:flex; flex-direction:column; align-items:stretch; gap:4px; }
.records-workspace .records-toolbar .records-primary-filters label { position:static; width:auto; height:auto; clip-path:none; overflow:visible; }
.records-workspace .records-primary-filters select { width:100%; }
.users-workspace .user-dashboard { grid-template-columns:repeat(4,minmax(0,1fr)); }
.user-upload-count { white-space:nowrap; font-variant-numeric:tabular-nums; }
.user-upload-count > strong { display:block; font-size:16px; }
.cc-weight-policy-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin:16px 0 8px; }
.cc-weight-policy-fields .field { min-width:0; }
.cc-weight-policy-fields input { width:100%; }
@media(max-width:760px) {
 .records-workspace .records-toolbar .records-primary-filters { width:100%; flex:1 1 100%; }
 .records-workspace .records-toolbar .records-primary-filters .field { flex:1 1 130px; min-width:0; }
 .users-workspace .user-dashboard { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .users-workspace .user-dashboard .user-stat:first-child { grid-column:auto; }
 .users-workspace .users-compact-table td:nth-child(7) { grid-column:1 / -1; grid-row:5; padding-top:8px; border-top:1px solid var(--border); }
 .users-workspace .users-compact-table td:nth-child(7)::before { content:'已上号'; }
 html[lang="en"] .users-workspace .users-compact-table td:nth-child(7)::before { content:'Uploaded'; }
 .cc-weight-policy-fields { grid-template-columns:minmax(0,1fr); gap:8px; }
}

/* Official Key channel demand: admin RPM shortfall input and member-facing card badge. */
.official-route-demand { min-width:0; }
.official-route-demand input { width:100%; height:34px; min-height:34px; box-sizing:border-box; padding:5px 10px; border:1px solid #ffffff12; border-radius:8px; background-color:#111827; font-size:12px; font-variant-numeric:tabular-nums; }
.official-route-demand input:focus-visible { outline:0; border-color:#60a5fa; box-shadow:0 0 0 3px #3b82f61a; }
.channel-text .channel-demand { justify-self:start; margin-top:4px; padding:3px 9px; border-radius:999px; font-size:12px; font-weight:600; white-space:nowrap; font-variant-numeric:tabular-nums; color:#fbbf24; background:#f59e0b1f; }
html[data-theme="light"] .official-route-demand input { background:#fcfdff; color:#202d45; border-color:#dfe5ef; }
html[data-theme="light"] .channel-text .channel-demand { color:#a35a00; background:#fff3dc; }

/* 直推 points line in the user list, styled as a sibling of the Key line. */
.user-direct-amount { margin-top:2px; color:#c4b5fd; }
html[data-theme="light"] .user-direct-amount { color:#6d4fc4; }

/* Role filter beside the user search box; own row on phones so the search input keeps its width. */
.users-level-filter { min-width:120px; }
.users-toolbar form:has(.users-level-filter) { max-width:580px; }
@media(max-width:760px) {
 .users-workspace .users-toolbar form { flex-wrap:wrap; }
 .users-workspace .users-toolbar .users-level-filter { flex:1 1 100%; min-width:0; }
}

/* Pro / Max split under each points figure. */
.tier-points { margin-top:2px; color:#94a3b8; font:400 11px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace; font-variant-numeric:tabular-nums; white-space:nowrap; }
.user-direct-amount + .tier-points { color:#a78bfa; }
.user-stat .tier-points { margin:2px 0 4px; font-size:12px; }
.metric-value + .tier-points { font-size:12px; }
html[data-theme="light"] .tier-points { color:#6b7a90; }
html[data-theme="light"] .user-direct-amount + .tier-points { color:#6d4fc4; }

/* ===== UI pass 2026-11-18 (Claude): points split, users points matrix, mobile pools cards, form alignment ===== */
:root { --tier-pro:#34d399; --tier-max:#f5a524; --tier-unknown:#94a3b8; --pm-direct:#c4b5fd; }
html[data-theme="light"] { --tier-pro:#0f9f6e; --tier-max:#b86e00; --tier-unknown:#6b7a90; --pm-direct:#6d4fc4; }


/* Fields in a two-column row: never stretch label/input rows to the taller neighbour. */
.field { align-content:start; }

/* Shared dot */
.tier-dot { display:inline-block; width:7px; height:7px; border-radius:50%; flex:none; background:var(--tier-unknown); }
.tier-pro .tier-dot { background:var(--tier-pro); }
.tier-max .tier-dot { background:var(--tier-max); }

/* Chips: wrap freely, never overflow (records summary) */
.tier-chips { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; min-width:0; }
.tier-chip { display:inline-flex; align-items:center; gap:6px; padding:3px 9px; border-radius:999px; background:#ffffff0a; color:#94a3b8; font:500 12px/1.5 system-ui,sans-serif; white-space:nowrap; }
.tier-chip b { color:var(--text, #e2e8f0); font:600 12px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace; font-variant-numeric:tabular-nums; }
html[data-theme="light"] .tier-chip { background:#eef2f8; color:#5b6b82; }
html[data-theme="light"] .tier-chip b { color:#1f2a3d; }
.records-workspace .points-summary > div:not(.group-usage-section) { min-width:0; }
@media(min-width:761px) {
 .records-workspace .points-summary > div:not(.group-usage-section) { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; column-gap:16px; row-gap:0; }
 .records-workspace .points-summary > div:not(.group-usage-section) > strong { justify-self:end; white-space:nowrap; }
 .records-workspace .points-summary > div:not(.group-usage-section) > .hint { white-space:nowrap; }
 .records-workspace .points-summary .tier-chips { grid-column:1 / -1; justify-content:flex-end; margin-top:10px; }
}

/* Breakdown: proportion bar + aligned rows (user detail cards) */
.tier-breakdown { display:grid; gap:8px; margin:10px 0 6px; min-width:0; }
.tier-bar { display:flex; height:6px; border-radius:999px; overflow:hidden; background:#ffffff12; gap:2px; }
.tier-seg { min-width:3px; }
.tier-seg.tier-pro { background:var(--tier-pro); }
.tier-seg.tier-max { background:var(--tier-max); }
.tier-seg.tier-unknown { background:var(--tier-unknown); }
.tier-rows { display:grid; gap:3px; }
.tier-row { display:grid; grid-template-columns:auto minmax(0,1fr) auto 38px; align-items:center; gap:8px; font-size:12px; color:#94a3b8; }
.tier-row b { color:var(--text, #e2e8f0); font:600 12.5px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace; font-variant-numeric:tabular-nums; text-align:right; white-space:nowrap; }
.tier-row small { text-align:right; color:#64748b; font-size:11px; font-variant-numeric:tabular-nums; }
.tier-row .tier-label { white-space:nowrap; }
@media(max-width:760px) {
 .tier-row { grid-template-columns:auto auto minmax(0,1fr); gap:6px; }
 .tier-row small { display:none; }
 .tier-row b { font-size:11.5px; }
}
html[data-theme="light"] .tier-bar { background:#e6ebf3; }
html[data-theme="light"] .tier-row { color:#5b6b82; }
html[data-theme="light"] .tier-row b { color:#1f2a3d; }
.user-detail-stats .user-stat { min-width:0; align-content:start; }
.user-detail-stats .user-stat > strong { overflow-wrap:anywhere; }

/* Users list: own vs 直推 matrix */
.users-compact-table .user-amount.user-points-cell { max-width:none; min-width:210px; font-weight:400; }
.users-compact-table td:first-child { max-width:230px; }
.users-compact-table td:first-child .user-identity > div { min-width:0; overflow-wrap:anywhere; }
.points-matrix { display:grid; grid-template-columns:auto minmax(0,1fr) minmax(0,1fr); column-gap:10px; row-gap:2px; align-items:baseline; }
.points-matrix > * { font:500 12px/1.55 ui-monospace,SFMono-Regular,Menlo,monospace; font-variant-numeric:tabular-nums; text-align:right; white-space:nowrap; color:#cbd5e1; }
.points-matrix .pm-head { font:500 11px/1.4 system-ui,sans-serif; color:#64748b; padding-bottom:2px; }
.points-matrix .pm-label { display:inline-flex; align-items:center; gap:6px; justify-content:flex-start; text-align:left; font:500 11px/1.55 system-ui,sans-serif; color:#94a3b8; }
.points-matrix .pm-total { font-size:14.5px; font-weight:700; color:#f1f5f9; padding-bottom:3px; }
.points-matrix .pm-direct { color:var(--pm-direct); }
.points-matrix .pm-total.pm-direct { color:var(--pm-direct); }
.user-points-cell .user-key-amount { margin-top:8px; padding-top:6px; border-top:1px dashed #ffffff14; }
html[data-theme="light"] .points-matrix > * { color:#334155; }
html[data-theme="light"] .points-matrix .pm-total { color:#0f172a; }
html[data-theme="light"] .points-matrix .pm-direct, html[data-theme="light"] .points-matrix .pm-total.pm-direct { color:var(--pm-direct); }
html[data-theme="light"] .user-points-cell .user-key-amount { border-top-color:#e2e8f0; }

@media(max-width:760px) {
 /* Users cards: points cells take the full card width so the matrix never squeezes. */
 .users-workspace .users-compact-table td.user-points-cell { grid-column:1 / -1; min-width:0; font-family:inherit; font-size:inherit; }
 .users-workspace .users-compact-table tbody tr { grid-template-rows:none; }
 .users-workspace .users-compact-table td:nth-child(3) { grid-row:3; }
 .users-workspace .users-compact-table td:nth-child(4) { grid-row:4; }
 .users-workspace .users-compact-table td:nth-child(5) { grid-column:1; grid-row:5; }
 .users-workspace .users-compact-table td:nth-child(6) { grid-column:2; grid-row:5; }
 .users-workspace .users-compact-table td:nth-child(7) { grid-column:1 / -1; grid-row:6; }
 .users-workspace .users-compact-table td:nth-child(7)::before { content:'团队已上号'; }
 html[lang="en"] .users-workspace .users-compact-table td:nth-child(7)::before { content:'Team uploads'; }

 /* Pools table becomes cards, same pattern as the users list. */
 .pools-table { min-width:0; width:100%; }
 .pools-table thead { display:none; }
 .pools-table tbody { display:grid; gap:12px; }
 .pools-table tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 14px; padding:14px; border:1px solid var(--border); border-radius:12px; }
 .pools-table td { display:block; min-width:0 !important; padding:0; border:0; white-space:normal !important; overflow-wrap:anywhere; }
 .pools-table td:nth-child(1), .pools-table td:nth-child(3), .pools-table td:nth-child(7), .pools-table td:nth-child(8), .pools-table td:nth-child(9) { grid-column:1 / -1; }
 .pools-table td:nth-child(1) { padding-bottom:10px; border-bottom:1px solid var(--border); }
 .pools-table td:nth-child(n+2)::before { display:block; margin-bottom:4px; color:var(--muted); font:500 11px/1.4 system-ui,sans-serif; }
 .pools-table td:nth-child(2)::before { content:'协议'; }
 .pools-table td:nth-child(3)::before { content:'后台地址'; }
 .pools-table td:nth-child(4)::before { content:'配置'; }
 .pools-table td:nth-child(5)::before { content:'积分口径'; }
 .pools-table td:nth-child(6)::before { content:'状态'; }
 .pools-table td:nth-child(7)::before { content:'登录 / 连接测试'; }
 .pools-table td:nth-child(8)::before { content:'账号数据'; }
 .pools-table td:nth-child(9)::before { content:'操作'; }
 html[lang="en"] .pools-table td:nth-child(2)::before { content:'Protocol'; }
 html[lang="en"] .pools-table td:nth-child(3)::before { content:'Service URL'; }
 html[lang="en"] .pools-table td:nth-child(4)::before { content:'Settings'; }
 html[lang="en"] .pools-table td:nth-child(5)::before { content:'Points basis'; }
 html[lang="en"] .pools-table td:nth-child(6)::before { content:'Status'; }
 html[lang="en"] .pools-table td:nth-child(7)::before { content:'Login / connection test'; }
 html[lang="en"] .pools-table td:nth-child(8)::before { content:'Account data'; }
 html[lang="en"] .pools-table td:nth-child(9)::before { content:'Actions'; }
 .pools-table .actions { min-width:0; flex-wrap:wrap; }

 /* Official channel rows: the RPM input has no column header on phones. */
 .official-route-demand::before { content:'需求缺口 RPM'; display:block; margin-bottom:4px; color:var(--muted); font-size:11px; }
 html[lang="en"] .official-route-demand::before { content:'RPM shortfall'; }
}

/* ===================================================================================
   Light theme v2 "Ink" (Claude, 2026-11-18)
   Neutral white surfaces, ink typography, hairline borders; colour only carries status.
   Appended last so it supersedes the two earlier light layers; dark theme untouched.
   =================================================================================== */
html[data-theme="light"] {
  color-scheme: light;
  --bg:#f7f7f8; --surface:#ffffff; --surface-2:#f4f4f5; --border:#ebebef; --border-strong:#e1e1e6;
  --text:#18181b; --ink:#09090b; --muted:#71717a; --faint:#a1a1aa;
  --accent:#18181b; --accent-text:#ffffff; --accent-soft:#f4f4f5;
  --ok:#15803d; --ok-soft:#f0fdf4; --warn:#b45309; --warn-soft:#fffbeb; --danger:#dc2626; --danger-soft:#fef2f2;
  --info:#4338ca; --info-soft:#eef2ff;
  --tier-pro:#16a34a; --tier-max:#ea8a0c; --tier-unknown:#a1a1aa; --pm-direct:#6d28d9;
  --shadow:0 1px 2px rgb(16 24 40 / .04);
}
html[data-theme="light"] body { background:var(--bg); color:var(--text); }
html[data-theme="light"] body:not(#_) :is(h1,h2,h3,.brand,.record-title,.user-name,.stat-value,.points-value) { color:var(--ink); }
html[data-theme="light"] body:not(#_) :is(.hint,.sub,.muted,.brand-subtitle,th,.who) { color:var(--muted); }
html[data-theme="light"] body:not(#_) label { color:#3f3f46; }
html[data-theme="light"] body:not(#_) ::placeholder { color:var(--faint); }
html[data-theme="light"] body:not(#_) ::selection { background:#e4e4e7; }

/* ---- Shell: sidebar / top bar ---- */
html[data-theme="light"] body:not(#_) .app-shell .topbar { background:#fff; border-color:var(--border); box-shadow:none; }
html[data-theme="light"] body:not(#_) .app-shell .nav button { color:#52525b; background:transparent; border-color:transparent; font-weight:500; box-shadow:none; }
html[data-theme="light"] body:not(#_) .app-shell .nav button svg { color:#71717a; }
html[data-theme="light"] body:not(#_) .app-shell .nav button:hover { background:#f4f4f5; color:var(--ink); border-color:transparent; }
html[data-theme="light"] body:not(#_) .app-shell .nav button[aria-current=page] { background:#f4f4f5; color:var(--ink); font-weight:600; border-color:transparent; box-shadow:none; }
html[data-theme="light"] body:not(#_) .app-shell .nav button[aria-current=page] svg { color:var(--ink); }
html[data-theme="light"] body:not(#_) .app-shell .nav button[aria-current=page]::before { background:var(--ink); }

/* ---- Surfaces ---- */
html[data-theme="light"] body:not(#_) :is(.card,.modal,.dialog,.official-routing,.official-connection,.records-workspace > .card) { background:#fff; color:var(--text); border:1px solid var(--border); box-shadow:var(--shadow); }
html[data-theme="light"] body:not(#_) dialog.modal { border-radius:16px; box-shadow:0 24px 64px rgb(9 9 11 / .14), 0 2px 6px rgb(9 9 11 / .05); }
html[data-theme="light"] body:not(#_) dialog.modal::backdrop { background:rgb(9 9 11 / .32); }
html[data-theme="light"] body:not(#_) :is(.modal-head,.modal-foot) { border-color:var(--border); background:#fff; }

/* Panels that sit directly on the page get a white card look; panels nested inside a card go flat. */
html[data-theme="light"] body:not(#_) :is(.records-overview,.pool-rpm-panel,.user-stat,.records-workspace .records-tools,.records-workspace .records-group-breakdown,.group-usage-section) { background:#fff; border:1px solid var(--border); box-shadow:none; color:var(--text); }
html[data-theme="light"] body:not(#_) .records-workspace .records-overview { background:transparent; border:0; }
html[data-theme="light"] body:not(#_) .records-workspace .points-summary { background:transparent; border:0; box-shadow:none; }
html[data-theme="light"] body:not(#_) .records-workspace .points-summary > div:not(.group-usage-section) { background:#fff; border:1px solid var(--border); box-shadow:none; }
html[data-theme="light"] body:not(#_) :is(.points-summary strong,.records-workspace .points-summary > div > strong,.rpm-total > strong,.metric-value,.user-stat > strong) { color:var(--ink); }
html[data-theme="light"] body:not(#_) :is(.account-record-meta,.account-record .compact-points-card,.compact-points-card,.record-points,.points-card,.user-amount,.users-compact-table .user-amount,.users-workspace .users-compact-table .user-amount,.official-channel) { background:transparent; border-color:var(--border); box-shadow:none; color:var(--text); }
html[data-theme="light"] body:not(#_) .records-workspace .records-group-breakdown summary { color:var(--ink); font-weight:600; }

/* ---- Buttons ---- */
html[data-theme="light"] body:not(#_) .btn { background:#fff; color:var(--text); border:1px solid #e4e4e7; font-weight:500; box-shadow:0 1px 1px rgb(9 9 11 / .03); }
html[data-theme="light"] body:not(#_) .btn:hover { background:#f4f4f5; color:var(--ink); border-color:#d4d4d8; }
html[data-theme="light"] body:not(#_) .btn.btn-primary { background:var(--ink); color:#fff; border-color:var(--ink); box-shadow:0 1px 2px rgb(9 9 11 / .12); }
html[data-theme="light"] body:not(#_) .btn.btn-primary:hover { background:#27272a; border-color:#27272a; color:#fff; }
html[data-theme="light"] body:not(#_) .btn.btn-destructive { color:#dc2626; border-color:#f5d0d0; background:#fff; }
html[data-theme="light"] body:not(#_) .btn.btn-destructive:hover { background:#fef2f2; border-color:#f1b5b5; color:#b91c1c; }
html[data-theme="light"] body:not(#_) .btn:disabled, html[data-theme="light"] body:not(#_) .btn[disabled] { opacity:.45; box-shadow:none; }
html[data-theme="light"] body:not(#_) .btn-link { background:#fff; }

/* ---- Inputs ---- */
html[data-theme="light"] body:not(#_) :is(input,select,textarea,.records-toolbar input,.records-toolbar select,.official-route-control select,select.target-pool-select,select.target-pool-select:hover,.official-route-demand input) { background-color:#fff; color:var(--text); border:1px solid #e4e4e7; box-shadow:0 1px 1px rgb(9 9 11 / .02); }
html[data-theme="light"] body:not(#_) :is(input,select,textarea):hover { border-color:#d4d4d8; }
html[data-theme="light"] body:not(#_) :is(input,select,textarea):focus, html[data-theme="light"] body:not(#_) :is(input,select,textarea):focus-visible { border-color:#a1a1aa; box-shadow:0 0 0 3px rgb(24 24 27 / .07); outline:none; }
html[data-theme="light"] body:not(#_) :is(input,select,textarea):disabled { background:#fafafa; color:var(--faint); border-color:#f0f0f2; }
html[data-theme="light"] body:not(#_) input[type=checkbox], html[data-theme="light"] body:not(#_) input[type=radio] { accent-color:var(--ink); }
html[data-theme="light"] body:not(#_) .input-group .addon { background:#f4f4f5; color:#52525b; border-color:#e4e4e7; }

/* ---- Segmented controls & tabs ---- */
html[data-theme="light"] body:not(#_) :is(.segmented,.record-type-tabs,.key-buckets) { background:#f4f4f5; border:0; box-shadow:none; }
html[data-theme="light"] body:not(#_) :is(.segmented button,.record-type-tabs button,.key-buckets button) { background:transparent; color:var(--muted); border-color:transparent; box-shadow:none; }
html[data-theme="light"] body:not(#_) :is(.segmented button[aria-pressed=true],.segmented button.active,.record-type-tabs button[aria-selected=true],.key-buckets button[aria-pressed=true]) { background:#fff; color:var(--ink); border-color:transparent; font-weight:600; box-shadow:0 1px 2px rgb(9 9 11 / .08), 0 0 0 1px rgb(9 9 11 / .04); }

/* Project picker / channel cards */
html[data-theme="light"] body:not(#_) :is(.project,.channel) { background:#fff; color:var(--text); border:1px solid var(--border); box-shadow:none; }
html[data-theme="light"] body:not(#_) :is(.project:hover,.channel:hover) { background:#fafafa; border-color:#d4d4d8; }
html[data-theme="light"] body:not(#_) .project[aria-checked=true] { background:#fff; border-color:var(--ink); box-shadow:0 0 0 1px var(--ink); }
html[data-theme="light"] body:not(#_) .project strong { color:var(--ink); }
html[data-theme="light"] body:not(#_) .channel-text span { color:var(--muted); }

/* ---- Badges & status ---- */
html[data-theme="light"] body:not(#_) :is(.badge-ok,.status-healthy,.official-route-status[data-enabled=true]) { background:var(--ok-soft); color:var(--ok); box-shadow:inset 0 0 0 1px #dcfce7; }
html[data-theme="light"] body:not(#_) :is(.badge-warn,.status-warning) { background:var(--warn-soft); color:var(--warn); box-shadow:inset 0 0 0 1px #fef3c7; }
html[data-theme="light"] body:not(#_) :is(.badge-danger,.status-error,.status-abnormal) { background:var(--danger-soft); color:#b91c1c; box-shadow:inset 0 0 0 1px #fee2e2; }
html[data-theme="light"] body:not(#_) .badge-info { background:var(--info-soft); color:var(--info); box-shadow:inset 0 0 0 1px #e0e7ff; }
html[data-theme="light"] body:not(#_) :is(.badge-muted,.official-route-status) { background:#f4f4f5; color:#52525b; box-shadow:inset 0 0 0 1px #ececef; }
html[data-theme="light"] body:not(#_) :is(.form-error,.text-danger) { color:#dc2626; }
html[data-theme="light"] body:not(#_) .channel-text .channel-demand { color:#b45309; background:#fffbeb; box-shadow:inset 0 0 0 1px #fde68a; }

/* Health filters on the records page */
html[data-theme="light"] body:not(#_) .records-workspace .health-filter { background:#fff; border:1px solid var(--border); box-shadow:none; }
html[data-theme="light"] body:not(#_) .records-workspace .health-filter.active { background:#fff; border-color:var(--ink); box-shadow:0 0 0 1px var(--ink); }
html[data-theme="light"] body:not(#_) .health-filter > strong { color:var(--ink); }
html[data-theme="light"] body:not(#_) .health-all > span { color:#3f3f46; background:#f4f4f5; }
html[data-theme="light"] body:not(#_) .health-healthy > span { color:var(--ok); background:var(--ok-soft); }
html[data-theme="light"] body:not(#_) :is(.health-abnormal,.health-suspected,.health-possible_ban) > span { color:var(--warn); background:var(--warn-soft); }
html[data-theme="light"] body:not(#_) .health-banned > span { color:#b91c1c; background:var(--danger-soft); }

/* ---- Tables ---- */
html[data-theme="light"] body:not(#_) th { background:transparent; color:var(--muted); font-weight:500; border-color:var(--border); }
html[data-theme="light"] body:not(#_) :is(td,.users-compact-table td,.official-route-row) { border-color:#f0f0f2; color:var(--text); background:transparent; }
html[data-theme="light"] body:not(#_) :is(tbody tr:hover,.official-route-row:hover,.account-record:hover,.records-workspace .account-record:hover) { background:#fafafa; }
html[data-theme="light"] body:not(#_) .users-compact-table tbody tr { background:#fff; }
html[data-theme="light"] body:not(#_) .user-avatar { background:#f4f4f5; color:#3f3f46; box-shadow:inset 0 0 0 1px #e4e4e7; }
html[data-theme="light"] body:not(#_) .official-routing-columns { background:#fafafa; color:var(--muted); }
html[data-theme="light"] body:not(#_) .official-route-row + .official-route-row { box-shadow:0 -1px 0 #f0f0f2; }

/* ---- Records ---- */
html[data-theme="light"] body:not(#_) .records-workspace .account-record-list { background:#fff; border:1px solid var(--border); box-shadow:none; }
html[data-theme="light"] body:not(#_) .records-workspace .account-record { background:#fff; color:var(--text); border-color:#f0f0f2; }
html[data-theme="light"] body:not(#_) .record-account-name { color:var(--ink); }
html[data-theme="light"] body:not(#_) .record-points strong { color:var(--ink); }
html[data-theme="light"] body:not(#_) .usage-window.slim-window, html[data-theme="light"] body:not(#_) .account-record .slim-window { background:transparent; }
html[data-theme="light"] body:not(#_) .window-caption strong { color:var(--ink); }
html[data-theme="light"] body:not(#_) .window-empty { background:#f1f1f3; }
/* Progress tracks: the earlier light layer put ::-webkit-progress-bar inside :is(), which browsers drop. */
html[data-theme="light"] body:not(#_) .account-record .slim-window progress, html[data-theme="light"] body:not(#_) .usage-window progress { background:#f1f1f3; }
html[data-theme="light"] body:not(#_) .account-record .slim-window progress::-webkit-progress-bar { background:#f1f1f3; }
html[data-theme="light"] body:not(#_) .usage-window progress::-webkit-progress-bar { background:#f1f1f3; }
html[data-theme="light"] body:not(#_) .account-record .slim-window progress::-webkit-progress-value { background:#3f3f46; }
html[data-theme="light"] body:not(#_) .account-record .slim-window progress::-moz-progress-bar { background:#3f3f46; }
html[data-theme="light"] body:not(#_) .account-record .window-warn progress::-webkit-progress-value { background:#f59e0b; }
html[data-theme="light"] body:not(#_) .account-record .window-warn progress::-moz-progress-bar { background:#f59e0b; }
html[data-theme="light"] body:not(#_) .account-record .window-danger progress::-webkit-progress-value { background:#e11d48; }
html[data-theme="light"] body:not(#_) .account-record .window-danger progress::-moz-progress-bar { background:#e11d48; }
/* Issue strip: quiet inline note instead of a full-width pink band. */
html[data-theme="light"] body:not(#_) .record-issue { background:transparent; color:#b91c1c; border-top:1px dashed #f3d3d3; }
html[data-theme="light"] body:not(#_) .record-issue > span { background:var(--danger-soft); color:#b91c1c; box-shadow:inset 0 0 0 1px #fee2e2; }
html[data-theme="light"] body:not(#_) .record-extra summary { color:var(--muted); }

/* ---- Users ---- */
html[data-theme="light"] body:not(#_) .user-key-amount { color:#0369a1; }
html[data-theme="light"] body:not(#_) .user-key-amount > span { color:var(--muted); }
html[data-theme="light"] body:not(#_) .points-matrix > * { color:#3f3f46; }
html[data-theme="light"] body:not(#_) .points-matrix .pm-head { color:var(--faint); }
html[data-theme="light"] body:not(#_) .points-matrix .pm-label { color:var(--muted); }
html[data-theme="light"] body:not(#_) .points-matrix .pm-total { color:var(--ink); }
html[data-theme="light"] body:not(#_) :is(.points-matrix .pm-direct,.points-matrix .pm-total.pm-direct) { color:var(--pm-direct); }
html[data-theme="light"] body:not(#_) .user-points-cell .user-key-amount { border-top-color:#ececef; }
html[data-theme="light"] body:not(#_) .user-stat { box-shadow:none; }
html[data-theme="light"] body:not(#_) .tier-bar { background:#f1f1f3; }
html[data-theme="light"] body:not(#_) .tier-chip { background:#f4f4f5; color:#52525b; }
html[data-theme="light"] body:not(#_) :is(.tier-chip b,.tier-row b) { color:var(--ink); }
html[data-theme="light"] body:not(#_) .tier-row { color:var(--muted); }
html[data-theme="light"] body:not(#_) .user-action-item { background:#fff; }
html[data-theme="light"] body:not(#_) .user-action-item:hover { background:#f4f4f5; }

/* ---- Toast ---- */
html[data-theme="light"] body:not(#_) .toast { background:#fff; color:var(--text); border:1px solid var(--border); box-shadow:0 12px 32px rgb(9 9 11 / .10); }
html[data-theme="light"] body:not(#_) .toast-error { background:#fff; color:#b91c1c; border-color:#fecaca; }

/* ---- Login ---- */
html[data-theme="light"] body:not(#_):has(.login-wrap) { background:#fafafa; }
html[data-theme="light"] body:not(#_) .login-story::after { background-image:radial-gradient(#d4d4d8 .8px,transparent .9px); opacity:.55; }
html[data-theme="light"] body:not(#_) .login-story h2 { color:var(--ink); }
html[data-theme="light"] body:not(#_) .login-story h2 span { color:var(--faint); }
html[data-theme="light"] body:not(#_) .login-story p { color:var(--muted); }
html[data-theme="light"] body:not(#_) .login-card { background:#fff; border:1px solid var(--border); box-shadow:0 1px 2px rgb(9 9 11 / .04), 0 16px 48px rgb(9 9 11 / .06); }
html[data-theme="light"] body:not(#_) .login-card label { color:#3f3f46; }
html[data-theme="light"] body:not(#_) .login-card input { background:#fff; }
html[data-theme="light"] body:not(#_) .login-card .login-language .btn { background:transparent; border:0; box-shadow:none; color:var(--muted); }
html[data-theme="light"] body:not(#_) .login-card .login-language .btn:hover { color:var(--ink); background:#f4f4f5; }

/* Leftovers from the tint audit */
html[data-theme="light"] body:not(#_) tr { border-color:#f0f0f2; }
html[data-theme="light"] body:not(#_) .group-usage-item { border-color:var(--border); background:#fff; }
html[data-theme="light"] body:not(#_) .group-usage-item span { color:#52525b; }
html[data-theme="light"] body:not(#_) :is(.window-caption span,.window-remaining) { color:var(--muted); }
html[data-theme="light"] body:not(#_) .official-routing-columns span { color:var(--muted); }
html[data-theme="light"] body:not(#_) .tier-row small { color:var(--faint); }
html[data-theme="light"] body:not(#_) .records-workspace .health-filter.health-all.active { background:#fff; }
html[data-theme="light"] body:not(#_) :is(strong,b) { color:var(--ink); }
html[data-theme="light"] body:not(#_) .badge strong, html[data-theme="light"] body:not(#_) .form-error strong { color:inherit; }

/* Both themes: a record's points figure never breaks mid-number on phones. */
@media(max-width:760px) {
 .records-workspace .record-points strong, .record-points strong { white-space:nowrap; overflow-wrap:normal; font-size:22px; }
}

/* Check-result dialog: readable label/value contrast in the light theme. */
html[data-theme="light"] .check-result-list dt { color:#64748b; }
html[data-theme="light"] .check-result-list dd { color:#1e293b; }

/* Records batch bar: select page / invert / clear, batch health check and batch weight. */
.records-batch { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px 16px; margin:12px 0 4px; padding:10px 14px; border:1px solid var(--border); border-radius:12px; background:var(--surface-2); }
.records-batch-select, .records-batch-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; min-width:0; }
.records-batch .record-select-all { margin-right:4px; }
.records-batch .record-select-all input { width:16px; height:16px; margin:0; accent-color:var(--accent); }
.records-batch .batch-progress { font-variant-numeric:tabular-nums; }
.batch-result-list > div { grid-template-columns:minmax(0,220px) minmax(0,1fr); }
.batch-result-list dt { overflow-wrap:anywhere; }
html[data-theme="light"] .record-check-feedback { color:#0369a1; }
html[data-theme="light"] .record-check-feedback.check-failed { color:#be123c; }
@media(max-width:760px) {
 .records-batch { padding:10px 12px; }
 .records-batch-actions { width:100%; }
 .records-batch-actions .btn { flex:1 1 auto; }
 .batch-result-list > div { grid-template-columns:minmax(0,1fr); }
}

/* Live total RPM: distinct emerald figure, smooth roll between readings, millisecond update stamp. */
.rpm-total .rpm-label { display:grid; gap:4px; min-width:0; }
.rpm-total .rpm-updated { font-size:12px; font-variant-numeric:tabular-nums; }
.pool-rpm-panel .rpm-total > strong.rpm-value { color:#34d399; font-variant-numeric:tabular-nums; }
html[data-theme="light"] body:not(#_) .pool-rpm-panel .rpm-total > strong.rpm-value { color:#059669; }

/* 已限流 status chip and filter card (both themes); seven overview cards on wide screens. */
.health-rate_limited > span { color:#fb923c; background:rgb(249 115 22 / .12); }
.status-rate_limited.badge-warn { color:#fb923c; background:rgb(249 115 22 / .12); }
html[data-theme="light"] body:not(#_) .health-rate_limited > span, html[data-theme="light"] body:not(#_) .status-rate_limited.badge-warn { color:#c2410c; background:#fff7ed; box-shadow:inset 0 0 0 1px #fed7aa; }
@media(min-width:1001px) { .health-shortcuts { grid-template-columns:repeat(7,minmax(0,1fr)); } }
@media (max-width:1000px) and (min-width:761px) { .health-shortcuts { grid-template-columns:repeat(4,minmax(0,1fr)); } }
@media(max-width:760px) { .health-shortcuts { grid-template-columns:repeat(4,minmax(0,1fr)); } }
@media(max-width:420px) { .health-shortcuts { grid-template-columns:repeat(3,minmax(0,1fr)); } }




/* Authenticated home announcement; administrator text stays plain and wraps. */
.home-announcement { min-width:0; border-left:3px solid #647bf0; }
.home-announcement[hidden] { display:none; }
.announcement-heading { display:flex; align-items:center; flex-wrap:wrap; gap:8px 14px; margin-bottom:10px; }
.announcement-label { display:inline-flex; padding:3px 8px; border-radius:6px; background:#26335d; color:#bbc9ff; font-size:11px; font-weight:600; letter-spacing:1px; }
.announcement-title { margin:0 0 10px; color:var(--text); font-size:18px; line-height:1.55; white-space:pre-wrap; overflow-wrap:anywhere; }
.announcement-content { color:var(--text); font-size:14px; line-height:1.8; white-space:pre-wrap; overflow-wrap:anywhere; word-break:normal; }
.announcement-load-error { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; }
.announcement-settings input,.announcement-settings textarea { width:100%; box-sizing:border-box; }
.announcement-settings textarea { resize:vertical; min-height:160px; white-space:pre-wrap; overflow-wrap:anywhere; }
html[data-theme="light"] .home-announcement { background:#fff; border-color:#e0e7f2; border-left-color:#5778e8; }
html[data-theme="light"] .announcement-label { background:#edf2ff; color:#4567c7; }
@media(max-width:760px) {
 .home-announcement { padding:14px; }
 .announcement-title { font-size:16px; }
 .announcement-content { font-size:13px; line-height:1.75; }
 .announcement-heading .hint { font-size:11px; }
 .announcement-settings .modal-foot { flex-wrap:wrap; }
}

/* 当日最快一分钟积分（今日积分卡片内） */
.peak-minute { grid-column:1 / -1; display:flex; flex-wrap:wrap; align-items:baseline; justify-content:flex-end; gap:4px 6px; margin-top:6px; font-size:12px; color:var(--muted); }
.peak-minute b { color:var(--text); font:600 13px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace; font-variant-numeric:tabular-nums; }
@media(max-width:760px) { .peak-minute { justify-content:flex-start; } }

/* Fable 积分卡片：数字用紫色区分 */
.fable-detail-stats .user-stat > strong { color:#c4b5fd; }
html[data-theme="light"] body:not(#_) .fable-detail-stats .user-stat > strong { color:#6d28d9; }

/* Pool visibility: per-group user access dialog. */
.pool-access-note { margin-top:6px; }
.pool-access-tools { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:10px 0; }
.pool-access-tools input[type=search] { flex:1 1 220px; min-width:0; }
.pool-access-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:6px; max-height:min(52vh,460px); overflow:auto; padding:8px; border:1px solid var(--border); border-radius:10px; }
.pool-access-item { display:flex; align-items:center; gap:8px; padding:6px 8px; border-radius:8px; cursor:pointer; min-width:0; }
.pool-access-item:hover { background:var(--surface-2); }
.pool-access-item input { width:16px; height:16px; margin:0; flex:none; accent-color:var(--accent); }
.pool-access-name { font-weight:600; overflow-wrap:anywhere; }
.pool-access-item small { margin-left:auto; white-space:nowrap; }
@media(max-width:760px) { .pool-access-list { grid-template-columns:minmax(0,1fr); } }

/* 管理员：活跃账号剩余可产出积分（全部记录页，独占一行） */
.records-workspace .points-summary > .remaining-points-card { grid-column:1 / -1; }
.records-workspace .points-summary > .remaining-points-card > strong { color:#34d399; }
html[data-theme="light"] body:not(#_) .records-workspace .points-summary > .remaining-points-card > strong { color:#059669; }

/* Pool access: visible-to-all switch. */
.pool-access-all { display:flex; align-items:flex-start; gap:10px; padding:12px 14px; margin-bottom:10px; border:1px solid var(--border); border-radius:10px; background:var(--surface-2); cursor:pointer; }
.pool-access-all input { width:18px; height:18px; margin:2px 0 0; flex:none; accent-color:var(--accent); }
.pool-access-all span { display:grid; gap:2px; min-width:0; }
.pool-access-list.pool-access-off { opacity:.45; pointer-events:none; }

/* Onboarding account counts: independent of the blue theme accent. */
.pool-rpm-panel .onboard-account-counts {display:flex;flex-wrap:wrap;gap:8px 24px;margin-top:10px;font-size:13px;line-height:1.5;}
.pool-rpm-panel .onboard-account-counts b {font-size:18px;font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap;margin-left:6px;}
.pool-rpm-panel .account-count-active {color:#6ee7b7;}
.pool-rpm-panel .account-count-total {color:#fcd34d;}
html[data-theme="light"] body:not(#_) .pool-rpm-panel .account-count-active {color:#047857;}
html[data-theme="light"] body:not(#_) .pool-rpm-panel .account-count-total {color:#92400e;}

.pool-rpm-panel .account-count-healthy {color:#c4b5fd;}
html[data-theme="light"] body:not(#_) .pool-rpm-panel .account-count-healthy {color:#6d28d9;}

/* 目标分组标题旁的上错分组警告 */
.pool-plan-warning { display:inline-block; margin-left:10px; padding:2px 9px; border-radius:6px; font-size:12px; font-weight:600; line-height:1.6; color:#fca5a5; background:rgb(239 68 68 / .14); vertical-align:middle; }
html[data-theme="light"] body:not(#_) .pool-plan-warning { color:#b91c1c; background:#fef2f2; box-shadow:inset 0 0 0 1px #fecaca; }
@media(max-width:760px) { .pool-plan-warning { display:block; margin:6px 0 0; width:fit-content; } }

/* 结账中心 */
.settle-table { width:100%; border-collapse:collapse; font-size:13px; }
.settle-table th { text-align:left; font-weight:500; color:var(--muted); padding:8px 10px; border-bottom:1px solid var(--border); white-space:nowrap; }
.settle-table td { padding:10px; border-bottom:1px solid var(--border); vertical-align:top; }
.settle-table td.num, .settle-table .num { text-align:right; font-variant-numeric:tabular-nums; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; white-space:nowrap; }
.settle-table tfoot td { font-weight:600; border-bottom:0; }
.settle-table input { width:110px; min-width:0; }
.settle-voided td { opacity:.55; text-decoration:line-through; }
.settle-voided td:first-child { text-decoration:none; }
.settle-owe { color:#f59e0b; }
.settle-prepaid { color:#34d399; }
html[data-theme="light"] body:not(#_) .settle-owe { color:#b45309; }
html[data-theme="light"] body:not(#_) .settle-prepaid { color:#15803d; }
.users-toolbar .settle-filter input { width:auto; height:auto; min-width:0; min-height:0; margin:0; flex:none; }
.settle-view .settle-stats { grid-template-columns:repeat(4,minmax(0,1fr)); }
.settle-filter { display:inline-flex; align-items:center; gap:6px; font-size:13px; color:var(--muted); white-space:nowrap; }
.settle-stats { margin:14px 0; }
.settle-period { display:grid; gap:4px; margin:4px 0 12px; }
.settle-period strong { font-size:16px; }
.settle-breakdown { display:grid; gap:6px; margin:12px 0; }
.settle-breakdown summary { cursor:pointer; color:var(--muted); font-size:13px; }
.settle-total { font-size:16px; }
dialog.modal.settle-dialog { width:min(980px, calc(100vw - 32px)); max-width:min(980px, calc(100vw - 32px)); }
@media(max-width:760px) {
 .settle-view .settle-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .settle-overview thead { display:none; }
 .settle-overview tbody tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px 12px; padding:12px; border:1px solid var(--border); border-radius:12px; margin-bottom:10px; }
 .settle-overview td { border:0; padding:0; }
 .settle-overview td:first-child, .settle-overview td:last-child { grid-column:1 / -1; }
}

/* 结账：未结积分按分组分行 */
.settle-pool-lines { display:grid; gap:2px; margin-top:4px; font-size:12px; }
.settle-pool-lines > div { display:flex; justify-content:space-between; gap:12px; color:var(--muted); }
.settle-pool-lines b { font:600 12px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace; font-variant-numeric:tabular-nums; color:var(--text); white-space:nowrap; }
.user-stat .settle-pool-lines { margin:4px 0 6px; }

/* 结账 U 换算（÷6.7） */
.settle-usdt { font-size:12px; margin-top:2px; white-space:nowrap; font-variant-numeric:tabular-nums; }

/* 上号自动分组 */
.pool-auto { display:grid; gap:6px; padding:14px 16px; border:1px solid var(--border); border-radius:12px; margin:4px 0 8px; }
.pool-auto-main { display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; }
.pool-auto-main strong { font-size:18px; }
.pool-auto-stats { display:flex; flex-wrap:wrap; gap:6px 8px; font-size:12px; color:var(--muted); }
.pool-auto-stats span { padding:2px 9px; border-radius:999px; background:rgb(148 163 184 / .12); font-variant-numeric:tabular-nums; }
.pool-auto-stats span.active { color:var(--text); box-shadow:inset 0 0 0 1px var(--border); }

/* 上号页：代理延迟（号池服务器 → 代理） */
.proxy-latency { display:flex; flex-wrap:wrap; align-items:center; gap:6px 8px; margin:-4px 0 10px; font-size:13px; min-height:0; }
.proxy-latency:empty { display:none; }
.proxy-latency .form-error { margin:0; }
.latency-chip { display:inline-flex; align-items:baseline; gap:6px; padding:3px 10px; border-radius:999px; background:rgb(148 163 184 / .12); color:var(--muted); font-variant-numeric:tabular-nums; }
.latency-chip b { font-weight:600; }
html body:not(#_) .latency-chip.ok b { color:#059669; }
html body:not(#_) .latency-chip.warn b { color:#d97706; }
html body:not(#_) .latency-chip.bad b { color:#dc2626; }
html[data-theme="dark"] body:not(#_) .latency-chip.ok b { color:#34d399; }
html[data-theme="dark"] body:not(#_) .latency-chip.warn b { color:#fbbf24; }
html[data-theme="dark"] body:not(#_) .latency-chip.bad b { color:#f87171; }

/* 记录页：账号代理测试结果 */
.proxy-latency-note { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 8px; }
html body:not(#_) .proxy-verdict { display:inline-block; padding:1px 8px; border-radius:999px; font-size:12px; font-weight:600; background:rgb(148 163 184 / .14); color:var(--muted); }
html body:not(#_) .proxy-verdict.ok { background:rgb(16 185 129 / .12); color:#047857; }
html body:not(#_) .proxy-verdict.warn { background:rgb(245 158 11 / .14); color:#b45309; }
html body:not(#_) .proxy-verdict.bad { background:rgb(239 68 68 / .12); color:#b91c1c; }
html[data-theme="dark"] body:not(#_) .proxy-verdict.ok { color:#34d399; }
html[data-theme="dark"] body:not(#_) .proxy-verdict.warn { color:#fbbf24; }
html[data-theme="dark"] body:not(#_) .proxy-verdict.bad { color:#f87171; }
.record-proxy-issue { margin:0 0 8px; padding:6px 10px; border-radius:10px; background:rgb(239 68 68 / .05); font-size:12px; }
.record-health .proxy-verdict { align-self:center; }

/* Settlement: "since last settlement" row in breakdowns. */
.settle-late-row td { color:var(--muted); font-style:italic; }

/* 记录页工具栏（2026-11-30）：搜索单独一行，筛选下拉框下一行等宽排开，避免长分组名把搜索框挤没 */
html body:not(#_) .records-workspace .records-toolbar { display:flex; flex-wrap:wrap; align-items:stretch; gap:12px; }
html body:not(#_) .records-workspace .records-toolbar .records-search { flex:1 1 100%; min-width:0; margin:0; display:flex; align-items:center; gap:8px; flex-wrap:nowrap; }
html body:not(#_) .records-workspace .records-toolbar .records-search input { flex:1 1 auto; width:auto; min-width:0; max-width:none; }
html body:not(#_) .records-workspace .records-toolbar .records-search .btn { flex:0 0 auto; white-space:nowrap; }
html body:not(#_) .records-workspace .records-toolbar .records-primary-filters { flex:1 1 100%; width:100%; min-width:0; display:grid; grid-template-columns:repeat(auto-fit, minmax(160px, 1fr)); gap:10px 12px; }
html body:not(#_) .records-workspace .records-toolbar .records-primary-filters .field { min-width:0; margin:0; display:flex; flex-direction:column; align-items:stretch; gap:4px; }
html body:not(#_) .records-workspace .records-toolbar .records-primary-filters select { width:100%; min-width:0; max-width:100%; text-overflow:ellipsis; }
@media (max-width:540px) {
  html body:not(#_) .records-workspace .records-toolbar .records-search { flex-wrap:wrap; }
  html body:not(#_) .records-workspace .records-toolbar .records-search input { flex:1 1 100%; width:100%; }
}
@media (max-width:420px) {
  html body:not(#_) .records-workspace .records-toolbar .records-primary-filters { grid-template-columns:repeat(2, minmax(0, 1fr)); }
}

/* 全站下拉框（2026-11-30）：去掉系统双箭头，统一细线箭头、圆角、悬停 / 聚焦 / 禁用状态；不改各处原有高度和字号 */
html body:not(#_):not(#__) select:not([multiple]):not([size]) {
  -webkit-appearance:none; -moz-appearance:none; appearance:none;
  padding-left:12px; padding-right:38px;
  border-radius:10px;
  background-repeat:no-repeat; background-position:right 12px center; background-size:16px 16px;
  text-overflow:ellipsis; white-space:nowrap; overflow:hidden;
  cursor:pointer;
  transition:border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
html body:not(#_):not(#__) select:not([multiple]):not([size]):disabled { cursor:not-allowed; }
html[data-theme="light"] body:not(#_):not(#__) select:not([multiple]):not([size]) {
  background-color:#fff; background-image:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%3E%3Cpath%20d='M4%206l4%204%204-4'%20stroke='%2371717a'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E");
  color:#18181b; border:1px solid #e4e4e7; box-shadow:0 1px 2px rgb(9 9 11 / .04);
}
html[data-theme="light"] body:not(#_):not(#__) select:not([multiple]):not([size]):hover:not(:disabled) { border-color:#d4d4d8; background-color:#fafafa; }
html[data-theme="light"] body:not(#_):not(#__) select:not([multiple]):not([size]):focus, html[data-theme="light"] body:not(#_):not(#__) select:not([multiple]):not([size]):focus-visible { outline:none; border-color:#a1a1aa; box-shadow:0 0 0 3px rgb(24 24 27 / .08); background-color:#fff; }
html[data-theme="light"] body:not(#_):not(#__) select:not([multiple]):not([size]):disabled { background-color:#fafafa; background-image:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%3E%3Cpath%20d='M4%206l4%204%204-4'%20stroke='%23d4d4d8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E"); color:#a1a1aa; border-color:#f0f0f2; box-shadow:none; opacity:1; }
html[data-theme="light"] body:not(#_):not(#__) select:not([multiple]):not([size]) option { background:#fff; color:#18181b; }
html[data-theme="dark"] body:not(#_):not(#__) select:not([multiple]):not([size]) {
  background-color:#0f172a; background-image:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%3E%3Cpath%20d='M4%206l4%204%204-4'%20stroke='%2394a3b8'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E");
  color:#e2e8f0; border:1px solid #334155; box-shadow:0 1px 2px rgb(0 0 0 / .25);
}
html[data-theme="dark"] body:not(#_):not(#__) select:not([multiple]):not([size]):hover:not(:disabled) { border-color:#475569; background-color:#131d33; }
html[data-theme="dark"] body:not(#_):not(#__) select:not([multiple]):not([size]):focus, html[data-theme="dark"] body:not(#_):not(#__) select:not([multiple]):not([size]):focus-visible { outline:none; border-color:#64748b; box-shadow:0 0 0 3px rgb(148 163 184 / .22); }
html[data-theme="dark"] body:not(#_):not(#__) select:not([multiple]):not([size]):disabled { background-image:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%3E%3Cpath%20d='M4%206l4%204%204-4'%20stroke='%23475569'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E"); color:#64748b; border-color:#1e293b; opacity:1; }
html[data-theme="dark"] body:not(#_):not(#__) select:not([multiple]):not([size]) option { background:#0f172a; color:#e2e8f0; }

/* 跑量明细：普通积分 / Fable 积分 / 总积分 三块，每块 4 列（本人、直推、下级、本人＋团队）× 2 行（今日、累计） */
.user-detail-dialog .points-section-head { display:flex; align-items:baseline; gap:10px; margin:18px 0 8px; padding-top:14px; border-top:1px solid var(--border); }
.user-detail-dialog .points-section-head:first-of-type { border-top:0; padding-top:0; }
.user-detail-dialog .points-section-head h3 { margin:0; }
html body:not(#_) .user-detail-dialog .points-split-grid { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:10px; }
html body:not(#_) .user-detail-dialog .points-split-grid .user-stat { min-width:0; }
html body:not(#_):not(#__) .user-detail-dialog .fable-detail-stats .user-stat strong { color:#7c3aed; }
html[data-theme="dark"] body:not(#_):not(#__) .user-detail-dialog .fable-detail-stats .user-stat strong { color:#c4b5fd; }
@media (max-width:900px) { html body:not(#_) .user-detail-dialog .points-split-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); } }

/* 结账：Fable 行（分组名 · Fable）单独一行、紫色标出 */
html body:not(#_) .settle-fable > td:first-child, html body:not(#_) .settle-pool-lines .settle-fable span { color:#7c3aed; font-weight:600; }
html[data-theme="dark"] body:not(#_) .settle-fable > td:first-child, html[data-theme="dark"] body:not(#_) .settle-pool-lines .settle-fable span { color:#c4b5fd; }

/* 结账弹窗：上次结算 */
.settle-dialog .settle-last { display:grid; gap:4px; margin:2px 0 16px; padding:12px 14px; border:1px solid var(--border); border-radius:12px; background:var(--surface-2); }
.settle-dialog .settle-last strong { font-size:15px; }
/* 滴滴 2.0 — content system */
html[data-theme="light"] {
  color-scheme: light;
  --bg:#f7f5f0; --surface:#fffdf9; --surface-2:#f3efe7; --border:#e6dfd4; --border-strong:#cec5b7;
  --text:#182131; --ink:#182131; --muted:#5e625f; --faint:#737571;
  --accent:#a63e1c; --accent-soft:#fbe8db; --accent-text:#fffdf9;
  --primary:#ad431d; --primary-hover:#933716; --primary-ink:#fffdf9; --control-ring:#ad431d;
  --ok:#1a6b54; --ok-soft:#e2f3ea; --warn:#81520c; --warn-soft:#fbefcf;
  --danger:#a52c38; --danger-soft:#f9e5e6; --info:#305482; --info-soft:#eaf0f9;
  --shadow:0 2px 6px rgb(53 39 25 / .035),0 12px 28px rgb(53 39 25 / .04);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg:#131923; --surface:#1d2633; --surface-2:#242e3c; --border:#374352; --border-strong:#536071;
  --text:#eef1f6; --ink:#fbf8f2; --muted:#b6c0cd; --faint:#98a6b7;
  --accent:#ffb58a; --accent-soft:#3b2c2b; --accent-text:#261a14;
  --primary:#f6a574; --primary-hover:#ffb68a; --primary-ink:#261a14; --control-ring:#f6a574;
  --ok:#86ddbc; --ok-soft:#233d39; --warn:#f5ce80; --warn-soft:#413728;
  --danger:#ffadb4; --danger-soft:#432b35; --info:#b6cff9; --info-soft:#293a55;
  --shadow:0 2px 6px rgb(0 0 0 / .13),0 12px 28px rgb(0 0 0 / .09);
}
html[data-theme] {
  --radius:16px; --nav-ink:#141c2a; --signal-border:#3b4453;
  --signal-text:#fff7ed; --signal-muted:#cad1dc; --signal-accent:#ffb78c;
  --control-edge:var(--border-strong); --control-bg:var(--surface); --control-hover:var(--surface-2);
}
html[data-theme] body:not(#_) {
  background:var(--bg); color:var(--text); line-height:1.55;
}
.workspace .view { min-width:0; gap:18px; }
.workspace .card,
html[data-theme] body:not(#_) :is(.workspace .card,dialog.modal,.official-routing,.official-connection) {
  color:var(--text); background:var(--surface); border-color:var(--border); border-radius:var(--radius); box-shadow:var(--shadow);
}
.workspace .card:not(.home-announcement), .workspace .records-workspace > .card { padding:clamp(16px,2vw,28px); }
.workspace .card-head { gap:12px 20px; margin-bottom:20px; align-items:flex-start; }
.workspace .card-head h2 { font-size:clamp(18px,2vw,22px); font-weight:740; letter-spacing:-.025em; }
.workspace .card-head .hint { margin-top:5px; line-height:1.55; }
.workspace .stack { gap:18px; }
.hint { color:var(--muted); }
.workspace :is(.field,.json-upload,.input-group,.actions) { min-width:0; }
.field > label { color:var(--text); font-weight:650; }
.workspace .field { gap:7px; margin-bottom:17px; }
.workspace .grid-2 { grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 18px; }
.workspace .advanced { padding:10px 13px; border:1px solid var(--border); border-radius:10px; background:var(--surface-2); }
.workspace details.advanced summary { margin-bottom:0; }
.workspace details.advanced[open] > summary { margin-bottom:12px; }
.workspace details.advanced .field:last-child { margin-bottom:0; }

html[data-theme] body:not(#_) :is(input:not([type=checkbox],[type=radio],[type=file],[type=range]),textarea) {
  background:var(--surface); color:var(--text); border:1px solid var(--border-strong); box-shadow:none; border-radius:10px;
}
html[data-theme] body:not(#_) :is(input:not([type=checkbox],[type=radio],[type=file],[type=range]),textarea):hover:not(:disabled) {
  border-color:var(--muted);
}
html[data-theme] body:not(#_) :is(input:not([type=checkbox],[type=radio],[type=file],[type=range]),textarea):focus {
  border-color:var(--accent); outline:none; box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 17%,transparent);
}
html[data-theme] body:not(#_):not(#__) select:not([multiple]):not([size]) {
  padding-right:38px; background-color:var(--surface); color:var(--text); border-color:var(--border-strong); box-shadow:none;
}
html[data-theme] body:not(#_):not(#__) select:not([multiple]):not([size]):hover:not(:disabled) {
  background-color:var(--surface-2); border-color:var(--muted);
}
html[data-theme] body:not(#_):not(#__) select:not([multiple]):not([size]):focus {
  background-color:var(--surface); border-color:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 17%,transparent);
}
html[data-theme] body:not(#_):not(#__) select:not([multiple]):not([size]) option { background-color:var(--surface); color:var(--text); }
html[data-theme] body:not(#_) :is(input[type=checkbox],input[type=radio]) { accent-color:var(--accent); }
html[data-theme] body:not(#_) :is(input[readonly],input:disabled:not([type=checkbox],[type=radio]),textarea:disabled,.input-group .addon),
html[data-theme] body:not(#_):not(#__) select:not([multiple]):not([size]):disabled {
  border-color:var(--border); background-color:var(--surface-2); color:var(--muted);
}
html[data-theme] body:not(#_) .input-group > :first-child { border-radius:10px 0 0 10px; }
html[data-theme] body:not(#_) .input-group > :last-child { border-radius:0 10px 10px 0; }
html[data-theme] body:not(#_) :is(input,textarea)::placeholder { color:var(--faint); opacity:1; }
.workspace :is(input:not([type=checkbox],[type=radio],[type=file],[type=range]),select), .modal-body select {
  min-height:42px;
}

html[data-theme] body:not(#_) .btn {
  min-height:37px; padding:8px 13px; border-radius:9px; background:var(--surface); border-color:var(--border-strong);
  color:var(--text); font-weight:650; box-shadow:none;
}
html[data-theme] body:not(#_) .btn:hover:not(:disabled) { background:var(--surface-2); border-color:var(--muted); color:var(--ink); }
html[data-theme] body:not(#_) .btn.btn-sm { min-height:33px; padding:6px 11px; }
html[data-theme] body:not(#_) .btn.btn-primary,
html[data-theme] body:not(#_) .records-workspace .records-toolbar .btn.btn-primary {
  background:var(--primary); color:var(--primary-ink); border-color:var(--primary);
}
html[data-theme] body:not(#_) .btn.btn-primary:hover:not(:disabled),
html[data-theme] body:not(#_) .records-workspace .records-toolbar .btn.btn-primary:hover:not(:disabled) {
  background:var(--primary-hover); color:var(--primary-ink); border-color:var(--primary-hover);
}
html[data-theme] body:not(#_) .btn.btn-link { background:transparent; border-color:transparent; color:var(--accent); }
html[data-theme] body:not(#_) .btn.btn-link:hover:not(:disabled) { background:var(--accent-soft); border-color:transparent; color:var(--accent); }
html[data-theme] body:not(#_) :is(.btn.btn-destructive,.btn.btn-danger) { background:var(--danger-soft); border-color:transparent; color:var(--danger); }
html[data-theme] body:not(#_) :is(.btn.btn-destructive,.btn.btn-danger):hover:not(:disabled) { background:var(--danger-soft); border-color:var(--danger); color:var(--danger); }
html[data-theme] body:not(#_) :is(.btn:focus-visible,.project:focus-visible,.record-type-tabs button:focus-visible,.health-filter:focus-visible,summary:focus-visible) {
  outline:2px solid var(--control-ring); outline-offset:3px; box-shadow:none;
}
html[data-theme] body:not(#_) :is(.form-error,.text-danger) { color:var(--danger); }
.workspace .form-error:not(:empty) { padding:7px 10px; border-radius:8px; background:var(--danger-soft); }

html[data-theme] body:not(#_) :is(.segmented,.key-buckets) {
  padding:4px; gap:4px; background:var(--surface-2); border:1px solid var(--border); border-radius:10px; box-shadow:none;
}
html[data-theme] body:not(#_) :is(.segmented button,.record-type-tabs button,.key-buckets button) {
  min-height:34px; padding:7px 13px; border-radius:7px; color:var(--muted); background:transparent;
  border:1px solid transparent; box-shadow:none; font-weight:650;
}
html[data-theme] body:not(#_) :is(.segmented button[aria-pressed=true],.segmented button.active,.key-buckets button[aria-pressed=true]) {
  background:var(--surface); border-color:var(--border); color:var(--accent); box-shadow:0 1px 3px rgb(0 0 0 / .07);
}
html[data-theme] body:not(#_) :is(.record-type-tabs button,.segmented button):hover:not(:disabled) { color:var(--accent); }
html[data-theme] body:not(#_) :is(.channel,.official-channel) { background:var(--surface); border-color:var(--border); box-shadow:none; }
html[data-theme] body:not(#_) .channel:hover { background:var(--accent-soft); border-color:var(--accent); }
.workspace .channel-grid { gap:12px; grid-template-columns:repeat(auto-fill,minmax(min(100%,240px),1fr)); }

.workflow-column,.onboard-dashboard { display:grid; gap:18px; min-width:0; }
.onboard-dashboard .card.home-announcement,
html[data-theme] body:not(#_) .onboard-dashboard .home-announcement {
  padding:16px 20px; background:var(--accent-soft); border-color:var(--border); border-left:4px solid var(--accent); box-shadow:none;
}
html[data-theme] body:not(#_) .announcement-label { background:var(--surface); color:var(--accent); }
.onboard-dashboard .project-picker { gap:14px; grid-template-columns:repeat(2,minmax(0,1fr)); }
html[data-theme] body:not(#_) .onboard-dashboard .project {
  position:relative; display:grid; grid-template-columns:auto minmax(0,1fr); min-height:84px;
  padding:15px 18px; align-items:center; gap:12px;
  border:1px solid var(--border-strong); border-radius:14px; background:var(--surface); color:var(--text); box-shadow:none;
}
html[data-theme] body:not(#_) .onboard-dashboard .project[aria-checked=true] {
  background:var(--accent-soft); border-color:var(--accent); box-shadow:inset 3px 0 0 var(--accent);
}
html[data-theme] body:not(#_) .onboard-dashboard .project:hover:not([aria-checked=true]) { border-color:var(--accent); background:var(--surface-2); }
html[data-theme] body:not(#_) .onboard-dashboard .project strong { font-size:16px; color:var(--ink); }
html[data-theme] body:not(#_) .onboard-dashboard .project[aria-checked=true] strong { color:var(--accent); }
.onboard-dashboard .project-copy { display:grid; min-width:0; gap:3px; overflow-wrap:anywhere; }
.onboard-dashboard .project .project-order {
  display:grid; place-items:center; width:36px; height:36px; border:1px solid var(--border);
  border-radius:9px; background:var(--surface-2); color:var(--muted); font:680 11px/1 var(--mono);
}
.onboard-dashboard .project[aria-checked=true] .project-order {
  background:var(--primary); border-color:var(--primary); color:var(--primary-ink);
}
.onboard-dashboard .pool-auto { background:var(--surface-2); border-color:var(--border); }
.onboard-dashboard fieldset.step + fieldset.step { border-top-style:solid; padding-top:24px; margin-top:24px; }
.onboard-dashboard .step-num { width:26px; height:26px; border-radius:8px; }
.onboard-dashboard fieldset.step:not(:disabled) .step-num { background:var(--accent-soft); color:var(--accent); }
.workflow-progression { display:flex; gap:6px 14px; flex-wrap:wrap; align-items:baseline; }
.workflow-progression h2 { color:var(--ink); font-size:17px; font-weight:730; letter-spacing:-.02em; }
.workflow-progression p { overflow-wrap:anywhere; }

html[data-theme] body:not(#_) .onboard-dashboard .pool-rpm-panel {
  position:relative; isolation:isolate; overflow:hidden; display:grid; align-items:stretch;
  grid-template-columns:minmax(0,1.2fr) minmax(0,2fr); min-height:118px;
  gap:18px 25px; padding:20px 24px; margin:0; border-radius:var(--radius);
  border:1px solid var(--signal-border); background:linear-gradient(117deg,#182334 0%,#202b3c 100%); color:var(--signal-text); box-shadow:none;
}
html[data-theme] body:not(#_) .onboard-dashboard .card > .pool-rpm-panel { margin-bottom:22px; }
.onboard-dashboard .pool-rpm-panel::before {
  content:""; position:absolute; inset:0 0 0 54%; z-index:-1; opacity:.55;
  background:repeating-linear-gradient(130deg,transparent 0 22px,#f5b99517 23px 24px,transparent 25px 46px);
  mask-image:linear-gradient(to right,transparent,#000); pointer-events:none;
}
.onboard-dashboard .pool-rpm-panel > .hint:only-child { grid-column:1 / -1; align-self:center; }
.onboard-dashboard .pool-rpm-panel .hint { color:var(--signal-muted); }
.onboard-dashboard .rpm-total { gap:5px; flex-direction:column; align-items:flex-start; justify-content:center; min-width:0; }
html[data-theme] body:not(#_) .onboard-dashboard .pool-rpm-panel .rpm-total > strong.rpm-value {
  color:var(--signal-accent); font-size:clamp(26px,4vw,43px); font-weight:720; letter-spacing:-.04em; line-height:1.1; overflow-wrap:anywhere;
}
.onboard-dashboard .pool-rpm-panel .onboard-account-counts {
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:0;
}
html[data-theme] body:not(#_) .onboard-dashboard .pool-rpm-panel .onboard-account-counts > span {
  display:flex; flex-direction:column; justify-content:center; gap:5px; min-width:0; padding:10px 14px;
  background:rgb(255 255 255 / .065); color:var(--signal-muted); border:1px solid var(--signal-border); border-radius:11px;
}
html[data-theme] body:not(#_) .onboard-dashboard .pool-rpm-panel .onboard-account-counts b {
  display:block; color:var(--signal-text); font-size:clamp(17px,2.3vw,24px); letter-spacing:-.025em; line-height:1.15;
  margin:0; white-space:normal; overflow-wrap:anywhere;
}

html[data-theme] body:not(#_) .workspace .record-type-tabs:not(.key-buckets) {
  width:100%; align-items:end; gap:16px; padding:0; margin:0; background:transparent; border:0; border-bottom:1px solid var(--border-strong); border-radius:0;
}
html[data-theme] body:not(#_) .workspace .record-type-tabs:not(.key-buckets) button {
  border-radius:0; border:0; border-bottom:2px solid transparent; margin-bottom:-1px; padding:9px 9px 12px; box-shadow:none;
}
html[data-theme] body:not(#_) .workspace .record-type-tabs:not(.key-buckets) button[aria-selected=true] {
  background:transparent; color:var(--accent); border-bottom-color:var(--accent); box-shadow:none;
}
html[data-theme] body:not(#_) .records-workspace .points-summary > div:not(.group-usage-section) {
  display:grid; grid-template-columns:minmax(0,1fr); align-content:start; justify-items:start;
  gap:7px; min-height:98px; background:var(--surface-2); border:1px solid var(--border); border-radius:12px; box-shadow:none;
}
html[data-theme] body:not(#_) .records-workspace .points-summary > div:not(.group-usage-section) > :is(.hint,strong) {
  justify-self:start; white-space:normal; overflow-wrap:anywhere;
}
html[data-theme] body:not(#_) .records-workspace .points-summary .tier-chips { justify-content:flex-start; margin-top:0; }
html[data-theme] body:not(#_) .records-workspace .points-summary > div:nth-of-type(2):not(.group-usage-section) { background:var(--accent-soft); }
html[data-theme] body:not(#_) .records-workspace .points-summary > div > strong { color:var(--ink); letter-spacing:-.04em; }
html[data-theme] body:not(#_) .records-workspace .points-summary > .remaining-points-card {
  background:var(--ok-soft); border-color:color-mix(in srgb,var(--ok) 25%,var(--border));
}
html[data-theme] body:not(#_) .records-workspace .points-summary > .remaining-points-card > strong { color:var(--ok); }
html[data-theme] body:not(#_) .records-workspace .records-tools {
  background:var(--surface-2); border-color:var(--border); border-radius:13px; box-shadow:none; padding:16px;
}
html[data-theme] body:not(#_) .records-workspace .records-toolbar .records-primary-filters label {
  position:static; width:auto; height:auto; clip-path:none; overflow:visible; font-size:12px; color:var(--muted);
}
html[data-theme] body:not(#_) .records-workspace .records-toolbar .records-search .btn { min-height:42px; }
html[data-theme] body:not(#_) .records-workspace .records-advanced { border-top:1px solid var(--border); padding-top:10px; margin-top:12px; }
html[data-theme] body:not(#_) .records-workspace .records-advanced summary { width:fit-content; font-weight:650; color:var(--accent); }
html[data-theme] body:not(#_) .records-workspace .health-filter { border-color:var(--border-strong); background:var(--surface); border-radius:10px; box-shadow:none; }
html[data-theme] body:not(#_) .records-workspace .health-filter.active { border-color:var(--accent); background:var(--accent-soft); box-shadow:none; }
html[data-theme] body:not(#_) .records-workspace .health-filter:hover { border-color:var(--accent); }
html[data-theme] body:not(#_) .records-workspace .health-filter > strong { color:var(--ink); font-size:21px; letter-spacing:-.03em; }
html[data-theme] body:not(#_) .records-workspace .records-group-breakdown { background:var(--surface); border-color:var(--border); box-shadow:none; }
html[data-theme] body:not(#_) .records-workspace .records-group-breakdown summary { color:var(--accent); }
html[data-theme] body:not(#_) .record-upload-summary { border:0; border-left:3px solid var(--accent); background:var(--accent-soft); border-radius:8px; }
html[data-theme] body:not(#_) .records-workspace .account-record-list { gap:10px; background:none; border:0; border-radius:0; box-shadow:none; }
html[data-theme] body:not(#_) .records-workspace .account-record {
  background:var(--surface); border:1px solid var(--border); border-radius:12px; color:var(--text); box-shadow:none;
}
html[data-theme] body:not(#_) .records-workspace .account-record:hover { background:var(--surface); border-color:var(--border-strong); }
html[data-theme] body:not(#_) .records-workspace .account-record :is(.record-detail-inner,.record-extra) { background:var(--surface-2); border-color:var(--border); }
html[data-theme] body:not(#_) .records-workspace .account-record .provider-usage-card.compact-points-card {
  background:var(--surface); color:var(--text); border-color:var(--border);
}
.package-tier,.tag { color:var(--text); }
html[data-theme] body:not(#_) .record-points strong { color:var(--ink); }
html[data-theme] body:not(#_) .account-record .slim-window progress::-webkit-progress-value { background:var(--ok); }
html[data-theme] body:not(#_) .account-record .slim-window progress::-moz-progress-bar { background:var(--ok); }
html[data-theme] body:not(#_) .account-record .window-warn progress::-webkit-progress-value { background:var(--warn); }
html[data-theme] body:not(#_) .account-record .window-warn progress::-moz-progress-bar { background:var(--warn); }
html[data-theme] body:not(#_) .account-record .window-danger progress::-webkit-progress-value { background:var(--danger); }
html[data-theme] body:not(#_) .account-record .window-danger progress::-moz-progress-bar { background:var(--danger); }

.workspace .table-wrap { width:100%; max-width:100%; margin:0; padding:0; border:1px solid var(--border); border-radius:11px; overscroll-behavior-x:contain; }
html[data-theme] body:not(#_) :is(.workspace,.modal-body) table th {
  background:var(--surface-2); color:var(--muted); border-color:var(--border); font-weight:670;
}
html[data-theme] body:not(#_) :is(.workspace,.modal-body) table td { border-color:var(--border); }
html[data-theme] body:not(#_) :is(.workspace,.modal-body) table tbody tr:hover { background:var(--surface-2); }
html[data-theme] body:not(#_) :is(.workspace,.modal-body) :is(.user-stat,.earnings-metric) {
  background:var(--surface-2); color:var(--text); border-color:var(--border); border-radius:12px; box-shadow:none;
}
html[data-theme] body:not(#_) :is(.workspace,.modal-body) :is(.user-stat,.earnings-metric) > strong { letter-spacing:-.035em; }
html[data-theme] body:not(#_) .settle-view .settle-stats .user-stat:nth-child(3) {
  background:var(--accent-soft); border-color:color-mix(in srgb,var(--accent) 24%,var(--border));
}
html[data-theme] body:not(#_) .settle-view .settle-stats .user-stat:nth-child(3) > strong { color:var(--accent); }
html[data-theme] body:not(#_) :is(.settle-view,.modal-body) .settle-owe { color:var(--warn); }
html[data-theme] body:not(#_) :is(.settle-view,.modal-body) .settle-prepaid { color:var(--ok); }
html[data-theme] body:not(#_) .workspace .user-avatar { border-radius:11px; background:var(--accent-soft); color:var(--accent); box-shadow:none; }
.workspace .settle-filter { gap:8px; }
.workspace .users-toolbar { margin-bottom:14px; }
.workspace .settle-view .users-toolbar > input { width:min(100%,420px); }
.workspace .settle-overview td .btn { white-space:nowrap; }

html[data-theme] body:not(#_) dialog.modal { box-shadow:0 18px 64px rgb(10 17 28 / .33); }
html[data-theme] body:not(#_) dialog.modal::backdrop { background:rgb(13 20 32 / .56); backdrop-filter:blur(2px); }
html[data-theme] body:not(#_) :is(.modal-head,.modal-foot) { background:var(--surface); border-color:var(--border); }
.modal-head { position:sticky; top:0; z-index:1; }
.modal-head h2 { font-size:18px; color:var(--text); }
.modal-body { min-width:0; padding:20px; }
.modal-body .table-wrap { margin:0; padding:0; border:1px solid var(--border); border-radius:9px; }
.modal-foot { position:sticky; bottom:0; z-index:1; }
html[data-theme] body:not(#_) .toast { background:var(--surface); color:var(--text); border:1px solid var(--border); border-left:3px solid var(--accent); box-shadow:var(--shadow); }
html[data-theme] body:not(#_) .toast-error { color:var(--danger); border-left-color:var(--danger); }

@media(max-width:1080px) {
  .workspace .health-shortcuts { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .workspace .settle-view .settle-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:760px) {
  .workspace .view,.workspace .stack,.workflow-column,.onboard-dashboard { gap:13px; }
  .workspace .card-head { margin-bottom:15px; }
  .workspace .grid-2,.modal-body .grid-2 { grid-template-columns:minmax(0,1fr); }
  .workspace .record-main .record-points { grid-column:2; }
  .workspace .health-shortcuts { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .workspace .health-filter { min-width:0; overflow-wrap:anywhere; }
  .workspace .settle-overview thead { display:table-header-group; }
  .workspace .settle-overview tbody tr { display:table-row; border:0; padding:0; }
  .workspace .settle-overview td { display:table-cell; padding:10px; border-bottom:1px solid var(--border); }
  .workspace .users-list-wrap { border:0; }
  .workspace .users-compact-table td { padding:6px; }
  .modal-head,.modal-body,.modal-foot { padding:13px; }
  .modal-body .input-group > :is(:first-child,:last-child) { border-radius:10px; }
}
@media(max-width:520px) {
  html[data-theme] body:not(#_) .onboard-dashboard .pool-rpm-panel { grid-template-columns:1fr; gap:13px; padding:15px; }
  .onboard-dashboard .project-picker { gap:8px; }
  html[data-theme] body:not(#_) .onboard-dashboard .project { min-height:74px; padding:11px 10px; gap:7px; }
  html[data-theme] body:not(#_) .onboard-dashboard .project strong { font-size:14px; }
  .onboard-dashboard .project .project-order { width:26px; height:26px; border-radius:7px; }
  .onboard-dashboard .project-copy span { font-size:11px; }
  html[data-theme] body:not(#_) .records-workspace .records-tools { padding:12px; }
  .workspace .records-workspace .points-summary > div:not(.group-usage-section) { padding:12px; }
  .workspace .records-workspace .points-summary > div > strong { font-size:21px; }
}
@media(max-width:360px) {
  html[data-theme] body:not(#_) .onboard-dashboard .project { grid-template-columns:minmax(0,1fr); }
}
@media(prefers-reduced-motion:reduce) {
  .workspace :is(button,a,input,select,textarea), .modal :is(button,a,input,select,textarea) { transition:none; }
}

/* 滴滴 / Workspace chrome */
#app .app-shell,
#app .login-wrap {
  --dd-rail: #141c2a;
  --dd-rail-bg: #192332;
  --dd-rail-rule: #2a3545;
  --dd-rail-ink: #eff2f6;
  --dd-rail-muted: #9facc0;
  --dd-peach: #f6a574;
  --dd-canvas: #f8f6f1;
  --dd-paper: #fffdf9;
  --dd-outline: #e8e1d8;
  --dd-ink: #202735;
  --dd-muted: #67696f;
  --dd-action: #a74320;
  --dd-soft: #f9ede3;
  --dd-pad: clamp(22px, 3.1vw, 50px);
}
html[data-theme="dark"] #app :is(.app-shell,.login-wrap) {
  --dd-canvas: #101620;
  --dd-paper: #192230;
  --dd-outline: #303b4b;
  --dd-ink: #f5eee8;
  --dd-muted: #afbbcd;
  --dd-action: #f5b48f;
  --dd-soft: #3a2b29;
}

#app .app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: clamp(234px, 17.3vw, 258px) minmax(0, 1fr);
  background: var(--dd-canvas);
  color: var(--dd-ink);
}
#app .workspace-rail {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100dvh;
  min-width: 0;
  padding: 30px 18px 20px;
  overflow-y: auto;
  background: var(--dd-rail);
  color: var(--dd-rail-ink);
}
#app .app-shell .workspace-rail .brand,
#app .login-card .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 0 8px;
  margin: 0;
}
#app .brand img.brand-mark {
  display: block;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: none;
  background: none;
}
#app .brand-label { display: grid; gap: 4px; line-height: 1; min-width: 0; }
#app .brand-label :is(h1,strong,b,span:first-child) {
  font-weight: 750;
  font-size: 20px;
  line-height: 1.15;
  letter-spacing: .075em;
}
#app .brand-label .brand-subtitle {
  display: block;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .13em;
  white-space: nowrap;
}
html[data-theme] #app .app-shell .workspace-rail :is(.brand,.brand-label,.brand-label h1,.brand-label strong) { color: var(--dd-rail-ink); }
html[data-theme] #app .app-shell .workspace-rail .brand-subtitle { color: var(--dd-rail-muted); }
#app .rail-caption {
  padding: 0 10px;
  margin: 49px 0 12px;
  color: #98a7bc;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
}
#app .rail-footer {
  margin-top: auto;
  border-top: 1px solid var(--dd-rail-rule);
  padding: 17px 10px 0;
  color: var(--dd-rail-muted);
  font-size: 11px;
  display: flex;
  gap: 9px;
  align-items: center;
}
#app .rail-footer::before {
  content: '';
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  background: var(--dd-peach);
  border-radius: 50%;
  box-shadow: 0 0 0 4px #f6a57420;
}
#app .app-shell .workspace-rail .nav {
  display: flex;
  flex: none;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  gap: 5px;
  overflow: visible;
  margin-bottom: 32px;
}
html[data-theme] #app .app-shell .workspace-rail .nav button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-direction: row;
  min-width: 0;
  min-height: 45px;
  width: 100%;
  padding: 9px 14px;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  box-shadow: none;
  color: #c0c9d6;
  background: transparent;
  font-size: 13px;
  font-weight: 540;
  text-align: left;
  white-space: normal;
}
html[data-theme] #app .app-shell .workspace-rail .nav button .nav-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: #9facc0;
}
html[data-theme] #app .app-shell .workspace-rail .nav button:hover {
  background: #232f40;
  color: var(--dd-rail-ink);
  border-color: var(--dd-rail-rule);
}
html[data-theme] #app .app-shell .workspace-rail .nav button[aria-current="page"] {
  color: #ffeadd;
  background: #312b2d;
  border-color: #574039;
  font-weight: 700;
}
html[data-theme] #app .app-shell .workspace-rail .nav button[aria-current="page"]::before {
  content: '';
  position: absolute;
  width: 3px;
  height: 18px;
  border-radius: 4px;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  background: var(--dd-peach);
}
html[data-theme] #app .app-shell .workspace-rail .nav button[aria-current="page"] .nav-icon { color: var(--dd-peach); }
#app .workspace-rail .nav button:focus-visible { outline: 2px solid var(--dd-peach); outline-offset: 2px; }

#app .app-shell > .workspace { min-width: 0; }
html[data-theme] #app .app-shell > .workspace > .topbar {
  position: sticky;
  inset: 0 0 auto;
  width: auto;
  height: auto;
  min-height: 63px;
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px var(--dd-pad);
  border: 0;
  border-bottom: 1px solid var(--dd-outline);
  background: var(--dd-paper);
  color: var(--dd-ink);
  box-shadow: none;
  z-index: 25;
}
#app .workspace-context {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--dd-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}
#app .workspace-context::before {
  content: '';
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border: 1px solid var(--dd-action);
  border-radius: 2px;
  transform: rotate(45deg);
}
#app .app-shell .topbar .account {
  position: static;
  display: flex;
  flex: 0 0 auto;
  flex-flow: row nowrap;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
}
html[data-theme] #app .app-shell .topbar .account > .btn,
html[data-theme] #app .login-wrap .login-language > .btn {
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 33px;
  padding: 4px 9px;
  margin: 0;
  border: 1px solid var(--dd-outline);
  border-radius: 7px;
  background: var(--dd-paper);
  color: var(--dd-muted);
  box-shadow: none;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}
html[data-theme] #app .app-shell .topbar .account > .btn:hover,
html[data-theme] #app .login-wrap .login-language > .btn:hover {
  background: var(--dd-soft);
  color: var(--dd-action);
  border-color: var(--dd-outline);
}
#app .account-menu { position: relative; min-width: 0; }
#app .account-trigger {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  color: var(--dd-ink);
  background: transparent;
  min-height: 36px;
  max-width: 224px;
  padding: 3px 6px;
  border: 1px solid transparent;
  border-radius: 9px;
  vertical-align: middle;
}
#app .account-trigger::-webkit-details-marker { display: none; }
#app .account-trigger::marker { content: ''; }
#app .account-trigger::after {
  content: '';
  width: 5px;
  height: 5px;
  border-bottom: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: translateY(-1px) rotate(45deg);
  flex: 0 0 5px;
  margin-inline: 2px;
}
#app .account-menu[open] > .account-trigger,
#app .account-trigger:hover {
  border-color: var(--dd-outline);
  background: var(--dd-soft);
}
#app .account-menu[open] > .account-trigger::after { transform: translateY(2px) rotate(225deg); }
#app .account-avatar {
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--dd-action);
  background: var(--dd-soft);
  border: 1px solid var(--dd-outline);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 750;
}
html[data-theme] #app .app-shell .topbar .account .who {
  width: auto;
  margin: 0;
  color: var(--dd-ink);
  font-size: 12px;
  font-weight: 630;
  line-height: 1.35;
}
#app .account-trigger .who {
  display: block;
  min-width: 0;
  max-width: 149px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
#app .account-popover {
  position: absolute;
  z-index: 30;
  right: 0;
  top: calc(100% + 8px);
  display: grid;
  gap: 3px;
  width: min(12rem, calc(100vw - 2rem));
  max-width: 100vw;
  padding: 7px;
  color: var(--dd-ink);
  background: var(--dd-paper);
  border: 1px solid var(--dd-outline);
  border-radius: 12px;
  box-shadow: 0 10px 34px #12182925;
}
#app .account-popover :is(p,.who) { padding: 5px 8px; overflow-wrap: anywhere; }
html[data-theme] #app .app-shell .topbar .account .account-popover button {
  text-align: left;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--dd-ink);
  background: none;
  box-shadow: none;
}
html[data-theme] #app .app-shell .topbar .account .account-popover button:hover {
  color: var(--dd-action);
  background: var(--dd-soft);
  border-color: var(--dd-outline);
}
#app .app-shell main.workspace-main {
  width: 100%;
  min-width: 0;
  max-width: 1660px;
  margin: 0 auto;
  padding: 0 var(--dd-pad) 46px;
}
#app .workspace-page-heading {
  min-width: 0;
  display: grid;
  gap: 6px;
  margin: 0 0 24px;
  padding: clamp(25px, 3.1vw, 45px) 0 18px;
  border-bottom: 1px solid var(--dd-outline);
}
#app .workspace-page-heading .page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 1px;
  color: var(--dd-action);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .15em;
}
#app .workspace-page-heading .page-kicker::before {
  content: '';
  width: 14px;
  height: 1px;
  background: currentColor;
}
html[data-theme] #app .workspace-page-heading #workspace-title {
  color: var(--dd-ink);
  font-size: clamp(26px, 3vw, 42px);
  font-weight: 740;
  line-height: 1.19;
  letter-spacing: -.035em;
}
#app .workspace-page-heading #workspace-description {
  color: var(--dd-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}
#app .workspace-main:focus { outline: none; }

/* 滴滴 / Split sign-in */
html[data-theme] body:has(#app .login-wrap) {
  background: radial-gradient(ellipse at 88% 13%, #f2e7db, transparent 62%), #f5f2ed;
}
html[data-theme="dark"] body:has(#app .login-wrap) {
  background: radial-gradient(ellipse at 88% 13%, #232633, transparent 62%), #101620;
}
html[data-theme] #app .login-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(340px, .86fr);
  align-content: center;
  align-items: stretch;
  gap: 0;
  width: 100%;
  max-width: 1172px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 38px 24px;
  background: transparent;
}
html[data-theme] #app .login-wrap .login-story {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 32px;
  overflow: hidden;
  isolation: isolate;
  position: relative;
  min-width: 0;
  min-height: 568px;
  padding: 38px 43px;
  background: #141c2a;
  background-image: linear-gradient(146deg, #1b2738 0%, #141c2a 51%, #131923 100%);
  border: 1px solid #29384c;
  border-right: 0;
  border-radius: 25px 0 0 25px;
  color: var(--dd-rail-ink);
  text-align: left;
  box-shadow: 0 26px 75px #161c2a1d;
}
#app .login-story::before {
  content: '';
  position: absolute;
  pointer-events: none;
  z-index: -1;
  inset: 0;
  background-image: radial-gradient(#c4cbd34a 1px, transparent 1px);
  background-size: 17px 17px;
  mask-image: linear-gradient(132deg, transparent 29%, #0008 100%);
}
html[data-theme] #app .login-wrap .login-story::after { content: none; }
html[data-theme] #app .login-wrap .login-story .login-story-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 11px;
  font-weight: 720;
  letter-spacing: .15em;
  color: var(--dd-peach);
}
#app .login-story-brand img {
  width: 27px;
  height: 27px;
  border-radius: 7px;
  object-fit: contain;
}
#app .login-edition {
  position: absolute;
  top: 41px;
  right: 41px;
  padding: 3px 8px;
  border: 1px solid #516173;
  border-radius: 999px;
  color: #cfdae6;
  background: #172230;
  font: 600 10px/1.5 var(--mono);
  letter-spacing: .1em;
}
#app .login-copy {
  align-self: start;
  max-width: 93%;
  margin: 30px 0 108px;
}
html[data-theme] #app .login-wrap .login-story h2 {
  color: var(--dd-rail-ink);
  font-size: clamp(35px, 4.15vw, 65px);
  line-height: 1.17;
  margin: 0 0 19px;
  letter-spacing: -.04em;
  font-weight: 730;
  overflow-wrap: anywhere;
}
html[data-theme] #app .login-wrap .login-story h2 span { color: var(--dd-peach); }
html[data-theme] #app .login-wrap .login-story p {
  color: #aebbd0;
  font-size: 13px;
  line-height: 1.68;
  max-width: 32ch;
}
#app .login-story-footer {
  z-index: 1;
  align-self: end;
  min-width: 0;
  color: #aab7c7;
  font: 600 9px/1.4 var(--mono);
  letter-spacing: .15em;
  overflow-wrap: anywhere;
}
#app .login-graphic {
  position: absolute;
  width: min(97%, 475px);
  height: 230px;
  right: -16px;
  bottom: -24px;
  z-index: -1;
  background-image:
    linear-gradient(132deg, transparent 26%, #70809626 26.2%, transparent 26.5%),
    repeating-linear-gradient(132deg, transparent 0 26px, #f6a5746e 27px, transparent 28px 49px);
  mask-image: radial-gradient(ellipse at 66% 54%, #000 15%, transparent 75%);
  opacity: .85;
}
#app .login-graphic::before,
#app .login-graphic::after,
#app .login-graphic .graphic-orbit {
  content: '';
  position: absolute;
  width: 320px;
  height: 68px;
  right: 4px;
  bottom: 61px;
  border: 1px solid #f6a574;
  border-radius: 100px;
  transform: rotate(-32deg);
}
#app .login-graphic::after {
  right: 50px;
  bottom: 40px;
  border-color: #99a8bb;
  opacity: .7;
}
#app .login-graphic .graphic-orbit {
  right: -34px;
  bottom: 84px;
  border-color: #925d4b;
}
html[data-theme] #app .login-wrap .login-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: clamp(31px, 4vw, 55px);
  color: var(--dd-ink);
  background: var(--dd-paper);
  border: 1px solid var(--dd-outline);
  border-radius: 0 25px 25px 0;
  box-shadow: 0 26px 75px #161c2a1d;
}
#app .login-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  flex-wrap: wrap;
}
html[data-theme] #app .login-wrap .login-card .brand { margin: 0; padding: 0; color: var(--dd-ink); }
html[data-theme] #app .login-wrap .login-card .brand-label :is(h1,strong) { color: var(--dd-ink); }
html[data-theme] #app .login-wrap .login-card .brand-subtitle { color: var(--dd-muted); }
html[data-theme] #app .login-wrap .login-card .login-language {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: static;
  gap: 5px;
  margin: 0;
}
html[data-theme] #app .login-wrap .login-card .login-welcome { margin: 43px 0 22px; }
html[data-theme] #app .login-wrap .login-card .login-welcome > .hint {
  color: var(--dd-action);
  font-size: 11px;
  font-weight: 720;
  letter-spacing: .07em;
}
html[data-theme] #app .login-wrap .login-card .login-welcome h2 {
  margin: 5px 0 0;
  color: var(--dd-ink);
  font-size: clamp(23px, 2.8vw, 33px);
  font-weight: 740;
  line-height: 1.22;
  letter-spacing: -.03em;
}
html[data-theme] #app .login-wrap .login-card .field { margin: 0 0 17px; }
html[data-theme] #app .login-wrap .login-card label {
  color: var(--dd-ink);
  font-size: 12px;
  font-weight: 650;
  margin-bottom: 0;
}
html[data-theme] #app .login-wrap .login-card input {
  height: 45px;
  border: 1px solid var(--dd-outline);
  border-radius: 8px;
  background: var(--dd-canvas);
  color: var(--dd-ink);
  padding-inline: 12px;
  font-size: 14px;
}
html[data-theme] #app .login-wrap .login-card input:focus-visible {
  outline: 2px solid var(--dd-action);
  outline-offset: 2px;
}
html[data-theme] #app .login-wrap .login-card .btn.btn-primary {
  min-height: 45px;
  margin: 6px 0 0;
  border: 1px solid #a74320;
  border-radius: 8px;
  background: #a74320;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  box-shadow: none;
}
html[data-theme] #app .login-wrap .login-card .btn.btn-primary:hover { background: #8c3417; border-color: #8c3417; }
html[data-theme="dark"] #app .login-wrap .login-card .btn.btn-primary { background: #f6a574; border-color: #f6a574; color: #2c1a13; }
html[data-theme="dark"] #app .login-wrap .login-card .btn.btn-primary:hover { background: #ffc094; border-color: #ffc094; }
#app .login-card .form-error:empty { display: none; }
#app .login-footnote {
  margin-top: auto;
  padding-top: 23px;
  color: var(--dd-muted);
  font-size: 11px;
  line-height: 1.35;
}

@media (max-width: 860px) {
  #app .app-shell { grid-template-columns: minmax(0, 1fr); --dd-pad: clamp(14px, 3vw, 26px); }
  #app .workspace-rail {
    position: static;
    height: auto;
    overflow: visible;
    padding: 12px var(--dd-pad);
  }
  #app .app-shell .workspace-rail .brand { padding: 0; }
  #app .workspace-rail .brand img.brand-mark { width: 31px; height: 31px; border-radius: 8px; }
  #app .workspace-rail .brand-label :is(h1,strong,b,span:first-child) { font-size: 17px; }
  #app .rail-caption, #app .rail-footer { display: none; }
  #app .app-shell .workspace-rail .nav {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-flow: row;
    grid-auto-columns: auto;
    order: initial;
    margin: 12px 0 0;
    gap: 4px;
  }
  html[data-theme] #app .app-shell .workspace-rail .nav button { gap: 6px; padding: 6px 8px; min-height: 39px; font-size: 11px; }
  html[data-theme] #app .app-shell .workspace-rail .nav button .nav-icon { width: 16px; height: 16px; flex-basis: 16px; }
  html[data-theme] #app .app-shell .workspace-rail .nav button[aria-current="page"]::before { height: 13px; }
  html[data-theme] #app .app-shell > .workspace > .topbar { position: relative; min-height: 49px; padding-block: 5px; }
  #app .workspace-page-heading { margin-bottom: 17px; }
}
@media (max-width: 665px) {
  #app .app-shell .workspace-rail .nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #app .account-trigger .who { display: none; }
  html[data-theme] #app .app-shell .topbar .account .account-popover .who { display: block; }
  html[data-theme] #app .login-wrap { grid-template-columns: minmax(0, 1fr); width: min(100%, 474px); padding: 15px 12px; }
  html[data-theme] #app .login-wrap .login-story {
    min-height: 0;
    padding: 17px 19px;
    gap: 16px;
    border-radius: 17px 17px 0 0;
    border: 1px solid #29384c;
    border-bottom: none;
  }
  #app .login-copy { margin: 0; max-width: 100%; }
  html[data-theme] #app .login-wrap .login-story h2 { font-size: clamp(24px, 6vw, 33px); margin: 0 0 6px; }
  html[data-theme] #app .login-wrap .login-story p { font-size: 11px; }
  #app .login-story-footer { display: none; }
  #app .login-edition { top: 17px; right: 18px; }
  #app .login-graphic { bottom: -80px; right: -75px; opacity: .55; }
  html[data-theme] #app .login-wrap .login-card { padding: 20px 19px; border-radius: 0 0 17px 17px; }
  html[data-theme] #app .login-wrap .login-card .login-welcome { margin: 26px 0 16px; }
  #app .login-top img.brand-mark { width: 34px; height: 34px; }
  #app .login-footnote { padding-top: 16px; }
}
@media (max-width: 365px) {
  #app .workspace-context { font-size: 10px; gap: 5px; }
  #app .app-shell .topbar .account { gap: 3px; }
  html[data-theme] #app .app-shell .topbar .account > .btn { padding-inline: 6px; }
  html[data-theme] #app .app-shell .workspace-rail .nav button { gap: 4px; font-size: 10px; }
}

/* Optional accessibility and decorative chrome hooks. */
#app .workspace-skip {
  position: absolute;
  z-index: 40;
  top: 7px;
  left: 8px;
  padding: 7px 12px;
  color: #211a16;
  background: #ffd0b1;
  border-radius: 6px;
  text-decoration: underline;
  transform: translateY(calc(-100% - 8px));
}
#app .workspace-skip:focus { transform: translateY(0); outline: 2px solid #fff; outline-offset: 2px; }
#app .account-menu:not([open]) > .account-popover { display: none; }
#app .login-graphic .graphic-lane {
  position: absolute;
  inset: auto -40px 57px auto;
  width: 380px;
  height: 120px;
  border: 1px solid #5c6a7c;
  border-radius: 120px;
  transform: rotate(-32deg);
}
#app .login-graphic .graphic-orbit-secondary {
  position: absolute;
  width: 265px;
  height: 54px;
  right: 26px;
  bottom: 32px;
  border: 1px dashed #77869d;
  border-radius: 100px;
  transform: rotate(-32deg);
}
#app .login-graphic .graphic-stop {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f6a574;
  box-shadow: 0 0 0 4px #f6a57426;
}
#app .login-graphic .graphic-stop-a { right: 110px; bottom: 155px; }
#app .login-graphic .graphic-stop-b { right: 198px; bottom: 88px; background: #96a8c2; box-shadow: 0 0 0 4px #96a8c233; }
#app .login-graphic .graphic-stop-c { right: 80px; bottom: 81px; }
/* 滴滴 2.0 — composed release */
#app .login-copy h2 span { display:block; }
#app .login-story-footer { display:flex; flex-wrap:wrap; gap:8px 17px; }
#app .login-story-footer span { display:inline-flex; align-items:center; gap:7px; }
#app .login-story-footer span::before { content:""; width:4px; height:4px; background:#f6a574; border-radius:50%; }
html[data-theme] #app .login-wrap .login-card .login-welcome h1 {
  margin:5px 0 6px; color:var(--dd-ink); font-size:clamp(24px,3vw,36px); line-height:1.2; font-weight:740;
  letter-spacing:-.025em;
}
#app .login-welcome p { color:var(--dd-muted); font-size:13px; }
html[data-theme] #app .login-card .password-control { display:flex; width:100%; }
html[data-theme] #app .login-card .password-control input {
  min-width:0; flex:1 1 0%; border-radius:9px 0 0 9px;
}
html[data-theme] #app .login-card .password-reveal {
  width:auto; flex:none; margin:0; color:var(--dd-action); white-space:nowrap; border-radius:0 9px 9px 0;
}
.dialog-tools { display:flex; align-items:center; gap:6px; }
.dialog-tools .dialog-close { line-height:1; font-size:1.2rem; }

#app #workspace-title:focus { outline:none; }
#app .account-trigger .account-role { margin-inline-start:6px; color:var(--dd-muted); font-weight:550; }
html[data-theme] #app .login-wrap .login-story { width:100%; max-width:none; justify-self:stretch; margin:0; }
html[data-theme] #app .onboard-dashboard .pool-rpm-panel .hint { color:var(--signal-muted); }
#app .login-copy { max-width:100%; }
html[data-theme] #app .login-wrap .login-story p { max-width:36ch; }
@media(min-width:666px){
  html[data-theme] #app .login-wrap .login-story h2 { font-size:clamp(28px,3.4vw,52px); }
}
@media(max-width:665px){
  #app .login-story-footer { display:none; }
}
