.comment-modal[hidden] { display: none !important; }

.comment-modal {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  background: rgba(54, 29, 43, .46);
  backdrop-filter: blur(9px);
  animation: commentFadeIn .2s ease-out both;
}

body.comment-modal-open { overflow: hidden; }

.comment-modal__panel {
  width: min(680px, 100%);
  max-height: min(850px, calc(100dvh - 36px));
  overflow: auto;
  border: 1px solid rgba(183, 82, 112, .25);
  border-radius: 32px 10px 32px 10px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(255, 246, 249, .98));
  box-shadow: 0 30px 90px rgba(70, 30, 49, .28);
  color: #60434f;
  animation: commentPanelIn .28s cubic-bezier(.2,.8,.2,1) both;
}

.comment-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 26px 17px;
  border-bottom: 1px solid rgba(183, 82, 112, .13);
}

.comment-modal__head h2 { margin: 5px 0 4px; color: #6c394a; font-size: clamp(1.65rem, 5vw, 2.2rem); line-height: 1.1; }
.comment-modal__head p { margin: 0; color: #92717d; font-size: .94rem; }
.comment-modal__eyebrow { color: #b65c78; font: 700 .7rem/1 Georgia, serif; letter-spacing: .14em; }
.comment-modal__close { flex: 0 0 44px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #f8e2e9; color: #a04f68; font-size: 1.65rem; line-height: 1; cursor: pointer; }
.comment-modal__close:hover { transform: rotate(5deg); background: #f3cfda; }
.comment-modal__target { margin: 17px 26px 0; border: 1px dashed rgba(183, 82, 112, .24); border-radius: 14px; background: rgba(249, 226, 233, .55); padding: 10px 13px; color: #98536a; font-weight: 800; word-break: keep-all; }

.comment-thread { padding: 16px 26px 6px; }
.comment-thread__status { border-radius: 18px; background: rgba(255, 255, 255, .72); padding: 24px 16px; color: #987783; text-align: center; }
.comment-thread__list { display: grid; gap: 10px; }
.comment-item { border: 1px solid rgba(183, 82, 112, .14); border-radius: 18px 6px 18px 6px; background: rgba(255, 255, 255, .82); padding: 14px 15px; box-shadow: 0 7px 20px rgba(105, 48, 67, .05); }
.comment-item header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 7px 14px; }
.comment-item strong { color: #8f465d; font-size: 1rem; }
.comment-item time { color: #a98a95; font-size: .75rem; }
.comment-item p { margin: 8px 0 0; color: #644c56; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-thread__more { width: 100%; min-height: 44px; margin-top: 11px; border: 1px solid rgba(183, 82, 112, .18); border-radius: 999px; background: #fff; color: #925067; font-weight: 800; cursor: pointer; }

.comment-form { margin: 16px 26px 26px; border: 1px solid rgba(183, 82, 112, .17); border-radius: 22px 7px 22px 7px; background: rgba(249, 229, 235, .55); padding: 18px; }
.comment-form label { display: grid; gap: 7px; color: #84495d; font-weight: 800; }
.comment-form__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.comment-form__hint { padding-bottom: 10px; color: #a88692; font-size: .76rem; }
.comment-form input,
.comment-form textarea { width: 100%; border: 1px solid rgba(183, 82, 112, .22); border-radius: 13px; background: rgba(255, 255, 255, .9); color: #60434f; font: inherit; padding: 11px 12px; outline: none; }
.comment-form textarea { min-height: 112px; resize: vertical; }
.comment-form input:focus,
.comment-form textarea:focus { border-color: #ce718c; box-shadow: 0 0 0 3px rgba(206, 113, 140, .14); }
.comment-form__message { margin-top: 13px; }
.comment-form__honeypot { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.comment-form .kokoro-turnstile { margin-top: 14px; }
.comment-form__foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; }
.comment-form__foot [role="status"] { color: #9a586d; font-size: .88rem; }
.comment-submit,
.comment-open-btn { min-height: 44px; border: 1px solid rgba(183, 82, 112, .22); border-radius: 999px; background: #fff1f5; color: #9e4e67; font: inherit; font-weight: 800; padding: 9px 17px; cursor: pointer; transition: transform .18s ease, background .18s ease, box-shadow .18s ease; }
.comment-submit { flex: 0 0 auto; background: #cf6d89; color: #fff; }
.comment-open-btn:hover,
.comment-submit:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(133, 56, 82, .12); }
.comment-submit:disabled { opacity: .55; cursor: wait; }
.comment-open-btn.has-comment::before { content: "♥ "; }
.comment-modal__close:focus-visible,
.comment-thread__more:focus-visible,
.comment-submit:focus-visible,
.comment-open-btn:focus-visible {
  outline: 3px solid #9f405f;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, .88);
}

body.theme-dark .comment-modal__panel { border-color: rgba(255,255,255,.12); background: linear-gradient(145deg, rgba(49,35,45,.99), rgba(36,27,35,.99)); color: #f3dfe7; }
body.theme-dark .comment-modal__head,
body.theme-dark .comment-form { border-color: rgba(255,255,255,.1); }
body.theme-dark .comment-modal__head h2,
body.theme-dark .comment-item strong,
body.theme-dark .comment-form label { color: #f1b2c5; }
body.theme-dark .comment-modal__head p,
body.theme-dark .comment-item time,
body.theme-dark .comment-form__hint { color: #c4a5b1; }
body.theme-dark .comment-modal__target,
body.theme-dark .comment-form { background: rgba(255,255,255,.05); color: #f0b2c5; }
body.theme-dark .comment-item,
body.theme-dark .comment-thread__status,
body.theme-dark .comment-form input,
body.theme-dark .comment-form textarea { border-color: rgba(255,255,255,.1); background: rgba(255,255,255,.06); color: #f4e8ee; }
body.theme-dark .comment-modal__close:focus-visible,
body.theme-dark .comment-thread__more:focus-visible,
body.theme-dark .comment-submit:focus-visible,
body.theme-dark .comment-open-btn:focus-visible { outline-color: #ffd1df; box-shadow: 0 0 0 6px rgba(46, 31, 40, .92); }

@keyframes commentFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes commentPanelIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

@media (max-width: 620px) {
  .comment-modal { align-items: end; padding: 10px 8px max(8px, env(safe-area-inset-bottom)); }
  .comment-modal__panel { max-height: calc(100dvh - 18px); border-radius: 26px 8px 26px 8px; }
  .comment-modal__head { padding: 21px 18px 14px; }
  .comment-modal__target { margin-inline: 18px; }
  .comment-thread { padding-inline: 18px; }
  .comment-form { margin-inline: 18px; padding: 15px; }
  .comment-form__row { grid-template-columns: 1fr; gap: 3px; }
  .comment-form__hint { padding-bottom: 0; }
  .comment-form__foot { align-items: stretch; flex-direction: column; }
  .comment-submit { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .comment-modal,
  .comment-modal__panel { animation: none; }
  .comment-open-btn,
  .comment-submit,
  .comment-modal__close { transition: none; }
}
