/* PANEL-60 Phase 11, Workstream BP (items 244-250) — THE
   design-token source for the whole portal (item 245).

   This file is the single source every Phase-11 page
   consumes. It defines CSS custom properties ONLY, plus
   BP-scoped component primitives (.p60bp-*). It contains
   NO global element rules, NO .card / body / html rules
   and NO --pp-* / theme variable redefinitions, so the
   item-56 theme gallery, BH personal appearance and BJ
   public looks resolve exactly as before — tokens layer
   UNDER themes, never over them.

   Consumption contract (item 245): a page opts in by
   putting class="p60bp-scope" on its root element (or by
   using the .p60bp-* primitives directly). A page that
   never opts in renders byte-for-byte as today. Token
   defaults preserve current phone rendering (mobile law
   202-206); the desktop type scale (item 250) applies
   only inside min-width media queries, only to opted-in
   elements.

   Reduced motion (items 246/262): every transition and
   animation in this file is stilled by BOTH signals —
   the device media query (prefers-reduced-motion) and
   the in-app state, which is the class "dp-reduce-motion"
   on <html> written by display_prefs.prefs_class (the
   same signal WS-BR's item-262 toggle surface writes
   through display_prefs.save_prefs). p60bp.js reads the
   same two signals.
*/

:root {
  /* ---- item 245: spacing scale ---- */
  --p60-space-0: 0;
  --p60-space-1: 4px;
  --p60-space-2: 8px;
  --p60-space-3: 12px;
  --p60-space-4: 16px;
  --p60-space-5: 20px;
  --p60-space-6: 24px;
  --p60-space-8: 32px;
  --p60-space-10: 40px;
  --p60-space-12: 48px;

  /* ---- item 245: card scale ---- */
  --p60-card-pad: 16px 18px;
  --p60-card-pad-compact: 10px 12px;
  --p60-card-radius: 12px;
  --p60-card-border: 1px solid var(--pp-hairline, #26262b);
  --p60-card-bg: var(--pp-panel, #161618);
  --p60-card-shadow: 0 6px 24px rgba(0, 0, 0, .45);
  --p60-card-gap: 16px;

  /* ---- item 245: radius scale ---- */
  --p60-radius-sm: 6px;
  --p60-radius-md: 10px;

  /* ---- item 245: type scale (all viewports) ---- */
  --p60-font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --p60-text-xs: .72rem;
  --p60-text-sm: .85rem;
  --p60-text-base: .95rem;
  --p60-text-lg: 1.1rem;
  --p60-text-xl: 1.3rem;
  --p60-line-tight: 1.2;
  --p60-line-body: 1.55;

  /* ---- item 250: titles — phone/default sizes first.
     These match today's rendering (main h1 is 1.7rem);
     the larger display sizes are APPLIED only under the
     min-width block at the end of this file. ---- */
  --p60-title-page: 1.7rem;
  --p60-title-section: 1.25rem;
  --p60-display-sm: 2rem;
  --p60-display-md: 2.6rem;
  --p60-display-lg: 3.2rem;
  --p60-display-xl: 4rem;

  /* ---- item 249: ONE status colour language.
     Colourblind-safe pairs: every status also carries an
     icon + a text label (see tokens60bp.STATUS_MAP); the
     colour here is never the only carrier of meaning.
     Blue/orange/purple/teal separation is kept distinct
     under common colour-vision deficiencies. ---- */
  --p60-status-live: #2f9e44;
  --p60-status-live-bg: rgba(47, 158, 68, .14);
  --p60-status-delivered: #1971c2;
  --p60-status-delivered-bg: rgba(25, 113, 194, .14);
  --p60-status-review: #e8590c;
  --p60-status-review-bg: rgba(232, 89, 12, .14);
  --p60-status-pending: #f08c00;
  --p60-status-pending-bg: rgba(240, 140, 0, .14);
  --p60-status-draft: #868e96;
  --p60-status-draft-bg: rgba(134, 142, 150, .16);
  --p60-status-attention: #d6336c;
  --p60-status-attention-bg: rgba(214, 51, 108, .14);
  --p60-status-takedown: #a61e4d;
  --p60-status-takedown-bg: rgba(166, 30, 77, .16);
  --p60-status-neutral: #5c7cfa;
  --p60-status-neutral-bg: rgba(92, 124, 250, .14);

  /* ---- item 246: micro-transitions ---- */
  --p60-dur-fast: 120ms;
  --p60-dur-med: 200ms;
  --p60-ease: ease-out;
  --p60-transition-state: opacity var(--p60-dur-fast) var(--p60-ease), transform var(--p60-dur-fast) var(--p60-ease), background-color var(--p60-dur-med) var(--p60-ease);

  /* ---- item 247: skeleton primitives ---- */
  --p60-skel-bg: var(--pp-hairline, #26262b);
  --p60-skel-shine: rgba(255, 255, 255, .07);
  --p60-skel-radius: 8px;
  --p60-skel-line-h: 14px;

  /* ---- item 248: designed empty states ---- */
  --p60-empty-pad: 32px 24px;
  --p60-empty-border: 1px dashed var(--pp-hairline, #33333a);
  --p60-empty-bg: var(--pp-panel, #141416);

  /* ---- item 244: artwork-forward header ---- */
  --p60-header-scrim: linear-gradient(100deg, rgba(5, 5, 8, .78) 0%, rgba(5, 5, 8, .55) 55%, rgba(5, 5, 8, .35) 100%);
  --p60-header-blur: blur(6px);
  --p60-header-min-h: 148px;

  /* ---- focus (shared with item 261 surfaces) ---- */
  --p60-focus-ring: 0 0 0 3px var(--pp-accent, #f5b301);
}

/* ============================================================
   Opt-in scope + primitives. Everything below is scoped to
   .p60bp-* classes — nothing here can move a page that has
   not opted in.
   ============================================================ */

.p60bp-scope {
  font-family: var(--p60-font-family);
  line-height: var(--p60-line-body);
}
.p60bp-scope .p60bp-title {
  font-size: var(--p60-title-page);
  line-height: var(--p60-line-tight);
}
.p60bp-scope .p60bp-section-title {
  font-size: var(--p60-title-section);
  line-height: var(--p60-line-tight);
}
.p60bp-card {
  background: var(--p60-card-bg);
  border: var(--p60-card-border);
  border-radius: var(--p60-card-radius);
  box-shadow: var(--p60-card-shadow);
  padding: var(--p60-card-pad);
  margin-bottom: var(--p60-card-gap);
}
.p60bp-card--compact { padding: var(--p60-card-pad-compact); }

/* ---- item 249: the status pill. Icon + label + colour,
   always together; the modifier only changes colours. ---- */
.p60bp-status {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 20px; padding: 2px 10px;
  font-size: var(--p60-text-sm); font-weight: 600;
  white-space: nowrap; border: 1px solid currentColor;
  transition: var(--p60-transition-state);
}
.p60bp-status--live { color: var(--p60-status-live); background: var(--p60-status-live-bg); }
.p60bp-status--delivered { color: var(--p60-status-delivered); background: var(--p60-status-delivered-bg); }
.p60bp-status--in_review { color: var(--p60-status-review); background: var(--p60-status-review-bg); }
.p60bp-status--pending { color: var(--p60-status-pending); background: var(--p60-status-pending-bg); }
.p60bp-status--draft { color: var(--p60-status-draft); background: var(--p60-status-draft-bg); }
.p60bp-status--needs_attention { color: var(--p60-status-attention); background: var(--p60-status-attention-bg); }
.p60bp-status--takedown { color: var(--p60-status-takedown); background: var(--p60-status-takedown-bg); }
.p60bp-status--neutral { color: var(--p60-status-neutral); background: var(--p60-status-neutral-bg); }

/* ---- item 246: micro-transitions on state changes ---- */
.p60bp-tick {
  display: inline-flex; align-items: center; gap: 4px;
  opacity: 0; transform: translateY(2px);
  transition: var(--p60-transition-state);
  color: var(--p60-status-live); font-weight: 600;
}
.p60bp-tick--show { opacity: 1; transform: none; }
.p60bp-moved { transition: var(--p60-transition-state); }
.p60bp-moved--flash { background: var(--p60-status-delivered-bg); }

/* ---- item 247: skeleton loading primitives, shaped like
   the real layouts (list / detail / form). ---- */
.p60bp-skel { display: block; }
.p60bp-skel-line, .p60bp-skel-block, .p60bp-skel-thumb {
  background: var(--p60-skel-bg);
  border-radius: var(--p60-skel-radius);
  position: relative; overflow: hidden;
}
.p60bp-skel-line { height: var(--p60-skel-line-h); margin-bottom: var(--p60-space-2); }
.p60bp-skel-line--short { width: 45%; }
.p60bp-skel-line--title { height: 22px; width: 60%; }
.p60bp-skel-block { height: 96px; margin-bottom: var(--p60-space-3); }
.p60bp-skel-thumb { width: 56px; height: 56px; flex: 0 0 56px; }
.p60bp-skel-row { display: flex; gap: var(--p60-space-3); align-items: center; margin-bottom: var(--p60-space-3); }
.p60bp-skel-row .p60bp-skel-lines { flex: 1; }
.p60bp-skel-field { height: 38px; margin-bottom: var(--p60-space-3); }
.p60bp-skel-line::after, .p60bp-skel-block::after,
.p60bp-skel-thumb::after, .p60bp-skel-field::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--p60-skel-shine), transparent);
  animation: p60bp-shimmer 1.4s infinite;
}
@keyframes p60bp-shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

/* ---- item 248: designed empty states (ESC visual world:
   sun mark, token spacing, one plain next step). ---- */
.p60bp-empty {
  background: var(--p60-empty-bg);
  border: var(--p60-empty-border);
  border-radius: var(--p60-card-radius);
  padding: var(--p60-empty-pad);
  text-align: center; margin-bottom: var(--p60-card-gap);
}
.p60bp-empty-icon { font-size: 2rem; line-height: 1; display: block; margin-bottom: var(--p60-space-3); }
.p60bp-empty-title { font-size: var(--p60-text-lg); font-weight: 700; margin: 0 0 var(--p60-space-2); }
.p60bp-empty-line { margin: 0; }

/* ---- item 244: artwork-forward header. The release's
   OWN cover (set as --p60bp-cover by the template from
   tokens60bp's resolver) sits dimmed + blurred behind the
   existing header content; the scrim keeps text contrast.
   With no cover the modifier class renders the plain
   current header — no image at all. ---- */
.p60bp-art-header {
  position: relative; overflow: hidden;
  border-radius: var(--p60-card-radius);
  min-height: var(--p60-header-min-h);
  margin-bottom: var(--p60-card-gap);
}
.p60bp-art-header--cover {
  background-image: var(--p60bp-cover);
  background-size: cover; background-position: center;
}
.p60bp-art-scrim {
  position: absolute; inset: 0;
  background: var(--p60-header-scrim);
  backdrop-filter: var(--p60-header-blur);
  -webkit-backdrop-filter: var(--p60-header-blur);
}
.p60bp-art-content {
  position: relative; z-index: 1;
  padding: var(--p60-space-5);
  color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
}
.p60bp-art-header--plain .p60bp-art-content {
  color: inherit; text-shadow: none;
  padding: var(--p60-space-4) 0;
}

/* ---- item 246/262: reduced motion, BOTH signals ---- */
@media (prefers-reduced-motion: reduce) {
  .p60bp-tick, .p60bp-moved, .p60bp-status { transition: none; }
  .p60bp-skel-line::after, .p60bp-skel-block::after,
  .p60bp-skel-thumb::after, .p60bp-skel-field::after {
    animation: none;
  }
  .p60bp-tick { transform: none; }
}
html.dp-reduce-motion .p60bp-tick,
html.dp-reduce-motion .p60bp-moved,
html.dp-reduce-motion .p60bp-status { transition: none; }
html.dp-reduce-motion .p60bp-skel-line::after,
html.dp-reduce-motion .p60bp-skel-block::after,
html.dp-reduce-motion .p60bp-skel-thumb::after,
html.dp-reduce-motion .p60bp-skel-field::after {
  animation: none;
}
html.dp-reduce-motion .p60bp-tick { transform: none; }

/* ---- item 250: desktop typography scale. min-width
   ONLY, opted-in elements ONLY — phone rendering is the
   default above and is never touched here. ---- */
@media (min-width: 1024px) {
  .p60bp-scope .p60bp-display { font-size: var(--p60-display-md); line-height: var(--p60-line-tight); }
  .p60bp-scope .p60bp-title { font-size: var(--p60-display-sm); }
}
@media (min-width: 1440px) {
  .p60bp-scope .p60bp-display { font-size: var(--p60-display-lg); }
  .p60bp-scope .p60bp-title { font-size: var(--p60-display-md); }
}
