/* clean/build-admin.css — page polish for the clean layer (see clean/base.css).
   Build + Admin pages: Code (+ lib/changes.js), Projects, Settings, Users. Every rule is
   scoped under a page-owned prefix (cd- chg- pj- st- us-) so nothing leaks to other pages. */

/* shared micro-label used by these pages */
.st-lbl, .us-lbl, .pj-lbl, .cd-lbl {
  font: 500 9.5px/1.2 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-4);
}

/* ================================================================= Settings */
/* ---- compact rows that open in place: name · one-line summary · status · chevron */
.st-xlist { display: flex; flex-direction: column; }
.st-x { border-bottom: 1px solid var(--line); }
.st-x:last-child { border-bottom: 0; }
.st-x-sum {
  list-style: none; display: grid; grid-template-columns: 180px minmax(0, 1fr) auto 12px; align-items: center; gap: 18px;
  padding: 13px 2px; user-select: none;
}
.st-x-sum::-webkit-details-marker { display: none; }
details.st-x > .st-x-sum { cursor: pointer; transition: background 0.12s var(--ease); }
details.st-x > .st-x-sum:hover { background: rgba(255, 255, 255, 0.015); }
.st-x-n { font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-x-s { min-width: 0; font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-x-st { display: inline-flex; justify-content: flex-end; min-width: 0; max-width: 280px; }
.st-x-c { width: 12px; height: 12px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-4); transition: transform 0.18s var(--ease), color 0.12s; }
details.st-x > .st-x-sum .st-x-c::before { content: ''; width: 5px; height: 5px; margin-top: -3px; border-right: 1.4px solid currentColor; border-bottom: 1.4px solid currentColor; transform: rotate(45deg); }
details.st-x > .st-x-sum:hover .st-x-c { color: var(--text-2); }
details.st-x[open] > .st-x-sum .st-x-c { transform: rotate(180deg); }
.st-x-body {
  display: flex; flex-direction: column; gap: 10px; max-width: 760px;
  padding: 0 2px 20px 200px; animation: ui-rise 0.22s var(--ease);
}
.st-x-hint { margin: 0; max-width: 72ch; font-size: 12.5px; line-height: 1.55; color: var(--text-3); }
.st-x-note { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.st-x-ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-x-ctl > input:not([type=checkbox]) { flex: 1 1 220px; min-width: 0; }
.st-x-body .signin-form { max-width: 440px; }
.st-code { padding: 8px 12px; font: 12px/1.5 var(--mono); color: var(--text-2); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); word-break: break-all; user-select: all; }

/* status: dot + one calm word (the dot carries the colour) */
.st-state { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-state.is-good, .st-state.is-accent, .st-state.is-warn { color: var(--text-2); }
.st-mono { font: 11.5px var(--mono); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- per-tier models */
.st-tiers { display: flex; flex-direction: column; }
.st-tier { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 18px; align-items: center; padding: 13px 2px; border-bottom: 1px solid var(--line); }
.st-tier:last-child { border-bottom: 0; }
.st-tier-id { min-width: 0; }
.st-tier-n { display: flex; align-items: baseline; gap: 10px; font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.st-tag { font: 500 9.5px/1.2 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-4); white-space: nowrap; }
.st-tier-w { margin-top: 5px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-tier-w .vz-dot { margin-right: 7px; vertical-align: 1px; }
.st-tier-ctl { display: flex; align-items: center; gap: 8px; min-width: 0; }
.st-tier-ctl > input { flex: 1; min-width: 0; }
.st-tier-ins { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.st-tier-ctl select { width: 118px; flex: none; }
.st-static { font-size: 12.5px; color: var(--text-3); }

/* ---- AI usage: headline figure, provider split, ranked models, months as columns */
.st-usage { display: flex; flex-direction: column; gap: 34px; padding-top: 4px; }
.st-u-top, .st-u-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px 64px; align-items: start; }
.st-u-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.st-u-grid.one { grid-template-columns: minmax(0, 1fr); }
.st-u-grid.one .st-u-models { max-width: 760px; }
.st-u-head { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.st-u-head .vz-fig-v { font-size: 42px; }
.st-u-head .vz-fig-l { margin-top: 4px; font-size: 13px; }
.st-or { display: flex; flex-direction: column; gap: 6px; max-width: 400px; }
.st-or-h { font: 11px var(--mono); color: var(--text-4); }
.st-u-prov, .st-u-models, .st-u-months { min-width: 0; }
.st-u-prov .st-lbl, .st-u-models .st-lbl, .st-u-months .st-lbl { margin-bottom: 14px; }
.st-u-prov .vz-split-bar { height: 10px; }
.st-legend { margin-top: 12px; }
.st-u-models .vz-hbar-l { font: 11.5px var(--mono); color: var(--text-2); }
.st-u-models .vz-more-body { padding-top: 11px; }
.st-usage > .vz-more { margin-top: -14px; }
.st-usage > .vz-more > .vz-more-body { max-width: 760px; }
.st-src { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--text-3); }
.st-src > span:first-child { color: var(--text-2); }
.st-src > span:last-child { font: 11px var(--mono); color: var(--text-4); }
.st-src + .st-x-hint { margin-top: 12px; }
/* provider shares: one accent family at falling strength, so colour stays a signal */
.st-usage .t-s1 { --vz-c: var(--accent); }
.st-usage .t-s2 { --vz-c: rgba(127, 178, 195, 0.62); }
.st-usage .t-s3 { --vz-c: rgba(127, 178, 195, 0.38); }
.st-usage .t-s4 { --vz-c: rgba(168, 173, 183, 0.34); }
.st-usage .t-s5 { --vz-c: rgba(168, 173, 183, 0.2); }
.st-usage .t-dim { --vz-c: rgba(127, 178, 195, 0.5); --vz-rgb: 127, 178, 195; }

@media (max-width: 1100px) { .st-u-top, .st-u-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .st-x-sum { grid-template-columns: minmax(0, 1fr) auto 12px; gap: 4px 14px; }
  .st-x-s { grid-column: 1 / -1; grid-row: 2; }
  .st-x-body { padding-left: 2px; }
  .st-tier { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .st-tier-ctl { flex-wrap: wrap; }
}

/* ================================================================= Users */
.us-page { display: flex; flex-direction: column; }
.us-top { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px 56px; align-items: center; padding-top: 26px; }
.us-top .vz-kpi:first-child .vz-kpi-v { font-size: 34px; }
.us-mix { min-width: 0; }
.us-mix .us-lbl { margin-bottom: 14px; }
.us-mix .vz-split-bar { height: 10px; }
.us-none { font-size: 12.5px; color: var(--text-4); }
/* role mix: one accent family, most powerful role strongest */
.us-top .t-r1 { --vz-c: var(--accent); }
.us-top .t-r2 { --vz-c: rgba(127, 178, 195, 0.64); }
.us-top .t-r3 { --vz-c: rgba(127, 178, 195, 0.4); }
.us-top .t-r4 { --vz-c: rgba(168, 173, 183, 0.34); }
.us-top .t-r5 { --vz-c: rgba(168, 173, 183, 0.2); }

.us-list { display: flex; flex-direction: column; }
.us-row { display: flex; align-items: center; gap: 16px; padding: 14px 2px; border-bottom: 1px solid var(--line); }
.us-list > .us-row:last-child, .us-list .vz-capped > .us-row:last-child { border-bottom: 0; }
.us-row .user-av { width: 34px; height: 34px; border-radius: 9px; font-size: 13px; box-shadow: none; }
.us-id { flex: 1; min-width: 0; }
.us-name { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 13.5px; }
.us-name b { font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.us-tag { flex: none; font: 500 9.5px/1.2 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.us-mail { margin-top: 1px; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.us-job { margin-top: 3px; font-size: 12px; font-style: italic; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.us-row.is-pending .us-job { white-space: normal; line-height: 1.5; max-width: 72ch; }
.us-job.none { font-style: normal; color: var(--text-4); }
.us-st { flex: none; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-3); }
.us-role { flex: none; width: 210px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.us-role select { width: 100%; }
.us-rdesc { font-size: 11.5px; color: var(--text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.us-rdesc:empty { display: none; }
.us-acts { flex: none; min-width: 140px; display: flex; justify-content: flex-end; align-items: center; gap: 6px; flex-wrap: wrap; }
.us-note { font: 11px var(--mono); color: var(--text-4); cursor: default; }
.us-list .vz-showall { margin: 12px 2px 0; }
@media (max-width: 900px) {
  .us-top { grid-template-columns: minmax(0, 1fr); }
  .us-row { flex-wrap: wrap; }
  .us-role { width: auto; flex: 1 1 200px; }
}

/* ================================================================= Projects */
.pj-top { display: flex; align-items: center; flex-wrap: wrap; gap: 28px 52px; padding: 30px 0 6px; }
.pj-top-r { flex: 1 1 320px; max-width: 620px; display: flex; flex-direction: column; gap: 16px; }
.pj-top-r .vz-split-bar { height: 10px; }
.pj-lbl { margin-bottom: -4px; }
.goal-grid.pj-grid { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
.pj-card { display: flex; flex-direction: column; }
.pj-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.pj-head .vz-ring { flex: none; }
.pj-id { min-width: 0; padding-top: 4px; }
.pj-desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; line-height: 1.5; }
.pj-ctl { display: flex; align-items: center; gap: 2px; }
.pj-status { height: 26px; padding: 0 24px 0 8px; font-size: 12px; color: var(--text-3); background-color: transparent; border-color: transparent; }
.pj-status:hover, .pj-status:focus { border-color: var(--line-2); }
.pj-card.is-done .pj-status { color: var(--good); }
.pj-card.is-blocked .pj-status { color: var(--bad); }
.pj-del { opacity: 0; transition: opacity 0.12s var(--ease); }
.pj-card:hover .pj-del, .pj-del:focus-visible { opacity: 1; }
@media (hover: none) { .pj-del { opacity: 1; } }
.goal-measure.pj-measure { margin: 16px 0 0; }
.pj-checks { display: flex; flex-direction: column; }
.pj-measure .vz-showall { margin-top: 6px; }
.pj-range { display: block; width: 100%; margin: 2px 0 0; }
.pj-notes .vz-more { margin-top: 14px; }
.pj-notes .vz-tl-t { white-space: normal; overflow: visible; font-size: 12.5px; line-height: 1.5; color: var(--text-2); }
.goal-talk.pj-talk { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 560px) { .goal-grid.pj-grid { grid-template-columns: minmax(0, 1fr); } }

/* ================================================================= Code */
/* landing: commits as a timeline, PRs as quiet links */
.cd-recent { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 22px 52px; align-items: start; }
.cd-col { min-width: 0; }
.cd-lbl { margin-bottom: 10px; }
.cd-recent .vz-tl-t { font-size: 12.5px; color: var(--text-2); }
.cd-recent .vz-tl-i.t-accent .vz-tl-t { color: var(--text); }
.cd-recent .vz-tl-w { font-size: 10.5px; }
.cd-recent .vz-more { margin-top: 6px; }
.cd-recent .vz-more-body { padding-top: 4px; }
.cd-recent .vz-quiet { padding: 8px 0; }
.cd-prs { display: flex; flex-direction: column; }
.cd-pr { display: flex; align-items: baseline; gap: 10px; min-width: 0; padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--text-2); text-decoration: none; transition: color 0.12s; }
.cd-pr:last-child { border-bottom: 0; }
.cd-pr:hover { color: var(--text); text-decoration: none; }
.cd-pr-n { flex: none; font: 11px var(--mono); color: var(--text-4); }
.cd-pr-t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1100px) { .cd-recent { grid-template-columns: minmax(0, 1fr); } }

/* Changes: branch facts as a kpi strip, then one quiet line with the actions */
.chg-hd { display: flex; flex-direction: column; gap: 12px; }
.chg-kpis .vz-kpis { border-top: 0; }
.chg-kpis .vz-kpi { padding-top: 4px; }
.chg-kpis .vz-kpi:first-child .vz-kpi-v { font: 500 14px/26px var(--mono); letter-spacing: 0; }
.chg-bar { display: flex; align-items: center; gap: 10px; min-width: 0; }
.chg-bar .chg-last { flex: 1; min-width: 0; font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chg-bar .chg-actions { flex: none; margin-left: auto; }
.chg-hd .chg-rule { margin: 0; font-size: 11.5px; color: var(--text-4); }
.chg-sub.is-warn { color: var(--text-2); }
.chg-kinds:not(:empty) { max-width: 520px; margin: 4px 0 12px; }
.chg-kinds .vz-split { gap: 8px; }
.chg-kinds .vz-split-bar { height: 6px; }
.chg-req-meta { margin-top: 4px; }
.chg-req-why { margin-top: 6px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.chg-req .vz-more { margin-top: 6px; }
.chg-req .vz-more-body { padding-top: 6px; }
.chg-req .chg-req-files { margin-top: 0; }
.chg-files > .vz-showall { margin: 10px 2px 0; }
/* change sizes: lines added (green) / removed (red) per file, biggest first */
.chg-sizes { display: flex; flex-direction: column; gap: 7px; max-width: 780px; margin: 6px 0 16px; }
.chg-sizes .vz-more { margin-top: 2px; }
.chg-sizes .vz-more-body { display: flex; flex-direction: column; gap: 7px; padding-top: 8px; }
.chg-size { display: grid; grid-template-columns: minmax(0, 1fr) minmax(80px, 220px) 92px; gap: 14px; align-items: center; }
.chg-size-p { font: 11.5px var(--mono); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chg-size-bar { display: flex; gap: 1px; height: 6px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, 0.05); }
.chg-size-bar > i { display: block; height: 100%; }
.chg-size-bar > i.a { background: var(--good); }
.chg-size-bar > i.d { background: var(--bad); }
.chg-size-n { display: flex; justify-content: flex-end; gap: 8px; font: 11px var(--mono); font-variant-numeric: tabular-nums; }
.chg-size-n .a { color: var(--good); }
.chg-size-n .d { color: var(--bad); }
