/* PasarGuard tabs: the admins (with their API keys) and the settings of a PasarGuard panel. Every class starts with .pg-admin- */

/* ---- the bar: sub-view buttons, search, counts */
html body #page .pg-admin-seg { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; padding: 0; }
html body #page .pg-admin-seg button { height: 32px; padding: 0 13px; border-radius: 10px; font-size: 12.5px; font-weight: 600; color: var(--mut); background: var(--panel); border: 1px solid var(--line); box-shadow: none; }
html body #page .pg-admin-seg button:hover { color: var(--text); }
html body #page .pg-admin-seg button.on { color: var(--text); background: rgba(122, 167, 240, .17); border-color: rgba(122, 167, 240, .5); }
html body #page .pg-admin-seg button.dirty::after { content: "•"; margin-left: 6px; color: var(--warn); font-weight: 900; }
html body #page .pg-admin-q { width: 200px; flex: none; }
html body #page .pg-bar .pg-admin-cnt { display: inline-flex; align-items: center; flex-wrap: wrap; }
html body #page .pg-bar .pg-admin-cnt .pill { margin: 0 5px 0 0; }
html body #page .pg-admin-kdel[hidden], html body #page .pg-admin-bulk[hidden] { display: none; }
html body #page select.pg-admin-bulk { width: auto; max-width: 190px; }

/* ---- the lists */
html body #page .pg-admin-box { margin-bottom: 6px; }
html body #page .pg-admin-tbl td { vertical-align: middle; }
html body #page .pg-admin-tbl thead th small { font-weight: 400; text-transform: none; letter-spacing: 0; }
html body #page .pg-admin-th { cursor: pointer; user-select: none; white-space: nowrap; }
html body #page .pg-admin-th:hover, html body #page .pg-admin-th.on { color: var(--text); }
html body #page .pg-admin-nm { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 0; min-width: 0; }
html body #page .pg-admin-nm .pill { margin-left: 6px; }
html body #page .pg-admin-link { cursor: pointer; }
html body #page .pg-admin-link:hover { text-decoration: underline; }
html body #page .pg-admin-own { color: var(--warn); border-color: rgba(255, 200, 70, .4); background: rgba(255, 200, 70, .08); }
html body #page .pg-admin-stat { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
html body #page .pg-admin-num { text-align: center; font-variant-numeric: tabular-nums; }
html body #page .pg-admin-acts { text-align: right; white-space: nowrap; }
html body #page .pg-admin-acts > * { margin-left: 4px; }
html body #page .pg-admin-acts select.pg-admin-menu { width: 74px; height: 28px !important; padding: 0 8px !important; font-size: 12px; }
html body #page .pg-admin-acts button.sm { height: 28px; padding: 0 11px; }
html body #page .pg-admin-note2 { display: block; margin: 0 2px 6px; font-size: 12px; line-height: 1.45; }
html body #page .pg-admin-note2 code, html body #modal .pg-admin-once code, html body #page .pg-admin-tbl code { font-size: 11.5px; }

/* ---- windows: add / edit an admin, a key */
html body #modal .pg-admin-form2 [hidden] { display: none !important; }
html body #modal .pg-admin-form2 .pg-admin-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; }
html body #modal .pg-admin-form2 .pg-admin-cols > div { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
html body #modal .pg-admin-form2 .sbox { margin: 0; }
html body #modal .pg-admin-form2 .kf { min-height: 34px; padding: 3px 0; }
html body #modal .pg-admin-form2 .kf > span:first-child { width: 112px; }
html body #modal .pg-admin-form2 .kf > input, html body #modal .pg-admin-form2 .kf > select, html body #modal .pg-admin-form2 .kf > .pg-admin-secrow, html body #modal .pg-admin-form2 .kf > .pg-admin-exprow { flex: 1; min-width: 0; }
html body #modal .pg-admin-form2 .kf input, html body #modal .pg-admin-form2 .kf select { height: 28px; }
html body #modal .pg-admin-form2 .kf > em { flex: none; font-style: normal; font-size: 11px; color: var(--mut); }
html body #modal .pg-admin-form2 .kf > b.mono { text-align: left; }
html body #modal .pg-admin-secrow, html body #page .pg-admin-secrow { display: flex; align-items: center; gap: 6px; min-width: 0; }
html body #modal .pg-admin-secrow .pill, html body #page .pg-admin-secrow .pill { margin: 0; flex: none; }
html body #modal .pg-admin-secrow input, html body #page .pg-admin-secrow input { flex: 1; min-width: 0; }
html body #modal .pg-admin-exprow { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
html body #modal .pg-admin-exprow input { flex: 1 1 120px; min-width: 0; }
html body #modal .pg-admin-chips { display: inline-flex; gap: 3px; }
html body #modal .pg-admin-chips button { height: 28px; padding: 0 8px; }
html body #modal .pg-admin-swgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 14px; padding-top: 4px; }
html body #modal .pg-admin-sw, html body #page .pg-admin-sw { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; font-size: 12px; color: var(--mut); }
html body #modal .pg-admin-sw > span:first-child, html body #page .pg-admin-sw > span:first-child { min-width: 0; }
html body #modal .pg-admin-adv { margin: 10px 0 0; }
html body #modal .pg-admin-adv summary { cursor: pointer; user-select: none; font-size: 12px; }
html body #modal .pg-admin-ovgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; padding-top: 6px; }
html body #modal .pg-admin-lockmsg { font-size: 12px; }
html body #modal .pg-admin-sudo { display: inline-flex; align-items: center; gap: 8px; }
html body #modal .pg-admin-note { margin: 0 0 10px; font-size: 12.5px; line-height: 1.5; }
html body #modal .pg-admin-form2 .frm-act { margin-top: 12px; }

/* the password helper */
html body #modal .pg-admin-pwbox { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
html body #modal .pg-admin-pwlab { font-size: 11.5px; margin-bottom: 5px; }
html body #modal .pg-admin-pwrow { display: flex; gap: 6px; align-items: center; }
html body #modal .pg-admin-pwrow input { flex: 1; min-width: 0; height: 30px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
html body #modal .pg-admin-pwrow button { height: 30px; }
html body #modal .pg-admin-rules { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 7px; }
html body #modal .pg-admin-rules span { font-size: 10.5px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--mut); background: rgba(255, 255, 255, .03); }
html body #modal .pg-admin-rules span.ok { color: var(--ok); border-color: rgba(61, 220, 151, .45); background: rgba(61, 220, 151, .08); }
html body #modal .pg-admin-rules span.bad { color: var(--bad); border-color: rgba(255, 107, 139, .45); background: rgba(255, 107, 139, .07); }
html body #modal .pg-admin-pw small { display: block; margin-top: 6px; }

/* the secret that is shown once */
html body #modal .pg-admin-once p { margin: 0 0 10px; font-size: 13px; line-height: 1.5; }
html body #modal .pg-admin-onebox { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid rgba(255, 200, 70, .45); background: rgba(255, 200, 70, .07); border-radius: 12px; margin-bottom: 10px; }
html body #modal .pg-admin-onebox > span { flex: none; font-size: 12px; }
html body #modal .pg-admin-onebox input { flex: 1; min-width: 0; height: 32px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
html body #modal .pg-admin-warn { color: var(--warn); }

/* usage window */
html body #modal .pg-admin-urange { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-bottom: 8px; }
html body #modal .pg-admin-urange .kf { width: 190px; padding: 0; min-height: 0; }
html body #modal .pg-admin-urange .kf > span:first-child { width: 40px; }
html body #modal .pg-admin-urange input { height: 30px; }
html body #modal .pg-admin-presets { display: inline-flex; gap: 4px; margin-left: auto; }
html body #modal .pg-admin-usum { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; font-size: 12px; }
html body #modal .pg-admin-usum .pill { margin: 0; }
html body #modal .pg-admin-ubox { max-height: 320px; margin-bottom: 6px; }
html body #modal .pg-admin-num { text-align: right; font-variant-numeric: tabular-nums; }
html body #modal .pg-admin-usage small { display: block; }

/* the rights of a key */
html body #modal .pg-admin-permbar { display: flex; align-items: center; gap: 6px; margin: 6px 0 4px; }
html body #modal .pg-admin-permwrap { margin-top: 10px; max-height: 300px; overflow: auto; padding-right: 4px; scrollbar-width: thin; }
html body #modal .pg-admin-perm { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
html body #modal .pg-admin-res { margin: 0; padding: 2px 8px 6px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
html body #modal .pg-admin-res legend { padding: 0 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--mut); }
html body #modal .pg-admin-res label { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 26px; font-size: 11.5px; color: var(--mut); }
html body #modal .pg-admin-res label span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html body #modal .pg-admin-res select { width: 58px; height: 24px; padding: 0 4px; font-size: 11.5px; flex: none; }
html body #modal .pg-admin-res select.on { color: var(--ok); border-color: rgba(61, 220, 151, .45); }
html body #modal .pg-admin-hist { max-height: 300px; }

/* ---- Settings */
html body #page .pg-admin-sechead { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin: 0 2px 8px; font-size: 12.5px; }
html body #page .pg-admin-sechead .pill { margin: 0; }
html body #page .pg-admin-formbox { margin-bottom: 8px; max-height: calc(100vh - 340px); min-height: 180px; }
html body #page .pg-admin-fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px 18px; align-items: start; min-width: 0; }
html body #page .pg-admin-fgrid.pg-admin-top { padding: 12px 14px; }
html body #page .pg-admin-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 11.5px; color: var(--mut); }
html body #page .pg-admin-fl { display: flex; align-items: center; gap: 6px; line-height: 1.3; }
html body #page .pg-admin-fl .pill { margin: 0; }
html body #page .pg-admin-f > small { line-height: 1.3; font-size: 10.5px; }
html body #page .pg-admin-f input, html body #page .pg-admin-f select { width: 100%; height: 30px; box-sizing: border-box; }
html body #page .pg-admin-f .pg-admin-secrow input { width: auto; }
html body #page .pg-admin-f .pg-admin-secrow button { height: 30px; }
html body #page .pg-admin-wide { grid-column: 1 / -1; }
html body #page .pg-admin-grp { margin: 0; padding: 4px 10px 8px; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
html body #page .pg-admin-grp > legend { padding: 0 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; color: var(--mut); }
html body #page .pg-admin-grp .pg-admin-fgrid { grid-template-columns: 1fr; gap: 0; }
html body #page .pg-admin-grp.pg-admin-wide .pg-admin-fgrid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0 18px; }
html body #page .pg-admin-sw { min-height: 30px; }
html body #page .pg-admin-json { width: 100%; box-sizing: border-box; padding: 8px 10px; font-size: 12px; line-height: 1.45; resize: vertical; }
html body #page .pg-admin-json.bad { border-color: var(--bad); }
html body #page .pg-admin-gt { margin: 0; table-layout: auto; border-spacing: 0 4px; }
html body #page .pg-admin-gt th { text-align: left; font-size: 10.5px; padding: 2px 6px; }
html body #page .pg-admin-gt td { padding: 1px 6px; vertical-align: middle; }
html body #page .pg-admin-gt td.name { white-space: nowrap; font-size: 12px; width: 1%; }
html body #page .pg-admin-gt input, html body #page .pg-admin-gt select, html body #page .pg-admin-gt textarea { width: 100%; box-sizing: border-box; }
html body #page .pg-admin-gt input, html body #page .pg-admin-gt select { height: 28px; }
html body #page .pg-admin-gt textarea { min-height: 28px; }
html body #page .pg-admin-gt .pg-admin-secrow input { width: auto; }
html body #page .pg-admin-rx { width: 40px; text-align: right; }
html body #page .pg-admin-rowadd { display: flex; align-items: center; gap: 10px; padding-top: 4px; }
html body #page .pg-admin-foot { margin: 0 2px; padding-top: 2px; }
html body #page .pg-admin-foot button { height: 32px; }
html body #page .pg-admin-dirty { font-size: 12px; color: var(--warn); }

/* the app gives every input and select a minimum height of 38 px; the compact rows of these tabs set their own height, so the minimum has to go */
html body #page .pg-admin-acts select, html body #page .pg-admin-f input, html body #page .pg-admin-f select, html body #page .pg-admin-gt input, html body #page .pg-admin-gt select, html body #page .pg-admin-gt textarea,
html body #modal .pg-admin-form2 input:not([type="checkbox"]), html body #modal .pg-admin-form2 select, html body #modal .pg-admin-res select, html body #modal .pg-admin-pwrow input, html body #modal .pg-admin-onebox input,
html body #modal .pg-admin-urange input { min-height: 0; }html body #page .pg-admin-exp { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; line-height: 1.15; }
html body #page .pg-admin-exp small { font-size: 10.5px; }
html body #page .pg-admin-acts select.pg-admin-menu { width: 82px; }
/* ---- the roles view of the Admins tab (pg_roles.js) */
html body #modal .pg-roles-form .pg-roles-lim { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px; }
html body #modal .pg-roles-form .pg-roles-lim .kf > span:first-child { width: auto; flex: 1 1 auto; }
html body #modal .pg-roles-form .pg-roles-lim input { width: 96px; flex: none; }
html body #modal .pg-roles-form .pg-roles-h { margin: 8px 0 2px; font-size: 11px; letter-spacing: .6px; text-transform: uppercase; color: var(--mut); }
html body #modal .pg-roles-form .pg-roles-list { display: flex; flex-wrap: wrap; gap: 4px 16px; max-height: 108px; overflow: auto; padding: 4px 2px; }
html body #modal .pg-roles-form .pg-roles-pick label.chk { height: 26px; font-size: 12.5px; }
/* ---- the client templates view of the Templates tab (pg_client.js) */
html body #modal .pg-ctpl-form .pg-ctpl-ta { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; font-size: 11.5px; color: var(--mut); }
html body #modal .pg-ctpl-form .pg-ctpl-ta textarea { width: 100%; box-sizing: border-box; min-height: 320px; padding: 10px 12px; border-radius: 12px; font: 12px/1.5 var(--mono, ui-monospace, Menlo, Consolas, monospace); tab-size: 2; white-space: pre; resize: vertical; }
/* ---- the Users window and tools of a PasarGuard panel (pg_users.js) */
html body #page select.pgu-tools { height: 32px; width: 104px; border-radius: 10px; }
html body #modal .modal.pgu { max-width: 860px; }
html body #modal .modal.pgu-tool { max-width: 580px; }
html body #modal .pgu [hidden], html body #modal .pgu-tool [hidden] { display: none !important; }
html body #modal .pgu-tool .pgu-groups { display: flex; flex-wrap: wrap; gap: 2px 14px; max-height: 112px; overflow: auto; padding: 4px 0; min-width: 0; }
html body #modal .pgu-tool label.chk { height: 26px; font-size: 12.5px; }
/* the window of ONE user, tight (1.47.0): boxes of 8 px padding, fields of 30 px in two columns, the usage beside the account, the next plan beside the groups, a short activity list */
html body #modal .pgu .modal-body { padding: 8px 12px 10px; container: pgu / inline-size; }
html body #modal .pgu .pu-form { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; }
html body #modal .pgu .pu-top, html body #modal .pgu .pu-mid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 8px; align-items: stretch; }
html body #modal .pgu .pu-box { margin: 0; padding: 7px 12px 9px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); box-shadow: none; min-width: 0; }
html body #modal .pgu .pu-box > h5 { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 5px; padding: 0; border: 0; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mut); }
html body #modal .pgu .pu-box > h5 .sp { flex: 1; }
html body #modal .pgu .pu-box > h5 small { font-size: 11px; letter-spacing: 0; text-transform: none; }
html body #modal .pgu .pu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 14px; }
html body #modal .pgu .pu-f { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 30px; margin: 0; padding: 0; }
html body #modal .pgu .pu-f.wide { grid-column: 1 / -1; }
html body #modal .pgu .pu-f > span:first-child { flex: 0 0 72px; font-size: 12px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html body #modal .pgu .pu-f input:not([type="checkbox"]), html body #modal .pgu .pu-f select { flex: 1 1 0; min-width: 0; width: auto; height: 30px; min-height: 0; padding: 0 9px; border-radius: 9px; font-size: 13px; }
html body #modal .pgu .pu-f em { flex: none; font-style: normal; font-size: 11.5px; color: var(--mut); }
html body #modal .pgu .pu-f .srv-sw { margin: 0; }
html body #modal .pgu .pu-link { display: block; flex: 1 1 0; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; cursor: pointer; color: var(--text); }
html body #modal .pgu .pu-use { display: flex; flex-direction: column; gap: 0; }
html body #modal .pgu .pu-big { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; }
html body #modal .pgu .pu-big b { font-size: 21px; font-weight: 700; letter-spacing: -.3px; }
html body #modal .pgu .pu-big span { font-size: 12px; color: var(--mut); }
html body #modal .pgu .pu-bar { height: 6px; margin: 5px 0 6px; border-radius: 3px; background: var(--panel-2, rgba(255, 255, 255, .08)); overflow: hidden; }
html body #modal .pgu .pu-bar i { display: block; height: 100%; border-radius: 3px; background: var(--acc); } html body #modal .pgu .pu-bar i.warn { background: var(--warn); } html body #modal .pgu .pu-bar i.bad { background: var(--bad, #f0506e); }
html body #modal .pgu .pu-kv { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-height: 22px; font-size: 12.5px; border-top: 1px solid var(--line); }
html body #modal .pgu .pu-kv > span { color: var(--mut); } html body #modal .pgu .pu-kv > b { font-weight: 600; text-align: right; }
html body #modal .pgu .pu-meta { display: block; margin-top: auto; padding-top: 4px; font-size: 11px; line-height: 1.35; }
html body #modal .pgu .pu-chips { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 5px 6px; max-height: 92px; overflow: auto; }
html body #modal .pgu .pu-chip { position: relative; display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: 12px; color: var(--mut); cursor: pointer; user-select: none; }
html body #modal .pgu .pu-chip input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; pointer-events: none; }
html body #modal .pgu .pu-chip:has(input:checked) { color: var(--text); background: rgba(122, 167, 240, .17); border-color: rgba(122, 167, 240, .5); }
html body #modal .pgu .pu-chip:has(input:focus-visible) { outline: 2px solid rgba(47, 139, 255, .7); outline-offset: 1px; }
html body #modal .pgu .pu-save { margin: 0; padding: 0; }
html body #modal .pgu .pg-admin-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; margin: 0; max-width: 100%; }
html body #modal .pgu .pg-admin-seg button { height: 24px; padding: 0 10px; border-radius: 8px; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--mut); background: var(--panel); border: 1px solid var(--line); box-shadow: none; }
html body #modal .pgu .pg-admin-seg button.on { color: var(--text); background: rgba(122, 167, 240, .17); border-color: rgba(122, 167, 240, .5); }
html body #modal .pgu #pgu-actbody { max-height: 118px; overflow: auto; }
@container pgu (max-width: 700px) { html body #modal .pgu .pu-top, html body #modal .pgu .pu-mid { grid-template-columns: minmax(0, 1fr); } }
@container pgu (max-width: 470px) { html body #modal .pgu .pu-grid { grid-template-columns: minmax(0, 1fr); } }
html body #modal .pgu .pgu-tbl { width: 100%; table-layout: fixed; }
html body #modal .pgu .pgu-tbl th, html body #modal .pgu .pgu-tbl td { padding: 2px 8px; font-size: 12.5px; }
html body #modal .pgu .pgu-tbl td.name { text-align: left; }
html body #modal .pgu .pgu-foot { display: flex; justify-content: flex-end; padding-top: 6px; }
html body #modal .pgu .pgu-fmtbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 0 0 6px; } html body #modal .pgu .pgu-fmtbar .sp { flex: 1; }
html body #modal .pgu .pgu-fmtbar label { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--mut); } html body #modal .pgu .pgu-fmtbar select { height: 28px; width: 170px; font-size: 12.5px; } html body #modal .pgu .pgu-fmtbar button { height: 28px; }
html body #modal .pgu .pgu-fmtta { width: 100%; box-sizing: border-box; height: 100px; padding: 8px 10px; border-radius: 10px; font: 12px/1.45 var(--mono, ui-monospace, Menlo, Consolas, monospace); white-space: pre; resize: vertical; }
html body #modal .pgu .pgu-fmtnote { padding: 8px 2px; font-size: 12.5px; }
html body #modal .pgu-tool .pgu-p { margin: 0 0 8px; font-size: 12.5px; }
html body #modal .pgu-tool .pgu-chips { display: flex; flex-wrap: wrap; gap: 2px 12px; justify-content: flex-end; }
html body #modal .pgu-tool .pgu-two { display: inline-flex; align-items: center; gap: 8px; }
html body #modal .pgu-tool .pgu-two i { font-style: normal; color: var(--mut); }
html body #modal .pgu-tool .kv2.kf input[type="number"], html body #modal .pgu-tool .kv2.kf input[type="date"] { width: 150px; flex: none; }
html body #modal .pgu-tool .kv2.kf input:not([type="checkbox"]):not([type="number"]):not([type="date"]), html body #modal .pgu-tool .kv2.kf select { flex: 1 1 auto; min-width: 0; }
html body #modal .pgu-tool .pgu-res { margin: 8px 0; }
html body #modal .pgu-tool .pgu-count { padding: 7px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-size: 13px; }
html body #modal .pgu-tool .pgu-count b { margin-right: 4px; font-size: 17px; }
html body #modal .pgu-tool .pgu-count.none { color: var(--mut); }
html body #modal .pgu-tool .pgu-names { display: flex; flex-wrap: wrap; gap: 4px 6px; max-height: 150px; overflow: auto; margin-top: 6px; }
html body #modal .pgu-tool .pgu-names span { padding: 1px 9px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; }
html body #modal .pgu-tool .pgu-links { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 6px; font-size: 11.5px; color: var(--mut); }
html body #modal .pgu-tool .pgu-links textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: 12px; font: 12px/1.45 var(--mono, ui-monospace, Menlo, Consolas, monospace); white-space: pre; resize: vertical; }
html body #modal .pgu-tool .kv2.kf > div.pgu-chips, html body #modal .pgu-tool .kv2.kf > div.pgu-groups { flex-wrap: wrap; white-space: normal; overflow: visible; justify-content: flex-start; text-align: left; align-items: center; }
html body #modal .pgu-tool .kv2.kf > .pgu-two { flex: 1 1 auto; justify-content: flex-end; min-width: 0; }
html body #modal .pgu-tool .pgu-two input[type="date"] { width: 128px; min-width: 0; }

/* ---- the host window of a PasarGuard panel (pg_hosts.js). 1.59.0 (the owner: "make this window better and more professional" and "fix the size of my switches so they do not overlap"): two grouped cards (Where, Security), each a list of rows - the name and one line of help on the left, the control on the right, a hairline between the rows. The ticks (the users' states, ALPN) are pills that light up, never switches; every switch in the window is the same 40 x 24; every field the same 34 px. */
html body #modal .modal.pgh { max-width: 940px; }
html body #modal .pgh [hidden] { display: none !important; }
html body #modal .pgh form.pgh-form { display: block !important; }
html body #modal .pgh .pgh-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 14px; align-items: stretch; margin: 0 0 14px; }
html body #modal .pgh .pgh-card { margin: 0; border: 1px solid var(--uk-line); border-radius: 16px; background: var(--uk-surface); overflow: hidden; }
html body #modal .pgh .pgh-card > header { display: flex; align-items: center; gap: 10px; padding: 10px 16px; min-height: 48px; box-sizing: border-box; border-bottom: 1px solid var(--uk-line); }
html body #modal .pgh .pgh-card > header b { font-size: 13.5px; font-weight: 650; color: var(--uk-text); }
html body #modal .pgh .pgh-card > header small { margin-left: auto; font-size: 12px; color: var(--uk-mut); text-align: right; }
html body #modal .pgh .pgh-i { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: rgba(255, 255, 255, .06); color: var(--uk-mut); }
html body #modal .pgh .pgh-i svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html body #modal .pgh .pgh-r { display: grid; grid-template-columns: 124px minmax(0, 1fr); align-items: center; gap: 4px 14px; margin: 0; padding: 8px 16px; min-height: 50px; box-sizing: border-box; border-top: 1px solid var(--uk-line); }
html body #modal .pgh .pgh-card > header + .pgh-r { border-top: 0; }
html body #modal .pgh .pgh-l { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
html body #modal .pgh .pgh-l b { font-size: 13px; font-weight: 600; color: var(--uk-text); }
html body #modal .pgh .pgh-l small { font-size: 11px; line-height: 1.3; color: var(--uk-mut); }
html body #modal .pgh .pgh-c { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-width: 0; }
html body #modal .pgh .pgh-c input:not([type="checkbox"]), html body #modal .pgh .pgh-c select { flex: 1 1 auto; width: 100%; min-width: 0; height: 34px; box-sizing: border-box; padding: 0 12px; border-radius: 10px; font-size: 13px; }
html body #modal .pgh .pgh-c select { padding-right: 30px; }
html body #modal .pgh .pgh-c textarea { flex: 1 1 auto; width: 100%; min-width: 0; min-height: 56px; box-sizing: border-box; padding: 8px 12px; border-radius: 10px; resize: vertical; font: inherit; font-size: 13px; line-height: 1.4; }
/* a row of ticks: pills, a ring that fills blue with a tick when on; the size never changes */
html body #modal .pgh .pgh-chips { display: flex; flex-wrap: wrap; gap: 6px; }
html body #modal .pgh .pgh-chip { position: relative; display: inline-flex; margin: 0; padding: 0; cursor: pointer; }
html body #modal .pgh .pgh-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
html body #modal .pgh .pgh-chip span { position: relative; display: inline-flex; align-items: center; height: 28px; padding: 0 12px 0 28px; box-sizing: border-box; border-radius: 14px; border: 1px solid var(--uk-line); background: var(--uk-field); color: var(--uk-mut); font-size: 12.5px; font-weight: 600; white-space: nowrap; user-select: none; transition: background-color .15s, border-color .15s, color .15s; }
html body #modal .pgh .pgh-chip span::before { content: ""; position: absolute; left: 9px; top: 50%; width: 13px; height: 13px; margin-top: -6.5px; box-sizing: border-box; border-radius: 50%; border: 1.5px solid var(--uk-line-2); background: transparent no-repeat center / 9px; transition: background-color .15s, border-color .15s; }
html body #modal .pgh .pgh-chip:hover span { border-color: var(--uk-line-2); color: var(--uk-text); }
html body #modal .pgh .pgh-chip input:checked + span { background: rgba(31, 123, 255, .18); border-color: rgba(120, 175, 255, .6); color: var(--uk-text); }
html body #modal .pgh .pgh-chip input:checked + span::before { border-color: transparent; background-color: var(--uk-blue); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
html body #modal .pgh .pgh-chip input:focus-visible + span { outline: 2px solid #5aa9ff; outline-offset: 2px; }
/* every switch of the window: ONE size (40 x 24) and one look, on or off, whatever the page's other layers say */
html body #modal .pgh .pgh-sw .pgh-c { justify-content: flex-end; flex-wrap: nowrap; }
html body #modal .pgh .srv-sw, html body #modal .pgh .srv-sw.on { flex: none; display: inline-flex; width: 40px; min-width: 40px; max-width: 40px; height: 24px; margin: 0; padding: 0; gap: 0; border: 0; background: transparent; box-shadow: none; border-radius: 12px; }
html body #modal .pgh .srv-sw i, html body #modal .pgh .srv-sw.on i { width: 40px; height: 24px; border-radius: 12px; background: #35405a !important; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .10) !important; }
html body #modal .pgh .srv-sw i::after, html body #modal .pgh .srv-sw.on i::after { top: 3px; left: 3px; width: 18px; height: 18px; transform: none; background: linear-gradient(180deg, #fff, #dde5f6); box-shadow: 0 1px 3px rgba(0, 0, 0, .38); }
html body #modal .pgh .srv-sw:has(input:checked) i { background: linear-gradient(180deg, #2f9dff, #0a7cf5) !important; box-shadow: 0 0 0 1px rgba(10, 124, 245, .55), 0 0 9px rgba(10, 132, 255, .42) !important; }
html body #modal .pgh .srv-sw:has(input:checked) i::after { transform: translateX(16px); }
html body #modal .pgh .srv-sw:has(input:focus-visible) { outline: 2px solid #5aa9ff; outline-offset: 2px; }
/* the two folded groups under the cards */
html body #modal .pgh details.pgh-more { margin: 0 0 10px; border: 1px solid var(--uk-line); border-radius: 16px; background: var(--uk-surface); overflow: hidden; }
html body #modal .pgh details.pgh-more > summary { cursor: pointer; user-select: none; list-style: none; display: flex; align-items: center; gap: 10px; padding: 10px 16px; min-height: 48px; box-sizing: border-box; }
html body #modal .pgh details.pgh-more > summary::-webkit-details-marker { display: none; }
html body #modal .pgh details.pgh-more > summary b { font-size: 13.5px; font-weight: 650; color: var(--uk-text); }
html body #modal .pgh details.pgh-more > summary small { flex: 1 1 auto; min-width: 0; font-size: 12px; color: var(--uk-mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
html body #modal .pgh details.pgh-more > summary::after { content: ""; flex: none; width: 7px; height: 7px; margin: 0 4px 2px 2px; border: solid var(--uk-mut); border-width: 0 1.8px 1.8px 0; transform: rotate(45deg); transition: transform .15s; }
html body #modal .pgh details.pgh-more[open] > summary { border-bottom: 1px solid var(--uk-line); }
html body #modal .pgh details.pgh-more > summary + .pgh-r { border-top: 0; }
html body #modal .pgh details.pgh-more[open] > summary::after { transform: rotate(-135deg); margin-bottom: -2px; }
html body #modal .pgh .pgh-a { display: flex; flex-direction: column; gap: 6px; padding: 10px 16px 12px; border-top: 1px solid var(--uk-line); }
html body #modal .pgh summary + .pgh-a { border-top: 0; }
html body #modal .pgh .pgh-ah { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; font-size: 12.5px; }
html body #modal .pgh .pgh-ah b { font-size: 13px; font-weight: 600; color: var(--uk-text); }
html body #modal .pgh .pgh-ah small { flex: 1 1 200px; min-width: 0; font-size: 11.5px; color: var(--uk-mut); }
html body #modal .pgh .pgh-a textarea { width: 100%; box-sizing: border-box; padding: 8px 12px; border-radius: 10px; font: 12px/1.45 var(--mono, ui-monospace, Menlo, Consolas, monospace); white-space: pre; resize: vertical; }
html body #modal .pgh .pgh-a textarea.bad { border-color: var(--bad, #ff453a); }
/* the buttons stay in view while the window scrolls */
html body #modal .pgh .frm-act { position: sticky; bottom: -18px; z-index: 3; display: flex; align-items: center; gap: 8px; margin: 14px -18px -18px; padding: 12px 18px; border-top: 1px solid var(--uk-line); background: var(--u-modal, #0f1626); }
html[data-mode="light"] body #modal .pgh .frm-act { background: #fff; }
html body #modal .pgh .frm-act .sp { flex: 1; }
html[data-mode="light"] body #modal .pgh .pgh-i { background: rgba(30, 50, 100, .07); }

/* 1.57.25 - Settings redesigned like the other sections (the owner: "neat and compact like the rest"): the sections are the kit's segmented control, the form is ONE card of a fixed height (the head, the fields that scroll, the buttons at its foot), every control is 36 px (a switch is a 36 px well too, so a row of fields sits on one line), 280 px columns */
html body #page .pg-admin-seg { flex-wrap: nowrap; align-items: center; gap: 2px; height: 36px; box-sizing: border-box; padding: 3px; max-width: 100%; overflow-x: auto; scrollbar-width: none; border-radius: 11px; background: #151a2b; border: 1px solid var(--uk-line); }
html body #page .pg-admin-seg button { height: 28px; padding: 0 14px; box-sizing: border-box; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #b6bfd6; font-size: 13px; font-weight: 600; white-space: nowrap; }
html body #page .pg-admin-seg button:hover { color: #fff; background: rgba(255, 255, 255, .06); }
html body #page .pg-admin-seg button.on { background: #2d3f68; border-color: rgba(120, 170, 255, .5); color: #fff; box-shadow: inset 0 0 0 1px rgba(120, 170, 255, .4); }
html body #page .pg-admin-ib { width: 36px; height: 36px; padding: 0; display: inline-grid; place-items: center; flex: none; border-radius: 11px; background-image: linear-gradient(180deg, #44577f, #37486c) !important; border: 1px solid rgba(255, 255, 255, .18) !important; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12) !important; }
html body #page .pg-admin-ib:hover { background-image: linear-gradient(180deg, #2f8bff, #0b5ad9) !important; border-color: rgba(120, 180, 255, .55) !important; }
html body #page .pg-admin-ib svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
html body #page .pg-admin-card { display: flex; flex-direction: column; margin: 0; padding: 0; overflow: hidden; border-radius: 16px; border: 1px solid rgba(255, 255, 255, .09); background: linear-gradient(180deg, #181e30, #141a2b); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
html body #page .pg-admin-card .pg-admin-sechead { flex: none; margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--uk-line); font-size: 12.5px; } html body #page .pg-admin-card .pg-admin-sechead b { font-size: 14px; font-weight: 650; color: var(--text); }
html body #page .pg-admin-card .pg-admin-formbox { flex: 1 1 auto; min-height: 0; max-height: none; margin: 0; overflow: auto; scrollbar-width: thin; }
html body #page .pg-admin-card .pg-admin-fgrid.pg-admin-top { padding: 14px 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px 18px; align-items: end; }
html body #page .pg-admin-card .pg-admin-f input:not([type=checkbox]), html body #page .pg-admin-card .pg-admin-f select { height: 36px; border-radius: 11px; font-size: 13px; }
html body #page .pg-admin-card .pg-admin-f .pg-admin-secrow button { height: 36px; }
html body #page .pg-admin-card .pg-admin-sw { height: 36px; min-height: 0; box-sizing: border-box; padding: 0 12px; border: 1px solid var(--uk-line); border-radius: 11px; background: #0f1424; color: var(--text); font-size: 13px; }
html body #page .pg-admin-card .pg-admin-grp { padding: 4px 12px 12px; border-radius: 14px; } html body #page .pg-admin-card .pg-admin-grp .pg-admin-fgrid { gap: 8px 18px; }
html body #page .pg-admin-card .pg-admin-foot { flex: none; display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 16px; border-top: 1px solid var(--uk-line); background: rgba(0, 0, 0, .14); }
html body #page .pg-admin-card .pg-admin-foot button { height: 36px; padding: 0 16px; border-radius: 11px; font-size: 13px; font-weight: 600; }
html[data-mode="light"] body #page .pg-admin-seg { background: #eef2fa; border-color: rgba(30, 50, 100, .14); } html[data-mode="light"] body #page .pg-admin-seg button { color: #4a5a7e; } html[data-mode="light"] body #page .pg-admin-seg button.on { background: #fff; color: #14213d; box-shadow: 0 1px 3px rgba(30, 50, 100, .18), inset 0 0 0 1px rgba(47, 111, 224, .35); }
html[data-mode="light"] body #page .pg-admin-card { background: #fff; border-color: rgba(30, 50, 100, .14); box-shadow: 0 1px 2px rgba(30, 50, 100, .06); } html[data-mode="light"] body #page .pg-admin-card .pg-admin-sw { background: #f6f8fc; }html body #page .pg-bar .pg-admin-ib { width: 36px; height: 36px; }      /* (the bar's own rule made it 30 px: measured in a real browser) */
/* the Investigate window of a PasarGuard user (1.69.191, compact since 1.69.194): a strip, four tabs and small cards in a grid - nothing to scroll inside */
html body #modal .pgi { display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; line-height: 1.4; }
html body #modal .pgi .mut, html body #modal .pgi small { color: var(--mut); }
html body #modal .pgi-head { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); }
html body #modal .pgi-head.ok { border-color: var(--ok); }
html body #modal .pgi-head.warn { border-color: var(--warn); }
html body #modal .pgi-head.bad { border-color: var(--bad); }
html body #modal .pgi-v { flex: 1 1 240px; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; }
html body #modal .pgi-v > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
html body #modal .pgi .d { flex: none; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--mut); }
html body #modal .pgi-v .d { margin-top: 0; width: 10px; height: 10px; }
html body #modal .pgi .d.ok { background: var(--ok); }
html body #modal .pgi .d.warn { background: var(--warn); }
html body #modal .pgi .d.bad { background: var(--bad); }
html body #modal .pgi-stats { display: flex; align-items: flex-start; gap: 6px 18px; flex-wrap: wrap; }
html body #modal .pgi-st { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
html body #modal .pgi-st > span { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mut); }
html body #modal .pgi-st > b { font-size: 14px; font-weight: 700; white-space: nowrap; }
html body #modal .pgi-st > small { font-size: 10.5px; white-space: nowrap; }
html body #modal .pgi-wstats { padding: 2px 0 6px; }
html body #modal .pgi-tabs { margin: 0; }
html body #modal .pgi-tabs button { height: 28px; padding: 0 12px; font-size: 12px; }
html body #modal .pgi-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 8px; align-items: start; }
html body #modal .pgi-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html body #modal .pgi-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
html body #modal .pgi-card { margin: 0; padding: 7px 12px 8px; min-width: 0; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); }
html body #modal .pgi-card > h6 { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; margin: 0 0 5px; font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--mut); }
html body #modal .pgi-card > h6 small { font-size: 10.5px; font-weight: 500; letter-spacing: 0; text-transform: none; }
html body #modal .pgi-card > h6 .sp { flex: 1 1 0; }
html body #modal .pgi-card > h6.err { color: var(--bad); }
html body #modal .pgi-card > h6 .pill { letter-spacing: 0; text-transform: none; }
html body #modal .pgi-card > h6 .pill.on { color: var(--ok); }
html body #modal .pgi-card > h6 button.sm { height: 22px; padding: 0 9px; font-size: 11px; text-transform: none; letter-spacing: 0; }
html body #modal .pgi-bars { display: flex; align-items: flex-end; gap: 2px; height: 64px; }
html body #modal .pgi-bars.short { height: 54px; }
html body #modal .pgi-bars i { flex: 1; min-width: 2px; border-radius: 2px 2px 0 0; background: var(--acc); }
html body #modal .pgi-bars i.hot { background: var(--warn); }
html body #modal .pgi-ax { display: flex; gap: 2px; margin-top: 2px; font-size: 10px; color: var(--mut); }
html body #modal .pgi-ax span { flex: 1; min-width: 2px; white-space: nowrap; overflow: visible; }
html body #modal .pgi-f { display: flex; align-items: flex-start; gap: 8px; padding: 3px 0; border-top: 1px solid var(--line); }
html body #modal .pgi-f:first-of-type { border-top: 0; }
html body #modal .pgi-f b { font-weight: 600; }
html body #modal .pgi-f .mut { font-size: 11.5px; }
html body #modal .pgi-r { display: grid; align-items: center; gap: 8px; padding: 3px 0; border-top: 1px solid var(--line); min-width: 0; }
html body #modal .pgi-r:first-of-type { border-top: 0; }
html body #modal .pgi-r.pgi-srv { grid-template-columns: minmax(40px, 76px) minmax(0, 1fr) auto 36px; }
html body #modal .pgi-r.pgi-2 { grid-template-columns: minmax(0, 1fr) auto; }
html body #modal .pgi-r.pgi-3 { grid-template-columns: auto minmax(0, 1fr) auto; }
html body #modal .pgi-r.pgi-4 { grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.7fr) auto auto; }
html body #modal .pgi-r .n { font-weight: 600; min-width: 0; }
html body #modal .pgi-r .mono { font-size: 11.5px; text-align: right; }
html body #modal .pgi-r.pgi-4 .mono { text-align: left; }
html body #modal .pgi-bar { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .08); overflow: hidden; }
html body #modal .pgi-bar i { display: block; height: 100%; border-radius: 3px; background: var(--acc); }
html body #modal .pgi-more { padding-top: 3px; font-size: 11px; color: var(--mut); }
html body #modal .pgi-seg { display: inline-flex; gap: 2px; }
html body #modal .pgi-seg button { height: 20px; padding: 0 8px; border-radius: 7px; font-size: 10.5px; font-weight: 600; color: var(--mut); background: transparent; border: 1px solid transparent; text-transform: none; letter-spacing: 0; }
html body #modal .pgi-seg button.on { color: var(--text); border-color: var(--line); background: rgba(255, 255, 255, .06); }
html body #modal .pgi textarea.pgi-msg { width: 100%; min-height: 150px; font-family: inherit; font-size: 12.5px; line-height: 1.7; resize: none; }
html body #modal .pgi-note { font-size: 11px; }
@media (max-width: 760px) {
  html body #modal .pgi-grid, html body #modal .pgi-grid.three { grid-template-columns: minmax(0, 1fr); }
}
