/* New-session setup: a roomy, guided form that keeps the recording workflow
   visible while making each decision easy to scan. Loaded after foundation and
   components so this file owns the setup view only. */

#app .setup,
#app .setup:has(#trackingScope) {
  width: min(100%, 1080px);
  max-width: 1080px;
  margin: 0 auto;
  display: block;
}

#app .setup .form-card {
  padding: clamp(22px, 4vw, 42px);
  border: 0;
  box-shadow: none;
}

.setup-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.setup-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
.setup-grid > div { min-width: 0; }
.setup-notes { grid-column: 1 / -1; color: var(--ink-muted); font-size: 13px; }
.setup-notes summary { cursor: pointer; padding: 6px 0; }
.setup-notes[open] summary { margin-bottom: 8px; }
.setup-notes[hidden] { display: none; }
.setup-grid .setup-section-heading { margin-top: 0; }
#app .setup .fields { grid-template-columns: minmax(0, 1fr); gap: 14px; }
#app .setup .fields > .field { grid-column: 1 / -1; }
#app .setup .lineup-eligible { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#app .setup .team-player-list { max-height: 500px; }
#app .setup .lineup-add { grid-template-columns: minmax(0, 1fr); }
#app .setup .lineup-add-pos { flex-wrap: wrap; }

.setup .eyebrow {
  margin: 0 0 7px;
  color: var(--accent, var(--lime));
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
}

.setup-header { margin-bottom: 12px; }
.setup-header .page-title { margin: 0; }
.setup .setup-section-heading { display: none; }
.setup .setup-summary { display: none; }
.setup .recording-scope-field { margin-top: 4px; }
.scope-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.scope-label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.session-existing-readonly { opacity: .72; }
.session-existing-readonly .seg,
.session-existing-readonly select,
.session-existing-readonly input,
.session-existing-readonly textarea { pointer-events: none; }

.setup .page-title {
  margin-bottom: 7px;
  font-size: clamp(25px, 3vw, 34px);
}

.setup .page-sub {
  max-width: 620px;
  margin: 0;
  line-height: 1.55;
}

.setup-section-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 26px 0 13px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.setup-section-heading > span {
  display: grid;
  flex: 0 0 25px;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--lime) 16%, var(--surface));
  color: var(--lime);
  font-size: 12px;
  font-weight: 800;
}

.setup-section-heading h2 {
  margin: 1px 0 3px;
  font-size: 16px;
}

.setup-section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.setup .fields > .field.full {
  grid-column: 1 / -1;
}

.setup .fields > .league-field,
.setup .fields > .practice-half-field + .practice-half-field {
  grid-column: span 1;
}

.setup .field {
  min-width: 0;
}

.setup .field > label,
.setup .meta-title {
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}

.setup .label-optional {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .08em;
}

.setup .field-help {
  max-width: 680px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.setup .scope-numbering-help {
  margin-top: 3px;
  color: var(--ink-muted, var(--muted));
  font-size: 10px;
}

.setup .seg {
  width: 100%;
}

.setup .lineup-field {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 70%, var(--ink) 2%);
}

.lineup-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.lineup-heading-row .field-help {
  margin-top: 5px;
}

.setup .team-player-list {
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  max-height: 280px;
  padding: 2px;
}

.lineup-help {
  min-height: 20px;
}

.review-heading {
  margin-top: 28px;
}

.setup-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 12px;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface) 82%, var(--ink) 3%);
  color: var(--muted);
  font-size: 12px;
}

.setup-summary > span:not(.summary-label)::before {
  content: "·";
  margin-right: 12px;
  color: var(--line-strong, var(--line));
}

.setup-summary .summary-label {
  width: 100%;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.setup-summary strong {
  color: var(--ink);
}

.setup .start-session {
  min-height: 52px;
  margin-top: 14px;
  transition: opacity .15s ease, transform .15s ease;
}

.setup .lineup-field { margin-top: 18px; }
.setup .lineup-field[hidden] { display: none !important; }

.setup .start-session:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.setup .start-session.is-ready:hover {
  transform: translateY(-1px);
}

@media (max-width: 960px) {
  .setup-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}
@media (max-width: 720px) {
  #app .setup .form-card {
    padding: 20px 16px;
  }

  .setup .fields {
    grid-template-columns: 1fr;
  }

  .setup .fields > .league-field,
  .setup .fields > .practice-half-field + .practice-half-field {
    grid-column: 1 / -1;
  }

  .setup .team-player-list {
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  }
  .scope-grid { grid-template-columns: 1fr; }
}
