/* PALMSTAT_W50_PRODUCTIONDOCUMENTS_20260822
 * The house drawer (.ui-drawer) and the Production Documents panel (.pdx-*).
 *
 * Tokens are the estate's own globals with fallbacks. This file declares no
 * palette of its own: two components sharing one theme from two sources of
 * truth will drift, and the drift always shows up on the client's screen.
 *
 * z-index sits in the .modal-backdrop band (500), NOT the reels-drawer band
 * (1190/1200). A UI.modal raised from inside this drawer then stacks by DOM
 * order rather than being buried underneath it.
 */

/* ------------------------------------------------------------ the drawer */

.modal-overlay.ui-drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 500;
  /* PALMSTAT_W63_NONMODAL_20260825 - scrim is pointer-transparent and paints nothing:
     the list behind the drawer stays readable and clickable (item 4, option 2). */
  pointer-events: none;
  background: transparent;
  opacity: 0;
  transition: opacity 220ms ease;
}
.modal-overlay.ui-drawer-scrim.on { opacity: 1; }

.ui-drawer {
  pointer-events: auto; /* PALMSTAT_W63 - panel itself stays fully interactive */
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 96vw);
  display: flex;
  flex-direction: column;
  background: var(--bg-card, #fff);
  color: var(--fg-primary, #111);
  border-left: 1px solid var(--border-subtle, #e5e7eb);
  box-shadow: -12px 0 40px rgba(0, 0, 0, .25);
  transform: translateX(101%);
  visibility: hidden;
  transition: transform 240ms cubic-bezier(.22, .61, .36, 1), visibility 0s linear 240ms;
}
/* visibility:hidden on the closed state with the delayed transition takes a
   closed drawer out of the accessibility tree without hiding it mid-slide. */
.ui-drawer.on {
  transform: translateX(0);
  visibility: visible;
  transition: transform 240ms cubic-bezier(.22, .61, .36, 1), visibility 0s linear 0s;
}

@media (prefers-reduced-motion: reduce) {
  .modal-overlay.ui-drawer-scrim,
  .ui-drawer { transition: none; }
}

.ui-drawer__header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px 12px 18px;
  border-bottom: 1px solid var(--border-subtle, #e5e7eb);
  flex: 0 0 auto;
}
.ui-drawer__heading { flex: 1 1 auto; min-width: 0; }
.ui-drawer__title {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--fg-primary, #111);
}
.ui-drawer__sub {
  font-size: .78rem;
  color: var(--fg-secondary, #6b7280);
  margin-top: 3px;
  line-height: 1.4;
}
.ui-drawer__close {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--border-subtle, #e5e7eb);
  border-radius: var(--r-md, 8px);
  width: 30px;
  height: 30px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--fg-secondary, #6b7280);
}
.ui-drawer__close:hover { background: var(--bg-active, #f3f4f6); color: var(--fg-primary, #111); }
.ui-drawer__close:focus-visible { outline: 2px solid var(--brand-500, #2563eb); outline-offset: 2px; }

.ui-drawer__body {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 18px 24px 18px;
}

/* ------------------------------------------- production documents content */

.pdx-scope {
  font-size: .76rem;
  color: var(--fg-secondary, #6b7280);
  background: var(--bg-active, #f3f4f6);
  border-radius: var(--r-md, 8px);
  padding: 8px 10px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.pdx-tabs { margin-bottom: 12px; }

.pdx-stage { margin-bottom: 16px; }
.pdx-stage__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle, #e5e7eb);
  margin-bottom: 8px;
}
.pdx-stage__label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--fg-secondary, #6b7280);
}
.pdx-stage__count {
  font-size: .7rem;
  color: var(--fg-tertiary, #9ca3af);
  white-space: nowrap;
}
.pdx-stage__empty {
  font-size: .78rem;
  color: var(--fg-tertiary, #9ca3af);
  padding: 2px 0 6px 0;
  line-height: 1.5;
}

.pdx-doc {
  border: 1px solid var(--border-subtle, #e5e7eb);
  border-radius: var(--r-md, 8px);
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--bg-card, #fff);
}
.pdx-doc__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.pdx-doc__title {
  font-weight: 600;
  font-size: .86rem;
  line-height: 1.35;
  color: var(--fg-primary, #111);
  word-break: break-word;
}
.pdx-doc__ref {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: .72rem;
  color: var(--fg-tertiary, #9ca3af);
  white-space: nowrap;
}
.pdx-doc__facts {
  font-size: .74rem;
  color: var(--fg-secondary, #6b7280);
  margin-top: 5px;
  line-height: 1.6;
}
.pdx-doc__actions { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }

.pdx-doc__note {
  margin-top: 8px;
  padding: 7px 9px;
  border-radius: var(--r-sm, 6px);
  font-size: .74rem;
  line-height: 1.5;
  background: var(--warn-bg, #fff7ed);
  color: var(--warn-fg, #9a3412);
  border: 1px solid var(--warn-border, #fed7aa);
}

/* The link badges reuse the Job Card 360 vocabulary deliberately, so the two
   screens cannot describe the same relationship with different words.
   .badge--success is not used anywhere here: it carries a global infinite
   pulse animation, which inside a scrolling panel never stops. */
.pdx-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: var(--r-pill, 999px);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pdx-badge--hard     { background: #e7f6ed; color: #0e9048; }
.pdx-badge--inferred { background: #fdf3e2; color: #9a5b04; }
.pdx-badge--derived  { background: #eef2ff; color: #3730a3; }
.pdx-badge--warn     { background: #fee2e2; color: #b91c1c; }

/* ----------------------------------------------------------------- logs */

.pdx-log { list-style: none; margin: 0; padding: 0; }
.pdx-log__item {
  position: relative;
  padding: 0 0 12px 16px;
  border-left: 2px solid var(--border-subtle, #e5e7eb);
}
.pdx-log__item:last-child { border-left-color: transparent; }
.pdx-log__dot {
  position: absolute;
  left: -5px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-500, #2563eb);
}
.pdx-log__what { font-size: .82rem; font-weight: 600; color: var(--fg-primary, #111); line-height: 1.35; }
.pdx-log__detail { font-size: .74rem; color: var(--fg-secondary, #6b7280); margin-top: 2px; line-height: 1.5; }
.pdx-log__meta { font-size: .7rem; color: var(--fg-tertiary, #9ca3af); margin-top: 3px; }

.pdx-caption {
  font-size: .72rem;
  color: var(--fg-tertiary, #9ca3af);
  line-height: 1.55;
  border-top: 1px solid var(--border-subtle, #e5e7eb);
  margin-top: 14px;
  padding-top: 10px;
}

.pdx-summary {
  font-size: .76rem;
  line-height: 1.55;
  border: 1px dashed var(--border-subtle, #e5e7eb);
  border-radius: var(--r-md, 8px);
  padding: 9px 11px;
  margin-bottom: 12px;
  color: var(--fg-secondary, #6b7280);
}

/* --------------------------------------------- the per-row list affordance */

.pdx-open-btn { white-space: nowrap; }
