.teams-label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.teams-count {
  font-weight: 400;
  color: var(--kis-text-muted);
}

#names {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--kis-border);
  border-radius: var(--kis-radius);
  background: var(--kis-surface);
  color: var(--kis-text);
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  resize: vertical;
}

.teams-hint {
  font-size: 0.8rem;
  color: var(--kis-text-muted);
  margin: 0.4rem 0 0;
}

.teams-link {
  background: none;
  border: none;
  padding: 0 0.25rem;
  min-height: 44px;
  font: inherit;
  color: var(--kis-text-muted);
  text-decoration: underline;
  cursor: pointer;
}

/* Split settings */

.teams-settings {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.teams-mode {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.mode-btn {
  font-size: 0.9rem;
  padding: 0 1rem;
}

.mode-btn[aria-pressed="true"] {
  background: var(--kis-accent);
  color: var(--kis-accent-contrast);
  border-color: transparent;
}

.teams-stepper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.teams-stepper .kis-btn {
  width: 48px;
  padding: 0;
  font-size: 1.3rem;
  font-weight: 700;
}

.teams-number input {
  width: 5rem;
  min-height: 48px;
  text-align: center;
  font: inherit;
  font-size: 1.4rem;
  font-weight: 700;
  border: 1px solid var(--kis-border);
  border-radius: var(--kis-radius);
  background: var(--kis-surface);
  color: var(--kis-text);
}

.teams-preview {
  margin: 0;
  text-align: center;
  font-size: 0.9rem;
}

.teams-warning {
  color: var(--kis-accent);
  font-weight: 700;
}

.teams-split-row {
  text-align: center;
  margin: 1.25rem 0 0;
}

.teams-split {
  font-size: 1.1rem;
  padding: 1rem 2rem;
}

.kis-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.teams-message {
  text-align: center;
  font-size: 0.9rem;
  color: var(--kis-text-muted);
  min-height: 1.4em;
  margin: 0.75rem 0 0;
}

/* Results */

.teams-results {
  margin-top: 1rem;
}

.teams-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
}

.teams-card {
  border: 1px solid var(--kis-border);
  border-top: 5px solid var(--team-color);
  border-radius: var(--kis-radius);
  background: var(--kis-surface);
  padding: 0.5rem 0.75rem 0.75rem;
}

.teams-card-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.teams-card-name {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 0.25rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--kis-text);
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
}

.teams-card-name:hover,
.teams-card-name:focus {
  border-color: var(--kis-border);
  background: var(--kis-card);
}

.teams-card-name::placeholder {
  color: var(--kis-text);
  opacity: 1;
}

.teams-card-size {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--kis-text-muted);
  background: var(--kis-card);
  border: 1px solid var(--kis-border);
  border-radius: var(--kis-radius-pill);
  padding: 0.1rem 0.5rem;
}

.teams-card-list {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0 0.25rem;
}

.teams-card-list li {
  padding: 0.2rem 0;
  overflow-wrap: anywhere;
}

.teams-result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Rules, rosters & backup */

.teams-more {
  margin-top: 1.5rem;
  border-top: 1px solid var(--kis-border);
  padding-top: 0.5rem;
}

.teams-more summary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  cursor: pointer;
  color: var(--kis-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.teams-section {
  margin-top: 1.25rem;
}

.teams-section-title {
  font-size: 0.9rem;
  margin: 0 0 0.25rem;
}

.teams-rule-form,
.teams-save {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.teams-rule-form label,
.teams-save label {
  display: grid;
  gap: 0.25rem;
  flex: 1 1 8rem;
  font-size: 0.85rem;
  color: var(--kis-text-muted);
}

.teams-rule-form select,
.teams-save input {
  min-height: 44px;
  width: 100%;
  padding: 0 0.75rem;
  border: 1px solid var(--kis-border);
  border-radius: var(--kis-radius);
  background: var(--kis-surface);
  color: var(--kis-text);
  font: inherit;
  font-size: 1rem;
}

.teams-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.teams-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.teams-rule-text {
  flex: 1;
  font-size: 0.9rem;
}

.teams-muted {
  color: var(--kis-text-muted);
}

.teams-load {
  flex: 1;
  justify-content: flex-start;
  text-align: left;
}

.teams-small {
  font-size: 0.85rem;
  padding: 0 1rem;
}

.teams-backup {
  display: flex;
  gap: 0.5rem;
  margin: 0.5rem 0 0;
}
