:root {
    --site-bg: #f3f7f4;
    --surface: #ffffff;
    --surface-subtle: #f8fcf9;
    --brand: #1f874e;
    --brand-dark: #174b31;
    --brand-soft: rgba(31, 135, 78, 0.1);
    --text-main: #173125;
    --text-muted: #5f7468;
    --border-soft: rgba(31, 135, 78, 0.14);
    --shadow-soft: 0 18px 40px rgba(26, 55, 39, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    background: radial-gradient(circle at top, rgba(31, 135, 78, 0.08), transparent 34%), var(--site-bg);
    color: var(--text-main);
    line-height: 1.65;
}

body {
    font-family: "Segoe UI", "Trebuchet MS", sans-serif;
}

a {
    color: var(--brand);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--brand-dark);
}

img {
    max-width: 100%;
}

h1,
h2,
h3,
h4 {
    color: var(--brand-dark);
    letter-spacing: -0.03em;
}

h1 {
    margin-bottom: 0.35rem;
    font-size: clamp(2rem, 3vw, 2.75rem);
    line-height: 1.05;
}

h2 {
    margin-bottom: 0.75rem;
    font-size: 1.45rem;
}

p,
ul,
ol {
    margin: 0;
}

p + p,
p + ul,
ul + p,
ol + p,
.table-wrapper + p,
.code-wrapper + p,
.tabs + p {
    margin-top: 1rem;
}

.content-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.page-header-left,
.page-header-right {
    min-width: 0;
}

.page-header-right {
    flex: 1 1 380px;
}

.page-header.reference .page-header-right {
    max-width: 380px;
}

.page-subtitle {
    margin-top: -0.4rem;
    color: var(--text-muted);
    font-size: 1rem;
    font-style: normal;
}

select,
input[type="text"] {
    width: 100%;
    min-height: 44px;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-main);
    font: inherit;
    box-shadow: 0 6px 14px rgba(26, 55, 39, 0.04);
}

select:focus,
input[type="text"]:focus {
    outline: 2px solid rgba(31, 135, 78, 0.18);
    border-color: rgba(31, 135, 78, 0.28);
}

.news-filter {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.news-filter-category,
.news-filter-library {
    flex: 0 1 200px;
}

.news-filter-query {
    flex: 1 1 220px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.pagination-prev,
.pagination-next,
.pagination-current {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 700;
}

.pagination-prev,
.pagination-next {
    cursor: pointer;
    background: rgba(31, 135, 78, 0.08);
    color: var(--brand-dark);
    transition: background 0.2s ease, transform 0.2s ease;
}

.pagination-prev:hover,
.pagination-next:hover {
    background: rgba(31, 135, 78, 0.16);
    transform: translateY(-1px);
}

.pagination-prev.inactive,
.pagination-next.inactive {
    cursor: default;
    color: #98a69e;
    background: rgba(152, 166, 158, 0.12);
    transform: none;
}

.pagination-current {
    background: var(--brand-dark);
    color: #f6fff9;
}

.table-wrapper {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-radius: 24px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
}

.code-header,
.tree-view-title,
.tabs-header,
.code-type-title,
.news-item-header {
    background: linear-gradient(135deg, var(--brand-dark), var(--brand));
}

.code-header,
.tree-view-title {
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0 3px 0 1rem;
    font-weight: 700;
    color: #f6fff9;
}

.code-title {
    flex: 1;
    min-width: 0;
}

.code-wrapper-exchanges {
    position: static;
    top: auto;
    right: auto;
    margin-left: auto;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.code-wrapper-exchanges select {
    width: auto;
    min-height: 32px;
    padding: 0.3rem 2rem 0.3rem 0.75rem;
    border-radius: 12px;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.14);
    color: #f6fff9;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
    box-shadow: none;
}

.code-wrapper-exchanges select:focus {
    outline-color: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.32);
}

.code-wrapper-exchanges select option {
    color: var(--text-main);
    background: var(--surface);
}

.table {
    width: 100%;
    min-width: 300px;
    border-collapse: collapse;
    background: transparent;
}

.table th,
.table td {
    padding: 0.85rem 1rem;
    border: none;
    border-top: 1px solid rgba(23, 75, 49, 0.08);
    text-align: left;
    vertical-align: top;
}

.table th {
    background: rgba(31, 135, 78, 0.05);
    color: var(--brand-dark);
    font-weight: 700;
    white-space: nowrap;
}

.table tr:first-child th,
.table tr:first-child td {
    border-top: none;
}

.table tr:nth-child(even) td {
    background: rgba(31, 135, 78, 0.02);
}

.code-wrapper,
.tabs,
.tree-view,
.code-type,
.alert,
.info,
.collapse-content {
    border-radius: 12px;
    overflow: hidden;
}

.code-wrapper,
.tabs,
.code-type,
.alert,
.info,
.tree-view,
.collapse-content {
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
}

.code-wrapper pre,
.code-wrapper .code {
    margin: 0;
}

.alert,
.info {
    width: 100%;
    padding: 1rem 1.1rem;
}

.alert {
    border-color: rgba(240, 133, 36, 0.22);
    background: rgba(255, 205, 152, 0.45);
}

.info {
    border-color: rgba(27, 110, 194, 0.18);
    background: rgba(183, 205, 228, 0.4);
}

.tree-view {
    background: #e6e6e6;
}

.tree-view ul {
    padding: 0.9rem 1rem 1rem;
    margin: 0;
    list-style: none;
}

.tree-view li {
    padding: 0.2rem 0;
}

.tabs {
    border: 1px solid var(--border-soft);
}

.tab-content,
.code-type-content,
.news-item-content {
    padding: 1rem 1.1rem;
}

.collapse-content-header {
    background: #69927c;
    color: #fff;
}

.collapse-content.open .collapse-content-header {
    background: var(--brand);
}

.intro {
    display: flex;
    align-items: flex-start;
}

.intro-left {
    padding-right: 2rem;
}

.shields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 1.5rem;
}

.shield {
    display: inline-flex;
}

.shield img {
    display: block;
}

@media (max-width: 900px) {
    .page-header {
        align-items: stretch;
    }

    .page-subtitle {
        margin-top: -0.75rem;
    }

    .intro {
        flex-direction: column;
    }

    .intro-left {
        padding-right: 0;
    }
}
