/* ============================================================
   PSG Performance Hub: app-shell chrome layer.
   Builds ON the design system (loaded via ds-base.js): every
   token, the status palette, dark mode, and .img-placeholder
   come from there. Only app-specific chrome lives here.
   ============================================================ */

/* Box model reset: inputs/buttons style with width:100% + padding;
   without this they overflow their container by the padding amount. */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 68px;
  --topbar-h: 60px;
}

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--canvas-soft);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

performance-hub { display: block; height: 100%; }

/* Eyebrow: app-density variant of the system's mono eyebrow */
.eyebrow {
  font-family: var(--font-label);
  font-size: 11px; line-height: 16px; font-weight: 500;
  letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--mute); margin: 0;
}

/* Display titles use Virage: V1: weight 600, natural tracking */
.title-xl { font-family: var(--font-display); font-weight: 600; letter-spacing: 0; color: var(--ink); margin: 0; line-height: 1.04; }
.title-lg { font-family: var(--font-display); font-weight: 600; letter-spacing: 0; color: var(--ink); margin: 0; line-height: 1.08; }

/* Generic interactive surface */
.app-card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--elev-2);
}

/* Scrollbars */
.scroll { scrollbar-width: thin; scrollbar-color: var(--hairline-strong) transparent; }
.scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll::-webkit-scrollbar-thumb { background: var(--hairline-strong); border-radius: 999px; border: 3px solid var(--canvas-soft); }
.scroll::-webkit-scrollbar-track { background: transparent; }

/* Focus ring (accent) */
.focusable:focus-visible,
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button { font-family: inherit; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Entry transition */
@keyframes fadeUp { from { transform: translateY(10px); } to { transform: translateY(0); } }
.fade-up { animation: fadeUp .28s cubic-bezier(.22,.61,.36,1); }
.fade-in { animation: none; }

/* ============================================================
   Mobile: below 820px the sidebar becomes a drawer (handled in
   JS). Fixed two-column screen layouts collapse to one column so
   content is never crushed. Inline grid styles need !important. */
@media (max-width: 820px) {
  .mobile-stack { grid-template-columns: 1fr !important; }
  .kb-cols { grid-template-columns: 1fr !important; }
  .kb-row-actions, .kb-row-ftype { display: none !important; }
}
