/* P04D: one native form design for post/page discussions and Woo product reviews.
 * Do not alter provider markup, ratings, field validation or the comment posting flow. */
:where(.mtc-comments, .single-product div.product #review_form_wrapper) {
    --mtc-discussion-control: 48px;
    --mtc-discussion-radius: 10px;
    color: var(--mtc-text);
}
:where(.mtc-comments, .single-product div.product #review_form_wrapper) :where(.comment-form, #commentform) {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    color: var(--mtc-text);
}
:where(.mtc-comments, .single-product div.product #review_form_wrapper) :where(.comment-form p, #commentform p) {
    min-width: 0;
    margin: 0;
}
:where(.mtc-comments, .single-product div.product #review_form_wrapper) :where(.comment-form label, #commentform label) {
    display: inline-block;
    margin-block-end: 6px;
    color: var(--mtc-text);
    font-weight: 700;
}
:where(.mtc-comments, .single-product div.product #review_form_wrapper) :where(.comment-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]), .comment-form textarea, #commentform input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]), #commentform textarea) {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-height: var(--mtc-discussion-control);
    padding: 10px 12px;
    border: 1px solid var(--mtc-line);
    border-radius: var(--mtc-discussion-radius);
    color: var(--mtc-text);
    background: var(--mtc-bg);
    font: inherit;
    line-height: 1.7;
}
:where(.mtc-comments, .single-product div.product #review_form_wrapper) :where(textarea, .comment-form textarea, #commentform textarea) { min-height: 134px; resize: vertical; }
:where(.mtc-comments, .single-product div.product #review_form_wrapper) :where(.comment-form input, .comment-form textarea, #commentform input, #commentform textarea):focus-visible {
    outline: 2px solid var(--mtc-primary);
    outline-offset: -2px;
    border-color: var(--mtc-primary);
}
:where(.mtc-comments, .single-product div.product #review_form_wrapper) :where(.form-submit, #commentform .form-submit) { margin-block: 6px 0; }
:where(.mtc-comments, .single-product div.product #review_form_wrapper) :where(.form-submit input[type="submit"], .form-submit button[type="submit"], #submit) {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border: 1px solid var(--mtc-primary);
    border-radius: var(--mtc-discussion-radius);
    color: #fff;
    background: var(--mtc-primary);
    font-weight: 700;
    line-height: 1.35;
    cursor: pointer;
}
:where(.mtc-comments, .single-product div.product #review_form_wrapper) :where(.comment-form-cookies-consent, .comment-form .comment-form-cookies-consent) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
:where(.mtc-comments, .single-product div.product #review_form_wrapper) .comment-form-cookies-consent :where(input[type="checkbox"], label) { width: auto; margin: 0; }
:where(.mtc-comments, .single-product div.product #review_form_wrapper) :where(input[type="checkbox"], input[type="radio"]) {
    accent-color: var(--mtc-primary);
}
:where(.mtc-comments, .single-product div.product #review_form_wrapper) :where(.required, .comment-notes, .logged-in-as, .comment-form-comment .description) { color: var(--mtc-muted); }
:where(.mtc-comments, .single-product div.product #review_form_wrapper) :where(.comment-awaiting-moderation, .comment-notice, .mtc-field-error) {
    color: var(--mtc-text);
    border-inline-start: 3px solid var(--mtc-primary);
    padding-inline-start: 10px;
}
.mtc-comments :where(ol.comment-list, ol.children) { padding-inline-start: clamp(12px, 3vw, 32px); }
.mtc-comments :where(.comment-body, .pingback, .trackback) { padding-block: 12px; border-block-end: 1px solid var(--mtc-line); }
.mtc-comments :where(.comment-reply-link, #cancel-comment-reply-link) { display: inline-block; padding: 6px 10px; border-radius: 8px; color: var(--mtc-primary); }
.mtc-comments :where(.comment-reply-link, #cancel-comment-reply-link):focus-visible { outline: 2px solid var(--mtc-primary); outline-offset: -2px; }
/* Existing product review ordering owns two columns for the last row.
 * Preserve its hierarchy while fixing inconsistent controls and focus rings. */
.single-product div.product #review_form #commentform :where(.comment-form-comment, .comment-form-author, .comment-form-email) { min-width: 0; }
.single-product div.product #review_form #commentform :where(.comment-form-rating, .stars) { color: var(--mtc-primary); }
.single-product div.product #review_form #commentform :where(.form-submit, .mtcas-captcha) { min-width: 0; }
[data-theme="dark"] :where(.mtc-comments, .single-product div.product #review_form_wrapper) :where(.comment-form input:not([type="submit"]), .comment-form textarea, #commentform input:not([type="submit"]), #commentform textarea) { color: var(--mtc-text); background: var(--mtc-surface); border-color: var(--mtc-line); }
@media (max-width: 640px) {
    :where(.mtc-comments, .single-product div.product #review_form_wrapper) :where(.comment-form input:not([type="submit"]), .comment-form textarea, #commentform input:not([type="submit"]), #commentform textarea) { font-size: 16px; }
    .single-product div.product #review_form #commentform { grid-template-columns: minmax(0, 1fr); }
    .single-product div.product #review_form #commentform > :where(.form-submit, .mtcas-captcha, .mtc-captcha, .comment-form-captcha) { grid-column: 1; }
}
