/* =============================================================================
   sl-responsive.css — StayLinked SmartHub Responsive Layout Layer
   -----------------------------------------------------------------------------
   Makes the app shell fluid across every display class that runs SmartHub:
   small laptops (1280x800), standard laptops (1366/1440), desktops (1920),
   and wide desktops (2560+), plus split-screen window sizes.

   LOAD ORDER: after the page stylesheet, before header.css. Overrides here win
   by source order at equal specificity — no !important needed for new rules.

   Breakpoints (keep in sync with sl-tokens.css section 9). The window
   and the page box (container sl-page) use the same four widths:
     smartphone  ≤700px    one column; tables scroll in their own region
     tablet      ≤900px    settings panes and sidebars stack
     laptop      901–1199  fluid columns, no new stacking
     external    ≥1600px   same columns, wider gutter
   sm 640px is an extra-small phone tweak. 1200px is the designed desktop width.

   Strategy: desktop-first at the shell level (the legacy CSS assumes wide
   screens), fluid by default for everything new. Wide data tables scroll
   inside their own region (.sl-table-scroll) instead of forcing page width.
   ========================================================================== */

/* =============================================================================
   1. GLOBAL GUARDRAILS
   ========================================================================== */
html {
  box-sizing: border-box;
}
*, *::before, *::after {
  box-sizing: inherit;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;          /* nothing may force a page-level horizontal scroll */
}

img, svg, video, canvas {
  max-width: 100%;
  height: auto;
}
/* Header wordmark and the existing login mark are precisely sized — keep them exact */
.staylinked-logo img { max-width: none; height: 24px; }
#staylinked-logo img { max-width: none; height: auto; }

/* =============================================================================
   2. LEGACY SHELL RETROFIT
   These selectors match the existing page scaffolds and replace their fixed
   dimensions with fluid equivalents. Same specificity, later source order.
   ========================================================================== */

/* NOTE: retrofit selectors are prefixed with `body` to outrank the legacy
   declarations regardless of stylesheet load order (Thymeleaf layout head
   merging appends child-page links after this file). */

/* --- Home (admin/main.html): #main-frame was width: 1046px ----------------- */
body #main-frame {
  width: min(1046px, calc(100% - 2 * var(--sl-content-gutter)));
}

/* --- Settings / LicenseDetails: min-width was 2000px; SeatDetails: 1620px;
       Licensing: 600px. Inner content is flex/percent based, so fluid is safe.
       Wide tables get .sl-table-scroll regions instead. ---------------------- */
body #main-container {
  min-width: 0;
  padding-left: var(--sl-content-gutter);
  padding-right: var(--sl-content-gutter);
}

/* Settings #content-container pinned the page to a fixed 948px height */
body #content-container {
  height: auto;
  min-height: 600px;
}

/* Keep wide children inside the viewport so a table can scroll in its region. */
body #content-container,
body .server-bg,
body .table-wrapper,
body .editSeat-content,
body .license-details {
  min-width: 0;
}

/* Two-pane settings, licensing, and detail layouts stack on small screens */
@media (max-width: 900px) {
  body #main-container {
    height: auto;
    max-height: none;
    overflow: auto;
  }
  body #content-container {
    flex-direction: column;
    height: auto;
    overflow: auto;
  }
  body #content-container .settings-details,
  body #settings .authentication-container,
  body #settings .email-container,
  body .license-details,
  body .server-bg,
  body .editSeat-content,
  body .license-details.client-details-left {
    width: 100%;
    max-width: none;
    flex: 1 1 auto;
    height: auto;
    min-width: 0;
  }
  body .editSeat-content {
    margin-left: 0;
    padding: var(--sl-space-4);
  }
  body .client-disconnected-notice {
    width: 100%;
  }
  body #content-container .server-bg {
    border-radius: 0 0 4px 4px;
  }
  body #settings #portContainer,
  body #settings #logging-level-dropdown {
    --ds-field-max: 100%;
    width: 100%;
  }
  body .server-table-header {
    height: auto;
    flex-wrap: wrap;
    gap: var(--sl-space-2);
  }
  body .server-table-header-btns,
  body .server-table-header-search {
    width: 100%;
    height: auto;
    flex-wrap: wrap;
    gap: var(--sl-space-2);
  }
  body #content-container > .ds-card {
    width: min(407px, 100%);
  }
  body #card-container-wrapper {
    width: 100%;
    max-width: 100%;
  }
}

/* Home card grid and license cards: one column on phone */
@media (max-width: 700px) {
  body #card-container-wrapper {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
  }
  body #card-container-wrapper .ds-app-card {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 8.5rem;
  }
  body #content-container > .ds-card {
    width: 100%;
    margin-right: 0;
  }
  body #content-container .ds-card-row,
  body #content-container .entitlement-status {
    flex-wrap: wrap;
  }
}

/* =============================================================================
   3. APP HEADER RESPONSIVENESS
   The product name starts after the wordmark and its divider. Below md the
   title yields gracefully; below sm it hides rather than colliding with the
   action icons.
   ========================================================================== */
body .app-title {
  left: 199px;
}

/* --- Breadcrumb: one look on every page (Nov 2026) --------------------------
   Every page uses the same markup (DESIGN-LANGUAGE.md section 3):

     <nav aria-label="Breadcrumb" class="breadcrumb pkg-crumb">
       <th:block th:replace="~{common/BreadcrumbHomeFragment :: homeSwitch}">
       <ol>
         <li><a th:href="@{/parent}">Parent page</a></li>
         <li><a aria-current="page">This page</a></li>
       </ol>
     </nav>

   The trail is secondary to the page title: 14px regular. Parent pages are
   links in the link colour, always underlined, with a thicker underline on
   hover. The current page has no href, so it is plain text in the primary
   text colour. A chevron drawn in CSS sits between items; it has no content,
   so screen readers do not announce it. Every line is 24px tall, so each link
   is a 24px target. A parent name longer than --sl-breadcrumb-item-max ends
   in an ellipsis; the current page wraps. The trail wraps by item and never
   scrolls sideways. Older page sheets still carry nav.breadcrumb rules, so
   these selectors name both classes and every link state. The page layout
   owns the nav's margin and padding. */
body nav.breadcrumb.pkg-crumb,
body nav.pkg-crumb {
  display: flex;
  align-items: center;
  gap: var(--sl-space-2);
  min-width: 0;
  max-width: 100%;
  color: var(--sl-text-secondary);
  font-family: var(--sl-font-family);
  font-size: var(--sl-font-size-breadcrumb);
  font-style: normal;
  font-weight: var(--sl-font-weight-regular);
  line-height: var(--sl-space-6);
}
html body nav.breadcrumb.pkg-crumb ol,
html body nav.pkg-crumb ol {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}
body nav.breadcrumb.pkg-crumb li {
  display: inline-flex;
  align-items: flex-start;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0;
  font-size: var(--sl-font-size-breadcrumb);
  line-height: var(--sl-space-6);
  list-style: none;
}
body nav.breadcrumb.pkg-crumb li + li::before {
  content: "";
  flex: none;
  box-sizing: content-box;
  width: 0.4em;
  height: 0.4em;
  margin-block: calc((var(--sl-space-6) - 0.4em) / 2) 0;
  margin-inline: calc(var(--sl-space-2) - 0.1em) var(--sl-space-2);
  border: solid currentcolor;
  border-width: 1px 1px 0 0;
  color: var(--sl-text-secondary);
  transform: rotate(45deg);
}
body nav.breadcrumb.pkg-crumb li + li:dir(rtl)::before {
  transform: rotate(-135deg);
}
body nav.breadcrumb.pkg-crumb li > a:not([aria-current="page"]),
body nav.breadcrumb.pkg-crumb li > a:not([aria-current="page"]):visited {
  display: inline-block;
  /* A plain length: a percentage here is ignored when the li is sized, which
     left a gap after a cut-off name. The li's max-width keeps it on screen. */
  max-width: var(--sl-breadcrumb-item-max);
  overflow: hidden;
  color: var(--sl-text-link);
  background: transparent;
  font-size: var(--sl-font-size-breadcrumb);
  font-style: normal;
  font-weight: var(--sl-font-weight-regular);
  line-height: var(--sl-space-6);
  text-decoration-line: underline;
  text-decoration-style: solid;
  text-decoration-thickness: max(1px, 0.0625rem);
  text-underline-offset: 0.15em;
  text-decoration-skip-ink: auto;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
body nav.breadcrumb.pkg-crumb li > a:not([aria-current="page"]):hover,
body nav.breadcrumb.pkg-crumb li > a:not([aria-current="page"]):active {
  color: var(--sl-text-link);
  background: transparent;
  box-shadow: none;
  text-decoration-line: underline;
  text-decoration-thickness: max(3px, 0.1875rem, 0.12em);
}
body nav.breadcrumb.pkg-crumb li > a:focus {
  outline: none;
}
body nav.breadcrumb.pkg-crumb li > a:not([aria-current="page"]):focus-visible {
  border-radius: var(--sl-radius-xs);
  outline: var(--sl-focus-ring-width) solid var(--sl-focus-ring-color);
  outline-offset: var(--sl-focus-ring-offset);
  background: transparent;
  box-shadow: none;
  color: var(--sl-text-link);
}
body nav.breadcrumb.pkg-crumb li > [aria-current="page"],
body nav.breadcrumb.pkg-crumb li > [aria-current="page"]:hover,
body nav.breadcrumb.pkg-crumb li > [aria-current="page"]:active {
  min-width: 0;
  color: var(--sl-text-primary);
  background: transparent;
  box-shadow: none;
  font-size: var(--sl-font-size-breadcrumb);
  font-weight: var(--sl-font-weight-regular);
  line-height: var(--sl-space-6);
  text-decoration: none;
  overflow-wrap: anywhere;
  cursor: default;
}

/* Home: the icon link the shared fragment (BreadcrumbHomeFragment.html) puts
   before the trail, in a lead-in span that also draws the chevron after it.
   Same 24px line and link colour as a parent link, so it reads as the first
   level. The lead-in stays on the first line when the trail wraps. */
body nav.pkg-crumb > .pkg-crumb-lead {
  display: inline-flex;
  flex: none;
  align-self: flex-start;
  align-items: center;
  gap: var(--sl-space-2);
  height: var(--sl-space-6);
}
body nav.pkg-crumb > .pkg-crumb-lead::after {
  content: "";
  flex: none;
  box-sizing: content-box;
  width: 0.4em;
  height: 0.4em;
  margin-inline-end: 0.1em;
  border: solid currentcolor;
  border-width: 1px 1px 0 0;
  color: var(--sl-text-secondary);
  transform: rotate(45deg);
}
body nav.pkg-crumb > .pkg-crumb-lead:dir(rtl)::after {
  transform: rotate(-135deg);
}
body nav.pkg-crumb a.pkg-crumb-home,
body nav.pkg-crumb a.pkg-crumb-home:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--sl-space-6);
  height: var(--sl-space-6);
  color: var(--sl-text-link);
  background: transparent;
  text-decoration: none;
}
/* house-blank, solid (Font Awesome Pro 7.3.1), inline in the fragment. */
body nav.pkg-crumb a.pkg-crumb-home .pkg-crumb-home-icon {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
}
body nav.pkg-crumb a.pkg-crumb-home:hover,
body nav.pkg-crumb a.pkg-crumb-home:active {
  border-radius: var(--sl-radius-xs);
  color: var(--sl-text-link);
  background: var(--sl-action-tertiary-bg-hover);
  box-shadow: none;
}
body nav.pkg-crumb a.pkg-crumb-home:focus {
  outline: none;
}
body nav.pkg-crumb a.pkg-crumb-home:focus-visible {
  border-radius: var(--sl-radius-xs);
  outline: var(--sl-focus-ring-width) solid var(--sl-focus-ring-color);
  outline-offset: var(--sl-focus-ring-offset);
}

/* The Applications menu is in the top bar (HeaderFragment.html). */
@media (max-width: 900px) {
  body .app-title {
    font-size: var(--sl-font-size-xl);
    max-width: calc(100vw - 386px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
@media (max-width: 700px) {
  body .app-title,
  body .staylinked-logo::after {
    display: none;
  }
}

/* =============================================================================
   4. NEW SHELL PRIMITIVES — use these when building or migrating pages
   ========================================================================== */

/* Full-page scaffold below the fixed 68px header */
.sl-shell {
  min-height: calc(100vh - var(--sl-header-height));
  min-height: calc(100dvh - var(--sl-header-height));
  padding-top: var(--sl-header-height);
  display: flex;
  flex-direction: column;
  background: var(--sl-surface-page);
}

/* Centered content column: fluid with a readable cap */
.sl-container {
  width: 100%;
  max-width: var(--sl-container-max);
  margin-inline: auto;
  padding-inline: var(--sl-content-gutter);
}
.sl-container--narrow { max-width: var(--sl-container-narrow); }
.sl-container--full   { max-width: none; }

/* Standard page block spacing */
.sl-stack   { display: flex; flex-direction: column; gap: var(--sl-space-4); }
.sl-stack--tight { gap: var(--sl-space-2); }
.sl-stack--loose { gap: var(--sl-space-6); }

.sl-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sl-space-2h);
}
.sl-cluster--end { justify-content: flex-end; }

/* Auto-fitting card grid — the responsive home for .sl-card lists.
   233px = the card's designed width in Figma; it grows fluidly from there. */
.sl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(233px, 100%), 1fr));
  gap: var(--sl-space-4);
}
.sl-grid--wide {
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
}

/* Sidebar + content pattern (settings-style pages).
   Sidebar keeps its designed 253px (Figma settings menu) until space runs out,
   then the pair stacks. */
.sl-sidebar-layout {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sl-space-6);
}
.sl-sidebar-layout > .sl-sidebar {
  flex: 1 1 253px;
  max-width: 320px;
  min-width: 220px;
}
.sl-sidebar-layout > .sl-sidebar-content {
  flex: 999 1 min(60%, 480px);
  min-width: 0;
}
@media (max-width: 900px) {
  .sl-sidebar-layout > .sl-sidebar { max-width: none; }
}

/* Wide data tables: scroll within their own region, never the page */
.sl-table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}
.sl-table-scroll > table {
  min-width: 640px;   /* keep the column structure legible while scrolling */
  width: 100%;
}

/* Form grid: label/control pairs that reflow from 2-up to 1-up */
.sl-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: var(--sl-space-4) var(--sl-space-6);
  align-items: start;
}

/* =============================================================================
   5. UTILITIES
   ========================================================================== */
.sl-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.sl-hide-below-sm { }
.sl-hide-below-md { }
@media (max-width: 700px)  { .sl-hide-below-sm { display: none; } }
@media (max-width: 900px)  { .sl-hide-below-md { display: none; } }
/* External display: same columns, wider gutter. Page insets that are
   written again later in this file are repeated after those rules. */
@media (min-width: 1600px) {
  .sl-container { padding-inline: var(--sl-space-10); }
  body {
    --sl-content-gutter: var(--sl-space-12);
  }
}

/* Laptop: columns stay beside each other and give up their fixed floors.
   Stacking stays in the tablet (900) and smartphone (700) queries. */
@media (min-width: 901px) and (max-width: 1199px) {
  body .injection-workspace,
  body .url-contents-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-width: 0;
  }
  body .injection-editor-panel,
  body .injection-navigation,
  body .url-contents-navigation,
  body .url-contents-editor-panel {
    min-width: 0;
    max-width: 100%;
  }
}

/* Phone and tablet: keep text fields in the form. iOS zooms any control
   under 16px until the field fills the screen and the chrome jumps. This
   file loads last so it beats page and section input sizes. */
@media (max-width: 900px), (orientation: landscape) and (max-height: 500px) {
  body.sl-has-shell input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]),
  body.sl-has-shell select,
  body.sl-has-shell textarea,
  body.sl-has-shell .text-field,
  body.sl-has-shell .text-area,
  body.sl-has-shell .settings-panel .text-field,
  body.sl-has-shell .settings-panel select.text-field,
  body.sl-has-shell .settings-panel textarea.text-field,
  body.sl-has-shell .settings-panel .text-area,
  body.sl-has-shell .section-panel .text-field,
  body.sl-has-shell .section-panel select.text-field,
  body.sl-has-shell .section-panel textarea.text-field,
  body.sl-has-shell .section-panel .text-area,
  body.sl-has-shell #addPackageModal .standard-required input,
  body.sl-has-shell #addPackageModal .standard-required textarea,
  body.sl-has-shell #addPackageModal .standard-required select,
  body.sl-has-shell #addPackageModal .input-container input,
  body.sl-has-shell #addPackageModal .input-container textarea,
  body.sl-has-shell #addPackageModal .input-container select,
  body.sl-has-shell #addPackageModal #package-description,
  body.sl-has-shell .te-scan__field .text-field,
  body.sl-has-shell .te-scan__field select.text-field,
  body.sl-has-shell .te-scan__picker-select,
  body.sl-has-shell .te-barcode__select select.text-field {
    font-size: var(--sl-font-size-input);
  }
}

/* Dialogs keep their designed width until the window is narrower. */
body .assign-seat-modal .seat-modal-content,
body .modal-content,
/* The license, Settings and Client console dialogs were listed here too; since
   22 November 2026 every dialog's height is held by the "fits the window"
   rules at the end of the confirm dialog in sl-components.css, whose cap
   leaves the overlay's gap. These two older boxes keep this one. */
body .package-modal-content,
body .delete-modal-content {
  max-width: calc(100vw - 2 * var(--sl-content-gutter));
  max-height: calc(100dvh - 2 * var(--sl-space-6));
  overflow: auto;
  box-sizing: border-box;
}
body #addPackageModal input[type="text"],
body #addPackageModal textarea,
body #addPackageModal select {
  width: 100%;
  max-width: 470px;
  box-sizing: border-box;
}

/* Host chrome around Keyboard Designer. The device art is not scaled. */
body .keyboard-designer-layout,
body .keyboard-designer-body-wrap {
  min-width: 0;
  max-width: 100%;
}

/* =============================================================================
   6. TYPE AND AVAILABLE WIDTH
   Text follows --sl-font-family and rem sizes (converted in the page CSS).
   Fixed floors (525 / 605 / 640 / 720 / 900) are caps instead, so a field or
   panel shrinks with the space it is given. The page container is measured
   directly: stacking follows that width, which tracks the window today and
   a narrower workspace if one is introduced later.
   ========================================================================== */
body #main-container {
  container-type: inline-size;
  container-name: sl-page;
}

body .text-field,
body .text-area,
body #section-general .config-block,
body #section-general .config-block-proxy {
  width: 100%;
  max-width: 525px;
  min-width: 0;
  box-sizing: border-box;
}

body .help-box,
body #editor.ace-editor-block,
body .ace-editor-block {
  min-width: 0;
  max-width: 100%;
}

body .settings-content .general-background,
body #section-general > .general-background,
body #section-profiles > .general-background,
body #section-file-operations > .general-background,
body #section-device-criteria > .general-background,
body #section-security > .general-background {
  width: 100%;
  min-width: 0;
  justify-content: flex-start;
}

body .general-frame,
body .general-frame.settings-panel,
body .general-frame.injection-frame,
body .general-frame.file-operations-frame,
body .general-frame.device-criteria-frame,
body .general-frame.security-frame,
body #section-device-criteria .general-frame.device-criteria-frame,
body #section-security .general-frame.security-frame {
  width: 100%;
  min-width: 0;
  max-width: none;
  margin-inline: 0;
  box-sizing: border-box;
}

body #section-file-operations .advanced-file-operations-page {
  --file-op-path-column: minmax(0, 1fr);
  --file-op-overwrite-column: minmax(0, 216px);
  --file-op-actions-column: minmax(0, 330px);
  width: 100%;
  min-width: 0;
  max-width: none;
  margin-inline: 0;
  box-sizing: border-box;
}
body #section-file-operations .file-operations-table {
  overflow-x: auto;
  min-width: 0;
  max-width: 100%;
}
body #section-file-operations .file-operation-row,
body #section-file-operations .file-operations-header,
body #section-file-operations .file-operation-row > *,
body #section-file-operations .file-operations-header > * {
  min-width: 0;
  max-width: 100%;
}

body #main-container:has(#packageTable) .server-bg-header,
body #main-container:has(#packageTable) .server-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

body .settings-content .form-row > input,
body .settings-content .form-row > select,
body .settings-content .form-row > textarea,
body .nav-actions,
body .nav-actions-right,
body .settings-action-bar {
  max-width: 100%;
  min-width: 0;
}
body .nav-actions,
body .nav-actions-right,
body .settings-action-bar {
  flex-wrap: wrap;
}

/* Same stack as the 900px window query, measured on the page box. */
@container sl-page (max-width: 900px) {
  body #content-container {
    flex-direction: column;
    height: auto;
    overflow: auto;
  }
  body #content-container .settings-details,
  body #settings .authentication-container,
  body #settings .email-container,
  body .license-details,
  body .server-bg,
  body .editSeat-content,
  body .license-details.client-details-left {
    width: 100%;
    max-width: none;
    flex: 1 1 auto;
    height: auto;
    min-width: 0;
  }
  body .editSeat-content {
    margin-left: 0;
    padding: var(--sl-space-4);
  }
  body .client-disconnected-notice,
  body #card-container-wrapper,
  body .server-table-header-btns,
  body .server-table-header-search {
    width: 100%;
    max-width: 100%;
  }
  body .server-table-header,
  body .server-table-header-btns,
  body .server-table-header-search {
    height: auto;
    flex-wrap: wrap;
    gap: var(--sl-space-2);
  }
  body #content-container > .ds-card {
    width: min(407px, 100%);
  }
}
@container sl-page (max-width: 700px) {
  body #card-container-wrapper {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  body #card-container-wrapper .ds-app-card {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 8.5rem;
    margin-right: 0;
  }
  body #content-container > .ds-card {
    width: 100%;
    max-width: 100%;
    margin-right: 0;
  }
  body #content-container .ds-card-row,
  body #content-container .entitlement-status {
    flex-wrap: wrap;
  }
}

/* Laptop and external, measured on the page box. Same widths as the window. */
@container sl-page (min-width: 901px) and (max-width: 1199px) {
  body .injection-workspace,
  body .url-contents-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-width: 0;
  }
  body .injection-editor-panel,
  body .injection-navigation,
  body .url-contents-navigation,
  body .url-contents-editor-panel {
    min-width: 0;
    max-width: 100%;
  }
}
@container sl-page (min-width: 1600px) {
  body #content-container > .ds-card {
    margin-right: var(--sl-space-6);
    margin-bottom: var(--sl-space-6);
  }
}

/* Phone and tablet: 16px fields on the existing pages, which do not use sl-has-shell. */
@media (max-width: 900px), (orientation: landscape) and (max-height: 500px) {
  body input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]),
  body select,
  body textarea {
    font-size: var(--sl-font-size-input);
  }
}

body .page-content.settings-layout {
  padding-top: calc(var(--sl-header-height, 68px) + var(--sl-space-3));
}
body .page-content.settings-layout > nav.breadcrumb,
body .page-content.settings-layout .metadata-header,
body .page-content.settings-layout .settings-header,
body .page-content.settings-layout .settings-content {
  margin-left: clamp(16px, 2.5vw, 32px);
  margin-right: clamp(16px, 2.5vw, 32px);
}
@media (min-width: 1600px) {
  body .page-content.settings-layout > nav.breadcrumb,
  body .page-content.settings-layout .metadata-header,
  body .page-content.settings-layout .settings-header,
  body .page-content.settings-layout .settings-content {
    margin-left: var(--sl-space-12);
    margin-right: var(--sl-space-12);
  }
}

/* Light and dark. The header icon swaps; dark mode repaints the panels that
   still use a hardcoded white or the page wash. */
html[data-theme="dark"] .header-theme .header-theme-to-dark {
  display: none;
}
html[data-theme="dark"] .header-theme .header-theme-to-light {
  display: inline-block;
}
html[data-theme="dark"] body#login {
  background-image: none;
  background-color: var(--sl-surface-canvas);
}
html[data-theme="dark"] #main-container,
html[data-theme="dark"] #homepage,
html[data-theme="dark"] .empty-base,
html[data-theme="dark"] .page-content {
  background-color: var(--sl-surface-page);
  color: var(--sl-text-primary);
}
html[data-theme="dark"] .server-table,
html[data-theme="dark"] .seat-table,
html[data-theme="dark"] .pkg-card,
html[data-theme="dark"] .login-container,
html[data-theme="dark"] .ds-tip-rich {
  background-color: var(--sl-surface-raised);
  color: var(--sl-text-primary);
}
html[data-theme="dark"] #main-frame .title,
html[data-theme="dark"] #main-frame .subTitle,
html[data-theme="dark"] #page-heading,
html[data-theme="dark"] .server-bg-header h2 {
  color: var(--sl-text-primary);
}

/* Apps menu lists names only. This file loads last, so it stays hidden. */
#popup-Context .ds-app-tile > .ds-app-tile-icon,
#popup-Context .ds-app-tile > i {
  display: none;
}

/* Configuration editors and the add-package dialog. Same field contract as
   sl-migrate.css (Figma text input): height, radius, border, type, and focus.
   This file loads last so page rules cannot drift from it. */
.page-content.settings-layout input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]),
.page-content.settings-layout select,
#addPackageModal input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]),
#addPackageModal select {
  height: var(--sl-control-height);
}
.page-content.settings-layout input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]),
.page-content.settings-layout select,
.page-content.settings-layout textarea,
#addPackageModal input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]),
#addPackageModal select,
#addPackageModal textarea {
  box-sizing: border-box;
  min-height: var(--sl-control-height);
  padding: var(--sl-space-2h) var(--sl-space-3);
  background: var(--sl-surface-raised);
  border: 1px solid var(--sl-border-field);
  border-radius: var(--sl-field-radius);
  font-family: var(--sl-font-family);
  font-size: var(--sl-field-font-size);
  font-weight: var(--sl-font-weight-regular);
  line-height: var(--sl-line-height-body);
  color: var(--sl-text-field);
}
.page-content.settings-layout .settings-select > select {
  padding-right: 2.25rem;
}
.page-content.settings-layout input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):focus,
.page-content.settings-layout select:focus,
.page-content.settings-layout textarea:focus,
#addPackageModal input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):focus,
#addPackageModal select:focus,
#addPackageModal textarea:focus {
  border-color: var(--sl-selected-border);
  box-shadow: inset 0 0 0 1px var(--sl-selected-border);
}
.page-content.settings-layout input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):focus-visible,
.page-content.settings-layout select:focus-visible,
.page-content.settings-layout textarea:focus-visible,
.page-content.settings-layout .text-field:focus-visible,
.page-content.settings-layout .text-area:focus-visible,
.page-content.settings-layout .settings-select > select:focus-visible,
.page-content.settings-layout #certificatePemInput:focus-visible,
#addPackageModal input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):focus-visible,
#addPackageModal select:focus-visible,
#addPackageModal textarea:focus-visible {
  outline: var(--sl-focus-ring-width) solid var(--sl-focus-ring-color);
  outline-offset: var(--sl-focus-ring-offset);
  border-width: 1px;
  border-style: solid;
  border-color: var(--sl-selected-border);
  box-shadow: inset 0 0 0 1px var(--sl-selected-border);
}
.page-content.settings-layout input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):disabled,
.page-content.settings-layout select:disabled,
.page-content.settings-layout textarea:disabled,
#addPackageModal input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):disabled,
#addPackageModal select:disabled,
#addPackageModal textarea:disabled {
  background: var(--sl-surface-disabled);
  border-style: dashed;
  color: var(--sl-text-muted);
  cursor: not-allowed;
}
.page-content.settings-layout input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"])[readonly],
.page-content.settings-layout textarea[readonly],
#addPackageModal input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"])[readonly],
#addPackageModal textarea[readonly] {
  background: var(--sl-surface-disabled);
}

/* Each editor section fills the pane. Its title row stays full width; the fields scroll. */
body .settings-body.has-vertical-nav > .settings-content {
  overflow: hidden;
}
body .settings-body #section-general.section-panel,
body .settings-body #section-profiles.section-panel,
body .settings-body #section-hosts.section-panel,
body .settings-body #section-security.section-panel,
body .settings-body #section-file-operations.section-panel,
body .settings-body #section-device-criteria.section-panel {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}
body .settings-body .section-panel > div:not(.general-background) {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}
body .settings-body .section-panel > .general-background,
body .settings-body .section-panel > div > .general-background {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: auto;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
body .settings-body .general-frame.settings-panel:has(> .settings-tab-head),
body .settings-body #section-file-operations .advanced-file-operations-page,
body .settings-body #section-device-criteria .general-frame.device-criteria-frame,
body .settings-body #section-security .general-frame.security-frame {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  max-width: none;
  min-height: 0;
  margin: 0;
  overflow: auto;
}
body .settings-body .general-frame.settings-panel:has(> .settings-tab-head) {
  padding-top: 0;
}
body .settings-body .settings-tab-head {
  position: sticky;
  top: 0;
  z-index: 4;
  align-self: stretch;
  flex: 0 0 auto;
  margin: 0 -40px 0;
  padding: 1.5rem 40px 1rem;
  background: var(--sl-surface-raised);
}
body .settings-tab-head .settings-heading,
body .settings-tab-head .required-field-note,
body .settings-tab-head .settings-section-note {
  margin-bottom: 0;
}
body .settings-tab-head .settings-heading + .required-field-note,
body .settings-tab-head .settings-heading + .settings-section-note {
  margin-top: 0.5rem;
}
body .settings-body #section-file-operations > .general-background,
body .settings-body #section-device-criteria > .general-background {
  width: 100%;
  min-width: 0;
}

/* The Add package dialog is styled in package-add-dialog.css. */

body .injection-navigation > .injection-intro,
body .url-contents-navigation > .url-contents-intro {
  position: sticky;
  top: 0;
  z-index: 3;
  margin: -30px -30px 0 -40px;
  padding: 30px 30px 16px 40px;
  background: var(--sl-surface-raised);
}

body .injection-editor-panel,
body .url-contents-editor-panel {
  overflow: hidden;
}
body .injection-editor-heading-row,
body .url-contents-editor-heading-row {
  flex: 0 0 auto;
  background: var(--sl-surface-accent);
}
body .injection-editor-well {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
body .url-contents-editor-panel .url-contents-list-frame {
  min-height: 0;
  overflow: auto;
}

@media (max-width: 900px) {
  body .injection-navigation,
  body .url-contents-navigation,
  body .injection-editor-panel,
  body .url-contents-editor-panel {
    overflow: visible;
  }
  body .injection-editor-heading-row,
  body .url-contents-editor-heading-row h3,
  body .url-contents-editor-panel > .url-contents-no-selection {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--sl-surface-accent);
  }
  body .url-contents-editor-panel > .url-contents-no-selection {
    top: 1.75rem;
  }
}

/* Print: drop chrome, keep content */
@media print {
  .header, #popup-Context, #popup-AdminMenu { display: none; }
  .sl-shell { padding-top: 0; }
}
