@font-face { font-family: 'Pebi Sans'; src: url('brand/pebitech/fonts/public-sans-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Pebi Sans'; src: url('brand/pebitech/fonts/public-sans-600.woff2') format('woff2'); font-weight: 500 900; font-display: swap; }
@font-face { font-family: 'Pebi Display'; src: url('brand/pebitech/fonts/bricolage-grotesque-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
:root {
  color-scheme: light;
  --bg: #fcfcfd;
  --panel: #ffffff;
  --panel-2: #f1f4f8;
  --line: #dfe5ee;
  --text: #243044;
  --muted: #526079;
  --accent: #bd4c3b;
  --good: #19633e;
  --warn: #805409;
  --bad: #aa2436;
  --brand-navy: #202e48;
  --brand-peach: #fff0e9;
  --brand-blue: #eef3fa;
  --shadow: 0 4px 14px #24304408;
}
/* A consistent hierarchy across forms, help and command results. */
.portal-help { border: 1px solid var(--line); border-radius: 14px; margin: 14px 0; background: var(--panel); }
.portal-help > summary { cursor: pointer; padding: 16px 18px; font-weight: 600; color: var(--text); }
.portal-help > .panel { border: 0; margin: 0; box-shadow: none; padding-top: 0; }
.portal-help[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.portal-help > summary:focus-visible, .command-history-archive > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.panel { line-height: 1.55; }
.topbar { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.topbar-titles p { max-width: 72ch; }
.form-grid, .row { row-gap: 16px; }
.btn { min-height: 42px; }
.portal-help > p { margin: 0; padding: 0 18px 18px; }
.main { max-width: 1800px; width: 100%; margin-inline: auto; }
.card .stat { margin-top: 8px; letter-spacing: -0.03em; }
.card > .muted:first-child { font-size: 13px; font-weight: 600; }
.side .brand { padding: 4px 8px 16px; border-bottom: 1px solid var(--line); }
.nav-btn { transition: background-color .15s ease, color .15s ease; }
.nav-btn.active { box-shadow: inset 3px 0 var(--accent); }
.table-panel { margin-top: 14px; }
@media (prefers-reduced-motion: reduce) { .nav-btn { transition: none; } }
* { box-sizing: border-box; }
.endpoint-card { margin: 12px 0; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; }
.endpoint-card-summary {
  display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1.2fr) minmax(0,1fr) minmax(0,1fr);
  gap: 18px; align-items: center; cursor: pointer; list-style: none; padding: 18px 44px 18px 18px; position: relative;
}
.endpoint-card-summary::-webkit-details-marker { display: none; }
.endpoint-card-summary::after { content: ''; position: absolute; right: 20px; top: 28px; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); }
.endpoint-card[open] > .endpoint-card-summary::after { transform: rotate(225deg); }
.endpoint-card-summary > span { min-width: 0; overflow-wrap: anywhere; }
.endpoint-summary-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.endpoint-card-summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.endpoint-card[open] > .endpoint-card-summary { border-bottom: 1px solid var(--line); }
.endpoint-card-body { padding: 0 16px 16px; }
.endpoint-card-body .table-panel { border: 0; padding: 0; margin-top: 0; }
@media (max-width: 720px) { .endpoint-card-summary { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; } }
@media (max-width: 380px) { .endpoint-card-summary { grid-template-columns: minmax(0,1fr); } }
.command-history h3 { font-size: 16px; margin: 18px 0 12px; }
.command-history h3 small { font-size: 12px; font-weight: normal; }
.command-history-archive { margin: 12px 0 20px; }
#content .command-history-archive tr[hidden] { display: none !important; }
.command-history-filter { margin-bottom: 12px; align-items: end; flex-wrap: wrap; }
.command-history-archive > summary {
  cursor: pointer;
  padding: 12px 0;
  font-weight: 600;
}
.portal-loader {
  min-height: max(240px, calc(100svh - 220px));
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px;
  text-align: center;
}
.portal-loader--compact {
  min-height: 200px;
}
/* Anchor full-page loading to the visible viewport, including after scrolling.
   Keep the sidebar usable and leave detail-panel loaders in their own panels. */
#content > .portal-loader:not(.portal-loader--compact) {
  position: fixed;
  inset: 0 0 0 250px;
  width: auto;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  z-index: 10;
  pointer-events: none;
}
.portal-loader .pebi-loader {
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .portal-loader { min-height: max(220px, calc(100svh - 260px)); }
  .portal-loader--compact { min-height: 180px; }
}
html, body { margin: 0; min-height: 100%; font-family: 'Pebi Sans', 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
h1, h2, h3, .product-title, .stat { font-family: 'Pebi Display', 'Pebi Sans', sans-serif; font-weight: 500; letter-spacing: -.025em; }
button, input, select, textarea { font: inherit; }
.esm-password-field { position:relative; width:100%; min-width:0; }
.esm-password-field > input { width:100%; box-sizing:border-box; padding-inline-end:3.25rem; }
.esm-password-toggle { position:absolute; inset-inline-end:0.45rem; top:50%; transform:translateY(-50%); display:grid; place-items:center; width:2.25rem; height:2.25rem; padding:0; border:0; border-radius:6px; background:transparent; color:var(--muted,#536782); box-shadow:none; cursor:pointer; }
.esm-password-toggle:hover { background:rgba(83,103,130,0.1); }
.esm-password-toggle:focus-visible { outline:2px solid var(--accent,#c34d35); outline-offset:2px; }
.esm-password-toggle svg { width:21px; height:21px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
a { color: var(--accent); }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 15% 10%, #eef3fa 0, transparent 52%),
    radial-gradient(ellipse at 90% 90%, #fff0e9 0, transparent 48%),
    var(--bg);
}
.login-card {
  width: min(460px, 92vw);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 36px;
  box-shadow: 0 20px 50px #24304412;
}
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.brand.brand-stack {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.product-title {
  display: block;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.product-title-side {
  font-size: 15px;
}
/* PEBITECH lockup: icon crop from brand PNG + uppercase wordmark
   (PNG wordmark is mixed-case; text branding stays UPPER CASE) */
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  line-height: 1;
  margin: 0;
}
.brand-lockup .brand-icon {
  display: block;
  flex-shrink: 0;
  width: 1.2em;
  height: 1.2em;
  object-fit: cover;
  object-position: left center;
}
.brand-lockup .brand-name {
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-navy);
  font-size: 1em;
}
.brand-lockup.login-brand { font-size: 14px; }
.brand-lockup.drawer-brand { font-size: 13px; }
.brand-lockup.topbar-brand {
  display: none;
  font-size: 10px;
  flex-shrink: 0;
  gap: 0.4em;
}
.logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, #fff0e9, #eef3fa);
  display: grid; place-items: center; font-weight: 800; color: var(--brand-navy);
}
.hint { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
.form-grid > .portal-help { grid-column: 1 / -1; margin: 0; }
.form-grid > div { min-width: 0; }
.policy-endpoint-select, .windows-policy-targets select { padding: 8px; min-height: 130px; }
.policy-endpoint-select option, .windows-policy-targets option { padding: 5px 8px; }
.windows-policy-targets { min-width: 0; margin: 18px 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; }
.windows-policy-targets legend { font-weight: 600; padding: 0 6px; }
.policy-selection-hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.browser-startup-policy + .browser-startup-policy { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 16px; }
.policy-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 16px 0; }
input, select, textarea {
  width: 100%; padding: 11px 12px; border-radius: 10px;
  border: 1px solid #cbd5e2; background: #ffffff; color: var(--text);
}
.btn {
  border: 1px solid #af4936; border-radius: 6px; padding: 11px 16px; cursor: pointer;
  background: linear-gradient(180deg, #df816c 0%, #c75b46 48%, #b54736 51%, #c55b44 100%); color: white; font-weight: 600;
  box-shadow: inset 0 1px 0 #ffffff9c, 0 4px 10px #ad4d3014;
}
.btn:hover { background: #a53e30; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: #ffffff; color: var(--brand-navy); border: 1px solid #cbd5e2; box-shadow: none; }
.btn.ghost:hover { background: var(--brand-blue); }
.btn.danger { background: #9c2437; border-color: #9c2437; box-shadow: none; }
.btn.full { width: 100%; margin-top: 16px; }
.error { color: var(--bad); min-height: 20px; font-size: 13px; }

.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side {
  background: #ffffff; border-right: 1px solid var(--line); padding: 24px 12px;
  display: flex; flex-direction: column; gap: 6px;
  overflow-y: auto;
}
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; background: transparent; color: var(--muted);
  border: 0; border-radius: 10px; padding: 8px 12px; cursor: pointer;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.nav-group-toggle:hover { color: var(--text); background: var(--brand-blue); }
.nav-chevron {
  width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid currentColor; flex-shrink: 0; transition: transform 0.15s ease;
}
.nav-group.collapsed .nav-chevron { transform: rotate(-90deg); }
.nav-group-items {
  display: flex; flex-direction: column; gap: 2px; padding-left: 4px;
}
.nav-group.collapsed .nav-group-items { display: none; }
.nav-btn {
  text-align: left; background: transparent; color: var(--text);
  border: 0; border-radius: 10px; padding: 9px 12px; cursor: pointer;
}
.nav-btn.active, .nav-btn:hover { background: var(--panel-2); }
.nav-btn.active { background: var(--brand-peach); color: #984d3c; font-weight: 600; }
.main { padding: 22px 26px 40px; min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; margin-bottom: 18px;
}
.topbar-lead {
  display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1;
}
.topbar-titles { min-width: 0; }
.topbar-titles h2 {
  margin: 0;
  font-size: 1.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-toggle {
  display: none;
  width: 40px; height: 40px; padding: 0;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text);
  cursor: pointer; flex-shrink: 0;
  place-items: center;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 16px; height: 2px;
  background: currentColor;
  border-radius: 1px;
  position: relative;
}
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle-bars::before { top: -5px; }
.nav-toggle-bars::after { top: 5px; }
.nav-scrim {
  display: none;
}
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.card, .panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 16px; box-shadow: var(--shadow);
}
.stat { font-size: 28px; font-weight: 700; }
.muted { color: var(--muted); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: #344c6b; background: #f4f7fb; font-size: 12px; font-weight: 600; letter-spacing: .015em; }
tbody tr:hover { background: #faf8f6; }
.topbar-titles h2 { font-size: 1.75rem; line-height: 1.15; }
.brand-tagline { color: var(--muted); font-size: 11px; line-height: 1.4; margin-top: 3px; }
.login-card .product-title { font-size: 25px; margin-top: 14px; }
#login-status .portal-loader { min-height: 110px; position: static; }
#login-status .pebi-loader { width: 48px; height: 48px; }
.login-card .muted { font-size: 13px; line-height: 1.6; margin-top: 7px; }
.side .brand { border-top: 3px solid var(--brand-navy); padding-top: 20px; }
.nav-btn { border-radius: 6px; }
.endpoint-card, .portal-help { border-radius: 8px; }
input:hover, select:hover, textarea:hover { border-color: #9aabc1; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
code { color: #344c6b; }
::selection { background: #ffe4d7; color: var(--brand-navy); }
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.35;
  background: #eef3fa; color: #344c6b;
  white-space: nowrap;
}
.badge.good { background: #e6f5ec; color: #19633e; }
.badge.bad { background: #fdebee; color: #aa2436; }
.badge.warn { background: #fff2db; color: #805409; }
.badge-nowrap { white-space: nowrap; }
.ep-host {
  min-width: 160px;
  vertical-align: top;
}
.ep-host-name {
  font-weight: 600;
  line-height: 1.35;
}
.ep-host-meta {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.35;
}
.ep-host-badge {
  margin-top: 6px;
}
.ep-group {
  min-width: 150px;
  vertical-align: top;
}
.ep-group-select {
  width: auto;
  min-width: 148px;
  max-width: 220px;
  padding: 8px 10px;
}
.hidden { display: none !important; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }
/* Native select and number inputs have different intrinsic heights. */
#aa-mode, #aa-duration {
  display: block;
  box-sizing: border-box;
  height: 48px;
  min-height: 48px;
  margin: 0;
  line-height: 1.4;
}
.inline-edit {
  display: flex;
  gap: 6px;
  align-items: center;
  max-width: 260px;
}
.inline-edit input {
  margin: 0;
  padding: 7px 10px;
  min-width: 0;
}
.inline-edit .btn {
  padding: 7px 10px;
  flex-shrink: 0;
}
@media (max-width: 1100px) {
  #content > .portal-loader:not(.portal-loader--compact) { left: 0; }
  .app {
    grid-template-columns: 1fr;
    position: relative;
  }
  .nav-toggle { display: grid; }
  .brand-lockup.topbar-brand { display: inline-flex; }
  .side {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(292px, 86vw);
    z-index: 40;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.4);
  }
  .app.nav-open .side { transform: translateX(0); }
  .nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(0, 0, 0, 0.45);
    border: 0;
    padding: 0;
    cursor: pointer;
  }
  .nav-scrim[hidden] { display: none !important; }
  .main { padding: 16px 14px 36px; }
  .topbar-titles h2 { font-size: 1.1rem; }
  .grid, .form-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .grid, .form-grid { grid-template-columns: 1fr; }
  .login-card { padding: 22px 18px; }
  .topbar { align-items: flex-start; }
  #group-picker-wrap { width: 100%; }
  table { font-size: 13px; }
  th, td { padding: 8px 6px; }
}

/* Keep deployment targets readable without making action rows excessively tall. */
.software-packages table { min-width: 0; table-layout: fixed; }
.software-packages th:nth-child(1) { width: 14%; }
.software-packages th:nth-child(2) { width: 5%; }
.software-packages th:nth-child(3) { width: 18%; }
.software-packages th:nth-child(4) { width: 23%; }
.software-packages th:nth-child(5) { width: 12%; }
.software-packages th:nth-child(6) { width: 28%; }
.software-packages td { overflow-wrap: anywhere; padding-top: 16px; padding-bottom: 16px; }
.software-packages td:last-child { padding-left: 16px; }
.software-packages select[multiple] { display: block; box-sizing: border-box; width: 100%; height: 142px; padding: 6px; border-radius: 10px; overflow: auto; }
.software-packages select[multiple] option { padding: 4px 6px; }
.software-packages .selection-help { font-size: 12px; line-height: 1.4; margin: 6px 0 10px; }
.software-deploy-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.software-deploy-actions .btn { margin: 0; min-height: 36px; padding: 8px 10px; font-size: 13px; line-height: 1.3; }
.software-deploy-actions .btn:first-child { grid-column: 1 / -1; }
@media (max-width: 700px) {
  .software-packages .panel { padding: 10px; }
  .software-packages table { min-width: 0; }
}
/* Shared containment for every portal result table. */
#content, .panel, .row > *, .form-grid > * { min-width: 0; }
.table-panel { max-width: 100%; overflow: auto; }
.table-panel td { overflow-wrap: anywhere; }
.table-panel td .btn { margin: 3px 4px 3px 0; }
.table-panel input:not([type=checkbox]):not([type=radio]), .table-panel select { max-width: 100%; }
.endpoint-list table { min-width: 0; table-layout: fixed; }
.endpoint-list th:nth-child(1) { width: 17%; }
.endpoint-list th:nth-child(2) { width: 22%; }
.endpoint-list th:nth-child(3) { width: 13%; }
.endpoint-list th:nth-child(4) { width: 7%; }
.endpoint-list th:nth-child(5) { width: 11%; }
.endpoint-list th:nth-child(6) { width: 11%; }
.endpoint-list th:nth-child(7) { width: 8%; }
.endpoint-list th:nth-child(8) { width: 11%; }
.endpoint-list td { padding-top: 14px; padding-bottom: 14px; }
.endpoint-list .ep-host, .endpoint-list .ep-group { min-width: 0; }
.endpoint-list .ep-group-select { width: 100%; min-width: 0; }
.endpoint-list .inline-edit { max-width: none; margin-bottom: 6px; }
.endpoint-list .inline-edit input { width: 100%; }
.endpoint-actions { display: flex; flex-direction: column; gap: 6px; }
.endpoint-actions .btn { width: 100%; margin: 0 !important; padding: 7px 8px; font-size: 12px; line-height: 1.35; min-height: 34px; }
@media (max-width: 720px) {
  .table-panel { padding: 10px; }
  .row > input, .row > select, .row > textarea { width: 100%; }
}

/* Wrap records into readable lines rather than scrolling the page sideways. */
.table-panel table { table-layout: fixed; min-width: 0; }
.table-panel th, .table-panel td { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.table-panel .badge { white-space: normal; }
.table-panel .btn { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.endpoint-list thead { display: none; }
.endpoint-list tbody, .endpoint-list tr, .endpoint-list td { display: block; }
.endpoint-list tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.endpoint-list td { border: 0; padding: 0; }
.endpoint-list td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.endpoint-list td:last-child { grid-column: span 2; }
.endpoint-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
/* Endpoint details use complete rows for fields, status and actions. */
#content .endpoint-card-body .table-panel tr { align-items: start; gap: 20px 24px; padding: 20px 0 0; border-bottom: 0; background: transparent; }
#content .endpoint-card-body .inline-edit { display: flex; align-items: stretch; gap: 8px; margin: 0 0 8px; }
#content .endpoint-card-body .inline-edit input { flex: 1; min-width: 0; width: 0; }
#content .endpoint-card-body .inline-edit .btn { flex: 0 0 auto; margin: 0; }
#content .endpoint-card-body .inline-edit input,
#content .endpoint-card-body .inline-edit .btn,
#content .endpoint-card-body .ep-group-select { height: 44px; min-height: 44px; padding: 8px 12px; line-height: 1.4; }
#content .endpoint-card-body .ep-group-select { max-width: none; }
#content .endpoint-card-body td:last-child { grid-column: 1 / -1; padding-top: 16px; border-top: 1px solid var(--line); }
#content .endpoint-card-body .endpoint-actions { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
#content .endpoint-card-body .endpoint-actions .btn { grid-column: span 2; min-height: 42px; padding: 10px 12px; }
#content .endpoint-card-body .endpoint-actions:has(> :nth-child(5)) > :nth-child(n+4) { grid-column: span 3; }
@media (min-width: 901px) {
  #content .endpoint-card-body .table-panel tr { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  #content .endpoint-card-body td { grid-column: span 4; }
  #content .endpoint-card-body td:nth-child(n+4):nth-child(-n+7) { grid-column: span 3; }
  #content .endpoint-card-body td:last-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  #content .endpoint-card-body .endpoint-actions { grid-template-columns: minmax(0, 1fr); }
  #content .endpoint-card-body .endpoint-actions .btn,
  #content .endpoint-card-body .endpoint-actions:has(> :nth-child(5)) > :nth-child(n+4) { grid-column: auto; }
}
@media (max-width: 1000px) {
  .table-panel thead { display: none; }
  .table-panel tbody, .table-panel tr, .table-panel td { display: block; }
  .table-panel tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
  .table-panel td { border: 0; padding: 0; }
  .table-panel td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
  .endpoint-list td:last-child { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .table-panel tr { grid-template-columns: minmax(0, 1fr); }
  .software-deploy-actions { grid-template-columns: minmax(0, 1fr); }
}

/* Use the same labeled, multiline record layout in every portal option. */
#content .table-panel thead { display: none; }
#content .table-panel tbody, #content .table-panel tr, #content .table-panel td { display: block; }
#content .table-panel tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
#content .table-panel td { border: 0; padding: 0; min-width: 0; }
#content .table-panel td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
#content .table-panel td[colspan] { grid-column: 1 / -1; }
#content .table-panel td[colspan]::before { display: none; }
#content .table-panel select[multiple] { display: block; width: 100%; margin-bottom: 8px; }
#content .table-panel img { max-width: 100%; }
#content pre, #content code, #content .muted, #content p { overflow-wrap: anywhere; }
#content pre { white-space: pre-wrap; }
#content .row > div { flex: 1 1 220px; min-width: 0 !important; max-width: 100%; }
#content .row > .btn { flex: 0 1 auto; }
/* Keep guidance above actions; form field rows retain their bottom alignment. */
#content .row > .portal-help { flex: 0 0 100%; width: 100%; margin: 0; box-sizing: border-box; }
#content .row:not(:has(input, select, textarea)) { align-items: stretch; }
#content .row:not(:has(input, select, textarea)) > .btn,
#content .form-actions > .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 0;
  line-height: 1.4;
}
#content .row:not(:has(input, select, textarea)) > .muted { align-self: center; }
/* Standalone submit cells belong below the complete grid of fields. */
#content .form-grid > div:has(> .btn):not(:has(input, select, textarea, label, strong)),
#content .form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
#content .form-grid > div:has(> .btn):not(:has(input, select, textarea, label, strong)) > p,
#content .form-actions > [role="status"] { flex-basis: 100%; margin: 0; }
#content .btn { white-space: normal; max-width: 100%; }
.portal-date-field { position: relative; display: flex; align-items: stretch; gap: 0; }
.preview-error { display: grid; gap: 8px; color: var(--muted); font-size: 13px; }
.preview-error .btn { justify-self: start; }
.portal-date-field > input[type="text"] { min-width: 0; flex: 1; border-radius: 10px 0 0 10px; }
.portal-date-field > .portal-date-open { flex: 0 0 52px; padding: 8px; display: flex; align-items: center; justify-content: center; border-left: 0; border-radius: 0 10px 10px 0; background: var(--brand-blue); }
.portal-date-field > .portal-date-native {
  position: absolute; width: 1px; height: 1px; padding: 0; border: 0;
  opacity: 0; pointer-events: none; bottom: 0; right: 0;
}
.portal-calendar { position: fixed; margin: 0; z-index: 10000; width: min(432px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; box-sizing: border-box; border: 1px solid var(--line); border-radius: 16px; padding: 18px; color: var(--text); background: var(--panel); box-shadow: 0 18px 48px #202e4829; }
.portal-calendar::backdrop { background: #202e4866; }
.portal-calendar h3 { margin: 0 0 16px; font-size: 18px; }
.portal-calendar-selectors { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.portal-calendar-selectors label { min-width: 0; margin: 0; font-size: 13px; }
.portal-calendar-selectors select { min-width: 0; height: 44px; padding: 8px; }
.portal-calendar-grid .btn:disabled { opacity: .35; cursor: not-allowed; }
.portal-date-field > input[type="text"] { width: 0; }
.portal-calendar-nav { display: grid; grid-template-columns: 44px 1fr 44px 44px; align-items: center; gap: 8px; margin-bottom: 14px; }
.portal-calendar-nav strong { text-align: center; font-size: 19px; }
.portal-calendar-nav .btn { padding: 8px; border: 0; background: var(--brand-blue); color: var(--brand-navy); min-height: 46px; }
.portal-calendar-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.portal-calendar-grid.portal-calendar-days { grid-template-columns: repeat(7,minmax(0,1fr)); }
.portal-calendar-grid .btn { min-width: 0; padding: 9px 2px; min-height: 46px; border: 0; border-radius: 9px; box-shadow: none; background: transparent; font-weight: 400; }
.portal-calendar-grid .btn:not(:disabled):hover { background: var(--brand-peach); }
.portal-calendar-grid .btn[aria-pressed="true"] { background: var(--accent); color: white; font-weight: 600; }
.portal-calendar-message:empty, .portal-calendar-actions:empty { display: none; }
.portal-calendar-grid > span { text-align: center; font-size: 12px; color: var(--muted); }
.portal-calendar-grid [aria-pressed="true"] { background: var(--accent); color: white; border-color: var(--accent); }
.portal-calendar > label { display: block; margin-top: 14px; }
.portal-calendar-message { color: var(--bad); font-size: 13px; }
.portal-calendar-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
.portal-calendar .btn { white-space: normal; }
#content input[type=checkbox], #content input[type=radio] { width: auto; flex: 0 0 auto; }
.topbar-titles h2 { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  #content .table-panel tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #content .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  #content .table-panel tr, #content .form-grid { grid-template-columns: minmax(0, 1fr); }
  #content .endpoint-list td:last-child { grid-column: 1 / -1; }
  #content .row > div { flex-basis: 100% !important; }
}
/* Compact, endpoint-first BitLocker recovery view. */
.bl-toolbar { display:flex; align-items:end; gap:16px; margin:20px 0 12px; flex-wrap:wrap; }
.bl-toolbar > div:first-child { flex:1; min-width:180px; }
.bl-toolbar .muted, .bl-endpoint small { font-size:12px; }
.bl-search { width: min(100%,320px); font-size:12px; color:var(--muted); }
.bl-search input { display:block; width:100%; margin-top:4px; }
.bl-endpoints { border:1px solid var(--line); border-radius:10px; overflow:hidden; background:var(--panel); }
.bl-endpoint + .bl-endpoint { border-top:1px solid var(--line); }
.bl-endpoint[hidden] { display:none; }
.bl-endpoint > summary { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(0,1fr) minmax(0,1fr); gap:16px; padding:12px 38px 12px 16px; cursor:pointer; list-style:none; position:relative; align-items:center; }
.bl-endpoint > summary::-webkit-details-marker { display:none; }
.bl-endpoint > summary::after { content:'+'; position:absolute; right:16px; font-size:22px; color:var(--accent); }
.bl-endpoint[open] > summary::after { content:'−'; }
.bl-endpoint[open] > summary { background:var(--brand-blue); border-bottom:1px solid var(--line); }
.bl-endpoint > summary:focus-visible { outline:2px solid var(--accent); outline-offset:-3px; }
.bl-endpoint small { display:block; color:var(--muted); margin-top:4px; }
.bl-endpoint summary > span { min-width:0; overflow-wrap:anywhere; }
.bl-drive-list { padding:0 16px; }
.bl-detail-heading { display:flex; flex-wrap:wrap; gap:8px 16px; align-items:center; padding:12px 0; font-size:13px; }
.bl-drive { padding:12px 0; border-top:1px solid var(--line); }
.bl-drive-title, .bl-key-row { display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; }
.bl-drive-title { font-size:13px; }
.bl-drive-title > strong { font-size:20px; min-width:30px; }
.bl-key-row { margin:8px 0; }
.bl-key-row .btn { font-size:12px; min-height:32px; padding:5px 12px; }
.bl-key { display:block; padding:8px 12px; background:var(--panel-2); border-radius:6px; font-size:13px; overflow-wrap:anywhere; user-select:all; max-width:100%; }
.bl-metadata { font-size:12px; color:var(--muted); }
.bl-metadata summary { cursor:pointer; padding:4px 0; }
.bl-metadata dl { display:grid; grid-template-columns:100px minmax(0,1fr); gap:6px 12px; margin:8px 0; }
.bl-metadata dd { margin:0; overflow-wrap:anywhere; }
.bl-no-matches { padding:12px 16px; }
@media(max-width:620px) { .bl-endpoint > summary { grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:8px; } .bl-endpoint > summary > span:last-child { grid-column:1/-1; display:flex; flex-wrap:wrap; align-items:center; gap:8px; } .bl-endpoint small { margin-top:2px; } .bl-key { width:100%; } .bl-search { width:100%; } }
/* Secondary setup and command metadata use the same compact disclosure pattern. */
.portal-setup > .row { padding:0 18px 18px; margin:0 !important; }
.portal-deploy > summary { cursor:pointer; color:var(--accent); font-weight:600; font-size:13px; padding:8px 0; }
.portal-deploy-body { padding-top:8px; }
#content .portal-record:not(.portal-record-open) > .portal-record-secondary { display:none; }
#content .portal-record .portal-record-toggle { display:block; width:max-content; min-height:30px; padding:4px 10px; margin:8px 0 0; font-size:12px; }
#content .portal-record:not(.portal-record-open) > td > .muted,
#content .portal-record:not(.portal-record-open) > td > pre { max-height:3.1em; overflow:hidden; }
#content .portal-record-open { background:var(--brand-blue); border-radius:8px; padding-inline:12px; }
.portal-deploy > summary:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
@media (max-width:560px) { #content .portal-record .portal-record-toggle { width:100%; } }

/* Windows branding preview is illustrative; never collects credentials. */
.lock-design-header { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:16px; }
.lock-design-header > label { display:flex; align-items:center; gap:12px; margin:0; white-space:nowrap; }
.lock-design-header select { width:220px; margin:0; }
.lock-design-stage { position:relative; aspect-ratio:16/9; width:min(100%,740px,calc(52vh * 16 / 9)); margin:16px auto; overflow:hidden; border-radius:14px; background:#172638; color:white; isolation:isolate; }
.lock-design-stage > #ls-design-image { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:-2; }
.lock-design-stage::after { content:""; position:absolute; inset:0; background:linear-gradient(transparent,#0009); z-index:-1; }
.lock-design-clock { position:absolute; left:7%; bottom:12%; display:grid; text-shadow:0 2px 8px #000; }
.lock-design-clock strong { font-size:clamp(32px,6vw,76px); font-weight:400; }
.lock-design-signin,.lock-design-notice { display:none; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); text-align:center; width:min(80%,440px); }
.lock-design-avatar { font-size:60px; }
.lock-design-password { border:1px solid #fff9; background:#0008; padding:10px; margin-top:14px; }
.lock-design-stage[data-mode="signin"] .lock-design-signin { display:grid; gap:8px; }
.lock-design-stage[data-mode="notice"] .lock-design-notice { display:block; background:#143c68ee; border:1px solid #ffffff66; border-radius:8px; padding:24px; }
.lock-design-notice p { white-space:pre-wrap; overflow-wrap:anywhere; max-height:180px; overflow:auto; }
.lock-design-notice span { display:inline-block; border:1px solid #fff9; padding:6px 30px; }
.lock-design-stage:not([data-mode="lock"]) .lock-design-clock { display:none; }
.lock-design-stage[data-mode="signin"] > img { filter:blur(5px); transform:scale(1.03); }

@media (max-width:600px) { .lock-design-header { grid-template-columns:1fr; } .lock-design-header select { flex:1; width:auto; min-width:0; } .lock-design-clock strong { font-size:clamp(30px,7vw,56px); } }

.lock-design-panel > strong { display:block; margin-bottom:14px; }
.lock-design-source { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); align-items:start; gap:16px; }
.lock-design-source input,.lock-design-source select { width:100%; min-width:0; }
.lock-design-source small { display:block; margin-top:6px; }
.lock-design-panel > .lock-design-header { margin-top:24px; padding-top:20px; border-top:1px solid var(--line); }
.lock-design-options { margin:16px 0; padding:14px 0; border-top:1px solid var(--line); }
.lock-design-options > summary { cursor:pointer; font-weight:600; }
.lock-design-options[open] > summary { margin-bottom:14px; }
.lock-design-targets { display:grid; gap:12px; margin-top:20px; }
.lock-design-targets > label { margin:0; }
.lock-design-targets > select { width:100%; min-width:0; }
@media (max-width:800px) { .lock-design-source { grid-template-columns:minmax(0,1fr) auto; } .lock-design-source > div:last-child { grid-column:1/-1; } }
@media (max-width:480px) { .lock-design-source { grid-template-columns:1fr; } .lock-design-source > .btn { justify-self:start; } }

.lock-design-source > div > label { margin:0 0 6px; }
.lock-design-source > .btn { margin-top:26px; }
@media (max-width:480px) { .lock-design-source > .btn { margin-top:0; } }

.lock-design-stage { container-type:inline-size; }
.lock-design-stage[data-clock-layout="win11"] .lock-design-clock { top:10%; bottom:auto; left:50%; transform:translateX(-50%); text-align:center; white-space:nowrap; }
.lock-design-stage[data-clock-layout="none"] .lock-design-clock { display:none; }
.lock-design-logo { position:absolute; height:auto; object-fit:contain; z-index:0; }
.lock-design-org,.lock-design-footer { position:absolute; color:white; text-shadow:0 2px 5px #000; z-index:0; }
.lock-design-org { font-size:clamp(9px,1.67cqw,16px); font-weight:600; max-width:35%; overflow-wrap:anywhere; }
.lock-design-footer { bottom:2.2%; left:50%; transform:translateX(-50%); font-size:clamp(8px,1.25cqw,12px); width:65%; text-align:center; }
.lock-design-stage[data-mode="signin"] .lock-design-logo,.lock-design-stage[data-mode="signin"] .lock-design-org,.lock-design-stage[data-mode="signin"] .lock-design-footer { filter:blur(3px); }
