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

/* ===== общее (как на других подстраницах раздела) ===== */
.cm-empty { padding: 22px 16px; font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
.cm-dim { color: var(--text-secondary); }
.page-content .up { color: var(--green, #4ade80); } .page-content .down { color: var(--red, #f87171); }
.live-dot.off { background: var(--text-secondary); animation: none; opacity: .6; }
.cm-verdict { display: block; margin: 10px 0 30px; padding: 0 4px; font-size: 13px; line-height: 1.6; color: var(--text-secondary); }
.cm-verdict:empty { margin: 0 0 30px; }
.cm-verdict > i { color: var(--gold, #d4af37); margin-right: 4px; }
.cm-verdict b { color: var(--text-color); }
.cm-verdict b.up { color: var(--green, #4ade80); } .cm-verdict b.down { color: var(--red, #f87171); }
.cm-num { margin-right: 4px; font: 600 26px/1 var(--mx-f-display); letter-spacing: -.02em; color: transparent; -webkit-text-stroke: 1px var(--mx-gold-line); opacity: .9; }
.cm-tip { position: absolute; z-index: 5; display: none; pointer-events: none; min-width: 110px; padding: 8px 11px; border: 1px solid var(--mx-line-strong); border-radius: 10px; background: rgba(16,16,15,.94); box-shadow: 0 10px 28px rgba(0,0,0,.4); font-size: 13px; line-height: 1.55; color: #e9e7df; white-space: nowrap; }
.cm-tip b { color: #fff; } .cm-tip span { color: #a9a79c; }
.cv-seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--mx-line-strong); border-radius: 999px; background: var(--mx-surface); }
.cv-seg button { border: 0; background: transparent; border-radius: 999px; padding: 6px 12px; color: var(--text-secondary); font: 600 13px var(--mx-f-ui); cursor: pointer; white-space: nowrap; }
.cv-seg button.on { background: var(--gold, #d4af37); color: #141413; }

/* ===== 01. КОНВЕРТЕР ===== */
.cv-main { position: relative; z-index: 6; display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); grid-template-rows: auto 70px auto auto; gap: 10px 14px; padding: 20px 22px 16px; border: 1px solid var(--mx-gold-line); border-radius: var(--mx-r);
    background: radial-gradient(80% 90% at 50% 0%, rgba(212,175,55,.1), transparent 70%), var(--mx-surface); }
.cv-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cv-amt { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; border: 1px solid var(--mx-line-strong); border-radius: 14px; background: var(--mx-surface-2); min-width: 0; }
.cv-amt small { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-secondary); }
.cv-amt input, .cv-amt output { width: 100%; min-width: 0; border: 0; background: transparent; color: var(--text-color); font: 600 34px/1.15 var(--mx-f-display); outline: none; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-res .cv-amt { border-color: var(--mx-gold-line); background: var(--mx-gold-wash); }
.cv-res output { color: var(--gold, #d4af37); }
label.cv-amt:focus-within { border-color: var(--gold, #d4af37); }
.cv-unit { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--mx-line-strong); border-radius: 12px; background: var(--mx-surface); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color .15s; }
.cv-unit:hover { border-color: var(--gold, #d4af37); }
.cv-unit img { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; }
.cv-u-n { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cv-u-n b { font: 600 15px var(--mx-f-display); color: var(--text-color); }
.cv-u-n small { font-size: 12.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-unit > i { color: var(--text-secondary); font-size: 12.5px; }
.cv-swap { align-self: center; justify-self: center; width: 52px; height: 52px; margin-top: 18px; border: 1px solid var(--mx-gold-line); border-radius: 50%; background: var(--mx-gold-wash); color: var(--gold, #d4af37); font-size: 18px; cursor: pointer; transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.cv-swap:hover { transform: rotate(180deg); }
.cv-flow { grid-column: 1 / -1; position: relative; height: 70px; }
.cv-flow canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cv-rate { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 4px 18px; text-align: center; cursor: pointer; }
.cv-r-main { font-size: 15px; color: var(--text-color); }
.cv-r-main b { font: 600 18px var(--mx-f-display); color: var(--gold, #d4af37); }
.cv-r-inv { font-size: 13.5px; color: var(--text-secondary); }
.cv-r-d { font-size: 13.5px; font-weight: 700; }
.cv-r-src { flex-basis: 100%; font-size: 12.5px; color: var(--text-secondary); }
.cv-quick { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding-top: 10px; border-top: 1px dashed var(--mx-line); }
.cv-quick button { padding: 6px 12px; border: 1px solid var(--mx-line-strong); border-radius: 999px; background: transparent; color: var(--text-secondary); font: 600 13px var(--mx-f-ui); cursor: pointer; }
.cv-quick button:hover, .cv-quick button.on { border-color: var(--gold, #d4af37); color: var(--text-color); }
.cv-pop { position: absolute; z-index: 30; width: 340px; max-width: calc(100% - 8px); padding: 8px; border: 1px solid var(--mx-line-strong); border-radius: 14px; background: var(--bg-color, #121211); box-shadow: 0 20px 44px rgba(0,0,0,.5); }
.cv-pop[hidden] { display: none; }
.cv-pop-s { display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--mx-line-strong); border-radius: 10px; }
.cv-pop-s i { font-size: 13px; color: var(--text-secondary); }
.cv-pop-s input { flex: 1; min-width: 0; padding: 9px 0; border: 0; background: transparent; color: var(--text-color); font: 500 13px var(--mx-f-ui); outline: none; }
.cv-pop-l { display: flex; flex-direction: column; max-height: 320px; overflow-y: auto; margin-top: 6px; }
.cv-pop-l small { padding: 8px 8px 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-secondary); }
.cv-pop-l button { display: grid; grid-template-columns: 22px 64px minmax(0, 1fr); gap: 10px; align-items: center; padding: 6px 8px; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.cv-pop-l button:hover, .cv-pop-l button.on { background: var(--mx-gold-wash); }
.cv-pop-l img { width: 22px; height: 22px; border-radius: 50%; }
.cv-pop-l b { font-size: 13.5px; color: var(--text-color); }
.cv-pop-l span { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== 02. СУММА ВЕЗДЕ ===== */
.cv-all { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cv-all > .cm-empty { grid-column: 1 / -1; border: 1px solid var(--mx-line); border-radius: var(--mx-r); background: var(--mx-surface); }
.cv-c { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 2px 10px; align-items: center; padding: 10px 12px; 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; }
.cv-c:hover { border-color: var(--gold, #d4af37); transform: translateY(-2px); }
.cv-c.on { border-color: var(--mx-gold-line); background: var(--mx-gold-wash); }
.cv-c img { grid-row: span 2; width: 30px; height: 30px; border-radius: 50%; }
.cv-c-n { display: flex; flex-direction: column; min-width: 0; }
.cv-c-n b { font: 600 13px var(--mx-f-display); color: var(--text-color); }
.cv-c-n small { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-c-d { font-size: 12.5px; font-weight: 700; text-align: right; }
.cv-c-v { grid-column: 2 / -1; font: 600 17px var(--mx-f-display); color: var(--text-color); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-c-v i { font: 500 13px var(--mx-f-ui); font-style: normal; color: var(--text-secondary); }

/* ===== 03. ИСТОРИЯ ===== */
.cv-hist { padding: 14px 16px 10px; border: 1px solid var(--mx-line); border-radius: var(--mx-r); background: var(--mx-surface); }
.cv-hist-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-bottom: 8px; }
.cv-hist-st { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.cv-hist-st span { display: flex; flex-direction: column; }
.cv-hist-st small { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); }
.cv-hist-st b { font: 600 16px var(--mx-f-display); color: var(--text-color); font-variant-numeric: tabular-nums; }
.cv-hist-box { position: relative; height: 300px; }
.cv-hist-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
.cv-hist-box .cm-empty { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; }

/* ===== 04. ЕЦБ ===== */
.cv-ecb { margin-bottom: 30px; padding: 16px 18px; border: 1px solid var(--mx-line); border-radius: var(--mx-r); background: var(--mx-surface); }
.cv-ecb > .cm-empty { padding: 6px 0; }
.cv-ecb-g { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 20px; align-items: center; }
.cv-eb { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border: 1px solid var(--mx-line-strong); border-radius: 12px; background: var(--mx-surface-2); }
.cv-eb small { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); }
.cv-eb b { font: 600 26px var(--mx-f-display); color: var(--text-color); font-variant-numeric: tabular-nums; }
.cv-eb span { font-size: 12.5px; color: var(--text-secondary); }
.cv-eb-mid { display: flex; flex-direction: column; align-items: center; }
.cv-eb-mid b { font: 600 22px var(--mx-f-display); color: var(--text-color); }
.cv-eb-mid span { font-size: 12.5px; color: var(--text-secondary); }
.cv-ecb-t { margin-top: 12px; font-size: 13.5px; line-height: 1.55; color: var(--text-secondary); }
.cv-ecb-none { display: flex; gap: 12px; font-size: 13.5px; line-height: 1.55; color: var(--text-secondary); }
.cv-ecb-none > i { margin-top: 3px; color: var(--gold, #d4af37); }
.cv-ecb-none > div { display: flex; flex-direction: column; gap: 4px; }
.cv-ecb-none b { font-size: 13.5px; color: var(--text-color); }

/* ===== 05. ПОКУПАТЕЛЬНАЯ СИЛА ===== */
.cv-pow { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--mx-line); border-radius: var(--mx-r); background: var(--mx-surface); }
.cv-pow > .cm-empty { padding: 6px 0; }
.cv-pw-h { margin-bottom: 4px; font: 600 14px var(--mx-f-display); color: var(--text-color); }
.cv-pw { display: grid; grid-template-columns: 150px 150px 16px 160px minmax(0, 1fr) 70px; gap: 12px; align-items: center; padding: 6px 0; border-top: 1px dashed var(--mx-line); }
.cv-pw-n { display: flex; align-items: center; gap: 8px; }
.cv-pw-n img { width: 24px; height: 24px; border-radius: 50%; }
.cv-pw-n b { font-size: 13px; color: var(--text-color); }
.cv-pw-v { display: flex; flex-direction: column; font-size: 13px; color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-pw-v small { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
.cv-pw-v b { font-size: 14px; color: var(--text-color); }
.cv-pw > i { color: var(--text-secondary); font-size: 12.5px; }
.cv-pw-bar { position: relative; height: 12px; border-radius: 4px; background: var(--mx-surface-2); }
.cv-pw-bar i.z { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--mx-line-strong); }
.cv-pw-bar i.b { position: absolute; top: 2px; bottom: 2px; border-radius: 3px; }
.cv-pw-bar i.b.up { background: rgba(74,222,128,.7); } .cv-pw-bar i.b.down { background: rgba(248,113,113,.7); }
.cv-pw-c { font-size: 14px; text-align: right; font-variant-numeric: tabular-nums; }

/* ===== ДАЛЬШЕ ===== */
.cm-next { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 34px 0 10px; }
.cm-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; }
.cm-next a:hover { border-color: var(--mx-gold-line); background: var(--mx-gold-wash); }
.cm-next i { grid-row: span 2; font-size: 16px; color: var(--gold, #d4af37); }
.cm-next b { font-size: 13px; color: var(--text-color); }
.cm-next span { font-size: 13px; color: var(--text-secondary); }

/* ===== СВЕТЛАЯ ТЕМА ===== */
body.light .page-content .up, body.light .cm-verdict b.up { color: #15803d; }
body.light .page-content .down, body.light .cm-verdict b.down { color: #b91c1c; }
body.light .cm-num { -webkit-text-stroke-color: rgba(138,106,16,.55); }
body.light .cv-seg button.on { background: #a87f12; color: #fff; }
body.light .cv-res output, body.light .cv-r-main b, body.light .cv-swap { color: #8a6a10; }
body.light .cv-pop { background: #fff; box-shadow: 0 20px 44px rgba(0,0,0,.15); }
body.light .cv-pw-bar i.b.up { background: rgba(22,163,74,.6); } body.light .cv-pw-bar i.b.down { background: rgba(220,38,38,.55); }

/* ===== АДАПТИВ ===== */
@media (max-width: 1300px) {
    .cv-all { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .cv-pw { grid-template-columns: 130px 130px 14px 140px minmax(0, 1fr) 64px; }
}
@media (max-width: 1100px) {
    .cv-all { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cm-next { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .cv-main { grid-template-columns: 1fr; grid-template-rows: none; padding: 14px 12px; }
    .cv-swap { margin: 0 auto; transform: rotate(90deg); width: 44px; height: 44px; }
    .cv-swap:hover { transform: rotate(270deg); }
    .cv-flow { display: none; }
    .cv-amt input, .cv-amt output { font-size: 28px; }
    .cv-all { grid-template-columns: 1fr; }
    .cv-ecb-g { grid-template-columns: 1fr; gap: 8px; }
    .cv-pw { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
    .cv-pw-n { grid-column: 1; } .cv-pw-c { grid-column: 2; grid-row: 1; }
    .cv-pw-v { grid-row: 2; } .cv-pw > i { display: none; }
    .cv-pw-bar { grid-column: 1 / -1; }
    .cv-hist-box { height: 240px; }
}
@media (max-width: 600px) {
    .strip-head { flex-wrap: wrap; }
    .cm-num { font-size: 20px; }
    .cm-next { grid-template-columns: 1fr; }
}
