.community-editorial-backdrop .community-editor-interaction-drawer {
    --editorial-drawer-gutter: clamp(16px, 4.5vw, 24px);
    --editorial-drawer-accent: var(--primary-color, #ff6b35);
    --editorial-drawer-accent-text: #9c4228;
    --editorial-drawer-muted: #706967;
    --editorial-drawer-surface: #f8f7f6;
    --editorial-drawer-line: #f0ebe8;
    width: 100%;
    max-width: 560px;
    padding: 0;
}

.community-editorial-backdrop .community-editor-interaction-drawer > header {
    min-height: 58px;
    padding: 0 var(--editorial-drawer-gutter);
    border-color: var(--editorial-drawer-line);
}

.community-editorial-backdrop .community-editor-interaction-drawer > .community-drawer-message {
    flex: none;
    margin: 8px var(--editorial-drawer-gutter) 0;
}

.community-editorial-backdrop .community-editor-comments-drawer {
    height: 74vh;
    height: min(74vh, 660px);
    height: min(74dvh, 660px);
    max-height: calc(100% - 12px);
    overflow: hidden;
}

.community-editor-comment-total {
    margin-inline-start: 8px;
    color: var(--editorial-drawer-muted);
    font-size: 13px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.community-editor-comments {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.community-editor-comment-list {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 var(--editorial-drawer-gutter);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

.community-editor-comment-empty {
    display: grid;
    min-height: 100%;
    place-content: center;
    justify-items: center;
    gap: 6px;
    padding: 20px 0;
    box-sizing: border-box;
    text-align: center;
}

.community-editor-comment-empty svg {
    width: 52px;
    height: 52px;
    color: var(--editorial-drawer-accent);
}

.community-editor-comment-empty strong { font-size: 15px; }
.community-editor-comment-empty p { margin: 0; color: var(--editorial-drawer-muted); font-size: 13px; }

.community-editor-comment-thread { padding-block: 13px 9px; }
.community-editor-comment-thread + .community-editor-comment-thread { border-top: 1px solid var(--editorial-drawer-line); }

.community-editor-comment {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: start;
    column-gap: 10px;
    min-width: 0;
    scroll-margin-block: 10px;
}

.community-editor-comment.is-child {
    grid-template-columns: 28px minmax(0, 1fr);
    margin-inline-start: 46px;
    margin-block-start: 9px;
}

.community-editor-comment-avatar {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    border-radius: 50%;
    overflow: hidden;
    background: #ffefe5;
    color: var(--editorial-drawer-accent-text);
    font-size: 13px;
    font-weight: 650;
}

.community-editor-comment-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.community-editor-comment-avatar img[hidden] { display: none; }

.community-editor-comment-byline {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 2px 7px;
    min-width: 0;
    color: var(--editorial-drawer-muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.community-editor-comment-byline strong { color: var(--ink); font-size: 13px; }
.community-editor-comment-byline b { color: var(--editorial-drawer-accent-text); font-weight: 600; }

.community-editor-comment-content > p {
    margin: 4px 0 2px;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.65;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.community-editor-comment-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0 13px;
    min-height: 28px;
    color: var(--editorial-drawer-muted);
    font-size: 11px;
}

.community-editor-comment-meta button,
.community-editor-reply-target button {
    min-height: 30px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.1;
    cursor: pointer;
}

.community-editor-comment-meta button:first-of-type { color: var(--editorial-drawer-accent-text); }
.community-editor-comment-meta button:hover, .community-editor-reply-target button:hover { text-decoration: underline; }
.community-editor-comment-meta button:disabled, .community-editor-reply-target button:disabled { cursor: default; opacity: .55; }

.community-editor-comment-form {
    display: grid;
    flex: none;
    gap: 6px;
    padding: 10px var(--editorial-drawer-gutter);
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--editorial-drawer-line);
    background: #fff;
}

.community-editor-reply-target {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    color: var(--editorial-drawer-muted);
    font-size: 12px;
}

.community-editor-reply-target span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.community-editor-reply-target strong { color: var(--editorial-drawer-accent-text); }
.community-editor-reply-target button { flex: none; min-height: 24px; }

.community-editor-comment-form textarea,
.community-editor-report textarea {
    box-sizing: border-box;
    display: block;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 8px 11px;
    resize: none;
    border: 1px solid transparent;
    border-radius: 12px;
    background: var(--editorial-drawer-surface);
    color: var(--ink);
    font: inherit;
    font-size: 16px;
    line-height: 1.5;
}

.community-editor-comment-form textarea::placeholder,
.community-editor-report textarea::placeholder { color: #76706e; }

.community-editor-comment-form textarea:focus,
.community-editor-report textarea:focus { border-color: var(--editorial-drawer-accent); outline: none; }

.community-editor-comment-form textarea[aria-invalid="true"],
.community-editor-report textarea[aria-invalid="true"] { border-color: #bc3b2b; }

.community-editor-comment-actions,
.community-editor-report-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.community-editor-comment-actions small,
.community-editor-report-label small {
    color: var(--editorial-drawer-muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.community-editor-comment-actions .is-over, .community-editor-report-label .is-over { color: #b63729; font-weight: 650; }

.community-editor-submit,
.community-editor-secondary {
    min-width: 76px;
    min-height: 38px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
}

.community-editor-submit { background: var(--editorial-drawer-accent); color: #2b130b; }
.community-editor-submit:hover { background: var(--primary-dark, #e55a2b); }
.community-editor-submit:disabled { background: #f0ebe8; color: #706661; cursor: default; }
.community-editor-secondary { background: var(--editorial-drawer-surface); color: var(--ink); }
.community-editor-secondary:hover { background: #f1edeb; }
.community-editor-secondary:disabled { opacity: .55; cursor: default; }

.community-editor-report {
    display: grid;
    gap: 10px;
    padding: 14px var(--editorial-drawer-gutter);
    padding-bottom: max(14px, env(safe-area-inset-bottom));
}

.community-editor-report-target {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    min-width: 0;
    padding: 11px 12px;
    border-radius: 12px;
    background: #fff6f0;
}

.community-editor-report-target svg {
    box-sizing: border-box;
    width: 34px;
    height: 34px;
    padding: 7px;
    border-radius: 10px;
    background: #ffede1;
    color: var(--editorial-drawer-accent-text);
}

.community-editor-report-target strong { font-size: 13px; }
.community-editor-report-target p {
    display: -webkit-box;
    margin: 3px 0 0;
    overflow: hidden;
    overflow-wrap: anywhere;
    color: var(--editorial-drawer-muted);
    font-size: 13px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.community-editor-report-target p span { font-weight: 600; }
.community-editor-report-label label { color: var(--ink); font-size: 14px; font-weight: 650; }
.community-editor-report-actions { display: flex; gap: 8px; }
.community-editor-report-actions button { min-height: 42px; }
.community-editor-report-actions .community-editor-submit { flex: 1; }

@media (max-width: 360px) {
    .community-editorial-backdrop .community-editor-interaction-drawer { --editorial-drawer-gutter: 13px; }
    .community-editor-comment.is-child { margin-inline-start: 30px; }
}

@media (max-height: 520px) {
    .community-editorial-backdrop .community-editor-comments-drawer { height: 85vh; height: 85dvh; }
}
