/* Admin, Session setups (admin/session_setups): the index's catalog line and
   reference, and the editor laid out like iRacing's Create a Race wizard in
   its single-page view: the sections listed down the left, sticky, each
   with its count of changed settings, and the sections stacked on the
   right. */

.setups-catalog-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
  margin-top: 1.25rem; padding-block: .75rem; border-block: 1px solid var(--edge);
  font-size: .875rem; color: var(--ink-muted);
}
.setups-reference { margin-top: 2.5rem; border-top: 1px solid var(--edge); padding-top: 1rem; }
.setups-reference > summary { cursor: pointer; font-weight: 600; color: var(--ink); }

/* ---------- the editor ---------- */

.setup-editor-head h1 { font-weight: 700; font-size: clamp(1.9rem, 3vw, 2.5rem); margin-top: .25rem; }
.setup-name-label { display: block; margin-top: 1.25rem; font-size: .875rem; color: var(--ink-muted); }
.setup-name { margin-top: .35rem; width: 100%; max-width: 28rem; font-size: 1.05rem; }
.setup-head-note { margin-top: .9rem; max-width: 52rem; font-size: .85rem; color: var(--ink-faint); }
.setup-error-summary {
  margin-top: 1rem; padding: .6rem .9rem; max-width: 40rem;
  border-left: 3px solid var(--danger); background: var(--danger-soft); color: var(--ink); font-size: .875rem;
}
.setup-error { flex-basis: 100%; margin-top: .3rem; font-size: .8rem; color: var(--danger); }

.setup-editor-body {
  display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 2.5rem; align-items: start; margin-top: 1.75rem;
}

.setup-nav { position: sticky; top: 1rem; }
.setup-nav ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--edge); }
.setup-nav a {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  padding: .45rem .75rem; margin-left: -1px; border-left: 2px solid transparent;
  font-size: .9rem; color: var(--ink-muted); text-decoration: none;
}
.setup-nav a:hover { color: var(--ink); border-left-color: var(--edge-strong); }
.setup-nav a.has-error { color: var(--danger); border-left-color: var(--danger); }
.setup-nav-count {
  min-width: 1.5rem; padding: 0 .4rem; border-radius: 999px; text-align: center;
  font-size: .75rem; font-variant-numeric: tabular-nums; background: var(--accent-soft); color: var(--accent);
}

.setup-section { padding-block: 1.4rem; border-top: 1px solid var(--edge); scroll-margin-top: 1rem; }
.setup-section:first-child { border-top: 0; padding-top: 0; }
.setup-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; }
.setup-section-head h2 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; letter-spacing: .01em; }
.setup-reset { font-size: .8rem; color: var(--ink-faint); text-decoration: underline; text-underline-offset: 2px; }
.setup-reset:hover { color: var(--ink); }

.setup-own { margin-top: .9rem; }
.setup-own + .setup-settings { margin-top: .9rem; border-top: 1px dashed var(--edge); padding-top: .6rem; }
.setup-types { display: flex; flex-wrap: wrap; gap: .5rem; border: 0; padding: 0; margin: 0; }
.setup-types legend { font-size: .875rem; color: var(--ink-muted); margin-bottom: .45rem; }
.setup-type {
  display: flex; align-items: flex-start; gap: .5rem; padding: .55rem .8rem; cursor: pointer;
  border: 1px solid var(--edge); border-radius: var(--radius); background: var(--surface); font-size: .9rem;
}
.setup-type:has(input:checked) { border-color: var(--accent-edge); background: var(--accent-soft); }
.setup-type input { margin-top: .2rem; }
.setup-type small { display: block; font-size: .75rem; color: var(--ink-faint); }
.setup-minutes { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; margin-top: .9rem; }
.setup-minutes label { display: block; font-size: .875rem; color: var(--ink-muted); margin-bottom: .3rem; }
.setup-minutes-field { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--ink-faint); }
.setup-note { margin-top: .5rem; font-size: .8rem; color: var(--ink-faint); }
/* The setup's own rows (car, track, AI count) share the settings' columns. */
.setup-row {
  display: grid; grid-template-columns: minmax(10rem, 16rem) auto minmax(0, 1fr); align-items: center; gap: .25rem 1rem;
}
.setup-row > label { font-size: .9rem; color: var(--ink-muted); }
.setup-row[hidden] { display: none; }
.setup-warn { font-size: .8rem; color: var(--warm); }

.setup-settings { margin-top: .6rem; }
.setup-setting {
  display: grid; grid-template-columns: minmax(10rem, 16rem) auto minmax(0, 1fr); align-items: center; gap: .25rem 1rem;
  padding: .4rem .6rem; margin-inline: -.6rem; border-left: 2px solid transparent;
}
.setup-setting.is-changed { border-left-color: var(--accent); background: rgba(188, 235, 33, 0.04); }
.setup-setting.is-changed .setup-setting-label { color: var(--ink); }
.setup-setting.has-error { border-left-color: var(--danger); }
.setup-setting .setup-error { grid-column: 1 / -1; margin-top: 0; }
.setup-setting-label { font-size: .9rem; color: var(--ink-muted); }
.setup-setting-field { display: inline-flex; align-items: center; gap: .5rem; min-width: 0; }
.setup-setting-field small { font-size: .75rem; color: var(--ink-faint); white-space: nowrap; }
.setup-setting-field select { max-width: 22rem; }
.setup-switch { width: 1.1rem; height: 1.1rem; accent-color: var(--accent-deep); }
.setup-default { font-size: .78rem; color: var(--ink-faint); }
.setup-unread { margin-top: .5rem; font-size: .8rem; color: var(--ink-faint); font-style: italic; }

.setup-save-bar { margin-top: 1.5rem; }

@media (max-width: 860px) {
  .setup-editor-body { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .setup-nav { position: static; }
  .setup-nav ol { display: flex; flex-wrap: wrap; gap: .25rem; border-left: 0; }
  .setup-nav a { border: 1px solid var(--edge); border-radius: var(--radius); margin: 0; padding: .3rem .6rem; font-size: .8rem; }
  .setup-setting, .setup-row { grid-template-columns: minmax(0, 1fr); }
}
