/* =========================================================================
 * Crypto Flow — Estilos
 * ========================================================================= */
:root {
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --r: 14px;
  --r-sm: 10px;
  color-scheme: dark;
  --bg: #0a0d14;
  --surface: #121722;
  --surface-2: #1a2131;
  --surface-3: #232c3f;
  --border: #263049;
  --grid: #1e2638;
  --text: #e9edf5;
  --text-2: #a4aec2;
  --muted: #76829b;
  --brand: #8b6cff;
  --brand-2: #14b8a6;
  --brand-soft: rgba(139, 108, 255, .14);
  --up: #34c77b;
  --down: #f26462;
  --warn: #e8a317;
  --info: #4f9bf0;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px rgba(0,0,0,.25);
  /* paleta categórica (modo oscuro) */
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5fa;
  --surface: #ffffff;
  --surface-2: #f6f7fb;
  --surface-3: #eceff6;
  --border: #e0e4ee;
  --grid: #edf0f5;
  --text: #0f1422;
  --text-2: #4b556b;
  --muted: #7a849a;
  --brand: #6d4cf0;
  --brand-2: #0d9488;
  --brand-soft: rgba(109, 76, 240, .10);
  --up: #13894b;
  --down: #d33b39;
  --warn: #a86f00;
  --info: #2a78d6;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 4px 16px rgba(16,24,40,.05);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'tnum' 1, 'cv11' 1;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 20px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
p { margin: 0 0 8px; }
a { color: var(--brand); }
code { font-family: var(--mono); background: var(--surface-3); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
.small { font-size: 12px; }
.muted { color: var(--text-2); }
.center { text-align: center; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.up { color: var(--up); }
.down { color: var(--down); }
.warn { color: var(--warn); }
.mt { margin-top: 12px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ------------------------------------------------------------------ layout */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 14px; gap: 18px; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.brand b { display: block; font-size: 17px; letter-spacing: -.02em; }
.brand span { display: block; font-size: 11.5px; color: var(--text-2); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: none; border: 0; border-radius: 10px; padding: 10px 12px;
  color: var(--text-2); font-weight: 500; text-align: left; position: relative;
}
.nav button:hover { background: var(--surface-2); color: var(--text); }
.nav button.on { background: var(--brand-soft); color: var(--text); }
.nav button.on::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav button.on svg { stroke: var(--brand); }
.nav-badge[hidden] { display: none; }
.nav-badge { margin-left: auto; background: var(--brand); color: #fff; font-style: normal; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 6px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.user { display: flex; gap: 10px; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px; }
.user b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user .small { display: block; }
.avatar { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 700; display: grid; place-items: center; flex: none; }
.xp { height: 4px; background: var(--surface-3); border-radius: 4px; margin-top: 6px; overflow: hidden; }
.xp span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 4px; }
.side-btns { display: flex; gap: 6px; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; color: var(--text-2); }
.icon-btn:hover { color: var(--text); border-color: var(--muted); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.disclaimer { font-size: 11px; color: var(--muted); margin: 0; line-height: 1.45; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 24px; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.tb-left { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.menu { display: none; }
.tb-clock { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; justify-content: center; }
.clock { display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.clock b { display: block; font-size: 13px; }
.clock .small { display: block; line-height: 1.2; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 4px color-mix(in srgb, var(--up) 22%, transparent); animation: pulse 1.6s infinite; }
.dot.paused { background: var(--muted); box-shadow: none; animation: none; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--up) 0%, transparent); } }
.tb-right { display: flex; align-items: center; gap: 12px; }
.scen { display: flex; flex-direction: column; gap: 0; }
.scen .small { line-height: 1.1; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.ticker { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.ticker b { display: block; font-size: 13.5px; }
.ticker .small { display: block; line-height: 1.2; }
.view { padding: 22px 24px 48px; max-width: 1440px; width: 100%; margin: 0 auto; }

/* ------------------------------------------------------------------ grids */
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.g-1-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-1-1-1 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-swap { grid-template-columns: minmax(0, 480px) minmax(0, 1fr); align-items: start; }
.products { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.products.three { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.missions { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.lessons { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack > .card { margin: 0; }
.section-h { margin: 28px 0 14px; }
.section-h h2 { margin-bottom: 4px; }
.section-h p { margin: 0; }
.page-h { margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.row-gap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-end { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.row-btns { display: flex; gap: 8px; margin-top: 12px; }

/* ------------------------------------------------------------------ card */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); min-width: 0; margin-bottom: 16px; }
.grid > .card { margin-bottom: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.kpi { padding: 16px 18px; }
.kpi-label { font-size: 12.5px; color: var(--text-2); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi-val { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin: 4px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { font-size: 12px; color: var(--text-2); }
.hint { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--border); font-size: 10px; color: var(--muted); cursor: help; }
.chart { position: relative; width: 100%; }
.chart canvas { display: block; }

/* ------------------------------------------------------------------ controls */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { background: none; border: 0; padding: 6px 11px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.18); }
:root[data-theme="dark"] .seg button.on { background: var(--surface-3); }
.seg.adv button { color: var(--brand); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: 9px 16px; border-radius: 10px; font-weight: 600; font-size: 13.5px; transition: .15s;
}
.btn:hover:not(:disabled) { border-color: var(--muted); }
.btn.primary { background: var(--brand); border-color: transparent; color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 30%, transparent); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--down); border-color: transparent; color: #fff; }
.btn.danger-t { color: var(--down); }
.btn:disabled { opacity: .45; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn.lg { padding: 13px 18px; font-size: 15px; border-radius: 12px; }
.btn.block { width: 100%; }
.link { background: none; border: 0; color: var(--brand); font-weight: 600; font-size: 12.5px; padding: 0; }
.select { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); padding: 7px 10px; border-radius: 9px; font: inherit; font-size: 13px; font-weight: 600; }
.field { margin: 12px 0; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; gap: 8px; }
.input-wrap { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 4px 6px 4px 12px; transition: border-color .15s; }
.input-wrap:focus-within { border-color: var(--brand); }
.input-wrap input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: 600 16px var(--font); padding: 8px 0; }
.max { background: var(--brand-soft); color: var(--brand); border: 0; border-radius: 7px; padding: 4px 8px; font-size: 11px; font-weight: 700; }
.unit { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; padding-right: 6px; white-space: nowrap; }
input[type="range"] { width: 100%; accent-color: var(--brand); }
.quick { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.quick button { background: var(--surface-3); border: 0; border-radius: 7px; padding: 4px 9px; font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.quick button:hover { color: var(--text); }
.search { width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; color: var(--text); font: inherit; margin-bottom: 12px; }
.plus { text-align: center; color: var(--muted); font-weight: 700; margin: -4px 0; }

/* ------------------------------------------------------------------ tokens */
.tk { --tk: 20px; width: var(--tk); height: var(--tk); border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 800; font-size: calc(var(--tk) * .52); flex: none; vertical-align: middle; line-height: 1; }
.tk-firos { background: linear-gradient(135deg, #8b6cff, #14b8a6); }
.tk-usdt { background: #26a17b; }
.tk-pair { --tk: 20px; display: inline-flex; vertical-align: middle; flex: none; }
.tk-pair .tk { width: var(--tk); height: var(--tk); font-size: calc(var(--tk) * .5); box-shadow: 0 0 0 2px var(--surface); }
.tk-pair .tk + .tk { margin-left: calc(var(--tk) * -.35); }

/* ------------------------------------------------------------------ badges / tags */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 650; padding: 3px 8px; border-radius: 20px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.good, .risk-low { background: color-mix(in srgb, var(--up) 15%, transparent); color: var(--up); }
.risk-mid { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.risk-high { background: color-mix(in srgb, var(--down) 15%, transparent); color: var(--down); }
.tag { display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.tag-swap { color: var(--s1); }
.tag-liquidez, .tag-farm { color: var(--s3); }
.tag-staking { color: var(--s7); }
.tag-bono, .tag-rentafija { color: var(--s4); }
.tag-prestamo { color: var(--s5); }
.tag-recompensa, .tag-mision { color: var(--up); }
.tag-liquidacion, .tag-revertida { color: var(--down); }

/* ------------------------------------------------------------------ quote / alerts */
.quote { background: var(--surface-2); border-radius: 11px; padding: 4px 12px; margin: 12px 0; }
.quote:empty { display: none; }
.q-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 13px; border-bottom: 1px dashed var(--border); }
.q-row:last-of-type { border-bottom: 0; }
.q-row span { color: var(--text-2); }
.q-row b { text-align: right; }
.alert { border-radius: 10px; padding: 10px 12px; font-size: 13px; margin: 10px 0; border: 1px solid; }
.alert.bad { background: color-mix(in srgb, var(--down) 10%, transparent); border-color: color-mix(in srgb, var(--down) 35%, transparent); }
.alert.good { background: color-mix(in srgb, var(--up) 10%, transparent); border-color: color-mix(in srgb, var(--up) 35%, transparent); }
.alert.info { background: color-mix(in srgb, var(--info) 10%, transparent); border-color: color-mix(in srgb, var(--info) 30%, transparent); }

/* ------------------------------------------------------------------ explain */
.explain { border-top: 1px solid var(--border); }
.explain:first-child { border-top: 0; }
.card > .explain:last-child { margin-bottom: -6px; }
.explain summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 11px 0; font-weight: 600; font-size: 13.5px; }
.explain summary::-webkit-details-marker { display: none; }
.explain summary::after { content: '+'; margin-left: auto; color: var(--muted); font-size: 18px; font-weight: 400; }
.explain[open] summary::after { content: '−'; }
.explain .q { width: 22px; height: 22px; border-radius: 7px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none; }
.explain-body { padding: 0 0 12px 32px; color: var(--text-2); font-size: 13.5px; }
.card > .card-h + .explain, .card > .explain:first-child { margin-top: -6px; }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; text-transform: uppercase; letter-spacing: .03em; }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; }
.tbl td:first-child, .tbl td.r { white-space: nowrap; }
.tbl td .tk, .tbl td .tk-pair { margin-right: 4px; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: var(--surface-2); }
.wprog { min-width: 150px; }
.prog { display: flex; flex-direction: column; gap: 4px; }
.prog-bar { height: 6px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.prog-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 6px; transition: width .4s; }
.empty { text-align: center; padding: 22px 10px; color: var(--text-2); }
.empty p { margin-bottom: 10px; }

/* ------------------------------------------------------------------ dashboard */
.alloc { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.donut { display: block; }
.donut-big { font-size: 22px; font-weight: 750; fill: var(--text); }
.donut-small { font-size: 11px; fill: var(--text-2); }
.legend { list-style: none; padding: 0; margin: 0; width: 100%; }
.legend li { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 12.5px; }
.sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.lg-l { flex: 1; color: var(--text-2); min-width: 0; }
.lg-v { font-weight: 600; white-space: nowrap; }
.lg-v em { font-style: normal; color: var(--muted); font-weight: 500; margin-left: 6px; display: inline-block; min-width: 40px; text-align: right; }
.bal { list-style: none; margin: 0; padding: 0; }
.bal li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.bal li:last-child { border-bottom: 0; }
.bal b, .bal .small { display: block; }
.bal .r { margin-left: auto; text-align: right; }
.bal li > div:nth-child(2) { min-width: 0; }
.mission-hero { display: flex; gap: 12px; margin-bottom: 12px; }
.m-ic { font-size: 26px; width: 46px; height: 46px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.feed { list-style: none; padding: 0; margin: 0; }
.feed li { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.feed li:last-child { border-bottom: 0; }
.feed p { margin: 0 0 2px; font-size: 13px; }
.feed .tag { margin-top: 2px; min-width: 86px; text-align: center; }
.news { list-style: none; margin: 0; padding: 0; }
.news li { padding: 10px 0 10px 12px; border-left: 3px solid var(--border); margin-bottom: 8px; }
.news li.good { border-left-color: var(--up); }
.news li.bad { border-left-color: var(--down); }
.news p { margin: 3px 0; }

/* ------------------------------------------------------------------ swap */
.swap-card { position: relative; }
.slip { display: flex; align-items: center; gap: 8px; }
.slip .seg button { padding: 4px 8px; font-size: 11.5px; }
.swap-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.swap-box:focus-within { border-color: var(--brand); }
.swap-top, .swap-bot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.swap-bot .quick { margin-top: 0; }
.swap-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.swap-row input, .swap-row output { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: 700 28px var(--font); letter-spacing: -.02em; padding: 0; overflow: hidden; text-overflow: ellipsis; }
.pill { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); padding: 6px 12px 6px 6px; border-radius: 30px; font-weight: 700; white-space: nowrap; }
.swap-flip { display: grid; place-items: center; width: 40px; height: 40px; margin: -12px auto; position: relative; z-index: 2; border-radius: 12px; background: var(--surface); border: 4px solid var(--surface); box-shadow: 0 0 0 1px var(--border); font-size: 18px; color: var(--brand); }
.swap-flip:hover { transform: rotate(180deg); transition: transform .3s; }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin-bottom: 12px; }
.stats-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats-grid > div { min-width: 0; }
.stats-grid .small { display: block; }
.stats-grid b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
.card .stats-grid:has(+ .chart) { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ------------------------------------------------------------------ products */
.product { display: flex; flex-direction: column; }
.product .btn { margin-top: auto; }
.prod-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.prod-h > div { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.prod-apr { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin: 12px 0 2px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.prod-apr span { font-size: 13px; font-weight: 600; margin-left: 6px; color: var(--text-2); -webkit-text-fill-color: var(--text-2); }
.est { min-height: 20px; color: var(--text-2); }
.harvest { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.harvest b { display: block; font-size: 18px; }
.harvest .small { display: block; }
.stack-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; margin-bottom: 12px; }
.stack-bar span { display: block; height: 100%; }
.steps { padding-left: 20px; margin: 0 0 12px; }
.steps li { margin-bottom: 8px; color: var(--text-2); }
.steps b { color: var(--text); }

/* ------------------------------------------------------------------ lending */
.hf-card .stats-grid { margin-top: 16px; }
.hf-big { font-size: 44px; font-weight: 800; letter-spacing: -.03em; line-height: 1; margin-bottom: 14px; }
.hf-ok { color: var(--up); }
.hf-warn { color: var(--warn); }
.hf-bad { color: var(--down); }
.hf-gauge { position: relative; height: 10px; border-radius: 10px; background: linear-gradient(90deg, var(--down), var(--warn) 25%, var(--up) 50%, var(--up)); }
.hf-gauge span { position: absolute; top: -4px; width: 4px; height: 18px; border-radius: 3px; background: var(--text); transform: translateX(-50%); box-shadow: 0 0 0 2px var(--surface); }
.hf-scale { display: flex; justify-content: space-between; margin-top: 6px; }

/* ------------------------------------------------------------------ academy */
.academy-hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 16%, var(--surface)), var(--surface) 60%); }
.academy-hero h2 { margin-bottom: 8px; }
.lvl-badge { width: 64px; height: 64px; border-radius: 18px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-size: 28px; font-weight: 800; display: grid; place-items: center; flex: none; }
.hero-stats { display: flex; gap: 22px; }
.hero-stats b { display: block; font-size: 20px; }
.mission { display: flex; align-items: center; gap: 12px; }
.mission p { margin: 2px 0 4px; }
.mission.claimed { opacity: .6; }
.mission.done { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow); }
.done-ic { width: 28px; height: 28px; border-radius: 50%; background: color-mix(in srgb, var(--up) 18%, transparent); color: var(--up); display: grid; place-items: center; font-weight: 800; flex: none; }
.done-ic.sm { width: 22px; height: 22px; font-size: 12px; position: absolute; top: 12px; right: 12px; }
.lesson { position: relative; text-align: left; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; cursor: pointer; transition: .15s; }
.lesson:hover { border-color: var(--brand); transform: translateY(-2px); }
.l-ic { font-size: 26px; }
.l-ic.big { font-size: 40px; display: block; margin-bottom: 6px; }
.lesson-modal h2 { margin: 8px 0 12px; }
.lesson-body { color: var(--text-2); font-size: 14.5px; }
.lesson-body b { color: var(--text); }
.lesson-body ul { padding-left: 20px; }
.lesson-body li { margin-bottom: 6px; }
.quiz { background: var(--surface-2); border-radius: 14px; padding: 16px; margin-top: 16px; }
.quiz h4 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; font-weight: 500; }
.opt:hover:not(:disabled) { border-color: var(--brand); }
.opt.right { border-color: var(--up); background: color-mix(in srgb, var(--up) 12%, var(--surface)); }
.opt.wrong { border-color: var(--down); background: color-mix(in srgb, var(--down) 12%, var(--surface)); }
.opt:disabled { cursor: default; }
.glossary { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 4px 24px; }
.glossary div { padding: 8px 0; border-bottom: 1px solid var(--border); }
.glossary dt { font-weight: 700; }
.glossary dd { margin: 2px 0 0; color: var(--text-2); font-size: 13px; }

/* ------------------------------------------------------------------ toasts */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; box-shadow: 0 12px 32px rgba(0,0,0,.3); animation: tin .25s ease-out; transition: .3s; }
.toast.out { opacity: 0; transform: translateX(20px); }
@keyframes tin { from { opacity: 0; transform: translateY(10px); } }
.toast b { display: block; font-size: 13.5px; }
.toast p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-2); }
.toast > div { flex: 1; min-width: 0; }
.toast-ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; flex: none; }
.toast-good .toast-ic { background: var(--up); }
.toast-bad .toast-ic { background: var(--down); }
.toast-warn .toast-ic { background: var(--warn); }
.toast-info .toast-ic { background: var(--info); }
.toast-x { background: none; border: 0; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 2px; }

/* ------------------------------------------------------------------ modal */
.modal { display: none; position: fixed; inset: 0; z-index: 90; align-items: center; justify-content: center; padding: 16px; }
.modal.open { display: flex; }
.modal-back { position: absolute; inset: 0; background: rgba(5, 8, 14, .6); backdrop-filter: blur(4px); }
.modal-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 24px; width: min(460px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 24px 64px rgba(0,0,0,.4); animation: tin .2s ease-out; }
.modal-card.wide { width: min(620px, 100%); }
.modal-card h3 { margin-bottom: 10px; font-size: 17px; }
.modal-x { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 8px; background: var(--surface-2); border: 0; font-size: 20px; color: var(--text-2); }
.onb { text-align: center; }
.onb .field { text-align: left; }
.onb-logo { display: flex; justify-content: center; margin-bottom: 10px; }
.onb h2 { font-size: 24px; margin-bottom: 8px; }
.onb-bal { display: flex; gap: 12px; justify-content: center; margin: 16px 0; }
.onb-bal > div { flex: 1; max-width: 200px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.onb-bal b { font-size: 22px; }
.scen-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.scen-opt { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 10px 12px; cursor: pointer; color: var(--text) !important; }
.scen-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.scen-opt input { accent-color: var(--brand); margin-top: 3px; }
.scen-opt b, .scen-opt .small { display: block; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-2-1, .g-1-2, .g-1-1-1 { grid-template-columns: minmax(0, 1fr); }
  .g-1-1-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-1-1-1 > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 980px) {
  .g-swap, .g-1-1 { grid-template-columns: minmax(0, 1fr); }
  .g-swap .swap-card { max-width: 560px; width: 100%; justify-self: center; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-100%); transition: transform .25s; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .sidebar.open { transform: none; }
  .menu { display: grid; }
  .topbar { padding: 10px 16px; gap: 10px; }
  .tb-left { min-width: 0; flex: 1; }
  .tb-clock { order: 3; flex-basis: 100%; justify-content: flex-start; }
  .view { padding: 16px 16px 40px; }
}
@media (max-width: 640px) {
  .g-1-1-1 { grid-template-columns: minmax(0, 1fr); }
  .kpi-val { font-size: 20px; }
  .topbar { position: static; }
  .tb-right { order: 4; flex-basis: 100%; justify-content: space-between; }
  .clock { flex: 1 1 100%; }
  .tb-clock .seg button { padding: 6px 9px; }
  .stats-grid.three, .card .stats-grid:has(+ .chart) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scen-pick { grid-template-columns: minmax(0, 1fr); }
  .missions { grid-template-columns: minmax(0, 1fr); }
  .hero-stats { width: 100%; justify-content: space-around; }
  .swap-row input, .swap-row output { font-size: 24px; }
  h1 { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
