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

/* ===== общее ===== */
.cx-panel { border: 1px solid var(--mx-line); border-radius: var(--mx-r); background: var(--mx-surface); overflow: hidden; min-width: 0; }
.cx-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 13px 16px; border-bottom: 1px solid var(--mx-line); }
.cx-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); }
.cx-panel-head span i { color: var(--gold, #d4af37); }
.cx-panel-head small { font-size: 12.5px; color: var(--text-secondary); opacity: .7; }
.cx-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 30px; }
.cx-note { padding: 12px 16px 14px; border-top: 1px solid var(--mx-line); font-size: 13.5px; line-height: 1.55; color: var(--text-secondary); }
.cx-note:empty { display: none; }
.cx-note b { color: var(--text-color); }
.cx-note .up, .cx-tier-t .up { color: var(--green, #4ade80); } .cx-note .down, .cx-tier-t .down { color: var(--red, #f87171); }
.cx-empty { padding: 22px 16px; font-size: 13px; line-height: 1.5; color: var(--text-secondary); grid-column: 1 / -1; }
.cx-noicon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; background: var(--mx-surface-2); border: 1px solid var(--mx-line); color: var(--text-secondary); font-size: 10.5px; font-weight: 700; }
.strip-head .cx-seg { margin-left: auto; }
.strip-head .cx-seg + .strip-legend { margin-left: 8px; }
.cx-seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: 9px; background: var(--mx-surface-2); }
.cx-seg button { border: 0; background: transparent; border-radius: 7px; padding: 4px 10px; color: var(--text-secondary); font: 600 12.5px var(--mx-f-ui); cursor: pointer; }
.cx-seg button.on { background: var(--gold, #d4af37); color: #17130a; }

/* ===== 1. СЕКТОРА ===== */
.cx-sectors { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 30px; }
.cx-sector { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--mx-line); border-radius: 12px; background: var(--bg, var(--mx-surface)); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, transform .15s; min-width: 0; }
.cx-sector:hover { border-color: var(--mx-gold-line); transform: translateY(-1px); }
.cx-sector.on { border-color: var(--gold, #d4af37); box-shadow: 0 0 0 1px var(--gold, #d4af37) inset; }
.cx-sec-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cx-sec-top b { font-size: 14px; font-weight: 700; color: var(--text-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-sec-top i { font-style: normal; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.cx-sec-top i.up { color: var(--green, #4ade80); } .cx-sec-top i.down { color: var(--red, #f87171); }
.cx-sec-cap { font-size: 13px; font-weight: 600; color: var(--text-color); }
.cx-sec-cap em { font-style: normal; font-weight: 500; color: var(--text-secondary); margin-left: 6px; font-size: 12.5px; }
.cx-sec-size { height: 3px; border-radius: 2px; background: rgba(255,255,255,.06); overflow: hidden; }
.cx-sec-size i { display: block; height: 100%; background: var(--gold, #d4af37); opacity: .7; }
.cx-sec-coins { display: flex; align-items: center; min-width: 0; }
.cx-sec-coins img { width: 18px; height: 18px; border-radius: 50%; margin-right: -5px; border: 1.5px solid #141413; background: #141413; }
.cx-sec-coins small { margin-left: 10px; font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== 2. КРУПНЫЕ / СРЕДНИЕ / МАЛЫЕ ===== */
.cx-tiers { padding: 6px 8px 4px; overflow-x: auto; }
.cx-tier-t { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: 13px; }
.cx-tier-t th { padding: 6px 6px 4px; font-size: 12.5px; font-weight: 500; color: var(--text-secondary); text-align: center; }
.cx-tier-t th:first-child { text-align: left; }
.cx-tier-t td { padding: 9px 6px; text-align: center; font-weight: 700; border-radius: 7px; white-space: nowrap; }
.cx-tier-t td:first-child { text-align: left; font-weight: 400; }
.cx-tier-t td:first-child b { display: block; font-size: 13px; color: var(--text-color); }
.cx-tier-t td:first-child small { font-size: 12px; color: var(--text-secondary); }
.cx-tier-t td:last-child { font-weight: 600; color: var(--text-secondary); font-size: 13px; }
.cx-upbar { display: inline-block; width: 34px; height: 4px; margin-right: 6px; border-radius: 2px; background: rgba(248,113,113,.45); overflow: hidden; vertical-align: middle; }
.cx-upbar i { display: block; height: 100%; background: var(--green, #4ade80); }

/* ===== 3. ЦИКЛ ОТ ATH ===== */
.cx-ath-dist { padding: 8px 10px 6px; }
.cx-ath-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 30px 78px; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 9px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .15s; }
.cx-ath-row:hover { background: var(--mx-surface-2); }
.cx-ath-row.on { background: var(--mx-gold-wash); box-shadow: inset 2px 0 0 var(--gold, #d4af37); }
.cx-ath-l { font-size: 13px; color: var(--text-secondary); white-space: nowrap; }
.cx-ath-bar { height: 10px; border-radius: 5px; background: rgba(255,255,255,.04); overflow: hidden; }
.cx-ath-bar i { display: block; height: 100%; border-radius: 5px; background: hsl(var(--h, 60), 62%, 52%); opacity: .8; transition: width .5s; }
.cx-ath-n { font-size: 13px; font-weight: 700; color: var(--text-color); text-align: right; }
.cx-ath-ic { display: flex; }
.cx-mini { width: 18px; height: 18px; border-radius: 50%; margin-right: -4px; border: 1.5px solid #141413; background: #141413; }
.cx-ath-ic .cx-noicon { width: 18px; height: 18px; font-size: 7px; margin-right: -4px; }

/* ===== 4. РАЗМЫТИЕ ПРЕДЛОЖЕНИЯ ===== */
.cx-list { display: flex; flex-direction: column; }
.cx-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 16px; border: 0; border-bottom: 1px solid var(--mx-line); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .15s; }
.cx-row:last-child { border-bottom: 0; }
.cx-row:hover { background: var(--mx-gold-wash); }
.cx-row .asset-icon-compact, .cx-row .cx-noicon { width: 28px; height: 28px; }
.cx-row-n { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.cx-row-n b { font-size: 13px; color: var(--text-color); }
.cx-row-n small { font-size: 12.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-row-v { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.cx-row-v b { font-size: 14px; font-weight: 700; color: var(--text-color); }
.cx-row-v small { font-size: 12.5px; color: var(--text-secondary); }
.cx-circ { display: block; height: 4px; margin-top: 3px; border-radius: 2px; background: rgba(255,255,255,.07); overflow: hidden; max-width: 220px; }
.cx-circ i { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, #d4af37, #f5d97a); }
.cx-circ-sm { display: inline-block; width: 40px; margin: 0 8px 0 0; vertical-align: middle; }

/* ===== 5. ТАБЛИЦА ===== */
.cx-state { margin-top: 0; }
.cx-count { margin-left: auto; font-weight: 600; color: var(--text-color); }
.cx-count + .sb-reset { margin-left: 8px; }
.cx-muted { opacity: .7; }
.cx-rank { color: var(--text-secondary); font-weight: 600; }
.cx-table tbody tr { cursor: pointer; }
.cx-table thead th[data-sort] { cursor: pointer; user-select: none; }
.cx-table thead th.sorted .sort-ico::after { content: '▼'; }
.cx-table thead th.sorted.asc .sort-ico::after { content: '▲'; }
.cx-table thead th[data-sort="rank"].sorted .sort-ico::after { content: '▲'; }
.cx-star { width: 26px; height: 26px; border: 0; border-radius: 6px; background: none; color: var(--text-secondary); cursor: pointer; font-size: 13px; opacity: .55; transition: opacity .15s, color .15s; }
.cx-star:hover, .cx-star.on { opacity: 1; color: #fbbf24; }
.cx-circ-cell, .cx-ath { white-space: nowrap; font-size: 13px; color: var(--text-secondary); }
.cx-ath .up { color: var(--green, #4ade80); font-weight: 700; }
.cx-athbar { display: inline-block; width: 46px; height: 4px; margin-right: 8px; border-radius: 2px; background: var(--mx-surface-2); overflow: hidden; vertical-align: middle; }
.cx-athbar i { display: block; height: 100%; background: var(--gold, #d4af37); opacity: .75; }
.cx-pager { justify-content: space-between; }

/* ===== КАЛЬКУЛЯТОР «ЕСЛИ БЫ КУПИЛ» ===== */
.cx-calc { display: grid; grid-template-columns: 340px minmax(0, 1fr); margin-bottom: 30px; border: 1px solid var(--mx-line); border-radius: var(--mx-r); background: var(--mx-surface); overflow: hidden; }
.cx-calc-in { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-right: 1px solid var(--mx-line); }
.cx-field { display: flex; flex-direction: column; gap: 6px; }
.cx-field > span { font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); }
.cx-field input { width: 100%; padding: 10px 12px; border: 1px solid var(--mx-line); border-radius: 10px; background: var(--mx-surface-2); color: var(--text-color); font: 500 14px var(--mx-f-ui); outline: none; }
.cx-field input:focus { border-color: var(--mx-gold-line); }
.cx-seg-lg { display: grid; grid-template-columns: repeat(2, 1fr); }
.cx-seg-lg button { padding: 7px 8px; font-size: 13px; }
.cx-calc-out { padding: 18px 20px; min-width: 0; }
.cx-calc-main { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--mx-line); }
.cx-calc-coin { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.cx-calc-coin .asset-icon-compact { width: 42px; height: 42px; }
.cx-calc-coin b { display: block; font-size: 16px; color: var(--text-color); }
.cx-calc-coin small { font-size: 13px; color: var(--text-secondary); }
.cx-calc-res { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.cx-calc-res span { font-size: 13px; color: var(--text-secondary); }
.cx-calc-res b { font-family: var(--mx-f-display); font-size: clamp(24px, 2.6vw, 34px); font-weight: 600; letter-spacing: -.02em; color: var(--text-color); }
.cx-calc-res i { font-style: normal; font-size: 14px; font-weight: 700; }
.cx-calc-res i.up, .cx-cmp em.up { color: var(--green, #4ade80); } .cx-calc-res i.down, .cx-cmp em.down { color: var(--red, #f87171); }
.cx-calc-cmp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-top: 14px; }
.cx-cmp { display: grid; grid-template-columns: auto 18px auto 1fr; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--mx-line); border-radius: 10px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color .15s; }
.cx-cmp:hover { border-color: var(--mx-gold-line); }
.cx-cmp span { font-size: 12.5px; color: var(--text-secondary); white-space: nowrap; }
.cx-cmp b { font-size: 13px; color: var(--text-color); }
.cx-cmp em { font-style: normal; font-size: 13.5px; font-weight: 700; text-align: right; white-space: nowrap; }

/* ===== СВЕТЛАЯ ТЕМА ===== */
body.light .cx-sec-coins img, body.light .cx-mini, body.light .cx-ath-ic .cx-noicon { border-color: #fff; background: #fff; }
body.light .cx-sec-size, body.light .cx-ath-bar, body.light .cx-circ { background: rgba(20,20,20,.07); }
body.light .cx-tier-t td.up, body.light .cx-note .up { color: #15803d; } body.light .cx-tier-t td.down, body.light .cx-note .down { color: #b91c1c; }

/* ===== СОСЕДНИЕ ПОДСТРАНИЦЫ ===== */
.cx-next { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 34px 0 10px; }
.cx-next a { display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; column-gap: 10px; padding: 14px 16px; border: 1px solid var(--mx-line); border-radius: 12px; background: var(--mx-surface); text-decoration: none; transition: border-color .15s, background .15s; }
.cx-next a:hover { border-color: var(--mx-gold-line); background: var(--mx-surface-2); }
.cx-next i { grid-row: 1 / 3; align-self: center; color: var(--gold, #d4af37); font-size: 16px; }
.cx-next b { font-size: 13px; color: var(--text-color); }
.cx-next span { font-size: 13px; color: var(--text-secondary); }

/* ===== АДАПТИВ ===== */
@media (max-width: 1300px) { .cx-sectors { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cx-next { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .cx-duo, .cx-calc { grid-template-columns: 1fr; } .cx-calc-in { border-right: 0; border-bottom: 1px solid var(--mx-line); } }
@media (max-width: 640px) { .cx-calc-cmp { grid-template-columns: 1fr; } .cx-calc-res { align-items: flex-start; } }
@media (max-width: 640px) { .cx-sectors { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cx-next { grid-template-columns: 1fr; } .cx-ath-row { grid-template-columns: 82px minmax(0, 1fr) 26px; } .cx-ath-ic { display: none; } }
body.light .cx-calc-res i.up, body.light .cx-cmp em.up { color: #15803d; } body.light .cx-calc-res i.down, body.light .cx-cmp em.down { color: #b91c1c; }

/* заголовки блоков на телефоне: подпись и переключатель — отдельной строкой под заголовком */
@media (max-width: 640px) {
  .page-content .strip-head { flex-wrap: wrap; row-gap: 8px; }
  .page-content .strip-head .strip-title { white-space: nowrap; }
  .page-content .strip-head .strip-legend { flex-basis: 100%; margin-left: 0; order: 3; }
  .strip-head .cx-seg { margin-left: auto; }
}
