.discussion-header {
    gap: 32px;
}

.knowledge-categories, .knowledge-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 18px; margin: 24px 0; }
.knowledge-category, .knowledge-summary { display: block; overflow-wrap: anywhere; }
.knowledge-category h2, .knowledge-summary h2 { font-size: 20px; margin: 0 0 12px; }
.knowledge-category:hover, .knowledge-summary:hover, .knowledge-selected { border-color: var(--green); background: #f4f8ef; }
.knowledge-search { display: flex; gap: 16px; align-items: end; flex-wrap: wrap; margin: 28px 0; }
.knowledge-search .registration-field { flex: 1 1 240px; margin: 0; }
.knowledge-search .text-link { padding: 12px 0; }
.knowledge-article { padding: clamp(20px, 4vw, 48px); max-width: 900px; margin: 24px auto; }
.knowledge-article h1 { overflow-wrap: anywhere; }
.knowledge-intro { font-size: 18px; line-height: 1.7; }
.knowledge-body { padding: 24px 0; line-height: 1.85; }
.knowledge-photo { width: 100%; max-height: 500px; object-fit: contain; border-radius: 8px; background: #f4f8ef; }
.knowledge-discuss { border-top: 1px solid var(--line); padding-top: 24px; }
.knowledge-editor { max-width: 950px; }

.search-result {
    display: block;
    padding: 24px;
    border-bottom: 1px solid var(--line);
}

.search-result:last-child {
    border-bottom: 0;
}

.search-result:hover {
    background: #fbfcf8;
}

.search-result h3 {
    margin: 7px 0 9px;
    font-size: 18px;
    overflow-wrap: anywhere;
}

.search-result-kind {
    font-size: 10px;
    color: var(--green);
}

.search-snippet {
    margin: 0 0 13px;
    color: #5e7167;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.search-result-meta {
    font-size: 11px;
    color: var(--muted);
}

.search-result-meta span {
    float: right;
    color: var(--green);
}

.search-toolbar {
    flex-wrap: wrap;
}

.search-toolbar > div {
    min-width: 0;
    overflow-wrap: anywhere;
}

.discussion-navigation {
    display: flex;
    gap: 24px;
    color: var(--green);
    font-size: 13px;
}

.discussion-main {
    min-height: calc(100vh - 160px);
    padding-bottom: 55px;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: var(--muted);
    padding: 22px 0;
}

.breadcrumbs a {
    color: var(--green);
}

.discussion-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 35px;
    border-radius: 13px;
    background: linear-gradient(120deg, #103e3b, #286656);
    color: white;
}

.discussion-hero h1 {
    font-size: 32px;
    margin: 12px 0;
}

.discussion-hero p {
    color: #c0d3cc;
    margin: 0;
}

.discussion-hero .btn {
    white-space: nowrap;
}

.discussion-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 28px 0 20px;
}

.discussion-toolbar .btn {
    font-size: 12px;
    flex-shrink: 0;
}

.topic-row {
    display: flex;
    align-items: center;
    gap: 17px;
    padding: 23px;
    border-bottom: 1px solid var(--line);
}

.topic-row:last-child {
    border-bottom: 0;
}

.topic-row:hover {
    background: #fbfcf8;
}

.topic-row-info {
    flex: 1;
    min-width: 0;
}

.topic-row h3 {
    font-size: 15px;
    margin: 0;
    overflow-wrap: anywhere;
}

.topic-row p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.topic-replies {
    display: flex;
    flex-direction: column;
    text-align: center;
    font-size: 10px;
    color: var(--muted);
}

.topic-replies b {
    color: var(--ink);
    font-size: 16px;
}

.discussion-empty {
    text-align: center;
    padding: 45px 24px;
}

.discussion-empty p {
    color: var(--muted);
    margin-bottom: 23px;
}

.discussion-compose {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 285px;
    gap: 28px;
    align-items: start;
}

.discussion-compose h1 {
    font-size: 30px;
    margin: 12px 0;
}

.registration-field select,
.registration-field textarea {
    width: 100%;
    border: 1px solid #d9e3da;
    border-radius: 7px;
    padding: 12px 13px;
    color: var(--ink);
    background: #fcfdfb;
    font-size: 13px;
}

.registration-field textarea {
    resize: vertical;
    min-height: 140px;
}

.registration-field textarea[aria-invalid='true'],
.registration-field select[aria-invalid='true'] {
    border-color: #ae5040;
}

.compose-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 22px;
    font-size: 12px;
    color: var(--green);
}

.guest-actions {
    justify-content: flex-start;
}

.topic-heading h1 {
    font-size: 32px;
    margin: 12px 0;
    overflow-wrap: anywhere;
}

.topic-heading p {
    color: var(--muted);
    font-size: 12px;
}

.post-card {
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 18px;
    scroll-margin-top: 20px;
}

.post-author {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    padding: 17px 24px;
    background: #f0f4ed;
    border-radius: 10px 10px 0 0;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.post-author time {
    margin-left: auto;
    font-size: 11px;
    color: var(--muted);
}

.post-badge {
    font-size: 9px;
    margin-left: 9px;
    padding: 3px 6px;
    color: var(--green);
    border: 1px solid #d7e3ca;
    border-radius: 4px;
}

.post-body {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    padding: 25px;
    line-height: 1.85;
}

.replies-heading {
    margin: 32px 0 18px;
}

.replies-heading span {
    margin-left: 7px;
    color: var(--muted);
    font-size: 13px;
}

.reply-compose {
    margin-top: 25px;
    scroll-margin-top: 20px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 25px 0;
    font-size: 12px;
    color: var(--muted);
}

@media (max-width: 850px) {
    .discussion-navigation {
        display: none;
    }

    .discussion-compose {
        grid-template-columns: 1fr;
    }

    .compose-tip {
        display: none;
    }
}

@media (max-width: 600px) {
    .discussion-header {
        gap: 0;
        padding-bottom: 10px;
    }

    .discussion-hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 25px;
    }

    .discussion-hero h1,
    .topic-heading h1 {
        font-size: 27px;
    }

    .discussion-toolbar {
        flex-wrap: wrap;
    }

    .topic-row {
        padding: 18px 15px;
        gap: 10px;
    }

    .post-author {
        padding: 15px;
    }

    .post-author time {
        flex-basis: 100%;
        margin-left: 43px;
    }

    .post-body {
        padding: 20px;
    }
}
.topic-media {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 240px));
    gap: 16px;
    margin: 0 24px 24px;
}
.topic-media-item {
    position: relative;
    display: block;
    overflow: hidden;
    border: 1px solid var(--line, #d8e2da);
    border-radius: 12px;
    color: inherit;
    text-decoration: none;
    background: #f1f5f0;
}
.topic-media-item img {
    display: block;
    width: 100%;
    height: 160px;
    object-fit: contain;
}
.topic-media-item:hover, .topic-media-item:focus-visible { outline: 2px solid #226459; }
.media-caption { display: block; padding: 8px 12px; font-size: 12px; overflow-wrap: anywhere; }
.media-play {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 5px 9px;
    border-radius: 8px;
    background: #103e3be6;
    color: white;
    font-size: 13px;
}
.media-selection { padding-left: 20px; font-size: 13px; overflow-wrap: anywhere; }
.media-selection:empty { display: none; }
[data-upload-status] progress { width: 100%; accent-color: #226459; }
.admin-actions { margin: 0 0 24px; }
.btn.danger { background: #9b302b; color: white; border-color: #9b302b; }
.btn.danger:hover { background: #7c2622; }
.admin-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 16px 0; border-bottom: 1px solid #d8e2da; overflow-wrap: anywhere; }
.admin-links { display: flex; gap: 16px; flex-wrap: wrap; margin: 16px 0; }
.topic-rating { padding: 1.5rem; }
.spotlight-photos { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1.5rem 0; border: 1px solid #c8d8ce; border-radius: 8px; padding: 1rem; }
.spotlight-photo { display: flex; flex-direction: column; gap: .5rem; width: 180px; cursor: pointer; overflow-wrap: anywhere; }
.spotlight-photo img { width: 180px; height: 120px; object-fit: cover; border: 3px solid transparent; border-radius: 6px; }
.spotlight-photo input:checked + img { border-color: #226459; }
.spotlight-photo input:focus-visible + img { outline: 2px solid #226459; outline-offset: 2px; }
.rating-picker { border: 0; padding: 0; margin: 0 0 1rem; }
.rating-stars { display: inline-flex; flex-direction: row-reverse; gap: .25rem; }
.rating-stars input, .rating-sr { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.rating-stars label { display: inline-flex; padding: .25rem; color: #737b79; cursor: pointer; }
.rating-stars label svg { width: 2.5rem; height: 2.5rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.rating-stars input:checked ~ label { color: #a56a00; }
.rating-stars input:checked ~ label svg { fill: currentColor; }
.rating-stars label:hover { outline: 1px solid #a56a00; border-radius: .2rem; }
.rating-stars input:focus-visible + label { outline: 2px solid #226459; outline-offset: 2px; border-radius: .2rem; }
