/* poLCA — Polska Baza Danych LCA | v5.0.0 | polca.org.pl
   Aesthetic: Institutional Scientific Portal
   Typography: Inter Tight + Inter + IBM Plex Mono */

/* === CSS VARIABLES === */
:root {
    --sidebar-bg: #111318;
    --sidebar-hover: #1E2028;
    --sidebar-active: #282A33;
    --sidebar-text: rgba(255,255,255,0.45);
    --sidebar-text-active: #FFFFFF;
    --sidebar-width: 256px;
    --sidebar-border: rgba(255,255,255,0.06);

    /* Ink palette — cool darks */
    --ink: #111318;
    --ink-secondary: #23262F;
    --ink-muted: #555555;

    /* Paper palette — cool neutrals */
    --paper: #F7F8FA;
    --paper-warm: #EEF0F4;
    --paper-card: #FFFFFF;
    --paper-white: #FFFFFF;

    /* Accent: deep teal — institutional, scientific */
    --accent: #0E7C6B;
    --accent-light: #12A18A;
    --accent-subtle: rgba(14, 124, 107, 0.08);
    --accent-border: rgba(14, 124, 107, 0.2);

    /* Functional: muted, unsaturated */
    --func-green: #4A7C59;
    --func-green-bg: rgba(74, 124, 89, 0.07);
    --func-green-border: rgba(74, 124, 89, 0.18);
    --func-red: #9B3B3B;
    --func-red-bg: rgba(155, 59, 59, 0.07);
    --func-red-border: rgba(155, 59, 59, 0.18);
    --func-blue: #3B6B9B;
    --func-blue-bg: rgba(59, 107, 155, 0.07);
    --func-blue-border: rgba(59, 107, 155, 0.18);
    --func-amber: #8B6914;
    --func-amber-bg: rgba(139, 105, 20, 0.07);
    --func-amber-border: rgba(139, 105, 20, 0.18);
    --func-purple: #6B4C8B;
    --func-purple-bg: rgba(107, 76, 139, 0.07);
    --func-purple-border: rgba(107, 76, 139, 0.18);

    /* Text */
    --text-primary: #111318;
    --text-body: #374151;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;
    --text-light: #D1D5DB;

    /* Borders */
    --border: #E5E7EB;
    --border-light: #F3F4F6;
    --border-strong: #D1D5DB;

    /* Shadows — neutral */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.04);

    /* Radius — minimal, sharp */
    --radius-xs: 3px;
    --radius-sm: 6px;
    --radius-md: 8px;

    --topbar-height: 52px;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* === RESET === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    font-family: 'Inter', 'Helvetica Neue', Helvetica, sans-serif;
    background: var(--paper);
    color: var(--text-body);
    line-height: 1.65;
    font-size: 15px;
    font-weight: 400;
}

::selection {
    background: rgba(14, 124, 107, 0.15);
    color: var(--ink);
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-light); }

/* === SIDEBAR === */
.polca-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: transform 0.4s var(--ease-out);
}

.sidebar-brand {
    padding: 1.6rem 1.4rem 1.2rem;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 1.3rem;
    font-weight: 600;
    color: #FFFFFF;
    display: block;
    margin-bottom: 0.15rem;
    text-decoration: none;
    letter-spacing: -0.03em;
    transition: opacity 0.2s;
}
.sidebar-logo:hover { color: #FFFFFF; opacity: 0.8; }

.sidebar-subtitle {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.3);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0.6rem;
}

.sidebar-nav-label {
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.2);
    padding: 0.9rem 0.75rem 0.3rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-xs);
    color: var(--sidebar-text);
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.2s var(--ease-out);
    text-decoration: none;
    margin-bottom: 1px;
}

.sidebar-nav a:hover {
    background: var(--sidebar-hover);
    color: rgba(255,255,255,0.8);
}

.sidebar-nav a.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
    font-weight: 600;
}

.sidebar-nav a .nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.sidebar-nav a:hover .nav-icon,
.sidebar-nav a.active .nav-icon { opacity: 1; }

.sidebar-footer {
    padding: 0.9rem 1.4rem;
    border-top: 1px solid var(--sidebar-border);
}

.sidebar-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.68rem;
    color: rgba(255,255,255,0.3);
    font-family: 'IBM Plex Mono', monospace;
}

.status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

/* === TOPBAR === */
.polca-topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: rgba(247, 248, 250, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: var(--radius-xs);
}

.sidebar-toggle span {
    display: block;
    width: 16px;
    height: 1.5px;
    background: var(--text-secondary);
    margin: 3.5px 0;
    transition: 0.3s var(--ease-out);
}

.topbar-search {
    position: relative;
    width: 260px;
}

.topbar-search input {
    width: 100%;
    padding: 0.45rem 0.7rem 0.45rem 2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-family: inherit;
    background: var(--paper-card);
    color: var(--text-body);
    transition: all 0.25s var(--ease-out);
}

.topbar-search input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--paper-white);
    box-shadow: 0 0 0 3px rgba(14, 124, 107, 0.06);
}

.topbar-search::before {
    content: '';
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    width: 13px;
    height: 13px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23999999'%3E%3Cpath fill-rule='evenodd' d='M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border: none;
    border-radius: var(--radius-xs);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    text-decoration: none;
}

.topbar-btn-primary {
    background: var(--ink);
    color: #FFFFFF;
}
.topbar-btn-primary:hover {
    background: var(--ink-secondary);
    color: #FFFFFF;
    transform: translateY(-1px);
}

.topbar-btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.topbar-btn-outline:hover {
    background: var(--paper-card);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

/* === MAIN CONTENT === */
.polca-content {
    margin-left: var(--sidebar-width);
    padding-top: var(--topbar-height);
    min-height: 100vh;
}

.polca-page {
    padding: 2.5rem 3rem 3.5rem;
    max-width: 1120px;
    animation: page-enter 0.4s ease-out;
}

.polca-page-wide { max-width: 100%; }

.page-header {
    margin-bottom: 2.75rem;
    position: relative;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--ink);
}

.page-title {
    font-family: 'Inter Tight', 'Helvetica Neue', Helvetica, sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.page-subtitle {
    font-size: 0.92rem;
    color: var(--text-secondary);
    max-width: 640px;
    line-height: 1.7;
}

/* === CARDS — paper-like, no rounded corners === */
.card {
    background: var(--paper-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-lg { padding: 2rem 2.25rem; }

.card-accent-green { border-left: 3px solid var(--func-green); }
.card-accent-orange { border-left: 3px solid var(--accent); }
.card-accent-blue { border-left: 3px solid var(--func-blue); }
.card-accent-red { border-left: 3px solid var(--func-red); }
.card-accent-purple { border-left: 3px solid var(--func-purple); }

.card-dark {
    background: var(--ink);
    border-color: transparent;
    color: rgba(255,255,255,0.85);
    position: relative;
    overflow: hidden;
}

.card-dark::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(14,124,107,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.card-dark .card-title { color: #FFFFFF; }
.card-dark .card-text { color: rgba(255,255,255,0.55); }

.card-title {
    font-family: 'Inter Tight', 'Helvetica Neue', Helvetica, sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.card-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 0.6rem;
    font-weight: 500;
}

.card-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.75;
}

.card-footer {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

/* === HERO SECTION === */
.hero-section {
    padding: 3.5rem 0 2.5rem;
    position: relative;
    border-bottom: 2px solid var(--ink);
    margin-bottom: 2.5rem;
}

.hero-overline {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.25rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.hero-overline::before {
    content: '';
    display: block;
    width: 32px;
    height: 1.5px;
    background: var(--accent);
}

.hero-title {
    font-family: 'Inter Tight', 'Helvetica Neue', Helvetica, sans-serif;
    font-size: 3.4rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.05;
    letter-spacing: -0.035em;
    margin-bottom: 1.25rem;
    max-width: 580px;
}

.hero-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 500px;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.hero-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 1.5rem;
    background: var(--ink);
    color: #FFFFFF;
    font-size: 0.84rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--radius-xs);
    text-decoration: none;
    transition: all 0.25s var(--ease-out);
    border: 1.5px solid var(--ink);
}

.hero-btn-primary:hover {
    background: var(--ink-secondary);
    color: #FFFFFF;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(20, 20, 20, 0.2);
}

.hero-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 1.5rem;
    background: transparent;
    color: var(--text-body);
    font-size: 0.84rem;
    font-weight: 600;
    font-family: inherit;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-xs);
    text-decoration: none;
    transition: all 0.25s var(--ease-out);
}

.hero-btn-outline:hover {
    background: var(--paper-card);
    color: var(--text-primary);
    border-color: var(--ink-muted);
}

/* === METRIC CARDS === */
.metric-card {
    background: var(--paper-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.4rem 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s var(--ease-out);
    position: relative;
    border-top: 3px solid var(--ink);
}

.metric-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.metric-number {
    font-family: 'Inter Tight', 'Helvetica Neue', Helvetica, sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.04em;
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.metric-tag {
    display: inline-flex;
    font-size: 0.58rem;
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding: 0.15rem 0.5rem;
    background: var(--paper-warm);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-weight: 500;
}

.metric-tag.orange {
    color: var(--accent);
    background: var(--accent-subtle);
    border-color: var(--accent-border);
}

.metric-tag.blue {
    color: var(--func-blue);
    background: var(--func-blue-bg);
    border-color: var(--func-blue-border);
}

/* === FEATURE CARDS (Dashboard) === */
.feature-card {
    background: var(--paper-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s var(--ease-out);
    display: block;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s var(--ease-out);
}

.feature-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    color: inherit;
    border-color: var(--border-strong);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    transition: transform 0.3s var(--ease-spring);
}

.feature-card:hover .feature-card-icon {
    transform: scale(1.05);
}

.feature-card-icon.green { background: var(--func-green-bg); color: var(--func-green); }
.feature-card-icon.orange { background: var(--accent-subtle); color: var(--accent); }
.feature-card-icon.blue { background: var(--func-blue-bg); color: var(--func-blue); }
.feature-card-icon.purple { background: var(--func-purple-bg); color: var(--func-purple); }

.feature-card h3 {
    font-family: 'Inter Tight', 'Helvetica Neue', Helvetica, sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.45rem;
    letter-spacing: -0.02em;
}

.feature-card p {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* === GRID LAYOUTS === */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 1.25rem; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 1.25rem; }

/* === STAT METRICS === */
.stat-block { display: flex; flex-direction: column; gap: 0.1rem; }

.stat-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.stat-value.orange { color: var(--accent); }
.stat-value.blue { color: var(--func-blue); }
.stat-value.red { color: var(--func-red); }

.stat-label {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    line-height: 1.5;
}

/* === COMPARISON BARS === */
.comp-bar-group { margin-bottom: 1rem; }
.comp-bar-group:last-child { margin-bottom: 0; }

.comp-bar-label {
    font-size: 0.72rem;
    font-family: 'IBM Plex Mono', monospace;
    color: var(--text-tertiary);
    margin-bottom: 0.35rem;
    letter-spacing: 0.02em;
}

.comp-bar-track {
    height: 28px;
    background: var(--paper-warm);
    border-radius: var(--radius-xs);
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-light);
}

.comp-bar-fill {
    height: 100%;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    font-size: 0.68rem;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    color: #FFFFFF;
    transition: width 1s var(--ease-out);
}

.comp-bar-fill.green { background: var(--ink); }
.comp-bar-fill.gray { background: var(--text-tertiary); }
.comp-bar-fill.orange { background: var(--accent); }
.comp-bar-fill.blue { background: var(--func-blue); }

.comp-note {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-top: 0.5rem;
    font-style: italic;
}

/* === LAYERS (Metodyka) === */
.layers-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.layer-card {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 1.25rem;
    padding: 1.3rem 1.5rem;
    background: var(--paper-card);
    align-items: start;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border-light);
}

.layer-card:last-child { border-bottom: none; }

.layer-card:hover { background: var(--paper-warm); }

.layer-num {
    font-family: 'Inter Tight', 'Helvetica Neue', Helvetica, sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-light);
    line-height: 1.2;
}

.layer-num.highlight {
    background: var(--accent);
    color: #FFFFFF;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xs);
    font-size: 1rem;
}

.layer-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.layer-desc {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.65rem;
}

.tag {
    font-size: 0.62rem;
    font-family: 'IBM Plex Mono', monospace;
    padding: 0.15rem 0.5rem;
    background: var(--paper-warm);
    color: var(--text-secondary);
    border-radius: var(--radius-xs);
    letter-spacing: 0.02em;
    border: 1px solid var(--border-light);
}

.tag.amber {
    background: var(--func-amber-bg);
    color: var(--func-amber);
    border-color: var(--func-amber-border);
}
.tag.blue {
    background: var(--func-blue-bg);
    color: var(--func-blue);
    border-color: var(--func-blue-border);
}
.tag.gray {
    background: var(--border-light);
    color: var(--text-secondary);
    border-color: var(--border);
}

/* === SECTOR CARDS (Analiza) === */
.sector-card {
    border-radius: var(--radius-sm);
    padding: 1.15rem 1.25rem;
    transition: transform 0.2s var(--ease-out);
}

.sector-card:hover { transform: translateY(-1px); }

.sector-card-green {
    background: var(--func-green-bg);
    border: 1px solid var(--func-green-border);
}

.sector-card-red {
    background: var(--func-red-bg);
    border: 1px solid var(--func-red-border);
}

.sector-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.sector-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 0.5rem;
}

.sector-diff-green {
    font-size: 0.72rem;
    color: var(--func-green);
    font-weight: 600;
    font-family: 'IBM Plex Mono', monospace;
}

.sector-diff-red {
    font-size: 0.72rem;
    color: var(--func-red);
    font-weight: 600;
    font-family: 'IBM Plex Mono', monospace;
}

/* === TABLES — editorial, clean === */
.polca-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.84rem;
}

.polca-table thead th {
    background: var(--paper-warm);
    padding: 0.65rem 0.8rem;
    text-align: left;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 2px solid var(--ink);
    white-space: nowrap;
}

.polca-table thead th:first-child { border-radius: var(--radius-xs) 0 0 0; }
.polca-table thead th:last-child { border-radius: 0 var(--radius-xs) 0 0; }

.polca-table tbody td {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-body);
    vertical-align: top;
}

.polca-table tbody tr:last-child td { border-bottom: none; }
.polca-table tbody tr { transition: background 0.15s; }
.polca-table tbody tr:hover td { background: rgba(14, 124, 107, 0.02); }

.polca-table .mono {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
}

.polca-table .highlight { color: var(--accent); font-weight: 600; }
.dot-full { color: var(--func-green); font-weight: 700; }
.dot-mid { color: var(--func-amber); font-weight: 700; }
.dot-low { color: var(--func-red); font-weight: 700; }

/* === CALCULATOR === */
.calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.calc-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.calc-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.calc-input {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.1rem;
    color: var(--accent);
    background: var(--paper-card);
    transition: all 0.25s var(--ease-out);
}

.calc-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14, 124, 107, 0.06);
}

.calc-select {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.86rem;
    color: var(--text-body);
    background: var(--paper-card);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23999999' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    transition: all 0.25s var(--ease-out);
}

.calc-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14, 124, 107, 0.06);
}

.calc-note {
    font-size: 0.76rem;
    color: var(--text-tertiary);
    font-style: italic;
    line-height: 1.6;
}

.calc-result-block {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.calc-result-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    margin-bottom: 0.1rem;
    font-family: 'IBM Plex Mono', monospace;
}

.calc-result-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.02em;
}

.calc-result-value small {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.calc-result-value.secondary {
    font-size: 1.05rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.calc-diff {
    font-size: 0.76rem;
    color: var(--accent);
    font-weight: 600;
    font-family: 'IBM Plex Mono', monospace;
}

.calc-divider {
    height: 1px;
    background: var(--border);
}

/* === DATASET CARDS === */
.dataset-card {
    background: var(--paper-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s var(--ease-out);
    position: relative;
}

.dataset-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-border);
    transform: translateY(-2px);
}

.dataset-badge {
    display: inline-flex;
    font-size: 0.58rem;
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    padding: 0.15rem 0.55rem;
    background: var(--accent-subtle);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-xs);
    margin-bottom: 1rem;
    font-weight: 500;
}

.dataset-card h3 {
    font-family: 'Inter Tight', 'Helvetica Neue', Helvetica, sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
    letter-spacing: -0.02em;
}

.dataset-desc {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 1.4rem;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.82rem;
}

.spec-row:last-child { border-bottom: none; }
.spec-key { color: var(--text-tertiary); font-size: 0.78rem; }
.spec-val {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* === PRICING GRID === */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.price-card {
    background: var(--paper-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s var(--ease-out);
}

.price-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.price-card.recommended {
    border-color: var(--ink);
    border-width: 2px;
    box-shadow: var(--shadow-md);
    position: relative;
}

.price-card.recommended::before {
    content: 'Rekomendowane';
    position: absolute;
    top: -10px;
    right: 14px;
    font-size: 0.58rem;
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #FFFFFF;
    background: var(--ink);
    padding: 0.12rem 0.55rem;
    border-radius: var(--radius-xs);
    font-weight: 500;
}

.price-tier {
    font-size: 0.62rem;
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
}

.price-card.recommended .price-tier { color: var(--accent); }

.price-amount {
    font-family: 'Inter Tight', 'Helvetica Neue', Helvetica, sans-serif;
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.1rem;
    letter-spacing: -0.03em;
}

.price-period {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    margin-bottom: 1.25rem;
}

.price-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* === SOURCES / BADGES === */
.badge-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
    margin-bottom: 1.4rem;
}

.badge {
    font-size: 0.72rem;
    padding: 0.25rem 0.55rem;
    background: var(--paper-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    transition: all 0.2s;
}

.badge:hover { background: var(--paper-warm); }

.badge.official {
    border-color: var(--accent-border);
    color: var(--accent);
    background: var(--accent-subtle);
}

.badge.official:hover {
    border-color: var(--accent);
    background: rgba(14, 124, 107, 0.12);
}

.badge.validation {
    border-style: dashed;
    color: var(--text-tertiary);
}

/* === BLOCKQUOTE — editorial === */
.quote-block {
    border-left: 3px solid var(--ink);
    padding: 1.5rem 1.75rem;
    background: var(--paper-card);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.quote-block::before {
    content: '\201C';
    position: absolute;
    top: -8px;
    left: 12px;
    font-family: 'Inter Tight', 'Helvetica Neue', Helvetica, sans-serif;
    font-size: 3.5rem;
    color: var(--border);
    line-height: 1;
}

.quote-block p {
    font-family: 'Inter Tight', 'Helvetica Neue', Helvetica, sans-serif;
    font-size: 1.02rem;
    font-style: italic;
    line-height: 1.75;
    color: var(--text-body);
}

.quote-source {
    font-family: 'IBM Plex Mono', monospace;
    font-style: normal;
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-top: 0.75rem;
    letter-spacing: 0.04em;
}

/* === SECTION UTILITY === */
.section-num {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.section-gap { margin-bottom: 1.5rem; }
.section-gap-lg { margin-bottom: 2.5rem; }
.mt-1 { margin-top: 0.75rem; }
.mt-2 { margin-top: 1.25rem; }
.mt-3 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.75rem; }
.mb-2 { margin-bottom: 1.25rem; }

/* === PROSE === */
.prose {
    font-size: 0.92rem;
    color: var(--text-body);
    line-height: 1.85;
    max-width: 640px;
}

.prose p { margin-bottom: 1.1rem; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { font-weight: 600; color: var(--text-primary); }

/* === ANIMATIONS === */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.fade-in.visible:nth-child(1) { transition-delay: 0ms; }
.fade-in.visible:nth-child(2) { transition-delay: 100ms; }
.fade-in.visible:nth-child(3) { transition-delay: 200ms; }
.fade-in.visible:nth-child(4) { transition-delay: 300ms; }

/* Page entrance */
@keyframes page-enter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === AMBER BLOCKS (Layer VI special) === */
.amber-card {
    background: var(--func-amber-bg);
    border: 1px solid var(--func-amber-border);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.amber-card-title {
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.amber-highlight {
    border-left: 4px solid var(--accent);
}

/* === PORTAL FOOTER === */
.polca-portal-footer {
    margin-left: var(--sidebar-width);
    padding: 2rem 3rem;
    font-size: 0.7rem;
    color: var(--text-tertiary);
    border-top: 1px solid var(--border);
    background: var(--paper-card);
    letter-spacing: 0.02em;
    font-family: 'IBM Plex Mono', monospace;
}

.polca-portal-footer a {
    color: var(--text-tertiary);
    transition: color 0.2s;
}

.polca-portal-footer a:hover {
    color: var(--accent);
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
    .pricing-grid { grid-template-columns: 1fr; }
    .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    :root { --sidebar-width: 0px; }

    .polca-sidebar {
        transform: translateX(-256px);
        width: 256px;
    }

    .polca-sidebar.active { transform: translateX(0); }
    .polca-topbar { left: 0; }
    .polca-content { margin-left: 0; }
    .polca-portal-footer { margin-left: 0; }
    .sidebar-toggle { display: block; }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        backdrop-filter: blur(4px);
        z-index: 190;
    }

    .sidebar-overlay.active { display: block; }
    .topbar-search { width: 140px; }

    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
    .calc-grid { grid-template-columns: 1fr; }
    .pricing-grid { grid-template-columns: 1fr; }

    .polca-page { padding: 1.25rem 1rem; }
    .page-title { font-size: 1.7rem; }
    .hero-title { font-size: 2rem; }
    .hero-section { padding: 2rem 0 1.5rem; }
    .metric-number { font-size: 1.6rem; }
    .page-header { padding-bottom: 1.5rem; }
}

/* Steel highlight */
.steel-highlight {
    background: var(--func-purple-bg);
    border: 1px solid var(--func-purple-border);
    border-radius: var(--radius-sm);
    padding: 1.5rem 1.75rem;
}

.steel-stat { text-align: center; }
.steel-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Inter Tight', 'Helvetica Neue', Helvetica, sans-serif;
    letter-spacing: -0.02em;
}
.steel-stat-label {
    font-size: 0.68rem;
    color: var(--text-tertiary);
    font-family: 'IBM Plex Mono', monospace;
}

/* === PAPER TEXTURE === */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    mix-blend-mode: multiply;
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* === DIVIDER — editorial rule === */
.editorial-rule {
    width: 48px;
    height: 2px;
    background: var(--ink);
    margin: 1.5rem 0;
}

/* === HERO WITH IMAGE === */
.hero-with-image {
    position: relative;
    min-height: 420px;
    display: flex;
    align-items: center;
    overflow: hidden;
    border-bottom: none;
    margin-bottom: 2.5rem;
    padding: 4rem 0 3.5rem;
}

.hero-image-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(17,19,24,0.88) 0%, rgba(17,19,24,0.65) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-with-image .hero-overline {
    color: var(--accent-light);
}

.hero-with-image .hero-overline::before {
    background: var(--accent-light);
}

.hero-with-image .hero-title {
    color: #FFFFFF;
    max-width: 620px;
}

.hero-with-image .hero-desc {
    color: rgba(255,255,255,0.75);
}

.hero-with-image .hero-btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #FFFFFF;
}

.hero-with-image .hero-btn-primary:hover {
    background: var(--accent-light);
    border-color: var(--accent-light);
    color: #FFFFFF;
}

.hero-with-image .hero-btn-outline {
    color: rgba(255,255,255,0.85);
    border-color: rgba(255,255,255,0.25);
}

.hero-with-image .hero-btn-outline:hover {
    background: rgba(255,255,255,0.1);
    color: #FFFFFF;
    border-color: rgba(255,255,255,0.4);
}

/* === SECTION IMAGE STRIP === */
.section-image-strip {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
    margin-bottom: 2rem;
    border-radius: var(--radius-sm);
}

.section-image-strip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.section-image-strip::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to bottom, transparent, var(--paper));
    pointer-events: none;
}

/* === NOSCRIPT FALLBACK === */
noscript .fade-in,
.no-js .fade-in {
    opacity: 1 !important;
    transform: none !important;
}

@media (max-width: 768px) {
    .hero-with-image {
        min-height: 280px;
        padding: 2.5rem 0 2rem;
    }

    .hero-with-image .hero-title {
        font-size: 2rem;
    }

    .section-image-strip {
        height: 140px;
        margin-bottom: 1.25rem;
    }
}
