/* Pasture-only framing and responsive polish. */
.ps-demo-frame { position: relative; width: 100%; min-width: 0; }
.ps .ps-demo-frame > :is(.ps-app-window,.ps-pen-shell) { position: absolute; inset: 0 auto auto 0; width: var(--frame-width); height: var(--frame-height); max-height: none; max-width: none; margin: 0; transform: scale(var(--frame-scale,1)); transform-origin: top left; display: flex; flex-direction: column; }
.ps .ps-demo-frame > .ps-app-window .ps-window-bar { height: 43px; min-height: 43px; flex: none; padding-inline: 64px; font-size: 10px; }
.ps .ps-demo-frame .ps-window-dots { left: 14px; top: 16px; gap: 7px; }
.ps .ps-demo-frame .ps-window-dots i { width: 10px; height: 10px; }
.ps .ps-demo-frame .ps-window-trail { display: block; }
.ps .ps-demo-frame > .ps-app-window > .ps-motion-stage { height: auto; min-height: 0; flex: 1 1 auto; }
.ps .ps-demo-frame .ps-motion-card { padding: 26px 7%; }
.ps .ps-demo-frame .ps-motion-text { font-size: calc(var(--scene-font,20px) * var(--reading-scale,1)); }
.ps .ps-demo-frame .ps-card-edge-label { font-size: 10px; visibility: visible; }
.ps .ps-demo-frame .ps-scene-progress { bottom: 18px; left: 24px; right: 24px; font-size: 8px; }
.ps .ps-demo-frame .ps-motion-reader[data-layout="zen"] .ps-motion-card { padding: 34px 12% 40px; }
.ps-room .ps-demo-frame { margin-top: 16px; }
.ps .ps-room .ps-demo-frame .ps-motion-card { padding: 16px 11%; }
.ps .ps-room .ps-demo-frame .ps-motion-reader[data-layout="zen"] .ps-motion-card { padding: 34px 12% 40px; }
.ps .ps-room .ps-demo-frame .ps-motion-text { font-size: calc(var(--scene-font,16px) * min(var(--reading-scale,1),1.2)); }
.ps-pace .ps-demo-frame { align-self: start; }
.ps .ps-demo-frame .ps-pace-scroll { height: auto; min-height: 0; flex: 1; }
.ps .ps-demo-frame > .ps-pen-shell .ps-pen-chrome { height: 43px; font-size: 10px; }
.ps .ps-demo-frame .ps-pen-stack { padding: 36px 7% 40px; }
.ps .ps-demo-frame .ps-pen-passage { font-size: 22px; }
.ps .ps-demo-frame .ps-pen-edge { font-size: 10px; }

.ps-palette-aisle { gap: clamp(16px,2.2vw,32px); align-items: start; }
.ps-palette-rail-list { gap: 4px; grid-auto-rows: minmax(34px,1fr); padding: 4px; }
.ps-palette-swatch-row { min-height: 34px; padding-left: 12px; border-radius: 7px; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.ps-palette-swatch-row .ps-palette-row-name { font-size: 11px; padding-right: 8px; }
.ps-palette-swatch-row .ps-palette-chips { align-self: center; height: 20px; margin-right: 8px; border-radius: 3px; overflow: hidden; flex: none; }
.ps-palette-swatch-row .ps-palette-chips i { width: 7px; }
.ps-palette-swatch-row[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg),0 0 0 3px var(--ink); }
.ps-palette-swatch-row[aria-pressed="true"] .ps-palette-row-name::before { content: '✓ '; }
@media (hover:hover) { .ps-palette-swatch-row:hover { transform: translateX(2px); } }
.ps .ps-palette-current { margin: 0; font: 11px/1.5 var(--font-mono); color: var(--ink-2); text-align: center; }
.ps-palette-current span { color: var(--ink); }
.ps-palette-tune .ps-segment button { cursor: pointer; min-height: 40px; }
.ps .ps-download { padding-block: clamp(48px,6vw,72px); }
.ps-download-mark { width: 48px; height: 40px; margin-bottom: 20px; }
.ps-download .ps-actions { margin-top: 24px; }
.ps .ps-download .ps-review-note { margin: 12px auto 0; font-size: 12px; }
.ps .ps-download .ps-assurances { max-width: 800px; margin: 32px auto 0; padding: 0; border: 0; gap: 16px; text-align: center; font-size: 12px; }

/* Recover the original mobile tabbed Aa swatches; keep the scaled preview window. */
@container (max-width: 720px) {
  .ps-palette-aisle { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
  .ps-palette-center { order: -1; position: sticky; top: calc(var(--chrome-top) + var(--product-nav-height)); z-index: 3; gap: 10px; margin: 0; padding: 8px 0 12px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .ps-palette-rail-label { display: none; }
  .ps-palette-rail-list { grid-template-columns: repeat(5,minmax(0,1fr)); grid-auto-rows: 44px; gap: 6px; padding: 4px; }
  .ps-palette-swatch-row { display: grid; place-items: center; padding: 0; min-height: 44px; }
  .ps-palette-swatch-row .ps-palette-row-name,.ps-palette-swatch-row .ps-palette-chips { display: none; }
  .ps-palette-swatch-row .ps-palette-aa { display: block; margin-top: -6px; font: 16px/1 var(--font-display); color: var(--name-ink); }
  .ps-palette-swatch-row .ps-palette-band { display: block; }
  .ps-palette-tabs { display: flex; }
  .ps-palette-tune { gap: 8px; }
  .ps-palette-tune .ps-segment button { min-height: 44px; }
  .ps-palette-tune .ps-layout-fieldset .ps-segment button > span { position: absolute; width: 1px; height: 1px; clip: rect(0 0 0 0); overflow: hidden; }
  .ps-palette-tune .ps-layout-thumb { display: block; }
}
@media (max-height: 560px) {
  @container (max-width: 720px) { .ps-palette-center { position: static; } }
}
@media (max-width: 860px) {
  .ps-matrix { overflow: visible; }
  .ps-matrix table,.ps-matrix tbody { display: block; min-width: 0; width: 100%; }
  .ps-matrix colgroup { display: none; }
  .ps-matrix thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .ps-matrix tbody tr { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); padding-block: 14px; border-bottom: 1px solid var(--line); }
  .ps-matrix tbody th[scope="row"] { grid-column: 1/-1; padding: 0 0 12px; font-size: 18px; }
  .ps-matrix tbody th,.ps-matrix tbody td { position: static; border: 0; background: transparent; }
  .ps-matrix tbody td { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px; min-width: 0; }
  .ps-matrix td::before { content: attr(data-product); color: var(--ink-2); font: 11px/1.4 var(--font-mono); }
  .ps-matrix td.ps-col-pasture { background: var(--bg-raised); border-radius: 4px; }
  .ps-matrix tr.ps-matrix-group { display: block; padding: 24px 0 0; border: 0; }
  .ps-matrix tr.ps-matrix-group th { display: block; padding: 0; font-size: 11px; }
  .ps-matrix tr.ps-matrix-group td { display: none; }
}
@media (max-width: 600px) {
  .ps-matrix tbody tr { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px 10px; }
  .ps-present-mount .ps-present-neck { display: block; height: 25px; }
  .ps-present-mount .ps-present-foot { display: block; height: 7px; }
  .ps .ps-open-visual,.ps .ps-open-visual.is-tooled { height: 440px; }
  .ps .ps-open-visual .ps-open-term { width: 94%; left: 0; height: 148px; }
  .ps .ps-open-visual .ps-open-app { width: 88%; height: auto; aspect-ratio: 746.72/505; right: 10%; bottom: 0; }
  .ps .ps-open-visual .ps-open-app--next { right: 0; bottom: 82px; }
  .ps .ps-open-app .ps-mini-stage { --mini-width: 84%; --mini-height: 68%; }
  .ps .ps-download .ps-assurances { grid-template-columns: 1fr; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { .ps-palette-swatch-row { transition: none; } }

.ps-open-app { aspect-ratio: 420/286; height: auto; }
.ps-terminal-interior { position: absolute; inset: 0 auto auto 0; display: flex; flex-direction: column; width: 420px; height: 286px; transform: scale(var(--terminal-scale,1)); transform-origin: top left; container-type: inline-size; }
.ps .ps-terminal-interior .ps-mini-trail { height: 36px; font-size: 9px; }
.ps .ps-terminal-interior .ps-mini-trail .ps-window-dots { left: 12px; top: 14px; gap: 5px; }
.ps .ps-terminal-interior .ps-mini-trail .ps-window-dots i { width: 8px; height: 8px; }
.ps .ps-terminal-interior .ps-mini-stage { --mini-width: 84%; --mini-height: 68%; }
.ps .ps-terminal-interior .ps-mini-front { padding: 14px 8%; }
.ps .ps-terminal-interior .ps-mini-front h3 { font-size: 18px; line-height: 1.15; }
.ps .ps-terminal-interior .ps-mini-front p { font-size: 13px; line-height: 1.4; }
.ps .ps-terminal-interior .ps-mini-edge { font-size: 8px; }
.ps .ps-terminal-interior .ps-mini-progress { font-size: 8px; padding: 12px 24px 18px; }
