/* Prototype viewer (widgets/proto/proto.js). Two plain dark bezels side by side, a large iPad-like display and a
   phone with no notch, sharing one corner radius. A 1px white line on each screen's inner edge keeps dark pages
   apart from the bezel; in dark mode the bezel is a lighter grey so it stands out from the page. Screens scroll up and
   down only. */
.pv { container-type: size; font-size: 12.5px; line-height: 1.35; color: var(--ink); text-align: left; }
.pv button, .pv a { font: inherit; color: inherit; }
.pv__wrap { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 20px; height: 100%; padding: 16px 18px 16px 22px; }
.pv__side { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.pv__eyebrow { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.pv__versions { display: flex; gap: 4px; }
.pv__ver { flex: 1; display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; border: 0; border-radius: 8px; background: none; box-shadow: inset 0 0 0 1px var(--line); text-align: left; color: var(--ink-2) !important; }
.pv__ver b { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.pv__ver span { font-size: 10.5px; line-height: 1.2; color: var(--muted); }
.pv__ver[aria-pressed=true] { background: var(--ink); color: var(--bg) !important; box-shadow: none; }
.pv__ver[aria-pressed=true] span { color: inherit; opacity: .7; }
.pv__ver.is-empty:not([aria-pressed=true]) { opacity: .55; }
/* Page tabs: equal-width pills. */
.pv__pages { display: flex; flex-direction: column; gap: 4px; min-height: 0; overflow-x: hidden; overflow-y: auto; }
.pv__page { flex: none; padding: 5px 10px; border: 0; border-radius: 100px; background: none; box-shadow: inset 0 0 0 1px var(--line); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2) !important; font-size: 12.5px !important; transition: background-color .2s ease, color .2s ease; }
.pv__page:hover, .pv__page:focus-visible { box-shadow: inset 0 0 0 1px var(--ink-2); outline: none; }
.pv__page[aria-selected=true] { background: var(--ink); color: var(--bg) !important; box-shadow: none; }
.pv__page.is-empty { color: var(--muted) !important; }
.pv__acts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; }
.pv__btn { display: inline-block; padding: 4px 10px; border: 0; border-radius: 100px; background: none; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2) !important; white-space: nowrap; }
.pv__btn[hidden] { display: none; }
.pv__btn:hover, .pv__btn:focus-visible { box-shadow: inset 0 0 0 1px var(--ink-2); color: var(--ink) !important; outline: none; }

/* Devices: both as tall as the stage allows, at 4:3 and 9:19.5, with 16px between them. */
.pv__stage { container-type: size; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 16px; }
.pv__device {
  --h: min(100cqh, (100cqw - 16px) / 1.795);
  --pad: calc(var(--h) * .03);
  position: relative; box-sizing: border-box; display: flex; height: var(--h); padding: var(--pad);
  border-radius: calc(var(--h) * .06); background: #1c1c1e; box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 18px 40px -22px rgba(0,0,0,.5);
}
html[data-theme=dark] .pv__device { background: #4a4a4f; box-shadow: 0 0 0 1px rgba(255,255,255,.14); }
.pv__slot--desktop .pv__device { width: calc(var(--h) * 4 / 3); }
.pv__slot--phone .pv__device { width: calc(var(--h) * 9 / 19.5); }
.pv__device::after { content: ''; position: absolute; inset: var(--pad); z-index: 1; border-radius: calc(var(--h) * .03); box-shadow: inset 0 0 0 1px #fff; pointer-events: none; }
.pv__screen { flex: 1; min-width: 0; min-height: 0; overflow-x: hidden; overflow-y: auto; border-radius: calc(var(--h) * .03); background: #fff; scrollbar-width: none; }
.pv__screen::-webkit-scrollbar { display: none; }
.pv__screen:focus-visible { outline: 2px solid var(--mark); outline-offset: 3px; }
.pv__screen.is-frame { overflow: hidden; position: relative; }
.pv__shot { display: block; width: 100%; height: auto; }
.pv__frame { display: block; border: 0; transform-origin: 0 0; background: #fff; }
.pv__empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 100%; padding: 16px; text-align: center; color: #6e7079; font-size: 12px; }
.pv__empty b { color: #2b2b2b; font-size: 13px; }

/* Full screen */
.pv--full { position: fixed; inset: 0; z-index: 300; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.pv--full .pv__wrap { grid-template-columns: 200px minmax(0, 1fr); gap: 32px; padding: 28px 32px; }

/* Narrow frames: controls on top, pages as a row of equal pills, the devices below. */
@container (max-width: 620px) {
  .pv__wrap { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 10px; padding: 12px 12px 12px 16px; }
  .pv__side { gap: 8px; }
  .pv__eyebrow { display: none; }
  .pv__pages { flex-direction: row; overflow: visible; }
  .pv__page { flex: 1 1 0; min-width: 0; padding: 3px 8px; }
  .pv__ver { padding: 4px 8px; }
  .pv__ver b { font-size: 13px; }
  .pv__acts { margin-top: 0; }
}
/* Stacked page: the two screens stack, each using the full width (the phone a little narrower). */
.is-vertical .pic--proto .pv__wrap { grid-template-rows: auto auto; height: auto; }
.is-vertical .pic--proto .pv__stage { container-type: inline-size; flex-direction: column; gap: 14px; }
.is-vertical .pic--proto .pv__slot { width: 100%; display: flex; justify-content: center; }
.is-vertical .pic--proto .pv__slot--desktop .pv__device { --h: calc(100cqw * 3 / 4); }
.is-vertical .pic--proto .pv__slot--phone .pv__device { --h: calc(min(280px, 64cqw) * 19.5 / 9); }
@media (prefers-reduced-motion: reduce) { .pv__page { transition: none; } }
