:root {
    --green: #0c5b4c;
    --green-dark: #083d35;
    --green-soft: #e7f3ef;
    --ink: #10201f;
    --muted: #61706b;
    --paper: #f7faf7;
    --white: #ffffff;
    --line: #d7e0dd;
    --gold: #f2b705;
    --coral: #cc5a43;
    --shadow: 0 18px 50px rgba(16, 32, 31, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    letter-spacing: 0;
}

body.no-scroll {
    overflow: hidden;
}

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

a {
    color: var(--green);
    text-decoration: none;
}

a:hover,
a:focus {
    text-decoration: underline;
}

button,
input,
select,
textarea {
    font: inherit;
}

[hidden] {
    display: none !important;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px clamp(16px, 4vw, 48px);
    background: rgba(247, 250, 247, 0.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

.site-brand,
.admin-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    text-decoration: none;
}

.site-brand strong,
.admin-brand strong {
    display: block;
    font-size: clamp(0.95rem, 1.6vw, 1.15rem);
    line-height: 1.15;
}

.site-brand small,
.admin-brand small {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 8px;
    background: var(--green);
    color: var(--white);
    font-weight: 800;
}

.brand-logo {
    display: block;
    width: 54px;
    height: 58px;
    flex: 0 0 54px;
    object-fit: contain;
    border-radius: 6px;
    background: var(--white);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.site-nav a,
.site-nav summary,
.admin-sidebar a {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}

.site-nav a.active,
.site-nav summary.active,
.site-nav a:hover,
.site-nav a:focus,
.site-nav summary:hover,
.site-nav summary:focus,
.admin-sidebar a:hover,
.admin-sidebar a:focus {
    background: var(--green-soft);
    color: var(--green-dark);
}

.site-nav summary {
    list-style: none;
    cursor: pointer;
}

.site-nav summary::-webkit-details-marker {
    display: none;
}

.site-nav summary::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-left: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
}

.nav-group {
    position: relative;
}

.nav-group[open] summary::after {
    transform: rotate(225deg) translate(-2px, -1px);
}

.subnav {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 25;
    display: grid;
    min-width: 210px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.nav-group:not([open]) .subnav {
    display: none;
}

@media (hover: hover) and (pointer: fine) {
    .nav-group:hover .subnav,
    .nav-group:focus-within .subnav {
        display: grid;
    }
}

.nav-toggle {
    display: none;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
    font-weight: 800;
    padding: 8px 12px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
    gap: clamp(24px, 5vw, 56px);
    align-items: center;
    padding: clamp(36px, 7vw, 84px) clamp(16px, 5vw, 72px) 36px;
    background: linear-gradient(135deg, #f7faf7 0%, #edf6f2 58%, #fff8df 100%);
}

.hero h1,
.section-hero h1,
.detail-article h1 {
    margin: 8px 0 14px;
    font-size: clamp(2.2rem, 6vw, 4.6rem);
    line-height: 1.02;
}

.hero p,
.section-hero p,
.lead {
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.22rem);
    max-width: 70ch;
}

.hero-actions,
.button-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 22px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
    font-weight: 800;
    padding: 10px 16px;
    text-decoration: none;
    cursor: pointer;
}

.button.primary {
    border-color: var(--green);
    background: var(--green);
    color: var(--white);
}

.button.ghost {
    background: transparent;
}

.button.full {
    width: 100%;
}

.button.tiny {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 0.86rem;
}

.button:hover,
.button:focus {
    transform: translateY(-1px);
    text-decoration: none;
}

.hero-panel {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.hero-panel img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.hero-panel dl {
    display: grid;
    gap: 0;
    margin: 0;
}

.hero-panel div {
    padding: 18px;
    border-top: 1px solid var(--line);
}

dt {
    color: var(--green-dark);
    font-weight: 900;
}

dd {
    margin: 4px 0 0;
    color: var(--muted);
}

.eyebrow {
    display: inline-flex;
    color: var(--coral);
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
}

.content-band,
.content-section,
.section-hero,
.detail-article,
.contact-layout,
.feature-strip,
.timeline {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.content-band {
    padding: 38px 0 16px;
}

.two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.two-column article,
.feature-strip article,
.contact-card,
.publication-card,
.empty-state,
.install-card,
.login-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 10px 26px rgba(16, 32, 31, 0.08);
}

.two-column article,
.feature-strip article,
.contact-card,
.empty-state {
    padding: 22px;
}

.two-column h2,
.section-heading h2,
.feature-strip h2,
.contact-card h2,
.popup-panel h2 {
    margin: 4px 0 10px;
    font-size: clamp(1.45rem, 3vw, 2.15rem);
    line-height: 1.1;
}

.content-section {
    padding: 42px 0 62px;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.publication-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.publication-card {
    overflow: hidden;
}

.publication-card img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: var(--green-soft);
}

.publication-card div {
    padding: 18px;
}

.publication-card h3 {
    margin: 8px 0;
    font-size: 1.25rem;
    line-height: 1.2;
}

.publication-card p {
    color: var(--muted);
    margin: 0 0 14px;
}

.publication-card time {
    color: var(--muted);
    font-size: 0.88rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fff4c4;
    color: #6f5100;
    font-size: 0.82rem;
    font-weight: 900;
}

.section-hero {
    padding: 50px 0 18px;
}

.contact-layout {
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1.2fr);
    gap: 18px;
    padding: 20px 0 0;
}

.map-frame {
    min-height: 340px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--white);
}

.map-frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 340px;
    border: 0;
}

.feature-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    padding: 20px 0 0;
}

.timeline {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 20px 0 0;
}

.timeline div {
    padding: 18px;
    border-left: 4px solid var(--gold);
    background: var(--white);
    border-radius: 8px;
}

.timeline strong,
.timeline span {
    display: block;
}

.timeline span {
    color: var(--muted);
}

.detail-article {
    padding: 44px 0 68px;
}

.detail-article .back-link {
    display: inline-flex;
    margin-bottom: 16px;
    font-weight: 800;
}

.detail-image {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    border-radius: 8px;
    margin: 18px 0;
}

.article-media {
    width: min(900px, 100%);
    margin: 22px 0;
}

.article-media img {
    display: block;
    width: 100%;
    max-height: 760px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

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

.document-viewer {
    width: min(960px, 100%);
    margin: 22px 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--white);
    box-shadow: 0 10px 26px rgba(16, 32, 31, 0.08);
}

.document-viewer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}

.pdf-viewer {
    display: block;
    width: 100%;
    height: min(78vh, 760px);
    min-height: 520px;
    border: 0;
    background: #f1f4f2;
}

.rich-text {
    width: min(760px, 100%);
    font-size: 1.08rem;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 24px clamp(16px, 5vw, 72px);
    background: var(--green-dark);
    color: var(--white);
}

.site-footer div,
.site-footer span {
    display: block;
}

.site-footer span {
    color: rgba(255, 255, 255, 0.78);
}

.site-footer a {
    color: var(--white);
    font-weight: 900;
}

.popup-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(8, 61, 53, 0.65);
}

.popup-panel {
    width: min(480px, 100%);
    padding: 24px;
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.popup-close {
    float: right;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    cursor: pointer;
}

.install-page,
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #e8f4ef 0%, #fff8df 100%);
}

.install-card,
.login-card {
    width: min(520px, 100%);
    padding: clamp(22px, 5vw, 34px);
}

.install-card h1,
.login-card h1 {
    margin: 8px 0 10px;
    font-size: clamp(1.8rem, 7vw, 2.65rem);
    line-height: 1.05;
}

.install-status {
    display: grid;
    gap: 10px;
    margin: 20px 0;
}

.install-status div,
.credentials-box,
.locked-credit {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
}

.install-footer {
    margin-top: 22px;
    color: var(--muted);
    font-size: 0.92rem;
}

.stacked-form {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.alert {
    margin: 14px 0;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--line);
    font-weight: 700;
}

.alert-success {
    background: #eaf7ed;
    color: #17612a;
    border-color: #bde4c6;
}

.alert-error {
    background: #fff0ed;
    color: #8b2d1f;
    border-color: #f1b5aa;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid #bdcbc6;
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

label {
    display: grid;
    color: var(--ink);
    font-weight: 800;
}

small {
    color: var(--muted);
}

code {
    font-family: Consolas, "Liberation Mono", monospace;
}

@media (max-width: 980px) {
    .hero,
    .contact-layout {
        grid-template-columns: 1fr;
    }

    .publication-grid,
    .feature-strip,
    .timeline {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    body {
        font-size: 16px;
    }

    .site-header {
        align-items: flex-start;
        flex-wrap: wrap;
        padding: 10px 14px;
    }

    .site-brand {
        max-width: calc(100% - 82px);
    }

    .nav-toggle {
        display: inline-flex;
    }

    .site-nav,
    .admin-sidebar {
        display: none;
        width: 100%;
    }

    .site-nav.open,
    .admin-sidebar.open {
        display: grid;
    }

    .site-nav a,
    .site-nav summary,
    .admin-sidebar a {
        width: 100%;
        justify-content: flex-start;
    }

    .nav-group {
        width: 100%;
    }

    .subnav {
        position: static;
        min-width: 0;
        margin: 4px 0 6px 12px;
        box-shadow: none;
    }

    .hero {
        padding: 28px 14px 24px;
    }

    .hero h1,
    .section-hero h1,
    .detail-article h1 {
        font-size: clamp(2rem, 12vw, 3rem);
    }

    .two-column,
    .publication-grid,
    .feature-strip,
    .timeline {
        grid-template-columns: 1fr;
    }

    .section-heading,
    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .button-row,
    .hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

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

    .document-viewer-head {
        align-items: stretch;
        flex-direction: column;
    }

    .document-viewer-head .button {
        width: 100%;
    }

    .pdf-viewer {
        height: 70vh;
        min-height: 420px;
    }
}
