:root {
    --ink: #10233f;
    --muted: #60708a;
    --brand: #1967d2;
    --brand-dark: #104b9d;
    --teal: #00a896;
    --surface: #ffffff;
    --soft: #f3f7fc;
    --line: #dce6f2;
    --shadow: 0 16px 42px rgba(22, 53, 91, .09);
    --radius: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body {
    margin: 0;
    color: var(--ink);
    background: #fff;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
img { max-width: 100%; }
.main-content { min-height: 60vh; }

.site-header {
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid rgba(220, 230, 242, .9);
    backdrop-filter: blur(16px);
    box-shadow: 0 4px 18px rgba(22, 53, 91, .04);
}
.navbar { min-height: 72px; }
.navbar-brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); }
.navbar-brand img { border-radius: 12px; box-shadow: 0 6px 16px rgba(25, 103, 210, .18); }
.navbar-brand span { display: flex; flex-direction: column; line-height: 1.05; }
.navbar-brand strong { font-size: 1.05rem; letter-spacing: -.02em; }
.navbar-brand small { margin-top: 5px; color: var(--muted); font-size: .7rem; font-weight: 500; }
.navbar .nav-link { color: #334761; font-weight: 650; border-radius: 10px; padding: .65rem .8rem !important; }
.navbar .nav-link:hover { color: var(--brand); background: #eef5ff; }
.navbar-toggler { border: 0; padding: .45rem; }
.language-switcher { display: inline-flex; gap: 3px; padding: 4px; background: var(--soft); border-radius: 11px; }
.language-switcher a { padding: 6px 8px; border-radius: 8px; color: #53657d; font-size: .72rem; font-weight: 800; text-decoration: none; }
.language-switcher a.active { color: #fff; background: var(--brand); box-shadow: 0 4px 10px rgba(25, 103, 210, .22); }

.hero-section {
    position: relative;
    overflow: hidden;
    padding: clamp(4rem, 9vw, 7.5rem) 0;
    color: #fff;
    background: linear-gradient(130deg, #0c3572 0%, #1261c8 56%, #008d91 100%);
}
.hero-section::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px); background-size: 24px 24px; mask-image: linear-gradient(to right, black, transparent); }
.hero-orb { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .22; }
.hero-orb-one { width: 360px; height: 360px; background: #74e6d4; right: -120px; top: -170px; }
.hero-orb-two { width: 260px; height: 260px; background: #7eb5ff; left: 36%; bottom: -180px; }
.hero-section .container-xl { z-index: 1; }
.eyebrow, .section-kicker { display: inline-flex; align-items: center; gap: 8px; color: #8edfd4; font-size: .78rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.hero-section h1 { max-width: 760px; margin: 1rem 0; font-size: clamp(2.65rem, 7vw, 5.7rem); line-height: .98; letter-spacing: -.06em; font-weight: 850; }
.hero-lead { max-width: 680px; margin: 0 0 2rem; color: rgba(255,255,255,.82); font-size: clamp(1.05rem, 2vw, 1.28rem); line-height: 1.65; }
.calculator-search { display: flex; align-items: center; gap: 12px; width: min(100%, 620px); padding: 7px 10px 7px 18px; color: #64748b; background: #fff; border: 1px solid rgba(255,255,255,.5); border-radius: 15px; }
.calculator-search input { width: 100%; min-height: 46px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 1rem; }
.calculator-search kbd { border: 1px solid #dbe4ef; color: #6b7b91; background: #f4f7fb; box-shadow: none; }
.hero-panel { padding: clamp(1.25rem, 4vw, 2rem); border: 1px solid rgba(255,255,255,.22); border-radius: 26px; background: rgba(7, 36, 79, .35); box-shadow: 0 24px 70px rgba(3, 25, 59, .25); backdrop-filter: blur(12px); }
.hero-stat { display: flex; align-items: baseline; justify-content: space-between; padding: 1rem .2rem; border-bottom: 1px solid rgba(255,255,255,.15); }
.hero-stat strong { font-size: clamp(1.9rem, 5vw, 2.8rem); letter-spacing: -.05em; }
.hero-stat span { color: rgba(255,255,255,.72); font-size: .9rem; }
.hero-panel .btn { margin-top: 1.25rem; color: var(--brand-dark); border-radius: 13px; font-weight: 750; }

.section-block { padding: clamp(3.5rem, 7vw, 6rem) 0; }
.section-soft { background: var(--soft); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.section-heading h2 { margin: .35rem 0 0; font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -.045em; font-weight: 820; }
.section-heading p { max-width: 480px; margin: 0; color: var(--muted); }
.section-kicker { color: var(--brand); }
.calculator-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.calculator-card { position: relative; display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 14px; align-items: start; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 24px rgba(22,53,91,.045); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.calculator-card:hover { transform: translateY(-3px); border-color: #bcd4f1; box-shadow: var(--shadow); }
.calculator-icon { display: grid; place-items: center; width: 46px; height: 46px; color: var(--brand); background: #eaf3ff; border-radius: 14px; }
.calculator-copy { min-width: 0; }
.calculator-category { display: block; margin-bottom: 5px; color: var(--teal); font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.calculator-card h3 { margin: 0; font-size: 1.04rem; line-height: 1.35; font-weight: 780; }
.calculator-card h3 a { color: var(--ink); text-decoration: none; }
.calculator-card p { margin: 7px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.55; }
.card-arrow { align-self: center; color: #87a0bd; }
.category-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.category-card { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 13px; padding: 20px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 17px; text-decoration: none; transition: .2s ease; }
.category-card:hover { color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); }
.category-icon { display: grid; place-items: center; width: 42px; height: 42px; color: #fff; background: linear-gradient(135deg, var(--brand), var(--teal)); border-radius: 12px; }
.category-card span:nth-child(2) { display: flex; flex-direction: column; }
.category-card strong { font-size: .95rem; }
.category-card small { margin-top: 3px; color: var(--muted); }

.directory-hero { padding: 3.5rem 0; background: linear-gradient(180deg, #edf5ff, #fff); border-bottom: 1px solid var(--line); }
.directory-hero h1 { max-width: 760px; margin: .6rem 0; font-size: clamp(2rem, 5vw, 3.7rem); letter-spacing: -.05em; font-weight: 850; }
.directory-hero p { max-width: 740px; color: var(--muted); font-size: 1.05rem; }
.directory-search { margin-top: 1.5rem; border-color: var(--line); box-shadow: 0 12px 32px rgba(22,53,91,.08); }
.directory-content { padding-top: 2.5rem; padding-bottom: 4rem; }
.calculator-category-section { padding-top: 1.5rem; margin-bottom: 3.2rem; }
.category-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: .8rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.category-heading h2 { margin: 0; font-size: 1.45rem; font-weight: 800; letter-spacing: -.025em; }
.category-heading span { color: var(--muted); font-size: .82rem; }
.empty-search { padding: 2rem; text-align: center; color: var(--muted); background: var(--soft); border-radius: var(--radius); }

.breadcrumb { white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.breadcrumb-item.active { max-width: 65vw; overflow: hidden; text-overflow: ellipsis; }
.page-calculator .main-content, .page-tool .main-content { padding: 1.5rem 0 4rem; }
.legacy-calculator { width: min(100% - 24px, 1320px); margin-inline: auto; }
.legacy-calculator > .row { --bs-gutter-x: 1.25rem; }
.legacy-calculator h1 { font-size: clamp(1.8rem, 5vw, 2.75rem); letter-spacing: -.04em; font-weight: 820; }
.legacy-calculator h2, .legacy-calculator h3, .legacy-calculator h4 { color: var(--ink); font-weight: 760; }
.legacy-calculator .card { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 32px rgba(22,53,91,.06) !important; }
.legacy-calculator .card-header { padding: 1rem 1.2rem; border-color: var(--line); }
.legacy-calculator .card-body { padding: clamp(1rem, 3vw, 1.5rem); }
.legacy-calculator .form-control, .legacy-calculator .form-select { min-height: 48px; border-color: #cbd8e7; border-radius: 10px; font-size: 16px; }
.legacy-calculator .form-control:focus, .legacy-calculator .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .22rem rgba(25,103,210,.13); }
.legacy-calculator .btn { min-height: 46px; border-radius: 10px; font-weight: 700; }
.legacy-calculator .table-responsive, .legacy-calculator table { max-width: 100%; }
.legacy-calculator canvas { max-width: 100% !important; }
.legacy-calculator pre, .legacy-calculator code { white-space: pre-wrap; overflow-wrap: anywhere; }

.site-footer { padding: 3.5rem 0 1.2rem; color: #c8d5e7; background: #0d2038; }
.footer-brand { display: inline-block; margin-bottom: .8rem; color: #fff; font-size: 1.35rem; font-weight: 850; text-decoration: none; }
.site-footer p { max-width: 520px; color: #9fb0c7; line-height: 1.65; }
.site-footer h2 { color: #fff; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; }
.site-footer a:not(.footer-brand) { display: block; margin: .55rem 0; color: #c8d5e7; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-bottom { padding-top: 1.4rem; margin-top: 2.2rem; border-top: 1px solid rgba(255,255,255,.1); color: #7f93ad; font-size: .82rem; }
.error-page { padding: 5rem 0; }
.error-code { color: #cfe2fb; font-size: clamp(5rem, 18vw, 10rem); line-height: 1; font-weight: 900; letter-spacing: -.08em; }
.error-page h1 { font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -.05em; }
.error-page p { max-width: 680px; margin: 1rem auto 2rem; color: var(--muted); }

@media (max-width: 991.98px) {
    .navbar-collapse { padding: .8rem 0 1rem; }
    .navbar .nav-link { padding: .75rem !important; }
    .hero-section { padding-top: 4rem; }
    .hero-panel { max-width: 620px; }
    .category-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 767.98px) {
    .navbar { min-height: 64px; }
    .navbar-brand small { display: none; }
    .navbar-brand img { width: 36px; height: 36px; }
    .hero-section h1 { max-width: 580px; }
    .hero-lead { line-height: 1.55; }
    .hero-panel { border-radius: 20px; }
    .section-heading { display: block; }
    .section-heading p { margin-top: .75rem; }
    .calculator-grid, .category-grid { grid-template-columns: 1fr; }
    .calculator-card { padding: 16px; }
    .calculator-card p { display: none; }
    .category-card { padding: 16px; }
    .directory-hero { padding: 2.7rem 0; }
    .legacy-calculator { width: min(100% - 16px, 1320px); }
    .legacy-calculator > .row > [class*="col-"] { width: 100%; }
    .legacy-calculator .card { border-radius: 14px; }
    .legacy-calculator .btn-group { display: flex; flex-wrap: wrap; width: 100%; }
    .legacy-calculator .btn-group .btn { flex: 1 1 auto; }
    .legacy-calculator form .btn-primary[type="submit"] { width: 100%; }
}

@media (max-width: 420px) {
    .language-switcher a { padding-inline: 6px; }
    .calculator-card { grid-template-columns: auto minmax(0,1fr); }
    .card-arrow { display: none; }
    .calculator-icon { width: 42px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
