:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --primary: #38bdf8;
    --accent: #ef4444;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --severity-normal: #10b981;
    --severity-warning: #f59e0b;
    --severity-danger: #ef4444;
}

body.v2-dark {
    background-color: var(--bg-dark);
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    overflow-x: hidden;
}

/* Navbar Enhancements */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background: transparent;
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.navbar .logo {
    flex: 1;
    display: flex;
    align-items: center;
}

.navbar .nav-links {
    flex: 2;
    justify-content: center;
}

.navbar .hamburger {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.logo-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.4rem;
}

.logo-text .accent {
    color: var(--primary);
}

/* Search Bar in Hero */
.hero-search {
    max-width: 600px;
    margin: 2rem auto 3rem;
    position: relative;
    z-index: 10;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1.2rem;
    color: var(--text-muted);
}

#atlasSearch {
    width: 100%;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 99px;
    padding: 1rem 1.5rem 1rem 3.5rem;
    color: white;
    font-size: 1.1rem;
    transition: var(--transition);
}

#atlasSearch:focus {
    outline: none;
    background: rgba(30, 41, 59, 0.8);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.2);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    flex: 2;
    justify-content: center;
}

.nav-links li a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-links li a:hover {
    color: var(--primary);
}

/* --- Dropdown Navigation --- */
.nav-dropdown {
    position: relative;
    padding-bottom: 0.5rem;
    margin-bottom: -0.5rem;
}

.nav-dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.nav-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.97);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.75rem 0.5rem 0.5rem;
    min-width: 180px;
    list-style: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    z-index: 500;
    margin-top: 0;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    width: 100%;
    height: 12px;
}

.nav-dropdown:hover .dropdown-menu {
    display: block;
    animation: fadeInDown 0.15s ease;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.dropdown-menu li a {
    display: block;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    color: var(--nav-text) !important;
    font-size: 0.9rem !important;
    white-space: nowrap;
    text-decoration: none;
}

.dropdown-menu li a:hover {
    background: rgba(56, 189, 248, 0.1);
    color: var(--nav-primary) !important;
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    gap: 12px;
    margin-left: 20px;
    align-items: center;
}

.lang-btn {
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.lang-btn.active {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.3);
}

.flag-icon {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 2px;
    display: block;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.hamburger {
    display: none;
}

/* Hero Section */
.v2-hero {
    padding: 110px 5% 70px;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 80% 20%, rgba(56, 189, 248, 0.14), transparent 45%),
                radial-gradient(circle at 20% 80%, rgba(16, 185, 129, 0.08), transparent 45%),
                linear-gradient(180deg, #0b1120 0%, #0f172a 100%);
    border-bottom: 1px solid var(--glass-border);
}

.hero-ekg-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.55;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    border-radius: 99px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    letter-spacing: 0.5px;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.15);
}

.badge-pulse {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 10px #10b981;
    animation: live-blink 1.2s infinite ease-in-out;
}

.text-gradient {
    background: linear-gradient(135deg, #ffffff 0%, #38bdf8 55%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.v2-hero h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 3.6rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.v2-hero p {
    color: #94a3b8;
    font-size: 1.2rem;
    max-width: 720px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

.hero-stats-chips {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.2rem auto 2.2rem;
}

.hero-stats-chips .chip {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #cbd5e1;
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    gap: 6px;
}

.chip-num {
    color: #38bdf8;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
}

/* Wyszukiwarka w Hero */
.hero-search {
    max-width: 620px;
    margin: 0 auto 2.5rem;
    position: relative;
    z-index: 10;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 1.3rem;
    color: #64748b;
    pointer-events: none;
    transition: color 0.2s ease;
}

#atlasSearch {
    width: 100%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 99px;
    padding: 1.1rem 3.5rem 1.1rem 3.5rem;
    color: white;
    font-size: 1.05rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#atlasSearch:focus {
    outline: none;
    background: rgba(15, 23, 42, 0.95);
    border-color: #38bdf8;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.25), 0 15px 35px rgba(0, 0, 0, 0.4);
}

#atlasSearch:focus + .search-icon,
.search-wrapper:focus-within .search-icon {
    color: #38bdf8;
}

.search-clear-btn {
    position: absolute;
    right: 1.2rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #94a3b8;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.search-clear-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #ef4444;
}

.legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
}

.leg-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.normal { background: var(--severity-normal); box-shadow: 0 0 10px var(--severity-normal); }
.dot.warning { background: var(--severity-warning); box-shadow: 0 0 10px var(--severity-warning); }
.dot.danger { background: var(--severity-danger); box-shadow: 0 0 10px var(--severity-danger); }

/* Main Layout */
.v2-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    max-width: 1600px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    gap: 3rem;
}

.v2-sidebar h3 {
    font-family: 'Outfit', sans-serif;
    margin-bottom: 1.2rem;
    font-size: 1.2rem;
    color: #f8fafc;
    letter-spacing: 0.02em;
}

.filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.filter-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.85rem 1.1rem;
    border-radius: 14px;
    margin-bottom: 0.45rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: #94a3b8;
    border: 1px solid transparent;
    background: rgba(30, 41, 59, 0.25);
    font-size: 0.95rem;
}

.filter-list li:hover {
    background: rgba(56, 189, 248, 0.08);
    color: #f8fafc;
    transform: translateX(4px);
    border-color: rgba(56, 189, 248, 0.18);
}

.filter-list li.active {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(16, 185, 129, 0.08));
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.4);
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.12);
}

.filter-list li svg {
    flex-shrink: 0;
    transition: transform 0.2s ease, color 0.2s ease;
}

.filter-list li:hover svg {
    transform: scale(1.1);
    color: #38bdf8;
}

.cat-badge {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
    transition: all 0.2s ease;
}

.filter-list li.active .cat-badge {
    background: #38bdf8;
    color: #0f172a;
}

.stats-box {
    margin-top: 2.2rem;
    padding: 1.2rem 1.4rem;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.8));
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.stats-icon {
    font-size: 1.4rem;
    background: rgba(56, 189, 248, 0.12);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.25);
    flex-shrink: 0;
}

.stats-val {
    font-weight: 700;
    color: #f8fafc;
    font-size: 0.98rem;
}

.stats-sub {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* QRS Nomenclature Info Box */
.qrs-info-box {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(30, 41, 59, 0.5));
    border: 1px solid rgba(45, 212, 191, 0.3);
    border-radius: 16px;
    padding: 1.2rem 1.6rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.qrs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.qrs-header-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #2dd4bf;
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
}

.qrs-chevron {
    color: #2dd4bf;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.qrs-info-box.collapsed .qrs-chevron {
    transform: rotate(-90deg);
}

.qrs-info-box.collapsed .qrs-body {
    display: none;
}

.qrs-body {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.qrs-intro {
    margin: 0 0 0.8rem;
    color: #cbd5e1;
    font-size: 0.92rem;
    line-height: 1.6;
}

.qrs-list {
    padding-left: 1.4rem;
    margin: 0 0 1rem;
    color: #cbd5e1;
    font-size: 0.9rem;
}

.qrs-list li {
    margin-bottom: 0.3rem;
}

.qrs-examples {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 12px;
    padding: 1rem 1.2rem;
}

.qrs-examples strong {
    color: #e2e8f0;
    margin-bottom: 0.5rem;
    display: block;
    font-size: 0.9rem;
}

.qrs-examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.6rem 1.2rem;
}

.qrs-example-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.88rem;
    color: #94a3b8;
}

.qrs-example-row em {
    font-style: normal;
    color: #38bdf8;
}

.qrs-code {
    font-style: normal;
    font-weight: 700;
    color: #38bdf8;
    font-family: 'Outfit', monospace;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 0.95rem;
    min-width: 44px;
    display: inline-block;
    text-align: center;
}

/* Grid and Cards */
.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
}

.ecg-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.75), rgba(15, 23, 42, 0.9));
    backdrop-filter: blur(16px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.4rem;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.4s ease backwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.ecg-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.4), transparent 60%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.ecg-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5), 0 0 25px rgba(56, 189, 248, 0.2);
    border-color: rgba(56, 189, 248, 0.4);
}

.ecg-card:hover::before {
    opacity: 1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-cat-badge {
    font-size: 0.72rem;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.06);
    padding: 3px 9px;
    border-radius: 6px;
    font-weight: 500;
}

.severity-pill {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.severity-pill.normal { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.severity-pill.warning { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.severity-pill.danger { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }

.card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0.3rem 0 0.3rem;
    color: #f8fafc;
    line-height: 1.3;
}

.card-subtitle {
    font-size: 0.88rem;
    color: #94a3b8;
    line-height: 1.5;
}

.card-trace-preview {
    background: #0f172a;
    border-radius: 14px;
    height: 125px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.card-trace-preview::after {
    content: '';
    position: absolute;
    top: 9px;
    right: 10px;
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    animation: live-blink 1.2s ease-in-out infinite;
    z-index: 3;
}

.card-trace-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease, filter 0.4s ease;
}

.ecg-card:hover .card-trace-preview img {
    transform: scale(1.05);
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    font-size: 0.85rem;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.features-preview {
    color: #94a3b8;
    font-size: 0.82rem;
}

.card-cta-btn {
    color: #38bdf8;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    transition: transform 0.2s ease, color 0.2s ease;
}

.ecg-card:hover .card-cta-btn {
    transform: translateX(4px);
    color: #7dd3fc;
}

/* Modals */
.v2-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.92);
    backdrop-filter: blur(12px);
}

.modal-card {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 94%;
    max-width: 1120px;
    height: 92vh;
    max-height: 92vh;
    background: #1e293b;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
    padding: 1.6rem 2rem 1.4rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--glass-border);
}

.modal-subtitle-tag {
    font-size: 0.8rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.2rem;
}

.modal-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    margin: 0;
    line-height: 1.2;
}

.modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: white;
    font-size: 1.2rem;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.modal-close:hover {
    background: var(--accent);
    color: white;
    transform: rotate(90deg);
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    min-height: 0;
}

.modal-grid::-webkit-scrollbar {
    width: 5px;
}
.modal-grid::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
}
.modal-grid::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 10px;
}

.modal-left h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    margin-bottom: 0.3rem;
}

.modal-left .modal-subtitle {
    font-size: 0.95rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.modal-section {
    margin-bottom: 1rem;
}

.modal-section h4 {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    margin-bottom: 0.6rem;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
}

.feature-list li::before {
    content: '✓';
    color: var(--severity-normal);
}

/* Interactive EKG Section in Modal */
.interactive-ekg {
    background: #0a0f1e;
    border-radius: 14px;
    padding: 0;
    position: relative;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.1);
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.ekg-monitor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.6);
    border-bottom: 1px solid rgba(56, 189, 248, 0.2);
    font-family: 'Courier New', monospace;
    font-size: 0.82rem;
    color: #38bdf8;
    letter-spacing: 0.5px;
}

.ekg-monitor-left {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.ekg-lead-label {
    font-weight: 800;
    font-size: 0.85rem;
    background: rgba(56, 189, 248, 0.18);
    color: #38bdf8;
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.ekg-hr-display {
    font-weight: 700;
    color: #7dd3fc;
}

.ekg-heart-icon {
    display: inline-block;
    animation: heart-beat 1s ease-in-out infinite;
}

@keyframes heart-beat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.25); }
    30% { transform: scale(1); }
    45% { transform: scale(1.15); }
}

.ekg-hr-value {
    color: #38bdf8;
    font-size: 1.05rem;
    font-weight: 800;
}

.ekg-live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #22c55e;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.ekg-grid-toggle-btn {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.ekg-grid-toggle-btn:hover {
    background: rgba(56, 189, 248, 0.25);
    color: white;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.ekg-live-dot {
    width: 7px;
    height: 7px;
    background: #22c55e;
    border-radius: 50%;
    animation: live-blink 1.2s ease-in-out infinite;
}

@keyframes live-blink {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px #22c55e; }
    50% { opacity: 0.3; box-shadow: none; }
}

.ekg-monitor-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 700 / 250;
    border-radius: 0;
    overflow: hidden;
    transition: background 0.3s ease;
}

.ekg-monitor-wrapper.cyber-grid {
    background: #060a14;
}

.ekg-monitor-wrapper.cyber-grid .ekg-grid-overlay {
    background-image: 
        linear-gradient(to right, rgba(56, 189, 248, 0.07) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(56, 189, 248, 0.07) 1px, transparent 1px);
    background-size: 20px 20px;
}

.ekg-monitor-wrapper.paper-grid {
    background: #fff8f5;
}

.ekg-monitor-wrapper.paper-grid .ekg-grid-overlay {
    background-image: 
        linear-gradient(to right, rgba(200, 60, 60, 0.12) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(200, 60, 60, 0.12) 1px, transparent 1px);
    background-size: 20px 20px;
}

.ekg-monitor-wrapper.paper-grid .main-trace {
    filter: invert(0.88) hue-rotate(180deg) brightness(0.7);
}

.ekg-grid-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.main-trace {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    z-index: 1;
    transition: filter 0.3s ease;
}

.ekg-scan-line {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to bottom, transparent, rgba(56, 189, 248, 0.4), transparent);
    z-index: 3;
    pointer-events: none;
    animation: scan-sweep 2.5s linear infinite;
}

@keyframes scan-sweep {
    from { top: -4px; }
    to { top: 100%; }
}

.ekg-monitor-footer {
    display: flex;
    justify-content: space-between;
    padding: 6px 16px;
    background: rgba(0, 0, 0, 0.6);
    border-top: 1px solid rgba(56, 189, 248, 0.15);
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    color: rgba(56, 189, 248, 0.7);
    letter-spacing: 0.5px;
}

.annotation-spot {
    position: absolute;
    width: 25px;
    height: 25px;
    border: 3px solid var(--primary);
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    cursor: help;
    z-index: 10;
    transform: translate(-50%, -50%);
    transition: var(--transition);
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(56, 189, 248, 0); }
    100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

.annotation-spot:hover {
    background: rgba(56, 189, 248, 0.3);
    transform: scale(1.05);
}

.annotation-box {
    position: absolute;
    border: 2px solid var(--box-color);
    background-color: color-mix(in srgb, var(--box-color) 12%, transparent);
    border-radius: 4px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    mix-blend-mode: multiply;
}

.annotation-box:hover {
    z-index: 20;
    background-color: color-mix(in srgb, var(--box-color) 25%, transparent);
    box-shadow: 0 4px 15px color-mix(in srgb, var(--box-color) 30%, transparent), 
                inset 0 0 10px color-mix(in srgb, var(--box-color) 20%, transparent);
    transform: translateY(-1px) scale(1.01);
}

.annotation-label {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: var(--box-color);
    color: white;
    padding: 3px 10px;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 10px color-mix(in srgb, var(--box-color) 40%, transparent);
    pointer-events: none;
    z-index: 100;
    letter-spacing: 0.02em;
}

/* Etykiety na górze */
.annotation-box.label-top .annotation-label {
    top: auto;
    bottom: calc(100% + 6px);
}

/* Etykiety na dole */
.annotation-box.label-bottom .annotation-label {
    top: calc(100% + 6px);
    bottom: auto;
}

/* Pokaż etykietę po najechaniu */
.annotation-box:hover .annotation-label {
    opacity: 1;
    visibility: visible;
}

/* Responsive */
@media (max-width: 1400px) {
    /* Mobile Nav */
    .nav-links {
        display: none;
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background-color: #0f172a;
        flex-direction: column;
        align-items: center;
        padding: 2rem 0;
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.4);
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        gap: 1.5rem;
        z-index: 100;
    }

    .nav-links.active {
        display: flex;
    }
    
    .hamburger {
        display: flex !important;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 21px;
        cursor: pointer;
        z-index: 101;
    }
    
    .hamburger .line {
        width: 100%;
        height: 3px;
        background-color: white;
        border-radius: 3px;
        transition: all 0.3s ease;
    }
    
    .lang-switcher {
        display: flex;
        margin-left: 0;
        margin-right: 20px;
    }
}


@media (max-width: 1100px) {
    .v2-container { grid-template-columns: 1fr; }
    .modal-grid { grid-template-columns: 1fr; }
    .v2-sidebar { order: -1; }
    .filter-list { display: flex; overflow-x: auto; gap: 1rem; padding-bottom: 1rem; }
    .filter-list li { white-space: nowrap; }
}

@media (max-width: 768px) {
    .v2-hero h1 { font-size: 2.2rem; }
    .grid-layout { grid-template-columns: 1fr; }
    .modal-card { padding: 1rem; border-radius: 15px; height: 96vh; max-height: 96vh; }
    .modal-grid { grid-template-columns: 1fr; }
}

/* --- Footer & Common Elements --- */
.v2-footer {
    padding: 3rem 5%;
    border-top: 1px solid var(--glass-border);
    margin-top: 2rem;
}

.v2-footer .footer-wrap {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.v2-footer .footer-links {
    display: flex;
    gap: 1.5rem;
}

.v2-footer .footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.v2-footer .footer-links a:hover {
    color: var(--primary);
}

/* Medical Disclaimer & Cookies */
.medical-disclaimer {
    background: rgba(15, 23, 42, 0.4);
    border-top: 1px solid var(--glass-border);
    padding: 2.5rem 1rem;
    color: #94a3b8;
    font-size: 0.85rem;
    line-height: 1.6;
    text-align: center;
    margin: 0 auto;
}

.medical-disclaimer strong {
    display: block;
    color: #f1f5f9;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
}

.cookie-banner {
    position: fixed;
    bottom: -100px;
    left: 20px;
    right: 20px;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10000;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transition: bottom 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-banner.active {
    bottom: 20px;
}

.cookie-content p {
    color: #f1f5f9;
    margin: 0;
    font-size: 0.95rem;
}

.cookie-actions {
    display: flex;
    gap: 0.75rem;
    margin-left: 2rem;
}

.btn-cookie {
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    border: none;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-ok {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #f1f5f9;
}

.btn-ok:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-allow {
    background: var(--primary);
    color: #0f172a;
}

.btn-allow:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(56, 189, 248, 0.4);
}

.btn-decline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #94a3b8;
}

.btn-decline:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
}

@media (max-width: 768px) {
    .cookie-banner {
        flex-direction: column;
        text-align: center;
        gap: 1.25rem;
        padding: 1.5rem;
    }
    .cookie-actions { margin-left: 0; }
    
    .v2-footer .footer-wrap {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}
