.comments-dialog { width: min(600px, calc(100vw - 32px)); max-height: min(800px, 88dvh); overflow: hidden; }
.comments-body { position: relative; display: flex; flex-direction: column; overflow: hidden; padding: 0 !important; min-height: 300px; height: min(690px, 76dvh); }
.comments-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 24px; flex: 0 0 auto; border-bottom: 1px solid var(--line); }
.comments-count { font-size: 15px; font-weight: 650; }
.comments-sort { max-width: 145px; border: 0; border-radius: 6px; padding: 8px 25px 8px 10px; background: var(--bg); color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.comments-list { flex: 1 1 auto; overflow-y: auto; overscroll-behavior-y: contain; padding: 24px 24px 12px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; min-height: 100px; }
.comments-state { padding: 28px 12px; color: var(--muted); text-align: center; font-size: 14px; line-height: 1.6; }
.comments-state.error { color: var(--danger); }
.comment-thread { margin-bottom: 26px; }
.comment-row { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.comments-avatar { flex: 0 0 auto; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; }
.comments-content { flex: 1 1 auto; min-width: 0; }
.comments-name-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 5px; min-height: 20px; }
.comments-author { padding: 0; border: 0; color: var(--text); font-size: 13px; font-weight: 650; line-height: 1.4; background: none; cursor: pointer; text-align: left; overflow-wrap: anywhere; }
.comments-author:hover { text-decoration-line: underline; text-decoration-thickness: .07em; text-underline-offset: -0.1px; text-underline-position: from-font; text-decoration-skip-ink: none; }
.comments-author-label { color: var(--accent); background: var(--accent-soft); padding: 1px 6px; border-radius: 5px; font-size: 10px; }
.comments-reply-to { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.comments-text { margin: 0 0 10px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.comments-meta { display: flex; align-items: center; gap: 14px; min-height: 28px; color: var(--muted); font-size: 11px; }
.comments-meta time { white-space: nowrap; }
.comments-meta-spacer { flex: 1 1 auto; }
.comments-reply-button { padding: 3px 0; border: 0; font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); background: transparent; cursor: pointer; }
.comments-reaction { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 30px; padding: 2px; border: none; background: transparent; color: var(--muted); font: inherit; font-size: 11px; cursor: pointer; transition: color .16s ease; }
.comments-reaction:active { transform: none; }
.comments-reaction.is-active { color: var(--pink); }
.comments-reaction.is-active:not(.comments-dislike) svg { fill: currentColor; }

.comments-author-liked { display: inline-flex; color: var(--danger); font-size: 10px; margin-top: 3px; }
.comments-author-liked[hidden] { display: none; }
.comments-replies { margin: 14px 0 0 47px; padding-left: 13px; border-left: 1px solid var(--line); }
.comments-replies[hidden] { display: none; }
.comments-replies .comment-row { margin-bottom: 17px; gap: 9px; }
.comments-expand { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; padding: 9px 0 0; margin-left: 48px; cursor: pointer; }
.comments-expand[hidden] { display: none; }
.comments-expand[aria-expanded=true] svg { transform: rotate(180deg); }
.comments-thread-line { width: 24px; height: 1px; background: var(--line); }
.comments-media { display: block; width: fit-content; max-width: min(235px, 100%); padding: 0; margin: 7px 0; border: none; background: transparent; cursor: zoom-in; border-radius: 7px; overflow: hidden; }
.comments-media img { display: block; width: auto; height: auto; max-width: 100%; max-height: 245px; object-fit: contain; border-radius: 7px; }
.comments-more { flex-shrink: 0; align-self: center; margin: 4px 0 10px; font-size: 13px; }
.comments-more[hidden] { display: none; }
.comments-composer { flex: 0 0 auto; background: var(--panel); padding: 10px 20px 12px; border-top: 1px solid var(--line); }
.comments-emoji { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; gap: 4px; }
.comments-emoji-button { display: inline-flex; justify-content: center; align-items: center; width: 36px; height: 36px; font-size: 23px; border: 0; border-radius: 6px; background: none; cursor: pointer; transition: background .15s, transform .15s; }
.comments-emoji-button:hover { background: transparent; }
.comments-input-row { display: flex; align-items: center; gap: 10px; }
.comments-input { display: block; flex: 1 1 auto; resize: none; min-width: 0; min-height: 42px; max-height: 116px; box-sizing: border-box; padding: 11px 14px; border: 1px solid transparent; border-radius: 10px; color: var(--text); background: var(--bg); font: inherit; font-size: 13px; line-height: 20px; }
.comments-input::placeholder { color: var(--muted); }
.comments-input:focus { outline: none; border-color: var(--accent); }
.comments-send { flex-shrink: 0; background: var(--accent) !important; color: var(--on-accent) !important; border-radius: 50% !important; width: 36px; height: 36px; }
.comments-send:disabled { opacity: .35; }
.comments-composer-tools { display: flex; align-items: center; gap: 8px; margin-left: 43px; }
.comments-composer-tools .icon-btn { color: var(--muted); width: 32px; height: 30px; }
.comments-counter { margin-left: auto; color: var(--muted); font-size: 10px; }
.comments-file { display: none; }
.comments-reply-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--accent); font-size: 12px; margin: 0 0 8px 43px; }
.comments-reply-banner[hidden], .comments-attachment[hidden] { display: none; }
.comments-reply-banner .icon-btn { width: 26px; height: 26px; }
.comments-attachment { position: relative; width: fit-content; margin: 0 0 10px 43px; }
.comments-attachment img { display: block; max-width: 120px; max-height: 100px; width: auto; border-radius: 6px; }
.comments-attachment .icon-btn { position: absolute; right: -9px; top: -6px; width: 25px; height: 25px; background: var(--button-bg); border: 2px solid var(--panel); border-radius: 50%; }
.comments-submit-status { min-height: 0; color: var(--muted); font-size: 11px; margin-left: 43px; line-height: 1.5; }
.comments-submit-status:empty { display: none; }
.comments-composer progress { width: calc(100% - 43px); height: 3px; accent-color: var(--accent); margin-left: 43px; }
.comments-composer progress[hidden] { display: none; }
.comment-preview-overlay { z-index: 1200 !important; }
.comment-preview-content { display: flex; align-items: center; flex-direction: column; gap: 24px; }
.comment-media-preview { width: auto; max-width: 100%; height: auto; max-height: 60dvh; object-fit: contain; border-radius: 6px; }
.comment-preview-actions { display: flex; width: 100%; gap: 12px; }
.comment-preview-actions > * { flex: 1; justify-content: center; text-decoration: none; }
@media (max-width: 640px) {
  .comments-overlay { align-items: flex-end !important; padding: 0 !important; }
  .comments-dialog { width: 100% !important; max-width: 100% !important; max-height: 85dvh !important; border-radius: 14px 14px 0 0 !important; border-bottom: 0 !important; animation: comments-rise .22s ease-out; }
  .comments-body { height: min(640px, 68dvh); min-height: 180px; }
  .comments-toolbar { padding: 10px 18px; }
  .comments-list { padding: 20px 16px 8px; }
  .comments-composer { padding: 8px 14px max(10px, env(safe-area-inset-bottom)); }
  .comments-meta { gap: 10px; }
  .comments-replies { margin-left: 36px; padding-left: 10px; }
  .comments-media { max-width: min(210px, 100%); }
  .comments-media img { max-height: 230px; }
  .comments-emoji-button { width: 32px; height: 32px; font-size: 22px; }
}
@keyframes comments-rise { from { transform: translateY(35px); opacity: .5; } to { transform: translateY(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .comments-dialog, .comments-reaction, .comments-emoji-button { animation: none !important; transition: none !important; }
}

/* Same discussion component embedded beside publication media. */
.comments-toolbar-actions{display:flex;align-items:center;gap:4px;flex-shrink:0}
.comments-refresh{width:32px;height:32px;font-size:23px;color:var(--muted);border-radius:50%;background:transparent}
.comments-inline{height:auto;min-height:0;flex:1 1 auto;width:100%}
.comments-inline .comments-toolbar{padding:12px 18px;gap:8px}
.comments-inline .comments-count{font-size:13px;font-weight:600}
.comments-inline .comments-sort{max-width:115px;font-size:13px;padding:7px 18px 7px 8px}
.comments-inline .comments-list{padding:18px 18px 8px;min-height:120px;scrollbar-gutter:stable}
.comments-inline .comments-composer{padding:10px 16px 12px}
.comments-inline .comments-emoji-button{width:30px;height:30px;font-size:21px}
.comments-inline .comments-replies{margin-left:30px;padding-left:10px}
.comments-inline .comments-expand{margin-left:42px}
.comments-inline .comments-input-row{gap:8px}
.comments-inline .comments-input-row>.avatar{width:28px!important;height:28px!important;font-size:11px!important}
.comments-inline .comments-meta{gap:9px}
.comments-inline .comments-input{padding:10px 11px}
.comments-inline .comments-composer-tools{margin-left:36px}
.comments-inline .comments-emoji{gap:2px}
.comments-inline .comments-media{max-width:min(210px,100%)}
.comments-inline .comments-content{overflow-wrap:anywhere}
@media(max-width:640px){
 .comments-inline{min-height:360px;height:55dvh;flex:none}
 .comments-inline .comments-toolbar{padding:10px 14px}
 .comments-inline .comments-list{padding:16px 14px 8px}
 .comments-inline .comments-composer{padding:10px 12px max(10px,env(safe-area-inset-bottom))}
 .comments-inline .comments-count{font-size:12px}
}

/* Soft fields and unboxed actions; outlines are reserved for focus visibility. */
.publication-comments{
 --comment-control-bg:#ededed;
 --comment-control-hover:#e5e5e5;
 --comment-placeholder:#666;
}
:root[data-theme="dark"] .publication-comments{
 --comment-control-bg:#2b2b2b;
 --comment-control-hover:#343434;
 --comment-placeholder:#b7b7b7;
}
.publication-comments .comments-input{
 min-height:44px;
 border:0;
 background:var(--comment-control-bg);
 color:var(--text);
 box-shadow:none;
 transition:background .16s ease;
}
.publication-comments .comments-input::placeholder{color:var(--comment-placeholder);opacity:1}
.publication-comments .comments-input:focus{
 box-shadow:none;
 outline:none;
}
.publication-comments .comments-toolbar-actions{gap:6px}
.publication-comments .comments-count{min-width:0;line-height:1.4}
.publication-comments .comments-sort{
 min-height:44px;
 border:0;
 background:transparent;
 color:var(--text);
 font-weight:500;
 border-radius:6px;
}
.publication-comments .comments-refresh,
.publication-comments .comments-composer-tools .icon-btn{
 width:44px;
 height:44px;
 min-width:44px;
 border:0;
 border-radius:7px;
 color:var(--text);
 background:transparent;
 box-shadow:none;
 transition:background .16s ease;
}
.publication-comments .comments-send{width:44px;height:44px;min-width:44px}
.publication-comments .comments-refresh:hover:not(:disabled),
.publication-comments .comments-composer-tools .icon-btn:hover:not(:disabled),
.publication-comments .comments-sort:hover:not(:disabled){background:transparent}
.publication-comments .comments-refresh:focus-visible,
.publication-comments .comments-composer-tools .icon-btn:focus-visible,
.publication-comments .comments-sort:focus-visible,
.publication-comments .comments-send:focus-visible{outline:2px solid var(--text);outline-offset:3px}
.publication-comments .comments-composer-tools{padding-top:6px}
.publication-comments .comments-composer-tools .icon-btn[aria-expanded="true"]{color:var(--accent)}
.publication-comments .comments-attachment .icon-btn{border:0;box-shadow:none}
.publication-comments .comments-input:disabled,
.publication-comments .comments-sort:disabled,
.publication-comments .comments-refresh:disabled,
.publication-comments .comments-composer-tools .icon-btn:disabled{opacity:.5;box-shadow:none;cursor:pointer}
.publication-comments .comments-send:disabled{opacity:.35;cursor:default}
@media(max-width:380px){
 .publication-comments .comments-toolbar-actions{gap:4px}
 .publication-comments .comments-composer-tools{gap:6px}
 .publication-comments .comments-counter{font-size:10px}
}
@media(prefers-reduced-motion:reduce){
 .publication-comments .comments-input,
 .publication-comments .comments-refresh,
 .publication-comments .comments-composer-tools .icon-btn{transition:none}
}

.comments-reaction-count{display:inline-block;inline-size:3.5ch;min-inline-size:3.5ch;block-size:1.2em;line-height:1.2;overflow:hidden;text-overflow:ellipsis;font-variant-numeric:tabular-nums;text-align:left}
.comments-reaction .icon{transition:color .16s ease,scale .16s ease}
.comments-reaction:hover{background:transparent}
.comments-composer .icon-btn:hover{background:transparent}
.comments-composer .icon-btn:active{transform:none}
.icon-weighted>.icon-geometry{stroke-width:var(--icon-base-outline-width);transition:color .16s ease}
@media(prefers-reduced-motion:reduce){.icon-weighted>.icon-geometry{transition:none}}
@media(prefers-reduced-motion:reduce){.comments-reaction .icon{transition:none;animation:none!important}}

/* Real comment actions, anchored to each root/reply author row. */
.comments-name-line{position:relative;padding-right:44px}
.comments-row-menu{position:absolute;right:0;top:0;width:44px;height:22px}
.comments-menu-toggle{position:absolute;right:0;top:-11px;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;min-width:44px;padding:0;border:0;border-radius:0;background:transparent!important;color:var(--muted);box-shadow:none!important;cursor:pointer;transition:color .16s ease;transform:none}
.comments-menu-toggle:is(:hover,:focus-visible,:active,[aria-expanded="true"]){color:var(--text)}
.comments-menu-toggle:active{transform:none}
.comments-menu-toggle>.icon{opacity:.72;transition:opacity .16s ease,scale .16s ease}
.comments-menu-toggle:is(:hover,:focus-visible,:active,[aria-expanded="true"])>.icon{opacity:1}
@media(prefers-reduced-motion:reduce){.comments-menu-toggle>.icon{transition:none}}
.comments-menu-toggle:focus-visible{outline:2px solid var(--text);outline-offset:-7px;border-radius:8px}
.comments-menu-panel{position:absolute;right:0;top:calc(100% + 9px);z-index:6;width:260px;max-width:calc(100vw - 64px);padding:6px;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--text);box-shadow:0 12px 36px #0002}
.comments-menu-panel[hidden]{display:none!important}
.comments-menu-panel.is-above{top:auto;bottom:calc(100% + 9px)}
.comments-menu-item{display:block;width:100%;min-height:44px;padding:10px 12px;border:0;border-radius:5px;background:transparent;color:var(--text);text-align:left;font:inherit;font-size:14px;line-height:1.35;cursor:pointer}
.comments-menu-item:hover{background:transparent;text-decoration:underline;text-underline-offset:3px}
.comments-menu-item:focus-visible{outline:2px solid var(--text);outline-offset:-3px}
.comments-menu-item.is-danger{color:var(--danger)}
.comments-menu-item:disabled{opacity:.45;cursor:pointer;text-decoration:none}
.comments-menu-description{margin:6px 8px 8px;font-size:13px;line-height:1.5;overflow-wrap:anywhere}
.comments-menu-status{margin:4px 8px;color:var(--muted);font-size:12px;line-height:1.4;overflow-wrap:anywhere}
.comments-menu-status:empty{display:none}
.comments-menu-confirm-actions{display:flex;gap:4px}
.comments-menu-confirm-actions>.comments-menu-item{flex:1;text-align:center}

.comments-reaction:not(.is-active):not(.is-disliked):hover{color:color-mix(in srgb,var(--muted) 80%,var(--text))}
.comments-reaction:disabled{opacity:1;cursor:pointer}
:root[data-theme="dark"] .comments-reaction.is-active{color:var(--pink)}


/* A pressed dislike strengthens only its existing outline, never its silhouette.
   Explicit scope wins over the publication panel's inactive-hover rule. */
:root .comments-reaction.comments-dislike.is-disliked,
:root .publication-comments .comments-reaction.comments-dislike.is-disliked{color:var(--text)}
.comments-reaction.comments-dislike>.icon-thumb-down{fill:none;transform:none}
.comments-reaction.comments-dislike{transform:none}
@media(prefers-reduced-motion:reduce){.comments-menu-toggle{transition:none}}

/* 1.23.12 — compact actions under text, heart in a dedicated right column. */
.comments-name-line{padding-right:0}
.comments-meta{position:relative}
.comments-meta>.comments-row-menu{position:static;flex:none;width:32px;height:32px}
.comments-meta .comments-menu-toggle{position:static;width:32px;height:32px;min-width:32px;min-height:32px;top:auto;right:auto}
.comments-meta .comments-menu-toggle>.icon{width:16px;height:16px}
.comments-meta .comments-menu-panel{width:min(260px,100%);max-width:100%}
.comment-row>.comments-reaction{flex:0 0 60px;width:60px;min-width:60px;min-height:44px;flex-direction:row;gap:5px;align-self:flex-start;padding:2px 0}
.comment-row>.comments-reaction>.icon{width:19px;height:19px}
.comment-row>.comments-reaction>.comments-reaction-count{inline-size:auto;min-inline-size:0;max-inline-size:36px;text-align:center;font-size:11px}
/* Desktop hover reveals the menu without shifting Reply or the heart.
   Keyboard focus and an open menu retain it; touch has no hover requirement. */
@media(hover:hover) and (pointer:fine){
 .comment-row .comments-menu-toggle{opacity:0;pointer-events:none}
 .comment-row:hover>.comments-content .comments-menu-toggle,
 .comment-row:focus-within>.comments-content .comments-menu-toggle,
 .comment-row .comments-menu-toggle[aria-expanded="true"]{opacity:1;pointer-events:auto}
}
@media(hover:none),(pointer:coarse){.comment-row .comments-menu-toggle{opacity:1;pointer-events:auto}}

/* Time and reply form one quiet baseline below each comment. */
.comments-inline .comments-meta{column-gap:16px;row-gap:0}
.comments-meta>.comments-date{font-size:12px;line-height:1.4}
.comments-meta>.comments-reply-button{font-size:12px;line-height:1.4;font-weight:600}
.comments-meta>.comments-row-menu{margin-left:-8px}

/* Validation appears only when the comment exceeds the server limit. */
.comments-composer .comments-limit-error,
.publication-comments .comments-composer-floating .comments-counter.comments-limit-error{position:static;display:block;visibility:visible;margin:4px 0 0;padding:0;text-align:left;font-size:12px;line-height:1.4;color:var(--danger)}
.comments-composer .comments-limit-error[hidden]{display:none!important}
.comments-composer .comments-input[aria-invalid="true"]{color:var(--danger);background:color-mix(in srgb,var(--danger) 7%,transparent)!important;box-shadow:inset 0 -2px var(--danger)!important}
.comments-text>.comments-expand-text{display:inline;padding:0;margin:0;border:0;background:none;color:var(--muted);font:inherit;font-size:inherit;cursor:pointer}
.comments-text>.comments-expand-text:hover,.comments-text>.comments-expand-text:focus-visible{color:var(--text)}

/* Reserve the existing chevron slot; no temporary loading row expands a thread. */
.comments-expand[aria-busy="true"]>.icon{animation:comments-loading-spin .8s linear infinite}
.comments-list,.comments-scroll{overflow-anchor:none}
@keyframes comments-loading-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.comments-expand[aria-busy="true"]>.icon{animation:none;opacity:.45}}

/* Recipient is the emphasis; the introductory label stays quiet. */
.comments-reply-banner{color:var(--muted);font-size:13px;line-height:1.45}
.comments-reply-recipient{min-width:0;overflow-wrap:anywhere}
.comments-reply-prefix{font-size:13px;font-weight:400;color:var(--muted)}
.comments-reply-username{font-size:14px;font-weight:650;color:var(--text)}
.comments-reply-banner>.icon-btn{flex-shrink:0}
