/* Receipts (rc-) and the seal (sl-). Colours come from site.css variables; --seal and --butter
   fall back to the brand values until the design sheet defines them. Pastel is public, ink is
   sealed: the wallet bar and the seal disc are the sealed parts of a card. */

/* the builder lays out by the width it is given, not the viewport: the home page puts it in a
   column, a harness or the desk may give it the full row */
.rc-builder { container-type: inline-size; }
.rc-grid { display: grid; gap: 24px; }
@container (min-width: 760px) {
  .rc-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .rc-done { grid-column: 1 / -1; }
}

.rc-form { display: grid; gap: 16px; min-width: 0; }
.rc-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.rc-fieldset legend { font-weight: 600; padding: 0; margin-bottom: 8px; }
.rc-field { display: grid; gap: 6px; }
.rc-field span { font-weight: 600; }
.rc-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 8px 16px; }
.rc-choice { display: inline-flex; align-items: center; gap: 8px; margin-right: 20px; }

.rc-legs-edit { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.rc-leg-edit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4.2em auto 44px;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.rc-builder select,
.rc-builder input[type="text"],
.rc-builder input[type="url"] {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}
.rc-pct { text-align: right; font-family: var(--mono); }
.rc-unit { font-family: var(--mono); color: var(--ink-2); }
.rc-remove { min-height: 44px; width: 44px; padding: 0; justify-content: center; font-size: 20px; line-height: 1; }

.rc-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--butter, #fff0c2);
  color: var(--ink);
}

.rc-preview { min-width: 0; }
.rc-preview > .hint { margin: 0 0 8px; }

.rc-done { padding-top: 8px; border-top: 1px solid var(--line); }
.rc-note { margin: 12px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--paper); color: var(--ink); }
.rc-note[data-state="live"] { background: color-mix(in srgb, var(--m) 18%, var(--paper)); }
.rc-note[data-state="degraded"] { background: var(--butter, #fff0c2); }
.rc-done code { overflow-wrap: anywhere; }
.rc-proof { margin-top: 16px; }
.rc-proof h3 { margin-top: 8px; }

/* ------------------------------------------------------------ the card -- */

.rc-card {
  container-type: inline-size;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--ground);
  color: var(--ink);
}
.rc-card__head { display: flex; align-items: center; gap: 10px; }
.rc-card__mark { display: block; width: auto; height: 26px; }
.rc-card__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(96px, 36%);
  gap: 20px;
  align-items: start;
  margin-top: 16px;
}
.rc-card__title {
  margin: 0 0 12px;
  font-size: clamp(26px, 7cqi, 40px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}
.rc-legs { list-style: none; padding: 0; margin: 0; }
.rc-leg {
  display: grid;
  grid-template-columns: 4.2em minmax(0, 1fr) 3em;
  align-items: center;
  gap: 10px;
  margin: 0;
  min-height: 28px;
  font-family: var(--mono);
  font-size: 14px;
}
.rc-leg--empty { display: block; color: var(--ink-2); font-family: var(--sans); }
.rc-leg__track { display: block; height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
.rc-leg__bar { display: block; height: 100%; min-width: 10px; border-radius: 5px; background: var(--v); }
.rc-leg:nth-child(even) .rc-leg__bar { background: var(--m); }
.rc-leg__bar--sealed,
.rc-leg:nth-child(even) .rc-leg__bar--sealed { width: 100%; background: var(--seal, #3a2c8f); }
.rc-leg__pct { text-align: right; }
.rc-card__meta { margin: 12px 0 0; font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.rc-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
.rc-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  background: var(--butter, #fff0c2);
  color: var(--ink);
}
.rc-badge--post { background: color-mix(in srgb, var(--m) 22%, var(--paper)); }

.rc-card__seal { display: flex; justify-content: center; align-items: center; aspect-ratio: 1; }
.rc-card__seal svg { display: block; width: 100%; height: auto; }
.rc-card__seal--open {
  border-radius: 50%;
  background: var(--seal, #3a2c8f);
  padding: 14%;
  text-align: center;
}
.rc-card__seal-note { color: var(--paper); font-size: 12px; line-height: 1.35; }

@container (max-width: 420px) {
  .rc-card__body { grid-template-columns: minmax(0, 1fr); }
  .rc-card__seal { width: 50%; max-width: 180px; justify-self: center; order: -1; }
  .rc-card__seal--open { width: 60%; }
}

/* ------------------------------------------------------------ the view -- */

.rc-view { display: grid; gap: 16px; }
@media (min-width: 960px) {
  .rc-view { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; column-gap: 32px; }
  .rc-view > .rc-card { grid-row: 1 / span 5; }
}
.rc-lines { margin: 0; padding-left: 1.25em; color: var(--ink-2); }
.rc-fact { margin: 0; }
.rc-fact a { overflow-wrap: anywhere; }

/* ------------------------------------------------------------ the seal -- */

.sl-seal { display: block; max-width: 240px; }
.sl-seal svg { display: block; width: 100%; height: auto; }

@media (max-width: 480px) {
  .rc-card { padding: 16px; }
}
