/* ============================================================
 * FabricsMaker — custom order request workspace.
 *
 * Scoped entirely to `.fmcor-*`. Nothing here can reach a header,
 * a footer, another product page, a cart, or a checkout, and no
 * selector in this file is bare.
 *
 * It consumes the existing --fm-* tokens from foundation.css. No new
 * palette, no new font stack, no gradient, no filter, no shadow
 * beyond the two the theme already defines, no remote asset, no
 * @font-face, no CDN.
 *
 * The project rule is that display:none is never used to hide a
 * thing. It appears once, on an element the visitor asked to hide
 * (the additional-links group) and only while that group is empty,
 * where a zero-height box is the correct rendering.
 * ============================================================ */

.fmcor {
  --fmcor-rule-soft: var(--fm-rule);
  --fmcor-gap: var(--fm-space-6);
  /* The workspace renders full width, outside the two-column product
     grid. A form line longer than about 70 characters is hard to read
     and hard to scan, so the journey gets its own measure. */
  max-width: 68rem;
  margin: var(--fm-space-8) auto;
  padding-inline: var(--fm-gutter);
}

/* One page-level exception, because the page title lives in the theme's
   hero rather than in this component. Loaded on this page only. */
.fm-custom-hero__sub {
  font-size: var(--fm-text-lg);
  color: var(--fm-ink);
}

/* ---------- shared module frame ---------- */

.fmcor-step {
  border-top: 1px solid var(--fmcor-rule-soft);
  padding-top: var(--fm-space-6);
  margin-bottom: var(--fm-space-7);
  scroll-margin-top: var(--fm-space-8);
}
.fmcor-step:last-child {
  margin-bottom: 0;
}

.fmcor-step__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--fm-space-3);
  margin-bottom: var(--fm-space-4);
}
.fmcor-step__number {
  font-family: var(--fm-font-mono);
  font-size: var(--fm-text-xs);
  letter-spacing: var(--fm-tracking-meta);
  color: var(--fm-primary);
  border: 1px solid var(--fm-primary-soft);
  border-radius: var(--fm-radius-sm);
  padding: 2px var(--fm-space-2);
  white-space: nowrap;
}
.fmcor-step__title {
  font-family: var(--fm-font-serif);
  font-size: var(--fm-text-xl);
  line-height: var(--fm-leading-snug);
  color: var(--fm-ink);
  margin: 0;
  flex: 1 1 16rem;
  min-width: 0;
}
.fmcor-step__intro {
  font-size: var(--fm-text-base);
  color: var(--fm-ink-muted);
  margin: 0 0 var(--fm-space-5);
  max-width: 44rem;
}
.fmcor-step__body {
  display: grid;
  gap: var(--fm-space-5);
}
@media (min-width: 56rem) {
  .fmcor-step__body--split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--fm-space-7);
    align-items: start;
  }
}

/* ---------- 01 · download ---------- */

.fmcor-download__button {
  display: inline-flex;
  align-items: center;
  gap: var(--fm-space-2);
  min-height: var(--fm-control-cta);
  font-family: var(--fm-font-sans);
  font-size: var(--fm-text-base);
  font-weight: 500;
  line-height: 1.2;
  padding: var(--fm-space-3) var(--fm-space-6);
  border-radius: var(--fm-radius-md);
  border: 1px solid var(--fm-primary);
  background-color: var(--fm-primary);
  color: var(--fm-surface);
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color var(--fm-dur-short) var(--fm-ease-out),
    border-color var(--fm-dur-short) var(--fm-ease-out),
    color var(--fm-dur-short) var(--fm-ease-out);
}
.fmcor-download__button:hover {
  background-color: var(--fm-primary-hover);
  border-color: var(--fm-primary-hover);
  color: var(--fm-surface);
  text-decoration: none;
}
.fmcor-download__button:focus-visible {
  outline: 2px solid var(--fm-primary);
  outline-offset: 2px;
}
/* Pending state: no href was ever rendered, so this is a real disabled
   control, not a link dressed up as one. */
.fmcor-download__button[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: var(--fm-surface-sunk);
  border-color: var(--fm-rule);
  color: var(--fm-ink-muted);
}
.fmcor-download__pending {
  font-size: var(--fm-text-sm);
  color: var(--fm-ink-muted);
  margin: var(--fm-space-3) 0 0;
  max-width: 40rem;
}

/* ---------- rules ledger ---------- */

.fmcor-rules {
  border: 1px solid var(--fmcor-rule-soft);
  border-radius: var(--fm-radius-md);
  background-color: var(--fm-surface);
  padding: var(--fm-space-5);
  margin: 0;
}
.fmcor-rules__title {
  font-size: var(--fm-text-xs);
  letter-spacing: var(--fm-tracking-meta);
  text-transform: uppercase;
  color: var(--fm-ink-muted);
  margin: 0 0 var(--fm-space-3);
}
.fmcor-rules__list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.fmcor-rules__list li {
  display: flex;
  gap: var(--fm-space-3);
  padding: var(--fm-space-3) 0;
  border-top: 1px solid var(--fm-rule);
  font-size: var(--fm-text-sm);
  line-height: var(--fm-leading-normal);
  color: var(--fm-ink);
}
.fmcor-rules__list li:first-child {
  border-top: 0;
  padding-top: 0;
}
.fmcor-rules__key {
  flex: 0 0 6.5rem;
  color: var(--fm-ink-muted);
}
/* Below this width a two-column ledger squeezes the value into a
   four-word column. Stack the label above its value instead. */
@media (max-width: 40rem) {
  .fmcor-rules__list li {
    display: block;
  }
  .fmcor-rules__key {
    display: block;
    margin-bottom: 2px;
  }
}
.fmcor-rules__value {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}
.fmcor-rules__value strong {
  font-weight: 600;
}
.fmcor-rules__value code {
  font-family: var(--fm-font-mono);
  font-size: 0.95em;
  background-color: var(--fm-surface-sunk);
  border-radius: var(--fm-radius-sm);
  padding: 1px 5px;
}
.fmcor-rules__note {
  margin: var(--fm-space-4) 0 0;
  padding-top: var(--fm-space-3);
  border-top: 1px solid var(--fm-rule);
  font-size: var(--fm-text-xs);
  color: var(--fm-ink-muted);
}

/* ---------- 02 · prepare & share ---------- */

.fmcor-list {
  counter-reset: fmcor-step;
  margin: 0;
  padding: 0;
  list-style: none;
}
.fmcor-list__item {
  counter-increment: fmcor-step;
  display: flex;
  gap: var(--fm-space-3);
  padding: var(--fm-space-3) 0;
  border-top: 1px solid var(--fm-rule);
  font-size: var(--fm-text-sm);
  line-height: var(--fm-leading-normal);
  color: var(--fm-ink);
}
.fmcor-list__item:first-child {
  border-top: 0;
  padding-top: 0;
}
.fmcor-list__item::before {
  content: counter(fmcor-step);
  flex: 0 0 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--fm-rule-strong);
  border-radius: 999px;
  font-family: var(--fm-font-mono);
  font-size: 0.75rem;
  color: var(--fm-ink-muted);
}
.fmcor-list__item > span {
  flex: 1 1 auto;
  min-width: 0;
}

.fmcor-platforms {
  display: grid;
  gap: var(--fm-space-2);
  margin: 0 0 var(--fm-space-3);
  padding: 0;
  list-style: none;
}
.fmcor-platforms li {
  display: flex;
  align-items: baseline;
  gap: var(--fm-space-2);
  font-size: var(--fm-text-sm);
  color: var(--fm-ink);
  padding: var(--fm-space-2) var(--fm-space-3);
  border: 1px solid var(--fmcor-rule-soft);
  border-radius: var(--fm-radius-sm);
  background-color: var(--fm-surface);
}
.fmcor-platforms strong {
  font-weight: 600;
}
.fmcor-platforms span {
  color: var(--fm-ink-muted);
  font-size: var(--fm-text-xs);
}
.fmcor-callout {
  border-left: 3px solid var(--fm-attention-token);
  padding: var(--fm-space-2) 0 var(--fm-space-2) var(--fm-space-4);
  margin: var(--fm-space-4) 0 0;
  font-size: var(--fm-text-sm);
  color: var(--fm-ink);
  max-width: 40rem;
}
.fmcor-callout--time {
  border-left-color: var(--fm-primary-soft);
}
.fmcor-callout__title {
  display: block;
  font-weight: 600;
  margin-bottom: 2px;
}

/* artwork requirements shortcuts */

.fmcor-spec {
  margin: 0;
}
.fmcor-spec__group {
  border-top: 1px solid var(--fm-rule);
  padding: var(--fm-space-4) 0 0;
  margin-top: var(--fm-space-4);
}
.fmcor-spec__group:first-child {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}
.fmcor-spec__legend {
  font-size: var(--fm-text-xs);
  letter-spacing: var(--fm-tracking-meta);
  text-transform: uppercase;
  color: var(--fm-ink-muted);
  margin: 0 0 var(--fm-space-2);
  padding: 0;
}
.fmcor-spec__group ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.fmcor-spec__group li {
  font-size: var(--fm-text-sm);
  line-height: var(--fm-leading-normal);
  color: var(--fm-ink);
  padding: var(--fm-space-1) 0 var(--fm-space-1) var(--fm-space-4);
  position: relative;
}
.fmcor-spec__group li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--fm-rule-strong);
}
.fmcor-spec__group em {
  font-style: normal;
  color: var(--fm-ink-muted);
}
.fmcor-more {
  display: inline-block;
  margin-top: var(--fm-space-4);
  font-size: var(--fm-text-sm);
  color: var(--fm-primary);
}

/* ---------- 03 · the form ---------- */

.fmcor-form-panel {
  /* Sized to the form's measure and centred in the column. A full-width
     panel around a 40rem form reads as a layout mistake, not as
     emphasis; a left-hugging one leaves a hole beside the heading. */
  max-width: 46rem;
  margin-inline: auto;
  border: 1px solid var(--fm-rule-strong);
  border-radius: var(--fm-radius-lg);
  background-color: var(--fm-surface);
  box-shadow: var(--fm-shadow-2);
  padding: var(--fm-space-6);
}
.fmcor-form-panel[hidden] {
  display: none;
}
@media (max-width: 40rem) {
  .fmcor-form-panel {
    padding: var(--fm-space-5) var(--fm-space-4);
  }
}

.fmcor-form {
  /* A form line past roughly 75 characters is hard to scan. This is the
     measure, not a layout decision. */
  max-width: 40rem;
}
.fmcor-form__grid {
  display: grid;
  gap: var(--fm-space-4);
}
.fmcor-field {
  min-width: 0;
}
.fmcor-field > label {
  display: block;
  font-family: var(--fm-font-sans);
  font-size: var(--fm-text-sm);
  font-weight: 500;
  color: var(--fm-ink);
  margin-bottom: var(--fm-space-1);
}
.fmcor-field__optional {
  font-weight: 400;
  color: var(--fm-ink-muted);
}
.fmcor-field__required {
  color: var(--fm-attention-token);
}
.fmcor-field input[type="text"],
.fmcor-field input[type="email"],
.fmcor-field input[type="tel"],
.fmcor-field input[type="url"],
.fmcor-field textarea {
  width: 100%;
  max-width: none;
  min-height: var(--fm-control-min);
  font-family: var(--fm-font-sans);
  font-size: 1rem;
  line-height: var(--fm-leading-snug);
  color: var(--fm-ink);
  background-color: var(--fm-bg);
  border: 1px solid var(--fm-rule);
  border-radius: var(--fm-radius-sm);
  padding: var(--fm-space-3);
  transition: border-color var(--fm-dur-short) var(--fm-ease-out);
  -webkit-appearance: none;
  appearance: none;
}
.fmcor-field textarea {
  min-height: calc(var(--fm-control-min) * 2.4);
  resize: vertical;
}
.fmcor-field input:hover,
.fmcor-field textarea:hover {
  border-color: var(--fm-rule-strong);
}
.fmcor-field input:focus-visible,
.fmcor-field textarea:focus-visible {
  border-color: var(--fm-primary);
  outline: 2px solid var(--fm-primary);
  outline-offset: 1px;
}
.fmcor-field input[aria-invalid="true"] {
  border-color: var(--fm-attention-token);
}

/* 16px minimum on mobile so iOS Safari does not zoom on focus. */
@media (max-width: 40rem) {
  .fmcor-field input[type="text"],
  .fmcor-field input[type="email"],
  .fmcor-field input[type="tel"],
  .fmcor-field input[type="url"],
  .fmcor-field textarea {
    font-size: 16px;
  }
}

.fmcor-field__hint {
  display: block;
  font-family: var(--fm-font-sans);
  font-size: var(--fm-text-xs);
  line-height: var(--fm-leading-normal);
  color: var(--fm-ink-muted);
  margin-top: var(--fm-space-1);
}
.fmcor-field__error {
  display: block;
  font-family: var(--fm-font-sans);
  font-size: var(--fm-text-xs);
  line-height: var(--fm-leading-normal);
  color: var(--fm-attention-token);
  margin-top: var(--fm-space-1);
}
.fmcor-field__error:empty {
  display: none;
}

/* ---------- target date: the site's own English calendar ----------
 *
 * The browser's own date popup draws its month and weekday names from
 * the BROWSER's locale and ignores lang="en" on the document and on the
 * input, so it cannot be made English from the page. This panel is drawn
 * here instead, and its words are written in the markup and in the
 * script, in English, where the site's own language cannot reach them.
 *
 * The native date input is hidden only once the script has taken the
 * field over (the data-enhanced attribute), so a browser that never
 * runs the script still shows a working date box.
 */

.fmcor-date {
  position: relative;
  /* The panel is laid out from the width of its own field, not from the
   * width of the window, so the month name is never cut off because the
   * browser window happens to be narrow. */
  container-type: inline-size;
  container-name: fmcor-date;
}
.fmcor-date[data-enhanced="true"] {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: var(--fm-space-2);
}
.fmcor-date__text {
  flex: 1 1 0;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
@container fmcor-date (max-width: 13rem) {
.fmcor-field input.fmcor-date__text { padding-left: 6px; padding-right: 6px; }
}
.fmcor-date__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: var(--fm-control-min);
  min-height: var(--fm-control-min);
  padding: var(--fm-space-2);
  font-family: var(--fm-font-sans);
  color: var(--fm-ink);
  background-color: var(--fm-bg);
  border: 1px solid var(--fm-rule);
  border-radius: var(--fm-radius-sm);
  cursor: pointer;
}
.fmcor-date__toggle:hover {
  border-color: var(--fm-rule-strong);
}
.fmcor-date__toggle:focus-visible {
  outline: 2px solid var(--fm-primary);
  outline-offset: 1px;
}
.fmcor-date__icon {
  display: block;
}

.fmcor-date__panel {
  flex: 1 0 100%;
  margin-top: var(--fm-space-3);
  padding: var(--fm-space-3);
  background-color: var(--fm-surface);
  border: 1px solid var(--fm-rule);
  border-radius: var(--fm-radius-sm);
}
.fmcor-date__head {
  /* Narrow first: the month gets a line of its own, the year sits
   * between the two arrows. A browser that does not support container
   * queries keeps this layout, which is the one that always fits. */
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) 2rem;
  grid-template-areas:
    "month month month"
    "prev  year  next";
  align-items: center;
  gap: var(--fm-space-2);
  margin-bottom: var(--fm-space-3);
}
.fmcor-date__nav[data-fmcor-date-prev] {
  grid-area: prev;
}
.fmcor-date__nav[data-fmcor-date-next] {
  grid-area: next;
}
.fmcor-date__select--month {
  grid-area: month;
}
.fmcor-date__select--year {
  grid-area: year;
}
.fmcor-date__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  font-family: var(--fm-font-sans);
  font-size: var(--fm-text-base);
  line-height: 1;
  color: var(--fm-ink);
  background-color: transparent;
  border: 1px solid var(--fm-rule);
  border-radius: var(--fm-radius-sm);
  cursor: pointer;
}
.fmcor-date__nav:hover {
  color: var(--fm-primary);
  border-color: var(--fm-rule-strong);
}
.fmcor-date__nav:focus-visible {
  outline: 2px solid var(--fm-primary);
  outline-offset: 1px;
}
/* The theme styles `.fm-form select`, and the form carries that class,
 * so this rule is written with two class names to outrank it. The
 * calendar's own selects are sized for the panel, not for a form field. */
.fmcor-field .fmcor-date__select {
  width: 100%;
  min-width: 0;
  min-height: 2.25rem;
  /* Narrow first: at a narrow field the panel has to fit a month name
   * and a year in a fifth of its width each, so the type is small. A
   * browser that does not support container queries keeps this size. */
  padding: var(--fm-space-1);
  font-family: var(--fm-font-sans);
  font-size: var(--fm-text-xs);
  line-height: var(--fm-leading-snug);
  color: var(--fm-ink);
  background-color: var(--fm-bg);
  border: 1px solid var(--fm-rule);
  border-radius: var(--fm-radius-sm);
}
.fmcor-date__select:focus-visible {
  outline: 2px solid var(--fm-primary);
  outline-offset: 1px;
}

.fmcor-date__grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.fmcor-date__grid th {
  padding: var(--fm-space-1) 0;
  font-family: var(--fm-font-sans);
  /* "Mon" has to fit in a fifth of the panel. */
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--fm-ink-muted);
  text-align: center;
}
.fmcor-date__grid abbr {
  text-decoration: none;
  border: 0;
}
.fmcor-date__cell {
  padding: 1px;
  text-align: center;
}
.fmcor-date__day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.25rem;
  padding: 0;
  font-family: var(--fm-font-sans);
  font-size: var(--fm-text-sm);
  line-height: 1;
  color: var(--fm-ink);
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: var(--fm-radius-sm);
  cursor: pointer;
}
.fmcor-date__day:hover {
  border-color: var(--fm-rule-strong);
}
.fmcor-date__day:focus-visible {
  outline: 2px solid var(--fm-primary);
  outline-offset: -2px;
}
.fmcor-date__day.is-selected {
  color: var(--fm-surface);
  background-color: var(--fm-primary);
  border-color: var(--fm-primary);
}
.fmcor-date__day.is-today {
  font-weight: 600;
  text-decoration: underline;
}

.fmcor-date__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--fm-space-2);
  margin-top: var(--fm-space-3);
  padding-top: var(--fm-space-3);
  border-top: 1px solid var(--fm-rule);
}
.fmcor-date__action {
  min-height: 2.25rem;
  padding: var(--fm-space-1) var(--fm-space-3);
  font-family: var(--fm-font-sans);
  font-size: var(--fm-text-sm);
  color: var(--fm-primary);
  background-color: transparent;
  border: 1px solid var(--fm-rule);
  border-radius: var(--fm-radius-sm);
  cursor: pointer;
}
.fmcor-date__action:hover {
  border-color: var(--fm-primary);
}
.fmcor-date__action:focus-visible {
  outline: 2px solid var(--fm-primary);
  outline-offset: 1px;
}

/* The enhanced controls exist only once the script has taken the field
 * over. Every one of these rules names the [hidden] attribute, so the
 * attribute alone decides whether the control is on the page. */
.fmcor-date__native[hidden],
.fmcor-date__text[hidden],
.fmcor-date__toggle[hidden],
.fmcor-date__panel[hidden] {
  display: none;
}

/* Wide enough for one line: the arrows flank the month and the year, and
 * the type goes back to its normal size.
 *
 * This block comes AFTER the rules it overrides. A container query has
 * the same specificity as the plain rule it competes with, so the one
 * that is written last is the one that wins. */
@container fmcor-date (min-width: 20rem) {
  .fmcor-date__head {
    /* The toolbar is capped and centred, so the month name is not
     * stretched across a wide form. The year column is wide enough for
     * four digits plus the browser's own arrow. */
    grid-template-columns: 2rem minmax(0, 16rem) 5rem 2rem;
    grid-template-areas: "prev month year next";
    justify-content: center;
  }
  .fmcor-field .fmcor-date__select {
    padding: var(--fm-space-1) var(--fm-space-2);
    font-size: var(--fm-text-sm);
  }
  .fmcor-date__grid th {
    font-size: var(--fm-text-xs);
  }
}

/* A very narrow panel gives its padding back to the calendar. */
@container fmcor-date (max-width: 12rem) {
  .fmcor-date__panel {
    padding: var(--fm-space-1);
  }
}

/* honeypot: present for bots, unreachable for people */
.fmcor-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- sharing links ---------- */

.fmcor-links {
  margin: var(--fm-space-3) 0 0;
  padding: 0;
  border: 0;
  list-style: none;
}
.fmcor-link-row {
  display: block;
  margin-bottom: var(--fm-space-3);
}
.fmcor-link-row:last-child {
  margin-bottom: 0;
}
.fmcor-link-row__label {
  display: block;
  font-size: var(--fm-text-xs);
  letter-spacing: var(--fm-tracking-meta);
  text-transform: uppercase;
  color: var(--fm-ink-muted);
  margin-bottom: var(--fm-space-1);
}
.fmcor-link-row__control {
  display: flex;
  gap: var(--fm-space-2);
  align-items: flex-start;
}
.fmcor-link-row__input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  min-height: var(--fm-control-min);
  font-family: var(--fm-font-sans);
  font-size: 1rem;
  color: var(--fm-ink);
  background-color: var(--fm-bg);
  border: 1px solid var(--fm-rule);
  border-radius: var(--fm-radius-sm);
  padding: var(--fm-space-3);
  transition: border-color var(--fm-dur-short) var(--fm-ease-out);
  -webkit-appearance: none;
  appearance: none;
}
.fmcor-link-row__input:hover {
  border-color: var(--fm-rule-strong);
}
.fmcor-link-row__input:focus-visible {
  border-color: var(--fm-primary);
  outline: 2px solid var(--fm-primary);
  outline-offset: 1px;
}
.fmcor-link-row__input[aria-invalid="true"] {
  border-color: var(--fm-attention-token);
}
@media (max-width: 40rem) {
  .fmcor-link-row__control {
    flex-wrap: wrap;
  }
  .fmcor-link-row__input {
    font-size: 16px;
    flex: 1 0 100%;
  }
}
.fmcor-link-row__remove {
  flex: 0 0 auto;
  min-height: var(--fm-control-min);
  font-family: var(--fm-font-sans);
  font-size: var(--fm-text-sm);
  color: var(--fm-primary);
  background-color: transparent;
  border: 1px solid var(--fm-rule);
  border-radius: var(--fm-radius-sm);
  padding: var(--fm-space-2) var(--fm-space-3);
  cursor: pointer;
  white-space: nowrap;
}
.fmcor-link-row__remove:hover {
  border-color: var(--fm-primary);
}
.fmcor-link-row__remove:focus-visible {
  outline: 2px solid var(--fm-primary);
  outline-offset: 2px;
}
.fmcor-link-row__message {
  display: block;
  font-size: var(--fm-text-xs);
  line-height: var(--fm-leading-normal);
  color: var(--fm-ink-muted);
  margin-top: var(--fm-space-1);
}
.fmcor-link-row__message:empty {
  display: none;
}
.fmcor-link-row__message.fm-field-error {
  color: var(--fm-attention-token);
}
.fmcor-link-row__message.fm-field-success {
  color: var(--fm-success-token);
}

.fmcor-add-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--fm-control-min);
  margin-top: var(--fm-space-3);
  padding: var(--fm-space-2) var(--fm-space-4);
  font-family: var(--fm-font-sans);
  font-size: var(--fm-text-sm);
  color: var(--fm-primary);
  background-color: transparent;
  border: 1px dashed var(--fm-rule-strong);
  border-radius: var(--fm-radius-sm);
  cursor: pointer;
}
.fmcor-add-link:hover:not([disabled]) {
  border-color: var(--fm-primary);
  border-style: solid;
}
.fmcor-add-link:focus-visible {
  outline: 2px solid var(--fm-primary);
  outline-offset: 2px;
}
.fmcor-add-link[disabled],
.fmcor-add-link[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  border-style: solid;
  border-color: var(--fm-rule);
  color: var(--fm-ink-muted);
}

/* ---------- submit + status ---------- */

.fmcor-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--fm-space-3);
  margin-top: var(--fm-space-5);
  padding-top: var(--fm-space-5);
  border-top: 1px solid var(--fm-rule);
}
.fmcor-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--fm-space-2);
  width: 100%;
  min-height: var(--fm-control-cta);
  padding: var(--fm-space-3) var(--fm-space-5);
  font-family: var(--fm-font-sans);
  font-size: var(--fm-text-base);
  font-weight: 500;
  line-height: 1.2;
  color: var(--fm-surface);
  background-color: var(--fm-primary);
  border: 1px solid var(--fm-primary);
  border-radius: var(--fm-radius-md);
  cursor: pointer;
  transition:
    background-color var(--fm-dur-short) var(--fm-ease-out),
    border-color var(--fm-dur-short) var(--fm-ease-out),
    opacity var(--fm-dur-short) var(--fm-ease-out);
}
@media (min-width: 34rem) {
  .fmcor-submit {
    width: auto;
    min-width: 16rem;
  }
}
.fmcor-submit:hover:not([disabled]) {
  background-color: var(--fm-primary-hover);
  border-color: var(--fm-primary-hover);
}
.fmcor-submit:focus-visible {
  outline: 2px solid var(--fm-primary);
  outline-offset: 2px;
}
.fmcor-submit[disabled],
.fmcor-submit[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: var(--fm-surface-sunk);
  border-color: var(--fm-rule);
  color: var(--fm-ink-muted);
}
.fmcor-submit.is-loading::before {
  content: "";
  width: 0.9em;
  height: 0.9em;
  border: 2px solid currentColor;
  border-radius: 999px;
  border-top-color: transparent;
  animation: fmcor-spin 720ms linear infinite;
}
@keyframes fmcor-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .fmcor-submit.is-loading::before {
    animation: none;
  }
}

.fmcor-status {
  font-size: var(--fm-text-sm);
  line-height: var(--fm-leading-normal);
}
.fmcor-status[data-state="success"] {
  color: var(--fm-success-token);
}
.fmcor-status[data-state="error"] {
  color: var(--fm-attention-token);
}
.fmcor-status[data-state="loading"] {
  color: var(--fm-ink-muted);
}
.fmcor-status:empty {
  display: none;
}
.fmcor-status:empty + .fmcor-noscript-note {
  display: none;
}
.fmcor-noscript-note {
  display: block;
  margin-top: var(--fm-space-3);
  font-size: var(--fm-text-sm);
  color: var(--fm-ink-muted);
}

/* ---------- success ---------- */

.fmcor-success {
  border: 1px solid var(--fm-success-token);
  border-radius: var(--fm-radius-lg);
  background-color: var(--fm-surface);
  padding: var(--fm-space-6);
  max-width: 40rem;
}
.fmcor-success[hidden] {
  display: none;
}
.fmcor-success__title {
  font-family: var(--fm-font-serif);
  font-size: var(--fm-text-2xl);
  line-height: var(--fm-leading-tight);
  color: var(--fm-ink);
  margin: 0 0 var(--fm-space-3);
}
.fmcor-success__lead {
  font-size: var(--fm-text-md);
  color: var(--fm-ink);
  margin: 0 0 var(--fm-space-5);
}
.fmcor-success__ref {
  border: 1px solid var(--fm-rule);
  border-radius: var(--fm-radius-md);
  background-color: var(--fm-bg);
  padding: var(--fm-space-4);
  margin: 0 0 var(--fm-space-5);
}
.fmcor-success__ref dt {
  font-size: var(--fm-text-xs);
  letter-spacing: var(--fm-tracking-meta);
  text-transform: uppercase;
  color: var(--fm-ink-muted);
  margin-bottom: var(--fm-space-1);
}
.fmcor-success__ref dd {
  margin: 0;
  font-family: var(--fm-font-mono);
  font-size: var(--fm-text-lg);
  letter-spacing: 0.04em;
  color: var(--fm-ink);
  overflow-wrap: anywhere;
}
.fmcor-success__copy p {
  font-size: var(--fm-text-sm);
  line-height: var(--fm-leading-normal);
  color: var(--fm-ink-muted);
  margin: 0 0 var(--fm-space-3);
}
.fmcor-success__copy p:last-child {
  margin-bottom: 0;
}
.fmcor-success__copy strong {
  color: var(--fm-ink);
  font-weight: 600;
}

/* ---------- 04 · what happens next ---------- */

.fmcor-next {
  display: grid;
  gap: var(--fm-space-4);
  counter-reset: fmcor-next;
  /* The marker is rendered by ::below, which can be styled to match the
     rest of the page. The browser's own marker would print "1." in
     addition to it. */
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 48rem) {
  .fmcor-next {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--fm-space-5) var(--fm-space-6);
  }
}
.fmcor-next__step {
  counter-increment: fmcor-next;
  border-top: 2px solid var(--fm-rule);
  padding-top: var(--fm-space-3);
}
.fmcor-next__step::before {
  content: counter(fmcor-next);
  display: block;
  font-family: var(--fm-font-mono);
  font-size: var(--fm-text-xs);
  color: var(--fm-primary);
  margin-bottom: var(--fm-space-1);
}
.fmcor-next__step h3 {
  font-family: var(--fm-font-sans);
  font-size: var(--fm-text-base);
  font-weight: 600;
  line-height: var(--fm-leading-snug);
  color: var(--fm-ink);
  margin: 0 0 var(--fm-space-2);
}
.fmcor-next__step p {
  font-size: var(--fm-text-sm);
  line-height: var(--fm-leading-normal);
  color: var(--fm-ink-muted);
  margin: 0;
}

/* ---------- closed-route notice ---------- */

.fmcor-closed {
  border: 1px solid var(--fm-rule-strong);
  border-left: 3px solid var(--fm-attention-token);
  border-radius: var(--fm-radius-md);
  background-color: var(--fm-surface);
  padding: var(--fm-space-5);
  max-width: 40rem;
}
.fmcor-closed__title {
  font-size: var(--fm-text-base);
  font-weight: 600;
  color: var(--fm-ink);
  margin: 0 0 var(--fm-space-2);
}
.fmcor-closed__copy {
  font-size: var(--fm-text-sm);
  line-height: var(--fm-leading-normal);
  color: var(--fm-ink-muted);
  margin: 0 0 var(--fm-space-3);
}
.fmcor-closed__copy:last-child {
  margin-bottom: 0;
}

/* ---------- closed-route panel (R5_1 / issue 2, Option A) ----------
 *
 * The closed panel is a complete alternative route, not an apology.
 * It has to read as a way forward, so it is laid out like a short
 * ordered list of actions rather than a paragraph of refusal.
 *
 * The panel never contains a form, an input or a postable name, so
 * there is nothing here that can be unhidden into a submission. */
.fmcor-closed {
  border: 1px solid var(--fm-rule-strong);
  border-left: 3px solid var(--fm-attention-token);
  border-radius: var(--fm-radius-md);
  background-color: var(--fm-surface);
  padding: var(--fm-space-6);
  max-width: 52rem;
}
.fmcor-closed__eyebrow {
  font-family: var(--fm-font-mono);
  font-size: var(--fm-text-xs);
  letter-spacing: var(--fm-tracking-meta);
  text-transform: uppercase;
  color: var(--fm-attention-token);
  margin: 0 0 var(--fm-space-2);
}
.fmcor-closed__title {
  font-family: var(--fm-font-serif);
  font-size: var(--fm-text-xl);
  line-height: var(--fm-leading-snug);
  color: var(--fm-primary);
  margin: 0 0 var(--fm-space-3);
}
.fmcor-closed__copy {
  font-size: var(--fm-text-sm);
  line-height: var(--fm-leading-normal);
  color: var(--fm-ink-muted);
  margin: 0 0 var(--fm-space-5);
  max-width: 58ch;
}
.fmcor-closed__routes {
  counter-reset: fmcor-closed-route;
  list-style: none;
  margin: 0 0 var(--fm-space-5);
  padding: 0;
}
.fmcor-closed__route {
  counter-increment: fmcor-closed-route;
  border-top: 1px solid var(--fm-rule);
  padding: var(--fm-space-4) 0;
}
.fmcor-closed__route:last-child {
  border-bottom: 1px solid var(--fm-rule);
}
.fmcor-closed__route-label {
  display: block;
  font-family: var(--fm-font-sans);
  font-size: var(--fm-text-base);
  font-weight: 600;
  color: var(--fm-ink);
  margin-bottom: var(--fm-space-1);
}
.fmcor-closed__route-label::before {
  content: counter(fmcor-closed-route) " / ";
  font-family: var(--fm-font-mono);
  font-size: var(--fm-text-xs);
  color: var(--fm-primary);
}
.fmcor-closed__route-copy {
  display: block;
  font-size: var(--fm-text-sm);
  line-height: var(--fm-leading-normal);
  color: var(--fm-ink-muted);
  max-width: 60ch;
  margin-bottom: var(--fm-space-3);
}
.fmcor-closed__route-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--fm-space-3) var(--fm-space-5);
  align-items: center;
}
.fmcor-closed__route-action {
  display: inline-flex;
  align-items: center;
  min-height: var(--fm-control-min);
  font-family: var(--fm-font-sans);
  font-size: var(--fm-text-sm);
  color: var(--fm-primary);
  text-decoration: underline;
  text-underline-offset: .25em;
}
.fmcor-closed__route-action:hover,
.fmcor-closed__route-action:focus-visible {
  color: var(--fm-primary-hover);
}
.fmcor-closed__route-action.is-pending {
  color: var(--fm-ink-muted);
  cursor: not-allowed;
  opacity: 0.7;
  text-decoration: none;
}
.fmcor-closed__note {
  font-size: var(--fm-text-xs);
  line-height: var(--fm-leading-normal);
  color: var(--fm-ink-muted);
  margin: 0;
  max-width: 62ch;
}
@media (max-width: 40rem) {
  .fmcor-closed {
    padding: var(--fm-space-5) var(--fm-space-4);
  }
}
