.profile-editor { max-width: 820px; }
.profile-form { gap: 24px; }
.profile-form .form-section {
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 20px 28px;
  padding: 24px;
  border-radius: 16px;
}
.profile-form .match-section { grid-template-columns: 1fr; }
.profile-form .match-section > .section-heading { grid-column: 1 / -1; }
.profile-fields { gap: 18px; }
.profile-fields textarea { min-height: 100px; }
.profile-fields .name-age { grid-template-columns: minmax(0, 1fr) 100px; }
.select-field { display: grid; gap: 8px; min-width: 0; font-size: 0.9375rem; font-weight: 600; }
.select-control { position: relative; display: block; min-width: 0; }
.select-control select { appearance: none; width: 100%; min-height: 48px; padding: 12px 42px 12px 14px; color: var(--ink); font-size: 1rem; line-height: 1.4; font-weight: 400; cursor: pointer; background: var(--surface); }
.select-control svg { pointer-events: none; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; }
.profile-fields .choice-grid { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.profile-fields .choice-grid label { border: 0; padding: 8px 0; min-height: 44px; border-radius: 0; background: none; font-weight: 400; }
.profile-fields .choice-grid label:has(input:checked) { background: none; }
.profile-fields .choice-grid input { margin: 0; }
.selection-field { padding: 0; margin: 0; border: 0; min-width: 0; }
.selection-field legend { font-size: 0.9375rem; font-weight: 600; margin-bottom: 8px; }
.selection-options { display: flex; gap: 8px; flex-wrap: wrap; }
.selection-options .selection-option {
  position: relative;
  display: flex;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.selection-option input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.selection-option span {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--control-line);
  border-radius: 10px;
  background: white;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
}
.selection-option input:checked + span {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  color: var(--accent-dark);
  font-weight: 700;
}
.selection-option input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 3px; }
.selection-option input[aria-invalid="true"] + span { border-color: var(--danger); }
.start-page { max-width: 660px; padding-top: clamp(24px, 5vh, 64px); }
.start-page h1 { font-size: clamp(1.75rem, 3.4vw, 2.65rem); line-height: 1.3; }
.start-controls { margin-top: 24px; }
.match-conditions { gap: 12px; }
.match-conditions > span { min-width: 0; overflow-wrap: anywhere; }
.waiting-page { max-width: 560px; }
.waiting-indicator { display: flex; gap: 8px; margin-bottom: 24px; }
.waiting-indicator span { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); animation: breathe 1.2s ease-in-out infinite alternate; }
.waiting-indicator span:nth-child(2) { animation-delay: 0.2s; }
.waiting-indicator span:nth-child(3) { animation-delay: 0.4s; }
.waiting-page .match-conditions { margin-bottom: 20px; }
[aria-busy="true"] { cursor: progress; }
button[aria-busy="true"]::before {
  content: "";
  width: 14px;
  height: 14px;
  display: inline-block;
  flex-shrink: 0;
  margin-right: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: rotate 0.8s linear infinite;
}
@keyframes breathe { to { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) {
  .waiting-indicator span, button[aria-busy="true"]::before { animation: none; }
}
@media (max-width: 760px) {
  .profile-form .form-section { display: block; padding: 18px; }
  .profile-fields .field-row { grid-template-columns: 1fr; }
  .profile-fields .name-age { grid-template-columns: minmax(0, 1fr) 80px; }
  .profile-save { padding: 0; }
  .selection-option span { padding: 10px; }
  .start-page { padding-top: 24px; }
  .mobile-nav a { font-size: 0.8125rem; text-align: center; }
}
@media (max-width: 360px) {
  .profile-form .form-section { padding: 14px; }
  .profile-fields .name-age { grid-template-columns: 1fr; }
}
html[data-large-text="true"] .profile-fields .field-row { grid-template-columns: 1fr; }
html[data-large-text="true"] .selection-options { display: grid; grid-template-columns: 1fr; }
