/* ==========================================================================
   Shared UI Core
   ========================================================================== */

body {
  margin: 0;
  background: var(--color-bg-app);
  color: var(--color-text-strong);
  font-family: var(--font-family-base);
}

.content {
  padding: 12px 10px 26px;
}

.page-wrap {
  max-width: 980px;
  margin: 0 auto;
}

.page-wrap--wide {
  max-width: 1120px;
}

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

.empty {
  padding: 16px 12px;
  color: var(--color-text-muted);
  font-size: var(--font-size-md);
}

.rating-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.rating-value {
  color: var(--color-text-strong);
  font-size: 0.9rem;
  font-weight: var(--font-weight-semibold);
}

.rating-lk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.06);
  color: var(--color-text-soft);
  font-size: 10px;
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
}

/* ==========================================================================
   Avatar
   ========================================================================== */

.app-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--avatar-size);
  height: var(--avatar-size);
  flex: 0 0 var(--avatar-size);
  overflow: hidden;
  background: #fff;
  border: 2px solid transparent;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
  box-sizing: border-box;
  border-radius: var(--avatar-radius);
}

.app-avatar--circle,
.app-avatar--rounded,
.app-avatar--square {
  border-radius: var(--avatar-radius);
}

.app-avatar__img,
.app-avatar__fallback,
.app-avatar__slot {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  border-radius: inherit;
}

.app-avatar__img {
  display: block;
  object-fit: cover;
}

.app-avatar__fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  font-size: calc(var(--avatar-size) * 0.32);
  font-weight: 800;
  letter-spacing: 0.01em;
  user-select: none;
}

.app-avatar__fallback--male {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.app-avatar__fallback--female {
  background: rgba(236, 72, 153, 0.12);
  color: #db2777;
}

.app-avatar__fallback--neutral {
  background: rgba(107, 114, 128, 0.12);
  color: #6b7280;
}

.app-avatar__slot {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.025);
  color: rgba(15, 23, 42, 0.45);
  font-size: var(--avatar-slot-font-size);
  font-weight: 500;
  line-height: 1;
}

.app-avatar__badge {
  position: absolute;
  left: var(--avatar-badge-inset);
  right: var(--avatar-badge-inset);
  bottom: var(--avatar-badge-inset);
  height: var(--avatar-badge-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius:
    0
    0
    calc(var(--avatar-radius) - var(--avatar-badge-inset))
    calc(var(--avatar-radius) - var(--avatar-badge-inset));
  background: linear-gradient(
    to top,
    rgba(17, 24, 39, 0.55),
    rgba(17, 24, 39, 0.45)
  );
  color: #fff;
  font-size: var(--avatar-badge-font-size);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.app-avatar--frame-neutral {
  border: 2px solid rgba(148, 163, 184, 0.35);
}

.app-avatar--frame-male {
  border: 2px solid rgba(148, 163, 184, 0.35);
}

.app-avatar--frame-female {
  border: 2px solid rgba(148, 163, 184, 0.35);
}

.app-avatar--frame-trainer {
  border: 2px solid rgba(16, 185, 129, 0.45);
}

.app-avatar--frame-captain {
  border: 2px solid rgba(37, 99, 235, 0.45);
}

.app-avatar--frame-admin {
  border: 2px solid rgba(239, 68, 68, 0.45);
}

.app-avatar--frame-premium {
  border: 2px solid rgba(245, 158, 11, 0.55);
}

.app-avatar--slot {
  border: 2px dashed rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.025);
  box-shadow: none;
}

.app-avatar__slot {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(15, 23, 42, 0.45);
  font-size: var(--avatar-slot-font-size);
  font-weight: 500;
  line-height: 1;
  border: 0;
  background: transparent;
}

/* ==========================================================================
   Cards and Form Controls
   ========================================================================== */

.tm-card {
  padding: 14px;
  background: var(--color-bg-body);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
}

.tm-card--skill {
  padding: 0;
  overflow: hidden;
}

.tm-card-body {
  padding: 16px;
}

.tm-form-error {
  margin-top: 6px;
  padding-left: 2px;
  color: var(--color-danger);
  font-size: var(--font-size-sm);
  line-height: 1.35;
}

.tm-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tm-field--full {
  grid-column: 1 / -1;
}

.tm-label {
  color: rgba(0, 0, 0, 0.65);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
}

.tm-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tm-inline-check {
  gap: 12px;
  min-height: 38px;
}

.tm-help {
  color: var(--color-text-soft);
  font-size: var(--font-size-sm);
}

.tm-help--form-note {
  display: block;
  margin-top: 8px;
}

.tm-help--form-strong {
  color: var(--color-text-strong);
  font-weight: var(--font-weight-semibold);
}

.tm-field-card {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: var(--field-height);
  padding: 0 var(--field-padding-x);
  background: var(--color-surface);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--field-radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tm-field-card:focus-within {
  border-color: rgba(13, 110, 253, 0.45);
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.12);
}

.tm-field-card--display {
  background: rgba(15, 23, 42, 0.035);
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: none;
}

.tm-field-card--display:hover,
.tm-field-card--display:focus-within {
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: none;
}

.tm-field-card-icon {
  flex: 0 0 auto;
  color: var(--color-text-soft);
  font-size: 14px;
}

.tm-field-card-control {
  width: 100%;
  min-height: calc(var(--field-height) - 2px);
  padding: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: rgba(0, 0, 0, 0.8);
  font-size: 14px;
  line-height: 1.2;
  font-weight: var(--font-weight-bold);
}

.tm-field-card-static {
  width: 100%;
  min-height: calc(var(--field-height) - 2px);
  display: flex;
  align-items: center;
  color: rgba(0, 0, 0, 0.66);
  font-size: 14px;
  line-height: 1.2;
  font-weight: var(--font-weight-bold);
  user-select: none;
  cursor: default;
}

.tm-field-card-display-icon {
  flex: 0 0 auto;
  color: var(--color-text-faint);
  font-size: 13px;
  opacity: 0.9;
}

.tm-field-card-control[type="time"] {
  min-width: 0;
}

.tm-field-card select.tm-field-card-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}

.tm-field-card-control[type="text"],
.tm-field-card-control[type="email"],
.tm-field-card-control[type="number"],
.tm-field-card-control[type="password"],
.tm-field-card-control[type="time"] {
  cursor: text;
}

.tm-field-card-chevron {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--color-text-faint);
  pointer-events: none;
}

.tm-field-card-control::-webkit-calendar-picker-indicator {
  opacity: 0.6;
}

.tm-field-card .flatpickr-input {
  width: 100%;
  min-height: calc(var(--field-height) - 2px);
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  outline: 0 !important;
  color: rgba(0, 0, 0, 0.8);
  font-size: var(--font-size-xl);
  line-height: 1.2;
  font-weight: var(--font-weight-bold);
  cursor: pointer;
}

.tm-field-card .flatpickr-input.tm-field-card-control,
.tm-field-card .tm-fp-control,
.tm-field-card .tm-fp-control[type="text"] {
  cursor: pointer !important;
}

.tm-field-card .flatpickr-input::-webkit-calendar-picker-indicator {
  display: none;
}

.tm-field-card--textarea {
  min-height: calc(var(--field-height) - 4px);
  resize: vertical;
  color: rgba(0, 0, 0, 0.8);
  font-size: 16px;
  line-height: 1.35;
  font-weight: var(--font-weight-medium);
}

.tm-field-card-icon--top {
  margin-top: 6px;
}

.tm-field-card-textarea-wrap {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.tm-field-card-textarea {
  min-height: 52px;
  resize: vertical;
  color: rgba(0, 0, 0, 0.8);
  font-size: 16px;
  line-height: 1.35;
  font-weight: var(--font-weight-medium);
}

.tm-field-card-textarea::placeholder {
  color: var(--color-text-faint);
}

.tm-field-card-counter {
  margin-top: auto;
  padding-top: 4px;
  text-align: right;
  color: var(--color-text-faint);
  font-size: 11px;
  font-weight: var(--font-weight-bold);
}

.tm-check-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  position: relative;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin: 0;
  background: var(--color-surface);
  border: 2px solid rgba(0, 0, 0, 0.22);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.tm-check-input:hover {
  border-color: rgba(13, 110, 253, 0.45);
}

.tm-check-input:checked {
  background: var(--primary-blue);
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.12);
}

.tm-check-input:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid var(--color-surface);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.tm-check-input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.14);
}

.tm-check-input:disabled {
  cursor: not-allowed;
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.14);
  box-shadow: none;
}

.tm-check-input:disabled:hover {
  border-color: rgba(15, 23, 42, 0.14);
}

.tm-field.is-disabled .tm-inline-check {
  cursor: not-allowed;
  opacity: 0.78;
}

.tm-field.is-disabled,
.tm-field.is-disabled * {
  cursor: not-allowed;
}

.tm-help--unavailable {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tm-help--unavailable i {
  color: var(--color-text-strong);
  font-size: 14px;
}

.tm-help-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.1);
  color: var(--color-text-strong);
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  line-height: 1;
}

.tm-help-chip--note {
  gap: 7px;
  min-height: 28px;
  padding: 0 10px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
}

.tm-help-chip--note i {
  font-size: 14px;
}

/* ==========================================================================
   Shared Sections
   ========================================================================== */

.section-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  box-shadow: 0 1px 0 var(--color-border-soft);
  overflow: hidden;
}

.section-head {
  background: var(--color-bg-body);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1px;
  flex-wrap: wrap;
}

.section-head.profile-head {
  padding: 10px;
  padding-left: 20px;
}

.section-body {
  padding: 14px;
  margin: 0 auto;
}

.section-divider {
  height: 1px;
  margin: 18px 0;
  background: rgba(0, 0, 0, 0.08);
}

.section-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.section-title {
  color: var(--color-text-strong);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-extrabold);
  line-height: 1.2;
}

/* ==========================================================================
   Shared Lists and Player Rows
   ========================================================================== */

.tm-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  background: var(--color-bg-body);
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.tm-list-item {
  display: flex;
  align-items: stretch;
  padding: 14px 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.tm-list-item + .tm-list-item {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.tm-player {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 0 4px;
}

.tm-player-content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tm-player-top {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.tm-player-name {
  min-width: 0;
  padding-top: 0;
  color: var(--color-text-strong);
  font-size: 18px;
  line-height: 1.2;
  font-weight: var(--font-weight-extrabold);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tm-list-item.is-highlight .tm-player-name {
  color: var(--color-organizer);
}

.tm-right-inline {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.tm-player-bottom {
  margin-top: 2px;
}

.tm-player-meta-text {
  color: var(--color-text-soft);
  font-size: var(--font-size-sm);
  line-height: 1.3;
}

.tm-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.tm-section-title {
  margin-bottom: 10px;
  font-weight: var(--font-weight-extrabold);
}

.tm-footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tm-footer-left,
.tm-footer-right {
  display: flex;
  gap: 10px;
}

.tm-divider {
  height: 1px;
  margin: 14px 0;
  background: var(--border-color);
  opacity: 0.8;
}

/* ==========================================================================
   Shared Buttons
   ========================================================================== */

.ui-btn {
  min-width: 0;
  height: var(--control-height-md);
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--ui-btn-text);
  background: var(--ui-btn-bg);
  border: 1px solid var(--ui-btn-border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: var(--transition-btn);
}

.ui-btn:hover {
  text-decoration: none;
}

.ui-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.ui-btn:focus,
.ui-btn:focus-visible {
  outline: none;
  box-shadow: none;
}

.ui-btn:disabled,
.ui-btn.is-disabled {
  opacity: 1;
  color: var(--color-text-faint);
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.10);
  pointer-events: none;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.ui-btn:disabled i,
.ui-btn.is-disabled i,
.ui-btn:disabled svg,
.ui-btn.is-disabled svg {
  color: inherit;
}

.ui-btn--primary {
  background: var(--ui-btn-color);
  border-color: var(--ui-btn-color);
  color: var(--ui-btn-text-on-color);
}

.ui-btn--primary:hover {
  background: var(--ui-btn-color-hover);
  border-color: var(--ui-btn-color-hover);
  color: var(--ui-btn-text-on-color);
}

.ui-btn--secondary {
  background: var(--color-surface);
  border-color: var(--ui-btn-border-strong);
  color: var(--ui-btn-text);
}

.ui-btn--secondary:hover {
  background: var(--ui-btn-secondary-bg-hover);
  border-color: var(--ui-btn-secondary-border-hover);
  color: var(--ui-btn-text);
}

.ui-btn--danger {
  background: var(--color-surface);
  border-color: var(--ui-btn-danger-border);
  color: var(--ui-btn-danger);
}

.ui-btn--danger:hover {
  background: var(--ui-btn-danger-soft);
  border-color: var(--ui-btn-danger-border-hover);
  color: var(--ui-btn-danger);
}

.ui-btn--success {
  background: var(--color-surface);
  border-color: var(--ui-btn-success-border);
  color: var(--ui-btn-success);
}

.ui-btn--success:hover {
  background: var(--ui-btn-success-soft);
  border-color: var(--ui-btn-success-border-hover);
  color: var(--ui-btn-success);
}

.ui-btn--lock {
  background: var(--ui-btn-lock-bg);
  border-color: var(--ui-btn-lock-border);
  color: var(--ui-btn-lock-text);
  cursor: default;
}

.ui-btn--lock:hover {
  background: var(--ui-btn-lock-bg);
  border-color: var(--ui-btn-lock-border);
  color: var(--ui-btn-lock-text);
  box-shadow: none;
  transform: none;
}

.ui-btn--ghost {
  background: transparent;
  border: 1px solid var(--color-border-soft);
  color: #6b7280;
}

.ui-btn--ghost:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.15);
}

.ui-btn--sm {
  height: var(--control-height-sm, 36px);
  padding: 0 10px;
  font-size: var(--font-size-sm, 13px);
}

.ui-btn--lg {
  height: var(--control-height-lg, 44px);
  padding: 0 14px;
}

.ui-btn--icon {
  min-width: 44px;
  padding: 0 14px;
  gap: 6px;
}

.ui-btn--icon.ui-btn--sm {
  min-width: 36px;
  padding: 0 10px;
}

.ui-btn--icon.ui-btn--lg {
  min-width: 44px;
  padding: 0 14px;
}

.ui-btn--block {
  width: 100%;
}

.ui-btn i,
.ui-btn svg {
  flex: 0 0 auto;
  line-height: 1;
}

.ui-pill-btn {
  height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: all 0.18s ease;
}

.ui-pill-btn i {
  font-size: 14px;
}

.ui-pill-btn--success {
  background: rgba(25, 135, 84, 0.1);
  border-color: rgba(25, 135, 84, 0.25);
  color: #198754;
}

.ui-pill-btn--success:hover {
  background: rgba(25, 135, 84, 0.18);
}

.ui-pill-btn--edit {
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.12);
  color: var(--color-text-strong);
}

.ui-pill-btn--edit:hover {
  background: rgba(15, 23, 42, 0.08);
  border-color: rgba(15, 23, 42, 0.18);
}

.ui-pill-btn--danger {
  background: rgba(220, 53, 69, 0.08);
  border-color: rgba(220, 53, 69, 0.22);
  color: #dc3545;
}

.ui-pill-btn--danger:hover {
  background: rgba(220, 53, 69, 0.15);
}

.app-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  line-height: 1;
  white-space: nowrap;
}

.app-pill--primary {
  background: rgba(111, 66, 193, 0.1);
  border-color: rgba(111, 66, 193, 0.18);
  color: var(--color-primary);
}

.app-pill--trainer {
  background: rgba(25, 135, 84, 0.1);
  border-color: rgba(25, 135, 84, 0.18);
  color: var(--color-role-trainer);
}

.app-pill--captain {
  background: rgba(13, 110, 253, 0.1);
  border-color: rgba(13, 110, 253, 0.18);
  color: var(--color-role-captain);
}

/* ==========================================================================
   Shared Choice and Rating Controls
   ========================================================================== */

.tm-rating {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tm-rating-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.tm-rating-val {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: #1f2a37;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-extrabold);
}

.tm-rating-hint {
  color: var(--color-text-faint);
  font-size: var(--font-size-sm);
}

.tm-rating.is-disabled {
  opacity: 0.45;
}

.tm-rating.is-disabled .tm-range {
  pointer-events: none;
}

.tm-rating.is-disabled .tm-slider-range {
  background: #cfd4da;
}

.tm-slider {
  --tm-thumb: 18px;
  --rail-pad: 22px;
  position: relative;
  height: 36px;
  display: flex;
  align-items: center;
}

.tm-slider-track,
.tm-slider-range {
  position: absolute;
  height: 8px;
  border-radius: var(--radius-pill);
}

.tm-slider-track {
  left: 0;
  right: 0;
  background: var(--primary-soft);
}

.tm-slider-range {
  background: var(--btn-primary);
  opacity: 0.25;
}

.tm-slider.is-lk .tm-slider-track,
.tm-slider.is-lk .tm-slider-range {
  transform: scaleX(-1);
}

.tm-range {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  height: 36px;
  margin: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  pointer-events: none;
}

.tm-range--min {
  z-index: 2;
}

.tm-range--max {
  z-index: 3;
}

.tm-range::-webkit-slider-runnable-track,
.tm-range::-moz-range-track {
  height: 8px;
  background: transparent;
  border: none;
}

.tm-range::-webkit-slider-thumb {
  pointer-events: all;
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -5px;
  border: 2px solid var(--color-surface);
  border-radius: 50%;
  background: var(--primary-blue);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

.tm-range::-moz-range-thumb {
  pointer-events: all;
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-surface);
  border-radius: 50%;
  background: var(--btn-primary);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

.tm-range--max::-webkit-slider-thumb,
.tm-range--max::-moz-range-thumb {
  background: var(--btn-primary);
}

.tm-rating.is-locked .tm-range {
  opacity: 0.7;
}

.tm-rating-marker {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  background: var(--color-surface);
  border: 1px solid var(--primary-dark);
  border-radius: var(--radius-pill);
  color: var(--btn-primary);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.tm-rating-marker:hover {
  background: var(--primary-soft);
}

.tm-rating-marker-label,
.tm-slider-value {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 6px;
  background: var(--color-surface);
  border-radius: var(--radius-pill);
  color: #1f2a37;
  font-weight: var(--font-weight-extrabold);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.tm-rating-marker-label {
  top: -22px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  line-height: 1;
  white-space: normal;
  font-size: var(--font-size-sm);
}

.tm-slider-value {
  top: -18px;
  z-index: 5;
  border: 1px solid rgba(0, 0, 0, 0.12);
  white-space: nowrap;
  font-size: 11px;
}

.tm-slider-value {
  left: calc(var(--rail-pad) + (var(--pct) * (100% - (2 * var(--rail-pad))) / 100));
}

.tm-slider-value--min {
  transform: translateX(-85%);
}

.tm-slider-value--max {
  transform: translateX(-25%);
}

.tm-radio-group {
  display: flex;
  gap: 0;
  margin-top: 4px;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radio-card-radius);
}

.tm-radio-card {
  flex: 1;
  min-width: 0;
  position: relative;
  min-height: var(--radio-card-height);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 var(--field-padding-x);
  background: var(--color-surface);
  cursor: pointer;
  user-select: none;
  border-radius: var(--radio-card-radius);
  transition: background-color 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.tm-radio-card:hover,
.tm-radio-card.is-active {
  background: var(--color-primary-soft);
}

.tm-radio-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tm-radio-control {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border: 1.5px solid rgba(0, 0, 0, 0.18);
  border-radius: var(--radius-pill);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.tm-radio-dot {
  width: 8px;
  height: 8px;
  background: var(--btn-primary);
  border-radius: var(--radius-pill);
  transform: scale(0);
  transition: transform 0.14s ease;
}

.tm-radio-main {
  flex: 1 1 auto;
  min-width: 0;
}

.tm-radio-title {
  color: var(--color-text-heading);
  font-size: 14px;
  line-height: 1.15;
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.01em;
}

.tm-radio-sub {
  margin-top: 2px;
  color: rgba(31, 41, 55, 0.56);
  font-size: var(--font-size-sm);
  line-height: 1.25;
}

.tm-radio-icon {
  flex: 0 0 auto;
  color: var(--btn-primary);
  font-size: var(--font-size-lg);
  transition: color 0.16s ease;
}

.tm-radio-card.is-active {
  box-shadow: inset 0 0 0 1px var(--primary-dark);
}

.tm-radio-card.is-active .tm-radio-control {
  border-color: var(--primary-dark);
  box-shadow: 0 0 0 1px var(--primary-soft);
}

.tm-radio-card.is-active .tm-radio-dot {
  transform: scale(1);
}

.tm-radio-card.is-active .tm-radio-title {
  color: var(--color-text-strong);
}

.tm-radio-card.is-active .tm-radio-sub {
  color: rgba(17, 24, 39, 0.62);
}

.tm-radio-card.is-active .tm-radio-icon {
  color: var(--color-text-strong);
}

.tm-radio-card.is-disabled {
  cursor: not-allowed;
  background: rgba(15, 23, 42, 0.03);
}

.tm-radio-card.is-disabled:hover {
  background: rgba(15, 23, 42, 0.03);
}

.tm-radio-card.is-disabled .tm-radio-control {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.7);
}

.tm-radio-card.is-disabled .tm-radio-title,
.tm-radio-card.is-disabled .tm-radio-sub,
.tm-radio-card.is-disabled .tm-radio-icon {
  color: rgba(31, 41, 55, 0.42);
}

/* ==========================================================================
   Shared Structured Layout Blocks
   ========================================================================== */

.mr-segment {
  width: 100%;
  padding: 2px;
  background: var(--segment-bg);
  border-radius: 0 0 16px 16px;
}

.mr-segment--card {
  padding: 1px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-color);
  border-radius: 16px;
}

.mr-segment-inner {
  display: flex;
  gap: 6px;
  width: 100%;
}

.mr-tab-content {
  touch-action: pan-y;
}

.mr-seg-btn {
  max-width: 200px;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 0 solid var(--segment-btn-border);
  border-radius: 14px;
  background: var(--segment-btn-bg);
  color: var(--segment-text);
  font-weight: var(--font-weight-medium);
  transition:
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.mr-seg-btn:hover {
  background: var(--segment-bg);
  color: var(--segment-count-text);
}

.mr-seg-btn i {
  font-size: 1.05rem;
  opacity: 0.9;
}

.mr-segment--card .mr-seg-btn {
  justify-content: center;
}

.mr-label {
  flex: 1;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mr-count {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  background: var(--segment-count-bg);
  color: var(--segment-count-text);
  font-size: 0.75rem;
  font-weight: var(--font-weight-bold);
  transition:
    background 0.18s ease,
    color 0.18s ease;
}

.mr-seg-btn.active {
  background: var(--segment-btn-bg-active);
  color: var(--segment-text-active);
  box-shadow: var(--segment-shadow-active);
  font-weight: var(--font-weight-bold);
  border: 1px solid var(--segment-btn-border);
}

.mr-seg-btn.active .mr-count {
  background: var(--segment-count-bg-active);
  color: var(--segment-count-text-active);
}

.add-member-form__grid,
.add-member-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.add-member-form__field,
.add-member-form-grid__col {
  min-width: 0;
}

.add-member-form-grid__col--full {
  grid-column: 1 / -1;
}

.club-subsection {
  overflow: visible;
}

.club-subsection__title {
  color: var(--color-text-strong);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-extrabold);
}

.role-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.role-card {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 14px;
  border: 1px solid var(--color-border-soft);
  border-radius: 16px;
  background: var(--color-surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.role-card:hover {
  border-color: rgba(111, 66, 193, 0.35);
  background: rgba(111, 66, 193, 0.04);
}

.role-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.role-card-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: var(--color-surface);
  color: transparent;
  font-size: 14px;
}

.role-card-content {
  min-width: 0;
}

.role-card-title,
.role-card-meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-card-title {
  color: var(--color-text-title);
  font-weight: var(--font-weight-extrabold);
  line-height: 1.2;
}

.role-card-meta {
  margin-top: 2px;
  color: var(--color-text-soft);
  font-size: var(--font-size-sm);
  line-height: 1.2;
}

.role-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(111, 66, 193, 0.08);
  color: var(--color-primary);
  font-size: 17px;
}

.role-card:has(input:checked) {
  border-color: var(--color-primary);
  background: rgba(111, 66, 193, 0.07);
  box-shadow: 0 8px 20px rgba(111, 66, 193, 0.12);
}

.role-card:has(input:checked) .role-card-check {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}

@media (max-width: 768px) {
  .mr-segment-inner {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .mr-seg-btn {
    max-width: none;
    width: 100%;
    justify-content: center;
    padding: 10px 8px;
    gap: 6px;
    border-radius: 12px;
  }

  .mr-seg-btn i {
    font-size: 15px;
  }

  .mr-count {
    padding: 2px 6px;
    font-size: 11px;
  }

  .add-member-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  .role-card-grid {
    grid-template-columns: 1fr;
  }

  .role-card {
    min-height: 58px;
    padding: 10px 12px;
  }
}
