/* Shared inline send controls; legacy buttons stay available through Settings. */
html body .na-comment-input {
    /* Keep the typing highlight on touch devices as well as desktop. */
    --na-field-focus: #ffcc00;
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
}
html body .na-comment-input > textarea {
    display: block;
    width: 100%;
    margin: 0;
    padding-right: 56px !important;
}
/* Every post composer uses the tournament field treatment. */
html body :is(.np-reply-form, .no-composer, .na-comment-form) .na-comment-input > textarea {
    background: var(--na-comment-surface, #fff) !important;
    border: 1px solid var(--na-comment-border, #d9cde7) !important;
    border-radius: 8px;
    padding: 10px 56px 10px 12px !important;
    color: var(--na-comment-text, #251637);
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    box-shadow: none;
}
html body :is(.np-reply-form, .no-composer, .na-comment-form) .na-comment-input > textarea::placeholder {
    color: var(--na-comment-placeholder, #999);
    opacity: 1;
}
html body :is(.np-reply-form, .no-composer, .na-comment-form) .na-comment-input > textarea:focus {
    border-color: #ffcc00 !important;
    outline: none;
}
html[data-na-theme="dark"] .na-comment-input,
.na-theme-dark .na-comment-input {
    --na-comment-surface: var(--no-soft, var(--nd-soft, #202b39));
    --na-comment-border: var(--no-line, var(--nd-line, #3a4858));
    --na-comment-text: var(--no-ink, var(--nd-text, #f4f7fb));
    --na-comment-placeholder: var(--no-muted, var(--nd-muted, #c7c3b6));
}
.na-comment-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 8px;
}
.na-comment-field > :is(.na-comment-input, textarea) { grid-column: 1 / -1; }
.na-comment-field > .na-mention-ui { grid-column: 1; grid-row: 2; order: 0; margin: 6px 0 0; }
.na-comment-field > .na-comment-count {
    grid-column: 2;
    grid-row: 2;
    margin-top: 6px;
    color: var(--nd-muted, #756786);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.6;
    text-align: right;
    white-space: nowrap;
}
html body .na-comment-input > .na-comment-send {
    position: absolute;
    right: 3px;
    bottom: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #7544ad;
    box-shadow: none;
    cursor: pointer;
    line-height: 1;
}
html body .na-comment-send svg { flex: none; width: 22px; height: 22px; pointer-events: none; }
html body .na-comment-send:hover:not(:disabled) { background: #7544ad14; }
html body .na-comment-send:focus-visible { outline: 2px solid currentColor; outline-offset: -3px; }
html body .na-comment-send:disabled { opacity: .4; cursor: default; }
html body .na-comment-legacy-hidden { display: none !important; }
html body .no-composer .na-comment-input { grid-column: 1 / -1; margin-top: 8px; }
html[data-na-theme="dark"] body .na-comment-send,
html body .na-theme-dark .na-comment-send { color: #c4a1f3; }

/* Post conversations use the same field treatment as tournament comments. */
html body .na-comment-input {
    --na-comment-field-bg: #fff;
    --na-comment-field-border: #d9cde7;
    --na-comment-field-text: #000;
    --na-comment-field-placeholder: #999;
}
html[data-na-theme="dark"] body .na-comment-input,
html body .na-theme-dark .na-comment-input {
    --na-comment-field-bg: #251f30;
    --na-comment-field-border: #393044;
    --na-comment-field-text: #f5f1fa;
    --na-comment-field-placeholder: #b9adc9;
}
html body :is(.np-reply-form, .no-event .no-composer, .na-comment-form) .na-comment-input > textarea {
    background: var(--na-comment-field-bg) !important;
    border: 2px solid var(--na-comment-field-border) !important;
    border-radius: 8px;
    color: var(--na-comment-field-text) !important;
    padding: 10px 56px 10px 12px;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    box-shadow: none;
}
html body :is(.np-reply-form, .no-event .no-composer, .na-comment-form) .na-comment-input > textarea::placeholder {
    color: var(--na-comment-field-placeholder) !important;
    opacity: 1;
}
html body :is(.np-reply-form, .no-event .no-composer, .na-comment-form) .na-comment-input > textarea:focus {
    border-color: var(--na-field-focus, #ffcc00) !important;
    box-shadow: 0 0 0 1px var(--na-field-focus, #ffcc00) !important;
    outline: none;
}

/* Mobile comment bars share the same layout on every conversation surface. */
@media (max-width: 782px) {
    html body .na-comment-shell.no-event,
    html body .na-comment-shell.np-dialog.np-drawer-dialog {
        top: var(--na-comment-visible-top, 0px);
        bottom: auto;
        height: var(--na-comment-visible-height, 100dvh);
        max-height: none;
    }
    html body .na-comment-shell.np-dialog:not(.np-drawer-dialog) {
        position: fixed;
        top: calc(var(--na-comment-visible-top, 0px) + 8px);
        bottom: auto;
        margin: 0 auto;
        height: calc(var(--na-comment-visible-height, 100dvh) - 16px);
        max-height: none;
    }
    html body .na-comment-dock {
        flex: 0 0 auto;
        min-height: 0;
        max-height: 55%;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--no-line, var(--nd-line, #e3d8ca));
        background: var(--no-surface, var(--nd-card, var(--na-comment-surface, #fffdf9)));
    }
    html body .na-comment-dock[hidden],
    html body [data-na-dock-inactive] { display: none !important; }
    html body .na-comment-dock-page {
        position: fixed;
        left: 0;
        right: 0;
        bottom: var(--na-comment-bottom, 0px);
        max-height: calc(var(--na-comment-visible-height, 100dvh) * .55);
        z-index: 1001;
    }
    html body .na-comment-page {
        padding-bottom: calc(var(--na-comment-dock-height, 72px) + var(--na-comment-nav-height, 0px) + 20px);
    }
    html.na-comment-keyboard body .na-comment-dock { padding-bottom: 10px; }
    html.na-comment-keyboard .nd-bottom-nav,
    html.na-comment-keyboard .na-bottom-nav { visibility: hidden; }
    html body .na-comment-dock .na-comment-form-section-docked,
    html body .na-comment-dock .na-comment-reply-form-wrap {
        position: static;
        width: auto;
        max-width: none;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        transform: none;
    }
    html body .na-comment-dock form,
    html body .na-comment-dock .no-composer { margin: 0; padding: 0; }
    html body .na-comment-dock .no-notice { margin: 0; }
    html body .na-comment-dock .na-comment-input { margin-top: 0; }
    html body .na-comment-dock textarea {
        margin-top: 0;
        font-size: 16px;
        max-height: min(144px, calc(var(--na-comment-visible-height, 100dvh) * .3)) !important;
    }
    html body .na-comment-dock .na-mention-ui { margin-bottom: 0; }
    html body .na-comment-dock form:not(:focus-within) .na-mention-ui,
    html body .na-comment-dock form:not(:focus-within) .no-char-count,
    html body .na-comment-dock form:not(:focus-within) > .np-help { display: none; }
    html body .na-comment-dock .np-help { margin-bottom: 0; }
    html body .na-comment-dock .np-reply-footer,
    html body .na-comment-dock .no-event-compose { padding: 10px 0 0; border: 0; background: transparent; }
    html body .na-comment-dock:not(:has([data-visibility="private"])) .no-composer > label > span:first-child {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
    html body .na-comment-dock .no-reply-target p { max-height: 3.2em; overflow: hidden; }
    html[data-na-theme="dark"] .na-find-single-page { --na-comment-surface: #18212d; }
}
