.writing-help-detail {
    --help-ink: #252329;
    --help-muted: #6c676b;
    --help-line: #eeeae8;
    --help-surface: #faf8f7;
    --help-gutter: clamp(16px, 4vw, 32px);
    --help-width: 760px;
    box-sizing: border-box;
    width: 100%;
    max-width: var(--help-width);
    min-height: 100vh;
    min-height: 100dvh;
    margin-inline: auto;
    padding: 0 0 calc(92px + env(safe-area-inset-bottom));
    background: #fff;
    color: var(--help-ink);
}
.writing-help-detail svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round }
.writing-help-detail .help-detail-topbar {
    position: sticky;
    top: 0;
    z-index: 12;
    display: grid;
    grid-template-columns: 38px minmax(0,1fr) 38px;
    gap: 12px;
    align-items: center;
    min-height: 55px;
    padding-inline: var(--help-gutter);
    border-bottom: 1px solid var(--help-line);
    background: #fff;
}
.help-detail-topbar .help-detail-titlebar {
    min-width: 0;
    overflow: hidden;
    font-size: 16px;
    font-weight: 740;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.help-detail-menu { position: relative; justify-self: end }
.help-detail-menu summary { list-style: none }
.help-detail-menu summary::-webkit-details-marker { display: none }
.help-detail-menu[open] summary { background: #f6f4f3 }
.help-detail-menu-items {
    position: absolute;
    inset-block-start: calc(100% + 6px);
    inset-inline-end: 0;
    display: grid;
    min-width: 144px;
    padding: 5px;
    border: 1px solid var(--help-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 26px #2821281a;
}
.help-detail-menu-items :is(button,a) {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding-inline: 10px;
    border: 0;
    border-radius: 7px;
    background: #fff;
    color: var(--help-ink);
    font: inherit;
    font-size: 14px;
    text-align: start;
    text-decoration: none;
    cursor: pointer;
}
.help-detail-menu-items :is(button,a):hover { background: var(--writing-accent-soft); color: var(--writing-accent-text) }
.help-detail-menu-items svg { flex: none; width: 17px; height: 17px }

.help-detail-content { padding: clamp(24px, 5vw, 34px) var(--help-gutter) 26px }
.writing-help-detail .help-detail-title {
    color: var(--help-ink);
    font-size: clamp(24px, 5.6vw, 35px);
    font-weight: 780;
    line-height: 1.36;
    overflow-wrap: anywhere;
    text-wrap: balance;
}
.help-detail-byline,.help-detail-answer-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 9px; min-width: 0 }
.help-detail-byline { margin-block-start: 13px }
.help-detail-byline strong,.help-detail-answer-heading strong { font-size: 14px; font-weight: 690; overflow-wrap: anywhere }
.help-detail-byline time,.help-detail-answer-heading time { color: var(--help-muted); font-size: 12px }
.help-detail-avatar,
.help-detail-byline > img,
.help-detail-answer-heading > img {
    flex: none;
    width: 31px;
    height: 31px;
    border-radius: 50%;
    background: #f4eeea;
    color: #8e5b43;
    object-fit: cover;
}
.help-detail-avatar { position: relative; display: grid; place-items: center; overflow: hidden; font-size: 13px }
.help-detail-avatar svg { width: 17px; height: 17px }
.help-detail-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover }
.help-detail-status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px 12px;
    margin-block: 20px 0;
    padding: 11px 13px;
    border-radius: 10px;
    background: var(--help-surface);
    line-height: 1.45;
}
.help-detail-state,.help-detail-answer-badge { color: var(--writing-accent-text); font-size: 12px; font-weight: 700; line-height: 1.35 }
.help-detail-state { padding: 4px 8px; border-radius: 5px; background: var(--writing-accent-soft) }
.help-detail-state:is([data-state=paid],[data-state=completed], [data-state=settled]) { background: #ebf5ef; color: #2f6844 }
.help-detail-state:is([data-state=refunded],[data-state=closed],[data-state=expired]) { background: #efedef; color: #605c64 }
.help-detail-bounty { color: var(--writing-accent-text); font-size: 14px; font-weight: 730; overflow-wrap: anywhere }
.help-detail-deadline { color: var(--help-muted); font-size: 12px; overflow-wrap: anywhere }
.help-detail-status:has(+ .help-detail-terms) { border-radius: 10px 10px 0 0 }
.help-detail-terms {
    display: grid;
    grid-template-columns: fit-content(46%) minmax(0,1fr);
    gap: 6px 10px;
    min-width: 0;
    margin: 0;
    padding: 8px 13px 11px;
    border-top: 1px solid #ede6e1;
    border-radius: 0 0 10px 10px;
    background: var(--help-surface);
    font-size: 13px;
    overflow-wrap: anywhere;
}
.help-detail-terms > div { display: grid; grid-column: 1/-1; grid-template-columns: minmax(0, 8.8rem) minmax(0,1fr); grid-template-columns: subgrid }
.help-detail-terms dt { color: var(--help-muted) }
.help-detail-terms dd { min-width: 0; margin: 0; color: var(--help-ink) }
.writing-help-detail .help-detail-body {
    margin-block: 21px 0;
    color: #38343b;
    font-size: clamp(16px, 3.9vw, 17px);
    line-height: 1.88;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.writing-help-detail .community-post-gallery,
.writing-help-detail .post-gallery-gallery:not(.has-one) {
    grid-template-columns: minmax(0,1fr);
    grid-auto-flow: row;
    grid-auto-columns: auto;
    justify-items: start;
    gap: 11px;
    margin-block: 19px 0;
    padding: 0;
    overflow: visible;
    scroll-snap-type: none;
}
.writing-help-detail .community-post-image { max-width: 100%; border-radius: 9px; background: var(--help-surface) }
.writing-help-detail .community-post-gallery .community-post-image img { width: auto; max-width: 100%; height: auto; max-height: none; aspect-ratio: auto; object-fit: contain }

.help-detail-answers { margin-inline: var(--help-gutter); border-top: 1px solid var(--help-line); scroll-margin-top: 64px }
.help-detail-section-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 11px; padding-block: 16px 5px }
.writing-help-detail .help-detail-section-heading h2,.help-detail-section-heading:is(h2) { font-size: 19px; font-weight: 740; line-height: 1.3 }
.help-detail-section-heading span,.help-detail-section-heading small { color: var(--help-muted); font-size: 13px; font-weight: 500 }
.writing-help-detail .help-detail-empty { padding-block: 16px 22px; color: var(--help-muted); font-size: 14px; line-height: 1.6 }
.help-detail-answer { min-width: 0; padding-block: 15px 12px; scroll-margin-block: 70px 92px }
.help-detail-answer + .help-detail-answer:not(.child) { border-top: 1px solid var(--help-line) }
.help-detail-answer.child { margin-inline-start: 22px; padding: 10px 0 8px 12px; border-inline-start: 2px solid var(--help-line) }
.help-detail-answer.child .help-detail-avatar { width: 26px; height: 26px }
.help-detail-answer-badge { padding: 4px 6px; border-radius: 5px; background: var(--writing-accent-soft) }
.writing-help-detail .help-detail-answer-body { margin-block: 7px 0; color: #38343b; font-size: 15px; line-height: 1.76; white-space: pre-wrap; overflow-wrap: anywhere }
.help-detail-answer-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 9px; margin-block-start: 3px }
.help-detail-answer-actions button {
    min-height: 38px;
    padding: 0 5px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--help-muted);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}
.help-detail-answer-actions button:not(:disabled):hover { background: var(--help-surface); color: var(--writing-accent-text) }
.help-detail-answer-actions .help-detail-primary { padding-inline: 10px; background: var(--writing-accent-soft); color: var(--writing-accent-text); font-weight: 690 }

.help-detail-actions {
    position: fixed;
    z-index: 11;
    inset: auto 0 0;
    box-sizing: border-box;
    width: min(100%, var(--help-width));
    margin-inline: auto;
    padding: 8px var(--help-gutter) calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--help-line);
    background: #fff;
}
.help-detail-action-inner { min-width: 0 }
.help-detail-action-row { display: flex; align-items: stretch; justify-content: space-between; gap: 5px }
.help-detail-action-row .help-detail-action,
.help-detail-action-row .help-detail-primary {
    display: inline-flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    min-height: 44px;
    padding: 6px 5px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #524d55;
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}
.help-detail-action-row .help-detail-action:not(.help-detail-primary):hover { background: var(--help-surface) }
.help-detail-action-row .help-detail-action[aria-pressed=true] { background: var(--writing-accent-soft); color: var(--writing-accent-text) }
.help-detail-action-row .help-detail-action[aria-pressed=true] svg { fill: var(--writing-accent-border) }
.help-detail-action-row .help-detail-action > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.help-detail-action-row svg { flex: none; width: 18px; height: 18px }
.help-detail-action-row .help-detail-primary { flex-grow: 1.4; border-radius: 24px; background: var(--primary-color); color: #fff; font-weight: 730 }
.help-detail-action-row .help-detail-primary:not(:disabled):hover { background: var(--primary-dark) }
.writing-help-detail button:disabled { opacity: .6; cursor: default }
.writing-help-detail .help-detail-feedback {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-block-end: 6px;
    padding: 6px 9px;
    border-radius: 7px;
    background: var(--writing-accent-soft);
    color: var(--writing-accent-text);
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.help-detail-feedback button { margin-inline-start: auto; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer }
.help-detail-feedback a { color: inherit; font-weight: 700; white-space: nowrap }

.help-detail-dialog {
    position: fixed;
    inset: 0;
    box-sizing: border-box;
    width: min(560px, calc(100% - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 19px 22px 20px;
    overflow: auto;
    border: 0;
    border-radius: 16px;
    background: #fff;
    color: var(--help-ink, #252329);
    box-shadow: 0 18px 65px #2a1d1933;
}
.help-detail-dialog::backdrop { background: #1f1a2359 }
.help-detail-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-block-end: 13px }
.help-detail-dialog-head :is(h2,h3) { margin: 0; font-size: 19px; font-weight: 740; line-height: 1.35 }
.help-detail-dialog-form { display: grid; gap: 11px; min-width: 0; font-size: 14px; line-height: 1.5 }
.help-detail-dialog-form label { display: grid; gap: 6px; font-weight: 650 }
.help-detail-dialog-form textarea {
    box-sizing: border-box;
    width: 100%;
    min-height: 125px;
    padding: 11px 12px;
    border: 1px solid var(--help-line, #eeeae8);
    border-radius: 9px;
    background: var(--help-surface, #faf8f7);
    color: var(--help-ink, #252329);
    font: inherit;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.55;
    resize: vertical;
}
.help-detail-dialog-form textarea:focus { outline: 2px solid var(--writing-accent-border); outline-offset: 1px; background: #fff }
.help-detail-dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; align-items: center; gap: 8px }
.help-detail-dialog-actions button {
    min-height: 43px;
    padding: 7px 18px;
    border: 0;
    border-radius: 22px;
    background: var(--help-surface, #faf8f7);
    color: var(--help-ink, #252329);
    font: inherit;
    font-size: 14px;
    font-weight: 680;
    cursor: pointer;
}
.help-detail-dialog-actions .help-detail-primary { background: var(--primary-color); color: #fff }
.help-detail-dialog-actions .help-detail-primary:not(:disabled):hover { background: var(--primary-dark) }

@media (max-width: 560px) {
    .help-detail-dialog {
        inset: auto 0 0;
        width: 100%;
        max-height: calc(100dvh - 22px);
        margin: 0;
        padding: 15px var(--help-gutter, 18px) calc(15px + env(safe-area-inset-bottom));
        border-radius: 18px 18px 0 0;
    }
}
@media (max-width: 360px) {
    .help-detail-status { gap: 6px 9px; padding-inline: 10px }
    .help-detail-terms { padding-inline: 10px }
    .help-detail-action-row .help-detail-action,.help-detail-action-row .help-detail-primary { gap: 4px; font-size: 12px }
    .help-detail-action-row svg { width: 16px; height: 16px }
}
