/* ==========================================================================
   NEMEVORA — lecture formatting service
   Extends css/styles.css. Same tokens, same restraint; this file only adds the
   pieces the service page needs.
   ========================================================================== */

/* .visually-hidden and .offer-badge live in css/styles.css: the main page uses
   them too. */

/* --- Intro ----------------------------------------------------------------- */

.lecture-intro { padding-block: clamp(3rem, 6vw, 5.5rem) clamp(2rem, 4vw, 3rem); }

.lecture-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-block: 1.1rem 1.3rem;
}

.lecture-head h1 { font-size: clamp(2.4rem, 1.6rem + 3.4vw, 4rem); }

.promise-list {
  display: grid;
  gap: 0.45rem;
  max-width: 44rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}
.promise-list li {
  position: relative;
  padding-inline-start: 1.15rem;
  font-size: 0.99rem;
  color: var(--text-soft);
}
.promise-list li::before {
  content: "";
  position: absolute;
  top: 0.95em;
  inset-inline-start: 0;
  width: 0.5rem;
  height: 1px;
  background: var(--gold);
}

/* --- Flow ------------------------------------------------------------------ */

.lecture-app { padding-block: clamp(3rem, 6vw, 5rem); }

.flow {
  display: grid;
  gap: clamp(1.25rem, 2.5vw, 1.75rem);
  max-width: 54rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow-step {
  padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--medium) var(--ease), box-shadow var(--medium) var(--ease),
    opacity var(--medium) var(--ease);
}
.flow-step.is-active {
  border-color: rgba(6, 36, 69, 0.3);
  box-shadow: var(--shadow-md);
}
.flow-step.is-done { opacity: 0.9; }

.flow-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.flow-num {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  flex: none;
  border: 1px solid var(--teal);
  border-radius: 50%;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
  background: var(--bg-cream);
}
.flow-step.is-done .flow-num {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--on-navy);
}

.flow-head h3 { font-size: clamp(1.45rem, 1.3rem + 0.5vw, 1.7rem); }

/* --- Dropzone --------------------------------------------------------------- */

.dropzone {
  display: grid;
  place-items: center;
  gap: 0.5rem;
  padding: clamp(2rem, 5vw, 3.25rem) 1.25rem;
  background: var(--bg-cream);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--fast) var(--ease), background-color var(--fast) var(--ease),
    box-shadow var(--medium) var(--ease), transform var(--medium) var(--ease-out);
}
.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--navy);
  box-shadow: inset 0 -3px 0 var(--gold);
}
.dropzone.is-dragging {
  border-color: var(--gold);
  background: rgba(175, 129, 67, 0.06);
  transform: translateY(-2px);
}
.dropzone[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

.dropzone-icon {
  width: 2.4rem;
  height: 2.4rem;
  margin-bottom: 0.35rem;
  fill: none;
  stroke: var(--teal);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dropzone-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.4;
}

.dropzone-hint { font-size: 0.92rem; color: var(--text-faint); }

/* Real upload progress (the only percentage on the page) */
.upload-progress { margin-top: 1.1rem; }

.upload-bar {
  height: 4px;
  background: rgba(6, 36, 69, 0.1);
  border-radius: 999px;
  overflow: hidden;
}
.upload-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--teal);
  transition: width 200ms linear;
}

.upload-label {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-faint);
}

.privacy-note {
  margin-top: 1.25rem;
  padding-inline-start: 0.9rem;
  border-inline-start: 2px solid var(--teal-light);
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-faint);
}

/* --- File and result cards --------------------------------------------------- */

.file-card,
.result-card {
  display: grid;
  gap: 1.25rem;
}

.file-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.9rem 1.5rem;
  margin: 0;
}
.file-facts > div {
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.file-facts dt {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-faint);
}
.file-facts dd {
  margin: 0.2rem 0 0;
  font-size: 1rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.status-ok { color: var(--teal); }
.status-error { color: var(--gold); }

.file-card .btn { justify-self: start; }

/* --- Mode choice -------------------------------------------------------------- */

.modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.mode-card {
  position: relative;
  display: block;
  padding: 1.1rem 1.25rem;
  background: var(--bg-cream);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--fast) var(--ease), box-shadow var(--medium) var(--ease),
    transform var(--medium) var(--ease-out);
}
.mode-card:hover { border-color: rgba(6, 36, 69, 0.35); transform: translateY(-2px); }
.mode-card.is-selected {
  border-color: var(--navy);
  box-shadow: inset 0 -3px 0 var(--gold);
}
.mode-card.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.mode-card input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.mode-card:focus-within {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}

.mode-title {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.4;
}

.mode-text {
  display: block;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-soft);
}

.mode-note {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--gold);
}

/* --- Stages -------------------------------------------------------------------- */

.stages {
  display: grid;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stages li {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-block: 0.55rem;
  font-size: 1rem;
  color: var(--text-faint);
  transition: color var(--medium) var(--ease);
}

.stage-dot {
  position: relative;
  width: 0.7rem;
  height: 0.7rem;
  flex: none;
  border: 1px solid var(--teal-light);
  border-radius: 50%;
  background: transparent;
  transition: background-color var(--medium) var(--ease), border-color var(--medium) var(--ease);
}

.stages li.is-done { color: var(--text-soft); }
.stages li.is-done .stage-dot { background: var(--teal); border-color: var(--teal); }

.stages li.is-current { color: var(--navy); font-weight: 600; }
.stages li.is-current .stage-dot { border-color: var(--gold); background: var(--gold); }

@media (prefers-reduced-motion: no-preference) {
  .stages li.is-current .stage-dot::after {
    content: "";
    position: absolute;
    inset: -5px;
    border: 1px solid var(--gold);
    border-radius: 50%;
    animation: stage-pulse 1.6s var(--ease-out) infinite;
  }
}

@keyframes stage-pulse {
  0% { transform: scale(0.75); opacity: 0.85; }
  70% { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(1.25); opacity: 0; }
}

/* --- Result --------------------------------------------------------------------- */

.result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.btn-text {
  padding: 0.4rem 0;
  border: 0;
  background: none;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--text-faint);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.btn-text:hover { color: var(--navy); }

.result-note {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-faint);
}

/* --- Notices --------------------------------------------------------------------- */

.notice {
  max-width: 54rem;
  margin-top: 1.5rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--gold);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}
.notice p + p { margin-top: 0.4rem; }
.notice-title { font-weight: 600; }
.notice-error { border-inline-start-color: var(--gold); }
.notice-warn { border-inline-start-color: var(--teal); margin-bottom: 1.5rem; }
/* Sign in before uploading: an invitation, not a failure */
.notice-signin { border-inline-start-color: var(--teal); margin-top: 0; margin-bottom: 1.5rem; }
/* --- Paying for an order ------------------------------------------------------- */

.notice-payment { border-inline-start-color: var(--gold); }

/* Where the order stands, said plainly and first */
.payment-state {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--navy);
}

.payment-state.is-submitted { color: var(--teal); }

.payment-why { margin-top: 0.35rem; font-size: 0.95rem; color: var(--text-soft); }

/* 1. The order number leads the screen: biggest type, its own panel, and the
      only accent-filled button on it. Everything else is deliberately quieter. */
.payment-order-block {
  margin-block: 1.3rem;
  padding: 1.2rem 1.3rem;
  text-align: center;
  background: var(--bg-cream);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.payment-order-label {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.payment-order-value {
  margin-block: 0.3rem 0.9rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 2.6rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.06em;
  color: var(--navy);
  -webkit-user-select: all;
  user-select: all;
}

/* The prominent copy button. Filled in the accent colour and comfortably
   tappable, against the receiver's small outlined one below. */
.btn-copy-primary {
  appearance: none;
  padding: 0.6rem 1.5rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--bg-cream);
  background: var(--gold);
  border: 0;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}

.btn-copy-primary:hover { background: #9c7038; transform: translateY(-1px); }
.btn-copy-primary:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.btn-copy-primary.is-copied { background: var(--teal); }

/* 2. The amount */
.payment-amount-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1rem;
  padding-block: 0.7rem;
  border-bottom: 1px solid var(--line-soft);
}

.payment-amount-label { font-size: 0.95rem; color: var(--text-soft); }

/* Why the amount above is lower than the list price. One quiet line: the
   number that matters is the one being asked for, not the saving. */
.payment-discount {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  line-height: 1.7;
  color: #2E6B6B;
}

/* 3. The design, chosen before the money moves ------------------------------
   Compact by design: this screen's job is getting a transfer right, so the
   chooser has to be answerable at a glance rather than studied. */
.payment-style { padding-block: 1rem; border-bottom: 1px solid var(--line-soft); }

.payment-style-head {
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
}

.payment-style-options { display: grid; gap: 0.5rem; }

.pay-style {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.65rem 0.8rem;
  background: var(--bg-cream);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}

.pay-style:hover { border-color: var(--line-strong); }

.pay-style.is-selected {
  background: #FFFDFA;
  border-color: var(--navy);
  box-shadow: inset 0 0 0 1px var(--navy);
}

/* The radio itself is the accessible control; the card is its visible form */
.pay-style input {
  flex: none;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0.15rem 0 0;
  accent-color: var(--navy);
}

.pay-style .mode-swatch { flex: none; }

.pay-style-body { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }

.pay-style-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
}

/* Marks the preselected option as a considered default, not a stray click */
.pay-style-default {
  padding: 0.05rem 0.4rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-soft);
  background: rgba(6, 36, 69, 0.07);
  border-radius: 999px;
}

.pay-style-text { font-size: 0.85rem; line-height: 1.6; color: var(--text-soft); }

/* After the transfer claim: a sentence instead of a question */
.payment-style-locked { font-size: 0.95rem; color: var(--navy); }
.payment-style-locked strong { font-weight: 600; }
/* .btn-text lives in css/admin.css, which this page does not load */
#payment-style-change {
  margin-top: 0.35rem;
  padding: 0;
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.9rem;
  color: var(--teal);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

#payment-style-change:hover { color: var(--navy); }
#payment-style-status { min-height: 1.3em; margin-top: 0.45rem; font-size: 0.88rem; }

@media (max-width: 420px) {
  .pay-style { padding: 0.6rem 0.65rem; gap: 0.5rem; }
  .pay-style .mode-swatch { display: none; }
}

/* 4. Why it is a manual transfer */
.payment-method-note {
  margin-top: 0.9rem;
  font-size: 0.93rem;
  line-height: 1.7;
  color: var(--text-faint);
}

/* 4. The destination: same row shape, but plainly secondary to the block above */
.payment-receiver-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.7rem;
  margin-top: 0.9rem;
  padding: 0.8rem 1rem;
  background: var(--bg-cream);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.payment-receiver-label-text {
  font-size: 0.9rem;
  color: var(--text-faint);
  margin-inline-end: auto;
}

.payment-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.03em;
  overflow-wrap: anywhere;
  /* If the clipboard is unavailable - an old browser, a page not on a secure
     origin, a denied permission - the copy button says to copy by hand. One tap
     should then select the whole value, not half a transfer number. */
  -webkit-user-select: all;
  user-select: all;
}

.payment-amount {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.02em;
}

.payment-receiver-label { font-size: 0.88rem; color: var(--text-faint); }

.btn-copy {
  flex: none;
  appearance: none;
  padding: 0.25rem 0.6rem;
  font: inherit;
  font-size: 0.82rem;
  color: var(--text-soft);
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}

.btn-copy:hover { color: var(--navy); border-color: var(--line-strong); }
.btn-copy:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn-copy.is-copied { color: var(--teal); border-color: var(--teal); }

/* 5. The one step that decides whether a transfer can be matched at all. Given
      a border and a tint so it reads as an instruction, not as more prose. */
.payment-callout {
  margin-top: 1.2rem;
  padding: 1rem 1.15rem;
  background: rgba(175, 129, 67, 0.1);
  border: 1px solid rgba(175, 129, 67, 0.45);
  border-inline-start: 4px solid var(--gold);
  border-radius: var(--radius-md);
}

.payment-callout-head {
  margin-bottom: 0.4rem;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--navy);
}

.payment-callout p { font-size: 0.97rem; line-height: 1.75; color: var(--navy); }

/* 6. What happens next */
.payment-reassurance {
  margin-top: 1rem;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--teal);
}

/* Kept for the "payment unavailable" fallback, which still uses it */
.payment-instruction {
  padding: 0.85rem 1rem;
  font-size: 0.97rem;
  line-height: 1.7;
  color: var(--navy);
  background: rgba(175, 129, 67, 0.08);
  border-radius: var(--radius-md);
}

.payment-inline-number {
  display: inline-block;
  padding: 0.05rem 0.35rem;
  font-weight: 600;
  background: var(--bg-card);
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.notice-payment .btn-primary { margin-top: 1.1rem; }

.payment-proof {
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line-soft);
}

.payment-proof summary {
  font-size: 0.95rem;
  color: var(--text-soft);
  cursor: pointer;
}

.payment-proof summary:hover { color: var(--navy); }
.payment-proof-text { margin-top: 0.6rem; font-size: 0.9rem; line-height: 1.7; color: var(--text-faint); }
.payment-proof .btn { margin-top: 0.7rem; }

.payment-footnote {
  margin-top: 1.3rem;
  font-size: 0.88rem;
  color: var(--text-faint);
}

@media (max-width: 460px) {
  /* The label above the value, so a long transfer number is not squeezed */
  .payment-receiver-row { flex-direction: column; align-items: stretch; gap: 0.35rem; }
  .payment-receiver-label-text { margin-inline-end: 0; }
  .payment-receiver-row .btn-copy { align-self: flex-start; }
  .btn-copy-primary { width: 100%; }
}

/* A lecture of yours still open on the server. Not a failure - an offer. */
.notice-resume { border-inline-start-color: var(--teal); margin-top: 0; margin-bottom: 1.5rem; }
.notice-resume #resume-detail { margin-top: 0.4rem; font-weight: 500; }

.resume-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

/* .notice .btn adds a top margin meant for a lone button; the row owns its own */
.resume-actions .btn { margin-top: 0; }

.resume-hint {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  color: var(--text-faint);
}

@media (max-width: 460px) {
  /* Two buttons side by side stop fitting; stacking keeps both tappable */
  .resume-actions { flex-direction: column; align-items: stretch; }
  .resume-actions .btn { justify-content: center; }
}
.notice .btn { margin-top: 0.9rem; }

/* Dimmed by aria-disabled above; this stops the click as well as showing it */
.dropzone.is-disabled { pointer-events: none; }

/* --- Style swatches ----------------------------------------------------------------- */

.modes-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }

.mode-swatch {
  display: flex;
  gap: 4px;
  height: 2.6rem;
  margin-bottom: 0.9rem;
  padding: 5px;
  border-radius: 6px;
  border: 1px solid var(--line-soft);
}
.mode-swatch i { display: block; border-radius: 3px; }
.mode-swatch i:nth-child(1) { flex: 3; }
.mode-swatch i:nth-child(2) { flex: 1.2; }
.mode-swatch i:nth-child(3) { flex: 0.5; }
.swatch-academic { background: #FAF7F2; }
.swatch-academic i:nth-child(1) { background: linear-gradient(#062445 0 22%, transparent 22% 34%, #DDD6CA 34% 40%, transparent 40% 52%, #DDD6CA 52% 58%, transparent 58%); }
.swatch-academic i:nth-child(2) { background: #E4EDEC; }
.swatch-academic i:nth-child(3) { background: #AF8143; }
.swatch-clinical { background: #F7F6F3; }
.swatch-clinical i:nth-child(1) { background: linear-gradient(90deg, #579292 0 6%, #EDF2F2 6%); }
.swatch-clinical i:nth-child(2) { background: #0B2B45; }
.swatch-clinical i:nth-child(3) { background: #F5EDE0; }
.swatch-original { background: repeating-linear-gradient(135deg, #F4F3F1 0 6px, #ECEAE6 6px 12px); }
.swatch-original i:nth-child(1) { background: rgba(6, 36, 69, 0.18); }
.swatch-original i:nth-child(2) { background: rgba(87, 146, 146, 0.35); }
.swatch-original i:nth-child(3) { background: #AF8143; }

/* --- Processing extras ---------------------------------------------------------------- */

.queue-note,
.stage-hint {
  margin: 0 0 0.8rem;
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--text-faint);
}
.stage-hint { margin: 1rem 0 0; max-width: 46rem; }

/* --- Review checkpoint ------------------------------------------------------------------ */

.review {
  margin-top: 1.75rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--gold);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}
.review-lead { margin-top: 0.4rem; font-size: 0.94rem; line-height: 1.8; color: var(--text-soft); }
.review-list { display: grid; gap: 1rem; margin: 1.25rem 0 0; padding: 0; list-style: none; }
.review-item {
  display: grid;
  gap: 0.6rem;
  padding: 1rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: var(--bg-cream);
}
.review-meta { font-size: 0.85rem; color: var(--text-faint); }
.review-crop {
  display: block;
  max-width: 100%;
  max-height: 11rem;
  object-fit: contain;
  justify-self: start;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}
.review-text {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font: 1rem/1.7 var(--font-body);
  color: var(--navy);
  resize: vertical;
}
.review-text:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.review-alt { font-size: 0.9rem; color: var(--text-soft); display: flex; flex-wrap: wrap; gap: 0.3rem 0.6rem; align-items: baseline; }
.review-choices { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; font-size: 0.94rem; }
.review-choices label { display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer; }
.review-choices input { accent-color: var(--navy); }
.review-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin-top: 1.25rem; }

/* --- Preview ----------------------------------------------------------------------------- */

.result-figures { font-size: 0.9rem; line-height: 1.75; color: var(--text-soft); }

.preview { display: grid; gap: 0.75rem; min-width: 0; }
.preview-stage { margin: 0; }
.preview-stage img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
}
.preview-stage figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-faint);
  text-align: center;
}
.preview-strip {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem 0.1rem 0.6rem;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
}
.preview-thumb {
  flex: 0 0 7.5rem;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  background: none;
  cursor: pointer;
  scroll-snap-align: start;
  transition: border-color var(--fast) var(--ease), transform var(--medium) var(--ease-out);
}
.preview-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line-soft);
}
.preview-thumb:hover { transform: translateY(-2px); }
.preview-thumb.is-current { border-color: var(--gold); }
.preview-thumb:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

.redesign { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.redesign-label { font-size: 0.9rem; color: var(--text-faint); }
.redesign-label + span { display: inline-flex; flex-wrap: wrap; gap: 0.5rem; }
.result-actions-secondary { padding-top: 0.25rem; }
#download-link.is-disabled { opacity: 0.45; pointer-events: none; }

/* --- Responsive ------------------------------------------------------------------ */

@media (max-width: 640px) {
  .lecture-head { gap: 0.75rem; }
  .flow-step { padding: 1.1rem; }
  .file-facts { grid-template-columns: 1fr 1fr; }
  .result-actions .btn { flex: 1 1 100%; }
  .redesign .btn { flex: 1 1 auto; }
  .dropzone-title { font-size: 1.25rem; }
  .review { padding: 1rem; }
  .review-item { padding: 0.85rem; }
  .preview-thumb { flex-basis: 5.75rem; }
}

@media (max-width: 380px) {
  .file-facts { grid-template-columns: 1fr; }
}

/* --- before / after examples ------------------------------------------------------
   One slide twice: the original underneath, the result on top, clipped at --pos
   from the left. js/lecture-samples.js moves --pos from the pointer, and from a
   visually hidden range input for the keyboard. */

.samples-list { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); }

.sample { margin: 0; }

.sample-compare {
  position: relative;
  aspect-ratio: 16 / 9;
  cursor: ew-resize;
  /* A sideways drag moves the divider; an up-and-down swipe still scrolls the page */
  touch-action: pan-y;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.sample-compare img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.sample-after {
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0);
}

.sample-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos, 50%);
  width: 2px;
  margin-left: -1px;
  background: var(--gold);
  pointer-events: none;
}
.sample-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2.25rem;
  height: 2.25rem;
  margin: -1.125rem 0 0 -1.125rem;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: var(--bg-cream);
  box-shadow: var(--shadow-sm);
}

.sample-tag {
  position: absolute;
  top: 0.75rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  background: rgba(250, 247, 242, 0.92);
  border: 1px solid var(--line);
  border-radius: 999px;
  pointer-events: none;
}
/* The result is revealed from the left, so its label sits on the left */
.sample-tag-after { left: 0.75rem; }
.sample-tag-before { right: 0.75rem; }

.sample-compare:focus-within .sample-divider::after {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

.sample-caption {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  color: var(--text-soft);
}

/* Not the full width of the page: the picture is sharper, and easier to take in,
   at about the size of a page of slides. A tap still opens it at full size. */
.sample-still { max-width: 720px; margin-inline: auto; }

.sample-still img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  background: var(--bg-card);
}

/* `display: grid` above would otherwise win over the hidden attribute. A file the
   owner formatted by hand has no previews and no engine content check, and those
   parts are hidden for it (js/lecture.js renderResult). */
.preview[hidden],
#step-result dl > div[hidden],
.redesign[hidden] { display: none; }

/* The optional contact on the payment screen.
   Deliberately quiet: it sits below the design choice, it is marked optional in the
   label, and the hint says e-mail stays the channel. Nothing about it should read as
   a required step between the customer and paying. */
.payment-contact {
  margin-block: 1.1rem;
  padding-block-start: 1rem;
  border-block-start: 1px solid var(--line, rgba(0, 0, 0, .1));
}
.payment-contact-label {
  display: block;
  margin-block-end: .45rem;
  font-size: .95rem;
  font-weight: 600;
}
.payment-contact-label .optional {
  font-weight: 400;
  opacity: .7;
}
.payment-contact .input {
  inline-size: 100%;
  max-inline-size: 22rem;
}
.payment-contact-hint {
  margin-block: .5rem 0;
  font-size: .85rem;
  line-height: 1.6;
  opacity: .75;
}
.payment-contact #contact-save { margin-block-start: .5rem; }
