:root {
    --bg: #f7f8fb;
    --text: #17191f;
    --muted: #5d6472;
    --accent: #b4232a;
    --secondary: #126c72;
    --card: #ffffff;
    --line: #d9dde7;
}

[data-theme="dark"] {
    --bg: #12151b;
    --text: #f3efe7;
    --muted: #b8bfca;
    --accent: #ff6f61;
    --secondary: #62c7bd;
    --card: #1b2029;
    --line: #2e3541;
}

* { box-sizing: border-box; }

html {
    overflow-x: hidden;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    overflow-x: hidden;
    padding-top: var(--site-header-offset, 4.7rem);
}

[data-theme="dark"] body { background: var(--bg); }

[data-theme="dark"] .site-header.is-scrolled {
    box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
}

[data-theme="dark"] .brand {
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, .78);
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .18);
    padding: .22rem .38rem;
}

[data-theme="dark"] .empty-state,
[data-theme="dark"] .community-note,
[data-theme="dark"] .community-heading span,
[data-theme="dark"] .comment-card time {
    color: var(--muted);
}

.container {
    width: min(1100px, calc(100% - 2rem));
    margin: 0 auto;
}

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

.flash-message {
    align-items: center;
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(19, 35, 59, .08);
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(19, 35, 59, .18);
    color: #13233b;
    display: grid;
    gap: .25rem;
    grid-template-columns: 3rem minmax(0, 1fr);
    margin: 0;
    max-width: min(360px, calc(100vw - 2rem));
    min-height: 5.4rem;
    padding: 1rem 1.1rem;
    position: fixed;
    right: 1rem;
    top: 5.25rem;
    z-index: 30;
    animation: flashMessageIn .16s ease-out, flashMessageOut .22s ease-in 2.8s forwards;
}

.flash-message:popover-open {
    inset: 5.25rem 1rem auto auto;
}

.flash-message::backdrop {
    background: transparent;
}

.flash-message strong,
.flash-message span:not(.flash-icon) {
    grid-column: 2;
    min-width: 0;
}

.flash-message strong {
    font: 900 1rem/1.15 "Trebuchet MS", "Segoe UI", sans-serif;
}

.flash-message span:not(.flash-icon) {
    color: #5d6472;
    font-size: .86rem;
    font-weight: 800;
    line-height: 1.35;
}

.flash-icon {
    align-items: center;
    align-self: center;
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-weight: 900;
    grid-column: 1;
    grid-row: 1 / span 2;
    height: 2.45rem;
    justify-content: center;
    width: 2.45rem;
}

.flash-icon::before {
    font-size: 1.15rem;
    line-height: 1;
}

.flash-message.success {
    border-top: 4px solid var(--secondary);
}

.flash-message.info {
    border-top: 4px solid #c89435;
}

.flash-message.error {
    border-top: 4px solid var(--accent);
}

.flash-message.success .flash-icon {
    background: var(--secondary);
    box-shadow: 0 10px 24px rgba(18, 108, 114, .28);
}

.flash-message.info .flash-icon {
    background: #c89435;
    box-shadow: 0 10px 24px rgba(200, 148, 53, .28);
}

.flash-message.error .flash-icon {
    background: var(--accent);
    box-shadow: 0 10px 24px rgba(180, 35, 42, .28);
}

.flash-message.success .flash-icon::before,
.flash-message.info .flash-icon::before {
    content: "✓";
}

.flash-message.error .flash-icon::before {
    content: "!";
}

.flash-message.is-hidden {
    display: none;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes flashMessageOut {
    to {
        opacity: 0;
        transform: translateY(-8px);
        visibility: hidden;
    }
}

.site-header {
    border-bottom: 1px solid var(--line);
    background: var(--card);
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
    z-index: 10;
}

.site-header.is-scrolled {
    background: var(--card);
    border-color: var(--line);
    box-shadow: 0 6px 18px rgba(19, 35, 59, .06);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    transition: padding .2s ease;
}

.site-header.is-scrolled .header-inner {
    padding: .48rem 0;
}

.brand {
    display: inline-flex;
    flex: 0 0 auto;
    height: 3.25rem;
    text-decoration: none;
    transition: height .2s ease, opacity .2s ease;
}

.brand:hover,
.brand:focus-visible {
    opacity: .82;
    outline: 0;
}

.brand img {
    display: block;
    height: 100%;
    max-width: min(18rem, 48vw);
    object-fit: contain;
    object-position: left center;
}

.site-header.is-scrolled .brand {
    height: 2.55rem;
}

.search-form {
    display: flex;
    flex: 0 1 320px;
    justify-content: flex-end;
    gap: .5rem;
}

.header-actions {
    align-items: center;
    display: flex;
    gap: .6rem;
    justify-content: flex-end;
    margin-left: auto;
}

.site-header .header-actions .header-auth-button {
    align-items: center;
    background-color: #13233b;
    border: 1px solid #13233b;
    color: #ffffff;
    display: inline-flex;
    justify-content: center;
    min-height: 2.5rem;
    padding: .55rem .95rem;
}

.site-header .header-actions .header-auth-button:hover,
.site-header .header-actions .header-auth-button:focus-visible {
    background-color: #0f1b2d;
    border-color: #0f1b2d;
    color: #ffffff;
}

.user-menu {
    position: relative;
}

.site-header .header-actions .user-menu-trigger {
    background: linear-gradient(180deg, #ffffff, #f6f8fb);
    border: 1px solid #d9e0eb;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(19, 35, 59, .06);
    color: #172941;
    cursor: pointer;
    gap: .55rem;
    list-style: none;
    padding: .25rem .65rem .25rem .25rem;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.site-header .header-actions .user-menu-trigger:hover,
.site-header .header-actions .user-menu-trigger:focus-visible,
.user-menu[open] .user-menu-trigger {
    background: #ffffff;
    border-color: #aebed2;
    box-shadow: 0 5px 16px rgba(19, 35, 59, .12);
    color: #172941;
    outline: 0;
}

.user-menu-trigger::-webkit-details-marker {
    display: none;
}

.user-avatar {
    align-items: center;
    background: linear-gradient(145deg, #b4232a, #8f1b28);
    border-radius: 50%;
    color: #ffffff;
    display: inline-flex;
    flex: 0 0 1.85rem;
    font-size: .76rem;
    font-weight: 900;
    height: 1.85rem;
    justify-content: center;
    letter-spacing: .02em;
}

.user-menu-name {
    display: inline-block;
    font-size: .87rem;
    font-weight: 800;
    max-width: 13.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-chevron {
    flex: 0 0 auto;
    height: .85rem;
    opacity: .66;
    transition: transform .2s ease;
    width: .85rem;
}

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

.user-menu-panel {
    background: #ffffff;
    border: 1px solid rgba(19, 35, 59, .12);
    border-radius: 10px;
    box-shadow: 0 14px 36px rgba(19, 35, 59, .16);
    display: grid;
    gap: .25rem;
    min-width: 10rem;
    padding: .4rem;
    position: absolute;
    right: 0;
    top: calc(100% + .5rem);
    z-index: 14;
}

.user-menu-panel form {
    margin: 0;
}

.user-menu-panel a,
.user-menu-panel button {
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: #13233b;
    cursor: pointer;
    display: block;
    font: inherit;
    font-weight: 800;
    padding: .65rem .75rem;
    text-align: left;
    text-decoration: none;
    width: 100%;
}

.user-menu-panel .user-menu-logout {
    align-items: center;
    display: flex;
    gap: .65rem;
}

.user-menu-logout svg {
    height: 1.1rem;
    width: 1.1rem;
}

.user-menu-panel a:hover,
.user-menu-panel button:hover,
.user-menu-panel a:focus-visible,
.user-menu-panel button:focus-visible {
    background: rgba(19, 35, 59, .08);
    outline: 0;
}

.reader-tools {
    display: flex;
    gap: .45rem;
}

.mobile-tools-menu {
    display: none;
}

.mobile-search-toggle {
    display: none;
}

.mobile-search-ready .mobile-search-toggle {
    align-items: center;
    display: inline-flex;
    justify-content: center;
}

.mobile-search-ready .search-form {
    display: none;
}

.mobile-search-ready .search-form.is-open {
    display: flex;
}

.icon-button,
.reader-tools button {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    font-weight: 800;
    height: 2.5rem;
    justify-content: center;
    padding: 0;
    width: 2.5rem;
}

.icon-button svg {
    fill: none;
    height: 1.15rem;
    pointer-events: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.2;
    width: 1.15rem;
}

.icon-button:hover,
.icon-button:focus-visible {
    border-color: var(--accent);
    color: var(--accent);
    outline: 0;
}

.icon-button[aria-pressed="true"] {
    background: var(--text);
    border-color: var(--text);
    color: var(--card);
}

.search-form input {
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--text);
    padding: .6rem .75rem;
    border-radius: 999px;
    min-width: 220px;
}

.search-form input:focus {
    border-color: var(--accent);
    outline: 2px solid color-mix(in srgb, var(--accent) 20%, transparent);
    outline-offset: 1px;
}

.search-form button {
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
}

.search-form button:hover,
.search-form button:focus-visible {
    background: var(--text);
    border-color: var(--text);
    color: var(--card);
}

.back-to-top {
    align-items: center;
    background: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 84%, #ffffff);
    border-radius: 999px;
    bottom: 1.2rem;
    box-shadow: 0 18px 42px rgba(19, 35, 59, .2);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    height: 3rem;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    right: 1.2rem;
    transform: translateY(.75rem);
    transition: opacity .2s ease, transform .2s ease, background .2s ease;
    width: 3rem;
    z-index: 20;
}

.back-to-top.is-visible {
    opacity: .94;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
    background: var(--text);
    outline: 0;
}

.back-to-top svg {
    fill: none;
    height: 1.35rem;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.4;
    width: 1.35rem;
}

.hero { padding: 2.5rem 0 1rem; }

.hero h1 {
    margin: .4rem 0;
    font: 900 clamp(1.8rem, 4vw, 3rem)/1.1 Georgia, serif;
}

.hero-small { padding-top: 1.5rem; }

.kicker {
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--secondary);
    font-weight: 800;
    font-size: .78rem;
}

.section-title {
    margin: 1.8rem 0 .8rem;
    font: 800 1.2rem/1.2 "Trebuchet MS", "Segoe UI", sans-serif;
}

.chip-row { display: flex; flex-wrap: wrap; gap: .6rem; }

.chip {
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--line);
    background: #fff;
    padding: .45rem .75rem;
    border-radius: 999px;
}

a,
button,
input,
select,
textarea {
    touch-action: manipulation;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin: .6rem 0 2rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
    transition: transform .2s ease, box-shadow .2s ease;
}

.card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 0, 0, .07); }
.card h3 { margin: .2rem 0 .55rem; font: 800 1.05rem/1.3 Georgia, serif; }
.card h3 a { color: inherit; text-decoration: none; }
.meta { color: var(--muted); font-size: .85rem; margin: 0; }
.empty-state { color: var(--muted); border-left: 4px solid var(--secondary); padding-left: .8rem; }

.breaking-badge {
    background: var(--accent);
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .04em;
    margin-right: .35rem;
    padding: .22rem .45rem;
    text-transform: uppercase;
}

.article-detail { padding: 2rem 0; }
.article-detail h1 { font: 900 clamp(1.6rem, 3.6vw, 2.7rem)/1.15 Georgia, serif; margin: .4rem 0; }

.article-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 1.5rem 0;
    border-radius: 16px;
    overflow: hidden;
    background: #101820;
}

.article-video iframe,
.article-video video {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.article-video > a {
    display: grid;
    height: 100%;
    place-items: center;
    color: white;
}
.lead { font-size: 1.08rem; color: var(--muted); }
.content { line-height: 1.8; }

.content p,
.content ul,
.content ol {
    margin: 0 0 1rem;
}

.content ul,
.content ol {
    padding-left: 1.5rem;
}

.reader-mode .related-news,
.reader-mode .community-panel {
    display: none;
}

.reader-mode .admin-shortcut,
.reader-mode .search-form {
    display: none;
}

.reader-mode main.container {
    width: min(760px, calc(100% - 2rem));
}

.reader-mode .article-detail {
    padding-top: 3rem;
}

.reader-mode .article-detail h1 {
    font-size: clamp(2rem, 4vw, 3.35rem);
}

.reader-mode .lead {
    font-size: 1.25rem;
}

.reader-mode .content {
    font-size: 1.18rem;
    line-height: 2;
}

.share-panel {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin: 1.25rem 0 .5rem;
}

.share-button {
    border: 1px solid rgba(180, 35, 42, .18);
    border-radius: 999px;
    background: #fff7f4;
    color: var(--accent);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.35rem;
    padding: .55rem .85rem;
    font: 800 .88rem/1 "Trebuchet MS", "Segoe UI", sans-serif;
    text-decoration: none;
}

.share-button:hover {
    background: var(--accent);
    color: #fff;
}

.article-toolbox {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 14px 36px rgba(19, 35, 59, .08);
    margin: .25rem 0 1.5rem;
    padding: .8rem;
}

.article-tool-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem;
}

.article-tool-button {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--card) 78%, #f4efe5);
    color: var(--text);
    cursor: pointer;
    font-weight: 900;
    min-height: 2.45rem;
    padding: .65rem .9rem;
    position: relative;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.article-tool-button.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: translateY(-1px);
}

.article-tool-button::after {
    content: " +";
}

.article-tool-button.is-active::after {
    content: " -";
}

.article-tool-panel {
    animation: toolPanelReveal .18s ease-out;
    margin-top: .8rem;
}

.article-tool-panel[hidden] {
    display: none !important;
}

.article-toolbox .share-panel,
.article-toolbox .audio-panel {
    margin-bottom: 0;
}

@keyframes toolPanelReveal {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.audio-panel {
    align-items: center;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
}

.audio-panel.is-disabled {
    display: none;
}

.audio-panel p,
.audio-panel strong {
    margin: 0;
}

.audio-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.audio-actions button,
.audio-actions select {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    font-weight: 800;
    padding: .55rem .75rem;
}

.related-news {
    border-top: 1px solid var(--line);
    padding-top: 1.75rem;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .8rem;
}

.section-heading h2 {
    margin: 0;
    font: 900 1.45rem/1.2 Georgia, serif;
}

.news-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.press-release-section {
    background: var(--card);
    border: 1px solid var(--line);
    border-top: 4px solid var(--accent);
    border-radius: 22px;
    margin: 1.5rem 0;
    padding: 1.2rem;
}

.press-release-link {
    color: var(--accent);
    font-weight: 800;
    text-decoration: none;
}

.press-release-link:hover,
.press-release-link:focus-visible {
    text-decoration: underline;
}

.press-release-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.press-release-card {
    align-items: start;
    border-top: 1px solid var(--line);
    display: grid;
    gap: .9rem;
    grid-template-columns: minmax(0, 7rem) minmax(0, 1fr);
    padding-top: 1rem;
}

.press-release-card img {
    border-radius: 10px;
    display: block;
    height: 6rem;
    object-fit: cover;
    width: 100%;
}

.press-release-card .meta {
    font-size: .75rem;
    margin: 0 0 .25rem;
}

.press-release-card h3 {
    font: 800 1rem/1.25 Georgia, serif;
    margin: 0;
}

.press-release-card h3 a {
    color: var(--text);
    text-decoration: none;
}

.press-release-card h3 a:hover,
.press-release-card h3 a:focus-visible {
    color: var(--accent);
    text-decoration: underline;
}

.press-release-card p:last-child {
    color: var(--muted);
    font-size: .9rem;
    margin: .4rem 0 0;
}

.reader-signals {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 1.5rem 0 2rem;
}

.signal-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 1rem;
}

.signal-card .section-title {
    margin-top: .25rem;
}

.ranked-list {
    display: grid;
    gap: .75rem;
    margin: 0;
    padding-left: 1.4rem;
}

.ranked-list li::marker {
    color: var(--accent);
    font-weight: 900;
}

.ranked-list a {
    color: var(--text);
    display: block;
    font: 800 1rem/1.25 Georgia, serif;
    text-decoration: none;
}

.ranked-list span {
    color: var(--muted);
    display: block;
    font-size: .82rem;
    margin-top: .2rem;
}

@media (max-width: 720px) {
    .header-inner { flex-direction: column; align-items: stretch; }
    .header-actions {
        justify-content: flex-end;
        margin-left: 0;
    }
    .user-menu-panel {
        right: 0;
    }
    .search-form { flex: 1 1 auto; }
    .search-form input { min-width: 0; width: 100%; }
    .article-tool-buttons { grid-template-columns: 1fr; }
    .share-button { flex: 1 1 calc(50% - .55rem); }
    .audio-panel { align-items: stretch; flex-direction: column; }
    .audio-actions button,
    .audio-actions select { flex: 1; }
    .reader-signals { grid-template-columns: 1fr; }
}

.admin-shortcut {
    color: #f5d47a;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: .02em;
}

.admin-auth,
.admin-shell {
    padding: 3rem 0;
}

.admin-shell.narrow {
    max-width: 880px;
    margin: 0 auto;
}

.admin-wide-card {
    margin-left: calc((880px - min(1180px, calc(100vw - 2rem))) / 2);
    margin-right: calc((880px - min(1180px, calc(100vw - 2rem))) / 2);
}

.admin-hero,
.page-heading,
.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin-hero {
    padding: 2rem;
    border-radius: 28px;
    background: linear-gradient(135deg, #13233b, #29496f 55%, #c89435);
    color: #fff;
    box-shadow: 0 22px 60px rgba(19, 35, 59, .22);
}

.admin-hero h1,
.page-heading h1,
.admin-card h2,
.admin-login-card h1 {
    margin: 0;
}

.eyebrow {
    margin: 0 0 .35rem;
    color: #c89435;
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.admin-nav,
.admin-metrics,
.admin-grid.two {
    display: grid;
    gap: 1rem;
}

.admin-nav {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    margin: 1.5rem 0;
}

.admin-nav a,
.admin-link,
.action-button,
.ghost-button,
.admin-form button,
.row-actions button,
.inline-edit button,
.inline-delete button {
    border: 0;
    border-radius: 999px;
    background: #13233b;
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    padding: .72rem 1rem;
    text-align: center;
    text-decoration: none;
}

.admin-nav a {
    background: #f4efe5;
    color: #13233b;
}

.ghost-button {
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.45);
}

.admin-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1.5rem;
}

.admin-metrics article,
.admin-card {
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(19, 35, 59, .08);
    border-radius: 24px;
    box-shadow: 0 16px 45px rgba(19, 35, 59, .09);
}

.admin-metrics article {
    padding: 1.25rem;
}

.admin-metrics strong {
    display: block;
    color: #13233b;
    font-size: 2.1rem;
}

.admin-card {
    padding: 1.4rem;
    overflow-x: auto;
    max-width: 100%;
}

.admin-login-card {
    max-width: 460px;
    margin: 0 auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid rgba(19, 35, 59, .1);
    padding: .9rem .7rem;
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    color: #6a5737;
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.users-table td {
    vertical-align: middle;
}

.admin-table td.actions-cell {
    vertical-align: middle;
}

.row-actions,
.inline-edit {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .45rem;
}

.row-actions {
    min-height: 2.25rem;
}

.row-actions form {
    align-items: center;
    display: flex;
    margin: 0;
}

.row-actions .action-button,
.row-actions button {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    line-height: 1;
    min-height: 2.25rem;
    white-space: nowrap;
}

.row-actions .action-button,
.row-actions button,
.inline-edit button,
.inline-delete button {
    padding: .45rem .75rem;
}

button.danger,
.inline-delete button.danger {
    background: #9f2b2b;
}

.admin-form {
    display: grid;
    gap: .8rem;
}

.admin-form label {
    color: #5d4b2d;
    font-weight: 900;
}

.field-hint {
    color: var(--muted);
    display: block;
    font-size: .82rem;
    font-weight: 700;
    margin-top: .2rem;
}

.admin-form input,
.admin-form textarea,
.admin-form select,
.inline-edit input {
    width: 100%;
    border: 1px solid rgba(19, 35, 59, .18);
    border-radius: 16px;
    padding: .85rem 1rem;
    font: inherit;
}

.rich-text-editor {
    border: 1px solid rgba(19, 35, 59, .18);
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
}

.rich-text-toolbar {
    align-items: center;
    background: #f4efe5;
    border-bottom: 1px solid rgba(19, 35, 59, .12);
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    padding: .45rem;
}

.rich-text-toolbar button {
    align-items: center;
    background: #ffffff;
    border: 1px solid rgba(19, 35, 59, .14);
    border-radius: 8px;
    color: #13233b;
    cursor: pointer;
    display: inline-flex;
    font: 900 .95rem/1 "Trebuchet MS", "Segoe UI", sans-serif;
    height: 2.15rem;
    justify-content: center;
    min-width: 2.15rem;
    padding: .35rem .5rem;
    width: auto;
}

.rich-text-toolbar button:hover,
.rich-text-toolbar button:focus-visible {
    border-color: #13233b;
    outline: 0;
}

.toolbar-underline {
    text-decoration: underline;
}

.toolbar-divider {
    align-self: stretch;
    background: rgba(19, 35, 59, .16);
    width: 1px;
}

.rich-text-surface {
    color: #17191f;
    line-height: 1.65;
    min-height: 18rem;
    outline: 0;
    padding: .85rem 1rem;
}

.rich-text-surface:empty::before {
    color: #8d9481;
    content: "Escribe el contenido de la noticia...";
}

.rich-text-surface p,
.rich-text-surface ul,
.rich-text-surface ol {
    margin: 0 0 .9rem;
}

.rich-text-surface ul,
.rich-text-surface ol {
    padding-left: 1.5rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    align-items: center;
}

.form-actions a {
    color: #6a5737;
    font-weight: 800;
}

.admin-grid.two {
    grid-template-columns: minmax(280px, .7fr) minmax(320px, 1.3fr);
}

.categories-grid {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(240px, 340px) minmax(360px, 680px);
    justify-content: start;
}

.category-create-card {
    max-width: 340px;
    width: 100%;
}

.categories-list-card {
    max-width: 680px;
    width: 100%;
}

.categories-list-card .admin-table {
    min-width: 0;
}

.categories-list-card .inline-edit {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
}

.inline-delete {
    margin-top: .55rem;
}

.role-form {
    display: flex;
    gap: .45rem;
    margin: 0;
}

.role-form select {
    border: 1px solid rgba(19, 35, 59, .18);
    border-radius: 999px;
    min-width: 110px;
    padding: .45rem .75rem;
}

.role-form button {
    border: 0;
    border-radius: 999px;
    background: #13233b;
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    padding: .45rem .75rem;
    white-space: nowrap;
}

@media (max-width: 800px) {
    .admin-hero,
    .page-heading,
    .admin-card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-nav,
    .admin-metrics,
    .admin-grid.two,
    .categories-grid {
        grid-template-columns: 1fr;
    }

    .row-actions {
        display: grid;
    }
}

.community-panel {
    margin: 3rem 0;
    padding: 1.6rem;
    border: 1px solid rgba(19, 35, 59, .1);
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(244, 239, 229, .96), rgba(255, 255, 255, .92));
    box-shadow: 0 16px 45px rgba(19, 35, 59, .08);
}

.community-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.community-heading h2 {
    margin: 0;
}

.community-heading span,
.community-note,
.empty-state,
.comment-card time {
    color: #6a5737;
}

.community-note {
    margin: .75rem 0 1.25rem;
}

.comment-form {
    display: grid;
    gap: .75rem;
    margin: 1rem 0 1.4rem;
}

.comment-form label {
    color: #13233b;
    font-weight: 900;
}

.comment-form textarea {
    background: rgba(255, 255, 255, .9);
    border: 1px solid rgba(19, 35, 59, .16);
    border-radius: 14px;
    color: #17191f;
    font: inherit;
    min-height: 7rem;
    padding: .8rem;
    resize: vertical;
}

.comment-form .form-actions {
    align-items: center;
    justify-content: space-between;
}

.comment-form .community-note {
    margin: 0;
}

.comment-list {
    display: grid;
    gap: 1rem;
}

.comment-card {
    padding: 1rem;
    border: 1px solid rgba(19, 35, 59, .08);
    border-radius: 20px;
    background: rgba(255, 255, 255, .82);
}

.comment-card strong,
.comment-card time {
    display: block;
}

.comment-card p {
    margin-bottom: .85rem;
}

.comment-report-button {
    background: transparent;
    border: 0;
    color: var(--accent);
    cursor: pointer;
    font: inherit;
    font-weight: 900;
    padding: 0;
}

.moderation-list {
    display: grid;
    gap: 1rem;
}

.moderation-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: .85rem;
    padding: 1rem;
}

.moderation-card h2 {
    font-size: 1.05rem;
    margin: 0;
}

.moderation-card time {
    color: var(--muted);
    font-size: .9rem;
    font-weight: 800;
}


.card-image,
.article-image {
    display: block;
    width: 100%;
    object-fit: cover;
}

.card-image {
    aspect-ratio: 16 / 10;
    border-radius: 18px;
    margin-bottom: .9rem;
}

.article-image {
    max-height: 520px;
    border-radius: 28px;
    margin: 1.5rem 0;
}

@media (max-width: 960px) {
    .container {
        width: min(100% - 1.5rem, 900px);
    }

    .header-inner {
        flex-wrap: wrap;
    }

    .brand { height: 2.7rem; }

    .admin-shell,
    .admin-auth {
        padding: 2rem 0;
    }

    .admin-hero {
        padding: 1.5rem;
    }

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

@media (max-width: 640px) {
    .container {
        width: min(100% - 1rem - env(safe-area-inset-left) - env(safe-area-inset-right), 620px);
    }

    .header-inner {
        align-items: center;
        display: grid;
        gap: .75rem;
        grid-template-columns: minmax(0, 1fr) auto auto auto;
        padding: .85rem 0;
    }

    .brand {
        align-self: auto;
        height: 2.2rem;
        justify-self: start;
    }

    .header-actions {
        display: contents;
    }

    .search-form {
        min-width: 0;
        width: 100%;
    }

    .mobile-search-ready .mobile-search-toggle {
        align-items: center;
        display: inline-flex;
        grid-column: 2;
        grid-row: 1;
        justify-content: center;
    }

    .mobile-search-ready .header-actions.is-search-open .mobile-search-toggle {
        display: none;
    }

    .desktop-reader-tools {
        display: none;
    }

    .mobile-tools-menu {
        display: block;
        grid-column: 4;
        grid-row: 1;
        position: relative;
    }

    .mobile-tools-menu summary {
        align-items: center;
        cursor: pointer;
        display: inline-flex;
        justify-content: center;
        list-style: none;
    }

    .mobile-tools-menu summary::-webkit-details-marker {
        display: none;
    }

    .header-auth-button {
        grid-column: 3;
        grid-row: 1;
    }

    .mobile-tools-panel {
        background: var(--card);
        border: 1px solid var(--line);
        border-radius: 14px;
        box-shadow: 0 12px 28px rgba(19, 35, 59, .16);
        display: flex;
        gap: .4rem;
        padding: .4rem;
        position: absolute;
        right: 0;
        top: calc(100% + .5rem);
        z-index: 14;
    }

    .mobile-search-ready .search-form {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
    }

    .mobile-search-ready .search-form.is-open {
        display: flex;
    }

    .reader-mode.mobile-search-ready .mobile-search-toggle {
        display: none;
    }

    .mobile-search-ready .search-form input {
        font-size: 16px;
        min-height: 2.75rem;
    }

    .admin-link,
    .action-button,
    .ghost-button,
    .admin-form button,
    .row-actions button {
        width: 100%;
    }

    .hero {
        padding: 1.5rem 0 .75rem;
    }

    .hero h1,
    .article-detail h1 {
        overflow-wrap: anywhere;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .card {
        border-radius: 16px;
        padding: .9rem;
    }

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

    .chip {
        align-items: center;
        display: inline-flex;
        justify-content: center;
        min-height: 2.75rem;
        text-align: center;
    }

    .section-title {
        margin-top: 1.35rem;
    }

    .meta {
        line-height: 1.45;
    }

    .share-button,
    .article-tool-button,
    .audio-actions button,
    .audio-actions select {
        min-height: 2.75rem;
    }

    .share-panel {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .share-button {
        width: 100%;
    }

    .article-detail {
        padding: 1.25rem 0;
    }

    .article-image {
        border-radius: 18px;
        max-height: 340px;
    }

    .back-to-top {
        bottom: calc(1rem + env(safe-area-inset-bottom));
        right: max(1rem, env(safe-area-inset-right));
    }

    .content {
        font-size: 1rem;
        line-height: 1.7;
    }

    .admin-hero,
    .admin-card,
    .community-panel {
        border-radius: 18px;
        padding: 1rem;
    }

    .admin-nav,
    .admin-metrics,
    .admin-grid.two,
    .categories-grid {
        grid-template-columns: 1fr;
    }

    .category-create-card,
    .categories-list-card {
        max-width: none;
    }

    .admin-metrics strong {
        font-size: 1.65rem;
    }

    .admin-card {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-wide-card {
        margin-left: 0;
        margin-right: 0;
    }

    .admin-table {
        min-width: 680px;
    }

    .row-actions {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .row-actions form,
    .row-actions .action-button {
        width: 100%;
    }

    .form-actions,
    .community-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .form-actions a {
        text-align: center;
    }

    .inline-edit {
        display: grid;
        grid-template-columns: 1fr;
    }

    .categories-list-card .inline-edit {
        grid-template-columns: 1fr;
    }

    .role-form {
        display: grid;
        grid-template-columns: 1fr;
    }

    .role-form button,
    .role-form select {
        width: 100%;
    }

    .inline-delete {
        margin-top: .45rem;
    }

    .rich-text-toolbar {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .rich-text-toolbar button {
        width: 100%;
    }

    .toolbar-divider {
        display: none;
    }
}

@media (max-width: 420px) {
    .chip-row {
        display: flex;
        flex-wrap: wrap;
    }

    .share-panel {
        grid-template-columns: 1fr;
    }

    .admin-table {
        min-width: 620px;
    }

    .admin-table th,
    .admin-table td {
        padding: .7rem .55rem;
    }

    .card-image {
        border-radius: 14px;
    }
}

[data-theme="dark"] .chip,
[data-theme="dark"] .admin-nav a {
    background: #252d39;
    border-color: var(--line);
    color: var(--text);
}

[data-theme="dark"] .admin-card,
[data-theme="dark"] .admin-metrics article,
[data-theme="dark"] .community-panel,
[data-theme="dark"] .comment-card {
    background: rgba(27, 32, 41, .96);
    border-color: var(--line);
    box-shadow: 0 16px 45px rgba(0, 0, 0, .24);
    color: var(--text);
}

[data-theme="dark"] .flash-message {
    background: rgba(27, 32, 41, .98);
    border-color: #3b4656;
    color: var(--text);
}

[data-theme="dark"] .flash-message span:not(.flash-icon) {
    color: var(--muted);
}

[data-theme="dark"] .admin-card h2,
[data-theme="dark"] .admin-card h3,
[data-theme="dark"] .page-heading h1,
[data-theme="dark"] .admin-login-card h1,
[data-theme="dark"] .admin-metrics strong,
[data-theme="dark"] .community-heading h2 {
    color: var(--text);
}

[data-theme="dark"] .admin-form label,
[data-theme="dark"] .admin-table th,
[data-theme="dark"] .form-actions a,
[data-theme="dark"] .community-heading span,
[data-theme="dark"] .community-note,
[data-theme="dark"] .comment-card time {
    color: var(--muted);
}

[data-theme="dark"] .admin-form input,
[data-theme="dark"] .admin-form textarea,
[data-theme="dark"] .admin-form select,
[data-theme="dark"] .inline-edit input,
[data-theme="dark"] .role-form select {
    background: #121821;
    border-color: #3b4656;
    color: var(--text);
}

[data-theme="dark"] .rich-text-editor {
    background: #121821;
    border-color: #3b4656;
}

[data-theme="dark"] .rich-text-toolbar {
    background: #252d39;
    border-color: #3b4656;
}

[data-theme="dark"] .rich-text-toolbar button {
    background: #121821;
    border-color: #3b4656;
    color: var(--text);
}

[data-theme="dark"] .rich-text-surface {
    color: var(--text);
}

[data-theme="dark"] .admin-form input::placeholder,
[data-theme="dark"] .admin-form textarea::placeholder {
    color: #8f99aa;
}

[data-theme="dark"] .admin-table th,
[data-theme="dark"] .admin-table td {
    border-bottom-color: #343d4b;
}

[data-theme="dark"] .share-button {
    background: rgba(255, 111, 97, .12);
    border-color: rgba(255, 111, 97, .28);
    color: #ffb2a9;
}

[data-theme="dark"] .share-button:hover {
    background: var(--accent);
    color: #12151b;
}

[data-theme="dark"] .admin-link,
[data-theme="dark"] .action-button,
[data-theme="dark"] .admin-form button,
[data-theme="dark"] .row-actions button,
[data-theme="dark"] .inline-edit button,
[data-theme="dark"] .inline-delete button,
[data-theme="dark"] .role-form button {
    background: #324055;
    color: #ffffff;
}

[data-theme="dark"] .site-header .header-actions .header-auth-button {
    background: rgba(243, 239, 231, .12);
    border-color: rgba(243, 239, 231, .28);
    color: #f3efe7;
}

[data-theme="dark"] .site-header .header-actions .header-auth-button:hover,
[data-theme="dark"] .site-header .header-actions .header-auth-button:focus-visible {
    background: #f57c56;
    border-color: #f57c56;
    color: #12151b;
}

[data-theme="dark"] .site-header .header-actions .user-menu-trigger,
[data-theme="dark"] .site-header .header-actions .user-menu-trigger:hover,
[data-theme="dark"] .site-header .header-actions .user-menu-trigger:focus-visible,
[data-theme="dark"] .user-menu[open] .user-menu-trigger {
    background: #252d39;
    border-color: #3b4656;
    color: #f3efe7;
}

[data-theme="dark"] .user-menu-panel {
    background: rgba(27, 32, 41, .98);
    border-color: #3b4656;
}

[data-theme="dark"] .user-menu-panel a,
[data-theme="dark"] .user-menu-panel button {
    color: #f3efe7;
}

[data-theme="dark"] .user-menu-panel a:hover,
[data-theme="dark"] .user-menu-panel button:hover,
[data-theme="dark"] .user-menu-panel a:focus-visible,
[data-theme="dark"] .user-menu-panel button:focus-visible {
    background: rgba(243, 239, 231, .12);
}

[data-theme="dark"] button.danger,
[data-theme="dark"] .inline-delete button.danger {
    background: #b84545;
}
