.container.news-active {
    max-width: 760px;
}

.container.news-active.news-reading {
    height: auto;
    min-height: calc(100dvh - 2rem);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: visible;
}

#page-topic.news-reading.active {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: flex-start;
    min-height: auto;
    height: auto;
    padding-top: 3.25rem;
    padding-bottom: 0;
}

#page-topic.news-reading .topic-panel,
#page-topic.news-reading .practice-mode-tabs {
    display: none;
}

.topic-grid.news-grid {
    display: block;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem);
}

#page-topic.news-reading .topic-grid.news-grid {
    flex: 1;
    min-height: auto;
    padding-bottom: 0;
}

.news-reader {
    width: 100%;
}

.news-reader.is-reading {
    height: auto;
    min-height: auto;
    display: flex;
    flex-direction: column;
}

.news-reader:not(.is-reading) .news-reader-header,
.news-reader:not(.is-reading) .news-digest,
.news-reader.is-reading .news-setup {
    display: none;
}

.news-setup {
    display: grid;
}

.news-filters,
.news-settings {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.7rem;
    margin-bottom: 0.85rem;
}

.news-field,
.news-setting {
    min-width: 0;
    border: 0;
}

.news-field-label {
    display: block;
    margin: 0 0 0.35rem;
    color: #6b625e;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.news-select {
    width: 100%;
    min-height: 44px;
    padding: 0.55rem 2rem 0.55rem 0.7rem;
    border: 2px solid #ded7d2;
    border-radius: 8px;
    background: #fff;
    color: #2d3436;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 750;
}

.news-select:focus-visible,
.news-segment:focus-visible,
.news-resume:focus-visible,
.news-reader-back:focus-visible,
.news-nav-button:focus-visible,
.news-retry:focus-visible,
.news-word:focus-visible,
.news-translation-speak:focus-visible,
.news-translation-close:focus-visible,
.news-source:focus-visible {
    outline: 3px solid rgba(0, 184, 148, 0.3);
    outline-offset: 2px;
}

.news-select:disabled {
    background: #f5f2f0;
    color: #9a918c;
}

.news-segments {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
}

.news-segment {
    min-width: 0;
    min-height: 40px;
    padding: 0.35rem 0.25rem;
    border: 2px solid #ded7d2;
    border-radius: 8px;
    background: #fff;
    color: #625b57;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 850;
    cursor: pointer;
}

.news-segment.active {
    border-color: #00a98f;
    background: #e9f9f5;
    color: #087966;
}

.news-resume {
    justify-self: center;
    min-height: 44px;
    margin-top: 0.2rem;
    padding: 0.55rem 1rem;
    border: 0;
    border-radius: 8px;
    background: #087966;
    color: #fff;
    font: inherit;
    font-weight: 850;
    cursor: pointer;
}

.news-resume[hidden] {
    display: none;
}

.news-reader-header {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 0.2rem 0.75rem;
    align-items: center;
    margin-bottom: 0.7rem;
}

.news-reader-back {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid #ded7d2;
    border-radius: 50%;
    background: #fff;
    color: #4d5fb8;
    font: inherit;
    font-size: 1.15rem;
    font-weight: 900;
    cursor: pointer;
}

.news-reader-meta {
    min-width: 0;
}

.news-reader-title {
    display: block;
    color: #273235;
    font-size: 0.94rem;
    font-weight: 900;
}

.news-reader-status {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.65rem;
    align-items: center;
    margin-top: 0.08rem;
}

.news-edition-updated {
    color: #8b817b;
    font-size: 0.68rem;
    font-weight: 750;
}

.news-article-progress {
    grid-column: 1 / -1;
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: #eee8e4;
}

.news-article-progress-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #00b894, #6c5ce7);
    transition: width 0.2s ease;
}

.news-loading,
.news-error,
.news-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-height: 9rem;
    padding: 1.2rem;
    color: #6b625e;
    text-align: center;
}

.news-reader.is-reading .news-loading,
.news-reader.is-reading .news-error,
.news-reader.is-reading .news-empty {
    flex: 1;
    min-height: 0;
    border: 2px solid rgba(108, 92, 231, 0.18);
    border-radius: 8px;
    background: #fffefd;
}

.news-loading-copy {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    text-align: left;
}

.news-loading-copy span {
    font-size: 0.76rem;
}

.news-spinner {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border: 3px solid #dceee9;
    border-top-color: #00a98f;
    border-radius: 50%;
    animation: news-spin 0.8s linear infinite;
}

@keyframes news-spin {
    to { transform: rotate(360deg); }
}

.news-error {
    flex-direction: column;
}

.news-retry {
    min-height: 42px;
    padding: 0.5rem 0.9rem;
    border: 0;
    border-radius: 8px;
    background: #087966;
    color: #fff;
    font: inherit;
    font-weight: 850;
    cursor: pointer;
}

.news-stale {
    margin: 0 0 0.7rem;
    padding: 0.6rem 0.7rem;
    border-left: 3px solid #f0a43b;
    background: #fff8e8;
    color: #695b3c;
    font-size: 0.76rem;
    line-height: 1.4;
}

.news-digest {
    flex: 0 0 auto;
    min-height: auto;
    display: flex;
    flex-direction: column;
}

.news-story-list,
.news-story-carousel {
    flex: 0 0 auto;
    min-height: auto;
    display: grid;
    grid-template-rows: auto auto;
    gap: 0.75rem;
}

.news-story-nav {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    justify-content: center;
}

.news-nav-button {
    width: 58px;
    height: 58px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #4d5fb8;
    box-shadow: 0 7px 20px rgba(77, 95, 184, 0.16);
    font: inherit;
    font-size: 1.2rem;
    font-weight: 900;
    cursor: pointer;
}

.news-nav-button:disabled {
    color: #aaa19c;
    cursor: default;
    opacity: 0.55;
}

.news-story-frame {
    display: flex;
    min-height: auto;
    overflow-y: visible;
    touch-action: pan-y;
}

.news-story {
    width: 100%;
    min-height: 0;
    padding: clamp(1.1rem, 3vw, 1.7rem);
    border: 2px solid rgba(108, 92, 231, 0.22);
    border-radius: 8px;
    background: #fffefd;
    box-shadow: 0 8px 24px rgba(58, 45, 38, 0.08);
}

.news-story-title {
    margin: 0;
    color: #273235;
    font-size: clamp(1.15rem, 2.8vw, 1.42rem);
    font-weight: 900;
    line-height: 1.3;
    letter-spacing: 0;
}

.news-story-meta {
    margin: 0.45rem 0 1.1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee8e4;
    color: #8b817b;
    font-size: 0.72rem;
    font-weight: 750;
    line-height: 1.35;
}

.news-story-body {
    display: grid;
    gap: 0.95rem;
}

.news-sentence {
    margin: 0;
    color: #3c4547;
    font-size: 1rem;
    font-weight: 520;
    line-height: 1.72;
}

.news-word {
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    border-bottom: 1px dotted transparent;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.news-word:hover,
.news-word.selected {
    border-bottom-color: #00a98f;
    color: #087966;
}

.news-source {
    display: inline-block;
    margin-top: 0.7rem;
    color: #4d5fb8;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.news-word-popover {
    position: fixed;
    z-index: 40;
    display: grid;
    gap: 0.45rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid #b9e5da;
    border-radius: 8px;
    background: rgba(246, 255, 252, 0.98);
    box-shadow: 0 12px 34px rgba(30, 93, 79, 0.22);
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
}

.news-word-popover[hidden] {
    display: none;
}

.news-translation-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.news-translation-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 0.35rem;
    align-items: center;
}

.news-translation-word {
    color: #087966;
    font-size: 0.86rem;
    overflow-wrap: anywhere;
}

.news-translation-speak,
.news-translation-close {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border: 0;
    border-radius: 999px;
    background: #e9f4f1;
    color: #087966;
    font: inherit;
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.news-translation-speak {
    background: #fff;
    border: 1px solid #cfe5df;
    font-size: 0.9rem;
}

.news-translation-speak.speaking {
    border-color: #00a98f;
    background: #dff7f1;
}

.news-translation-result,
.news-translation-error {
    min-width: 0;
    color: #273235;
    font-size: 1.18rem;
    font-weight: 800;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.news-translation-error {
    color: #b44538;
}

.news-translation-content {
    display: grid;
    gap: 0.55rem;
}

.news-translation-detail {
    display: grid;
    gap: 0.2rem;
}

.news-translation-detail-label {
    color: #827873;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.news-translation-chip {
    justify-self: start;
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    background: #e9f4f1;
    color: #087966;
    font-size: 0.75rem;
    font-weight: 850;
}

.news-translation-forms {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.news-translation-form {
    display: inline-flex;
    gap: 0.25rem;
    align-items: baseline;
    padding: 0.22rem 0.45rem;
    border: 1px solid #e4ded9;
    border-radius: 8px;
    background: #fff;
    font-size: 0.75rem;
    font-weight: 800;
}

.news-translation-form-label {
    color: #827873;
}

.news-translation-form-value,
.news-translation-muted {
    color: #3c4547;
}

.news-translation-muted {
    font-size: 0.78rem;
    font-weight: 750;
    line-height: 1.35;
}

.news-translation-status,
.news-login-link {
    color: #6b625e;
    font-size: 0.68rem;
    line-height: 1.35;
}

.news-login-link {
    color: #4d5fb8;
    font-weight: 800;
}

@media (max-width: 560px) {
    .container.news-active.news-reading {
        height: auto;
        min-height: 100dvh;
    }

    #page-topic.news-reading.active {
        min-height: auto;
        height: auto;
        padding-top: 3.25rem;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 0.75rem);
    }

    .practice-mode-tabs {
        grid-template-columns: 1fr 1fr;
        max-width: 100%;
    }

    .news-filters,
    .news-settings {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .news-story {
        padding: 1rem;
    }

    .news-story-title {
        font-size: 1.15rem;
    }

    .news-sentence {
        font-size: 0.96rem;
    }

    .news-word-popover {
        padding: 0.75rem 0.8rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .news-spinner { animation-duration: 1.8s; }
}
