/* upload.css — ARC redesign: horizontal param grid, collapsible test matrix,
   dropzone file slots, sticky action rail. */

.upload-section { padding: 40px 0 96px; }

/* Inline link button (e.g. "load sample data") inside paragraph text ---- */
.btn-inline-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.btn-inline-link:hover { color: var(--accent-hover, var(--blue-700)); }

/* Run-time progress + error in the action rail ------------------------- */
.run-progress {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-700);
}
.run-spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--ink-200);
  border-right-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.run-error {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 3px solid var(--coral);
  background: color-mix(in srgb, var(--coral) 8%, transparent);
  color: var(--ink-900);
  font-size: 13px;
  border-radius: 0 6px 6px 0;
}
.run-error pre {
  margin: 6px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-700);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Step indicator ------------------------------------------------------- */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
  padding: 14px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 14px);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.step-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink-500);
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  transition: color 120ms ease, background 120ms ease;
}
.step-item:hover { background: var(--ink-100); color: var(--ink-900); }
.step-item .step-num {
  width: 22px; height: 22px;
  border-radius: 999px;
  background: var(--ink-100);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-500);
}
.step-item.active { color: var(--ink-900); }
.step-item.active .step-num { background: var(--blue-100); color: var(--accent); }
.step-item.done { color: var(--ink-900); }
.step-item.done .step-num {
  background: var(--accent);
  color: white;
}
.step-item .step-label { font-size: 13px; font-weight: 500; }
.step-sep {
  flex: 0 1 40px;
  height: 1px;
  background: var(--ink-200);
}

/* Main 2-column layout ------------------------------------------------- */
.arc-upload-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}
@media (max-width: 1080px) {
  .arc-upload-grid { grid-template-columns: 1fr; }
  .upload-rail { position: static !important; }
}
.arc-upload-main { min-width: 0; }

/* Step blocks ---------------------------------------------------------- */
.upload-stepblock + .upload-stepblock { margin-top: 32px; }
.upload-stepblock-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.upload-stepblock-head h2 {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink-900);
}
.upload-stepblock-head p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-500);
  flex-basis: 100%;
}
.step-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--blue-100);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Parameter grid + cards ---------------------------------------------- */
.param-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.2fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 1180px) {
  .param-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .param-grid { grid-template-columns: 1fr; }
}

.param-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 16px 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.param-card-title {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: -0.005em;
}
.param-card-desc {
  font-size: 12px;
  color: var(--ink-500);
  line-height: 1.4;
}

/* Radio pills ---------------------------------------------------------- */
.radio-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.radio-pill {
  display: grid;
  grid-template-columns: 16px 1fr;
  column-gap: 10px;
  align-items: center;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 120ms ease, border-color 120ms ease;
  font-size: 13px;
  line-height: 1.3;
  color: var(--ink-700);
}
.radio-pill:hover { background: var(--ink-100); }
.radio-pill input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
.radio-pill .radio-pill-dot {
  width: 14px; height: 14px;
  border: 1.5px solid var(--ink-300);
  border-radius: 999px;
  position: relative;
  transition: border-color 120ms ease, background 120ms ease;
}
.radio-pill:hover .radio-pill-dot { border-color: var(--ink-500); }
.radio-pill.checked {
  background: var(--blue-100);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--ink-900);
}
.radio-pill.checked .radio-pill-dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--paper);
}
.radio-pill-content {
  display: grid;
  row-gap: 2px;
  min-width: 0;
}
.radio-pill-label { font-weight: 500; color: inherit; }
.radio-pill-desc { font-size: 11.5px; color: var(--ink-500); line-height: 1.4; }
.radio-stack.compact .radio-pill { padding: 6px 10px; }

/* Tests row + collapsible matrix -------------------------------------- */
.tests-row {
  margin-top: 16px;
  padding: 16px 18px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.tests-row-title {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-900);
  margin-bottom: 4px;
}
.tests-row-sub {
  font-size: 12.5px;
  color: var(--ink-500);
  line-height: 1.4;
  max-width: 560px;
}
.tests-row-sub strong {
  color: var(--accent);
  font-weight: 600;
}
.tests-row-toggle {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
  font-weight: 500;
}

.test-matrix-wrap {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.test-matrix-scroll {
  overflow-x: auto;
}
.test-matrix {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 13px;
}
.test-matrix th,
.test-matrix td {
  padding: 8px 10px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.test-matrix tr:last-child td { border-bottom: 0; }
.test-matrix th {
  background: var(--paper-2);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-500);
}
.test-matrix .test-name-col {
  text-align: left;
  font-weight: 500;
  color: var(--ink-900);
  white-space: nowrap;
  padding-left: 16px;
}
.test-matrix .cell-na { color: var(--ink-300); font-family: var(--mono); }
.test-matrix input[type="checkbox"] { margin: 0; accent-color: var(--accent); cursor: pointer; }
.test-matrix input[type="checkbox"]:disabled { cursor: not-allowed; opacity: 0.7; }

/* File slots ----------------------------------------------------------- */
.file-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 880px) { .file-grid { grid-template-columns: 1fr; } }

.file-slot {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.file-slot-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-900);
}
.req-dot {
  color: var(--coral);
  font-size: 14px;
  margin-left: 4px;
}
.opt-tag {
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-500);
  padding: 2px 6px;
  background: var(--ink-100);
  border-radius: 4px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.file-slot-drop {
  min-height: 140px;
  border: 1.5px dashed var(--ink-200);
  border-radius: 10px;
  background: var(--paper);
  transition: border-color 120ms ease, background 120ms ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.file-slot-drop:hover { border-color: var(--accent); background: color-mix(in srgb, var(--blue-100) 30%, var(--paper)); }
.file-slot.drag-over .file-slot-drop { border-color: var(--accent); background: var(--blue-100); }
.file-slot.filled .file-slot-drop {
  border-style: solid;
  border-color: var(--accent);
  background: color-mix(in srgb, var(--blue-100) 40%, var(--paper));
  cursor: default;
}

.file-slot-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px;
  color: var(--ink-500);
  text-align: center;
}
.file-slot-empty svg { color: var(--ink-400); }
.file-slot-cta { font-size: 13px; font-weight: 500; color: var(--ink-700); }
.file-slot-hint { font-size: 11px; color: var(--ink-500); font-family: var(--mono); }

.file-slot-filled {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 14px 18px;
  width: 100%;
}
.file-slot-filled svg { color: var(--ink-500); }
.file-slot-filename {
  font-size: 13px;
  color: var(--ink-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-slot-size { font-size: 11px; color: var(--ink-500); }
.file-slot-remove {
  background: transparent;
  border: 0;
  color: var(--ink-400);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  transition: color 120ms ease, background 120ms ease;
}
.file-slot-remove:hover { color: var(--coral); background: color-mix(in srgb, var(--coral) 10%, transparent); }

/* Email field ---------------------------------------------------------- */
.email-field { max-width: 420px; }
.email-field label {
  display: block;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-900);
  margin-bottom: 6px;
}
.email-field input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--ink-200);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink-900);
  background: var(--paper);
  outline: 0;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.email-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(43, 139, 199, 0.15);
}

/* Action rail (sticky) ------------------------------------------------- */
.upload-rail { position: sticky; top: 88px; }
.rail-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.rail-action .smallcaps { color: var(--ink-500); margin-bottom: 14px; }

.rail-summary {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
}
.rail-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.rail-summary-k { color: var(--ink-500); }
.rail-summary-v { color: var(--ink-900); font-weight: 500; text-align: right; }

.rail-validation {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.val-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-500);
  transition: color 120ms ease;
}
.val-item.ok { color: var(--ink-900); }
.val-dot {
  width: 18px; height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.val-item.pending .val-dot { background: var(--ink-100); color: var(--ink-400); }
.val-item.ok .val-dot { background: var(--accent); color: white; }

.btn-submit {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  justify-content: center;
}
.btn-submit:disabled { opacity: 0.4; cursor: not-allowed; }

.rail-note {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-500);
  line-height: 1.5;
}
.rail-note a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.rail-note a:hover { text-decoration: underline; }

/* Illustrated hero (also used on ARC upload page) --------------------- */
.content-hero--illustrated { padding-top: 40px; padding-bottom: 48px; }
.content-hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: 48px;
  align-items: center;
}
@media (max-width: 980px) {
  .content-hero-split { grid-template-columns: 1fr; gap: 24px; }
  .content-hero-art { order: -1; max-width: 480px; margin: 0 auto; }
}
.content-hero-art img { width: 100%; height: auto; display: block; }

/* Breadcrumbs */
.content-hero .crumbs {
  font-size: 13px;
  color: var(--ink-500);
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}
.content-hero .crumbs a { color: var(--ink-700); text-decoration: none; }
.content-hero .crumbs a:hover { color: var(--accent); }
.content-hero .crumbs .sep { color: var(--ink-300); }

/* AI Interpretation panel -------------------------------------------- */
.ai-panel {
  margin-top: 24px;
  padding: 24px 26px 20px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--accent) 6%, var(--paper)),
    var(--paper));
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.ai-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.ai-panel-head h3 {
  margin: 0;
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink-900);
}
.ai-chip {
  background: var(--accent);
  color: white;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
}
.ai-block { margin-top: 16px; }
.ai-block .smallcaps {
  color: var(--ink-500);
  margin-bottom: 6px;
}
.ai-block p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-900);
}
.ai-findings {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai-findings li {
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
}
.ai-finding-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 4px;
}
.ai-finding-metric {
  font-weight: 600;
  color: var(--accent);
  font-size: 13px;
}
.ai-finding-window,
.ai-finding-estimate,
.ai-finding-p {
  font-size: 12px;
  color: var(--ink-700);
  padding: 2px 6px;
  background: var(--ink-100);
  border-radius: 4px;
}
.ai-finding-test {
  font-size: 11.5px;
  color: var(--ink-500);
  margin-left: auto;
}
.ai-finding-interp {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-700);
  line-height: 1.5;
}
.ai-null-result {
  margin: 0;
  font-size: 14px;
  color: var(--ink-700);
  font-style: italic;
}
.ai-disclaimer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-500);
}

/* Results file list -------------------------------------------------- */
.results-files {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.results-files li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.results-files li:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: var(--shadow-sm);
}
.results-file-meta { flex: 1; min-width: 0; }
.results-file-name {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-900);
  margin-bottom: 2px;
}
.results-file-sub {
  font-size: 11.5px;
  color: var(--ink-500);
  word-break: break-all;
}
.results-file-dl {
  flex-shrink: 0;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
}

@media (max-width: 980px) {
  .content-section + aside.rail-card { position: static !important; }
  section.section > .page > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

.spec-dump {
  background: var(--ink-100);
  padding: 16px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  overflow-x: auto;
}

/* Full-width hero variant — used on the ARC upload page so the editorial
   intro doesn't get column-clipped at 680/880 px the way long-form
   content pages are.                                                       */
.content-hero--wide .content-hero-inner { max-width: none; }
.content-hero--wide .content-hero-lede  { max-width: none; }

/* The step-num is now a flex container holding either a digit or a ✓ SVG. */
.step-item .step-num svg { display: block; }

/* ---------------------------------------------------------------------- */
/* Layout adjustments — info icons, schema chips, action links, etc.       */
/* ---------------------------------------------------------------------- */

/* Info icon (ⓘ) used inside radio labels and elsewhere */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 6px;
  color: var(--ink-400);
  cursor: help;
  vertical-align: middle;
  transition: color 120ms ease;
}
.info-icon:hover, .info-icon:focus-visible {
  color: var(--accent);
  outline: none;
}

/* "26 active" chip on the Test statistics row */
.active-chip {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  padding: 2px 8px;
  background: color-mix(in srgb, var(--accent) 12%, var(--paper));
  color: var(--accent);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

/* Test matrix — locked & toggleable cell rendering replaces checkboxes */
.test-matrix .cell-on {
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
}
.test-matrix .cell-off {
  color: var(--ink-300);
  font-family: var(--mono);
}
.test-matrix .cell-toggleable .cell-on-btn,
.test-matrix .cell-add .cell-add-btn {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font: inherit;
  transition: background 120ms ease, color 120ms ease;
}
.test-matrix .cell-on-btn { color: var(--accent); font-size: 14px; font-weight: 600; }
.test-matrix .cell-on-btn:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.test-matrix .cell-add-btn {
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
  font-family: var(--mono);
  letter-spacing: 0.01em;
}
.test-matrix .cell-add-btn:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  text-decoration: underline;
}

/* File slot — schema chips below the drop zone + per-slot Sample link */
.file-slot-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
}
.schema-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.schema-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: color-mix(in srgb, var(--blue-100) 60%, var(--paper-2));
  color: var(--ink-700);
  border-radius: 4px;
  font-size: 10.5px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.file-slot-sample {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  padding: 2px 0;
}
.file-slot-sample:hover { text-decoration: underline; }

/* OPTIONAL badge — boxier style matching the screenshots */
.opt-tag {
  border: 1px solid var(--ink-200);
  background: var(--paper);
}

/* Required-asterisk marker — colored leading "*" */
.req-dot {
  margin-left: 0;
  margin-right: 2px;
}

/* Rail head — small caps + 1/3 progress pill */
.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.rail-head .smallcaps { margin-bottom: 0; color: var(--ink-500); }
.rail-progress {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--paper));
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

/* Validation rows — left-aligned label + right-aligned action link */
.val-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
}
.val-label { min-width: 0; }
.val-action {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.val-action:hover { text-decoration: underline; }

/* Spec hash chip at the bottom of the rail */
.rail-spec {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}
.spec-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  background: var(--ink-100);
  color: var(--ink-500);
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.02em;
  cursor: help;
}
