/* Styling for the <qp-shell> custom element (shell.js) — sidebar (navy,
   guideline §4), top bar, footer, plus a handful of shared utility classes
   (.qp-btn, .qp-visually-hidden) used across pages/components. */

.qp-shell {
  display: flex;
  min-height: 100vh;
}

.qp-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--text);
  padding: 8px 16px;
  z-index: 100;
}
.qp-skip-link:focus {
  left: 8px;
  top: 8px;
}

.qp-sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  width: var(--shell-sidebar-width);
  flex-shrink: 0;
  padding: 16px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.qp-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  padding: 0 20px 16px;
  font-size: 1rem;
}

.qp-sidebar-brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--accent);
  display: inline-block;
}

.qp-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.qp-nav-link {
  display: block;
  padding: 10px 20px;
  color: var(--sidebar-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  border-left: 3px solid transparent;
  min-height: 24px;
}

.qp-nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--sidebar-text);
}

.qp-nav-link-active {
  border-left-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
  color: var(--sidebar-text);
  font-weight: 600;
}

.qp-shell-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.qp-topbar {
  height: var(--shell-topbar-height);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.qp-sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text);
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
}

/* Turn 18 accessibility QA: guideline §4 requires green badge text
   specifically ("PRODUCTION" in green), so this can't switch to neutral
   text like the general status-pill fix below — instead the tint dropped
   from 16% to 2% (still visibly green-tinted, not a bordered-white chip)
   and the text uses --accent-text-safe (tokens.css) instead of --positive;
   computed to clear 4.5:1 in both themes at this tint level. */
.qp-edition-badge {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-text-safe);
  background: color-mix(in srgb, var(--positive) 2%, var(--surface));
  border: 1px solid var(--positive);
  border-radius: 999px;
  padding: 2px 10px;
}

.qp-search {
  flex: 1;
  max-width: 420px;
}

.qp-search input {
  width: 100%;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  padding: 0 10px;
  font-size: 0.875rem;
}

.qp-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.qp-current-operator {
  font-size: 0.75rem;
  opacity: 0.8;
}

.qp-main-content {
  flex: 1;
}

.qp-footer {
  display: flex;
  gap: 16px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  opacity: 0.7;
}

.qp-footer a {
  color: var(--info);
}

.qp-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* sm — sidebar collapses to a drawer (guideline §1) */
@media (max-width: 767px) {
  .qp-sidebar-toggle {
    display: inline-block;
  }
  .qp-sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    z-index: 50;
    transition: left 0.2s ease;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.3);
  }
  .qp-sidebar.qp-sidebar-open {
    left: 0;
  }
  .qp-search {
    display: none;
  }
}
