:root {
    color-scheme: light;
    --bg: #f7f5ef;
    --surface: #ffffff;
    --surface-strong: #103b36;
    --text: #16201f;
    --muted: #5d6b68;
    --line: #dbe2dd;
    --accent: #0f766e;
    --accent-dark: #0b5650;
    --gold: #d99d2b;
    --danger: #a63535;
    --shadow: 0 18px 45px rgba(22, 32, 31, .10);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

.site-header,
.site-footer,
main {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 0;
}

.brand,
.site-nav,
.data-meter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand {
    font-weight: 800;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: var(--surface-strong);
    color: white;
    font-size: 13px;
    letter-spacing: .04em;
}

.site-nav a {
    padding: 10px 12px;
    color: var(--muted);
    font-weight: 650;
}

.site-nav a:hover {
    color: var(--accent-dark);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
    gap: 36px;
    align-items: center;
    min-height: 500px;
    padding: 48px 0 34px;
}

.hero-copy h1,
.page-intro h1,
.detail-header h1 {
    margin: 0;
    max-width: 780px;
    font-size: clamp(2.35rem, 5vw, 5rem);
    line-height: .98;
    letter-spacing: 0;
}

.detail-header h1 {
    font-size: clamp(2rem, 4vw, 3.8rem);
}

.detail-header h1 span {
    color: var(--accent-dark);
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent-dark);
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.lead {
    max-width: 660px;
    color: var(--muted);
    font-size: 1.12rem;
    line-height: 1.6;
}

.search-panel,
.converter-panel {
    position: relative;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.converter-panel {
    max-width: 740px;
    margin: 0 0 34px;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 800;
}

.search-row {
    display: flex;
    gap: 10px;
}

input {
    width: 100%;
    min-height: 54px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 16px;
    color: var(--text);
    font: inherit;
    background: #fbfcfb;
}

input:focus {
    outline: 3px solid rgba(15, 118, 110, .18);
    border-color: var(--accent);
}

button,
.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    border: 0;
    border-radius: 8px;
    padding: 0 20px;
    background: var(--accent);
    color: white;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

button:hover,
.button-link:hover {
    background: var(--accent-dark);
}

.hint,
.result-item p,
.section-heading p,
.site-footer,
.source-line {
    color: var(--muted);
}

.hint {
    margin: 12px 0 0;
    font-size: .92rem;
}

.live-results {
    position: absolute;
    z-index: 10;
    right: 24px;
    left: 24px;
    top: calc(100% - 18px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.live-results a {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
}

.live-results a:last-child {
    border-bottom: 0;
}

.live-results a:hover {
    background: #f1f7f5;
}

.quick-actions,
.section-heading,
.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.quick-actions {
    margin: 6px 0 42px;
}

.action-link {
    display: grid;
    gap: 4px;
    padding: 18px 20px;
    border-left: 4px solid var(--gold);
    background: rgba(255, 255, 255, .65);
}

.action-link span {
    color: var(--muted);
}

.data-meter {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.data-meter span,
.badge {
    padding: 7px 10px;
    border-radius: 999px;
    background: #e8efeb;
    color: var(--accent-dark);
    font-size: .84rem;
    font-weight: 800;
}

.results-section,
.page-intro,
.detail-layout {
    padding: 28px 0 48px;
}

.page-intro {
    max-width: 820px;
}

.section-heading {
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.section-heading h2,
.detail-section h2 {
    margin: 0 0 14px;
    font-size: 1.45rem;
}

.result-list {
    display: grid;
    gap: 12px;
}

.result-item {
    display: grid;
    grid-template-columns: 104px 1fr;
    gap: 18px;
    align-items: start;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.code-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border-radius: 8px;
    background: var(--surface-strong);
    color: white;
    font-weight: 900;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--accent-dark);
    font-size: .9rem;
    font-weight: 800;
}

.result-item h3 {
    margin: 5px 0 8px;
    font-size: 1.12rem;
    line-height: 1.35;
}

.result-item h3 a:hover {
    color: var(--accent-dark);
}

.result-item p {
    margin: 0;
    line-height: 1.5;
}

.notice,
.empty-state {
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff9e9;
}

.notice-error {
    border-color: rgba(166, 53, 53, .25);
    color: var(--danger);
    background: #fff1f1;
}

.detail-header {
    align-items: flex-start;
    margin-bottom: 30px;
}

.detail-section {
    margin-bottom: 22px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.detail-section h3 {
    margin: 18px 0 8px;
    color: var(--accent-dark);
}

.detail-section p {
    line-height: 1.7;
}

.hierarchy {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hierarchy li {
    display: grid;
    grid-template-columns: 110px 78px 1fr;
    gap: 12px;
    align-items: baseline;
    padding: 12px;
    border-radius: 8px;
    background: #f6faf8;
}

.hierarchy span {
    color: var(--muted);
    font-size: .9rem;
}

.site-footer {
    padding: 36px 0;
    border-top: 1px solid var(--line);
    font-size: .92rem;
}

@media (max-width: 820px) {
    .site-header,
    .quick-actions,
    .detail-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero {
        grid-template-columns: 1fr;
        min-height: auto;
        padding-top: 28px;
    }

    .search-row {
        flex-direction: column;
    }

    button,
    .button-link {
        width: 100%;
    }

    .data-meter {
        justify-content: flex-start;
    }

    .result-item,
    .hierarchy li {
        grid-template-columns: 1fr;
    }
}

