/* ── Reset & base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:       #2563eb;
    --primary-dark:  #1d4ed8;
    --primary-light: #eff6ff;
    --accent:        #f59e0b;
    --success:       #16a34a;
    --error:         #dc2626;
    --warning:       #d97706;

    --dark:   #0f172a;
    --text:   #1e293b;
    --muted:  #64748b;
    --border: #e2e8f0;
    --light:  #f8fafc;
    --white:  #ffffff;

    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --radius:    0.5rem;
    --radius-lg: 1rem;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow:    0 4px 16px rgba(0,0,0,.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
    --transition: 160ms ease;
    --max-w: 1200px;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
ul, ol { padding-left: 1.25rem; }

/* ── Typography ───────────────────────────────────────────────────────────── */
h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; color: var(--dark); }
h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.875rem); }
h3 { font-size: 1.125rem; }
p  { margin-bottom: .75rem; }
p:last-child { margin-bottom: 0; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.25rem;
}

.section { padding: 4rem 0; }
.bg-light { background: var(--light); }

.content-narrow {
    max-width: 780px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
}

/* ── Header / Nav ─────────────────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: 64px;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark);
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
}
.nav-logo strong { color: var(--primary); }
.nav-logo:hover { text-decoration: none; opacity: .85; }

.nav-menu {
    display: flex;
    list-style: none;
    gap: .25rem;
    margin-left: auto;
    padding: 0;
    align-items: center;
}

.nav-menu a {
    display: block;
    padding: .45rem .75rem;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}
.nav-menu a:hover,
.nav-menu a.active { background: var(--primary-light); color: var(--primary); }

/* ── Mega menu ────────────────────────────────────────────────────────────── */
.has-mega { position: static; }
.mega-trigger-row { display: flex; align-items: center; }
.mega-trigger-row > a { display: flex; align-items: center; gap: .3rem; }
.icon-chevron { transition: transform var(--transition); flex-shrink: 0; }

/* desktop: mobile-toggle is just a visual chevron attached to the link */
.mega-mob-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: .45rem .35rem;
    color: var(--text);
    border-radius: var(--radius);
    transition: background var(--transition);
}
.mega-mob-toggle:hover { background: var(--primary-light); color: var(--primary); }

.mega-menu {
    display: none;
    position: absolute;max-width: var(--max-w);
    top: 64px;
    left: 0;
    right: 0; 
    margin-left: auto;
    margin-right: auto;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--white);
    border-top: 2px solid var(--primary);
    border-bottom: 1px solid var(--border);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 300;
    padding: 1.75rem 0 1.25rem;
}
.mega-inner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem 2rem;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.5rem;
}
.mega-col-head {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--primary);
    margin-bottom: .5rem;
    padding-bottom: .35rem;
    border-bottom: 1px solid var(--border);
}
.mega-col ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .1rem; }
.mega-col ul li a {
    display: block;
    padding: .25rem .35rem;
    font-size: .825rem;
    color: var(--text);
    border-radius: calc(var(--radius) - 2px);
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mega-col ul li a:hover { background: var(--primary-light); color: var(--primary); }
.mega-footer {
    max-width: var(--max-w);
    margin: 1rem auto 0;
    padding: .75rem 1.5rem 0;
    border-top: 1px solid var(--border);
    text-align: right;
}
.mega-footer a { font-size: .85rem; font-weight: 600; color: var(--primary); text-decoration: none; }
.mega-footer a:hover { text-decoration: underline; }

/* open states — managed by JS (.is-open = desktop hover, .mob-open = mobile tap) */
.has-mega.is-open .mega-menu  { display: block; }
.has-mega.is-open .icon-chevron { transform: rotate(180deg); }

/* Mobile toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    padding: 6px;
    margin-left: auto;
}
.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Breadcrumb ───────────────────────────────────────────────────────────── */
.breadcrumb-wrap {
    background: var(--light);
    border-bottom: 1px solid var(--border);
    padding: .6rem 0;
}
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    list-style: none;
    padding: 0;
    font-size: .8125rem;
    color: var(--muted);
    align-items: center;
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb [aria-current] { color: var(--text); font-weight: 500; }
.sep { color: var(--border); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .6rem 1.25rem;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); text-decoration: none; }


.btn-outline {
  background: transparent;

  color: var(--white);
  border-color: var(--white);
}
.btn-outline:hover { background: var(--primary); text-decoration: none; }
.btn-lg { padding: .8rem 1.75rem; font-size: 1rem; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 50%, #3b82f6 100%);
    color: var(--white);
    padding: 5rem 0 4rem;
    text-align: center;
}
.hero-content { max-width: 680px; margin: 0 auto; }
.hero h1 { color: var(--white); font-size: clamp(2rem, 5vw, 3.25rem); margin-bottom: 1rem; }
.hero-accent { color: #93c5fd; }
.hero-sub { font-size: 1.125rem; opacity: .9; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Section header ───────────────────────────────────────────────────────── */
.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.section-header h2 { margin-bottom: .5rem; }
.section-header p  { color: var(--muted); }
.section-link { font-size: .9rem; font-weight: 600; }

/* ── Calculator cards grid ────────────────────────────────────────────────── */
.calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}
.calc-card {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: 1.5rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
    text-decoration: none;
    color: inherit;
}
.calc-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary);
    transform: translateY(-2px);
    text-decoration: none;
}
.calc-card-more { border-style: dashed; background: var(--light); }
.calc-icon { font-size: 2rem; line-height: 1; }
.calc-card h3 { font-size: 1rem; color: var(--dark); }
.calc-card p   { font-size: .875rem; color: var(--muted); flex: 1; }
.calc-tag { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--primary); background: var(--primary-light); padding: .2rem .5rem; border-radius: 99px; align-self: flex-start; margin-top: auto; }

/* ── Features grid ────────────────────────────────────────────────────────── */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}
.feature { text-align: center; padding: 1.5rem; }
.feature-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.feature h3 { margin-bottom: .5rem; font-size: 1.05rem; }
.feature p  { color: var(--muted); font-size: .9rem; }

/* ── Blog grid ────────────────────────────────────────────────────────────── */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.blog-grid-full { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); margin-bottom: 3rem; }

.blog-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    transition: box-shadow var(--transition);
}
.blog-card:hover { box-shadow: var(--shadow); }
.blog-card-meta { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.blog-tag { background: var(--primary-light); color: var(--primary); padding: .2rem .6rem; border-radius: 99px; font-size: .75rem; font-weight: 600; }
.reading-time { color: var(--muted); font-size: .8rem; }
.blog-card h2, .blog-card h3 { font-size: 1.05rem; line-height: 1.35; margin-bottom: .25rem; }
.blog-card h2 a, .blog-card h3 a { color: var(--dark); }
.blog-card h2 a:hover, .blog-card h3 a:hover { color: var(--primary); text-decoration: none; }
.blog-card p { font-size: .875rem; color: var(--muted); flex: 1; }
.read-more { font-size: .875rem; font-weight: 600; color: var(--primary); margin-top: auto; }

/* ── Page header ──────────────────────────────────────────────────────────── */
.page-header {
    background: var(--light);
    border-bottom: 1px solid var(--border);
    padding: 3rem 0 2.5rem;
}
.page-header h1 { margin-bottom: .5rem; }
.page-sub { color: var(--muted); font-size: 1.05rem; }

/* ── Calculator layout ────────────────────────────────────────────────────── */
.calc-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2rem;
    align-items: start;
    padding: 2.5rem 1.25rem;
}

.calc-card-widget {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}
.calc-card-widget h2 { margin-bottom: 1.25rem; font-size: 1.25rem; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.calc-form { display: flex; flex-direction: column; gap: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: .35rem; }
label { font-size: .875rem; font-weight: 600; color: var(--text); }

input[type="number"],
input[type="text"],
input[type="email"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: .65rem .9rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: .9rem;
    color: var(--text);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
    -webkit-appearance: none;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; padding-right: 2.25rem; }

.input-addon {
    display: flex;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.input-addon:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.input-addon input,
.input-addon select {
    border: none;
    border-radius: 0;
    flex: 1;
    box-shadow: none !important;
}
.input-addon input:focus,
.input-addon select:focus { box-shadow: none !important; }
.addon {
    display: flex;
    align-items: center;
    padding: 0 .85rem;
    background: var(--light);
    border-left: 1.5px solid var(--border);
    font-size: .8rem;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
}

/* ── Results ──────────────────────────────────────────────────────────────── */
.calc-result {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}
.calc-result.hidden { display: none; }

.result-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: .25rem;
    margin-bottom: 1.25rem;
}
.result-label { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.result-value { font-size: clamp(2rem, 6vw, 3rem); font-weight: 800; color: var(--primary); line-height: 1; }
.result-unit  { font-size: .9rem; color: var(--muted); }
.result-category { font-size: 1.25rem; font-weight: 700; margin-bottom: .5rem; }
.result-detail { font-size: .875rem; color: var(--muted); text-align: center; }

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: .75rem;
}
.three-col { grid-template-columns: repeat(3, 1fr); }

.rg-item {
    background: var(--light);
    border-radius: var(--radius);
    padding: .85rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.rg-item.highlight { background: var(--primary-light); }
.rg-item span { font-size: .75rem; color: var(--muted); font-weight: 500; }
.rg-item strong { font-size: 1rem; font-weight: 700; color: var(--dark); }
.rg-item.highlight strong { color: var(--primary); }

/* Salary deduction table */
.deductions-table { margin-top: 1rem; }
.ded-row { display: flex; justify-content: space-between; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.ded-row:last-child { border-bottom: none; }
.ded-row.neg strong { color: var(--error); }
.ded-row.total { font-weight: 700; padding-top: .75rem; }
.ded-row.total strong { color: var(--success); font-size: 1.1rem; }

/* Inline results (procent) */
.multi-calc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; padding: 2rem 0; }
.inline-result { margin-top: 1rem; padding: 1rem; background: var(--primary-light); border-radius: var(--radius); }
.result-line { font-size: .95rem; }
.result-line strong { color: var(--primary); font-size: 1.1rem; }
.calc-desc { font-size: .875rem; color: var(--muted); margin-bottom: .75rem; }
.err { color: var(--error); font-size: .875rem; }

/* ── BMI scale ────────────────────────────────────────────────────────────── */
.bmi-scale { margin: 1.25rem 0 .75rem; }
.bmi-bar {
    position: relative;
    display: flex;
    border-radius: var(--radius);
    overflow: hidden;
    height: 48px;
    font-size: .7rem;
    text-align: center;
}
.bmi-segment { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: .2rem; line-height: 1.2; color: white; font-weight: 600; }
.seg-sub    { background: #3b82f6; }
.seg-normal { background: #22c55e; }
.seg-over   { background: #f59e0b; }
.seg-obese  { background: #ef4444; }
.bmi-pointer {
    position: absolute;
    top: -6px;
    width: 3px;
    height: calc(100% + 12px);
    background: var(--dark);
    border-radius: 2px;
    transform: translateX(-50%);
    transition: left .4s ease;
    z-index: 2;
    pointer-events: none;
}

/* ── Tabs ─────────────────────────────────────────────────────────────────── */
.tab-bar {
    display: flex;
    gap: .5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.tab-bar-lg { padding: 2rem 0 0; }
.tab-btn {
    padding: .5rem 1.1rem;
    border: 1.5px solid var(--border);
    border-radius: 99px;
    background: var(--white);
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--muted);
    transition: all var(--transition);
}
.tab-btn.active, .tab-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}
.tab-panel.hidden { display: none; }

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.calc-sidebar { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 80px; }
.info-box {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}
.info-box h3 { font-size: .9rem; margin-bottom: .75rem; color: var(--dark); }
.formula {
    font-family: 'Courier New', monospace;
    font-size: .8rem;
    background: var(--light);
    padding: .75rem;
    border-radius: var(--radius);
    line-height: 1.8;
    color: var(--text);
}
.formula-small {
    font-family: 'Courier New', monospace;
    font-size: .8rem;
    background: var(--light);
    padding: .5rem .75rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    color: var(--muted);
}
.info-text { font-size: .85rem; color: var(--muted); line-height: 1.5; }
.sidebar-link { display: block; font-size: .875rem; font-weight: 500; padding: .4rem 0; }

/* Mini table in sidebar */
.mini-table { width: 100%; font-size: .8rem; border-collapse: collapse; }
.mini-table tr { border-bottom: 1px solid var(--border); }
.mini-table tr:last-child { border-bottom: none; }
.mini-table td { padding: .35rem 0; }
.mini-table td:last-child { text-align: right; font-weight: 600; }

/* Category IMC tags */
.cat-tag { font-size: .7rem; font-weight: 700; padding: .15rem .5rem; border-radius: 99px; white-space: nowrap; }
.cat-sub    { background: #dbeafe; color: #1d4ed8; }
.cat-normal { background: #dcfce7; color: #15803d; }
.cat-over   { background: #fef3c7; color: #92400e; }
.cat-obese  { background: #fee2e2; color: #991b1b; }

/* ── Conversii ────────────────────────────────────────────────────────────── */
.conv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; }
.conv-field { display: flex; flex-direction: column; gap: .3rem; }
.conv-field label { font-size: .8rem; font-weight: 600; color: var(--muted); }

/* ── Calculator category page ─────────────────────────────────────────────── */
.calc-category { padding: 2.5rem 0; border-bottom: 1px solid var(--border); }
.calc-category:first-child { padding-top: 2rem; }
.calc-category:last-child { border-bottom: none; }
.cat-title { margin-bottom: 1.25rem; font-size: 1.25rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-size: .9rem; }

/* ── Table ────────────────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.data-table th { background: var(--light); font-weight: 600; text-align: left; }
.data-table th, .data-table td { padding: .6rem .8rem; border: 1px solid var(--border); }
.data-table tbody tr:nth-child(even) { background: var(--light); }

.table-section { margin-top: 2rem; }
.table-section h2 { margin-bottom: 1rem; }
.table-scroll { overflow-x: auto; }

/* ── FAQ ──────────────────────────────────────────────────────────────────── */
.faq-section { margin-top: 2rem; }
.faq-section h2 { margin-bottom: 1rem;text-align: center; }
.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: .5rem;
    overflow: hidden;
}
.faq-item summary {
    padding: .9rem 1rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .9rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.2rem; color: var(--primary); flex-shrink: 0; }
.faq-item[open] summary::after { content: '–'; }
.faq-item p { padding: .75rem 1rem 1rem; color: var(--muted); font-size: .875rem; border-top: 1px solid var(--border); }

/* ── Info callout ─────────────────────────────────────────────────────────── */
.info-callout {
    background: var(--primary-light);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}
.info-callout h3 { font-size: 1rem; margin-bottom: .5rem; color: var(--primary-dark); }
.info-callout ul { color: var(--text); font-size: .875rem; padding-left: 1.25rem; }
.info-callout li { margin-bottom: .35rem; }

.disclaimer-box {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    font-size: .85rem;
    color: #78350f;
    margin-bottom: 1.5rem;
}

/* ── Related calcs ────────────────────────────────────────────────────────── */
.related-calcs { margin-top: 1.5rem; }
.related-calcs h2 { margin-bottom: .75rem; font-size: 1.1rem; }
.related-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.related-item {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .45rem .9rem;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 99px;
    font-size: .875rem;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    transition: all var(--transition);
}
.related-item:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); text-decoration: none; }

/* ── Blog filters ─────────────────────────────────────────────────────────── */
.blog-filters { padding: 1.5rem 0; display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; border-bottom: 1px solid var(--border); margin-bottom: 2rem; }
.search-form { display: flex; gap: .5rem; flex: 1; min-width: 200px; }
.search-form input { flex: 1; }
.cat-filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.cat-btn {
    padding: .35rem .85rem;
    border: 1.5px solid var(--border);
    border-radius: 99px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--muted);
    background: var(--white);
    text-decoration: none;
    transition: all var(--transition);
}
.cat-btn.active, .cat-btn:hover { background: var(--primary); border-color: var(--primary); color: var(--white); text-decoration: none; }
.empty-state { text-align: center; padding: 4rem 0; color: var(--muted); }

/* ── Article ──────────────────────────────────────────────────────────────── */
.article-layout {}
.article-header { background: var(--light); border-bottom: 1px solid var(--border); padding: 3rem 0 2.5rem; }
.article-meta { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: .75rem; font-size: .8rem; color: var(--muted); }
.article-excerpt { font-size: 1.125rem; color: var(--muted); margin: .75rem 0; line-height: 1.65; }
.article-author { font-size: .8rem; color: var(--muted); display: block; margin-top: .75rem; }
.article-body { padding: 2rem 0; }
.article-footer { padding: 1.5rem 0; border-top: 1px solid var(--border); margin-top: 1rem; }
.disclaimer { font-style: italic; color: var(--muted); font-size: .875rem; margin-bottom: 1rem; }

/* Related calculators block inside blog articles */
.article-related-calcs { margin: 2rem 0 1rem; padding: 1.25rem 1.5rem; background: var(--primary-light); border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: var(--radius-lg); }
.article-related-calcs h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--primary); margin-bottom: .85rem; }
.arc-grid { display: flex; flex-wrap: wrap; gap: .5rem; }
.arc-item { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .75rem; background: var(--white); border: 1px solid var(--border); border-radius: 999px; font-size: .825rem; color: var(--text); text-decoration: none; transition: background var(--transition), color var(--transition), border-color var(--transition); white-space: nowrap; }
.arc-item:hover { background: var(--primary); color: #fff; border-color: var(--primary); text-decoration: none; }
.arc-icon { font-size: 1rem; line-height: 1; }
[data-theme="dark"] .article-related-calcs { background: rgba(30,58,138,.15); border-color: #334155; border-left-color: #60a5fa; }
[data-theme="dark"] .arc-item { background: #1e293b; border-color: #334155; color: #e2e8f0; }

/* ── Prose ────────────────────────────────────────────────────────────────── */
.prose h2 { margin: 2rem 0 .75rem; }
.prose h3 { margin: 1.5rem 0 .5rem; font-size: 1rem; }
.prose ul, .prose ol { margin: .75rem 0 .75rem 1.25rem; }
.prose li { margin-bottom: .35rem; font-size: .9375rem; }
.prose p  { font-size: .9375rem; line-height: 1.7; }
.prose table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .875rem; }
.prose th, .prose td { padding: .6rem .8rem; border: 1px solid var(--border); text-align: left; }
.prose th { background: var(--light); font-weight: 600; }
.prose a { color: var(--primary); }
.formula-box {
    background: var(--primary-light);
    border-left: 4px solid var(--primary);
    padding: 1rem 1.25rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
    font-size: .9rem;
    line-height: 1.8;
}

/* ── Contact form ─────────────────────────────────────────────────────────── */
.contact-form { display: flex; flex-direction: column; gap: 1.25rem; margin-bottom: 2.5rem; }
.contact-info { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.contact-info h2 { margin-bottom: 1rem; }
.contact-info p { margin-bottom: .5rem; }
.contact-info ul { color: var(--muted); }

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: .9rem;
}
.alert ul { margin: .5rem 0 0 1.25rem; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* ── 404 ──────────────────────────────────────────────────────────────────── */
.error-page { padding: 6rem 0; text-align: center; }
.error-code { font-size: 8rem; font-weight: 900; color: var(--border); line-height: 1; margin-bottom: 1rem; }
.error-page h1 { margin-bottom: .75rem; }
.error-page p  { color: var(--muted); margin-bottom: 2rem; }
.error-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 2.5rem; }
.error-suggestions h2 { font-size: 1.1rem; margin-bottom: .75rem; }
.error-suggestions ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .5rem; align-items: center; }
.error-suggestions a { color: var(--primary); font-size: .9rem; }

/* ── Science calc ─────────────────────────────────────────────────────────── */
.sci-result { min-height: 2rem; font-size: .9rem; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
    background: var(--dark);
    color: #94a3b8;
    padding: 3.5rem 0 0;
    margin-top: 4rem;
      border-top: 1px solid var(--border);
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid #1e293b;
}
.footer-logo { font-size: 1.25rem; font-weight: 700; color: #fff; display: inline-block; margin-bottom: .75rem; text-decoration: none; }
.footer-logo strong { color: #60a5fa; }
.footer-brand p { font-size: .875rem; line-height: 1.6; }
.footer-col h3 { color: #fff; font-size: .875rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 1rem; }
.footer-col ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.footer-col a { color: #94a3b8; font-size: .875rem; text-decoration: none; transition: color var(--transition); }
.footer-col a:hover { color: #fff; }
.footer-bottom { padding: 1.5rem 0; text-align: center; font-size: .8rem; }
.footer-bottom p { margin-bottom: .25rem; }
.footer-disclaimer { color: #475569; font-size: .75rem; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .calc-layout { grid-template-columns: 1fr; }
    .calc-sidebar { position: static; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
    .nav-toggle { display: flex; }
    .nav-menu {
        display: none;
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--white);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 1rem;
        overflow-y: auto;
        box-shadow: var(--shadow-lg);
        border-top: 1px solid var(--border);
    }
    .nav-menu.open { display: flex; }
    .nav-menu a { padding: .75rem 1rem; font-size: 1rem; }

    /* Mega menu — mobile: stacked, collapsed by default */
    .has-mega { position: static; }
    .mega-trigger-row { border-radius: var(--radius); }
    .mega-trigger-row > a { flex: 1; padding: .75rem 1rem; }
    .mega-mob-toggle { padding: .75rem .9rem; border-left: 1px solid var(--border); border-radius: 0 var(--radius) var(--radius) 0; }
    /* block desktop .is-open from working on mobile */
    .has-mega.is-open .mega-menu { display: none; }
    /* mobile state */
    .mega-menu { position: static; border: none !important; box-shadow: none; padding: 0; max-height: none; max-width: none; border-radius: 0; }
    .has-mega.mob-open .mega-menu { display: block; }
    .mega-inner { grid-template-columns: 1fr 1fr; gap: .75rem 1.25rem; padding: .5rem 1rem 1rem; background: var(--light); border-radius: var(--radius); margin: .25rem 0; }
    .mega-col-head { font-size: .7rem; }
    .mega-col ul li a { font-size: .825rem; white-space: normal; }
    .mega-footer { text-align: center; margin: 0; padding: .5rem 1rem; border-top: 1px solid var(--border); }
    .has-mega.mob-open .icon-chevron { transform: rotate(180deg); }
    .hero { padding: 3rem 0 2.5rem; }
    .form-row { grid-template-columns: 1fr; }
    .three-col { grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .multi-calc-grid { grid-template-columns: 1fr; }
    .blog-filters { flex-direction: column; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.75rem; }
    .hero-actions { flex-direction: column; align-items: center; }
    .error-code { font-size: 5rem; }
    .three-col { grid-template-columns: 1fr; }
    .tab-bar-lg { overflow-x: auto; flex-wrap: nowrap; padding-bottom: .5rem; }
}

/* ── Currency converter ───────────────────────────────────────────────────── */
.currency-converter { display: flex; flex-direction: column; gap: .75rem; }
.conv-row { display: grid; grid-template-columns: 1fr 1.6fr; gap: .75rem; align-items: end; }
.flex-1 { flex: 1; }
.swap-row { display: flex; align-items: center; gap: 1rem; padding: .25rem 0; }
.conv-equals { font-size: 1.5rem; color: var(--muted); font-weight: 300; }
.swap-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--white);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
    color: var(--primary);
    flex-shrink: 0;
}
.swap-btn:hover { background: var(--primary); color: var(--white); border-color: var(--primary); }

.conv-rate-info {
    display: flex; flex-wrap: wrap; gap: .75rem; align-items: center;
    margin-top: 1rem; padding: .75rem 1rem;
    background: var(--primary-light); border-radius: var(--radius);
    font-size: .875rem;
}
.conv-rate-info .sep-dot { color: var(--border); }
.conv-rate-info strong { color: var(--primary); }

.bnr-meta {
    display: flex; flex-wrap: wrap; gap: .75rem; align-items: center;
    margin-top: .75rem; font-size: .8rem; color: var(--muted);
}
.bnr-source-link { color: var(--primary); font-weight: 600; margin-left: auto; }

/* Rates table */
.rates-table .cur-code { font-family: 'Courier New', monospace; font-size: .9rem; }
.mult-badge { font-size: .65rem; background: #fef3c7; color: #92400e; padding: .1rem .35rem; border-radius: 99px; margin-left: .25rem; vertical-align: middle; font-weight: 700; }
.rate-val { font-variant-numeric: tabular-nums; }
.rate-inverse { font-size: .8rem; }
.muted { color: var(--muted); }

.table-note { font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.table-search-wrap { margin-top: 1rem; }
.table-search-wrap input { max-width: 280px; }

.highlight-box { background: var(--primary-light); border-color: #bfdbfe; }
.quick-rates td:last-child { color: var(--primary); }
.quick-rates { font-size: .85rem; }

.alert-warning { background: #fffbeb; border: 1px solid #fcd34d; color: #78350f; padding: 1rem 1.25rem; border-radius: var(--radius); margin-bottom: 1.5rem; font-size: .875rem; }

/* ── Business calculators ─────────────────────────────────────────────────── */
.formula {
    font-size: .85rem; background: var(--light); border-radius: var(--radius);
    padding: 1rem; border: 1px solid var(--border); line-height: 1.8; font-family: 'Courier New', monospace;
}
.mini-table { width: 100%; font-size: .8rem; border-collapse: collapse; }
.mini-table th { font-size: .75rem; color: var(--muted); padding: .25rem .5rem; border-bottom: 1px solid var(--border); text-align: left; }
.mini-table td { padding: .25rem .5rem; }
.mini-table tr:nth-child(even) td { background: var(--light); }
.sidebar-link {
    display: block; padding: .5rem .75rem; color: var(--text);
    background: var(--light); border-radius: var(--radius); font-size: .85rem;
    text-decoration: none; margin-top: .4rem; transition: var(--transition);
}
.sidebar-link:hover { background: var(--primary-light); color: var(--primary); }
.field-hint { font-size: .78rem; color: var(--muted); margin: -.25rem 0 .4rem; }
.section-subtitle { font-size: 1rem; font-weight: 600; color: var(--text); border-bottom: 1px solid var(--border); padding-bottom: .4rem; }
.result-grid.three-col { grid-template-columns: repeat(3,1fr); }
.rg-item.highlight { background: var(--primary-light); border-color: #bfdbfe; }

/* Margin visual bar */
.margin-visual { }
.margin-bar-labels { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-bottom: .3rem; }
.margin-bar { display: flex; height: 1.5rem; border-radius: var(--radius); overflow: hidden; }
.mb-cost   { background: #ef4444; transition: width .4s; }
.mb-profit { background: #22c55e; transition: width .4s; }

/* Break-even chart */
.chart-legend { display: flex; gap: 1.25rem; font-size: .8rem; color: var(--text); margin-top: .75rem; flex-wrap: wrap; }
.legend-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; vertical-align: middle; margin-right: .3rem; }

/* ROAS verdict */
.roas-verdict { margin-top: 1rem; padding: .75rem 1rem; border-radius: var(--radius); font-size: .875rem; font-weight: 500; }
.verdict-good { color: #15803d; }
.verdict-bad  { color: #b91c1c; }
.metric-note  { margin-top: .75rem; font-size: .85rem; font-weight: 500; color: var(--text); }

/* Production cost breakdown bar */
.cost-bar-wrap { margin-bottom: 1rem; }
.cost-bar { display: flex; height: 1.5rem; border-radius: var(--radius); overflow: hidden; }
.cb-seg { transition: width .4s; }
.cost-bar-legend { display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: .78rem; color: var(--text); margin-top: .5rem; }
.cost-bar-legend em { font-style: normal; }
.cost-bar-legend span { display: flex; align-items: center; gap: .3rem; }

/* Price layers (sidebar visual) */
.price-layers { display: flex; flex-direction: column; gap: 2px; }
.pl-layer { padding: .3rem .6rem; font-size: .78rem; font-weight: 500; border-radius: 3px; }

/* CPC calc desc */
.calc-desc { font-size: .9rem; color: var(--muted); margin-bottom: 1.25rem; }

/* ── Education / Math calculators ────────────────────────────────────────── */
/* Grade rows */
.grade-row { display: flex; gap: .75rem; align-items: flex-end; margin-bottom: .75rem; }
.grade-input-wrap { width: 90px; flex-shrink: 0; }
.add-row-btn {
    background: var(--primary-light); border: 1px dashed #93c5fd; color: var(--primary);
    padding: .5rem 1rem; border-radius: var(--radius); cursor: pointer; font-size: .875rem;
    font-weight: 500; transition: var(--transition); margin-top: .25rem;
}
.add-row-btn:hover { background: #dbeafe; }
.rm-row-btn {
    background: none; border: 1px solid var(--border); color: var(--muted);
    width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: .85rem;
    flex-shrink: 0; align-self: flex-end; margin-bottom: 2px; transition: var(--transition);
}
.rm-row-btn:hover { border-color: var(--error); color: var(--error); }

/* Grade visual bar */
.grade-bar-bg { height: 12px; background: var(--border); border-radius: 99px; overflow: hidden; }
.grade-bar-fill { height: 100%; border-radius: 99px; transition: width .5s, background .5s; }
.grade-bar-labels { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-top: .3rem; }

/* Admission tip */
.admit-tip { margin-top: .75rem; font-size: .875rem; font-weight: 500; color: var(--text); }

/* Fraction inputs */
.fraction-input-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: .5rem 0 1rem; }
.fraction-widget { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.frac-input { width: 70px; text-align: center; border: 2px solid var(--border); border-radius: var(--radius); padding: .4rem .5rem; font-size: 1.1rem; }
.frac-input:focus { border-color: var(--primary); outline: none; }
.frac-line { width: 70px; height: 2px; background: var(--text); border-radius: 1px; }
.eq-sign { font-size: 1.5rem; color: var(--muted); font-weight: 300; }
.result-frac { min-width: 70px; }
.frac-result-num, .frac-result-den { font-size: 1.1rem; font-weight: 700; color: var(--primary); text-align: center; display: block; }
.op-select { min-width: 140px; }

/* Steps box */
.steps-box { margin-top: 1rem; }
.steps-pre { background: var(--light); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; font-family: 'Courier New', monospace; font-size: .82rem; white-space: pre-wrap; margin: 0; line-height: 1.7; }

/* Proportion/regula de trei */
.proportion-grid { display: grid; grid-template-columns: 1fr auto 1fr 1fr auto 1fr; gap: .75rem; align-items: end; }
.prop-arrow { font-size: 1.5rem; color: var(--primary); padding-bottom: .6rem; text-align: center; }
.result-inline { padding: .55rem .75rem; background: var(--primary-light); border: 2px solid #93c5fd; border-radius: var(--radius); font-weight: 700; color: var(--primary); min-height: 42px; display: flex; align-items: center; }
.compound-row { display: flex; gap: .75rem; align-items: flex-end; margin-bottom: .75rem; }

/* Equations */
.eq-builder { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; padding: .75rem 0 1.25rem; }
.eq-coef { width: 80px; text-align: center; border: 2px solid var(--border); border-radius: var(--radius); padding: .4rem .5rem; font-size: 1.05rem; }
.eq-coef:focus { border-color: var(--primary); outline: none; }
.eq-var { font-size: 1.15rem; font-weight: 700; color: var(--primary); }
.eq-op { font-size: 1.1rem; color: var(--muted); }
.eq-term { display: flex; align-items: center; gap: .35rem; }
.sistem-builder { padding: .75rem 0 1.25rem; display: flex; flex-direction: column; gap: .75rem; }
.sis-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.discriminant-badge { margin-top: .75rem; background: #fef9c3; border: 1px solid #fde047; color: #713f12; padding: .5rem 1rem; border-radius: var(--radius); font-family: monospace; font-size: .875rem; }

/* Pitagora */
.triangle-diagram { display: flex; justify-content: center; margin: 1rem 0; }

/* Shape selector (arii-volume) */
.shape-selector { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.25rem; }
.shape-btn {
    padding: .35rem .75rem; border: 1px solid var(--border); border-radius: 99px;
    background: white; color: var(--text); cursor: pointer; font-size: .85rem;
    transition: var(--transition);
}
.shape-btn.active, .shape-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* Pascal triangle */
.pascal-wrap { text-align: center; margin-top: 1rem; overflow-x: auto; }
.pascal-row { display: flex; justify-content: center; gap: .35rem; margin-bottom: .3rem; }
.pascal-cell {
    min-width: 40px; padding: .3rem .4rem; border-radius: var(--radius);
    background: var(--primary-light); border: 1px solid #bfdbfe;
    font-size: .82rem; font-weight: 600; color: var(--primary);
}

/* Examples box */
.examples-box { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.examples-box h3 { font-size: 1rem; margin-bottom: .75rem; }

/* ── Sănătate ────────────────────────────────────────────────────────────── */

/* Greutate ideală – scale bar */
.gi-scale-bar { position: relative; height: 28px; background: #f1f5f9; border-radius: 99px; overflow: hidden; margin: .5rem 0; }
.gi-scale-ideal { position: absolute; top:0; height: 100%; background: #bbf7d0; border-radius: 0; }
.gi-scale-marker { position: absolute; top: 50%; transform: translate(-50%,-50%); width: 14px; height: 14px; background: var(--primary); border-radius: 50%; border: 2px solid white; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.gi-scale-labels { display: flex; justify-content: space-between; font-size: .72rem; color: var(--text-muted); margin-top: .25rem; }

/* ── Casă & Utilități ─────────────────────────────────────────────────────── */

/* ROI timeline bar (panouri fotovoltaice, izolatie termica) */
.roi-bar-bg { position: relative; height: 28px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: .5rem 0; }
.roi-bar-fill { height: 100%; background: linear-gradient(90deg, #22c55e, #4ade80); border-radius: 99px; transition: width .5s ease; }
.roi-bar-label { position: absolute; right: .75rem; top: 50%; transform: translateY(-50%); font-size: .8rem; font-weight: 600; color: #15803d; }
.roi-bar-ticks { display: flex; justify-content: space-between; font-size: .75rem; color: var(--text-muted); margin-top: .25rem; }

/* Layer rows (izolatie-termica – resistenta termica) */
.layer-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; margin-bottom: .75rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }

/* Camera rows (suprafata-apartament) */
.camera-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; margin-bottom: .75rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }

/* Goluri rows (zugravire) */
.goluri-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; margin-bottom: .75rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }

/* Mozaic rows (gresie-parchet per-camera tab) */
.moz-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; margin-bottom: .75rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }

/* Multi rows (zugravire multiple camere) */
.multi-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; margin-bottom: .75rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }

/* Data table shared */
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.data-table th, .data-table td { padding: .45rem .75rem; border: 1px solid var(--border); text-align: left; }
.data-table th { background: var(--surface-2); font-weight: 600; }
.data-table tfoot th { background: var(--primary-light); color: var(--primary); }
.data-table tr:nth-child(even) td { background: var(--surface-2); }

/* ── Utilities ────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ── Rates band ───────────────────────────────────────────────────────────── */
.rates-band {
    background: #0f172a;
    color: #e2e8f0;
    font-size: .8rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    white-space: nowrap;
}
.rates-band::-webkit-scrollbar { display: none; }
.rates-band-inner {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: .55rem 1.5rem;
    min-width: 100%;
}
.rates-band-label {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-weight: 700;
    color: #93c5fd;
    margin-right: 1.25rem;
    flex-shrink: 0;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.rates-band-item {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: 0 1.25rem;
    border-left: 1px solid #334155;
    flex-shrink: 0;
    line-height: 1.4;
}
.rates-band-item:first-of-type { border-left: none; }
.rates-band-key { color: #94a3b8; }
.rates-band-val { color: #f1f5f9; font-weight: 600; }
.rates-band-date {
    display: inline-block;
    background: #1e3a8a;
    color: #93c5fd;
    font-size: .68rem;
    font-weight: 700;
    padding: .1rem .4rem;
    border-radius: 4px;
    margin-left: .25rem;
    vertical-align: middle;
}
.rates-band-warn {
    background: #7c2d12;
    color: #fca5a5;
}

/* ── Hero search ──────────────────────────────────────────────────────────── */
.hero-search-wrap {
    position: relative;
    max-width: 560px;
    margin: 2rem auto 0;
}
.hero-search-input {
    width: 100%;
    padding: .9rem 1.25rem .9rem 3rem;
      padding-left: 3em !important;
    font-size: 1rem;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 24px rgba(0,0,0,.28);
    outline: none;
    color: var(--dark);
    background: #fff;
    box-sizing: border-box;
}
.hero-search-input::placeholder { color: var(--muted); }
.hero-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 1.1rem;
    opacity: .5;
}
.search-suggestions {
    position: absolute;
    top: calc(100% + .4rem);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    overflow: hidden;
    z-index: 200;
    display: none;
    text-align: left;
}
.search-suggestions.open { display: block; }
.search-suggestion {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem 1.25rem;
    text-decoration: none;
    color: var(--dark);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.search-suggestion:last-child { border-bottom: none; }
.search-suggestion:hover,
.search-suggestion.active { background: var(--primary-light); text-decoration: none; }
.search-sugg-icon { font-size: 1.3rem; flex-shrink: 0; line-height: 1; }
.search-sugg-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.search-sugg-name { font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-sugg-cat  { font-size: .72rem; color: var(--muted); }
.search-no-result { padding: 1rem 1.25rem; color: var(--muted); font-size: .9rem; }

/* ── Homepage: hero stats bar ─────────────────────────────────────────────── */
.hero-stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,.2);
}
.hero-stat { text-align: center; }
.hero-stat-num { display: block; font-size: 1.75rem; font-weight: 800; color: #fff; line-height: 1; }
.hero-stat-label { font-size: .8rem; opacity: .8; margin-top: .25rem; }

/* ── Homepage: category browse grid ──────────────────────────────────────── */
.cat-browse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}
.cat-browse-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: 1.25rem 1rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    text-align: center;
    transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
.cat-browse-card:hover { box-shadow: var(--shadow); border-color: var(--primary); transform: translateY(-2px); text-decoration: none; }
.cat-browse-icon { font-size: 2rem; line-height: 1; }
.cat-browse-name { font-size: .9rem; font-weight: 600; color: var(--dark); }
.cat-browse-count { font-size: .75rem; color: var(--muted); }

/* ── Homepage: SEO article ────────────────────────────────────────────────── */
.home-article { padding: 3.5rem 0; background: var(--white); }
.home-article h2 { margin-top: 2rem; margin-bottom: .75rem; }
.home-article h2:first-child { margin-top: 0; }
.home-article p { color: var(--text); line-height: 1.75; margin-bottom: 1rem; }

@media (max-width: 640px) {
    .hero-stats { gap: 1.25rem; }
    .hero-stat-num { font-size: 1.4rem; }
    .cat-browse-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* ── Theme toggle button ───────────────────────────────────────────────────── */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    flex-shrink: 0;
}
.theme-toggle:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }

/* Show sun in dark mode, moon in light mode */
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ── Dark mode variables ───────────────────────────────────────────────────── */
/* html[data-theme="dark"] has specificity (0,1,1) > :root (0,1,0) → guaranteed win */
html[data-theme="dark"] {
    --primary-light: #1e3a8a;
    --text:   #e2e8f0;
    --muted:  #94a3b8;
    --border: #334155;
    --light:  #1e293b;
    --white:  #0f172a;
    --dark:   #f1f5f9;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
    --shadow:    0 4px 16px rgba(0,0,0,.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.5);
}

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) {
        --primary-light: #1e3a8a;
        --text:   #e2e8f0;
        --muted:  #94a3b8;
        --border: #334155;
        --light:  #1e293b;
        --white:  #0f172a;
        --dark:   #f1f5f9;
        --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
        --shadow:    0 4px 16px rgba(0,0,0,.4);
        --shadow-lg: 0 8px 32px rgba(0,0,0,.5);
    }
    html:not([data-theme="light"]) .theme-toggle .icon-sun  { display: block; }
    html:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* Dark: components with hardcoded colors that need explicit overrides */
[data-theme="dark"] body  { background: #0f172a; color: #e2e8f0; }
[data-theme="dark"] .page-header { background: #1e293b; }
[data-theme="dark"] .calc-card-widget { background: #1e293b; }
[data-theme="dark"] .info-box  { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .hero-search-input { background: #1e293b; color: #e2e8f0; box-shadow: 0 4px 24px rgba(0,0,0,.5); }
[data-theme="dark"] .search-suggestions { background: #1e293b; }
[data-theme="dark"] .search-suggestion:hover,
[data-theme="dark"] .search-suggestion.active { background: #1e3a8a; }
[data-theme="dark"] .faq-item  { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .related-calcs { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .tab-bar   { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .tab-btn   { color: #94a3b8; }
[data-theme="dark"] .tab-btn.active { background: #0f172a; color: #e2e8f0; }
[data-theme="dark"] .blog-card { background: #1e293b; }
[data-theme="dark"] .home-article { background: #0f172a; }
[data-theme="dark"] .site-footer { background: #0f172a; }
[data-theme="dark"] .mega-menu { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .mega-col ul li a:hover { background: #1e3a8a; }
[data-theme="dark"] .mini-table td,
[data-theme="dark"] .mini-table th { border-color: #334155; }
[data-theme="dark"] .data-table th { background: #1e293b; }
[data-theme="dark"] .data-table tr:nth-child(even) td { background: #1e293b; }
[data-theme="dark"] .calc-result { background: #1e293b; }
[data-theme="dark"] select,
[data-theme="dark"] input,
[data-theme="dark"] textarea { background: #1e293b; color: #e2e8f0; border-color: #334155; }

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) body  { background: #0f172a; }
    html:not([data-theme="light"]) .page-header { background: #1e293b; }
    html:not([data-theme="light"]) .calc-card-widget { background: #1e293b; }
    html:not([data-theme="light"]) .info-box  { background: #1e293b; border-color: #334155; }
    html:not([data-theme="light"]) .hero-search-input { background: #1e293b; color: #e2e8f0; }
    html:not([data-theme="light"]) .search-suggestions { background: #1e293b; }
    html:not([data-theme="light"]) .faq-item  { background: #1e293b; border-color: #334155; }
    html:not([data-theme="light"]) .blog-card { background: #1e293b; }
    html:not([data-theme="light"]) .home-article { background: #0f172a; }
    html:not([data-theme="light"]) .site-footer { background: #0f172a; }
    html:not([data-theme="light"]) .calc-result { background: #1e293b; }
    html:not([data-theme="light"]) select,
    html:not([data-theme="light"]) input,
    html:not([data-theme="light"]) textarea { background: #1e293b; color: #e2e8f0; border-color: #334155; }
}
body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

 input, textarea {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}