/* ==========================================================================
   News Ukraine 24 — minimal endless feed
   Left icon menu (bottom bar on phones), one centred news column, light/dark.
   ========================================================================== */

:root {
    --bg: #ffffff;
    --fg: #0b0b0c;
    --muted: #6a6a72;
    --line: #ececee;
    --line-strong: #d3d3d8;
    --surface: #f5f5f6;
    --accent: #d50000;
    --telegram: #229ed9;
    --telegram-hover: #1b88bd;

    --side: 248px;
    --col: 640px;
    --radius: 14px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;

    --nu-top: 0px;
}

:root[data-theme="dark"] {
    --bg: #101010;
    --fg: #f3f4f6;
    --muted: #8d8d96;
    --line: #262629;
    --line-strong: #3a3a3f;
    --surface: #1b1b1d;
    --accent: #ff453a;
    color-scheme: dark;
}

body.admin-bar {
    --nu-top: 32px;
}

/* Reset ------------------------------------------------------------------ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img,
video,
iframe {
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

h1,
h2,
h3 {
    margin: 0;
}

[hidden] {
    display: none !important;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.nu-skip {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 100;
    padding: 10px 14px;
    background: var(--fg);
    color: var(--bg);
    border-radius: 8px;
}

.nu-skip:focus {
    top: 12px;
}

/* Icons ------------------------------------------------------------------ */

.nu-icon {
    flex: none;
    width: 24px;
    height: 24px;
}

.nu-icon-sun {
    display: none;
}

:root[data-theme="dark"] .nu-icon-sun {
    display: block;
}

:root[data-theme="dark"] .nu-icon-moon {
    display: none;
}

.nu-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: var(--muted);
    transition: background 0.15s, color 0.15s;
}

.nu-btn-icon:hover {
    background: var(--surface);
    color: var(--fg);
}

/* Logo ------------------------------------------------------------------- */

.nu-logo {
    display: inline-block;
    line-height: 0;
}

.nu-logo img {
    display: none;
    height: 100%;
    width: auto;
}

/* Stacked logo (desktop sidebar), light/dark. */
.nu-logo .nu-lg-stacked.nu-lg-light {
    display: block;
}

:root[data-theme="dark"] .nu-logo .nu-lg-stacked.nu-lg-light {
    display: none;
}

:root[data-theme="dark"] .nu-logo .nu-lg-stacked.nu-lg-dark {
    display: block;
}

/* Wide logo (phone top bar), light/dark. */
.nu-logo-top .nu-lg-wide.nu-lg-light {
    display: block;
}

:root[data-theme="dark"] .nu-logo-top .nu-lg-wide.nu-lg-light {
    display: none;
}

:root[data-theme="dark"] .nu-logo-top .nu-lg-wide.nu-lg-dark {
    display: block;
}

.nu-logo-side {
    height: 72px;
}

.nu-logo-top {
    height: 28px;
}

/* App shell -------------------------------------------------------------- */

.nu-app {
    display: grid;
    grid-template-columns: var(--side) minmax(0, 1fr);
    min-height: 100vh;
}

.nu-topbar {
    display: none;
}

.nu-side {
    position: sticky;
    top: var(--nu-top);
    align-self: start;
    grid-column: 1;
    grid-row: 1 / span 2;
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--nu-top));
    padding: 24px 14px 18px;
    border-right: 1px solid var(--line);
    overflow-y: auto;
}

.nu-main {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    padding: 28px 24px 96px;
}

.nu-col {
    max-width: var(--col);
    margin: 0 auto;
}

/* Left menu -------------------------------------------------------------- */

.nu-side-brand {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0 12px 22px;
}

.nu-side-close,
.nu-menu-btn,
.nu-mark {
    display: none;
}

.nu-mark {
    line-height: 0;
}

.nu-mark img {
    display: block;
    width: 40px;
    height: 40px;
}

.nu-mark-dark {
    display: none !important;
}

:root[data-theme="dark"] .nu-mark-light {
    display: none !important;
}

:root[data-theme="dark"] .nu-mark-dark {
    display: block !important;
}

.nu-nav ul {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nu-nav-link,
.nu-theme-toggle {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    color: var(--muted);
    font-size: 17px;
    transition: background 0.15s, color 0.15s;
}

.nu-nav-link:hover,
.nu-theme-toggle:hover {
    background: var(--surface);
    color: var(--fg);
}

.nu-nav-link.is-current {
    background: var(--surface);
    color: var(--fg);
    font-weight: 700;
    box-shadow: inset 3px 0 0 var(--accent);
}

.nu-side-foot {
    margin-top: auto;
    padding-top: 18px;
}

.nu-theme-toggle {
    font-size: 15px;
}

.nu-subscribe {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-bottom: 10px;
    padding: 12px;
    border-radius: 12px;
    background: var(--telegram);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    transition: background 0.15s;
}

.nu-subscribe:hover {
    background: var(--telegram-hover);
}

.nu-social {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

/* Search overlay --------------------------------------------------------- */

.nu-search {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 12vh 20px 20px;
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nu-search-form {
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(640px, 100%);
    padding: 6px 6px 6px 18px;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    background: var(--bg);
    color: var(--muted);
}

.nu-search-input {
    flex: 1;
    min-width: 0;
    padding: 12px 0;
    border: 0;
    outline: 0;
    background: none;
    color: var(--fg);
    font: inherit;
    font-size: 20px;
}

.nu-search-input::-webkit-search-cancel-button {
    display: none;
}

/* Category chips --------------------------------------------------------- */

.nu-chips {
    position: sticky;
    top: var(--nu-top);
    z-index: 10;
    display: flex;
    gap: 8px;
    margin: -28px -24px 8px;
    padding: 28px 24px 14px;
    overflow-x: auto;
    background: var(--bg);
    scrollbar-width: none;
}

.nu-chips::-webkit-scrollbar {
    display: none;
}

.nu-chip {
    flex: none;
    padding: 8px 16px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    color: var(--fg);
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.nu-chip:hover {
    background: var(--surface);
}

.nu-chip.is-current {
    background: var(--fg);
    border-color: var(--fg);
    color: var(--bg);
}

/* Headings --------------------------------------------------------------- */

.nu-heading {
    padding: 12px 0 8px;
    border-bottom: 1px solid var(--line);
}

.nu-heading h1 {
    font-size: 28px;
    line-height: 1.2;
    letter-spacing: -0.015em;
}

.nu-heading-desc {
    margin: 8px 0 14px;
    color: var(--muted);
}

.nu-heading-desc p {
    margin: 0;
}

/* Feed ------------------------------------------------------------------- */

.nu-item {
    padding: 26px 0;
    border-bottom: 1px solid var(--line);
}

.nu-feed > .nu-item:first-child {
    padding-top: 12px;
}

.nu-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    color: var(--muted);
    font-size: 14px;
}

.nu-cat:hover {
    color: var(--accent);
}

.nu-title {
    margin-top: 8px;
    font-size: 23px;
    line-height: 1.27;
    font-weight: 750;
    letter-spacing: -0.012em;
    text-wrap: balance;
}

.nu-title a:hover {
    color: var(--accent);
}

.nu-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 16.5px;
    line-height: 1.55;
}

.nu-media {
    display: block;
    margin-top: 16px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    aspect-ratio: 16 / 9;
}

.nu-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

:root[data-theme="dark"] .nu-media img,
:root[data-theme="dark"] .nu-article-media img {
    filter: brightness(0.92);
}

.nu-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    font-weight: 600;
    transition: background 0.15s;
}

.nu-more:hover {
    background: var(--surface);
}

.nu-pager {
    display: flex;
    justify-content: center;
    padding: 28px 0;
}

.nu-sentinel {
    height: 1px;
}

.nu-sentinel.is-loading {
    height: 48px;
    background: radial-gradient(circle, var(--muted) 0 3px, transparent 4px) center / 18px 18px repeat-x;
    animation: nu-pulse 1s ease-in-out infinite;
}

@keyframes nu-pulse {
    50% {
        opacity: 0.25;
    }
}

.nu-end,
.nu-empty {
    padding: 36px 0;
    text-align: center;
    color: var(--muted);
}

/* Article ---------------------------------------------------------------- */

.nu-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 15px;
}

.nu-back .nu-icon {
    width: 20px;
    height: 20px;
}

.nu-back:hover {
    color: var(--fg);
}

.nu-article-title {
    margin-top: 10px;
    font-size: 34px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.nu-article-media {
    margin: 22px 0 0;
}

.nu-article-media img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
}

.nu-article-media figcaption {
    margin-top: 8px;
    color: var(--muted);
    font-size: 14px;
}

.nu-prose {
    margin-top: 26px;
    font-size: 18.5px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.nu-prose > * {
    margin: 0 0 1.1em;
}

.nu-prose h2,
.nu-prose h3 {
    margin: 1.6em 0 0.6em;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.nu-prose h2 {
    font-size: 1.45em;
}

.nu-prose h3 {
    font-size: 1.2em;
}

.nu-prose a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.nu-prose img,
.nu-prose video {
    height: auto;
    border-radius: 12px;
}

.nu-prose blockquote {
    margin: 1.7em 0;
    padding: 2px 0 2px 22px;
    border-left: 2px solid var(--muted);
    color: var(--fg);
    font-size: 0.97em;
    line-height: 1.65;
}

.nu-prose blockquote > * {
    margin: 0 0 0.8em;
}

.nu-prose blockquote > :last-child {
    margin-bottom: 0;
}

.nu-prose blockquote + blockquote {
    margin-top: 1.2em;
}

.nu-prose blockquote cite,
.nu-prose blockquote footer {
    display: block;
    margin-top: 0.8em;
    color: var(--muted);
    font-size: 0.82em;
    font-style: normal;
    letter-spacing: 0.01em;
}

.nu-prose blockquote a {
    color: inherit;
}

.nu-prose ul,
.nu-prose ol {
    padding-left: 1.4em;
    list-style: revert;
}

/* Follow block at the end of every article */

.nu-follow {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.nu-follow-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
}

.nu-follow-title {
    margin: 0;
    font-size: 21px;
    font-weight: 750;
    letter-spacing: -0.01em;
}

.nu-follow-btn {
    display: inline-flex;
    align-items: center;
    padding: 11px 26px;
    border-radius: 10px;
    background: var(--telegram);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    transition: background 0.15s;
}

.nu-follow-btn:hover {
    background: var(--telegram-hover);
}

.nu-follow .nu-social {
    flex-direction: row;
    margin: 12px 0 0 -10px;
    padding: 0;
    border: 0;
}

/* Freshness note above an article */

.nu-fresh {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
}

/* While the "new articles" pill is up it sits in this slot, above the header. */
.nu-fresh.is-covered {
    visibility: hidden;
}

.nu-fresh a {
    color: var(--accent);
    font-weight: 600;
}

.nu-fresh a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Footer ----------------------------------------------------------------- */

.nu-foot {
    max-width: var(--col);
    margin: 48px auto 0;
    color: var(--muted);
    font-size: 14px;
}

.nu-foot-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-bottom: 10px;
}

.nu-foot-links a:hover {
    color: var(--fg);
}

.nu-foot-copy {
    margin: 0;
}

/* Back to top ------------------------------------------------------------ */

.nu-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: var(--bg);
    box-shadow: 0 4px 16px rgb(0 0 0 / 12%);
}

/* Tablet: icon rail ------------------------------------------------------ */

@media (max-width: 1099px) {
    :root {
        --side: 76px;
    }

    .nu-side {
        align-items: center;
        padding-left: 8px;
        padding-right: 8px;
    }

    .nu-side-brand {
        padding: 0 0 20px;
    }

    .nu-logo-side {
        height: 30px;
    }

    .nu-nav-label {
        display: none;
    }

    .nu-nav-link,
    .nu-theme-toggle,
    .nu-subscribe {
        justify-content: center;
        padding: 14px;
    }

    .nu-nav-link.is-current {
        box-shadow: none;
    }

    .nu-side .nu-social {
        flex-direction: column;
        align-items: center;
    }
}

/* Phone: top bar + slide-in drawer -------------------------------------- */

@media (max-width: 767px) {
    :root {
        --nu-top: 56px;
    }

    body.admin-bar {
        --nu-top: 102px;
    }

    .nu-app {
        display: block;
    }

    .nu-topbar {
        position: sticky;
        top: calc(var(--nu-top) - 56px);
        z-index: 30;
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 56px;
        padding: 0 12px;
        background: var(--bg);
        border-bottom: 1px solid var(--line);
    }

    .nu-topbar-actions {
        display: flex;
        gap: 2px;
    }

    .nu-menu-btn {
        display: inline-flex;
    }

    /* The sidebar becomes an off-canvas drawer. */
    .nu-side {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 70;
        align-items: stretch;
        align-self: auto;
        width: min(300px, 86vw);
        height: 100vh;
        height: 100dvh;
        padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
        border-right: 1px solid var(--line);
        background: var(--bg);
        overflow-y: auto;
        transform: translateX(-102%);
        visibility: hidden;
        transition: transform 0.22s ease, visibility 0s linear 0.22s;
    }

    .nu-side.is-open,
    .nu-side:target {
        transform: none;
        visibility: visible;
        transition: transform 0.22s ease;
        box-shadow: 0 0 40px rgb(0 0 0 / 30%);
    }

    .nu-backdrop {
        position: fixed;
        inset: 0;
        z-index: 65;
        background: rgb(0 0 0 / 45%);
    }

    .nu-side-brand {
        padding: 0 0 16px 8px;
    }

    /* The drawer shows the wide logo too. */
    .nu-logo-side {
        height: 30px;
    }

    .nu-logo-side .nu-lg-stacked {
        display: none !important;
    }

    .nu-logo-side .nu-lg-wide.nu-lg-light {
        display: block;
    }

    :root[data-theme="dark"] .nu-logo-side .nu-lg-wide.nu-lg-light {
        display: none;
    }

    :root[data-theme="dark"] .nu-logo-side .nu-lg-wide.nu-lg-dark {
        display: block;
    }

    .nu-side-close {
        display: inline-flex;
    }

    .nu-nav-label {
        display: inline;
    }

    .nu-nav-link,
    .nu-theme-toggle {
        justify-content: flex-start;
        padding: 13px 12px;
    }

    .nu-nav-link.is-current {
        box-shadow: inset 3px 0 0 var(--accent);
    }

    .nu-subscribe {
        justify-content: flex-start;
    }

    .nu-side .nu-social {
        flex-direction: row;
        align-items: center;
    }

    .nu-lang-current {
        justify-content: flex-start;
        padding: 8px 10px;
    }

    .nu-lang-name,
    .nu-lang-chevron {
        display: initial;
    }

    .nu-lang-chevron {
        display: block;
    }

    .nu-lang-list {
        left: 0;
        right: 0;
        bottom: calc(100% - 6px);
        min-width: 0;
        margin-left: 0;
    }

    .nu-main {
        padding: 0 12px 64px;
    }

    .nu-chips {
        margin: 0 -12px 4px;
        padding: 14px 12px 12px;
        top: calc(var(--nu-top));
    }

    .nu-title {
        font-size: 21px;
    }

    .nu-excerpt {
        font-size: 16px;
    }

    .nu-article-title {
        font-size: 27px;
    }

    .nu-prose {
        font-size: 17.5px;
    }

    .nu-media,
    .nu-article-media img {
        border-radius: 12px;
    }

    /* The round back-to-top button is desktop only; phones use the dock. */
    .nu-top {
        display: none;
    }

    .nu-heading {
        padding-top: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .nu-sentinel.is-loading {
        animation: none;
    }
}

/* New articles pill ------------------------------------------------------ */

.nu-new-wrap {
    position: sticky;
    top: calc(var(--nu-top) + 60px);
    z-index: 12;
    height: 0;
    text-align: center;
    pointer-events: none;
}

.nu-new {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px 10px 14px;
    border-radius: 999px;
    background: var(--fg);
    color: var(--bg);
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 6px 22px rgb(0 0 0 / 22%);
    animation: nu-pill-in 0.25s ease-out;
}

.nu-new .nu-icon {
    width: 18px;
    height: 18px;
    stroke-width: 2.4;
}

.nu-new:disabled {
    opacity: 0.6;
    cursor: progress;
}

@keyframes nu-pill-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
}

/* Language switcher ------------------------------------------------------ */

.nu-lang {
    position: relative;
    margin-top: 6px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.nu-lang-current {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 12px;
    cursor: pointer;
    list-style: none;
    font-size: 16px;
}

.nu-lang-current::-webkit-details-marker {
    display: none;
}

.nu-lang-current:hover,
.nu-lang[open] > .nu-lang-current {
    background: var(--surface);
}

.nu-lang-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    padding: 3px 6px;
    border-radius: 6px;
    background: var(--surface);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.nu-lang-name {
    flex: 1;
}

.nu-lang-chevron {
    width: 18px;
    height: 18px;
    color: var(--muted);
    transition: transform 0.15s;
}

.nu-lang[open] .nu-lang-chevron {
    transform: rotate(180deg);
}

.nu-lang-list {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% - 6px);
    z-index: 40;
    padding: 6px;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: var(--bg);
    box-shadow: 0 10px 30px rgb(0 0 0 / 16%);
}

.nu-lang-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
    border-radius: 10px;
    font-size: 15px;
}

.nu-lang-list a:hover {
    background: var(--surface);
}

.nu-lang-list a[aria-current] {
    font-weight: 700;
}

.nu-lang-list a[aria-current] .nu-lang-code {
    background: var(--fg);
    color: var(--bg);
}

/* Rail: compact language switcher */

@media (max-width: 1099px) and (min-width: 768px) {
    .nu-lang {
        width: 100%;
    }

    .nu-lang-current {
        justify-content: center;
        padding: 8px 0;
    }

    .nu-lang-name,
    .nu-lang-chevron {
        display: none;
    }

    .nu-lang-list {
        left: 100%;
        right: auto;
        bottom: 0;
        min-width: 190px;
        margin-left: 8px;
    }

    .nu-side {
        overflow-y: visible;
    }
}

/* Reading mode: article pages collapse the menu into the same icon rail
   that tablets use (desktop widths only; narrower screens already have it). */

@media (min-width: 1100px) {
    body.nu-reading .nu-app {
        --side: 76px;
    }

    body.nu-reading .nu-side {
        align-items: center;
        padding-left: 8px;
        padding-right: 8px;
        overflow-y: visible;
    }

    body.nu-reading .nu-side-brand {
        justify-content: center;
        padding: 0 0 20px;
    }

    body.nu-reading .nu-logo-side {
        display: none;
    }

    body.nu-reading .nu-mark {
        display: block;
    }

    body.nu-reading .nu-nav-label {
        display: none;
    }

    body.nu-reading .nu-nav-link,
    body.nu-reading .nu-theme-toggle,
    body.nu-reading .nu-subscribe {
        justify-content: center;
        padding: 14px;
    }

    body.nu-reading .nu-nav-link.is-current {
        box-shadow: none;
    }

    body.nu-reading .nu-side .nu-social {
        flex-direction: column;
        align-items: center;
    }

    body.nu-reading .nu-lang {
        width: 100%;
    }

    body.nu-reading .nu-lang-current {
        justify-content: center;
        padding: 8px 0;
    }

    body.nu-reading .nu-lang-name,
    body.nu-reading .nu-lang-chevron {
        display: none;
    }

    body.nu-reading .nu-lang-list {
        left: 100%;
        right: auto;
        bottom: 0;
        min-width: 190px;
        margin-left: 8px;
    }
}

/* Short windows: let the rail scroll instead of spilling off screen. */
@media (min-width: 768px) and (max-height: 720px) {
    .nu-side {
        overflow-y: auto;
    }
}

/* Tablet rail uses the compact mark too */
@media (min-width: 768px) and (max-width: 1099px) {
    .nu-side-brand {
        justify-content: center;
    }

    .nu-logo-side {
        display: none;
    }

    .nu-mark {
        display: block;
    }
}

@media (max-width: 767px) {
    .nu-new-wrap {
        top: calc(var(--nu-top) + 64px);
    }
}

/* Endless articles ------------------------------------------------------- */

.nu-article + .nu-article {
    margin-top: 24px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.nu-next {
    display: flex;
    justify-content: center;
    padding: 36px 0;
    text-align: center;
}

.nu-next .nu-more {
    max-width: 100%;
}

/* On article pages there are no chips, so the pill sits closer to the top. */
.nu-reading .nu-new-wrap {
    top: calc(var(--nu-top) + 14px);
}

/* News list next to an article --------------------------------------------- */

.nu-panel {
    display: none;
}

.nu-stream {
    overflow-anchor: none;
}

@media (min-width: 1100px) {
    body.nu-reading {
        --col: 700px;
    }

    body.nu-reading .nu-app {
        --panel: 340px;
        grid-template-columns: var(--side) var(--panel) minmax(0, 1fr);
    }

    body.nu-reading .nu-main {
        grid-column: 3;
    }

    body.nu-reading .nu-panel {
        position: sticky;
        top: var(--nu-top);
        align-self: start;
        grid-column: 2;
        grid-row: 1 / span 2;
        display: block;
        height: calc(100vh - var(--nu-top));
        padding: 0 20px 0 28px;
        border-right: 1px solid var(--line);
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: var(--line-strong) transparent;
    }
}

@media (min-width: 1100px) and (max-width: 1279px) {
    body.nu-reading .nu-app {
        --panel: 300px;
    }
}

.nu-pitem {
    position: relative;
    display: block;
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
}

.nu-pitem time {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 13px;
}

.nu-ptitle {
    display: block;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.005em;
}

.nu-pitem:hover .nu-ptitle {
    color: var(--accent);
}

/* The article being read: a bar on the panel's left edge, like the reference. */
.nu-pitem.is-active::before {
    content: "";
    position: absolute;
    top: 14px;
    bottom: 14px;
    left: -28px;
    width: 3px;
    border-radius: 2px;
    background: var(--fg);
}

.nu-pitem.is-active .nu-ptitle {
    font-weight: 750;
}

/* Phone dock ---------------------------------------------------------------- */

.nu-dock {
    display: none;
}

@media (max-width: 767px) {
    .nu-dock {
        position: fixed;
        left: 50%;
        bottom: calc(14px + env(safe-area-inset-bottom));
        z-index: 25;
        display: flex;
        gap: 4px;
        padding: 6px;
        border: 1px solid var(--line-strong);
        border-radius: 999px;
        background: color-mix(in srgb, var(--bg) 92%, transparent);
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
        box-shadow: 0 8px 28px rgb(0 0 0 / 18%);
        transform: translate(-50%, calc(100% + 40px));
        transition: transform 0.25s ease;
    }

    .nu-dock.is-visible {
        transform: translate(-50%, 0);
    }

    .nu-dock-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 64px;
        height: 46px;
        border-radius: 999px;
        color: var(--fg);
        -webkit-tap-highlight-color: transparent;
    }

    .nu-dock-btn:active {
        background: var(--surface);
    }
}

@media (prefers-reduced-motion: reduce) {
    .nu-dock {
        transition: none;
    }
}

/* Phones: tighter vertical rhythm between and inside articles. */
@media (max-width: 767px) {
    .nu-article + .nu-article {
        margin-top: 20px;
        padding-top: 20px;
    }

    .nu-follow {
        margin-top: 24px;
        padding-top: 16px;
    }

    .nu-prose {
        margin-top: 18px;
    }

    .nu-article-media {
        margin-top: 14px;
    }
}
