/* Gráficas, portada en directo y detalles comunes (cargado desde partials/head-extra). */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-top: 10px; }
.chart-card { background: var(--surface, #fff); border: 1px solid var(--line, #e3e6ec); border-radius: 18px; padding: 18px 20px 14px; min-width: 0; }
.chart-card h3 { margin: 0; font-size: 1.05rem; }
.chart-card .sub { margin: 2px 0 10px; color: #6b6890; font-size: .88rem; }
.ch { width: 100%; height: auto; display: block; overflow: visible; }
.ch-grid { stroke: #ECE8F6; stroke-width: 1; }
.ch-x, .ch-y { fill: #7d7aa0; font-size: 11px; }
.ch-bar { transition: opacity .15s; } .ch-bar:hover { opacity: .8; }
.ch-dot { transition: r .15s; } .ch-dot:hover { r: 7; }
.ch-slice { transition: stroke-width .15s; } .ch-slice:hover { stroke-width: 7.5; }
.ch-donut { max-width: 190px; margin: 0 auto; }
.ch-total { font-size: 5.2px; font-weight: 800; fill: #1C1640; }
.ch-empty { padding: 36px 8px; text-align: center; color: #8a85ad; font-size: .92rem; }
.ch-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; margin: 8px 0 0; padding: 0; font-size: .85rem; color: #4a4670; }
.ch-legend li { display: flex; align-items: center; gap: 6px; }
.ch-legend span { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* Portada: Trade en directo */
.live-search { display: flex; gap: 8px; max-width: 520px; margin: 0 0 20px; }
.live-search input { margin: 0; }
.live-rail-wrap { position: relative; }
.live-rail { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 14px; scrollbar-width: thin; }
.live-rail .tr-card { flex: 0 0 200px; scroll-snap-align: start; }
.rail-btn { position: absolute; top: 40%; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line, #e3e6ec); background: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; box-shadow: 0 4px 14px rgba(20, 30, 60, .15); }
.rail-btn[data-dir="-1"] { left: -14px; } .rail-btn[data-dir="1"] { right: -14px; }
.rail-btn:hover { background: #F5F3FB; }
.live-stats { display: flex; flex-wrap: wrap; gap: 14px 34px; list-style: none; margin: 22px 0 0; padding: 0; color: #4a4670; }
.live-stats strong { display: block; font-size: 1.9rem; letter-spacing: -0.03em; color: #1C1640; }
@media (max-width: 700px) { .rail-btn { display: none; } }

/* ===== Trade: portada del mercado ===== */
.tr-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 30px; align-items: center; padding: 38px 36px; margin: 8px 0 22px; border-radius: 26px; background: radial-gradient(circle at 85% 10%, #8B5CF6 0%, transparent 45%), radial-gradient(circle at 10% 100%, #06B6D4 0%, transparent 40%), linear-gradient(135deg, #1C1640 0%, #3A33F2 100%); color: #fff; overflow: hidden; position: relative; }
.tr-hero h1 { margin: 4px 0 10px; font-size: clamp(1.8rem, 4.2vw, 2.9rem); letter-spacing: -0.035em; line-height: 1.08; }
.tr-kicker { margin: 0; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 800; opacity: .85; }
.tr-lead { margin: 0 0 18px; opacity: .92; max-width: 52ch; font-size: 1.08rem; }
.tr-herosearch { display: flex; gap: 8px; align-items: center; background: #fff; border-radius: 16px; padding: 6px 6px 6px 14px; max-width: 560px; box-shadow: 0 14px 34px rgba(0, 0, 0, .25); }
.tr-herosearch input[type=search] { border: 0; margin: 0; background: transparent; flex: 1; min-width: 0; box-shadow: none; outline: none; }
.tr-hero .tr-chip { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .35); color: #fff; }
.tr-hero .tr-chip:hover { background: #fff; color: #1C1640; }
.tr-herocards { position: relative; min-height: 260px; }
.tr-herocards .hc { position: absolute; width: 150px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 14px; box-shadow: 0 16px 36px rgba(0, 0, 0, .4); background: #fff; animation: trfloat 6s ease-in-out infinite; }
.tr-herocards .hc1 { left: 4%; top: 18%; transform: rotate(-9deg); }
.tr-herocards .hc2 { left: 32%; top: 0; transform: rotate(3deg); animation-delay: -2s; z-index: 2; }
.tr-herocards .hc3 { left: 58%; top: 22%; transform: rotate(11deg); animation-delay: -4s; }
@keyframes trfloat { 50% { translate: 0 -10px; } }
@media (prefers-reduced-motion: reduce) { .tr-herocards .hc { animation: none; } }
@media (max-width: 820px) { .tr-hero { grid-template-columns: 1fr; padding: 26px 20px; } .tr-herocards { display: none; } }
.tr-statsband { margin: 0 0 8px; padding: 18px 22px; background: var(--surface, #fff); border: 1px solid var(--line, #e3e6ec); border-radius: 18px; justify-content: space-around; }
.tr-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.tr-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 20px 14px; border-radius: 18px; background: var(--surface, #fff); border: 1px solid var(--line, #e3e6ec); text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.tr-tile:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(58, 51, 242, .16); border-color: #3A33F2; }
.tr-tile img { height: 56px; width: auto; max-width: 140px; object-fit: contain; }
.tr-tile span { color: #6b6890; font-size: .88rem; }
.tr-empty { padding: 34px 24px; text-align: center; border: 2px dashed #CBD0DF; border-radius: 20px; background: var(--surface, #fff); }
.tr-empty p { margin: 6px 0 14px; color: #5a6075; }
.tr-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.tr-steps li { background: var(--surface, #fff); border: 1px solid var(--line, #e3e6ec); border-radius: 18px; padding: 18px 20px; }
.tr-steps li span { display: inline-flex; width: 32px; height: 32px; border-radius: 50%; background: #3A33F2; color: #fff; align-items: center; justify-content: center; font-weight: 800; margin-bottom: 8px; }
.tr-steps p { margin: 4px 0 0; color: #5a6075; font-size: .93rem; }

/* ===== Portada de la web ===== */
.hero-search { display: flex; gap: 8px; margin-top: 20px; max-width: 480px; }
.hero-search input { margin: 0; }
.band { background: linear-gradient(90deg, #1C1640, #3A33F2); color: #fff; padding: 26px 0; }
.band .live-stats { margin: 0; justify-content: space-around; color: #E4E0FA; }
.band .live-stats strong { color: #fff; }
.home-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin: 18px 0 8px; }
.home-block { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 34px; align-items: center; }
.home-block .tile-box { background: #F5F3FB; border-radius: 22px; padding: 22px; }
@media (max-width: 820px) { .home-block { grid-template-columns: 1fr; } }
