* {
  box-sizing: border-box;
}

body {
  background:
    radial-gradient(circle at 10% 4%, rgba(21, 153, 106, 0.12), transparent 42%),
    radial-gradient(circle at 86% 2%, rgba(36, 91, 133, 0.10), transparent 38%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.68), rgba(219, 239, 233, 0.76)),
    var(--rf-bg);
  color: var(--rf-ink);
  font-family: var(--rf-font-body);
  line-height: 1.6;
  margin: 0;
  transition:
    background var(--rf-duration-slow) var(--rf-easing-standard),
    color var(--rf-duration-base) var(--rf-easing-standard);
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 10% 4%, rgba(56, 200, 145, 0.08), transparent 42%),
    radial-gradient(circle at 86% 2%, rgba(139, 187, 228, 0.09), transparent 38%),
    linear-gradient(135deg, #0f1714, #17241f 70%, #111a17),
    var(--rf-bg);
}

:root[data-theme="dark"] .app-shell::after {
  background: linear-gradient(
    90deg,
    var(--rf-clinical-red) 0%,
    rgba(196, 122, 122, 0.30) 38%,
    transparent 68%
  );
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 28px;
  position: relative;
}

.app-shell::before {
  background:
    linear-gradient(rgba(28, 69, 86, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 69, 86, 0.05) 1px, transparent 1px);
  background-size: 38px 38px;
  content: "";
  inset: 0;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 72%);
  pointer-events: none;
  position: fixed;
}

.app-shell::after {
  background: linear-gradient(
    90deg,
    var(--rf-clinical-red) 0%,
    rgba(122, 40, 40, 0.38) 38%,
    transparent 68%
  );
  content: "";
  height: 3px;
  left: 0;
  pointer-events: none;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 200;
}

.workspace {
  margin: 0 auto;
  max-width: 1180px;
  position: relative;
  z-index: 1;
}

.workspace-header {
  align-items: flex-end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 22px;
}

.header-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-end;
  padding-bottom: 4px;
}

.header-control-group,
.header-link-group {
  align-items: center;
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-end;
}

.header-link-group {
  padding-left: 2px;
}

.eyebrow {
  color: var(--rf-primary-strong);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.07em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(26px, 3.8vw, 42px);
  font-weight: 640;
  letter-spacing: -0.025em;
  line-height: 1.12;
  margin-bottom: 0;
  max-width: 760px;
  overflow-wrap: anywhere;
}

h2 {
  font-size: 24px;
  margin-bottom: 6px;
}

h3 {
  font-size: 16px;
  margin-bottom: 10px;
}

.theme-toggle {
  align-items: center;
  background: var(--rf-glass-bg);
  border: 1px solid rgba(21, 153, 106, 0.26);
  border-radius: 999px;
  box-shadow: var(--rf-shadow-soft);
  color: var(--rf-muted);
  cursor: pointer;
  display: inline-flex;
  font-weight: 480;
  gap: 8px;
  min-height: 42px;
  padding: 8px 13px;
  transition: box-shadow var(--rf-duration-fast) var(--rf-easing-standard);
}

.validation-report-link,
.manual-link {
  min-width: auto;
}

.validation-report-link {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(18, 164, 112, 0.95), rgba(80, 214, 160, 0.88)),
    var(--rf-primary-strong);
  border: 1px solid rgba(236, 247, 242, 0.44);
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(21, 153, 106, 0.16);
  color: #ffffff;
  display: inline-flex;
  font-weight: 560;
  justify-content: center;
  min-height: 42px;
  padding: 8px 14px;
  text-decoration: none;
  white-space: nowrap;
}

.manual-link {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(75, 132, 174, 0.95), rgba(156, 207, 240, 0.88)),
    var(--rf-accent);
  border: 1px solid rgba(236, 247, 242, 0.44);
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(75, 132, 174, 0.16);
  color: #ffffff;
  display: inline-flex;
  font-weight: 560;
  justify-content: center;
  min-height: 42px;
  padding: 8px 14px;
  text-decoration: none;
  white-space: nowrap;
}

.validation-report-link:hover,
.validation-report-link:focus-visible,
.manual-link:hover,
.manual-link:focus-visible {
  background:
    linear-gradient(135deg, rgba(9, 125, 86, 0.98), rgba(39, 187, 132, 0.96)),
    var(--rf-primary-strong);
  color: #ffffff;
  transform: translateY(-1px);
}

.language-control {
  align-items: center;
  background: var(--rf-glass-bg);
  border: 1px solid rgba(21, 153, 106, 0.26);
  border-radius: 999px;
  box-shadow: var(--rf-shadow-soft);
  display: inline-flex;
  gap: 10px;
  min-height: 42px;
  padding: 7px 11px;
}

.language-control span {
  color: var(--rf-primary-strong);
  font-size: 11px;
  font-weight: 480;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.language-control select {
  background: transparent;
  border: 0;
  color: var(--rf-ink);
  min-height: 30px;
  padding: 0 4px;
}

.theme-toggle-icon {
  color: var(--rf-primary-strong);
  font-size: 18px;
}

.wizard {
  background: var(--rf-surface);
  backdrop-filter: blur(16px) saturate(1.04);
  -webkit-backdrop-filter: blur(16px) saturate(1.04);
  border: 1px solid rgba(21, 153, 106, 0.20);
  border-radius: var(--rf-radius-lg);
  box-shadow: var(--rf-shadow);
  overflow: hidden;
  transition:
    background var(--rf-duration-slow) var(--rf-easing-standard),
    box-shadow var(--rf-duration-base) var(--rf-easing-standard);
}

.stepper {
  background:
    linear-gradient(135deg, #071c16, var(--rf-primary-strong) 38%, var(--rf-accent) 72%, var(--rf-clinical-red));
  color: rgba(255, 255, 255, 0.74);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.stepper span {
  align-items: center;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  gap: 10px;
  padding: 14px 18px;
}

.stepper span:last-child {
  border-right: 0;
}

.stepper strong {
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  display: inline-flex;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.stepper .is-active,
.stepper .is-complete {
  color: #ffffff;
}

.stepper .is-active strong,
.stepper .is-complete strong {
  background: linear-gradient(135deg, var(--rf-primary), var(--rf-accent));
  box-shadow: 0 0 0 5px rgba(21, 153, 106, 0.18);
}

.status {
  border-bottom: 1px solid var(--rf-glass-line);
  padding: 12px 24px;
}

.status[data-type="success"] {
  background: var(--rf-primary-tint);
  color: var(--rf-primary-strong);
}

.status[data-type="error"] {
  background: var(--rf-danger-tint);
  color: var(--rf-danger);
}

.panel {
  padding: var(--rf-space-6);
}

.panel-heading {
  margin-bottom: 24px;
}

.panel-heading p {
  color: var(--rf-muted);
  margin-bottom: 0;
  max-width: 820px;
  overflow-wrap: anywhere;
}

.form-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid-params {
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
}

.arm-labels-panel {
  background: var(--rf-glass-bg);
  border: 1px solid rgba(21, 153, 106, 0.18);
  border-left: 5px solid var(--rf-primary);
  border-radius: var(--rf-radius-lg);
  box-shadow: var(--rf-shadow-soft);
  margin-top: 18px;
  padding: 16px;
}

.arm-labels-panel p {
  color: var(--rf-muted);
  margin-bottom: 14px;
}

.arm-labels-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.parameter-helper {
  background: linear-gradient(135deg, var(--rf-primary-tint), var(--rf-card-bg));
  border: 1px solid rgba(21, 153, 106, 0.20);
  border-left: 5px solid var(--rf-primary);
  border-radius: var(--rf-radius);
  color: var(--rf-muted);
  font-weight: 450;
  margin-bottom: 18px;
  padding: 12px;
}

.csv-tools {
  align-items: flex-start;
  background: var(--rf-glass-bg);
  border: 1px solid rgba(36, 91, 133, 0.18);
  border-left: 5px solid var(--rf-accent);
  border-radius: var(--rf-radius-lg);
  box-shadow: var(--rf-shadow-soft);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-top: 18px;
  padding: 16px;
}

.participant-strata-tools {
  background: var(--rf-soft-panel);
  border: 1px solid rgba(36, 91, 133, 0.16);
  border-radius: var(--rf-radius);
  margin-top: 12px;
  max-width: 560px;
  padding: 12px;
}

.participant-strata-tools[hidden] {
  display: none;
}

.participant-strata-tools small {
  color: var(--rf-muted);
  display: block;
  font-weight: 450;
  margin-top: 8px;
}

.csv-tools[hidden] {
  display: none;
}

.csv-tools p {
  color: var(--rf-muted);
  margin-bottom: 0;
}

.csv-tools h3 {
  color: var(--rf-accent);
}

.csv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.csv-preview {
  background: var(--rf-soft-panel);
  border: 1px solid rgba(36, 91, 133, 0.20);
  border-radius: var(--rf-radius-lg);
  box-shadow: var(--rf-shadow-soft);
  margin-top: 14px;
  padding: 16px;
}

.csv-preview[hidden],
.csv-column-picker[hidden] {
  display: none;
}

.csv-preview-header {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.csv-preview-header h3 {
  color: var(--rf-accent);
  margin-bottom: 4px;
}

.csv-preview-summary {
  color: var(--rf-muted);
  font-weight: 450;
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.csv-preview-summary[data-type="error"] {
  color: var(--rf-danger);
}

.csv-preview-summary[data-type="success"] {
  color: var(--rf-primary-strong);
}

.csv-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.csv-column-picker {
  background: var(--rf-accent-tint);
  border: 1px solid rgba(36, 91, 133, 0.16);
  border-radius: var(--rf-radius);
  margin-top: 14px;
  padding: 12px;
}

.csv-column-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.csv-column-option {
  align-items: center;
  background: var(--rf-card-bg);
  border: 1px solid rgba(36, 91, 133, 0.16);
  border-radius: 999px;
  color: var(--rf-accent);
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  gap: 8px;
  min-height: 38px;
  padding: 7px 10px;
}

.csv-column-option input {
  accent-color: var(--rf-primary);
  min-height: auto;
  width: auto;
}

.csv-preview-table-wrap {
  margin-top: 14px;
  max-height: 240px;
}

.file-button {
  display: inline-flex;
}

.file-button input {
  display: none;
}

label {
  color: var(--rf-muted);
  display: grid;
  gap: 8px;
  font-weight: 480;
}

[data-technique-param][hidden] {
  display: none;
}

input,
select {
  background: var(--rf-control-bg);
  border: 1px solid var(--rf-line);
  border-radius: var(--rf-radius);
  color: var(--rf-control-ink);
  min-height: 44px;
  padding: 10px 12px;
  width: 100%;
}

input[type="radio"],
input[type="checkbox"] {
  accent-color: var(--rf-primary);
  border-radius: 50%;
  flex: 0 0 auto;
  height: 18px;
  min-height: 18px;
  padding: 0;
  width: 18px;
}

input::placeholder {
  color: var(--rf-control-placeholder);
  opacity: 1;
}

select option {
  background: var(--rf-control-bg);
  color: var(--rf-control-ink);
}

input:focus,
select:focus,
button:focus-visible,
.technique-card:focus-within,
.file-button:focus-within {
  border-color: var(--rf-primary);
  box-shadow: var(--rf-focus-ring);
  outline: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select {
  box-shadow: inset 0 0 0 1px rgba(16, 33, 26, 0.08);
}

:root[data-theme="dark"] .button:not(.button-primary),
:root[data-theme="dark"] .method-filter,
:root[data-theme="dark"] .theme-toggle,
:root[data-theme="dark"] .validation-report-link,
:root[data-theme="dark"] .manual-link {
  color: var(--rf-ink);
}

:root[data-theme="dark"] .validation-report-link,
:root[data-theme="dark"] .manual-link {
  color: #ffffff;
}

:root[data-theme="dark"] .technique-card {
  background:
    linear-gradient(180deg, rgba(31, 50, 43, 0.98), rgba(22, 36, 31, 0.98)),
    var(--family-tint);
  border-color: rgba(236, 247, 242, 0.24);
  box-shadow: inset 0 1px 0 rgba(236, 247, 242, 0.08), 0 16px 34px rgba(0, 0, 0, 0.18);
}

:root[data-theme="dark"] .technique-card strong,
:root[data-theme="dark"] .technique-card small,
:root[data-theme="dark"] .family-heading span,
:root[data-theme="dark"] .method-guide-grid strong,
:root[data-theme="dark"] .preview-grid strong {
  color: var(--rf-ink);
}

:root[data-theme="dark"] .technique-card small,
:root[data-theme="dark"] .method-guide-grid p,
:root[data-theme="dark"] .preview-note {
  color: var(--rf-muted);
}

:root[data-theme="dark"] .technique-card em,
:root[data-theme="dark"] .family-heading small,
:root[data-theme="dark"] .csv-column-option {
  background: rgba(236, 247, 242, 0.10);
  border-color: rgba(236, 247, 242, 0.14);
}

:root[data-theme="dark"] .technique-card b {
  color: var(--rf-primary-strong);
}

:root[data-theme="dark"] .technique-card em:nth-of-type(2) {
  color: var(--rf-accent);
}

:root[data-theme="dark"] .technique-family {
  background: rgba(14, 28, 24, 0.78);
}

:root[data-theme="dark"] .family-heading {
  border-bottom-color: rgba(236, 247, 242, 0.28);
}

:root[data-theme="dark"] .method-filter:not(.is-active) {
  background: rgba(16, 29, 25, 0.92);
  border-color: rgba(236, 247, 242, 0.18);
  color: var(--rf-ink);
}

:root[data-theme="dark"] .method-assistant {
  background:
    linear-gradient(135deg, rgba(21, 47, 39, 0.96), rgba(28, 72, 59, 0.82)),
    linear-gradient(90deg, var(--rf-primary-tint), var(--rf-accent-tint));
}

:root[data-theme="dark"] .technique-card:has(input:checked) {
  background:
    linear-gradient(180deg, rgba(31, 50, 43, 0.98), rgba(22, 36, 31, 0.98)),
    var(--rf-clinical-red-tint);
  border-color: var(--family-color);
  box-shadow:
    0 0 0 3px var(--family-tint),
    0 0 0 6px var(--rf-clinical-red-tint),
    0 12px 32px rgba(0, 0, 0, 0.24);
}

.inline-control {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) 44px 44px;
}

.icon-button {
  align-items: center;
  background: linear-gradient(135deg, var(--rf-primary-tint), var(--rf-card-bg));
  border: 1px solid var(--rf-line);
  border-radius: var(--rf-radius);
  color: var(--rf-primary-strong);
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  min-height: 44px;
}

.method-assistant {
  align-items: center;
  background:
    linear-gradient(135deg, var(--rf-card-bg), var(--rf-primary-tint)),
    linear-gradient(90deg, var(--rf-primary-tint), var(--rf-accent-tint));
  border: 1px solid rgba(21, 153, 106, 0.28);
  border-left: 5px solid var(--rf-primary);
  border-radius: var(--rf-radius-lg);
  box-shadow: var(--rf-shadow-soft);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 16px;
}

.microcopy {
  color: var(--rf-primary-strong);
  font-size: 12px;
  font-weight: 480;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.method-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.method-filter {
  background: var(--rf-card-bg);
  border: 1px solid var(--rf-glass-line);
  border-radius: 999px;
  color: var(--rf-muted);
  cursor: pointer;
  font-weight: 500;
  min-height: 40px;
  padding: 8px 14px;
  white-space: normal;
  transition:
    box-shadow var(--rf-duration-fast) var(--rf-easing-standard),
    transform var(--rf-duration-fast) var(--rf-easing-standard),
    background var(--rf-duration-base) var(--rf-easing-standard);
}

.method-filter.is-active {
  background: linear-gradient(135deg, var(--rf-primary), #127c64);
  border-color: rgba(18, 124, 100, 0.72);
  box-shadow: 0 10px 24px rgba(21, 153, 106, 0.18);
  color: #ffffff;
}

.method-filter--stratified.is-active {
  background: linear-gradient(135deg, var(--rf-accent), var(--rf-primary));
  border-color: rgba(36, 91, 133, 0.62);
}

.method-filter--cluster.is-active {
  background: linear-gradient(135deg, #1f6f80, var(--rf-accent));
  border-color: rgba(36, 91, 133, 0.62);
}

.technique-groups {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.technique-family {
  --family-color: var(--rf-primary);
  --family-tint: var(--rf-primary-tint);
  background: var(--rf-soft-panel);
  border: 1px solid var(--family-color);
  border-radius: var(--rf-radius-lg);
  box-shadow: var(--rf-shadow-soft);
  overflow: hidden;
  padding: 18px;
  position: relative;
}

.technique-family::before {
  background: linear-gradient(90deg, var(--family-color), transparent);
  content: "";
  height: 8px;
  inset: 0 0 auto;
  position: absolute;
}

.technique-family--blocks {
  --family-color: var(--rf-accent);
  --family-tint: var(--rf-accent-tint);
}

.technique-family--stratified {
  --family-color: var(--rf-warn);
  --family-tint: var(--rf-warn-tint);
  grid-column: 1 / -1;
}

.technique-family--cluster {
  --family-color: var(--rf-clinical-red);
  --family-tint: var(--rf-clinical-red-tint);
}

.technique-family[hidden] {
  display: none;
}

.family-heading {
  align-items: center;
  border-bottom: 1px solid rgba(217, 230, 223, 0.76);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
}

.family-heading span {
  color: var(--rf-ink);
  font-size: 18px;
  font-weight: 620;
  overflow-wrap: anywhere;
}

.family-heading small {
  background: var(--family-tint);
  border-radius: 999px;
  color: var(--family-color);
  display: inline-flex;
  font-size: 12px;
  font-weight: 520;
  padding: 5px 10px;
  text-align: center;
}

.technique-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.technique-card {
  background:
    linear-gradient(180deg, var(--rf-card-solid), var(--rf-card-bg)),
    var(--family-tint);
  border: 1px solid rgba(217, 230, 223, 0.88);
  border-radius: var(--rf-radius);
  cursor: pointer;
  display: grid;
  gap: 12px;
  min-height: var(--rf-card-min-h);
  padding: 18px;
  position: relative;
  transition:
    border-color var(--rf-duration-fast) var(--rf-easing-standard),
    box-shadow var(--rf-duration-fast) var(--rf-easing-standard),
    transform var(--rf-duration-fast) var(--rf-easing-standard);
}

.technique-card input {
  opacity: 0;
  pointer-events: none;
  position: absolute;
}

.technique-card > span {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.technique-card > span::before {
  background: var(--family-tint);
  border-radius: 999px;
  content: "";
  height: 10px;
  margin-bottom: 12px;
  width: 42px;
}

.technique-card:has(input:checked) {
  background:
    linear-gradient(180deg, var(--rf-card-solid), var(--rf-card-bg)),
    var(--rf-clinical-red-tint);
  border-color: var(--family-color);
  box-shadow:
    0 0 0 4px var(--family-tint),
    0 0 0 7px var(--rf-clinical-red-tint),
    var(--rf-shadow-soft);
}

.technique-card:has(input:checked) > span::before {
  background: linear-gradient(
    90deg,
    var(--family-color),
    var(--rf-accent) 55%,
    var(--rf-clinical-red)
  );
  width: 64px;
}

.technique-card strong {
  color: var(--rf-ink);
  font-size: 17px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.technique-card small {
  color: var(--rf-muted);
  display: block;
  font-weight: 500;
  margin-top: 4px;
  min-height: 54px;
  overflow-wrap: anywhere;
}

.technique-card em {
  align-items: center;
  background: var(--rf-primary-tint);
  border: 1px solid rgba(21, 153, 106, 0.16);
  border-radius: 999px;
  color: var(--rf-primary-strong);
  display: inline-flex;
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
  gap: 4px;
  margin-top: 8px;
  padding: 6px 9px;
  white-space: normal;
  width: fit-content;
}

.technique-card em:nth-of-type(2) {
  background: var(--rf-accent-tint);
  border-color: rgba(36, 91, 133, 0.16);
  color: var(--rf-accent);
}

.technique-card b {
  color: var(--rf-accent);
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.method-guide,
.method-preview {
  background: var(--rf-glass-bg);
  border: 1px solid rgba(21, 153, 106, 0.16);
  border-radius: var(--rf-radius-lg);
  box-shadow: var(--rf-shadow-soft);
  margin-top: 18px;
  padding: 16px;
}

.method-guide h3,
.method-preview h3 {
  margin-bottom: 0;
}

.method-guide-grid,
.preview-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
}

.method-guide-grid div,
.preview-grid div {
  background: var(--rf-card-bg);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--rf-radius-sm);
  padding: 12px;
}

.method-guide-grid div:nth-child(1),
.preview-grid div:nth-child(3) {
  border-color: rgba(21, 153, 106, 0.22);
  box-shadow: inset 0 3px 0 var(--rf-primary);
}

.method-guide-grid div:nth-child(2),
.preview-grid div:nth-child(4) {
  border-color: rgba(36, 91, 133, 0.22);
  box-shadow: inset 0 3px 0 var(--rf-accent);
}

.method-guide-grid div:nth-child(4) {
  border-color: rgba(164, 96, 0, 0.22);
  box-shadow: inset 0 3px 0 var(--rf-warn);
}

.method-guide-grid span,
.preview-grid span {
  color: var(--rf-muted);
  display: block;
  font-size: 11px;
  font-weight: 480;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.method-guide-grid strong,
.preview-grid strong {
  color: var(--rf-ink);
  display: block;
  margin-top: 4px;
}

.method-guide-grid p,
.preview-note {
  color: var(--rf-muted);
  margin: 4px 0 0;
}

.preview-note {
  margin-top: 12px;
}

.preview-note code {
  background: rgba(16, 33, 26, 0.08);
  border-radius: 6px;
  color: var(--rf-primary-strong);
  font-family: var(--rf-font-mono);
  padding: 2px 6px;
}

.actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 28px;
}

.button {
  background: var(--rf-card-bg);
  border: 1px solid var(--rf-line);
  border-radius: var(--rf-radius);
  color: var(--rf-ink);
  cursor: pointer;
  font-weight: 540;
  min-height: 44px;
  padding: 10px 16px;
  transition:
    box-shadow var(--rf-duration-fast) var(--rf-easing-standard),
    transform var(--rf-duration-fast) var(--rf-easing-standard),
    background var(--rf-duration-base) var(--rf-easing-standard);
}

.button-primary {
  background: linear-gradient(135deg, var(--rf-primary), #127c64);
  border-color: rgba(18, 124, 100, 0.72);
  color: #ffffff;
}

.button-primary:hover,
.method-filter:hover,
.technique-card:hover {
  transform: translateY(-1px);
}

.button-secondary {
  color: var(--rf-muted);
}

.result-metrics {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 24px;
}

.result-metrics div {
  background: var(--rf-glass-bg);
  border: 1px solid var(--rf-glass-line);
  border-radius: var(--rf-radius);
  box-shadow: inset 0 3px 0 var(--rf-primary);
  padding: 12px;
}

.result-metrics div:nth-child(2) {
  box-shadow: inset 0 3px 0 var(--rf-accent);
}

.result-metrics div:nth-child(3) {
  box-shadow: inset 0 3px 0 var(--rf-warn);
}

.result-metrics div:nth-child(4) {
  box-shadow: inset 0 3px 0 var(--rf-primary-strong);
}

.result-metrics span {
  color: var(--rf-muted);
  display: block;
  font-size: 12px;
  font-weight: 480;
  text-transform: uppercase;
}

.result-metrics strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.validation-decision {
  background: var(--rf-primary-tint);
  border: 1px solid rgba(21, 153, 106, 0.22);
  border-left: 5px solid var(--rf-primary);
  border-radius: var(--rf-radius-lg);
  box-shadow: var(--rf-shadow-soft);
  margin: -8px 0 24px;
  padding: 14px 16px;
}

.validation-decision strong {
  color: var(--rf-primary-strong);
  display: block;
  font-size: 17px;
  margin-bottom: 4px;
}

.validation-decision p {
  color: var(--rf-muted);
  font-weight: 450;
  margin: 0;
}

.validation-decision[data-validation="WARN"] {
  background: var(--rf-warn-tint);
  border-color: rgba(164, 96, 0, 0.28);
  border-left-color: var(--rf-warn);
}

.validation-decision[data-validation="WARN"] strong {
  color: var(--rf-warn);
}

.audit-strip {
  align-items: center;
  background:
    linear-gradient(135deg, var(--rf-card-bg), var(--rf-accent-tint));
  border: 1px solid rgba(36, 91, 133, 0.20);
  border-left: 5px solid var(--rf-accent);
  border-radius: var(--rf-radius-lg);
  box-shadow: var(--rf-shadow-soft);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(120px, 0.5fr) minmax(220px, 1fr) minmax(260px, 1.2fr);
  margin: -8px 0 24px;
  padding: 14px;
}

.audit-strip div {
  min-width: 0;
}

.audit-strip span {
  color: var(--rf-muted);
  display: block;
  font-size: 11px;
  font-weight: 480;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.audit-strip strong {
  color: var(--rf-accent);
  display: block;
  overflow-wrap: anywhere;
}

.audit-strip p {
  color: var(--rf-muted);
  font-weight: 450;
  margin: 0;
}

.local-data-panel {
  align-items: start;
  background: var(--rf-glass-bg);
  border: 1px solid rgba(21, 153, 106, 0.18);
  border-left: 5px solid var(--rf-primary);
  border-radius: var(--rf-radius-lg);
  box-shadow: var(--rf-shadow-soft);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.2fr) minmax(220px, 0.9fr);
  margin-bottom: 24px;
  padding: 16px;
}

.local-data-panel h3,
.local-data-panel p {
  margin-bottom: 0;
}

.local-data-panel p:not(.microcopy) {
  color: var(--rf-muted);
  font-weight: 450;
}

.local-data-metrics {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.local-data-metrics div {
  background: var(--rf-card-bg);
  border: 1px solid var(--rf-glass-line);
  border-radius: var(--rf-radius-sm);
  padding: 10px;
}

.local-data-metrics span {
  color: var(--rf-muted);
  display: block;
  font-size: 11px;
  font-weight: 480;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.local-data-metrics strong {
  color: var(--rf-primary-strong);
  display: block;
  margin-top: 3px;
}

.local-data-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.split-layout {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.math-box {
  background: var(--rf-glass-bg);
  border: 1px solid var(--rf-glass-line);
  border-radius: var(--rf-radius-lg);
  padding: 16px;
}

.math-box pre {
  background: #10211a;
  border-radius: var(--rf-radius);
  color: #ffffff;
  overflow: auto;
  padding: 12px;
}

.math-box code {
  background: var(--rf-card-bg);
  color: var(--rf-ink);
  border-radius: 4px;
  display: block;
  overflow-wrap: anywhere;
  padding: 8px;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--rf-line);
  padding: 10px;
  text-align: left;
}

th {
  color: var(--rf-muted);
  font-size: 12px;
  text-transform: uppercase;
}

.table-wrap {
  background: var(--rf-soft-panel);
  border: 1px solid var(--rf-glass-line);
  border-radius: var(--rf-radius-lg);
  margin-top: 24px;
  max-height: 420px;
  overflow: auto;
}

.warning-list {
  color: var(--rf-warn);
  padding-left: 18px;
}

.sequence-preview-note {
  background: color-mix(in srgb, var(--rf-warn) 12%, var(--rf-surface));
  border: 1px solid color-mix(in srgb, var(--rf-warn) 40%, transparent);
  border-radius: var(--rf-radius-sm);
  color: var(--rf-ink);
  font-size: var(--rf-text-sm);
  font-weight: 700;
  margin: var(--rf-space-3) 0 0;
  padding: var(--rf-space-2) var(--rf-space-3);
}

.operational-panel,
.verification-panel {
  background: var(--rf-soft-panel);
  border: 1px solid var(--rf-glass-line);
  border-radius: var(--rf-radius-lg);
  margin-top: var(--rf-space-4);
  padding: var(--rf-space-4);
}

.security-mode-panel {
  align-items: center;
  background:
    linear-gradient(135deg, var(--rf-primary-tint), var(--rf-card-bg)),
    var(--rf-soft-panel);
  border: 1px solid rgba(21, 153, 106, 0.22);
  border-left: 5px solid var(--rf-primary);
  border-radius: var(--rf-radius);
  display: grid;
  gap: var(--rf-space-3);
  grid-template-columns: minmax(240px, 0.9fr) minmax(340px, 1.1fr);
  margin: 0 0 var(--rf-space-4);
  padding: var(--rf-space-3);
}

.security-mode-copy h3,
.security-mode-copy p {
  margin-bottom: 0;
}

.security-mode-copy .microcopy {
  margin-bottom: 4px;
}

.security-mode-copy p:not(.microcopy) {
  color: var(--rf-muted);
  font-size: var(--rf-text-sm);
  line-height: 1.45;
}

.mode-options,
.operational-metrics,
.operational-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rf-space-3);
  margin-top: var(--rf-space-3);
}

.mode-option {
  align-items: center;
  background: var(--rf-card-bg);
  border: 1px solid var(--rf-line);
  border-radius: var(--rf-radius);
  color: var(--rf-ink);
  cursor: pointer;
  display: flex;
  flex: 1 1 220px;
  gap: var(--rf-space-2);
  min-height: 76px;
  min-width: 0;
  padding: var(--rf-space-2) var(--rf-space-3);
}

.mode-option:has(input:checked) {
  border-color: var(--rf-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--rf-primary) 22%, transparent);
}

.mode-option > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.mode-option strong,
.mode-option small {
  overflow-wrap: anywhere;
}

.mode-option strong {
  color: var(--rf-ink);
  line-height: 1.2;
}

.mode-option small,
.operational-panel p,
.verification-panel p {
  color: var(--rf-muted);
}

.operational-metrics > div {
  background: var(--rf-card-bg);
  border: 1px solid var(--rf-line);
  border-radius: var(--rf-radius);
  min-width: 150px;
  padding: var(--rf-space-3);
}

.operational-metrics span {
  color: var(--rf-muted);
  display: block;
  font-size: var(--rf-text-xs);
  text-transform: uppercase;
}

.operational-metrics strong {
  color: var(--rf-ink);
  display: block;
  overflow-wrap: anywhere;
}

.verification-panel textarea {
  min-height: 112px;
  margin-top: var(--rf-space-3);
  width: 100%;
}

.verification-output {
  background: var(--rf-card-bg);
  border: 1px solid var(--rf-line);
  border-radius: var(--rf-radius);
  color: var(--rf-ink);
  margin-top: var(--rf-space-3);
  min-height: 44px;
  overflow-wrap: anywhere;
  padding: var(--rf-space-3);
}

.concealed-cell {
  color: var(--rf-muted);
  font-weight: 800;
  letter-spacing: 0;
}

.loading-inline,
.progress-status {
  align-items: center;
  color: var(--rf-muted);
  display: inline-flex;
  font-size: var(--rf-text-sm);
  gap: var(--rf-space-2);
}

.loading-inline::before {
  animation: rf-spin var(--rf-duration-slow) linear infinite;
  border: 2px solid var(--rf-primary-tint);
  border-top-color: var(--rf-primary);
  border-radius: 50%;
  content: "";
  height: 16px;
  width: 16px;
}

.skeleton {
  animation: rf-skeleton 1.1s var(--rf-easing-standard) infinite alternate;
  background: linear-gradient(90deg, var(--rf-card-bg), var(--rf-soft), var(--rf-card-bg));
  background-size: 220% 100%;
  border-radius: var(--rf-radius-sm);
  min-height: 16px;
}

@keyframes rf-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes rf-skeleton {
  from {
    background-position: 0% 0;
    opacity: 0.72;
  }

  to {
    background-position: 100% 0;
    opacity: 1;
  }
}

@media print {
  body,
  :root[data-theme="dark"] body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .app-shell {
    min-height: auto;
    padding: 0;
  }

  .app-shell::before,
  .app-shell::after,
  .workspace-header,
  .stepper,
  .actions,
  .header-actions,
  .local-data-actions,
  .csv-tools,
  .method-assistant {
    display: none !important;
  }

  .workspace,
  .wizard,
  .panel,
  .method-guide,
  .method-preview,
  .technique-family,
  .technique-card,
  .table-wrap,
  .math-box {
    background: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-color: #cccccc !important;
    box-shadow: none !important;
    color: #000000 !important;
  }

  .panel {
    display: block !important;
    padding: 16px 0;
  }

  [hidden] {
    display: none !important;
  }

  th,
  td {
    color: #000000 !important;
  }
}
