/* ==========================================================================
   js.17 brief intake (create.html) — the questions asked before js.17
   composes a page. Loads after css/desk.css and reuses its tokens and controls
   (.mast, .pill, .text-btn, .tag, .micro, .field-error, dialog).
   Spec: docs/intake-spec.md
   ========================================================================== */

.intake-page { --rail-top: 88px; }
.intake { padding-bottom: clamp(64px, 3rem + 4vw, 120px); }
.intake:focus { outline: none; }

/* Masthead: title and save state in the centre */
.mast__title { display: none; }
@media (min-width: 768px) {
  .mast__title {
    position: absolute;
    left: 50%;
    display: flex;
    align-items: baseline;
    gap: 10px;
    color: var(--ink);
    white-space: nowrap;
    transform: translateX(-50%);
  }
}
.mast__saved { color: var(--stone); letter-spacing: .1em; }
.mast__saved:not(:empty)::before { content: "· "; }

/* Motion hooks (js/intake.js animates them; without it everything is simply shown) */
.mask { display: inline-block; }

/* --------------------------------------------------------------------------
   Cover
   -------------------------------------------------------------------------- */
.cover {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: 56px;
  padding-top: clamp(32px, 1rem + 4vw, 104px);
}
.cover__eyebrow { margin-bottom: 20px; color: var(--stone); }
.cover__title {
  font: 400 clamp(52px, 1rem + 6.2vw, 144px)/.9 var(--serif);
  letter-spacing: -.02em;
}
.cover__title .mask { display: block; }
.cover__title i { color: var(--gilt); }
.cover__lead {
  max-width: 40ch;
  margin-top: 28px;
  font-size: clamp(17px, 15px + .3vw, 20px);
  line-height: 1.5;
  color: var(--graphite);
}
.cover__resume { margin-top: 24px; font: italic 400 24px/1.2 var(--serif); color: var(--ink); }
.cover__actions { margin-top: 32px; }
.cover__note { margin-top: 20px; font-size: 13px; line-height: 1.45; color: var(--stone); }

.restart { max-width: 46ch; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--hair); }
.restart__text { color: var(--graphite); }
.restart__text:focus-visible { outline-offset: 4px; }
.restart .btn-row { margin-top: 14px; }

.cover__aside { align-self: end; padding-top: 16px; border-top: 1px solid var(--ink); }
.cover__list-title { margin-bottom: 8px; color: var(--stone); }
.cover__list-title + .cover__list .cover__group:first-child { padding-top: 8px; }
.cover__list + .cover__list-title { margin-top: 36px; }
.cover__list li:not(.cover__group) {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--hair);
  font-size: 15px;
  line-height: 1.4;
}
.cover__group { padding: 20px 0 6px; color: var(--gilt); }
.cover__num { font: italic 400 19px/1.1 var(--serif); color: var(--stone); }
.cover__bring li {
  position: relative;
  padding: 9px 0 9px 22px;
  border-bottom: 1px solid var(--hair);
  font-size: 15px;
  line-height: 1.45;
  color: var(--graphite);
}
.cover__bring li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 17px;
  width: 6px;
  height: 6px;
  background: var(--ink);
  transform: rotate(45deg);
}

@media (min-width: 992px) {
  .cover {
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
    column-gap: clamp(40px, 6vw, 120px);
    align-items: end;
  }
}

/* --------------------------------------------------------------------------
   Flow: rail · chapter · dossier
   -------------------------------------------------------------------------- */
.flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: var(--col-gap);
  align-items: start;
  padding-top: clamp(16px, .5rem + 1.5vw, 40px);
}
.rail, .chapters, .dossier { min-width: 0; }
.dossier { display: none; }

@media (min-width: 992px) {
  .flow { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: clamp(32px, 3vw, 56px); }
  .rail { grid-column: 1 / -1; }
  .chapters { grid-column: 1; }
  .dossier {
    display: block;
    grid-column: 2;
    position: sticky;
    top: var(--rail-top);
    margin-top: 40px;
  }
}
@media (min-width: 1200px) {
  .flow {
    grid-template-columns: minmax(176px, 2fr) minmax(0, 6fr) minmax(0, 4fr);
    column-gap: clamp(32px, 3vw, 64px);
  }
  .rail { grid-column: 1; grid-row: 1; position: sticky; top: var(--rail-top); }
  .chapters { grid-column: 2; grid-row: 1; }
  .dossier { grid-column: 3; grid-row: 1; margin-top: 0; }
}

/* Rail: a horizontal strip until 1200px, a vertical index above */
.rail__list {
  display: flex;
  gap: 6px;
  margin: -6px calc(-1 * var(--gutter)) 0;
  padding: 6px var(--gutter) 14px; /* room for focus rings */
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--hair);
}
.rail__list::-webkit-scrollbar { display: none; }
.rail__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  color: var(--graphite);
  font: 500 12px/1 var(--sans);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background-color .3s linear, color .3s linear, border-color .3s linear;
}
.rail__num { font: italic 400 16px/1 var(--serif); letter-spacing: 0; text-transform: none; color: var(--stone); }
.rail__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rail__state { display: none; width: 12px; height: 12px; color: var(--verdigris); }
.rail__state svg { width: 100%; height: 100%; }
.rail__link.is-done .rail__state { display: block; }
.rail__link[aria-current="step"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.rail__link[aria-current="step"] .rail__num { color: var(--champagne); }
.rail__link[aria-current="step"] .rail__label { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: inherit; }
.rail__link[aria-current="step"] .rail__state { color: var(--champagne); }
.rail__link.is-flagged:not([aria-current="step"]) { border-color: var(--oxblood); }
/* Needs an answer: a mark, not colour alone */
.rail__link.is-flagged:not([aria-current="step"]) .rail__state { display: block; width: 7px; height: 7px; border-radius: 999px; background: var(--oxblood); justify-self: center; }
.rail__link.is-flagged .rail__state svg { display: none; }
@media (hover: hover) { .rail__link:not([aria-current="step"]):hover { border-color: var(--ink); color: var(--ink); } }
@media (min-width: 768px) and (pointer: coarse) { .rail__label { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: inherit; } }
/* With a mouse the strip wraps instead of scrolling, so every chapter stays in reach */
@media (hover: hover) and (pointer: fine) and (max-width: 1199.98px) {
  .rail__list { flex-wrap: wrap; row-gap: 6px; overflow-x: visible; }
}

@media (min-width: 1200px) {
  .rail__list { display: block; margin: 0; padding: 0; overflow: visible; border-top: 1px solid var(--ink); border-bottom: 0; }
  .rail__link {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 12px;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 10px 0;
    border: 0;
    border-bottom: 1px solid var(--hair);
    border-radius: 0;
    background: none;
    color: var(--stone);
    letter-spacing: .1em;
    white-space: normal;
  }
  .rail__link::before {
    content: "";
    position: absolute;
    left: 0;
    top: -1px;
    bottom: -1px;
    width: 2px;
    background: var(--ink);
    transform: scaleY(0);
    transform-origin: center top;
    transition: transform .5s var(--ease-out);
  }
  .rail__num { padding-left: 12px; }
  .rail__label { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: inherit; line-height: 1.3; }
  .rail__link[aria-current="step"] { background: none; color: var(--ink); }
  .rail__link[aria-current="step"]::before { transform: scaleY(1); }
  .rail__link[aria-current="step"] .rail__num { color: var(--gilt); }
  .rail__link[aria-current="step"] .rail__state { color: var(--verdigris); }
  .rail__link.is-flagged:not([aria-current="step"]) { color: var(--oxblood); border-color: var(--hair); }
  @media (hover: hover) { .rail__link:not([aria-current="step"]):hover { color: var(--ink); } }
}

/* --------------------------------------------------------------------------
   Chapter
   -------------------------------------------------------------------------- */
.chapters { padding-top: 32px; }
@media (min-width: 1200px) { .chapters { padding-top: 0; } }

.chapter { scroll-margin-top: 88px; }
.chapter__kicker { display: flex; align-items: baseline; gap: 12px; color: var(--stone); }
.chapter__num { font: italic 400 22px/1 var(--serif); letter-spacing: 0; text-transform: none; color: var(--gilt); }
.chapter__title {
  margin-top: 14px;
  font: 400 clamp(40px, 1rem + 3.2vw, 80px)/.95 var(--serif);
  letter-spacing: -.015em;
}
.chapter__title .mask { display: block; }
.chapter__title:focus-visible { outline-offset: 6px; }
.chapter__lede { max-width: 48ch; margin-top: 18px; font-size: 17px; line-height: 1.55; color: var(--graphite); }

/* Questions */
.q { min-width: 0; margin: 40px 0 0; padding: 0; border: 0; }
.q-group > .q:first-child { margin-top: 40px; }
.q__label { display: block; width: 100%; margin: 0 0 12px; padding: 0; color: var(--stone); }
.q__label--gap { margin-top: 24px; }
.q__optional { font-weight: 400; color: var(--stone); letter-spacing: .1em; }
.q__optional::before { content: "· "; }
.q__hint { max-width: 58ch; margin: -4px 0 14px; font-size: 14px; line-height: 1.5; color: var(--stone); }
.q__subhead { margin-bottom: 8px; font: 400 30px/1.1 var(--serif); }
.q__note { max-width: 54ch; margin-top: 24px; font-size: 15px; line-height: 1.55; color: var(--graphite); }
.q__count { margin-top: 6px; font-size: 12px; line-height: 1.4; color: var(--stone); text-align: right; font-variant-numeric: tabular-nums lining-nums; }
.q__count:empty { display: none; }
.q__add { margin-top: 16px; }
.q__follow { min-width: 0; margin: 16px 0 0; padding: 0 0 0 18px; border: 0; border-left: 1px solid var(--line-control); }

.textfield {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 400 17px/1.2 var(--sans);
  box-shadow: inset 0 -1px 0 var(--line-control);
  transition: box-shadow .2s linear;
  -webkit-appearance: none;
  appearance: none;
}
.textfield:focus-visible { outline: none; box-shadow: inset 0 -2px 0 var(--ink); }
.textfield[aria-invalid="true"] { box-shadow: inset 0 -2px 0 var(--oxblood); }
.textfield[aria-invalid="true"]:focus-visible { box-shadow: inset 0 -4px 0 var(--oxblood); }
.textfield--sm { flex: 1; min-width: 0; height: 40px; font-size: 15px; }

.textarea {
  display: block;
  width: 100%;
  min-height: 96px;
  padding: 14px 16px;
  border: 1px solid var(--line-control);
  border-radius: 0;
  background: var(--vellum);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  resize: vertical;
  transition: border-color .2s linear, box-shadow .2s linear;
  -webkit-appearance: none;
  appearance: none;
}
.textarea:focus-visible { outline: none; border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.textarea[aria-invalid="true"] { border-color: var(--oxblood); box-shadow: inset 0 0 0 1px var(--oxblood); }
.textarea[aria-invalid="true"]:focus-visible { box-shadow: inset 0 0 0 2px var(--oxblood); }
.textarea--line { min-height: 0; padding: 12px 16px; font: 400 clamp(21px, 1rem + .5vw, 26px)/1.35 var(--serif); }
.textfield::placeholder,
.textarea::placeholder { color: var(--stone); opacity: 1; }

/* Segmented choice */
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 100%;
  padding: 4px;
  border: 1px solid var(--line-control);
  border-radius: 999px;
  background: var(--vellum);
}
.seg__opt { position: relative; display: inline-flex; }
.seg__input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  color: var(--graphite);
  font: 500 12px/1.2 var(--sans);
  letter-spacing: .1em;
  text-align: center;
  text-transform: uppercase;
  transition: background-color .35s var(--ease-out), color .35s var(--ease-out);
}
.seg__input:checked + .seg__label { background: var(--ink); color: var(--paper); }
.seg__input:focus-visible + .seg__label { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (hover: hover) { .seg__input:not(:checked):hover + .seg__label { color: var(--ink); } }
@media (max-width: 575.98px) {
  .seg { display: flex; border-radius: 26px; }
  .seg__opt { flex: 1 1 100%; }
  .seg__label { width: 100%; }
}

/* Option cards (radio and checkbox) */
.opts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 576px) { .opts--grid, .opts--pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.opt {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--hair);
  background: var(--vellum);
  cursor: pointer;
  transition: border-color .25s linear, box-shadow .25s linear;
}
.opt__input { position: absolute; top: 18px; left: 18px; width: 18px; height: 18px; margin: 0; opacity: 0; cursor: pointer; }
.opt:has(> .opt__input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.opt:has(> .opt__input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.opt__input:focus-visible ~ .opt__mark,
.opt__input:focus-visible ~ .opt__row .opt__mark { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
@media (hover: hover) { .opt:hover { border-color: var(--line-control); } }

.opt__mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1px solid var(--line-control);
  border-radius: 999px;
  background: var(--paper);
  color: var(--paper);
  transition: background-color .25s linear, border-color .25s linear;
}
.opt__mark::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ink);
  transform: scale(0);
  transition: transform .35s var(--ease-out);
}
.opt__input:checked ~ .opt__mark,
.opt__input:checked ~ .opt__row .opt__mark { border-color: var(--ink); }
.opt__input:checked ~ .opt__mark::after,
.opt__input:checked ~ .opt__row .opt__mark::after { transform: scale(1); }
.opt__mark--box { border-radius: 2px; }
.opt__mark--box::after { display: none; }
.opt__mark--box svg { width: 12px; height: 12px; opacity: 0; transition: opacity .2s linear; }
.opt__input:checked ~ .opt__mark--box { background: var(--ink); }
.opt__input:checked ~ .opt__mark--box svg { opacity: 1; }

.opt__text { min-width: 0; }
.opt__title { display: block; color: var(--ink); font-size: 16px; font-weight: 500; line-height: 1.35; }
.opt__desc { display: block; margin-top: 4px; color: var(--stone); font-size: 14px; line-height: 1.45; }
.opt__letter { display: inline-block; margin-right: 10px; font: italic 400 22px/1 var(--serif); color: var(--gilt); }

.opt-block { min-width: 0; }
.opt-block > .q__follow { margin: 12px 0 8px 18px; }
.opt-block--none { margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--hair); }

/* Invalid choices are marked on the controls, not only in the message below them */
.opt:has(> .opt__input[aria-invalid="true"]) { border-color: var(--oxblood); }
.seg:has(.seg__input[aria-invalid="true"]) { border-color: var(--oxblood); box-shadow: inset 0 0 0 1px var(--oxblood); }
.chip__input[aria-invalid="true"] + .chip__label { border-color: var(--oxblood); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips__custom { display: contents; }
.chip { position: relative; display: inline-flex; }
.chip__input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-control);
  border-radius: 999px;
  color: var(--graphite);
  font-size: 14px;
  line-height: 1.2;
  transition: background-color .25s linear, border-color .25s linear, color .25s linear;
}
.chip__input:checked + .chip__label { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.chip__input:checked + .chip__label::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 999px; background: var(--champagne); }
.chip__input:focus-visible + .chip__label { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (hover: hover) { .chip__input:not(:checked):hover + .chip__label { border-color: var(--ink); color: var(--ink); } }

.add-inline { display: flex; align-items: center; gap: 16px; max-width: 380px; margin-top: 16px; }

/* --------------------------------------------------------------------------
   Repeating rows: listing links, dislikes, colours
   -------------------------------------------------------------------------- */
.rows { display: grid; gap: 6px; }
.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0 16px;
}
.row__meta { grid-column: 1 / -1; min-height: 0; }
.row__remove { align-self: center; }

.source {
  display: inline-flex;
  max-width: 100%;
  overflow-wrap: anywhere;
  align-items: center;
  gap: 8px;
  margin: 8px 0 4px;
  color: var(--graphite);
  font: 500 11px/1.3 var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.source:empty { display: none; }
.source::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 999px; background: var(--verdigris); }
.source--other::before { background: transparent; box-shadow: inset 0 0 0 1px var(--ink); }
.source--invalid { color: var(--oxblood); }
.source--invalid::before { background: var(--oxblood); }

.row--swatch { grid-template-columns: 44px minmax(0, 132px) minmax(0, 1fr) auto; align-items: center; gap: 8px 14px; }
.swatch {
  position: relative;
  display: block;
  background: var(--vellum) linear-gradient(135deg, transparent calc(50% - .5px), var(--line-control) 0 calc(50% + .5px), transparent 0);
  forced-color-adjust: none;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border: 1px solid var(--line-control);
  border-radius: 999px;
  cursor: pointer;
}
.swatch__picker {
  position: absolute;
  inset: -10px;
  width: calc(100% + 20px);
  height: calc(100% + 20px);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  opacity: 0; /* the label shows the colour; the native well would paint black when empty */
}
.swatch:has(.swatch__picker:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.textfield--hex { font-variant-numeric: tabular-nums; text-transform: uppercase; }
.swatch__note { font-size: 13px; line-height: 1.4; color: var(--stone); }
@media (max-width: 575.98px) {
  .row--swatch { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .row--swatch > :last-child { grid-column: 3; grid-row: 1; }
  .swatch__note { grid-column: 2 / -1; }
}

/* Reference sites */
.sites { border-top: 1px solid var(--hair); }
.site { padding: 20px 0 22px; border-bottom: 1px solid var(--hair); }
.site__head { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: end; gap: 0 14px; }
.site__num { padding-bottom: 12px; font: italic 400 20px/1 var(--serif); color: var(--gilt); }
.site__body { min-width: 0; margin: 14px 0 0 54px; padding: 0; border: 0; }
.site__body .source { margin-top: 0; }
.site__aspects { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.site__aspects .chip__label { min-height: 34px; padding: 0 13px; font-size: 13px; }
.site__note { margin-top: 12px; }
@media (max-width: 575.98px) { .site__body { margin-left: 0; } }

/* --------------------------------------------------------------------------
   Uploads
   -------------------------------------------------------------------------- */
.uploads { display: grid; gap: 28px; margin-top: 22px; }

.drop {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 30px 20px;
  border: 1px dashed var(--line-control);
  background: var(--vellum);
  text-align: center;
  transition: border-color .2s linear, background-color .2s linear;
}
.drop--compact { padding: 18px 16px; }
.drop.is-over { border-style: solid; border-color: var(--ink); background: var(--linen); }
.drop__input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop__icon { display: block; width: 28px; height: 28px; margin-bottom: 4px; color: var(--stone); }
.drop__icon svg { width: 100%; height: 100%; }
.drop__text { font-size: 15px; line-height: 1.45; color: var(--graphite); }
.drop__pick {
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
@media (hover: hover) { .drop__pick:hover { text-decoration-color: transparent; } }
.drop__hint { font-size: 13px; line-height: 1.45; color: var(--stone); }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 18px 14px; margin-top: 16px; }
.thumbs:empty { display: none; }
.thumb { display: flex; flex-direction: column; min-width: 0; }
.thumb__figure {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--folio);
  color: var(--champagne);
  font: 500 11px/1 var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.thumb__img { width: 100%; height: 100%; object-fit: cover; }
.thumb__tag {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 7px;
  background: var(--paper);
  color: var(--ink);
  font: 500 11px/1 var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.thumb__name { margin-top: 8px; overflow: hidden; font-size: 13px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.thumb__info { font-size: 12px; line-height: 1.4; color: var(--stone); }
.thumb__remove { align-self: flex-start; margin-top: 2px; font-size: 11px; }

.thumbs--logo { grid-template-columns: minmax(0, 200px); }
.thumbs--logo .thumb__figure {
  aspect-ratio: 16 / 10;
  color: var(--graphite);
  background-color: var(--vellum);
  background-image: conic-gradient(var(--linen) 25%, transparent 0 50%, var(--linen) 0 75%, transparent 0);
  background-size: 16px 16px;
  border: 1px solid var(--hair);
}
.thumbs--logo .thumb__img { object-fit: contain; padding: 12%; }

.thumbs--list { grid-template-columns: minmax(0, 1fr); gap: 0; border-top: 1px solid var(--hair); }
.thumbs--list .thumb { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 0 14px; padding: 10px 0; border-bottom: 1px solid var(--hair); }
.thumbs--list .thumb__figure { grid-row: 1 / span 2; }
.thumbs--list .thumb__name { margin-top: 0; }
.thumbs--list .thumb__remove { grid-column: 3; grid-row: 1 / span 2; align-self: center; margin: 0; }
.thumbs--list .thumb__name { align-self: end; }
.thumbs--list .thumb__info { align-self: start; }

/* --------------------------------------------------------------------------
   Motion level previews
   -------------------------------------------------------------------------- */
.opt--motion { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 14px; }
.opt--motion .opt__input { top: auto; bottom: 18px; }
.opt__row { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 14px; }
@media (min-width: 576px) {
  .opt--motion { grid-template-columns: 156px minmax(0, 1fr); align-items: center; gap: 20px; }
}

.mc { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--folio); }
.mc--a { display: flex; flex-direction: column; justify-content: center; gap: 9px; padding: 0 16%; }
.mc__line { display: block; height: 5px; background: var(--pearl); opacity: .9; }
.mc__line:nth-child(2) { width: 82%; animation-delay: .22s; }
.mc__line--short { width: 54%; animation-delay: .44s; }
@keyframes mc-rise {
  0%, 12% { opacity: .9; transform: none; }
  24% { opacity: 0; transform: translateY(-3px); }
  34% { opacity: 0; transform: translateY(10px); }
  56%, 100% { opacity: .9; transform: none; }
}

.mc__panel { position: absolute; inset: 0; z-index: 1; background: var(--champagne); transform: translateX(-101%); }
.mc__word { position: absolute; left: 12%; bottom: 14%; color: var(--pearl); font: italic 400 34px/1 var(--serif); transform-origin: left bottom; }
@keyframes mc-wipe {
  0% { transform: translateX(-101%); }
  38%, 52% { transform: translateX(0); }
  90%, 100% { transform: translateX(101%); }
}
@keyframes mc-zoom {
  0%, 30% { opacity: 1; transform: none; }
  38%, 52% { opacity: 0; transform: scale(1.7); }
  82%, 100% { opacity: 1; transform: none; }
}

.mc--c { perspective: 320px; }
.mc__orb { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; transform-style: preserve-3d; transform: rotateX(62deg) rotateY(24deg); }
.mc__ring { position: absolute; inset: 0; border: 1px solid var(--champagne); border-radius: 50%; }
.mc__ring--2 { border-color: var(--pearl); transform: rotateY(90deg); }
.mc__cursor { position: absolute; left: 22%; top: 62%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--pearl); }
.mc__bars { position: absolute; right: 10px; bottom: 10px; display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.mc__bars i { display: block; width: 2px; height: 100%; background: var(--champagne); transform-origin: center bottom; transform: scaleY(.6); }
.mc__bars i:nth-child(2) { animation-delay: -.3s; }
.mc__bars i:nth-child(3) { animation-delay: -.6s; }
.mc__bars i:nth-child(4) { animation-delay: -.15s; }
@keyframes mc-spin { from { transform: rotateX(62deg) rotateY(24deg); } to { transform: rotateX(422deg) rotateY(384deg); } }
@keyframes mc-cursor {
  0%, 100% { left: 22%; top: 62%; }
  33% { left: 72%; top: 28%; }
  66% { left: 58%; top: 76%; }
}
@keyframes mc-eq { 0% { transform: scaleY(.6); } 50% { transform: scaleY(1); } 100% { transform: scaleY(.25); } }
/* Previews move only while their card is pointed at or focused: nothing loops beside the form unasked. */
@media (prefers-reduced-motion: no-preference) {
  .opt--motion:is(:hover, :focus-within) .mc__line { animation: mc-rise 3.6s var(--ease-out) infinite; }
  .opt--motion:is(:hover, :focus-within) .mc__panel { animation: mc-wipe 3.4s var(--ease-in-out) infinite; }
  .opt--motion:is(:hover, :focus-within) .mc__word { animation: mc-zoom 3.4s var(--ease-out) infinite; }
  .opt--motion:is(:hover, :focus-within) .mc__orb { animation: mc-spin 7s linear infinite; }
  .opt--motion:is(:hover, :focus-within) .mc__cursor { animation: mc-cursor 4.2s ease-in-out infinite; }
  .opt--motion:is(:hover, :focus-within) .mc__bars i { animation: mc-eq .9s ease-in-out infinite alternate; }
  .opt--motion:is(:hover, :focus-within) .mc__line:nth-child(2) { animation-delay: .22s; }
  .opt--motion:is(:hover, :focus-within) .mc__line--short { animation-delay: .44s; }
  .opt--motion:is(:hover, :focus-within) .mc__bars i:nth-child(2) { animation-delay: -.3s; }
  .opt--motion:is(:hover, :focus-within) .mc__bars i:nth-child(3) { animation-delay: -.6s; }
  .opt--motion:is(:hover, :focus-within) .mc__bars i:nth-child(4) { animation-delay: -.15s; }
}

/* --------------------------------------------------------------------------
   Chapter navigation
   -------------------------------------------------------------------------- */
.chapter-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--hair);
}
/* The sticky bar must never cover the focused field */
@media (max-width: 991.98px) { html { scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom)); } }

.chapter-nav__count { margin-left: auto; color: var(--stone); font-variant-numeric: tabular-nums lining-nums; }
.dossier-toggle { display: none; }

@media (max-width: 991.98px) {
  .chapter-nav {
    position: sticky;
    bottom: 0;
    z-index: 30;
    flex-wrap: nowrap;
    gap: 12px;
    margin: 48px calc(-1 * var(--gutter)) 0;
    padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
    background: var(--paper);
  }
  .chapter-nav__count { display: none; }
  .chapter-nav__next { margin-left: auto; padding: 0 22px; }
  .dossier-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--line-control);
    border-radius: 999px;
    color: var(--ink);
    font: 500 12px/1 var(--sans);
    letter-spacing: .1em;
    text-transform: uppercase;
    white-space: nowrap;
  }
  .dossier-toggle__dot { width: 7px; height: 7px; border-radius: 999px; background: var(--gilt); }
  .dossier-toggle.has-news .dossier-toggle__dot { animation: note-pulse .9s ease-in-out 4 alternate; }
  .dossier-toggle__count { color: var(--stone); }
}
@media (max-width: 479.98px) {
  .dossier-toggle__count, .chapter-nav__next .icon-arrow { display: none; }
  .chapter-nav__next { min-width: 0; padding: 0 18px; white-space: normal; line-height: 1.2; text-align: center; }
}

/* --------------------------------------------------------------------------
   Dossier: the page's one dark object
   -------------------------------------------------------------------------- */
.dossier__panel {
  position: relative;
  max-height: calc(100vh - 112px);
  max-height: calc(100dvh - 112px);
  padding: clamp(24px, 1rem + .6vw, 32px);
  overflow: auto;
  overscroll-behavior: contain;
  background-color: var(--folio);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
  background-size: 240px 240px;
  color: var(--pearl);
  box-shadow: var(--shadow-rest);
  outline: 1px solid var(--keyline);
  outline-offset: -13px;
  scrollbar-width: thin;
  scrollbar-color: rgba(239, 236, 230, .25) transparent;
}
.dossier__grain, .dossier__keyline { display: none; }
.dossier :focus-visible, .dossier-sheet :focus-visible, .filed__aside :focus-visible { outline-color: var(--champagne); }
.dossier .dossier__panel:focus-visible { outline: 2px solid var(--champagne); outline-offset: -13px; }

.dossier__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.dossier__label { display: inline-flex; align-items: center; gap: 10px; color: var(--pearl); }
.dossier__burst { display: block; width: 16px; height: 16px; color: var(--champagne); }
.dossier__burst svg { width: 100%; height: 100%; fill: currentColor; }
.dossier__title { margin-top: 20px; font: 400 clamp(30px, 1rem + 1vw, 40px)/1 var(--serif); color: var(--pearl); }
.dossier__title i { color: var(--champagne); }

.dossier__ready { margin-top: 18px; }
.dossier__ready-text { font-size: 13px; line-height: 1.4; color: var(--folio-muted); }
.ticks { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; margin-top: 10px; }
.ticks li { height: 3px; background: rgba(239, 236, 230, .16); transition: background-color .6s var(--ease-out); }
.ticks li.is-current { background: rgba(231, 220, 198, .45); }
.ticks li.is-done { background: var(--champagne); }

.dossier__group { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--hair-folio); }
.dossier__group-title { display: flex; justify-content: space-between; gap: 12px; color: var(--folio-muted); }
.dossier__group-count { color: var(--champagne); }

.facts { margin-top: 8px; }
.fact { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--hair-folio); }
.fact:last-child { border-bottom: 0; }
.fact__num { font: italic 400 16px/1.3 var(--serif); color: var(--folio-muted); }
.fact__label { display: block; color: var(--folio-muted); font: 500 11px/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; }
.fact__value {
  display: -webkit-box;
  margin-top: 3px;
  overflow: hidden;
  color: var(--pearl);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.fact.is-empty .fact__value { color: var(--folio-muted); font-style: italic; }
.fact.is-current .fact__num { color: var(--champagne); }
.fact__swatches { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: -1px; }
.fact__swatch { display: inline-block; width: 11px; height: 11px; border: 1px solid var(--hair-folio); border-radius: 999px; }

.notes__empty { margin-top: 12px; font: italic 400 19px/1.3 var(--serif); color: var(--folio-muted); }
.notes { margin-top: 6px; }
.note { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--hair-folio); }
.note:last-child { border-bottom: 0; }
.note__dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 999px; background: var(--champagne); }
.note[data-kind="planned"] .note__dot { background: transparent; box-shadow: inset 0 0 0 1px var(--folio-muted); }
.note.is-working .note__dot { background: var(--champagne); box-shadow: none; animation: note-pulse .8s ease-in-out infinite alternate; }
.note__meta { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--folio-muted); font: 500 11px/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; }
.note__text { margin-top: 3px; color: var(--pearl); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.note[data-kind="planned"] .note__text,
.note.is-working .note__text { color: var(--folio-muted); }
.note.is-fresh .note__text { animation: note-in .7s var(--ease-out) both; }
.note__swatches { display: flex; gap: 6px; margin-top: 8px; }
.note__swatch { width: 18px; height: 18px; border: 1px solid var(--hair-folio); border-radius: 999px; }
@keyframes note-pulse { from { opacity: .35; } to { opacity: 1; } }
@keyframes note-in { from { opacity: 0; transform: translateY(4px); } }

.dossier__foot { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--hair-folio); font-size: 12px; line-height: 1.5; color: var(--folio-muted); }

/* Mobile sheet */
.dossier-sheet {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0 var(--gutter) calc(24px + env(safe-area-inset-bottom));
  border: 0;
  background: var(--folio);
  color: var(--pearl);
  box-shadow: none;
}
.dossier-sheet[open] { animation: ik-sheet-in .36s cubic-bezier(.215, .61, .355, 1); }
.dossier-sheet.is-closing { animation: nct-fade-out .24s linear forwards; }
@keyframes ik-sheet-in { from { opacity: 0; transform: translateY(24px); } }
.dossier-sheet__top {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 56px;
  border-bottom: 1px solid var(--hair-folio);
  background: var(--folio);
}
.dossier-sheet .dossier__panel { max-height: none; padding: 20px 0 0; overflow: visible; background: none; box-shadow: none; outline: 0; }

/* --------------------------------------------------------------------------
   Review
   -------------------------------------------------------------------------- */
.review { margin-top: 36px; border-top: 1px solid var(--ink); }
.review__item { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 6px 16px; padding: 20px 0; border-bottom: 1px solid var(--hair); }
.review__num { font: italic 400 20px/1.2 var(--serif); color: var(--gilt); }
.review__title { font: 400 24px/1.15 var(--serif); }
.review__edit { grid-column: 3; grid-row: 1; align-self: start; }
.review__answers { grid-column: 2 / -1; display: grid; gap: 6px; margin-top: 4px; }
.review__row { display: grid; grid-template-columns: minmax(0, 168px) minmax(0, 1fr); gap: 2px 16px; font-size: 14px; line-height: 1.5; }
.review__row dt { color: var(--stone); }
.review__row dd { color: var(--ink); overflow-wrap: anywhere; }
.review__flag { grid-column: 2 / -1; display: flex; align-items: baseline; gap: 10px; color: var(--oxblood); font-size: 14px; line-height: 1.45; }
.review__flag::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 999px; background: var(--oxblood); transform: translateY(-1px); }
.review__thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.review__thumbs img { width: 40px; height: 40px; object-fit: cover; background: var(--folio); }
.review__swatch { display: inline-block; width: 12px; height: 12px; margin-right: 4px; border: 1px solid var(--hair); border-radius: 999px; vertical-align: -1px; }
@media (max-width: 575.98px) {
  .review__item { grid-template-columns: 36px minmax(0, 1fr); }
  .review__edit { grid-column: 2; grid-row: auto; }
  .review__row { grid-template-columns: minmax(0, 1fr); }
}

/* --------------------------------------------------------------------------
   Filed
   -------------------------------------------------------------------------- */
.filed {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: 56px;
  padding-top: clamp(32px, 1rem + 4vw, 104px);
}
.filed__eyebrow { margin-bottom: 20px; color: var(--stone); }
.filed__title { font: 400 clamp(52px, 1rem + 6vw, 136px)/.9 var(--serif); letter-spacing: -.02em; }
.filed__title .mask { display: block; }
.filed__title i { color: var(--gilt); }
.filed__lead { max-width: 40ch; margin-top: 28px; font-size: clamp(17px, 15px + .3vw, 20px); line-height: 1.5; color: var(--graphite); }
.filed__actions { margin-top: 32px; }
.filed__note { margin-top: 20px; font-size: 13px; line-height: 1.45; color: var(--stone); }
.filed__aside {
  align-self: start;
  padding: clamp(24px, 1rem + 1vw, 36px);
  background: var(--folio);
  color: var(--pearl);
  box-shadow: var(--shadow-rest);
  outline: 1px solid var(--keyline);
  outline-offset: -13px;
}
.filed__run-title { color: var(--folio-muted); }
.run { margin-top: 12px; border-top: 1px solid var(--hair-folio); }
.run__item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hair-folio);
  color: var(--folio-muted);
  font-size: 14px;
  line-height: 1.45;
  transition: color .4s linear;
}
.run__mark { align-self: center; width: 9px; height: 9px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--folio-muted); }
.run__status { min-width: 60px; color: var(--folio-muted); font: 500 11px/1 var(--sans); letter-spacing: .12em; text-align: right; text-transform: uppercase; white-space: nowrap; }
.run__item.is-working, .run__item.is-done { color: var(--pearl); }
.run__item.is-working .run__mark { background: var(--champagne); box-shadow: none; animation: note-pulse .8s ease-in-out infinite alternate; }
.run__item.is-done .run__mark { background: var(--champagne); box-shadow: none; }
.run__item.is-done .run__status { color: var(--champagne); }
@media (min-width: 992px) {
  .filed { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: clamp(40px, 6vw, 120px); align-items: start; }
}

/* --------------------------------------------------------------------------
   Touch, reduced motion
   -------------------------------------------------------------------------- */
@media (pointer: coarse) {
  .chip__label, .site__aspects .chip__label, .rail__link { min-height: 44px; }
  .rail__link, .chapter-nav__back, .add-inline .text-btn { min-width: 44px; justify-content: center; }
  .drop__pick { display: inline-flex; align-items: center; min-height: 44px; }
  .textfield--sm { height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .seg__label, .opt, .opt__mark, .opt__mark::after, .chip__label, .rail__link, .rail__link::before, .ticks li, .run__item { transition: none; }
  .mc__line, .mc__panel, .mc__word, .mc__orb, .mc__cursor, .mc__bars i { animation: none; }
  .mc__line { opacity: .9; }
  .mc__panel { transform: translateX(-101%); }
  .mc__word { opacity: 1; }
  .note.is-working .note__dot, .run__item.is-working .run__mark, .dossier-toggle.has-news .dossier-toggle__dot { animation: none; }
  .note.is-fresh .note__text { animation: none; }
  .dossier-sheet[open], .dossier-sheet.is-closing { animation: nct-fade-in .15s linear; }
}

/* --------------------------------------------------------------------------
   Several products: one block per product, each with its own photos
   -------------------------------------------------------------------------- */
.seg--three .seg__opt { flex: 1 1 auto; }

.products { display: grid; gap: 20px; }
.product {
  --product-pad: clamp(20px, 1.4vw, 28px);   /* the desk's card curve, not the page gutter */
  padding: var(--product-pad);
  border: 1px solid var(--hair);
  background: var(--vellum);
}
.product__set {
  position: relative;                        /* the Remove button sits against the legend */
  display: block;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.product__num { padding: 0; color: var(--stone); }
.product .row__remove { position: absolute; top: -2px; right: 0; }
.product__set > .q { margin-top: 20px; }
.product__set > .q:first-of-type {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--hair);
}
/* One boundary per level: the card is the bordered surface, the drop zone is a well in it */
.product .drop { background: var(--paper); }
