.create-platform-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.create-platform-field legend {
  margin-bottom: 5px;
  padding: 0;
}

.create-platform-choices {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.create-platform-choice {
  position: relative;
}

.create-platform-choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.create-platform-choice .platform-tag {
  display: flex;
  min-height: 36px;
  justify-content: center;
  padding: 0 3px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  font-size: 14px;
}

.create-platform-choice input:hover:not(:checked, :disabled) + .platform-tag {
  border-color: var(--accent-border);
  background: var(--accent-subtle);
}

.create-platform-choice input:checked + .platform-tag {
  border-color: var(--accent);
  background: var(--accent-subtle);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.create-platform-choice input:disabled {
  cursor: not-allowed;
}

.create-platform-choice input:disabled + .platform-tag {
  border-color: var(--border-light);
  background: var(--bg-disabled);
  color: var(--text-disabled);
  box-shadow: none;
}

.create-platform-choice input:focus-visible + .platform-tag {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.create-tutor-picker {
  position: relative;
}

.create-tutor-picker .form-control {
  min-height: 38px;
  padding-right: 44px;
  caret-color: var(--accent);
}

.create-tutor-picker:has(.account-clear:not([hidden])) .form-control {
  padding-right: 78px;
}

.create-tutor-picker .form-control::placeholder {
  color: var(--text-muted);
}

.create-tutor-controls {
  position: absolute;
  inset: 1px 3px 1px auto;
  display: flex;
  align-items: center;
  gap: 2px;
}

.create-tutor-controls button {
  position: relative;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.create-tutor-controls button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.create-tutor-controls .account-clear {
  color: #475569;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  isolation: isolate;
}

.create-tutor-controls .account-clear::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #e2e8f0;
  z-index: -1;
  transition: background-color 0.15s ease;
}

.create-tutor-controls .account-clear:hover:not(:disabled) {
  color: #b91c1c;
}

.create-tutor-controls .account-clear:hover:not(:disabled)::before {
  background: #fee2e2;
}

.create-tutor-controls .account-clear:disabled::before {
  background: #f1f5f9;
}

.create-tutor-controls .account-toggle:hover:not(:disabled),
.create-tutor-picker:has([aria-expanded="true"]) .account-toggle:not(:disabled) {
  background: var(--accent-subtle);
  color: var(--accent-hover);
}

.create-tutor-controls button:disabled {
  color: var(--text-disabled);
  cursor: not-allowed;
}

.create-tutor-picker:has([aria-expanded="true"]) .account-toggle svg {
  transform: rotate(180deg);
}

.create-tutor-popup {
  position: absolute;
  inset: calc(100% + 4px) 0 auto;
  z-index: 3;
  padding: 4px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  box-shadow: var(--shadow-md);
}

.create-tutor-popup ul {
  max-height: min(220px, 32vh);
  overflow: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: 0;
  list-style: none;
}

.create-tutor-popup li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.create-tutor-popup li[aria-selected="true"] {
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 700;
}

.create-tutor-popup li:is(:hover, .is-active) {
  background: var(--accent-soft);
  color: var(--accent);
}

.create-tutor-popup li[aria-selected="true"]::after {
  content: '';
  flex: 0 0 9px;
  height: 5px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}

.create-tutor-popup p {
  margin: 0;
  padding: 8px 10px;
  color: var(--text-muted);
}

.account-search-row { position:relative; }
.account-search-row .form-control { width:100%; }
.create-tutor-popup li { justify-content:flex-start; }
.account-text { display:grid; min-width:0; gap:2px; }
.account-text strong { font-size:14px; line-height:1.4; }
.account-text small { color:var(--text-secondary); font-size:12px; overflow-wrap:anywhere; }
.chosen-account { display:flex; gap:8px; align-items:center; margin-top:6px; min-width:0; }
.chosen-account[hidden], .create-tutor-controls button[hidden], select[hidden] { display:none; }
.create-tutor-picker.has-choice:not(.is-open) .form-control {
  color:transparent; caret-color:transparent;
}
.create-tutor-picker.has-choice:not(.is-open) .chosen-account {
  position:absolute; inset:1px 76px 1px 10px; pointer-events:none; margin:0; overflow:hidden;
}
.create-tutor-picker.has-choice:not(.is-open) .chosen-account .staff-avatar {
  width:22px; height:22px; font-size:11px; flex-shrink:0;
}
.create-tutor-picker.has-choice:not(.is-open) .chosen-account .account-text {
  display:flex; align-items:baseline; gap:6px; min-width:0; flex:1;
}
.create-tutor-picker.has-choice:not(.is-open) .chosen-account .account-text strong {
  font-size:13.5px; line-height:1.2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; flex:0 1 auto; min-width:0;
}
.create-tutor-picker.has-choice:not(.is-open) .chosen-account .account-text small {
  font-size:12px; line-height:1.2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; flex:0 2 auto; min-width:0;
}
.create-tutor-picker.is-open .chosen-account { display:none; }
.chosen-account small { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

@media (max-width: 640px) {
  .create-platform-choice .platform-tag,
  .create-tutor-picker .form-control,
  .create-tutor-popup li {
    min-height: 44px;
  }

  .create-tutor-picker .form-control {
    padding-right: 50px;
    font-size: 16px;
  }

  .create-tutor-picker:has(.account-clear:not([hidden])) .form-control {
    padding-right: 92px;
  }

  .create-tutor-controls button {
    width: 40px;
    height: 40px;
  }

  .create-tutor-controls .account-clear {
    font-size: 16px;
  }

  .create-tutor-controls .account-clear::before {
    width: 26px;
    height: 26px;
  }

  .create-tutor-picker.has-choice:not(.is-open) .chosen-account {
    inset: 1px 92px 1px 10px;
  }
}
