:root {
    --brand-green: #22ad4a;
    --brand-green-dark: #168c39;
    --brand-black: #171717;
    --brand-red: #e51b23;
    --brand-text: #202020;
    --brand-muted: #6b6b6b;
    --brand-line: #dedede;
    --brand-page: #ffffff;
    --brand-panel: #ffffff;
    --brand-soft: #f6f6f6;
    --brand-input: #ffffff;
    --brand-shadow: 0 10px 28px rgba(0, 0, 0, .10);
    --brand-focus: 0 0 0 4px rgba(34, 173, 74, .16);
}

[data-theme="dark"] {
    --brand-text: #f2f2f2;
    --brand-muted: #b8b8b8;
    --brand-line: #333333;
    --brand-page: #101010;
    --brand-panel: #1a1a1a;
    --brand-soft: #151515;
    --brand-input: #111111;
    --brand-shadow: 0 12px 32px rgba(0, 0, 0, .45);
}

@media (prefers-color-scheme: dark) {
    [data-theme="auto"] {
        --brand-text: #f2f2f2;
        --brand-muted: #b8b8b8;
        --brand-line: #333333;
        --brand-page: #101010;
        --brand-panel: #1a1a1a;
        --brand-soft: #151515;
        --brand-input: #111111;
        --brand-shadow: 0 12px 32px rgba(0, 0, 0, .45);
    }
}

* { box-sizing: border-box; }
html { color-scheme: light dark; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--brand-page);
    color: var(--brand-text);
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.page { min-height: 100vh; }

.site-header {
    background: var(--brand-panel);
    border-bottom: 1px solid var(--brand-line);
}
.contact-strip {
    min-height: 36px;
    border-bottom: 1px solid var(--brand-line);
    color: var(--brand-text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 34px;
    font-size: 14px;
}
.contact-strip strong { color: var(--brand-green); }
.header-main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
}
.brand-logo {
    width: 62px;
    height: 62px;
    object-fit: contain;
    display: block;
}
.brand-logo-fallback {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--brand-green);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 32px;
    transform: skew(-10deg);
}
.brand-word {
    color: var(--brand-text);
    font-size: clamp(30px, 4vw, 52px);
    font-weight: 900;
    letter-spacing: -2px;
    line-height: 1;
}
.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}
.languages {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: flex-end;
}
.language {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--brand-line);
    background: var(--brand-soft);
    color: var(--brand-text);
    padding: 7px 9px;
    border-radius: 2px;
    font-weight: 800;
}
.language.active {
    background: var(--brand-green);
    border-color: var(--brand-green);
    color: #fff;
}
.language small { font-size: 11px; }
.theme-switch {
    display: inline-flex;
    border: 1px solid var(--brand-line);
    background: var(--brand-soft);
    padding: 3px;
    gap: 3px;
}
.theme-switch button {
    min-width: 34px;
    height: 32px;
    border: 0;
    background: transparent;
    color: var(--brand-text);
    cursor: pointer;
    font-weight: 900;
}
.theme-switch button.active {
    background: var(--brand-green);
    color: #fff;
}
.shop-nav {
    background: var(--brand-black);
    color: #fff;
    min-height: 50px;
    display: flex;
    align-items: stretch;
    justify-content: center;
    overflow-x: auto;
}
.shop-nav span {
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-left: 1px solid rgba(255,255,255,.10);
    font-weight: 900;
    font-size: 14px;
    white-space: nowrap;
}
.shop-nav span:last-child { border-right: 1px solid rgba(255,255,255,.10); }
.shop-nav .nav-accent { color: var(--brand-red); }

.hero {
    background: var(--brand-panel);
    color: var(--brand-text);
    padding: 32px clamp(16px, 4vw, 48px) 34px;
}
.hero-inner {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}
.eyebrow {
    color: var(--brand-green);
    font-weight: 900;
    letter-spacing: .16em;
    margin: 0 0 10px;
}
h1 {
    color: var(--brand-text);
    font-size: clamp(30px, 5vw, 50px);
    line-height: 1.08;
    margin: 0;
    font-weight: 900;
}
.subtitle {
    margin: 14px auto 26px;
    max-width: 680px;
    color: var(--brand-muted);
    font-size: 17px;
    line-height: 1.45;
}
.search-card {
    background: var(--brand-panel);
    color: var(--brand-text);
    border: 1px solid var(--brand-line);
    border-radius: 2px;
    padding: 18px;
    box-shadow: var(--brand-shadow);
    text-align: left;
}
.search-card label {
    display: block;
    margin: 0 0 10px;
    font-weight: 900;
    color: var(--brand-text);
}
.search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--brand-line);
    background: var(--brand-input);
    padding: 0 0 0 14px;
}
.search-row:focus-within {
    border-color: var(--brand-green);
    box-shadow: var(--brand-focus);
}
.search-row svg {
    width: 25px;
    height: 25px;
    fill: var(--brand-green);
    flex: none;
}
input[type="search"] {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--brand-text);
    font-size: 20px;
    padding: 17px 14px 17px 0;
}
input[type="search"]::placeholder { color: #a7a7a7; }
.stats {
    margin-top: 12px;
    color: var(--brand-muted);
    font-size: 14px;
}
.stats span:first-child { color: var(--brand-green); font-weight: 900; }

.results-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 48px) 50px;
}
.results-head {
    border-bottom: 1px solid var(--brand-line);
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: end;
    margin-bottom: 20px;
    padding-bottom: 10px;
}
.results-head h2 {
    color: var(--brand-text);
    margin: 0;
    font-size: 23px;
    font-weight: 900;
    position: relative;
}
.results-head h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -11px;
    width: 100%;
    height: 2px;
    background: var(--brand-green);
}
.results-head p {
    color: var(--brand-muted);
    margin: 0;
    text-align: right;
}
.results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.result {
    background: var(--brand-panel);
    border: 1px solid var(--brand-line);
    padding: 16px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .05);
}
.result-code {
    min-width: 62px;
    padding: 10px 9px;
    text-align: center;
    background: var(--brand-green);
    color: #fff;
    font-weight: 900;
    font-size: 20px;
}
.result-title {
    margin: 2px 0 0;
    font-weight: 900;
    line-height: 1.35;
    color: var(--brand-text);
}
mark {
    background: rgba(34, 173, 74, .24);
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}
.empty {
    grid-column: 1 / -1;
    background: var(--brand-panel);
    border: 1px dashed var(--brand-line);
    color: var(--brand-muted);
    padding: 28px;
    text-align: center;
}

@media (max-width: 820px) {
    .contact-strip { align-items: flex-start; flex-direction: column; gap: 5px; padding: 8px 16px; }
    .header-main { align-items: flex-start; flex-direction: column; padding: 20px 16px; }
    .brand-logo, .brand-logo-fallback { width: 48px; height: 48px; }
    .brand-word { font-size: 34px; }
    .header-actions { width: 100%; justify-content: space-between; }
    .shop-nav { justify-content: flex-start; }
    .hero-inner { text-align: left; }
    .results-head { display: block; }
    .results-head p { text-align: left; margin-top: 8px; }
    input[type="search"] { font-size: 17px; }
}

.sticky-tools {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 48px;
    background: var(--brand-panel);
    border-bottom: 1px solid var(--brand-line);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 7px clamp(12px, 3vw, 28px);
    box-shadow: 0 5px 16px rgba(0, 0, 0, .08);
}
.all-codes-button {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    border: 1px solid var(--brand-green);
    background: var(--brand-panel);
    color: var(--brand-green);
    padding: 0 12px;
    font-weight: 900;
    cursor: pointer;
}
.all-codes-button:hover,
.all-codes-button.active {
    background: var(--brand-green);
    color: #fff;
}
.all-codes-icon {
    display: inline-grid;
    place-items: center;
    min-width: 36px;
    height: 22px;
    border-radius: 2px;
    background: currentColor;
    color: var(--brand-panel);
    font-size: 11px;
    line-height: 1;
}
.all-codes-button:hover .all-codes-icon,
.all-codes-button.active .all-codes-icon {
    color: var(--brand-green);
    background: #fff;
}
.alphabet-nav {
    display: flex;
    align-items: center;
    gap: 5px;
    overflow-x: auto;
    scrollbar-width: thin;
    max-width: min(100%, 980px);
    padding: 2px 0;
}
.alphabet-nav:empty { display: none; }
.alphabet-nav a {
    flex: none;
    min-width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--brand-line);
    background: var(--brand-soft);
    color: var(--brand-text);
    font-weight: 900;
    font-size: 13px;
}
.alphabet-nav a:hover,
.alphabet-nav a:focus {
    border-color: var(--brand-green);
    background: var(--brand-green);
    color: #fff;
    outline: 0;
}
.all-codes-mode .results {
    display: block;
}
.letter-section {
    scroll-margin-top: 70px;
    margin-bottom: 26px;
}
.letter-section h3 {
    margin: 0 0 12px;
    padding: 9px 14px;
    background: var(--brand-black);
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    border-left: 5px solid var(--brand-green);
}
.letter-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

@media (max-width: 820px) {
    .sticky-tools {
        justify-content: flex-start;
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }
    .alphabet-nav {
        width: 100%;
        max-width: 100%;
    }
    .all-codes-button {
        width: 100%;
        justify-content: center;
    }
}
