:root {
    color-scheme: light;
    --bg: #f5f6f4;
    --surface: #ffffff;
    --surface-2: #eef2ef;
    --ink: #171b1f;
    --muted: #5b646b;
    --brand: #0b6b57;
    --brand-dark: #11332d;
    --accent: #b3262e;
    --gold: #d79a25;
    --line: #d9dfdc;
    --shadow: 0 14px 34px rgba(24, 31, 34, 0.11);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.55;
    background: var(--bg);
    color: var(--ink);
}

a { color: inherit; }
a:focus, button:focus, input:focus, textarea:focus, select:focus {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -80px;
    z-index: 20;
    background: #000;
    color: #fff;
    padding: 10px 14px;
}
.skip-link:focus { top: 12px; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.wrap {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.topbar {
    background: var(--brand-dark);
    color: #fff;
    font-size: 0.92rem;
}
.topbar-inner {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0;
    flex-wrap: wrap;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}
.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}
.brand {
    display: inline-flex;
    flex-direction: column;
    padding: 14px 0;
    text-decoration: none;
}
.brand strong {
    color: var(--brand);
    font-size: 1.35rem;
    letter-spacing: 0;
}
.brand span {
    color: var(--muted);
    font-size: 0.9rem;
}
.nav-links {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.nav-links a, .button {
    text-align: center;
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 9px 12px;
    text-decoration: none;
    background: transparent;
    color: var(--ink);
    font-weight: 700;
}
.nav-links a:hover, .nav-links a.active {
    background: var(--surface-2);
    color: var(--brand);
}
.button {
    border-color: var(--line);
    background: var(--surface);
}
.button:hover, .button.primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.hero {
    background: #0e2f2a;
    color: #fff;
}
.editorial-hero {
    padding: 36px 0;
}
.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
    gap: 30px;
    align-items: center;
}
.hero-copy {
    padding: 22px 0;
}
.eyebrow {
    margin: 0 0 8px;
    color: #f6c766;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}
.eyebrow.dark { color: var(--accent); }
h1 {
    margin: 0;
    max-width: 780px;
    font-size: clamp(2.4rem, 5vw, 4.7rem);
    line-height: 1;
    letter-spacing: 0;
}
.hero p { max-width: 700px; font-size: 1.12rem; }
.hero-actions, .actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 22px;
}
.hero .button { border-color: rgba(255, 255, 255, 0.36); color: #fff; }
.hero .button:focus-visible { outline-color: #fff; }
.hero .primary { background: #fff; color: var(--brand); border-color: #fff; }
.hero-media {
    margin: 0;
    min-height: 300px;
}
.hero-media img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.28);
}

.page { padding: 30px 0 58px; }
.portal-home > section + section { margin-top: 34px; }
.section-head {
    scroll-margin-top: 92px;
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin: 26px 0 16px;
}
.section-head.compact { margin-top: 0; }
.section-head h2, .page-title h1 { margin: 0; }
.section-head p, .page-title p, .card p { color: var(--muted); }

.headline-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
    gap: 18px;
    align-items: stretch;
}
.lead-story, .news-rail, .feature-strip {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.lead-story {
    padding: clamp(22px, 4vw, 34px);
}
.kicker {
    display: inline-flex;
    margin-bottom: 12px;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
}
.lead-story h2 {
    margin: 0 0 12px;
    font-size: clamp(1.8rem, 4vw, 3.15rem);
    line-height: 1.05;
    letter-spacing: 0;
}
.lead-story a, .news-card a { text-decoration: none; }
.lead-story a:hover, .news-card a:hover { color: var(--brand); }
.lead-story p { color: var(--muted); font-size: 1.06rem; }

.news-rail { padding: 18px; }
.rail-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
    margin-bottom: 4px;
}
.rail-head h2 { margin: 0; font-size: 1.2rem; }
.rail-head a { color: var(--brand); font-weight: 800; text-decoration: none; }
.rail-item {
    display: block;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
}
.rail-item span, .meta {
    display: block;
    margin-bottom: 7px;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.88rem;
}
.rail-item strong { line-height: 1.28; }
.empty-note { color: var(--muted); }

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    box-shadow: var(--shadow);
}
.card h2, .card h3 { margin-top: 0; }
.card:focus-within { box-shadow: 0 0 0 3px rgba(215, 154, 37, 0.28), var(--shadow); }
.card:focus-within { box-shadow: 0 0 0 3px rgba(215, 154, 37, 0.28), var(--shadow); }
.card-media, .article-media {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
}
.card-media {
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.news-card { min-height: 210px; }

.portal-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.portal-links a {
    min-height: 118px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--line);
    border-left: 5px solid var(--brand);
    border-radius: 8px;
    background: var(--surface);
    text-decoration: none;
    box-shadow: var(--shadow);
}
.portal-links a:hover { border-left-color: var(--accent); transform: translateY(-1px); }
.portal-links span { color: var(--accent); font-weight: 800; text-transform: uppercase; font-size: 0.82rem; }
.portal-links strong { font-size: 1.04rem; line-height: 1.25; }

.feature-strip {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
    align-items: center;
    padding: 24px;
    background: linear-gradient(90deg, #ffffff 0%, #f0f5f2 100%);
}
.feature-strip h2 { margin: 0 0 8px; }
.feature-strip p { margin-bottom: 0; color: var(--muted); }

.tag-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.tag {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 9px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 0.88rem;
    text-decoration: none;
}
.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--shadow);
}
.stat strong {
    display: block;
    color: var(--brand);
    font-size: 1.65rem;
}
.device-note { color: var(--muted); }

.search-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin: 18px 0;
}
.search-form input, .form input, .form textarea, .form select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 12px;
    font: inherit;
}
.form label {
    display: block;
    font-weight: 700;
    margin: 14px 0 6px;
}
.form textarea { resize: vertical; min-height: 140px; }

.news-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(150px, 0.8fr)) auto;
    gap: 10px;
    align-items: end;
    margin: 18px 0;
}
.news-filters label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-weight: 700;
}
.news-filters input, .news-filters select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 12px;
    font: inherit;
    background: var(--surface);
    color: var(--ink);
}
.filter-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.news-featured-card {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
    gap: 18px;
    align-items: center;
    margin-bottom: 16px;
}
.news-featured-card h3 {
    margin: 8px 0 10px;
    font-size: clamp(1.7rem, 3vw, 2.6rem);
    line-height: 1.08;
}
.news-featured-card a, .news-grid a { text-decoration: none; }
.news-featured-card a:hover, .news-grid a:hover { color: var(--brand); }
.tag.active, .tag.small {
    border-color: var(--brand);
    color: var(--brand);
    background: #e6f2ed;
}
.tag.small {
    width: fit-content;
    margin-bottom: 8px;
    border-radius: 6px;
}
.pagination {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 24px;
}
.article-card {
    max-width: 900px;
    margin: 0 auto;
}
.article-card h1 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.08;
    margin-bottom: 16px;
}
.article-body {
    white-space: normal;
}
.article-body p {
    margin: 0 0 16px;
}
.inline-actions form { margin: 0; }
audio { width: 100%; margin-top: 10px; }
.article-body { white-space: pre-line; font-size: 1.08rem; }
.footer {
    background: var(--brand-dark);
    color: #f7fff8;
    padding: 28px 0;
}
.footer-grid {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}
.footer nav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.footer a { color: #ffe3a1; }
.footer a:focus-visible, .footer a:hover { color: #fff; }
.footer a:focus-visible, .footer a:hover { color: #fff; }


.rss-row {
    display: grid;
    grid-template-columns: minmax(160px, 0.7fr) minmax(260px, 1.3fr) auto;
    gap: 12px;
    align-items: end;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}
.checkline {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    margin-bottom: 0 !important;
}
.checkline input {
    width: auto;
    min-height: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.form select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 12px;
    font: inherit;
    background: var(--surface);
}
.admin-list {
    display: grid;
    gap: 14px;
}
.admin-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
}
.inline-actions {
    justify-content: flex-end;
    margin-top: 0;
}
.button.danger {
    border-color: #c84646;
    color: #9b1c1c;
}
.button.danger:hover {
    background: #b3262e;
    border-color: #b3262e;
    color: #fff;
}
.radio-program-card {
    min-height: 250px;
}
@media (max-width: 900px) {
    .hero-grid, .headline-layout, .grid, .grid.two, .stats, .portal-links, .feature-strip {
        grid-template-columns: 1fr;
    }
    .section-head {
        align-items: start;
        flex-direction: column;
    }
    .nav-links {
        width: 100%;
        padding-bottom: 12px;
    }
    .nav-links a { flex: 1 1 120px; }
    .search-form, .rss-row, .form-grid, .admin-item, .news-filters, .news-featured-card { grid-template-columns: 1fr; }
    .hero-media { min-height: 0; }
}

@media (max-width: 560px) {
    .wrap { width: min(100% - 24px, 1180px); }
    .editorial-hero { padding: 26px 0; }
    .hero-copy { padding: 8px 0; }
    .hero-actions .button, .actions .button, .filter-actions .button { width: 100%; }
    .lead-story, .news-rail, .feature-strip, .card, .portal-links a, .stat { padding: 16px; }
}

.smart-hero .hero-copy p {
    max-width: 760px;
}
.smart-home .headline-layout {
    margin-top: 0;
}
.lead-story-smart {
    display: grid;
    align-content: start;
}
.lead-media {
    display: block;
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 16px;
}
.editorial-stats {
    margin-top: 18px;
}
.category-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.category-column {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--shadow);
}
.category-column h3 {
    margin: 0 0 10px;
    color: var(--brand);
}
.category-column h3 a,
.mini-story,
.system-list a {
    text-decoration: none;
}
.mini-story {
    display: block;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}
.mini-story span,
.system-list span {
    display: block;
    color: var(--accent);
    font-size: 0.84rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.mini-story strong,
.system-list strong {
    display: block;
    line-height: 1.28;
}
.mini-story:hover strong,
.system-list a:hover strong,
.category-column h3 a:hover {
    color: var(--brand);
}
.system-strip {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    box-shadow: var(--shadow);
}
.system-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}
.system-list a {
    min-height: 135px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
}
@media (max-width: 1050px) {
    .category-board,
    .system-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 900px) {
    .category-board,
    .system-list {
        grid-template-columns: 1fr;
    }
}
.stats-page .stats-summary {
    margin-bottom: 18px;
}
.stats-card {
    display: grid;
    gap: 14px;
}
.stat-bars {
    display: grid;
    gap: 12px;
}
.stat-row {
    display: grid;
    gap: 6px;
}
.stat-labels {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    color: var(--muted);
}
.stat-labels strong {
    color: var(--ink);
}
.bar-track {
    height: 10px;
    border-radius: 999px;
    background: var(--surface-2);
    overflow: hidden;
}
.bar-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--brand), #2f8f72);
    border-radius: 999px;
}
.metric-list {
    display: grid;
    gap: 10px;
}
.metric-item,
.link-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
}
.metric-item span,
.link-item span {
    color: var(--muted);
}
.link-list {
    display: grid;
    gap: 10px;
}
@media (max-width: 900px) {
    .metric-item,
    .link-item,
    .stat-labels {
        flex-direction: column;
        align-items: flex-start;
    }
}
