/* Pre-UI2 stabilization: component-scoped fixes only. */

/* Profile editor */
body.page-profile-edit .pre-ui2-onboarding-skip,
body.page-onboarding .pre-ui2-onboarding-skip {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 12px;
}
body:is(.page-profile-edit,.page-onboarding) .pre-ui2-bio-field > textarea {
  min-height: 240px;
  line-height: 1.75;
}
.pre-ui2-bio-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #667085;
  font-size: .84rem;
  font-weight: 750;
}
.pre-ui2-bio-tools > [data-profile-bio-count] { white-space: nowrap; }
.pre-ui2-bio-dialog,
.pre-ui2-age-success-dialog,
.r7-phone-send-dialog {
  width: min(760px, calc(100% - 32px));
  max-width: none;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: transparent;
  box-shadow: 0 30px 90px rgba(24, 31, 45, .3);
}
.r7-phone-send-dialog { width: min(440px, calc(100% - 32px)); }
.r7-phone-send-dialog__body { min-width: 0; gap: 12px; }
.r7-phone-send-dialog__body :is(h3,p) { margin: 0; overflow-wrap: anywhere; }
.r7-phone-send-dialog__body .r7-phone-dialog-kicker {
  display: block;
  width: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #c82d52;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}
.pre-ui2-bio-dialog::backdrop,
.pre-ui2-age-success-dialog::backdrop,
.r7-phone-send-dialog::backdrop {
  background: rgba(17, 24, 39, .52);
  backdrop-filter: blur(4px);
}
.pre-ui2-bio-dialog__surface,
.pre-ui2-age-success-dialog > div,
.r7-phone-send-dialog > div {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid #f0dfe2;
  border-radius: 24px;
  background: #fff;
}
.pre-ui2-bio-dialog__head,
.pre-ui2-bio-dialog__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.pre-ui2-bio-dialog__head :is(p,h2),
.pre-ui2-age-success-dialog :is(p,h2) { margin: 0; }
.pre-ui2-bio-dialog textarea {
  width: 100%;
  min-height: min(52vh, 480px);
  resize: vertical;
  padding: 16px;
  border: 1px solid #d8dfe8;
  border-radius: 16px;
  font: inherit;
  line-height: 1.8;
}
.pre-ui2-bio-dialog__footer > div { display: flex; gap: 8px; }

/* My Page alignment and state visibility */
body.page-mypage.koirea-member-web .v104-mission-panel {
  width: min(var(--kw-content, 1120px), calc(100% - 32px));
  margin-inline: auto;
  box-sizing: border-box;
}
body.page-mypage.koirea-member-web :is(.v64-photo-grid,.photo-review-grid) .v935-photo-frame {
  aspect-ratio: 4 / 5;
}
body.page-mypage.koirea-member-web :is(.v64-photo-grid,.photo-review-grid) .v935-photo-frame > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
body.page-mypage.koirea-member-web .v103-photo-preview {
  width: min(230px, 100%);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 16px;
}
body.page-mypage.koirea-member-web .v103-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
body.page-mypage.koirea-member-web .v103-photo-upload-status[data-state="success"] {
  padding: 12px 14px;
  border: 1px solid #a7e8cb;
  border-radius: 12px;
  background: #effcf6;
  color: #087a53;
  white-space: pre-line;
}

/* Age-locked message rows expose metadata, but never the real body. */
body.page-messages.koirea-member-web .v787-message-row.is-age-locked,
body.koirea-app-body .koirea-app-message-row.is-age-locked {
  background: linear-gradient(135deg, #fff, #fff7f9);
}
body.page-messages.koirea-member-web .v787-message-row.is-age-locked .v787-message-preview,
body.koirea-app-body .koirea-app-message-row.is-age-locked p {
  color: #8a5361;
  font-weight: 750;
}
.pre-ui2-age-success-dialog > div { text-align: center; }
.pre-ui2-age-success-dialog .v680-age-success-kicker {
  display: block;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #c82d52;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}
.pre-ui2-age-success-dialog p { color: #566176; line-height: 1.8; }
.pre-ui2-age-success-dialog form { display: flex; justify-content: center; }

/* Contact category helper and server-owned member ID. */
body.page-contact .v806-contact-member-id {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid #e7dce0;
  border-radius: 12px;
  background: #f8f6f7;
  color: #172033;
  font-weight: 850;
}
body.page-contact [data-contact-helper] {
  min-width: 0;
}
body.page-contact [data-contact-helper] li {
  overflow-wrap: anywhere;
}

/* Keep only the current 1024px TOP CTA position correction local to Hero actions. */
@media (min-width: 901px) and (max-width: 1100px) {
  body.page-home.v164-public-top-direction .k33-home .k33-hero-actions {
    display: grid;
    grid-template-columns: minmax(0, 220px) minmax(0, 200px);
    width: min(100%, 432px);
    gap: 12px;
    align-items: stretch;
  }
  body.page-home.v164-public-top-direction .k33-home .k33-hero-actions > [data-button-role] {
    width: 100%;
    min-width: 0;
  }
  body.page-home.v164-public-top-direction .k33-home .k33-hero-actions .k33-btn-primary[data-button-role] > span {
    white-space: nowrap;
  }
}

/* SMS confirmation is a clear final checkpoint before the provider call. */
.r7-phone-send-dialog__number {
  padding: 13px 15px;
  border-radius: 13px;
  background: #fff4f6;
  color: #d92d55;
  font-size: 1.1rem;
  font-weight: 900;
  text-align: center;
}
.r7-phone-send-dialog__actions { display: flex; justify-content: flex-end; gap: 8px; }

@media (max-width: 600px) {
  body:is(.page-profile-edit,.page-onboarding) .pre-ui2-bio-field > textarea { min-height: 220px; }
  .pre-ui2-onboarding-skip .button { width: 100%; justify-content: center; }
  .pre-ui2-bio-dialog {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
  .pre-ui2-bio-dialog__surface {
    min-height: 100%;
    border-radius: 0;
    padding: 16px 12px max(16px, env(safe-area-inset-bottom));
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  .pre-ui2-bio-dialog__head { align-items: flex-start; gap: 8px; }
  .pre-ui2-bio-dialog__head > div { flex: 1 1 auto; min-width: 0; }
  .pre-ui2-bio-dialog__head h2 { font-size: 1.25rem; white-space: nowrap; }
  .pre-ui2-bio-dialog__head > .button { flex: 0 0 auto; width: auto; min-width: 88px; }
  .pre-ui2-bio-dialog textarea { min-height: 0; height: 100%; resize: none; }
  .pre-ui2-bio-dialog__footer { align-items: stretch; flex-direction: column; }
  .pre-ui2-bio-dialog__footer > div { display: grid; grid-template-columns: 1fr 1fr; }
  .r7-phone-send-dialog__actions { display: grid; grid-template-columns: 1fr 1fr; }
}

body.page-mypage.koirea-member-web .pre-ui2-photo-blur-form { margin: 0; }
body.page-mypage.koirea-member-web .pre-ui2-photo-blur-form .button { width: 100%; min-height: 42px; }
