/* ===== Variables (dark default) — CalcBoxer Premium ===== */
:root, [data-theme="dark"] {
    --bg: #0d0d10;
    --bg-card: #16161c;
    --bg-input: #1e1e26;
    --border: #2a2a34;
    --text: #e8e8ec;
    --text-muted: #8b8b96;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-warm: #f59e0b;
    --accent-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 35%, #3b82f6 70%, #2563eb 100%);
    --accent-gradient-hover: linear-gradient(135deg, #fbbf24 0%, #f59e0b 35%, #60a5fa 70%, #3b82f6 100%);
    --accent-line: linear-gradient(90deg, #f59e0b 0%, #3b82f6 50%, #2563eb 100%);
    --success: #22c55e;
    --radius: 12px;
    --radius-sm: 8px;
    --font-sans: 'DM Sans', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.03);
}

/* ===== Light theme ===== */
[data-theme="light"] {
    --bg: #f4f6fa;
    --bg-card: #ffffff;
    --bg-input: #eef1f6;
    --border: #dce0e8;
    --text: #1a1d24;
    --text-muted: #5c6170;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-warm: #d97706;
    --accent-gradient: linear-gradient(135deg, #f59e0b 0%, #3b82f6 50%, #2563eb 100%);
    --accent-gradient-hover: linear-gradient(135deg, #fbbf24 0%, #60a5fa 50%, #3b82f6 100%);
    --accent-line: linear-gradient(90deg, #f59e0b 0%, #3b82f6 100%);
    --success: #16a34a;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Layout ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
    box-sizing: border-box;
}

/* ===== Header ===== */
.header {
    background: var(--bg-card);
    border-bottom: none;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
    /* overflow widoczny — inaczej lista „Kategorie” jest przycinana i zamiast dropdownu widać przewijany pasek */
    overflow: visible;
}
[data-theme="dark"] .header {
    background: linear-gradient(180deg, #16161c 0%, #141419 100%);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .header::after {
    content: "";
    display: block;
    height: 2px;
    background: var(--accent-line);
    opacity: 0.85;
}
[data-theme="light"] .header {
    background: linear-gradient(180deg, #ffffff 0%, #fafbfd 100%);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .header::after {
    content: "";
    display: block;
    height: 2px;
    background: var(--accent-line);
    opacity: 0.7;
}
.header .container {
    display: flex;
    align-items: center;
    gap: 0;
    min-width: 0;
    flex-wrap: nowrap;
    overflow: visible;
}
.header .container .logo {
    margin-right: 1.25rem;
    flex-shrink: 0;
    min-width: 0;
}
.header .container .nav {
    flex: 1 1 0;
    min-width: 0;
    /* Nie używaj overflow-x: auto — zamienia dropdown kategorii w poziomy scroll zamiast rozwijanej listy */
    overflow: visible;
}
.header .container .header-utils {
    margin-left: auto;
    flex-shrink: 0;
}
.logo {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    border: none;
    outline: none;
}
.logo:hover { color: var(--accent); }
.logo:focus { outline: none; }
.logo:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}
.logo-img {
    display: block;
    max-height: 42px;
    width: auto;
    height: auto;
    max-width: 180px;
    border: none;
    outline: none;
}
.logo-fallback {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text);
    letter-spacing: -0.02em;
}
/* Tekst „Strona główna” zamiast grafiki — tylko na wąskim ekranie (patrz @media max-width 768px) */
.logo-home-text {
    display: none;
}
.nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.nav-dropdown {
    position: relative;
}
.nav-dropdown-trigger {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    user-select: none;
}
.nav-dropdown-arrow {
    font-size: 0.7em;
    opacity: 0.8;
}
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.25rem;
    min-width: 200px;
    max-width: min(100vw - 2rem, 22rem);
    /* Długa lista kategorii — przewijanie wewnątrz panelu, żeby wszystkie były dostępne */
    max-height: min(70vh, calc(100vh - 6rem));
    max-height: min(70vh, calc(100dvh - 6rem));
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    padding: 0.35rem 0;
    z-index: 120;
}
.nav-dropdown-menu::-webkit-scrollbar {
    width: 8px;
}
.nav-dropdown-menu::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}
.nav-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    display: block;
}
.nav-dropdown-item {
    display: block;
    padding: 0.4rem 1rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.15s;
}
.nav-dropdown-item:hover {
    background: var(--bg-input);
    color: var(--accent);
}
.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--accent); }
.nav-link.disabled {
    color: var(--text-muted);
    opacity: 0.7;
    cursor: default;
}
.nav-link.btn-nav {
    background: var(--accent-gradient);
    color: white !important;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.35);
}
.nav-link.btn-nav:hover {
    background: var(--accent-gradient-hover);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.header-utils { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.header-utils .header-usage { margin-right: 0.5rem; white-space: nowrap; }
.header-format-label { display: inline-flex; align-items: center; margin-right: 0.5rem; }
.header-format-label + .header-format-label { padding-left: 0.75rem; border-left: 1px solid var(--border); margin-left: 0; }
.header-format-label .currency-select,
.header-format-label .units-select {
    min-width: 8rem;
    max-width: 10rem;
    margin-left: 0.35rem;
    padding: 0.35rem 0.6rem;
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    appearance: auto;
}
.header-utils .lang-form { display: inline-flex; align-items: center; margin-right: 0.5rem; }
.header-utils .lang-form:not(:first-child) { padding-left: 0.75rem; border-left: 1px solid var(--border); }
.header-utils .header-format-label:first-of-type { padding-left: 0.75rem; border-left: 1px solid var(--border); }
.header-utils .lang-form .lang-select { min-width: 4rem; padding: 0.35rem 0.6rem; }
#header-login { display: flex; align-items: center; }
.theme-toggle {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.6rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: color 0.2s, border-color 0.2s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent); box-shadow: 0 0 12px rgba(59, 130, 246, 0.2); }
.lang-select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    color: var(--text);
    cursor: pointer;
    appearance: auto;
}
.lang-select option,
.header-format-label .currency-select option,
.header-format-label .units-select option {
    background: var(--bg-card);
    color: var(--text);
}
.lang-select-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.2rem 0.35rem 0.2rem 0.4rem;
}
.lang-select-wrap .lang-flag {
    width: 18px;
    height: 12px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
    border-radius: 1px;
}
.lang-select-wrap .lang-select {
    min-width: 2.2rem;
    padding: 0.1rem 0.25rem 0.1rem 0;
    border: none;
    background: transparent;
}
.lang-select-wrap .lang-flag-pl {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16'%3E%3Crect width='24' height='8' fill='%23fff'/%3E%3Crect y='8' width='24' height='8' fill='%23dc143c'/%3E%3C/svg%3E");
}
.lang-select-wrap .lang-flag-en {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16'%3E%3Crect width='24' height='16' fill='%23B22234'/%3E%3Crect width='24' height='1.23' y='0' fill='%23B22234'/%3E%3Crect width='24' height='1.23' y='2.46' fill='%23B22234'/%3E%3Crect width='24' height='1.23' y='4.92' fill='%23B22234'/%3E%3Crect width='24' height='1.23' y='7.38' fill='%23B22234'/%3E%3Crect width='24' height='1.23' y='9.84' fill='%23B22234'/%3E%3Crect width='24' height='1.23' y='12.31' fill='%23B22234'/%3E%3Crect width='24' height='1.23' y='1.23' fill='%23fff'/%3E%3Crect width='24' height='1.23' y='3.69' fill='%23fff'/%3E%3Crect width='24' height='1.23' y='6.15' fill='%23fff'/%3E%3Crect width='24' height='1.23' y='8.62' fill='%23fff'/%3E%3Crect width='24' height='1.23' y='11.08' fill='%23fff'/%3E%3Crect width='24' height='1.23' y='13.54' fill='%23fff'/%3E%3Crect width='9.6' height='8.62' fill='%23002868'/%3E%3Cpath fill='%23fff' d='M2 1.2l.25.76.8.1-.58.56.15.8L2 3.1l-.62.32.15-.8-.58-.56.8-.1L2 1.2zm4.8 0l.25.76.8.1-.58.56.15.8L6.8 3.1l-.62.32.15-.8-.58-.56.8-.1L6.8 1.2zm4.8 0l.25.76.8.1-.58.56.15.8-.62.32-.62-.32.15-.8-.58-.56.8-.1.25-.76zM2 5.2l.25.76.8.1-.58.56.15.8L2 7.1l-.62.32.15-.8-.58-.56.8-.1L2 5.2zm4.8 0l.25.76.8.1-.58.56.15.8L6.8 7.1l-.62.32.15-.8-.58-.56.8-.1L6.8 5.2zm4.8 0l.25.76.8.1-.58.56.15.8-.62.32-.62-.32.15-.8-.58-.56.8-.1.25-.76z'/%3E%3C/svg%3E");
}
/* Ikony social (Facebook, X, Instagram) — ten sam styl, subtelne i eleganckie */
.footer-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: color 0.2s ease, opacity 0.2s ease;
    opacity: 0.85;
}
.footer-social:hover {
    color: var(--accent);
    opacity: 1;
}
.footer-social-icon {
    display: block;
    width: 1.1rem;
    height: 1.1rem;
    background: currentColor;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
}
.footer-social--facebook .footer-social-icon {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z'/%3E%3C/svg%3E");
}
.footer-social--twitter .footer-social-icon {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='5' x2='19' y2='19'/%3E%3Cline x1='19' y1='5' x2='5' y2='19'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='5' x2='19' y2='19'/%3E%3Cline x1='19' y1='5' x2='5' y2='19'/%3E%3C/svg%3E");
}
.footer-social--instagram .footer-social-icon {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='2' width='20' height='20' rx='5' ry='5'/%3E%3Cpath d='M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z'/%3E%3Cline x1='17.5' y1='6.5' x2='17.51' y2='6.5'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='2' width='20' height='20' rx='5' ry='5'/%3E%3Cpath d='M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z'/%3E%3Cline x1='17.5' y1='6.5' x2='17.51' y2='6.5'/%3E%3C/svg%3E");
}
/* Etykieta tekstowa obok ikony (Facebook / X / Instagram) — lepsze dla SEO i narzędzi bez JS */
.footer-social--labeled {
    width: auto;
    min-height: 1.75rem;
    padding: 0 0.35rem;
    gap: 0.35rem;
}
.footer-social-label {
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Tekst wprowadzający na stronie głównej (SEO / udział tekstu na stronie) */
.home-seo-intro {
    margin-bottom: 2.5rem;
    max-width: 48rem;
}
.home-seo-intro-text {
    margin: 0 0 1rem;
    line-height: 1.65;
    color: var(--text-muted);
    font-size: 0.98rem;
}
.home-seo-intro .section-title {
    margin-bottom: 0.85rem;
}
/* Tekst podstrony /kalkulatory.html (spójnie ze stroną główną) */
.kalkulatory-seo-intro {
    margin-bottom: 2rem;
    max-width: 48rem;
}
.kalkulatory-seo-intro-text {
    margin: 0;
    line-height: 1.65;
    color: var(--text-muted);
    font-size: 0.98rem;
}
.kalkulatory-seo-intro .section-title {
    margin-bottom: 0.75rem;
}

/* ===== Main ===== */
.main {
    flex: 1;
    padding: 2.5rem 0 4rem;
}
/* Kalkulator (dane + wyniki): szerszy kontener. .container--calc-wide dokładany w js/app.js (działa także bez :has w starszych przeglądarkach). */
.main .container:not(.calc-rails-outer):is(.container--calc-wide, :has(.calculator-grid)) {
    max-width: 1440px;
}
.hero {
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
}
/* Kalkulatory z blokiem SEO (np. Regulacje AI) — mniejsza przerwa pod tytułem */
.main .container > .hero:has(+ .calc-seo-block) {
    margin-bottom: 1.25rem;
}
.hero::before {
    content: "";
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    height: 140%;
    background: radial-gradient(ellipse at center, rgba(59, 130, 246, 0.06) 0%, transparent 65%);
    pointer-events: none;
}
[data-theme="light"] .hero::before {
    background: radial-gradient(ellipse at center, rgba(59, 130, 246, 0.05) 0%, transparent 60%);
}
.hero h1 {
    font-size: clamp(1.85rem, 4.5vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0 0 0.5rem;
    color: var(--text);
    position: relative;
}
[data-theme="light"] .hero h1 {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-desc {
    margin: 0;
    color: var(--text-muted);
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}
.hero-home { margin-bottom: 3rem; }
.hero-home .hero-desc { margin-bottom: 1.5rem; }

/* Subtelna tożsamość wizualna (cała witryna): siatka + dwa akcenty w rogach (środek gradientu w rogu ekranu, żeby było widać) */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse min(140vw, 1280px) min(95vh, 900px) at 100% 0%, rgba(59, 130, 246, 0.32) 0%, rgba(59, 130, 246, 0.14) 28%, rgba(59, 130, 246, 0.07) 48%, rgba(59, 130, 246, 0.025) 68%, rgba(59, 130, 246, 0.01) 82%, transparent 92%),
        radial-gradient(ellipse min(130vw, 1180px) min(92vh, 880px) at 0% 100%, rgba(245, 158, 11, 0.26) 0%, rgba(245, 158, 11, 0.12) 30%, rgba(245, 158, 11, 0.06) 50%, rgba(245, 158, 11, 0.02) 70%, rgba(245, 158, 11, 0.008) 84%, transparent 92%),
        radial-gradient(rgba(59, 130, 246, 0.045) 1px, transparent 1px);
    background-size: auto, auto, 26px 26px;
    background-repeat: no-repeat, no-repeat, repeat;
}
[data-theme="dark"] body::before {
    background-image:
        radial-gradient(ellipse min(140vw, 1280px) min(95vh, 900px) at 100% 0%, rgba(59, 130, 246, 0.4) 0%, rgba(59, 130, 246, 0.18) 26%, rgba(59, 130, 246, 0.09) 46%, rgba(59, 130, 246, 0.035) 66%, rgba(59, 130, 246, 0.012) 80%, transparent 92%),
        radial-gradient(ellipse min(130vw, 1180px) min(92vh, 880px) at 0% 100%, rgba(245, 158, 11, 0.3) 0%, rgba(245, 158, 11, 0.14) 28%, rgba(245, 158, 11, 0.07) 48%, rgba(245, 158, 11, 0.025) 68%, rgba(245, 158, 11, 0.01) 82%, transparent 92%),
        radial-gradient(rgba(96, 165, 250, 0.08) 1px, transparent 1px);
    background-size: auto, auto, 26px 26px;
}
/* prefers-reduced-motion: akcenty są statyczne — zostawiamy; tylko siatka może być mniej kontrastowa */
@media (prefers-reduced-motion: reduce) {
    body::before {
        background-image:
            radial-gradient(ellipse min(140vw, 1280px) min(95vh, 900px) at 100% 0%, rgba(59, 130, 246, 0.26) 0%, rgba(59, 130, 246, 0.11) 28%, rgba(59, 130, 246, 0.055) 48%, rgba(59, 130, 246, 0.02) 68%, rgba(59, 130, 246, 0.008) 82%, transparent 92%),
            radial-gradient(ellipse min(130vw, 1180px) min(92vh, 880px) at 0% 100%, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.09) 30%, rgba(245, 158, 11, 0.045) 50%, rgba(245, 158, 11, 0.015) 70%, rgba(245, 158, 11, 0.006) 84%, transparent 92%),
            radial-gradient(rgba(59, 130, 246, 0.035) 1px, transparent 1px);
        background-size: auto, auto, 28px 28px;
        background-repeat: no-repeat, no-repeat, repeat;
    }
    [data-theme="dark"] body::before {
        background-image:
            radial-gradient(ellipse min(140vw, 1280px) min(95vh, 900px) at 100% 0%, rgba(59, 130, 246, 0.32) 0%, rgba(59, 130, 246, 0.14) 26%, rgba(59, 130, 246, 0.07) 46%, rgba(59, 130, 246, 0.028) 66%, rgba(59, 130, 246, 0.01) 80%, transparent 92%),
            radial-gradient(ellipse min(130vw, 1180px) min(92vh, 880px) at 0% 100%, rgba(245, 158, 11, 0.24) 0%, rgba(245, 158, 11, 0.11) 28%, rgba(245, 158, 11, 0.055) 48%, rgba(245, 158, 11, 0.02) 68%, rgba(245, 158, 11, 0.008) 82%, transparent 92%),
            radial-gradient(rgba(96, 165, 250, 0.065) 1px, transparent 1px);
        background-size: auto, auto, 28px 28px;
    }
}

.header-usage {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.9;
    font-weight: 400;
    margin-right: 0.5rem;
    white-space: nowrap;
}
.header-usage #calc-usage-total-count {
    color: var(--text-muted);
    font-weight: 500;
}
@media (max-width: 640px) {
    .header-usage { display: none; }
}

/* Nagłówek na wąskich ekranach — nawigacja ukryta */
@media (max-width: 992px) {
    .header .container .nav {
        display: none !important;
    }
}

/* Mobile: pas z logo (link do strony głównej), potem ustawienia (język, waluta, jednostki…) */
@media (max-width: 768px) {
    .header {
        padding: 0.75rem 0;
    }
    .header .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        flex-wrap: wrap;
        gap: 0.5rem 0;
        align-items: center;
    }
    /* Zamiast logo: subtelny, wyśrodkowany link „Strona główna” / „Home” */
    .header .container .logo {
        display: flex !important;
        flex: 0 0 100%;
        width: 100%;
        box-sizing: border-box;
        margin-right: 0;
        margin-bottom: 0.15rem;
        padding: 0.35rem 0 0.75rem;
        justify-content: center;
        align-items: center;
        min-height: 44px;
        border-bottom: 1px solid var(--border);
        text-decoration: none;
    }
    .header .container .logo .logo-img,
    .header .container .logo .logo-fallback {
        display: none !important;
    }
    .header .container .logo .logo-home-text {
        display: block !important;
        width: 100%;
        text-align: center;
        font-size: 0.72rem;
        font-weight: 500;
        letter-spacing: 0.06em;
        color: var(--text-muted);
        opacity: 0.72;
        line-height: 1.35;
        padding: 0.15rem 0.5rem 0;
        background: linear-gradient(180deg, transparent 0%, transparent 55%, rgba(59, 130, 246, 0.06) 100%);
        border-radius: var(--radius-sm);
        transition: color 0.2s ease, opacity 0.2s ease;
    }
    [data-theme="dark"] .header .container .logo .logo-home-text {
        background: linear-gradient(180deg, transparent 0%, rgba(59, 130, 246, 0.07) 100%);
    }
    .header .container .logo:hover .logo-home-text,
    .header .container .logo:focus-visible .logo-home-text {
        color: var(--accent);
        opacity: 0.95;
    }
    .header .container .logo:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
        border-radius: var(--radius-sm);
    }
    .header .container .header-utils {
        flex: 0 0 100%;
        width: 100%;
        margin-left: 0;
        display: grid;
        grid-template-rows: auto auto;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 0.5rem 0.75rem;
        align-items: center;
        justify-items: center;
    }
    /* Wiersz 1: flaga (język) + zmiana trybu + Zaloguj — wyśrodkowane */
    .header .container .header-utils .lang-form {
        grid-row: 1;
        grid-column: 1;
        display: inline-flex;
        align-items: center;
        justify-self: center;
    }
    .header .container .header-utils .theme-toggle {
        grid-row: 1;
        grid-column: 2;
        justify-self: center;
        width: auto;
        min-width: auto;
        padding: 0.4rem;
        aspect-ratio: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: var(--radius-sm);
    }
    .header .container .header-utils #header-login {
        grid-row: 1;
        grid-column: 3;
        justify-self: center;
    }
    /* Wiersz 2: waluta + jednostki — wyśrodkowane, selecty na pełną treść opcji */
    .header .container .header-utils #header-currency-label {
        grid-row: 2;
        grid-column: 1;
        display: inline-flex !important;
        align-items: center;
        min-width: 0;
        justify-self: stretch;
        width: 100%;
    }
    .header .container .header-utils #header-units-label {
        grid-row: 2;
        grid-column: 2;
        display: inline-flex !important;
        align-items: center;
        min-width: 0;
        justify-self: stretch;
        width: 100%;
    }
    .header .container .header-utils .header-usage {
        grid-row: 2;
        grid-column: 3;
        justify-self: center;
    }
    /* Język: tylko flaga — select nakładka na flagę, klikalna */
    .header-utils .lang-form .lang-select-wrap {
        position: relative;
        display: inline-flex;
        width: 2.25rem;
        height: 1.5rem;
        min-width: 2.25rem;
        padding: 0;
        border-radius: var(--radius-sm);
        overflow: hidden;
    }
    .header-utils .lang-form .lang-select-wrap .lang-flag {
        width: 100%;
        height: 100%;
        min-width: 2rem;
        min-height: 1.35rem;
        pointer-events: none;
    }
    .header-utils .lang-form .lang-select-wrap .lang-select {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        min-width: 0;
        opacity: 0;
        cursor: pointer;
        font-size: 0;
        z-index: 2;
        -webkit-tap-highlight-color: transparent;
    }
    .lang-select {
        padding: 0.35rem 0.5rem;
        font-size: 0.8rem;
    }
    .header-utils .lang-form .lang-select {
        min-width: 0;
    }
    /* Gdy brak .lang-select-wrap — wąski select (tylko flaga z opcji) */
    .header-utils .lang-form:not(:has(.lang-select-wrap)) .lang-select {
        width: 2.5rem;
        min-width: 2.5rem;
        padding: 0.35rem 0.2rem;
        font-size: 1rem;
        text-align: center;
    }
    /* Waluta i jednostki — szerokość na całą treść opcji (np. „Metryczne (km, l, kg, °C)”) */
    .header .container .header-utils .header-format-label .currency-select,
    .header .container .header-utils .header-format-label .units-select {
        min-width: 10rem;
        width: 100%;
        max-width: 100%;
        padding: 0.4rem 0.5rem;
        font-size: 0.8rem;
        box-sizing: border-box;
        overflow: visible;
    }
}
@media (max-width: 480px) {
    .header .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    .header .container .header-utils {
        gap: 0.4rem 0.5rem;
    }
    .header .container .header-utils .theme-toggle {
        padding: 0.35rem;
    }
    .lang-select {
        padding: 0.3rem 0.4rem;
        font-size: 0.75rem;
    }
    .header .container .header-utils .header-format-label .currency-select,
    .header .container .header-utils .header-format-label .units-select {
        font-size: 0.75rem;
        padding: 0.35rem 0.4rem;
        min-width: 8rem;
    }
}
.btn-hero {
    display: inline-block;
    padding: 0.85rem 1.75rem;
    font-size: 1rem;
    text-decoration: none;
}

/* ===== Breadcrumbs ===== */
#breadcrumbs { margin-bottom: 1rem; }
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
}
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumb-sep { user-select: none; }
.breadcrumb-current { color: var(--text); }

/* ===== Page head ===== */
.page-head { margin-bottom: 1.75rem; }
.page-head h1 { margin: 0 0 0.35rem; font-size: clamp(1.5rem, 3.5vw, 2rem); }
.page-desc { margin: 0 0 0.5rem; color: var(--text-muted); font-size: 1.05rem; line-height: 1.5; max-width: 42em; }

/* ===== Sekcja „Jak obliczane są wyniki” — przyciągająca, wprawiająca w podziw ===== */
.calc-explanation {
  margin-top: 1.5rem;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  padding: 0 0 2rem 0;
  max-width: 54em;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  padding-left: 2rem;
  padding-right: 2rem;
  padding-bottom: 2.5rem;
}
/* Pas gradientu — jak „zakładka” lub pasek premium (ciepły → akcent) */
.calc-explanation::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 6px;
  border-radius: 20px 0 0 20px;
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 25%, #2563eb 75%, #1d4ed8 100%);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.25);
}
[data-theme="light"] .calc-explanation::before {
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 30%, #3b82f6 70%, #2563eb 100%);
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.2);
}
/* Delikatna „światłość” w rogu — przyciąga wzrok */
.calc-explanation::after {
  content: "";
  position: absolute;
  top: -60%;
  right: -20%;
  width: 70%;
  height: 120%;
  background: radial-gradient(ellipse at center, rgba(59, 130, 246, 0.08) 0%, transparent 60%);
  pointer-events: none;
}
[data-theme="light"] .calc-explanation::after {
  background: radial-gradient(ellipse at center, rgba(59, 130, 246, 0.06) 0%, transparent 55%);
}
[data-theme="dark"] .calc-explanation {
  background: linear-gradient(145deg, rgba(18, 18, 22, 0.98) 0%, rgba(24, 24, 30, 0.99) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.03) inset, 0 24px 64px -24px rgba(0, 0, 0, 0.4);
}
[data-theme="light"] .calc-explanation {
  background: linear-gradient(145deg, #ffffff 0%, #fafbff 50%, #f8fafc 100%);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.9) inset, 0 20px 48px -20px rgba(59, 130, 246, 0.08);
}
/* Tytuł — większy, z charakterem */
.calc-explanation-title {
  margin: 0 0 1.75rem;
  padding: 1.5rem 0 1rem;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.03em;
  position: relative;
  z-index: 1;
}
[data-theme="dark"] .calc-explanation-title {
  color: rgba(255, 255, 255, 0.96);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
[data-theme="light"] .calc-explanation-title {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: #1e293b;
}
.calc-explanation-body {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.82;
  letter-spacing: 0.015em;
  position: relative;
  z-index: 1;
}
/* Wykresy i schematy w kalkulatorach */
.calc-chart { margin-top: 0.75rem; max-width: 100%; }
.calc-chart-svg { display: block; max-width: 100%; height: auto; }
.calc-diagram { margin: 1rem 0; max-width: 100%; text-align: center; }
.calc-diagram svg { max-width: 100%; height: auto; }
.calc-explanation-diagram {
  margin: 1.5rem 0;
  padding: 1rem;
  text-align: center;
  border-radius: var(--radius-sm);
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.15);
}
.calc-explanation-diagram svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
.calc-explanation-diagram svg text { fill: var(--text); font-size: 12px; font-family: var(--font-sans); }
.calc-explanation-diagram svg line,
.calc-explanation-diagram svg polyline,
.calc-explanation-diagram svg polygon,
.calc-explanation-diagram svg path,
.calc-explanation-diagram svg circle,
.calc-explanation-diagram svg ellipse { stroke: var(--accent); stroke-width: 1.5; fill: none; }
.calc-explanation-diagram svg [fill]:not(text) { fill: rgba(59, 130, 246, 0.12); stroke: var(--accent); }

.calc-explanation-body .calc-explanation-p {
  margin: 0 0 1.2em;
  line-height: 1.75;
}
[data-theme="dark"] .calc-explanation-body .calc-explanation-p {
  color: rgba(232, 232, 236, 0.9);
}
[data-theme="light"] .calc-explanation-body .calc-explanation-p {
  color: rgba(30, 41, 59, 0.88);
}
.calc-explanation-body .calc-explanation-p:last-child {
  margin-bottom: 0;
}
/* Blok wzoru — jak „okno” z delikatnym blaskiem */
.calc-explanation-body .calc-explanation-formula {
  margin: 1.15em 0 1.35em;
  padding: 1.25rem 1.4rem;
  font-family: var(--font-mono, 'Consolas', 'Liberation Mono', monospace);
  font-size: 0.925rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  border-radius: 12px;
  line-height: 1.75;
  overflow-x: auto;
  display: block;
}
[data-theme="dark"] .calc-explanation-body .calc-explanation-formula {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.2) 0%, rgba(30, 64, 175, 0.08) 100%);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: rgba(248, 250, 252, 0.95);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(59, 130, 246, 0.1) inset;
}
[data-theme="light"] .calc-explanation-body .calc-explanation-formula {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(147, 197, 253, 0.06) 100%);
  border: 1px solid rgba(59, 130, 246, 0.18);
  color: #1e3a5f;
  box-shadow: 0 2px 16px rgba(59, 130, 246, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
}
/* Kroki — wyraźne „karty” z numeracją wizualną */
.calc-explanation-body .calc-explanation-step {
  margin: 0.85em 0 1em;
  padding: 0.9em 1em 0.9em 3.5rem;
  line-height: 1.7;
  border-radius: 12px;
  position: relative;
}
.calc-explanation-body .calc-explanation-step::before {
  content: attr(data-step);
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-sans);
  letter-spacing: 0;
}
[data-theme="dark"] .calc-explanation-body .calc-explanation-step {
  color: rgba(232, 232, 236, 0.92);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(59, 130, 246, 0.04) 100%);
  border: 1px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}
[data-theme="dark"] .calc-explanation-body .calc-explanation-step::before {
  background: linear-gradient(145deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}
[data-theme="light"] .calc-explanation-body .calc-explanation-step {
  color: #1e293b;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.07) 0%, rgba(147, 197, 253, 0.04) 100%);
  border: 1px solid rgba(59, 130, 246, 0.15);
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.04);
}
[data-theme="light"] .calc-explanation-body .calc-explanation-step::before {
  background: linear-gradient(145deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.35);
}
.calc-explanation-body .calc-explanation-step:first-of-type {
  margin-top: 0.5em;
}
/* Numer w kółku — ukrywamy duplikat w tekście */
.calc-explanation-body .calc-explanation-step[data-step] .calc-explanation-step-num {
  display: none;
}
/* Jednostki — spokojna „notatka” z klasą */
.calc-explanation-body .calc-explanation-units {
  margin-top: 1.25em;
  margin-bottom: 0;
  padding: 1rem 1.2rem;
  font-size: 0.9rem;
  line-height: 1.72;
  border-radius: 12px;
}
[data-theme="dark"] .calc-explanation-body .calc-explanation-units {
  color: rgba(203, 213, 225, 0.9);
  background: linear-gradient(135deg, rgba(100, 116, 139, 0.15) 0%, rgba(71, 85, 105, 0.08) 100%);
  border: 1px solid rgba(148, 163, 184, 0.15);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .calc-explanation-body .calc-explanation-units {
  color: #475569;
  background: linear-gradient(135deg, rgba(241, 245, 249, 0.9) 0%, rgba(226, 232, 240, 0.6) 100%);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.03);
}
/* Nagłówki sekcji — czytelna hierarchia */
.calc-explanation-body .calc-explanation-heading {
  margin: 1.75em 0 0.6em;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.4;
  padding-left: 0.75rem;
  border-left: 4px solid transparent;
}
[data-theme="dark"] .calc-explanation-body .calc-explanation-heading {
  color: rgba(255, 255, 255, 0.94);
  border-left-color: rgba(251, 191, 36, 0.6);
}
[data-theme="light"] .calc-explanation-body .calc-explanation-heading {
  color: #1e293b;
  border-left-color: #f59e0b;
}
.calc-explanation-body .calc-explanation-heading:first-child {
  margin-top: 0;
}
.calc-explanation-body .calc-explanation-p + .calc-explanation-heading {
  margin-top: 1.85em;
}
.calc-explanation-body .calc-explanation-heading + .calc-explanation-p,
.calc-explanation-body .calc-explanation-heading + .calc-explanation-list {
  margin-top: 0.5em;
}
/* Lista — eleganckie kropki z gradientem */
.calc-explanation-body .calc-explanation-list {
  margin: 0.55em 0 1.15em;
  padding-left: 1.5rem;
  list-style: none;
  line-height: 1.75;
}
.calc-explanation-body .calc-explanation-list li {
  margin-bottom: 0.55em;
  padding-left: 0.5em;
  position: relative;
}
.calc-explanation-body .calc-explanation-list li::before {
  content: "";
  position: absolute;
  left: -1.15rem;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #3b82f6);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.35);
}
.calc-explanation-body .calc-explanation-list li:last-child {
  margin-bottom: 0;
}

/* ===== Sekcja „Ciekawostka” ===== */
.calc-curiosity {
  margin-top: 1.75rem;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  padding: 1.5rem 1.75rem 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 52em;
  box-shadow: var(--shadow);
}
.calc-curiosity-title {
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  border-bottom: 2px solid var(--accent);
}
.calc-curiosity-body {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.7;
}
.calc-curiosity-body .calc-curiosity-p {
  margin: 0;
  color: var(--text-muted);
  font-style: italic;
}

/* ===== Section title ===== */
.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1.25rem;
    color: var(--text);
}

/* ===== Category grid ===== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}
.category-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, transform 0.15s;
    box-shadow: var(--shadow);
}
.category-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.category-card-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.75rem;
}
.category-card-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 0.4rem;
    color: var(--text);
}
.category-card-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 0.75rem;
    line-height: 1.45;
}
.category-card-meta {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 500;
}

/* Desktop polish: category cards look cleaner and more intentional */
@media (min-width: 992px) {
    .category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.35rem;
    }
    .category-card {
        position: relative;
        min-height: 210px;
        padding: 1.35rem 1.35rem 1.2rem;
        overflow: hidden;
        border-color: rgba(88, 117, 170, 0.45);
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(59, 130, 246, 0.08);
    }
    .category-card::before {
        content: "";
        position: absolute;
        inset: 0 0 auto 0;
        height: 3px;
        background: var(--accent-line);
        opacity: 0.9;
    }
    .category-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(59, 130, 246, 0.2);
    }
    .category-card-icon {
        width: 2.6rem;
        height: 2.6rem;
        display: inline-grid;
        place-items: center;
        border-radius: 999px;
        margin-bottom: 0.85rem;
        font-size: 1.25rem;
        line-height: 1;
        background: linear-gradient(135deg, rgba(59,130,246,0.18), rgba(245,158,11,0.15));
        border: 1px solid rgba(99, 157, 255, 0.3);
    }
    .category-card-title {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    .category-card-desc {
        font-size: 0.92rem;
        line-height: 1.5;
        min-height: 4.2em;
    }
    .category-card-meta {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        margin-top: 0.25rem;
        font-size: 0.82rem;
    }
    .category-card-meta::before {
        content: "→";
        opacity: 0.8;
    }
}

/* ===== Popular calculators (homepage SEO links) ===== */
.popular-calcs {
    margin-bottom: 2.5rem;
    padding: 1.5rem 1.35rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}
.popular-calcs .section-title {
    margin-bottom: 0.75rem;
}
.popular-calcs .section-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0 0 1.25rem;
    line-height: 1.5;
}
.popular-calcs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem 1rem;
    margin: 0;
}
.popular-calcs-grid a {
    display: block;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.35;
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-input);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.popular-calcs-grid a:hover {
    text-decoration: none;
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.06);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    color: var(--accent);
}
[data-theme="dark"] .popular-calcs-grid a:hover {
    text-decoration: none;
    border-color: rgba(59, 130, 246, 0.45);
    background: rgba(59, 130, 246, 0.1);
}

/* Odstęp między „polecane” a „kategorie” na stronie głównej */
.categories-preview {
    margin-top: 1.5rem;
}
.categories-preview .section-title {
    margin-top: 0;
}

/* ===== Calculator list (links to calculators) ===== */
.calculator-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
/* Opisowe bloki podkategorii (tylko etykieta tekstowa, bez linków) */
.calculator-topic-block {
    margin-top: 1.5rem;
}
.calculator-topic-block:first-child {
    margin-top: 0;
}
.calculator-topic-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 0.75rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
}
.calculator-list-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.calculator-card-link {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem 1.25rem 1.75rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    position: relative;
    box-shadow: var(--shadow-card);
}
.calculator-card-link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-line);
    border-radius: var(--radius) 0 0 var(--radius);
    opacity: 0.7;
}
.calculator-card-link:hover {
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.06);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(59, 130, 246, 0.12);
}
[data-theme="light"] .calculator-card-link:hover {
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.08), 0 0 0 1px rgba(59, 130, 246, 0.15);
}
.calculator-link-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
    color: var(--text);
}
.calculator-link-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 0.5rem;
    line-height: 1.45;
}
.calculator-link-cta {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent);
}
.empty-state { color: var(--text-muted); margin: 0; }

/* ===== Why us ===== */
.why-us {
    margin-top: 2.75rem;
    padding: 1.5rem 1.35rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}
.why-us .section-title {
    margin-bottom: 1rem;
}
.why-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.85rem;
}
.why-list li {
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-muted);
    line-height: 1.55;
}
.why-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-gradient);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.35);
}

/* ===== SEO: FAQ, table, sources ===== */
.popular-calcs-list { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-size: 0.95rem; }
.popular-calcs-list li { position: relative; padding-left: 0.85rem; }
.popular-calcs-list li::before { content: "•"; position: absolute; left: 0; color: var(--accent); }
.popular-calcs-list a { color: var(--accent); text-decoration: none; }
.popular-calcs-list a:hover { text-decoration: underline; }

.seo-faq {
    margin-top: 2.75rem;
    padding: 1.5rem 1.35rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}
.seo-faq .section-title {
    margin-bottom: 1rem;
}
.faq-list { margin: 0; padding: 0; list-style: none; }
.faq-list dt {
    font-weight: 600;
    font-size: 1.02rem;
    color: var(--text);
    margin-top: 1.35rem;
    margin-bottom: 0.35rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border);
}
.faq-list dt:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.faq-list dd {
    margin: 0 0 0.25rem;
    padding-left: 0;
    color: var(--text-muted);
    line-height: 1.6;
}
.faq-list a { color: var(--accent); text-decoration: none; }
.faq-list a:hover { text-decoration: underline; }

.seo-table-section {
    margin-top: 2.75rem;
    padding: 1.5rem 1.35rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}
.seo-table-section .section-title {
    margin-bottom: 1rem;
}
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); margin: 0; }
.seo-table-section .table-wrap {
    overflow-x: auto;
}
.seo-overview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}
.seo-overview-table th,
.seo-overview-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.seo-overview-table th {
    background: var(--bg-input);
    color: var(--text);
    font-weight: 600;
}
.seo-overview-table tbody tr:last-child td { border-bottom: none; }
.seo-overview-table td { color: var(--text-muted); }
.seo-overview-table td:first-child {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.seo-sources {
    margin-top: 2rem;
    padding: 1.25rem 1.35rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.65;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}
.seo-sources a { color: var(--accent); text-decoration: none; }
.seo-sources a:hover { text-decoration: underline; }
.sources-lang.sources-en { display: none; }
html[lang="en"] .sources-lang.sources-pl { display: none; }
html[lang="en"] .sources-lang.sources-en { display: inline; }

/* ===== Auth / narrow pages ===== */
.container-narrow { max-width: 560px; }
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}
.auth-card h1 { margin: 0 0 0.5rem; }
.auth-desc { color: var(--text-muted); margin: 0 0 1.25rem; }
.auth-placeholder {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}
.auth-placeholder ul { margin: 0.5rem 0 0 1rem; padding: 0; }

.admin-block { margin-bottom: 1rem; }
.admin-block p { margin: 0.35rem 0; }
.admin-stats-local-hint { font-size: 0.9rem; opacity: 0.9; margin: 0.35rem 0 0.75rem; max-width: 42rem; }
.admin-list { margin: 0.5rem 0; padding-left: 1.25rem; }
.hidden { display: none !important; }
.table-wrap { overflow-x: auto; margin: 0.5rem 0; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 0.4rem 0.6rem; text-align: left; border-bottom: 1px solid var(--border-color, #e0e0e0); }
.admin-table th { font-weight: 600; }
.admin-table tbody tr:hover { background: var(--bg-hover, #f5f5f5); }

/* ===== Calculator Grid ===== */
.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: start;
}
/* Chart.js / canvas ma „intrinsic” szerokość — bez min-width: 0 kolumny siatki rozpychają układ */
.calculator-grid > * {
    min-width: 0;
}
@media (max-width: 900px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Ekologia — rozbudowane formularze (wiele pól, układ siatki) ===== */
.eco-calculator-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
}
@media (max-width: 1100px) {
    .eco-calculator-grid {
        grid-template-columns: 1fr;
    }
}
.eco-calc-form .eco-input-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem 1rem;
}
@media (max-width: 600px) {
    .eco-calc-form .eco-input-grid {
        grid-template-columns: 1fr;
    }
}
.eco-calc-form .eco-field-full {
    grid-column: 1 / -1;
}
.eco-calc-form .fieldset--accent {
    margin-top: 0.5rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(59, 130, 246, 0.06));
    border: 1px solid var(--border);
}
.eco-result-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 0.75rem 0 1rem;
}
.eco-metric {
    flex: 1 1 140px;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border);
}
.eco-metric strong {
    display: block;
    font-size: 1.15rem;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
}
.eco-metric span {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.eco-chart-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0.75rem 0 0.35rem;
    color: var(--text-muted);
}
.results-card.eco-results-wide {
    min-height: 380px;
}

.calculator-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1.5rem 1.5rem 1.75rem;
    box-shadow: var(--shadow-card);
    position: relative;
}
.calculator-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-line);
    border-radius: var(--radius) 0 0 var(--radius);
    opacity: 0.75;
}
.calculator-card h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1.25rem;
    color: var(--text);
}

/* ===== Form ===== */
#tco-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.fieldset {
    border: none;
    margin: 0;
    padding: 0;
}
.fieldset legend {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.fieldset label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
}
.fieldset label:last-child { margin-bottom: 0; }
.calc-hint { margin: 0.75rem 0 0.25rem; font-size: 0.85rem; color: var(--text-muted); }
.fieldset label span {
    font-size: 0.9rem;
    color: var(--text-muted);
}
.fieldset input {
    width: 100%;
    padding: 0.6rem 0.85rem;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--text);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s;
}
.fieldset input:focus {
    outline: none;
    border-color: var(--accent);
}
/* Dark mode: delikatnie jaśniejsze pola formularza kalkulatora */
[data-theme="dark"] .fieldset input,
[data-theme="dark"] .calculator-card input[type="number"],
[data-theme="dark"] .calculator-card select {
    background: #2b2b38;
    border-color: #4a4a5c;
    box-shadow: inset 0 0 0 1px rgba(138, 180, 255, 0.12);
}
[data-theme="dark"] .fieldset input:focus,
[data-theme="dark"] .calculator-card input[type="number"]:focus,
[data-theme="dark"] .calculator-card select:focus {
    border-color: #6aa2ff;
    box-shadow:
        0 0 0 3px rgba(106, 162, 255, 0.22),
        inset 0 0 0 1px rgba(176, 208, 255, 0.35);
}
[data-theme="dark"] .fieldset label span {
    color: #b7bfd4;
}
/* Wartość przykładowa (Np. …) — mniej wyraźna, sygnalizuje tylko podpowiedź */
.fieldset input::placeholder {
    color: var(--text-muted);
    opacity: 0.55;
    font-style: italic;
}

/* Kalkulatory ekologia / Regulacje AI — przykładowe wartości tylko jako placeholder (wyszarzone) */
.eco-calc-form input::placeholder,
.calculator-card input[type="number"]::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
    font-style: italic;
    font-weight: 400;
}
[data-theme="dark"] .eco-calc-form input::placeholder,
[data-theme="dark"] .calculator-card input[type="number"]::placeholder {
    opacity: 0.45;
}

/* Blok SEO / treść podstrony kalkulatora (Regulacje AI i inne) */
.calc-seo-block {
    margin: 0 0 1rem;
    padding: 1.1rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-muted, rgba(148, 163, 184, 0.08));
}
.calc-seo-block-title {
    margin: 0 0 0.65rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
}
.calc-seo-block-text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
    overflow-wrap: anywhere;
    word-wrap: break-word;
}
[data-theme="dark"] .calc-seo-block {
    background: rgba(148, 163, 184, 0.06);
}

/* Google AdSense — kontenery .ad-slot wypełniane przez app.js (CONFIG.ADENSE) */
.ad-slot {
    min-height: 90px;
    margin: 1rem 0;
    text-align: center;
    overflow: hidden;
}
.ad-slot-inline {
    margin: 1.25rem 0 1.75rem;
}

/* Regulacje AI — reklamy w szynach po bokach (desktop), pod treścią (mobile) */
.main .container.calc-rails-outer {
    max-width: 1340px;
}
/* Ta sama strona kalkulatora — wcześniejsza reguła szyn (1340px) wygrywała nad szerokością siatki; tu celowo poszerzamy cały układ z reklamami. */
.main .container.calc-rails-outer:is(.container--calc-wide, :has(.calculator-grid)) {
    max-width: 1560px;
}
@media (min-width: 901px) {
    .main .container.container--calc-wide .calculator-grid > .calculator-card {
        padding: 1.4rem 1.25rem 1.4rem 1.6rem;
    }
}
.calc-rails-grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}
.calc-rails-main {
    min-width: 0;
    width: 100%;
    order: 1;
}
.ad-rail {
    width: 100%;
    max-width: 100%;
}
/* Domyślnie jedna szyna (prawa) pod treścią — mniej powtórzeń reklam na mobile */
.ad-rail--left {
    display: none;
}
.ad-rail--right {
    order: 2;
}
.ad-rail .ad-slot.ad-slot-sidebar {
    margin: 0.75rem 0;
    min-height: 100px;
}
/* Średni desktop: jedna szyna (prawa), ~300px — lepsze dla jednostek AdSense */
@media (min-width: 1100px) and (max-width: 1299px) {
    .calc-rails-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
        gap: 1rem 1.25rem;
        align-items: start;
    }
    .ad-rail--left {
        display: none;
    }
    .calc-rails-main {
        grid-column: 1;
        order: 0;
        width: auto;
    }
    .ad-rail--right {
        grid-column: 2;
        order: 0;
        display: block;
        position: sticky;
        top: 5.75rem;
        align-self: start;
    }
    .ad-rail--right .ad-slot.ad-slot-sidebar {
        margin: 0;
        min-height: 250px;
    }
}
@media (min-width: 1300px) {
    .calc-rails-grid {
        display: grid;
        grid-template-columns: minmax(200px, 280px) minmax(0, 1fr) minmax(200px, 280px);
        gap: 1rem 1.25rem;
        align-items: start;
    }
    .ad-rail--left {
        display: block;
        order: unset;
    }
    .calc-rails-main {
        grid-column: 2;
        order: 0;
        width: auto;
    }
    .ad-rail--left {
        grid-column: 1;
        order: 0;
    }
    .ad-rail--right {
        grid-column: 3;
        order: 0;
    }
    .ad-rail {
        position: sticky;
        top: 5.75rem;
        align-self: start;
    }
    .ad-rail .ad-slot.ad-slot-sidebar {
        margin: 0;
        min-height: 250px;
    }
}

/* Select w formularzach kalkulatorów — spójny wygląd i czytelna lista opcji (unika czarnego prostokąta) */
.fieldset select,
.calculator-card select {
    width: 100%;
    padding: 0.6rem 0.85rem;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--text);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    appearance: auto;
    -webkit-appearance: menulist;
}
.fieldset select:focus,
.calculator-card select:focus {
    outline: none;
    border-color: var(--accent);
}
/* Opcje listy — jawnie tło i kolor, żeby nie znikały w ciemnym motywie */
.fieldset select option,
.calculator-card select option {
    background: var(--bg-card);
    color: var(--text);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}
.btn {
    padding: 0.65rem 1.25rem;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.3);
}
.btn-primary:hover {
    background: var(--accent-gradient-hover);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}
/* Jasny motyw — przyciski mniej intensywne, stonowany niebieski */
[data-theme="light"] .btn-primary {
    background: #4f7fd8;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.2);
}
[data-theme="light"] .btn-primary:hover {
    background: #3b6fc7;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}
[data-theme="light"] .nav-link.btn-nav {
    background: #4f7fd8;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.2);
}
[data-theme="light"] .nav-link.btn-nav:hover {
    background: #3b6fc7;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}
.btn-secondary {
    background: var(--bg-input);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: var(--border);
    color: var(--text);
}

/* ===== Results ===== */
.results-card {
    min-height: 320px;
}
.calc-usage {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-muted);
}
.calc-usage strong {
    color: var(--text);
}
.results-placeholder {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}
.results-placeholder p { margin: 0; }
.results-content.hidden {
    display: none !important;
}
.results-placeholder.hidden { display: none; }

.result-summary {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.result-main {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
}
.result-main.secondary { opacity: 0.95; }
.result-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}
.result-value {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--success);
}
.result-main.secondary .result-value {
    font-size: 1.25rem;
    color: var(--text);
}

/* Cooking calculators — czytelny blok wyników */
.cooking-result {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.cooking-result-summary {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 0.25rem;
}
.cooking-result-rows {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.cooking-result-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}
.cooking-result-row:last-child {
    border-bottom: none;
}
.cooking-result-label {
    font-size: 0.95rem;
    color: var(--text);
}
.cooking-result-value {
    font-weight: 600;
    font-family: var(--font-mono);
    font-size: 1.15rem;
    color: var(--success);
}

.hex-rgb-preview-wrap { display: block; }
.hex-rgb-preview {
    display: inline-block;
    width: 5rem;
    height: 4rem;
    border-radius: 8px;
    border: 2px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.result-breakdown {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.result-breakdown li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.result-breakdown li:last-child { border-bottom: none; }
.result-breakdown .breakdown-label { color: var(--text-muted); }
.result-breakdown .breakdown-value {
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--text);
}

/* ===== Wykresy w kalkulatorach ===== */
.calc-chart-wrap {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    max-width: 100%;
    min-width: 0;
    position: relative;
}
.calc-chart-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 0.75rem 0;
}
.calc-chart-wrap canvas {
    max-height: 280px;
    width: 100% !important;
}

/* ===== Footer ===== */
.footer {
    background: var(--bg-card);
    border-top: none;
    padding: 1.25rem 0;
    margin-top: auto;
    position: relative;
}
[data-theme="dark"] .footer {
    background: linear-gradient(0deg, #16161c 0%, #141419 100%);
}
[data-theme="dark"] .footer::before {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-line);
    opacity: 0.85;
}
[data-theme="light"] .footer {
    background: linear-gradient(0deg, #fafbfd 0%, #ffffff 100%);
}
[data-theme="light"] .footer::before {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-line);
    opacity: 0.7;
}
.footer-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.footer-copy {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}
.footer-links a {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
}
.footer-links a:hover { color: var(--accent); }

/* ===== Responsive ===== */
@media (max-width: 640px) {
    /* Na mobile nie przycinaj dropdownu wyboru języka — overflow: hidden w .header przycina listę opcji */
    .header { overflow: visible; }
    /* Wybór języka: szerszy select i czytelne opcje w rozwijanej liście */
    .lang-select-wrap {
        position: relative;
        z-index: 110;
        min-width: 5rem;
    }
    .lang-select-wrap .lang-select {
        min-width: 5rem;
        font-size: 1rem;
        padding: 0.4rem 0.5rem;
        -webkit-appearance: menulist;
        appearance: menulist;
    }
    .lang-select-wrap .lang-select option,
    .lang-select option {
        background: var(--bg-card);
        color: var(--text);
        font-size: 1rem;
        padding: 0.35rem 0.5rem;
    }
    [data-theme="light"] .lang-select-wrap .lang-select option,
    [data-theme="light"] .lang-select option {
        background: #fff;
        color: #1a1d24;
    }
    .nav { gap: 0.75rem; }
    .nav-link { font-size: 0.9rem; }
    .nav-link.btn-nav { padding: 0.35rem 0.7rem; }
    .category-grid { grid-template-columns: 1fr; }
    /* Nagłówek: na mobile wyśrodkowanie logo, menu i bloku utils (język, motyw, zaloguj) */
    .header .container {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }
    .header .container .logo { margin-right: 0; }
    .header .container .nav { flex: 1 1 100%; order: 3; justify-content: center; }
    .header .container .header-utils {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.75rem;
        padding-left: 0;
        border-left: none;
    }
    .header-utils .lang-form,
    .header-utils .header-format-label:first-of-type { padding-left: 0; border-left: none; margin-left: 0; }
    /* Waluta i jednostki — wyśrodkowane, bez nadmiernego rozciągania */
    .header-utils .header-format-label {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.35rem;
    }
    .header-format-label .currency-select,
    .header-format-label .units-select {
        min-width: 6rem;
        max-width: 8.5rem;
    }
    #header-login { justify-content: center; }
    .footer-grid {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    .footer-links {
        justify-content: center;
        width: 100%;
    }
}
