.comment-media-sprite { display: block; width: 100%; height: 100%; overflow: hidden; pointer-events: none; }
.mgn-comment-avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; overflow: hidden; border: 1px solid var(--site-tone-715064, #715053); border-radius: 50%; background: #28161a; color: #f1b9bf; font-size: 16px; text-transform: uppercase; }
.comment-avatar.mgn-comment-avatar { width: 42px; height: 42px; border-radius: 50%; padding: 0; }
.project-comments .project-comment .comment-avatar.mgn-comment-avatar { display: inline-flex; }
.mgn-comment-avatar > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.comment-sticker-attachments { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0 4px; align-items: center; }
.comment-sticker { display: block; flex: none; width: 150px; height: 150px; max-width: 100%; }

/* Transparent uploads sit directly on the comment, like the built-in stickers. */
.comment-images .comment-image-link.is-transparent { border: 0; border-radius: 0; background: transparent; }
.comment-images .comment-image-link.is-transparent img { height: auto; max-height: calc(220px / 3); object-fit: contain; border-radius: 0; }

/* Keep the message and all its actions together, including on narrow screens. */
.project-comments .comment-compose-body .comment-composer { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 22px 24px; }
.comment-editor-heading { align-self: center; }
.project-comments .comment-editor-heading h3 { margin: 0 0 6px; }
.project-comments .comment-editor-heading .comment-form-hint { margin: 0; font-size: 12px; }
.project-comments .comment-composer .comment-field { margin: 0; gap: 6px; }
.comment-editor-identity { grid-column: 1; display: flex; flex-direction: column; align-items: stretch; min-width: 0; width: min(340px, 100%); }
.project-comments .comment-name-field { flex: 1; min-width: 0; }
.comment-name-control { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 4px 8px 4px 4px; border: 1px solid var(--site-tone-3c3544, #443536); border-radius: 9px; background: #0006; transition: border-color .2s, background-color .2s, outline-color .2s; }
.comment-name-control:focus-within { border-color: var(--site-tone-d7889e, #d78890); background: var(--site-tone-070409ad, #090405ad); outline: 2px solid var(--site-tone-d7889e40, #d7889040); outline-offset: 2px; }
.project-comments .comment-composer .comment-name-control input { flex: 1; min-width: 0; min-height: 38px; padding: 6px 4px; border: 0; border-radius: 0; background: transparent; outline: none; }
.comment-editor-identity .comment-identity-avatar { position: relative; flex: none; border: 0; border-radius: 50%; background: transparent; }
.comment-editor-identity .comment-identity-avatar > summary { width: 36px; height: 36px; min-height: 36px; padding: 2px; justify-content: center; border-radius: 50%; }
.comment-editor-identity .comment-avatar-preview { width: 32px; height: 32px; }
.comment-editor-identity .comment-identity-avatar > fieldset { top: calc(100% + 10px); bottom: auto; width: 310px; max-width: calc(100vw - 70px); transform-origin: top left; }
.comment-name-label { display: flex; align-items: baseline; gap: 8px; font-size: 12px; color: var(--site-tone-d5d0df, #dfd0d2); }
.comment-name-field small { font-size: 10px; color: #9f949e; }
.project-comments .comment-message-field { grid-column: 1 / -1; }
.project-comments .comment-message-field textarea { min-height: 108px; padding: 12px 14px; }
.comment-editor-footer { grid-column: 1 / -1; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; min-width: 0; }
.project-comments .comment-editor-footer .comment-form-bottom { flex: none; display: flex; flex-direction: row; align-items: center; gap: 14px; min-height: 44px; }
.project-comments .comment-editor-footer .comment-form-bottom .link-button { width: auto; min-height: 44px; padding: 10px 16px; font-size: 13px; transition: background .2s, border-color .2s, transform .2s; }
.comment-editor-footer .link-button:hover { transform: translateY(-1px); }
.comment-editor-footer .link-button:active { transform: translateY(0); }
.project-comments .comment-composer .comment-form-note { margin: 0; font-size: 10px; }

.comment-media-tools { position: relative; display: flex; flex: 1; align-items: flex-start; flex-wrap: wrap; gap: 8px; margin: 0; min-width: 0; }
.comment-media-picker, .comment-editor-footer .comment-rating-choice { position: relative; min-width: 0; max-width: 100%; margin: 0; align-self: auto; }
.comment-media-picker { border: 1px solid var(--site-tone-73526a, #735255); border-radius: 10px; background: #130b0e66; }
.comment-media-picker summary, .comment-editor-footer .comment-rating-choice summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 7px 11px; border-radius: 9px; color: var(--site-tone-d7bad1, #d7babd); font-size: 12px; cursor: pointer; list-style: none; transition: background .2s, border-color .2s, color .2s; }
.comment-media-picker summary::-webkit-details-marker { display: none; }
.comment-media-picker summary::marker { content: ''; }
.comment-media-picker summary > svg { width: 21px; height: 21px; flex: none; }
.comment-media-picker summary:hover, .comment-editor-footer .comment-rating-choice summary:hover { background: #58303a33; color: #f3d0da; }
.comment-media-picker[open] > summary { background: #58303a44; }
.comment-media-chevron, .comment-editor-footer .comment-rating-choice summary > span { margin-left: auto; transition: transform .22s; }
.comment-media-picker[open] .comment-media-chevron, .comment-editor-footer .comment-rating-choice[open] summary > span { transform: rotate(180deg); }
.comment-avatar-preview { width: 28px; height: 28px; font-size: 12px; }
.comment-avatar-preview > svg { display: block; }
.comment-media-picker summary:focus-visible, .comment-editor-footer .comment-rating-choice summary:focus-visible { outline: 2px solid #d98e95; outline-offset: 3px; }
.comment-media-picker > fieldset, .project-comments .comment-editor-footer .comment-rating-options { position: absolute; bottom: calc(100% + 10px); left: 0; z-index: 14; width: 310px; max-width: calc(100vw - 56px); margin: 0; padding: 14px; border: 1px solid #79555e; border-radius: 12px; min-width: 0; box-sizing: border-box; background: #130e16fa; box-shadow: 0 12px 35px #000a; transform-origin: bottom left; }
.comment-media-picker legend { float: none; width: auto; margin: 0; padding: 0 4px; font-size: 11px; color: #cbbcc6; }
.project-comments .comment-editor-footer .comment-rating-options { width: 280px; }
.project-comments .comment-editor-footer .comment-rating-options legend { font-size: 12px; margin-bottom: 12px; }
.comment-editor-footer .comment-no-rating { font-size: 12px; }
.comment-avatar-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px 6px; margin-top: 8px; }
.comment-media-choice { position: relative; display: flex; align-items: center; justify-content: center; cursor: pointer; min-width: 0; margin: 0; }
.comment-media-choice > input { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
.comment-avatar-option { width: 38px; height: 38px; border: 2px solid transparent; background: #28161a; transition: border-color .18s, transform .18s, background .18s; }
.comment-media-choice:hover .comment-avatar-option { transform: translateY(-2px); }
.comment-media-choice > input:checked + span { border-color: #cf8c99; background-color: #45232b; }
.comment-media-choice > input:focus-visible + span { outline: 2px solid #d98e95; outline-offset: 2px; }
.comment-media-choice > input:disabled + span { opacity: .3; cursor: default; }
.comment-sticker-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; max-height: min(264px, 40vh); overflow-y: auto; overscroll-behavior: contain; padding: 5px; margin: 4px -5px 0; scrollbar-width: thin; scrollbar-color: #79555e transparent; }
.comment-sticker-option { display: block; width: 100%; height: 80px; padding: 5px; border: 2px solid transparent; border-radius: 9px; box-sizing: border-box; transition: background .18s, border-color .18s, opacity .18s; }
.comment-sticker-option:hover { background: #58303a55; }
.comment-media-count { flex-basis: 100%; font-size: 10px; color: #baaaae; line-height: 1.6; }
.comment-selected-stickers { display: flex; flex-basis: 100%; gap: 8px; flex-wrap: wrap; align-items: center; }
.comment-selected-stickers:empty { display: none; }
.comment-selected-stickers .comment-sticker-attachments { margin: 0; }
.comment-selected-stickers .comment-sticker { width: 72px; height: 72px; }
.comment-selected-sticker { position: relative; display: block; width: 76px; height: 76px; padding: 7px; border: 1px solid #79555e; border-radius: 10px; background: #160d1188; cursor: pointer; animation: comment-sticker-in .2s ease-out; transition: border-color .18s, background .18s; }
.comment-selected-sticker:hover { background: #45232b66; border-color: #cf8c99; }
.comment-selected-sticker > span { position: absolute; right: 3px; top: 0; color: #e0bcc4; font-size: 17px; line-height: 1.3; }
.comment-selected-sticker:focus-visible { outline: 2px solid #d98e95; outline-offset: 3px; }
.admin-comment-author { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.admin-comment-author h2 { margin: 0; }
.admin-comment .comment-sticker { width: 120px; height: 120px; }
@keyframes comment-sticker-in { from { opacity: 0; transform: translateY(5px) scale(.95); } to { opacity: 1; transform: none; } }
@media (max-width: 767px) {
    .project-comments .comment-compose-body .comment-composer { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 18px; }
    .comment-editor-identity { grid-column: 1; grid-row: auto; }
    .project-comments .comment-composer .comment-field > span { font-size: 12px; }
    .project-comments .comment-message-field textarea { min-height: 104px; font-size: 16px; }
    .comment-editor-footer { flex-direction: column; gap: 12px; }
    .comment-media-tools { width: 100%; }
    .comment-media-picker, .comment-editor-footer .comment-rating-choice { position: static; }
    .comment-media-picker > fieldset, .project-comments .comment-editor-footer .comment-rating-options { width: min(310px, 100%); max-width: 100%; }
    .project-comments .comment-editor-footer .comment-rating-choice { width: auto; }
    .project-comments .comment-editor-footer .comment-rating-choice summary { min-height: 44px; font-size: 12px; }
    .project-comments .comment-editor-footer .comment-rating-choice summary strong { font-size: 11px; }
    .project-comments .comment-editor-footer .comment-form-bottom { width: 100%; justify-content: space-between; }
    .project-comments .comment-editor-footer .comment-form-bottom small { font-size: 11px; }
    .project-comments .comment-composer .comment-form-note { font-size: 10px; }
}
@media (max-width: 575px) {
    .comment-avatar.mgn-comment-avatar { width: 34px; height: 34px; }
    .comment-sticker { width: 112px; height: 112px; }
    .comment-sticker-attachments { gap: 8px; }
    .comment-avatar-option { width: 33px; height: 33px; }
    .comment-sticker-option { height: 74px; }
}
@media (prefers-reduced-motion: reduce) {
    .comment-name-control, .comment-media-picker summary, .comment-media-chevron, .comment-avatar-option, .comment-sticker-option, .comment-selected-sticker, .comment-editor-footer .comment-rating-choice summary, .comment-editor-footer .comment-rating-choice summary > span, .project-comments .comment-editor-footer .comment-form-bottom .link-button { transition: none; animation: none; }
}
