/* Approved setup-helper page, shared with its original A preview. */
.sa-page {
  width: 100%;
  min-width: 0;
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  padding: 22px clamp(24px, 3cqw, 44px);
  background: var(--night, #121c19);
  color: var(--paper, #f0f3e9);
  font-family: var(--sans, 'Inter', 'Helvetica Neue', Arial, sans-serif);
}

.sa-page,
.sa-page *,
.sa-page *::before,
.sa-page *::after { box-sizing: border-box; }

.sa-page h1,
.sa-page h2,
.sa-page p,
.sa-page figure { margin: 0; }

.sa-meta,
.sa-main,
.sa-footer { width: 100%; max-width: 1160px; justify-self: center; }

.sa-meta,
.sa-source-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 20px;
  font: 9px/1.5 var(--mono, Menlo, Consolas, monospace);
  letter-spacing: .045em;
  text-transform: uppercase;
  color: var(--quiet, #a2b0a8);
}

.sa-edition { color: var(--lavender, #c2b8ff); }

.sa-main { display: grid; gap: 26px; min-width: 0; align-self: center; }

.sa-heading,
.sa-evidence { display: grid; grid-template-columns: minmax(0, 1fr) 216px; gap: 34px; min-width: 0; }
.sa-heading { align-items: end; }

.sa-page .sa-title {
  font-size: clamp(48px, 6.5cqw, 80px);
  line-height: .97;
  font-weight: 600;
  letter-spacing: -.063em;
  text-transform: uppercase;
}

.sa-title > span {
  display: block;
  margin-top: 10px;
  font-size: .63em;
  line-height: 1.05;
  letter-spacing: -.042em;
  color: var(--mint, #d0f5a5);
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 1px currentColor;
}

.sa-intro { padding-bottom: 2px; font-size: 17px; line-height: 1.5; letter-spacing: -.015em; color: var(--body-text, #d5dfd7); }
.sa-intro strong { color: var(--mint, #d0f5a5); font-weight: 600; white-space: nowrap; }

.sa-source-line { min-height: 24px; gap: 12px; }
.sa-source-line > span:last-child { color: var(--lavender, #c2b8ff); }
.sa-shot { min-width: 0; }

.sa-shot-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: zoom-in;
  border-radius: 16px 16px 4px 4px;
}

/* Intentional image excerpt: source x=40..1400, y=408..906 (1360×498).
   It preserves the guide, full input and save controls. The dialog shows 1440×1122. */
.sa-photo-crop {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1360 / 498;
  overflow: hidden;
  border: 1px solid #464361;
  border-radius: 16px;
  background: #171729;
  transition: border-color .18s ease;
}

.sa-photo {
  position: absolute;
  display: block;
  width: 105.882353%;
  max-width: none;
  height: auto;
  left: -2.941176%;
  top: -81.927711%;
}

.sa-photo-pointers { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--mint, #d0f5a5); pointer-events: none; }
.sa-photo-pointers path { stroke: currentColor; stroke-width: 1; opacity: .65; vector-effect: non-scaling-stroke; }
.sa-photo-pointers circle { fill: currentColor; }

.sa-photo-caption { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 9px; color: var(--quiet, #a2b0a8); font-size: 11px; line-height: 1.5; }
.sa-photo-action { display: inline-flex; align-items: center; gap: 9px; color: var(--mint, #d0f5a5); font-size: 12px; }
.sa-photo-action svg { width: 16px; height: 16px; flex-shrink: 0; }
.sa-shot-button:hover .sa-photo-crop { border-color: var(--mint, #d0f5a5); }
.sa-shot-button:hover .sa-photo-action { text-decoration: underline; text-underline-offset: 3px; }
.sa-shot-button:focus-visible { outline: 2px solid var(--mint, #d0f5a5); outline-offset: 6px; }

.sa-margin-notes {
  display: grid;
  grid-template-rows: 1fr 1fr;
  padding-top: 24px;
  padding-bottom: 27px;
  min-width: 0;
}

.sa-page .sa-note h2 { margin: 0 0 7px; font-size: 17px; line-height: 1.3; font-weight: 550; letter-spacing: -.035em; }
.sa-note p { color: var(--quiet, #a2b0a8); font-size: 14px; line-height: 1.5; letter-spacing: -.01em; }
.sa-note strong { color: var(--body-text, #d5dfd7); font-weight: 500; }

.sa-footer { display: flex; justify-content: space-between; align-items: baseline; gap: 20px 28px; padding-top: 16px; border-top: 1px solid var(--rule, #35453d); }
.sa-location { font-size: 13px; line-height: 1.5; letter-spacing: -.015em; }
.sa-location > span { margin: 0 7px; color: var(--lavender, #c2b8ff); }
.sa-location strong { color: var(--mint, #d0f5a5); font-weight: 550; }
.sa-return { font-size: 12px; line-height: 1.5; color: var(--quiet, #a2b0a8); }

@container reader (max-width: 850px) {
  .sa-page { padding: 26px 24px; gap: 30px; }
  .sa-heading { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .sa-page .sa-title { font-size: 9cqw; }
  .sa-intro { max-width: 44ch; padding: 0; }
  .sa-evidence { grid-template-columns: minmax(0, 1fr); gap: 25px; }
  .sa-margin-notes { grid-template-columns: 1fr 1fr; grid-template-rows: auto; gap: 28px; padding: 0; }
  .sa-photo-pointers { display: none; }
  .sa-note { padding-top: 15px; border-top: 1px solid var(--rule, #35453d); }
  .sa-note p { font-size: 15px; }
  .sa-footer { align-items: flex-start; }
  .sa-return { max-width: 22ch; }
}

@container reader (max-width: 600px) {
  .sa-page { padding: 24px 20px; gap: 28px; }
  .sa-edition { display: none; }
  .sa-main { gap: 28px; }
  .sa-page .sa-title { font-size: 14.1cqw; }
  .sa-title > span { margin-top: 10px; font-size: .59em; }
  .sa-intro { max-width: 34ch; }
  .sa-source-line { font-size: 8px; min-height: 24px; letter-spacing: .015em; }
  /* A larger left-hand excerpt on phones: both buttons remain complete.
     The input extends past the crop. The full step is one tap away. */
  .sa-photo-crop { aspect-ratio: 640 / 498; border-radius: 14px; }
  .sa-photo { width: 225%; left: -6.25%; }
  .sa-margin-notes { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .sa-note { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding-top: 17px; }
  .sa-page .sa-note h2 { margin: 0; font-size: 20px; }
  .sa-note p { font-size: 16px; line-height: 1.5; max-width: 38ch; }
  .sa-footer { flex-direction: column; gap: 11px; padding-top: 18px; }
  .sa-location { font-size: 13px; max-width: 35ch; }
  .sa-location > span { margin: 0 3px; }
  .sa-return { max-width: none; }
}

@media (max-height: 810px) {
  @container reader (min-width: 851px) {
    .sa-page { padding-top: 18px; padding-bottom: 18px; gap: 14px; }
    .sa-meta, .sa-main, .sa-footer { max-width: 1080px; }
    .sa-main { gap: 20px; }
    .sa-page .sa-title { font-size: min(6.5cqw, 68px); }
    .sa-footer { padding-top: 14px; }
  }
}

@media (prefers-reduced-motion: reduce) { .sa-photo-crop { transition: none; } }
@media (forced-colors: active) { .sa-title > span { -webkit-text-fill-color: currentColor; -webkit-text-stroke: 0; } }
