/*
 * «Справочник БИК»: theme on top of engine.css — forest green with a brass detail (distinct from the emerald of
 * «Чей номер», the navy of ОКВЭД and the blue default). Contrast (WCAG AA ≥ 4.5:1):
 *   light — accent #14532d on #fff 9.1:1 (white on accent 9.1:1), link #166534 on #fff 7.1:1 / on #f5f7f9 6.6:1 /
 *           on accent-soft #e8f2ec 6.2:1, brass #7a5c14 on #fff 6.2:1 / on warn #fbf3e3 5.7:1;
 *   dark  — accent #8fd1a6 on #161d23 9.6:1 (on-accent #0b2416 on accent 9.3:1), link #a3dcb6 on #0f1418 11.9:1 /
 *           on accent-soft #16261d 10.1:1, brass #d9b36a on #161d23 8.6:1.
 */
:root {
    --c-accent: #14532d;
    --c-accent-soft: #e8f2ec;
    --c-on-accent: #fff;
    --c-link: #166534;
    --c-focus: #166534;
    --c-brass: #7a5c14;
    --c-ok-border: #2f7a4d;
    --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --c-accent: #8fd1a6;
        --c-accent-soft: #16261d;
        --c-on-accent: #0b2416;
        --c-link: #a3dcb6;
        --c-focus: #a3dcb6;
        --c-brass: #d9b36a;
        --c-ok-border: #5fb07f;
    }
}

/* 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 ---------- */
.site-header { border-top: 3px solid var(--c-brass); }
.site-nav { display: flex; flex-wrap: wrap; 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; }

/* ---------- Common ---------- */
.num, .bic { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.eyebrow { margin: 0 0 var(--s-1); color: var(--c-brass); font-size: var(--fs-sm); font-weight: 600; letter-spacing: .02em; }
.hint { font-size: var(--fs-sm); color: var(--c-muted); }
.h-sub { margin: var(--s-4) 0 var(--s-2); font-family: var(--font); font-size: var(--fs-base); color: var(--c-muted); }
.h-card { margin-top: 0; }
h1 { overflow-wrap: anywhere; }
.source-note { margin: var(--s-1) 0 0; font-size: var(--fs-sm); color: var(--c-muted); }
.source-line { font-weight: 600; }
.badge--warn { border-color: var(--c-warn-border); background: var(--c-warn-soft); color: var(--c-brass); }

/* ---------- Home ---------- */
.hero { margin-bottom: var(--s-5); }
.search-form { display: flex; gap: var(--s-2); max-width: 640px; margin: 0 0 var(--s-2); }
.search-form input[type="search"] { flex: 1; width: 100%; min-width: 0; }
.search-form button { flex: none; }
.link-list li > a { min-height: 44px; display: flex; align-items: center; }
@media (min-width: 640px) {
    .link-list--cols { columns: 2; column-gap: var(--s-6); }
}

/* ---------- BIC / bank page ---------- */
.bic-head { margin-bottom: var(--s-4); }
.bic-head h1 { margin-bottom: var(--s-1); }
.bic-code { display: block; font-family: var(--font); font-size: var(--fs-lg); font-weight: 700; color: var(--c-accent); font-variant-numeric: tabular-nums; }
.bic-name { display: block; }
.kv dd.num { font-size: var(--fs-lg); }

/* Requisites for copying: plain selectable text, wraps instead of scrolling. */
.requisites__text {
    margin: 0 0 var(--s-2);
    padding: var(--s-3) var(--s-4);
    border: 1px dashed var(--c-border-strong);
    border-radius: var(--radius);
    background: var(--c-surface);
    font-family: var(--font-mono);
    font-size: .9375rem;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.copy-btn { margin: 0 0 var(--s-2); }
.copy-btn[data-copied] { border-color: var(--c-ok-border); }

/* Tables of BICs and of accounts: on narrow screens each row becomes a card (no horizontal page scroll). */
.bic-table td:first-child, .bic-table td:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.bic-table td:first-child a { font-weight: 700; }
.liq-list .bic { font-weight: 700; font-variant-numeric: tabular-nums; margin-right: .35em; }
@media (max-width: 639px) {
    .table-wrap--cards { overflow-x: visible; border: 0; background: transparent; }
    .table-wrap--cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .table-wrap--cards table, .table-wrap--cards tbody, .table-wrap--cards tr, .table-wrap--cards td { display: block; width: 100%; }
    .table-wrap--cards tr { margin-bottom: var(--s-2); padding: var(--s-2) var(--s-3); border: 1px solid var(--c-border); border-radius: var(--radius); background: var(--c-surface); }
    .table-wrap--cards td { padding: 2px 0; border: 0; white-space: normal; overflow-wrap: anywhere; }
    .bic-table td:first-child a { display: inline-flex; align-items: center; min-height: 44px; }
    .bic-table td:last-child:not(:empty)::before { content: "Корсчёт: "; color: var(--c-muted); }
    .acc-table td:first-child { font-weight: 700; }
    .acc-table td[data-label]::before { content: attr(data-label) ": "; color: var(--c-muted); }
}

/* ---------- Account check ---------- */
.check-form { max-width: 560px; }
.check-form input { width: 100%; font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.check-form label { display: block; margin-bottom: var(--s-1); font-weight: 600; }
.check-form .hint { margin: var(--s-1) 0 0; }
.check-form--inline { display: grid; gap: var(--s-2); max-width: none; }
@media (min-width: 768px) {
    .check-form--inline { grid-template-columns: 10rem 1fr auto; }
}
.result-ok { border-left-color: var(--c-ok-border); }
.check-result .kv { margin-bottom: var(--s-3); }

/* ---------- Codes on /pravila ---------- */
.codes { margin: 0 0 var(--s-4); }
.codes > div { display: flex; gap: var(--s-3); padding: var(--s-2) 0; border-bottom: 1px solid var(--c-border); }
.codes dt { flex: none; min-width: 3.5em; font-weight: 700; font-variant-numeric: tabular-nums; }
.codes dd { margin: 0; min-width: 0; }
