.news-item {
    appearance: none;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: left;
    width: 100%;
}

.news-item:focus-visible {
    outline: 3px solid #7ab7e4;
    outline-offset: -2px;
}

.news-item-source > span {
    display: block;
}

.news-dialog-summary-section {
    border-bottom: 1px solid #dbe4ef;
    padding-bottom: 14px;
}

.news-dialog-overlay {
    box-sizing: border-box;
    overflow: hidden;
}

.news-dialog {
    box-sizing: border-box;
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.news-dialog-header {
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 2;
}

.news-dialog-comments:empty,
.news-dialog-comments[hidden] {
    display: none;
}

.news-comments {
    background: #fff;
    border-top: 1px solid #dbe4ef;
    display: flex;
    flex-direction: column;
    margin-top: 20px;
    min-height: 280px;
    padding-top: 18px;
}

.news-comments-title {
    color: #172033;
    font-size: 1.04rem;
    margin: 0;
}

.news-comments-subtitle {
    color: #667789;
    font-size: .8rem;
    line-height: 1.45;
    margin: 4px 0 12px;
}

.news-comments-boundary {
    background: transparent;
    border: 0;
    color: #3d5268;
    font-size: .74rem;
    margin: 6px 0 2px;
    padding: 0;
}

.news-comments-notice,
.news-comments-status,
.news-comments-empty {
    color: #596b7d;
    font-size: .78rem;
    line-height: 1.5;
    margin: 8px 0;
}

.news-comments-notice {
    font-size: .7rem;
    margin: 2px 0 12px;
}

.news-comments-status.is-error,
.news-comments-action-status {
    color: #b42318;
}

.news-comment-create-form,
.news-comments-action-form {
    display: grid;
    flex: 1 1 auto;
    gap: 10px;
    min-width: 0;
}

.news-comment-create-form {
    align-items: center;
    display: grid;
    gap: 7px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.news-comment-create-form .news-comments-field-label {
    font-size: 0;
    grid-column: 1;
    grid-row: 1;
}

.news-comment-composer-controls {
    align-items: center;
    display: contents;
}

.news-comments-field-label {
    color: #26384a;
    display: grid;
    font-size: .82rem;
    font-weight: 700;
    gap: 6px;
}

.news-comments-textarea,
.news-comments-select {
    background: #f7f8fa;
    border: 1px solid #d8dee6;
    border-radius: 18px;
    box-sizing: border-box;
    color: #172033;
    font: inherit;
    min-height: 42px;
    padding: 9px 10px;
    width: 100%;
}

.news-comments-textarea {
    min-height: 84px;
    resize: vertical;
}

.news-comment-create-form .news-comments-textarea {
    max-height: 120px;
    min-height: 44px;
    overflow-y: auto;
    resize: none;
}

.news-comments-check {
    color: #42576b;
    font-size: .8rem;
}

.news-comment-create-form .news-comments-check {
    grid-column: 1 / -1;
    grid-row: 2;
}

.news-comment-composer {
    align-items: flex-start;
    background: rgba(255, 255, 255, .97);
    border-top: 1px solid #e7ebf0;
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding: 12px 0 4px;
    position: sticky;
    bottom: 0;
    z-index: 3;
}

.news-comment-composer.is-guest {
    align-items: center;
    background: #f7f9fc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    justify-content: space-between;
    padding: 12px;
}

.news-comment-login-copy {
    color: #526579;
    font-size: .8rem;
    line-height: 1.45;
    margin: 0;
}

.news-comments-list,
.news-comment-replies {
    list-style: none;
    margin: 0;
    padding: 0;
}

.news-comment {
    align-items: flex-start;
    display: flex;
    gap: 10px;
    padding: 14px 0 0;
    position: relative;
}

.news-comment-avatar {
    align-items: center;
    background: #e7efff;
    border-radius: 50%;
    color: #295fb4;
    display: inline-flex;
    flex: 0 0 38px;
    font-size: .86rem;
    font-weight: 800;
    height: 38px;
    justify-content: center;
    user-select: none;
    width: 38px;
}

.news-comment-composer-avatar {
    flex-basis: 34px;
    height: 34px;
    width: 34px;
}

.news-comment-main {
    flex: 1 1 auto;
    min-width: 0;
}

.news-comment-bubble {
    background: transparent;
    border-radius: 0;
    box-sizing: border-box;
    display: block;
    max-width: min(100%, 640px);
    padding: 0;
}

.news-comment-replies {
    border-left: 2px solid #e1e6ec;
    margin: 6px 0 0 10px;
    padding-left: 18px;
}

.news-comment-replies:empty {
    display: none;
}

.news-comment-reply {
    padding-top: 10px;
}

.news-comment-header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.news-comment-author {
    color: #203246;
    font-size: .84rem;
}

.news-comment-state {
    background: #edf2f7;
    border-radius: 999px;
    color: #506176;
    font-size: .68rem;
    padding: 2px 7px;
}

.news-comment-state.state-restored {
    background: #e8f7ef;
    color: #17633c;
}

.news-comment-state.state-temporarily_hidden,
.news-comment-state.state-copyright_hidden,
.news-comment-state.state-moderation_removed {
    background: #fff3df;
    color: #8a4d0f;
}

.news-comment-time {
    color: #75879a;
    font-size: .7rem;
}

.news-comment-body {
    color: #26384a;
    font-size: .86rem;
    line-height: 1.55;
    margin: 4px 0 0;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.news-comment-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 26px;
    padding: 2px 0 0;
}

.news-comment-actions,
.news-comments-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.news-comments-primary,
.news-comments-secondary,
.news-comments-more,
.news-comment-action,
.news-comments-action-close {
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    min-height: 36px;
    padding: 7px 12px;
}

.news-comments-primary {
    background: #1769d1;
    color: #fff;
    font-weight: 700;
}

.news-comment-create-form .news-comments-primary {
    align-items: center;
    display: inline-flex;
    font-size: 1.25rem;
    grid-column: 2;
    grid-row: 1;
    height: 44px;
    justify-content: center;
    min-height: 44px;
    padding: 0;
    width: 44px;
}

.news-comments-secondary,
.news-comments-more {
    background: #edf3f8;
    color: #24506e;
}

.news-comment-action {
    background: transparent;
    color: #526579;
    min-height: 28px;
    padding: 3px 5px;
}

.news-comment-action.is-danger {
    color: #a12622;
}

.news-comments-primary:focus-visible,
.news-comments-secondary:focus-visible,
.news-comments-more:focus-visible,
.news-comment-action:focus-visible,
.news-comments-action-close:focus-visible,
.news-comments-textarea:focus-visible,
.news-comments-select:focus-visible {
    outline: 3px solid #7ab7e4;
    outline-offset: 2px;
}

.news-comments-textarea:focus-visible,
.news-comments-select:focus-visible {
    background: #fff;
}

.news-comments-action-overlay {
    align-items: center;
    background: rgba(13, 24, 40, .68);
    display: flex;
    inset: 0;
    justify-content: center;
    padding:
        max(16px, env(safe-area-inset-top))
        max(16px, env(safe-area-inset-right))
        max(16px, env(safe-area-inset-bottom))
        max(16px, env(safe-area-inset-left));
    position: fixed;
    z-index: var(--z-modal, 30000);
}

.news-comments-action-dialog {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
    box-sizing: border-box;
    color: #172033;
    max-height: min(82dvh, 620px);
    overflow: auto;
    padding: 18px;
    width: min(92vw, 480px);
}

.news-comments-action-header {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.news-comments-action-title {
    font-size: 1rem;
    margin: 0;
}

.news-comments-action-close {
    background: transparent;
    color: #526478;
}

@media (max-width: 600px) {
    .news-dialog-overlay {
        align-items: stretch;
        background: #f3f6fa;
        justify-content: stretch;
        padding: 0;
    }

    .news-dialog {
        background: #fff;
        border-radius: 0;
        box-shadow: none;
        color: #1c2d40;
        height: 100%;
        max-height: none;
        max-width: none;
        padding: 0;
        transform: none;
        width: 100%;
    }

    .news-dialog-header {
        background: rgba(255, 255, 255, .98);
        border-bottom: 1px solid #dce5ef;
        box-sizing: border-box;
        justify-content: flex-start;
        margin: 0;
        min-height: 56px;
        padding: 6px 12px;
        position: sticky;
        top: 0;
    }

    .news-dialog-category {
        background: transparent;
        color: #14283d;
        font-size: 0;
        font-weight: 700;
        left: 50%;
        padding: 0;
        position: absolute;
        transform: translateX(-50%);
    }

    .news-dialog-category::before {
        content: "뉴스";
        font-size: .95rem;
    }

    .news-dialog-close {
        align-items: center;
        color: #284a70;
        display: inline-flex;
        font-size: 0;
        height: 44px;
        justify-content: center;
        order: -1;
        padding: 0;
        width: 44px;
    }

    .news-dialog-close::before {
        content: "‹";
        font-size: 2.2rem;
        font-weight: 300;
        line-height: 1;
    }

    .news-dialog-summary-section {
        background: #fff;
        border-bottom: 1px solid #dce5ef;
        padding: 18px 16px 16px;
    }

    .news-dialog-title {
        color: #172b40;
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 12px;
    }

    .news-dialog-body,
    .news-dialog-body.pending {
        background: transparent;
        border: 0;
        color: #32475d;
        font-size: .9rem;
        line-height: 1.72;
        margin: 0 0 12px;
        padding: 0;
    }

    .news-dialog-source {
        color: #6c7f91;
    }

    .news-dialog-actions {
        background: #fff;
        border-bottom: 1px solid #dce5ef;
        justify-content: flex-start;
        margin: 0;
        padding: 10px 16px;
    }

    .news-dialog-link {
        background: #eaf2fc;
        border-radius: 999px;
        color: #155ba9;
        font-size: .76rem;
        min-height: 44px;
    }

    .news-comments {
        background: #fff;
        border-top: 0;
        color: #1c2d40;
        margin: 0;
        min-height: calc(100dvh - 360px);
        padding: 16px 16px 0;
    }

    .news-comments-action-overlay {
        background: rgba(0, 0, 0, .74);
        color: #1c2d40;
        align-items: flex-end;
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }

    .news-comments-action-dialog {
        background: #fff;
        color: #1c2d40;
        max-height: calc(100dvh - env(safe-area-inset-top) - 18px);
        width: 100%;
    }
}

/* Public information cards remain available through the 767px mobile shell.
   Keep the three visible news-detail actions touchable in narrow landscape too,
   where the full-screen <=600px dialog treatment does not apply. */
@media (max-width: 767px) {
    .news-dialog-close,
    .news-dialog-link,
    .news-comments-primary {
        min-height: 44px;
    }

    .news-dialog-close {
        align-items: center;
        display: inline-flex;
        justify-content: center;
        min-width: 44px;
    }
}
