/*
 * Photo-size catalog and detail pages (rendered by src/worker/render/*).
 * Loaded after photo-sizes.css (a copy of globals.css), so tokens, header,
 * footer, buttons and FAQ come from there; this file only adds the ps* layout,
 * matching the homepage's night studio hero.
 */

.psPage {
  overflow-x: clip;
}

/* ---------- Night hero ---------- */

.psHero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(44px, 5.5vw, 88px) clamp(48px, 5.5vw, 84px);
  background: var(--night);
  color: var(--night-text);
}

.psHero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(var(--night-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--night-line) 1px, transparent 1px),
    linear-gradient(rgba(173, 198, 230, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(173, 198, 230, 0.06) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  content: "";
  mask-image: radial-gradient(120% 90% at 70% 40%, #000 10%, transparent 75%);
}

.psHero::after {
  position: absolute;
  z-index: -1;
  inset-block-start: -30%;
  inset-inline-end: -12%;
  width: min(820px, 90vw);
  aspect-ratio: 1;
  background:
    radial-gradient(closest-side, rgba(60, 140, 220, 0.32), transparent 70%),
    radial-gradient(closest-side at 30% 70%, rgba(246, 196, 83, 0.1), transparent 70%);
  content: "";
  filter: blur(10px);
}

.psHeroInner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(40px, 6vw, 96px);
}

.psHeroCopy > * {
  animation: ps-rise 800ms var(--ease-out) both;
}

.psHeroCopy > :nth-child(2) {
  animation-delay: 70ms;
}

.psHeroCopy > :nth-child(3) {
  animation-delay: 140ms;
}

.psHeroCopy > :nth-child(n + 4) {
  animation-delay: 210ms;
}

@keyframes ps-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

.psKicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--night-line);
  border-radius: var(--radius-pill);
  padding: 7px 14px 7px 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--night-muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.psKickerDot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--gold);
}

.psHero h1 {
  margin: 22px 0 0;
  color: #fff;
  font-size: clamp(2.3rem, 1rem + 3.8vw, 4.1rem);
  font-weight: 700;
  letter-spacing: var(--tracking-display);
  line-height: 1.05;
  text-wrap: balance;
}

.psHero h1.isLong {
  font-size: clamp(2rem, 1rem + 2.8vw, 3.3rem);
}

.psHero h1.isExtraLong {
  font-size: clamp(1.7rem, 1rem + 2vw, 2.6rem);
}

html:is([lang^="zh"], [lang="ja"], [lang="ko"]) .psHero h1 {
  line-height: 1.38;
}

.psPhrase {
  display: inline-block;
}

html[lang="ar"] .psHero h1 {
  line-height: 1.3;
}

html[lang="ja"] .psPage :is(h1, h2, h3),
html[lang^="zh"] .psPage :is(h1, h2, h3) {
  word-break: auto-phrase;
}

html[lang="ko"] .psPage :is(h1, h2, h3) {
  word-break: keep-all;
}

.psLede {
  max-width: 34em;
  margin: 20px 0 0;
  color: var(--night-muted);
  font-size: var(--lede);
  line-height: 1.65;
}

.psActions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
}

.psHero .appStoreBadge svg {
  border-radius: 7px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.psGhostButton {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.psGhostButton:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

.psArrow {
  width: 16px;
  height: 16px;
  flex: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
  transition: transform var(--duration) var(--ease-out);
}

a:hover > .psArrow {
  transform: translateX(3px);
}

[dir="rtl"] .psArrow {
  transform: scaleX(-1);
}

[dir="rtl"] a:hover > .psArrow {
  transform: scaleX(-1) translateX(3px);
}

.psTrust {
  display: block;
  margin-top: 20px;
  color: var(--night-muted);
  font-size: 0.86rem;
}

/* ---------- Catalog hero: search and the real-scale lineup ---------- */

.psSearch {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 560px;
  margin-top: 34px;
}

.psSearch svg {
  position: absolute;
  inset-inline-start: 18px;
  width: 20px;
  height: 20px;
  stroke: var(--ink-muted);
  stroke-linecap: round;
  stroke-width: 1.7;
  pointer-events: none;
}

.psSearch input {
  width: 100%;
  height: 58px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding-inline: 50px 18px;
  background: var(--paper);
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.7);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  outline: none;
  transition:
    border-color var(--duration),
    box-shadow var(--duration);
}

.psSearch input::placeholder {
  color: var(--ink-faint);
}

.psSearch input:focus {
  border-color: var(--gold);
  box-shadow:
    0 0 0 4px var(--gold-soft),
    0 18px 40px -20px rgba(0, 0, 0, 0.7);
}

.psLineup {
  --mm: 3.3px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(14px, 2vw, 26px);
  border: 1px solid var(--night-line);
  border-radius: var(--radius-major);
  padding: clamp(28px, 3.5vw, 44px) clamp(18px, 3vw, 36px);
  background:
    linear-gradient(rgba(173, 198, 230, 0.07) 1px, transparent 1px) 0 0 / 100% calc(var(--mm) * 5),
    linear-gradient(90deg, rgba(173, 198, 230, 0.07) 1px, transparent 1px) 0 0 / calc(var(--mm) * 5) 100%,
    rgba(10, 19, 34, 0.55);
  animation: ps-rise 900ms 200ms var(--ease-out) both;
}

.psLineupItem {
  display: grid;
  min-width: 64px;
  justify-items: center;
  gap: 4px;
  text-align: center;
}

.psLineupFrame {
  position: relative;
  width: calc(var(--w) * var(--mm));
  height: calc(var(--h) * var(--mm));
  margin-bottom: 10px;
  overflow: hidden;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 18px 36px -16px rgba(0, 0, 0, 0.7);
  transition: transform var(--duration-slow) var(--ease-out);
}

.psLineupItem:hover .psLineupFrame {
  transform: translateY(-6px);
}

.psLineupItem strong {
  max-width: max(calc(var(--w, 0) * var(--mm)), 88px);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
}

.psLineupItem span[dir] {
  color: var(--night-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  white-space: nowrap;
}

/* ---------- Silhouettes (lineup, cards, detail stage) ---------- */

.psLineupFrame::before,
.psShape::before,
.psStagePhoto::before {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 50%;
  height: 100%;
  aspect-ratio: 0.78;
  background:
    radial-gradient(50% 50% at 50% 50%, var(--sil, #c7d2df) 97%, transparent 100%) 50% 30% / 36% 33% no-repeat,
    radial-gradient(50% 100% at 50% 100%, var(--sil, #c7d2df) 97%, transparent 100%) 50% 100% / 92% 30% no-repeat;
  content: "";
  translate: -50% 0;
}

[dir="rtl"] :is(.psLineupFrame, .psShape, .psStagePhoto)::before {
  translate: 50% 0;
}

/* ---------- Filter bar ---------- */

.psFilterBar {
  position: sticky;
  z-index: 20;
  top: var(--header-total);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(18px);
}

.psFilterInner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 14px;
}

.psFilters {
  display: flex;
  min-width: 0;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.psFilters::-webkit-scrollbar {
  display: none;
}

.psFilters button {
  height: 36px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 0 15px;
  background: var(--paper);
  color: var(--ink-soft);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 570;
  white-space: nowrap;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}

.psFilters button:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.psFilters button.isActive {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.psFilterDivider {
  width: 1px;
  flex: none;
  margin-inline: 6px;
  background: var(--line);
}

.psResultCount {
  flex: none;
  margin: 0;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- Cards ---------- */

.psCatalog {
  padding-block: 32px var(--section-y-sm);
}

.psGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 228px), 1fr));
  gap: 14px;
}

.psCard {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  transition:
    border-color var(--duration),
    box-shadow var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}

.psCard[hidden] {
  display: none;
}

.psCard:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.psCardPlate {
  display: flex;
  height: 124px;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line-soft);
  background:
    linear-gradient(var(--grid-minor) 1px, transparent 1px) 0 0 / 100% 11px,
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px) 0 0 / 11px 100%,
    var(--paper-cool);
}

.psShape {
  --mm: 1.5px;
  position: relative;
  width: calc(var(--w) * var(--mm));
  height: calc(var(--h) * var(--mm));
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 8px 16px -10px rgba(11, 28, 49, 0.45);
  transition: transform var(--duration-slow) var(--ease-out);
}

.psShapePixel {
  width: auto;
  height: 76px;
  aspect-ratio: var(--r);
  max-width: 130px;
  border-style: dashed;
}

.psCard:hover .psShape {
  transform: scale(1.06);
}

.psCardBody {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 16px 18px 0;
}

.psCardBody h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 640;
  letter-spacing: var(--tracking-tight);
  line-height: 1.35;
}

.psCardDim {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  justify-self: start;
}

.psCardMeta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--ink-muted);
  font-size: 0.76rem;
}

.psCardIcao,
.psIcao {
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  background: var(--accent-wash);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.psCardLink {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 18px 16px;
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 560;
  transition: color var(--duration);
}

.psCardLink svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
  transition: transform var(--duration) var(--ease-out);
}

[dir="rtl"] .psCardLink svg {
  transform: scaleX(-1);
}

.psCard:hover .psCardLink {
  color: var(--accent);
}

.psCard:hover .psCardLink svg {
  transform: translateX(3px);
}

[dir="rtl"] .psCard:hover .psCardLink svg {
  transform: scaleX(-1) translateX(3px);
}

.psEmpty {
  max-width: 460px;
  margin: 40px auto 0;
  text-align: center;
}

.psEmpty[hidden] {
  display: none;
}

.psEmpty h2 {
  margin: 0;
  font-size: var(--display-4);
  letter-spacing: var(--tracking-tight);
}

.psEmpty p {
  margin: 12px 0 24px;
  color: var(--ink-muted);
  line-height: 1.65;
}

/* ---------- Detail hero ---------- */

.psCrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 26px;
  color: var(--night-muted);
  font-size: 0.82rem;
}

.psCrumbs a {
  color: var(--night-muted);
  transition: color var(--duration);
}

.psCrumbs a:hover {
  color: #fff;
}

.psCrumbs span:last-child {
  color: var(--night-text);
}

.psBadges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.psBadges .psIcao {
  padding: 5px 11px;
  background: var(--gold-soft);
  color: var(--gold);
}

.psStage {
  --stage-h: 360px;
  display: grid;
  justify-items: center;
  gap: 28px;
  border: 1px solid var(--night-line);
  border-radius: var(--radius-major);
  padding: 64px 72px 32px;
  background: rgba(10, 19, 34, 0.55);
  animation: ps-rise 900ms 150ms var(--ease-out) both;
}

.psStageFrame {
  position: relative;
  width: min(calc(var(--stage-h) * var(--r)), 340px);
  aspect-ratio: var(--r);
}

.psStagePhoto {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 4px;
  background: linear-gradient(#fff, #eef2f6);
  box-shadow: 0 30px 60px -22px rgba(0, 0, 0, 0.75);
  --sil: #c3cfdc;
}

.psRuler {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--night-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.psRuler i {
  position: absolute;
  inset: 0;
}

.psRuler b {
  position: relative;
  border-radius: 4px;
  padding: 1px 7px;
  background: var(--night-raise);
  font-weight: 500;
  white-space: nowrap;
}

.psRulerTop {
  inset-inline: 0;
  bottom: calc(100% + 12px);
  height: 18px;
}

.psRulerTop i {
  background:
    linear-gradient(90deg, rgba(233, 238, 246, 0.6) 1px, transparent 1px) 0 100% / calc(500% / var(--ticks-x, 10)) 9px repeat-x,
    linear-gradient(90deg, rgba(233, 238, 246, 0.4) 1px, transparent 1px) 0 100% / calc(100% / var(--ticks-x, 10)) 5px repeat-x,
    linear-gradient(rgba(233, 238, 246, 0.6), rgba(233, 238, 246, 0.6)) 0 100% / 100% 1px no-repeat;
}

.psRulerSide {
  top: 0;
  bottom: 0;
  left: calc(100% + 12px);
  width: 18px;
}

.psRulerSide i {
  background:
    linear-gradient(rgba(233, 238, 246, 0.6) 1px, transparent 1px) 0 0 / 9px calc(500% / var(--ticks-y, 10)) repeat-y,
    linear-gradient(rgba(233, 238, 246, 0.4) 1px, transparent 1px) 0 0 / 5px calc(100% / var(--ticks-y, 10)) repeat-y,
    linear-gradient(90deg, rgba(233, 238, 246, 0.6), rgba(233, 238, 246, 0.6)) 0 0 / 1px 100% no-repeat;
}

.psRulerSide b {
  padding: 7px 1px;
  writing-mode: vertical-rl;
}

/* Pixel presets have no physical scale: show the span without millimetre ticks. */
.psStagePixel .psRulerTop i {
  background:
    linear-gradient(rgba(233, 238, 246, 0.6), rgba(233, 238, 246, 0.6)) 0 100% / 1px 9px no-repeat,
    linear-gradient(rgba(233, 238, 246, 0.6), rgba(233, 238, 246, 0.6)) 100% 100% / 1px 9px no-repeat,
    linear-gradient(rgba(233, 238, 246, 0.6), rgba(233, 238, 246, 0.6)) 0 100% / 100% 1px no-repeat;
}

.psStagePixel .psRulerSide i {
  background:
    linear-gradient(rgba(233, 238, 246, 0.6), rgba(233, 238, 246, 0.6)) 0 0 / 9px 1px no-repeat,
    linear-gradient(rgba(233, 238, 246, 0.6), rgba(233, 238, 246, 0.6)) 0 100% / 9px 1px no-repeat,
    linear-gradient(rgba(233, 238, 246, 0.6), rgba(233, 238, 246, 0.6)) 0 0 / 1px 100% no-repeat;
}

.psStageChip {
  display: grid;
  max-width: 100%;
  justify-items: center;
  gap: 2px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 9px 18px;
  background: rgba(10, 19, 34, 0.7);
  text-align: center;
}

.psStageChip strong {
  color: #fff;
  font-size: 0.86rem;
  font-weight: 600;
}

.psStageChip span {
  color: var(--night-muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

/* ---------- Detail: spec and output ---------- */

.psFacts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 6vw, 96px);
  padding-block: var(--section-y-sm) 0;
}

.psFacts h2,
.psMakeCopy h2,
.psGuideHeading h2,
.psRelatedHeading h2 {
  margin: 12px 0 0;
  font-size: var(--display-3);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  line-height: 1.15;
  text-wrap: balance;
}

html:is([lang^="zh"], [lang="ja"], [lang="ko"], [lang="ar"]) .psPage h2 {
  line-height: 1.38;
}

.psFacts p {
  margin: 12px 0 0;
  color: var(--ink-muted);
  line-height: 1.65;
}

.psFactList {
  margin: 26px 0 0;
  border-top: 1px solid var(--line);
}

.psFactList > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding-block: 16px;
}

.psFactList dt {
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.psFactList dd {
  margin: 0;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--tracking-tight);
  text-align: end;
}

.psFactList dd[dir="ltr"] {
  font-family: var(--font-mono);
  font-size: 1.02rem;
  font-weight: 560;
  letter-spacing: 0;
}

/* ---------- Detail: framing (App positioning data) ---------- */

.psFraming {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(32px, 6vw, 96px);
  padding-block: var(--section-y-sm) 0;
}

.psFramingFigure {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(28px, 4vw, 48px);
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 20px 20px,
    var(--paper-cool);
}

.psFramingFigure svg {
  display: block;
  width: min(100%, 260px);
  max-height: 340px;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 18px 40px -22px rgba(15, 27, 45, 0.45), 0 0 0 1px rgba(15, 27, 45, 0.08);
}

.psFramingPaper {
  fill: #fff;
}

.psFramingBody {
  fill: #c7d2df;
}

.psFramingBand {
  fill: var(--gold);
  fill-opacity: 0.34;
}

.psFramingAnchor {
  stroke: #b7861d;
  stroke-dasharray: 2 1.6;
  stroke-width: 0.7;
}

.psFramingHead {
  stroke: var(--accent);
  stroke-dasharray: 2 1.6;
  stroke-width: 0.6;
}

.psFramingBracket {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-width: 1.4;
}

.psFramingCopy h2,
.psRequirementsHeading h2,
.psArticle h2 {
  margin: 12px 0 0;
  font-size: var(--display-3);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  line-height: 1.15;
  text-wrap: balance;
}

.psFramingCopy > p,
.psRequirementsHeading p {
  margin: 12px 0 0;
  color: var(--ink-muted);
  line-height: 1.65;
}

.psFraming .psFactList dt {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.psFraming .psFactList dd {
  display: grid;
  gap: 2px;
  font-size: 1rem;
}

.psFraming .psFactList dd span[dir] {
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0;
}

.psSwatch {
  width: 14px;
  height: 14px;
  flex: none;
  border-radius: 4px;
}

.psSwatchHead {
  border: 2px solid var(--accent);
  background: var(--accent-wash);
}

.psSwatchEye {
  background: rgba(246, 196, 83, 0.55);
  box-shadow: inset 0 0 0 1px #b7861d;
}

/* ---------- Detail: size-specific requirements (content/photo-sizes) ---------- */

.psRequirements {
  padding-block: var(--section-y-sm) 0;
}

.psRequirementsHeading {
  max-width: 720px;
}

.psRules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 14px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.psRule {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 22px;
  background: var(--paper);
}

.psRuleIcon {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  padding: 6px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.psRule.is-required .psRuleIcon {
  background: var(--night);
  color: var(--gold);
}

.psRule.is-allowed .psRuleIcon {
  background: var(--accent-tint);
  color: var(--accent);
}

.psRule.is-notAllowed .psRuleIcon {
  background: #fde8e6;
  color: #c2412d;
}

.psRule.is-conditional .psRuleIcon {
  background: var(--gold-soft);
  color: #9a6b0c;
}

.psRule strong {
  display: block;
  font-size: 1rem;
  letter-spacing: var(--tracking-tight);
}

.psRuleStatus {
  display: block;
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.psRule.is-notAllowed .psRuleStatus {
  color: #c2412d;
}

.psRule p {
  margin: 8px 0 0;
  color: var(--ink-muted);
  font-size: 0.94rem;
  line-height: 1.6;
}

.psSources {
  display: grid;
  gap: 6px;
  margin: 20px 0 0;
  padding: 0;
  color: var(--ink-muted);
  font-size: 0.86rem;
  list-style: none;
}

.psSources li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.psSources li span:first-child {
  font-weight: 600;
}

.psSources a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Detail: make it in the App ---------- */

.psMake {
  margin-top: var(--section-y-sm);
  overflow: hidden;
  background:
    radial-gradient(70% 60% at 85% 20%, var(--accent-wash), transparent 70%),
    var(--paper-cool);
}

.psMakeInner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(40px, 7vw, 120px);
  padding-block: clamp(56px, 6vw, 96px) 0;
}

.psMakePhones {
  position: relative;
  display: flex;
  height: clamp(380px, 38vw, 520px);
  justify-content: center;
  align-self: end;
}

.psPhone {
  position: relative;
  display: block;
  width: clamp(200px, 19vw, 260px);
  aspect-ratio: 660 / 1434;
  overflow: hidden;
  border: 8px solid #0d1522;
  border-bottom: 0;
  border-radius: 40px 40px 0 0;
  background: #0d1522;
  box-shadow: 0 40px 80px -30px rgba(15, 27, 45, 0.45);
}

.psPhone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 32px 32px 0 0;
}

.psPhoneBack {
  position: absolute;
  inset-block-start: 40px;
  inset-inline-start: calc(50% - clamp(200px, 19vw, 260px) * 0.95);
  opacity: 0.55;
  transform: rotate(-6deg);
}

[dir="rtl"] .psPhoneBack {
  transform: rotate(6deg);
}

.psMakeCopy {
  padding-block-end: clamp(56px, 6vw, 96px);
}

.psMakeCopy p {
  max-width: 30em;
  margin: 16px 0 28px;
  color: var(--ink-soft);
  font-size: var(--lede);
  line-height: 1.65;
}

/* ---------- Detail: guidance ---------- */

.psGuide {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(32px, 6vw, 96px);
  padding-block: var(--section-y-sm) 0;
}

.psGuideHeading p {
  margin: 16px 0 0;
  color: var(--ink-muted);
  line-height: 1.7;
}

.psGuideSteps {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  counter-reset: ps-step;
  list-style: none;
}

.psGuideSteps li {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 24px 22px 76px;
  background: var(--paper);
  counter-increment: ps-step;
}

[dir="rtl"] .psGuideSteps li {
  padding: 22px 76px 22px 24px;
}

.psGuideSteps li::before {
  position: absolute;
  inset-block-start: 22px;
  inset-inline-start: 24px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--night);
  color: var(--gold);
  content: counter(ps-step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
}

.psGuideSteps h3 {
  margin: 0;
  font-size: 1.04rem;
  letter-spacing: var(--tracking-tight);
}

.psGuideSteps p {
  margin: 6px 0 0;
  color: var(--ink-muted);
  line-height: 1.6;
}

/* ---------- Detail: long-form guide (content/photo-sizes sections) ---------- */

.psArticle {
  padding-block: var(--section-y-sm) 0;
}

.psArticleBody {
  display: grid;
  gap: 40px;
  max-width: 760px;
  margin-top: 4px;
}

.psArticleBody h3 {
  margin: 24px 0 0;
  font-size: 1.12rem;
  letter-spacing: var(--tracking-tight);
}

.psArticleBody h4 {
  margin: 18px 0 0;
  font-size: 1rem;
}

.psArticleBody p,
.psArticleBody li {
  color: var(--ink-muted);
  line-height: 1.75;
}

.psArticleBody p {
  margin: 14px 0 0;
}

.psArticleBody ul,
.psArticleBody ol {
  margin: 14px 0 0;
  padding-inline-start: 1.3em;
}

.psArticleBody li + li {
  margin-top: 6px;
}

.psArticleBody strong {
  color: var(--ink);
}

/* ---------- Detail: related ---------- */

.psRelated {
  padding-block: var(--section-y-sm);
}

.psRelatedHeading {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 28px;
}

.psRelatedHeading h2 {
  margin: 0;
}

.psRelatedHeading a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .psHeroInner,
  .psFacts,
  .psFraming,
  .psGuide,
  .psMakeInner {
    grid-template-columns: minmax(0, 1fr);
  }

  .psLineup {
    justify-self: stretch;
  }

  .psStage {
    justify-self: stretch;
  }

  .psMakeCopy {
    order: -1;
    padding-block-end: 0;
  }
}

@media (max-width: 640px) {
  .psHero {
    padding-block: 32px 40px;
  }

  .psLineup {
    --mm: 2px;
    gap: 10px;
    padding: 24px 12px;
  }

  .psLineupItem {
    min-width: 0;
  }

  .psLineupItem strong {
    max-width: 72px;
    font-size: 0.74rem;
  }

  .psSearch input {
    height: 52px;
  }

  .psFilterInner {
    padding-block: 10px;
  }

  .psResultCount {
    display: none;
  }

  .psGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .psCardPlate {
    height: 104px;
  }

  .psShape {
    --mm: 1.25px;
  }

  .psShapePixel {
    height: 64px;
  }

  .psCardBody {
    padding: 12px 12px 0;
  }

  .psCardBody h3 {
    font-size: 0.9rem;
  }

  .psCardLink {
    padding: 10px 12px 12px;
  }

  .psStage {
    --stage-h: 250px;
    padding: 52px 52px 24px 34px;
  }

  .psStageFrame {
    width: min(calc(var(--stage-h) * var(--r)), 230px);
  }

  .psMakePhones {
    height: 360px;
  }

  .psPhone {
    width: 190px;
  }

  .psPhoneBack {
    inset-inline-start: calc(50% - 180px);
  }

  .psGuideSteps li {
    padding: 64px 20px 20px;
  }

  [dir="rtl"] .psGuideSteps li {
    padding: 64px 20px 20px;
  }

  .psGuideSteps li::before {
    inset-inline-start: 20px;
    inset-block-start: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .psHeroCopy > *,
  .psLineup,
  .psStage {
    animation: none;
  }
}
