.subediss-page {
    background:
        radial-gradient(circle at 10% 0%, rgba(37, 99, 235, 0.10), transparent 28%),
        radial-gradient(circle at 95% 12%, rgba(5, 150, 105, 0.10), transparent 26%),
        var(--page);
}

.subediss-shell {
    padding: 28px 0 56px;
}

.subediss-hero {
    border-bottom: 1px solid var(--line);
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(255, 255, 255, 0.86));
}

.subediss-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
    gap: 32px;
    align-items: center;
    padding: 44px 0;
}

.subediss-hero h1 {
    max-width: 760px;
    margin: 16px 0 12px;
    color: var(--text);
    font-size: clamp(36px, 5vw, 68px);
    line-height: 0.95;
    letter-spacing: 0;
}

.subediss-hero p {
    max-width: 680px;
    margin: 0;
    color: #475569;
    font-size: 18px;
    line-height: 1.65;
}

.subediss-search-card,
.sub-card,
.composer-card,
.post-card,
.empty-feed {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
}

.subediss-search-card {
    border-radius: 20px;
    padding: 20px;
}

.subediss-search-card label,
.composer-form label {
    display: grid;
    gap: 8px;
    color: #334155;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.subediss-search-row {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}

.subediss-search-row input,
.composer-form input,
.composer-form textarea,
.composer-form select,
.comment-strip input,
.feed-toolbar select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    outline: none;
}

.subediss-search-row input,
.composer-form input,
.composer-form select,
.comment-strip input,
.feed-toolbar select {
    min-height: 46px;
    padding: 0 14px;
}

.composer-form textarea {
    min-height: 120px;
    padding: 14px;
    resize: vertical;
}

.subediss-search-row button,
.composer-actions button,
.comment-strip button,
.login-composer a {
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--blue-600), var(--emerald));
    color: #fff;
    font-weight: 950;
    cursor: pointer;
}

.subediss-search-row button {
    padding: 0 18px;
}

.subediss-search-card small,
.composer-top small,
.channel-link small,
.post-head,
.post-actions,
.composer-actions span {
    color: var(--muted);
}

.subediss-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 300px;
    gap: 22px;
    padding-top: 0;
}

.sticky-card {
    position: sticky;
    top: 88px;
}

.sub-card {
    border-radius: 18px;
    padding: 16px;
}

.sub-card + .sub-card {
    margin-top: 16px;
}

.sub-card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    color: #0f172a;
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
}

.sub-card-title strong {
    display: grid;
    place-items: center;
    min-width: 30px;
    height: 30px;
    border-radius: 10px;
    background: var(--blue-50);
    color: var(--blue-600);
}

.channel-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 14px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.channel-link:hover,
.channel-link.active {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.channel-link strong,
.channel-link small {
    display: block;
}

.channel-link strong {
    color: var(--text);
    font-size: 13px;
}

.channel-link small {
    margin-top: 2px;
    font-size: 11px;
}

.channel-icon,
.avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 13px;
    background: linear-gradient(135deg, #dbeafe, #d1fae5);
    color: var(--blue-600);
    font-size: 12px;
    font-weight: 950;
}

.channel-icon.fire {
    color: #b45309;
    background: #fef3c7;
}

.channel-icon.blue {
    color: var(--blue-600);
    background: #dbeafe;
}

.subediss-feed {
    min-width: 0;
}

.feed-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.86)),
        radial-gradient(circle at 100% 0%, rgba(16, 185, 129, 0.12), transparent 30%);
    box-shadow: var(--shadow);
    padding: 22px;
}

.feed-titlebar h1 {
    margin: 10px 0 8px;
    color: var(--text);
    font-size: clamp(26px, 3vw, 38px);
    line-height: 1.05;
    letter-spacing: 0;
}

.feed-titlebar p {
    max-width: 650px;
    margin: 0;
    color: #475569;
    line-height: 1.6;
}

.start-discussion-btn,
.side-start-btn {
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--blue-600), var(--emerald));
    color: #fff;
    font-weight: 950;
    cursor: pointer;
    box-shadow: 0 18px 32px rgba(37, 99, 235, 0.20);
}

.start-discussion-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 170px;
    min-height: 52px;
    padding: 0 20px;
    white-space: nowrap;
}

.side-start-btn {
    width: 100%;
    min-height: 44px;
    margin-top: 12px;
}

.side-start-btn.link {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sub-alert {
    margin-bottom: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    font-weight: 800;
}

.sub-alert.success {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.sub-alert.danger {
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #991b1b;
}

.composer-card,
.post-card,
.empty-feed {
    border-radius: 20px;
    padding: 18px;
}

.composer-top,
.login-composer {
    display: flex;
    align-items: center;
    gap: 14px;
}

.composer-top {
    margin-bottom: 16px;
}

.composer-top strong,
.login-composer strong {
    display: block;
    color: var(--text);
    font-size: 18px;
}

.composer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.composer-grid.compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 12px;
}

.composer-form > input,
.composer-form > textarea {
    margin-bottom: 12px;
}

.composer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 12px;
}

.composer-actions button,
.comment-strip button {
    min-height: 44px;
    padding: 0 18px;
}

.login-composer p {
    margin: 4px 0 0;
    color: var(--muted);
}

.login-composer a {
    margin-left: auto;
    padding: 13px 18px;
    white-space: nowrap;
}

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

.tabs {
    display: flex;
    gap: 8px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.tabs a {
    padding: 9px 14px;
    border-radius: 10px;
    color: #475569;
    font-size: 13px;
    font-weight: 900;
}

.tabs a.active {
    background: var(--blue-600);
    color: #fff;
}

.feed-toolbar select {
    max-width: 180px;
}

.post-card + .post-card {
    margin-top: 14px;
}

.post-card {
    position: relative;
}

.post-card::before {
    content: "";
    position: absolute;
    inset: 18px auto 18px 0;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--blue-600), var(--emerald));
    opacity: 0.85;
}

.post-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 12px;
    font-weight: 800;
}

.sub-pill,
.type-pill {
    border-radius: 999px;
    padding: 6px 9px;
}

.sub-pill {
    background: #eff6ff;
    color: var(--blue-600);
}

.type-pill {
    margin-left: auto;
    background: #ecfdf5;
    color: #047857;
    text-transform: capitalize;
}

.post-card h2 {
    margin: 0 0 10px;
    color: var(--text);
    font-size: 22px;
    line-height: 1.25;
}

.post-card p {
    margin: 0;
    color: #475569;
    line-height: 1.7;
}

.tag-row,
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-row {
    margin-top: 14px;
}

.tag-row span,
.tag-cloud span {
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 900;
}

.tag-cloud small {
    color: var(--muted);
}

.post-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: 13px;
    font-weight: 900;
}

.post-actions form {
    margin: 0;
}

.post-actions button {
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: #475569;
    padding: 0 12px;
    font-weight: 950;
    cursor: pointer;
}

.post-actions button.voted {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: var(--blue-600);
}

.comment-strip {
    display: grid;
    gap: 10px;
    margin-top: 14px;
    padding: 14px;
    border-radius: 14px;
    background: #f8fafc;
}

.comment-strip div {
    color: #475569;
    font-size: 13px;
    line-height: 1.5;
}

.comment-strip div strong {
    color: var(--text);
}

.comment-strip form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin: 0;
}

.rules-list {
    margin: 0;
    padding-left: 18px;
    color: #475569;
    line-height: 1.65;
    font-size: 13px;
}

.stats-list {
    display: grid;
    gap: 10px;
}

.stats-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
}

.stats-list div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.stats-list strong {
    color: var(--blue-600);
    font-size: 24px;
}

.stats-list span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.contributors-list {
    display: grid;
    gap: 12px;
}

.contributor-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.contributor-row > span {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: #dbeafe;
    color: var(--blue-600);
    font-size: 12px;
    font-weight: 950;
}

.contributor-row strong,
.contributor-row small {
    display: block;
}

.contributor-row strong {
    color: var(--text);
    font-size: 13px;
}

.contributor-row small,
.muted-copy {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.discussion-modal[hidden] {
    display: none;
}

.discussion-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 22px;
}

.discussion-backdrop {
    position: fixed;
    inset: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.50);
    backdrop-filter: blur(12px);
    cursor: pointer;
}

.discussion-panel {
    position: relative;
    z-index: 1;
    width: min(880px, 100%);
    max-height: min(92vh, 860px);
    overflow: auto;
    border: 1px solid rgba(191, 219, 254, 0.95);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 253, 250, 0.94)),
        radial-gradient(circle at 100% 0%, rgba(37, 99, 235, 0.12), transparent 32%);
    box-shadow: 0 34px 90px rgba(15, 23, 42, 0.28);
    padding: 22px;
}

.discussion-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.discussion-panel-head h2 {
    margin: 10px 0 6px;
    color: var(--text);
    font-size: 28px;
    line-height: 1.1;
}

.discussion-panel-head p {
    margin: 0;
    color: var(--muted);
}

.modal-close-btn {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--text);
    font-weight: 950;
    cursor: pointer;
}

.modal-composer-form {
    display: grid;
}

.optional-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modal-login-composer {
    border: 1px dashed #bfdbfe;
    border-radius: 18px;
    padding: 18px;
    background: #f8fafc;
}

.discussion-modal-open {
    overflow: hidden;
}

.empty-feed {
    color: var(--muted);
    text-align: center;
}

.empty-feed strong {
    display: block;
    color: var(--text);
    font-size: 20px;
}

@media (max-width: 1100px) {
    .subediss-layout {
        grid-template-columns: 240px minmax(0, 1fr);
    }

    .subediss-right {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }

    .sub-card + .sub-card {
        margin-top: 0;
    }
}

@media (max-width: 820px) {
    .subediss-hero-grid,
    .subediss-layout,
    .subediss-right,
    .composer-grid,
    .composer-grid.compact {
        grid-template-columns: 1fr;
    }

    .sticky-card {
        position: static;
    }

    .subediss-sidebar .sub-card {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .sub-card-title {
        grid-column: 1 / -1;
    }

    .feed-toolbar,
    .feed-titlebar,
    .composer-actions,
    .login-composer {
        align-items: stretch;
        flex-direction: column;
    }

    .start-discussion-btn {
        width: 100%;
    }

    .login-composer a {
        margin-left: 0;
        text-align: center;
    }

    .feed-toolbar select {
        max-width: none;
    }
}

@media (max-width: 560px) {
    .subediss-sidebar .sub-card,
    .comment-strip form {
        grid-template-columns: 1fr;
    }

    .tabs {
        width: 100%;
        overflow-x: auto;
    }

    .tabs a {
        white-space: nowrap;
    }

    .type-pill {
        margin-left: 0;
    }
}
