/* admin-users-1 (owner 01-10, docs/PLAN-2026-10-01-admin-users-1.md): Settings > Users, the paged directory with its
   detail drawer (admin-users.js). Loaded after org-panel.css; theme tokens only, so light and dark follow. Below 720px
   the table becomes cards, the filters fold behind a button and the drawer becomes a bottom sheet. */
.au-root { display: grid; gap: 14px; max-width: 1180px; }
.au-root [hidden], .au-drawer [hidden], .au-confirm [hidden] { display: none !important; }
.au-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

.au-banner { display: grid; gap: 4px; margin: 0; padding: 9px 12px; border: 1px solid var(--toast-border); border-radius: 10px;
  background: var(--toast-bg); color: var(--text); font-size: .85rem; }
.au-banner:empty { display: none; }

.au-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.au-stat { display: inline-flex; align-items: baseline; gap: 8px; min-height: 36px; padding: 6px 12px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--bg-elevated); color: var(--text); font: inherit; font-size: .85rem; cursor: pointer; }
.au-stat b { font-size: 1.05rem; }
.au-stat:hover:not(:disabled) { background: var(--bg-hover); }
.au-stat:disabled { cursor: default; opacity: .7; }
.au-stat[aria-pressed="true"] { border-color: var(--link); background: var(--accent-blue-soft); }

.au-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.au-search { flex: 1 1 260px; min-width: 0; height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); color: var(--text); font: inherit; font-size: .9rem; }
.au-sel { height: 38px; max-width: 100%; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg);
  color: var(--text); font: inherit; font-size: .85rem; color-scheme: light dark; }
.au-sel.is-set { border-color: var(--link); background: var(--accent-blue-soft); }
.au-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; font-size: .85rem; cursor: pointer; }
.au-btn:hover:not(:disabled) { background: var(--bg-hover); }
.au-btn:disabled { opacity: .55; cursor: default; }
.au-btn.au-link { border-color: transparent; background: none; color: var(--link); padding: 0 6px; }
.au-btn.au-primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.au-btn.au-danger { background: var(--danger-text); border-color: var(--danger-text); color: var(--bg); }
.au-filters-btn { display: none; }
.au-root :is(.au-stat, .au-btn, .au-sel, .au-search, .au-th, .au-open, .au-page):focus-visible,
.au-drawer :is(.au-btn, .au-sel, .au-x, .au-switch, a):focus-visible,
.au-confirm .au-btn:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

.au-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; color: var(--text-muted); font-size: .8rem; }
.au-meta .au-sp { flex: 1; }

.au-card { border: 1px solid var(--border); border-radius: 12px; background: var(--bg); overflow: hidden; }
.au-table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.au-table th { height: 40px; padding: 0 12px; background: var(--bg-elevated); border-bottom: 1px solid var(--border); color: var(--text-muted);
  font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; text-align: left; white-space: nowrap; }
.au-th { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px; margin: 0 -6px; border: 0; border-radius: 6px; background: none;
  color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.au-th:hover { background: var(--bg-hover); color: var(--text); }
.au-arr { opacity: .35; font-size: .65rem; }
th[aria-sort] .au-th { color: var(--text); }
th[aria-sort] .au-arr { opacity: 1; color: var(--link); }
.au-table td { height: 56px; padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.au-table tbody tr:last-child td { border-bottom: 0; }
.au-row { cursor: pointer; }
.au-row:hover td { background: var(--bg-hover); }
.au-row.is-open td { background: var(--accent-blue-soft); }
.au-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.au-av { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center; font-size: .75rem; font-weight: 700;
  background: var(--badge-blue-bg-hover); color: var(--link); }
.au-av.au-lg { flex-basis: 48px; width: 48px; height: 48px; font-size: 1.05rem; }
.au-open { display: block; min-width: 0; max-width: 260px; padding: 0; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.au-name { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-email { display: block; color: var(--text-muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-muted { color: var(--text-muted); }
.au-orgs { display: flex; flex-wrap: wrap; gap: 4px; max-width: 320px; }
/* org-role-name-1: the role chip says "Org workspace manager" (longer than MANAGER); on a laptop-width screen the organisation name in the
   table chip gives way (ellipsis; the full name and role are in the tooltip and the drawer) so the table keeps fitting its container */
@media (min-width: 721px) and (max-width: 1440px) { .au-table .au-orgs { max-width: 240px; } }
.au-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600;
  white-space: nowrap; border: 1px solid var(--border); color: var(--text-muted); background: transparent; }
.au-chip .au-t { overflow: hidden; text-overflow: ellipsis; }
.au-chip-org { color: var(--text); background: var(--bg-elevated); }
.au-chip-org .au-r { font-weight: 700; font-size: .65rem; letter-spacing: .03em; color: var(--link); }
.au-chip-org.is-susp { opacity: .65; border-style: dashed; }
.au-chip-none { border-style: dashed; }
.au-chip-admin { border-color: transparent; background: var(--badge-blue-bg-hover); color: var(--link); }
.au-chip-srv { border-color: transparent; background: var(--accent-blue-soft); color: var(--info); }
/* user-manager-1: the User Manager role chip (theme tokens only; the same shape as the Admin chip) */
.au-chip-um { border-color: transparent; background: var(--accent-blue-soft); color: var(--link); }
.au-chip-ok { border-color: transparent; background: var(--badge-green-bg-hover); color: var(--badge-green-text); }
.au-chip-block { border-color: transparent; background: var(--toast-bg); color: var(--toast-text); }
.au-dot { width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.au-chev { color: var(--text-muted); font-size: 1.1rem; text-align: right; }
.au-when { white-space: nowrap; }
.au-when small { display: block; color: var(--text-muted); font-size: .72rem; }
.au-root.no-orgs .au-col-org, .au-root.no-orgs [data-quick="assigned"], .au-root.no-orgs [data-quick="unassigned"],
.au-root.no-orgs [data-f="org"], .au-root.no-orgs [data-f="org_role"] { display: none; }

.au-cards { display: none; }
.au-c { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 4px 10px; align-items: center; padding: 12px;
  border-bottom: 1px solid var(--border); cursor: pointer; }
.au-c:last-child { border-bottom: 0; }
.au-c .au-orgs, .au-c .au-cmeta { grid-column: 2 / -1; }
.au-c .au-open { max-width: none; }
.au-cmeta { display: flex; flex-wrap: wrap; gap: 4px 8px; color: var(--text-muted); font-size: .75rem; }

.au-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 12px; border-top: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text-muted); font-size: .82rem; }
.au-foot .au-sp { flex: 1; }
.au-foot .au-sel { height: 32px; }
.au-pages { display: flex; align-items: center; gap: 4px; }
.au-page { min-width: 36px; height: 36px; padding: 0 8px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--text);
  font: inherit; font-size: .82rem; cursor: pointer; }
.au-page:hover:not(:disabled) { background: var(--bg-hover); }
.au-page[aria-current="page"] { border-color: var(--border); background: var(--bg); font-weight: 700; }
.au-page:disabled { color: var(--text-muted); opacity: .5; cursor: default; }

.au-empty { display: grid; justify-items: center; gap: 6px; padding: 44px 16px; text-align: center; color: var(--text-muted); font-size: .87rem; }
.au-empty strong { color: var(--text); font-size: .95rem; }
.au-sk { display: block; height: 10px; border-radius: 6px; background: var(--bg-hover); }

/* Admin page: the one-line Users card (D4) */
.au-admin-card { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.au-admin-card p { margin: 0; flex: 1 1 260px; color: var(--text-muted); font-size: .88rem; }
.au-admin-card p b { color: var(--text); }

/* detail drawer (fixed, above the page; the chat log modal, z 300, opens above it) */
.au-scrim { position: fixed; inset: 0; z-index: 240; background: var(--shadow-overlay); }
.au-drawer { position: fixed; z-index: 250; top: 0; right: 0; bottom: 0; width: 460px; max-width: 100%; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text); border-left: 1px solid var(--border); box-shadow: -12px 0 32px var(--shadow-drawer); }
.au-dh { position: relative; display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 4px 12px; align-items: center;
  padding: 18px 18px 14px; border-bottom: 1px solid var(--border); }
.au-dh h3 { margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.au-dh .au-sub { color: var(--text-muted); font-size: .85rem; overflow-wrap: anywhere; }
.au-dh .au-chips { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.au-x { width: 40px; height: 40px; border: 0; border-radius: 8px; background: none; color: var(--text-muted); font-size: 1.4rem; cursor: pointer; align-self: start; }
.au-x:hover { background: var(--bg-hover); color: var(--text); }
.au-db { flex: 1; overflow: auto; padding: 4px 18px 18px; }
.au-sec { padding: 14px 0; border-bottom: 1px solid var(--border); }
.au-sec:last-child { border-bottom: 0; }
.au-sec h4 { margin: 0 0 10px; color: var(--text-muted); font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.au-kv { display: grid; grid-template-columns: 130px minmax(0,1fr); gap: 8px 12px; margin: 0; font-size: .87rem; }
.au-kv dt { color: var(--text-muted); }
.au-kv dd { margin: 0; overflow-wrap: anywhere; }
.au-hint { margin: 8px 0 0; color: var(--text-muted); font-size: .78rem; }
.au-hint a, .au-hint .au-link { color: var(--link); }
.au-orglist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.au-orglist li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: .87rem; }
.au-orglist .au-n { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.au-ctl { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.au-ctl .au-l { flex: 1; min-width: 0; }
.au-ctl .au-l b { display: block; font-size: .87rem; font-weight: 600; }
.au-ctl .au-l span { display: block; color: var(--text-muted); font-size: .78rem; }
.au-switch { position: relative; flex: 0 0 46px; width: 46px; height: 28px; border: 0; border-radius: 999px; background: var(--border-strong); cursor: pointer; }
.au-switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 999px; background: var(--bg); transition: left .15s; }
.au-switch[aria-checked="true"] { background: var(--success); }
.au-switch[aria-checked="true"]::after { left: 22px; }
.au-switch:disabled { opacity: .5; cursor: default; }
.au-msg { margin: 6px 0 0; font-size: .8rem; color: var(--toast-text); }
.au-msg:empty { display: none; }
.au-tiles { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.au-tile { padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elevated); min-width: 0; }
.au-tile b { display: block; font-size: .95rem; overflow-wrap: anywhere; }
.au-tile span { color: var(--text-muted); font-size: .72rem; }
.au-df { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 18px; border-top: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text-muted); font-size: .78rem; }

.au-confirm { position: fixed; z-index: 260; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 400px; max-width: calc(100vw - 32px);
  padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); color: var(--text); box-shadow: 0 20px 50px var(--shadow-strong); }
.au-confirm h5 { margin: 0 0 8px; font-size: 1rem; }
.au-confirm p { margin: 0 0 14px; color: var(--text-muted); font-size: .87rem; }
.au-confirm .au-btns { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }

/* user-lifecycle-1: account status chips, the drawer's Account section, the action dialog with its reason, the
   deletion preview and the typed confirmation (same tokens; the dialog scrolls inside itself on a small screen) */
.au-chip-susp { border-color: transparent; background: var(--toast-bg); color: var(--toast-text); }
.au-chip-arch { border-style: dashed; color: var(--text-muted); }
.au-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.au-ok { margin: 0 0 8px; font-size: .87rem; color: var(--text); }
.au-steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: .82rem; color: var(--text-muted); }
.au-steps li.is-done { color: var(--text); }
.au-steps li.is-done > span:first-child { color: var(--success); }
.au-hist { margin-top: 10px; font-size: .8rem; color: var(--text-muted); }
.au-hist summary { cursor: pointer; }
.au-hist ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.au-hist li { overflow-wrap: anywhere; }
.au-hist b { color: var(--text); font-weight: 600; }
.au-confirm.au-wide { width: 540px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto;
  box-shadow: 0 0 0 100vmax var(--shadow-overlay), 0 20px 50px var(--shadow-strong); }
.au-confirm.au-wide p { color: var(--text); }
.au-fl { display: block; margin: 10px 0 4px; font-size: .8rem; font-weight: 600; color: var(--text); }
.au-input { display: block; width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); color: var(--text); font: inherit; font-size: .87rem; resize: vertical; }
.au-confirm .au-input { margin-bottom: 12px; }
.au-confirm .au-input:focus-visible, .au-hist summary:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.au-pv { width: 100%; border-collapse: collapse; margin: 0 0 8px; font-size: .85rem; }
.au-pv caption { text-align: left; font-weight: 600; font-size: .8rem; padding-bottom: 4px; }
.au-pv td { padding: 5px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.au-pv td:last-child { width: 64px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.au-kept { margin: 0 0 4px; padding-left: 18px; font-size: .8rem; color: var(--text-muted); display: grid; gap: 2px; }

/* user-manager-zenithai-b: ZenithAI accounts on this page - Add user / Import CSV, the Invited chip and the drawer's
   Sign-in section (same tokens) */
.au-prov { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.au-chip-inv { border-style: dashed; border-color: var(--link); color: var(--link); }
.au-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .82rem; }
.au-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 10px; }
.au-list li > * { min-width: 0; overflow-wrap: anywhere; }
.au-list li > span:last-child { color: var(--text-muted); }
.au-bad { color: var(--danger-text); font-weight: 600; }

@media (max-width: 720px) {
  .au-summary { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, black 85%, transparent); mask-image: linear-gradient(90deg, black 85%, transparent); }
  .au-stat { flex: 0 0 auto; }
  .au-toolbar .au-sel, .au-toolbar .au-clear { display: none; }
  .au-toolbar.is-open .au-sel { display: block; flex: 1 1 100%; }
  .au-toolbar.is-open .au-clear { display: inline-flex; }
  .au-filters-btn { display: inline-flex; }
  .au-search { flex-basis: 0; }
  .au-table { display: none; }
  .au-cards { display: block; }
  .au-card { overflow: visible; }
  .au-foot { position: sticky; bottom: 0; justify-content: space-between; border-radius: 0 0 12px 12px; }
  .au-foot .au-rpp, .au-pages .au-num { display: none; }
  .au-drawer { top: auto; height: 92vh; height: 92dvh; width: 100%; border-left: 0; border-top: 1px solid var(--border); border-radius: 16px 16px 0 0; }
  .au-dh::before { content: ""; position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 4px; background: var(--border-strong); }
  .au-kv { grid-template-columns: 110px minmax(0,1fr); }
  .au-tiles { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* api-usage-ui-1 (owner 17-10, docs/design/api-usage/): Settings > API & Usage. The Keys tab (search, sort, filters, paging,
   the "Can add documents" switch) and the Usage tab that hosts the Top 10 card. Prefix ua-; theme tokens, plus the few
   own tokens below: the light theme's darker NEW pill and the switch-off track (the app's own values measure under 4.5:1
   and 3:1; written as rgb() because a test keeps this file free of # colours). Below 720px the table becomes cards. Reduced motion turns the skeleton shimmer off. */
:root { --ua-pill-bg: var(--badge-blue-bg-hover); --ua-pill-text: var(--link); --ua-switch-off: rgb(113, 113, 122); }
[data-theme="light"] { --ua-pill-bg: rgb(239, 246, 255); --ua-pill-text: rgb(29, 78, 216); }
.side-nav-item .ua-new { margin-left: auto; padding: 1px 6px; border-radius: 999px; background: var(--ua-pill-bg); color: var(--ua-pill-text);
  font-size: .62rem; font-weight: 700; letter-spacing: .05em; }
/* api-usage-ui-2: the thin line above the admin entries of the side menu (hidden until app.js shows it) */
.side-nav-divider { height: 1px; margin: 6px 12px 4px; background: var(--border); }
.side-nav-divider[hidden] { display: none; }
.ua-root { display: grid; gap: 14px; max-width: 1180px; }
.ua-root [hidden] { display: none !important; }
.ua-root .settings-section-wide { max-width: none; }
.ua-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.ua-muted { color: var(--text-muted); }
.ua-root :is(button, input, select, [role="tab"]):focus-visible, .ua-toasts :is(button):focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

.ua-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.ua-tab { position: relative; padding: 11px 14px 10px; border: 0; background: none; color: var(--text-muted); font: inherit; font-size: .86rem;
  font-weight: 600; cursor: pointer; white-space: nowrap; }
.ua-tab:hover, .ua-tab[aria-selected="true"] { color: var(--text); }
.ua-root .ua-tab:focus-visible { outline-offset: -3px; border-radius: 6px; }   /* inside the box: the tab bar scrolls and would clip it */
.ua-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--link); }
.ua-cnt:empty { display: none; }
.ua-cnt { margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--bg-hover); color: var(--text-muted); font-size: .72rem; font-weight: 600; }
.ua-pane { display: grid; gap: 14px; outline: none; }

.ua-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--toast-border);
  border-radius: 10px; background: var(--toast-bg); color: var(--text); font-size: .85rem; }
.ua-banner b { color: var(--toast-text); }
.ua-banner .btn { margin-left: auto; }
.ua-tools { display: grid; gap: 10px; margin-bottom: 10px; }
.ua-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ua-search { position: relative; flex: 1 1 280px; min-width: 0; }
.ua-search svg { position: absolute; left: 12px; top: 11px; color: var(--text-muted); pointer-events: none; }
.ua-search kbd { position: absolute; right: 10px; top: 9px; }
.ua-input { width: 100%; height: 38px; padding: 0 40px 0 36px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; font-size: .88rem; }
.ua-sel { height: 38px; max-width: 100%; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text);
  font: inherit; font-size: .85rem; color-scheme: light dark; }
.ua-sel.is-set { border-color: var(--link); background: var(--accent-blue-soft); }
.ua-sortm { display: none; }
.ua-root kbd { display: inline-block; min-width: 20px; padding: 0 5px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px;
  background: var(--bg-elevated); color: var(--text-muted); font: 600 .7rem/1.6 var(--font); text-align: center; }
.ua-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ua-chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg);
  color: var(--text-muted); font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.ua-chip:hover { color: var(--text); background: var(--bg-hover); }
.ua-chip[aria-pressed="true"] { border-color: var(--link); background: var(--accent-blue-soft); color: var(--text); }
.ua-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: 30px; color: var(--text-muted); font-size: .8rem; }
.ua-meta b { color: var(--text); }
.ua-sp { flex: 1; }

.ua-tcard { border-radius: 8px; }
.ua-wrap { border-radius: 8px 8px 0 0; border-bottom: 0; }
.ua-root > *, .ua-pane > *, .ua-tools > * { min-width: 0; }   /* api-usage-ui-2: a grid item never grows to its content, so nothing here makes the page scroll sideways */
/* api-usage-ui-2: fixed layout, so the columns have the widths below and Name and Owner share the rest and ellipsize (title = full text);
   the table needs about 720px: below 1100px of window (the side menu takes 260px) the rows are cards (see the 1100px block). */
.ua-table { table-layout: fixed; }
.ua-table th { height: 40px; padding: 0 10px; vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ua-table td { padding: 8px 10px; vertical-align: middle; font-size: .85rem; }
.ua-table th:nth-child(2) { width: 142px; }
.ua-table th:nth-child(4) { width: 100px; }
.ua-table th:nth-child(5) { width: 140px; }
.ua-table th:nth-child(6) { width: 96px; }
.ua-table tbody tr:last-child td { border-bottom: 1px solid var(--border); }
.ua-row:hover td { background: var(--bg-hover); }
.ua-row.is-cur td { background: var(--accent-blue-soft); }
.ua-row.is-cur td:first-child { box-shadow: inset 3px 0 0 var(--link); }
.ua-kn { display: block; max-width: 280px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ua-c-prefix { white-space: nowrap; }
.ua-c-prefix code { font-size: .78rem; }
.ua-cpy { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-left: 4px; border: 0; border-radius: 6px; background: none; color: var(--text-muted); cursor: pointer; vertical-align: middle; }
.ua-cpy:hover { background: var(--bg-hover); color: var(--text); }
.ua-person { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 260px; }
.ua-av { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; background: var(--badge-blue-bg-hover); color: var(--link); font-size: .7rem; font-weight: 700; }
.ua-av::before { content: attr(data-i); }
.ua-av.ua-sys { border-radius: 8px; background: var(--bg-hover); color: var(--text-muted); }
.ua-ot { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ua-c-created, .ua-ts, .ua-ago { white-space: nowrap; }   /* api-usage-ui-2: a date never breaks; the (ago) part may drop to a second line */
.ua-ago { color: var(--text-muted); font-size: .78rem; }
.ua-switch { appearance: none; -webkit-appearance: none; position: relative; width: 40px; height: 24px; margin: 0; border: 0; border-radius: 999px;
  background: var(--ua-switch-off); cursor: pointer; vertical-align: middle; }
.ua-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 999px; background: var(--bg); transition: left .15s; }
.ua-switch:checked { background: var(--success); }
.ua-switch:checked::after { left: 19px; }
.ua-switch:disabled { opacity: .45; cursor: not-allowed; }
.ua-skel td { height: 50px; }
.ua-sk1, .ua-sk2 { background: linear-gradient(90deg, var(--bg-hover) 0, var(--bg-elevated) 50%, var(--bg-hover) 100%); background-size: 200% 100%; animation: ua-sh 1.4s infinite linear; }
.ua-sk1 { width: 60%; } .ua-sk2 { width: 35%; margin-top: 8px; }
@keyframes ua-sh { to { background-position: -200% 0; } }

.ua-empty { display: grid; justify-items: center; gap: 8px; padding: 44px 16px; border: 1px solid var(--border); border-radius: 8px; text-align: center; color: var(--text-muted); font-size: .87rem; }
.ua-empty strong { color: var(--text); font-size: 1rem; }
.ua-empty-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 4px; }
.ua-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 0 0 8px 8px;
  background: var(--bg-elevated); color: var(--text-muted); font-size: .82rem; }
.ua-foot .ua-sel { height: 32px; }
.ua-pages { display: flex; align-items: center; gap: 4px; }
.ua-page { min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: .82rem; cursor: pointer; }
.ua-page:hover:not(:disabled) { background: var(--bg-hover); }
.ua-page[aria-current="page"] { border-color: var(--border); background: var(--bg); font-weight: 700; }
.ua-page:disabled { color: var(--text-muted); opacity: .5; cursor: default; }

.ua-toasts { position: fixed; z-index: 350; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
.ua-toast { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elevated);
  color: var(--text); box-shadow: 0 12px 32px var(--shadow-strong); font-size: .86rem; animation: ua-tin .18s ease-out; }
.ua-toast code { padding: 1px 5px; border-radius: 4px; background: var(--bg-hover); }
.ua-ok { color: var(--success); font-weight: 700; }
.ua-x { width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: var(--text-muted); font-size: 1.1rem; cursor: pointer; }
.ua-x:hover { background: var(--bg-hover); color: var(--text); }
@keyframes ua-tin { from { transform: translateY(8px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) { .ua-sk1, .ua-sk2, .ua-toast, .ua-switch::after { animation: none; transition: none; } }
@media (max-width: 1100px) {      /* api-usage-ui-2: was 720px; the table needs about 720px of room and the side menu takes 260px */
  .ua-hide-m { display: none; }     /* the sort note and the J K Enter hint */
  .ua-sortm { display: inline-block; }
  .ua-wrap { overflow: visible; border: 1px solid var(--border); border-radius: 8px 8px 0 0; }
  .ua-table, .ua-table tbody, .ua-table tr, .ua-table td { display: block; }
  .ua-table thead { display: none; }
  .ua-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 12px; border-bottom: 1px solid var(--border); }
  .ua-table td, .ua-table tbody tr:last-child td { padding: 0; border: 0; height: auto; }
  .ua-table td { grid-column: 1 / -1; font-size: .8rem; }
  .ua-table td.ua-c-name { grid-column: 1; }
  .ua-table td.ua-c-docs { grid-column: 2; grid-row: 1; }
  .ua-table td.ua-c-prefix, .ua-table td.ua-c-owner { grid-column: 1 / -1; }
  .ua-table td.ua-c-created::before, .ua-table td.ua-when::before { content: attr(data-label) ": "; color: var(--text-muted); }
  .ua-kn { max-width: 100%; font-size: .9rem; }
  .ua-person { max-width: 100%; }
  .ua-skel td { grid-column: 1 / -1; }
  .ua-table tr.ua-row { cursor: default; }
}
@media (max-width: 720px) {
  .ua-search kbd { display: none; }
  .ua-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .ua-chip { flex: none; }
  .ua-foot { justify-content: space-between; }
  .ua-rpp, .ua-pnum { display: none; }
}

/* usage-problems-1 (owner 11-10): the problem label of a Top 10 row is a button, and the window it opens (admin.js;
   the chat log's .chatlog-overlay / .chatlog-card with a table in it). Theme tokens only. Below 640px each reason is
   a block: the sentence, then where, how many, first and last with their names in front. */
.ut-card button.ut-prob { cursor: pointer; font-family: inherit; line-height: inherit; }
.ut-card button.ut-prob:hover { text-decoration: underline; }
.ut-card button.ut-prob:focus-visible, .up-card :is(.btn, .icon-btn):focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.up-card { max-width: 940px; }
.up-sub { display: grid; gap: 4px; margin-bottom: 6px; }
.up-who { color: var(--text); font-size: .95rem; overflow-wrap: anywhere; }
.up-total { color: var(--text); font-weight: 600; }
.up-asof { margin-left: 8px; color: var(--text-muted); font-weight: 400; }
.up-what { min-width: 260px; color: var(--text); overflow-wrap: anywhere; }
.up-todo { margin-top: 2px; color: var(--text-muted); }
.up-code { margin-top: 4px; color: var(--text-muted); font-size: .7rem; }
.up-where { white-space: nowrap; }
.up-table .up-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.up-table td.up-num { font-weight: 600; color: var(--text); }
.up-when { white-space: nowrap; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.up-old .up-what { color: var(--text-muted); }
.up-state { display: grid; justify-items: center; gap: 10px; }

@media (max-width: 640px) {
  .up-table, .up-table tbody, .up-table tr, .up-table td { display: block; }
  .up-table thead { display: none; }
  .up-table tr { padding: 10px 0; border-bottom: 1px solid var(--border); }
  .up-table tbody tr:last-child { border-bottom: 0; }
  .up-table td { padding: 2px 0; border-bottom: 0; text-align: left; white-space: normal; }
  .up-table td.up-num { text-align: left; }
  .up-table td:not(.up-what)::before { content: attr(data-label) ": "; color: var(--text-muted); font-weight: 400; }
  .up-what { min-width: 0; }
}

/* usage-top10-1 (owner 09-10, docs/PLAN-2026-10-09-admin-usage-v2-dashboard.md section 3): the Admin page's "Top 10 by
   usage" card (admin.js). It reuses the Admin page's classes (.admin-head-row, .btn, .api-usage-table, .admin-bar-track,
   .au-th, .au-chip, .au-sk); only the layout is here. Theme tokens only. Below 720px each row becomes three lines:
   rank, name and the sorted number; the API / Chat / WS split; the bar and the other number. */
.ut-card [hidden] { display: none !important; }
.ut-head { align-items: center; flex-wrap: wrap; }
.ut-tools { display: inline-flex; align-items: center; gap: 8px; }
.ut-switches { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 0 0 10px; }
.ut-seg { display: inline-flex; }
.ut-seg .btn { min-height: 32px; margin-left: -1px; border-radius: 0; background: var(--bg); color: var(--text-muted); }
.ut-seg .btn:first-child { margin-left: 0; border-radius: 8px 0 0 8px; }
.ut-seg .btn:last-child { border-radius: 0 8px 8px 0; }
.ut-seg .btn:hover { background: var(--bg-hover); color: var(--text); }
.ut-seg .btn[aria-pressed="true"] { position: relative; z-index: 1; border-color: var(--link); background: var(--accent-blue-soft);
  color: var(--text); font-weight: 600; }
.ut-card :is(.btn, .au-th):focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.ut-body { transition: opacity .15s; }
.ut-body.is-busy { opacity: .55; }
.ut-table td { vertical-align: middle; }
.ut-table .ut-rank { width: 30px; padding-right: 0; color: var(--text-muted); text-align: right; font-variant-numeric: tabular-nums; }
.ut-name { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.ut-email { display: block; color: var(--text-muted); font-size: .76rem; overflow-wrap: anywhere; }
.ut-email-only { display: block; }
.ut-sub { color: var(--text-muted); font-size: .74rem; }
.ut-split { color: var(--text-muted); }
.ut-split abbr { text-decoration: none; }
.ut-prob { margin-left: 4px; font-size: .7rem; }
.ut-table .ut-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ut-table td.is-sorted .ut-n { font-weight: 700; color: var(--text); }
.ut-bar { display: inline-block; flex: none; width: 72px; height: 6px; margin-left: 10px; vertical-align: middle; }
.ut-bar .admin-bar-fill { display: block; background: var(--link); }
.ut-short, .ut-unit { display: none; }
.ut-skel { display: grid; gap: 14px; padding: 16px 14px; }
.ut-state { display: grid; justify-items: center; gap: 10px; padding: 26px 14px; text-align: center; color: var(--text-muted); font-size: .85rem; }
.ut-notranked { margin: 8px 0 0; }

@media (max-width: 720px) {
  .ut-table, .ut-table tbody { display: block; }
  .ut-table thead { display: none; }
  .ut-table tr { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; grid-template-areas: "rank who main" ". split split" ". bar other";
    gap: 4px 10px; align-items: center; padding: 12px; border-bottom: 1px solid var(--border); }
  .ut-table tbody tr:last-child { border-bottom: 0; }
  .ut-table td { display: block; padding: 0; border: 0; }
  .ut-table .ut-rank { grid-area: rank; width: auto; text-align: left; align-self: start; }
  .ut-table td.is-sorted .ut-n { align-self: start; }
  .ut-who { grid-area: who; min-width: 0; }
  .ut-split { grid-area: split; min-width: 0; }
  .ut-table td.ut-num { display: contents; }
  .ut-table td.is-sorted .ut-n { grid-area: main; text-align: right; font-size: .95rem; }
  .ut-table td.is-sorted .ut-bar { grid-area: bar; display: block; width: auto; margin: 0; }
  .ut-table td.ut-num:not(.is-sorted) .ut-n { grid-area: other; min-width: 116px; text-align: right; color: var(--text-muted); white-space: nowrap; }
  .ut-table td.ut-num:not(.is-sorted) .ut-unit { display: inline; }
  .ut-full { display: none; }
  .ut-short { display: inline; }
}

/* workspace-add-doc-1 (17-10): the line under Admin > API keys that says why a "Can add documents" change failed */
#adminKeysFlagError { color: var(--danger-text); font-weight: 600; margin-top: 6px; }
#adminKeysFlagError[hidden] { display: none; }

/* storage-s1 (21-10, docs/PLAN-2026-10-21-storage-visibility.md Part A): the Files and Storage columns, the attachments line
   in the meta row and the drawer's Storage section (admin-users.js). The bar reuses the Admin page's .admin-bar-track /
   .admin-bar-fill (as .ut-bar does); theme tokens only, so light and dark follow. */
.au-table .au-col-stor { white-space: nowrap; }
.au-stor { display: grid; gap: 4px; min-width: 0; font-variant-numeric: tabular-nums; }
.au-sbar { display: block; width: 100%; max-width: 88px; height: 4px; border-radius: 999px; background: var(--bg-hover); overflow: hidden; }
.au-sbar .admin-bar-fill { display: block; height: 100%; border-radius: inherit; background: var(--link); }
.au-cstor { display: inline-flex; align-items: center; gap: 6px; }
.au-cstor .au-sbar { width: 40px; }
.au-sk.au-sk-net { width: 24px; height: 24px; margin: 0 auto; border-radius: 999px; }
.au-sk.au-sk-stor { width: 76px; }
.au-stale { cursor: help; }
.au-stor-sum { color: var(--text-muted); }
.au-stor-h { margin: 0; }
.au-stor-btn { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 32px; padding: 0; border: 0; background: none;
  color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; text-align: left; cursor: pointer; }
.au-stor-btn .au-muted { font-weight: 400; letter-spacing: 0; text-transform: none; font-size: .8rem; }
.au-stor-caret { margin-left: auto; font-size: .8rem; }
.au-drawer .au-stor-btn:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.au-stor-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 0 8px; color: var(--text-muted); font-size: .78rem; }
.au-stor-chats > li { display: block; }
.au-stor-chat { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; }
.au-stor-chat > b { min-width: 0; overflow-wrap: anywhere; }
.au-stor-chat > span { color: var(--text-muted); }
.au-stor-files { display: grid; gap: 4px; margin: 6px 0 0; padding: 0; list-style: none; }
.au-stor-files li { display: grid; gap: 1px; padding-top: 5px; border-top: 1px dashed var(--border); font-size: .78rem; }
.au-stor-files li > span:last-child { color: var(--text-muted); }
.au-stor-fn { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
/* users-table-1 (21-10): the Users table fits ITS CARD at any width. The card (not the window: the side menu takes 260px) is a
   size container; the table has a fixed layout (no cell can push it past the card), narrow cells with ellipsis, Files and
   Storage in one column, Internet as a round icon (check / cross) with the word as its label, and the Designation as a muted
   line under the e-mail until the card is wide enough for its own column. A card narrower than the table's minimum scrolls
   inside itself with the Name column held at the left. Theme tokens only. */
.au-desig-line { display: none; }
.au-desig { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-pchips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.au-stor-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.au-fcount { color: var(--text-muted); font-size: .72rem; }
.au-int { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 999px; vertical-align: middle; }
.au-int-ok { background: var(--badge-green-bg-hover); color: var(--badge-green-text); }
.au-int-no { background: var(--toast-bg); color: var(--toast-text); }
@media (min-width: 721px) {
  .au-card { overflow-x: auto; overflow-y: hidden; min-width: 0; container: au-card / inline-size; }
  .au-table { table-layout: fixed; min-width: 700px; }
  .au-table th, .au-table td { box-sizing: border-box; padding-left: 8px; padding-right: 8px; }
  .au-table .au-col-name { width: 24%; }
  .au-table .au-col-desig { width: 150px; }
  .au-table .au-col-role { width: 92px; }
  .au-table .au-col-role .au-chip { overflow: hidden; text-overflow: ellipsis; }
  .au-table .au-col-net { width: 84px; text-align: center; }
  .au-table .au-col-stor { width: 112px; }
  .au-table .au-col-seen { width: 100px; }
  .au-table .au-col-go { width: 24px; padding-left: 0; padding-right: 8px; }
  .au-table td.au-col-net { text-align: center; }
  .au-table th.au-col-net .au-th { margin: 0 -6px; }
  .au-table .au-person { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 0 10px; }
  .au-table .au-person .au-av { grid-row: 1 / span 2; align-self: center; }
  .au-table .au-open { max-width: none; width: 100%; }
  .au-table .au-open:focus-visible { outline-offset: -2px; }
  .au-table .au-pchips { grid-column: 2; }
  .au-table .au-orgs { max-width: none; }
  .au-table .au-chip-org .au-t { min-width: 0; }
  .au-table .au-chip-org .au-r { flex: 0 0 auto; }
  .au-table .au-when { white-space: nowrap; }
}
/* below 1100px the organisation chip is two lines (name, then the role) so the name keeps room in a narrow cell */
@container au-card (max-width: 1099px) {
  .au-table .au-chip-org { display: grid; justify-items: start; gap: 0; padding: 3px 9px; border-radius: 10px; }
  .au-table .au-chip-org .au-t { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .au-table .au-chip-none { white-space: normal; border-radius: 10px; }
}
/* below 900px the Designation has no column of its own: it is the muted line under the person's e-mail (and the initials step aside) */
@container au-card (max-width: 899px) {
  .au-table .au-col-desig { display: none; }
  .au-table .au-person { grid-template-columns: minmax(0, 1fr); }        /* the decorative initials give their 42px to the e-mail */
  .au-table .au-person .au-av { display: none; }
  .au-table .au-pchips { grid-column: 1; }
  .au-table .au-desig-line { display: block; color: var(--text-muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
/* the table's own minimum no longer fits the card: it scrolls here and the Name column stays at the left edge */
@container au-card (max-width: 699px) {
  .au-table .au-col-name { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--border); }
  .au-table td.au-col-name { background: var(--bg); }
  .au-table th.au-col-name { background: var(--bg-elevated); z-index: 2; }
  .au-table .au-row:hover td.au-col-name { background: var(--bg-hover); }
  .au-table .au-row.is-open td.au-col-name { background: var(--accent-blue-soft); }
}
