@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;800&family=Unbounded:wght@400;700;900&family=JetBrains+Mono:wght@500&display=swap');

:root {
    --bg-core: #000000;
    --text-main: #FFFFFF;
    --text-muted: #888;
    --accent: #CCFF00;
    --color-success: #00E676;
    --color-danger: #FF1744;
    --color-warn: #FFC400;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; outline: none; }

/* ГЛАВНОЕ ИЗМЕНЕНИЕ: Скролл на body */
body { 
    background: var(--bg-core); 
    color: var(--text-main); 
    font-family: 'Manrope', sans-serif; 
    margin: 0; 
    overflow-x: hidden;
    overflow-y: auto; /* ВКЛЮЧАЕМ СКРОЛЛ */
}

/* --- МАТРИЦА (ФОН) --- */
.matrix-hud { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh; 
    z-index: 0; 
    pointer-events: none; /* Пропускает клики */
    display: flex; justify-content: center; align-items: flex-start; 
}
.parallax-wrapper { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding-bottom: 20vh; }
.zoom-wrapper { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.matrix-stack { position: relative; width: 95vw; max-width: 450px; aspect-ratio: 1 / 1; }
.matrix-bg { width: 100%; height: 100%; object-fit: contain; position: absolute; top: 0; left: 0; z-index: 1; opacity: 1; }
.nodes-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; }

/* Точки матрицы - ДОЛЖНЫ БЫТЬ КЛИКАБЕЛЬНЫ */
.matrix-val {
    position: absolute; transform: translate(-50%, -50%);
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-family: 'Unbounded', sans-serif; font-weight: 800; line-height: 1;
    cursor: pointer; 
    pointer-events: auto !important; /* ВАЖНО */
    width: 24px; height: 24px; font-size: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    transition: transform 0.1s;
    z-index: 20; /* Выше фона */
}
.matrix-val:active { transform: translate(-50%, -50%) scale(0.95); }
.matrix-val.val-large { width: 30px; height: 30px; font-size: 12px; }
.matrix-val.val-std   { width: 24px; height: 24px; font-size: 10px; }
.matrix-val.val-small { width: 18px; height: 18px; font-size: 8px; }

/* --- ОБЕРТКА КОНТЕНТА --- */
.content-layer {
    position: relative; 
    width: 100%; 
    z-index: 10;
    pointer-events: none; /* ПРОПУСКАЕТ КЛИКИ СКВОЗЬ ПУСТОТУ К МАТРИЦЕ */
}

/* --- ВЕРХНЯЯ ЧАСТЬ (HEADER) --- */
.header-spacer {
    position: relative;
    height: 75vh; /* Высота "дырки", чтобы видеть матрицу */
    width: 100%;
}

/* Лого и Панель теперь ABSOLUTE внутри потока (уезжают вверх) */
.top-logo { 
    position: absolute; top: 25px; left: 25px; 
    pointer-events: auto; /* Кликабельно */
    font-family: 'Unbounded', sans-serif; font-weight: 900; font-size: 14px; color: #fff; 
}

.top-right-panel { 
    position: absolute; top: 20px; right: 20px; 
    pointer-events: auto; /* Кликабельно */
    display: flex; flex-direction: column; align-items: flex-end; gap: 12px; 
}

/* --- СТИЛИ ИНПУТОВ --- */
.mode-switch { display: flex; gap: 4px; background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); padding: 4px; border-radius: 12px; border: 1px solid #333; }
.mode-switch button { background: transparent; border: none; color: #666; font-family: 'Unbounded'; font-size: 10px; font-weight: 700; padding: 6px 12px; cursor: pointer; border-radius: 8px; }
.mode-switch button.active { background: #fff; color: #000; }
.input-cluster { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.date-row { display: flex; align-items: center; gap: 2px; background: rgba(0,0,0,0.3); padding: 4px; border-radius: 8px; }
select { background: transparent; color: #fff; border: none; font-family: 'Unbounded', monospace; font-size: 18px; font-weight: 700; text-align: right; cursor: pointer; direction: rtl; appearance: none; }
.sep { color: #666; font-weight: 300; margin: 0 2px; }
.go-text-btn { background: rgba(0,0,0,0.8); border: 1px solid #333; color: var(--accent); font-family: 'Unbounded'; font-size: 11px; font-weight: 800; padding: 12px 24px; border-radius: 20px; cursor: pointer; margin-top: 5px; }
.go-text-btn:active { background: var(--accent); color: #000; }

/* --- ЧЕРНАЯ ПАНЕЛЬ С ДАННЫМИ --- */
.info-panel {
    background: linear-gradient(to bottom, #050505 0%, #000000 100%);
    min-height: 100vh;
    border-top: 1px solid #222;
    padding-bottom: 120px;
    box-shadow: 0 -20px 60px #000;
    pointer-events: auto; /* Контент кликабелен */
    position: relative;
    z-index: 30;
}

/* --- ТАБЫ --- */
.sticky-tabs {
    position: sticky; top: 0; z-index: 100;
    background: rgba(5,5,5,0.9); backdrop-filter: blur(10px);
    padding: 15px 0; border-bottom: 1px solid #222;
}
.tabs-row { display: flex; overflow-x: auto; gap: 20px; padding: 0 20px; scrollbar-width: none; }
.tab { color: #555; background: transparent; white-space: nowrap; cursor: pointer; font-family: 'JetBrains Mono'; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.tab.active { color: #fff; text-shadow: 0 0 10px rgba(255,255,255,0.3); }

/* --- СТИЛИ КАРТОЧЕК (GRIMOIRE) --- */
.info-box { padding: 30px 20px; max-width: 600px; margin: 0 auto; }
.hud-header { margin-bottom: 30px; border-left: 2px solid var(--accent); padding-left: 15px; }
.hud-title { font-family: 'Unbounded'; font-weight: 900; font-size: 24px; color: #fff; margin: 0 0 5px 0; letter-spacing: -0.5px; }
.hud-meta { font-family: 'JetBrains Mono'; color: var(--accent); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; opacity: 0.8; margin-bottom: 25px; display: block; }

.tech-card {
    background: rgba(20, 20, 20, 0.6); backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px; padding: 25px; margin-bottom: 20px;
}
.grim-section { margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.grim-label { font-family: 'JetBrains Mono'; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.grim-text { font-family: 'Manrope'; font-size: 14px; line-height: 1.5; color: #ddd; }

.grim-plus .grim-label { color: #CCFF00; }
.grim-minus .grim-label { color: #FF5555; }
.grim-work .grim-label { color: #00CCFF; }
.grim-rest .grim-label { color: #D197FF; }

/* ТАБЛИЦЫ */
.hud-table-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px; border-bottom: 1px solid rgba(255,255,255,0.05); cursor: pointer; }
.col-name { flex: 2; font-family: 'JetBrains Mono'; font-size: 11px; text-transform: uppercase; display: flex; align-items: center; gap: 8px;}
.col-val { flex: 1; text-align: center; font-family: 'Unbounded'; font-weight: 700; font-size: 12px; color: #fff; }
.col-sum { flex: 1; text-align: right; font-family: 'Unbounded'; font-weight: 700; font-size: 12px; color: var(--accent); }
.hud-details { display: none; padding: 15px; background: rgba(0,0,0,0.3); border-bottom: 1px solid rgba(255,255,255,0.05); }
.hud-details.open { display: block; animation: slideDown 0.3s ease; }
.chakra-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; box-shadow: 0 0 5px currentColor; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* PROGNOZ */
.col-year { flex: 1; font-family: 'Unbounded'; font-size: 14px; color: #fff; }
.col-main { flex: 1; text-align: right; font-family: 'JetBrains Mono'; font-weight: 700; color: #CCFF00; }
.forecast-card { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 15px; margin-bottom: 15px; }

.footer-debug { text-align: center; padding: 60px; opacity: 0.2; }

/* === PREMIUM LIST STYLING === */
/* Блок одного пункта списка */
.list-block {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    padding: 10px 12px;
    margin-bottom: 6px;
    border-radius: 0 4px 4px 0;
    transition: background 0.2s;
}

/* Цветные бордеры в зависимости от секции */
.grim-plus .list-block  { border-left-color: rgba(204, 255, 0, 0.3); } /* Green */
.grim-minus .list-block { border-left-color: rgba(255, 85, 85, 0.3); } /* Red */
.grim-work .list-block  { border-left-color: rgba(0, 204, 255, 0.3); } /* Blue */
.grim-rest .list-block  { border-left-color: rgba(209, 151, 255, 0.3); } /* Purple */

/* Номер пункта (1., 2.) */
.num-accent {
    font-family: 'JetBrains Mono';
    font-weight: 700;
    margin-right: 6px;
    opacity: 0.8;
}
.grim-plus .num-accent { color: #CCFF00; }
.grim-minus .num-accent { color: #FF5555; }
.grim-work .num-accent { color: #00CCFF; }
.grim-rest .num-accent { color: #D197FF; }

/* Улучшение читаемости заголовков */
.grim-label {
    opacity: 0.9;
    letter-spacing: 1.5px;
    font-size: 11px;
    margin-bottom: 12px;
}

/* Сам текст */
.grim-text {
    font-family: 'Manrope';
    font-weight: 400;
    color: #e0e0e0; /* Чуть светлее, чем было */
    line-height: 1.55;
}

/* SECURITY PATCH: Force buttons on top */
.top-right-panel {
    z-index: 2000 !important;
}
.header-spacer {
    z-index: 2000 !important;
    pointer-events: none;
}
.top-logo {
    z-index: 2000 !important;
}
/* Ensure list blocks handle text wrapping */
.list-block {
    word-wrap: break-word;
    white-space: pre-wrap;
}
