/* ════════════════════════════════════════════════════════════════════════════
   PROCUREMENT DRAWER (mqr/procurementDrawer.jsx) — the Security / Privacy / Status drawer the
   /enterprise rail and security-review cards open, plus the "Back to Enterprise" bar on /security
   and /sla. Same language as the enterprise page: the dark ink band of the hero and the identity
   console carries the drawer's header and tabs; the body sits on the theme's own surface so it
   reads in light and dark. Right-side drawer on desktop, bottom sheet at ≤640px.
   ════════════════════════════════════════════════════════════════════════════ */

.pd-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Security-review cards that open the drawer are <button>s: same look as the link cards. */
button.gov-sec__card { font: inherit; text-align: left; cursor: pointer; width: 100%; }
.gov-sec__card:focus-visible, .gov-rail a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* The rail is position:fixed — keep it still when the drawer hides the page scrollbar. */
@media (min-width: 1200px) { .gov-rail { right: calc(18px + var(--pd-sbw, 0px)); } }

.pd-root { position: fixed; inset: 0; z-index: 900; }
.pd-backdrop { position: absolute; inset: 0; background: rgba(8, 10, 16, 0.48); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: pd-fade .22s ease both; }
.pd-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); display: flex; flex-direction: column;
  background: var(--bg); color: var(--fg); border-left: 1px solid var(--border);
  box-shadow: -30px 0 80px -40px rgba(0, 0, 0, 0.55); animation: pd-in-right .28s cubic-bezier(.22, .61, .36, 1) both; outline: none; }
.pd-root.is-closing .pd-backdrop { animation: pd-fade-out .2s ease both; }
.pd-root.is-closing .pd-panel { animation: pd-out-right .2s ease-in both; }

/* Header: the enterprise ink band, title + close, then the tabs sitting on its bottom edge. */
.pd-head { --pd-ink: var(--ent-ink, #0c0e14); --pd-line: var(--ent-line, rgba(255,255,255,0.10)); --pd-dim: var(--ent-dim, rgba(255,255,255,0.62));
  flex: none; color: #fff; padding: 18px 20px 0;
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 55%), var(--pd-ink); }
.pd-grab { display: none; }
.pd-head__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pd-title { margin: 0; font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; color: #fff; }
.pd-close { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--pd-line);
  background: rgba(255,255,255,0.04); color: #fff; cursor: pointer; transition: background .15s, border-color .15s; }
.pd-close:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.24); }
.pd-close:focus-visible, .pd-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pd-tabs { display: flex; gap: 4px; margin-top: 16px; }
.pd-tab { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px 13px; border: 0; background: none;
  font: inherit; font-size: 14px; font-weight: 500; color: var(--pd-dim); cursor: pointer; border-radius: 8px 8px 0 0; transition: color .15s; }
.pd-tab:hover { color: #fff; }
.pd-tab.is-active { color: #fff; font-weight: 600; }
.pd-tab.is-active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.pd-tab svg { opacity: 0.85; }

/* Body */
.pd-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px 22px 30px; animation: pd-fade .2s ease both; }
.pd-h { margin: 0; font-family: var(--font-display); font-size: 21px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; }
.pd-lead { margin: 8px 0 0; font-size: 14px; line-height: 1.55; color: var(--fg-muted); text-wrap: pretty; }
.pd-sub { margin: 26px 0 10px; font-family: var(--font-display); font-size: 14.5px; font-weight: 600; }

/* Security: one ledger of answers — icon, the question it settles, the answer. */
.pd-rows { list-style: none; margin: 18px 0 0; padding: 0; }
.pd-row { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 14px; padding: 16px 0; border-top: 1px solid var(--border); }
.pd-row:last-child { border-bottom: 1px solid var(--border); }
.pd-row__ic { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: var(--accent); background: var(--accent-bg-soft); }
.pd-row__t { display: block; font-weight: 600; font-size: 14.5px; line-height: 1.35; padding-top: 6px; }
.pd-row__b { margin: 5px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--fg-muted); }

/* Where the data lives — a compact key: what · where (where in the mono of the enterprise serials). */
.pd-loc { margin-top: 8px; }
.pd-loc__rows { margin: 0; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--bg-elev); overflow: hidden; }
.pd-loc__row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 9px 12px; font-size: 13px; line-height: 1.4; }
.pd-loc__row + .pd-loc__row { border-top: 1px solid var(--border); }
.pd-loc__row dt { color: var(--fg); }
.pd-loc__row dd { margin: 0; flex: none; max-width: 48%; text-align: right; font-family: var(--ent-mono, ui-monospace, Menlo, monospace); font-size: 11.5px; color: var(--fg-muted); }
.pd-loc__note { margin: 8px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--fg-subtle, var(--fg-muted)); }

.pd-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 22px; }
.pd-actions__pack { text-decoration: none; }
.pd-more, .pd-ext { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--accent); text-decoration: none; }
.pd-more:hover, .pd-ext:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Privacy */
.pd-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pd-list li { position: relative; padding-left: 16px; font-size: 13.5px; line-height: 1.55; color: var(--fg-muted); }
.pd-list li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.pd-list__k { font-weight: 600; color: var(--fg); }
.pd-docs { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.pd-doc { display: flex; align-items: center; gap: 8px; padding: 12px 2px; border-bottom: 1px solid var(--border); font-size: 14px; font-weight: 600;
  color: var(--fg); text-decoration: none; }
.pd-doc svg { margin-left: auto; color: var(--accent); }
.pd-doc:hover { color: var(--accent); }

/* Status: the live reading, then the SLA. */
.pd-live { margin-top: 18px; padding: 16px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--bg-elev); min-height: 132px;
  display: flex; flex-direction: column; gap: 10px; }
.pd-live__msg, .pd-live__overall { display: flex; align-items: center; gap: 10px; margin: 0; }
.pd-live__msg { font-size: 14px; color: var(--fg-muted); }
.pd-live__overall { font-family: var(--font-display); font-size: 16.5px; font-weight: 600; }
.pd-live__comp { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.pd-live__state { font-weight: 600; font-size: 13px; }
.pd-live__state.is-good { color: var(--good); }
.pd-live__state.is-warn, .pd-live__state.is-maint { color: var(--warn); }
.pd-live__state.is-bad { color: var(--bad); }
.pd-live__upd { margin: 0; font-family: var(--ent-mono, ui-monospace, Menlo, monospace); font-size: 11.5px; color: var(--fg-subtle, var(--fg-muted)); }
.pd-live .pd-more { margin-top: auto; }
.pd-dot { position: relative; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--fg-subtle, #999); }
.pd-dot.is-good { background: var(--good); }
.pd-dot.is-warn, .pd-dot.is-maint { background: var(--warn); }
.pd-dot.is-bad { background: var(--bad); }
.pd-dot.is-beat::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--good); animation: pd-beat 2.4s ease-out infinite; }
.pd-dot.is-idle { animation: pd-blink 1.2s ease-in-out infinite alternate; }

.pd-sla { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: var(--radius-lg); border: 1px solid var(--border); margin-bottom: 14px; }
.pd-sla__n { font-family: var(--font-display); font-weight: 700; font-size: 30px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--accent); }
.pd-sla__lines { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px;
  font-size: 13px; line-height: 1.45; color: var(--fg-muted); }

/* Footer: the one conversion step, always in reach. */
.pd-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px;
  padding-bottom: max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--bg-elev); }
.pd-foot__t { font-size: 13.5px; color: var(--fg-muted); }
.pd-foot a { text-decoration: none; cursor: pointer; flex: none; }

/* Phones: a bottom sheet. */
@media (max-width: 640px) {
  .pd-panel { top: auto; left: 0; width: 100%; max-height: 88vh; max-height: 88dvh; border-left: 0; border-radius: 18px 18px 0 0; overflow: hidden;
    box-shadow: 0 -24px 60px -24px rgba(0, 0, 0, 0.5); animation-name: pd-in-up; }
  .pd-root.is-closing .pd-panel { animation-name: pd-out-down; }
  .pd-head { padding-top: 10px; }
  .pd-grab { display: block; width: 40px; height: 4px; border-radius: 4px; background: rgba(255,255,255,0.28); margin: 0 auto 10px; }
  .pd-tabs { margin-top: 12px; }
  .pd-tab { flex: 1; justify-content: center; padding-inline: 6px; }
  .pd-body { padding: 20px 18px 24px; }
  .pd-foot__t { display: none; }
  .pd-foot a { flex: 1; }
  .pd-foot a .forge-btn { width: 100%; justify-content: center; }
}

/* "← Back to Enterprise" on /security and /sla (?from=enterprise only). */
.pd-back { border-bottom: 1px solid var(--border); background: var(--bg-elev); }
.pd-back__a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 0; font-size: 13.5px; font-weight: 600; color: var(--fg); text-decoration: none; }
.pd-back__a svg { color: var(--accent); transition: transform .15s; }
.pd-back__a:hover { color: var(--accent); }
.pd-back__a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

@keyframes pd-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pd-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes pd-in-right { from { transform: translateX(100%); } to { transform: none; } }
@keyframes pd-out-right { from { transform: none; } to { transform: translateX(100%); } }
@keyframes pd-in-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes pd-out-down { from { transform: none; } to { transform: translateY(100%); } }
@keyframes pd-beat { 0% { transform: scale(1); opacity: 0.55; } 70%, 100% { transform: scale(2.6); opacity: 0; } }
@keyframes pd-blink { from { opacity: 0.35; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .pd-backdrop, .pd-panel, .pd-body, .pd-root.is-closing .pd-backdrop, .pd-root.is-closing .pd-panel { animation: none !important; }
  .pd-dot.is-beat::after, .pd-dot.is-idle { animation: none; }
}
