:root {
    /* ─── НАВІГАЦІЯ: ГОЛОВНІ РУБРИКИ (LIGHT MODE) ─── */
    --cat-main-bg: #ffffff;
    --cat-main-bg-hover: #f1f5f9;
    --cat-main-bg-active: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    --cat-main-text: #334155;
    --cat-main-text-hover: #0f172a;
    --cat-main-text-active: #ffffff;
    --cat-main-border: #cbd5e1;
    --cat-main-border-active: #0284c7;
    --cat-main-shadow-active: 0 4px 14px rgba(2, 132, 199, 0.25);

    /* ─── НАВІГАЦІЯ: ПІДРУБРИКИ (LIGHT MODE) ─── */
    --sub-bg: #f8fafc;
    --sub-bg-hover: #f1f5f9;
    --sub-bg-active: #e2e8f0;
    --sub-text: #64748b;
    --sub-text-hover: #0f172a;
    --sub-text-active: #0369a1;
    --sub-border: #e2e8f0;
    --sub-border-active: #0284c7;
    --sub-shadow-active: 0 2px 6px rgba(2, 132, 199, 0.15), inset 0 0 0 1px #0284c7;

    /* ─── НИЖНЯ ПАНЕЛЬ КЕРУВАННЯ HERO-БЛОКУ (LIGHT MODE) ─── */
    --hero-control-bg: rgba(255, 255, 255, 0.75);
    --hero-control-border: 1px solid rgba(14, 165, 233, 0.32);
    --hero-control-text: #0f172a;
    --hero-control-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    --hero-control-radius: 12px;
    --hero-control-hover-bg: rgba(240, 249, 255, 0.9);
    --hero-control-hover-border: 1px solid rgba(14, 165, 233, 0.55);
    --hero-control-focus: 0 0 0 2px #0284c7;
    --hero-control-font-size: clamp(0.78rem, 1.1vw, 0.95rem);

    /* ─── АДМІНІСТРАТИВНА ПАНЕЛЬ (LIGHT MODE) ─── */
    --admin-bg: radial-gradient(circle at 50% 30%, rgba(2, 132, 199, 0.06) 0%, rgba(240, 249, 255, 0.7) 100%);
    --admin-card-bg: rgba(255, 255, 255, 0.85);
    --admin-card-border: 1px solid rgba(14, 165, 233, 0.28);
    --admin-card-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    --admin-text-main: #0f172a;
    --admin-text-muted: #64748b;
    --admin-accent: #0284c7;
    --admin-accent-hover: #0369a1;
    --admin-tab-bg: #ffffff;
    --admin-tab-border: #cbd5e1;
    --admin-tab-text: #475569;
}

html.dark-mode,
body.dark-mode,
html[data-theme="dark"],
body[data-theme="dark"] {
    /* ─── НАВІГАЦІЯ: ГОЛОВНІ РУБРИКИ (DARK MODE) ─── */
    --cat-main-bg: #1e293b;
    --cat-main-bg-hover: #334155;
    --cat-main-bg-active: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
    --cat-main-text: #e2e8f0;
    --cat-main-text-hover: #ffffff;
    --cat-main-text-active: #ffffff;
    --cat-main-border: #475569;
    --cat-main-border-active: #38bdf8;
    --cat-main-shadow-active: 0 4px 18px rgba(56, 189, 248, 0.35);

    /* ─── НАВІГАЦІЯ: ПІДРУБРИКИ (DARK MODE) ─── */
    --sub-bg: #0b1329;
    --sub-bg-hover: #16203a;
    --sub-bg-active: linear-gradient(135deg, rgba(14, 165, 233, 0.22) 0%, rgba(15, 23, 42, 0.95) 100%);
    --sub-text: #94a3b8;
    --sub-text-hover: #cbd5e1;
    --sub-text-active: #e0f2fe;
    --sub-border: #1e293b;
    --sub-border-active: rgba(56, 189, 248, 0.5);
    --sub-shadow-active: inset 0 0 0 1px rgba(125, 211, 252, 0.15), 0 0 12px rgba(14, 165, 233, 0.18);

    /* ─── НИЖНЯ ПАНЕЛЬ КЕРУВАННЯ HERO-БЛОКУ (DARK MODE) ─── */
    --hero-control-bg: rgba(15, 23, 42, 0.65);
    --hero-control-border: 1px solid rgba(56, 189, 248, 0.45);
    --hero-control-text: #e0f2fe;
    --hero-control-shadow: 0 0 0 1px rgba(56, 189, 248, 0.08), 0 8px 24px rgba(2, 132, 199, 0.12);
    --hero-control-radius: 12px;
    --hero-control-hover-bg: rgba(30, 41, 59, 0.85);
    --hero-control-hover-border: 1px solid rgba(56, 189, 248, 0.7);
    --hero-control-hover-shadow: 0 0 18px rgba(56, 189, 248, 0.3);
    --hero-control-focus: 0 0 0 2px #38bdf8;

    /* ─── АДМІНІСТРАТИВНА ПАНЕЛЬ (DARK MODE) ─── */
    --admin-bg: radial-gradient(circle at 50% 30%, rgba(14, 165, 233, 0.15) 0%, #0b0f19 100%);
    --admin-card-bg: rgba(15, 23, 42, 0.75);
    --admin-card-border: 1px solid rgba(56, 189, 248, 0.35);
    --admin-card-shadow: 0 0 35px rgba(2, 132, 199, 0.2);
    --admin-text-main: #f8fafc;
    --admin-text-muted: #94a3b8;
    --admin-accent: #38bdf8;
    --admin-accent-hover: #7dd3fc;
    --admin-tab-bg: #1e293b;
    --admin-tab-border: #334155;
    --admin-tab-text: #cbd5e1;
}

/* Базові налаштування */
body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: 1600px;
    padding: 32px 36px;
    box-sizing: border-box;
}

/* ─── НОВИЙ ГЕРОЙ-БЛОК ЦИФРОВИЙ РАДАР (ПОКРАЩЕНА СВІТЛА ТЕМА) ─── */
.hero-cyber-section {
    background: linear-gradient(135deg, #f0f7ff 0%, #f8fafc 45%, #e2e8f0 100%);
    padding: 36px 40px 24px 40px;
    border-radius: 24px;
    border: 1px solid rgba(186, 230, 253, 0.9);
    text-align: left;
    position: relative;
    margin-bottom: 28px;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -1px 2px rgba(2, 132, 199, 0.05);
    backdrop-filter: blur(12px);
}

/* Декоративні кібер-елементи фону */
.cyber-bg-decor {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 1;
}

.cyber-grid-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(rgba(2, 132, 199, 0.15) 1.2px, transparent 1.2px);
    background-size: 24px 24px;
    opacity: 0.85;
}

.radar-sweep-circle {
    position: absolute;
    top: -120px;
    right: -100px;
    width: 440px;
    height: 440px;
    border-radius: 50%;
    border: 1px dashed rgba(2, 132, 199, 0.28);
    background: radial-gradient(circle, rgba(2, 132, 199, 0.07) 0%, rgba(56, 189, 248, 0.02) 50%, transparent 75%);
    animation: radarRotate 40s linear infinite;
    box-shadow: inset 0 0 40px rgba(2, 132, 199, 0.05);
}

@keyframes radarRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hud-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    border-color: rgba(2, 132, 199, 0.55);
    border-style: solid;
}
.hud-corner.top-left { top: 12px; left: 12px; border-width: 2.5px 0 0 2.5px; }
.hud-corner.top-right { top: 12px; right: 12px; border-width: 2.5px 2.5px 0 0; }
.hud-corner.bottom-left { bottom: 12px; left: 12px; border-width: 0 0 2.5px 2.5px; }
.hud-corner.bottom-right { bottom: 12px; right: 12px; border-width: 0 2.5px 2.5px 0; }

.welcome-header-content {
    display: flex;
    align-items: center;
    gap: 36px;
    position: relative;
    z-index: 2;
}

/* Обгортка емблеми з кібер-радарними кільцями та blue glow */
.emblem-radar-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    flex-shrink: 0;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.22) 0%, rgba(2, 132, 199, 0.06) 55%, transparent 75%);
    border-radius: 50%;
}

.radar-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(2, 132, 199, 0.3);
    pointer-events: none;
}

.radar-ring.inner {
    width: calc(100% - 10px);
    height: calc(100% - 10px);
    border-style: dashed;
    animation: radarPulse 4s ease-in-out infinite alternate;
}

.radar-ring.outer {
    width: 100%;
    height: 100%;
    border-color: rgba(2, 132, 199, 0.22);
}

@keyframes radarPulse {
    0% { transform: scale(0.98); opacity: 0.5; }
    100% { transform: scale(1.04); opacity: 0.95; }
}

.welcome-emblem {
    width: 130px;
    height: auto;
    max-height: 160px;
    object-fit: contain;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 8px 22px rgba(2, 132, 199, 0.22));
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), filter 0.35s ease;
}

.emblem-radar-wrapper:hover .welcome-emblem {
    transform: scale(1.04) translateY(-2px);
    filter: drop-shadow(0 12px 28px rgba(2, 132, 199, 0.35));
}

.welcome-text-block {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 2;
}

/* Заголовок дайджесту */
.logo-title {
    display: block;
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    color: #0f2942;
    margin: 0 0 12px 0;
    line-height: 1.1;
    background: linear-gradient(135deg, #0f172a 0%, #0284c7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Опис дайджесту у стилі hero */
.hero-digest-desc {
    font-size: clamp(1.05rem, 1.8vw, 1.22rem) !important;
    font-weight: 500 !important;
    color: #334155 !important;
    text-align: left !important;
    margin: 0 !important;
    max-width: 950px;
    line-height: 1.6;
}

/* Нижня панель привітального вікна з кнопками керування (Glassmorphism) */
.welcome-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 26px;
    padding: 14px 20px;
    background: rgba(241, 245, 249, 0.75);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(186, 230, 253, 0.7);
    border-radius: 16px;
    flex-wrap: wrap;
    gap: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 2px 8px rgba(15, 23, 42, 0.03);
    position: relative;
    z-index: 2;
}

.header-action-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.update-badge {
    background: var(--hero-control-bg);
    color: var(--hero-control-text);
    border: var(--hero-control-border);
    border-radius: var(--hero-control-radius);
    box-shadow: var(--hero-control-shadow);
    backdrop-filter: blur(10px);
    padding: 7px 15px;
    font-weight: 700;
    font-size: var(--hero-control-font-size);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.update-badge-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #0284c7;
    transition: color 0.2s ease;
}

body.dark-mode .update-badge-icon {
    color: #38bdf8;
}

.update-badge strong {
    color: #0284c7;
    font-weight: 700;
    font-size: var(--hero-control-font-size);
}

body.dark-mode .update-badge strong {
    color: #38bdf8;
}

.auth-header-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

/* Кнопка виходу */
.logout-btn {
    background: var(--hero-control-bg);
    color: var(--hero-control-text);
    border: var(--hero-control-border);
    border-radius: var(--hero-control-radius);
    box-shadow: var(--hero-control-shadow);
    backdrop-filter: blur(10px);
    padding: 7px 15px;
    cursor: pointer;
    font-size: var(--hero-control-font-size);
    font-weight: 700;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.logout-btn:hover {
    background: var(--hero-control-hover-bg);
    border: var(--hero-control-hover-border);
    box-shadow: var(--hero-control-hover-shadow);
    transform: translateY(-1px);
}

.logout-btn:focus-visible {
    outline: none;
    box-shadow: var(--hero-control-focus);
}

/* ─── ПЕРЕМИКАЧ ТЕМИ (ДЕНЬ-НІЧ) ─── */
.theme-switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 32px;
    flex-shrink: 0;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--hero-control-bg);
    border: var(--hero-control-border);
    border-radius: 30px;
    box-shadow: var(--hero-control-shadow);
    backdrop-filter: blur(10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
    user-select: none;
}

.theme-switch:hover .theme-slider {
    border: var(--hero-control-hover-border);
    box-shadow: var(--hero-control-hover-shadow);
}

.theme-switch input:focus-visible + .theme-slider {
    box-shadow: var(--hero-control-focus);
}

.theme-slider::before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: #ffffff;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease, box-shadow 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.theme-switch input:checked + .theme-slider {
    background: var(--hero-control-bg);
    border: var(--hero-control-border);
}

.theme-switch input:checked + .theme-slider::before {
    transform: translateX(26px);
    background-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.sun-icon, .moon-icon {
    font-size: 13px;
    line-height: 1;
    z-index: 1;
    transition: transform 0.35s ease, opacity 0.3s ease;
}

.sun-icon {
    opacity: 1;
    transform: scale(1);
    color: #f59e0b;
}

.moon-icon {
    opacity: 0.7;
    transform: scale(0.8);
    color: #f1f5f9;
}

.theme-switch input:checked + .theme-slider .sun-icon {
    opacity: 0.5;
    transform: scale(0.75);
}

.theme-switch input:checked + .theme-slider .moon-icon {
    opacity: 1;
    transform: scale(1);
}


/* Меню рубрик */
.categories {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px;
    margin-bottom: 16px;
    padding: 0;
}

.cat-btn {
    background: var(--cat-main-bg);
    color: var(--cat-main-text);
    border: 1px solid var(--cat-main-border);
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap !important;
    flex: 1 1 180px;
    text-align: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.cat-btn:hover {
    background: var(--cat-main-bg-hover);
    color: var(--cat-main-text-hover);
}

.cat-btn.active {
    background: var(--cat-main-bg-active);
    color: var(--cat-main-text-active);
    border-color: var(--cat-main-border-active);
    box-shadow: var(--cat-main-shadow-active);
}

/* Меню підрубрик */
.sub-categories {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px;
    margin-bottom: 24px;
    padding: 0;
}

.sub-btn {
    background: var(--sub-bg);
    color: var(--sub-text);
    border: 1px solid var(--sub-border);
    padding: 9px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.86rem;
    font-weight: 600;
    white-space: nowrap !important;
    flex: 1 1 140px;
    text-align: center;
    transition: all 0.2s ease;
}

.sub-btn:hover {
    background: var(--sub-bg-hover);
    color: var(--sub-text-hover);
}

.sub-btn.active {
    background: var(--sub-bg-active);
    color: var(--sub-text-active);
    border-color: var(--sub-border-active);
    box-shadow: var(--sub-shadow-active);
    font-weight: 700;
}

/* ─── СУЧАСНІ АНАЛІТИЧНІ КАРТКИ НОВИН ─── */
.news-zone {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.news-card {
    background: #ffffff;
    border: 1px solid #dbe7f3;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease, border-color 0.25s ease;
    position: relative;
    border-left: 5px solid #0284c7;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
}

/* Категорійні кольорові акценти */
.news-card.cat-accent-tech { border-left-color: #0284c7; }
.news-card.cat-accent-industry { border-left-color: #10b981; }
.news-card.cat-accent-security { border-left-color: #06b6d4; }
.news-card.cat-accent-ukraine { border-left-color: #eab308; }
.news-card.cat-accent-threats { border-left-color: #f59e0b; }
.news-card.cat-accent-summary { border-left-color: #64748b; }

.news-header {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding: 16px 20px;
    gap: 18px;
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s ease;
}

.news-header:hover {
    background-color: #f8fafc;
}

.news-thumb-box {
    width: 180px;
    height: 120px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #0f172a;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
}

.news-card.expanded .news-thumb-box,
.news-header.expanded .news-thumb-box,
.news-card.expanded .news-summary-preview,
.news-header.expanded .news-summary-preview {
    display: none !important;
}

.news-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.news-header:hover .news-thumb-img {
    transform: scale(1.04);
}

.news-content-box {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.news-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.news-date {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 500;
}

.sub-badge {
    background: #f1f5f9;
    color: #334155;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 700;
    display: inline-block;
    border: 1px solid #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.news-title {
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.35;
    color: #0f172a;
    margin: 2px 0 0 0;
    letter-spacing: -0.01em;
}

.news-summary-preview {
    font-size: 0.88rem;
    line-height: 1.48;
    color: #475569;
    margin: 2px 0 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.toggle-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    flex-shrink: 0;
    align-self: center;
    transition: background-color 0.2s ease;
}

.toggle-icon {
    font-size: 0.75rem;
    color: #64748b;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-header.expanded .toggle-icon {
    transform: rotate(180deg);
}

.news-header.expanded .toggle-icon-box {
    background: #e2e8f0;
}

/* Розгорнутий стан */
.news-body {
    display: none;
    padding: 0 20px 20px 20px;
    border-top: 1px solid #f1f5f9;
    margin-top: 0;
    background: #ffffff;
}

.news-full-image-box {
    margin-top: 16px;
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    max-height: 420px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.news-image {
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
}

.news-body-content p {
    font-size: 0.96rem;
    line-height: 1.68;
    color: #334155;
    margin: 0 0 14px 0;
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    overflow-wrap: break-word;
    text-align-last: left;
}

.analysis-section-block {
    background: #f8fafc;
    border-left: 4px solid #0284c7;
    border-radius: 10px;
    padding: 14px 18px;
    margin-top: 16px;
    margin-bottom: 16px;
}

.analysis-section-title {
    font-size: 0.94rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px 0;
    letter-spacing: -0.01em;
}

.analysis-text-p {
    font-size: 0.94rem;
    line-height: 1.65;
    color: #334155;
    margin: 0 0 12px 0;
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    overflow-wrap: break-word;
    text-align-last: left;
}

.analysis-text-p:last-child {
    margin-bottom: 0;
}

.analysis-bullet-list {
    margin: 10px 0 14px 0;
    padding-left: 20px;
    list-style-type: disc;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.analysis-bullet-item {
    font-size: 0.93rem;
    line-height: 1.62;
    color: #334155;
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    overflow-wrap: break-word;
    text-align-last: left;
}

.analysis-bullet-item strong,
.analysis-text-p strong {
    color: #0f172a;
    font-weight: 700;
}

.source-block {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.84rem;
    color: #475569;
    margin-top: 14px;
}

.news-source-link {
    color: #0284c7;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.news-source-link:hover {
    color: #0369a1;
    text-decoration: underline;
}

.news-source-text {
    color: #475569;
    font-weight: 600;
}

/* Адаптивність карток для мобільних екранів */
@media (max-width: 640px) {
    .news-header {
        flex-direction: column;
        padding: 14px 16px;
        gap: 12px;
    }

    .news-thumb-box {
        width: 100%;
        height: 160px;
    }

    .toggle-icon-box {
        position: absolute;
        top: 14px;
        right: 14px;
        width: 28px;
        height: 28px;
    }

    .news-title {
        font-size: 1rem;
        padding-right: 28px;
    }

    .news-body {
        padding: 0 16px 16px 16px;
    }
}

/* ─── ЕКРАН ВХОДУ (CYBER / RADAR GLASSMORPHISM AUTH SCREEN) ─── */
.auth-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    max-width: 100vw;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 9999;
    background: radial-gradient(circle at 50% 50%, rgba(2, 132, 199, 0.12) 0%, rgba(240, 249, 255, 0.95) 100%);
}

.auth-container.hidden {
    display: none !important;
}

body.dark-mode .auth-container {
    background: radial-gradient(circle at 50% 50%, rgba(14, 165, 233, 0.18) 0%, #0b0f19 100%);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(14, 165, 233, 0.32);
    border-radius: 24px;
    padding: 32px 28px;
    box-sizing: border-box;
    text-align: center;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

body.dark-mode .auth-card {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(56, 189, 248, 0.35);
    box-shadow: 0 0 35px rgba(2, 132, 199, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px);
}

.auth-title-block {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

.auth-lock-icon {
    width: 24px;
    height: 24px;
    color: #0284c7;
    flex-shrink: 0;
}

body.dark-mode .auth-lock-icon {
    color: #38bdf8;
}

.auth-title {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.01em;
}

body.dark-mode .auth-title {
    color: #f8fafc;
}

.auth-subtitle {
    margin: 0 0 20px 0;
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.45;
}

body.dark-mode .auth-subtitle {
    color: #94a3b8;
}

/* ЄДИНИЙ КОМПОНЕНТ ПОЛЯ ПАРОЛЯ ТА КНОПКИ ОКА */
.password-input-wrapper {
    position: relative;
    width: 100%;
    margin: 0 0 16px 0;
}

.auth-card input#password-input {
    width: 100%;
    height: 48px;
    padding: 0 52px 0 16px;
    margin: 0;
    border-radius: 14px;
    border: 1.5px solid rgba(14, 165, 233, 0.35);
    background: rgba(255, 255, 255, 0.9);
    color: #0f172a;
    font-size: 16px !important; /* Фікс iOS Safari: запобігає авто-зуму при фокусі */
    box-sizing: border-box;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-card input#password-input:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18);
    background: #ffffff;
}

body.dark-mode .auth-card input#password-input {
    background: rgba(15, 23, 42, 0.85);
    border: 1.5px solid rgba(56, 189, 248, 0.35);
    color: #f8fafc;
}

body.dark-mode .auth-card input#password-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.22);
    background: #0f172a;
}

/* Приховування чужорідних браузерних автозаповнювачів та іконок reveal */
#password-input::-webkit-contacts-auto-fill-button,
#password-input::-webkit-credentials-auto-fill-button,
#password-input::-ms-reveal,
#password-input::-ms-clear {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Кнопка перегляду пароля */
.toggle-password-btn {
    position: absolute !important;
    right: 6px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #0284c7;
    border-radius: 10px;
    transition: all 0.2s ease;
    z-index: 3;
}

.toggle-password-btn:hover {
    color: #0369a1;
    background: rgba(224, 242, 254, 0.9) !important;
    border-color: rgba(14, 165, 233, 0.35) !important;
}

.toggle-password-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px #0284c7;
}

body.dark-mode .toggle-password-btn {
    color: rgba(125, 211, 252, 0.95);
}

body.dark-mode .toggle-password-btn:hover {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12) !important;
    border-color: rgba(56, 189, 248, 0.45) !important;
}

body.dark-mode .toggle-password-btn:focus-visible {
    box-shadow: 0 0 0 2px #38bdf8;
}

.eye-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    pointer-events: none;
}

/* ─── ІНДИКАТОРИ ПІДКАЗОК ВВЕДЕННЯ ПАРОЛЯ (ЦЕНТРОВАНІ) ─── */
.password-hints-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 4px 0 14px 0;
    min-height: 20px;
    align-items: center !important;
    justify-content: center;
    width: 100%;
}

.password-hint-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #d97706;
    background: rgba(254, 243, 199, 0.7);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 4px 12px;
    border-radius: 8px;
    transition: opacity 0.2s ease, transform 0.2s ease;
    opacity: 1;
    transform: translateY(0);
    text-align: center;
    width: auto;
    margin: 0 auto;
}

.password-hint-item.hidden {
    display: none !important;
    opacity: 0;
    transform: translateY(-4px);
}

body.dark-mode .password-hint-item {
    color: #fbbf24;
    background: rgba(120, 53, 15, 0.35);
    border-color: rgba(245, 158, 11, 0.4);
}

.hint-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Основна кнопка Увійти */
.auth-submit-btn {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25);
}

.auth-submit-btn:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.4);
    transform: translateY(-1px);
}

.auth-submit-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.5);
}

.error-msg {
    color: #ef4444 !important;
    font-size: 0.88rem;
    margin: 12px 0 0 0;
    font-weight: 600;
}

/* ─── АДАПТИВНІСТЬ ДЛЯ РІЗНИХ ЕКРАНІВ (RESPONSIVE BREAKPOINTS) ─── */

/* 1. ПЛАНШЕТИ (TABLET: 768px – 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .hero-cyber-section {
        padding: 30px 32px 22px 32px;
    }

    .welcome-header-content {
        gap: 28px;
    }

    .welcome-emblem {
        width: 110px;
        max-height: 140px;
    }

    .logo-title {
        font-size: clamp(1.8rem, 3.4vw, 2.6rem);
    }

    .hero-digest-desc {
        font-size: 1.08rem !important;
    }

    .welcome-bottom-row {
        margin-top: 22px;
        padding: 12px 18px;
    }
}

/* 2. МОБІЛЬНІ ПРИСТРОЇ (MOBILE: до 767px) */
@media (max-width: 767px) {
    .container {
        padding: 12px 10px;
    }

    /* МОБІЛЬНЕ АДАПТИВНЕ КОМПОНУВАННЯ ЕКРАНА ВХОДУ (LOGIN SCREEN MOBILE ADAPTATION) */
    .auth-container {
        min-height: 100svh !important;
        min-height: -webkit-fill-available !important;
        padding: max(16px, env(safe-area-inset-top, 16px)) 16px max(20px, env(safe-area-inset-bottom, 20px)) !important;
    }

    .auth-card {
        width: min(92vw, 420px) !important;
        padding: 24px 20px !important;
        border-radius: 20px !important;
    }

    .auth-title {
        font-size: clamp(1.25rem, 5.5vw, 1.45rem) !important;
    }

    .auth-subtitle {
        font-size: clamp(0.85rem, 3.5vw, 0.92rem) !important;
        margin-bottom: 16px !important;
    }

    .hero-cyber-section {
        padding: 18px 16px 14px 16px;
        border-radius: 18px;
        margin-bottom: 20px;
    }

    /* Декорації на мобільному робимо м'якшими */
    .cyber-grid-overlay {
        opacity: 0.35;
        background-size: 20px 20px;
    }

    .radar-sweep-circle {
        width: 260px;
        height: 260px;
        top: -70px;
        right: -60px;
        opacity: 0.35;
    }

    .hud-corner {
        width: 10px;
        height: 10px;
        border-width: 2px;
    }
    .hud-corner.top-left { top: 8px; left: 8px; }
    .hud-corner.top-right { top: 8px; right: 8px; }
    .hud-corner.bottom-left { bottom: 8px; left: 8px; }
    .hud-corner.bottom-right { bottom: 8px; right: 8px; }

    /* ГОРИЗОНТАЛЬНЕ КОМПОНУВАННЯ (ЗБЕРЕЖЕННЯ ДЕСКТОПНОЇ СТРУКТУРИ) */
    .welcome-header-content {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
        gap: 14px;
    }

    .emblem-radar-wrapper {
        padding: 6px;
        flex-shrink: 0;
    }

    .welcome-emblem {
        width: 72px;
        height: auto;
        max-height: 95px;
        flex-shrink: 0;
    }

    .welcome-text-block {
        flex: 1;
        min-width: 0;
        text-align: left;
    }

    .logo-title {
        font-size: clamp(1.4rem, 6vw, 2.2rem);
        letter-spacing: 0.02em;
        line-height: 1.15;
        text-align: left !important;
        margin-bottom: 6px !important;
    }

    .hero-digest-desc {
        font-size: clamp(0.78rem, 2.8vw, 0.92rem) !important;
        line-height: 1.38 !important;
        text-align: left !important;
        max-width: 100% !important;
        color: #475569 !important;
    }

    /* НИЖНЯ ПАНЕЛЬ СТРОГО В ОДИН ГОРИЗОНТАЛЬНИЙ РЯД (SINGLE HORIZONTAL ROW) */
    .welcome-bottom-row {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-top: 14px;
        padding: 8px 10px;
        border-radius: 14px;
        gap: 6px;
        flex-wrap: nowrap !important;
    }

    .update-badge {
        width: auto;
        flex-shrink: 0;
        box-sizing: border-box;
        font-size: var(--hero-control-font-size);
        padding: 5px 8px;
        white-space: nowrap !important;
        overflow: visible !important;
        text-overflow: clip !important;
        display: inline-flex;
        align-items: center;
    }

    .header-action-buttons {
        width: auto;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 6px;
        flex-shrink: 0;
        flex-wrap: nowrap !important;
    }

    .calendar-btn {
        height: 32px;
        padding: 0 4px;
        flex-shrink: 0;
    }

    .theme-switch {
        flex-shrink: 0;
        transform: scale(0.9);
    }

    .logout-btn {
        height: 32px;
        padding: 0 10px;
        font-size: var(--hero-control-font-size);
        white-space: nowrap !important;
        flex-shrink: 0;
    }
}

/* 3. МАЛІ МОБІЛЬНІ ЕКРАНИ (SMALL MOBILE: до 420px / 360px) */
@media (max-width: 420px) {
    .container {
        padding: 10px 6px;
    }

    .hero-cyber-section {
        padding: 14px 10px 12px 10px;
        border-radius: 14px;
    }

    .welcome-header-content {
        gap: 10px;
    }

    .welcome-emblem {
        width: 60px;
        max-height: 78px;
    }

    .logo-title {
        font-size: clamp(1.2rem, 5.2vw, 1.6rem);
        letter-spacing: 0.01em;
        margin-bottom: 4px !important;
    }

    .hero-digest-desc {
        font-size: 0.74rem !important;
        line-height: 1.3 !important;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .welcome-bottom-row {
        padding: 6px 8px;
        gap: 4px;
        flex-wrap: nowrap !important;
    }

    .update-badge {
        font-size: var(--hero-control-font-size);
        padding: 4px 6px;
        flex-shrink: 0;
        white-space: nowrap !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }

    .header-action-buttons {
        gap: 4px;
        flex-shrink: 0;
    }

    .calendar-btn {
        height: 30px;
        padding: 0 3px;
        transform: scale(0.92);
    }

    .theme-switch {
        transform: scale(0.82);
    }

    .logout-btn {
        height: 30px;
        padding: 0 8px;
        font-size: var(--hero-control-font-size);
    }
}

    .cat-btn {
        font-size: 0.9rem;
        padding: 10px 12px;
    }

    .sub-btn {
        font-size: 0.82rem;
        padding: 8px 10px;
    }
}

/* Панель генерації PDF (Завжди вертикальна колонка) */
.pdf-export-panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-top: clamp(32px, 5vw, 56px);
    margin-bottom: clamp(32px, 5vw, 64px);
    width: 100%;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.pdf-btn {
    width: 100%;
    max-width: 100%;
    height: 48px;
    padding: 0 20px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.pdf-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
    border-color: #0284c7;
    color: #0284c7;
}

.pdf-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.pdf-btn-full {
    border-color: #0284c7;
    background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
}

.pdf-btn-selected {
    border-color: #0369a1;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

    /* Модальне вікно */
    .modal-overlay {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(15, 23, 42, 0.5);
        backdrop-filter: blur(4px);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1000;
        padding: 16px;
    }

    .modal-card {
        background: #ffffff;
        width: 100%;
        max-width: 500px;
        border-radius: 20px;
        padding: 24px;
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-card h2 {
        margin-top: 0;
        color: #0f172a;
    }

    .form-group {
        margin-bottom: 16px;
        text-align: left;
    }

    .form-group label {
        display: block;
        font-size: 0.9rem;
        font-weight: 600;
        color: #475569;
        margin-bottom: 6px;
    }

    .form-group input[type="text"],
    .form-group select,
    .form-group textarea {
        width: 100%;
        padding: 10px 12px;
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        font-family: inherit;
        font-size: 0.95rem;
        box-sizing: border-box;
    }

    .form-group input[type="file"] {
        width: 100%;
        font-size: 0.9rem;
        color: #475569;
    }

    .modal-actions {
        display: flex;
        justify-content: flex-end;
        gap: 12px;
        margin-top: 24px;
    }

    .cancel-btn {
        background: #f1f5f9;
        color: #475569;
        border: none;
        padding: 10px 18px;
        border-radius: 10px;
        font-weight: 600;
        cursor: pointer;
    }

    .cancel-btn:hover { background: #e2e8f0; }

    .save-btn {
        background: #0284c7;
        color: #ffffff;
        border: none;
        padding: 10px 18px;
        border-radius: 10px;
        font-weight: 600;
        cursor: pointer;
    }

    .save-btn:hover { background: #0369a1; }

    /* Нові блоки в карточці новини */
    .importance-block {
        background: rgba(241, 245, 249, 0.7);
        border-left: 4px solid #94a3b8;
        padding: 12px;
        border-radius: 0 8px 8px 0;
        color: #334155;
        font-size: 0.9rem;
        margin-bottom: 12px;
        text-align: justify;
        white-space: pre-line;
    }

    .source-block {
        color: #0284c7;
        font-size: 0.85rem;
        margin-bottom: 8px;
        font-weight: 500;
    }

    @media print {
        @page {
            size: A4 portrait;
            margin: 12mm;
        }
        body {
            background: #ffffff !important;
            color: #0f172a !important;
        }
        .pdf-export-panel, .modal-overlay, .image-modal, .header-banner, .category-navigation { display: none !important; }
    }

    /* Спеціальний CSS-планшетизатор для PDF генерації */
    .pdf-document {
        background: #ffffff !important;
        color: #0f172a !important;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    }

    .pdf-cover-page {
        page-break-after: always !important;
        break-after: page !important;
    }

    .pdf-news-page {
        page-break-before: always !important;
        break-before: page !important;
        page-break-inside: auto !important;
        break-inside: auto !important;
    }

    .pdf-cover-page + .pdf-news-page {
        page-break-before: auto !important;
        break-before: auto !important;
    }

    .pdf-news-intro {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .pdf-news-image-block {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .pdf-news-image-block img {
        max-width: 100% !important;
        max-height: 95mm !important;
        object-fit: contain !important;
    }

    /* Модальне вікно для збільшення зображення (Lightbox) */
    .image-modal {
        display: none;
        position: fixed;
        z-index: 2000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.75); /* напівпрозора темна тінь */
        align-items: center;
        justify-content: center;
        cursor: zoom-out;
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    .image-modal.show {
        display: flex;
        opacity: 1;
    }

    .image-modal-content {
        margin: auto;
        display: block;
        max-width: 92vw;
        max-height: 88vh;
        width: auto;
        height: auto;
        object-fit: contain;
        border-radius: 12px;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
        transform: scale(0.95);
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        cursor: default;
    }

    .image-modal.show .image-modal-content {
        transform: scale(1);
    }

    @media (max-width: 576px) {
        .image-modal-content {
            max-width: 95vw;
            max-height: 82vh;
            border-radius: 10px;
        }
    }

    .close-modal {
        position: absolute;
        top: 20px;
        right: 35px;
        color: #f1f5f9;
        font-size: 40px;
        font-weight: bold;
        transition: color 0.2s;
        cursor: pointer;
        user-select: none;
    }

    .close-modal:hover {
        color: #cbd5e1;
    }

    /* Вказівка курсору зуму на зображеннях карток */
    .news-image {
        cursor: zoom-in;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .news-image:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    }

/* ─── ТЕМНА ТЕМА (DARK MODE) ─── */
body.dark-mode {
    background-color: #0b0f19;
    color: #f1f5f9;
}

body.dark-mode .welcome-section,
body.dark-mode .auth-card,
body.dark-mode .news-card,
body.dark-mode .modal-card {
    background-color: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.dark-mode .welcome-section h1,
body.dark-mode .news-card h3,
body.dark-mode .auth-card h2,
body.dark-mode .modal-card h2 {
    color: #f8fafc;
}

body.dark-mode .welcome-section p,
body.dark-mode .auth-card p,
body.dark-mode .news-card p,
body.dark-mode .form-group label,
body.dark-mode .news-date,
body.dark-mode .news-card span,
body.dark-mode .news-time {
    color: #94a3b8;
}

body.dark-mode .logout-btn,
body.dark-mode .cancel-btn {
    background-color: #334155;
    color: #cbd5e1;
}

body.dark-mode .logout-btn:hover,
body.dark-mode .cancel-btn:hover {
    background-color: #475569;
    color: #ffffff;
}

/* Змінні тем автоматично керують кольорами категорій та підкатегорій */

body.dark-mode .sub-badge {
    background-color: #1e293b;
    color: #cbd5e1;
    border-color: #334155;
}

body.dark-mode .news-card {
    background-color: #0f172a;
    border-color: rgba(56, 189, 248, 0.18);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

body.dark-mode .news-header:hover {
    background-color: #1e293b;
}

body.dark-mode .news-title {
    color: #f8fafc;
}

body.dark-mode .news-summary-preview {
    color: #94a3b8;
}

body.dark-mode .toggle-icon-box {
    background: #1e293b;
}

body.dark-mode .toggle-icon {
    color: #94a3b8;
}

body.dark-mode .news-header.expanded .toggle-icon-box {
    background: #334155;
}

body.dark-mode .news-body {
    background: #0f172a;
    border-top-color: #1e293b;
}

body.dark-mode .news-body-content p {
    color: #cbd5e1;
}

body.dark-mode .analysis-section-block {
    background: rgba(30, 41, 59, 0.7);
    border-left-color: #38bdf8;
}

body.dark-mode .analysis-section-title {
    color: #38bdf8;
}

body.dark-mode .analysis-text-p,
body.dark-mode .analysis-bullet-item {
    color: #cbd5e1;
}

body.dark-mode .analysis-bullet-item strong,
body.dark-mode .analysis-text-p strong {
    color: #f8fafc;
}

body.dark-mode .source-block {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

body.dark-mode .news-source-link {
    color: #38bdf8;
}

body.dark-mode .news-source-link:hover {
    color: #7dd3fc;
}

body.dark-mode .news-source-text {
    color: #cbd5e1;
}

body.dark-mode .auth-card input,
body.dark-mode .form-group input[type="text"],
body.dark-mode .form-group select,
body.dark-mode .form-group textarea {
    background-color: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

body.dark-mode .form-group input[type="text"]:focus,
body.dark-mode .form-group select:focus,
body.dark-mode .form-group textarea:focus,
body.dark-mode .auth-card input:focus {
    border-color: #38bdf8;
    outline: none;
}

body.dark-mode .pdf-btn {
    background: #1e293b !important;
    color: #cbd5e1 !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

body.dark-mode .pdf-btn-full {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    border-color: rgba(56, 189, 248, 0.3) !important;
    color: #f8fafc !important;
}

body.dark-mode .pdf-btn-selected {
    background: linear-gradient(135deg, #1e293b 0%, #172554 100%) !important;
    border-color: rgba(56, 189, 248, 0.3) !important;
    color: #f8fafc !important;
}

body.dark-mode .pdf-btn:hover:not(:disabled) {
    background: #334155 !important;
    border-color: #38bdf8 !important;
    color: #38bdf8 !important;
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.2) !important;
}

/* ─── КНОПКА ТА БАР КАЛЕНДАРЯ ─── */
.calendar-btn {
    background: var(--hero-control-bg);
    color: var(--hero-control-text);
    border: var(--hero-control-border);
    border-radius: var(--hero-control-radius);
    box-shadow: var(--hero-control-shadow);
    backdrop-filter: blur(10px);
    padding: 3px 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.calendar-btn:hover {
    background: var(--hero-control-hover-bg);
    border: var(--hero-control-hover-border);
    box-shadow: var(--hero-control-hover-shadow);
    transform: translateY(-1px);
}

.calendar-btn:focus-visible {
    outline: none;
    box-shadow: var(--hero-control-focus);
}

.dyn-cal-icon {
    width: 32px;
    height: 32px;
    background: #ffffff;
    border: 1.5px solid #0284c7;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
    position: relative;
    flex-shrink: 0;
}

.dyn-cal-header {
    height: 8px;
    background: #0284c7;
    width: 100%;
}

.dyn-cal-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--hero-control-font-size);
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cal-badge {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #0284c7;
    border-radius: 50%;
}

.date-filter-bar {
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    color: #0369a1;
    padding: 10px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 500;
}

.reset-date-btn {
    background: #ffffff;
    color: #0369a1;
    border: 1px solid #bae6fd;
    padding: 4px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.reset-date-btn:hover {
    background: #0284c7;
    color: #ffffff;
}

/* ─── МОДАЛЬНЕ ВІКНО КАЛЕНДАРЯ ─── */
.calendar-modal-card {
    max-width: 380px;
    padding: 20px;
    position: relative;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.calendar-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}

.cal-nav-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #475569;
    transition: all 0.2s ease;
}

.cal-nav-btn:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

.close-modal-btn {
    font-size: 24px;
    font-weight: bold;
    color: #94a3b8;
    cursor: pointer;
    margin-left: 8px;
    line-height: 1;
}

.close-modal-btn:hover {
    color: #0f172a;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 8px;
}

.calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 16px;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    background: #f8fafc;
}

.cal-day.empty {
    background: transparent;
    cursor: default;
}

.cal-day:not(.empty):hover {
    background: #e2e8f0;
    color: #0f172a;
}

.cal-day.has-news {
    font-weight: 700;
    color: #0284c7;
    background: #f0f9ff;
    border-color: #bae6fd;
}

.cal-day.has-news::after {
    content: "";
    width: 5px;
    height: 5px;
    background-color: #0284c7;
    border-radius: 50%;
    position: absolute;
    bottom: 3px;
}

.cal-day.selected {
    background: #0284c7 !important;
    color: #ffffff !important;
    border-color: #0284c7 !important;
}

.cal-day.selected::after {
    background-color: #ffffff !important;
}

.calendar-footer {
    text-align: center;
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
}

.cal-reset-btn {
    background: #f1f5f9;
    color: #475569;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
}

.cal-reset-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* ─── ТЕМНА ТЕМА ДЛЯ КАЛЕНДАРЯ ─── */

body.dark-mode .date-filter-bar {
    background: #0f172a;
    border-color: #0284c7;
    color: #38bdf8;
}

body.dark-mode .reset-date-btn {
    background: #1e293b;
    color: #38bdf8;
    border-color: #0284c7;
}

body.dark-mode .reset-date-btn:hover {
    background: #0284c7;
    color: #ffffff;
}

body.dark-mode .calendar-header {
    border-bottom-color: #334155;
}

body.dark-mode .calendar-header h3 {
    color: #f8fafc;
}

body.dark-mode .cal-nav-btn {
    background: #334155;
    border-color: #475569;
    color: #cbd5e1;
}

body.dark-mode .cal-nav-btn:hover {
    background: #0284c7;
    color: #ffffff;
}

body.dark-mode .close-modal-btn:hover {
    color: #f8fafc;
}

body.dark-mode .calendar-weekdays {
    color: #94a3b8;
}

body.dark-mode .cal-day {
    background: #0f172a;
    color: #cbd5e1;
}

body.dark-mode .cal-day.empty {
    background: transparent;
}

body.dark-mode .cal-day:not(.empty):hover {
    background: #334155;
    color: #f8fafc;
}

body.dark-mode .cal-day.has-news {
    background: #1e293b;
    color: #38bdf8;
    border-color: #0284c7;
}

body.dark-mode .cal-day.has-news::after {
    background-color: #38bdf8;
}

body.dark-mode .calendar-footer {
    border-top-color: #334155;
}

body.dark-mode .cal-reset-btn {
    background: #334155;
    color: #cbd5e1;
}

body.dark-mode .cal-reset-btn:hover {
    background: #475569;
    color: #ffffff;
}

body.dark-mode .dyn-cal-icon {
    background: #1e293b;
    border-color: #38bdf8;
}

body.dark-mode .dyn-cal-header {
    background: #0284c7;
}

body.dark-mode .dyn-cal-body {
    color: #f8fafc;
}

body.dark-mode .hero-cyber-section {
    background: linear-gradient(135deg, #0b1329 0%, #0f172a 60%, #1e293b 100%);
    border-color: #334155;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4), 0 0 20px rgba(56, 189, 248, 0.05);
}

body.dark-mode .cyber-grid-overlay {
    background-image: radial-gradient(rgba(56, 189, 248, 0.12) 1px, transparent 1px);
}

body.dark-mode .radar-sweep-circle {
    border-color: rgba(56, 189, 248, 0.2);
    background: radial-gradient(circle, rgba(56, 189, 248, 0.05) 0%, transparent 70%);
}

body.dark-mode .hud-corner {
    border-color: rgba(56, 189, 248, 0.4);
}

body.dark-mode .radar-ring {
    border-color: rgba(56, 189, 248, 0.3);
}

body.dark-mode .emblem-radar-wrapper {
    background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, rgba(2, 132, 199, 0.04) 55%, transparent 75%);
}

body.dark-mode .welcome-emblem {
    filter: drop-shadow(0 6px 18px rgba(56, 189, 248, 0.3)) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

body.dark-mode .emblem-radar-wrapper:hover .welcome-emblem {
    filter: drop-shadow(0 10px 26px rgba(56, 189, 248, 0.5)) drop-shadow(0 4px 10px rgba(0, 0, 0, 0.7));
}

body.dark-mode .logo-title {
    background: linear-gradient(135deg, #ffffff 0%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.dark-mode .hero-digest-desc {
    color: #cbd5e1 !important;
}

body.dark-mode .welcome-bottom-row {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(51, 65, 85, 0.8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 4px 12px rgba(0, 0, 0, 0.2);
}



/* ─── СТИЛІ БРЕНДОВО-НАВІГАЦІЙНОГО БЛОКУ (STICKY BRAND NAV) ─── */
.sticky-brand-nav {
    position: fixed;
    top: 110px;
    left: 24px;
    width: 250px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(186, 230, 253, 0.9);
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-12px);
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease, border-color 0.3s ease;
}

.sticky-brand-nav.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.sticky-brand-nav:hover {
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.snav-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.snav-emblem {
    width: 38px;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 6px rgba(2, 132, 199, 0.2));
}

.snav-title-block {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.snav-brand-title {
    font-weight: 850;
    font-size: 1.05rem;
    color: #0f2942;
    line-height: 1.2;
    white-space: nowrap;
}

.snav-brand-subtitle {
    font-size: 0.72rem;
    color: #0284c7;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.snav-context {
    background: rgba(240, 247, 255, 0.8);
    border: 1px solid rgba(186, 230, 253, 0.6);
    border-radius: 12px;
    padding: 10px 12px;
    margin: 14px 0;
}

.snav-context-label {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
}

.snav-active-cat-name {
    font-size: 0.92rem;
    font-weight: 750;
    color: #0f172a;
    margin-top: 2px;
    word-break: break-word;
}

.snav-active-sub-name {
    font-size: 0.78rem;
    color: #0369a1;
    font-weight: 500;
    margin-top: 1px;
    word-break: break-word;
}

.snav-menu-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.snav-categories-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.snav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: #334155;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.snav-item:hover {
    background: rgba(224, 242, 254, 0.6);
    color: #0284c7;
}

.snav-item.active {
    background: #0284c7;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

/* ─── СТИЛІ МОБІЛЬНОГО ПЛАВАЮЧОГО ІНДИКАТОРА (MOBILE FLOATING PILL) ─── */
.mobile-floating-pill {
    display: none;
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    left: 14px;
    width: max-content;
    max-width: calc(100vw - 28px);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(186, 230, 253, 0.95);
    border-radius: 30px;
    padding: 7px 16px 7px 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
    z-index: 999;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-12px);
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
}

.mobile-floating-pill:active {
    transform: scale(0.96);
}

.mfp-emblem {
    width: 22px;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.mfp-brand {
    font-weight: 850;
    font-size: 0.88rem;
    color: #0f172a;
    flex-shrink: 0;
    white-space: nowrap;
}

.mfp-divider {
    color: #0284c7;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.mfp-cat {
    font-size: 0.84rem;
    font-weight: 650;
    color: #0284c7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
    max-width: 180px;
}

/* DARK MODE ДЛЯ БРЕНДОВОЇ НАВІГАЦІЇ */
body.dark-mode .sticky-brand-nav {
    background: rgba(15, 23, 42, 0.88);
    border-color: rgba(51, 65, 85, 0.9);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.dark-mode .snav-header {
    border-bottom-color: rgba(51, 65, 85, 0.8);
}

body.dark-mode .snav-brand-title {
    color: #f8fafc;
}

body.dark-mode .snav-brand-subtitle {
    color: #38bdf8;
}

body.dark-mode .snav-context {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(51, 65, 85, 0.8);
}

body.dark-mode .snav-active-cat-name {
    color: #f8fafc;
}

body.dark-mode .snav-active-sub-name {
    color: #38bdf8;
}

body.dark-mode .snav-item {
    color: #cbd5e1;
}

body.dark-mode .snav-item:hover {
    background: rgba(30, 41, 59, 0.8);
    color: #38bdf8;
}

body.dark-mode .snav-item.active {
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}

body.dark-mode .mobile-floating-pill {
    background: rgba(15, 23, 42, 0.92);
    border-color: rgba(51, 65, 85, 0.95);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5);
}

body.dark-mode .mfp-brand {
    color: #f8fafc;
}

body.dark-mode .mfp-cat {
    color: #38bdf8;
}

/* RESPONSIVE ПОВЕДІНКА БОКОВОГО БЛОКУ */
@media (max-width: 1280px) {
    .sticky-brand-nav {
        display: none !important;
    }
    .mobile-floating-pill.visible {
        display: inline-flex !important;
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }
}

@media (max-width: 420px) {
    .mfp-cat {
        max-width: 120px;
    }
}

/* ─── ОФЛАЙН ІНДИКАТОР (OFFLINE STATUS PILL) ─── */
.offline-status-pill {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    display: none;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.2);
    transition: all 0.3s ease;
    pointer-events: none;
}

.offline-status-pill.visible {
    display: inline-flex;
}

.offline-status-pill.offline {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.offline-status-pill.online {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

body.dark-mode .offline-status-pill.offline {
    background: #1e293b;
    color: #fbbf24;
    border: 1px solid #78350f;
}

body.dark-mode .offline-status-pill.online {
    background: #0f172a;
    color: #4ade80;
    border: 1px solid #14532d;
}
