.profile-comments-page {
  --comment-accent: var(--rf-primary);
  padding-block: 40px 64px;
}
.profile-comments-page .shell { max-width: 1040px; }
.profile-comments-header { align-items: center; gap: 24px; margin-bottom: 28px; }
.profile-comments-header > div { min-width: 0; }
.profile-comments-header .eyebrow { margin-bottom: 10px; font-size: .65rem; letter-spacing: .13em; }
.profile-comments-header h1 { margin-bottom: 12px; font-size: clamp(1.8rem, 3.7vw, 2.8rem); overflow-wrap: anywhere; }
.profile-comments-header p { margin-bottom: 0; max-width: 62ch; font-size: .9rem; line-height: 1.6; }
.profile-comments-header > .button { flex-shrink: 0; }
.profile-comments-page .stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 24px;
  padding: 8px 0;
  border: 1px solid var(--rf-line);
  border-radius: 12px;
  background: var(--rf-surface);
}
.profile-comments-page .stat-card {
  min-width: 0;
  padding: 16px 24px;
  border: 0;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.profile-comments-page .stat-card + .stat-card { border-left: 1px solid var(--rf-line); }
.profile-comments-page .stat-card strong { margin-bottom: 5px; font-size: 1.7rem; font-weight: 750; line-height: 1.1; }
.profile-comments-page .stat-card span { display: block; font-size: .67rem; letter-spacing: .065em; line-height: 1.5; overflow-wrap: anywhere; }
.profile-comment-filters {
  display: grid;
  grid-template-columns: 1.5fr 1.25fr 1fr 1fr;
  gap: 16px 12px;
  padding: 22px;
  margin: 0 0 16px;
  border: 1px solid var(--rf-line);
  border-radius: 12px;
  background: var(--rf-surface);
}
.profile-comment-filters label { display: grid; gap: 8px; min-width: 0; font-size: .74rem; font-weight: 600; color: var(--rf-muted); }
.profile-comment-filters select, .profile-comment-filters input { width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border-radius: 7px; font-size: .82rem; color: var(--rf-text); background: var(--rf-bg); }
.profile-comment-filters .button-row { grid-column: 1/-1; justify-content: flex-end; gap: 8px; }
.profile-comment-filters .button { min-height: 38px; padding: 8px 15px; font-size: .76rem; }
.profile-comments-results { margin: 0 2px 20px; font-size: .76rem; line-height: 1.6; }
.profile-comment-thread { min-width: 0; margin-bottom: 22px; overflow: hidden; border: 1px solid var(--rf-line); border-radius: 12px !important; }
.profile-comment-thread > .panel-body { min-width: 0; padding: 0 24px 10px; }
.profile-thread-heading { align-items: center; flex-wrap: wrap; gap: 14px; margin: 0 -24px 0; padding: 20px 24px; border-bottom: 1px solid var(--rf-line); background: color-mix(in srgb, var(--rf-muted) 4%, var(--rf-surface)); }
.profile-thread-heading > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-width: 0; flex: 1; }
.profile-comment-thread h2 { margin: 0; font-size: 1.04rem; line-height: 1.45; overflow-wrap: anywhere; }
.profile-comment-thread h2 a { color: var(--rf-text); text-decoration: none; }
.profile-comment-thread h2 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.profile-thread-chapter { flex-shrink: 0; padding: 3px 8px; border: 1px solid var(--rf-line); border-radius: 5px; color: var(--rf-muted); font-size: .66rem; }
.profile-thread-heading > .button { padding: 7px 10px; font-size: .7rem; min-height: 32px; }
.profile-comment { position: relative; min-width: 0; margin: 0 0 0 calc(var(--reply-depth)*20px); padding: 22px 0 18px; border: 0; overflow-wrap: anywhere; }
.profile-comment + .profile-comment { border-top: 1px solid var(--rf-line); }
.profile-comment[data-depth]:not([data-depth="0"]) { margin-top: 4px; padding-left: 18px; border-left: 2px solid var(--rf-line); }
.profile-comment.is-author[data-depth]:not([data-depth="0"]) { border-left-color: color-mix(in srgb, var(--comment-accent) 40%, var(--rf-line)); }
.profile-comment-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; min-height: 32px; }
.profile-comment-initial { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border: 1px solid var(--rf-line); border-radius: 50%; background: color-mix(in srgb, var(--rf-muted) 10%, var(--rf-surface)); color: var(--rf-muted); font-size: .61rem; font-weight: 700; letter-spacing: .02em; }
.is-author > .profile-comment-meta .profile-comment-initial { color: var(--rf-text); background: color-mix(in srgb, var(--comment-accent) 12%, var(--rf-surface)); }
.profile-comment-meta > a { color: var(--rf-text); font-size: .83rem; font-weight: 650; text-decoration: none; }
.profile-comment-meta > a:hover { text-decoration: underline; }
.profile-comment-meta time { margin-left: auto; color: var(--rf-muted); font-size: .65rem; font-variant-numeric: tabular-nums; }
.profile-comment-context { display: block; margin: 8px 0 0 42px; font-size: .7rem; }
.profile-comment-context a { color: inherit; text-underline-offset: 3px; }
.profile-comment-text { margin: 12px 0 14px 42px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--rf-text); font-size: .9rem; line-height: 1.8; }
.profile-comment-image { display: block; width: auto; max-width: 100%; height: auto; max-height: 440px; object-fit: contain; object-position: left; margin: 10px 0; border: 1px solid var(--rf-line); border-radius: 8px; }
.profile-comment [data-reaction-list] { gap: 7px; margin-left: 42px; }
.profile-comment [data-reaction-list]:empty { display: none; }
.profile-comment-reaction { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 4px 9px; border: 1px solid var(--rf-line); border-radius: 7px; font: inherit; font-size: .69rem; color: var(--rf-muted); background: transparent; cursor: pointer; }
.profile-comment-reaction img { width: 20px; height: 20px; object-fit: contain; }
.profile-comment-reaction [data-reaction-count] { font-weight: 700; }
.profile-comment-reaction[aria-pressed="true"] { color: var(--rf-text); border-color: color-mix(in srgb, var(--comment-accent) 55%, var(--rf-line)); background: color-mix(in srgb, var(--comment-accent) 9%, var(--rf-surface)); }
.profile-comment-reaction:disabled { cursor: default; opacity: 1; }
.profile-comment-actions { flex-wrap: wrap; gap: 4px; margin: 9px 0 0 34px; }
.profile-comment-actions .button { min-height: 34px; padding: 6px 8px; border: 1px solid transparent; border-radius: 6px; box-shadow: none !important; background: transparent !important; color: var(--rf-muted); font-size: .71rem; font-weight: 600; }
.profile-comment-actions .button:hover { color: var(--rf-text); background: color-mix(in srgb, var(--rf-muted) 9%, transparent) !important; transform: none; }
.profile-comment-actions [data-reply]::before { content: '↩'; margin-right: 5px; font-size: .95rem; }
.profile-comment-actions [data-open-reactions]::before { content: '☺'; margin-right: 5px; font-size: .95rem; }
.profile-comment-actions [data-copy-comment] { margin-left: auto; }
.profile-comment-reply { display: grid; gap: 10px; margin: 14px 0 2px 42px; padding: 16px; border: 1px solid var(--rf-line); border-radius: 9px; background: color-mix(in srgb, var(--rf-bg) 55%, var(--rf-surface)); }
.profile-comment-reply label { font-size: .74rem; font-weight: 650; }
.profile-comment-reply textarea { width: 100%; max-width: 100%; min-height: 108px; resize: vertical; border-radius: 7px; padding: 12px; font: inherit; font-size: .85rem; line-height: 1.6; background: var(--rf-surface); }
.profile-comment-reply .button-row { flex-wrap: wrap; gap: 8px; }
.profile-comment-reply .button { padding: 7px 12px; font-size: .73rem; min-height: 36px; }
.profile-comment-reply [data-insert-emoji] { margin-left: auto; }
.profile-comment-reply[hidden], .profile-comment[hidden] { display: none !important; }
.profile-comment-status { margin: 10px 0 0 42px; font-size: .73rem; }
.profile-comment-status:empty { display: none; }
.profile-comment-pagination { flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--rf-line); }
.profile-comment-pagination > .muted { margin-inline: 8px; font-size: .73rem; }
.profile-comment-pagination .button { min-width: 36px; min-height: 36px; padding: 8px 12px; font-size: .75rem; }
.profile-comment-pagination [aria-current="page"] { color: var(--rf-text); border-color: var(--comment-accent); background: color-mix(in srgb, var(--comment-accent) 12%, var(--rf-surface)); }
.profile-reaction-dialog { position: fixed; inset: 0; margin: auto; width: min(520px, calc(100vw - 32px)); max-height: 80vh; overflow: auto; border: 1px solid var(--rf-line); border-radius: 14px; padding: 24px; background: var(--rf-surface); color: var(--rf-text); box-shadow: 0 20px 80px rgba(0,0,0,.3); }
.profile-reaction-dialog::backdrop { background: rgba(0,0,0,.65); }
.profile-reaction-dialog .panel-title { align-items: center; gap: 16px; margin-bottom: 20px; }
.profile-reaction-dialog h2 { margin: 0; font-size: 1.2rem; }
.profile-reaction-dialog label { display: grid; gap: 8px; font-size: .75rem; color: var(--rf-muted); }
.profile-reaction-dialog input { width: 100%; min-height: 42px; border-radius: 7px; }
.profile-reaction-options { display: grid; grid-template-columns: repeat(auto-fill,minmax(82px,1fr)); gap: 8px; margin-top: 16px; }
.profile-reaction-options button { display: grid; justify-items: center; align-content: center; gap: 8px; min-width: 0; min-height: 78px; padding: 12px 6px; overflow-wrap: anywhere; white-space: normal; border: 1px solid var(--rf-line); border-radius: 8px; background: transparent; }
.profile-reaction-options button:hover { border-color: var(--comment-accent); background: color-mix(in srgb, var(--comment-accent) 7%, var(--rf-surface)); }
.profile-reaction-options small { font-size: .64rem; line-height: 1.3; }
.profile-reaction-options img { width: 30px; height: 30px; object-fit: contain; }
.profile-reaction-options .emoji-glyph { font-size: 27px; line-height: 1.2; }
.profile-comments-page :is(button,a,input,select,textarea):focus-visible { outline: 2px solid var(--rf-secondary); outline-offset: 3px; }
@media(max-width: 760px) {
  .profile-comment-filters { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 18px; }
  .profile-comments-header { align-items: flex-start; }
  .profile-comments-page .stat-card { padding: 14px 16px; }
  .profile-comment-meta time { flex-basis: calc(100% - 42px); margin-left: 42px; margin-top: -7px; }
}
@media(max-width: 540px) {
  .profile-comments-page { padding-block: 26px 44px; }
  .profile-comments-page .shell { width: calc(100% - 24px); }
  .profile-comments-header { flex-wrap: wrap; gap: 16px; margin-bottom: 22px; }
  .profile-comments-header h1 { font-size: 1.9rem; }
  .profile-comments-page .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 0; }
  .profile-comments-page .stat-card { padding: 16px; }
  .profile-comments-page .stat-card:nth-child(3) { border-left: 0; }
  .profile-comments-page .stat-card:nth-child(n+3) { border-top: 1px solid var(--rf-line); }
  .profile-comment-filters { gap: 14px 10px; }
  .profile-comment-filters label:nth-of-type(-n+2) { grid-column: 1/-1; }
  .profile-comment-thread > .panel-body { padding: 0 16px 6px; }
  .profile-thread-heading { margin-inline: -16px; padding: 16px; }
  .profile-thread-heading > .button { font-size: .65rem; }
  .profile-comment { padding-block: 18px 14px; margin-left: calc(var(--reply-depth)*8px); }
  .profile-comment[data-depth]:not([data-depth="0"]) { padding-left: 10px; }
  .profile-comment-text, .profile-comment-context, .profile-comment [data-reaction-list], .profile-comment-reply, .profile-comment-status { margin-left: 0; }
  .profile-comment-actions { margin-left: -8px; }
  .profile-comment-reply { padding: 12px; }
  .profile-comment-image { max-height: 340px; }
  .profile-comment-text { font-size: .86rem; line-height: 1.75; }
  .profile-comment-pagination { gap: 6px; }
  .profile-comment-pagination > .muted { order: 1; flex-basis: 100%; text-align: center; margin: 8px 0 0; }
}
@media(prefers-reduced-motion: no-preference) {
  .profile-comment-actions .button, .profile-comment-reaction, .profile-reaction-options button { transition: background-color .15s, border-color .15s, color .15s; }
}
.profile-comment-actions > .button,
.profile-comment-pagination > .button,
.profile-comment-filters .button-row > .button,
.profile-comment-reply .button-row > .button { flex: 0 0 auto; }
.profile-thread-heading { flex-direction: row; }

.profile-thread-heading > .profile-replies-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 5px 9px; min-width: 42px; color: var(--rf-muted); font-variant-numeric: tabular-nums; }
.profile-replies-arrow { display: inline-block; font-size: 1.2rem; line-height: 1; transform: rotate(0); }
.profile-replies-toggle[aria-expanded="true"] .profile-replies-arrow { transform: rotate(90deg); }
