/* ============================================================
   Rocket Kitchen components
   ============================================================ */

.rk-app {
  min-height: 100vh;
}

/* Skip link. The sidebar is a dozen links plus a footer, so without one a
   keyboard user pays seventeen Tabs to reach the page's first control. It sits
   above the viewport until focused, so nobody else ever sees it. */
.rk-skip {
  position: absolute;
  top: var(--rk-space-3);
  left: var(--rk-space-4);
  z-index: 100;
  padding: 0.5rem 0.9rem;
  border-radius: var(--rk-radius-pill);
  background: var(--rk-text);
  color: var(--rk-bg);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-300%);
}
.rk-skip:focus-visible { transform: none; }

/* The skip link lands focus on <main>. A plain :focus ring on the whole page
   body reads as clutter, but the skip link itself must have SOME visible
   effect for a sighted keyboard user, so :focus-visible still gets one. */
.rk-container:focus { outline: none; }
.rk-container:focus-visible { outline: 2px solid var(--rk-accent); outline-offset: -2px; }

/* ---------------------------------------------------------------
   Layout
   --------------------------------------------------------------- */

.rk-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--rk-space-6) var(--rk-space-5) var(--rk-space-7);
}
.rk-container--flush { padding-top: 0; }

.rk-page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--rk-space-4);
  margin-bottom: var(--rk-space-5);
  flex-wrap: wrap;
}

.rk-page-header p { margin-top: var(--rk-space-1); }

.rk-page-header-main { display: flex; align-items: flex-start; gap: var(--rk-space-3); }

.rk-page-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--rk-accent-tint);
  color: var(--rk-accent-strong);
  flex-shrink: 0;
  margin-top: 2px;
}
.rk-page-icon .rk-icon { width: 20px; height: 20px; }

/* Brand mark: the sidebar and the sign-in card share it. */
.rk-logo-dot {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--rk-accent), var(--rk-accent-strong));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  box-shadow: 0 2px 6px rgba(255, 90, 44, 0.35);
}
.rk-logo-dot .rk-icon { width: 15px; height: 15px; }

/* ---------------------------------------------------------------
   Icon utility — consistent stroke icons replace emoji everywhere.
   --------------------------------------------------------------- */

.rk-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}
.rk-icon svg { width: 100%; height: 100%; display: block; }
.rk-icon-sm { width: 14px; height: 14px; }
.rk-icon-lg { width: 24px; height: 24px; }

/* ---------------------------------------------------------------
   Filters and stat strips
   --------------------------------------------------------------- */

/* ---- filter pills (client-side table filter) ---- */

.rk-filter-row {
  display: flex;
  gap: var(--rk-space-2);
  margin-bottom: var(--rk-space-4);
  flex-wrap: wrap;
}

.rk-filter-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.9rem;
  border-radius: var(--rk-radius-pill);
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid var(--rk-border-strong);
  background: var(--rk-surface);
  color: var(--rk-text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: transform 100ms ease-out, background var(--rk-duration-fast) var(--rk-ease-standard),
              color var(--rk-duration-fast) var(--rk-ease-standard), border-color var(--rk-duration-fast) var(--rk-ease-standard);
}
.rk-filter-pill:active { transform: scale(0.95); }
.rk-filter-pill[aria-pressed="true"] {
  background: var(--rk-text);
  border-color: var(--rk-text);
  color: var(--rk-bg);
}

/* ---- filter bar (server-side GET form: brand + date range) ---- */

.rk-filter-bar {
  display: flex;
  gap: var(--rk-space-3);
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: var(--rk-space-4);
}
.rk-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.rk-filter-field label {
  font-size: 0.75rem;
  color: var(--rk-text-secondary);
  font-weight: 600;
}
.rk-filter-field select,
.rk-filter-field input[type="date"] {
  padding: 0.45rem 0.7rem;
  border-radius: var(--rk-radius-sm);
  border: 1px solid var(--rk-border-strong);
  background: var(--rk-surface);
  color: var(--rk-text);
  font-size: 0.875rem;
  font-family: inherit;
}

/* Form controls ship browser-default blue and 13px; bring them into the
   palette and up to a size a busy hand can hit. Declared here, ahead of the
   visually-hidden inputs later in the file (.rk-verdict input,
   .rk-file-field input), which override it at equal specificity by order. */
input[type="checkbox"], input[type="radio"] {
  accent-color: var(--rk-accent);
  width: 1.125rem;
  height: 1.125rem;
  margin: 0 0.15rem 0 0;
  vertical-align: -0.2em;
}

/* ---- stat strip above a table ---- */

.rk-stat-strip {
  display: flex;
  gap: var(--rk-space-6);
  flex-wrap: wrap;
  padding: var(--rk-space-4) var(--rk-space-1);
  margin-bottom: var(--rk-space-2);
}
.rk-stat-strip-item .rk-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
}
.rk-stat-strip-item .rk-stat-label {
  font-size: 0.75rem;
  color: var(--rk-text-secondary);
  margin-top: 0.1rem;
}

/* ---------------------------------------------------------------
   Surfaces / cards
   --------------------------------------------------------------- */

.rk-surface {
  background: var(--rk-surface);
  border: 1px solid var(--rk-border);
  border-radius: var(--rk-radius-lg);
  box-shadow: var(--rk-shadow-sm);
}

.rk-card {
  background: var(--rk-surface);
  border: 1px solid var(--rk-border);
  border-radius: var(--rk-radius-md);
  box-shadow: var(--rk-shadow-sm);
  padding: var(--rk-space-5);
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform var(--rk-duration-base) var(--rk-ease-out-soft),
              box-shadow var(--rk-duration-base) var(--rk-ease-out-soft),
              border-color var(--rk-duration-base) var(--rk-ease-out-soft);
}

a.rk-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--rk-shadow-md);
  border-color: var(--rk-border-strong);
}
a.rk-card:active {
  transform: translateY(-1px) scale(0.985);
  transition-duration: 90ms;
}

.rk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--rk-space-4);
}
.rk-grid > * { min-width: 0; }

/* ---------------------------------------------------------------
   Tables
   --------------------------------------------------------------- */

.rk-table-wrap {
  overflow-x: auto;
  border-radius: var(--rk-radius-lg);
  border: 1px solid var(--rk-border);
  background: var(--rk-surface);
  box-shadow: var(--rk-shadow-sm);
}

table.rk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 560px;
}

.rk-table thead th {
  position: sticky;
  top: 0;
  text-align: left;
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--rk-text-secondary);
  font-weight: 650;
  padding: 0.85rem 1rem;
  background: var(--rk-surface-sunken);
  border-bottom: 1px solid var(--rk-border);
  white-space: nowrap;
}

.rk-table tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--rk-border);
  vertical-align: middle;
}

.rk-table tbody tr:last-child td { border-bottom: none; }

.rk-table tbody tr {
  transition: background var(--rk-duration-fast) var(--rk-ease-standard);
}
.rk-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--rk-surface-sunken) 45%, transparent); }
.rk-table tbody tr:hover { background: var(--rk-surface-sunken); }
.rk-table tbody tr.rk-row-danger { background: var(--rk-danger-tint); }
.rk-table tbody tr.rk-row-warn { background: var(--rk-warning-tint); }

.rk-num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------
   Badges / status
   --------------------------------------------------------------- */

.rk-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.2rem 0.6rem;
  border-radius: var(--rk-radius-pill);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.rk-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.rk-badge-success { background: var(--rk-success-tint); color: var(--rk-success-ink); }
.rk-badge-warning { background: var(--rk-warning-tint); color: var(--rk-warning-ink); }
.rk-badge-danger  { background: var(--rk-danger-tint);  color: var(--rk-danger-ink); }

/* Tone as text: stat values, inline warnings. Ink, never the fill. */
.rk-warn { color: var(--rk-warning-ink); }
.rk-danger { color: var(--rk-danger-ink); }
.rk-ok { color: var(--rk-success-ink); }
.rk-badge-neutral { background: var(--rk-border); color: var(--rk-text-secondary); }

.rk-tag-brand {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: var(--rk-radius-pill);
  font-size: 0.75rem;
  font-weight: 650;
}
.rk-tag-macros { background: var(--rk-macros-tint); color: var(--rk-macros-ink); }
.rk-tag-soulara { background: var(--rk-soulara-tint); color: var(--rk-soulara-ink); }

/* ---------------------------------------------------------------
   Buttons
   --------------------------------------------------------------- */

.rk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  padding: 0.55rem 1.05rem;
  border-radius: var(--rk-radius-pill);
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 100ms ease-out, background var(--rk-duration-fast) var(--rk-ease-standard),
              box-shadow var(--rk-duration-fast) var(--rk-ease-standard);
}
.rk-btn:active { transform: scale(0.96); transition-duration: 80ms; }

.rk-btn-primary { background: var(--rk-accent-solid); color: var(--rk-text-on-solid); box-shadow: var(--rk-shadow-sm); }
.rk-btn-primary:hover { background: var(--rk-accent-solid-hover); }

.rk-btn-secondary { background: var(--rk-surface); border-color: var(--rk-border-strong); color: var(--rk-text); }
.rk-btn-secondary:hover { background: var(--rk-surface-sunken); }

/* ---------------------------------------------------------------
   Empty states
   --------------------------------------------------------------- */

.rk-empty {
  text-align: center;
  padding: var(--rk-space-7) var(--rk-space-5);
  color: var(--rk-text-secondary);
}
.rk-empty-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto var(--rk-space-3);
  border-radius: 50%;
  background: var(--rk-surface-sunken);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rk-text-tertiary);
}
.rk-empty-icon .rk-icon { width: 20px; height: 20px; }

/* ---------------------------------------------------------------
   Toasts — materialize in (blur+scale together, not a flat fade)
   --------------------------------------------------------------- */

.rk-toast-region {
  position: fixed;
  bottom: var(--rk-space-5);
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: var(--rk-space-2);
  align-items: center;
  pointer-events: none;
}

@keyframes rk-materialize {
  from { opacity: 0; transform: translateY(6px) scale(0.98); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes rk-fade-only { from { opacity: 0; } to { opacity: 1; } }

.rk-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: var(--rk-space-2);
  padding: 0.65rem 1.1rem;
  border-radius: var(--rk-radius-pill);
  background: var(--rk-material-heavy-bg);
  backdrop-filter: blur(var(--rk-material-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--rk-material-blur)) saturate(180%);
  border: 1px solid var(--rk-material-border);
  box-shadow: var(--rk-shadow-lg);
  font-size: 0.875rem;
  font-weight: 550;
  color: var(--rk-text);
  animation: rk-materialize 260ms var(--rk-ease-out-soft) forwards;
}
/* app.js adds rk-toast-<variant> for the Django message level. The words
   carry the meaning; the tone only reinforces it. */
.rk-toast-success { color: var(--rk-success-ink); border-color: var(--rk-success-ink); }
.rk-toast-danger { color: var(--rk-danger-ink); border-color: var(--rk-danger-ink); }

@media (prefers-reduced-motion: reduce) {
  .rk-toast { animation: rk-fade-only 150ms linear forwards; }
}

/* ---------------------------------------------------------------
   Top / low sellers panel
   --------------------------------------------------------------- */

.rk-sellers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--rk-space-4);
  margin-bottom: var(--rk-space-6);
}
@media (max-width: 720px) {
  .rk-sellers-grid { grid-template-columns: 1fr; }
}

.rk-sellers-panel {
  background: var(--rk-surface);
  border: 1px solid var(--rk-border);
  border-radius: var(--rk-radius-md);
  padding: var(--rk-space-5);
  box-shadow: var(--rk-shadow-sm);
}

.rk-sellers-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--rk-text-secondary);
  margin-bottom: var(--rk-space-4);
}

.rk-seller-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 46px;
  align-items: center;
  gap: var(--rk-space-3);
  padding: 0.45rem 0;
}
.rk-seller-row + .rk-seller-row { border-top: 1px solid var(--rk-border); }

.rk-seller-name {
  font-size: 0.875rem;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rk-seller-variant {
  font-size: 0.75rem;
  color: var(--rk-text-tertiary);
  font-weight: 400;
}

.rk-seller-qty {
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--rk-text-secondary);
}

.rk-seller-bar-track {
  height: 6px;
  border-radius: 3px;
  background: var(--rk-surface-sunken);
  overflow: hidden;
}
.rk-seller-bar-fill {
  height: 100%;
  border-radius: 3px;
}
.rk-seller-bar-fill.rk-tone-top { background: var(--rk-success); }
.rk-seller-bar-fill.rk-tone-low { background: var(--rk-warning); }

/* ---------------------------------------------------------------
   Accordion (native <details>/<summary>, collapsed by default —
   used for the recipe detail page: components and SKUs stay closed
   until clicked, so the page opens as a scannable list of names).
   --------------------------------------------------------------- */

.rk-accordion {
  background: var(--rk-surface);
  border: 1px solid var(--rk-border);
  border-radius: var(--rk-radius-md);
  box-shadow: var(--rk-shadow-sm);
  margin-bottom: var(--rk-space-3);
  overflow: hidden;
}

.rk-accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--rk-space-3);
  padding: var(--rk-space-4) var(--rk-space-5);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background var(--rk-duration-fast) var(--rk-ease-standard);
}
.rk-accordion-summary::-webkit-details-marker { display: none; }
.rk-accordion-summary:hover { background: var(--rk-surface-sunken); }
.rk-accordion-summary:active { transform: scale(0.995); }

.rk-accordion-chevron {
  color: var(--rk-text-tertiary);
  transition: transform var(--rk-duration-base) var(--rk-ease-out-soft);
  flex-shrink: 0;
}
.rk-accordion[open] > .rk-accordion-summary .rk-accordion-chevron { transform: rotate(90deg); }

.rk-accordion-body {
  padding: 0 var(--rk-space-5) var(--rk-space-5);
  animation: rk-accordion-open 200ms var(--rk-ease-out-soft);
}
@keyframes rk-accordion-open {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .rk-accordion-body { animation: none; }
}

.rk-accordion-nested {
  margin-top: var(--rk-space-3);
  border: 1px solid var(--rk-border);
  border-radius: var(--rk-radius-sm);
  background: var(--rk-surface-sunken);
  overflow: hidden;
}
.rk-accordion-nested .rk-accordion-summary { padding: 0.6rem var(--rk-space-3); font-size: 0.875rem; font-weight: 600; }
.rk-accordion-nested .rk-accordion-body { padding: 0 var(--rk-space-3) var(--rk-space-3); }

.rk-method-text {
  white-space: pre-line;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--rk-text-secondary);
}

/* ---------------------------------------------------------------
   Mini compare bars (forecast predicted vs actual)
   --------------------------------------------------------------- */

.rk-bar-compare {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100px;
}
.rk-bar-track {
  height: 5px;
  border-radius: 3px;
  background: var(--rk-surface-sunken);
  overflow: hidden;
}
.rk-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width var(--rk-duration-slow) var(--rk-ease-out-soft);
}
.rk-bar-fill.rk-bar-predicted { background: var(--rk-text-tertiary); }
.rk-bar-fill.rk-bar-actual-over { background: var(--rk-success); }
.rk-bar-fill.rk-bar-actual-under { background: var(--rk-danger); }

/* ---------------------------------------------------------------
   Empty-state CTA
   --------------------------------------------------------------- */

.rk-empty .rk-btn { margin-top: var(--rk-space-3); }

/* ---------------------------------------------------------------
   Cooling board (blast freezer)
   --------------------------------------------------------------- */

.rk-tab-row {
  display: flex;
  gap: var(--rk-space-1);
  background: var(--rk-surface-sunken);
  border-radius: var(--rk-radius-md);
  padding: 0.25rem;
  margin-bottom: var(--rk-space-4);
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}
.rk-tab {
  padding: 0.5rem 1rem;
  border-radius: var(--rk-radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--rk-text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--rk-duration-fast) var(--rk-ease-standard), color var(--rk-duration-fast) var(--rk-ease-standard);
}
.rk-tab:hover { color: var(--rk-text); }
.rk-tab[aria-current="page"] { background: var(--rk-accent-solid); color: var(--rk-text-on-solid); }

.rk-progress-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--rk-space-4);
  margin-bottom: var(--rk-space-4);
}
.rk-progress-track {
  height: 4px;
  width: 160px;
  max-width: 40vw;
  background: var(--rk-border);
  border-radius: var(--rk-radius-pill);
  margin-top: 0.4rem;
  overflow: hidden;
}
.rk-progress-fill { height: 100%; background: var(--rk-success); border-radius: var(--rk-radius-pill); }

.rk-search-input {
  padding: 0.45rem 0.9rem;
  border-radius: var(--rk-radius-pill);
  border: 1px solid var(--rk-border-strong);
  background: var(--rk-surface);
  color: var(--rk-text);
  font-size: 0.8125rem;
  font-family: inherit;
  min-width: 180px;
}

.rk-cooling-card {
  background: var(--rk-surface);
  border: 1px solid var(--rk-border);
  border-left: 3px solid var(--rk-border-strong);
  border-radius: var(--rk-radius-md);
  padding: var(--rk-space-4);
  margin-bottom: var(--rk-space-3);
}
.rk-cooling-card[data-overdue="true"] { border-left-color: var(--rk-danger); }
.rk-cooling-card[data-stage="done"] { border-left-color: var(--rk-success); }

.rk-cooling-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--rk-space-3);
  margin-bottom: var(--rk-space-3);
}
.rk-cooling-card-head h3 { font-size: 1rem; margin: 0; }
.rk-cooling-card-meta { font-size: 0.8125rem; color: var(--rk-text-secondary); margin-top: 0.15rem; }

.rk-checkpoint-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: var(--rk-space-2);
}
.rk-checkpoint-pill {
  border-radius: var(--rk-radius-sm);
  padding: 0.5rem 0.4rem;
  text-align: center;
  border: 1px solid transparent;
}
.rk-checkpoint-pill .rk-checkpoint-label { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.rk-checkpoint-pill .rk-checkpoint-value { font-size: 0.9375rem; font-weight: 700; margin-top: 0.15rem; font-variant-numeric: tabular-nums; }

.rk-checkpoint-logged { background: var(--rk-success-tint); color: var(--rk-success-ink); }
.rk-checkpoint-overdue { background: var(--rk-danger-tint); color: var(--rk-danger-ink); }
.rk-checkpoint-pending { background: var(--rk-warning-tint); color: var(--rk-warning-ink); }
.rk-checkpoint-waiting { background: var(--rk-surface-sunken); color: var(--rk-text-tertiary); }

.rk-cooling-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--rk-space-2);
  margin-top: var(--rk-space-3);
}
.rk-cooling-action input[type="number"] {
  width: 90px;
  padding: 0.5rem 0.7rem;
  border-radius: var(--rk-radius-sm);
  border: 1px solid var(--rk-border-strong);
  background: var(--rk-surface);
  color: var(--rk-text);
  font-size: 0.875rem;
  font-family: inherit;
}

.rk-not-cooked-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--rk-space-3);
  padding: var(--rk-space-3) 0;
  border-top: 1px solid var(--rk-border);
}
.rk-not-cooked-row:first-child { border-top: none; }
.rk-not-cooked-form {
  display: flex;
  align-items: center;
  gap: var(--rk-space-2);
  flex-wrap: wrap;
}
.rk-not-cooked-form input[type="number"] {
  width: 92px;
  padding: 0.4rem 0.6rem;
  border-radius: var(--rk-radius-sm);
  border: 1px solid var(--rk-border-strong);
  background: var(--rk-surface);
  font-size: 0.8125rem;
  font-family: inherit;
}
.rk-not-cooked-form label { font-size: 0.75rem; color: var(--rk-text-secondary); }

/* ============================================================
   Compliance — coverage board, checklist run, history, authoring
   ============================================================ */

/* ---- scheduled-check board ---- */

.rk-visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.rk-coverage-name {
  display: block;
  font-size: 0.9375rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.rk-coverage-sub {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--rk-text-secondary);
  font-variant-numeric: tabular-nums;
}

.rk-occurrence {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--rk-space-4);
  padding: var(--rk-space-3) var(--rk-space-5);
  border-top: 1px solid var(--rk-border);
}
.rk-occurrence:first-child { border-top: none; }
/* Missed work is the loudest thing on the page; work already done recedes. */
.rk-occurrence[data-state="missed"] { background: var(--rk-danger-tint); }
.rk-occurrence[data-state="clear"] .rk-coverage-name { font-weight: 600; color: var(--rk-text-secondary); }

.rk-occurrence-when { display: flex; flex-direction: column; }
.rk-occurrence-time {
  font-size: 1.0625rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.rk-occurrence-what { min-width: 0; }
.rk-occurrence-go {
  display: flex;
  align-items: center;
  gap: var(--rk-space-3);
  justify-content: flex-end;
}
@media (max-width: 860px) {
  .rk-occurrence { grid-template-columns: 5.5rem minmax(0, 1fr); row-gap: var(--rk-space-2); }
  .rk-occurrence-state { grid-column: 2; }
  .rk-occurrence-go { grid-column: 1 / -1; justify-content: space-between; }
}

.rk-state-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--rk-radius-pill);
  font-size: 0.75rem;
  font-weight: 650;
  white-space: nowrap;
}
.rk-state-missed { background: var(--rk-danger-tint); color: var(--rk-danger-ink); }
.rk-state-due { background: var(--rk-warning-tint); color: var(--rk-warning-ink); }
.rk-state-upcoming { background: var(--rk-surface-sunken); color: var(--rk-text-secondary); }
.rk-state-flagged { background: var(--rk-danger-tint); color: var(--rk-danger-ink); }
.rk-state-clear { background: var(--rk-success-tint); color: var(--rk-success-ink); }

.rk-open-figure {
  font-size: 2.25rem;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--rk-warning-ink);
}
.rk-open-figure[data-tone="missed"] { color: var(--rk-danger-ink); }
.rk-open-figure[data-tone="clear"] { color: var(--rk-success-ink); }

.rk-action-strip { padding: var(--rk-space-4) var(--rk-space-5); margin-bottom: var(--rk-space-4); }
.rk-action-chips { display: flex; flex-wrap: wrap; gap: var(--rk-space-2); }

/* ---- actions ---- */

.rk-action-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--rk-space-3);
  padding: var(--rk-space-3) var(--rk-space-5);
  border-top: 1px solid var(--rk-border);
  text-decoration: none;
  color: inherit;
}
.rk-action-row:first-child { border-top: none; }
.rk-action-row:hover { background: var(--rk-surface-sunken); }
.rk-action-row[data-status="complete"] .rk-coverage-name {
  color: var(--rk-text-secondary);
  font-weight: 600;
}
.rk-action-main { min-width: 0; }
.rk-action-meta { display: flex; align-items: center; gap: var(--rk-space-2); flex-wrap: wrap; justify-content: flex-end; }

.rk-priority-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.rk-priority-dot[data-priority="high"] { background: var(--rk-danger); }
.rk-priority-dot[data-priority="medium"] { background: var(--rk-warning); }
.rk-priority-dot[data-priority="low"] { background: var(--rk-text-tertiary); }

/* ---- configuration notice (a checklist that is due nowhere) ---- */

.rk-config-note {
  display: flex;
  align-items: flex-start;
  gap: var(--rk-space-3);
  padding: var(--rk-space-4) var(--rk-space-5);
  margin-bottom: var(--rk-space-4);
  border: 1px solid var(--rk-warning);
  background: var(--rk-warning-tint);
  border-radius: var(--rk-radius-md);
  font-size: 0.875rem;
}
.rk-config-note .rk-icon { color: var(--rk-warning-ink); flex: none; }

/* ---- checklist run ---- */

.rk-check-list { display: flex; flex-direction: column; max-width: 56rem; }

.rk-check-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--rk-space-4);
  padding: var(--rk-space-4) var(--rk-space-5);
  border-top: 1px solid var(--rk-border);
}
.rk-check-row:first-child { border-top: none; }
.rk-check-prompt { font-size: 0.9375rem; line-height: 1.45; }
.rk-check-index {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--rk-text-tertiary);
  font-variant-numeric: tabular-nums;
  margin-right: 0.5rem;
}

.rk-verdict-group { display: flex; gap: var(--rk-space-2); }

.rk-verdict {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.95rem;
  border-radius: var(--rk-radius-pill);
  border: 1px solid var(--rk-border-strong);
  background: var(--rk-surface);
  color: var(--rk-text-secondary);
  font-size: 0.8125rem;
  font-weight: 650;
  cursor: pointer;
  user-select: none;
  transition: background var(--rk-duration-fast) var(--rk-ease-standard),
              color var(--rk-duration-fast) var(--rk-ease-standard),
              border-color var(--rk-duration-fast) var(--rk-ease-standard);
}
.rk-verdict input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.rk-verdict:hover { border-color: var(--rk-text-tertiary); }
.rk-verdict:has(input:focus-visible) { outline: 2px solid var(--rk-accent); outline-offset: 2px; }

/* The chosen chip. The live radio drives it; browsers without :has()
   (Firefox before 121) fall back to the row's data-state, which compliance.js
   keeps in step with the radios. The fallback is scoped so a browser that has
   :has() never paints a stale data-state chip next to the live one. */
.rk-verdict-pass:has(input:checked) {
  background: var(--rk-success-ink);
  border-color: var(--rk-success-ink);
  color: var(--rk-text-on-solid);
}
.rk-verdict-fail:has(input:checked) {
  background: var(--rk-danger-ink);
  border-color: var(--rk-danger-ink);
  color: var(--rk-text-on-solid);
}
@supports not selector(:has(a)) {
  .rk-check-row[data-state="pass"] .rk-verdict-pass {
    background: var(--rk-success-ink);
    border-color: var(--rk-success-ink);
    color: var(--rk-text-on-solid);
  }
  .rk-check-row[data-state="fail"] .rk-verdict-fail {
    background: var(--rk-danger-ink);
    border-color: var(--rk-danger-ink);
    color: var(--rk-text-on-solid);
  }
}

/* Unanswered rows stay visibly unanswered — a compliance record that cannot
   tell "not asked" from "passed" is worthless. */
.rk-check-row[data-answered="no"] { background: var(--rk-surface-sunken); }
.rk-check-row[data-answered="no"] .rk-verdict { border-style: dashed; }

.rk-corrective {
  grid-column: 1 / -1;
  display: none;
  flex-direction: column;
  gap: var(--rk-space-2);
  padding-top: var(--rk-space-3);
}
.rk-check-row[data-state="fail"] .rk-corrective { display: flex; }
.rk-check-row:has(input[value="fail"]:checked) .rk-corrective { display: flex; }

.rk-corrective-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--rk-danger-ink);
}
.rk-corrective textarea,
.rk-corrective input[type="text"] {
  width: 100%;
  font: inherit;
  font-size: 0.875rem;
  color: var(--rk-text);
  background: var(--rk-surface);
  border: 1px solid var(--rk-danger);
  border-radius: var(--rk-radius-sm);
  padding: 0.55rem 0.7rem;
  resize: vertical;
}
.rk-corrective textarea:focus-visible,
.rk-corrective input[type="text"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--rk-danger-tint);
}

.rk-corrective-owner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--rk-space-2) var(--rk-space-3);
}
.rk-corrective-owner select.rk-input { width: auto; min-width: 10rem; }
.rk-corrective-owner input[type="date"].rk-input { width: auto; }

/* ---- day-grouped board history ---- */

.rk-day-group .rk-occurrence:first-child { border-top: none; }

.rk-check-error {
  grid-column: 1 / -1;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--rk-danger-ink);
}

/* ---- sticky run bar ---- */

.rk-run-bar {
  position: sticky;
  bottom: 0;
  max-width: 56rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--rk-space-4);
  flex-wrap: wrap;
  margin-top: var(--rk-space-4);
  padding: var(--rk-space-4) var(--rk-space-5);
  border: 1px solid var(--rk-border);
  border-radius: var(--rk-radius-md);
  background: var(--rk-material-bg);
  backdrop-filter: blur(var(--rk-material-blur));
  -webkit-backdrop-filter: blur(var(--rk-material-blur));
  box-shadow: var(--rk-shadow-lg);
}
.rk-run-progress { font-size: 0.875rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.rk-run-reason { font-size: 0.8125rem; color: var(--rk-warning-ink); font-weight: 600; }
.rk-btn[aria-disabled="true"] {
  cursor: not-allowed;
  background: var(--rk-surface-sunken);
  border-color: var(--rk-border-strong);
  color: var(--rk-text-secondary);
  box-shadow: none;
}

/* ---- record detail ---- */

.rk-answer-row {
  display: flex;
  align-items: flex-start;
  gap: var(--rk-space-3);
  padding: var(--rk-space-3) var(--rk-space-5);
  border-top: 1px solid var(--rk-border);
}
.rk-answer-row:first-child { border-top: none; }
.rk-answer-mark { flex: none; margin-top: 0.1rem; }
.rk-answer-pass .rk-answer-mark { color: var(--rk-success); }
.rk-answer-fail .rk-answer-mark { color: var(--rk-danger); }
.rk-answer-fail { background: var(--rk-danger-tint); }
.rk-answer-action {
  margin-top: 0.3rem;
  font-size: 0.8125rem;
  color: var(--rk-text-secondary);
}
.rk-answer-action strong { color: var(--rk-danger-ink); font-weight: 650; }

/* ---- history ---- */

.rk-cycle-group {
  padding: var(--rk-space-4) var(--rk-space-5);
  border-top: 1px solid var(--rk-border);
}
.rk-cycle-group:first-child { border-top: none; }
.rk-cycle-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--rk-space-3);
  flex-wrap: wrap;
}
.rk-cycle-date { font-size: 1rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.rk-cycle-coverage {
  display: flex;
  align-items: center;
  gap: var(--rk-space-3);
  margin-top: var(--rk-space-2);
}
.rk-cycle-bar {
  flex: 1;
  height: 6px;
  min-width: 80px;
  background: var(--rk-surface-sunken);
  border-radius: var(--rk-radius-pill);
  overflow: hidden;
}
.rk-cycle-bar-fill { height: 100%; background: var(--rk-success); border-radius: inherit; }
.rk-cycle-bar-fill[data-partial="true"] { background: var(--rk-warning); }
.rk-cycle-records {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rk-space-2);
  margin-top: var(--rk-space-3);
}
.rk-record-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--rk-radius-pill);
  border: 1px solid var(--rk-border);
  background: var(--rk-surface);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--rk-text-secondary);
  text-decoration: none;
}
.rk-record-chip:hover { border-color: var(--rk-text-tertiary); }
.rk-record-chip-fail { border-color: var(--rk-danger); background: var(--rk-danger-tint); color: var(--rk-danger-ink); }

/* ---- authoring ---- */

.rk-author-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--rk-space-4);
  align-items: start;
}
@media (max-width: 900px) {
  .rk-author-grid { grid-template-columns: 1fr; }
}

.rk-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--rk-space-3);
  padding: var(--rk-space-3) var(--rk-space-5);
  border-top: 1px solid var(--rk-border);
}
.rk-item-row:first-child { border-top: none; }
.rk-item-row-retired { color: var(--rk-text-tertiary); }
.rk-item-row-retired .rk-item-prompt { text-decoration: line-through; }
.rk-item-prompt { font-size: 0.9375rem; }

.rk-inline-form {
  display: flex;
  gap: var(--rk-space-2);
  align-items: flex-start;
  padding: var(--rk-space-4) var(--rk-space-5);
  border-top: 1px solid var(--rk-border);
}
.rk-inline-form .rk-input { flex: 1; }

.rk-checkbox-list > div {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rk-space-2);
}
.rk-checkbox-list label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--rk-radius-pill);
  border: 1px solid var(--rk-border-strong);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}
.rk-checkbox-list label:has(input:checked) {
  background: var(--rk-accent-tint);
  border-color: var(--rk-accent);
  color: var(--rk-accent-ink);
}

.rk-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--rk-text-secondary);
  padding: var(--rk-space-4) var(--rk-space-5) 0;
}


/* ---- typed answers ---- */

.rk-limit-tag {
  display: inline-block;
  margin-left: var(--rk-space-2);
  padding: 0.15rem 0.5rem;
  border-radius: var(--rk-radius-pill);
  background: var(--rk-surface-sunken);
  color: var(--rk-text-secondary);
  font-size: 0.6875rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rk-number-field { display: flex; align-items: center; gap: 0.4rem; }
.rk-number-field .rk-input { width: 7.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.rk-unit { font-size: 0.8125rem; font-weight: 650; color: var(--rk-text-secondary); }

.rk-verdict-group select.rk-input { min-width: 12rem; width: auto; }
.rk-verdict-group input[type="text"].rk-input { min-width: 16rem; width: auto; }

.rk-file-field {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--rk-radius-pill);
  border: 1px dashed var(--rk-border-strong);
  font-size: 0.8125rem;
  font-weight: 650;
  color: var(--rk-text-secondary);
  cursor: pointer;
  white-space: nowrap;
}
.rk-file-field:hover { border-color: var(--rk-accent); color: var(--rk-accent-ink); }
.rk-file-field input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.rk-file-field:has(input:focus-visible) { outline: 2px solid var(--rk-accent); outline-offset: 2px; }

.rk-extra-photos {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: var(--rk-space-3);
  padding-top: var(--rk-space-2);
}
.rk-photo-count { font-size: 0.75rem; font-weight: 650; color: var(--rk-success-ink); }

.rk-answer-value {
  font-size: 0.9375rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  margin-top: 0.15rem;
}
.rk-answer-value .rk-coverage-sub { display: inline; font-weight: 500; margin-left: 0.4rem; }

.rk-photo-strip { display: flex; gap: var(--rk-space-2); flex-wrap: wrap; margin-top: var(--rk-space-2); }
.rk-photo-strip img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: var(--rk-radius-sm);
  border: 1px solid var(--rk-border);
}

.rk-choice-row { display: flex; flex-wrap: wrap; gap: var(--rk-space-2); align-items: center; margin-top: var(--rk-space-2); }
.rk-choice-form { display: flex; gap: var(--rk-space-2); align-items: center; }
.rk-choice-form .rk-input { width: 9rem; }

.rk-item-add { padding: var(--rk-space-4) var(--rk-space-5); border-top: 1px solid var(--rk-border); }
.rk-item-add-row { display: flex; gap: var(--rk-space-2); align-items: center; flex-wrap: wrap; margin-top: var(--rk-space-2); }
.rk-item-add-row .rk-input { width: auto; }
.rk-item-add-row select.rk-input { min-width: 12rem; }
.rk-item-add-row input[type="number"].rk-input { width: 5.5rem; }
.rk-item-add-row input[type="text"].rk-input { width: 5rem; }

.rk-pager {
  display: flex;
  align-items: center;
  gap: var(--rk-space-3);
  justify-content: center;
  margin-top: var(--rk-space-4);
}
