/* PR #39 follow-up: scoped fixes only. */
.v140-inline-error {
  margin: 6px 0 0;
  padding: 9px 11px;
  border: 1px solid #f3b8c3;
  border-radius: 10px;
  background: #fff5f7;
  color: #b4233f;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.v140-password-field {
  position: relative;
  display: grid;
  min-width: 0;
}

.v140-password-field > input {
  padding-right: 84px;
}

.v140-password-field > button {
  position: absolute;
  top: 50%;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 70px;
  min-height: 38px;
  padding: 0 9px;
  translate: 0 -50%;
  border: 1px solid #edd3d8;
  border-radius: 10px;
  background: #fff9fa;
  color: #a92d48;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.v140-password-field > button .koirea-ui-icon {
  width: 18px;
  height: 18px;
}

.v140-signup-contact {
  margin: 2px 0 6px;
  text-align: center;
}

.v140-signup-contact a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 14px;
  color: #a92d48;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.v140-signup-contact .koirea-ui-icon {
  width: 19px;
  height: 19px;
}

body.page-mypage .v140-verification-status {
  align-content: center;
}

body.page-mypage .v140-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  min-height: 28px;
  margin-top: 5px;
  padding: 4px 10px;
  border: 1px solid #e6dde0;
  border-radius: 999px;
  background: #f7f5f6;
  color: #625b60;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

body.page-mypage .v140-status-chip.is-pending,
body.page-mypage .v935-photo-review-overlay {
  border-color: #f3c47b;
  background: #fff8e8;
  color: #8a5708;
}

body.page-mypage .v140-status-chip.is-complete {
  border-color: #a7e8cb;
  background: #effcf6;
  color: #087a53;
}

body.page-mypage .v935-photo-review-overlay {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  top: 10px !important;
  right: 10px !important;
  bottom: auto !important;
  left: auto !important;
  width: max-content !important;
  height: auto !important;
  min-width: 54px !important;
  max-width: calc(100% - 20px) !important;
  min-height: 28px;
  padding: 4px 10px;
  border-width: 1px;
  border-style: solid;
  border-radius: 999px;
  box-shadow: 0 5px 16px rgba(89, 61, 14, .12);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap !important;
  writing-mode: horizontal-tb !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  text-orientation: mixed !important;
}

.message-chat-list-search > button[data-chat-list-search-clear] {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 5px;
  display: inline-grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  translate: 0 -50%;




  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.message-chat-list-search > button[data-chat-list-search-clear][hidden] {
  display: none;
}

.message-chat-list-search:has(> button:not([hidden])) input {
  padding-right: 38px;
}

.v140-message-index-search {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 8px;
  width: min(760px, 100%);
  margin: 0 auto 12px;
  padding: 7px 8px 7px 13px;
  border: 1px solid #e3d9dc;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(30, 25, 28, .05);
}

.v140-message-index-search .koirea-ui-icon { position: static !important; display: block; width: 20px; height: 20px; margin: 0; translate: none; color: #a92d48; }
.v140-message-index-search input { position: static !important; box-sizing: border-box; width: 100%; min-width: 0; min-height: 40px; padding: 0 4px; border: 0; border-radius: 0; background: transparent; box-shadow: none; text-indent: 0; }
.v140-message-index-search input:focus { outline: 0; }
.v140-message-index-search button {
  width: 32px; min-height: 32px; padding: 0;     font-size: 18px; cursor: pointer;
}
.v140-message-index-search button[hidden] { visibility: hidden; }
.v140-message-index-empty { width: min(760px, 100%); margin: 10px auto; }

.v140-message-row-utilities {
  position: relative;
  z-index: 4;
  grid-column: 4;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.v140-message-row-menu { position: relative; pointer-events: auto; }

body.page-messages .v787-message-row:has(.v140-message-row-menu[open]) {
  z-index: 30 !important;
}

.v140-message-row-menu > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 36px;
  padding: 0 10px;




  font-size: 12px;
  font-weight: 850;
  list-style: none;
  cursor: pointer;
}

.v140-message-row-menu > summary::-webkit-details-marker { display: none; }
.v140-message-row-menu > summary .koirea-ui-icon { width: 18px; height: 18px; }
.v140-message-row-menu > summary span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.v140-message-row-menu > div {
  position: absolute;
  z-index: 25;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  gap: 6px;
  width: min(260px, calc(100vw - 32px));
  padding: 8px;
  border: 1px solid #e7dce0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(27, 23, 25, .16);
}

.v140-message-row-menu form { margin: 0; }
.v140-message-row-menu :is(a, button) { width: 100%; justify-content: flex-start; }

.message-chat-list-search {
  display: grid !important;
  grid-template-columns: 20px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 12px !important;
  overflow: visible !important;
}

.message-chat-list-search > .koirea-ui-icon,
.message-chat-list-search > svg {
  position: static !important;
  grid-column: 1;
  width: 18px !important;
  height: 18px !important;
  margin: 0 !important;
  translate: none !important;
}

.message-chat-list-search > input {
  position: static !important;
  grid-column: 2;
  box-sizing: border-box;
  width: 100% !important;
  min-width: 0 !important;
  padding: 0 3px !important;
  text-indent: 0 !important;
}

.message-chat-list-search > button[data-chat-list-search-clear] {
  position: static;
  grid-column: 3;
  translate: none;
}

.v140-template-editor-launch {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 0;
}

.v140-template-editor-launch > small { color: #70676c; line-height: 1.45; }

.v140-template-modal {
  position: fixed;
  z-index: 11000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.v140-template-modal[hidden] { display: none !important; }
.v140-template-modal-backdrop {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.v140-template-modal-backdrop:where(:not(body.koirea-member-web [data-button-role])) {
  border: 0;border-radius: 0;background: rgba(24, 18, 21, .48);
}
.v140-template-modal-card { position: relative; z-index: 1; width: min(520px, 100%); max-height: min(720px, calc(100dvh - 32px)); overflow: auto; padding: 22px; border: 1px solid #eadde1; border-radius: 22px; background: #fff; box-shadow: 0 24px 70px rgba(31, 21, 25, .24); }
.v140-template-modal-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.v140-template-modal-card > header h2 { margin: 2px 0 0; font-size: clamp(21px, 4vw, 26px); }
.v140-template-modal-card > header > button {
  display: grid; place-items: center; flex: 0 0 40px; width: 40px; min-height: 40px; padding: 0;     font-size: 24px; cursor: pointer;
}
.v140-template-modal-card > header > button:where(:not(body.koirea-member-web [data-button-role])) {
  border: 1px solid #eadde1;border-radius: 12px;background: #fff;color: #4c4448;
}
.v140-template-modal-card > p { margin: 0 0 16px; color: #685f64; line-height: 1.6; }
.v140-template-modal-card form { display: grid; gap: 8px; }
.v140-template-modal-card label { display: grid; gap: 7px; color: #332b2f; font-weight: 850; }
.v140-template-modal-card input { box-sizing: border-box; width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #d9ced2; border-radius: 12px; background: #fff; }
.v140-template-clear {
  justify-self: end; min-height: 36px; padding: 5px 10px;    font-weight: 800; cursor: pointer;
}
.v140-template-clear:where(:not(body.koirea-member-web [data-button-role])) {
  border: 0;background: transparent;color: #c22e50;
}
.v140-template-modal-status { min-height: 24px; margin: 2px 0 0 !important; color: #116b50 !important; font-weight: 800; }
.v140-template-modal-actions { display: flex; gap: 10px; margin-top: 2px; }
.v140-template-modal-actions > * { flex: 1; }
.v140-template-modal-open { overflow: hidden; }

@media (max-width: 560px) {
  .v140-password-field > button { min-height: 40px; }
  body.page-mypage .v140-status-chip { font-size: 11px; padding-inline: 8px; }
  body.page-messages .v787-message-list .v787-message-row { grid-template-columns: 54px minmax(0, 1fr) auto !important; }
  body.page-messages .v787-message-list .v787-message-actions { display: none !important; }
  body.page-messages .v140-message-row-utilities { grid-column: 3; }
  body.page-messages:where(:not(.koirea-member-web)) .v140-message-row-utilities .v878-simple-pin-form { display: none !important; }
  .v140-message-row-menu > summary { min-width: 44px; min-height: 44px; padding: 0 10px; }
  .v140-message-row-menu[open] > div {
    position: fixed;
    z-index: 10050;
    inset: auto 10px calc(74px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: none;
    box-shadow: 0 20px 48px rgba(27, 23, 25, .22);
  }
  .v140-template-editor-launch { align-items: flex-start; flex-direction: column; }
  .v140-template-modal { align-items: end; padding: 0; }
  .v140-template-modal-card { width: 100%; max-height: calc(100dvh - 18px); padding: 20px 16px calc(18px + env(safe-area-inset-bottom, 0px)); border-radius: 22px 22px 0 0; }
  .v140-template-modal-actions { flex-direction: column; }
}
