/**
 * Chalk & Settle — Who's Playing + Tees (shared wizard step 1)
 * Wire: wizard-step-WHOS-PLAYING-TEES-APPROVED
 * Round-level truth only: course · players · tees · index → course handicap.
 */

/* ── Wizard shell ─────────────────────────────────────────────────────────── */
.cs-wizard-screen {
  display: flex;
  flex-direction: column;
  height: 790px;
  max-height: calc(var(--shell-height) - 20px);
}

.cs-wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 6px;
  flex-shrink: 0;
}

.cs-wizard-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: var(--touch-min);
  padding: 0;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: var(--type-nav);
  font-weight: 600;
  color: var(--forest);
  cursor: pointer;
}

.cs-wizard-game {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
}

.cs-wizard-sec-h .edit {
  color: var(--gold);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  margin-left: auto;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-body);
  min-height: var(--touch-min);
  padding: 0;
}

.cs-wizard-step-dot {
  height: 4px;
  border-radius: 2px;
  background: var(--stone, #d4cec4);
  flex: 1;
}

.cs-wizard-step-dot.is-on {
  background: var(--forest);
}

.cs-wizard-step-lbl {
  font-family: var(--font-mono);
  font-size: var(--type-micro);
  color: var(--muted);
  margin-left: 6px;
}

.cs-wizard-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px;
  -webkit-overflow-scrolling: touch;
}

.cs-wizard-body::-webkit-scrollbar {
  display: none;
}

.cs-wizard-sec {
  margin-top: 14px;
}

.cs-wizard-sec-h {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
}

.cs-wizard-sec-h .hint {
  color: var(--line);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  margin-left: auto;
}

.cs-wizard-step-trail {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 18px 6px;
  flex-shrink: 0;
}

.cs-wizard-step-name {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

.cs-wizard-step-name.is-active {
  color: var(--forest);
  font-weight: 600;
}

.cs-wizard-step-sep {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--line);
}

.cs-wizard-steps {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 18px 8px;
  flex-shrink: 0;
}

.cs-wizard-course {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  gap: 11px;
}

.cs-wizard-course-ic {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(74, 93, 62, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--olive);
}

.cs-wizard-course-l {
  flex: 1;
  min-width: 0;
}

.cs-wizard-course-nm {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--forest);
}

.cs-wizard-course-sub {
  font-family: var(--font-body);
  font-size: var(--type-micro);
  color: var(--muted);
  margin-top: 1px;
}

/* ── Player roster (list — no cap) ─────────────────────────────────────────── */
.cs-wizard-players {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cs-wizard-player {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cs-wizard-p-av {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-inset, #efeae0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--olive);
  flex-shrink: 0;
}

.cs-wizard-p-l {
  flex: 1;
  min-width: 0;
}

.cs-wizard-p-name {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--forest);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cs-wizard-p-you {
  font-size: 10px;
  color: var(--gold);
  font-weight: 600;
}

.cs-wizard-p-name--placeholder .cs-wizard-p-you {
  color: var(--muted);
  font-weight: 500;
}

.cs-wizard-p-edit {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  color: var(--muted);
  vertical-align: middle;
}

.cs-wizard-p-edit svg {
  width: 12px;
  height: 12px;
}

.cs-wizard-p-name--edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--forest);
}

.cs-wizard-p-name--edit:active {
  opacity: 0.85;
}

.cs-wizard-p-av-edit {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.cs-wizard-p-av-edit svg {
  width: 14px;
  height: 14px;
}

.cs-wizard-p-meta {
  font-family: var(--font-mono);
  font-size: var(--type-micro);
  color: var(--muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.cs-wizard-p-hcap {
  color: var(--muted);
}

.cs-wizard-p-hcap--edit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: var(--muted);
  text-align: left;
}

.cs-wizard-p-hcap--edit:active {
  opacity: 0.85;
}

.cs-wizard-p-hcap-edit {
  display: inline-flex;
  align-items: center;
  color: var(--forest);
}

.cs-wizard-p-hcap-edit svg {
  width: 12px;
  height: 12px;
}

.cs-wizard-p-ch {
  color: var(--forest);
  font-weight: 500;
}

.cs-wizard-p-tee {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 8px;
  width: 92px;
  min-width: 92px;
  max-width: 92px;
  box-sizing: border-box;
  flex-shrink: 0;
  cursor: pointer;
  min-height: 36px;
  font-family: inherit;
}

.cs-wizard-p-tee select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 16px;
  border: none;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
}

.cs-wizard-p-tee-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cs-wizard-p-tee-nm {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--forest);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cs-wizard-p-tee-ch {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  line-height: 1;
}

.cs-wizard-tee-default {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--paper);
  border: 1px dashed var(--stone, #d4cec4);
  border-radius: 10px;
  padding: 8px 12px;
  margin-top: 8px;
}

.cs-wizard-tee-default .lbl {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-secondary, #6b6560);
  flex: 1;
}

.cs-wizard-tee-default .val {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--forest);
}

/* ── Add player grid ───────────────────────────────────────────────────────── */
.cs-wizard-add-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.cs-wizard-add-btn {
  background: var(--paper);
  border: 1.5px solid var(--stone, #d4cec4);
  border-radius: 10px;
  padding: 10px 11px;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  min-height: var(--touch-min);
  text-align: left;
  font-family: inherit;
}

.cs-wizard-add-btn--wide {
  grid-column: 1 / -1;
}

.cs-wizard-add-btn--primary {
  border-color: var(--forest);
  background: rgba(74, 93, 62, 0.12);
}

.cs-wizard-add-ic {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--bg-inset, #efeae0);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--olive);
}

.cs-wizard-add-tx {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--forest);
  line-height: 1.2;
}

.cs-wizard-add-sub {
  font-family: var(--font-body);
  font-size: var(--type-micro);
  color: var(--muted);
  margin-top: 1px;
}

/* ── Start bar ─────────────────────────────────────────────────────────────── */
.cs-wizard-startbar {
  flex-shrink: 0;
  padding: 11px 16px calc(11px + env(safe-area-inset-bottom));
  background: var(--cs-shell-bg);
  border-top: 1px solid var(--line);
}

.cs-wizard-confirm {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 9px;
  padding: 0 2px;
}

.cs-wizard-confirm-l {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--forest);
}

.cs-wizard-confirm-r {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
}

.cs-wizard-roster-hint {
  margin: 8px 0 0;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

.cs-wp-recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  max-height: min(52vh, 360px);
  overflow-y: auto;
}

.cs-wp-recent-empty {
  margin: 0 0 12px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.cs-wp-recent-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.cs-wp-recent-info {
  flex: 1;
  min-width: 0;
}

.cs-wp-recent-name {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--forest);
}

.cs-wp-recent-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.cs-wp-recent-add {
  flex-shrink: 0;
  min-height: 40px;
  padding: 0 14px;
}

.cs-wp-friend-list {
  max-height: 52vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 12px;
}

.cs-wp-friend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 0;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.cs-wp-friend-row.is-in-roster {
  opacity: 0.55;
}

.cs-wp-friend-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1B3D2F;
  color: #F4F0E8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.cs-wp-friend-state {
  flex-shrink: 0;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--forest);
}

.cs-wp-friend-row.is-in-roster .cs-wp-friend-state {
  color: var(--muted);
}

.cs-wizard-btn-next {
  width: 100%;
  min-height: var(--touch-min);
  background: var(--forest);
  color: var(--cream);
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.cs-wizard-btn-next:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  color: var(--paper);
  background: var(--forest);
}

.cs-wizard-sec--add {
  margin-bottom: 14px;
}

/* ── GHIN / guest sheets ───────────────────────────────────────────────────── */
.cs-wp-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(36, 33, 29, 0.35);
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.cs-wp-sheet-overlay.is-open {
  display: flex;
}

.cs-wp-sheet {
  width: min(var(--shell-width, 390px), 100%);
  /* Use --on-forest for text on forest fills when disabled */
  background: var(--bg);
  color: var(--ink);
  color-scheme: light;
  border-radius: 16px 16px 0 0;
  padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

.cs-wp-sheet-title {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--forest);
  margin-bottom: 6px;
}

.cs-wp-sheet-sub {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 14px;
}

.cs-wp-field {
  display: block;
  margin-bottom: 12px;
}

.cs-wp-field-lbl {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
}

.cs-wp-input {
  width: 100%;
  min-height: var(--touch-min);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--forest);
}

.cs-wp-input--mono {
  font-family: var(--font-mono);
}

.cs-wp-sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.cs-wp-btn {
  flex: 1;
  min-height: var(--touch-min);
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.cs-wp-btn--ghost {
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--forest);
}

.cs-wp-btn--forest {
  background: var(--forest);
  color: var(--paper);
}

.cs-wp-field-error {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--clay);
  margin: -4px 0 10px;
  min-height: 1.2em;
}

.cs-wizard-p-remove {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  margin-left: 4px;
  align-self: center;
}

.cs-wizard-p-remove:active {
  color: var(--clay);
  background: var(--clay-bg);
}

.cs-wizard-p-remove-spacer {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  margin-left: 4px;
}
