/* pqs-shell-stylesheet
   Shared page tokens and the small PQS badge. Every mini-app loads this file,
   or the vendored pqs-app-shell.css that includes it. The badge is a footer
   link to https://pqs.tools (P #2563EB, Q #0D9488, S #EA580C). It is not a
   fixed corner chip and it is not a bar in the middle of the page. */

.pqs-shell,
.pqs-page {
  --pqs-bg: #f4f6f9;
  --pqs-surface: #ffffff;
  --pqs-text: #141b26;
  --pqs-muted: #5b6676;
  --pqs-border: #e2e8f0;
  --pqs-sunken: #f4f6f9;
  --pqs-wash: color-mix(in srgb, var(--pqs-brand, #334155) 12%, #ffffff);
  --pqs-accent-text: var(--pqs-brand-ink, #1e293b);
  --pqs-code-bg: #141b26;
  --pqs-code-fg: #e6edf6;
  --pqs-shadow: 0 8px 24px rgba(20, 27, 38, 0.08);
  color: var(--pqs-text);
  background: transparent;
  color-scheme: light;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.pqs-shell[data-theme="dark"],
.pqs-page[data-theme="dark"] {
  --pqs-bg: #0d121a;
  --pqs-surface: #141b26;
  --pqs-text: #e6edf6;
  --pqs-muted: #9aa8ba;
  --pqs-border: #2c3a4c;
  --pqs-sunken: #0d121a;
  --pqs-wash: color-mix(in srgb, var(--pqs-brand, #334155) 24%, #141b26);
  --pqs-accent-text: color-mix(in srgb, var(--pqs-brand, #60a5fa) 68%, white);
  --pqs-code-bg: #0b1018;
  --pqs-code-fg: #e6edf6;
  --pqs-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  color: var(--pqs-text);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  .pqs-shell:not([data-theme="light"]),
  .pqs-page:not([data-theme="light"]) {
    --pqs-bg: #0d121a;
    --pqs-surface: #141b26;
    --pqs-text: #e6edf6;
    --pqs-muted: #9aa8ba;
    --pqs-border: #2c3a4c;
    --pqs-sunken: #0d121a;
    --pqs-wash: color-mix(in srgb, var(--pqs-brand, #334155) 24%, #141b26);
    --pqs-accent-text: color-mix(in srgb, var(--pqs-brand, #60a5fa) 68%, white);
    --pqs-code-bg: #0b1018;
    --pqs-code-fg: #e6edf6;
    --pqs-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    color: var(--pqs-text);
    color-scheme: dark;
  }
}

.pqs-shell,
.pqs-page,
.pqs-shell *,
.pqs-page *,
.pqs-shell *::before,
.pqs-page *::before,
.pqs-shell *::after,
.pqs-page *::after {
  box-sizing: border-box;
}

/* The page is at least the viewport. The footer follows the content on a long
   page and sits on the bottom edge when the content is short. */
.pqs-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--pqs-bg);
}

.pqs-page > main,
.pqs-page > #root {
  flex: 1 0 auto;
}

body:has(> .pqs-page) {
  margin: 0;
}

body:has(> .pqs-footer) {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  display: flex;
  flex-direction: column;
}

body:has(> .pqs-footer) > main {
  flex: 1 0 auto;
}

.pqs-footer {
  position: static;
  margin-top: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 8px 16px;
  border-top: 1px solid var(--pqs-border);
  background: var(--pqs-surface);
  color: var(--pqs-text);
}

pqs-app-badge {
  display: contents;
}

.pqs-shell :focus-visible,
.pqs-page :focus-visible {
  outline: 2px solid var(--pqs-brand, #2563eb);
  outline-offset: 2px;
}

.pqs-badge {
  position: static;
  inset: auto;
  z-index: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 32px;
  padding: 7px 9px 6px;
  border: 1px solid var(--pqs-border);
  border-radius: 10px;
  background: var(--pqs-surface);
  box-shadow: none;
  overflow: visible;
  line-height: 0;
  text-decoration: none;
}

.pqs-shell .pqs-badge__mark,
.pqs-shell .pqs-badge__mark svg,
.pqs-footer .pqs-badge__mark,
.pqs-footer .pqs-badge__mark svg {
  height: 16px;
  width: auto;
  max-width: none;
  display: block;
  object-fit: contain;
  object-position: center;
  overflow: visible;
  border-radius: 0;
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.pqs-badge:hover {
  transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
  .pqs-badge:hover { transform: none; }
}

.pqs-enable-notice {
  width: min(760px, 100%);
  margin: 16px 0;
  padding: 16px 18px;
  border: 1px solid var(--pqs-border);
  border-left: 4px solid var(--pqs-brand, #2563eb);
  border-radius: 12px;
  background: var(--pqs-surface);
  color: var(--pqs-text);
}

.pqs-enable-notice h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  line-height: 1.3;
}

.pqs-enable-notice p,
.pqs-enable-notice li {
  margin: 8px 0;
}

.pqs-enable-notice a {
  color: var(--pqs-accent-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pqs-enable-notice .pqs-hosts {
  list-style: none;
  margin: 8px 0;
  padding: 0;
}

.pqs-enable-notice code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875rem;
}

.pqs-enable-notice pre {
  margin: 8px 0;
  padding: 10px 12px;
  overflow-x: auto;
  border-radius: 8px;
  background: var(--pqs-code-bg);
  color: var(--pqs-code-fg);
}

@media print {
  .pqs-footer,
  .pqs-badge { display: none !important; }
}
