/* ============================================================
   iMINDBench Leaderboard — style.css
   Palette, type and shared controls live in ../assets/theme.css.
   ============================================================ */

/* --- Reset & base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 18px; scrollbar-gutter: stable; }

/* ============================================================
   HEADER
   ============================================================ */

/* Slim counterpart to the homepage masthead: same ink band, no activity
   canvas, sized to stay out of the way of the table. */
.site-header {
  overflow: hidden;
  background: var(--masthead);
  border-top: 2px solid var(--accent);
  border-bottom: 1px solid var(--border);
  padding: 2.9rem 0 2.7rem;
}

.header-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 7rem;
}

.site-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.038em;
  line-height: 1.05;
  color: var(--masthead-text);
  margin-bottom: 0.25rem;
}

.site-home-link {
  all: unset;
  display: inline-block;
  color: inherit;
  cursor: pointer;
}

.site-home-link:focus-visible {
  border-radius: 3px;
  outline: 2px solid var(--masthead-text);
  outline-offset: 4px;
}

.site-subtitle {
  font-size: 0.92rem;
  color: var(--masthead-muted);
  line-height: 1.4;
}

.leaderboard-header-actions {
  display: flex;
  align-items: center;
  gap: 1.15rem;
}

.header-home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.35rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--masthead-border);
  border-radius: var(--radius);
  color: var(--masthead-text);
  background: var(--masthead-scrim);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.header-home-link svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.header-home-link:hover {
  border-color: var(--masthead-text);
  color: var(--masthead-text);
  background: var(--masthead-hover);
}

/* Submitting a model is the action this page wants to encourage, so it carries
   the masthead's only fill. */
.header-home-link--primary {
  padding: 0.4rem 1.15rem;
  border-color: var(--masthead-text);
  color: var(--masthead);
  background: var(--masthead-text);
  font-weight: 600;
}

.header-home-link--primary:hover {
  border-color: var(--masthead-text);
  color: var(--masthead);
  background: #ffffff;
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */

.main-content {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 7rem 2.5rem;
}

/* ============================================================
   TAB BAR
   ============================================================ */

.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin: 2.4rem 0 0;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 0.6rem 1.15rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn:first-child { padding-left: 0; }

.tab-btn:hover {
  color: var(--text);
  border-bottom-color: var(--border);
}

.tab-btn.active {
  color: var(--text);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ============================================================
   FILTER BAR
   ============================================================ */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.15rem;
  align-items: flex-end;
  padding: 1rem 0 0.75rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.filter-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-faint);
}

.filter-select {
  height: 2.1rem;
  padding: 0 2rem 0 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23575f68'/%3E%3C/svg%3E") no-repeat right 0.65rem center;
  -webkit-appearance: none;
  appearance: none;
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--font-sans);
  cursor: pointer;
  min-width: 130px;
}

/* The chevron is a data URI, so it cannot inherit currentColor and has to
   repeat the --text-muted value of each theme by hand. */
:root[data-theme="dark"] .filter-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23a6acb4'/%3E%3C/svg%3E");
}

.filter-select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.metric-toggle-group { flex-direction: column; gap: 0.25rem; }

.toggle-btn-group {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  height: 2.1rem;
}

.toggle-btn {
  background: var(--surface);
  border: none;
  padding: 0 0.85rem;
  font-size: 0.82rem;
  font-family: var(--font-sans);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  border-right: 1px solid var(--border);
}

.toggle-btn:last-child { border-right: none; }

.toggle-btn.active {
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
}

.toggle-btn:hover:not(.active) {
  background: var(--accent-light);
  color: var(--accent-dark);
}

.reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  height: 2.1rem;
  padding: 0 0.9em;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
  align-self: flex-end;
}
.reset-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ============================================================
   SUMMARY BAR
   ============================================================ */

.summary-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  padding: 0.55rem 1.15rem;
  margin: 0 0 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.summary-stat {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0.1rem 1.15rem;
}

.summary-stat:first-child { padding-left: 0; }
.summary-stat + .summary-stat { border-left: 1px solid var(--border); }

.summary-value {
  font-size: 1.15rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--accent);
  line-height: 1.2;
}

.summary-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ============================================================
   TAB PANELS
   ============================================================ */

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================================
   TABLE
   ============================================================ */

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

#table-container table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

#table-container thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

#table-container thead tr:first-child th {
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

/* second header row (dataset group labels) */
#table-container thead tr:nth-child(2) th {
  background: var(--row-alt);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.35rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
  white-space: nowrap;
}

/* Header cells share the column width negotiation, so the numeric headers
   need the same floor as their cells or the column can still collapse. */
#table-container thead tr:nth-child(2) th { min-width: 4.5rem; }
#table-container thead tr:first-child th:nth-child(1) { min-width: 9rem; max-width: 13rem; }
#table-container thead tr:first-child th:nth-child(2) { min-width: 8rem; max-width: 15rem; }
#table-container thead tr:first-child th:nth-child(3) { min-width: 7.5rem; max-width: 12rem; }

#table-container th[data-sort] { cursor: pointer; user-select: none; }
#table-container th[data-sort]:hover { background: var(--accent-light); color: var(--accent); }
#table-container th.sorted-asc::after  { content: " ↑"; color: var(--accent); }
#table-container th.sorted-desc::after { content: " ↓"; color: var(--accent); }

#table-container tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background 0.1s;
  cursor: pointer;
}

#table-container tbody tr:nth-child(even) { background: var(--row-alt); }
#table-container tbody tr:hover { background: var(--row-hover); }

#table-container td {
  padding: 0.85rem 1.25rem;
  white-space: nowrap;
}

/* Column sizing.
   The table is auto-layout inside a horizontally scrollable wrapper, so
   without bounds a single long value -- a run name, or a long "pretrained
   on" string -- wins the width negotiation and squeezes every numeric
   column to nothing. Text columns get a min/max range and wrap inside it;
   numeric columns get a floor they cannot be pushed below. */

/* First two columns: model name + track */
#table-container td:first-child {
  font-weight: 500;
  color: var(--text);
  white-space: normal;
  min-width: 9rem;
  max-width: 13rem;
  overflow-wrap: break-word;
}

#table-container td:nth-child(2) {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: normal;
  min-width: 8rem;
  max-width: 15rem;
  overflow-wrap: break-word;
}

/* Numeric cells: never let a wide text column collapse these. */
#table-container td.num-cell {
  text-align: center;
  font-variant-numeric: tabular-nums;
  min-width: 4.5rem;
}

/* Best value highlight. The heat ramp already makes the column maximum the
   darkest cell, so weight is enough to confirm it. */
#table-container td.best-cell {
  background: var(--best);
  color: var(--best-text);
  font-weight: 700;
}

/* Rank badge */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 600;
  margin-right: 0.45rem;
  flex-shrink: 0;
}
.rank-1 { background: var(--rank-1-bg); color: var(--rank-1-text); }
.rank-2 { background: var(--rank-2-bg); color: var(--rank-2-text); }
.rank-3 { background: var(--rank-3-bg); color: var(--rank-3-text); }

.track-badge {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.1em 0.45em;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 0.3rem;
}
.track-stft { background: var(--track-stft-bg); color: var(--track-stft-text); }
.track-wav  { background: var(--track-wav-bg); color: var(--track-wav-text); }
/* Violet keeps the third track distinct from the STFT and WAV badges. */
.track-other { background: var(--track-other-bg); color: var(--track-other-text); }

/* Pretraining column. Bounded and wrapping: `pretrained_on` is free text
   from a submission file and can be arbitrarily long. */
#table-container td.pretrain-cell {
  text-align: center;
  white-space: normal;
  min-width: 7.5rem;
  max-width: 12rem;
  overflow-wrap: break-word;
}
.pretrain-yes  { color: var(--positive); font-weight: 600; }
.pretrain-no   { color: var(--text-faint); }
.pretrain-data { font-size: 0.78rem; color: var(--text-muted); display: block; margin-top: 0.15rem; }

/* Partial coverage warning asterisk */
.coverage-warn {
  display: inline-block;
  cursor: default;
  font-size: 0.85em;
  font-weight: 700;
  color: var(--warn);
  margin-left: 0.15em;
  vertical-align: super;
  line-height: 1;
}

/* Footnote below table / chart card */
.coverage-footnote {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-left: 2px solid var(--warn);
  background: var(--row-alt);
  border-radius: 0 var(--radius) var(--radius) 0;
  line-height: 1.5;
}

/* Hidden utility (used for subject filter group) */
.hidden { display: none !important; }

/* Top-3 row left accent stripe */
#table-container tbody tr:has(.rank-1) td:first-child { border-left: 2px solid var(--rank-1-rule); }
#table-container tbody tr:has(.rank-2) td:first-child { border-left: 2px solid var(--rank-2-text); }
#table-container tbody tr:has(.rank-3) td:first-child { border-left: 2px solid var(--rank-3-rule); }

.table-note {
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-top: 1.2rem;
  line-height: 1.5;
}

/* ============================================================
   EMPTY / LOADING STATES
   ============================================================ */

.empty-state {
  padding: 3rem 2rem;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.9rem;
}

.empty-state p { margin: 0; }

/* ============================================================
   CHARTS
   ============================================================ */

.charts-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 0.5rem;
}


.chart-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem 1.75rem;
  /* margin-bottom: 10px; */
}

.chart-section-title {
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.018em;
  color: var(--text);
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.chart-section-subtitle {
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-bottom: 1rem;
}

.chart-body {
  display: flex;
  align-items: flex-start;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
}

.chart-avg-panel {
  flex-shrink: 0;
  background: var(--surface);
  z-index: 2;
  position: relative;
}

/* app.js tags the generated SVG elements with these classes instead of baking
   in hex values, so the charts follow the theme without being redrawn. Bar
   fills stay fixed: they encode model identity and must not shift with theme. */
.chart-grid { stroke: var(--chart-grid); }
.chart-axis { stroke: var(--chart-axis); }
.chart-chance { stroke: var(--chart-chance); }
.chart-roofline { stroke: var(--chart-roofline); }
.chart-se { stroke: var(--chart-se); }
.chart-divider { stroke: var(--chart-divider); }
.chart-avg-grid { stroke: var(--chart-avg-grid); }
.chart-avg-bg { fill: var(--chart-avg-bg); }
.chart-tick { fill: var(--chart-tick); }
.chart-tick-y { fill: var(--chart-tick-muted); }
.chart-label { fill: var(--chart-label); }

.chart-avg-panel svg { display: block; }

.chart-scroll {
  overflow-x: auto;
  flex: 1;
  min-width: 0;
}

.chart-scroll svg {
  display: block;
  min-width: 700px;
}

/* Chart legend */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  margin-top: 0.85rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.legend-clickable {
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius);
  transition: background 0.1s, color 0.1s;
}
.legend-clickable:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-roofline {
  width: 18px;
  height: 0;
  border-top: 2px dashed var(--text-muted);
  flex-shrink: 0;
}

.legend-chance {
  width: 18px;
  height: 0;
  border-top: 1.5px dotted var(--text-faint);
  flex-shrink: 0;
}

.chart-tooltip {
  position: fixed;
  background: rgba(18, 22, 28, 0.94);
  color: var(--masthead-text);
  padding: 7px 12px;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.55;
  pointer-events: none;
  z-index: 9999;
  display: none;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  transition: opacity 0.08s;
}

/* ============================================================
   MODAL
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
  backdrop-filter: blur(2px);
}

.modal-overlay.hidden { display: none; }

.modal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  max-width: 700px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 1.75rem 2rem;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius);
}

.modal-close:hover { background: var(--border-light); color: var(--text); }

.modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  padding-right: 1.5rem;
}

.modal-body { font-size: 0.85rem; }

.modal-section { margin-bottom: 1.25rem; }

.modal-section-title {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.modal-kv-table {
  width: 100%;
  border-collapse: collapse;
}

.modal-kv-table tr td {
  padding: 0.25rem 0;
  vertical-align: top;
}

.modal-kv-table tr td:first-child {
  color: var(--text-muted);
  width: 40%;
  padding-right: 0.75rem;
  font-size: 0.82rem;
}

.modal-kv-table tr td:last-child {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  word-break: break-word;
}

.chain-step {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 0.45rem 0.65rem;
  margin-bottom: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--row-alt);
}

.chain-step-name {
  font-weight: 600;
  color: var(--accent-dark);
  margin-bottom: 0.15rem;
}

.chain-step-params {
  color: var(--text-muted);
  line-height: 1.5;
}

.run-config-card {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  background: var(--surface);
  margin-bottom: 0.7rem;
  overflow: hidden;
}

.run-config-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 1rem;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background 120ms ease;
}

.run-config-summary::-webkit-details-marker { display: none; }
.run-config-summary::marker { display: none; content: ""; }
.run-config-summary:hover { background: var(--row-alt); }
.run-config-summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.run-config-heading {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.run-config-title {
  color: var(--text);
  font-size: 0.83rem;
  font-weight: 600;
}

.run-config-subtitle {
  color: var(--text-muted);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.run-config-datasets {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.run-config-dataset {
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: var(--row-alt);
  color: var(--text-muted);
  padding: 0.12rem 0.42rem;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}

.run-config-chevron {
  width: 0.48rem;
  height: 0.48rem;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 140ms ease;
}

.run-config-card[open] > .run-config-summary {
  border-bottom: 1px solid var(--border-light);
  background: var(--row-alt);
}

.run-config-card[open] .run-config-chevron {
  transform: rotate(225deg) translate(-1px, -1px);
}

.run-config-content { padding: 0.65rem 0.85rem 0.75rem; }
.run-config-content .chain-step:last-child { margin-bottom: 0; }

/* ============================================================
   MULTI-SELECT DROPDOWN
   ============================================================ */

.multiselect { position: relative; }

.multiselect-btn {
  height: 2.1rem;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--font-sans);
  cursor: pointer;
  white-space: nowrap;
  min-width: 130px;
  text-align: left;
}

.multiselect-btn:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.multiselect-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 200px;
  max-height: 280px;
  overflow-y: auto;
  padding: 0.3rem 0 0.4rem;
}

.multiselect-panel.hidden { display: none; }

.ms-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
  user-select: none;
}

.ms-option:hover { background: var(--accent-light); }

.ms-all {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.ms-divider {
  height: 1px;
  background: var(--border-light);
  margin: 0.3rem 0;
}

.ms-option input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ============================================================
   SUBMIT PAGE
   ============================================================ */

/* submit.html is prose on the leaderboard chrome, so it needs a heading rhythm
   that the table page has no use for. It keeps .main-content's width so the
   text lines up with the table and the masthead.
   Margin rather than padding-top: the responsive rules below reset the
   .main-content padding shorthand. */
.submit-page {
  margin-top: 3rem;
}

/* The opening lines carry the page's entry point, so the heading and lead use
   the homepage scale rather than the smaller instruction type below them. */
.submit-page h2 {
  /* font-size: clamp(1.5rem, 3.6vw, 1.85rem); */
  line-height: 1.2;
  margin-bottom: 0.7rem;
}

.submit-intro p:not(.submit-cta-row) {
  /* max-width: 760px; */
  color: var(--text); 
   font-size: 1.12rem;
}

.submit-page h3 {
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
}

.submit-page p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 0.9rem;
}

.submit-section {
  margin-top: 2.6rem;
  padding-top: 2.1rem;
  border-top: 1px solid var(--border-light);
}

.submit-page code {
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  background: var(--accent-light);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.84em;
}

.submit-page pre {
  overflow-x: auto;
  margin-bottom: 1rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  line-height: 1.55;
}

.submit-page pre code {
  padding: 0;
  background: none;
  font-size: 0.8rem;
}

.submit-list {
  margin: 0 0 1rem 1.1rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.submit-page .submit-note {
  font-size: 0.84rem;
  color: var(--text-faint);
}

.submit-cta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem 1.3rem;
  margin-top: 1.4rem;
}

.submit-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.2rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent-contrast);
  background: var(--accent);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.submit-cta:hover {
  border-color: var(--accent-dark);
  color: var(--accent-contrast);
  background: var(--accent-dark);
}

.submit-cta svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.submit-cta-secondary {
  font-size: 0.84rem;
  font-weight: 500;
}

/* ============================================================
   FOOTER
   ============================================================ */

/* The footer itself comes from theme.css. Only the offset differs: here
   .main-content already carries the closing space, so the shared top margin
   would stack on top of it. */
.site-footer {
  margin-top: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
  .main-content { padding: 0 3rem 2rem; }
  .header-inner { padding: 0 3rem; }
}

@media (max-width: 768px) {
  .main-content { padding: 0 1rem 1.75rem; }
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.9rem;
    padding: 0 1rem;
  }
  .site-title { font-size: 1.3rem; }
  .filter-bar { gap: 0.6rem 1rem; }
  .summary-bar { padding: 0.45rem 0.8rem; }
  .summary-stat { padding: 0.1rem 0.7rem; }
  .summary-value { font-size: 1.05rem; }
  .modal-card { padding: 1.25rem 1.25rem; }
  .run-config-summary { grid-template-columns: minmax(0, 1fr) 1rem; }
  .run-config-datasets {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
  }
  .run-config-chevron { grid-column: 2; grid-row: 1; }
}
