:root {
    --bg: #f8f9fa;
    --surface: #ffffff;
    --surface-muted: #f1f3f6;
    --text: #222222;
    --text-muted: #4d5965;
    --header-bg: #222222;
    --header-text: #ffffff;
    --border: #d9e0e7;
    --accent: #009fe3;
    --accent-hover: #007bb3;
    --code-bg: #f1f3f6;
    --code-border: #009fe3;
    --inline-code-bg: #e7ebef;
    --inline-code-border: #cbd3db;
    --row-alt: #f8f9fa;
    --shadow: 0 2px 16px rgba(0, 159, 227, 0.08);
}

body.dark-mode {
    --bg: #181c20;
    --surface: #23272c;
    --surface-muted: #1e2328;
    --text: #e6e6e6;
    --text-muted: #a8b3bc;
    --header-bg: #23272c;
    --header-text: #ffffff;
    --border: #2c333a;
    --code-bg: #181c20;
    --code-border: #009fe3;
    --row-alt: #1e2328;
    --shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
    --inline-code-bg: #39424b;
    --inline-code-border: #57616b;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", "Roboto", Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    transition: background 0.3s, color 0.3s;
}

a {
    color: var(--accent);
}

.site-header,
.site-footer {
    background: var(--header-bg);
    color: var(--header-text);
    transition: background 0.3s, color 0.3s;
}

.site-header {
    border-bottom: 2px solid var(--accent);
}

.site-footer {
    border-top: 2px solid var(--accent);
    margin-top: auto;
    padding: 1.2rem 1rem;
    text-align: center;
}

.site-footer a {
    color: var(--header-text);
}

.site-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: 72px;
    padding: 0 2rem;
}

.site-title {
    grid-column: 2;
    justify-self: center;
    color: var(--header-text);
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.theme-toggle {
    grid-column: 3;
    justify-self: end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0.45rem 1rem;
    border: none;
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.theme-toggle:hover {
    background: var(--accent-hover);
}

main {
    max-width: 1100px;
    margin: 2.5rem auto;
    padding: 2.5rem 3rem;
    border-radius: 10px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow);
    transition: background 0.3s, color 0.3s, border-color 0.3s;
}

.landing-intro {
    margin-bottom: 1.5rem;
}

.landing-intro h1 {
    margin: 0 0 0.75rem;
}

    padding: 0 3.5em 0 0;
    border: none;
    border-radius: 0;
    background: transparent;
    margin: 0;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.section-intro {
    margin: 0 0 1.5rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.portal-card {
    border: 1.5px solid var(--border);
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-muted) 100%);
    box-shadow: var(--shadow);
}

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

.portal-card__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.portal-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    flex: 0 0 auto;
    border-radius: 12px;
    background: rgba(0, 159, 227, 0.12);
    color: var(--accent);
}

.portal-card__icon svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: currentColor;
}

.portal-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin: 0;
}

.portal-card h2 {
    margin: 0;
}

.portal-card p {
    color: var(--text-muted);
    line-height: 1.7;
}

.portal-card a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.portal-pill {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0 0.7rem;
    border-radius: 999px;
    background: rgba(0, 159, 227, 0.12);
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 700;
}

.news-feed {
    margin-top: 1.75rem;
}

.news-feed__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.news-feed__header h2,
.downloads-panel h2 {
    margin: 0;
}

.news-feed__list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.news-card,
.downloads-panel {
    padding: 1.2rem;
    border: 1.5px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-muted) 100%);
    box-shadow: var(--shadow);
}

.news-card h3 {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
}

.news-card h3 a {
    text-decoration: none;
}

.news-card p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.65;
}

.news-card__date,
.document-meta {
    display: block;
    margin-top: 0.4rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.downloads-panel {
    margin-bottom: 1.5rem;
}

.document-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0;
}

.document-list li + li {
    margin-top: 0.75rem;
}

.document-list a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.document-list a:hover {
    text-decoration: underline;
}

.section-groups {
    margin-top: 1.75rem;
}

.section-groups h2 {
    margin: 0 0 1rem;
}

.section-group {
    padding: 1.2rem;
    border: 1.5px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-muted) 100%);
    box-shadow: var(--shadow);
}

.section-group + .section-group {
    margin-top: 1rem;
}

.section-group__title,
.section-version h4 {
    margin: 0 0 0.45rem;
}

.section-group__title a,
.section-version h4 a {
    color: var(--text);
    text-decoration: none;
}

.section-group__title a:hover,
.section-version h4 a:hover {
    color: var(--accent);
}

.section-group__description,
.section-version p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.65;
}

.section-group__versions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.section-version {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.section-version .document-list {
    margin-top: 1rem;
}

.section-version__types {
    margin-top: 1rem;
}

.contract-type {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-muted);
}

.contract-type + .contract-type {
    margin-top: 0.85rem;
}

.contract-type__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1rem;
    cursor: pointer;
    list-style: none;
    font-weight: 700;
}

.contract-type__summary::-webkit-details-marker {
    display: none;
}

.contract-type__summary::after {
    content: ">";
    color: var(--text-muted);
    font-size: 1rem;
    transform: rotate(90deg);
    transition: transform 0.2s ease;
}

.contract-type[open] .contract-type__summary::after {
    transform: rotate(270deg);
}

.contract-type__summary-main {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.contract-type__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 auto;
    border-radius: 10px;
    background: rgba(0, 159, 227, 0.12);
    color: var(--accent);
}

.contract-type__icon svg {
    width: 1.2rem;
    height: 1.2rem;
    fill: currentColor;
}

.contract-type__body {
    padding: 0 1rem 1rem;
}

.contract-type__body p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.65;
}

.contract-type__body .document-list {
    margin-top: 0.85rem;
}

article {
    overflow-wrap: anywhere;
}

article table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--surface);
    color: var(--text);
}

article th,
article td {
    border: 1.5px solid var(--accent);
    padding: 0.7em 1.2em;
    text-align: left;
}

article th {
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.5px;
}

article tr:nth-child(even) td {
    background: var(--row-alt);
}

code {
    position: relative;
    top: 1px;
    padding: 0.08em 0.4em;
    border: 1px solid var(--inline-code-border);
    border-radius: 4px;
    background: var(--inline-code-bg);
    color: var(--text);
    font-family: "Fira Mono", Consolas, Menlo, monospace;
    font-size: 0.95em;
}

pre {
    position: relative;
    margin: 2em 0;
    padding: 1.2em 1.5em 1.2em 1.2em;
    max-width: 100%;
    overflow-x: auto;
    border-radius: 6px;
    background: var(--inline-code-bg);
    background-color: var(--inline-code-bg) !important;
    color: var(--text);
    color: var(--text) !important;
    border: 1.5px solid var(--inline-code-border);
    font-size: 1em;
    line-height: 1.6;
    word-break: break-word;
}

pre > code {
    display: block;
    position: static;
    top: auto;
    padding: 0 3.5em 0 0;
    border: none;
    border-radius: 0;
    background: transparent;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
    font-family: "Fira Mono", Consolas, Menlo, monospace;
    font-size: 1em;
}

.copy-btn {
    position: absolute;
    top: 0.7em;
    right: 0.7em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.2s ease, background 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 159, 227, 0.08);
}

.copy-btn:hover {
    opacity: 1;
    background: var(--accent-hover);
}

@media (max-width: 760px) {
    .site-nav {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        justify-items: center;
        padding: 1rem;
    }

    .site-title,
    .theme-toggle {
        grid-column: auto;
        justify-self: center;
    }

    main {
        margin: 1rem;
        padding: 1.5rem;
    }

    .portal-grid,
    .portal-grid--simple,
    .news-feed__list,
    .section-group__versions {
        grid-template-columns: 1fr;
    }

    .portal-card {
        padding: 1.2rem;
    }

    .contract-type__summary {
        padding: 0.85rem 0.9rem;
    }
}

@media (max-width: 1024px) {
    .portal-grid,
    .portal-grid--simple,
    .news-feed__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
