@import url("../design-system/styles/components.css");

body {
  min-height: 100vh;
}

.rc-shell {
  min-height: 100vh;
  background: var(--ds-surface-canvas);
}

/* ─── Topbar ─── */

.rc-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: 5rem;
  border-bottom: 1px solid color-mix(in oklab, var(--ds-border-subtle) 60%, transparent);
  backdrop-filter: blur(12px);
  background: color-mix(in oklab, var(--ds-surface-canvas) 60%, transparent);
  transition: background-color 300ms ease, border-color 300ms ease;
}

.rc-topbar[data-is-opaque="true"] {
  background: color-mix(in oklab, var(--ds-surface-canvas) 95%, transparent);
  border-bottom-color: var(--ds-border-subtle);
}

.rc-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-lg);
  max-width: 80rem;
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--ds-space-xl);
}

.rc-brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.rc-brand:hover {
  color: inherit;
}

.rc-brand__logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  color: var(--cw-color-charcoal);
}

[data-theme="dark"] .rc-brand__logo-wrap {
  color: white;
}

.rc-brand__logo {
  width: 100%;
  height: 100%;
}

.rc-brand__title {
  margin: 0;
  font-family: var(--ds-font-family-ui);
  font-size: 1.5rem;
  font-weight: var(--cw-font-weight-semi-bold);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.rc-topbar__actions {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  flex-shrink: 0;
}

.rc-topbar__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ds-text-secondary);
  text-decoration: none;
  font-size: var(--ds-font-size-body);
  font-weight: var(--cw-font-weight-medium);
  transition: color 120ms ease;
}

.rc-topbar__link:hover {
  color: var(--ds-text-primary);
}

.rc-icon--external {
  width: 0.9rem;
  height: 0.9rem;
  flex-shrink: 0;
}

.rc-icon--external-sm {
  width: 0.9rem;
  height: 0.9rem;
  flex-shrink: 0;
  color: var(--ds-text-muted);
}

.rc-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: var(--ds-radius-md);
  background: transparent;
  color: var(--ds-text-muted);
  cursor: pointer;
  transition: color 120ms ease, background-color 120ms ease;
}

.rc-icon-button:hover {
  background: color-mix(in oklab, var(--ds-text-muted) 8%, transparent);
  color: var(--ds-text-primary);
}

.rc-nav-toggle {
  display: none;
}

.rc-nav-toggle__icon--close {
  display: none;
}

body.rc-nav-open .rc-nav-toggle__icon--menu {
  display: none;
}

body.rc-nav-open .rc-nav-toggle__icon--close {
  display: block;
}

.rc-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.rc-icon--hidden {
  display: none;
}

[data-theme="dark"] .rc-theme-toggle[data-theme-state="dark"] .rc-icon--sun,
[data-theme="light"] .rc-theme-toggle[data-theme-state="light"] .rc-icon--moon {
  display: none;
}

[data-theme="dark"] .rc-theme-toggle[data-theme-state="dark"] .rc-icon--moon,
[data-theme="light"] .rc-theme-toggle[data-theme-state="light"] .rc-icon--sun {
  display: block;
}

/* ─── Layout ─── */

.rc-layout {
  max-width: 80rem;
  margin: 0 auto;
  padding: calc(5rem + var(--ds-space-xl)) var(--ds-space-xl) var(--ds-space-xl);
}

.rc-layout--tool {
  max-width: 96rem;
}

.rc-main-grid {
  display: grid;
  gap: var(--ds-space-2xl);
  grid-template-columns: 15rem minmax(0, 1fr) 14rem;
}

.rc-main-grid--no-right-rail {
  grid-template-columns: 15rem minmax(0, 1fr);
}

.rc-main-grid--no-sidebar {
  grid-template-columns: minmax(0, 1fr) 14rem;
}

.rc-main-grid--no-sidebar.rc-main-grid--no-right-rail {
  grid-template-columns: minmax(0, 1fr);
}

/* ─── Sidebar ─── */

.rc-sidebar-shell {
  position: sticky;
  top: calc(5rem + var(--ds-space-xl));
  height: calc(100vh - (5rem + var(--ds-space-xl)));
  overflow-y: auto;
  padding: 0 0 var(--ds-space-2xl);
  padding-right: var(--ds-space-xl);
  scrollbar-width: thin;
  scrollbar-color: color-mix(in oklab, var(--ds-text-muted) 20%, transparent) transparent;
}

.rc-nav-root {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.rc-nav-sections {
  display: grid;
}

.rc-nav-section + .rc-nav-section {
  margin-top: var(--ds-space-xl);
}

.rc-nav-section__label {
  margin: 0 0 var(--ds-space-sm);
  padding-left: 0.75rem;
  color: var(--ds-text-muted);
  font-family: var(--ds-font-family-ui);
  font-size: 0.6875rem;
  font-weight: var(--cw-font-weight-semi-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.rc-nav-group {
  display: grid;
  gap: 2px;
}

.rc-nav-link,
.rc-nav-folder__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  border: 0;
  border-radius: var(--ds-radius-md);
  padding: 0.4375rem 0.75rem 0.4375rem 1.25rem;
  background: transparent;
  color: var(--ds-text-secondary);
  font: inherit;
  font-size: var(--ds-font-size-body-sm);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.rc-nav-link {
  justify-content: flex-start;
}

.rc-nav-folder__toggle {
  justify-content: flex-start;
}

.rc-nav-link:hover,
.rc-nav-folder__toggle:hover {
  background: color-mix(in oklab, var(--ds-text-muted) 6%, transparent);
  color: var(--ds-text-primary);
}

.rc-nav-link[aria-current="page"] {
  background: var(--ds-interactive-primary-bg);
  color: var(--ds-interactive-primary-fg);
  font-weight: var(--cw-font-weight-medium);
}

[data-theme="dark"] .rc-nav-link[aria-current="page"] {
  background: var(--ds-surface-contrast);
  color: var(--ds-text-inverse);
}

.rc-nav-folder__toggle[data-has-active-child="true"] {
  color: var(--ds-text-primary);
  font-weight: var(--cw-font-weight-medium);
}

.rc-nav-folder__toggle[aria-expanded="true"] {
  color: var(--ds-text-primary);
}

.rc-nav-folder__icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: var(--ds-text-muted);
  transition: transform 180ms ease;
}

.rc-nav-folder__toggle[aria-expanded="true"] .rc-nav-folder__icon {
  transform: rotate(90deg);
}

.rc-nav-folder__items {
  display: none;
  margin-top: 2px;
  padding-left: 0.75rem;
  border-left: 1px solid var(--ds-border-subtle);
  margin-left: 1.5rem;
}

.rc-nav-folder__items.is-open {
  display: grid;
  gap: 2px;
}

.rc-nav-logout-form {
  display: none;
  margin-top: auto;
  padding-top: var(--ds-space-xl);
}

.rc-logout-btn--nav {
  width: 100%;
  justify-content: center;
}

/* ─── Main content ─── */

.rc-main {
  min-width: 0;
  padding-top: var(--ds-space-xl);
  align-self: start;
  transition: opacity 160ms ease;
}

.rc-main--tool {
  padding-top: 0;
}

/* Keep navigation classes for compatibility, but disable fade transitions. */
.rc-main.is-leaving,
.rc-main.is-entering {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce), (update: slow) {
  .rc-topbar {
    backdrop-filter: none;
    background: var(--ds-surface-canvas);
  }

  .rc-main {
    transition: none;
  }
}

.rc-content {
  display: grid;
  gap: var(--ds-space-xl);
}

.rc-content--tool {
  gap: var(--ds-space-lg);
}

.rc-route-body {
  display: grid;
  gap: var(--ds-space-xl);
}

.rc-route-body--tool {
  gap: var(--ds-space-md);
}

.rc-tool-page {
  display: grid;
  gap: 0.4rem;
}

.rc-tool-page__back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  color: var(--ds-text-secondary);
  font-size: var(--ds-font-size-body-sm);
  font-weight: var(--cw-font-weight-medium);
  text-decoration: none;
}

.rc-tool-page__back:hover {
  color: var(--ds-text-primary);
}

.rc-route-body > .ds-card,
.rc-doc {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.rc-doc__header {
  display: grid;
  gap: var(--ds-space-md);
  margin-bottom: var(--ds-space-2xl);
}

.rc-doc__header p {
  max-width: 70ch;
  color: var(--ds-text-secondary);
  font-size: var(--ds-font-size-body);
  line-height: var(--cw-line-height-relaxed);
}

.rc-doc .ds-prose h1,
.rc-doc .ds-prose h2,
.rc-doc .ds-prose h3,
.rc-doc .ds-prose h4,
.rc-doc .ds-prose h5,
.rc-doc .ds-prose h6 {
  position: relative;
  scroll-margin-top: 7rem;
}

.rc-section-actions__text h1,
.rc-section-actions__text h2 {
  position: relative;
  scroll-margin-top: 7rem;
}

.rc-doc .ds-prose h2 {
  padding-top: var(--ds-space-xl);
  border-top: 1px solid var(--ds-border-subtle);
}

.rc-doc .ds-prose h2:first-child,
.rc-doc .ds-prose h1 + h2 {
  border-top: 0;
  padding-top: 0;
}

.rc-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
  opacity: 0;
  margin-left: 0;
  color: var(--ds-text-muted);
  text-decoration: none;
  transition: opacity 120ms ease, color 120ms ease;
  vertical-align: middle;
}

.rc-anchor-tail {
  white-space: nowrap;
}

/* Keep heading anchor links inline with heading text. */
.rc-doc .ds-prose .rc-anchor,
.rc-doc__header .rc-anchor,
.rc-section-actions__text .rc-anchor {
  display: inline-flex !important;
}

.rc-anchor svg {
  width: 0.65em;
  height: 0.65em;
}

.rc-doc h1:hover .rc-anchor,
.rc-doc h2:hover .rc-anchor,
.rc-doc h1:focus-within .rc-anchor,
.rc-doc h2:focus-within .rc-anchor {
  opacity: 1;
}

.rc-section-actions__text h1:hover .rc-anchor,
.rc-section-actions__text h2:hover .rc-anchor,
.rc-section-actions__text h1:focus-within .rc-anchor,
.rc-section-actions__text h2:focus-within .rc-anchor {
  opacity: 1;
}

.rc-doc__header h1:hover .rc-anchor,
.rc-doc__header h2:hover .rc-anchor,
.rc-doc__header h1:focus-within .rc-anchor,
.rc-doc__header h2:focus-within .rc-anchor {
  opacity: 1;
}

.rc-doc h3 .rc-anchor,
.rc-doc h4 .rc-anchor,
.rc-doc h5 .rc-anchor,
.rc-doc h6 .rc-anchor {
  display: none;
}

.rc-anchor:hover {
  color: var(--ds-interactive-link);
}

/* Hide heading link affordance on small screens; heading `id` fragments still work. */
@media (max-width: 767px) {
  .rc-anchor {
    display: none !important;
  }
}

.rc-copied-tooltip {
  position: absolute;
  bottom: calc(100% + 0.4rem);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 0.3rem 0.6rem;
  border-radius: var(--ds-radius-sm);
  background: var(--ds-surface-contrast);
  color: var(--ds-text-inverse);
  font-size: var(--ds-font-size-caption);
  font-weight: var(--cw-font-weight-medium);
  pointer-events: none;
  animation: rc-fade-in-out 1.5s ease forwards;
}

@keyframes rc-fade-in-out {
  0% { opacity: 0; transform: translateX(-50%) translateY(4px); }
  15% { opacity: 1; transform: translateX(-50%) translateY(0); }
  75% { opacity: 1; }
  100% { opacity: 0; }
}

/* ─── Kicker / breadcrumb ─── */

.rc-doc__header > .ds-badge,
.rc-section-actions .ds-badge {
  display: inline-block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ds-interactive-link);
  font-family: var(--ds-font-family-ui);
  font-size: var(--ds-font-size-body-sm);
  font-weight: var(--cw-font-weight-medium);
}

/* ─── Prose spacing ─── */

.rc-doc .ds-prose > * + * {
  margin-top: var(--ds-space-lg);
}

.rc-doc .ds-prose > h2 + *,
.rc-doc .ds-prose > h3 + *,
.rc-doc .ds-prose > h4 + * {
  margin-top: var(--ds-space-md);
}

.rc-doc .ds-prose > * + h2 {
  margin-top: var(--ds-space-2xl);
}

.rc-doc .ds-prose > * + h3 {
  margin-top: var(--ds-space-xl);
}

.rc-doc .ds-prose p {
  line-height: 1.8;
}

.rc-doc .ds-prose li {
  line-height: 1.75;
}

.rc-copy-template {
  position: relative;
}

.rc-copy-template__button {
  position: absolute;
  top: var(--ds-space-sm);
  right: var(--ds-space-sm);
  z-index: 1;
}

.rc-copy-template__textarea {
  display: block;
  width: 100%;
  min-height: 24rem;
  padding: var(--ds-space-xl);
  padding-top: calc(var(--ds-space-xl) + 2.75rem);
  border: 1px solid var(--ds-border-default);
  border-radius: var(--ds-radius-lg);
  background: var(--ds-surface-page);
  color: var(--ds-text-primary);
  font: inherit;
  line-height: 1.75;
  resize: vertical;
}

.rc-copy-template__textarea:read-only {
  cursor: text;
}

.rc-doc .ds-prose > ol,
.rc-doc .ds-prose ol:not(li ol) {
  padding-bottom: var(--ds-space-md);
}

.rc-doc .ds-prose > ul,
.rc-doc .ds-prose ul:not(li ul) {
  padding-bottom: var(--ds-space-sm);
}

.rc-doc--safety-program .rc-doc-toc {
  margin-bottom: var(--ds-space-2xl);
  padding: var(--ds-space-lg);
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-lg);
  background: color-mix(in oklab, var(--ds-surface-page) 90%, var(--ds-surface-card));
}

.rc-doc--safety-program .rc-doc-toc__title {
  margin: 0;
  font-size: var(--ds-font-size-body-sm);
  font-weight: var(--cw-font-weight-semi-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ds-text-muted);
}

.rc-doc--safety-program .rc-doc-toc ol {
  margin: var(--ds-space-sm) 0 0;
  padding-left: 1.15rem;
}

.rc-doc--safety-program .rc-doc-toc li + li {
  margin-top: 0.2rem;
}

.rc-doc--safety-program .rc-doc-toc a {
  text-decoration: none;
}

.rc-doc--safety-program .rc-doc-toc a:hover {
  text-decoration: underline;
}

.rc-doc--safety-program .rc-safety-table-wrap {
  overflow-x: auto;
}

.rc-doc--safety-program .rc-safety-table p {
  margin: 0;
}

.rc-doc--safety-program .rc-safety-table td ul,
.rc-doc--safety-program .rc-safety-table th ul {
  margin: var(--ds-space-xs) 0 0;
  padding-left: 1rem;
}

.rc-doc--safety-program .ds-prose ul ul,
.rc-doc--safety-program .ds-prose ul ol,
.rc-doc--safety-program .ds-prose ol ul,
.rc-doc--safety-program .ds-prose ol ol {
  margin-top: var(--ds-space-xs);
  padding-left: 1.75rem;
}

/* Make numbered sub-lists stand out more under bullet parents. */
.rc-doc--safety-program .ds-prose ul > li > ol {
  padding-left: 2rem;
}

/* Normalize DOCX-converted lists that were split into adjacent blocks. */
.rc-doc--safety-program .ds-prose > ul,
.rc-doc--safety-program .ds-prose > ol,
.rc-doc--safety-program .ds-prose ul:not(li ul),
.rc-doc--safety-program .ds-prose ol:not(li ol) {
  padding-bottom: 0;
  margin-bottom: var(--ds-space-sm);
}

.rc-doc--safety-program .ds-prose ul + ul,
.rc-doc--safety-program .ds-prose ul + ol,
.rc-doc--safety-program .ds-prose ol + ul,
.rc-doc--safety-program .ds-prose ol + ol {
  margin-top: 0;
}

.rc-doc--safety-program .rc-safety-note {
  margin-bottom: var(--ds-space-sm);
}

.rc-doc--safety-program .rc-safety-numbered {
  margin-top: 0;
}

/* ─── Lot evaluation checklist ─── */

.rc-doc--lot-evaluation .rc-doc__header-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ds-space-md);
}

.rc-doc--lot-evaluation .rc-doc__header-top h1 {
  margin: 0;
  flex: 1 1 auto;
  min-width: min(100%, 12rem);
}

.rc-doc--lot-evaluation .rc-lot-floating-download {
  position: fixed;
  left: 50%;
  bottom: max(var(--ds-space-xl), env(safe-area-inset-bottom));
  transform: translate(-50%, 1rem);
  z-index: 26;
  opacity: 0;
  pointer-events: none;
  padding: 0.8rem 1.4rem;
  font-size: 1rem;
  line-height: 1.2;
  background: #fff;
  border-color: var(--ds-border-subtle);
  box-shadow: 0 10px 22px color-mix(in oklab, var(--ds-text-primary) 14%, transparent);
  transition: opacity 220ms ease, transform 220ms ease;
}

.rc-doc--lot-evaluation a.rc-lot-floating-download.ds-btn--secondary:hover,
.rc-doc--lot-evaluation a.rc-lot-floating-download.ds-btn--secondary:focus-visible {
  background: #fff;
  border-color: color-mix(in oklab, var(--ds-text-primary) 28%, var(--ds-border-subtle));
}

.rc-doc--lot-evaluation .rc-lot-floating-download.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.rc-doc--lot-evaluation .rc-lot-subhead {
  margin: 0;
  font-family: var(--ds-font-family-heading);
  font-size: var(--ds-font-size-h5);
  font-weight: var(--cw-font-weight-semi-bold);
  letter-spacing: -0.01em;
  color: var(--ds-text-primary);
}

.rc-doc--lot-evaluation .ds-prose > h2 + .rc-lot-subhead {
  margin-top: var(--ds-space-md);
}

.rc-doc--lot-evaluation .ds-prose > ul + .rc-lot-subhead,
.rc-doc--lot-evaluation .ds-prose > .rc-note-list + .rc-lot-subhead {
  margin-top: var(--ds-space-xl);
}

.rc-doc--lot-evaluation .rc-lot-workflow-table-wrap {
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-lg);
  padding: 0 var(--ds-space-md);
  background: color-mix(in oklab, var(--ds-surface-page) 95%, var(--ds-surface-card));
}

.rc-doc--lot-evaluation .rc-lot-workflow-table th:nth-child(1),
.rc-doc--lot-evaluation .rc-lot-workflow-table td:nth-child(1) {
  width: 4.75rem;
  text-align: center;
}

.rc-doc--lot-evaluation .rc-lot-workflow-table th:nth-child(3),
.rc-doc--lot-evaluation .rc-lot-workflow-table td:nth-child(3) {
  width: 34%;
}

.rc-doc--lot-evaluation .rc-lot-workflow-table td input[type="checkbox"] {
  margin: 0;
}

.rc-doc--lot-evaluation .rc-lot-core-table td:first-child {
  width: 12rem;
  text-align: left;
}

.rc-doc--lot-evaluation .rc-lot-core-table td:nth-child(2) {
  width: auto;
}

.rc-doc--lot-evaluation .rc-lot-core-table td {
  vertical-align: middle;
}

.rc-doc--lot-evaluation .rc-lot-input,
.rc-doc--lot-evaluation .rc-lot-note-input,
.rc-doc--lot-evaluation .rc-lot-final-notes__input {
  width: 100%;
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-md);
  background: var(--ds-surface-card);
  color: var(--ds-text-primary);
  font: inherit;
  font-size: var(--ds-font-size-body);
  line-height: 1.5;
}

.rc-doc--lot-evaluation .rc-lot-input {
  min-height: 2.25rem;
  padding: 0.4rem 0.6rem;
}

.rc-doc--lot-evaluation .rc-lot-note-input {
  min-height: 4.5rem;
  resize: vertical;
  padding: 0.5rem 0.6rem;
}

.rc-doc--lot-evaluation .rc-lot-status-cell {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-space-md);
}

.rc-doc--lot-evaluation .rc-lot-final-notes {
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-lg);
  padding: var(--ds-space-lg);
  margin-bottom: calc(var(--ds-space-xl) + var(--ds-space-lg));
  background: color-mix(in oklab, var(--ds-surface-page) 95%, var(--ds-surface-card));
}

.rc-doc--lot-evaluation .rc-lot-final-notes__input {
  min-height: 12rem;
  resize: vertical;
  padding: 0.65rem 0.75rem;
}

.rc-doc--lot-evaluation .rc-lot-field-grid {
  display: grid;
  gap: var(--ds-space-md);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: var(--ds-space-lg);
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-lg);
  background: color-mix(in oklab, var(--ds-surface-page) 92%, var(--ds-surface-card));
}

.rc-doc--lot-evaluation .rc-lot-field {
  display: grid;
  gap: var(--ds-space-xs);
  margin: 0;
  color: var(--ds-text-secondary);
  font-weight: var(--cw-font-weight-medium);
}

.rc-doc--lot-evaluation .rc-lot-field--wide {
  grid-column: 1 / -1;
}

.rc-doc--lot-evaluation .rc-lot-field span {
  display: block;
  min-height: 2.25rem;
  border-bottom: 1px solid var(--ds-border-strong);
}

.rc-doc--lot-evaluation .rc-lot-field--checkboxes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ds-space-sm) var(--ds-space-lg);
  margin: 0;
  padding: 0;
  border: 0;
}

.rc-doc--lot-evaluation .rc-lot-field--checkboxes legend {
  width: 100%;
  color: var(--ds-text-secondary);
  font-weight: var(--cw-font-weight-medium);
}

.rc-doc--lot-evaluation .rc-lot-field--checkboxes label,
.rc-doc--lot-evaluation .rc-checklist label {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.rc-doc--lot-evaluation .rc-checklist {
  list-style: none;
  padding-left: 0;
}

.rc-doc--lot-evaluation .rc-checklist li + li {
  margin-top: var(--ds-space-xs);
}

.rc-doc--lot-evaluation input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  margin-top: 0.35em;
  accent-color: var(--ds-interactive-link);
}

.rc-doc--lot-evaluation .rc-note-list {
  list-style: none;
  padding-left: 0;
}

.rc-doc--lot-evaluation .rc-note-list li {
  padding-bottom: var(--ds-space-md);
  border-bottom: 1px solid color-mix(in oklab, var(--ds-border-strong) 65%, transparent);
}

@media (max-width: 767px) {
  .rc-doc--lot-evaluation .rc-lot-field-grid {
    grid-template-columns: 1fr;
  }

  .rc-doc--lot-evaluation .rc-lot-floating-download {
    bottom: calc(max(var(--ds-space-lg), env(safe-area-inset-bottom)) + var(--ds-space-sm));
  }
}

/* ─── Highlight cards ─── */

.rc-highlight-grid {
  display: grid;
  gap: var(--ds-space-md);
  grid-template-columns: 1fr;
  margin-top: var(--ds-space-lg);
}

.rc-highlight-card {
  height: 100%;
  display: grid;
  gap: var(--ds-space-sm);
  align-content: start;
}

.rc-highlight-card h3 {
  font-size: var(--ds-font-size-h5);
  font-family: var(--ds-font-family-heading);
}

.rc-highlight-card p {
  font-size: var(--ds-font-size-body-sm);
  color: var(--ds-text-secondary);
}

.rc-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ds-text-muted);
  font-size: var(--ds-font-size-body-sm);
}

.rc-kicker svg {
  width: 0.95rem;
  height: 0.95rem;
}

.rc-inline-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ─── Right rail ─── */

.rc-right-rail {
  min-width: 0;
  padding-top: 0;
}

.rc-right-rail[hidden] {
  display: none !important;
}

.rc-right-rail__inner {
  position: sticky;
  top: calc(5rem + var(--ds-space-xl));
  display: grid;
  gap: var(--ds-space-xl);
}

.rc-right-rail__section {
  display: grid;
  gap: var(--ds-space-sm);
}

.rc-right-rail__title {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: var(--cw-font-weight-semi-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ds-text-muted);
}

/* ─── TOC ─── */

.rc-toc {
  display: grid;
  gap: 0.125rem;
}

.rc-toc--empty {
  color: var(--ds-text-muted);
  font-size: var(--ds-font-size-body-sm);
}

.rc-toc a {
  display: block;
  border-radius: var(--ds-radius-md);
  padding: 0.3rem 0.5rem;
  color: var(--ds-text-muted);
  text-decoration: none;
  font-size: var(--ds-font-size-body-sm);
  transition: color 120ms ease, background-color 120ms ease;
}

.rc-toc a:hover {
  color: var(--ds-text-primary);
}

.rc-toc a.is-active {
  color: var(--ds-text-primary);
  font-weight: var(--cw-font-weight-semi-bold);
}

.rc-toc a[data-level="3"] {
  padding-left: 1rem;
}

.rc-toc a[data-level="4"] {
  padding-left: 1.45rem;
}

/* Print/export rail block: keep markup; hide until behavior is finalized. */
.rc-export-section {
  display: none !important;
}

/* ─── Export button (Quo-style ghost) ─── */

.rc-export-group {
  position: relative;
  display: inline-flex;
  width: 100%;
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-lg);
}

.rc-export-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
  min-height: 2.25rem;
  padding: 0.4rem 0.75rem;
  border: 0;
  border-radius: var(--ds-radius-lg);
  background: var(--ds-surface-page);
  color: var(--ds-text-secondary);
  font: inherit;
  font-size: var(--ds-font-size-body-sm);
  font-weight: var(--cw-font-weight-medium);
  cursor: pointer;
  transition: color 120ms ease, background-color 120ms ease;
}

.rc-export-btn:hover {
  background: color-mix(in oklab, var(--ds-text-muted) 10%, var(--ds-surface-page));
  color: var(--ds-text-primary);
}

.rc-export-btn--toggle {
  flex: 0 0 2.25rem;
  border-left: 1px solid var(--ds-border-subtle);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  padding: 0;
}

.rc-export-btn:first-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.rc-export-btn--toggle .rc-icon {
  width: 0.625rem;
  height: 0.625rem;
}

/* ─── Legacy split-button compat ─── */

.rc-split-button {
  position: relative;
  display: inline-flex;
  width: 100%;
}

.rc-split-button .ds-btn {
  flex: 1;
  min-width: 0;
}

.rc-split-button__primary {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.rc-split-button__toggle {
  flex: 0 0 2.65rem;
  border-left: 1px solid color-mix(in oklab, var(--ds-interactive-secondary-border) 85%, transparent);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  padding: 0;
}

.rc-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 30;
  display: none;
  min-width: 11rem;
  padding: 0.35rem;
  border: 1px solid var(--ds-border-default);
  border-radius: var(--ds-radius-md);
  background: var(--ds-surface-card);
  box-shadow: var(--ds-shadow-md);
}

.rc-menu.is-open {
  display: grid;
  gap: 0.2rem;
}

.rc-menu__item {
  width: 100%;
  border: 0;
  border-radius: var(--ds-radius-sm);
  background: transparent;
  color: var(--ds-text-secondary);
  cursor: pointer;
  font: inherit;
  padding: 0.55rem 0.65rem;
  text-align: left;
}

.rc-menu__item:hover,
.rc-menu__item:focus-visible {
  background: var(--ds-surface-page);
  color: var(--ds-text-primary);
}

.rc-menu__item[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.rc-status {
  display: none;
  border-radius: var(--ds-radius-md);
  padding: 0.75rem 0.9rem;
  background: color-mix(in oklab, var(--ds-info) 8%, var(--ds-surface-page));
  color: var(--ds-text-secondary);
  font-size: var(--ds-font-size-body-sm);
}

.rc-status.is-visible {
  display: block;
}

/* ─── Directory table ─── */

.rc-table-wrap--directory {
  border: 0;
  background: transparent;
}

.rc-directory-table th {
  background: transparent;
  color: var(--ds-text-muted);
}

.rc-directory-table td,
.rc-directory-table th {
  padding: var(--ds-space-md) 0;
  padding-right: 0.85rem;
  border-bottom-color: var(--ds-border-subtle);
  vertical-align: middle;
}

.rc-directory-table td:last-child,
.rc-directory-table th:last-child {
  padding-right: 0;
}

.rc-directory-table a {
  word-break: break-word;
}

.rc-copy-link {
  position: relative;
}

.rc-copy-link--plain,
.rc-copy-link--plain:visited,
.rc-copy-link--plain:hover,
.rc-copy-link--plain:focus-visible {
  color: inherit;
  text-decoration: none;
  font: inherit;
}

.rc-copy-hint {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.4rem);
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 0.3rem 0.6rem;
  border-radius: var(--ds-radius-sm);
  background: var(--ds-surface-contrast);
  color: var(--ds-text-inverse);
  font-size: var(--ds-font-size-caption);
  font-weight: var(--cw-font-weight-medium);
  pointer-events: none;
}

@media (min-width: 768px) {
  .rc-copy-link {
    cursor: inherit;
  }

  .rc-copy-link:hover .rc-copy-hint,
  .rc-copy-link:focus-visible .rc-copy-hint {
    display: inline-flex;
  }

  .rc-copy-link.is-copied .rc-copy-hint {
    display: none;
  }
}

.rc-icon-btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-md);
  background: transparent;
  color: var(--ds-text-muted);
  cursor: pointer;
  transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.rc-icon-btn-download:hover {
  color: var(--ds-text-primary);
  background: var(--ds-surface-page);
  border-color: var(--ds-border-default);
}

.rc-icon-btn-download .rc-icon {
  width: 1rem;
  height: 1rem;
}

/* ─── Section actions ─── */

.rc-section-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--ds-space-md);
}

.rc-section-actions--split {
  display: grid;
  grid-template-columns: 6fr 4fr;
  align-items: start;
  gap: var(--ds-space-lg);
}

.rc-section-actions__text {
  display: grid;
  gap: var(--ds-space-md);
}

.rc-section-actions__text p {
  max-width: 70ch;
  color: var(--ds-text-secondary);
  font-size: var(--ds-font-size-body);
  line-height: var(--cw-line-height-relaxed);
}

.rc-section-actions__cta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.rc-section-actions--split .rc-section-actions__cta {
  align-self: center;
}

.rc-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: var(--ds-radius-pill);
  background: color-mix(in oklab, var(--ds-warning) 14%, var(--ds-surface-page));
  color: var(--ds-text-secondary);
  font-size: var(--ds-font-size-caption);
  font-weight: var(--cw-font-weight-medium);
}

.rc-pill--shared-login {
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-md);
  background: transparent;
  color: var(--ds-text-muted);
  font-size: 0.6875rem;
  font-weight: var(--cw-font-weight-semi-bold);
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* ─── Inline help ─── */

.rc-inline-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.rc-inline-help__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border: 1px solid var(--ds-border-default);
  border-radius: 999px;
  background: var(--ds-surface-card);
  color: var(--ds-text-muted);
  cursor: help;
  font-size: 0.72rem;
  line-height: 1;
}

.rc-inline-help__tooltip {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.45rem);
  z-index: 15;
  display: none;
  width: min(18rem, 80vw);
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--ds-border-default);
  border-radius: var(--ds-radius-md);
  background: var(--ds-surface-card);
  box-shadow: var(--ds-shadow-md);
  color: var(--ds-text-secondary);
  font-size: var(--ds-font-size-body-sm);
}

.rc-inline-help:hover .rc-inline-help__tooltip,
.rc-inline-help:focus-within .rc-inline-help__tooltip {
  display: block;
}

/* ─── Card grids ─── */

.rc-card-grid,
.rc-form-grid,
.rc-app-grid {
  display: grid;
  gap: var(--ds-space-md);
  grid-template-columns: 1fr;
}

.rc-social-grid {
  display: grid;
  gap: var(--ds-space-md);
  grid-template-columns: 1fr;
}

/* Data-driven list/table shells should span full content width. */
.rc-app-grid[data-app-grid],
.rc-form-grid[data-form-grid] {
  grid-template-columns: 1fr;
}

@media (min-width: 700px) {
  .rc-highlight-grid,
  .rc-card-grid,
  .rc-form-grid,
  .rc-app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rc-social-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rc-app-grid[data-app-grid],
  .rc-form-grid[data-form-grid] {
    grid-template-columns: 1fr;
  }
}

.rc-app-section {
  margin-top: var(--ds-space-2xl);
}

.rc-app-section__header {
  margin-bottom: var(--ds-space-lg);
}

.rc-card-link {
  display: grid;
  gap: 0.5rem;
  height: 100%;
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-lg);
  background: var(--ds-surface-card);
  color: inherit;
  padding: var(--ds-space-lg);
  text-decoration: none;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.rc-card-link:hover {
  border-color: color-mix(in oklab, var(--ds-interactive-link) 30%, var(--ds-border-subtle));
  background: color-mix(in oklab, var(--ds-surface-card) 92%, var(--ds-surface-page));
}

.rc-card-link--disabled {
  cursor: default;
}

.rc-card-link--disabled:hover {
  border-color: var(--ds-border-subtle);
  background: var(--ds-surface-card);
}

.rc-card-link__title {
  margin: 0;
  font-size: var(--ds-font-size-h5);
}

.rc-card-link__meta {
  color: var(--ds-text-muted);
  font-size: var(--ds-font-size-body-sm);
}

.rc-card-link__icon {
  width: 1.5rem;
  height: 1.5rem;
}

.rc-social-card__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.rc-social-card__favicon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: var(--ds-surface-page);
  object-fit: cover;
}

/* ─── Carousel ─── */

.rc-carousel {
  display: grid;
  gap: var(--ds-space-md);
}

.rc-carousel__track {
  display: grid;
  gap: var(--ds-space-md);
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 1fr);
  overflow-x: auto;
  padding-bottom: 0.2rem;
  scroll-snap-type: x mandatory;
}

.rc-carousel__track > * {
  scroll-snap-align: start;
}

.rc-carousel__card {
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-lg);
  background: var(--ds-surface-card);
  overflow: clip;
}

.rc-carousel__card iframe,
.rc-carousel__card blockquote {
  width: 100%;
  margin: 0;
}

.rc-carousel__card iframe {
  min-height: 34rem;
  border: 0;
}

.rc-embed-placeholder {
  display: grid;
  gap: 0.85rem;
  min-height: 22rem;
  align-content: center;
  justify-items: start;
  padding: var(--ds-space-lg);
}

/* ─── Tabs ─── */

.rc-tablist {
  display: flex;
  width: fit-content;
  margin-inline: auto;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.25rem;
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-pill);
  background: var(--ds-surface-page);
}

.rc-tab {
  border: 0;
  border-radius: var(--ds-radius-pill);
  background: transparent;
  color: var(--ds-text-secondary);
  cursor: pointer;
  font: inherit;
  font-weight: var(--cw-font-weight-medium);
  padding: 0.55rem 0.95rem;
}

.rc-tab[aria-selected="true"] {
  background: var(--ds-surface-card);
  box-shadow: var(--ds-shadow-sm);
  color: var(--ds-text-primary);
}

.rc-tab-panel {
  display: none;
}

.rc-tab-panel.is-active {
  display: block;
}

.rc-guide-figure {
  margin: var(--ds-space-2xl) 0;
}

.rc-guide-figure__image {
  display: block;
  width: 100%;
  max-width: min(90%, 52rem);
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-lg);
  background: var(--ds-surface-card);
  box-shadow: var(--ds-shadow-md), var(--ds-shadow-sm);
}

.rc-guide-figure__caption {
  margin-top: var(--ds-space-sm);
  max-width: min(90%, 52rem);
  margin-left: auto;
  margin-right: auto;
  color: var(--ds-text-secondary);
  font-size: var(--ds-font-size-body-sm);
}

@media (min-width: 640px) {
  .rc-guide-figure__image {
    max-width: min(68%, 52rem);
  }

  .rc-guide-figure__caption {
    max-width: min(68%, 52rem);
  }
}

/* ─── Tables ─── */

.rc-doc table td strong,
.rc-doc table th strong {
  font-weight: var(--cw-font-weight-semi-bold);
}

.rc-data-table td,
.rc-data-table th {
  white-space: nowrap;
}

.rc-data-table td:first-child,
.rc-data-table th:first-child {
  white-space: normal;
}

/* ─── App table ─── */

.rc-app-table {
  display: grid;
  gap: 0;
}

.rc-app-table__row {
  display: grid;
  grid-template-columns: 2.5rem 1fr 2fr 2rem;
  gap: var(--ds-space-md);
  align-items: center;
  padding: var(--ds-space-md) var(--ds-space-sm);
  border-bottom: 1px solid var(--ds-border-subtle);
  text-decoration: none;
  color: inherit;
  transition: background-color 120ms ease;
}

a.rc-app-table__row:hover {
  background: color-mix(in oklab, var(--ds-surface-page) 50%, var(--ds-surface-card));
}

.rc-app-table__row--disabled {
  cursor: default;
  opacity: 0.7;
}

.rc-app-table__row:last-child {
  border-bottom: 0;
}

.rc-app-table__cell--icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.rc-app-table__icon {
  width: 1.75rem;
  height: 1.75rem;
  padding: 0.1875rem;
  box-sizing: border-box;
  border-radius: 0.375rem;
  object-fit: contain;
  object-position: center;
  background: var(--ds-surface-page);
}

.rc-app-table__icon-placeholder {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.375rem;
  background: var(--ds-surface-muted);
}

.rc-app-table__cell--name {
  font-weight: var(--cw-font-weight-semi-bold);
  font-size: var(--ds-font-size-body);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rc-app-table__cell--desc {
  color: var(--ds-text-secondary);
  font-size: var(--ds-font-size-body-sm);
}

.rc-app-table__cell--action {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Summary stack ─── */

.rc-summary-stack {
  display: grid;
  gap: var(--ds-space-md);
}

.rc-summary-stack .ds-card h3 {
  font-size: var(--ds-font-size-h5);
  font-family: var(--ds-font-family-heading);
}

.rc-summary-stack .ds-card p {
  font-size: var(--ds-font-size-body-sm);
  color: var(--ds-text-secondary);
  margin-top: var(--ds-space-xs);
}

/* ─── IG embed ─── */

.rc-ig-section {
  display: grid;
  gap: var(--ds-space-md);
  margin-top: var(--ds-space-2xl);
}

.rc-ig-embed-wrap {
  max-width: 540px;
}

.rc-ig-embed-wrap .instagram-media {
  max-width: 100% !important;
  width: 100% !important;
  min-width: 0 !important;
}

/* ─── Forms table ─── */

.rc-forms-table td:first-child {
  white-space: nowrap;
}

.rc-forms-table td:nth-child(2) {
  color: var(--ds-text-secondary);
  font-size: var(--ds-font-size-body-sm);
}

.rc-forms-table td:last-child {
  width: 3rem;
  text-align: center;
}

/* ─── Misc ─── */

.rc-empty-state {
  border: 1px dashed var(--ds-border-default);
  border-radius: var(--ds-radius-md);
  padding: var(--ds-space-md);
  color: var(--ds-text-muted);
}

.rc-callout--extra-top {
  padding-top: var(--ds-space-lg);
}

.rc-btn--flat,
.rc-btn--flat:hover,
.rc-btn--flat:focus-visible {
  text-decoration: none;
}

.rc-btn--flat.ds-btn--primary:hover {
  background: var(--ds-interactive-primary-bg);
  color: var(--ds-interactive-primary-fg);
}

.rc-btn--flat.ds-btn--primary:focus-visible {
  color: var(--ds-interactive-primary-fg);
}

.rc-noscript {
  max-width: 42rem;
  margin: 8vh auto;
}

.rc-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.rc-user-chip {
  display: grid;
  gap: 0.125rem;
  min-width: 0;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-pill);
  background: color-mix(in oklab, var(--ds-surface-card) 92%, transparent);
}

/* Temporarily hide identity chip while keeping auth/user plumbing intact. */
.rc-topbar__actions .rc-user-chip {
  display: none;
}

.rc-user-chip__name {
  font-size: var(--ds-font-size-body-sm);
  font-weight: var(--cw-font-weight-semi-bold);
  color: var(--ds-text-primary);
}

.rc-user-chip__meta {
  font-size: 0.75rem;
  color: var(--ds-text-muted);
}

.rc-inline-form {
  margin: 0;
}

.rc-logout-btn {
  white-space: nowrap;
}

.rc-nav-backdrop {
  display: none;
}

.rc-inline-status {
  margin-bottom: calc(-1 * var(--ds-space-sm));
}

/* ─── Auth layout ─── */

.rc-auth-body {
  min-height: 100vh;
  background: var(--ds-surface-canvas);
}

.rc-auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.rc-auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--ds-space-lg) var(--ds-space-xl);
  max-width: 80rem;
  width: 100%;
  margin: 0 auto;
}

.rc-auth-main {
  display: grid;
  place-items: center;
  padding: var(--ds-space-xl);
}

.rc-auth-card {
  width: min(100%, 26rem);
  display: grid;
  gap: var(--ds-space-xl);
}

.rc-brand--auth .rc-brand__title {
  font-size: 1.25rem;
}

/* ─── Auth header block ─── */

.rc-auth-header {
  display: grid;
  gap: var(--ds-space-md);
}

.rc-auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem 0.25rem 0.5rem;
  border-radius: var(--ds-radius-pill);
  background: color-mix(in oklab, var(--ds-border-subtle) 50%, var(--ds-surface-page));
  color: var(--ds-text-secondary);
  font-size: var(--ds-font-size-caption);
  font-weight: var(--cw-font-weight-medium);
  width: fit-content;
}

.rc-auth-badge__icon {
  width: 0.85rem;
  height: 0.85rem;
  flex-shrink: 0;
}

.rc-auth-badge--warning {
  background: color-mix(in oklab, var(--ds-warning) 12%, var(--ds-surface-page));
  color: var(--ds-warning);
}

[data-theme="dark"] .rc-auth-badge--warning {
  color: #e0a800;
}

.rc-auth-heading {
  font-family: var(--ds-font-family-heading);
  font-size: var(--ds-font-size-h2);
  font-weight: var(--ds-font-weight-heading);
  line-height: var(--ds-line-height-heading);
  letter-spacing: -0.01em;
  color: var(--ds-text-primary);
}

.rc-auth-subtext {
  color: var(--ds-text-secondary);
  font-size: var(--ds-font-size-body);
  line-height: var(--cw-line-height-relaxed);
  max-width: 38ch;
}

/* ─── Auth form ─── */

.rc-auth-form {
  display: grid;
  gap: var(--ds-space-lg);
}

.rc-auth-divider {
  display: flex;
  align-items: center;
  gap: var(--ds-space-md);
  color: var(--ds-text-muted);
  font-size: var(--ds-font-size-body-sm);
}

.rc-auth-divider::before,
.rc-auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ds-border-subtle);
}

.rc-auth-submit {
  justify-content: center;
  margin-top: var(--ds-space-xs);
  min-height: 3.25rem;
  font-size: 1.25rem;
  text-decoration: none;
  transform: translateY(0) scale(1);
  transition: transform 180ms ease;
}

.rc-auth-submit:visited,
.rc-auth-submit:hover,
.rc-auth-submit:focus-visible,
.rc-auth-submit:active {
  text-decoration: none;
}

.rc-auth-submit:hover,
.rc-auth-submit:focus-visible {
  color: var(--ds-interactive-primary-fg);
  transform: translateY(-2px) scale(1.025);
}

/* ─── Auth footer ─── */

.rc-auth-footer {
  display: flex;
  justify-content: center;
  padding: var(--ds-space-lg) var(--ds-space-xl);
}

.rc-auth-footer__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ds-text-muted);
  text-decoration: none;
  font-size: var(--ds-font-size-body-sm);
  transition: color 120ms ease;
}

.rc-auth-footer__link:hover {
  color: var(--ds-text-primary);
}

@media (max-width: 640px) {
  .rc-auth-topbar {
    padding: var(--ds-space-md);
  }

  .rc-auth-main {
    padding: var(--ds-space-lg) var(--ds-space-md);
  }

  .rc-auth-heading {
    font-size: var(--ds-font-size-h3);
  }
}

/* ─── Responsive ─── */

@media (max-width: 1260px) {
  .rc-main-grid {
    grid-template-columns: 15rem minmax(0, 1fr);
  }

  .rc-main-grid--no-right-rail {
    grid-template-columns: 15rem minmax(0, 1fr);
  }

  .rc-main-grid--no-sidebar {
    grid-template-columns: minmax(0, 1fr);
  }

  .rc-right-rail {
    display: none !important;
  }

  .rc-app-table__row {
    grid-template-columns: 2rem 1fr 2fr 1.5rem;
  }
}

@media (max-width: 1024px) {
  .rc-layout {
    padding: calc(5rem + var(--ds-space-lg)) var(--ds-space-lg) var(--ds-space-lg);
  }

  html.rc-nav-open,
  body.rc-nav-open {
    overflow: hidden;
  }

  .rc-main-grid {
    grid-template-columns: 1fr;
    gap: var(--ds-space-xl);
  }

  .rc-topbar__link,
  .rc-topbar__actions > .rc-inline-form {
    display: none;
  }

  .rc-nav-toggle {
    display: inline-flex;
  }

  /* Larger tap targets for theme + menu icons on tablet and down */
  .rc-topbar__actions .rc-icon-button {
    width: 3rem;
    height: 3rem;
  }

  .rc-topbar__actions .rc-icon-button .rc-icon {
    width: 1.5rem;
    height: 1.5rem;
  }

  .rc-sidebar-shell {
    position: fixed;
    top: 5rem;
    right: 0;
    z-index: 45;
    width: min(22rem, 100vw);
    height: calc(100vh - 5rem);
    overflow-y: auto;
    padding: var(--ds-space-lg);
    border-left: 1px solid var(--ds-border-subtle);
    background: var(--ds-surface-canvas);
    box-shadow: var(--ds-shadow-lg);
    transform: translateX(100%);
    transition: transform 220ms ease;
  }

  body.rc-nav-open .rc-sidebar-shell {
    transform: translateX(0);
  }

  .rc-nav-backdrop {
    position: fixed;
    inset: 5rem 0 0;
    z-index: 40;
    border: 0;
    background: color-mix(in oklab, var(--ds-surface-canvas) 35%, black);
    opacity: 0;
    transition: opacity 220ms ease;
  }

  body.rc-nav-open .rc-nav-backdrop {
    display: block;
    opacity: 1;
  }

  .rc-nav-root {
    min-height: 100%;
  }

  .rc-nav-link,
  .rc-nav-folder__toggle {
    min-height: 2.75rem;
    padding: 0.625rem 0.875rem 0.625rem 1.25rem;
    font-size: var(--ds-font-size-body);
  }

  .rc-nav-logout-form {
    display: block;
  }

  .rc-right-rail__inner {
    position: static;
  }

  .rc-right-rail {
    order: 3;
  }
}

@media (max-width: 640px) {
  .rc-topbar__inner {
    padding: 0 var(--ds-space-md);
  }

  .rc-topbar__actions {
    gap: var(--ds-space-sm);
  }

  .rc-user-chip {
    display: none;
  }

  .rc-brand__title {
    font-size: 1.125rem;
  }

  .rc-sidebar-shell {
    width: 100vw;
    padding: var(--ds-space-md);
  }

  .rc-section-actions {
    align-items: stretch;
  }

  .rc-section-actions--split {
    grid-template-columns: 1fr;
  }

  .rc-section-actions .ds-btn,
  .rc-section-actions .rc-split-button {
    width: 100%;
  }

  .rc-carousel__track {
    grid-auto-columns: minmax(85vw, 1fr);
  }

  .rc-app-table__row {
    grid-template-columns: 2rem 1fr 1.5rem;
  }

  .rc-app-table__cell--desc {
    display: none;
  }
}

/* ─── Print ─── */

@media print {
  body {
    background: white;
  }

  .ds-skip-link,
  .rc-topbar,
  .rc-sidebar-shell,
  .rc-right-rail,
  .rc-status,
  .rc-section-actions,
  .rc-inline-help__button,
  .rc-anchor {
    display: none !important;
  }

  .rc-layout {
    max-width: none;
    padding: 0;
  }

  .rc-main-grid,
  .rc-content,
  .rc-route-body {
    display: block;
  }

  .rc-doc,
  .ds-card {
    border: 0 !important;
    box-shadow: none !important;
    background: white !important;
    padding: 0 !important;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}
