/* Shared profile-setting modal surface used by chat pages and MyPage. */
.matching-settings-card {
  width: 100%;
  padding: 0;
  box-sizing: border-box;
  color: var(--hf-color-text-strong);
}

.matching-settings-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  padding-right: 34px;
}

.matching-settings-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--hf-color-primary-text);
  background: var(--hf-color-primary-soft);
  border-radius: 50%;
  font-size: 19px;
}

.matching-settings-heading-text {
  min-width: 0;
}

.matching-settings-heading h2 {
  margin: 0;
  color: var(--hf-color-text-strong);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.35;
}

.matching-settings-heading p {
  margin: 5px 0 0;
  color: var(--hf-color-muted);
  font-size: 13px;
  line-height: 1.5;
}

.matching-settings-fieldset + .matching-settings-fieldset {
  margin-top: 20px;
}

.matching-settings-label {
  display: block;
  margin-bottom: 9px;
  color: var(--hf-color-text-strong);
  font-size: 13px;
  font-weight: 700;
}

.matching-settings-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.matching-settings-option {
  min-height: 40px;
  padding: 0 15px;
  color: var(--hf-color-text);
  background: var(--hf-color-surface);
  border: 1px solid var(--hf-color-line);
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.matching-settings-option.is-selected {
  color: var(--hf-control-selected-text);
  background: var(--hf-control-selected-bg);
  border-color: var(--hf-control-selected-border);
  box-shadow: inset 0 0 0 1px var(--hf-focus-ring);
}

.matching-settings-actions {
  display: flex;
  margin-top: 24px;
}

.matching-settings-save,
.room-profile-modal .room-primary-button {
  width: 100%;
  min-height: 44px;
  padding: 0 18px;
  color: var(--hf-button-primary-text);
  background: var(--hf-button-primary-bg);
  border: 1px solid var(--hf-button-primary-bg);
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.matching-settings-save:disabled,
.room-profile-modal .room-primary-button:disabled {
  color: var(--hf-control-disabled-text);
  background: var(--hf-control-disabled-bg);
  border-color: var(--hf-control-disabled-border);
  cursor: default;
}

.matching-settings-note {
  margin: 11px 0 0;
  color: var(--hf-color-muted);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  word-break: keep-all;
}

.matching-settings-recaptcha-wrap,
.room-recaptcha-wrap {
  margin-top: 16px;
  padding: 14px;
  overflow: hidden;
  background: var(--hf-color-surface-soft);
  border: 1px solid var(--hf-color-line);
  border-radius: 10px;
}

.room-recaptcha-wrap[hidden] {
  display: none;
}

.matching-settings-recaptcha-status,
.room-recaptcha-wrap small {
  display: block;
  margin: 8px 0 0;
  color: var(--hf-color-muted);
  font-size: 10px;
  line-height: 1.45;
}

.matching-settings-recaptcha-status.is-success {
  color: var(--hf-color-success);
  font-weight: 700;
}

.matching-settings-recaptcha-status.is-error,
.room-field-message.is-error {
  color: var(--hf-color-danger-hover);
}

.room-modal-dialog h2 {
  margin: 8px 32px 18px 0;
  color: var(--hf-color-text-strong);
  font-size: 21px;
}

.room-modal-description {
  margin: -8px 0 16px;
  color: var(--hf-color-muted);
  font-size: 11px;
  line-height: 1.6;
}

.room-input-label {
  display: block;
  margin: 13px 0 6px;
  color: var(--hf-color-text-strong);
  font-size: 11px;
  font-weight: 800;
}

.room-modal-dialog .hf-modal-body > .room-input-label:first-child {
  margin-top: 0;
}

.room-full-input {
  box-sizing: border-box;
  width: 100%;
  padding: 11px 12px;
  color: var(--hf-color-text);
  background: var(--hf-color-surface);
  border: 1px solid var(--hf-color-line-strong);
  border-radius: 10px;
  outline: 0;
  font-size: 14px;
}

.room-full-input:focus {
  border-color: var(--hf-color-primary-border);
  box-shadow: 0 0 0 3px var(--hf-focus-ring);
}

.room-profile-badge-section {
  margin-top: 18px;
  padding: 14px;
  background: var(--hf-color-surface-soft);
  border: 1px solid var(--hf-color-line);
  border-radius: 14px;
}

.room-profile-badge-heading > strong {
  color: var(--hf-color-text-strong);
  font-size: 13px;
}

.room-profile-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  background: var(--hf-color-surface);
  border: 1px solid var(--hf-color-line);
  border-radius: 12px;
}

.room-profile-badge {
  --profile-color: var(--hf-color-primary);
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--profile-color);
  border: 0;
  border-radius: 13px;
  font-size: 12px;
  font-weight: 900;
}

.room-profile-preview-badge {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  border-radius: 18px;
  font-size: 14px;
}

.room-profile-preview-badge[data-profile-emoji-active="true"] {
  font-size: 16px;
  font-weight: 400;
}

.room-profile-preview > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.room-profile-preview strong {
  overflow: hidden;
  color: var(--hf-color-text-strong);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-profile-preview small,
.room-profile-badge-label-row small {
  color: var(--hf-color-muted);
  font-size: 10px;
}

.room-profile-badge-control {
  margin-top: 14px;
}

.room-profile-badge-label,
.room-profile-badge-label-row {
  display: block;
  margin-bottom: 8px;
  color: var(--hf-color-text-strong);
  font-size: 11px;
  font-weight: 700;
}

.room-profile-badge-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.room-profile-badge-label-row .room-profile-badge-label {
  margin-bottom: 0;
}

.room-color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-left: 2px;
}

.room-color-button {
  width: 30px;
  height: 30px;
  padding: 0;
  background: var(--profile-color);
  border: 3px solid var(--hf-color-surface);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--hf-color-line-strong);
}

.room-color-button.is-selected {
  box-shadow: 0 0 0 2px var(--hf-control-selected-border);
}

.room-profile-emoji-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(38px, 1fr));
  gap: 7px;
}

.room-profile-emoji-button {
  min-width: 0;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--hf-color-text);
  background: var(--hf-color-surface);
  border: 1px solid var(--hf-color-line);
  border-radius: 11px;
  font-size: 21px;
  line-height: 1;
}

.room-profile-emoji-button.is-selected {
  border-color: var(--hf-control-selected-border);
  box-shadow: 0 0 0 1px var(--hf-control-selected-border);
}

.room-profile-emoji-button.is-default {
  flex-direction: column;
  gap: 1px;
  font-size: 11px;
  font-weight: 800;
}

.room-profile-emoji-default-preview {
  font-size: 12px;
  line-height: 1.1;
}

.room-profile-emoji-button small {
  font-size: 8px;
  font-weight: 700;
}

.room-profile-emoji-expand {
  display: none;
}

.room-field-message {
  min-height: 20px;
  margin: 10px 0;
  color: var(--hf-color-muted);
  font-size: 10px;
}

.room-profile-actions {
  display: block;
}

@media (hover: hover) and (pointer: fine) {
  .matching-settings-option:hover {
    color: var(--hf-control-selected-text);
    background: var(--hf-control-selected-hover-bg);
    border-color: var(--hf-control-selected-border);
  }
}

@media (max-width: 768px) {
  .matching-settings-heading {
    align-items: flex-start;
    margin-bottom: 18px;
    padding-right: 32px;
  }

  .matching-settings-icon {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    font-size: 17px;
  }

  .matching-settings-heading h2 {
    font-size: 17px;
  }

  .matching-settings-heading p {
    font-size: 12px;
  }

  .matching-settings-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .matching-settings-age-options .matching-settings-option:last-child {
    grid-column: 1 / -1;
  }

  .matching-settings-option {
    width: 100%;
    min-height: 42px;
    padding: 0 8px;
    font-size: 12px;
  }

  .room-profile-badge-section {
    padding: 12px;
  }

  .room-profile-emoji-grid {
    grid-template-columns: repeat(6, minmax(38px, 1fr));
  }

  .room-profile-emoji-grid[data-emoji-expanded="false"]
    > .room-profile-emoji-button:nth-of-type(n + 6) {
    display: none;
  }

  .room-profile-emoji-expand {
    grid-column: 6;
    grid-row: 1;
    min-width: 0;
    height: 42px;
    padding: 0;
    padding-top: 2px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    color: var(--hf-color-muted);
    background: var(--hf-color-surface-soft);
    border: 1px dashed var(--hf-color-line-strong);
    border-radius: 11px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
  }

  .room-profile-emoji-expand .fa {
    font-size: 12px;
  }

  .room-profile-emoji-expand[aria-expanded="true"] {
    grid-column: 1 / -1;
    grid-row: auto;
    height: 34px;
    flex-direction: row;
    gap: 5px;
  }

  .room-profile-emoji-expand:focus-visible {
    border-color: var(--hf-control-selected-border);
    outline: 2px solid var(--hf-focus-ring);
    outline-offset: 1px;
  }

  .room-profile-badge-label-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
}
