/* ============================================================================
   forex.css — блоки подстраницы «Форекс» (forex.html).
   Каркас — ui-base.css, дизайн-слой и токены (--mx-*) — kyrs.css, фон — kyrs-scene.css.
   ============================================================================ */

/* ===== общее ===== */
.fx-panel { border: 1px solid var(--mx-line); border-radius: var(--mx-r); background: var(--mx-surface); overflow: hidden; min-width: 0; }
.fx-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 13px 16px; border-bottom: 1px solid var(--mx-line); }
.fx-panel-head span { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-secondary); }
.fx-panel-head span i { color: var(--gold, #d4af37); }
.fx-panel-head small { font-size: 12.5px; color: var(--text-secondary); opacity: .7; }
.fx-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 30px; }
.fx-empty { padding: 22px 16px; font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
.fx-note { padding: 12px 16px 14px; border-top: 1px solid var(--mx-line); font-size: 13.5px; line-height: 1.55; color: var(--text-secondary); }
.fx-note b { color: var(--text-color); }
.page-content .up { color: var(--green, #4ade80); } .page-content .down { color: var(--red, #f87171); }
.strip-head .fx-seg { margin-left: auto; }
.strip-head .fx-seg + .strip-legend { margin-left: 8px; }
.fx-seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--mx-line); border-radius: 999px; }
.fx-seg button { border: 0; background: transparent; border-radius: 999px; padding: 4px 12px; color: var(--text-secondary); font: 600 12.5px var(--mx-f-ui); cursor: pointer; transition: color .15s, background .15s; }
.fx-seg button:hover { color: var(--text-color); }
.fx-seg button.on { background: var(--mx-gold-wash); color: var(--gold, #d4af37); box-shadow: inset 0 0 0 1px var(--mx-gold-line); }
/* значок валюты: символ на её цвете */
.fx-cur { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex-shrink: 0; border-radius: 8px; background: var(--c); color: #fff; font: 700 13px Arial, sans-serif; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }

/* ===== 1. СИЛА ВАЛЮТ ===== */
.fx-strength { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; padding: 8px 18px; border: 1px solid var(--mx-line); border-radius: var(--mx-r); background: var(--mx-surface); }
.fx-str-row { display: grid; grid-template-columns: 16px 26px 150px minmax(0, 1fr) 70px; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--mx-line); }
.fx-strength .fx-str-row:nth-last-child(-n+2) { border-bottom: 0; }
.fx-str-rank { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); text-align: right; }
.fx-str-name { display: flex; flex-direction: column; min-width: 0; }
.fx-str-name b { font-size: 14px; color: var(--text-color); }
.fx-str-name small { font-size: 12.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-str-bar { position: relative; height: 8px; border-radius: 4px; background: var(--mx-surface-2); }
.fx-str-bar::after { content: ''; position: absolute; left: 50%; top: -4px; bottom: -4px; width: 1px; background: var(--mx-line-strong); }
.fx-str-bar i { position: absolute; top: 0; bottom: 0; border-radius: 4px; transition: width .5s; }
.fx-str-bar i.up { background: var(--green, #4ade80); } .fx-str-bar i.down { background: var(--red, #f87171); }
.fx-str-v { font-size: 14px; font-weight: 700; text-align: right; }
.fx-verdict { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px; margin: 10px 0 30px; padding: 0 4px; font-size: 13px; line-height: 1.6; color: var(--text-secondary); }
.fx-verdict:empty { display: none; }
.fx-verdict > i { color: var(--gold, #d4af37); margin-right: 4px; }
.fx-verdict b { color: var(--text-color); }
.fx-verdict b.up { color: var(--green, #4ade80); } .fx-verdict b.down { color: var(--red, #f87171); }
.fx-link { border: 0; border-bottom: 1px dashed var(--mx-gold-line); padding: 0; background: none; color: var(--gold, #d4af37); font: inherit; font-weight: 700; cursor: pointer; }

/* ===== 1б. СИЛА ПО ДНЯМ (тепловая карта) ===== */
.fx-heat-wrap { overflow-x: auto; border: 1px solid var(--mx-line); border-radius: var(--mx-r); background: var(--mx-surface); }
.fx-heat { width: 100%; min-width: 780px; border-collapse: separate; border-spacing: 3px; padding: 6px; font-size: 13px; }
.fx-heat th { padding: 5px 6px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.fx-heat thead th b { display: block; font-size: 13px; color: var(--text-color); }
.fx-heat thead th small { font-size: 12px; font-weight: 500; }
.fx-heat thead th.now b, .fx-heat thead th.now small { color: var(--gold, #d4af37); }
.fx-heat tbody th { text-align: left; }
.fx-heat tbody th b { margin-left: 7px; font-size: 13px; color: var(--text-color); vertical-align: middle; }
.fx-heat tbody th .fx-cur { width: 22px; height: 22px; font-size: 11.5px; border-radius: 6px; vertical-align: middle; }
.fx-heat td { padding: 9px 4px; border-radius: 7px; text-align: center; font-weight: 600; color: var(--text-color); white-space: nowrap; }
.fx-heat td.pos { background: rgba(34,197,94,var(--a)); }
.fx-heat td.neg { background: rgba(239,68,68,var(--a)); }
.fx-heat td.now { box-shadow: inset 0 0 0 1px var(--mx-gold-line); }
.fx-heat-na { color: var(--text-secondary) !important; background: var(--mx-surface-2); }
.fx-heat .fx-heat-tot { padding-left: 12px; font-weight: 700; text-align: right; background: none; }
.fx-heat .fx-empty { text-align: left; font-weight: 400; }

/* ===== 2. МАТРИЦА ===== */
.fx-matrix-wrap { overflow-x: auto; margin-bottom: 30px; border: 1px solid var(--mx-line); border-radius: var(--mx-r); background: var(--mx-surface); }
.fx-matrix { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 3px; padding: 6px; font-size: 13px; }
.fx-matrix th { padding: 6px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.fx-matrix th b { margin-left: 7px; font-size: 13px; color: var(--text-color); vertical-align: middle; }
.fx-matrix th .fx-cur { width: 22px; height: 22px; font-size: 11.5px; border-radius: 6px; vertical-align: middle; }
.fx-matrix tbody th { text-align: left; }
.fx-mx-corner { font-size: 12px; font-weight: 500 !important; text-align: left; opacity: .7; }
.fx-matrix td { padding: 9px 6px; border-radius: 8px; text-align: center; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.fx-matrix td[data-sym]:hover { box-shadow: inset 0 0 0 1px var(--gold, #d4af37); transform: translateY(-1px); }
.fx-matrix td b { display: block; font-size: 13px; font-weight: 700; color: var(--text-color); }
.fx-matrix td small { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 600; }
.fx-mx-self { background: var(--mx-surface-2); color: var(--text-secondary); cursor: default !important; }
.fx-mx-na { font-size: 12.5px; color: var(--text-secondary); cursor: default !important; }
.fx-matrix .fx-empty { text-align: left; }

/* ===== 3. ВОЛАТИЛЬНОСТЬ ===== */
.fx-vol { display: flex; flex-direction: column; }
.fx-vol-legend { display: flex; justify-content: space-between; gap: 10px; padding: 9px 16px 4px; font-size: 12px; color: var(--text-secondary); opacity: .8; }
.fx-vol-row, .fx-rg-row { display: grid; align-items: center; gap: 12px; width: 100%; padding: 8px 16px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .15s; }
.fx-vol-row:hover, .fx-rg-row:hover { background: var(--mx-gold-wash); }
.fx-vol-row { grid-template-columns: 118px minmax(0, 1fr) 62px; }
.fx-vol-n, .fx-rg-n { display: flex; flex-direction: column; min-width: 0; }
.fx-vol-n b, .fx-rg-n b { font-size: 13px; color: var(--text-color); }
.fx-vol-n small { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.fx-vol-bar { position: relative; height: 8px; border-radius: 4px; background: var(--mx-surface-2); }
.fx-vol-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: linear-gradient(90deg, rgba(212,175,55,.35), var(--gold, #d4af37)); }
.fx-vol-bar em { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px; border-radius: 1px; background: var(--text-color); opacity: .55; }
.fx-vol-v, .fx-rg-v { display: flex; flex-direction: column; align-items: flex-end; }
.fx-vol-v b, .fx-rg-v b { font-size: 13px; font-weight: 700; color: var(--text-color); }
.fx-vol-v small, .fx-rg-v small { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }

/* ===== 4. ГОДОВОЙ ДИАПАЗОН ===== */
.fx-range { display: flex; flex-direction: column; padding-top: 6px; }
.fx-rg-row { grid-template-columns: 104px minmax(0, 1fr) 76px; }
.fx-rg-n em { font-style: normal; font-size: 12px; font-weight: 600; }
.fx-rg-n em.hi { color: var(--green, #4ade80); } .fx-rg-n em.lo { color: var(--red, #f87171); }
.fx-rg-track { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); }
.fx-rg-line { position: relative; height: 6px; border-radius: 3px; background: linear-gradient(90deg, rgba(248,113,113,.45), var(--mx-surface-2) 50%, rgba(74,222,128,.45)); }
.fx-rg-line i { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--gold, #d4af37); box-shadow: 0 0 0 3px rgba(212,175,55,.22); }

/* ===== 5. СВЕРКА С ЕЦБ ===== */
.fx-ecb { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 8px; margin-bottom: 30px; }
.fx-ecb-cell { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; padding: 11px 13px; border: 1px solid var(--mx-line); border-radius: 12px; background: var(--mx-surface); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, transform .15s; }
.fx-ecb-cell:hover { border-color: var(--mx-gold-line); transform: translateY(-1px); }
.fx-ecb-n { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fx-ecb-n img { width: 20px; height: 20px; border-radius: 50%; }
.fx-ecb-n b { font-size: 13px; color: var(--text-color); }
.fx-ecb-d { font-size: 13px; font-weight: 700; }
.fx-ecb-r { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 5px; font-size: 13px; color: var(--text-color); white-space: nowrap; }
.fx-ecb-r small { font-size: 11.5px; color: var(--text-secondary); }
.fx-ecb-r small + * { margin-right: 4px; }
.fx-ecb .fx-empty { grid-column: 1 / -1; }

/* ===== 6. ТАБЛИЦА ===== */
.fx-table tbody tr { cursor: pointer; }
.fx-spark { width: 96px; height: 34px; display: block; }
.fx-table thead th[data-sort] { cursor: pointer; user-select: none; }
.fx-table thead th.sorted .sort-ico::after { content: '▼'; }
.fx-table thead th.sorted.asc .sort-ico::after { content: '▲'; }
.fx-atr { font-weight: 600; white-space: nowrap; }
.fx-atr small { display: block; font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.fx-day-rng { font-size: 13px; color: var(--text-secondary); white-space: nowrap; }

/* ===== ДАЛЬШЕ ===== */
.fx-next { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 34px 0 10px; }
.fx-next a { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; padding: 14px 16px; border: 1px dashed var(--mx-line-strong); border-radius: 12px; color: inherit; text-decoration: none; transition: border-color .15s, background .15s; }
.fx-next a:hover { border-color: var(--mx-gold-line); background: var(--mx-gold-wash); }
.fx-next i { grid-row: span 2; font-size: 16px; color: var(--gold, #d4af37); }
.fx-next b { font-size: 13px; color: var(--text-color); }
.fx-next span { font-size: 13px; color: var(--text-secondary); }

/* ===== СВЕТЛАЯ ТЕМА ===== */
body.light .page-content .up, body.light .fx-verdict b.up, body.light .fx-rg-n em.hi { color: #15803d; }
body.light .page-content .down, body.light .fx-verdict b.down, body.light .fx-rg-n em.lo { color: #b91c1c; }
body.light .fx-str-bar i.up { background: #22a052; } body.light .fx-str-bar i.down { background: #dc3c3c; }
body.light .fx-link, body.light .fx-seg button.on { color: #8a6a10; }
body.light .fx-rg-line { background: linear-gradient(90deg, rgba(220,60,60,.35), rgba(20,20,20,.06) 50%, rgba(34,160,82,.35)); }
body.light .fx-cur { box-shadow: none; }
body.light .fx-matrix td b, body.light .fx-str-name b, body.light .fx-vol-n b, body.light .fx-rg-n b, body.light .fx-ecb-n b { color: #141414; }

/* ===== АДАПТИВ ===== */
@media (max-width: 1100px) {
    .fx-strength { grid-template-columns: 1fr; }
    .fx-strength .fx-str-row:nth-last-child(2) { border-bottom: 1px solid var(--mx-line); }
    .fx-duo { grid-template-columns: 1fr; }
    .fx-next { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .fx-str-row { grid-template-columns: 14px 26px 64px minmax(0, 1fr) 62px; gap: 8px; }
    .fx-str-name small { display: none; }
    .fx-strength { padding: 6px 12px; }
    .fx-vol-row { grid-template-columns: 96px minmax(0, 1fr) 54px; padding: 8px 12px; }
    .fx-rg-row { grid-template-columns: 74px minmax(0, 1fr) 64px; padding: 8px 12px; gap: 8px; }
    .fx-rg-lo, .fx-rg-hi { display: none; }
    .fx-next { grid-template-columns: 1fr; }
    .strip-head { flex-wrap: wrap; }
}
