:root {
    --bg: #f6f8fb;
    --surface: #ffffff;
    --surface-2: #ecfeff;
    --ink: #0f172a;
    --muted: #526179;
    --line: #dbe4ee;
    --brand: #0e7490;
    --brand-dark: #155e75;
    --accent: #84cc16;
    --accent-2: #f59e0b;
    --danger: #b91c1c;
    --shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
    --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(14,116,144,0.10), transparent 32rem),
        linear-gradient(180deg, #f8fafc 0%, var(--bg) 100%);
    line-height: 1.6;
}
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem clamp(1rem, 4vw, 3rem);
    background: rgba(255,255,255,0.9);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: .75rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 15px;
    color: white;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    font-size: 1.35rem;
    font-weight: 900;
    box-shadow: var(--shadow);
}
.brand strong { display: block; font-size: 1.1rem; }
.brand small { display: block; color: var(--muted); font-size: .78rem; margin-top: -2px; }
.top-nav { display: flex; align-items: center; gap: .25rem; }
.top-nav a {
    padding: .65rem .9rem;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 700;
    font-size: .94rem;
}
.top-nav a:hover { color: var(--ink); background: #e0f2fe; text-decoration: none; }
.nav-toggle { display: none; border: 0; background: var(--brand); color: white; border-radius: 12px; padding: .55rem .7rem; font-size: 1.2rem; }

.page-shell {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: clamp(1rem, 3vw, 2rem);
    width: min(1240px, calc(100% - 2rem));
    margin: 2rem auto;
    align-items: start;
}
.sidebar {
    position: sticky;
    top: 92px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.sidebar-title {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.1rem;
    color: var(--ink);
    background: linear-gradient(135deg, #cffafe, #ecfccb);
    border: 0;
    font-weight: 900;
    text-align: left;
    cursor: pointer;
}
.sidebar-list { display: grid; padding: .5rem; }
.sidebar-list a { padding: .65rem .8rem; border-radius: 13px; color: var(--muted); font-weight: 700; }
.sidebar-list a:hover { background: #f1f5f9; color: var(--ink); text-decoration: none; }
.sidebar.collapsed .sidebar-list { display: none; }
.content { min-width: 0; display: grid; gap: 1.3rem; }
.hero, .page-title, .panel, .converter-card, .finder-card, .currency-card, .category-card {
    background: rgba(255,255,255,.95);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.4rem;
    padding: clamp(1.4rem, 4vw, 2.3rem);
    background: linear-gradient(135deg, #ffffff 0%, #ecfeff 55%, #f7fee7 100%);
}
.eyebrow {
    margin: 0 0 .45rem;
    color: var(--brand-dark);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}
h1, h2, h3 { line-height: 1.15; margin: 0 0 .7rem; }
h1 { font-size: clamp(2rem, 5vw, 4rem); letter-spacing: -.04em; }
h2 { font-size: clamp(1.25rem, 3vw, 1.7rem); letter-spacing: -.02em; }
p { margin-top: 0; color: var(--muted); }
.hero-copy { max-width: 720px; font-size: clamp(1rem, 2.5vw, 1.25rem); margin-bottom: 0; }
.hero-cta, .primary-btn, .primary-link, .button-light {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: .75rem 1rem;
    border-radius: 999px;
    border: 0;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
}
.hero-cta, .primary-btn, .primary-link {
    color: white;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
}
.button-light { background: white; color: var(--brand-dark); }
.hero-cta:hover, .primary-btn:hover, .primary-link:hover, .button-light:hover { transform: translateY(-1px); text-decoration: none; }
.converter-card, .finder-card, .currency-card, .panel, .page-title { padding: clamp(1rem, 3vw, 1.5rem); }
.converter-card { border-top: 6px solid var(--brand); }
.converter-grid {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(170px, 1.3fr) auto minmax(120px, 1fr) minmax(170px, 1.3fr);
    gap: .9rem;
    align-items: end;
}
.field-wide { grid-column: 1 / -1; }
.field { display: grid; gap: .35rem; }
.field span { font-size: .82rem; color: var(--muted); font-weight: 900; }
input, select {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: .72rem .8rem;
    color: var(--ink);
    background: white;
    font: inherit;
    outline: none;
}
input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(14,116,144,.12); }
input[readonly] { background: #f8fafc; font-weight: 900; }
.swap-btn {
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 14px;
    background: #ecfeff;
    color: var(--brand-dark);
    font-size: 1.4rem;
    font-weight: 900;
    cursor: pointer;
}
.converter-note, .formula-line {
    margin: 1rem 0 0;
    padding: .8rem 1rem;
    border-radius: 15px;
    background: #f8fafc;
    color: var(--ink);
    font-weight: 800;
}
.split-section { display: grid; grid-template-columns: 2fr 1fr; gap: 1.3rem; }
.accent-panel { background: linear-gradient(135deg, var(--brand-dark), var(--brand)); color: white; }
.accent-panel p, .accent-panel h2 { color: white; }
.popular-columns { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem 1.5rem; }
.popular-columns ul { margin: 0; padding-left: 1.2rem; }
.popular-columns li { margin: .35rem 0; }
.category-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.category-card { padding: 1.25rem; }
.category-card span {
    display: inline-flex;
    margin-top: .5rem;
    padding: .35rem .6rem;
    border-radius: 999px;
    background: #f7fee7;
    color: #3f6212;
    font-size: .82rem;
    font-weight: 900;
}
.tag-list { display: flex; flex-wrap: wrap; gap: .55rem; }
.tag-list a {
    padding: .45rem .7rem;
    border-radius: 999px;
    background: #ecfeff;
    color: var(--brand-dark);
    font-weight: 800;
}
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
.unit-table { width: 100%; border-collapse: collapse; min-width: 720px; background: white; }
.unit-table th, .unit-table td { padding: .85rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.unit-table th { background: #f1f5f9; font-size: .83rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.unit-table tr:last-child td { border-bottom: 0; }
.finder-card, .currency-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; align-items: end; }
.finder-card .primary-btn, .currency-card .primary-btn { grid-column: span 2; }
.finder-result { grid-column: 1 / -1; padding: 1rem; border-radius: 16px; background: #f8fafc; color: var(--ink); }
.site-footer {
    width: min(1240px, calc(100% - 2rem));
    margin: 2rem auto 3rem;
    padding: 1.2rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--muted);
}
.site-footer p { max-width: 680px; margin: .25rem 0 0; }
.footer-links { display: flex; gap: .8rem; flex-wrap: wrap; }

@media (max-width: 960px) {
    .page-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .converter-grid { grid-template-columns: 1fr 1fr; }
    .swap-btn { grid-column: 1 / -1; width: 100%; }
    .split-section { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .site-header { align-items: flex-start; }
    .nav-toggle { display: block; }
    .top-nav { display: none; position: absolute; top: 74px; left: 1rem; right: 1rem; padding: .75rem; background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
    .top-nav.open { display: grid; }
    .hero { align-items: flex-start; flex-direction: column; }
    .converter-grid, .popular-columns, .category-cards, .finder-card, .currency-card { grid-template-columns: 1fr; }
    .finder-card .primary-btn, .currency-card .primary-btn { grid-column: auto; }
    .site-footer { flex-direction: column; }
}

/* V4 SEO/content quality blocks */
.example-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}
.example-card {
    padding: .9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #f8fafc;
    color: var(--ink);
    font-weight: 800;
}
.faq-panel details {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #ffffff;
    padding: .85rem 1rem;
    margin-top: .7rem;
}
.faq-panel summary {
    cursor: pointer;
    color: var(--ink);
    font-weight: 900;
}
.faq-panel details p {
    margin: .7rem 0 0;
}
.seo-helper-note {
    margin-top: .9rem;
    font-size: .9rem;
    color: var(--muted);
}
.action-row {
    display: flex;
    gap: .7rem;
    flex-wrap: wrap;
    align-items: center;
}
.button-light.bordered {
    border: 1px solid var(--line);
}
.not-found-card {
    min-height: 320px;
    display: grid;
    align-content: center;
}
@media (max-width: 720px) {
    .example-grid { grid-template-columns: 1fr; }
}

/* V5 Search Console query targeting blocks */
.answer-card {
    padding: clamp(1rem, 3vw, 1.5rem);
    background: linear-gradient(135deg, #f0fdfa, #ffffff 65%, #fefce8);
    border: 1px solid var(--line);
    border-left: 6px solid var(--accent);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.answer-value {
    color: var(--ink);
    font-size: clamp(1.25rem, 3vw, 2rem);
    font-weight: 950;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: .65rem;
}
.answer-card p:last-child { margin-bottom: 0; }
.plain-list { margin: 0; padding-left: 1.25rem; color: var(--muted); }
.plain-list li { margin: .55rem 0; }
