/* PXLTAB NODES integration only. Header, footer, buttons, and auth visuals are
   owned by the exact local copies under pxltab-shell/css. */
body.node-system-page {
  font-family: var(--font-sans, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
}

/* Keep the footer at the real mobile viewport boundary on short states. The
   first declaration supports older browsers; dvh follows the changing Chrome
   and Safari toolbar height where it is available. */
body.node-system-page:is(.workflow-page, .legal-page) {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body.node-system-page.workflow-page > .app-shell,
body.node-system-page.legal-page > .legal-page__main {
  flex: 1 0 auto;
}

body.node-system-page.workflow-page > .app-shell {
  min-height: calc(100vh - 4.5rem);
  min-height: calc(100dvh - 4.5rem);
}

.px-skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 9px 12px;
  border-radius: 8px;
  color: #071006;
  background: var(--accent);
  font-size: 12px;
  font-weight: 800;
  transform: translateY(-160%);
}

.px-skip-link:focus { transform: translateY(0); }

.px-shell-status {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.px-maintenance-banner {
  min-height: 38px;
  padding: 7px max(18px, calc((100vw - 1240px) / 2));
  border-top: 1px solid color-mix(in srgb, #d68a19 32%, var(--line, #d8dde7));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--text, #171a21);
  background: color-mix(in srgb, #d68a19 12%, var(--surface-1, #fff));
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}

.px-maintenance-banner[hidden] { display: none; }
.px-maintenance-banner__icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  flex: none;
  color: #fff;
  background: #b66b06;
  font-size: 11px;
  font-weight: 900;
}
.px-maintenance-banner > strong { font-size: 10px; }
.px-maintenance-banner__admin {
  margin-left: 3px;
  padding: 3px 7px;
  border: 1px solid color-mix(in srgb, #d68a19 36%, var(--line, #d8dde7));
  border-radius: 999px;
  background: color-mix(in srgb, #d68a19 8%, var(--surface-2, #f6f7fa));
  font-size: 9px;
  font-weight: 800;
}
.px-maintenance-banner__admin.is-clear {
  border-color: color-mix(in srgb, #21a36c 52%, var(--line, #d8dde7));
  color: #116842;
  background: color-mix(in srgb, #21a36c 12%, var(--surface-2, #f6f7fa));
}

html[data-theme="dark"] .px-maintenance-banner {
  border-top-color: #725321;
  color: #fff8e8;
  background: #2a2318;
}
html[data-theme="dark"] .px-maintenance-banner__admin {
  border-color: #71552d;
  color: #fff8e8;
  background: #151922;
}
html[data-theme="dark"] .px-maintenance-banner__admin.is-clear {
  border-color: #2c8c65;
  color: #aef0d2;
  background: #14271f;
}

.px-maintenance-dialog {
  width: min(430px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid var(--line-strong, #c6ccd8);
  border-radius: 16px;
  color: var(--text, #171a21);
  background: var(--surface-1, #fff);
  box-shadow: var(--elevation-3, 0 24px 70px rgba(13, 19, 32, .24));
}
.px-maintenance-dialog::backdrop { background: rgba(9, 14, 24, .46); backdrop-filter: blur(3px); }
.px-maintenance-dialog__card { padding: 24px; }
.px-maintenance-dialog__eyebrow {
  color: #b66b06;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.px-maintenance-dialog h2 { margin: 7px 0 0; color: inherit; font-size: 21px; }
.px-maintenance-dialog p { margin: 10px 0 20px; color: var(--muted, #667085); font-size: 12px; line-height: 1.55; }
.px-maintenance-dialog button {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--action-primary-border, transparent);
  border-radius: 10px;
  color: var(--action-primary-text, #fff);
  background: var(--action-primary-bg, #102d67);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.px-maintenance-dialog button:hover { background: var(--action-primary-bg-hover, #173b80); }
.px-maintenance-dialog button:focus-visible { outline: 3px solid var(--color-focus, #4a7cff); outline-offset: 3px; }

.px-generation-action[data-maintenance-disabled="true"]:not(.is-generating):not([aria-busy="true"]) {
  filter: saturate(.2);
  opacity: .58;
  cursor: not-allowed !important;
}

.px-support-badge {
  position: fixed;
  right: max(0.75rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 90;
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid var(--action-primary-border);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--action-primary-text);
  background: var(--action-primary-bg);
  box-shadow: var(--elevation-2);
  font-size: var(--type-body-small);
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  transition: transform 160ms ease-out, background-color 160ms ease-out;
}

.px-support-badge svg { width: 1.125rem; height: 1.125rem; flex: none; }
.px-support-badge:hover { color: var(--action-primary-text); background: var(--action-primary-bg-hover); transform: translateY(-2px); }
.px-support-badge:active { background: var(--action-primary-bg-active); transform: translateY(0); }
.px-support-badge:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }

@media (max-width: 560px) {
  .px-maintenance-banner {
    padding: 8px 12px;
    display: grid;
    grid-template-columns: auto auto auto;
    align-items: center;
    justify-content: center;
    column-gap: 5px;
    row-gap: 6px;
    font-size: 9px;
    text-align: center;
  }
  .px-maintenance-banner__icon { width: 17px; height: 17px; font-size: 10px; }
  .px-maintenance-banner > strong,
  .px-maintenance-banner #px-maintenance-banner-message { white-space: nowrap; }
  .px-maintenance-banner > strong { font-size: 9px; }
  .px-maintenance-banner__admin {
    grid-column: 1 / -1;
    justify-self: center;
    margin-left: 0;
    text-align: center;
  }
  .px-support-badge {
    right: max(0.5rem, env(safe-area-inset-right));
    bottom: max(0.5rem, env(safe-area-inset-bottom));
    width: 44px;
    padding: 0;
    border-radius: 50%;
  }
  .px-support-badge span { display: none; }
}

@media print { .px-support-badge { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .px-support-badge { transition: none; }
}

[data-pxltab-shared-header] {
  display: block;
  min-height: 4.5rem;
}

[data-pxltab-shared-footer] {
  display: block;
  min-height: 20rem;
}

.px-footer .version-pill {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
}

/* The copied Debug strip identifies the environment; the reference User view
   does not place the diagonal Debug watermark over its content or footer. */
body[data-site-environment="debug_staging"]::before { content: none; }

/* Header popovers are part of the shared shell. Keep their final state here so
   content-page styles cannot make them diverge from the Generation page. */
.node-system-page .px-language-menu .px-menu-button[aria-checked="true"],
.node-system-page .px-language-menu .px-menu-button[aria-checked="true"]:not(:disabled):hover {
  border-color: rgba(74, 201, 148, 0.88);
  color: #ffffff;
  background: var(--action-generation-gradient);
  box-shadow: 0 8px 20px rgba(10, 25, 49, 0.20);
}

.node-system-page .px-language-menu .px-menu-button[aria-checked="true"] :is(strong, small) {
  color: #ffffff !important;
}

.node-system-page .px-language-menu .px-menu-button[aria-checked="true"] small {
  color: rgba(255, 255, 255, 0.78);
}

.node-system-page .px-credit-menu { display: block; }
.node-system-page .px-credit-menu[hidden] { display: none; }
.node-system-page .px-credit-menu > :is(p, small) { margin: 0; }
.node-system-page .px-credit-menu > .px-credit-menu__copy { margin-top: 6px; }
.node-system-page .px-credit-menu > .px-credit-menu__usage { margin-top: 10px; }
.node-system-page .px-credit-menu > small { line-height: 1.55; }
.node-system-page .px-credit-menu > .px-menu__action {
  min-height: 40px;
  margin: 10px 0 0;
  padding-inline: 14px;
}

/* These containers receive programmatic focus so assistive technology
   announces them. They are not interactive controls, so do not draw a large
   focus rectangle around the whole popover. Interactive children retain their
   normal focus-visible treatment. */
.node-system-page .px-menu[tabindex="-1"]:focus {
  outline: none;
}

/* Public image collections reveal one decoded image node over the current
   theme surface. No overlay layer or layout-changing loader is introduced. */
[data-px-image-host] {
  background-color: var(--color-canvas-subtle);
}

[data-px-image-host] > img {
  transition: opacity 180ms ease-out;
}

[data-px-image-host].is-loading > img,
[data-px-image-host].is-error > img {
  opacity: 0;
}

[data-px-image-host].is-ready > img {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .px-skip-link { transition: none; }
  [data-px-image-host] > img { transition: none; }
}
