/* ============================================================================
   Intelliverse Press — gated library stylesheet (worker-rendered pages).
   The ONE external stylesheet the press worker links (CSP: style-src 'self').
   Brand: navy #1B3A6B, gold #C9952A (button fills only), warm cream canvas.
   Fonts self-hosted from /fonts (worker pages can't reach Astro's hashed URLs).
   Light-canvas brand surfaces — no dark mode v1; zero motion (reduced-motion safe).
   ========================================================================== */

/* ── Fonts ─────────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/playfair-display-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/lora-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Lora';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/lora-latin-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/inter-latin-600-normal.woff2') format('woff2');
}

/* ── Tokens ────────────────────────────────────────────────────────────── */
:root {
  /* Press brand */
  --navy: #1b3a6b;
  --navy-deep: #14294c;
  --gold: #c9952a;
  --gold-deep: #ac7d1f;
  --on-gold: #0d1b2a; /* ink on gold button = 6.5:1, AA pass */

  /* Canvas (sampled from design/DESIGN.md — warm, not clinical) */
  --canvas: #faf9f6;
  --canvas-soft: #f0ede6;
  --canvas-white: #ffffff;
  --cream-warm: #faf4e8; /* lapse-notice band — calm, not alarming */

  /* Ink */
  --ink: #0d1b2a;
  --ink-mid: #3a4e60; /* muted body/meta, still AA on canvas (~8:1) */

  /* Structure */
  --hairline: #ddd9d1;
  --hairline-strong: #bfb9ae;

  /* Type */
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Lora', Georgia, serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;

  --radius: 8px;
  --radius-sm: 5px;
  --measure: 65ch;
  --shadow-card: 0 2px 10px rgb(13 27 42 / 0.06);
}

/* ── Reset / base ──────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem; /* 17px */
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 {
  font-size: clamp(1.85rem, 1.4rem + 2vw, 2.5rem);
}
h2 {
  font-size: clamp(1.4rem, 1.2rem + 1vw, 1.7rem);
}
h3 {
  font-size: 1.2rem;
}
p {
  margin: 0 0 1rem;
  max-width: var(--measure);
}
a {
  color: var(--navy);
  text-underline-offset: 2px;
}
a:hover {
  color: var(--navy-deep);
}
strong {
  font-weight: 400;
}
strong,
b {
  color: var(--navy);
}
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Type helpers */
.ui {
  font-family: var(--font-ui);
}
.muted {
  color: var(--ink-mid);
}
.eyebrow {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-mid);
  margin: 0 0 0.35rem;
}

/* ── Layout ────────────────────────────────────────────────────────────── */
.wrap {
  width: 100%;
  max-width: 46rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}
main {
  flex: 1 0 auto;
  width: 100%;
  padding-block: 2.5rem 3.5rem;
}
.stack > * + * {
  margin-top: 1.1rem;
}
.lede {
  font-size: 1.15rem;
  color: var(--ink-mid);
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 100;
  background: var(--navy);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top 120ms ease;
}
.skip-link:focus {
  top: 0.75rem;
  color: #fff;
}

/* ── App header / footer ───────────────────────────────────────────────── */
.app-header {
  background: var(--canvas-white);
  border-bottom: 1px solid var(--hairline);
}
.app-header__inner {
  display: flex;
  align-items: center;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  padding-block: 0.85rem;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--navy);
  text-decoration: none;
  margin-right: auto;
}
.app-header__context {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-mid);
  margin: 0 0 0 auto; /* desktop: context + sign-out sit together on the right */
}
/* Narrow screens: wordmark takes its own row; context + sign-out group
   together on the second row instead of an orphaned button. */
@media (max-width: 480px) {
  .wordmark {
    flex-basis: 100%;
  }
  .app-header__context {
    margin-left: 0;
  }
}
.signout {
  margin: 0;
}
.signout button {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--ink-mid);
  background: none;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  min-height: 40px;
  cursor: pointer;
}
.signout button:hover {
  color: var(--navy);
  border-color: var(--navy);
}
.app-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--hairline);
  background: var(--canvas-white);
}
.app-footer__inner {
  padding-block: 1.5rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--ink-mid);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  align-items: baseline;
}
.app-footer__mark {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--navy);
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.7rem 1.4rem;
  font-family: var(--font-ui);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 999px; /* thumb-friendly pill */
  cursor: pointer;
}
/* Gold means "this is the button" — the only place gold appears. */
.btn--gold {
  background: var(--gold);
  color: var(--on-gold);
  box-shadow: 0 1px 2px rgb(13 27 42 / 0.14);
}
.btn--gold:hover {
  background: var(--gold-deep);
  color: var(--on-gold);
}
.btn--ghost {
  background: transparent;
  color: var(--navy);
  border-color: var(--hairline-strong);
}
.btn--ghost:hover {
  color: var(--navy-deep);
  border-color: var(--navy);
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.4rem;
}
.btn-row--center {
  justify-content: center;
}
.btn--block {
  width: 100%;
}

/* ── Cards / shelf ─────────────────────────────────────────────────────── */
.shelf-grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: 1fr;
  margin-top: 1.75rem;
}
@media (min-width: 40rem) {
  .shelf-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.card {
  background: var(--canvas-white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--navy);
  margin: 0;
  line-height: 1.25;
}
.card__meta {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--ink-mid);
  margin: 0;
}
.card__actions {
  margin-top: auto;
  padding-top: 0.6rem;
}

/* Tag chips */
.tag {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mid);
  background: var(--canvas-soft);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
}
.tag--free {
  color: var(--navy);
  background: var(--cream-warm);
  border-color: color-mix(in srgb, var(--gold) 45%, var(--hairline));
}

/* Locked upsell card — inviting, not nagging: warm, a quiet lock, a gold CTA. */
.card--locked {
  background: var(--canvas-soft);
  border-style: dashed;
  border-color: var(--hairline-strong);
  box-shadow: none;
}
.lock-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  background: var(--canvas-white);
  border: 1px solid var(--hairline-strong);
  color: var(--navy);
}
.lock-badge svg {
  width: 1.1rem;
  height: 1.1rem;
}
.card--locked .card__title {
  color: var(--navy);
}

/* ── Repository ────────────────────────────────────────────────────────── */
.current {
  background: var(--canvas-white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  margin-top: 1.5rem;
}
.current__version {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--navy);
  margin: 0 0 0.15rem;
}
.section-head {
  margin-top: 2.75rem;
}
.changelog {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}
.changelog__item {
  padding: 1.1rem 0;
  border-top: 1px solid var(--hairline);
}
.changelog__item:first-child {
  border-top: 0;
}
.changelog__ver {
  font-family: var(--font-ui);
  font-weight: 600;
  color: var(--navy);
}
.changelog__date {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--ink-mid);
  margin-left: 0.5rem;
}
.changelog__notes {
  margin: 0.4rem 0 0;
}

/* Vault teaser card on the repository page */
.vault-teaser {
  display: block;
  margin-top: 1.75rem;
  padding: 1.25rem 1.4rem;
  background: var(--canvas-white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  text-decoration: none;
  box-shadow: var(--shadow-card);
}
.vault-teaser:hover {
  border-color: var(--navy);
}

/* ── Vault list ────────────────────────────────────────────────────────── */
.vault-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.vault-item {
  background: var(--canvas-white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
}
.vault-item__body {
  flex: 1 1 12rem;
}
/* A framed player takes the row's full width and keeps 16:9 at every size.
   Majority of vault traffic is a phone that just scanned a QR code. */
.vault-player {
  flex: 1 1 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--canvas-soft, #eee);
}
.vault-player iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.vault-item__title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--navy);
  font-size: 1.1rem;
  margin: 0.15rem 0 0;
}

/* ── Banners / notices ─────────────────────────────────────────────────── */
.notice {
  background: var(--cream-warm);
  border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--hairline));
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  margin: 0 0 1.5rem;
}
.notice p {
  margin: 0;
  color: var(--ink-mid);
}
.notice p + p {
  margin-top: 0.5rem;
}
.notice__title {
  font-family: var(--font-ui);
  font-weight: 600;
  color: var(--navy);
}
/* Lapse banner — calm cream band, navy text (never alarming). */
.banner--lapse {
  background: var(--cream-warm);
  border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--hairline));
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  margin: 1.5rem 0;
}
.banner--lapse p {
  color: var(--ink-mid);
  margin: 0;
}
.banner--lapse p + p {
  margin-top: 0.55rem;
}

/* ── Forms ─────────────────────────────────────────────────────────────── */
.form {
  max-width: 26rem;
  margin-top: 1.5rem;
}
.field {
  display: block;
  margin-bottom: 1rem;
}
.field label {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.4rem;
}
.field input {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.9rem;
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--ink);
  background: var(--canvas-white);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
}
.field input:focus-visible {
  border-color: var(--navy);
  outline: 3px solid var(--gold);
  outline-offset: 1px;
}
/* Honeypot — visually and semantically removed from the flow. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form-note {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--ink-mid);
  margin-top: 0.9rem;
}

/* ── Empty states ──────────────────────────────────────────────────────── */
.empty {
  background: var(--canvas-soft);
  border-radius: var(--radius);
  padding: 2.25rem 1.5rem;
  margin-top: 1.5rem;
  text-align: center;
}
.empty p {
  margin-inline: auto;
  color: var(--ink-mid);
}

/* ── Motion ────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* ── Publisher sidecar ─────────────────────────────────────────────────────── */
.page-publish .pub-shelf {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pub-shelf__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.pub-shelf__title {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.pub-secondary {
  margin-top: 1.75rem;
}

.pub-sheet {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 0;
  max-width: 34rem;
  width: calc(100% - 2rem);
  background: #12161d;
  color: inherit;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.pub-sheet::backdrop {
  background: rgba(6, 8, 12, 0.72);
}

.pub-sheet__close-row {
  display: flex;
  justify-content: flex-end;
  margin: 0;
  padding: 0.65rem 0.75rem 0;
}

.pub-sheet__close {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  font: inherit;
  padding: 0.25rem 0.5rem;
}

.pub-sheet__close:hover {
  opacity: 1;
}

.pub-sheet__inner {
  padding: 0 1.25rem 1.4rem;
}

.pub-sheet__inner h2 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}

.dropzone {
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone--hot {
  border-color: rgba(212, 175, 99, 0.7);
  background: rgba(212, 175, 99, 0.06);
  outline: none;
}

.dropzone__label {
  margin: 0;
  font-weight: 500;
}

.dropzone__hint {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
}

.dropzone__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.file-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* The publisher's loaded-items list. Without these the row was run-on text
   ("Complete Audio Companion audio Check Remove") with a destructive Remove one
   word-space from Check, fifty-nine times over. Columns, a rule between rows,
   and Remove pushed to its own end of the row. */
.file-list__row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 0.25rem 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--hairline);
}
.file-list__name {
  font-family: var(--font-ui);
  font-weight: 600;
  color: var(--ink);
  min-width: 0;
  overflow-wrap: break-word;
}
/* On a phone four columns squeeze the title into a three-line column and break
   words mid-way. Give the title the full width and let the meta and the two
   actions share the row beneath it. */
@media (max-width: 32rem) {
  .file-list__row {
    grid-template-columns: 1fr auto auto;
    gap: 0.35rem 0.75rem;
  }
  .file-list__name {
    grid-column: 1 / -1;
  }
}
.file-list__row .ui,
.file-list__row .ui--danger {
  /* 44px: this row carries a delete and is used on a phone. */
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.file-list__row .inline-form {
  margin-left: 0.5rem;
}

.file-list .tag {
  display: inline-block;
  min-width: 3rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.8;
}

.manifest-status {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  opacity: 0.8;
}

.email-live {
  margin: 1.1rem 0 0.75rem;
}

.email-live__label {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
}

.email-live__card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  background: rgba(0, 0, 0, 0.25);
}

.email-live__subject {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.email-live__body {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.45;
  opacity: 0.9;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.85rem 0 1rem;
  cursor: pointer;
}

.check input {
  margin-top: 0.2rem;
}

.form-error {
  color: #f0a0a0;
  margin: 0 0 0.75rem;
}

.form-warn {
  color: #8a5a00;
  background: #fff6e5;
  border: 1px solid #f0d59a;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  margin: 0.5rem 0;
  font-size: 0.92rem;
}
.form-ok {
  color: #b7d7a8;
  margin: 0 0 0.75rem;
}

.notice--ok {
  border-color: rgba(140, 190, 120, 0.35);
}

.field__hint,
.field__follow {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  opacity: 0.7;
}

.field__follow {
  margin-top: 0.85rem;
}

@media (max-width: 560px) {
  .pub-shelf__row {
    flex-direction: column;
    align-items: stretch;
  }
}


/* Publisher price picker */
.price-create {
  border: 1px solid var(--border, #e6e0d4);
  border-radius: 8px;
  padding: 0.5rem 0.85rem 0.85rem;
  margin: 0.5rem 0 1rem;
}
.price-create summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.35rem 0;
}
.notice--live {
  border-color: #f0b4b4;
  background: #fff5f5;
}
.notice--test {
  border-color: #b7d7f0;
  background: #f3f9ff;
}
.field__follow {
  display: block;
  margin-top: 0.75rem;
}


.pub-shelf__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}
.pub-shelf__last {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-mid);
}
/* These three rules used to paint white-on-transparent, which was correct for a
   dark publisher shelf that no longer exists: .page-publish sets no dark
   background anywhere in this file. Being LATER in the cascade they beat the
   navy definitions at :308, so on the live publisher page the Notify button and
   the last-notified line were white text on cream, i.e. invisible. Repointed at
   the tokens rather than deleted, so the ghost button keeps its own quieter
   weight against .btn--gold. Found 2026-08-05 while adding the vault door. */
.btn--ghost:hover:not(:disabled) {
  border-color: var(--navy, var(--ink));
  background: rgba(13, 27, 42, 0.04);
}
.btn--ghost:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Form controls: selects, action row, quiet button ────────────────────────
   Native selects were rendering as raw OS widgets against a typeset page.
   These match the text inputs already in .form, and keep the platform arrow
   out by drawing our own. Sized to the same rhythm so a row of fields reads
   as one column, not as a form bolted onto a page. */
.form select {
  /* NO `appearance: none`. Three attempts at a CSS chevron have now rendered
     armless in the wild, and a dropdown with no arrow is worse than a plain one.
     The platform draws the arrow; we own the border, spacing and typeface so it
     sits in the page. Same tokens as .field input, one degree more presence. */
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.9rem;
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--ink);
  background: var(--canvas-white);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.16s ease;
}
.form select:hover { border-color: var(--navy); }
.form select:focus-visible {
  border-color: var(--navy);
  outline: 3px solid var(--gold);
  outline-offset: 1px;
}

/* Kill the number spinners. They read as a stray chevron sitting on the ONE
   field that is meant to be typed into, right beside a dropdown that had lost
   its own arrow, so the only affordance on the page was pointing at the wrong
   control. A price is typed, not nudged one cent at a time. */
.form input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}
.form input[type="number"]::-webkit-outer-spin-button,
.form input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
.form select:disabled { opacity: 0.55; cursor: not-allowed; }

/* Save sits beside a way out, because most visits are to look, not to change. */
.form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.form__actions .btn { flex: 0 0 auto; }

.btn--quiet {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.btn--quiet:hover { border-color: var(--navy); background: rgba(0, 0, 0, 0.03); }

/* The value a field already holds, stated before the control that changes it. */
.field__current {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
  opacity: 0.8;
}
.field__current strong { font-weight: 600; }

/* ── Publisher panels: status first, controls second ─────────────────────────
   The edit screen is read far more often than it is changed, so it is grouped
   into panels a publisher can scan, with the one live control (price) stating
   its consequences before the button that fires it. */
.panel {
  margin: 1.75rem 0;
  padding: 1.25rem 1.25rem 1.4rem;
  background: var(--canvas-white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md, 14px);
}
.panel h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.62;
}

/* What buyers pay, said plainly before anything asks to change it. */
.price-now {
  margin: 0 0 1.1rem;
  font-size: 1.15rem;
}
.price-now strong { font-weight: 600; }

/* Facts, not fields. */
.facts { margin: 0 0 0.9rem; }
.facts > div {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--hairline);
}
.facts > div:last-child { border-bottom: 0; }
.facts dt {
  flex: 0 0 8.5rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  opacity: 0.62;
}
.facts dd { margin: 0; }

/* A labelled divider between two ways of doing the same thing. */
.or-rule {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 1.1rem 0;
  opacity: 0.55;
  font-family: var(--font-ui);
  font-size: 0.85rem;
}
.or-rule::before,
.or-rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hairline);
}

/* Said before the button, never after. */
.consequences {
  margin: 1.2rem 0 0;
  padding: 0.9rem 1rem;
  background: rgba(28, 44, 74, 0.035);
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
}
.consequences p { margin: 0 0 0.5rem; font-family: var(--font-ui); font-size: 0.86rem; }
.consequences ul { margin: 0; padding-left: 1.1rem; }
.consequences li { margin: 0.3rem 0; }

/* Currency sign inside the field, so the input holds only the number. */
.amount-field { position: relative; }
.amount-field__symbol {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.55;
  pointer-events: none;
}
.amount-field input { padding-left: 1.9rem; }

/* A product that cannot be sold says so on its own row, before a customer
   finds out. Loud enough to stop a scroll, quiet enough not to shout. */
.pub-shelf__row--alert { border-left: 3px solid var(--gold); padding-left: 0.85rem; }
.pub-shelf__alert {
  margin: 0.35rem 0 0.5rem;
  padding: 0.55rem 0.7rem;
  font-size: 0.93rem;
  background: rgba(201, 149, 42, 0.09);
  border-radius: var(--radius-sm);
}
.pub-shelf__alert strong { font-family: var(--font-ui); }

/* Audio companions play in the row. preload="none" so a chapter page with four
   items does not pull four files on open over a phone connection. */
.vault-audio {
  flex: 1 1 100%;
}
.vault-audio audio {
  width: 100%;
  display: block;
}

.inline-form { display: inline; }
.ui--danger { color: var(--danger, #a3341f); background: none; border: 0; cursor: pointer; font: inherit; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ── The vault's chapter index ───────────────────────────────────────────────
   The reader scanned a code inside chapter 3 and is holding a phone. This is
   the first thing under the title and the shortest path to what they came for:
   one tap, no scrolling past thirteen other chapters. It scrolls sideways on a
   phone rather than wrapping to four rows and pushing the content off screen. */
.vault-index {
  display: flex;
  gap: 0.4rem;
  margin: 1.5rem 0 0;
  padding-bottom: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.vault-index::-webkit-scrollbar { display: none; }
.vault-index__link {
  flex: 0 0 auto;
  min-width: 2.4rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--canvas-white);
  color: var(--ink-mid);
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.vault-index__link:hover,
.vault-index__link:focus-visible {
  border-color: var(--hairline-strong);
  color: var(--ink);
}

.vault-section {
  margin-top: 2.5rem;
  /* The anchor target sits under the page's own breathing room, so a jump does
     not land the heading flush against the top of the viewport. */
  scroll-margin-top: 1.5rem;
}
.vault-section__title {
  font-size: 1.0625rem;
  letter-spacing: 0.02em;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--hairline);
}

@media (prefers-reduced-motion: reduce) {
  .vault-index__link { transition: none; }
}

/* An audio item's player IS the action, so the file download steps back to a
   quiet link. One primary action per row. */
.vault-item .vault-audio + .btn--gold {
  background: none;
  border: 1px solid var(--hairline);
  color: var(--ink-mid);
  box-shadow: none;
}
.vault-item .vault-audio + .btn--gold:hover {
  border-color: var(--hairline-strong);
  color: var(--ink);
}
