: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: #9c4c27;
  --info-soft: #f8e7df;
  --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: #faf8f6; --surface: #fff; --surface-2: #f7f4f2;
 --border: #efebe8; --text: #382e28; --muted: #928983;
 --accent: #f55c15; --accent-text: #fff; --accent-soft: #fef3ee;
 --ok: #168462; --ok-soft: #e8f7f0; --warn: #af7715; --warn-soft: #fff6e3;
 --danger: #d14f61; --danger-soft: #fff0f2; --info: #d45e27; --info-soft: #fef3ee;
 --radius: 18px; --shadow: 0 4px 24px rgba(92,70,56,.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 #f55c1525; }
.brand h1 { font-size: 19px; letter-spacing: 1px; }
.brand-subtitle { font-size: 8px; letter-spacing: 1.5px; color: #b0a6a0; }
.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: #928983; 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: #70645c; overflow-wrap: anywhere; margin-bottom: 5px; }
.app-shell main { margin: 0 0 0 220px; padding: 34px 32px; max-width: 1640px; }
.card { border-color: #f2eeec; 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: #fefcfb; border-color: #ede9e6; border-radius: 11px; padding: 11px 13px; }
input:focus, textarea:focus, select:focus { border-color: #faa67f; outline: none; box-shadow: 0 0 0 3px #f55c150c; }
.btn { border-radius: 10px; border-color: #eeeae7; padding: 9px 15px; box-shadow: none; }
.btn-primary { background: var(--accent); color: white; border-color: var(--accent); box-shadow: 0 3px 8px #f55c1518; }
.btn-primary:hover { background: #d75315; }
.btn-link { color: var(--accent); background: transparent; border-color: transparent; }
.project { border-radius: 14px; box-shadow: none; padding: 17px; }
.project[aria-checked=true] { background: #fff7f3; border-color: #fab18f; }
.segmented { padding: 4px; border-radius: 11px; background: #f6f4f2; }
.segmented button { padding: 8px 18px; border-radius: 8px; }
.segmented button[aria-pressed=true] { color: var(--accent); }
select.target-pool-select { background-color: #fffaf8; border-color: #fae6dc; color: #5c483b; border-radius: 12px; box-shadow: none; }
select.target-pool-select:hover { background-color: #fff7f3; border-color: #fab899; }
select.target-pool-select:focus { border-color: #faa67f; box-shadow: 0 0 0 3px #f55c150c; }
select.target-pool-select option { background: white; color: var(--text); }
.records-search { margin: 20px 0 12px; }
.records-search input { max-width: 620px; background: #fbf9f8; }
.records-filters { gap: 10px; padding-bottom: 8px; }
.records-overview { background: #fffaf7; border: 1px solid #fceee7; 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 #f0ece9; border-radius: 15px; box-shadow: 0 2px 6px #5f483803; }
.account-record-meta { background: #fefbf9; border-bottom-color: #f4f2ef; color: #a29993; padding: 10px 18px; gap: 8px 23px; font-size: 11px; }
.account-record-meta strong { color: #7e726a; }
.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: #a09892; font-size: 11px; }
.account-record .compact-points-card { background: #fffaf8; border: 1px solid #fcf2ed; border-radius: 12px; padding: 13px 15px; gap: 8px 24px; margin: 7px 0 0; }
.account-record .compact-points-card .usage-grid strong { color: #5c483a; font-variant-numeric: tabular-nums; }
.account-record .compact-points-card .usage-grid .hint { font-size: 12px; }
.account-record .compact-points-card > .hint { color: #afa6a0; font-size: 10px; }
.usage-window progress { accent-color: #f77234; }
.usage-window progress::-webkit-progress-bar { background: #f1ece9; border-radius: 6px; }
.usage-window progress::-webkit-progress-value { background: #f77234; 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: #fff7f3; border: 1px solid #feebe2; 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: #f55c15; 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: #fff8f4; margin: 18px 0; }
.points-summary > div { display: grid; gap: 6px; }
.points-summary strong { font-size: 28px; color: #f55c15; }
.points-summary > p { width: 100%; }

/* Panda graphite workspace */
:root {
 color-scheme: dark;
 --bg: #0e0c0a; --surface: #1a1613; --surface-2: #28221f; --border: #342d29;
 --text: #f2eeeb; --muted: #9d948e; --accent: #f46624; --accent-text: #190c07;
 --accent-soft: #3e1e0f; --ok: #6bc9b2; --ok-soft: #132e2c;
 --warn: #ebbd61; --warn-soft: #30291a; --danger: #fb7c99; --danger-soft: #351d29;
 --info: #ed804e; --info-soft: #33271e; --shadow: 0 4px 24px #00000018;
}
.app-shell .topbar { background: #15110f; border-color: #2e2925; }
.brand-subtitle { color: #827871; }
.brand img.panda-mark { width: 40px; height: 40px; border-radius: 13px; box-shadow: none; background: none; }
.app-shell .nav button { color: #a79d97; }
.app-shell .nav button[aria-current=page] { background: #2e2621; color: #faaa85; }
.app-shell .account .who { color: #bbb2ac; }
.card { border-color: #312a26; }
input, textarea, select, .records-search input { background-color: #171310; border-color: #3c342f; color: var(--text); }
.btn { background: #26201c; border-color: #3e3631; color: #dad0ca; }
.btn-primary { background: #de581b; border-color: #de581b; color: #fff; }
.btn-primary:hover { background: #f46625; }
.btn-link { background: transparent; border-color: transparent; color: #f6844f; }
.project[aria-checked=true] { background: #2d221b; border-color: #755c4c; }
.segmented { background: #16120f; }
select.target-pool-select, select.target-pool-select:hover { background-color: #261e19; border-color: #524237; color: #f8cab5; }
select.target-pool-select option { background: #211a16; color: #f2eeeb; }
.records-overview, .points-summary, .pool-rpm-panel { background: #231c17; border-color: #42372f; }
.points-summary strong, .rpm-total > strong { color: #f88955; }
.account-record { background: #191512; border-color: #37302b; box-shadow: none; }
.account-record-meta { background: #201b17; border-color: #342c27; color: #8f837b; }
.account-record-meta strong { color: #c2b7b0; }
.account-record .compact-points-card { background: #201915; border-color: #3d332c; 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: #f6e0d6; }
.account-record .compact-points-card > .hint { color: #8b7d73; }
.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: #b0a49c; }
.window-caption strong { font-size: 11px; color: #ece4df; font-weight: 500; }
.window-remaining { margin-left: auto; font-size: 10px; color: #93877e; }
.account-record .slim-window progress { display: block; appearance: none; width: 100%; height: 4px; border: 0; border-radius: 9px; overflow: hidden; background: #362f2b; color: #db7140; }
.account-record .slim-window progress::-webkit-progress-bar { background: #362f2b; border-radius: 9px; }
.account-record .slim-window progress::-webkit-progress-value { background: #db7140; border-radius: 9px; }
.account-record .slim-window progress::-moz-progress-bar { background: #db7140; 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: #362f2b; 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, #413731); border-radius: 12px; background: rgba(222,106,52,.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(232,94,30,.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,#31261e,#2a211b); border:1px solid #4c3f35; 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:#35281f; border-color:var(--accent); color:var(--accent); }
.records-tools { border:1px solid var(--border); border-radius:12px; padding:16px; background:#171310; }
.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:#1c1713; 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:#2a231f; --control-hover:#3e342d; --control-edge:#4e433c; --control-ring:#f88550; }
.btn,.records-workspace .btn { min-height:34px; padding:7px 12px; border:1px solid var(--control-edge); border-radius:9px; background:linear-gradient(180deg,#332b25,#2a231e); color:#eee7e2; 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,#f66826,#d6561b); border-color:#f37135; color:#fff; box-shadow:inset 0 1px 0 #ffffff22,0 3px 9px #da4b0924; }
.btn-link,.records-workspace .btn-link { background:#3e2d2260; border-color:#5e4a3d; color:#faaf8c; 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 #f7783d15; }
.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,#483528,#352820); box-shadow:inset 0 0 0 1px #f8855022; }
.app-shell .nav button { transition:color .16s,background .16s,transform .1s; }
.app-shell .nav button[aria-current=page] { box-shadow:inset 3px 0 0 #f88a57; }
.segmented button { transition:background .16s,color .16s,transform .1s,box-shadow .16s; }
.segmented button[aria-pressed=true],.segmented button.active { background:#40332b; color:#fbbc9f; box-shadow:0 2px 5px #0004,inset 0 1px 0 #ffffff0c; }
.toast { border:1px solid #63544a; border-radius:12px; background:#332922; color:#feede5; 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:#473b33; border-color:#867366; box-shadow:0 3px 10px #0003,inset 0 1px 0 #ffffff0b; transform:translateY(-1px); }
 .btn-primary:not(:disabled):hover { background:linear-gradient(180deg,#f77c43,#ea5a17); border-color:#faaf8c; box-shadow:0 4px 14px #d452163a; }
 .btn-destructive:not(:disabled):hover { background:#512b37; border-color:#ae6477; color:#ffd0d8; }
 .health-filter:hover { border-color:#826f62; background:#352b24; }
 .app-shell .nav button:hover { background:#2f2620; color:#fbe2d6; }
}
@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 #f88a57; }
 .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:#1b1410; --surface:#221b16; --surface-2:#342b25; --text:#f7f5f3; --muted:#afa49d; --border:#4c423c; }
body { background:#1b1410; }
.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:#221b16; 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:#afa49d; }
.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(217 78 13 / .1); color:#f66725; }
.badge-muted { background:rgb(175 164 157 / .1); color:#afa49d; }
.health-filter { border:0; background:#221b16; 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(175 164 157 / .1); }
.health-all > span { color:#f66725; background:rgb(217 78 13 / .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:#342b25; }
.health-filter.active { background:#30261f; box-shadow:inset 0 0 0 2px rgb(246 103 37 / .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:#1b1410; border-color:#4c423c; border-radius:10px; }
.records-workspace .account-record { transition:background .16s; }
.records-workspace .account-record:hover { background:rgb(52 43 37 / .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(27 20 16 / .6); }
.app-shell .account .btn { background:transparent; border:1px solid #4c423c; color:#dbd5d0; box-shadow:none; }
.app-shell .account .btn:hover { background:#342b25; color:#fbfaf9; border-color:#81766e; }
@media(min-width:761px) {
 .app-shell .nav button { border-left:4px solid transparent; }
 .app-shell .nav button[aria-current=page] { border-left-color:#d94e0d; background:rgb(217 78 13 / .1); color:#f66725; 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:#221b16; box-shadow:0 8px 24px #0003; }
.records-workspace .account-record { border-radius:0; box-shadow:none; border-bottom:1px solid rgb(175 164 157 / .12); background:transparent; }
.records-workspace .account-record:last-child { border-bottom:0; }
.records-workspace .account-record:hover { background:#342b2566; }
.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:#4c423c; }
.account-record .record-sync { grid-column:1 / -1; font-size:11px; color:#afa49d; }
.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:#afa49d; }
@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:#afa49d; }
.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:#afa49d; }
.check-result-list dd { margin:0; overflow-wrap:anywhere; color:#ece8e6; }
.record-check-feedback { padding:4px 18px; font-size:11px; color:#faa67f; 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:#221b16; }
 .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:#1b1410; 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:#1b1410; }
.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:#221b16; 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:#ece8e6; }
@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:#221b16; }
.record-type-tabs button { border:0; border-radius:9px; background:transparent; color:#afa49d; padding:9px 22px; font-size:13px; cursor:pointer; }
.record-type-tabs button[aria-selected=true] { background:#44352b; color:#faa67f; box-shadow:0 2px 6px #0003; }
.record-type-tabs button:focus-visible { outline:2px solid #f66725; 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:#44352b; color:#faa67f; }

/* 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:#27201b;
 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:#afa49d; 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:#feeae0; background:linear-gradient(180deg,#554438,#47372d);
 box-shadow:inset 0 1px 0 #ffffff15,0 2px 6px #0004;
}
.record-tabs-workspace > .record-type-tabs > button:not([aria-selected=true]):hover { color:#ece8e6; 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 #faa67f; 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:#faa67f; font:600 12px/1.5 ui-monospace,monospace; }
.user-key-amount > span { font:400 11px/1.5 system-ui,sans-serif; color:#afa49d; }
.key-detail-stats .user-stat > strong { color:#faa67f; }

/* 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:#1b1410; 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:#9e938c; 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:#221b16; font-size:12px; cursor:pointer; transition:border-color .16s,box-shadow .16s; }
.official-route-control select:hover { border-color:#81766e; }
.official-route-control select:focus-visible { outline:0; border-color:#f7814a; box-shadow:0 0 0 3px #f568271a; }
.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:#afa49d; background:#81766e12; }
.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:#1b1410; }
.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:#afa49d; 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:#afa49d; 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:#fcf6f3; --surface:#fff; --surface-2:#fcf4f1; --border:#eee8e4; --text:#513f33; --muted:#92857c; --accent:#e66c33; --accent-text:#fff; --accent-soft:#fef1eb; --ok:#178667; --ok-soft:#e7f6ef; --danger:#c34962; --danger-soft:#fff0f3; --warn:#ad761d; --warn-soft:#fff6e7; --info:#a98064; --info-soft:#fef3ee; --shadow:0 8px 30px #81624e08; }
html[data-theme="light"] body { background:#fcf6f3; color:#513f33; }
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:#513f33; border-color:#eee8e4; box-shadow:0 6px 28px #81624e07; }
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:#513f33; }
html[data-theme="light"] :is(.hint,.sub,.muted,.brand-subtitle,.official-routing-columns,th,label) { color:#92857c; }
html[data-theme="light"] :is(input,select,textarea,.records-toolbar input,.records-toolbar select,.official-route-control select) { background:#fffbf9; color:#513f33; border:1px solid #ede6e2; box-shadow:none; }
html[data-theme="light"] :is(input,select,textarea):focus { border-color:#ec8251; box-shadow:0 0 0 3px #e66c3314; outline:none; }
html[data-theme="light"] ::placeholder { color:#ab9f96; }
html[data-theme="light"] :is(.btn,.account .btn,.segmented button,.record-type-tabs button,.key-buckets button) { background:#fdf8f6; color:#816e62; border-color:#eee8e4; box-shadow:none; }
html[data-theme="light"] :is(.btn:hover,.account .btn:hover,.app-shell .nav button:hover) { background:#fef3ee; color:#c25e2f; border-color:#fadacb; }
html[data-theme="light"] :is(.btn-primary,.btn-primary:hover) { background:#e66c33; color:white; border-color:transparent; box-shadow:0 4px 12px #e66c331c; }
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:#fef1eb; color:#dc6731; border-color:#e66c33; box-shadow:none; }
html[data-theme="light"] :is(.account-record,.official-route-row,.users-compact-table td) { background:transparent; border-color:#f5f2f0; color:#5d4c41; }
html[data-theme="light"] :is(.account-record:hover,.official-route-row:hover,tbody tr:hover) { background:#fffaf7; }
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:#fcf6f3; color:#816e62; }
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:#9c9189; background:#f6f4f2; }
html[data-theme="light"] .channel-icon-monochrome { filter:none; }
html[data-theme="light"] .toast { background:#fff; color:#513f33; border-color:#ede6e2; box-shadow:0 8px 32px #81624e18; }
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%,#feeae080,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:#ae8b73; }
html[data-theme="light"] .login-story p { color:#998a80; 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 #9d7b640b; }
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:#eee8e4; }
html[data-theme="light"] :is(.project[aria-checked=true],.health-filter.active) { background:#fef1eb; border-color:#facdb8; }
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:#fdf5f1; border-color:#eee8e4; color:#816e62; }
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:#cf6432; }
html[data-theme="light"] :is(select.target-pool-select,select.target-pool-select:hover,select.target-pool-select option) { background:#fffbf9; border-color:#ede6e2; color:#513f33; }
html[data-theme="light"] :is(.window-empty,.account-record .slim-window progress,.account-record .slim-window progress::-webkit-progress-bar) { background:#f2ede9; }
html[data-theme="light"] .project { color:#513f33; }

/* Refined light palette: neutral surfaces, ink typography, restrained blue. */
html[data-theme="light"] { --bg:#fbf9f8; --surface:#fff; --surface-2:#f8f7f6; --text:#3c3129; --muted:#7e746e; --border:#eeebe8; --accent:#e46b33; --accent-soft:#fef3ee; }
html[data-theme="light"] body { background:#fbf9f8; color:#3c3129; }
html[data-theme="light"] :is(h1,h2,h3,strong,.brand,.record-title,.user-name,.who,.stat-value,.points-value,.key-revenue strong) { color:#3c3129; }
html[data-theme="light"] :is(.hint,.sub,.muted,.brand-subtitle,.official-routing-columns,th,label) { color:#7e746e; }
html[data-theme="light"] :is(.card,.modal,.dialog,.health-filter,.official-routing,.official-connection) { background:#fff; color:#3c3129; border:1px solid #f0eeec; box-shadow:0 2px 5px #44352b03,0 12px 32px #44352b05; }
html[data-theme="light"] .app-shell .topbar { background:#fff; border-color:#f0eeec; box-shadow:none; }
html[data-theme="light"] .app-shell .nav button { color:#7e746e; font-weight:500; }
html[data-theme="light"] .app-shell .nav button[aria-current=page] { color:#c85f2e; background:#fef4ef; 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:#fbfaf9; color:#675c55; border-color:#f0eeec; 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:#3c3129; }
html[data-theme="light"] :is(input,textarea,select,.official-route-control select,select.target-pool-select,select.target-pool-select:hover) { background:#fffdfc; color:#3c3129; border-color:#ebe6e3; }
html[data-theme="light"] :is(input,select,textarea):disabled { opacity:1; background:#f9f8f8; color:#9c958f; border-color:#f2f0ef; }
html[data-theme="light"] :is(.btn,.app-shell .account .btn) { background:#fff; color:#675c55; border-color:#ece8e6; font-weight:500; }
html[data-theme="light"] .btn-primary { background:#e46b33; color:#fff; border-color:#e46b33; box-shadow:0 4px 10px #e46b331a; }
html[data-theme="light"] .btn-primary:hover { background:#cf5f2c; 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:#3c3129; }
html[data-theme="light"] .official-routing-columns { background:#fefbfa; }
html[data-theme="light"] .official-route-row + .official-route-row { box-shadow:0 -1px 0 #f3f1f0; }
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%,#fef1eb 0,transparent 55%),#fdf9f7; }
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(#f1c8b5 .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:#a78772; }
html[data-theme="light"] .login-story p { color:#897b71; 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 #6c53430a; }
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:#706258; font-weight:500; font-size:12px; margin-bottom:8px; }
html[data-theme="light"] .login-card input { height:50px; border-radius:12px; background:#fffcfb; 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:#e46b33; border-color:#e46b33; color:#fff; }
html[data-theme="light"] .login-card .btn.btn-primary:hover { background:#cf5f2c; border-color:#cf5f2c; 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 #f0eeec; 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:#fbf9f8; border:1px solid #f2eeec; box-shadow:none; border-radius:12px; }
html[data-theme="light"] .records-workspace .points-summary > div > strong { color:#3c3129; }
html[data-theme="light"] .records-workspace .points-summary > div > .hint { color:#7e746e; }
html[data-theme="light"] .records-workspace .records-group-breakdown { background:#fbfaf9; border:1px solid #f2eeec; color:#675c55; box-shadow:none; }
html[data-theme="light"] .records-workspace .records-group-breakdown summary { color:#a57f66; font-weight:550; }
html[data-theme="light"] .records-workspace .records-tools { background:#fbfaf9; border:1px solid #f2eeec; 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 #efeae8; box-shadow:none; border-radius:10px; }
html[data-theme="light"] .records-workspace .health-filter.active { background:#fef3ee; border-color:#e7936c; }
html[data-theme="light"] .health-all > span { color:#9d7458; background:#fef0e9; }
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 #f2eeec; }
html[data-theme="light"] .records-workspace .account-record { background:#fff; color:#3c3129; border-color:#f3f1ef; }
html[data-theme="light"] .records-workspace .account-record:hover { background:#fffcfb; }
html[data-theme="light"] .records-workspace .account-record .provider-usage-card.compact-points-card { background:#fbfaf9; color:#3c3129; box-shadow:none; }
html[data-theme="light"] .group-usage-item { background:#fff; border-color:#f2eeec; color:#675c55; }
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:#e46b33; color:#fff; border-color:#e46b33; }
@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:#221b16; font-size:12px; font-variant-numeric:tabular-nums; }
.official-route-demand input:focus-visible { outline:0; border-color:#f7814a; box-shadow:0 0 0 3px #f568271a; }
.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:#fffdfc; color:#3c3129; border-color:#ebe6e3; }
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:#afa49d; 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:#877c74; }
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:#afa49d; --pm-direct:#c4b5fd; }
html[data-theme="light"] { --tier-pro:#0f9f6e; --tier-max:#b86e00; --tier-unknown:#877c74; --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:#afa49d; font:500 12px/1.5 system-ui,sans-serif; white-space:nowrap; }
.tier-chip b { color:var(--text, #ece8e6); font:600 12px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace; font-variant-numeric:tabular-nums; }
html[data-theme="light"] .tier-chip { background:#f6f2f0; color:#786d65; }
html[data-theme="light"] .tier-chip b { color:#362c26; }
.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:#afa49d; }
.tier-row b { color:var(--text, #ece8e6); 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:#81766e; 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:#f0ece9; }
html[data-theme="light"] .tier-row { color:#786d65; }
html[data-theme="light"] .tier-row b { color:#362c26; }
.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:#dbd5d0; }
.points-matrix .pm-head { font:500 11px/1.4 system-ui,sans-serif; color:#81766e; 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:#afa49d; }
.points-matrix .pm-total { font-size:14.5px; font-weight:700; color:#f7f5f3; 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:#4c423c; }
html[data-theme="light"] .points-matrix .pm-total { color:#231b16; }
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:#ece8e6; }

@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:#f8f7f7; --surface:#ffffff; --surface-2:#f5f4f4; --border:#ebebef; --border-strong:#e1e1e6;
  --text:#1c1917; --ink:#09090b; --muted:#7f756c; --faint:#aea59d;
  --accent:#1c1917; --accent-text:#ffffff; --accent-soft:#f5f4f4;
  --ok:#15803d; --ok-soft:#f0fdf4; --warn:#b45309; --warn-soft:#fffbeb; --danger:#dc2626; --danger-soft:#fef2f2;
  --info:#4338ca; --info-soft:#fef4ef;
  --tier-pro:#16a34a; --tier-max:#ea8a0c; --tier-unknown:#aea59d; --pm-direct:#6d28d9;
  --shadow:0 1px 2px rgb(34 27 22 / .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:#49423c; }
html[data-theme="light"] body:not(#_) ::placeholder { color:var(--faint); }
html[data-theme="light"] body:not(#_) ::selection { background:#e8e5e3; }

/* ---- 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:#5e564f; background:transparent; border-color:transparent; font-weight:500; box-shadow:none; }
html[data-theme="light"] body:not(#_) .app-shell .nav button svg { color:#7f756c; }
html[data-theme="light"] body:not(#_) .app-shell .nav button:hover { background:#f5f4f4; color:var(--ink); border-color:transparent; }
html[data-theme="light"] body:not(#_) .app-shell .nav button[aria-current=page] { background:#f5f4f4; 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 #e8e5e3; font-weight:500; box-shadow:0 1px 1px rgb(9 9 11 / .03); }
html[data-theme="light"] body:not(#_) .btn:hover { background:#f5f4f4; color:var(--ink); border-color:#dad6d2; }
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:#2c2825; border-color:#2c2825; 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 #e8e5e3; box-shadow:0 1px 1px rgb(9 9 11 / .02); }
html[data-theme="light"] body:not(#_) :is(input,select,textarea):hover { border-color:#dad6d2; }
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:#aea59d; box-shadow:0 0 0 3px rgb(28 25 23 / .07); outline:none; }
html[data-theme="light"] body:not(#_) :is(input,select,textarea):disabled { background:#fafafa; color:var(--faint); border-color:#f3f1ef; }
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:#f5f4f4; color:#5e564f; border-color:#e8e5e3; }

/* ---- Segmented controls & tabs ---- */
html[data-theme="light"] body:not(#_) :is(.segmented,.record-type-tabs,.key-buckets) { background:#f5f4f4; 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:#dad6d2; }
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 #feeae1; }
html[data-theme="light"] body:not(#_) :is(.badge-muted,.official-route-status) { background:#f5f4f4; color:#5e564f; 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:#49423c; background:#f5f4f4; }
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:#f3f1ef; 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:#f5f4f4; color:#49423c; box-shadow:inset 0 0 0 1px #e8e5e3; }
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 #f3f1ef; }

/* ---- 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:#f3f1ef; }
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:#f3f2f1; }
/* 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:#f3f2f1; }
html[data-theme="light"] body:not(#_) .account-record .slim-window progress::-webkit-progress-bar { background:#f3f2f1; }
html[data-theme="light"] body:not(#_) .usage-window progress::-webkit-progress-bar { background:#f3f2f1; }
html[data-theme="light"] body:not(#_) .account-record .slim-window progress::-webkit-progress-value { background:#49423c; }
html[data-theme="light"] body:not(#_) .account-record .slim-window progress::-moz-progress-bar { background:#49423c; }
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:#923306; }
html[data-theme="light"] body:not(#_) .user-key-amount > span { color:var(--muted); }
html[data-theme="light"] body:not(#_) .points-matrix > * { color:#49423c; }
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:#f3f2f1; }
html[data-theme="light"] body:not(#_) .tier-chip { background:#f5f4f4; color:#5e564f; }
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:#f5f4f4; }

/* ---- 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(#dad6d2 .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:#49423c; }
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:#f5f4f4; }

/* Leftovers from the tint audit */
html[data-theme="light"] body:not(#_) tr { border-color:#f3f1ef; }
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:#5e564f; }
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:#81766e; }
html[data-theme="light"] .check-result-list dd { color:#342b25; }

/* 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:#923306; }
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 #ee814e; }
.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:#4f3f34; color:#fcd2be; 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:#eee8e4; border-left-color:#e57743; }
html[data-theme="light"] .announcement-label { background:#fef3ee; color:#a68066; }
@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; }

/* ===================================================================================
   「我不是黑奴」品牌色（2026-11-27）：暖白纸色底 + 橘红主色；深色由 recolor.py 统一转暖。
   放在最后，选择器多一层 :not(#__) 以压过前面的浅色层。
   =================================================================================== */
html[data-theme="light"] {
  --bg:#faf6f1; --surface:#ffffff; --surface-2:#f6efe7; --border:#ede4da; --border-strong:#e2d6c8;
  --text:#1f1a16; --ink:#17120e; --muted:#7a6e64; --faint:#a89c91;
  --accent:#d9480f; --accent-hover:#c2410c; --accent-text:#ffffff; --accent-soft:#fff1e6; --accent-line:#f6c3a5;
}
html[data-theme="dark"] { --accent-hover:#ff9a5c; --accent-soft-2:#3a2418; }
html[data-theme="light"] body { background:var(--bg); }
html[data-theme="light"] body:not(#_):not(#__) ::selection { background:#fde0cc; }
/* 侧栏 / 顶栏 */
html[data-theme="light"] body:not(#_):not(#__) .app-shell .topbar { background:#fffcf8; border-color:var(--border); }
html[data-theme="light"] body:not(#_):not(#__) .app-shell .nav button:hover { background:#fbf1e7; }
html[data-theme="light"] body:not(#_):not(#__) .app-shell .nav button[aria-current=page] { background:var(--accent-soft); color:var(--accent-hover); }
html[data-theme="light"] body:not(#_):not(#__) .app-shell .nav button[aria-current=page] svg { color:var(--accent); }
html[data-theme="light"] body:not(#_):not(#__) .app-shell .nav button[aria-current=page]::before { background:var(--accent); }
/* 主按钮 */
html[data-theme="light"] body:not(#_):not(#__) .btn.btn-primary { background:var(--accent); border-color:var(--accent); color:#fff; box-shadow:0 2px 8px rgb(217 72 15 / .18); }
html[data-theme="light"] body:not(#_):not(#__) .btn.btn-primary:hover { background:var(--accent-hover); border-color:var(--accent-hover); color:#fff; }
html[data-theme="light"] body:not(#_):not(#__) .btn.btn-primary:disabled { background:#f1e3d8; border-color:#f1e3d8; color:#a8907f; box-shadow:none; }
/* 输入框焦点、勾选框 */
html[data-theme="light"] body:not(#_):not(#__) :is(input,select,textarea):focus,
html[data-theme="light"] body:not(#_):not(#__) :is(input,select,textarea):focus-visible { border-color:#ee9a6f; box-shadow:0 0 0 3px rgb(217 72 15 / .12); }
html[data-theme="light"] body:not(#_):not(#__) :is(input[type=checkbox],input[type=radio]) { accent-color:var(--accent); }
/* 选中的分段 / 标签 / 状态卡 */
html[data-theme="light"] body:not(#_):not(#__) :is(.segmented button[aria-pressed=true],.segmented button.active,.record-type-tabs button[aria-selected=true],.key-buckets button[aria-pressed=true]) { color:var(--accent-hover); }
html[data-theme="light"] body:not(#_):not(#__) .records-workspace .health-filter.active { border-color:var(--accent); box-shadow:0 0 0 1px var(--accent); }
html[data-theme="light"] body:not(#_):not(#__) .records-workspace .health-filter.health-all.active { background:var(--accent-soft); }
html[data-theme="light"] body:not(#_):not(#__) .project[aria-checked=true] { border-color:var(--accent); box-shadow:0 0 0 1px var(--accent); background:var(--accent-soft); }
/* 用量进度条：常态用暖棕，警告 / 危险保持黄 / 红 */
html[data-theme="light"] body:not(#_):not(#__) .account-record .slim-window progress::-webkit-progress-value { background:#8a5a3c; }
html[data-theme="light"] body:not(#_):not(#__) .account-record .slim-window progress::-moz-progress-bar { background:#8a5a3c; }
html[data-theme="light"] body:not(#_):not(#__) .account-record .window-warn progress::-webkit-progress-value { background:#f59e0b; }
html[data-theme="light"] body:not(#_):not(#__) .account-record .window-warn progress::-moz-progress-bar { background:#f59e0b; }
html[data-theme="light"] body:not(#_):not(#__) .account-record .window-danger progress::-webkit-progress-value { background:#e11d48; }
html[data-theme="light"] body:not(#_):not(#__) .account-record .window-danger progress::-moz-progress-bar { background:#e11d48; }
/* 登录页 */
html[data-theme="light"] body:not(#_):not(#__) .login-wrap { background:transparent; }
html[data-theme="light"] body:not(#_):not(#__):has(.login-wrap) { background:radial-gradient(ellipse 60% 70% at 28% 55%, #ffe3cf 0%, #fff1e6 45%, transparent 75%) fixed, var(--bg); }
html[data-theme="light"] body:not(#_):not(#__) .login-story h2 span { color:var(--accent); background:linear-gradient(90deg,#f06418,#d9400c); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; }
html[data-theme="light"] body:not(#_):not(#__) .login-story::after { background-image:radial-gradient(#ecc9b2 .8px,transparent .9px); }
html[data-theme="light"] body:not(#_):not(#__) .login-card { box-shadow:0 24px 80px rgb(120 60 20 / .07); border-color:var(--border); }
html[data-theme="dark"] body .login-story h2 span { background:linear-gradient(90deg,#ff9a4d,#ff6a2a); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; }
/* 品牌名 */
.brand h1 { letter-spacing:.5px; }
@media (max-width:560px) { .topbar .brand h1 { white-space:nowrap; font-size:16px; } .topbar .brand { flex:none; } }
