/* ══════════════════════════════════════════════════════════════
   fRank app pages
   Parts the signed-in form and wizard pages need on top of the kit
   in app_ui.css: breadcrumb, radio option cards, square checks,
   segmented pills, stepper, sticky action bar, key/value rows,
   list rows, meters, stat tiles, disclosure, dialog.
   Authority: docs/design/app-redesign/app-screens-pack.dc.html.

   Same conventions as app_ui.css: theme-aware through the app
   tokens plus the --ui-* values, fr- prefixed, and a doubled class
   wherever a rule has to beat a Tailwind utility (utilities sort
   last in the stylesheet glob).

   Display rules on anything toggled with the `hidden` CLASS stay
   single-class on purpose, so Tailwind's .hidden still wins.

   This file loads BEFORE app_ui.css (alphabetical glob), so a modifier
   on a kit class has to out-specify the kit's doubled selector, not
   just tie it: .fr-input.fr-input.fr-input--sm, never .fr-input.fr-input--sm.
   ══════════════════════════════════════════════════════════════ */

/* ── Breadcrumb ────────────────────────────────────────────── */
.fr-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.fr-crumbs a { color: inherit; text-decoration: none; }
.fr-crumbs a:hover { color: var(--text); }
.fr-crumbs svg { width: 13px; height: 13px; flex: none; }
/* The current page is a user's own title (and may carry the brand
   "fRank"), so it is never forced to caps. */
.fr-crumbs [aria-current="page"] { color: var(--text); text-transform: none; letter-spacing: 0.02em; }

/* A page head whose title sits beside a status badge. */
.fr-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.fr-title-row .fr-h1.fr-h1 { margin-top: 0; }

/* Two columns on desktop: the main list and a settings aside. */
.fr-split { display: grid; gap: 24px; align-items: start; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) {
  .fr-split { grid-template-columns: minmax(0, 1fr) 340px; }
}

/* ── Card parts ────────────────────────────────────────────── */
/* Muted count beside a bar title ("Snapshots · 4"). */
.fr-card .fr-card__bar .fr-card__count { font-size: 10.5px; color: rgba(250, 220, 194, 0.68); }
/* Second-level strip under the bar, or a group heading inside a flush card. */
.fr-card .fr-card__sub {
  padding: 8px 22px;
  background: var(--surface-2);
  border-bottom: 2px solid var(--ui-line);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.fr-card .fr-card__foot {
  padding: 10px 22px;
  border-top: 2px solid var(--ui-line);
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--text-muted);
}
/* Yellow Clash caps heading inside a card (no rule, unlike .fr-section-label). */
.fr-card-label.fr-card-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ui-label);
  margin: 0;
}

/* A row in a flush card's list. */
.fr-listrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--ui-line);
}
.fr-listrow:last-child { border-bottom: 0; }
.fr-listrow:hover { background: var(--ui-hov); }
.fr-listrow .fr-listrow__main { flex: 1 1 220px; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.fr-listrow .fr-listrow__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fr-listrow .fr-listrow__title { font-weight: 600; font-size: 14px; line-height: 1.25; color: var(--text); }
@media (max-width: 480px) {
  .fr-listrow { padding: 12px 16px; }
  .fr-card .fr-card__bar,
  .fr-card .fr-card__sub,
  .fr-card .fr-card__foot { padding-left: 16px; padding-right: 16px; }
}

/* Small pill action inside a row (View, Copy link, Publish). */
.fr-pill-btn.fr-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 11px;
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--ui-line2);
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}
.fr-pill-btn.fr-pill-btn:hover { border-color: var(--ui-ol); color: var(--text); }
.fr-pill-btn.fr-pill-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fr-pill-btn.fr-pill-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.fr-pill-btn.fr-pill-btn--primary,
.fr-pill-btn.fr-pill-btn--primary:hover {
  background: var(--ui-pink);
  color: var(--ui-on-pink);
  border-color: var(--ui-charcoal);
}
.fr-pill-btn.fr-pill-btn--danger,
.fr-pill-btn.fr-pill-btn--danger:hover { color: var(--red); border-color: var(--red); }
.fr-pill-btn.fr-pill-btn--quiet { border-color: transparent; color: var(--text-muted); }
.fr-pill-btn.fr-pill-btn--quiet:hover { border-color: transparent; background: var(--ui-hov); color: var(--text); }
.fr-pill-btn.fr-pill-btn[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--ui-ol); }
.fr-pill-btn.fr-pill-btn svg { width: 14px; height: 14px; flex: none; }

/* Round icon action inside a row (edit, delete, copy). */
.fr-listrow-icon.fr-listrow-icon {
  width: 32px;
  height: 32px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 120ms ease, background-color 120ms ease;
}
.fr-listrow-icon.fr-listrow-icon:hover { color: var(--text); background: var(--ui-hov); }
.fr-listrow-icon.fr-listrow-icon--danger:hover { color: var(--red); }
.fr-listrow-icon.fr-listrow-icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Dashed-outline badge for a not-yet-final state. */
.fr-badge.fr-badge.fr-badge--dashed { background: transparent; border-style: dashed; border-color: var(--ui-ol); color: var(--text); }

/* Position pill: this sets the shape; the bg-pos-* / text-pos-* token
   utilities on the same element set the colour. */
.fr-pospill {
  flex: none;
  display: inline-block;
  min-width: 34px;
  padding: 3px 6px;
  border: 1.5px solid var(--ui-charcoal);
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 9.5px;
  line-height: 1;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}
html[data-theme="dark"] .fr-pospill { border-color: transparent; }

/* Initials roundel (brand, member). */
.fr-avatar {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ui-pink);
  color: var(--ui-on-pink);
  border: 2px solid var(--ui-charcoal);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
}
.fr-avatar.fr-avatar--muted { background: var(--surface-2); color: var(--text); border-color: var(--ui-line2); }
.fr-avatar.fr-avatar--sm { width: 34px; height: 34px; font-size: 11px; }
.fr-avatar.fr-avatar--lg { width: 60px; height: 60px; font-size: 20px; box-shadow: 3px 3px 0 var(--ui-sh); }

/* ── Key / value rows ──────────────────────────────────────── */
.fr-kv { display: flex; flex-direction: column; margin: 0; }
.fr-kv .fr-kv__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--ui-line);
}
.fr-kv .fr-kv__row:last-child { border-bottom: 0; padding-bottom: 0; }
.fr-kv .fr-kv__row:first-child { padding-top: 0; }
.fr-kv dt,
.fr-kv .fr-kv__key {
  flex: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.fr-kv dd,
.fr-kv .fr-kv__val { margin: 0; font-size: 14px; font-weight: 600; color: var(--text); text-align: right; min-width: 0; }

/* ── Stat tiles ────────────────────────────────────────────── */
.fr-stat {
  background: var(--surface);
  border: 2px solid var(--ui-line2);
  padding: 12px 14px;
}
.fr-stat .fr-stat__num {
  font-family: var(--font-headline);
  font-weight: 500;
  font-size: 28px;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.fr-stat .fr-stat__label {
  margin-top: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.fr-stat.fr-stat--sm { padding: 8px 10px; text-align: center; }
.fr-stat.fr-stat--sm .fr-stat__num { font-size: 20px; }
.fr-stat.fr-stat--sm .fr-stat__label { margin-top: 0; margin-bottom: 4px; }

/* ── Meter ─────────────────────────────────────────────────── */
.fr-meter {
  height: 9px;
  border: 1.5px solid var(--ui-line2);
  border-radius: 999px;
  background: var(--ui-field);
  overflow: hidden;
}
.fr-meter .fr-meter__fill { height: 100%; border-radius: 999px; background: var(--ui-green); }
.fr-meter .fr-meter__fill--mid { background: var(--ui-yellow); }
.fr-meter .fr-meter__fill--low { background: var(--ui-red); }

/* ── Notices ───────────────────────────────────────────────── */
.fr-notice.fr-notice.fr-notice--warn { border-left: 8px solid var(--ui-yellow); }
.fr-notice.fr-notice.fr-notice--info { border-left: 8px solid var(--ui-blue); }
/* Supporting copy under a notice's lead line. */
.fr-notice .fr-notice__body { margin: 4px 0 0; font-weight: 500; font-size: 13.5px; line-height: 1.5; color: var(--text-muted); }
.fr-notice .fr-notice__body strong,
.fr-notice .fr-notice__body b { color: var(--text); font-weight: 600; }
.fr-notice ul { margin: 0; padding: 0; list-style: none; }

/* ── Radio option cards ────────────────────────────────────── */
.fr-option.fr-option {
  display: block;
  background: var(--surface);
  border: 2px solid var(--ui-line2);
  border-radius: 0;
  color: var(--text);
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}
.fr-option.fr-option:hover { border-color: var(--ui-ol); }
.fr-option.fr-option:has(.fr-option__radio:checked) {
  background: var(--surface);
  border-color: var(--ui-ol);
  box-shadow: 4px 4px 0 var(--ui-sh);
}
.fr-option.fr-option:has(.fr-option__radio:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.fr-option .fr-option__head { display: flex; align-items: flex-start; gap: 12px; padding: 16px; cursor: pointer; }
.fr-option .fr-option__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.fr-option .fr-option__title {
  font-family: var(--font-headline);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.05;
  color: var(--text);
  margin: 0;
}
.fr-option .fr-option__desc { font-size: 13px; line-height: 1.45; color: var(--text-muted); margin: 0; }
.fr-option .fr-option__icon { flex: none; color: var(--text-muted); margin-top: 1px; }
.fr-option .fr-option__icon svg { width: 20px; height: 20px; }
/* The radio dot. Selection is read from the real input, so it needs no JS;
   the doubled class outranks the utilities preset-select toggles on it. */
.fr-option .fr-option__dot.fr-option__dot {
  flex: none;
  position: relative;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 2px solid var(--ui-ol);
  border-radius: 50%;
  background: transparent;
}
.fr-option .fr-option__dot svg { display: none; }
.fr-option:has(.fr-option__radio:checked) .fr-option__dot.fr-option__dot {
  background: var(--ui-pink);
  border-color: var(--ui-charcoal);
}
.fr-option:has(.fr-option__radio:checked) .fr-option__dot::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--ui-charcoal);
}
/* Detail fields shown under the selected option. */
.fr-option .fr-option__more {
  padding: 16px;
  border-top: 2px solid var(--ui-line);
  background: var(--surface-2);
  flex-direction: column;
  gap: 16px;
}
.fr-option .fr-option__more:not(.hidden) { display: flex; }
.fr-option.fr-option--off { border-style: dashed; cursor: default; }
.fr-option.fr-option--off:hover { border-color: var(--ui-line2); }
.fr-option.fr-option--off .fr-option__title,
.fr-option.fr-option--off .fr-option__desc { opacity: 0.6; }
.fr-option .fr-option__state {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.fr-option .fr-option__state--ok { color: var(--green); }
.fr-option-grid { display: grid; gap: 14px; }

/* ── Square checks and round radios ────────────────────────── */
.fr-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  line-height: 1.3;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.fr-check:has(:disabled) { opacity: 0.5; cursor: not-allowed; }
.fr-check.fr-check--top { align-items: flex-start; }
.fr-check-row { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.fr-check__box.fr-check__box {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  border: 2px solid var(--ui-ol);
  border-radius: 0;
  background-color: var(--ui-field);
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
  transition: background-color 120ms ease, box-shadow 120ms ease;
}
.fr-check__box.fr-check__box[type="radio"] { border-radius: 50%; }
.fr-check__box.fr-check__box:checked {
  background-color: var(--ui-pink);
  border-color: var(--ui-charcoal);
  box-shadow: 2px 2px 0 var(--ui-sh);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f141d' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  background-size: 14px 14px;
}
.fr-check__box.fr-check__box[type="radio"]:checked {
  background-image: radial-gradient(circle, var(--ui-charcoal) 0 4px, transparent 4.5px);
  background-size: 100% 100%;
}
.fr-check__box.fr-check__box:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.fr-check__box.fr-check__box:disabled { cursor: not-allowed; }

/* Legend + "All" toggle above a group of checks. */
.fr-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.fr-group-head .fr-label { float: none; padding: 0; }
fieldset > .fr-label { margin-bottom: 10px; padding: 0; }

/* ── Segmented pill (tabs / variant toggle) ────────────────── */
.fr-seg {
  display: inline-flex;
  padding: 2px;
  border: 2px solid var(--ui-ol);
  border-radius: 999px;
  background: var(--surface);
}
.fr-seg .fr-seg__btn.fr-seg__btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10.5px;
  line-height: 1;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 7px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.fr-seg .fr-seg__btn.fr-seg__btn:hover { color: var(--text); }
.fr-seg .fr-seg__btn.fr-seg__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* snapshot-preview marks the active variant by toggling .text-accent, and
   that controller is not ours to change, so the class is the state hook. */
.fr-seg .fr-seg__btn.fr-seg__btn.text-accent,
.fr-seg .fr-seg__btn.fr-seg__btn[aria-pressed="true"] { background: var(--text); color: var(--bg); }

/* Tab strip in a card's charcoal bar. */
.fr-card .fr-card__bar.fr-card__bar--tabs { padding: 0 8px 0 0; gap: 0; align-items: stretch; flex-wrap: wrap; }
.fr-bar-tabs { display: flex; flex: 1 1 auto; min-width: 0; overflow-x: auto; }
.fr-bar-tabs .fr-bar-tabs__tab.fr-bar-tabs__tab {
  position: relative;
  flex: none;
  padding: 13px 14px;
  border: 0;
  background: transparent;
  color: rgba(250, 220, 194, 0.68);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  white-space: nowrap;
  cursor: pointer;
}
.fr-bar-tabs .fr-bar-tabs__tab.fr-bar-tabs__tab:hover,
.fr-bar-tabs .fr-bar-tabs__tab.fr-bar-tabs__tab[aria-selected="true"] { color: var(--shell-cream); }
.fr-bar-tabs .fr-bar-tabs__tab.fr-bar-tabs__tab:focus-visible { outline: 2px solid var(--shell-yellow); outline-offset: -3px; }
.fr-bar-tabs .fr-bar-tabs__tab > span { color: inherit; }
.fr-bar-tabs .fr-bar-tabs__ind.fr-bar-tabs__ind { height: 4px; background: var(--ui-pink); }
.fr-card .fr-card__bar--tabs .fr-card__bar-aside { display: flex; align-items: center; padding: 6px 0 6px 8px; }
.fr-card .fr-card__bar--tabs .fr-seg { border-color: var(--shell-cream); background: transparent; }
.fr-card .fr-card__bar--tabs .fr-seg .fr-seg__btn.fr-seg__btn { color: rgba(250, 220, 194, 0.72); }
.fr-card .fr-card__bar--tabs .fr-seg .fr-seg__btn.fr-seg__btn.text-accent { background: var(--shell-cream); color: #30202d; }

/* Depth tiles: a row of big-number radio choices. */
.fr-tiles.fr-tiles {
  display: flex;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 2px solid var(--ui-line2);
  border-radius: 0;
  background: var(--ui-field);
  overflow: hidden;
}
.fr-tiles .fr-tiles__tile.fr-tiles__tile {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 9px 6px;
  border-left: 2px solid var(--ui-line2);
  color: var(--text-muted);
  cursor: pointer;
}
.fr-tiles .fr-tiles__tile.fr-tiles__tile:first-of-type { border-left: 0; }
.fr-tiles .fr-tiles__tile.fr-tiles__tile:hover { color: var(--text); background: var(--ui-hov); }
.fr-tiles .fr-tiles__tile.fr-tiles__tile:has(:checked) { background: var(--ui-pink); color: var(--ui-on-pink); }
.fr-tiles .fr-tiles__tile.fr-tiles__tile:has(:checked) * { color: inherit; opacity: 1; }
.fr-tiles .fr-tiles__tile.fr-tiles__tile:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: -4px; }

/* ── Stepper ───────────────────────────────────────────────── */
.fr-stepper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.fr-stepper .fr-step { display: flex; align-items: center; gap: 9px; }
.fr-stepper .fr-step__num {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--ui-line2);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.fr-stepper .fr-step__num svg { width: 15px; height: 15px; }
.fr-stepper .fr-step__label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-muted);
}
.fr-stepper .fr-step--done .fr-step__num {
  background: var(--ui-green);
  border-color: var(--ui-charcoal);
  color: var(--ui-cream);
}
.fr-stepper .fr-step--active .fr-step__num {
  background: var(--ui-pink);
  border-color: var(--ui-charcoal);
  box-shadow: 2px 2px 0 var(--ui-sh);
  color: var(--ui-on-pink);
}
.fr-stepper .fr-step--active .fr-step__label { color: var(--text); }
.fr-stepper .fr-stepper__rule { flex: 1 1 12px; max-width: 48px; min-width: 12px; height: 2px; background: var(--ui-line2); }
@media (max-width: 560px) {
  .fr-stepper .fr-step:not(.fr-step--active) .fr-step__label {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
}

/* A status line with its action (the wizard's "what's next" card). */
.fr-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
}
.fr-status .fr-status__text { flex: 1 1 240px; min-width: 0; font-size: 14.5px; line-height: 1.5; color: var(--text-muted); margin: 0; }
.fr-status .fr-status__title { font-weight: 600; color: var(--text); }
.fr-status .fr-status__spinner { flex: none; width: 18px; height: 18px; color: var(--accent); }

/* ── Sticky action bar ─────────────────────────────────────── */
/* Sits at the foot of the scrolling <main>, which carries 32px of bottom
   padding (py-8). A sticky box is held inside that padding, so both the
   offset and the margin are pulled out by the same 32px to rest the bar
   flush on the edge, stuck or at the end of the page. */
.fr-actionbar {
  position: sticky;
  bottom: -32px;
  z-index: 5;
  margin-bottom: -32px;
  background: var(--surface-2);
  border-top: 2px solid var(--ui-edge);
}
.fr-actionbar .fr-actionbar__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px clamp(18px, 4vw, 56px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 14px;
}
.fr-actionbar .fr-actionbar__note { flex: 1 1 160px; font-size: 13.5px; color: var(--text-muted); margin: 0; }
/* A page that ends in an action bar does not need the page's own tail. */
.fr-page.fr-page--bar { padding-bottom: 28px; }
/* In-flow action row at the foot of a form. */
.fr-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-top: 22px;
  border-top: 2px solid var(--ui-line);
}

/* ── Disclosure ────────────────────────────────────────────── */
.fr-disclosure.fr-disclosure {
  background: var(--surface);
  border: 2px solid var(--ui-line2);
  border-radius: 0;
  color: var(--text);
}
.fr-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.fr-disclosure > summary::-webkit-details-marker { display: none; }
.fr-disclosure > summary:hover { background: var(--ui-hov); }
.fr-disclosure > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fr-disclosure .fr-disclosure__body { padding: 14px 16px 16px; border-top: 2px solid var(--ui-line); }
.fr-disclosure .fr-disclosure__body--flush { padding: 0; }

/* ── Dialog ────────────────────────────────────────────────── */
.fr-dialog.fr-dialog {
  margin: auto;
  width: calc(100% - 32px);
  max-width: 400px;
  padding: 22px;
  background: var(--surface);
  background-image: var(--ui-paper);
  color: var(--text);
  border: 2px solid var(--ui-edge);
  border-radius: 0;
  box-shadow: 5px 5px 0 var(--ui-sh);
}
.fr-dialog.fr-dialog::backdrop { background: rgba(13, 7, 12, 0.6); }
.fr-dialog .fr-dialog__body { font-size: 14px; line-height: 1.5; color: var(--text-muted); margin: 12px 0 0; }
.fr-dialog .fr-dialog__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ── Field extras ──────────────────────────────────────────── */
/* A select with its own chevron (wrap the select and the svg). */
.fr-select-wrap { position: relative; display: flex; }
.fr-select-wrap .fr-select.fr-select { appearance: none; -webkit-appearance: none; padding-right: 44px; cursor: pointer; }
.fr-select-wrap > svg {
  position: absolute;
  right: 16px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  pointer-events: none;
  color: var(--text-muted);
}
.fr-input.fr-input.fr-input--sm,
.fr-select.fr-select.fr-select--sm { min-height: 38px; padding-top: 7px; padding-bottom: 7px; font-size: 14px; }
.fr-textarea.fr-textarea.fr-textarea--mono { font-family: var(--font-data, ui-monospace, monospace); font-size: 13px; }
.fr-file.fr-file { display: block; width: 100%; font-family: var(--font); font-size: 13px; color: var(--text-muted); cursor: pointer; }
.fr-file.fr-file::file-selector-button {
  margin-right: 12px;
  height: 34px;
  padding: 0 14px;
  background: transparent;
  color: var(--text);
  border: 2px solid var(--ui-ol);
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
/* A survey question: a full sentence, so it reads as body copy rather than
   as a Clash caps field label. */
.fr-question.fr-question { display: block; padding: 0; font-size: 15.5px; font-weight: 600; line-height: 1.35; color: var(--text); }
fieldset > .fr-question { margin-bottom: 6px; }
/* Required marker beside a label. */
.fr-req { color: var(--accent); text-decoration: none; }
/* Sample-data table inside a card: tighter than .fr-table. */
.fr-table.fr-table.fr-table--tight thead th { padding: 9px 14px; }
.fr-table.fr-table.fr-table--tight tbody td { padding: 8px 14px; font-size: 13px; white-space: nowrap; color: var(--text-muted); }
/* A mapping row: label on the left, control on the right. */
.fr-map-row { display: grid; gap: 8px 16px; padding: 14px 22px; border-bottom: 1px solid var(--ui-line); }
.fr-map-row:last-child { border-bottom: 0; }
@media (min-width: 640px) {
  .fr-map-row { grid-template-columns: 170px minmax(0, 1fr); align-items: start; }
  .fr-map-row > .fr-label { padding-top: 14px; }
}
@media (max-width: 480px) { .fr-map-row { padding: 14px 16px; } }

/* ── Import match rows ─────────────────────────────────────── */
.fr-rank-num {
  flex: none;
  min-width: 30px;
  font-family: var(--font-data, ui-monospace, monospace);
  font-weight: 600;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--text-muted);
}
/* import-match-search replaces this pill's whole className when a player is
   picked, so its shape hangs off the target attribute and survives that. */
[data-import-match-search-target="pill"][data-import-match-search-target] {
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border: 2px solid var(--ui-charcoal);
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
[data-import-match-search-target="pill"].bg-green-bg { background: var(--ui-green); color: var(--ui-cream); }
/* Skip toggle: a pill that goes red when its hidden checkbox is on. */
.fr-pill-btn.fr-pill-btn:has(input:checked) { background: var(--ui-red); border-color: var(--ui-charcoal); color: #fff; }
.fr-pill-btn.fr-pill-btn:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Typeahead results under a match row's search box. */
.fr-results.fr-results {
  border: 2px solid var(--ui-edge);
  border-radius: 0;
  background: var(--surface);
  box-shadow: 4px 4px 0 var(--ui-sh);
}

/* ── Tag swatch ────────────────────────────────────────────── */
.fr-swatch { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--ui-charcoal); }
html[data-theme="dark"] .fr-swatch { border-color: var(--ui-line2); }

@media (prefers-reduced-motion: reduce) {
  .fr-option.fr-option,
  .fr-pill-btn.fr-pill-btn,
  .fr-check__box.fr-check__box { transition: none; }
}
