/* =============================================================
   DESIGN SYSTEM — "Modernist" redesign
   Depends on: tokens.css
   Shared structural classes only — no page-specific selectors.
   Component files (home.css, log.css, ...) consume these classes
   and layer their own page-specific rules on top.
   ============================================================= */

/* ── App background wash ───────────────────────────────────── */
.bg-textured {
  position: relative;
  background: var(--bg-hero-gradient);
}
.bg-textured::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.11;
  mix-blend-mode: overlay;
  background-image: var(--bg-noise-overlay);
}

/* ── Pods (cards) ───────────────────────────────────────────── */
.pod {
  border-radius: var(--radius-pod);
  background: var(--pod-bg);
  border: 1px solid var(--pod-border);
  box-shadow: var(--pod-bevel);
  padding: 13px 17px; /* spec: 12-15px vertical, 15-18px horizontal */
}
.pod--alt { background: var(--pod-bg-alt); }
.pod--hero {
  background: var(--pod-bg-hero);
  border-color: var(--border-featured);
  box-shadow: var(--pod-shadow-hero);
}
.pod--flat {
  box-shadow: none;
  border-color: rgba(116, 138, 126, 0.14);
}
.pod--warning { border-color: var(--warning-border); }
.pod--danger { border-color: var(--border-alert); }

/* PodHeader — eyebrow flush left, faint meta right, baseline aligned */
.pod-kicker {
  font-family: var(--font-label);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--text-label);
  text-transform: uppercase;
}
.pod-meta {
  font-family: var(--font-label);
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-faint);
}
.pod-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  line-height: 1.05;
}
.pod-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

/* ── Pills / segmented sub-nav ──────────────────────────────── */
.pill-nav {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}
.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  padding: 7px 13px;
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
/* Invisible hit-area expansion — keeps the mockup's visual pill height
   (~29px) while meeting the 44px touch-target acceptance check. Doesn't
   change layout since the pseudo-element is absolutely positioned. */
.pill::before {
  content: "";
  position: absolute;
  inset: -8px -2px;
}
.pill.active,
.pill[aria-selected="true"] {
  background: var(--pill-bg-active);
  border-color: transparent;
  color: var(--pill-text-active);
}
.pill--warning {
  border-color: var(--warning-border);
  color: var(--warning-gold);
}

/* ── Stat tiles ─────────────────────────────────────────────── */
.stat-tile {
  flex: 1;
  border-radius: var(--radius-md);
  background: var(--pod-bg);
  border: 1px solid var(--pod-border);
  box-shadow: var(--pod-bevel);
  padding: 9px 11px;
}
.stat-tile-label {
  font-family: var(--font-label);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--text-label);
  text-transform: uppercase;
}
.stat-tile-value {
  font-family: var(--font-display);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}

/* ── Primary CTA capsule ────────────────────────────────────── */
.cta-capsule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  border-radius: var(--radius-pill);
  padding: 0 8px 0 20px;
  background: var(--pill-bg-active);
  box-shadow: var(--cta-shadow);
  border: none;
  cursor: pointer;
  width: 100%;
  color: var(--pill-text-active);
  font-family: var(--font-display);
  font-size: 17px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.cta-capsule--warning { background: linear-gradient(135deg, rgba(168, 124, 56, .9), rgba(109, 81, 36, .9)); }
.cta-capsule--danger { background: var(--danger-grad); }
.cta-capsule-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(6, 12, 9, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

/* Secondary (outline) capsule used alongside a primary CTA */
.cta-capsule-outline {
  flex: 1;
  text-align: center;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.038);
  border: 1px solid var(--pod-border);
  padding: 9px 0;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--secondary-text);
  cursor: pointer;
}

/* ── Bottom-nav FAB ─────────────────────────────────────────── */
.bn-fab {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: var(--fill-nav-center);
  box-shadow: var(--shadow-nav-center);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pill-text-active);
  cursor: pointer;
  flex: none;
}
.bn-fab svg { display: block; }

/* ── Libraries screen (libraries.js) ──────────────────────────── */
#librariesContent { padding: 0 6px; }
#librariesContent .pod-row { margin-bottom: 8px; }

/* ── Interaction states (global) ──────────────────────────────
   Applied broadly (pods, pills, capsules, tiles, plain buttons) so
   every interactive surface gets a consistent hover/active/focus/
   disabled treatment instead of one-off per-component rules. */

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.pod, .pill, .cta-capsule, .stat-tile, .all-hub-tile, .bn-item, .bn-fab {
  transition: background-color .15s ease, border-color .15s ease,
              box-shadow .15s ease, transform .1s ease, opacity .15s ease;
}

@media (hover: hover) {
  .pod:hover, .all-hub-tile:hover {
    background: var(--pod-bg-hover);
    border-color: var(--border-hover);
  }
  .pill:not(.active):hover {
    background: var(--elevated-bg);
    border-color: rgba(116, 138, 126, 0.28);
  }
  .cta-capsule:hover, .bn-fab:hover { filter: brightness(1.06); }
}

.cta-capsule:active,
.pill:active,
.all-hub-tile:active,
.bn-fab:active,
button:active {
  transform: scale(0.985);
  box-shadow: none;
}

button:disabled,
.cta-capsule:disabled,
.pill:disabled,
[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Utility ────────────────────────────────────────────────── */
.tabular-nums { font-variant-numeric: tabular-nums; }

/* Loading skeleton — same geometry as the content it stands in for,
   so nothing shifts layout when real content replaces it. */
.skeleton {
  background: rgba(116, 138, 126, 0.12);
  border-radius: inherit;
  color: transparent !important;
  pointer-events: none;
}
.skeleton * { visibility: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .skeleton { animation: skeletonPulse 1.4s ease-in-out infinite; }
}
@keyframes skeletonPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
