/*
 * Theme «ОКВЭД 2 и ОКПД 2» on top of engine.css: deep navy accent on graphite text.
 * Contrast (WCAG AA ≥ 4.5:1): light — accent #1e3a5f on #fff 11.5:1, link #1f4e8c on #f5f7f9 7.7:1;
 * dark — link #a9c6ee on #0f1418 10.6:1, on-accent #0c1724 on #9dbbe3 9.2:1.
 */
:root {
    --c-text: #1b2129;
    --c-accent: #1e3a5f;
    --c-accent-soft: #e8eef6;
    --c-on-accent: #fff;
    --c-link: #1f4e8c;
    --c-focus: #1f4e8c;
}

@media (prefers-color-scheme: dark) {
    :root {
        --c-accent: #9dbbe3;
        --c-accent-soft: #1a2636;
        --c-on-accent: #0c1724;
        --c-link: #a9c6ee;
        --c-focus: #a9c6ee;
    }
}

/* Inputs at 16px: no zoom-on-focus in iOS Safari. */
input, select, textarea { font-size: 1rem; }
input[type="search"] { -webkit-appearance: none; appearance: none; }

/* ---------- Header: logo, classifier links, search ---------- */
.site-nav { display: flex; gap: 0 var(--s-4); }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }

/* ---------- Home ---------- */
.hero { margin-bottom: var(--s-6); }
.hero .hint, .hint { font-size: var(--fs-sm); color: var(--c-muted); }
.search-form { display: flex; gap: var(--s-2); max-width: 640px; margin: 0 0 var(--s-3); }
.search-form input[type="search"] { flex: 1; width: 100%; min-width: 0; }
.search-form button { flex: none; }
.h-sub { margin: 0 0 var(--s-2); font-family: var(--font); font-size: var(--fs-base); color: var(--c-muted); }

/* ---------- Codes ---------- */
.code { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.code-badge {
    display: inline-block;
    margin-right: .25em;
    padding: 0 .35em;
    border-radius: var(--radius-sm);
    background: var(--c-accent);
    color: var(--c-on-accent);
    font-family: var(--font);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
h1 { overflow-wrap: anywhere; }

/* Code + name rows: the name wraps under itself, never widens the page. */
.code-list { list-style: none; padding: 0; margin: 0 0 var(--s-4); }
.code-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--s-2); border-bottom: 1px solid var(--c-border); }
.code-list li > a { display: flex; gap: var(--s-3); flex: 1 1 14em; min-width: 0; min-height: 44px; padding: 10px 0; text-decoration: none; }
.code-list li > a:hover .code-name { text-decoration: underline; }
.code-list .code { flex: none; min-width: 4.5em; }
.code-list .code-name { min-width: 0; overflow-wrap: anywhere; color: var(--c-text); }
.code-list .badge { flex: none; margin-left: auto; }
.sections .code { display: inline-block; min-width: 1.5em; }

/* Section tree: nested lists with a guide line. */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: .5em; padding-left: var(--s-3); border-left: 1px solid var(--c-border); }
.tree a { display: block; min-height: 44px; padding: 10px 0; overflow-wrap: anywhere; }
.tree > li > a { font-weight: 600; }
.tree .code { margin-right: .35em; }

/* Explanations of Rosstat. */
.notes { max-width: var(--measure); }
.notes p { margin: 0 0 var(--s-2); }
.notes .notes-h { margin: var(--s-4) 0 var(--s-2); font-family: var(--font); font-size: var(--fs-base); font-weight: 600; }
.notes .notes-h:first-child { margin-top: 0; }
.notes ul { margin: 0 0 var(--s-3); padding-left: 1.25em; }
.notes li { margin-bottom: var(--s-1); }
.notes a { font-variant-numeric: tabular-nums; white-space: nowrap; }

.parent-name { margin-top: var(--s-2); }
.other-classifier a { display: inline-block; min-height: 44px; padding-block: 11px; font-weight: 600; }
.source { margin-top: var(--s-6); padding-top: var(--s-3); border-top: 1px solid var(--c-border); font-size: var(--fs-sm); color: var(--c-muted); }
.source a { display: inline-block; min-height: 44px; padding-block: 11px; margin-block: -11px; }

@media (max-width: 479px) {
    .code-list .code { min-width: 0; }
    .search-form button { padding-inline: 14px; }
}
