/*
 * Public Policies & Procedures Manual
 * Shared styling for the embed widget (Shadow DOM) + full-page reader.
 * Variables drive both light/dark themes and Docusaurus parity.
 */

:host,
:root {
  --pm-primary: #1a5276;
  --pm-primary-light: #1d5a82;
  --pm-primary-dark: #113952;
  --pm-on-primary: #ffffff;
  --pm-bg: #ffffff;
  --pm-bg-elev: #f6f8fb;
  --pm-bg-elev-2: #eef2f7;
  --pm-text: #1a2332;
  --pm-text-muted: #5b6b80;
  --pm-border: #e3e8ef;
  --pm-shadow: 0 8px 30px rgba(15, 30, 50, 0.18);
  --pm-radius: 12px;
  --pm-radius-sm: 8px;
  --pm-radius-lg: 18px;
  --pm-z: 2147483000;
  --pm-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, 'Helvetica Neue', sans-serif;
}

@media (prefers-color-scheme: dark) {
  :host,
  :root {
    --pm-primary: #5dade2;
    --pm-primary-light: #75b7e6;
    --pm-primary-dark: #2189c8;
    --pm-on-primary: #0b1422;
    --pm-bg: #131a25;
    --pm-bg-elev: #1a2332;
    --pm-bg-elev-2: #232f42;
    --pm-text: #e6edf6;
    --pm-text-muted: #9fb1c8;
    --pm-border: #2b394d;
    --pm-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  }
}

.pm-root,
.pm-root * { box-sizing: border-box; }
.pm-root {
  font-family: var(--pm-font);
  color: var(--pm-text);
  background: var(--pm-bg);
  line-height: 1.55;
  font-size: 14.5px;
}
.pm-root:not(.pm-page-shell) {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

/* -------------------------------------------------------------------------
 * Floating book button + drawer/modal shells (widget only)
 * ----------------------------------------------------------------------- */
.pm-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--pm-primary);
  color: var(--pm-on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  box-shadow: var(--pm-shadow);
  z-index: var(--pm-z);
  transition: transform 120ms ease, background 120ms ease;
}
.pm-fab[data-corner="bottom-left"]  { right: auto; left: 24px; }
.pm-fab[data-corner="top-right"]    { bottom: auto; top: 24px; }
.pm-fab[data-corner="top-left"]     { bottom: auto; top: 24px; right: auto; left: 24px; }
.pm-fab:hover { transform: translateY(-2px); background: var(--pm-primary-light); }
.pm-fab svg { width: 26px; height: 26px; }

.pm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: var(--pm-z);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}
.pm-overlay.is-open { opacity: 1; pointer-events: auto; }

.pm-panel {
  position: fixed;
  z-index: calc(var(--pm-z) + 1);
  background: var(--pm-bg);
  color: var(--pm-text);
  box-shadow: var(--pm-shadow);
  border: 1px solid var(--pm-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pm-panel.is-drawer {
  top: 0; bottom: 0; right: 0;
  width: 440px; max-width: 100vw;
  /* dvh keeps mobile browsers' dynamic URL bar from clipping content. */
  height: 100vh;
  height: 100dvh;
  transform: translateX(100%);
  transition: transform 220ms cubic-bezier(.22,.61,.36,1);
  border-radius: var(--pm-radius) 0 0 var(--pm-radius);
}
.pm-panel.is-drawer.is-open { transform: translateX(0); }
.pm-panel.is-drawer[data-corner="bottom-left"],
.pm-panel.is-drawer[data-corner="top-left"] {
  right: auto; left: 0;
  transform: translateX(-100%);
  border-radius: 0 var(--pm-radius) var(--pm-radius) 0;
}
.pm-panel.is-drawer[data-corner="bottom-left"].is-open,
.pm-panel.is-drawer[data-corner="top-left"].is-open { transform: translateX(0); }

.pm-panel.is-modal {
  top: 50%; left: 50%;
  width: min(960px, calc(100vw - 32px));
  height: min(720px, calc(100vh - 32px));
  border-radius: var(--pm-radius-lg);
  transform: translate(-50%, -45%);
  opacity: 0;
  transition: transform 200ms ease, opacity 200ms ease;
}
.pm-panel.is-modal.is-open { transform: translate(-50%, -50%); opacity: 1; }

.pm-panel.is-inline {
  position: relative;
  width: 100%;
  height: auto;
  min-height: 480px;
  border-radius: var(--pm-radius);
  overflow: visible;
}
.pm-panel.is-inline .pm-root {
  height: auto;
  min-height: 480px;
}
.pm-panel.is-inline .pm-body,
.pm-panel.is-inline .pm-list,
.pm-panel.is-inline .pm-reader {
  overflow: visible;
  max-height: none;
}

/* -------------------------------------------------------------------------
 * Header / nav
 * ----------------------------------------------------------------------- */
.pm-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--pm-bg-elev);
  border-bottom: 1px solid var(--pm-border);
  flex-shrink: 0;
}
.pm-header__logo { height: 26px; width: auto; flex-shrink: 0; }
.pm-header__title {
  font-weight: 600;
  font-size: 15px;
  margin: 0;
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-header__close,
.pm-header__back {
  background: transparent;
  border: none;
  color: var(--pm-text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 18px;
  line-height: 1;
}
.pm-header__close:hover,
.pm-header__back:hover { background: var(--pm-bg-elev-2); color: var(--pm-text); }

/* -------------------------------------------------------------------------
 * Search
 * ----------------------------------------------------------------------- */
.pm-search {
  padding: 8px 12px;
  border-bottom: 1px solid var(--pm-border);
  background: var(--pm-bg);
  flex-shrink: 0;
}
.pm-search input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius-sm);
  background: var(--pm-bg-elev);
  color: var(--pm-text);
  font: inherit;
  outline: none;
}
.pm-search input:focus { border-color: var(--pm-primary); box-shadow: 0 0 0 2px rgba(26,82,118,.18); }

/* -------------------------------------------------------------------------
 * Content area (split into list + reader at full-page; one-pane on widget)
 * ----------------------------------------------------------------------- */
.pm-body { flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; }
.pm-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0;
}
.pm-list.is-secondary {
  flex: 0 0 320px;
  border-right: 1px solid var(--pm-border);
}
.pm-reader {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 22px 26px 60px;
  display: none;
}
.pm-reader.is-active { display: block; }

.pm-list__toolbar {
  display: flex;
  gap: 6px;
  padding: 8px 12px 4px;
  position: sticky;
  top: 0;
  background: var(--pm-bg);
  border-bottom: 1px solid var(--pm-border);
  z-index: 1;
}
.pm-list__tool {
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.03em;
  border: 1px solid var(--pm-border);
  background: var(--pm-bg-elev);
  color: var(--pm-text-muted);
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.pm-list__tool:hover { background: var(--pm-bg-elev-2); color: var(--pm-text); }

.pm-group { padding: 2px 0; }
.pm-group__head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
  padding: 12px 14px 10px;
  color: var(--pm-text);
  text-align: left;
  border-top: 1px solid var(--pm-border);
}
.pm-group:first-of-type .pm-group__head { border-top: none; }
.pm-group__head:hover { background: var(--pm-bg-elev); }
.pm-group__title {
  flex: 1 1 auto;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.pm-group__code {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pm-text-muted);
  background: var(--pm-bg-elev);
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--pm-border);
}
.pm-chev {
  width: 12px;
  flex-shrink: 0;
  color: var(--pm-text-muted);
  font-size: 11px;
  line-height: 1;
  transition: transform 120ms ease;
}

.pm-subgroup { padding: 0 12px 4px 20px; }
.pm-subgroup__head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
  padding: 6px 8px;
  color: var(--pm-text);
  text-align: left;
  border-radius: var(--pm-radius-sm);
}
.pm-subgroup__head:hover { background: var(--pm-bg-elev); }
.pm-subgroup__title {
  flex: 1 1 auto;
  font-weight: 600;
  font-size: 13px;
}
.pm-subgroup__code {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  color: var(--pm-text-muted);
}
.pm-subgroup__count {
  font-size: 10px;
  color: var(--pm-text-muted);
  background: var(--pm-bg-elev);
  border: 1px solid var(--pm-border);
  padding: 1px 6px;
  border-radius: 999px;
}
.pm-policy-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin: 1px 0;
  border-radius: var(--pm-radius-sm);
  cursor: pointer;
  color: var(--pm-text);
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  font: inherit;
}
.pm-policy-item:hover { background: var(--pm-bg-elev-2); }
.pm-policy-item.is-active { background: var(--pm-primary); color: var(--pm-on-primary); }
.pm-policy-item.is-active .pm-policy-item__code { color: var(--pm-on-primary); opacity: .85; }
.pm-policy-item__code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--pm-text-muted);
  flex-shrink: 0;
  min-width: 56px;
}
.pm-policy-item__title { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* -------------------------------------------------------------------------
 * Reader
 * ----------------------------------------------------------------------- */
.pm-empty {
  margin: auto;
  padding: 30px;
  color: var(--pm-text-muted);
  text-align: center;
  font-style: italic;
}

.pm-policy__header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 4px;
}
.pm-policy__title {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  line-height: 1.25;
  flex: 1 1 auto;
  order: 1;
}
.pm-policy__code {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  background: var(--pm-bg-elev);
  color: var(--pm-primary);
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--pm-border);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 6px;
  order: 2;
}
.pm-policy__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 18px;
  color: var(--pm-text-muted);
  font-size: 12px;
}
.pm-tag {
  background: var(--pm-bg-elev);
  border: 1px solid var(--pm-border);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
}

.pm-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--pm-border);
  margin: 16px 0 20px;
}
.pm-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
  color: var(--pm-text-muted);
}
.pm-tab.is-active { color: var(--pm-primary); border-bottom-color: var(--pm-primary); font-weight: 600; }

.pm-markdown { font-size: 14.5px; line-height: 1.65; }
.pm-markdown h1, .pm-markdown h2, .pm-markdown h3 { color: var(--pm-text); }
.pm-markdown h2 { margin-top: 1.8em; }
.pm-markdown h3 { margin-top: 1.4em; }
.pm-markdown p { margin: 0.8em 0; }
.pm-markdown ul, .pm-markdown ol { margin: 0.6em 0 0.6em 1.4em; }
.pm-markdown li { margin: 0.3em 0; }
.pm-markdown code {
  background: var(--pm-bg-elev);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.92em;
}
.pm-markdown pre {
  background: var(--pm-bg-elev);
  padding: 12px;
  border-radius: var(--pm-radius-sm);
  overflow-x: auto;
}
.pm-markdown blockquote {
  border-left: 3px solid var(--pm-primary);
  margin: 1em 0;
  padding: 0.2em 0 0.2em 1em;
  color: var(--pm-text-muted);
}
.pm-markdown table { border-collapse: collapse; margin: 1em 0; }
.pm-markdown th, .pm-markdown td { border: 1px solid var(--pm-border); padding: 6px 10px; }
.pm-markdown img { max-width: 100%; border-radius: var(--pm-radius-sm); }
.pm-markdown a { color: var(--pm-primary); text-decoration: none; border-bottom: 1px dotted var(--pm-primary); }

/* Procedures view */
.pm-proc {
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius);
  padding: 14px 16px;
  margin-bottom: 14px;
  background: var(--pm-bg-elev);
}
.pm-proc__head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pm-proc__code {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--pm-primary);
  background: var(--pm-bg);
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--pm-border);
}
.pm-proc__title { font-size: 16px; font-weight: 600; margin: 0; }
.pm-proc__intro { color: var(--pm-text-muted); font-size: 13px; margin: 6px 0 8px; }
.pm-steps {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  counter-reset: pm-step;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pm-step {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: start;
  padding: 8px 10px;
  background: var(--pm-bg);
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius-sm);
}
.pm-step::before {
  counter-increment: pm-step;
  content: counter(pm-step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--pm-primary);
  color: var(--pm-on-primary);
  border-radius: 50%;
  font-weight: 700;
  font-size: 13px;
}
.pm-step__body { font-size: 14px; }
.pm-step__body p:last-child { margin-bottom: 0; }
.pm-step__artefact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 6px 8px;
  border: 1px solid var(--pm-primary);
  border-radius: var(--pm-radius-sm);
  color: var(--pm-primary);
  text-decoration: none;
  font-size: 12px;
}
.pm-step__artefact img { width: 36px; height: 36px; object-fit: cover; border-radius: 4px; }
.pm-step__artefact.is-image { display: block; padding: 6px; text-align: center; }
.pm-step__artefact.is-image img { width: 100%; height: auto; max-height: 320px; object-fit: contain; }
.pm-step__artefact.is-image .pm-step__cap {
  display: block;
  font-size: 11px;
  margin-top: 4px;
  color: var(--pm-text-muted);
  text-align: center;
}

/* Figures embedded inside the policy body (mirrors the procedure artefact UX). */
.pm-figure {
  margin: 1em auto;
  text-align: center;
}
.pm-figure img {
  max-width: 100%;
  height: auto;
  border-radius: var(--pm-radius-sm);
  border: 1px solid var(--pm-border);
}
.pm-figure__cap {
  display: block;
  font-size: 12px;
  color: var(--pm-text-muted);
  margin-top: 6px;
  font-style: italic;
}
.pm-figure--file {
  display: block;
  margin: 1em 0;
  text-align: left;
}
.pm-figure__file {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid var(--pm-primary);
  border-radius: var(--pm-radius-sm);
  color: var(--pm-primary);
  text-decoration: none;
  font-size: 13px;
}

/* Footer + state */
.pm-footer {
  padding: 8px 12px;
  font-size: 11px;
  color: var(--pm-text-muted);
  border-top: 1px solid var(--pm-border);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  background: var(--pm-bg-elev);
}
.pm-footer a { color: inherit; text-decoration: underline; }

.pm-loading,
.pm-error {
  margin: auto;
  padding: 30px;
  color: var(--pm-text-muted);
  text-align: center;
}
.pm-error { color: #c0392b; }

/* Full-page only */
.pm-page-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}
.pm-page-shell .pm-body { min-height: calc(100vh - 100px); }
.pm-page-shell .pm-list.is-secondary { flex: 0 0 380px; }

/* Mobile */
@media (max-width: 640px) {
  .pm-panel.is-drawer { width: 100vw; }
  .pm-body { flex-direction: column; }
  .pm-list.is-secondary { flex: 0 0 auto; max-height: 40vh; border-right: none; border-bottom: 1px solid var(--pm-border); }
  .pm-reader { padding: 16px; padding-bottom: 80px; }
  .pm-page-shell .pm-list.is-secondary { flex: 0 0 auto; }
}

/* Klingon pIqaD font - loaded for [data-lang="tlh-piqad"] surfaces.
   qolqoS re-maps Latin a-z to native pIqaD glyphs, so any Romanised
   Klingon text rendered with this font shows as native script. */
@font-face {
  font-family: 'pIqaD-qolqoS';
  src:
    url('./fonts/pIqaD-qolqoS.ttf') format('truetype'),
    url('/storage-public/policies-manual/fonts/pIqaD-qolqoS.ttf') format('truetype'),
    url('/public/policies-manual/fonts/pIqaD-qolqoS.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
[data-lang="tlh-piqad"] .pm-markdown,
[data-lang="tlh-piqad"] .pm-trp-er-page__body,
[data-lang="tlh-piqad"] .pm-trp-er-page__head,
[data-lang="tlh-piqad"] h2,
[data-lang="tlh-piqad"] h3 {
  font-family: 'pIqaD-qolqoS', system-ui, sans-serif;
  letter-spacing: 0.02em;
}
[data-lang="tlh"] .pm-markdown h1,
[data-lang="tlh"] .pm-markdown h2,
[data-lang="tlh"] .pm-markdown h3,
[data-lang="tlh"] .pm-markdown h4,
[data-lang="tlh"] .pm-markdown h5,
[data-lang="tlh"] .pm-markdown h6 {
  font-family: 'pIqaD-qolqoS', system-ui, sans-serif;
  letter-spacing: 0.02em;
}

/* Translations region picker - now matches admin manual page styling:
   tighter sizing, hide-able sidebar, square status icons. */
.pm-trp {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px;
  align-items: start;
}
.pm-trp.is-sidebar-hidden { grid-template-columns: 1fr; }
.pm-trp.is-sidebar-hidden .pm-trp-side { display: none; }
.pm-trp-toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.pm-trp-toggle {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--pm-border);
  color: var(--pm-text);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
}
.pm-trp-toggle:hover, .pm-trp-toggle.is-active {
  background: rgba(116,181,109,0.12);
  border-color: rgba(116,181,109,0.45);
  color: var(--pm-primary, #4a8c44);
}
.pm-trp-status {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; flex: 0 0 16px;
  border: 1px solid transparent;
  font-size: 9px;
  margin-left: 4px;
}
.pm-trp-status.is-pass { background: rgba(40,167,69,0.18); color: #2d8b3f; border-color: rgba(40,167,69,0.45); }
.pm-trp-status.is-warn { background: rgba(255,193,7,0.20); color: #8a6500; border-color: rgba(255,193,7,0.45); }
.pm-trp-status.is-fail { background: rgba(220,53,69,0.18); color: #a8313c; border-color: rgba(220,53,69,0.45); }
.pm-trp-status.is-busy { background: rgba(13,110,253,0.18); color: #1959b1; border-color: rgba(13,110,253,0.45); }
.pm-trp-side { display: flex; flex-direction: column; gap: 6px; }
.pm-trp-region {
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius-sm, 6px);
  background: var(--pm-bg-elev, #fff);
  overflow: hidden;
}
.pm-trp-region__head {
  width: 100%;
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px; cursor: pointer;
  background: var(--pm-bg-elev-2, rgba(0,0,0,0.03));
  border: 0; text-align: left;
  font-size: 12px; font-weight: 600; color: var(--pm-text);
}
.pm-trp-region__head:hover { background: var(--pm-bg-elev-3, rgba(0,0,0,0.06)); }
.pm-trp-region__title { flex: 1 1 auto; }
.pm-trp-region__count {
  font-size: 11px; padding: 1px 7px; border-radius: 999px;
  background: rgba(0,0,0,0.06); color: var(--pm-text-muted);
}
.pm-trp-region.is-collapsed .pm-trp-region__body { display: none; }
.pm-trp-region__body { display: flex; flex-direction: column; padding: 4px; gap: 2px; }

.pm-trp-variant {
  display: flex; align-items: center; gap: 6px;
  width: 100%; text-align: left;
  padding: 4px 7px; border-radius: 4px;
  background: transparent; border: 1px solid transparent;
  cursor: pointer; font-size: 12px; color: var(--pm-text);
}
.pm-trp-variant:hover { background: var(--pm-bg-elev-2, rgba(0,0,0,0.04)); }
.pm-trp-variant.is-active {
  background: rgba(116, 181, 109, 0.18);
  border-color: rgba(116, 181, 109, 0.45);
}
.pm-trp-flag {
  width: 18px; height: 18px; flex: 0 0 18px;
  object-fit: contain; opacity: 0.9;
}
.pm-trp-flag--placeholder {
  display: inline-block;
  background: rgba(0,0,0,0.08);
  border-radius: 3px;
}
.pm-trp-variant__body { flex: 1 1 auto; min-width: 0; line-height: 1.12; }
.pm-trp-variant__label { display: block; font-weight: 500; font-size: 12px; }
.pm-trp-variant__sub { display: block; font-size: 10px; color: var(--pm-text-muted); }
.pm-trp-exp, .pm-trp-stale {
  display: inline-block; font-size: 10px; font-weight: 600;
  padding: 1px 5px; margin-left: 4px; border-radius: 999px;
}
.pm-trp-exp { background: rgba(255, 193, 7, 0.18); color: #7a5b00; }
.pm-trp-stale { background: rgba(220, 53, 69, 0.18); color: #842029; }

.pm-trp-viewer { min-width: 0; }
.pm-trp-doc {
  background: var(--pm-bg-elev, #fff);
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius-sm, 6px);
  padding: 22px;
}
.pm-trp-doc__head { margin-bottom: 12px; }
.pm-trp-doc__head h2 { margin: 0 0 4px; font-size: 1.2rem; }
.pm-trp-doc__sub { font-size: 12px; color: var(--pm-text-muted); }
.pm-trp-doc.is-rtl .pm-markdown { direction: rtl; text-align: right; }

.pm-trp-banner {
  padding: 6px 12px; margin-bottom: 12px; font-size: 12px;
  border-radius: var(--pm-radius-sm, 6px);
}
.pm-trp-banner--exp { background: rgba(255, 193, 7, 0.14); color: #7a5b00; }
.pm-trp-banner--stale { background: rgba(220, 53, 69, 0.12); color: #842029; }

.pm-trp-er-pages { display: flex; flex-direction: column; gap: 14px; }
.pm-trp-er-page {
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius-sm, 6px);
  padding: 14px;
}
.pm-trp-er-page__num { font-size: 11px; color: var(--pm-text-muted); }
.pm-trp-er-page__head { margin: 4px 0 6px; font-size: 1.1rem; }
.pm-trp-er-page__body { font-size: 1rem; line-height: 1.45; }
.pm-trp-er-page__img {
  display: block; max-width: 100%; height: auto;
  margin: 10px 0; border-radius: var(--pm-radius-sm, 6px);
}
.pm-trp-er-page__cap { font-size: 12px; color: var(--pm-text-muted); text-align: center; }
.pm-trp-er-page__placeholder {
  display: flex; align-items: center; justify-content: center;
  min-height: 120px; margin: 10px 0;
  border: 2px dashed rgba(0,0,0,0.15);
  background: rgba(0,0,0,0.03);
  color: var(--pm-text-muted);
  font-size: 13px; text-align: center; padding: 12px;
}
.pm-trp-er-page__placeholder.is-busy { border-color: rgba(13,110,253,0.40); background: rgba(13,110,253,0.07); color: #1959b1; }
.pm-trp-er-page__placeholder.is-fail { border-color: rgba(220,53,69,0.45); background: rgba(220,53,69,0.06); color: #a8313c; }

@media (max-width: 640px) {
  .pm-trp { grid-template-columns: 1fr; }
}
