#user-detail {
  --staff-dim: #aaa9ae;
  --staff-line: #ffffff23;
  --staff-accent: #edc69d;
  width: min(100%, 1240px);
  max-width: none;
  padding: clamp(24px,4vw,52px) clamp(16px,5vw,76px) 72px;
  font-variant-numeric: tabular-nums;
}
#users-back { margin: 0 0 23px; color: var(--staff-dim); font-size: 14px; }
#users-back::before { content: '‹'; margin-right: 7px; }
.staff-header,.staff-person,.panel-heading,.record-pages,.record-pages > div { display: flex; align-items: center; }
.staff-header,.panel-heading,.record-pages { justify-content: space-between; gap: 16px; }
.staff-header { padding: 0 0 25px; }
.staff-person { min-width: 0; gap: 14px; }
.staff-person > div { min-width: 0; }
#staff-name { margin: 0; font-size: clamp(24px,3vw,38px); letter-spacing: -.035em; line-height: 1.2; overflow-wrap: anywhere; }
#staff-avatar .user-avatar { height: 50px; width: 50px; border-radius: 15px; font-size: 19px; }
#staff-identity { flex-wrap: wrap; gap: 4px 10px; color: #bab8bc; margin-top: 7px; font-size: 13px; }
#staff-identity .staff-role { padding: 2px 7px; border: 1px solid var(--staff-line); border-radius: 5px; color: #d7cabb; }
#staff-wallet { text-align: right; flex-shrink: 0; }
.metric-label { display: block; font-size: 14px; color: var(--staff-dim); }
#staff-balance { display: block; margin: 2px 0; font-size: clamp(28px,3vw,38px); font-weight: 600; letter-spacing: -.035em; }
#staff-balance small { font-size: .55em; color: #b9b5b0; letter-spacing: 0; }
#edit-balance { font-size: 13px; color: var(--staff-accent); background: transparent; border: 0; padding: 3px 0; }
#edit-balance:hover,.quiet:hover { text-decoration: underline; }
#staff-tabs { display: flex; gap: clamp(12px,2.8vw,34px); border-bottom: 1px solid var(--staff-line); }
#staff-tabs [role=tab] { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--staff-dim); padding: 12px 1px; font-size: 15px; transition: none; }
#staff-tabs [aria-selected=true] { color: #fff; border-bottom-color: var(--staff-accent); font-weight: 600; }
#user-detail [role=tabpanel] { padding-top: 28px; }
.staff-metrics { border: 0; border-bottom: 1px solid var(--staff-line); margin: 0 0 25px; padding: 4px 0 25px; gap: 18px; }
.staff-metrics dt { font-size: 14px; }
.staff-metrics dd { font-size: clamp(19px,2.3vw,28px); letter-spacing: -.025em; }
.panel-heading { margin-bottom: 18px; }
.panel-heading h2,.staff-conversations h2 { margin: 0; font-size: 19px; }
#user-detail .usage-plot { background: #131315; padding: 13px; border: 1px solid #ffffff12; border-radius: 9px; }
#user-detail .usage-plot canvas { height: clamp(170px,24vh,250px); }
#user-detail input,#user-detail select { min-width: 0; width: 100%; font: inherit; }
#user-detail input[type=checkbox] { min-width: 0; width: 16px; height: 16px; accent-color: #dfbd9c; }
.visually-labelled span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#user-detail .detail-filters { align-items: end; background: #151517; border: 1px solid #ffffff15; border-radius: 10px; padding: 14px; margin: 0; gap: 12px; }
.detail-filters label { min-width: 0; flex: 1 1 150px; font-size: 13px; }
.detail-filters label.wider { flex-grow: 1.5; }
.detail-filters label:has(input[type=date]) { flex: 0 1 175px; }
.detail-filters button,.mode-pick button,.record-pages button { font-size: 14px; }
.quiet { color: var(--staff-dim); background: transparent; border-color: transparent; }
.mode-pick { display: inline-flex; padding: 3px; border: 1px solid var(--staff-line); border-radius: 8px; }
.mode-pick button { padding: 5px 10px; border: 0; background: transparent; color: var(--staff-dim); border-radius: 5px; }
.mode-pick [aria-pressed=true] { background: #303033; color: #fff; }
.detail-status:empty,#chat-record-note:empty { display: none; }
.detail-status,#chat-record-note { margin: 16px 0; color: var(--staff-dim); font-size: 14px; }
#bill-table table { min-width: 565px; font-size: 14px; }
#bill-table small { display: block; color: var(--staff-dim); font: 12px/1.6 ui-monospace,monospace; overflow-wrap: anywhere; }
#bill-table td:first-child { max-width: 230px; }
#bill-table th { text-align: right; } #bill-table th:first-child { text-align: left; }
.record-pages { margin-top: 18px; font-size: 13px; color: var(--staff-dim); flex-wrap: wrap; }
.record-pages > div { gap: 9px; }
#user-detail .record-pages input { width: 3.4em; padding: 4px 2px; text-align: center; appearance: textfield; font-variant-numeric: tabular-nums; }
.record-pages input::-webkit-inner-spin-button { appearance: none; }
.record-pages:empty { display: none; }
.record-pages button:disabled { cursor: default; opacity: .4; }
#chat-records .chat-date { margin: 22px 0 3px; font-size: 14px; color: var(--staff-dim); font-weight: 500; }
#user-detail .chat-session-row { margin: 0; padding: 14px 5px; background: transparent; border: 0; border-bottom: 1px solid var(--staff-line); border-radius: 0; gap: 20px; }
#user-detail .chat-session-row:hover { background: #ffffff08; }
.chat-session-row > span { min-width: 0; display: grid; gap: 5px; }
.chat-session-row > span:last-child { flex: none; text-align: right; }
.chat-session-row strong { font-size: 15px; font-weight: 580; }
.chat-session-row code,#chat-session-id { font: 13px/1.5 ui-monospace,monospace; color: #a7a7ac; overflow-wrap: anywhere; }
#chat-reader-head { border-bottom: 1px solid var(--staff-line); padding-bottom: 15px; }
#chat-reader-head h3 { margin: 0 0 6px; font-size: 18px; overflow-wrap: anywhere; }
#user-detail .chat-turn { padding: 20px 0 18px; border: 0; border-bottom: 1px solid var(--staff-line); border-radius: 0; margin: 0; }
.chat-turn header { display: flex; gap: 8px 16px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
#user-detail .chat-match { border-inline-start: 2px solid var(--staff-accent); padding-left: 14px; }
#user-detail .chat-turn h3 { margin: 0; color: var(--staff-dim); font-size: 14px; }
.chat-turn h4 { font-size: 13px; color: var(--staff-accent); font-weight: 550; margin: 14px 0 5px; }
#user-detail .chat-turn p { line-height: 1.7; font-size: 15px; max-width: 86ch; }
#staff-permissions #user-form { gap: 16px; padding-bottom: 20px; }
#staff-permissions #staff-model-form { display: block; }
#staff-model-form fieldset { border: 0; padding: 0; margin: 26px 0 16px; }
#staff-model-form legend { color: #eceaed; font-size: 18px; font-weight: 600; margin-bottom: 14px; }
#staff-models label { display: flex; align-items: center; font-size: 14px; color: #d6d5d5; }
@media (max-width: 650px) {
  .staff-header { align-items: flex-start; flex-direction: column; gap: 20px; }
  #staff-wallet { display: grid; grid-template-columns: 1fr auto; align-items: baseline; width: 100%; text-align: left; }
  #staff-wallet .metric-label { grid-column: 1 / -1; }
  #staff-tabs { gap: 0; justify-content: space-between; }
  #staff-tabs [role=tab] { font-size: 14px; }
  .staff-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .staff-metrics dt { font-size: 13px; }
  .detail-filters label,.detail-filters label:has(input[type=date]) { flex: 1 1 42%; }
  .detail-filters label.wider { flex-basis: 100%; }
  .staff-person,.panel-heading { gap: 10px; }
  #bill-table table,#bill-table tbody { display: block; min-width: 0; }
  #bill-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #bill-table tbody tr { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px 12px; padding: 13px 0; border-bottom: 1px solid var(--staff-line); }
  #bill-table td { border: 0; padding: 0; text-align: left; overflow-wrap: anywhere; }
  #bill-table td:first-child { grid-row: 1; grid-column: 1; }
  #bill-table td:last-child { grid-row: 1; grid-column: 2; text-align: right; font-weight: 600; }
  #bill-table td:not(:first-child):not(:last-child) { font-size: 12px; color: var(--staff-dim); }
  #bill-table td:not(:first-child):not(:last-child)::before { content: attr(data-label) ' '; }
  #bill-table[data-grain=calls] td:nth-child(4) { grid-column: 2; grid-row: 2; text-align: right; }
}
#business-form { display:block; width:100%; margin:0; }
.access-columns { display:grid; grid-template-columns:minmax(0, .92fr) minmax(0, 1.08fr); border:1px solid var(--staff-line); border-radius:14px; overflow:hidden; background:#141416; }
.access-columns > section { min-width:0; padding:clamp(16px,2.4vw,32px); }
#business-media { background:#101012; border-inline-start:1px solid var(--staff-line); }
.access-heading { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin:0 0 14px; }
#business-form h2 { margin:0; font-weight:620; font-size:19px; letter-spacing:-.025em; }
.access-heading span,.access-account small,.access-system small,.access-empty p,#business-status,#business-no-matches { color:var(--staff-dim); font-size:13px; }
#business-options .access-system,#business-accounts .access-account { display:flex; flex-direction:row; align-items:center; gap:13px; padding:15px 3px; border-top:1px solid #ffffff14; cursor:pointer; color:#f0eff0; margin:0; }
.access-system > span:nth-child(2),.access-account > span { display:grid; flex:1; min-width:0; gap:2px; }
.access-system strong,.access-account strong { font-size:15px; font-weight:600; }
.access-symbol,.access-empty-icon { display:grid; position:relative; place-items:center; flex:none; width:37px; height:37px; border:1px solid #ffffff1b; border-radius:10px; color:#b1b0b3; background:#202022; }
.access-symbol::before,.access-symbol::after,.access-empty-icon::before,.access-empty-icon::after { content:''; position:absolute; box-sizing:border-box; }
.access-symbol.geo::before { width:17px; height:17px; border:1.5px solid; border-radius:50%; }
.access-symbol.geo::after { width:7px; height:7px; border:1.5px solid; border-radius:50%; }
.access-symbol.adfusion::before { width:3px; height:8px; background:currentColor; box-shadow:5px -4px currentColor,10px -8px currentColor; transform:translate(-5px,4px); }
.access-symbol.outlook::before { width:19px; height:14px; border:1.5px solid; border-radius:3px; }
.access-symbol.outlook::after { width:10px; height:10px; border:solid; border-width:0 1.5px 1.5px 0; transform:translateY(-3px) rotate(45deg); }
.access-system:has(:checked) .access-symbol { color:#ecd1b0; background:#27231f; border-color:#e8ba842a; }
#user-detail #business-options input { appearance:none; position:relative; flex:none; margin:0; width:37px; height:22px; min-height:0; border:1px solid #68666c; padding:0; border-radius:16px; background:#303033; cursor:pointer; }
#business-options input::after { content:''; display:block; width:14px; height:14px; margin:3px; border-radius:50%; background:#b7b6ba; transition:transform .15s; }
#user-detail #business-options input:checked { background:#dfbd98; border-color:#dfbd98; }
#business-options input:checked::after { transform:translateX(15px); background:#28201a; }
#business-form :focus-visible { outline:2px solid var(--staff-accent); outline-offset:3px; }
.access-system:hover strong,.access-account:hover strong { color:var(--staff-accent); }
.access-empty { min-height:181px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding:8px 16px; border:1px dashed #ffffff29; border-radius:9px; }
.access-empty-icon { width:35px; height:32px; margin-bottom:10px; background:none; border:0; }
.access-empty-icon::before,.access-empty-icon::after { width:24px; height:17px; border:1.5px solid; border-radius:3px; }
.access-empty-icon::before { transform:translate(-3px,-3px); opacity:.55; }
.access-empty-icon::after { background:#101012; transform:translate(2px,2px); }
.access-empty strong { font-size:15px; font-weight:550; }
#business-form .access-empty p { margin:5px 0 0; line-height:1.6; max-width:30em; }
#business-form .access-search { display:block; position:relative; margin:0 0 10px; }
#business-search { display:block; box-sizing:border-box; width:100%; border-radius:7px; padding:9px 12px; background:#1b1b1d; }
#business-accounts { max-height:22rem; overflow:auto; }
#business-accounts .access-account { gap:10px; padding:10px 4px; overflow-wrap:anywhere; }
#user-detail #business-accounts input { flex:none; width:16px; height:16px; margin:0; }
#business-form .access-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:17px 0; }
#business-form .access-footer .primary { flex:none; padding:9px 17px; }
#business-status[data-state=error] { color:#f5b8a8; }
#business-status[data-state=ok] { color:#d4e1d3; }
@media (max-width:720px) {
  .access-columns { grid-template-columns:minmax(0,1fr); }
  #business-media { border-inline-start:0; border-top:1px solid var(--staff-line); }
  .access-empty { min-height:125px; }
}
@media (prefers-reduced-motion:reduce) { #business-options input::after { transition:none; } }
