/* UI16-P1: pages that show no action tools, the favorite-only dashboard header,
   narrower import cards, and the folder icon used by Documents and Credentials. */
.page-head.ui16-no-tools .ui14-menu-tools,
.page-head.ui16-no-tools .ui11-toolbar-grid,
.page-head.ui16-no-tools .ui14-menu-exceptions:empty,
.page-head.ui16-no-tools #page-favorite-toggle {display:none !important;}

.page-head.ui16-favorite-only .ui16-favorite-slot {
    display:flex;
    flex:0 0 auto;
    align-items:center;
    justify-content:flex-end;
    margin-left:auto;
}
.ui16-favorite-slot > #page-favorite-toggle {
    width:84px;
    height:40px;
    min-height:0;
    border-radius:8px;
}

/* Select JSON File card: no more empty space on wide screens. */
.module-panel.ui16-narrow-card,
.form-card.ui16-narrow-card {max-width:720px;}

/* Folder icon (flat orange, rounded, two-tone), replaces the old emoji. */
.ui16-folder-icon {
    display:inline-block;
    width:22px;
    height:18px;
    margin-right:6px;
    vertical-align:-3px;
    flex:0 0 auto;
}
.ui16-folder-icon .ui16-folder-back {fill:#d4491b;}
.ui16-folder-icon .ui16-folder-front {fill:#f26b36;}
.ui16-folder-icon .ui16-folder-shine {fill:#ff9a6b;opacity:.55;}

/* ---- UI16-P1.1 -------------------------------------------------------------------- */
/* Administrative pages: breadcrumb + title, at most a Back and a + button. */
.ui16-admin-head .page-head-actions {display:flex;gap:8px;align-items:center;justify-content:flex-end;flex-wrap:wrap;}
.ui16-admin-head .page-head-actions .button {box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;height:40px;min-height:0;min-width:84px;padding:0 14px;font-size:13px;line-height:1.2;text-decoration:none;}
.ui16-admin-head .page-head-actions .ui16-admin-plus {width:84px;padding:0;font-size:23px;font-weight:800;}
.ui16-title-row {display:flex;align-items:center;gap:12px;flex-wrap:wrap;}
.ui16-title-row h1 {margin:0;}
.ui16-status-pill {display:inline-flex;align-items:center;padding:3px 11px;border:1px solid currentColor;border-radius:999px;font-size:12px;font-weight:700;white-space:nowrap;}
.ui16-admin-links {display:flex;gap:8px;justify-content:flex-end;margin:0 0 12px;}
.ui16-admin-links .button {height:34px;min-height:0;padding:0 14px;font-size:13px;display:inline-flex;align-items:center;}
/* Users & Roles: condensed role cards */
.role-summary-grid {margin-bottom:14px;gap:12px;}
.role-summary-card {padding:12px 16px;gap:4px;}
.role-summary-card span {line-height:1.35;}
/* Manage Users: room for the Protected pill */
.user-row.manage-user-row {grid-template-columns:minmax(180px,1.25fr) 130px minmax(220px,1.5fr) 100px minmax(390px,1.15fr);}
.protected-user {white-space:nowrap;}
/* One sort control per page: the toolbar Sort (or the column headers); hide the in-card dropdown. */
main .ui11-sortbar {display:none !important;}
/* Form pages: the shared 3 x 2 toolbar at the standard size, with a dimmed Sort slot. */
.page-head:not(.ui14-menu-page-head) .ui11-toolbar-grid {grid-template-columns:repeat(3,84px);width:268px;max-width:100%;}
.ui11-grid-favorite {grid-row:1 !important;}
.ui11-grid-favorite > .page-favorite-toggle,
.ui11-grid-favorite > .ui11-favorite-placeholder {height:40px !important;min-height:40px !important;}
.ui11-grid-sort {grid-column:3;grid-row:2;}
/* Import cards: Back on the same row as the scan button, at the right end of the card. */
.ui16-card-actions-row {display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;}
.ui16-card-actions-row .button {min-width:84px;}
/* Export pages: Back directly under the left card. */
.ui16-under-cards {margin-top:18px;display:flex;justify-content:flex-start;}
/* Export dropdown (JSON / CSV) */
.ui16-export-menu {position:relative;}
.ui16-export-menu > summary {list-style:none;cursor:pointer;}
.ui16-export-menu > summary::-webkit-details-marker {display:none;}
.ui16-export-panel {position:absolute;top:calc(100% + 6px);right:0;z-index:60;min-width:170px;display:none;flex-direction:column;gap:2px;padding:6px;border:1px solid var(--line,#2a3550);border-radius:10px;background:var(--panel,#111a2e);box-shadow:0 10px 28px rgba(0,0,0,.45);}
.ui16-export-menu[open] > .ui16-export-panel {display:flex;}
.ui16-export-panel a {display:block;padding:9px 12px;border-radius:8px;color:var(--text,#e8eefc);text-decoration:none;font-size:13px;white-space:nowrap;}
.ui16-export-panel a:hover, .ui16-export-panel a:focus {background:var(--panel2,#18233c);outline:none;}
.ui16-export-panel button {display:block;width:100%;padding:9px 12px;border:0;border-radius:8px;background:transparent;color:var(--text,#e8eefc);font:inherit;font-size:13px;text-align:left;white-space:nowrap;cursor:pointer;}
.ui16-export-panel button:hover, .ui16-export-panel button:focus {background:var(--panel2,#18233c);outline:none;}
.ui14-menu-tools > .ui14-slot-export {width:100%;min-width:0;}
.ui14-menu-tools > .ui14-slot-export > summary {box-sizing:border-box;display:flex;width:100%;height:40px;min-height:0;margin:0;padding:0 6px;align-items:center;justify-content:center;border-radius:8px;font-size:13px;line-height:1.2;white-space:nowrap;}

/* ---- UI16-P1.2 -------------------------------------------------------------------- */
/* Every "+" button draws its plus instead of typing a "+" character, so it is centred exactly
   (a text glyph sits wherever the font baseline puts it: up to 1.2px high, and a different size per toolbar). */
.ui11-plus,
.ui13-orgs-plus,
.ui16-admin-plus,
.ui15-credential-add-cell > details > summary {
    font-size:0 !important;
    line-height:0 !important;
    display:flex !important;
    align-items:center;
    justify-content:center;
    gap:0 !important;
    padding:0 !important;
    text-indent:0 !important;
    letter-spacing:0 !important;
}
.ui11-plus::before,
.ui13-orgs-plus::before,
.ui16-admin-plus::before,
.ui15-credential-add-cell > details > summary::before {
    content:"";
    display:block;
    width:16px;
    height:16px;
    flex:0 0 16px;
    background:currentColor;
    -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 2v12M2 8h12' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 2v12M2 8h12' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* Credential form: tighter vertical spacing (one 10px gap between rows instead of 16px + an 18px margin, shorter Notes, snugger card). */
.credential-wide-form {gap:10px 22px;}
.credential-wide-form > .form-field {margin-bottom:0;}
.credential-wide-form .form-field label {margin-bottom:5px;}
.credential-wide-form textarea {min-height:84px;height:92px;resize:vertical;}
.credential-wide-form > .form-actions {margin-top:6px;}
.form-card.killian-wide-form-card:has(> form.credential-wide-form) {padding:18px 20px;}

/* ---- UI16-P1.4: edge-to-edge, responsive -------------------------------------------- */
/* Pages use the full width of the window; side padding scales with the screen. (Was: 1500px cap, centred.) */
main {max-width:none;padding:clamp(16px,2.2vw,32px);}
/* Page headers were capped at 760-1200px, leaving content wider than its own title bar. */
.page-head-width-760,
.page-head-width-850,
.page-head-width-900,
.page-head-width-1000,
.page-head-width-1100,
.page-head-width-1200 {max-width:none;}
/* Generic form cards fill the width (single-purpose cards keep their own narrower classes: ui16-narrow-card, delete-confirm-card). */
.form-card,
.secret-card {max-width:none;}
.form-card.ui16-narrow-card {max-width:720px;}
/* Hidden switch checkboxes inherited width:100% and stuck out past the right edge, creating an invisible sideways scroll. */
.toggle-row input[type="checkbox"] {width:1px;height:1px;margin:0;clip-path:inset(50%);}
/* Audit log: columns share the width instead of a fixed 1500px; narrow screens scroll inside the card with a visible bar. */
.audit-table.audit-table-verbose {min-width:1180px;}
.audit-table-wrap {scrollbar-width:thin;}
/* Small screens: headers and their buttons wrap instead of overflowing. */
@media (max-width:760px) {
    .page-head {flex-wrap:wrap;gap:12px;}
    .page-head-actions {flex-wrap:wrap;}
}
/* Audit filter bar: fluid columns, never wider than the page. */
@media (max-width:1500px) {
    .audit-filter-panel {grid-template-columns:repeat(auto-fit,minmax(170px,1fr));}
    .audit-filter-search {grid-column:span 2;}
}
/* Simple forms (fields as direct children of the card): responsive multi-column grid instead of one stretched column. */
form.form-card:has(> .form-field) {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,360px),1fr));gap:10px 22px;align-items:start;}
form.form-card:has(> .form-field) > :not(.form-field) {grid-column:1 / -1;}
form.form-card:has(> .form-field) > .form-field {margin-bottom:0;}
form.form-card:has(> .form-field) > .form-field:has(textarea) {grid-column:1 / -1;}

/* ---- UI16-P1.5: two-column Administration, Django Administration setting ------------------ */
.ui16-admin-grid {column-count:2;column-gap:18px;}
.ui16-admin-grid > * {break-inside:avoid;display:block;width:100%;margin:0 0 18px !important;box-sizing:border-box;}
.ui16-admin-grid > .ui16-col-break {break-before:column;}
@media (max-width:1100px) {
    .ui16-admin-grid {column-count:1;}
    .ui16-admin-grid > .ui16-col-break {break-before:auto;}
}
.ui16-djadmin {margin:22px 0 20px;padding-top:18px;border-top:1px solid var(--line,#2a3550);}
.ui16-djadmin-open {margin-top:12px;padding:10px 14px;border:1px solid #e0603a;border-radius:10px;background:rgba(224,96,58,.12);color:#ffb59e;}
.ui16-djadmin-fields {margin-top:14px;display:grid;gap:8px;max-width:560px;}
.ui16-djadmin-fields[hidden] {display:none;}
.ui16-djadmin-warning {padding:12px 14px;border:1px solid #b78a2c;border-radius:10px;background:rgba(183,138,44,.12);line-height:1.5;}
.ui16-djadmin-ack {display:flex;align-items:flex-start;gap:10px;margin:4px 0;}
.ui16-djadmin-ack input {width:auto;margin-top:3px;}

/* ---- UI16-P1.6: favorite-customer shortcuts on the Dashboard ------------------------------ */
.ui16-dash-title-row {display:flex;align-items:center;gap:16px;flex-wrap:wrap;}
.ui16-dash-title-row h1 {margin:0;}
.ui16-org-pins {display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.ui16-org-pin {box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;gap:0;width:38px;height:38px;padding:0;border-radius:50%;border:1px solid rgba(110,170,255,.5);background:rgba(90,150,255,.14);color:#d6e6ff;font-size:.74rem;font-weight:700;letter-spacing:.02em;line-height:1;text-decoration:none;cursor:pointer;overflow:hidden;white-space:nowrap;}
.ui16-org-pin.is-four {font-size:.66rem;letter-spacing:0;}
.ui16-org-pin.is-pill {width:auto;min-width:38px;padding:0 13px;border-radius:19px;}
.ui16-org-pin:hover, .ui16-org-pin:focus-visible {background:rgba(90,150,255,.3);border-color:#8bbcff;outline:none;}
.ui16-org-pin-add {position:relative;font-size:0;border-style:dashed;background:transparent;color:#9db9e6;}
.ui16-org-pin-add::before {content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:block;width:14px;height:14px;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 2v12M2 8h12' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 2v12M2 8h12' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;}
.ui16-org-pin-add:hover, .ui16-org-pin-add:focus-visible {background:rgba(90,150,255,.14);color:#d6e6ff;}
.ui16-dialog {width:min(520px,92vw);max-height:86vh;padding:22px;border:1px solid var(--line,#2a3550);border-radius:14px;background:var(--panel,#111a2e);color:var(--text,#e8eefc);box-shadow:0 18px 50px rgba(0,0,0,.55);}
.ui16-dialog::backdrop {background:rgba(5,8,16,.66);}
.ui16-dialog h2 {margin:0 0 6px;}
.ui16-pin-filter {width:100%;margin:10px 0;}
.ui16-pin-list {list-style:none;margin:0;padding:0;max-height:42vh;overflow:auto;border:1px solid var(--line,#2a3550);border-radius:10px;}
.ui16-pin-list li {border-bottom:1px solid var(--line,#2a3550);}
.ui16-pin-list li:last-child {border-bottom:0;}
.ui16-pin-list li[hidden] {display:none;}
.ui16-pin-list label {display:flex;align-items:center;gap:12px;padding:9px 12px;cursor:pointer;}
.ui16-pin-list label:hover {background:var(--panel2,#18233c);}
.ui16-pin-list input {width:auto;margin:0;}
.ui16-pin-short {flex:0 0 auto;min-width:46px;text-align:center;padding:2px 8px;border-radius:999px;border:1px solid rgba(110,170,255,.45);font-size:.74rem;font-weight:700;color:#d6e6ff;}
.ui16-pin-name {flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.ui16-pin-empty {margin:10px 2px 0;color:var(--muted,#9aa8c7);}
.ui16-dialog-actions {display:flex;gap:10px;margin-top:16px;}

/* ---- UI16-P1.8: Favorites ----------------------------------------------------------------- */
/* The count lives in the star's dropdown header, not on the star itself. */
.favorites-toolbar-head {display:flex;align-items:center;gap:8px;}
.favorites-toolbar-head .favorites-toolbar-count {position:static;min-width:20px;height:20px;padding:0 6px;border:0;background:rgba(233,185,73,.2);color:#e9b949;font-size:11px;line-height:20px;}
/* Sort-only pages: hide every other toolbar slot and put Sort in the first cell. */
.ui16-sort-only .ui14-menu-tools {grid-template-columns:84px;grid-template-rows:40px;}
.ui16-sort-only .ui14-menu-tools > :not(.ui14-slot-sort) {display:none !important;}
.ui16-sort-only .ui14-menu-tools > .ui14-slot-sort {grid-column:1;grid-row:1;}
/* Favorites list: responsive cards instead of one stretched row per favorite. */
.favorites-page-list {display:grid;grid-template-columns:repeat(auto-fill,minmax(min(320px,100%),1fr));gap:10px;padding:14px 16px 6px;}
.favorites-page-list > .favorite-list-row {min-height:0;padding:11px 14px;border:1px solid var(--line);border-radius:10px;background:rgba(255,255,255,.025);}
.favorites-page-list > .favorite-list-row:last-child {border-bottom:1px solid var(--line);}
.favorites-page-list > .empty-state {grid-column:1 / -1;}
.favorite-list-added {display:block;font-style:normal;font-size:11px;color:var(--muted);}
.favorites-hint {margin:0;padding:6px 18px 16px;font-size:12px;}

/* ---- UI16-P2.0: firewall / router editor, networks on adapters, two-column subnet editor ---------- */
.ui16-fw-form {display:block;}
.ui16-fw-cols {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:16px;}
.ui16-fw-card {background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:16px 18px;}
.ui16-fw-card h2 {margin:0 0 12px;font-size:17px;}
.ui16-fw-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 16px;}
.ui16-fw-grid .ui16-fw-span2 {grid-column:1 / -1;}
.ui16-fw-grid label {display:block;margin:0 0 5px;font-size:12px;}
.ui16-fw-grid textarea {min-height:60px;height:60px;resize:vertical;}
.ui16-fw-head {display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:8px;}
.ui16-fw-head h2 {margin:0 0 2px;}
.ui16-fw-head .section-subtitle {margin:0;}
.ui16-fw-thead, .ui16-fw-row {display:grid;grid-template-columns:minmax(220px,270px) minmax(0,1fr) 84px;gap:8px 14px;align-items:start;}
.ui16-fw-thead {padding:6px 0 4px;font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);}
.ui16-fw-row {padding:10px 0;border-top:1px solid var(--line);}
.ui16-fw-row > .ui16-fw-ident {grid-column:1;grid-row:1;}
.ui16-fw-row > .ui16-fw-networks {grid-column:2;grid-row:1;}
.ui16-fw-row > .ui16-fw-actions {grid-column:3;grid-row:1;}
.ui16-fw-row > .ui16-fw-macs {grid-column:1 / -1;grid-row:2;}
.ui16-fw-ident {display:grid;grid-template-columns:minmax(0,1fr) 96px;gap:8px;}
.ui16-fw-ident input[type="number"] {padding-right:4px;}
/* The up / down arrows on the VLAN box are always visible (they otherwise show only on hover). */
.ui16-fw-ident input[type="number"]::-webkit-inner-spin-button, .ui16-fw-ident input[type="number"]::-webkit-outer-spin-button {opacity:1;height:30px;}
.ui16-fw-networks {display:flex;flex-wrap:wrap;gap:6px;align-items:center;}
.ui16-fw-chips {display:contents;}
.ui16-chip {display:inline-flex;align-items:center;gap:6px;min-height:28px;padding:0 10px;border-radius:999px;border:1px solid rgba(110,170,255,.5);background:rgba(90,150,255,.13);color:#d6e6ff;font-size:12px;font-weight:600;}
.ui16-chip small {font-weight:500;color:#9db9e6;}
.ui16-chip-add {border-style:dashed;background:transparent;color:#9db9e6;cursor:pointer;list-style:none;user-select:none;}
.ui16-chip-add::-webkit-details-marker {display:none;}
.ui16-fw-netmenu {position:relative;}
.ui16-fw-netpanel {position:absolute;z-index:30;top:calc(100% + 6px);left:0;min-width:300px;max-height:260px;overflow:auto;padding:6px;border:1px solid var(--line);border-radius:10px;background:var(--panel);box-shadow:0 14px 36px rgba(0,0,0,.5);}
.ui16-fw-netpanel {max-width:calc(100vw - 24px);}
.ui16-fw-netpanel.ui16-flip {left:auto;right:0;}
.ui16-fw-netoption {display:flex;align-items:center;gap:10px;margin:0;padding:7px 8px;border-radius:7px;cursor:pointer;font-size:13px;font-weight:600;}
.ui16-fw-netoption:hover {background:var(--panel2);}
.ui16-fw-netoption input {width:auto;margin:0;}
.ui16-fw-netoption small {margin-left:auto;color:var(--muted);font-weight:500;}
.ui16-fw-netempty {margin:6px 8px;color:var(--muted);font-size:12.5px;}
/* MAC addresses: one flowing line under each adapter - label, each MAC (name, six boxes, Delete), then "+ MAC". */
.ui16-fw-macs {display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;}
.ui16-fw-macs-label {font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);}
.ui16-fw-macs .mac-forms {display:contents;}
.ui16-fw-macrow {display:inline-flex;flex-wrap:nowrap;align-items:center;gap:6px;}
.ui16-fw-macrow .ui16-mac-name {flex:0 0 132px;}
.ui16-fw-macrow .ui16-mac-addr {flex:0 0 auto;}
.ui16-fw-macrow .asset-mac-pairs {width:auto;}
.ui16-fw-macrow .asset-mac-pair {max-width:44px;padding:8px 2px;}
.ui16-fw-macrow .ui16-mac-del {flex:0 0 auto;}
.ui16-fw-macrow label, .ui16-fw-ident label {margin:0;}
.ui16-fw-actions {text-align:right;}
@media (min-width:1101px) {
    /* Only the interface and MAC field labels (the column headings explain them); never the Networks menu options. */
    .ui16-fw-ident label, .ui16-mac-name label, .ui16-mac-addr label {position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;}
}
@media (max-width:1100px) {
    .ui16-fw-cols {grid-template-columns:1fr;}
    .ui16-fw-thead {display:none;}
    .ui16-fw-row {grid-template-columns:minmax(0,1fr) auto;}
    .ui16-fw-row > .ui16-fw-ident {grid-column:1;grid-row:1;}
    .ui16-fw-row > .ui16-fw-networks {grid-column:1;grid-row:2;}
    .ui16-fw-row > .ui16-fw-macs {grid-column:1 / -1;grid-row:3;}
    .ui16-fw-row > .ui16-fw-actions {grid-column:2;grid-row:1;}
    .ui16-fw-macrow {flex-wrap:wrap;}
    .ui16-fw-macrow .ui16-mac-name {flex:1 1 132px;}
    .ui16-fw-macrow .ui16-mac-addr {flex:1 1 100%;min-width:0;}
    .ui16-fw-macrow .asset-mac-pairs {width:100%;}
    .ui16-fw-ident label, .ui16-mac-name label, .ui16-mac-addr label {display:block;margin:0 0 4px;font-size:12px;}
}
.ui16-set-on-firewall {margin-left:8px;padding:2px 8px;border-radius:999px;background:rgba(233,185,73,.15);color:#e9b949;font-size:11px;font-weight:700;vertical-align:middle;}
.ui16-attached-list {list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;}
.ui16-attached-list li {display:flex;align-items:baseline;gap:10px;padding:8px 10px;border:1px solid var(--line);border-radius:8px;}
.ui16-attached-adapter {color:var(--muted);font-size:12.5px;}
.ui16-attached-empty {margin:0;padding:10px 12px;border:1px dashed var(--line);border-radius:10px;color:var(--muted);font-size:12.5px;}

/* ---- UI16-P2.0.1: interface rows, Sort menu ------------------------------------------------------ */
/* The row's box comes from the global section style; it had lost its inner padding, so the name,
   the MAC label and Remove touched its edges. */
.ui16-fw-row {padding:12px 16px;border:1px solid var(--line);border-radius:10px;background:rgba(255,255,255,.02);margin:0 0 10px;}
.ui16-fw-row > .ui16-fw-actions {padding-top:6px;}
.ui16-fw-thead {padding:6px 17px 4px;}
/* MAC line: ordinary flex layout (no display:contents), so every browser spaces it the same way. */
.ui16-fw-macs {display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;}
.ui16-fw-macs .mac-forms {display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;}
.ui16-fw-head-actions {display:flex;align-items:center;gap:8px;}
.ui16-fw-sortmenu {position:relative;}
.ui16-fw-sortbtn {list-style:none;cursor:pointer;user-select:none;}
.ui16-fw-sortbtn::-webkit-details-marker {display:none;}
.ui16-fw-sortpanel {position:absolute;z-index:30;top:calc(100% + 6px);right:0;min-width:190px;padding:6px;border:1px solid var(--line);border-radius:10px;background:var(--panel);box-shadow:0 14px 36px rgba(0,0,0,.5);display:flex;flex-direction:column;gap:2px;}
.ui16-fw-sortpanel button {display:block;width:100%;padding:8px 10px 8px 26px;border:0;border-radius:7px;background:transparent;color:var(--text);font-size:13px;font-weight:600;text-align:left;cursor:pointer;position:relative;}
.ui16-fw-sortpanel button:hover {background:var(--panel2);}
.ui16-fw-sortpanel button[aria-checked="true"]::before {content:"\2713";position:absolute;left:9px;color:#8bbcff;}

/* ---- UI16-P2.4d: Save, Save and Add Another, Cancel sit together in that order (template order) ---- */
.form-actions .save-add-another,
.object-editor-actions .save-add-another {margin-left:0;}

/* ---- UI16-P2.1: MAC row hugs its content (no stretch gap before Delete) ---- */
@media (min-width: 721px) {
  .ui16-fw-macrow .ui16-mac-addr {flex:0 0 auto;width:auto;}
  .ui16-fw-macrow .asset-mac-pairs:not([hidden]) {width:auto;flex:0 0 auto;gap:3px;}
  .ui16-fw-macrow .asset-mac-pair {flex:0 0 44px;width:44px;max-width:44px;}
}
@media (min-width: 721px) {
  .ui16-fw-macs {gap:6px 10px;}
  .ui16-fw-macs .mac-forms {flex:0 0 auto;width:max-content;max-width:100%;gap:6px 10px;}
  .ui16-fw-macs .add-mac {margin:0;flex:0 0 auto;}
  .ui16-fw-macrow {flex:0 0 auto;width:max-content;}
}

/* ---- UI16-P2.2: credential multi-select, Move dialog and drag-to-folder ---- */
.credential-move-column {width:38px;text-align:center;padding-left:10px;padding-right:4px;}
.credential-movable-row {cursor:grab;}
.credential-movable-row.is-selected {background:rgba(88,150,255,.10);}
.credential-movable-row.is-dragging {opacity:.45;}
.credential-move-bar {display:flex;align-items:center;gap:10px;margin:0 0 10px;padding:8px 12px;border:1px solid var(--line);border-radius:10px;background:var(--panel2);}
.credential-move-bar[hidden], .credential-drop-hint[hidden] {display:none;}
.credential-move-count {font-weight:700;font-size:13px;margin-right:auto;}
.credential-drop-hint {margin:0 0 8px;font-size:12px;color:var(--muted);}
body.credential-dragging .credential-folder-row[data-drop-folder] {outline:1px dashed rgba(139,188,255,.55);outline-offset:-2px;}
.credential-folder-row.is-drop-target {outline:2px solid #8bbcff !important;background:rgba(88,150,255,.14);}
.credential-move-dialog {width:min(460px,92vw);padding:22px;border:1px solid var(--line);border-radius:14px;background:var(--panel);color:var(--text);}
.credential-move-dialog::backdrop {background:rgba(0,0,0,.55);}
.credential-move-dialog h2 {margin:0 0 14px;font-size:18px;}
.credential-move-dialog label {display:block;margin-bottom:6px;font-size:12px;color:var(--muted);}
.credential-move-dialog select {width:100%;}
.credential-move-column input[type="checkbox"] {width:16px;height:16px;min-width:0;padding:0;margin:0;background:transparent;border:0;box-shadow:none;outline-offset:2px;cursor:pointer;}

/* ---- UI16-P2.2: Organization Tags administration ---- */
.tags-admin-card {margin-bottom:16px;}
.tags-mode-form {padding:6px 22px 18px;}
.tags-mode-options {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:12px;}
.tags-mode-option {display:flex;gap:10px;align-items:flex-start;padding:12px 14px;border:1px solid var(--line);border-radius:12px;cursor:pointer;background:var(--panel2);}
.tags-mode-option.is-current {border-color:#5f93ea;}
.tags-mode-option input {margin-top:3px;width:auto;}
.tags-mode-option strong {display:block;font-size:14px;}
.tags-mode-option small {display:block;margin-top:3px;color:var(--muted);font-size:12px;line-height:1.35;}
.tags-org-form {padding:0 0 4px;}
.tags-org-toolbar {display:flex;align-items:center;gap:10px;padding:10px 22px;flex-wrap:wrap;}
.tags-org-toolbar .form-control {max-width:280px;}
.tags-org-toolbar .muted {margin-right:auto;}
.tags-org-table-wrap {max-height:340px;overflow:auto;}
.tags-org-table tr.is-current {background:rgba(88,150,255,.08);}
.tags-org-table .tags-org-manage {text-align:right;}
.tags-org-table input[type="checkbox"], .tags-mode-option input[type="radio"] {width:16px;height:16px;padding:0;}
.tags-org-switch {display:flex;align-items:center;gap:8px;}
.tags-create-form {display:flex;gap:10px;padding:0 22px;}
.tags-create-form .form-control {max-width:360px;}
.tags-rule {padding:6px 22px 0;margin:0;font-size:12px;}
.tags-list {padding:8px 22px 18px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 22px;}
.tags-list-row {display:flex;align-items:center;gap:10px;}
.tags-rename-form {display:flex;gap:8px;flex:1;min-width:0;}
.tags-rename-form .form-control {min-width:0;}
.tags-usage, .tags-kind {font-size:12px;white-space:nowrap;}
@media (max-width:1100px) {.tags-list {grid-template-columns:minmax(0,1fr);} .tags-mode-options {grid-template-columns:minmax(0,1fr);}}
.tags-usage {min-width:72px;text-align:right;}
.tags-kind {min-width:52px;}
.status-pill.is-off {background:rgba(140,150,175,.14);color:var(--muted);border-color:rgba(140,150,175,.35);}

/* ---- UI16-P2.2: IP Control layout ---- */
.ip-status-strip {display:flex;flex-wrap:wrap;gap:12px;margin:0 0 16px;}
.ip-status-item {display:flex;align-items:center;gap:10px;padding:10px 16px;border:1px solid var(--line);border-radius:12px;background:var(--panel);min-height:48px;}
.ip-status-item span {font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);}
.ip-status-item strong {font-size:18px;}
.ip-status-item code {color:var(--link-soft);font-size:14px;}
.ip-status-you {margin-right:auto;}
.ip-rules-panel {margin-bottom:16px;}
.ip-rules-filters {display:flex;gap:10px;}
.ip-rules-filters .form-control {min-width:150px;}
.ip-rules-table {min-width:0;}
.ip-control-table-wrap {overflow-x:auto;}
.ip-control-row.ip-rules-row {grid-template-columns:90px minmax(260px,1fr) 110px 150px 130px 250px;}
.ip-rules-row[hidden] {display:none;}
.ip-rule-main {display:flex;flex-direction:column;gap:2px;min-width:0;}
.ip-rule-main code {font-size:13px;}
.ip-rule-main small, .ip-rule-matches small {color:var(--muted);font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.ip-rule-matches {display:flex;flex-direction:column;gap:2px;}
.ip-recent-panel {margin-bottom:16px;}
.ip-recent-list {list-style:none;margin:0;padding:0 22px 14px;}
.ip-recent-list li {display:flex;gap:16px;padding:8px 0;border-bottom:1px solid var(--line);font-size:12px;}
.ip-recent-list li:last-child {border-bottom:0;}
.ip-recent-list time {color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums;}
.ip-recent-empty {padding:0 22px 16px;margin:0;}
.ip-rule-dialog {width:min(560px,94vw);padding:22px;border:1px solid var(--line);border-radius:14px;background:var(--panel);color:var(--text);}
.ip-rule-dialog::backdrop {background:rgba(0,0,0,.55);}
.ip-rule-dialog h2 {margin:0 0 14px;font-size:18px;}
.ip-rule-fields {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px 16px;}
.ip-rule-fields .form-field:nth-child(1), .ip-rule-fields .form-field:nth-child(4) {grid-column:1 / -1;}
.ip-rule-fields .form-control, .ip-rule-fields input, .ip-rule-fields select {width:100%;}
.ip-rule-fields .form-field {margin:0;}
.ip-rule-fields textarea {min-height:64px;}
.ip-expiry-presets {display:flex;gap:6px;flex-wrap:wrap;margin-top:6px;}
@media (max-width:760px) {.ip-rule-fields {grid-template-columns:minmax(0,1fr);} .ip-control-row.ip-rules-row {grid-template-columns:80px minmax(200px,1fr) 100px 140px 110px 230px;} .ip-control-table-wrap {min-width:0;} .ip-rules-table {min-width:820px;}}

/* ======================================================================================
   UI16-P2.4: adaptive object forms
   One calm column by default. form-fit.js adds .ui16-cols-2 only when the single column would
   scroll on this window; then the cards flow into two columns (masonry, no blank row gaps).
   The outer card is flat, picker chrome is not nested, notes boxes are short.
   ====================================================================================== */
:root {--d-list-h:150px;--d-form-gap:12px;--d-card-pad:14px;--d-ta-h:78px;}
html[data-density="casual"] {--d-list-h:190px;--d-form-gap:18px;--d-card-pad:18px;--d-ta-h:110px;}
html[data-density="compact"] {--d-list-h:112px;--d-form-gap:8px;--d-card-pad:10px;--d-ta-h:60px;}

.object-editor-card {background:transparent;border:0;box-shadow:none;padding:0;max-width:1100px;}
.object-editor-form {display:block;}
.object-editor-form > .object-editor-section {margin:0 0 var(--d-form-gap);min-width:0;}
.object-editor-form .object-editor-grid {gap:var(--d-form-gap) 18px;}
.object-editor-form textarea {min-height:var(--d-ta-h);height:var(--d-ta-h);resize:vertical;}
.object-editor-form .object-editor-actions {margin-top:4px;padding-top:0;border-top:0;}
.object-editor-form > .object-editor-errors {margin-bottom:var(--d-form-gap);}
/* a section with no fields, text or controls (e.g. tags turned off) is not drawn */
.object-editor-form > .object-editor-section:not(:has(input, select, textarea, button, p, li, table, .object-editor-field, .record-tags-field)) {display:none;}
/* read-only notices become a slim block */
.object-editor-form > .object-editor-section:not(:has(.object-editor-grid, input, select, textarea, button)) {padding:10px 14px;}
.object-editor-form > .object-editor-section:not(:has(.object-editor-grid, input, select, textarea, button)) > h2 {font-size:14px;margin:0 0 4px;}
.object-editor-form > .object-editor-section:not(:has(.object-editor-grid, input, select, textarea, button)) > p {font-size:12.5px;line-height:1.45;margin:0;}
.object-editor-form .object-editor-description {margin:0 0 var(--d-form-gap);}

/* pickers: no card inside the card; neighbours are told apart by a hairline */
.object-editor-field > .record-tags-field {margin:0;padding:0;border:0;border-radius:0;background:transparent;}
.object-editor-field > .record-tags-field > label {margin-bottom:6px;}
.object-editor-grid > .object-editor-field:has(.record-tags-field) + .object-editor-field:has(.record-tags-field) {border-top:1px solid var(--line);padding-top:var(--d-form-gap);}
.object-editor-tag-group .record-tags-field {padding:0;border:0;border-radius:0;background:transparent;}
.record-tags-transfer-list, .association-transfer-list {min-height:var(--d-list-h);height:var(--d-list-h);}

@media (min-width:1180px) {
  .object-editor-card:has(.ui16-cols-2) {max-width:none;}
  .object-editor-form.ui16-cols-2 {column-count:2;column-gap:var(--d-form-gap);column-fill:balance;}
  .ui16-cols-2 > .object-editor-section {break-inside:avoid;}
  .ui16-cols-2 > .object-editor-errors, .ui16-cols-2 > .object-editor-actions {column-span:all;}
  .ui16-cols-2 > .object-editor-actions {margin-top:2px;}
  /* each half-width card keeps its own field grid; it drops to one column only when it is narrow */
  .ui16-cols-2 > .object-editor-section {container-type:inline-size;}
}

/* tighter labels, help text and buttons */
.object-editor-form .object-editor-field > label {font-size:13.5px;margin:0 0 5px;}
.object-editor-form .object-editor-field > small {margin-top:4px;font-size:11.5px;line-height:1.35;}
.object-editor-form .object-editor-section > h2 {font-size:18px;margin-bottom:10px;}
.object-editor-form .object-editor-grid > .object-editor-description {grid-column:1 / -1;margin:0;font-size:12.5px;}
.object-editor-form .object-editor-actions {padding-top:8px;}

@container (max-width:560px) {
  .object-editor-grid {grid-template-columns:minmax(0,1fr);}
  .object-editor-field--full {grid-column:auto;}
}
/* Assets: short notes (about the height of the MAC card), tighter labels and gaps */
.asset-form-card .asset-form-grid {gap:12px 18px;}
.asset-form-card .asset-form-grid label {font-size:13.5px;margin-bottom:5px;}
.asset-form-card .asset-form-grid > .form-field[data-asset-field="notes"] textarea {min-height:var(--d-ta-h);height:var(--d-ta-h);}
.asset-form-card .asset-form-grid .record-tags-field {margin:0;padding:var(--d-card-pad);}

/* Credentials (organization + personal): compact spacing, inline radios, flat tags */
.credential-wide-form {gap:8px 18px;}
.credential-wide-form .form-field label {font-size:13.5px;margin-bottom:4px;}
.credential-wide-form input:not([type="radio"]):not([type="checkbox"]), .credential-wide-form select {padding-top:8px;padding-bottom:8px;}
.credential-wide-form textarea {min-height:var(--d-ta-h);height:var(--d-ta-h);padding-top:8px;padding-bottom:8px;}
.credential-wide-form .helptext, .credential-wide-form .form-field > small {margin:3px 0 0;font-size:11.5px;line-height:1.35;}
.credential-wide-form > .form-actions {margin-top:2px;}
.form-card.killian-wide-form-card:has(> form.credential-wide-form) {padding:14px 18px;}
.credential-wide-form .record-tags-field {margin:0;padding:0;border:0;border-radius:0;}
.credential-personal-notice {margin:0 0 10px;padding:8px 12px;gap:2px;}
.credential-personal-notice strong {font-size:14px;}
.credential-personal-notice span {font-size:12.5px;line-height:1.4;}
/* Security radios: control and text on one line, left aligned */
#id_personal_security {display:flex;flex-wrap:wrap;gap:6px 22px;}
#id_personal_security > div {margin:0;}
#id_personal_security label {display:inline-flex;align-items:center;gap:8px;margin:0;font-weight:600;font-size:13.5px;cursor:pointer;}
#id_personal_security input[type="radio"] {width:auto;margin:0;padding:0;flex:0 0 auto;accent-color:var(--accent);}
.credential-wide-form > .form-field[data-credential-field="personal_security"] {grid-column:1 / -1;}
.asset-form-card .asset-form-grid .record-tags-field, .asset-form-card .asset-form-grid > .form-field .record-tags-field {border-color:var(--line);}

.asset-form-card .asset-form-grid > .form-field, .asset-form-card .asset-form-grid > .asset-macs-section {margin-bottom:0;}
.asset-form-card .asset-form-grid > .asset-macs-section {padding:10px 16px;}
.asset-form-card .asset-form-grid .record-tags-field > label {margin-bottom:6px;}
.asset-form-card .asset-form-grid .helptext, .asset-form-card .asset-form-grid small {margin-top:3px;font-size:11.5px;}
/* Contact: General on top; email and phone rows sit inside their own cards */
#batch-c-contact-email, #batch-c-contact-phones {font-size:18px;line-height:1.3;margin:0 0 8px;}

/* ======================================================================================
   UI16-P2.3: display density (eye menu + Casual / Lean / Compact)
   Lean is the existing look and has no overrides. The server sets <html data-density>.
   ====================================================================================== */
.density-menu {position:relative;}
.density-menu > summary {list-style:none;}
.density-menu > summary::-webkit-details-marker {display:none;}
.density-menu-button {display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:8px;color:var(--link-soft);cursor:pointer;}
.density-menu-button:hover, .density-menu[open] .density-menu-button {background:var(--panel2);}
.density-menu-panel {position:absolute;top:calc(100% + 9px);right:0;z-index:60;width:250px;max-width:calc(100vw - 24px);padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--panel);box-shadow:0 16px 36px rgba(0,0,0,.38);}
.density-menu-panel > strong {display:block;margin:0 2px 8px;font-size:13px;}
.density-menu-panel form {display:flex;flex-direction:column;gap:4px;margin:0;}
.density-option {display:flex;flex-direction:column;align-items:flex-start;gap:1px;width:100%;padding:8px 10px 8px 30px;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--text);text-align:left;cursor:pointer;position:relative;font:inherit;}
.density-option span {font-weight:700;font-size:13px;}
.density-option small {color:var(--muted);font-size:11.5px;}
.density-option:hover {background:var(--panel2);}
.density-option.is-active {border-color:var(--line-light);background:rgba(110,168,254,.08);}
.density-option.is-active::before {content:"\2713";position:absolute;left:11px;top:9px;color:#8bbcff;font-weight:800;}
.density-option:focus-visible, .density-menu-button:focus-visible {outline:2px solid var(--accent);outline-offset:1px;}
@media (max-width:760px) {.density-menu-panel {position:fixed;top:66px;right:12px;left:12px;width:auto;max-width:none;}}

.density-choice-row {display:flex;gap:10px;flex-wrap:wrap;margin-top:10px;}
.density-choice {display:inline-flex;align-items:center;gap:8px;padding:9px 16px;border:1px solid var(--line-light);border-radius:8px;cursor:pointer;font-weight:650;}
.density-choice input {width:auto;margin:0;padding:0;}
.density-choice.is-active {border-color:#5d8ed8;background:rgba(110,168,254,.1);}

/* ---- Casual: roomier ---- */
html[data-density="casual"] main {padding:38px 42px;}
html[data-density="casual"] .page-head {margin-bottom:28px;}
html[data-density="casual"] .module-row {padding:19px 22px;}
html[data-density="casual"] .module-panel-head {padding:22px 26px;}
html[data-density="casual"] .module-data-table th, html[data-density="casual"] .module-data-table td {padding:16px 18px;}
html[data-density="casual"] input, html[data-density="casual"] textarea, html[data-density="casual"] select {padding:14px 14px;}
html[data-density="casual"] textarea {min-height:160px;}
html[data-density="casual"] .button {padding:12px 18px;}
html[data-density="casual"] .button.compact {padding:9px 13px;}
html[data-density="casual"] .form-card, html[data-density="casual"] .secret-card {padding:30px;}
html[data-density="casual"] .form-field {margin-bottom:24px;}
html[data-density="casual"] .form-field label {margin-bottom:9px;}
html[data-density="casual"] .object-editor-section {padding:22px 24px;}
html[data-density="casual"] .object-editor-section > h2 {margin-bottom:18px;}
html[data-density="casual"] .object-editor-grid {gap:18px 24px;}
html[data-density="casual"] .org-sidebar {padding:22px 16px;gap:18px;}
html[data-density="casual"] .org-nav a {padding:13px 13px;}
html[data-density="casual"] .organization-metrics {gap:16px;}
html[data-density="casual"] .organization-metrics .metric-card {padding:20px 20px;min-height:96px;}
html[data-density="casual"] .organization-dashboard-grid {gap:22px;}
html[data-density="casual"] .organization-dashboard-widget-row {min-height:76px;padding:14px 20px;}
html[data-density="casual"] .organization-dashboard-widget-head {padding:20px 22px 16px;}
html[data-density="casual"] .global-summary-card {padding:22px 26px 18px;margin-bottom:26px;}
html[data-density="casual"] .global-stat {padding:9px 0;}
html[data-density="casual"] .organization-cards {gap:20px;}
html[data-density="casual"] .organization-card {padding:22px;}
html[data-density="casual"] .organization-card-counters {gap:10px 14px;}

/* ---- Compact: fit the most on screen ---- */
html[data-density="compact"] main {padding:16px 20px;}
html[data-density="compact"] h1 {font-size:1.6rem;margin-bottom:2px;}
html[data-density="compact"] .page-head {margin-bottom:12px;}
html[data-density="compact"] .page-head p {font-size:13px;}
html[data-density="compact"] .breadcrumbs {margin-bottom:6px;font-size:12px;}
html[data-density="compact"] section {padding:14px;}
html[data-density="compact"] .module-row {padding:8px 14px;}
html[data-density="compact"] .module-panel-head {padding:10px 14px;}
html[data-density="compact"] .module-data-table th, html[data-density="compact"] .module-data-table td {padding:7px 11px;}
html[data-density="compact"] input, html[data-density="compact"] textarea, html[data-density="compact"] select {padding:7px 10px;}
html[data-density="compact"] textarea {min-height:84px;}
html[data-density="compact"] .button {padding:7px 12px;}
html[data-density="compact"] .button.compact {padding:5px 9px;}
html[data-density="compact"] .form-card, html[data-density="compact"] .secret-card {padding:14px 16px;}
html[data-density="compact"] .form-field {margin-bottom:10px;}
html[data-density="compact"] .form-field label {margin-bottom:4px;}
html[data-density="compact"] .object-editor-section {padding:10px 12px;}
html[data-density="compact"] .object-editor-section > h2 {margin-bottom:8px;font-size:17px;}
html[data-density="compact"] .object-editor-grid {gap:8px 12px;}
html[data-density="compact"] .object-editor-field > label {margin-bottom:4px;}
html[data-density="compact"] .object-editor-field > small {margin-top:3px;}
html[data-density="compact"] .object-editor-actions {margin-top:12px;padding-top:12px;}
html[data-density="compact"] .org-sidebar {padding:12px 10px;gap:8px;}
html[data-density="compact"] .org-nav {gap:1px;}
html[data-density="compact"] .org-nav a {padding:6px 10px;}
html[data-density="compact"] .organization-metrics {gap:8px;margin-bottom:12px;}
html[data-density="compact"] .organization-metrics .metric-card {padding:8px 12px;min-height:58px;}
html[data-density="compact"] .organization-metrics .metric-card b {font-size:22px;}
html[data-density="compact"] .organization-dashboard-grid {gap:10px;}
html[data-density="compact"] .organization-dashboard-widget-head {min-height:0;padding:10px 14px 8px;}
html[data-density="compact"] .organization-dashboard-widget-row {min-height:0;padding:6px 14px;}
html[data-density="compact"] .organization-dashboard-widget-empty {min-height:0;padding:10px 14px;}
html[data-density="compact"] .organization-dashboard-widget-footer {min-height:34px;padding:5px 12px;}
html[data-density="compact"] .global-summary-card {padding:8px 14px 6px;margin-bottom:10px;}
html[data-density="compact"] .global-stat {padding:1px 0;}
html[data-density="compact"] .organization-cards {gap:10px;}
html[data-density="compact"] .organization-card {padding:10px 12px;}
html[data-density="compact"] .organization-card-counters {gap:2px 10px;margin-top:6px;padding-top:6px;}
html[data-density="compact"] .ip-status-item {min-height:38px;padding:6px 12px;}

/* UI16-P2.4: New Folder pop-up */
.folder-dialog {width:min(540px,94vw);padding:20px 22px;border:1px solid var(--line);border-radius:14px;background:var(--panel);color:var(--text);}
.folder-dialog::backdrop {background:rgba(0,0,0,.55);}
.folder-dialog h2 {margin:0 0 6px;font-size:18px;}
.folder-dialog-intro {margin:0 0 12px;font-size:12.5px;line-height:1.45;color:var(--muted);}
.folder-dialog-form {display:flex;flex-direction:column;gap:10px;}
.folder-dialog-form .form-field, .folder-dialog-form > div {margin:0;}
.folder-dialog-form label {font-size:13.5px;margin:0 0 4px;}
.folder-dialog-form .form-actions {margin:4px 0 0;display:flex;gap:10px;}
.folder-dialog-form .field-error, .folder-dialog-form .errorlist {color:var(--danger);font-size:12px;margin:4px 0 0;padding:0;list-style:none;}
.folder-dialog-form > *, .folder-dialog-form .form-field {width:100%;max-width:none;box-sizing:border-box;}
.folder-dialog-form input:not([type="checkbox"]):not([type="radio"]), .folder-dialog-form select, .folder-dialog-form textarea {width:100%;box-sizing:border-box;}
.folder-dialog-form .msg {margin:0;padding:8px 10px;font-size:12.5px;}
.folder-dialog-form .form-actions {width:auto;}

/* ======================================================================================
   UI16-P2.4c: column + row grid for fields
   Every simple field (label, control, hint, error) spans four shared rows of its grid
   (subgrid). Labels share a row, controls share a row, hints share a row, so a hint under one
   field can no longer push its neighbour's control out of line. Empty rows take no height.
   Spacing between field rows is padding at the bottom of the field, not a grid gap.
   ====================================================================================== */
.object-editor-form .object-editor-grid {row-gap:0;}
.credential-wide-form {row-gap:0;}
.asset-form-card .asset-form-grid {row-gap:0;}
.object-editor-grid > .object-editor-field,
.credential-wide-form > .form-field,
.asset-form-card .asset-form-grid > .form-field {padding-bottom:var(--d-form-gap);}
@supports (grid-template-rows:subgrid) {
  .object-editor-grid > .object-editor-field:has(> label):not(:has(.record-tags-field, .association-transfer-field)),
  .object-editor-grid > .object-editor-field:has(> .toggle-row),
  .credential-wide-form > .form-field:has(> label),
  .asset-form-card .asset-form-grid > .form-field:has(> label):not(:has(.record-tags-field)) {
    display:grid;grid-row:span 4;grid-template-rows:subgrid;row-gap:0;align-content:start;
  }
  .object-editor-grid > .object-editor-field:has(> .toggle-row) > .toggle-row {grid-row:2;align-self:center;}
  /* a label never stretches its row; hints and errors sit tight under the control */
  .object-editor-grid > .object-editor-field > label,
  .credential-wide-form > .form-field > label,
  .asset-form-card .asset-form-grid > .form-field > label {align-self:end;}
}

/* ======================================================================================
   UI16-P2.4e: header-bar cards (style B)
   Each section is a card with a tinted title strip and a step number. Notices without fields
   are slim, unnumbered cards. Two columns still only appear when one column would scroll.
   ====================================================================================== */
.object-editor-form {counter-reset:ui16sec;}
html .object-editor-form > .object-editor-section {
  background:var(--panel);border:1px solid var(--line);border-radius:10px;overflow:hidden;
  padding:0 var(--d-card-pad) 2px;margin-bottom:calc(var(--d-form-gap) + 2px);counter-increment:ui16sec;
}
html .object-editor-form > .object-editor-section > h2 {
  display:flex;align-items:center;gap:10px;margin:0 calc(var(--d-card-pad) * -1) 12px;padding:9px var(--d-card-pad);
  font-size:13px;line-height:1.3;letter-spacing:.06em;text-transform:uppercase;color:var(--text-medium);
  background:var(--panel2);border-bottom:1px solid var(--line);
}
html .object-editor-form > .object-editor-section > h2::before {
  content:counter(ui16sec);flex:none;width:20px;height:20px;border-radius:50%;background:var(--accent);color:#0b1020;
  font-size:11px;font-weight:800;letter-spacing:0;display:grid;place-items:center;
}
html .object-editor-form > .object-editor-section:not(:has(.object-editor-grid, input, select, textarea, button)) {
  counter-increment:none;padding:9px var(--d-card-pad);
}
html .object-editor-form > .object-editor-section:not(:has(.object-editor-grid, input, select, textarea, button)) > h2 {
  margin:0 0 3px;padding:0;background:transparent;border:0;font-size:13.5px;letter-spacing:0;text-transform:none;color:var(--text);
}
html .object-editor-form > .object-editor-section:not(:has(.object-editor-grid, input, select, textarea, button)) > h2::before {display:none;}
html .object-editor-grid > .object-editor-field:has(.record-tags-field) + .object-editor-field:has(.record-tags-field) {border-top:0;padding-top:0;}
/* assets + credentials: one card, no card inside it for tags */
html .asset-form-card .asset-form-grid .record-tags-field,
html .credential-wide-form .record-tags-field {border:0;padding:0;border-radius:0;background:transparent;}

/* ===== UI16-P3 theme module (profile card, fonts, non-default theme overrides) ===== */
.profile-side-stack{display:grid;gap:16px;min-width:0}
.profile-theme-card{display:grid;gap:10px}
.profile-theme-card h2{margin:0;font-size:15px}
.theme-custom{display:grid;gap:6px;padding:8px;border:1px solid var(--line);border-radius:9px}
.theme-custom[hidden]{display:none}
.theme-color-row{display:grid;grid-template-columns:minmax(0,1fr) 38px 64px;gap:8px;align-items:center}
.theme-color-name{display:grid;font-size:13px;font-weight:650;color:var(--text-medium)}
.theme-color-name small{font-weight:400;font-size:11px;color:var(--muted)}
.theme-color-row input[type=color]{width:38px;height:28px;padding:0;border:1px solid var(--line-light);border-radius:6px;background:none;cursor:pointer}
.theme-color-hex{font-size:11.5px;color:var(--muted)}
.theme-font-row{font-size:13px;font-weight:650;color:var(--text-medium)}
.theme-error[hidden]{display:none}

/* fonts: only when the user picked one */
html[data-font="arial"] body,html[data-font="arial"] input,html[data-font="arial"] select,html[data-font="arial"] textarea,html[data-font="arial"] button{font-family:Arial, "Helvetica Neue", Helvetica, sans-serif}
html[data-font="sans"] body,html[data-font="sans"] input,html[data-font="sans"] select,html[data-font="sans"] textarea,html[data-font="sans"] button{font-family:system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif}
html[data-font="ubuntu"] body,html[data-font="ubuntu"] input,html[data-font="ubuntu"] select,html[data-font="ubuntu"] textarea,html[data-font="ubuntu"] button{font-family:"Ubuntu Sans", Ubuntu, "Ubuntu Mono", "DejaVu Sans", sans-serif}
html[data-font="cambria"] body,html[data-font="cambria"] input,html[data-font="cambria"] select,html[data-font="cambria"] textarea,html[data-font="cambria"] button{font-family:Cambria, Georgia, "Times New Roman", serif}
html[data-font="times"] body,html[data-font="times"] input,html[data-font="times"] select,html[data-font="times"] textarea,html[data-font="times"] button{font-family:"Times New Roman", Times, serif}

/* non-default themes: replace the colors the stylesheet hard-codes */
html:not([data-theme="default"]) .button.secondary,
html:not([data-theme="default"]) button.secondary{background:var(--panel2);color:var(--text);border-color:var(--line-light)}
/* themed dashboard + topbar (these use hard-coded slate/amber colors in the default look) */
html:not([data-theme="default"]) .brand a,
html:not([data-theme="default"]) .top-link:hover,
html:not([data-theme="default"]) .top-link.active{color:var(--text)}
html:not([data-theme="default"]) .global-summary-card{
    background:linear-gradient(135deg,color-mix(in srgb,var(--hl) 9%,var(--panel)),var(--panel) 42%);
    border-color:color-mix(in srgb,var(--hl) 42%,var(--line));box-shadow:none}
html:not([data-theme="default"]) .global-summary-card::before{background:var(--hl)}
html:not([data-theme="default"]) .global-summary-title,
html:not([data-theme="default"]) .global-stat strong{color:var(--hl)}
html:not([data-theme="default"]) .global-summary-section{border-top-color:var(--line)}
html:not([data-theme="default"]) .global-summary-section-head h3{color:var(--text)}
html:not([data-theme="default"]) .global-stat{border-bottom-color:var(--line)}
html:not([data-theme="default"]) .global-stat span,
html:not([data-theme="default"]) .organization-card-counter,
html:not([data-theme="default"]) .organization-card-counter span{color:var(--muted)}
html:not([data-theme="default"]) .global-stat.is-zero strong,
html:not([data-theme="default"]) .organization-card-counter.is-zero strong{color:var(--muted)}
html:not([data-theme="default"]) .organization-card{
    background:linear-gradient(180deg,color-mix(in srgb,var(--org-color) 9%,var(--panel)),var(--panel) 70%);
    border-color:color-mix(in srgb,var(--org-color) 42%,var(--line));box-shadow:none}
html:not([data-theme="default"]) .organization-card > strong,
html:not([data-theme="default"]) .organization-card-counter strong{color:var(--text)}
html:not([data-theme="default"]) .organization-card-counters{border-top-color:color-mix(in srgb,var(--org-color) 24%,var(--line))}
html:not([data-theme="default"]) .org-name,
html:not([data-theme="default"]) .org-nav a:hover,
html:not([data-theme="default"]) .org-nav a.active,
html:not([data-theme="default"]) .metrics b,
html:not([data-theme="default"]) .metric-card b,
html:not([data-theme="default"]) .card strong,
html:not([data-theme="default"]) .module-row-main strong,
html:not([data-theme="default"]) .role-summary-card strong,
html:not([data-theme="default"]) .breadcrumbs strong,
html:not([data-theme="default"]) .document-editor-tool:hover,
html:not([data-theme="default"]) .document-editor-tool.active{color:var(--text)}
html:not([data-theme="default"]) .org-nav a.active{background:color-mix(in srgb,var(--accent) 16%,var(--panel))}
html:not([data-theme="default"]) .org-nav-group[open] > summary{background:var(--panel2)}
html:not([data-theme="default"]) .nav-count{background:var(--surface);color:var(--muted)}
html:not([data-theme="default"]) .org-nav a.active .nav-count{color:var(--text);border-color:var(--accent)}
html:not([data-theme="default"]) .org-nav-label{color:var(--hl)}
html:not([data-theme="default"]) .org-nav-submenu > a{color:var(--text-soft)}
html:not([data-theme="default"]) .button.danger,
html:not([data-theme="default"]) button.danger{color:#ffffff}
html:not([data-theme="default"]) .module-view-menu,
html:not([data-theme="default"]) .module-panel-head{background:var(--panel2);color:var(--text)}
html:not([data-theme="default"]) .module-table-heading{background:var(--panel2);color:var(--text-medium)}
html:not([data-theme="default"]) .module-table-actions-heading{background:var(--panel2) !important;color:var(--text-medium)}
html:not([data-theme="default"]) .module-secret-tooltip,
html:not([data-theme="default"]) .copy-toast{background:var(--panel2);color:var(--text);border:1px solid var(--line-light)}

/* ===== UI17 password generator (credential form) ===== */
.pwgen-row{display:flex;gap:8px;align-items:stretch}
.pwgen-row > input{flex:1;min-width:0}
.pwgen-toggle{white-space:nowrap}
.pwgen-panel{position:absolute;z-index:30;left:0;top:100%;margin-top:6px;width:min(430px,100%);min-width:min(340px,100%);padding:12px;border:1px solid var(--line-light);border-radius:10px;background:var(--panel);box-shadow:0 14px 36px rgba(0,0,0,.45);display:grid;gap:10px}
.pwgen-panel[hidden]{display:none}
.pwgen-modes{display:flex;gap:16px;font-size:13px;color:var(--text-medium)}
.pwgen-modes label,.pwgen-check{display:inline-flex;align-items:center;gap:6px;cursor:pointer}
.pwgen-modes input,.pwgen-check input{width:auto;margin:0}
.pwgen-panel button:disabled{opacity:.45;cursor:not-allowed}
.pwgen-preview{display:flex;gap:6px}
.pwgen-preview input{flex:1;min-width:0;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:14px}
.pwgen-meter{font-size:12px;color:var(--muted)}
.pwgen-opts{display:grid;grid-template-columns:1fr 1fr;gap:8px 14px;align-items:center;font-size:13px;color:var(--text-medium)}
.form-field .pwgen-panel .pwgen-len{grid-column:1/-1;display:grid !important;grid-template-columns:auto 1fr 64px;gap:10px;align-items:center}
.form-field .pwgen-panel .pwgen-len input[type=range]{width:100%;padding:0;min-width:0}
.form-field .pwgen-panel .pwgen-len input[type=number],.form-field .pwgen-panel .pwgen-spec input{width:64px}
.form-field .pwgen-panel .pwgen-spec{display:flex !important;align-items:center;gap:8px;justify-content:flex-start}
.pwgen-actions{display:flex;gap:8px;flex-wrap:wrap}

/* ===== UI17 quick-card generator icon + dialog ===== */
.ui17-pw-quick{display:inline-grid;place-items:center;width:26px;height:26px;padding:0;border:1px solid var(--line-light);border-radius:7px;background:var(--panel2);color:var(--text-medium);cursor:pointer}
.ui17-pw-quick:hover,.ui17-pw-quick:focus-visible{color:var(--text);border-color:var(--accent)}
.pwgen-dialog{width:min(440px,94vw);padding:16px;border:1px solid var(--line-light);border-radius:12px;background:var(--panel);color:var(--text);box-shadow:0 20px 50px rgba(0,0,0,.5)}
.pwgen-dialog::backdrop{background:rgba(0,0,0,.55)}
.pwgen-dialog h2{margin:0 0 10px;font-size:16px}
.pwgen-dialog .pwgen-panel-static{position:static;display:grid;width:auto;min-width:0;margin:0;padding:0;border:0;box-shadow:none;background:none}
.pwgen-dialog .pwgen-len{display:grid !important;grid-column:1/-1;grid-template-columns:auto 1fr 64px;gap:10px;align-items:center}
.pwgen-dialog .pwgen-len input[type=range]{width:100%;padding:0;min-width:0}
.pwgen-dialog .pwgen-len input[type=number],.pwgen-dialog .pwgen-spec input{width:64px}
.pwgen-dialog .pwgen-modes input,.pwgen-dialog .pwgen-check input{width:auto;margin:0}
.pwgen-dialog .pwgen-spec{display:flex !important;align-items:center;gap:8px}
.pwgen-help{margin:10px 0 0;font-size:12px;color:var(--muted)}
.pwgen-note{display:block;margin-top:3px;font-size:11.5px;color:var(--hl,#f59e0b)}

/* ---- UI17 modal object forms: timeline of sections (modal-form.js) ---- */
.mf-form, form.mf-form.asset-form-grid, form.mf-form.credential-wide-form { display: flex !important; flex-direction: column; gap: 0; column-count: auto; }
.mf-form > .mf-shell, .mf-form > .mf-foot { width: 100%; box-sizing: border-box; }
.mf-active main > .page-head { display: none; }
.mf-shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); height: 430px; border: 1px solid var(--line, #d8dee9); border-radius: 12px; overflow: hidden; background: var(--panel, #fff); }
.mf-rail { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 16px 12px; background: var(--panel2, #f8fafc); border-right: 1px solid var(--line, #d8dee9); overflow-y: auto; }
.mf-rail::before { content: ""; position: absolute; left: 31px; top: 30px; bottom: 30px; width: 2px; background: var(--line, #d8dee9); }
.mf-step { position: relative; display: flex; width: 100%; justify-content: flex-start; box-shadow: none; min-height: 0; align-items: center; gap: 10px; padding: 8px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--text-medium, #475569); text-align: left; cursor: pointer; font: inherit; }
.mf-step:hover { background: var(--line-light, #eef2f7); }
.mf-num { position: relative; z-index: 1; flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface, #fff); border: 2px solid var(--line, #cbd5e1); color: var(--muted, #64748b); }
.mf-steptext { display: flex; flex-direction: column; min-width: 0; }
.mf-steptitle { font-weight: 600; font-size: 13px; color: var(--text, #0f172a); }
.mf-stepsub { font-size: 11px; color: var(--muted, #64748b); }
.mf-step.mf-current { background: var(--surface, #fff); box-shadow: inset 0 0 0 1px var(--accent, #2563eb); }
.mf-step.mf-current .mf-num { background: var(--accent, #2563eb); border-color: var(--accent, #2563eb); color: var(--on-accent, #fff); }
.mf-step.mf-done .mf-num { background: var(--hl, #f59e0b); border-color: var(--hl, #f59e0b); color: var(--on-accent, #fff); }
.mf-step.mf-warn .mf-num { background: #dc2626; border-color: #dc2626; color: #fff; }
.mf-step.mf-warn .mf-stepsub { color: #dc2626; }
.mf-pane { min-width: 0; overflow-y: auto; padding: 18px 22px; }
.mf-section { display: none; border: 0 !important; box-shadow: none !important; background: transparent !important; padding: 0 !important; margin: 0 !important; }
.mf-section.mf-on { display: block; }
.mf-title { margin: 0 0 4px; font-size: 16px; }
.mf-desc { margin: 0 0 14px; color: var(--muted, #64748b); font-size: 13px; }
.mf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.mf-grid > .wide, .mf-grid > .form-field--wide, .mf-grid > .asset-macs-section, .mf-grid > [data-credential-field="notes"], .mf-grid > [data-asset-field="notes"] { grid-column: 1 / -1; }
.mf-foot .button, .mf-foot a.button { min-height: 0; }
.mf-foot { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding-top: 12px; }
.mf-hint { margin-right: auto; font-size: 12px; color: var(--muted, #64748b); }
.mf-hint kbd { font: inherit; font-size: 11px; padding: 1px 6px; border: 1px solid var(--line, #cbd5e1); border-bottom-width: 2px; border-radius: 5px; background: var(--surface, #fff); color: var(--text, #0f172a); }
.mf-next[hidden] { display: none; }
@media (max-width: 640px) {
  .mf-shell { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); height: min(520px, 75vh); }
  .mf-rail { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line, #d8dee9); padding: 8px; overflow-x: auto; }
  .mf-rail::before { display: none; }
  .mf-stepsub { display: none; }
  .mf-grid { grid-template-columns: 1fr; }
}

.mf-form .ui16-fw-cols:not(:has(*)) { display: none; }
.mf-grid > .record-tags-field { grid-column: 1 / -1; }

/* ---- Scripting module (full-page editor) -------------------------------- */
.script-form{display:flex;flex-direction:column;gap:10px;margin-top:6px}
.script-meta{display:grid;grid-template-columns:minmax(200px,1fr) minmax(200px,1fr) minmax(260px,2fr);gap:12px}
.script-meta label{display:block;margin-bottom:4px}
.script-meta textarea{min-height:0;height:38px;resize:vertical}
.script-toolbar{display:flex;align-items:flex-end;flex-wrap:wrap;gap:10px;padding:8px 10px;background:var(--panel2);border:1px solid var(--line);border-radius:10px 10px 0 0;border-bottom:0;margin-top:8px}
.script-tool{display:flex;flex-direction:column;gap:2px;font-size:12px;color:var(--muted)}
.script-tool select{min-width:200px}
.script-tool-spacer{flex:1 1 auto}
.script-check{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--text-soft);margin-bottom:6px;white-space:nowrap}.script-check input{width:auto;margin:0}
.script-fontsize{display:inline-flex;align-items:center;gap:6px;margin-bottom:2px}
.script-fontsize output{min-width:2ch;text-align:center;color:var(--text-soft);font-size:13px}
.script-lang-badge{display:inline-block;padding:4px 10px;border-radius:999px;border:1px solid var(--line-light);color:var(--text-soft);font-size:13px}
.script-editor-frame{height:calc(100vh - 500px);min-height:320px;border:1px solid var(--line);border-radius:0 0 10px 10px;overflow:hidden;background:var(--surface)}
.script-editor-frame .cm-editor{height:100%}
.script-compare-frame{border-radius:10px;height:calc(100vh - 330px)}
.script-compare-heads{display:grid;grid-template-columns:1fr 1fr;gap:12px;font-size:13px;color:var(--muted);margin:4px 2px}
.script-footer{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;font-size:12px;color:var(--muted)}
.script-status.is-over{color:var(--danger)}
.script-description{color:var(--text-soft);margin:0 0 10px}
@media (max-width:1100px){.script-meta{grid-template-columns:1fr 1fr}.script-field-desc{grid-column:1 / -1}}
@media (max-width:760px){.script-meta{grid-template-columns:1fr}.script-editor-frame{height:60vh}}
.script-toolbar .button.secondary{border:1px solid var(--line-light)}

/* Scripting folders */
.script-folders .module-panel-head{align-items:center;flex-wrap:wrap;gap:10px}
.script-folder-list{list-style:none;margin:0;padding:0}
.script-folder-row{display:flex;align-items:center;gap:14px;flex-wrap:wrap;padding:10px 20px;border-top:1px solid var(--line)}
.script-folder-name{display:inline-flex;align-items:center;gap:8px;min-width:200px;color:var(--text);text-decoration:none}
.script-folder-meta{color:var(--muted);font-size:13px;flex:1 1 auto}
.script-folder-empty{padding:14px 20px;margin:0}
.script-folder-archived{padding:6px 0 0;border-top:1px solid var(--line)}
.script-folder-archived summary{cursor:pointer;padding:8px 20px;color:var(--muted);font-size:13px}

/* Scripting: drag a script onto a folder */
tr[data-script-id][draggable="true"]{cursor:grab}
tr[data-script-id].is-dragging{opacity:.45}
.script-folder-row.is-drop-ready,.breadcrumbs a[data-script-drop].is-drop-ready{outline:1px dashed var(--line-light);outline-offset:-2px}
.script-folder-row.is-drop-target{background:color-mix(in srgb,var(--accent) 22%,transparent);outline:2px solid var(--accent);outline-offset:-2px}
.breadcrumbs a[data-script-drop].is-drop-target{background:color-mix(in srgb,var(--accent) 28%,transparent);border-radius:4px;outline:2px solid var(--accent)}
.script-drag-status{padding:8px 20px;font-size:13px;color:var(--text-soft)}
.script-drag-status.is-error{color:var(--danger)}

/* Email / SMTP page: tighter spacing and a checkbox that lines up with the other controls. */
form.form-card.smtp-form:has(> .form-field) {gap:8px 18px;padding:16px 20px;}
.smtp-form .form-field label:not(.smtp-check) {margin-bottom:5px;}
.smtp-form .form-field .helptext {margin-top:4px;line-height:1.35;}
.smtp-form .form-actions {margin-top:6px;}
.smtp-check-field .smtp-check-spacer {visibility:hidden;pointer-events:none;}
.smtp-check-field .smtp-check {display:flex;align-items:center;gap:10px;box-sizing:border-box;min-height:38px;margin:0;padding:0 12px;border:1px solid var(--line);border-radius:8px;cursor:pointer;font-weight:600;}
.smtp-check-field .smtp-check input[type="checkbox"] {flex:0 0 auto;width:16px;height:16px;min-width:0;margin:0;padding:0;background:transparent;box-shadow:none;cursor:pointer;}
.smtp-check-field .smtp-check span {line-height:1.2;}
.smtp-state {gap:12px;}
.smtp-state .secret-card {padding:14px 18px;gap:2px;}
.smtp-state .secret-card label {margin:8px 0 2px;}
.smtp-state .secret-card label:first-child {margin-top:0;}
.smtp-state .secret-card code {padding:8px 12px;font-size:14px;}

/* ===== UI18 custom-theme completeness =====
   Everything below makes colors that were hard-coded for the shipped dark-blue look follow the theme
   palette. In the Default theme --accent/--text/--accent-soft/--link-soft hold the shipped values, so
   the Default look is unchanged. */
:root{--ac-tint:color-mix(in srgb,var(--accent) 10%,transparent);--ac-tint-lo:color-mix(in srgb,var(--accent) 7%,transparent);--ac-line:color-mix(in srgb,var(--accent) 50%,transparent);--tx-stripe:color-mix(in srgb,var(--text) 2%,transparent);--tx-stripe-lo:color-mix(in srgb,var(--text) 1.4%,transparent)}
/* native controls follow the palette (checkbox/radio color, scrollbars, file button) */
input[type="checkbox"],input[type="radio"],input[type="range"],progress{accent-color:var(--accent)}
html:not([data-theme="default"]){scrollbar-color:var(--line-light) var(--chrome)}
html:not([data-theme="default"]) input[type="file"]::file-selector-button{background:var(--panel2);color:var(--text);border:1px solid var(--line-light);border-radius:6px;padding:6px 12px;margin-right:10px;font:inherit;font-weight:600;cursor:pointer}
html:not([data-theme="default"]) input[type="file"]::file-selector-button:hover{border-color:var(--accent)}
html:not([data-theme="default"]) ::selection{background:color-mix(in srgb,var(--accent) 35%,transparent);color:inherit}
/* focus rings and glows */
.mfa-reset-disabled:focus-visible,.protected-user:focus-visible,.toggle-row input[type="checkbox"]:focus-visible + .toggle-switch{outline-color:var(--accent)}
input:focus,textarea:focus,select:focus{box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 12%,transparent)}
.document-editor-canvas:focus{box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 12%,transparent)}
/* hover / selected tints */
.organization-checkbox-list label:hover,.organization-dashboard-option:hover,.ui16-org-pin-add:hover,.ui16-org-pin-add:focus-visible{background:var(--ac-tint-lo)}
.module-secret-action:hover,.module-secret-action:focus-visible,.organization-dashboard-summary-hover:hover,.organization-dashboard-summary-hover:focus-visible,.record-value-copy:hover,.record-value-copy:focus-visible,.credential-click-copy:hover,.credential-click-copy:focus-visible{background:var(--ac-tint)}
.credential-movable-row.is-selected,.tags-org-table tr.is-current{background:var(--ac-tint-lo)}
.credential-folder-row.is-drop-target{outline-color:var(--accent-soft) !important;background:var(--ac-tint)}
body.credential-dragging .credential-folder-row[data-drop-folder]{outline-color:color-mix(in srgb,var(--accent-soft) 55%,transparent)}
.tags-mode-option.is-current,.density-choice.is-active{border-color:var(--accent)}
.density-option.is-active,.density-choice.is-active{background:var(--ac-tint-lo)}
.density-option.is-active::before,.ui16-fw-sortpanel button[aria-checked="true"]::before{color:var(--accent-soft)}
/* pinned-organization chips and shortcuts */
.ui16-org-pin,.ui16-chip{border-color:var(--ac-line);background:color-mix(in srgb,var(--accent) 14%,transparent);color:var(--link-soft)}
.ui16-org-pin:hover,.ui16-org-pin:focus-visible{background:color-mix(in srgb,var(--accent) 30%,transparent);border-color:var(--accent-soft)}
.ui16-org-pin-add,.ui16-chip small,.ui16-chip-add{color:var(--accent-soft)}
.ui16-org-pin-add:hover,.ui16-org-pin-add:focus-visible{color:var(--link-soft)}
.ui16-pin-short{border-color:color-mix(in srgb,var(--accent) 45%,transparent);color:var(--link-soft)}
/* row stripes were white-on-dark; follow the text color so light palettes get a dark tint */
.dashboard .module table tr:nth-child(even){background:var(--tx-stripe-lo)}
tbody tr:nth-child(even){background:var(--tx-stripe-lo)}
.favorite-list-row:hover{background:var(--tx-stripe)}
.favorites-page-list > .favorite-list-row,.ui16-fw-row{background:var(--tx-stripe)}
.favorites-toolbar-item{border-bottom-color:color-mix(in srgb,var(--text) 5%,transparent)}
.archived-row{background:color-mix(in srgb,var(--muted) 5%,transparent)}
/* text that was fixed white */
.organization-metrics .metric-card b,.document-editor-tool:hover,.document-editor-tool:focus-visible,.document-editor-tool.active{color:var(--text)}
/* highlight-colored badges */
.favorites-toolbar-head .favorites-toolbar-count,.ui16-set-on-firewall{background:color-mix(in srgb,var(--hl,#e9b949) 20%,transparent);color:var(--hl,#e9b949)}
.theme-error.is-note{background:color-mix(in srgb,var(--hl) 14%,transparent);border-color:color-mix(in srgb,var(--hl) 55%,transparent);color:var(--text)}

/* ===== UI19 theme drop-down, editor and sharing ===== */
.theme-swatches{display:inline-flex;height:18px;width:84px;flex:none;border-radius:5px;overflow:hidden;border:1px solid rgba(128,128,128,.45)}
.theme-swatches i{flex:1;display:block}
.theme-select{position:relative}
.theme-select-button{display:flex;align-items:center;gap:10px;width:100%;padding:7px 10px;border:1px solid var(--line-light);border-radius:8px;background:var(--panel2);color:var(--text);font:inherit;font-weight:650;cursor:pointer;text-align:left}
.theme-select-button:focus-visible,.theme-select-option:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.theme-select-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.theme-select-caret{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:6px solid currentColor;opacity:.7}
.theme-select-list{position:absolute;z-index:30;left:0;right:0;top:calc(100% + 4px);max-height:320px;overflow:auto;margin:0;padding:4px;list-style:none;border:1px solid var(--line-light);border-radius:8px;background:var(--panel);box-shadow:0 10px 28px rgba(0,0,0,.35)}
.theme-select-list[hidden]{display:none}
.theme-select-group{padding:6px 8px 2px;font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
.theme-select-option{display:flex;align-items:center;gap:10px;padding:6px 8px;border-radius:6px;cursor:pointer;color:var(--text)}
.theme-select-option:hover,.theme-select-option:focus{background:var(--panel2)}
.theme-select-option[aria-selected=true]{box-shadow:inset 0 0 0 2px var(--accent)}
.theme-select-option small{color:var(--muted);font-size:11px;white-space:nowrap}
.theme-kind-note:empty{display:none}
.theme-editor{display:grid;gap:8px}
.theme-editor[hidden],.theme-recipients[hidden],.theme-recipient-results[hidden]{display:none}
.theme-field-label{font-size:13px;font-weight:650;color:var(--text-medium)}
.theme-share{display:grid;gap:6px;margin:0;padding:8px;border:1px solid var(--line);border-radius:9px}
.theme-share legend{padding:0 4px;font-size:13px;font-weight:650;color:var(--text-medium)}
.theme-share label{display:flex;align-items:center;gap:6px;font-size:13px}
.theme-recipients{display:grid;gap:6px}
.theme-recipient-results{margin:0;padding:4px;list-style:none;max-height:160px;overflow:auto;border:1px solid var(--line-light);border-radius:8px;background:var(--panel2)}
.theme-recipient-results button{width:100%;text-align:left;padding:5px 8px;border:0;border-radius:5px;background:none;color:var(--text);font:inherit;cursor:pointer}
.theme-recipient-results button:hover,.theme-recipient-results button:focus-visible{background:var(--panel)}
.theme-recipient-chips{display:flex;flex-wrap:wrap;gap:6px;margin:0;padding:0;list-style:none}
.theme-recipient-chips li{display:inline-flex;align-items:center;gap:4px;padding:2px 4px 2px 9px;border:1px solid var(--line-light);border-radius:999px;font-size:12.5px;background:var(--panel2)}
.theme-chip-x{border:0;background:none;color:var(--muted);font-size:16px;line-height:1;cursor:pointer;padding:0 4px}
.theme-actions{flex-wrap:wrap}
.theme-actions [hidden],.theme-editor [hidden]{display:none!important}
.theme-share label{justify-content:flex-start;text-align:left}
.theme-share input[type=radio]{width:auto;min-width:0;height:auto;margin:0;padding:0;flex:none;accent-color:var(--accent)}

/* ===== UI19 extra palette colors: banner, danger (muted and secondary flow through --muted / --accent-soft / --link-soft) ===== */
html:not([data-theme="default"]) .topbar{background:var(--chrome);border-bottom-color:color-mix(in srgb,var(--banner-fg) 18%,var(--chrome))}
html:not([data-theme="default"]) .topbar .brand a,
html:not([data-theme="default"]) .topbar .top-link:hover,
html:not([data-theme="default"]) .topbar .top-link.active{color:var(--banner-fg)}
html:not([data-theme="default"]) .topbar .top-link,
html:not([data-theme="default"]) .topbar .user-chip,
html:not([data-theme="default"]) .topbar .brand span{color:var(--banner-fg-soft)}
html:not([data-theme="default"]) .topbar .top-link:hover,
html:not([data-theme="default"]) .topbar .top-link.active{background:color-mix(in srgb,var(--banner-fg) 12%,var(--chrome))}
html:not([data-theme="default"]) .topbar .user-chip{background:color-mix(in srgb,var(--banner-fg) 8%,var(--chrome));border-color:color-mix(in srgb,var(--banner-fg) 22%,var(--chrome))}
html:not([data-theme="default"]) .topbar .linkbtn{color:var(--banner-fg)}
html:not([data-theme="default"]) .button.danger,
html:not([data-theme="default"]) button.danger{background:var(--danger-solid);color:#fff;border-color:var(--danger-solid)}
html:not([data-theme="default"]) .button.danger:hover,
html:not([data-theme="default"]) button.danger:hover{background:var(--danger-hover);color:#fff}
html:not([data-theme="default"]) .danger-notice{background:color-mix(in srgb,var(--danger) 12%,var(--panel));border-color:color-mix(in srgb,var(--danger) 45%,var(--line))}
html:not([data-theme="default"]) .danger-notice strong{color:var(--danger)}
html:not([data-theme="default"]) .danger-notice span{color:var(--text-soft)}
html:not([data-theme="default"]) .theme-error:not(.is-note),html:not([data-theme="default"]) .errorlist,html:not([data-theme="default"]) .field-error{color:var(--danger)}
.theme-swatches{width:70px}
.theme-custom{max-height:none}
html:not([data-theme="default"]) .topbar .density-menu-button,html:not([data-theme="default"]) .topbar summary{color:var(--banner-fg-soft)}

/* UI19 theme-matched fonts */
html[data-font="antique"] body,html[data-font="antique"] input,html[data-font="antique"] select,html[data-font="antique"] textarea,html[data-font="antique"] button{font-family:"Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, serif}
html[data-font="block"] body,html[data-font="block"] input,html[data-font="block"] select,html[data-font="block"] textarea,html[data-font="block"] button{font-family:Impact, "Arial Black", Haettenschweiler, "Franklin Gothic Heavy", sans-serif}
html[data-font="future"] body,html[data-font="future"] input,html[data-font="future"] select,html[data-font="future"] textarea,html[data-font="future"] button{font-family:Orbitron, Eurostile, "Bank Gothic", Bahnschrift, "Segoe UI", "Trebuchet MS", sans-serif}
html[data-font="typewriter"] body,html[data-font="typewriter"] input,html[data-font="typewriter"] select,html[data-font="typewriter"] textarea,html[data-font="typewriter"] button{font-family:"American Typewriter", "Courier New", Courier, "Nimbus Mono PS", monospace}
html[data-font="bubble"] body,html[data-font="bubble"] input,html[data-font="bubble"] select,html[data-font="bubble"] textarea,html[data-font="bubble"] button{font-family:"Arial Rounded MT Bold", "Varela Round", Nunito, "Comic Sans MS", "Chalkboard SE", "Trebuchet MS", sans-serif}
html[data-font="western"] body,html[data-font="western"] input,html[data-font="western"] select,html[data-font="western"] textarea,html[data-font="western"] button{font-family:Rockwell, Clarendon, "Bookman Old Style", "Roboto Slab", Georgia, serif}
html[data-font="elegant"] body,html[data-font="elegant"] input,html[data-font="elegant"] select,html[data-font="elegant"] textarea,html[data-font="elegant"] button{font-family:Didot, "Bodoni MT", "Bodoni 72", "Playfair Display", "Hoefler Text", "Times New Roman", serif}
html[data-font="console"] body,html[data-font="console"] input,html[data-font="console"] select,html[data-font="console"] textarea,html[data-font="console"] button{font-family:Consolas, "Lucida Console", Menlo, "DejaVu Sans Mono", "Courier New", monospace}
html[data-font="hand"] body,html[data-font="hand"] input,html[data-font="hand"] select,html[data-font="hand"] textarea,html[data-font="hand"] button{font-family:"Segoe Print", "Bradley Hand", "Comic Sans MS", "Chalkboard SE", "Marker Felt", cursive}
html[data-font="condensed"] body,html[data-font="condensed"] input,html[data-font="condensed"] select,html[data-font="condensed"] textarea,html[data-font="condensed"] button{font-family:"Arial Narrow", "Franklin Gothic Medium Cond", "Roboto Condensed", "Helvetica Neue Condensed", "Liberation Sans Narrow", sans-serif}

/* UI19 profile layout hardening: wide theme fonts (Handwritten, Console, Block...) must never push the left column over the form cards */
.profile-layout{grid-template-columns:minmax(240px,300px) minmax(0,1fr)}
.profile-layout>*{min-width:0}
.profile-side-stack{grid-template-columns:minmax(0,1fr)}
.profile-side-stack>*{min-width:0;max-width:100%;overflow-wrap:anywhere}
.profile-theme-card{grid-template-columns:minmax(0,1fr)}
.profile-theme-card>*{min-width:0}
.profile-theme-card select,.profile-theme-card input[type=text],.profile-theme-card input[type=search]{min-width:0;max-width:100%}
.profile-summary-card .button,.profile-summary-actions .button{white-space:normal;max-width:100%}
.theme-share{min-width:0}
.theme-select-button{min-width:0}
.theme-color-name{min-width:0;overflow-wrap:anywhere}

/* ===== UI19 IP Control: client IP detection panel ===== */
.ip-detect-panel{margin:0 0 16px}
.ip-detect-panel.ip-detect-untrusted_proxy{border-color:var(--danger,#ff7b86)}
.ip-detect-panel.ip-detect-untrusted_proxy .module-panel-head span{color:var(--danger,#ff7b86)}
.ip-detect-panel.ip-detect-ok_proxy .module-panel-head span{color:var(--accent)}
.ip-detect-facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px 18px;margin:0;padding:0 16px 12px}
.ip-detect-facts div{min-width:0}
.ip-detect-facts dt{font-size:11.5px;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}
.ip-detect-facts dd{margin:3px 0 0;overflow-wrap:anywhere}
.ip-detect-help{margin:0;padding:0 16px 10px;font-size:13px;color:var(--text-soft);line-height:1.5}
.ip-detect-code{margin:0 16px 10px;padding:9px 12px;border:1px solid var(--line);border-radius:8px;background:var(--surface);overflow-x:auto;user-select:all}
.ip-status-item button[disabled]{opacity:.5;cursor:not-allowed}
