/* The two member pages, a light restyle (to-A 018, done by B on branch member-pages-restyle, 13 Nov 2026; Vicky's seven points).
   member-story.html (patient: "Your stories") and portal-submit.html (professional: "Contributor portal") ONLY - loaded after
   member-review.css on those two pages and nowhere else, so every selector here is already scoped to them. Styling only: no
   word, markup order, link or script changed. The header and menu are not touched (nothing here reaches .site-header).
   Brand: deep purple #2E2150 / #3A2A66, bright purple #6B4FA0, gold #BB863F / #8A6222, lavender #F2EEF8 / #F7F4FB.
   Logical properties (inline-start / inline-end) so the Persian (right-to-left) page mirrors by itself. */

/* 1. Brand hero: the same deep purple band as patient-videos.html and gem-video-library.html (the gold light top right,
      the 2px gold rule at the foot), gold label, white title and line; "Sign out" a light outline button on the purple.
      Measured: label 9.0:1, title, line and Sign out 14.5:1 on #2E2150; the gold chip 5.1:1, buttons 6.5:1. */
.page-banner {
  background:
    radial-gradient(900px 480px at 92% -30%, rgba(187, 134, 63, 0.26), transparent 62%),
    linear-gradient(120deg, var(--purple-deep) 0%, var(--purple-deep) 55%, var(--purple) 100%);
  border-bottom: 2px solid var(--gold);
  color: var(--white);
  padding-block: clamp(1.9rem, 5vw, 3.6rem);
}
.page-banner .eyebrow { color: var(--guide-gold-light); }
.page-banner h1 { color: var(--white); }
.page-banner__subtitle { color: var(--white); }
.page-banner__saved { color: var(--guide-gold-light); }
.page-banner__signout,
.page-banner__signout.btn--ghost {
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  padding-inline: 1.1rem;
}
.page-banner__signout:hover,
.page-banner__signout.btn--ghost:hover { background: rgba(255, 255, 255, 0.12); color: var(--white); border-color: var(--white); }
.page-banner__signout:focus-visible { outline: 3px solid var(--guide-gold-light); outline-offset: 2px; }

/* 2. Wider, calmer layout: the column grows from 600px to 760px; the page behind it is the lightest lavender so the white
      cards lift. */
main#main { background: var(--lavender-light); }
.form-wrap { max-width: 760px; }

/* 4. Tabs as a clean two-part switch, not a floating card: the tab row sits straight on the lavender page; the active tab is
      filled light purple and heavier, with a clear focus ring (never colour alone: the weight and the inset line too). */
.portal-tabs .form-wrap { background: none; box-shadow: none; padding: 0; border-radius: 0; }
.portal-tabs { padding-block: clamp(1.4rem, 3.5vw, 2rem) 0; }
.portal-tabs__list {
  gap: 4px;
  padding: 4px;
  background: var(--white);
  border: 1px solid rgba(58, 42, 102, 0.16);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(46, 33, 80, 0.06);
}
.portal-tab {
  flex: 1 1 0;                  /* the two halves share one row at every width, a two-part switch even on a phone */
  min-width: 0;
  padding-inline: 0.6rem;
  margin-bottom: 0;
  border: 0;
  border-radius: 10px;
  min-height: 48px;
  color: var(--text-muted);
}
.portal-tab:hover { color: var(--purple-deep); background: var(--lavender-light); }
.portal-tab[aria-selected="true"] {
  background: var(--lavender);
  color: var(--purple-deep);
  box-shadow: inset 0 0 0 1.5px rgba(107, 79, 160, 0.45);
  border-bottom: 0;
}
.portal-tab:focus-visible { outline: 3px solid var(--purple-bright); outline-offset: 2px; }
/* the panel's card follows closely under the switch (no empty band between them) */
.portal-panel.section { padding-top: clamp(1rem, 2.5vw, 1.4rem); }

/* 3. Readable type: story and card titles 20px; field labels 16px semibold; help text, dates and status labels never
      under 14px. */
.mystory__title { font-size: 1.25rem; }
.field > label,
.field > .field__legend,
.field-group__title { font-size: 1rem; font-weight: 600; }
.field__hint, .field-group__hint, .field .optional, .voice-note,
.mystory__meta, .mystory__sharing, .mystory__status, .mystory__status--chip,
.mystory__return-hint, .mystories__count { font-size: 0.875rem; }
.mystory__file, .mystory__url, .mystory__author, .mystory__desc { font-size: max(0.875rem, 1em); }

/* 5. Cards that show status at a glance - only where the markup already carries the status as a class: "Returned with a note"
      (.mystory__dot--returned) a gold left bar and a gold label; published (.mystory__dot--published) the brand's deep purple.
      Received, in review, approved and withdrawn carry no class of their own in the markup (the same plain dot), so they keep
      the card without a bar; see the report. "A note from the GEM team" sits on a soft gold panel. */
.mystory {
  background: var(--white);
  border: 1px solid rgba(58, 42, 102, 0.12);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(46, 33, 80, 0.06);
  margin-bottom: 1.25rem;
}
.mystory:has(.mystory__dot--returned) { border-inline-start: 5px solid var(--gold); }
.mystory:has(.mystory__dot--published) { border-inline-start: 5px solid var(--purple-deep); }
.mystory__dot--returned { background: var(--gold); }
.mystory__dot--published { background: var(--purple-deep); }
.mystory__status--chip { padding: 0.25rem 0.75rem; color: var(--purple-deep); border-color: rgba(58, 42, 102, 0.22); }
.mystory__status--chip:has(.mystory__dot--returned) {
  color: var(--gold-deep); background: #FBF6EE; border-color: rgba(187, 134, 63, 0.6); font-weight: 600;
}
.mystory__status--chip:has(.mystory__dot--published) {
  color: var(--white); background: var(--purple-deep); border-color: var(--purple-deep); font-weight: 600;
}
.mystory__status--chip:has(.mystory__dot--published) .mystory__dot--published { background: var(--guide-gold-light); }
.mystory__return {
  background: #FBF6EE;
  border-inline-start: 3px solid var(--gold);
  border-radius: 0;
  border-start-end-radius: 12px; border-end-end-radius: 12px;   /* rounded on the side away from the bar, in both directions */
  padding: 0.95rem 1.1rem;
}
html[dir="rtl"] .mystory__dot { margin-right: 0; margin-left: 0.45rem; }
.mystory__return-head { color: var(--gold-deep); }

/* 6. Clear actions: "Edit and send again" a filled purple button, "Read what I wrote" (and the professional list's "Show
      more") an outline button, "Withdraw this story" a quiet text link on the far side of the row - not red. 44px high. */
.mystory__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 0.8rem; }
.mystory__controls .auth-toggle + .auth-toggle,
.mystory__controls .mystory__withdraw,
.mystory__controls .mystory__resend + .auth-toggle,
.mystory__controls .mystory__resend + .mystory__withdraw { margin-inline-start: 0; }
.mystory__resend,
.mystory__expand {
  min-height: 44px;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.2;
}
.mystory__resend { background: var(--purple-bright); color: var(--white); border: 2px solid var(--purple-bright); }
.mystory__resend:hover { background: var(--purple); border-color: var(--purple); color: var(--white); }
.mystory__expand { background: var(--white); color: var(--purple-bright); border: 2px solid var(--purple-bright); }
.mystory__expand:hover { background: var(--lavender); color: var(--purple-deep); }
.mystory__withdraw {
  margin-inline-start: auto;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.mystory__withdraw:hover { color: var(--purple-deep); }

/* 7. A tidier form: each credit (and audience / type) choice one selectable card, the radio beside the title; a purple border
      and tint when chosen. The consent boxes on a soft tint in place of the heavy outline, larger tick boxes. The prompt box
      keeps its gold bar (form-note, untouched). The send button larger, full width on phones. Even spacing between fields. */
.form-wrap .field, .form-wrap .field-group { margin-bottom: 1.6rem; }
.choice,
.field > label.choice {          /* .field > label (display: block, styles.css) used to win and put the radio on its own line */
  display: flex;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  border: 1.5px solid rgba(58, 42, 102, 0.2);
  border-radius: 12px;
  background: var(--white);
  margin-bottom: 0.6rem;
}
.choice:hover { border-color: var(--purple-bright); }
.choice:has(input:checked) { border-color: var(--purple-bright); background: var(--lavender); box-shadow: inset 0 0 0 1px var(--purple-bright); }
.choice:has(input:focus-visible) { outline: 3px solid var(--purple-bright); outline-offset: 2px; }
.choice input { width: 20px; height: 20px; margin: 0.1rem 0.75rem 0 0; accent-color: var(--purple-bright); }
html[dir="rtl"] .choice input { margin: 0.1rem 0 0 0.75rem; }
.consent { border: 0; background: var(--lavender); border-radius: 12px; padding: 1rem 1.1rem; }
.consent input { width: 22px; height: 22px; margin: 0.1rem 0.8rem 0 0; accent-color: var(--purple-bright); }
html[dir="rtl"] .consent input { margin: 0.1rem 0 0 0.8rem; }
.consent label { cursor: pointer; }
#ms-submit,
#pt-panel-submit button[type="submit"] { min-height: 52px; padding: 0.9rem 2.1rem; font-size: 1.05rem; border-radius: 999px; }
@media (max-width: 639.98px) {
  #ms-submit,
  #pt-panel-submit button[type="submit"] { width: 100%; }
  .mystory__withdraw { margin-inline-start: 0; }
}
/* the professional rows: the "Edit and send again" row keeps its distance from the description under it */
.mystory__returnhost .mystory__controls,
.mystory__detail > .mystory__controls:not(:last-child) { margin-bottom: 0.9rem; }

/* 9. The cover picture on a video submission (to-B 028, 14 Nov 2026): the field portal-cover.js builds in the video panel and
      in "Edit and send again". Its label and help read like the form's other fields; the preview is the stored 16:9 picture,
      at most 480 px wide; the frame pick shows the video cropped to 16:9 as the cover will be. Buttons 44px high, wrapping on
      a phone; the slider 44px tall for a finger. Measured (cover suite): label and slider label 12.3:1, help 7.0:1,
      buttons 6.5:1, error 14.5:1 on the white card. */
.gem-cover { margin-top: 1.4rem; }
.gem-cover__label { margin: 0 0 0.35rem; font-size: 1rem; font-weight: 600; color: var(--purple); }
.gem-cover .field__hint { margin-bottom: 0.35rem; }
.gem-cover__row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin: 0.7rem 0 0; }
.gem-cover .btn {
  min-height: 44px;
  padding: 0.5rem 1.15rem;
  border-radius: 999px;
  font-size: 0.95rem;
  max-width: 100%;
  white-space: normal;
  text-align: center;
}
.gem-cover__remove {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0.2rem 0.15rem;
  background: none; border: 0; font: inherit; font-weight: 600; font-size: 0.92rem;
  color: var(--purple); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.gem-cover__remove:hover { color: var(--purple-bright); }
.gem-cover__remove:focus-visible { outline: 3px solid var(--purple-bright); outline-offset: 2px; border-radius: 6px; }
.gem-cover__frame,
.gem-cover__stage {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 16 / 9;
  margin-top: 0.5rem;
  border-radius: 10px;
  overflow: hidden;
  background: var(--purple-deep);
  box-shadow: 0 0 0 1px rgba(58, 42, 102, 0.18);   /* a hairline outside the box, so the picture keeps its full 480 x 270 */
}
.gem-cover__img,
.gem-cover__video { display: block; width: 100%; height: 100%; object-fit: cover; }
.gem-cover__under { margin: 0.45rem 0 0; font-size: 0.875rem; color: var(--text-muted); }
.gem-cover__slabel { display: block; margin: 0.8rem 0 0.1rem; font-size: 0.95rem; font-weight: 600; color: var(--purple); }
.gem-cover__slider { display: block; width: 100%; max-width: 480px; min-height: 44px; margin: 0; accent-color: var(--purple-bright); }
.gem-cover__file { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.gem-cover__error { margin: 0.6rem 0 0; font-size: 0.9rem; font-weight: 600; color: var(--purple-deep); }
.gem-cover [hidden] { display: none !important; }
