/* A peek at a related item (GitHub issue 596, the owner's U5; docs/adr/0351-the-peek.md;
   public/js/app/ticket-peek.js). A panel over the right side of the ticket page, about 380 px, from under the top bar to
   the bottom, scrolling inside: its heading and Close, the item's facts, its texts, its latest reply, then its actions
   and Open full page kept at the foot. At 700 px and narrower it is a sheet from the bottom, with 44 px targets. Long
   words wrap, nothing is cut with an ellipsis. Colors are the palette's tokens, so the dark theme follows. */

.pk-panel[hidden] { display:none !important; }
.pk-panel { position:fixed; top:calc(var(--topbar-height) + var(--outage-banner-h, 0px)); right:0; bottom:0; z-index:var(--z-drawer); display:flex; flex-direction:column; width:min(380px, 100vw); min-width:0; border-left:1px solid var(--line-strong); background:var(--surface); box-shadow:var(--shadow-pop); color:var(--ink); overflow-wrap:anywhere; }
.pk-head { display:flex; align-items:flex-start; gap:var(--space-100); padding:var(--space-150) var(--space-100) var(--space-100) var(--space-200); border-bottom:1px solid var(--line); }
.pk-head-words { flex:1 1 auto; min-width:0; }
.pk-kicker { margin:0 0 var(--space-25); color:var(--muted); font-size:var(--text-xs); font-weight:var(--weight-semibold); letter-spacing:.02em; text-transform:uppercase; }
.pk-title { margin:0; color:var(--ink); font-size:var(--text-lg); font-weight:var(--weight-semibold); line-height:var(--leading-tight); }
.pk-title:focus { outline:none; }
.pk-title:focus-visible { outline:2px solid var(--spruce); outline-offset:1px; border-radius:var(--radius-xs); }
.pk-close { flex:none; width:36px; height:36px; border:0; border-radius:var(--radius-lg); background:transparent; color:var(--ink-2); font-size:var(--text-2xl); line-height:1; cursor:pointer; }
.pk-close:hover { background:var(--hover-bg); }
.pk-close:focus-visible { outline:2px solid var(--spruce); outline-offset:-2px; }
.pk-body { flex:1 1 auto; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:var(--space-150) var(--space-200); }
.pk-facts { display:grid; grid-template-columns:minmax(6.5rem, max-content) minmax(0, 1fr); gap:var(--space-50) var(--space-150); margin:0 0 var(--space-150); font-size:var(--text-sm); }
.pk-fact { display:contents; }
.pk-fact dt { color:var(--muted); }
.pk-fact dd { margin:0; min-width:0; color:var(--ink); }
.pk-section { margin:0 0 var(--space-150); padding-top:var(--space-100); border-top:1px solid var(--line); }
.pk-section h3 { margin:0 0 var(--space-50); color:var(--ink-2); font-size:var(--text-sm); font-weight:var(--weight-semibold); }
.pk-text { margin:0; color:var(--ink); font-size:var(--text-md); line-height:var(--leading-normal); white-space:pre-wrap; }
.pk-html { color:var(--ink); font-size:var(--text-md); line-height:var(--leading-normal); }
.pk-html :where(p, ul, ol) { margin:0 0 var(--space-100); }
.pk-html img { max-width:100%; height:auto; }
/* An article's own headings are under the peek's (ticket-peek.js makes them h4): sized as the peek's sections. */
.pk-html h4 { margin:var(--space-150) 0 var(--space-50); color:var(--ink); font-size:var(--text-md); font-weight:var(--weight-semibold); }
.pk-html pre { white-space:pre-wrap; }
.pk-reply-by { margin:0 0 var(--space-25); font-size:var(--text-sm); }
.pk-reply-by span { color:var(--muted); }
.pk-approval .apc-request { margin:0; }
/* The request's title is the peek's heading already; its status stays. */
.pk-approval .apc-request-title { display:none; }
.pk-approval .apc-request-head { justify-content:flex-start; }
.pk-foot { display:flex; flex-direction:column; gap:var(--space-100); padding:var(--space-150) var(--space-200) calc(var(--space-150) + env(safe-area-inset-bottom, 0px)); border-top:1px solid var(--line); background:var(--surface); }
.pk-actions { display:flex; flex-wrap:wrap; gap:var(--space-100); }
.pk-actions .pk-act, .pk-foot .pk-full { min-height:var(--control-height-sm); white-space:normal; text-align:center; }
.pk-act[aria-disabled="true"] { opacity:.6; cursor:not-allowed; }
.pk-act[aria-disabled="true"]:focus-visible { opacity:1; }
.pk-why { flex:1 1 100%; margin:0; color:var(--muted); font-size:var(--text-sm); }
.pk-foot .pk-full { align-self:flex-start; }
/* The Approvals card's Details, beside a request's title. */
.apc-request-head .pk-details { margin-left:auto; font-size:var(--text-sm); }

@media (max-width:700px) {
  /* A sheet from the bottom, over the phone's bar. */
  .pk-panel { top:auto; left:0; width:auto; max-height:min(85vh, 100% - 3rem); max-height:min(85dvh, 100% - 3rem); border-left:0; border-top:1px solid var(--line-strong); border-radius:var(--radius-xl) var(--radius-xl) 0 0; }
  .pk-close { width:44px; height:44px; }
  .pk-actions .pk-act, .pk-foot .pk-full, .apc-request-head .pk-details, .pk-approval .apc-actions button { min-height:44px; }
  .pk-foot .pk-full { align-self:stretch; }
}
@media print { .pk-panel { display:none !important; } }
