/* ===========================================================================
   RefrigiWear UI — component kit v3 (no-build)  ·  ENG-484, 2026-09-13
   Plain CSS on rfw-tokens.css. Light and dark come from the tokens; nothing in
   this file knows which theme it is in. Vocabulary borrowed from the two systems
   our users already know — Jira (Atlassian) and the Microsoft 365 admin center
   (Fluent 2) — re-expressed in RefrigiWear tokens:

     shell      .rfw-topbar (navy / neutral), .rfw-nav (page-coloured side nav),
                .rfw-topbar__search, app launcher + theme button from the worker
     headings   .rfw-h1 page title 28/600 · .rfw-h2 24/600 · .rfw-section 16/600
                with a chevron (Jira "Key details") · .rfw-kicker = 12/600 caption
     data       .rfw-card (flat, 1px stroke, 8px) · .rfw-stat (M365 KPI tile) ·
                .rfw-progress · .rfw-kv (Jira details list) · .rfw-table
     status     .rfw-pill (lozenge / badge) · .rfw-banner (message bar) ·
                .rfw-toast (top-right notification) · .rfw-chip (filter pill)
     controls   .rfw-btn (primary / secondary / subtle / gold / danger) ·
                .rfw-input .rfw-select .rfw-label · .rfw-switch · .rfw-tabs ·
                .rfw-crumbs · .rfw-menu · .rfw-dialog · .rfw-tip · .rfw-kbd
     states     .rfw-empty · .rfw-skeleton · .rfw-disclosure · .rfw-mask
     moments    (v3.1) .rfw-answer · .rfw-flow · .rfw-facts · .rfw-reassure ·
                .rfw-setting · .rfw-done · .rfw-changed · .rfw-empty--clear + .rfw-reggie

   Type is the Microsoft standard (Segoe UI, Fluent ramp). Sentence case; no
   uppercase tracking, no mono labels, no accent ticks, no text-shadow. Requires
   Tabler icons for the <i class="ti ti-*"> glyphs used in examples.

   v3.1 (ENG-705): page titles, KPI numbers and the wordmark are set in the brand's
   display face (--rfw-display, Roboto Condensed 700); nothing else is. The top bar is
   navy in both themes with a 2px gold trim. The moments above were proven in
   inventory control and promoted here so every app gets them.
   =========================================================================== */

.rfw {
  font-family: var(--rfw-sys); font-size: var(--rfw-fs-body); line-height: var(--rfw-lh-body);
  background: var(--rfw-bg); color: var(--rfw-ink);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.rfw *, .rfw *::before, .rfw *::after { box-sizing: border-box; }
/* Bare links are brand blue. :where() keeps this at zero class specificity so any
   component rendered as an <a> (.rfw-btn, .rfw-nav__link, .rfw-card, .rfw-chip …)
   keeps its own colour — found on Finance, where <a class="rfw-btn"> went blue-on-blue. */
:where(.rfw) a { color: var(--rfw-brand-ink); text-decoration: none; }
:where(.rfw) a:hover { text-decoration: underline; }
.rfw-num  { font-family: var(--rfw-font-num); font-variant-numeric: tabular-nums lining-nums; }
.rfw-mono { font-family: var(--rfw-mono); font-size: 13px; }
.rfw-muted { color: var(--rfw-muted); }
.rfw-caption { font-size: var(--rfw-fs-caption); line-height: var(--rfw-lh-caption); color: var(--rfw-muted); }

/* ---- app shell ---------------------------------------------------------- */
.rfw-topbar {
  display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 12px 0 8px; box-sizing: border-box;
  background: var(--rfw-chrome); color: var(--rfw-chrome-ink);
  border-bottom: 2px solid var(--rfw-trim, var(--rfw-chrome-line));   /* v3.1 D3: the gold trim */
  position: sticky; top: 0; z-index: 30;
  font-family: var(--rfw-sys);
}
/* The wordmark is set in the display face (D1); the app name after it (.sub) stays in the
   UI face, so "RefrigiWear" reads as the brand and the app name reads as a label. */
.rfw-brand { display: flex; align-items: center; gap: 10px; font-family: var(--rfw-display); font-weight: var(--rfw-fw-display); font-size: var(--rfw-fs-wordmark); line-height: var(--rfw-lh-wordmark); color: inherit; text-decoration: none; padding: 0 6px; }
.rfw-brand:hover { text-decoration: none; }
.rfw-brand i { font-size: 22px; color: var(--rfw-gold); }
/* The registered mark (brand standards §7: ® with the name every time). Inside
   <span class="rfw-brand__word">RefrigiWear<sup>®</sup></span> it is plain inline superscript.
   A bare <sup> straight inside .rfw-brand is a flex item of its own, so the gap would push it
   away and vertical-align would not apply: pull it back to the word and up to cap height. */
.rfw-brand__word { white-space: nowrap; }
.rfw-brand sup { font-size: 9px; line-height: 0; font-weight: 600; vertical-align: 9px; margin-left: 1px; }
.rfw-brand > sup { margin-left: -9px; position: relative; top: -6px; vertical-align: baseline; }
.rfw-brand__mark { height: 28px; width: auto; display: block; }
.rfw-brand .sub { font-family: var(--rfw-sys); font-weight: 400; color: var(--rfw-chrome-muted); font-size: 14px; line-height: 20px; }
.rfw-topbar__search {
  display: flex; align-items: center; gap: 8px; flex: 0 1 420px; margin: 0 auto;
  height: 32px; padding: 0 10px; border-radius: var(--rfw-r-sm);
  background: var(--rfw-chrome-2); border: 1px solid var(--rfw-chrome-line); color: var(--rfw-chrome-ink);
}
.rfw-topbar__search i { color: var(--rfw-chrome-muted); font-size: 18px; }
.rfw-topbar__search input {
  flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: inherit;
  font: inherit; font-size: 14px;
}
.rfw-topbar__search input::placeholder { color: var(--rfw-chrome-muted); }
.rfw-topbar__search:focus-within { border-color: var(--rfw-gold); }
.rfw-topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.rfw-topbar .status { margin-left: auto; display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--rfw-chrome-muted); }
/* icon buttons on the chrome (notifications, help, theme, launcher share this) */
.rfw-topbar__btn {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border-radius: var(--rfw-r-sm); border: 1px solid transparent; background: transparent; color: inherit;
  cursor: pointer; padding: 0; position: relative;
}
.rfw-topbar__btn:hover { background: var(--rfw-chrome-2); }
.rfw-topbar__btn i { font-size: 20px; }
.rfw-topbar__btn .rfw-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--rfw-crit); border: 2px solid var(--rfw-chrome); }

.rfw-layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 52px); }
.rfw-nav {
  background: var(--rfw-nav-bg); border-right: 1px solid var(--rfw-nav-line);
  padding: 12px 8px; overflow: auto; color: var(--rfw-nav-ink);
  position: sticky; top: 52px; align-self: start; max-height: calc(100vh - 52px);
}
.rfw-nav__group { font-size: var(--rfw-fs-caption); line-height: var(--rfw-lh-caption); font-weight: 600; color: var(--rfw-nav-muted); margin: 16px 12px 6px; }
.rfw-nav__group:first-child { margin-top: 4px; }
.rfw-nav__link {
  display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 6px 12px 6px 10px;
  border-radius: var(--rfw-r-sm); color: var(--rfw-nav-ink); text-decoration: none; cursor: pointer;
  font-size: 14px; line-height: 20px; font-weight: 400; margin-bottom: 2px; position: relative;
  transition: background var(--rfw-dur) var(--rfw-ease);
}
.rfw-nav__link i { font-size: 20px; color: var(--rfw-nav-muted); flex-shrink: 0; }
.rfw-nav__link:hover { background: var(--rfw-nav-hover); text-decoration: none; }
.rfw-nav__link--active, .rfw-nav__link[aria-current="page"] { background: var(--rfw-nav-active-bg); color: var(--rfw-nav-active-ink); font-weight: 600; }
.rfw-nav__link--active::before, .rfw-nav__link[aria-current="page"]::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--rfw-nav-active-bar);
}
.rfw-nav__link--active i, .rfw-nav__link[aria-current="page"] i { color: var(--rfw-nav-active-ink); }
.rfw-nav__badge { margin-left: auto; font-size: 12px; line-height: 16px; font-weight: 600; padding: 1px 7px; border-radius: var(--rfw-r-pill); background: var(--rfw-idle-50); color: var(--rfw-idle-ink); font-variant-numeric: tabular-nums; }
.rfw-nav__badge--crit { background: var(--rfw-crit-50); color: var(--rfw-crit-ink); }
.rfw-nav__badge--brand { background: var(--rfw-brand-50); color: var(--rfw-brand-ink); }
.rfw-nav__chev { margin-left: auto; font-size: 16px; color: var(--rfw-nav-muted); transition: transform var(--rfw-dur) var(--rfw-ease); }
.rfw-nav__link[aria-expanded="true"] .rfw-nav__chev { transform: rotate(180deg); }
.rfw-main { padding: 20px 24px 40px; overflow: auto; min-width: 0; }
/* One column below 800px: the nav stacks above the page. The layout keeps its min-height, and a grid
   shares spare height between its rows, so on a short page the nav's row grew past the nav and left an
   empty band above the content (ENG-710: found on Admin; Agent Studio and Finance showed it too).
   align-content: start keeps each row to its content; the spare height goes below the page. */
@media (max-width: 800px) { .rfw-layout { grid-template-columns: 1fr; align-content: start; } .rfw-nav { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--rfw-nav-line); } }

/* ---- page header + headings --------------------------------------------- */
.rfw-page { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 20px; flex-wrap: wrap; }
.rfw-page__title, .rfw-h1 { font-family: var(--rfw-display); font-size: var(--rfw-fs-page); line-height: var(--rfw-lh-page); font-weight: var(--rfw-fw-display); margin: 0; letter-spacing: 0; display: flex; align-items: center; gap: 10px; }
.rfw-h2 { font-size: var(--rfw-fs-title); line-height: var(--rfw-lh-title); font-weight: 600; margin: 0 0 16px; display: flex; align-items: center; gap: 10px; letter-spacing: 0; }
.rfw-h2 i, .rfw-h1 i, .rfw-page__title i { color: var(--rfw-muted); font-size: 1em; }
.rfw-h3 { font-size: var(--rfw-fs-subtitle); line-height: var(--rfw-lh-subtitle); font-weight: 600; margin: 0 0 12px; }
.rfw-page__lede { font-size: 14px; color: var(--rfw-muted); margin: 4px 0 0; max-width: 78ch; }
.rfw-page__actions { display: flex; align-items: center; gap: 8px; }

/* Section title — Jira's "Key details / Activity / SLAs": 16/600 with a chevron. As a
   <details> it collapses; as a plain div it is just the heading. */
.rfw-section { margin: 0 0 16px; }
.rfw-section > summary, .rfw-section__title {
  display: flex; align-items: center; gap: 6px; list-style: none; cursor: default;
  font-size: var(--rfw-fs-body-lg); line-height: var(--rfw-lh-body-lg); font-weight: 600; color: var(--rfw-ink);
  margin: 0 0 10px; padding: 2px 0; user-select: none;
}
.rfw-section > summary { cursor: pointer; border-radius: var(--rfw-r-sm); }
.rfw-section > summary::-webkit-details-marker { display: none; }
.rfw-section > summary::before, .rfw-section__title--toggle::before {
  content: ""; width: 8px; height: 8px; margin: 0 6px 0 2px; border-right: 2px solid var(--rfw-muted); border-bottom: 2px solid var(--rfw-muted);
  transform: rotate(45deg) translateY(-2px); transition: transform var(--rfw-dur) var(--rfw-ease); flex-shrink: 0;
}
.rfw-section:not([open]) > summary::before { transform: rotate(-45deg) translateX(-2px); }
.rfw-section > summary:hover { color: var(--rfw-brand-ink); }
.rfw-section__count { font-weight: 400; color: var(--rfw-muted); font-size: 14px; margin-left: 2px; }
.rfw-section__actions { margin-left: auto; display: flex; gap: 6px; font-weight: 400; font-size: 14px; }

/* Kicker (back-compat): now a plain caption label — 12/600, sentence case, no tick. */
.rfw-kicker { display: block; font-size: var(--rfw-fs-caption); line-height: var(--rfw-lh-caption); font-weight: 600; color: var(--rfw-muted); letter-spacing: 0; text-transform: none; margin: 0 0 8px; }
.rfw-kicker::first-letter { text-transform: uppercase; }
.rfw-kicker i { font-size: 14px; vertical-align: -2px; margin-right: 4px; color: var(--rfw-muted); }

/* ---- cards + grids ------------------------------------------------------ */
.rfw-card {
  background: var(--rfw-surface); border: 1px solid var(--rfw-line); border-radius: var(--rfw-r);
  padding: 16px 20px; margin-bottom: 16px; box-shadow: var(--rfw-elev-1);
}
.rfw-card--tight { padding: 12px 16px; }
.rfw-card__head { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.rfw-card__title { font-size: var(--rfw-fs-body-lg); line-height: var(--rfw-lh-body-lg); font-weight: 600; margin: 0; }
.rfw-card__head .rfw-kicker { margin: 0; }
.rfw-card__actions { margin-left: auto; display: flex; gap: 6px; }
.rfw-card__foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rfw-line); display: flex; gap: 8px; align-items: center; }
a.rfw-card, .rfw-card--interactive { transition: border-color var(--rfw-dur) var(--rfw-ease), background var(--rfw-dur) var(--rfw-ease); color: inherit; display: block; }
a.rfw-card:hover, .rfw-card--interactive:hover { border-color: var(--rfw-line-2); background: var(--rfw-surface-2); text-decoration: none; }
.rfw-grid { display: grid; gap: var(--rfw-gap); }
.rfw-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rfw-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rfw-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rfw-grid > .rfw-card { margin-bottom: 0; }
@media (max-width: 1100px) { .rfw-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .rfw-grid--2, .rfw-grid--3, .rfw-grid--4 { grid-template-columns: 1fr; } }

/* ---- KPI / stat tile (M365 "Your organization at a glance") -------------- */
.rfw-stat__label { font-size: 14px; line-height: 20px; color: var(--rfw-ink-2); margin: 0 0 4px; font-weight: 400; }
.rfw-stat__row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.rfw-stat__value { font-family: var(--rfw-display); font-variant-numeric: tabular-nums lining-nums; font-size: var(--rfw-fs-kpi); line-height: var(--rfw-lh-kpi); font-weight: var(--rfw-fw-display); letter-spacing: 0; }
.rfw-stat__value--accent { color: var(--rfw-brand-ink); }
.rfw-stat__value--ok   { color: var(--rfw-ok-ink); }
.rfw-stat__value--warn { color: var(--rfw-warn-ink); }
.rfw-stat__value--crit { color: var(--rfw-crit-ink); }
.rfw-stat__delta { font-size: 12px; line-height: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rfw-stat__delta--up { color: var(--rfw-ok-ink); }
.rfw-stat__delta--down { color: var(--rfw-crit-ink); }
.rfw-stat__sub { font-size: 12px; line-height: 16px; color: var(--rfw-muted); margin-top: 4px; }
.rfw-stat__spark { margin-top: 10px; display: block; width: 100%; height: 28px; }
.rfw-stat__rows { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.rfw-stat__item { font-size: 14px; line-height: 20px; }
.rfw-stat__item-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.rfw-stat__item-head b { font-weight: 400; color: var(--rfw-muted); font-variant-numeric: tabular-nums; }

/* ---- progress bar (M365 license usage) ---------------------------------- */
.rfw-progress { display: block; width: 100%; height: 4px; border-radius: var(--rfw-r-pill); background: var(--rfw-inset); overflow: hidden; }
.rfw-progress > span { display: block; height: 100%; border-radius: inherit; background: var(--rfw-brand); min-width: 2px; }
.rfw-progress--ok > span   { background: var(--rfw-ok); }
.rfw-progress--warn > span { background: var(--rfw-warn); }
.rfw-progress--crit > span { background: var(--rfw-crit); }
.rfw-progress--gold > span { background: var(--rfw-gold); }
.rfw-progress--lg { height: 8px; }

/* ---- key-value details (Jira "Details" panel) --------------------------- */
.rfw-kv { display: grid; grid-template-columns: minmax(120px, 160px) 1fr; gap: 10px 16px; margin: 0; font-size: 14px; line-height: 20px; }
.rfw-kv dt { color: var(--rfw-muted); font-weight: 400; margin: 0; }
.rfw-kv dd { margin: 0; color: var(--rfw-ink); min-width: 0; overflow-wrap: anywhere; }
.rfw-kv--tight { gap: 6px 12px; }

/* ---- lozenge / badge (Jira lozenge, Fluent tint badge) ------------------- */
.rfw-pill {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 16px; font-weight: 600;
  padding: 2px 8px; border-radius: var(--rfw-r-sm); border: 1px solid transparent;
  background: var(--rfw-idle-50); color: var(--rfw-idle-ink); white-space: nowrap; vertical-align: middle;
}
.rfw-pill i { font-size: 14px; }
.rfw-pill--ok     { background: var(--rfw-ok-50);    color: var(--rfw-ok-ink); }
.rfw-pill--warn   { background: var(--rfw-warn-50);  color: var(--rfw-warn-ink); }
.rfw-pill--crit   { background: var(--rfw-crit-50);  color: var(--rfw-crit-ink); }
.rfw-pill--info   { background: var(--rfw-brand-50); color: var(--rfw-brand-ink); }
.rfw-pill--accent { background: var(--rfw-gold-50);  color: var(--rfw-gold-ink); }
.rfw-pill--idle   { background: var(--rfw-idle-50);  color: var(--rfw-idle-ink); }
.rfw-pill--outline { background: transparent; border-color: currentColor; }
.rfw-pill--filled.rfw-pill--ok   { background: var(--rfw-ok);    color: var(--rfw-on-fill); }
.rfw-pill--filled.rfw-pill--crit { background: var(--rfw-crit);  color: var(--rfw-on-fill); }
.rfw-pill--filled.rfw-pill--info { background: var(--rfw-brand); color: var(--rfw-on-brand); }
.rfw-pill--round { border-radius: var(--rfw-r-pill); }
/* status dot for a compact list */
.rfw-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--rfw-idle-ink); vertical-align: middle; margin-right: 6px; }
.rfw-dot--ok { background: var(--rfw-ok); } .rfw-dot--warn { background: var(--rfw-warn); } .rfw-dot--crit { background: var(--rfw-crit); } .rfw-dot--brand { background: var(--rfw-brand); }

/* ---- filter chip (M365 "Top actions" pills) ----------------------------- */
.rfw-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px;
  border-radius: var(--rfw-r-pill); border: 1px solid var(--rfw-line-2); background: var(--rfw-surface);
  color: var(--rfw-ink-2); font: inherit; font-size: 14px; cursor: pointer;
  transition: background var(--rfw-dur) var(--rfw-ease), border-color var(--rfw-dur) var(--rfw-ease);
}
.rfw-chip:hover { background: var(--rfw-surface-2); }
.rfw-chip[aria-pressed="true"], .rfw-chip--on { background: var(--rfw-brand-50); border-color: var(--rfw-brand-line); color: var(--rfw-brand-ink); font-weight: 600; }
.rfw-chip--sm { height: 26px; padding: 0 10px; font-size: 13px; }
.rfw-chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- tables ------------------------------------------------------------- */
.rfw-table-wrap { border: 1px solid var(--rfw-line); border-radius: var(--rfw-r); overflow: hidden; background: var(--rfw-surface); }
.rfw-table-scroll { overflow: auto; max-height: 480px; border: 1px solid var(--rfw-line); border-radius: var(--rfw-r); background: var(--rfw-surface); }
.rfw-table { border-collapse: collapse; width: 100%; font-size: 14px; line-height: 20px; }
.rfw-table th, .rfw-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--rfw-line); vertical-align: middle; }
.rfw-table th { font-size: var(--rfw-fs-caption); line-height: var(--rfw-lh-caption); font-weight: 600; color: var(--rfw-muted); background: var(--rfw-surface); letter-spacing: 0; text-transform: none; white-space: nowrap; }
.rfw-table th[aria-sort] { cursor: pointer; user-select: none; }
.rfw-table th[aria-sort]:hover { color: var(--rfw-ink); }
.rfw-table th[aria-sort="ascending"]::after  { content: " \2191"; }
.rfw-table th[aria-sort="descending"]::after { content: " \2193"; }
.rfw-table tbody tr:last-child td { border-bottom: 0; }
.rfw-table tbody tr:hover { background: var(--rfw-surface-2); }
.rfw-table tbody tr[aria-selected="true"], .rfw-table tbody tr.is-selected { background: var(--rfw-brand-50); }
.rfw-table td.num, .rfw-table th.num, .rfw-table .num { font-family: var(--rfw-font-num); font-variant-numeric: tabular-nums lining-nums; text-align: right; }
.rfw-table--sticky thead th { position: sticky; top: 0; z-index: 1; box-shadow: 0 1px 0 var(--rfw-line); }
.rfw-table--compact th, .rfw-table--compact td { padding: 6px 10px; }
.rfw-table--striped tbody tr:nth-child(even) { background: var(--rfw-surface-2); }
.rfw-table td a { color: var(--rfw-brand-ink); }

/* ---- buttons (Fluent: 32px, 4px radius, 14/600) ------------------------- */
.rfw-btn {
  font-family: var(--rfw-sys); font-size: 14px; line-height: 20px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--rfw-control-h); padding: 5px 12px; border-radius: var(--rfw-r-sm);
  background: var(--rfw-brand); color: var(--rfw-on-brand); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap; box-shadow: none;
  transition: background var(--rfw-dur) var(--rfw-ease), border-color var(--rfw-dur) var(--rfw-ease), color var(--rfw-dur) var(--rfw-ease);
}
.rfw-btn i { font-size: 18px; }
.rfw-btn:hover { background: var(--rfw-brand-700); text-decoration: none; }
.rfw-btn:active { background: var(--rfw-brand-800); }
.rfw-btn--ghost, .rfw-btn--secondary { background: var(--rfw-surface); color: var(--rfw-ink); border-color: var(--rfw-line-2); }
.rfw-btn--ghost:hover, .rfw-btn--secondary:hover { background: var(--rfw-surface-2); }
.rfw-btn--ghost:active, .rfw-btn--secondary:active { background: var(--rfw-inset); }
.rfw-btn--subtle { background: transparent; color: var(--rfw-ink-2); border-color: transparent; }
.rfw-btn--subtle:hover { background: var(--rfw-surface-2); color: var(--rfw-ink); }
.rfw-btn--subtle:active { background: var(--rfw-inset); }
.rfw-btn--gold { background: var(--rfw-gold); color: #242424; }
.rfw-btn--gold:hover { background: #E6B000; }
.rfw-btn--gold:active { background: #CC9C00; }
.rfw-btn--danger { background: var(--rfw-crit); color: var(--rfw-on-brand); }
.rfw-btn--danger:hover { filter: brightness(.92); }
.rfw-btn--link { background: none; border-color: transparent; color: var(--rfw-brand-ink); padding-left: 4px; padding-right: 4px; }
.rfw-btn--link:hover { background: none; text-decoration: underline; }
.rfw-btn--sm { min-height: 24px; padding: 1px 8px; font-size: 12px; line-height: 16px; }
.rfw-btn--sm i { font-size: 14px; }
.rfw-btn--lg { min-height: 40px; padding: 9px 16px; font-size: 16px; }
.rfw-btn--icon { width: var(--rfw-control-h); padding: 0; }
.rfw-btn--icon.rfw-btn--sm { width: 24px; }
.rfw-btn:disabled, .rfw-btn[aria-disabled="true"] { background: var(--rfw-inset); color: var(--rfw-disabled); border-color: transparent; cursor: not-allowed; filter: none; }
.rfw-btn.is-copied { background: var(--rfw-ok-50); color: var(--rfw-ok-ink); border-color: var(--rfw-ok-line); }
.rfw-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rfw-btn-group { display: inline-flex; }
.rfw-btn-group > .rfw-btn { border-radius: 0; margin-left: -1px; }
.rfw-btn-group > .rfw-btn:first-child { border-radius: var(--rfw-r-sm) 0 0 var(--rfw-r-sm); margin-left: 0; }
.rfw-btn-group > .rfw-btn:last-child { border-radius: 0 var(--rfw-r-sm) var(--rfw-r-sm) 0; }
/* Jira-style status dropdown button ("Open ⌄") */
.rfw-btn--status { background: var(--rfw-brand-50); color: var(--rfw-brand-ink); border-color: transparent; }
.rfw-btn--status:hover { background: var(--rfw-brand-line); }
.rfw-btn--status::after { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: 2px; }

/* ---- form fields (Fluent input: 32px, underline accent on focus) --------- */
.rfw-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rfw-field--row { flex-direction: row; align-items: center; gap: 10px; }
.rfw-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.rfw-form-grid .rfw-field--full { grid-column: 1 / -1; }
.rfw-label { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--rfw-ink); letter-spacing: 0; text-transform: none; }
.rfw-label .req { color: var(--rfw-crit-ink); margin-left: 2px; }
.rfw-label .hint { font-weight: 400; color: var(--rfw-muted); margin-left: 6px; }
.rfw-input, .rfw-select, textarea.rfw-input {
  font-family: var(--rfw-sys); font-size: 14px; line-height: 20px; color: var(--rfw-ink);
  background: var(--rfw-surface); border: 1px solid var(--rfw-line-2); border-bottom-color: var(--rfw-line-strong);
  border-radius: var(--rfw-r-sm); min-height: var(--rfw-control-h); padding: 5px 10px; width: 100%;
  transition: border-color var(--rfw-dur) var(--rfw-ease), box-shadow var(--rfw-dur) var(--rfw-ease);
}
textarea.rfw-input { min-height: 80px; resize: vertical; }
.rfw-input::placeholder { color: var(--rfw-muted); }
.rfw-input:hover, .rfw-select:hover { border-color: var(--rfw-line-strong); }
.rfw-input:focus-visible, .rfw-select:focus-visible, textarea.rfw-input:focus-visible { outline: none; border-color: var(--rfw-line-2); box-shadow: inset 0 -2px 0 var(--rfw-brand); }
.rfw-input:disabled, .rfw-select:disabled { background: var(--rfw-inset); color: var(--rfw-disabled); border-color: var(--rfw-line); }
.rfw-input--sm { min-height: 24px; padding: 1px 8px; font-size: 13px; }
.rfw-select { appearance: none; -webkit-appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23616161' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; }
.rfw-field__help { font-size: 12px; line-height: 16px; color: var(--rfw-muted); }
.rfw-field__msg { font-size: 12px; line-height: 16px; display: inline-flex; align-items: center; gap: 4px; }
.rfw-field__msg i { font-size: 14px; }
.rfw-field--error .rfw-input, .rfw-field--error .rfw-select { border-color: var(--rfw-crit); border-bottom-color: var(--rfw-crit); }
.rfw-field--error .rfw-field__msg { color: var(--rfw-crit-ink); }
.rfw-field--ok .rfw-input { border-bottom-color: var(--rfw-ok); }
.rfw-field--ok .rfw-field__msg { color: var(--rfw-ok-ink); }
.rfw input[type="checkbox"], .rfw input[type="radio"], .rfw-check { accent-color: var(--rfw-brand); width: 16px; height: 16px; }
.rfw-checkrow { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
/* Fluent switch */
.rfw-switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.rfw-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.rfw-switch__track { width: 40px; height: 20px; border-radius: var(--rfw-r-pill); border: 1px solid var(--rfw-line-strong); background: var(--rfw-surface); position: relative; transition: background var(--rfw-dur) var(--rfw-ease), border-color var(--rfw-dur) var(--rfw-ease); flex-shrink: 0; }
.rfw-switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--rfw-line-strong); transition: transform var(--rfw-dur) var(--rfw-ease), background var(--rfw-dur) var(--rfw-ease); }
.rfw-switch input:checked + .rfw-switch__track { background: var(--rfw-brand); border-color: var(--rfw-brand); }
.rfw-switch input:checked + .rfw-switch__track::after { transform: translateX(20px); background: var(--rfw-on-brand); }
.rfw-switch input:focus-visible + .rfw-switch__track { box-shadow: var(--rfw-ring); }

/* ---- tabs (Fluent: underline) ------------------------------------------- */
.rfw-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rfw-line); margin: 0 0 16px; overflow-x: auto; }
.rfw-tab { font: inherit; font-size: 14px; line-height: 20px; font-weight: 400; color: var(--rfw-ink-2); background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px 6px; margin-bottom: -1px; cursor: pointer; white-space: nowrap; border-radius: var(--rfw-r-sm) var(--rfw-r-sm) 0 0; display: inline-flex; align-items: center; gap: 6px; }
.rfw-tab:hover { color: var(--rfw-ink); background: var(--rfw-surface-2); }
.rfw-tab[aria-selected="true"], .rfw-tab.is-on { color: var(--rfw-ink); font-weight: 600; border-bottom-color: var(--rfw-brand); }
.rfw-tab .n { font-weight: 400; color: var(--rfw-muted); font-variant-numeric: tabular-nums; }

/* ---- breadcrumbs (Jira: Spaces / Project / Key) ------------------------- */
.rfw-crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; line-height: 20px; color: var(--rfw-muted); margin: 0 0 12px; padding: 0; list-style: none; }
.rfw-crumbs li { display: inline-flex; align-items: center; gap: 6px; }
.rfw-crumbs li + li::before { content: "/"; color: var(--rfw-line-strong); }
.rfw-crumbs a { color: var(--rfw-muted); }
.rfw-crumbs a:hover { color: var(--rfw-brand-ink); }
.rfw-crumbs [aria-current="page"] { color: var(--rfw-ink); font-weight: 600; }

/* ---- message bar / banner (Fluent MessageBar) --------------------------- */
.rfw-banner { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: var(--rfw-r-sm); border: 1px solid; font-size: 14px; line-height: 20px; color: var(--rfw-ink); }
.rfw-banner i { font-size: 18px; margin-top: 1px; flex-shrink: 0; }
.rfw-banner__title { font-weight: 600; }
.rfw-banner__body { color: var(--rfw-ink-2); margin-top: 2px; }
.rfw-banner__actions { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.rfw-banner--info { background: var(--rfw-brand-50); border-color: var(--rfw-brand-line); } .rfw-banner--info i { color: var(--rfw-brand-ink); }
.rfw-banner--ok   { background: var(--rfw-ok-50);    border-color: var(--rfw-ok-line); }    .rfw-banner--ok i   { color: var(--rfw-ok-ink); }
.rfw-banner--warn { background: var(--rfw-warn-50);  border-color: var(--rfw-warn-line); }  .rfw-banner--warn i { color: var(--rfw-warn-ink); }
.rfw-banner--crit { background: var(--rfw-crit-50);  border-color: var(--rfw-crit-line); }  .rfw-banner--crit i { color: var(--rfw-crit-ink); }
.rfw-banner--accent { background: var(--rfw-gold-50); border-color: var(--rfw-gold-line); } .rfw-banner--accent i { color: var(--rfw-gold-ink); }

/* ---- toast (M365 top-right notification) -------------------------------- */
.rfw-toasts { position: fixed; top: 64px; right: 16px; z-index: 9000; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 32px)); }
.rfw-toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--rfw-surface); color: var(--rfw-ink); border: 1px solid var(--rfw-line); border-radius: var(--rfw-r-lg); box-shadow: var(--rfw-elev-3); font-size: 14px; line-height: 20px; }
.rfw-toast i { font-size: 20px; flex-shrink: 0; color: var(--rfw-brand-ink); margin-top: 1px; }
.rfw-toast--ok i { color: var(--rfw-ok-ink); } .rfw-toast--warn i { color: var(--rfw-warn-ink); } .rfw-toast--crit i { color: var(--rfw-crit-ink); }
.rfw-toast__title { font-weight: 600; }
.rfw-toast__body { color: var(--rfw-ink-2); }
.rfw-toast__link { display: inline-block; margin-top: 4px; }
.rfw-toast__close { margin-left: auto; }

/* ---- menu (dropdown) + dialog ------------------------------------------- */
.rfw-menu { position: absolute; z-index: 900; min-width: 200px; padding: 6px; margin: 0; list-style: none; background: var(--rfw-surface); border: 1px solid var(--rfw-line); border-radius: var(--rfw-r); box-shadow: var(--rfw-elev-3); }
.rfw-menu__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--rfw-r-sm); background: transparent; color: var(--rfw-ink); font: inherit; text-align: left; cursor: pointer; text-decoration: none; }
.rfw-menu__item:hover, .rfw-menu__item:focus-visible { background: var(--rfw-surface-2); text-decoration: none; }
.rfw-menu__item i { font-size: 18px; color: var(--rfw-muted); }
.rfw-menu__item--danger { color: var(--rfw-crit-ink); }
.rfw-menu hr, .rfw-divider { border: 0; border-top: 1px solid var(--rfw-line); margin: 6px 0; }
.rfw-dialog { background: var(--rfw-surface); color: var(--rfw-ink); border: 1px solid var(--rfw-line); border-radius: var(--rfw-r-lg); box-shadow: var(--rfw-elev-4); padding: 20px 24px; width: min(560px, calc(100vw - 32px)); }
.rfw-dialog::backdrop { background: var(--rfw-scrim); }
.rfw-dialog__title { font-size: var(--rfw-fs-subtitle); line-height: var(--rfw-lh-subtitle); font-weight: 600; margin: 0 0 12px; }
.rfw-dialog__foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.rfw-avatar { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--rfw-brand-50); color: var(--rfw-brand-ink); font-size: 12px; font-weight: 600; flex-shrink: 0; overflow: hidden; }
.rfw-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rfw-avatar--lg { width: 40px; height: 40px; font-size: 16px; }

/* ---- empty / loading states --------------------------------------------- */
.rfw-empty { text-align: center; color: var(--rfw-muted); padding: 40px 20px; border: 1px dashed var(--rfw-line-2); border-radius: var(--rfw-r); background: var(--rfw-surface); }
.rfw-empty i { font-size: 32px; color: var(--rfw-line-strong); display: block; margin-bottom: 10px; }
.rfw-empty__title { font-size: 16px; line-height: 22px; font-weight: 600; color: var(--rfw-ink); margin: 0 0 4px; }
.rfw-empty__body { font-size: 14px; color: var(--rfw-muted); margin: 0; }
/* Inside a card or a table cell the empty state is that container's content, not a second box: a
   dashed box inside a card reads as a drop zone. An app with its own card class adds the same rule. */
:where(.rfw-card, td) .rfw-empty { border: 0; background: none; padding: 24px 12px; }
.rfw-skeleton { height: 14px; background: var(--rfw-inset); border-radius: var(--rfw-r-sm); animation: rfw-sh 1.4s var(--rfw-ease) infinite; }
.rfw-skeleton--text { margin: 8px 0; }
.rfw-skeleton--h { height: 20px; width: 40%; }
@keyframes rfw-sh { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.rfw-spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--rfw-brand-50); border-top-color: var(--rfw-brand); border-radius: 50%; animation: rfw-spin .8s linear infinite; vertical-align: middle; }
@keyframes rfw-spin { to { transform: rotate(360deg); } }

/* ---- v3.1 (ENG-705): the moments ---------------------------------------- */
/* Proven in inventory control, promoted so every app has them, plus three new ones. Each
   answers what a person is asking at that moment:
     .rfw-answer     what is the answer?          one sentence at the top of a screen
     .rfw-flow       how does this run, and where does everything stand?
     .rfw-facts      what is true, and is each thing done?   icon + words, never colour alone
     .rfw-reassure   what will NOT happen if I click this?   the safety line in a dialog
     .rfw-setting    what is it, what is it set to, can I change it?
     .rfw-done       it worked: what happened and what comes next (Peak-End)
     .rfw-changed    what moved since I last looked?   a gold wash that fades; the note stays
     .rfw-empty--clear + .rfw-reggie   good news: nothing is waiting                          */

/* One-sentence answer. The state rides on the icon and the words: no coloured card edge. */
.rfw-answer { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin: 0 0 16px; background: var(--rfw-surface); border: 1px solid var(--rfw-line); border-radius: var(--rfw-r); }
.rfw-answer > i { font-size: 24px; line-height: 28px; flex-shrink: 0; color: var(--rfw-brand-ink); }
/* A flex item will not shrink below its content's width by default: without this, a long answer ran
   past the card on a phone instead of wrapping (found converging the customer card, churn, Command). */
.rfw-answer > div { min-width: 0; overflow-wrap: anywhere; }
.rfw-answer__title { font-size: var(--rfw-fs-subtitle); line-height: var(--rfw-lh-subtitle); font-weight: 600; margin: 0; color: var(--rfw-ink); }
.rfw-answer__body { color: var(--rfw-ink-2); margin: 2px 0 0; }
.rfw-answer--ok > i   { color: var(--rfw-ok-ink); }
.rfw-answer--warn > i { color: var(--rfw-warn-ink); }
.rfw-answer--crit > i { color: var(--rfw-crit-ink); }
.rfw-answer--idle > i { color: var(--rfw-idle-ink); }

/* A process drawn as steps, optionally under bands saying where each step happens and who
   does it. It lays out by the width of its OWN container (a card, a column), not the
   window: one column per step when each gets about 135px, otherwise one step per row.
   --rfw-flow-n is the number of steps (default 7); bands take grid-column inline.
   .rfw-flow--banded: the bands carry system and owner, so the per-step tags are for
   screen readers until the bands fold away, then they show.                            */
.rfw-flow { container: rfw-flow / inline-size; margin-top: 16px; }
.rfw-flow__bands, .rfw-flow__steps { display: grid; grid-template-columns: repeat(var(--rfw-flow-n, 7), minmax(0, 1fr)); column-gap: 12px; }
.rfw-flow__bands { row-gap: 6px; margin: 0 0 8px; }
.rfw-flow__band { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 10px; border-radius: var(--rfw-r-sm); font-size: 12px; line-height: 16px; font-weight: 600; color: var(--rfw-ink-2); background: var(--rfw-surface-2); border: 1px solid var(--rfw-line); }
.rfw-flow__band i { font-size: 16px; }
.rfw-flow__band--app { background: var(--rfw-brand-50); color: var(--rfw-brand-ink); border-color: var(--rfw-brand-line); }
.rfw-flow__steps { list-style: none; margin: 0; padding: 0; row-gap: 12px; }
.rfw-flow__step { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 10px; border: 1px solid var(--rfw-line); border-radius: var(--rfw-r); background: var(--rfw-surface); }
.rfw-flow__step--app { background: var(--rfw-brand-50); border-color: var(--rfw-brand-line); }
.rfw-flow__step:not(:last-child)::after { content: ""; position: absolute; top: 20px; right: -11px; width: 9px; height: 9px; box-sizing: border-box; border-top: 2px solid var(--rfw-line-strong); border-right: 2px solid var(--rfw-line-strong); transform: rotate(45deg); }
.rfw-flow__num { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; font-variant-numeric: tabular-nums; background: var(--rfw-chrome); color: var(--rfw-chrome-ink); }
.rfw-flow__title { grid-area: title; font-weight: 600; line-height: 20px; }
.rfw-flow__what { grid-area: what; font-size: 12px; line-height: 16px; color: var(--rfw-ink-2); }
.rfw-flow__tags { grid-area: tags; display: flex; flex-wrap: wrap; gap: 4px; }
.rfw-flow--banded .rfw-flow__tags { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rfw-flow__count { grid-area: count; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--rfw-line); }
.rfw-flow__big { font-family: var(--rfw-display); font-size: 26px; line-height: 32px; font-weight: var(--rfw-fw-display); font-variant-numeric: tabular-nums lining-nums; }
.rfw-flow__cap { font-size: 12px; line-height: 16px; color: var(--rfw-muted); }
@container rfw-flow (max-width: 999px) {
  .rfw-flow__bands { display: none; }
  .rfw-flow__steps { grid-template-columns: minmax(0, 1fr); }
  .rfw-flow__step { display: grid; grid-template-columns: 28px minmax(0, 1fr) minmax(170px, 240px); grid-template-areas: "num title count" "num tags count" "num what count"; column-gap: 12px; row-gap: 4px; align-items: start; }
  .rfw-flow__num { grid-area: num; }
  .rfw-flow--banded .rfw-flow__tags { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; }
  .rfw-flow__count { margin: 0; padding: 0 0 0 12px; border-top: 0; border-left: 1px solid var(--rfw-line); }
  .rfw-flow__step:not(:last-child)::after { top: auto; bottom: -10px; right: auto; left: 20px; transform: rotate(135deg); }
}
@container rfw-flow (max-width: 520px) {
  .rfw-flow__step { grid-template-columns: 28px minmax(0, 1fr); grid-template-areas: "num title" "num tags" "num what" "num count"; }
  .rfw-flow__count { padding: 8px 0 0; border-left: 0; border-top: 1px solid var(--rfw-line); }
}

/* Facts with a state: each line says what is true and whether it is done. */
.rfw-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.rfw-fact { display: flex; gap: 10px; align-items: flex-start; }
.rfw-fact > i { font-size: 20px; line-height: 20px; flex-shrink: 0; margin-top: 1px; color: var(--rfw-muted); }
.rfw-fact--ok > i   { color: var(--rfw-ok-ink); }
.rfw-fact--info > i { color: var(--rfw-brand-ink); }
.rfw-fact--warn > i { color: var(--rfw-warn-ink); }
.rfw-fact--crit > i { color: var(--rfw-crit-ink); }
.rfw-fact--todo > i { color: var(--rfw-muted); }
.rfw-fact__title { font-weight: 600; }
.rfw-fact__detail { color: var(--rfw-ink-2); }
.rfw-fact__how { font-size: 12px; line-height: 16px; color: var(--rfw-muted); margin-top: 2px; }
.rfw-facts--compact { gap: 10px; }
.rfw-facts--compact .rfw-fact__detail, .rfw-facts--compact .rfw-fact__how { display: none; }

/* The reassurance line: what will NOT happen. Sits above a dialog's buttons. */
.rfw-reassure { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 12px; line-height: 16px; color: var(--rfw-muted); }
.rfw-reassure > i { font-size: 16px; line-height: 16px; flex-shrink: 0; color: var(--rfw-ok-ink); }

/* Settings, one row each: what it is and why, what it is set to, change. Detail folds. */
.rfw-settings { padding-top: 4px; padding-bottom: 4px; }
.rfw-setting { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 4px 16px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--rfw-line); }
.rfw-setting:last-child { border-bottom: 0; }
.rfw-setting__label { font-weight: 600; }
.rfw-setting__summary { color: var(--rfw-ink-2); }
.rfw-setting__value { overflow-wrap: anywhere; }
.rfw-setting__more { grid-column: 1 / -1; }
.rfw-setting__more > summary { cursor: pointer; font-size: 12px; line-height: 16px; color: var(--rfw-brand-ink); min-height: 24px; display: inline-flex; align-items: center; }
.rfw-setting__detail { padding: 4px 0 0; max-width: 80ch; }
.rfw-setting__detail p { margin: 4px 0; }
@media (max-width: 760px) { .rfw-setting { grid-template-columns: minmax(0, 1fr); } }

/* Completion (Peak-End): it worked, what happened, what comes next. The check draws itself
   once; reduced motion shows it drawn. Put role="status" on it so it is announced.       */
.rfw-done { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-items: start; padding: 14px 16px; margin: 0 0 16px; background: var(--rfw-surface); border: 1px solid var(--rfw-ok-line); border-radius: var(--rfw-r); }
.rfw-done__check { grid-row: 1 / span 3; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--rfw-ok-50); color: var(--rfw-ok-ink); }
.rfw-done__check::after { content: ""; width: 13px; height: 7px; margin-top: -4px; border-left: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: rotate(-45deg); clip-path: inset(0 100% 0 0); animation: rfw-check .32s var(--rfw-ease-out) .15s forwards; }
@keyframes rfw-check { to { clip-path: inset(0 0 0 0); } }
.rfw-done__title { font-size: var(--rfw-fs-body-lg); line-height: var(--rfw-lh-body-lg); font-weight: 600; margin: 0; color: var(--rfw-ink); }
.rfw-done__body { color: var(--rfw-ink-2); margin: 2px 0 0; }
.rfw-done__next { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* What changed since you last looked. The wash is an overlay under the content, so the
   element keeps its own background when it fades; the note carries the meaning after.  */
.rfw-changed { position: relative; isolation: isolate; }
.rfw-changed::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; background: var(--rfw-gold-50); box-shadow: inset 3px 0 0 var(--rfw-gold); animation: rfw-changed 4.5s var(--rfw-ease-out) forwards; }
@keyframes rfw-changed { 0%, 65% { opacity: 1; } 100% { opacity: 0; } }
.rfw-changed__note { display: block; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--rfw-gold-ink); }

/* Good news. Reggie (D4) appears ONLY here, on completions and in the busy dialog: in the
   logo colours (navy on light, white on dark), never tinted. <span class="rfw-reggie"
   role="img" aria-label="Reggie"></span> is filled with the mark by the kit script. "No
   results" for a search is not good news: it keeps the plain .rfw-empty glyph.          */
.rfw-empty--clear { border-style: solid; border-color: var(--rfw-line); }
.rfw-reggie { display: block; width: 56px; height: 62px; margin: 0 auto 10px; color: var(--rfw-reggie); }
.rfw-reggie svg { display: block; width: 100%; height: 100%; fill: currentColor; }
.rfw-reggie--sm { width: 32px; height: 36px; }
.rfw-reggie--lg { width: 96px; height: 106px; }

/* ---- v3.1 (ENG-705): progress and status -------------------------------- */
/* Waiting is where people notice a tool's character, so this is where the brand shows up:
   gold marks NOW, the same rule as the "now" mark on charts. Response-time limits
   (Nielsen): under ~1 s show nothing (the busy dialog waits 400 ms), 1-10 s an indicator,
   over 10 s progress people can read: what, how far, roughly how long. Words carry the
   meaning; every animation is slow, has a purpose, and stops under reduced motion.     */

/* Progress with a label row: what is happening and how far along, in words.
   <div class="rfw-progress__head"><span>Removing SKUs <b>4 of 10</b></span><span>About 2 min left</span></div>
   <span class="rfw-progress rfw-progress--now" role="progressbar" aria-valuenow="40" ...><span style="width:40%"></span></span>
   --now: the process is moving now; its leading edge is gold. Drop it at 100% (or use --ok). */
.rfw-progress__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 0 6px; font-size: 12px; line-height: 16px; color: var(--rfw-ink-2); font-variant-numeric: tabular-nums; }
.rfw-progress__head b { font-weight: 600; color: var(--rfw-ink); }
.rfw-progress--now > span { box-shadow: inset -3px 0 0 var(--rfw-gold); transition: width var(--rfw-dur-2) var(--rfw-ease-out); }
/* Unknown length: a segment grows across the track and retreats. No fake percentage. */
.rfw-progress--indeterminate > span { width: 100%; clip-path: inset(0 100% 0 0); animation: rfw-indeterminate 1.6s var(--rfw-ease) infinite; }
@keyframes rfw-indeterminate { 0% { clip-path: inset(0 100% 0 0); } 50% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(0 0 0 100%); } }

/* Where one thing stands in its lifecycle: requested, approved, removing, checked, verified.
   Done steps are credited with a check, the current step is a brand ring with the gold
   "now" dot, a failed step is an x; the shapes differ, so colour is never the only cue.
   <ol class="rfw-steps" aria-label="Batch B-0142">
     <li class="rfw-steps__step is-done"><span class="rfw-steps__mark"></span><span class="rfw-steps__label">Approved</span><span class="rfw-steps__meta">07:10</span><span class="rfw-sr">, done</span></li>
     <li class="rfw-steps__step is-now" aria-current="step"> ... <span class="rfw-sr">, in progress</span></li> ...
   </ol><p class="rfw-steps__count">Step 3 of 5</p>                                          */
.rfw-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.rfw-steps__step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 0 4px; text-align: center; font-size: 12px; line-height: 16px; color: var(--rfw-muted); }
.rfw-steps__step + .rfw-steps__step::before { content: ""; position: absolute; top: 9px; left: calc(-50% + 14px); right: calc(50% + 14px); height: 2px; border-radius: 1px; background: var(--rfw-line-2); }
.rfw-steps__step.is-done + .rfw-steps__step::before { background: var(--rfw-ok); }
.rfw-steps__mark { position: relative; z-index: 1; width: 20px; height: 20px; box-sizing: border-box; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--rfw-line-strong); background: var(--rfw-surface); display: grid; place-items: center; }
.rfw-steps__label { font-weight: 600; overflow-wrap: anywhere; }
.rfw-steps__meta { font-weight: 400; color: var(--rfw-muted); font-variant-numeric: tabular-nums; }
.rfw-steps__step.is-done { color: var(--rfw-ink-2); }
.rfw-steps__step.is-done .rfw-steps__mark { background: var(--rfw-ok); border-color: var(--rfw-ok); color: var(--rfw-on-fill); }
.rfw-steps__step.is-done .rfw-steps__mark::after { content: ""; width: 8px; height: 4px; margin-top: -2px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); }
.rfw-steps__step.is-now { color: var(--rfw-ink); }
.rfw-steps__step.is-now .rfw-steps__mark { border-color: var(--rfw-brand-ink); }
.rfw-steps__step.is-now .rfw-steps__mark::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--rfw-gold); }
.rfw-steps__step.is-failed { color: var(--rfw-crit-ink); }
.rfw-steps__step.is-failed .rfw-steps__mark { background: var(--rfw-crit); border-color: var(--rfw-crit); color: var(--rfw-on-fill); }
.rfw-steps__step.is-failed .rfw-steps__mark::after { content: "\00D7"; font-size: 15px; line-height: 1; font-weight: 700; margin-top: -1px; }
.rfw-steps__count { margin: 8px 0 0; font-size: 12px; line-height: 16px; color: var(--rfw-muted); font-variant-numeric: tabular-nums; }
/* Many steps or a narrow column: stack them. */
.rfw-steps--vertical { grid-auto-flow: row; grid-auto-columns: auto; }
.rfw-steps--vertical .rfw-steps__step { flex-direction: row; flex-wrap: wrap; align-items: flex-start; column-gap: 10px; row-gap: 0; padding: 0 0 16px; text-align: left; }
.rfw-steps--vertical .rfw-steps__step + .rfw-steps__step::before { display: none; }
.rfw-steps--vertical .rfw-steps__step:not(:last-child)::after { content: ""; position: absolute; left: 9px; top: 22px; bottom: 2px; width: 2px; border-radius: 1px; background: var(--rfw-line-2); }
.rfw-steps--vertical .rfw-steps__step.is-done:not(:last-child)::after { background: var(--rfw-ok); }
.rfw-steps--vertical .rfw-steps__label { line-height: 20px; }
.rfw-steps--vertical .rfw-steps__meta { flex-basis: 100%; padding-left: 30px; margin-top: -2px; }

/* A status that is live right now (running, syncing, posting): a slow pulse on the dot. */
.rfw-pill--live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; background: currentColor; animation: rfw-live 2s var(--rfw-ease) infinite; }
@keyframes rfw-live { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* The trim works while the app works: whenever background work is running (the busy tray
   is up), a white glint runs along the gold trim, like reflective tape catching the light.
   It clips inside the bar, so it can never widen the page. Off under reduced motion; the
   tray still says what is running. */
.rfw-topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--rfw-chrome-ink); opacity: 0; clip-path: inset(0 100% 0 0); pointer-events: none; }
body:has(.rfw-busy-tray:not([hidden])) .rfw-topbar::after { opacity: .7; animation: rfw-glint 1.8s var(--rfw-ease) infinite; }
@keyframes rfw-glint { 0% { clip-path: inset(0 100% 0 0); } 50% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(0 0 0 100%); } }

/* ---- progressive disclosure --------------------------------------------- */
.rfw-disclosure { border: 1px solid var(--rfw-line); border-radius: var(--rfw-r); background: var(--rfw-surface); overflow: hidden; margin-bottom: 12px; }
.rfw-disclosure > summary { list-style: none; cursor: pointer; padding: 10px 14px; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--rfw-ink); display: flex; align-items: center; gap: 8px; letter-spacing: 0; text-transform: none; }
.rfw-disclosure > summary::-webkit-details-marker { display: none; }
.rfw-disclosure > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--rfw-muted); border-bottom: 2px solid var(--rfw-muted); transform: rotate(-45deg); margin: 0 6px 0 2px; transition: transform var(--rfw-dur) var(--rfw-ease); }
.rfw-disclosure[open] > summary::before { transform: rotate(45deg) translateY(-2px); }
.rfw-disclosure > summary:hover { background: var(--rfw-surface-2); }
.rfw-disclosure__body { padding: 12px 14px 14px; border-top: 1px solid var(--rfw-line); }

/* ---- tooltip ------------------------------------------------------------ */
.rfw-tip { position: relative; border-bottom: 1px dotted var(--rfw-line-strong); cursor: help; }
.rfw-tip::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  white-space: nowrap; font-family: var(--rfw-sys); font-size: 12px; line-height: 16px; font-variant-numeric: tabular-nums;
  color: var(--rfw-tooltip-ink); background: var(--rfw-tooltip-bg); border-radius: var(--rfw-r-sm); padding: 6px 10px;
  opacity: 0; pointer-events: none; transition: opacity var(--rfw-dur) var(--rfw-ease); z-index: 20; box-shadow: var(--rfw-elev-3);
}
.rfw-tip:hover::after, .rfw-tip:focus-visible::after { opacity: 1; }

/* ---- keyboard chip + masked value --------------------------------------- */
.rfw-kbd { display: inline-block; font-family: var(--rfw-mono); font-size: 12px; line-height: 16px; color: var(--rfw-ink-2); background: var(--rfw-inset); border: 1px solid var(--rfw-line-2); border-bottom-width: 2px; border-radius: var(--rfw-r-sm); padding: 1px 6px; }
.rfw-mask { font-family: var(--rfw-mono); letter-spacing: .08em; cursor: pointer; color: var(--rfw-muted); border-radius: 3px; }
.rfw-mask[data-value]:hover, .rfw-mask[data-value]:focus-visible { color: var(--rfw-ink); }
.rfw-mask[data-value]:not(:hover):not(:focus-visible)::after { content: "\2022\2022\2022\2022\2022\2022"; }
.rfw-mask[data-value]:hover::after, .rfw-mask[data-value]:focus-visible::after { content: attr(data-value); }
.rfw-code { font-family: var(--rfw-mono); font-size: 13px; line-height: 20px; background: var(--rfw-inset); border: 1px solid var(--rfw-line); border-radius: var(--rfw-r-sm); padding: 10px 12px; white-space: pre-wrap; word-break: break-word; color: var(--rfw-ink-2); }

/* ---- accessibility: visible focus, respect motion ----------------------- */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible, summary:focus-visible, input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: none; box-shadow: var(--rfw-ring); border-radius: var(--rfw-r-sm); }
.rfw-topbar a:focus-visible, .rfw-topbar button:focus-visible { box-shadow: none; outline: 2px solid var(--rfw-gold); outline-offset: 2px; }
/* v3.1: a text field, select or textarea WITHOUT a kit class still gets a visible ring.
   Zero specificity (:where), so any kit or app focus style wins over it; it only stops a
   bare field from having none at all. */
:where(input:not([type="checkbox"], [type="radio"], [type="hidden"], [type="range"], [type="color"]), select, textarea):focus-visible { outline: 2px solid var(--rfw-brand-ink); outline-offset: 1px; }
.rfw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .rfw-skeleton, .rfw-spinner { animation: none; }
  .rfw-done__check::after { animation: none; clip-path: none; }
  .rfw-changed::before { animation: none; }
  .rfw-progress--indeterminate > span { animation: none; clip-path: none; opacity: .45; }
  .rfw-progress--now > span { transition: none; }
  .rfw-pill--live::before { animation: none; }
  body:has(.rfw-busy-tray:not([hidden])) .rfw-topbar::after { animation: none; opacity: 0; }
  .rfw *, .rfw-topbar * { transition-duration: 0.001ms !important; }
}
@media print {
  .rfw-topbar, .rfw-nav, .rfw-toasts, .rfw-theme-btn, .rfw-suite-btn { display: none !important; }
  .rfw-layout { grid-template-columns: 1fr; }
  .rfw-card { break-inside: avoid; }
  .rfw-changed::before { display: none; }
}
