/* Post comments modal — same UX shell as support chat (dc-support) */
body.dc-fcomments-open {
  overflow: hidden !important;
}

body.dc-fcomments-open header.dc-app-header,
body.dc-fcomments-open .user-bottom-nav,
body.dc-fcomments-open .feed-v2-toggle {
  visibility: hidden !important;
  pointer-events: none !important;
}

.dc-fcomments {
  position: fixed;
  inset: 0;
  z-index: 100010;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.dc-fcomments[hidden] {
  display: none !important;
}

.dc-fcomments:not([hidden]) {
  pointer-events: auto;
}

.dc-fcomments__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(3, 3, 4, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.dc-fcomments__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  height: min(88vh, 720px);
  margin: 0;
  display: block;
  overflow: hidden;
  border-radius: 20px 20px 0 0;
  border: 1px solid rgba(255, 133, 0, 0.22);
  border-bottom: 0;
  background:
    radial-gradient(circle at 100% 0, rgba(255, 133, 0, 0.1), transparent 42%),
    radial-gradient(circle at 8% 28%, rgba(34, 34, 38, 0.22), transparent 50%),
    linear-gradient(180deg, #121214 0%, #070708 100%);
  box-shadow: 0 -18px 48px rgba(0, 0, 0, 0.45);
  --dc-fcomments-head-h: 48px;
  --dc-fcomments-composer-slot: 65px;
}

.dc-fcomments__head {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 8px;
  height: var(--dc-fcomments-head-h);
  min-height: var(--dc-fcomments-head-h);
  padding: 0 12px;
  border-bottom: 1px solid rgba(255, 133, 0, 0.14);
  background: rgba(8, 8, 10, 0.98);
}

.dc-fcomments__head-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 211, 145, 0.92);
  padding: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.dc-fcomments__head-back svg {
  width: 18px;
  height: 18px;
}

.dc-fcomments__head-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dc-fcomments__messages {
  position: absolute;
  top: var(--dc-fcomments-head-h);
  left: 0;
  right: 0;
  bottom: var(--dc-fcomments-composer-slot);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dc-fcomments__loading,
.dc-fcomments__error {
  margin: 24px 12px;
  text-align: center;
  color: rgba(244, 246, 251, 0.55);
  font-size: 14px;
  line-height: 1.45;
}

.dc-fcomments__messages .feed-comments-empty,
.dc-fcomments__messages .dc-fcomments__empty-state {
  flex: 1 1 auto;
  min-height: min(42vh, 320px);
  margin: 0;
  padding: 24px 20px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.dc-fcomments__empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 180, 90, 0.18), transparent 58%),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 140, 0, 0.18);
  color: rgba(255, 196, 130, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.dc-fcomments__empty-icon svg {
  width: 34px;
  height: 34px;
}

.dc-fcomments__empty-title,
.feed-comments-empty strong,
.dc-fcomments__empty-state strong {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.94);
  line-height: 1.3;
}

.dc-fcomments__empty-hint,
.feed-comments-empty span:not(.dc-fcomments__empty-icon),
.dc-fcomments__empty-state span:not(.dc-fcomments__empty-icon) {
  max-width: 260px;
  font-size: 0.92rem;
  line-height: 1.45;
  color: rgba(244, 246, 251, 0.58);
}

.dc-fcomments__composer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: end;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255, 133, 0, 0.14);
  background: rgba(8, 8, 10, 0.98);
}

.dc-fcomments__composer textarea {
  width: 100%;
  min-height: 40px;
  max-height: 120px;
  resize: none;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  padding: 10px 14px;
  font: inherit;
  font-size: 15px;
  line-height: 1.35;
  box-sizing: border-box;
}

.dc-fcomments__composer textarea:focus {
  outline: none;
  border-color: rgba(255, 138, 0, 0.45);
}

.dc-fcomments__send {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff8a00, #ff6a00);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.dc-fcomments__send:disabled {
  opacity: 0.45;
  cursor: default;
}

.dc-fcomments__guest {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  padding: 16px 14px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255, 133, 0, 0.14);
  background: rgba(8, 8, 10, 0.98);
  text-align: center;
}

.dc-fcomments__guest p {
  margin: 0 0 12px;
  color: rgba(244, 246, 251, 0.72);
  font-size: 14px;
}

.dc-fcomments__guest-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.dc-fcomments__guest-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
}

.dc-fcomments__guest-btn--primary {
  background: linear-gradient(135deg, #ff8a00, #ff6a00);
  border-color: transparent;
}

/* Comment rows inside modal */
.dc-fcomments__messages .feed-comment-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 100%;
}

.dc-fcomments__messages .feed-comment-row.is-own {
  flex-direction: row-reverse;
}

.dc-fcomments__messages .feed-comment-avatar {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  border: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.08);
}

.dc-fcomments__messages .feed-comment-bubble {
  max-width: min(82%, 320px);
  padding: 8px 12px 6px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.dc-fcomments__messages .feed-comment-row.is-own .feed-comment-bubble {
  background: rgba(255, 138, 0, 0.16);
  border-color: rgba(255, 138, 0, 0.22);
}

.dc-fcomments__messages .feed-comment-login {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 180, 100, 0.92);
  margin-bottom: 4px;
}

.dc-fcomments__messages .feed-comment-text {
  font-size: 15px;
  line-height: 1.4;
  color: rgba(244, 246, 251, 0.94);
  font-weight: 400;
}

.dc-fcomments__messages .feed-comment-meta {
  margin-top: 4px;
  text-align: right;
  font-size: 11px;
  color: rgba(244, 246, 251, 0.45);
}

@media (min-width: 768px) {
  .dc-fcomments__panel {
    max-width: min(480px, calc(100vw - 24px));
    border-radius: 20px;
    margin-bottom: 12px;
  }
}

@media (max-width: 767px) {
  body.dc-fcomments-open {
    position: fixed;
    width: 100%;
    height: 100%;
  }

  .dc-fcomments {
    align-items: stretch;
    justify-content: stretch;
    padding: 0 !important;
  }

  .dc-fcomments__panel {
    --dc-fcomments-head-h: 44px;
    --dc-fcomments-composer-slot: calc(56px + env(safe-area-inset-bottom, 0px));
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: none;
    /* Fill the TRUE screen, not the under-reported small viewport — see support-chat.css.
       svh/dvh can report below the physical screen in the iOS standalone PWA, leaving a dark
       band under the composer. --dc-layout-vh (clamped to screen height) reaches the real
       bottom; in a plain browser the var is unset and it falls back to 100dvh. */
    height: 100svh !important;
    height: 100dvh !important;
    height: var(--dc-layout-vh, 100dvh) !important;
    max-height: 100svh !important;
    max-height: 100dvh !important;
    max-height: var(--dc-layout-vh, 100dvh) !important;
    border-radius: 0;
    border: 0;
    box-shadow: none;
  }

  body.dc-fcomments-open.dc-fcomments-keyboard .dc-fcomments__panel {
    top: var(--dc-fcomments-vv-top, 0);
    bottom: auto;
    height: var(--dc-fcomments-vv-height, 100dvh) !important;
    max-height: var(--dc-fcomments-vv-height, 100dvh) !important;
  }

  .dc-fcomments__head {
    height: calc(var(--dc-fcomments-head-h) + env(safe-area-inset-top, 0px));
    min-height: calc(var(--dc-fcomments-head-h) + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: max(10px, env(safe-area-inset-left, 0px));
    padding-right: max(10px, env(safe-area-inset-right, 0px));
    box-sizing: border-box;
  }

  .dc-fcomments__messages {
    top: calc(var(--dc-fcomments-head-h) + env(safe-area-inset-top, 0px));
    padding: 10px 12px 8px;
  }

  .dc-fcomments__composer {
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .dc-fcomments__guest {
    padding: 16px 14px calc(16px + env(safe-area-inset-bottom, 0px));
  }

  body.dc-fcomments-open.dc-fcomments-keyboard .dc-fcomments__messages {
    bottom: calc(56px + 8px);
  }

  body.dc-fcomments-open.dc-fcomments-keyboard .dc-fcomments__composer {
    padding-bottom: 8px;
  }

  .dc-fcomments__composer textarea {
    font-size: 16px;
    touch-action: manipulation;
  }

  .dc-fcomments__send {
    touch-action: manipulation;
  }
}
