/* OSTREL pairing sheets on the builder (live try-on, True Size): one card in the house's language. The QR is the hero,
   on a paper tile with brass corner marks; one line under it; the link's state as a calm chip; the how-to and the
   privacy note folded into "How it works"; quiet text actions in one row. Non-modal: the builder stays usable. */
.ps { position: fixed; left: clamp(12px, 2vw, 32px); bottom: clamp(12px, 2vw, 32px); z-index: 61; box-sizing: border-box; width: min(392px, calc(100vw - 24px)); max-height: calc(100vh - 104px); max-height: calc(100dvh - 104px); overflow: auto; overscroll-behavior: contain; padding: 24px 24px 8px; background: var(--paper); color: var(--ink); border: 1px solid rgba(21, 19, 15, .2); box-shadow: 0 40px 80px -40px rgba(21, 19, 15, .55), 0 2px 6px -2px rgba(21, 19, 15, .08); }
.ps[hidden], .ps [hidden] { display: none !important; }
@media (prefers-reduced-motion: no-preference) {
  .ps:not([hidden]) { animation: ps-in .55s var(--ease) both; }
}
@keyframes ps-in { from { opacity: 0; transform: translateY(14px); } }

.ps-hd { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.ps-hd .k { margin: 0 0 8px; color: var(--brass-d); }
.ps-h { margin: 0; font: 400 34px/1 var(--serif); letter-spacing: -.012em; }
.ps-h em { font-style: italic; }
.ps-h:focus { outline: none; }
.ps-x { display: grid; place-items: center; width: 44px; height: 44px; margin: -12px -14px 0 0; padding: 0; background: transparent; border: 0; color: var(--graphite); cursor: pointer; transition: color .25s var(--ease); }
.ps-x svg { width: 15px; height: 15px; }
.ps-x:hover { color: var(--ink); }

/* the code: generous, centred, its full quiet zone drawn inside the canvas */
.ps-wait { display: grid; justify-items: center; gap: 28px; margin-top: 24px; padding-top: 34px; border-top: 1px solid var(--line); }
.ps-qr-w { --c: var(--brass); position: relative; line-height: 0; background: var(--paper); }
.ps-qr-w::after { content: ""; position: absolute; inset: -10px; pointer-events: none; background:
  linear-gradient(var(--c) 0 0) left top / 16px 1px no-repeat, linear-gradient(var(--c) 0 0) left top / 1px 16px no-repeat,
  linear-gradient(var(--c) 0 0) right top / 16px 1px no-repeat, linear-gradient(var(--c) 0 0) right top / 1px 16px no-repeat,
  linear-gradient(var(--c) 0 0) left bottom / 16px 1px no-repeat, linear-gradient(var(--c) 0 0) left bottom / 1px 16px no-repeat,
  linear-gradient(var(--c) 0 0) right bottom / 16px 1px no-repeat, linear-gradient(var(--c) 0 0) right bottom / 1px 16px no-repeat; }
.ps-qr { display: block; width: 216px; height: 216px; image-rendering: pixelated; }
.ps-scan { margin: 0; font: 400 italic 20px/1.2 var(--serif); color: var(--graphite); }

/* the link's state */
.ps-st { display: flex; align-items: flex-start; gap: 12px; margin: 24px 0 0; padding: 12px 16px; background: var(--bone); font-size: 14px; line-height: 1.45; color: var(--graphite); }
.ps-st:empty { display: none; }
.ps-st::before { content: ""; flex: none; width: 7px; height: 7px; margin-top: .52em; border-radius: 50%; background: var(--stone); }
.ps-st[data-tone="wait"]::before { background: var(--brass); }
.ps-st[data-tone="ok"]::before { background: var(--lichen); box-shadow: 0 0 0 3px rgba(79, 92, 65, .16); }
.ps-st[data-tone="ok"] { color: var(--ink); }
.ps-st[data-tone="warn"]::before { background: #9a4a2a; }
@media (prefers-reduced-motion: no-preference) {
  .ps-st[data-tone="wait"]::before { animation: ps-pulse 2.4s ease-in-out infinite; }
}
@keyframes ps-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(184, 146, 74, .45); } 60% { box-shadow: 0 0 0 6px rgba(184, 146, 74, 0); } }

/* how it works, folded */
.ps-more { margin-top: 16px; border-top: 1px solid var(--line); }
.ps-more summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; list-style: none; cursor: pointer; font: 500 11px/1 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--stone); }
.ps-more summary::-webkit-details-marker { display: none; }
.ps-more summary::after { content: "+"; font: 300 18px/1 var(--sans); color: var(--graphite); }
.ps-more[open] summary::after { content: "\2013"; }
.ps-more summary:hover { color: var(--ink); }
.ps-more ol { margin: 0; padding: 0 0 0 20px; font-size: 14px; line-height: 1.5; color: var(--graphite); }
.ps-more li + li { margin-top: 8px; }
.ps-more li::marker { font: 400 italic 15px var(--serif); color: var(--brass-d); }
.ps-more p { margin: 16px 0 16px; font-size: 13px; line-height: 1.5; color: var(--stone); }

/* quiet actions, one row */
.ps-ft { display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; border-top: 1px solid var(--line); }
.ps-lk { display: inline-flex; align-items: center; min-height: 44px; padding: 0; background: transparent; border: 0; font: 500 11px/1 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--graphite); text-decoration: underline; text-decoration-color: rgba(21, 19, 15, .28); text-underline-offset: 6px; cursor: pointer; transition: color .25s var(--ease), text-decoration-color .25s var(--ease); }
.ps-lk:hover { color: var(--ink); text-decoration-color: currentColor; }
.ps-lk.ps-end { margin-left: auto; }

/* linked: the mirror of what the phone shows */
.ps .to-mirror, .ps .ts-mirror { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }

/* opened on a phone: measuring right here comes first, the code is for a second phone */
.ps-onphone .ps-qr { width: 144px; height: 144px; }
.ps-onphone .ps-scan { font-size: 17px; }

@media (max-width: 520px) {
  .ps { left: 8px; right: 8px; bottom: 8px; width: auto; padding: 20px 20px 4px; }
  .ps-h { font-size: 30px; }
  .ps-qr { width: 200px; height: 200px; }
  .ps-onphone .ps-qr { width: 144px; height: 144px; }
}
@media (max-height: 760px) and (min-width: 521px) {
  .ps-wait { margin-top: 16px; padding-top: 28px; gap: 24px; }
  .ps-qr { width: 192px; height: 192px; }
  .ps-st { margin-top: 16px; }
}
