/* The admin's short names, now aliases of the shared tokens. Light/dark and
   the tenant accent come from the token file (data-theme on <html>). */
:root, .aramah-brand-scope { --bg:var(--aramah-bg); --panel:var(--aramah-surface); --line:var(--aramah-border);
        --fg:var(--aramah-text); --mut:var(--aramah-text-muted); --input:var(--aramah-input);
        --blue:var(--aramah-blue); --purple:var(--aramah-purple); --magenta:var(--aramah-magenta);
        --acc:var(--aramah-accent); --on-acc:var(--aramah-on-accent);
        --ok:var(--aramah-ok); --warn:var(--aramah-warn); --err:var(--aramah-err);
        --brand:var(--aramah-grad);
        --series-1:var(--aramah-series-1); --series-2:var(--aramah-series-2); }
* { box-sizing:border-box; }
body { margin:0; font:var(--aramah-text-base)/var(--aramah-leading) var(--aramah-font-sans); background:var(--bg); color:var(--fg); }
header { display:flex; align-items:center; gap:14px; padding:12px 20px; background:var(--panel);
         border-bottom:1px solid var(--line); position:sticky; top:0; z-index:5; }
header::after { content:""; position:absolute; left:0; right:0; bottom:-1px; height:2px; background:var(--brand); }
.brand { display:flex; align-items:center; gap:11px; }
.brand img.mark { height:30px; width:30px; }
.brand img.wordmark { height:22px; width:auto; }
.brand small { color:var(--mut); font-size:12px; letter-spacing:.4px; }
.brand .brandtext { font-weight:700; font-size:18px; letter-spacing:.5px; color:var(--fg); }
.brandprev { display:flex; align-items:center; justify-content:center; background:var(--input);
             border:1px dashed var(--line); border-radius:8px; padding:10px; }
.brandprev img { max-width:100%; max-height:100%; object-fit:contain; }
select.theme { padding:6px 8px; }
header .sp { flex:1; }
#who { color:var(--mut); font-size:13px; }
input, select, button, textarea { font:inherit; color:var(--fg); background:var(--input); border:1px solid var(--line);
         border-radius:var(--aramah-radius-md); padding:7px 10px; }
button { background:var(--acc); border-color:var(--acc); color:var(--on-acc); cursor:pointer; }
button:hover:not(.ghost):not(:disabled) { background:var(--aramah-accent-hover); border-color:var(--aramah-accent-hover); }
:focus-visible { outline:none; box-shadow:var(--aramah-focus-ring); }
button.ghost { background:transparent; color:var(--fg); }
.loader { display:flex; justify-content:center; align-items:center; padding:26px; }
.loader img { width:150px; }
.card { background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:16px; margin:14px 0; }
.card h2 { margin:0 0 12px; font-size:15px; }
.row { display:flex; gap:10px; flex-wrap:wrap; align-items:end; }
.field { display:flex; flex-direction:column; gap:4px; }
.field label { color:var(--mut); font-size:12px; }
table { width:100%; border-collapse:collapse; font-size:13px; }
th,td { text-align:left; padding:7px 10px; border-bottom:1px solid var(--line); vertical-align:top; }
th { color:var(--mut); font-weight:600; }
.pill { padding:2px 8px; border-radius:20px; font-size:12px; white-space:nowrap; }
.pill.ok { background:var(--aramah-ok-soft); color:var(--ok); }
.pill.ext { background:var(--aramah-warn-soft); color:var(--warn); }
.pill.warn { background:var(--aramah-warn-soft); color:var(--warn); }
.pill.err { background:var(--aramah-err-soft); color:var(--err); }
.pill.accent { background:var(--aramah-ok-soft); color:var(--ok); }
.muted { color:var(--mut); }
.err { color:var(--err); }
svg text { fill:var(--mut); font-size:11px; }
.hide { display:none !important; }
/* Overview dashboard: grid of KPI cards + widget rows */
.grid { display:grid; gap:14px; margin:14px 0; }
.grid.k5 { grid-template-columns: repeat(5, 1fr); }
.grid.k6 { grid-template-columns: repeat(6, 1fr); }
.grid.w3 { grid-template-columns: repeat(3, 1fr); }
.grid.w2 { grid-template-columns: 2fr 1fr; }
@media (max-width: 1100px) { .grid.k5, .grid.k6 { grid-template-columns: repeat(2, 1fr); }
                             .grid.w3, .grid.w2 { grid-template-columns: 1fr; } }
.kpi { background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:14px 16px; position:relative; overflow:hidden; }
.kpi .lbl { color:var(--mut); font-size:12px; text-transform:uppercase; letter-spacing:.5px; }
.kpi .val { font-size:24px; font-weight:700; margin-top:4px; letter-spacing:-0.02em; }
.kpi .delta { font-size:12px; margin-top:2px; }
.kpi .delta.up   { color:var(--ok); }
.kpi .delta.down { color:var(--err); }
.kpi .delta.flat { color:var(--mut); }
.kpi .spark { margin-top:8px; height:36px; }
.kpi .spark path.line { fill:none; stroke:var(--acc); stroke-width:1.5; }
.kpi .spark path.fill { fill:var(--acc); opacity:.14; }
.widget h3 { margin:0 0 10px; font-size:13px; color:var(--mut); text-transform:uppercase; letter-spacing:.5px; }
.barrow { display:flex; align-items:center; gap:10px; font-size:13px; padding:4px 0; }
.barrow .lbl { flex:0 0 40%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.barrow .track { flex:1; height:8px; border-radius:4px; background:var(--line); overflow:hidden; }
.barrow .track > span { display:block; height:100%; background:var(--acc); border-radius:4px; }
.barrow.orange .track > span { background:var(--warn); }
.barrow.purple .track > span { background:var(--purple); }
.barrow.green  .track > span { background:var(--ok); }
.barrow.red    .track > span { background:var(--err); }
.barrow .val { flex:0 0 auto; color:var(--mut); font-variant-numeric:tabular-nums; min-width:70px; text-align:right; }
/* Accuracy: heuristic vs user-rated (WBS 2.5.4). --series-1/2 are the theme's
   primary and highlight (token file); the ARAMAH defaults were validated with
   the dataviz palette check against the light and dark surfaces. */
.grid.k4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .grid.k4 { grid-template-columns: repeat(2, 1fr); } }
.legend { display:flex; gap:16px; flex-wrap:wrap; font-size:12px; color:var(--fg); margin:-2px 0 6px; }
.legend .sw { display:inline-block; width:14px; height:3px; border-radius:2px; vertical-align:middle; margin-right:6px; }
.cmp { position:relative; }
.cmp svg .grid-line { stroke:var(--line); stroke-width:1; }
.cmp svg .cross { stroke:var(--mut); stroke-width:1; stroke-dasharray:3 3; }
.cmp svg text.end { fill:var(--fg); font-size:11px; }
.cmp .tip { position:absolute; pointer-events:none; background:var(--aramah-surface-raised); color:var(--fg);
            border:1px solid var(--line); border-radius:8px; padding:6px 9px; font-size:12px; box-shadow:var(--aramah-shadow-md);
            white-space:nowrap; transform:translate(-50%, -110%); }
.cmp .tip .sw { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:6px; }
.reasons .barrow.reason .lbl { flex-basis:58%; }
.reasons .barrow.reason .track > span { background:var(--series-2); }
table.comments td { vertical-align:top; }
table.comments td.comment { white-space:normal; max-width:480px; }
/* Analytics: tab strip + treemap + heatmap */
.tabs { display:flex; gap:2px; margin:8px 0 4px; border-bottom:1px solid var(--line); }
.tabs a { padding:8px 14px; color:var(--mut); cursor:pointer; border-bottom:2px solid transparent; font-size:13px; user-select:none; }
.tabs a:hover { color:var(--fg); }
.tabs a.active { color:var(--fg); border-bottom-color:var(--magenta); }
.tabs a[href] { text-decoration:none; }
/* Pager: the footer of a paged list (Access) */
.pager { justify-content:space-between; align-items:center; flex-wrap:wrap; gap:8px; padding:10px 14px;
         border-top:1px solid var(--line); background:color-mix(in srgb, var(--input) 60%, var(--panel)); font-size:13px; }
.pager-info { display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.pager-size select { margin-left:6px; min-width:0; width:auto; padding:4px 8px; }
.pager-btns { gap:6px; align-items:center; }
.pager-btns button { min-width:32px; padding:4px 9px; }
.pager-btns button[aria-current="page"] { background:var(--acc); border-color:var(--acc); color:var(--on-acc); }

/* ── Access page (Users / Groups) ── */
svg.ico { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; vertical-align:-3px; flex:0 0 auto; }
#pageactions button svg.ico { margin-right:4px; }
.dotpill { display:inline-flex; align-items:center; gap:6px; padding:4px 12px; font-weight:600; align-self:center; }
.dotpill::before { content:""; width:6px; height:6px; border-radius:50%; background:currentColor; }
.segtabs { display:flex; gap:8px; margin:4px 0 14px; flex-wrap:wrap; }
.segtabs a { padding:6px 16px; border-radius:999px; border:1px solid var(--line); background:var(--input); color:var(--fg);
             text-decoration:none; font-size:13px; font-weight:500; }
.segtabs a:hover { border-color:var(--acc); }
.segtabs a.active { background:var(--aramah-accent-soft); border-color:var(--acc); color:var(--acc); font-weight:600; }
html[data-theme="light"] .segtabs a.active { color:var(--blue); border-color:var(--blue); }
.kpi.stat { --tone:var(--acc); text-align:center; border:1px solid color-mix(in srgb, var(--tone) 35%, var(--line));
            background:color-mix(in srgb, var(--tone) 5%, var(--panel)); padding:14px 12px; }
.kpi.stat .lbl { margin-top:8px; font-size:11px; font-weight:600; }
.kpi.stat .val { margin-top:2px; color:var(--fg); }
.kpi.stat .delta { font-size:12px; }
.kpi.stat .stat-ico { display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; border-radius:9px;
                      color:var(--tone); background:color-mix(in srgb, var(--tone) 14%, var(--panel));
                      border:1px solid color-mix(in srgb, var(--tone) 35%, transparent); }
.kpi.stat .stat-ico svg.ico { width:18px; height:18px; vertical-align:0; }
.kpi.stat.tone-acc { --tone:var(--acc); } .kpi.stat.tone-purple { --tone:var(--aramah-purple); }
.kpi.stat.tone-warn { --tone:var(--warn); } .kpi.stat.tone-err { --tone:var(--err); } .kpi.stat.tone-ok { --tone:var(--ok); }
.kpi.stat.clickable { display:block; width:100%; font:inherit; color:inherit; cursor:pointer; text-align:center; }
.kpi.stat.clickable:hover { background:color-mix(in srgb, var(--tone) 11%, var(--panel)); }
.searchbox { display:flex; align-items:center; gap:8px; padding:0 12px; border:1px solid var(--line); border-radius:10px;
             background:var(--panel); color:var(--mut); margin:0 0 10px; }
.searchbox:focus-within { box-shadow:var(--aramah-focus-ring); }
.searchbox input { border:0; background:transparent; padding:9px 0; flex:1; min-width:0; box-shadow:none; }
.searchbox.grow { flex:1 1 320px; margin:0; }
.grow { flex:1 1 auto; }
#iam_users .toolbar { align-items:center; gap:10px; margin:0 0 10px; }
.segmented { display:inline-flex; padding:3px; gap:2px; border:1px solid var(--line); border-radius:10px; background:var(--input); }
.segmented button { border:0; padding:5px 12px; border-radius:7px; color:var(--mut); font-size:13px; }
.segmented button[aria-pressed="true"] { background:var(--panel); color:var(--fg); font-weight:600;
                                         box-shadow:0 1px 2px color-mix(in srgb, var(--fg) 15%, transparent); }
#iam_users .filters { align-items:end; margin:0 0 10px; }
#iam_users .filters .field label { text-transform:uppercase; letter-spacing:.5px; font-size:11px; font-weight:600; }
#iam_users .filters select { min-width:160px; }
#iam_users .filters .count { margin-left:auto; font-size:12px; align-self:center; }
.tablecard { background:var(--panel); border:1px solid var(--line); border-radius:12px; }
.tablecard table.users th { font-size:11px; text-transform:uppercase; letter-spacing:.5px; padding:12px 14px; }
.tablecard table.users td { padding:10px 14px; }
.tablecard table.users tr:last-child td { border-bottom:0; }
.tablecard td.act { width:44px; text-align:right; }
.pill.rolepill { background:var(--input); border:1px solid var(--line); color:var(--fg); font-size:11px; font-weight:600; letter-spacing:.4px; text-transform:uppercase; }
.pill.rolepill.admin { background:var(--aramah-accent-soft); }
.gicon { display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; border-radius:50%;
         color:var(--ok); background:var(--aramah-ok-soft); }
.linkbtn { background:none; border:0; padding:0; color:var(--acc); text-decoration:underline; cursor:pointer; font-size:13px; }
html[data-theme="light"] .linkbtn { color:var(--blue); }
.grp-note { margin:0 0 10px; font-size:13px; }
.dirtoggle { display:flex; align-items:center; gap:6px; font-size:13px; color:var(--mut); align-self:center; cursor:pointer; }
.dirtoggle input { width:auto; padding:0; }
tr.dirrow td { color:var(--mut); }
tr.dirrow .pavatar.small { background:var(--input); color:var(--mut); border:1px solid var(--line); }
.pill.dirpill { background:var(--input); color:var(--mut); border:1px solid var(--line); }
.sr { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
details.rowmenu { position:relative; display:inline-block; }
details.rowmenu summary { list-style:none; cursor:pointer; padding:4px 6px; border-radius:6px; color:var(--mut); }
details.rowmenu summary::-webkit-details-marker { display:none; }
details.rowmenu summary:hover, details.rowmenu[open] summary { background:var(--input); color:var(--fg); }
.rowmenu-list { position:absolute; right:0; top:calc(100% + 4px); z-index:6; min-width:150px; display:flex; flex-direction:column;
                padding:4px; background:var(--panel); border:1px solid var(--line); border-radius:10px;
                box-shadow:0 8px 24px color-mix(in srgb, var(--fg) 18%, transparent); }
.rowmenu-list button { border:0; text-align:left; padding:7px 10px; border-radius:6px; }
.rowmenu-list button:hover { background:var(--input); }
.rowmenu-list button.danger { color:var(--err); }
@media (max-width: 760px) {
  .tablescroll { overflow-x:auto; }
  .rowmenu-list { position:static; box-shadow:none; margin-top:4px; }
  #iam_users .filters .count { margin-left:0; }
  .segmented { width:100%; } .segmented button { flex:1; padding:5px 6px; }
}
.filterbar { display:flex; gap:10px; flex-wrap:wrap; align-items:end; padding:10px 0; }
.filterbar select, .filterbar input { min-width:140px; }
.treemap { display:flex; flex-wrap:wrap; gap:2px; height:220px; }
.treemap .tm { color:var(--tm-on, #fff); padding:8px 10px; overflow:hidden; border-radius:6px;
                display:flex; flex-direction:column; justify-content:flex-end; font-size:12px; line-height:1.35; }
.treemap .tm b { font-size:13px; }
.heatmap { display:grid; grid-template-columns: 40px repeat(24, 1fr); gap:2px; font-size:10px; color:var(--mut); }
.heatmap .lb { color:var(--mut); font-size:10px; padding:2px 6px; text-align:right; }
.heatmap .hb { color:var(--mut); font-size:10px; text-align:center; padding-top:4px; grid-row:1; }
.heatmap .cell { height:18px; border-radius:2px; background:var(--aramah-accent-soft); }
.timeline .tl-day { color:var(--mut); font-size:12px; text-transform:uppercase; letter-spacing:.5px; margin:12px 0 6px; }
.timeline .tl-item { display:flex; gap:12px; padding:8px 0; border-bottom:1px solid var(--line); font-size:13px; }
.timeline .tl-item .tl-time { color:var(--mut); font-variant-numeric:tabular-nums; flex:0 0 60px; }
.timeline .tl-item .tl-cat  { flex:0 0 90px; }
.timeline .tl-item .tl-act  { font-weight:600; }
.timeline .tl-item .tl-res  { color:var(--mut); }
/* App shell: left sidebar + content */
.shell { display:flex; align-items:flex-start; }
.side { width:230px; flex:0 0 230px; padding:14px 10px; border-right:1px solid var(--line); min-height:calc(100vh - 57px); }
.navhead { display:block; width:100%; text-align:left; color:var(--mut); font-size:11px; text-transform:uppercase; letter-spacing:.7px; padding:6px 12px; }
/* Group headers open and close their group (WBS 4.11.1); search on top (4.11.2). */
button.navhead { background:none; border:0; border-radius:6px; cursor:pointer; font:inherit; font-size:11px; display:flex; justify-content:space-between; align-items:center; }
button.navhead::after { content:"›"; font-size:14px; line-height:1; transition:transform .15s; }
button.navhead[aria-expanded="true"]::after { transform:rotate(90deg); }
button.navhead:hover { color:var(--fg); background:var(--aramah-secondary-soft); }
/* Group headings carry a light tint of the tenant accent (aramah-tokens.css)
   so they stand apart from the links under them; the active link keeps its
   secondary fill and highlight bar. */
.side button.navhead { background:var(--aramah-nav-group-bg); color:var(--aramah-nav-group-text); font-weight:600; margin-top:2px; }
.side button.navhead::after { color:var(--acc); }
.side button.navhead:hover { background:var(--aramah-nav-group-bg-hover); }
@media (prefers-reduced-motion: reduce) { button.navhead::after { transition:none; } }
button.navhead.current { color:var(--fg); font-weight:600; }  /* the open page is in this group */
.navgroup { margin-bottom:6px; }
.navsearch { padding:0 2px 10px; }
.navsearch input { width:100%; }
.side a.navhit small { display:block; font-size:11px; color:var(--mut); }
.side a.navhit.first { background:var(--aramah-secondary-soft); color:var(--fg); }
.navnone { padding:6px 12px; font-size:13px; }
.navflash { outline:2px solid var(--acc); outline-offset:3px; transition:outline-color 1s; }
.content .card { scroll-margin-top:76px; }  /* a search jump lands below the sticky header */
.side a { display:block; padding:8px 12px; border-radius:8px; color:var(--mut); cursor:pointer; user-select:none; text-decoration:none; }
.side a:hover { color:var(--fg); }
.side a.active { color:var(--fg); background:var(--aramah-secondary-soft); box-shadow:inset 2px 0 0 0 var(--magenta); }
.side .navitems a { display:flex; align-items:center; gap:10px; }
.side .navitems a .navicon { flex:0 0 auto; }
.side .navitems a.active .navicon { color:var(--acc); }
.content { flex:1; padding:8px 20px 60px; min-width:0; }
main { min-width:0; }
/* Login */
.login { max-width:380px; margin:9vh auto; }
.login .card { padding:24px; }
.login h1 { font-size:18px; margin:0 0 4px; }
.login p.sub { margin:0 0 18px; color:var(--mut); font-size:13px; }
.login .field { margin-bottom:12px; }
.login input { width:100%; }
.login button { width:100%; padding:10px; margin-top:4px; }
.login .or { text-align:center; font-size:12px; margin:12px 0; }
/* Modal (member/model popups) */
.modal-back { position:fixed; inset:0; background:var(--aramah-scrim); display:flex; align-items:center;
              justify-content:center; z-index:20; }
.modal { background:var(--panel); border:1px solid var(--line); border-radius:12px; width:min(520px,92vw);
         max-height:82vh; overflow:auto; padding:18px; }
.modal h3 { margin:0 0 12px; font-size:15px; }
.modal .x { float:right; }
/* A long option ("Name · address") must not widen the popup: the picker
   shrinks to the row and the text is cut inside the box, not the dialog. */
.modal .row > .field { min-width:0; flex:1 1 0; }
.modal .field select, .modal .field input { width:100%; max-width:100%; min-width:0;
  text-overflow:ellipsis; }
.modal ul { list-style:none; margin:0; padding:0; }
.modal li { display:flex; align-items:center; justify-content:space-between; gap:10px;
            padding:8px 2px; border-bottom:1px solid var(--line); }
.linkish { color:var(--acc); cursor:pointer; text-decoration:underline; }
html[data-theme="light"] .linkish { color:var(--blue); }

/* ── Shared page parts (WBS 3.3.1, Language models first) ── */
.pagehead { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin:4px 0 12px; }
.pagehead h1, .pagehead h2 { margin:0; font-size:20px; font-weight:600; letter-spacing:-0.01em; }
#pagehead:empty { display:none; }
#pageactions { align-items:flex-end; flex-shrink:0; }
.pagehead p { margin:2px 0 0; font-size:13px; }
.toolbar { align-items:center; justify-content:space-between; margin:4px 0 6px; }
.chips { display:flex; gap:6px; flex-wrap:wrap; }
.chip { border-radius:999px; padding:5px 14px; font-size:13px; background:var(--panel); color:var(--fg); }
.chip[aria-pressed="true"] { background:var(--acc); border-color:var(--acc); color:var(--on-acc); }
input.search { min-width:260px; flex:0 1 360px; }
/* Toolbar controls shrink to a narrow main column instead of overflowing it. */
.toolbar select, .toolbar input, .toolbar label, .toolbar > .row { max-width:100%; min-width:0; }
.toolbar label { display:inline-flex; align-items:center; gap:6px; }
h3.section { margin:22px 0 8px; font-size:14px; }
.pill.neutral { background:var(--aramah-accent-soft); color:var(--fg); }
.card.empty { text-align:center; padding:28px; }
.pgrid { display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:12px; }
.pgrid.wide { grid-template-columns:repeat(auto-fill, minmax(420px, 1fr)); }
.pgrid .card { margin:0; }
.pcard .phead { display:flex; align-items:center; gap:12px; }
.pcard .pname { display:flex; flex-direction:column; min-width:0; }
.pcard .pname span { font-size:12px; }
.pcard.add p { font-size:13px; margin:10px 0 12px; min-height:2.6em; }
.pavatar { flex:0 0 auto; width:36px; height:36px; border-radius:10px; color:#fff; font-weight:700;
           display:inline-flex; align-items:center; justify-content:center; font-size:13px; letter-spacing:.3px; }
/* Logos sit on white in both themes: several are dark marks on transparent. */
.pavatar.logo { background:#fff; border:1px solid var(--line); }
.pavatar.logo img { width:22px; height:22px; object-fit:contain; }
.mlogo { flex:0 0 auto; width:22px; height:22px; border-radius:6px; background:#fff; border:1px solid var(--line);
         display:inline-flex; align-items:center; justify-content:center; }
.mlogo img { width:16px; height:16px; object-fit:contain; }
.mlogo.mono { background:var(--input); color:var(--mut); font-size:11px; font-weight:700; }
.mrow { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:9px 0 0;
        margin-top:9px; border-top:1px solid var(--line); flex-wrap:wrap; }
.mrow .mname { display:flex; align-items:center; gap:8px; flex-wrap:wrap; min-width:0; }
.mrow .mactions { display:flex; align-items:center; gap:8px; font-size:12px; }
@media (max-width: 760px) { .pagehead { flex-direction:column; } .pgrid.wide { grid-template-columns:1fr; } }

/* ── Default model and group access (WBS 3.3.2) ── */
.defaultcard { border-color:color-mix(in srgb, var(--acc) 35%, var(--line)); background:color-mix(in srgb, var(--acc) 5%, var(--panel)); }
.pill.accentpill { background:var(--acc); color:var(--on-acc); }
.mrow .maccess { flex-basis:100%; display:flex; gap:6px; flex-wrap:wrap; font-size:12px; }
.gchip { border:1px solid var(--line); border-radius:999px; padding:1px 9px; background:var(--input); }

/* ── Model types: tabs, type pill and capability badges ── */
.typetabs { display:flex; gap:2px; flex-wrap:wrap; border-bottom:1px solid var(--line); margin:14px 0 4px; }
.typetab { background:none; border:none; border-bottom:2px solid transparent; border-radius:0; padding:8px 12px;
           font-size:13px; color:var(--mut); }
.typetab[aria-pressed="true"] { color:var(--fg); border-bottom-color:var(--acc); font-weight:600; }
.typetab .muted { margin-left:4px; font-weight:normal; }
.pill.typepill { background:var(--input); color:var(--fg); border:1px solid var(--line); }
.pill.typepill[data-type="text"] { background:var(--aramah-accent-soft); border-color:transparent; }
.capbadge { font-size:11px; color:var(--mut); border:1px solid var(--line); border-radius:6px; padding:0 6px; }
ul.checklist { list-style:none; margin:8px 0; padding:0; }
ul.checklist li label { display:flex; align-items:center; gap:10px; padding:8px 2px; border-bottom:1px solid var(--line); cursor:pointer; }
ul.checklist li label > span { display:flex; flex-direction:column; }
ul.checklist input { width:auto; }

/* ── Theme colours (WBS 3.7.1): palettes, pickers, live preview ── */
.chip.palette { display:inline-flex; align-items:center; gap:8px; }
.chip.palette .swatches { display:inline-flex; }
.chip.palette .swatches i { width:14px; height:14px; border-radius:50%; border:2px solid var(--panel); margin-left:-4px; }
.chip.palette .swatches i:first-child { margin-left:0; }
.themegrid { display:grid; grid-template-columns:minmax(260px, 340px) 1fr; gap:20px; margin-top:12px; }
/* Chat texts (WBS 3.7.2): fields beside a small home-screen preview. */
.field textarea { width:100%; resize:vertical; line-height:1.45; }
.chattexts { display:grid; grid-template-columns:minmax(0, 1fr) minmax(240px, 380px); gap:20px; align-items:start; }
.chatprev { border:1px solid var(--line); border-radius:12px; overflow:hidden; background:var(--bg); margin-top:10px; }
.chatprev-header { padding:8px 12px; border-bottom:1px solid var(--line); font-size:12px; color:var(--mut); text-align:center; }
.chatprev-body { padding:26px 16px 12px; display:flex; flex-direction:column; align-items:center; gap:12px; }
.chatprev-greeting { font-size:20px; font-weight:600; text-align:center; overflow-wrap:anywhere; }
.chatprev-input { width:100%; border:1px solid var(--line); border-radius:14px; padding:12px; color:var(--mut); font-size:13px; background:var(--panel); }
.chatprev-footer { font-size:11px; color:var(--mut); text-align:center; white-space:pre-line; overflow-wrap:anywhere; }
@media (max-width: 1100px) { .chattexts { grid-template-columns:1fr; } }
.themefield { margin-bottom:12px; }
input.swatchpick { width:44px; height:34px; padding:2px; }
.themeprevs { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.themeprev { background:var(--bg); color:var(--fg); border:1px solid var(--line); border-radius:10px; overflow:hidden; font-size:12px; }
.themeprev .tp-head { display:flex; justify-content:space-between; padding:8px 10px; background:var(--panel); position:relative; }
.themeprev .tp-head::after { content:""; position:absolute; left:0; right:0; bottom:0; height:2px; background:var(--brand); }
.themeprev .tp-body { display:flex; min-height:150px; }
.themeprev .tp-side { flex:0 0 92px; padding:8px 6px; border-right:1px solid var(--line); background:var(--aramah-surface-sunken); }
.themeprev .tp-side a { display:block; padding:4px 8px; border-radius:6px; color:var(--mut); }
.themeprev .tp-side a.active { color:var(--fg); background:var(--aramah-secondary-soft); box-shadow:inset 2px 0 0 0 var(--magenta); }
.themeprev .tp-main { flex:1; padding:8px 10px; min-width:0; }
.themeprev .tp-tabs { display:flex; gap:10px; border-bottom:1px solid var(--line); }
.themeprev .tp-tabs a { padding:2px 0 4px; color:var(--mut); border-bottom:2px solid transparent; }
.themeprev .tp-tabs a.active { color:var(--fg); border-bottom-color:var(--magenta); }
.themeprev .tp-link { color:var(--aramah-link); text-decoration:underline; }
.themeprev .tp-btn { padding:4px 10px; font-size:12px; }
.themeprev .tp-grad { background:var(--brand); color:var(--aramah-on-grad); padding:4px 10px; border-radius:var(--aramah-radius-md); }
.themeprev .tp-bars { display:flex; align-items:flex-end; gap:6px; height:44px; margin-top:10px; }
.themeprev .tp-bars span { flex:0 0 18px; border-radius:3px 3px 0 0; }
@media (max-width: 1100px) { .themegrid, .themeprevs { grid-template-columns:1fr; } }
@media (max-width: 760px) { .themeprev .tp-side { display:none; } .themeprev .tp-bars { flex-wrap:wrap; } }

/* ── User counters (WBS 3.4.1): a tinted card per kind ── */
.grid.counters { margin-top:4px; }
.kpi.counter { border-left:4px solid var(--tone); background:color-mix(in srgb, var(--tone) 6%, var(--panel)); }
.kpi.counter .val { color:var(--tone); }
.kpi.counter.tone-acc    { --tone:var(--acc); }
.kpi.counter.tone-purple { --tone:var(--aramah-purple); }
.kpi.counter.tone-warn   { --tone:var(--warn); }
.kpi.counter.tone-err    { --tone:var(--err); }
.kpi.counter.tone-ok     { --tone:var(--ok); }

/* ── People: name over e-mail (WBS 3.4.2) ── */
.person { display:flex; align-items:center; gap:10px; min-width:0; }
.person .muted { font-size:12px; }
.pavatar.small { width:30px; height:30px; border-radius:50%; font-size:12px; background:var(--acc); color:var(--on-acc); }
table.users td { vertical-align:middle; }
table.users .gchip { display:inline-block; margin:1px 0; }
.modal li .person { flex:1; }

/* ── Users search and filters (WBS 3.4.3) ── */
.kpi.counter.clickable { display:block; width:100%; text-align:left; font:inherit; cursor:pointer;
  color:var(--fg); background:color-mix(in srgb, var(--tone) 6%, var(--panel));
  border:1px solid var(--line); border-left:4px solid var(--tone); }
.kpi.counter.clickable:hover { background:color-mix(in srgb, var(--tone) 12%, var(--panel)); }
.kpi.counter.clickable:focus-visible { outline:2px solid var(--tone); outline-offset:2px; }
#iam_users .toolbar { margin:2px 0 4px; }
#iam_users select { min-width:150px; }

/* Phones (WBS 3.1 follow-up): the sidebar folds into the header's menu button
   and the content takes the full width; nothing scrolls the page sideways
   (wide tables scroll inside their card). Desktop is unchanged. */
.navbtn { display:none; }
@media (max-width: 760px) {
  header { gap:8px; padding:10px 12px; flex-wrap:wrap; }
  header .brand { gap:8px; min-width:0; }
  .brand img.wordmark, .brand .brandtext { display:none; }  /* the mark alone */
  .brand small, #who { display:none; }
  select.theme { padding:6px 4px; }
  .navbtn { display:inline-flex; align-items:center; gap:6px; max-width:34vw; overflow:hidden;
            white-space:nowrap; }
  #navLabel { min-width:0; overflow:hidden; text-overflow:ellipsis; }
  .shell { display:block; }
  .side { display:none; width:auto; min-height:0; border-right:0; border-bottom:1px solid var(--line);
          background:var(--panel); padding:8px 10px; }
  .shell.nav-open .side { display:block; }
  .side a { padding:10px 12px; }
  .content { padding:4px 12px 40px; }
  .card { padding:14px 12px; overflow-x:auto; }
  .field input, .field select, .row > select, .row > input { max-width:100%; }
  input.search { min-width:0; flex:1 1 100%; }
  .grid.k4, .grid.k5, .grid.k6 { grid-template-columns:repeat(2, minmax(0, 1fr)); }
}

/* Empty and error states (WBS 3.8.1): js/core.js empty(), failed(),
   formError(), toast(). One look on every page. */
.state { display:flex; gap:12px; align-items:flex-start; padding:18px 16px; border:1px dashed var(--line);
         border-radius:12px; color:var(--mut); margin:4px 0; }
.state b { display:block; color:var(--fg); font-weight:600; }
.state p { margin:4px 0 0; }
.state-icon { flex:0 0 28px; height:28px; border-radius:50%; display:grid; place-items:center; font-weight:700;
              background:var(--aramah-secondary-soft); color:var(--fg); }
.state[data-state="error"] { border-style:solid; border-color:color-mix(in srgb, var(--err) 45%, var(--line));
                             background:var(--aramah-err-soft); }
.state[data-state="error"] .state-icon { background:var(--err); color:#fff; }
.state[data-state="error"] p { color:var(--fg); overflow-wrap:anywhere; }
.state-act { margin-top:10px; display:flex; gap:8px; flex-wrap:wrap; }
.widget .state, td .state { padding:10px 12px; }
.widget .state-icon, td .state-icon { flex-basis:22px; height:22px; font-size:12px; }
.formmsg.err::before { content:"⚠ "; }
#toasts { position:fixed; right:16px; bottom:16px; z-index:50; display:flex; flex-direction:column; gap:8px;
          max-width:min(420px, calc(100vw - 32px)); }
.toast { display:flex; gap:10px; align-items:flex-start; padding:10px 12px; border-radius:10px; background:var(--panel);
         border:1px solid var(--line); box-shadow:0 6px 24px rgba(0,0,0,.18); }
.toast span { flex:1; overflow-wrap:anywhere; }
.toast.err { border-color:var(--err); }
.toast.err span::before { content:"⚠ "; color:var(--err); }
.toast.ok span::before { content:"✓ "; color:var(--ok); }
.toast button { padding:0 6px; border:0; line-height:1.4; }

/* Chat Settings (WBS 6.4.2–6.4.4): one row per field, and the egress warning
   beside web search and cloud models. */
.csfield { display:grid; grid-template-columns:minmax(180px, 260px) minmax(140px, 220px) 1fr; gap:6px 16px;
           align-items:center; padding:10px 0; border-top:1px solid var(--line); }
.csfield:first-of-type { border-top:0; }
.csfield .muted { font-size:12px; }
.csfield.set > label b::after { content:" •"; color:var(--acc); }
.egress { display:flex; gap:10px; align-items:flex-start; padding:10px 12px; margin:8px 0 4px; border-radius:10px;
          background:var(--aramah-warn-soft); border:1px solid color-mix(in srgb, var(--warn) 40%, var(--line)); }
.egress::before { content:"⚠"; color:var(--warn); font-weight:700; }
.egress p { margin:0; color:var(--fg); }
@media (max-width:760px){ .csfield { grid-template-columns:1fr; } }

/* Roles (WBS 5.1.1–5.1.2): the two role systems side by side, and the
   permission matrix in the Users-table style with a row per group. */
.rolesys { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.rolesys p { margin:8px 0 0; font-size:13px; }
table.rolemx th.rolecol, table.rolemx td.rolecol { text-align:center; width:120px; }
table.rolemx th.rolecol span { display:block; font-weight:400; font-size:11px; }
table.rolemx td.rolecol input { width:auto; }
table.rolemx tr.grouprow th { background:var(--aramah-surface-sunken); color:var(--mut); font-size:11px;
  text-transform:uppercase; letter-spacing:.6px; padding:6px 10px; }
@media (max-width:760px){ .rolesys { grid-template-columns:1fr; } table.rolemx th.rolecol, table.rolemx td.rolecol { width:auto; } }

/* Brain (WBS 5.2.1): KPI cards that pick the chart, clickable table rows,
   and a wider modal for a project's drill-down. */
button.kpi.clickable { display:block; width:100%; text-align:left; font:inherit; cursor:pointer; color:var(--fg);
  background:var(--panel); border:1px solid var(--line); }
button.kpi.clickable:hover:not(:disabled) { background:var(--aramah-secondary-soft); border-color:var(--line); }
button.kpi.clickable[aria-pressed="true"] { border-color:var(--acc); box-shadow:inset 0 -3px 0 0 var(--acc); }
button.kpi.clickable:focus-visible { outline:2px solid var(--acc); outline-offset:2px; }
table.clickrows tr[tabindex] { cursor:pointer; }
table.clickrows tr[tabindex]:hover td, table.clickrows tr[tabindex]:focus-visible td { background:var(--aramah-secondary-soft); }
.modal.wide { width:min(900px, 94vw); }
th.num, td.num { text-align:right; font-variant-numeric:tabular-nums; }

/* DPIA (WBS 5.8.1–5.8.2): the person picker, the footprint lists, and the
   destructive buttons of the two-step erase. */
.grid.k3 { grid-template-columns:repeat(3, 1fr); }
ul.picklist { list-style:none; margin:10px 0 0; padding:0; border:1px solid var(--line); border-radius:10px; overflow:hidden; }
ul.picklist li + li { border-top:1px solid var(--line); }
ul.picklist button { display:flex; flex-direction:column; align-items:flex-start; gap:2px; width:100%; text-align:left;
  border:0; border-radius:0; padding:8px 12px; }
ul.picklist button:hover { background:var(--aramah-secondary-soft); }
ul.picklist .muted { font-size:12px; }
details.fplist { margin-top:10px; border-top:1px solid var(--line); padding-top:8px; }
details.fplist summary { cursor:pointer; font-weight:600; }
details.fplist ul { max-height:220px; overflow:auto; margin:8px 0 0; padding-left:18px; font-size:12px; }
label.checkline { display:flex; gap:8px; align-items:center; }
label.checkline input { width:auto; }
button.danger { background:transparent; color:var(--err); border-color:var(--err); }
button.danger:hover:not(:disabled) { background:var(--aramah-err-soft); border-color:var(--err); }
button.danger.solid { background:var(--err); color:var(--panel); }
button.danger.solid:hover:not(:disabled) { background:var(--err); opacity:.9; }
button:disabled { opacity:.5; cursor:not-allowed; }
code.copyable { user-select:all; font-size:13px; }
@media (max-width:760px){ .grid.k3 { grid-template-columns:1fr; } }

/* Notices (WBS 5.4.1): the chat's notice bar in a small chat window, the
   same colours by level as aramah/platform/PlatformChrome.tsx. */
.noticeprev { border:1px solid var(--line); border-radius:10px; overflow:hidden; background:var(--bg); }
.noticebar { display:flex; align-items:center; gap:10px; padding:8px 12px; font-size:13px; }
.noticebar > span:first-child { flex:1; white-space:pre-wrap; overflow-wrap:anywhere; }
.noticebar .nb-btn { border:1px solid color-mix(in srgb, currentColor 40%, transparent); border-radius:4px; padding:1px 8px; font-size:12px; }
.noticebar.lvl-info     { background:var(--aramah-blue); color:var(--aramah-on-blue); }
.noticebar.lvl-warn     { background:var(--warn); color:var(--aramah-on-grad); }
.noticebar.lvl-critical { background:var(--err); color:var(--aramah-on-grad); }
.noticeprev .np-body { padding:18px 16px 12px; display:flex; flex-direction:column; align-items:center; gap:10px; }
.noticeprev .np-greet { width:40%; height:12px; border-radius:6px; background:var(--line); }
.noticeprev .np-input { width:100%; border:1px solid var(--line); border-radius:12px; padding:8px 12px; color:var(--mut); font-size:12px; background:var(--panel); }

/* Projects (WBS 5.5.1): the list beside the selected project. */
.pjgrid { display:grid; grid-template-columns:minmax(0, 1.25fr) minmax(0, 1fr); gap:14px; align-items:start; }
.pjgrid > .card { margin:14px 0 0; }
.pjdetail { position:sticky; top:72px; max-height:calc(100vh - 90px); overflow:auto; }
.grid.k2 { grid-template-columns:repeat(2, minmax(0, 1fr)); }
table.clickrows tr.selected td { background:var(--aramah-secondary-soft); }
table.clickrows tr.selected td:first-child { box-shadow:inset 2px 0 0 0 var(--magenta); }
pre.pjmemory { white-space:pre-wrap; background:var(--input); border:1px solid var(--line); border-radius:8px;
  padding:12px; font-size:12px; max-height:280px; overflow:auto; margin:0; }
ul.pjchats { margin:0; padding-left:18px; font-size:12px; }
.barrow.pjhit { padding:6px 0; border-bottom:1px solid var(--line); align-items:flex-start; }
.barrow.pjhit .lbl { flex:0 0 40px; }
@media (max-width:1100px){ .pjgrid { grid-template-columns:1fr; } .pjdetail { position:static; max-height:none; } }

/* Analytics charts (WBS 5.9.1), in the Usage chart style of 3.2.1: a legend
   line under the title, series colours from the theme, a shaded heatmap. */
.chartlegend { font-size:12px; margin:-4px 0 10px; display:flex; flex-wrap:wrap; gap:6px 14px; align-items:center; }
.chartlegend b { color:var(--fg); }
.grid.halves { grid-template-columns:repeat(2, minmax(0, 1fr)); }
.barrow.share .lbl { display:flex; align-items:center; gap:8px; }
.barrow.share .sw { flex:0 0 10px; height:10px; border-radius:3px; background:var(--bar); }
.barrow.share .track > span { background:var(--bar); }
.barrow.share .val { min-width:110px; }
.heatmap .cell.b0, .heatkey .cell.b0 { background:var(--aramah-surface-sunken); }
.heatmap .cell.b1, .heatkey .cell.b1 { background:color-mix(in srgb, var(--acc) 15%, var(--panel)); }
.heatmap .cell.b2, .heatkey .cell.b2 { background:color-mix(in srgb, var(--acc) 32%, var(--panel)); }
.heatmap .cell.b3, .heatkey .cell.b3 { background:color-mix(in srgb, var(--acc) 52%, var(--panel)); }
.heatmap .cell.b4, .heatkey .cell.b4 { background:color-mix(in srgb, var(--acc) 74%, var(--panel)); }
.heatmap .cell.b5, .heatkey .cell.b5 { background:var(--acc); }
.heatkey { margin-left:auto; display:inline-flex; align-items:center; gap:3px; }
.heatkey .cell { display:inline-block; width:12px; height:12px; border-radius:2px; }
@media (max-width:760px){ .grid.halves { grid-template-columns:1fr; } .heatmap { overflow-x:auto; min-width:520px; } }

/* Connectors (WBS 4.13): status cards, the catalog and the SharePoint picker. */
.conncard .connstats { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:10px; margin:14px 0 4px; }
.conncard .connstats > div { display:flex; flex-direction:column; gap:2px; font-size:12px; }
.conncard .connstats b { font-size:16px; font-weight:600; color:var(--fg); }
.conncard .connscope { display:flex; flex-wrap:wrap; gap:4px; justify-content:flex-end; font-size:12px; }
.conncard details { margin-top:10px; font-size:12px; }
.conncard details summary { cursor:pointer; }
.conncard .connerr p { margin:6px 0 0; word-break:break-word; }
.conncard .connruns table { margin-top:6px; font-size:12px; }
.conncard .connact { margin-top:14px; gap:8px; flex-wrap:wrap; }
.sptools { gap:8px; margin:8px 0 0; flex-wrap:nowrap; }
.sptools input.search { flex:1 1 auto; }
.spnote { margin:10px 0 0; padding:8px 12px; border-radius:8px; font-size:12px;
  background:var(--aramah-warn-soft); color:var(--fg); }
.sptree { margin-top:12px; border-top:1px solid var(--line); }
.sprow { display:flex; align-items:center; gap:8px; min-height:36px; padding:2px 0 2px calc(var(--d, 0) * 22px);
  border-bottom:1px solid var(--line); font-size:13px; }
.sprow .sptoggle { flex:0 0 28px; height:28px; padding:0; }
.sprow .spname { display:flex; align-items:center; gap:8px; flex:1 1 auto; min-width:0; cursor:pointer; }
.sprow .spname span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sprow .spkind { flex:0 0 auto; font-size:12px; }
.spchips { display:flex; flex-wrap:wrap; gap:6px; }
.spchips .gchip { display:inline-flex; align-items:center; gap:4px; padding-right:4px; }
.spchips .spx { padding:0 6px; line-height:18px; min-height:0; }
@media (max-width:760px){
  .conncard .connstats { grid-template-columns:1fr 1fr; }
  .sptools { flex-wrap:wrap; } .sptools input.search { min-width:0; flex-basis:100%; }
  .sprow { padding-left:calc(var(--d, 0) * 12px); } .sprow .spkind { display:none; }
}

/* Document Sets and Document Explorer (WBS 6.5.4 / 6.5.5) */
/* A rule: source and kind side by side, its path on a line of its own. */
.dsrule { display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1fr) auto; gap:8px; align-items:center;
  padding:8px 0; border-bottom:1px solid var(--line); }
.dsrule select, .dsrule input { min-width:0; width:100%; }
.dsrule input { grid-column:1 / -1; }
.dsrule-text { font-size:13px; }
.dssample { margin:6px 0 0; padding-left:18px; font-size:13px; }
.wrapcell { overflow-wrap:anywhere; word-break:break-word; }
td.dsactions { white-space:nowrap; text-align:right; }

/* Uploaded files (WBS 6.7.1): the group picker, a scrolling list of checkboxes. */
.fi-groups { max-height:220px; overflow:auto; border:1px solid var(--line); border-radius:8px; padding:6px 10px; margin-top:6px; }
.fi-group { display:flex; gap:8px; align-items:center; padding:3px 0; font-size:13px; overflow-wrap:anywhere; }
.fi-group input { width:auto; }
.fi-docid { font-size:11px; }
td.fi-actions { white-space:nowrap; text-align:right; }
.fi-name { min-width:8em; }
@media (max-width: 700px) {
  .fi-wide, .fi-docid { display:none; }
  .fi-name { min-width:6em; } #fi_list .pill { white-space:normal; }
  td.fi-actions { white-space:normal; } td.fi-actions button { display:block; width:100%; margin:0 0 4px; }
}

/* Q-Factory templates (WBS 6.10.1) */
.fxfile { border:1px solid var(--line); border-radius:8px; padding:8px; margin-bottom:8px; }
.fxfile textarea { margin-top:6px; }

/* Web sites (WBS 6.8.1); the group picker is the Uploaded files one (.fi-groups). */
.wb-name { min-width:10em; }
.wb-name a { overflow-wrap:anywhere; font-size:12px; }
td.wb-actions { white-space:nowrap; text-align:right; }
.wb-limits { gap:12px; flex-wrap:wrap; }
.wb-limits .field { flex:1 1 9em; }
.wb-credit { font-size:12px; margin-top:12px; }
.wb-narrow { display:none; }
@media (max-width: 700px) {
  .wb-wide { display:none; } .wb-name { min-width:8em; }
  .wb-narrow.wb-acts { display:flex; flex-wrap:wrap; gap:4px; margin-top:6px; }
}

/* Confluence and Jira set-up (WBS 6.8.2). */
.at-list { margin-top:10px; max-height:320px; overflow:auto; border-top:1px solid var(--line); }
.at-item { display:flex; gap:8px; align-items:baseline; padding:6px 0; border-bottom:1px solid var(--line); overflow-wrap:anywhere; }
.at-item input { flex:0 0 auto; }
button.at-x { padding:0 4px; min-height:0; line-height:1; }

/* Service accounts (WBS 6.11.4) */
td.sa-actions { white-space:nowrap; text-align:right; }
.sa-key { margin-bottom:6px; }
.sa-key code { font-size:12px; }
.sa-groups { display:grid; grid-template-columns:1fr 1fr; gap:12px; max-height:260px; overflow:auto; }
.sa-pick { display:block; font-size:13px; padding:2px 0; }
.sa-narrow { display:none; }
@media (max-width: 700px) {
  .sa-wide { display:none; }
  .sa-narrow.sa-acts { display:flex; flex-wrap:wrap; gap:4px; margin-top:6px; }
  .sa-groups { grid-template-columns:1fr; }
}

/* Workflows (mockups A1–A3, js/pages/workflows.js) */
.wf-head { justify-content:flex-end; align-items:center; gap:10px; margin-bottom:12px; }
.wf-head > .muted:first-child { margin-right:auto; }
.wf-cards { display:grid; grid-template-columns:repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap:14px; }
.wf-card { display:flex; flex-direction:column; gap:10px; margin:0; }
.wf-card h2 { margin:0; font-size:15px; }
.wf-t { display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:13px; padding:7px 0; border-bottom:1px solid var(--line); }
.wf-t input[type=checkbox] { width:18px; height:18px; flex:0 0 auto; }
.wf-f { display:flex; flex-direction:column; gap:4px; flex:1 1 150px; min-width:0; font-size:13px; }
.wf-f > label, .wf-f > .lbl { font-weight:500; }
.wf-f textarea, .wf-f input[type=number], .wf-f select { width:100%; box-sizing:border-box; }
.wf-r { display:flex; flex-wrap:wrap; gap:12px; }
.wf-note { margin:0; font-size:12px; }
.wf-pick { border:1px solid var(--line); border-radius:8px; padding:6px 10px; background:var(--input); }
.wf-pick summary { cursor:pointer; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wf-pick[open] { max-height:240px; overflow:auto; }
.wf-scroll { overflow-x:auto; }
.wf-sel { background:color-mix(in srgb, var(--acc) 8%, transparent); }
.wf-detail { display:flex; flex-wrap:wrap; gap:20px; }
.wf-detail > div { flex:1 1 300px; min-width:0; }
.wf-detail h2 { margin:0 0 10px; font-size:15px; }
.wf-dl { display:grid; grid-template-columns:130px minmax(0,1fr); gap:7px 10px; font-size:13px; margin:0; }
.wf-dl dt { color:var(--mut); } .wf-dl dd { margin:0; overflow-wrap:anywhere; }
.wf-actions { flex-wrap:wrap; gap:8px; margin-top:12px; }
.wf-json { max-height:320px; overflow:auto; font-size:12px; background:var(--input); padding:10px; border-radius:8px; }
.wf-bars { display:flex; gap:4px; align-items:flex-end; height:130px; }
.wf-bar { flex:1; min-width:2px; background:var(--acc); border-radius:2px 2px 0 0; }
.wf-axis { justify-content:space-between; font-size:11px; margin-top:4px; }
.grid.wf-two { grid-template-columns:repeat(auto-fit, minmax(min(380px, 100%), 1fr)); }
/* Help: the header button and the admin guide page (js/pages/help.js). The
   header is sticky, so the button stays in view on every page; on phones it
   shrinks to "?". */
.helpbtn { display:inline-flex; align-items:center; gap:6px; padding:6px 10px; }
.helpbtn > span[aria-hidden] { display:inline-grid; place-items:center; width:18px; height:18px; border-radius:50%;
           border:1.5px solid currentColor; font-size:12px; font-weight:700; line-height:1; }
.helpgrid { display:grid; grid-template-columns:240px minmax(0, 1fr); gap:16px; align-items:start; }
.helptoc { position:sticky; top:72px; max-height:calc(100vh - 90px); overflow:auto; }
.helptoc input { width:100%; margin-bottom:10px; }
.helptoc .navhead { padding:8px 8px 4px; }
.helptoc a { display:block; padding:5px 8px; border-radius:6px; color:var(--mut); text-decoration:none; font-size:13px; }
.helptoc a:hover { color:var(--fg); }
.helptoc a[aria-current] { color:var(--fg); background:var(--aramah-secondary-soft); box-shadow:inset 2px 0 0 0 var(--magenta); }
.helpsec { margin-top:0; }
.helpsec h2 { font-size:17px; }
.helpsec h3 { font-size:13px; margin:14px 0 4px; }
.helpsec p, .helpsec li, .helpsec dd { font-size:13px; line-height:1.55; }
.helpsec ol, .helpsec ul { margin:0; padding-left:20px; }
.helpsec dl { margin:0; } .helpsec dt { display:inline; font-weight:600; } .helpsec dd { display:inline; margin:0; color:var(--mut); }
.helpsec dl div { margin:3px 0; }
.helpprob { background:var(--input); border-radius:8px; padding:7px 10px; margin:6px 0; font-size:13px; }
.helpprob b { display:block; }
.helpsec .open { margin-top:12px; }
@media (max-width: 760px) {
  .helpbtn { padding:6px 8px; } .helpbtn .helplabel { display:none; }
  .helpgrid { grid-template-columns:1fr; } .helptoc { position:static; max-height:none; }
}
/* Help panel (js/help_drawer.js): the guide beside the page, not over it. It
   sits above dialogs (z 20) and below toasts (z 50). Wide screens make room
   for it, so nothing on the page is covered; narrower ones lay it over the
   right edge; phones get a sheet from the bottom. */
.helppanel { position:fixed; top:0; right:0; bottom:0; width:min(380px, 92vw); z-index:30; display:flex; flex-direction:column;
             gap:8px; padding:12px; background:var(--panel); border-left:1px solid var(--line);
             box-shadow:-8px 0 24px color-mix(in srgb, var(--fg) 12%, transparent); }
.helppanel[hidden] { display:none; }
.helppanel .hp-head { display:flex; align-items:center; gap:6px; }
.helppanel .hp-title { flex:1; min-width:0; font-size:14px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.helppanel .hp-icon { display:inline-grid; place-items:center; width:30px; height:30px; padding:0; border-radius:8px;
                      color:var(--mut); text-decoration:none; font-size:18px; line-height:1; }
.helppanel .hp-icon:hover { color:var(--fg); background:var(--input); }
.helppanel input { width:100%; }
.helppanel .hp-body { flex:1; min-height:0; overflow:auto; padding-right:2px; }
.helppanel .helpsec h2 { font-size:16px; margin:2px 0 6px; }
.helppanel .helpsec h2:focus { outline:none; }
.hp-hits { list-style:none; margin:0; padding:0; }
.hp-hits li { padding:7px 4px; border-bottom:1px solid var(--line); font-size:13px; }
.hp-hits small { display:block; color:var(--mut); }
.helpbtn[aria-expanded="true"] { background:var(--aramah-secondary-soft); }
@media (min-width: 1100px) { body.help-open header, body.help-open .shell { margin-right:380px; } }
@media (max-width: 760px) {
  .helppanel { top:auto; left:0; width:auto; height:62vh; border-left:0; border-top:1px solid var(--line);
               border-radius:14px 14px 0 0; box-shadow:0 -8px 24px color-mix(in srgb, var(--fg) 14%, transparent); }
}
/* A dialog's scrim (z 20) would take a click on the header's Help button and
   close the dialog, losing what was typed. Keep the header above it. */
body:has(#modalBack) header { z-index:25; }
/* Small phones: the menu button keeps only its icon so the header, with Help,
   stays on one line. */
@media (max-width: 420px) { #navLabel { display:none; } }

/* ── Local (invited, non-SSO) chat users: mockup screens A–C, G2, H ── */
.pill.src-sso { background:var(--aramah-accent-soft); color:var(--blue); }
.pill.src-local { background:color-mix(in srgb, var(--purple) 12%, transparent); color:var(--purple); }
/* "External account" ring: a purple arc over the avatar's lower left, like a
   profile frame; the same colour as the Local chip. */
.pavatar.ext { position:relative; }
.pavatar.ext::after { content:""; position:absolute; inset:-3px; border-radius:50%; pointer-events:none;
  border:3px solid transparent; border-left-color:var(--purple); border-bottom-color:var(--purple); transform:rotate(-15deg); }
div.checklist { display:flex; flex-direction:column; gap:2px; max-height:220px; overflow:auto; border:1px solid var(--line);
  border-radius:8px; padding:6px 10px; }
div.checklist label, label.radio { display:flex; align-items:center; gap:8px; font-weight:400; cursor:pointer; margin:4px 0; }
div.checklist input, label.radio input { width:auto; }
.copybox { display:flex; gap:6px; align-items:center; margin-top:6px; }
.copybox code { flex:1; min-width:0; background:var(--input); border:1px solid var(--line); border-radius:6px; padding:6px 8px;
  font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
a.btn { display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border:1px solid var(--line); border-radius:8px;
  color:var(--fg); text-decoration:none; font-size:13px; }
a.btn:hover { background:var(--input); }
.modal .note { border-left:3px solid var(--blue); background:var(--aramah-accent-soft); padding:8px 12px; border-radius:0 6px 6px 0; font-size:13px; }
.modal .note.warn { border-left-color:var(--warn); background:var(--aramah-warn-soft); }
