/*
 * The platform-admin Acceptance tab (PlatformAdmin::AcceptanceController), read one item at a time
 * (D224, Afterpass's reading layout in Troph-e's skin). Three thin labelled bars in the top bar; then
 * the open item as the hero and the list of every item beside it, in a frame that holds still from
 * 1024px with each pane scrolling by itself, and stacked (item first) below that. No cards: no row, bar,
 * pane or list carries a fill or a frame of its own beyond a hairline; the current item takes the gold
 * wash a selected row takes elsewhere.
 */

/* --- The top bar's three bars ------------------------------------------------------------------ */

.acceptance__progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(var(--stat-tile-min), max-content));
  gap: var(--space-2) var(--space-6);
  width: 100%;
}

/* Three classes to the rail shell's two (shells.css loads after this file). */
.shell--rail .acceptance .ui-page-header__action { flex: 0 1 auto; }

.acceptance__bar {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.acceptance__bar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
}

.acceptance__bar-label {
  color: var(--text-secondary);
  font-size: var(--type-caption-size);
  line-height: var(--type-caption-leading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acceptance__bar-label--link { color: var(--text-gold); text-decoration: none; }
.acceptance__bar-label--link:hover { text-decoration: underline; }

.acceptance__bar-count {
  color: var(--text-primary);
  font-size: var(--type-caption-size);
  line-height: var(--type-caption-leading);
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
}

.acceptance__meter {
  appearance: none;
  width: 100%;
  height: var(--space-1);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  overflow: hidden;
}

.acceptance__meter::-webkit-progress-bar { background: var(--surface-2); border-radius: var(--radius-pill); }
.acceptance__meter::-webkit-progress-value { background: var(--gradient-gold); border-radius: var(--radius-pill); }
.acceptance__meter::-moz-progress-bar { background: var(--gradient-gold); border-radius: var(--radius-pill); }

/* Below 1024 the bars stack under the title, and the bar stops pinning: three bars stacked would take
   a third of a phone's screen for the whole page. */
@media (max-width: 1023px) {
  .shell--rail .acceptance .ui-page-header__bar { position: relative; }
  .shell--rail .acceptance .ui-page-header__action { flex: 1 1 100%; }
  .acceptance__progress { grid-template-columns: repeat(auto-fit, minmax(var(--stat-tile-min), 1fr)); }
}

/* --- The frame: the item and the list ---------------------------------------------------------- */

.acceptance__frame {
  display: flex;
  flex-direction: column;
}

/* The Turbo Frame steps aside, so the item it holds is the frame's own child. */
.acceptance__pane { display: contents; }

/* `position: relative` on both panes, so a visually hidden span inside one stays inside it rather than
   stretching the window from 1024px. */
.acceptance__item {
  position: relative;
  min-width: 0;
  container: acceptance-item / inline-size;
}

.acceptance__item:focus-visible,
.acceptance__list:focus-visible {
  outline: var(--focus-ring-outline);
  outline-color: var(--focus-colour-neutral);
  outline-offset: calc(-1 * var(--focus-ring-offset));
}

.acceptance__list {
  position: relative;
  margin-top: var(--space-10);
  padding: var(--space-4) 0;
  border-top: var(--border-width) solid var(--divider);
}

@media (min-width: 1024px) {
  /* The page is exactly the window's height, a column of the bar (however tall it wraps) and the frame
     under it, which takes the rest and holds still: nothing outside the two panes scrolls. Each level
     from the content column down is a flex column whose child may shrink (`min-height: 0`). */
  .shell--admin.shell--rail .shell__content:has(.acceptance__frame) {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    padding-bottom: 0;
  }

  .shell--rail .acceptance {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }

  .shell--rail .acceptance .ui-page-header__bar { margin-bottom: 0; flex: none; }

  .shell--rail .acceptance .ui-page__body,
  .shell--rail .acceptance .ui-page__main {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
  }

  .acceptance__frame {
    flex: 1 1 auto;
    flex-direction: row;
    min-height: 0;
  }

  .acceptance__item {
    order: 2;
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    padding: var(--space-8) var(--space-2) var(--space-10) var(--space-8);
  }

  .acceptance__list {
    order: 1;
    flex: none;
    width: var(--acceptance-list-width);
    margin: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    border-top: 0;
    border-right: var(--border-width) solid var(--divider);
  }
}

@media (max-width: 1023px) {
  .acceptance__item { padding-top: var(--space-2); }
}

/* "Skip to the list": out of sight until it takes focus, then the first line of the item. */
.acceptance__skip {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--border-width);
  height: var(--border-width);
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  color: var(--text-gold);
  font-size: var(--type-caption-size);
  line-height: var(--type-caption-leading);
  font-weight: var(--font-weight-semibold);
}

.acceptance__skip:focus-visible {
  position: static;
  display: inline-block;
  width: auto;
  height: auto;
  margin-bottom: var(--space-4);
  clip-path: none;
  border-radius: var(--radius-sm);
  outline: var(--focus-ring-outline);
  outline-color: var(--focus-colour-neutral);
  outline-offset: var(--focus-ring-offset);
}

/* --- The list ---------------------------------------------------------------------------------- */

.acceptance__list-intro {
  margin: 0 var(--space-4) var(--space-3) 0;
  color: var(--text-tertiary);
  font-size: var(--type-caption-size);
  line-height: var(--type-caption-leading);
}

.acceptance__group { border-bottom: var(--border-width) solid var(--divider); }

.acceptance__group-summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4) var(--space-3) 0;
  color: var(--text-gold);
  font-size: var(--type-eyebrow-size);
  line-height: var(--type-eyebrow-leading);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  font-weight: var(--font-weight-semibold);
  list-style: none;
  cursor: pointer;
}

.acceptance__group-summary::-webkit-details-marker { display: none; }
.acceptance__group-summary:hover .acceptance__group-title { color: var(--text-primary); }

.acceptance__group-summary:focus-visible {
  outline: var(--focus-ring-outline);
  outline-color: var(--focus-colour-neutral);
  outline-offset: calc(-1 * var(--focus-ring-offset));
}

/* Two chevrons rather than a rotated one, so the summary never becomes a containing block. */
.acceptance__chevron { flex: none; }
.acceptance__group[open] .acceptance__chevron--shut,
.acceptance__group:not([open]) .acceptance__chevron--open { display: none; }

.acceptance__group-title { flex: 1 1 auto; min-width: 0; }

.acceptance__group-count {
  color: var(--text-tertiary);
  letter-spacing: 0;
  text-transform: none;
  font-weight: var(--font-weight-regular);
  font-size: var(--type-caption-size);
  white-space: nowrap;
}

.acceptance__items {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0 0 var(--space-2);
  list-style: none;
}

.acceptance__items--standalone { padding-top: var(--space-2); }

.acceptance__item-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--control-height);
  padding: var(--space-2) var(--space-4) var(--space-2) var(--space-3);
  border-left: var(--border-width-stepper) solid transparent;
  color: var(--text-secondary);
  font-size: var(--type-body-size);
  line-height: var(--type-body-leading);
  text-decoration: none;
  transition: background-color var(--duration-fast) var(--easing-standard);
}

.acceptance__item-link:hover { background: var(--surface-hover-item); color: var(--text-primary); }

.acceptance__item-link[aria-current] {
  border-left-color: var(--gold-100);
  background: var(--gold-wash-selected);
  color: var(--text-primary);
  font-weight: var(--font-weight-semibold);
}

.acceptance__item-link:focus-visible {
  outline: var(--focus-ring-outline);
  outline-color: var(--focus-colour-neutral);
  outline-offset: calc(-1 * var(--focus-ring-offset));
}

.acceptance__item-label { min-width: 0; }

/* A story's state: an empty ring to review, moss and a tick once agreed, a gold ring and a dash once
   sent back, a dot for something to read. A decision's is the same in a square. */
.acceptance__mark {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--space-5);
  height: var(--space-5);
  border: var(--border-width-emphasis) solid var(--border-default);
  border-radius: var(--radius-pill);
  color: var(--text-tertiary);
}

.acceptance__mark--square { border-radius: var(--radius-control); }
.acceptance__mark .icon { width: var(--icon-sm); height: var(--icon-sm); }

.acceptance__mark--agreed {
  border-color: var(--success-border);
  background: var(--success-wash);
  color: var(--success-text);
}

.acceptance__mark--not-yet,
.acceptance__mark--change {
  border-color: var(--gold-100);
  background: var(--gold-wash-active);
  color: var(--gold-100);
}

.acceptance__mark--other { border-color: var(--text-tertiary); }

.acceptance__mark--reading { border-color: transparent; }
.acceptance__mark--reading::before {
  content: "";
  width: var(--space-1);
  height: var(--space-1);
  border-radius: var(--radius-pill);
  background: currentColor;
}

/* --- The open item ----------------------------------------------------------------------------- */

.acceptance__story,
.acceptance__reading {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.acceptance__hero {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: var(--acceptance-reading-measure);
}

.acceptance__eyebrow {
  margin: 0;
  color: var(--text-tertiary);
  font-size: var(--type-eyebrow-size);
  line-height: var(--type-eyebrow-leading);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  font-weight: var(--font-weight-semibold);
}

.acceptance__hero-title {
  margin: 0;
  color: var(--text-gold);
  font-size: var(--type-stat-size);
  line-height: var(--type-display-leading);
  font-weight: var(--font-weight-semibold);
}

.acceptance__standfirst {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--type-h3-size);
  line-height: var(--type-h3-leading);
}

/* Headings that take focus after a save or a swap are not controls, so no ring of their own. */
.acceptance__hero-title:focus,
.acceptance__decision-question:focus { outline: none; }

/* A story: what backs it, and beside it our assessment over the founders, once the pane is wide enough. */
.acceptance__story-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-8);
  padding-top: var(--space-6);
  border-top: var(--border-width) solid var(--divider);
}

@container acceptance-item (min-width: 760px) {
  .acceptance__story-body { grid-template-columns: minmax(0, 1fr) var(--acceptance-aside-width); }
  .acceptance__aside {
    padding-left: var(--space-6);
    border-left: var(--border-width) solid var(--divider);
  }
}

.acceptance__story-main,
.acceptance__aside {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  min-width: 0;
}

.acceptance__block {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: var(--acceptance-reading-measure);
}

.acceptance__label {
  margin: 0;
  color: var(--text-tertiary);
  font-size: var(--type-caption-size);
  line-height: var(--type-caption-leading);
  font-weight: var(--font-weight-semibold);
}


.acceptance__aside-title {
  margin: 0;
  color: var(--text-gold);
  font-size: var(--type-eyebrow-size);
  line-height: var(--type-eyebrow-leading);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  font-weight: var(--font-weight-semibold);
}

/* Our assessment, given its weight: the full-size pill and its note in white at the larger body size. */
.acceptance__assessment,
.acceptance__founders {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 0;
}

.acceptance__founders {
  padding-top: var(--space-6);
  border-top: var(--border-width) solid var(--divider);
}

.acceptance__assessment-note {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--type-body-lg-size);
  line-height: var(--type-body-lg-leading);
}

.acceptance__proposal {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--type-body-size);
  line-height: var(--type-body-leading);
}

.acceptance__lead {
  color: var(--text-primary);
  font-weight: var(--font-weight-semibold);
}

.acceptance__title {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--type-body-size);
  line-height: var(--type-body-leading);
  font-weight: var(--font-weight-semibold);
}

.acceptance__statement {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--type-body-size);
  line-height: var(--type-body-leading);
}

.acceptance__meta {
  margin: 0;
  color: var(--text-tertiary);
  font-size: var(--type-caption-size);
  line-height: var(--type-caption-leading);
}

.acceptance__note {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--type-caption-size);
  line-height: var(--type-caption-leading);
}

/* Dash-led lines: how we built it, what an area waits on, its known gaps. */
.acceptance__differences {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-secondary);
  font-size: var(--type-body-size);
  line-height: var(--type-body-leading);
}

.acceptance__differences li { padding-left: var(--space-3); text-indent: calc(var(--space-3) * -1); }
.acceptance__differences li::before { content: "– "; }

.acceptance__shots {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.acceptance__shot {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  width: var(--acceptance-shot-width);
  color: var(--text-tertiary);
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.acceptance__shot:hover { color: var(--text-primary); }
.acceptance__shot:hover .acceptance__shot-image { border-color: var(--gold-halo); }

.acceptance__shot:focus-visible {
  outline: var(--focus-ring-outline);
  outline-color: var(--focus-colour-neutral);
  outline-offset: var(--focus-ring-offset);
}

.acceptance__shot-image {
  width: 100%;
  height: auto;
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.acceptance__shot-caption {
  font-size: var(--type-caption-size);
  line-height: var(--type-caption-leading);
}

/* --- The founders' verdicts and the form --------------------------------------------------------- */

.acceptance__verdicts {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* One line per founder: who, what and when, then their note. */
.acceptance__verdict {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--space-2);
  font-size: var(--type-caption-size);
  line-height: var(--type-caption-leading);
}

.acceptance__verdict-who {
  color: var(--text-primary);
  font-weight: var(--font-weight-semibold);
}

.acceptance__verdict-what { color: var(--text-tertiary); }

.acceptance__verdict-note {
  flex-basis: 100%;
  color: var(--text-secondary);
}

.acceptance__history { width: 100%; }

.acceptance__history-summary {
  width: fit-content;
  color: var(--text-gold);
  font-size: var(--type-caption-size);
  line-height: var(--type-caption-leading);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.acceptance__history-summary:focus-visible {
  outline: var(--focus-ring-outline);
  outline-color: var(--focus-colour-neutral);
  outline-offset: var(--focus-ring-offset);
}

.acceptance__history-list { padding-top: var(--space-2); }

.acceptance__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 100%;
}

/* The note under the buttons, once a verdict is chosen: a hairline above it, no fill of its own. */
.acceptance__panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 100%;
  padding-top: var(--space-3);
  border-top: var(--border-width) solid var(--divider);
}

.acceptance__panel[hidden], .acceptance__panel [hidden] { display: none; }

/* The chosen verdict keeps the button's own active fill (D28), so the choice stays visible while the note is open. */
.acceptance__buttons .ui-button--primary[aria-pressed="true"] { background: var(--gradient-gold-active); }
.acceptance__buttons .ui-button--outline[aria-pressed="true"] {
  border-color: var(--gold-100);
  background: var(--gold-wash-active);
  color: var(--gold-100);
}
.acceptance__buttons .ui-button--text[aria-pressed="true"] { background: var(--gold-wash-active); color: var(--gold-100); }

.acceptance__prompt {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--type-caption-size);
  line-height: var(--type-caption-leading);
  font-weight: var(--font-weight-semibold);
}

.acceptance__field textarea { min-height: 0; }

/* The prompt says what the note is for; the label stays for a screen reader. */
.acceptance__field .ui-field__head {
  position: absolute;
  width: var(--border-width);
  height: var(--border-width);
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.acceptance__error {
  margin: 0;
  color: var(--danger-text);
  font-size: var(--type-caption-size);
  line-height: var(--type-caption-leading);
}

/* --- Previous and Next ------------------------------------------------------------------------- */

.acceptance__steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: var(--border-width) solid var(--divider);
}

.acceptance__step {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background-color var(--duration-fast) var(--easing-standard);
}

.acceptance__step--prev { justify-self: start; text-align: left; }
.acceptance__step--next { justify-self: end; text-align: right; align-items: flex-end; }
.acceptance__step:hover { background: var(--surface-hover-item); }

.acceptance__step:focus-visible {
  outline: var(--focus-ring-outline);
  outline-color: var(--focus-colour-neutral);
  outline-offset: var(--focus-ring-offset);
}

.acceptance__step-word {
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  gap: var(--space-1);
  color: var(--text-gold);
  font-size: var(--type-caption-size);
  line-height: var(--type-caption-leading);
  font-weight: var(--font-weight-semibold);
}

.acceptance__step-title {
  color: var(--text-secondary);
  font-size: var(--type-body-size);
  line-height: var(--type-body-leading);
}

/* --- Founder decisions: one at a time, with the rail of them all beside it ------------------------ */

.acceptance__decisions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-8);
  padding-top: var(--space-6);
  border-top: var(--border-width) solid var(--divider);
}

@container acceptance-item (min-width: 760px) {
  .acceptance__decisions { grid-template-columns: minmax(0, 1fr) var(--acceptance-rail-width); }
  .acceptance__rail {
    padding-left: var(--space-6);
    border-left: var(--border-width) solid var(--divider);
  }
}

.acceptance__decisions-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  min-width: 0;
}

.acceptance__decision {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.acceptance__decision-words {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: var(--acceptance-reading-measure);
}

.acceptance__decision-question {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--type-h2-size);
  line-height: var(--type-h2-leading);
  font-weight: var(--font-weight-semibold);
}

.acceptance__decision .acceptance__founders { max-width: var(--acceptance-reading-measure); }

.acceptance__rail {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

.acceptance__rail-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.acceptance__rail-group-title {
  margin: 0 0 var(--space-1);
  color: var(--text-tertiary);
  font-size: var(--type-caption-size);
  line-height: var(--type-caption-leading);
  font-weight: var(--font-weight-semibold);
}

.acceptance__rail .acceptance__items { padding: 0; }

/* --- Accounts and future builds: plain rows between hairlines ------------------------------------ */

.acceptance__accounts {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: var(--border-width) solid var(--divider);
}

.acceptance__account {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-1) var(--space-4);
  align-items: start;
  padding: var(--space-3) 0;
  border-bottom: var(--border-width) solid var(--divider);
}

.acceptance__account .ui-status { justify-self: start; }

@container acceptance-item (min-width: 640px) {
  /* A fixed column for the pill, so every row's state and next step line up. */
  .acceptance__account { grid-template-columns: minmax(0, 2fr) var(--acceptance-pill-column) minmax(0, 5fr); }
}

.acceptance__account-name {
  color: var(--text-primary);
  font-size: var(--type-body-size);
  line-height: var(--type-body-leading);
  font-weight: var(--font-weight-semibold);
}

.acceptance__account-next {
  color: var(--text-secondary);
  font-size: var(--type-body-size);
  line-height: var(--type-body-leading);
}

.acceptance__account-next strong { color: var(--text-primary); font-weight: var(--font-weight-semibold); }

.acceptance__future {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: var(--border-width) solid var(--divider);
}

.acceptance__future-build {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4) 0;
  border-bottom: var(--border-width) solid var(--divider);
}

.acceptance__future-build .acceptance__statement,
.acceptance__future-build .acceptance__note { max-width: var(--acceptance-reading-measure); }

/* --- The screenshot gallery: the page's one modal, wider than a form's, the picture fitted to the
   viewport so a tall phone screenshot never needs a scroll. ------------------------------------- */
.acceptance__gallery { overscroll-behavior: contain; }
.acceptance__gallery .ui-modal__panel { max-width: var(--gallery-width); }

.acceptance__gallery-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  touch-action: pan-y pinch-zoom;
}

.acceptance__gallery-image {
  display: block;
  max-width: 100%;
  max-height: 65dvh;
  width: auto;
  height: auto;
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.acceptance__gallery-caption {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  color: var(--text-secondary);
  font-size: var(--type-caption-size);
  line-height: var(--type-caption-leading);
}

.acceptance__gallery-count { color: var(--text-tertiary); white-space: nowrap; }

.acceptance__gallery .ui-modal__footer [hidden] { display: none; }
