/* Medidas compartidas. Cargar después de los estilos de cada página. */
:root{--layout-width:1320px;--layout-gutter:clamp(16px,3vw,40px);--layout-gap:20px}
*,*::before,*::after{box-sizing:border-box}
body{margin:0}
button,input,select,textarea{font:inherit}
img{max-width:100%}
main :is(h1,h2,h3){text-wrap:balance}
main :is(p,li,dd){overflow-wrap:break-word}
main :is(section,article,.panel,.card,.chartbox,.scorebox){min-width:0}
:is(button,a,input,select,textarea,summary):focus-visible{outline:3px solid var(--cmc-accent,var(--accent,#6188ff));outline-offset:4px}
:is(h1,h2,h3,section)[id]{scroll-margin-top:140px}

/* Una sola cabecera. La navegación común sigue disponible en pantallas pequeñas. */
html body:has(> .cmc-nav) > header.nc-mobile-shell.nc-mobile-shell{display:none!important}
.cmc-wrap,body.market-home .wrap{max-width:calc(var(--layout-width) + 2 * var(--layout-gutter));padding-inline:var(--layout-gutter)}
header.cmc-nav .cmc-wrap,body.market-home header.nav .wrap{gap:24px;min-height:76px}
.cmc-brand,body.market-home .brand{flex-shrink:0}
.cmc-links,body.market-home .links{gap:20px;align-items:center;scrollbar-width:thin;scroll-padding-inline:4px}
.cmc-nav .cmc-links a,body.market-home .links a{min-height:40px;display:inline-flex!important;align-items:center}
.cmc-theme,body.market-home .theme-btn{min-height:32px;flex-shrink:0}

/* Columna de trabajo: los artículos y el radar mantienen su composición particular. */
body[class*="cmc-p-"] > main:not(.main):not(.seo-article):not(.cmc-academia){width:calc(100% - 2 * var(--layout-gutter))!important;max-width:var(--layout-width)!important;margin-inline:auto!important;padding-inline:0!important;padding-top:32px;padding-bottom:64px}
body[class*="cmc-p-"] main :is(.intro,.hero)>p{line-height:1.75;max-width:72ch}
body[class*="cmc-p-"] :is(.analysis-grid,.horizons,.summary-grid){gap:var(--layout-gap)}
body[class*="cmc-p-"] :is(.panel,.scorebox,.chartbox,.workspace){border-radius:16px}
body[class*="cmc-p-"] :is(.section-head,.sectiontitle,.panel-head,.charthead){flex-wrap:wrap;gap:12px 20px}
body[class*="cmc-p-"] :is(.table-wrap,.allocation-table,.fc-tablewrap,.tabla){max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin}
body[class*="cmc-p-"] main :is(button,select){min-height:44px}
body.ficha-cmc .wrap{max-width:calc(var(--layout-width) + 2 * var(--layout-gutter))!important;padding-inline:var(--layout-gutter)!important}
.fc-grid{gap:32px;grid-template-columns:minmax(260px,320px) minmax(0,1fr)}
.fc-card{padding:24px}
.fc-side{top:100px}
.fc-tabs button{min-height:40px}
.fc-stats dd{overflow-wrap:anywhere}

/* Portada: resumen, buscador y tabla con una jerarquía estable. */
body.market-home{line-height:1.6}
body.market-home #contenido-principal{width:calc(100% - 2 * var(--layout-gutter));max-width:var(--layout-width);padding:0;margin-inline:auto}
body.market-home .head{padding:38px 0 8px}
body.market-home .head h1{font-size:clamp(27px,3.2vw,42px);line-height:1.16;letter-spacing:-.035em;max-width:26ch}
body.market-home .head p{max-width:88ch;font-size:14px;line-height:1.75;margin-top:14px}
body.market-home .cards{grid-template-columns:minmax(0,2fr) repeat(2,minmax(0,1fr));gap:20px;padding:24px 0 32px}
body.market-home .span2{grid-column:auto}
body.market-home .card{padding:22px;border-color:var(--line-strong);border-radius:16px;box-shadow:none}
body.market-home .card h3{gap:12px;align-items:baseline;line-height:1.45;margin-bottom:20px}
body.market-home .card h3 a{white-space:nowrap;flex-shrink:0}
body.market-home .mini.cols2{gap:10px 20px;align-items:stretch}
body.market-home .mini .row{grid-template-columns:16px minmax(0,1fr) auto;gap:7px;font-size:12px;min-height:42px;padding:5px 0;border-bottom:1px solid var(--line)}
body.market-home .mini .row .coin{min-width:0;gap:7px;overflow-wrap:anywhere;line-height:1.4}
body.market-home .mini .row .p{display:none}
body.market-home .mini .row>.num:last-child{white-space:nowrap}
body.market-home .gauge .y{line-height:1.5;text-align:center;margin-top:5px}
body.market-home .nina-card{grid-template-columns:1fr;gap:16px}
body.market-home .nina-card img{width:64px;height:64px;border-radius:50%}
body.market-home .nina-card p{font-size:14px;line-height:1.75}
body.market-home .card-foot{padding-top:16px;line-height:1.5}
body.market-home .market-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:14px}
body.market-home .market-toolbar h2{font-size:21px;letter-spacing:-.02em;margin:0}
body.market-home .market-toolbar .search{display:flex;min-height:44px;border:1px solid var(--line-strong);width:min(100%,300px)}
body.market-home .search input{width:100%;min-width:0;font-size:14px;min-height:28px}
body.market-home .search:focus-within{outline:2px solid var(--accent);outline-offset:3px}
body.market-home .tabs{padding-bottom:16px;gap:6px}
body.market-home .tab{min-height:44px;padding-inline:14px}
body.market-home .tbl-wrap{border:1px solid var(--line-strong);border-radius:14px;max-width:100%;overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:var(--fg-3) var(--bg-soft)}
body.market-home th{background:var(--bg-soft);padding-block:16px}
body.market-home td{padding-block:18px;font-size:13px}
body.market-home .table-help{font-size:12px;color:var(--fg-2);margin:10px 0 0}
body.market-home .src{font-size:12px;line-height:1.75;max-width:110ch}
body.market-home .section{padding-top:56px}
body.market-home .section h2{font-size:clamp(23px,2.4vw,30px);line-height:1.25}
body.market-home .about{padding:32px;gap:40px;grid-template-columns:minmax(0,1.25fr) minmax(0,.75fr)}
body.market-home .about img{height:340px;min-height:0;object-position:50% 25%}
body.market-home .about .lead{line-height:1.8}
body.market-home .tools{gap:20px}
body.market-home .tool{padding:24px;min-height:190px;border-radius:14px}
body.market-home .tool b{line-height:1.35}
body.market-home .guides a,body.market-home .btn{min-height:44px;display:inline-flex;align-items:center;justify-content:center}
body.market-home .disclaimer{margin-top:40px;line-height:1.8}
body.market-home footer a{color:var(--fg-2);text-underline-offset:4px}
body.market-home footer .legal-links{display:flex;gap:18px;flex-wrap:wrap}

/* Radar: sincronizar el ancho de la barra lateral y el inicio de la cabecera. */
@media(min-width:1201px){body:has(> aside.rail) > .cmc-strip,body:has(> aside.rail) > .cmc-nav{margin-left:218px!important}}
@media(min-width:981px) and (max-width:1200px){body:has(> aside.rail) > .cmc-strip,body:has(> aside.rail) > .cmc-nav{margin-left:183px!important}}
@media(min-width:701px) and (max-width:980px){body:has(> aside.rail) > .cmc-strip,body:has(> aside.rail) > .cmc-nav{margin-left:70px!important;margin-right:0!important}}
@media(max-width:700px){body:has(> aside.rail) > .cmc-strip,body:has(> aside.rail) > .cmc-nav{margin-inline:0!important}}

@media(max-width:1200px){
  header.cmc-nav .cmc-wrap,body.market-home header.nav .wrap{flex-wrap:wrap;gap:8px 20px}
  .cmc-links,body.market-home .links{order:3;flex-basis:100%;display:flex!important;gap:22px;padding-bottom:2px}
  .cmc-nav .cmc-cta,body.market-home .nav .cta{margin-left:auto!important}
  body.market-home .cards{grid-template-columns:repeat(2,minmax(0,1fr))}
  body.market-home .cards>.span2{grid-column:1/-1}
  body.market-home .mini .row{grid-template-columns:18px minmax(0,1fr) auto auto}
  body.market-home .mini .row .p{display:block;white-space:nowrap}
  body.market-home .nina-card{grid-template-columns:64px minmax(0,1fr)}
  .fc-side{top:150px}
}
@media(max-width:900px){
  .fc-grid{grid-template-columns:minmax(0,1fr)}
  .fc-side{position:static}
  body.market-home .tools{grid-template-columns:repeat(2,minmax(0,1fr))}
  body.market-home .about{gap:24px;padding:24px}
  body.market-home .about img{height:100%;max-height:420px}
  body.cmc-p-nina .map-layout{grid-template-columns:minmax(0,1fr)}
  body.cmc-p-nina .map-side{border-left:0;padding-left:0}
}
@media(max-width:600px){
  :root{--layout-gap:14px}
  header.cmc-nav .cmc-wrap,body.market-home header.nav .wrap{gap:6px 12px;min-height:0}
  .cmc-brand,body.market-home .brand{font-size:16px}
  .cmc-nav .cmc-cta,body.market-home .cta{font-size:12px!important;padding:10px 12px!important}
  .cmc-links,body.market-home .links{font-size:13px!important;gap:20px}
  body.market-home .head{padding-top:28px}
  body.market-home .cards{grid-template-columns:minmax(0,1fr);gap:14px;padding:20px 0 28px}
  body.market-home .card{padding:18px}
  body.market-home .mini.cols2{grid-auto-flow:row;grid-template-rows:none;grid-template-columns:minmax(0,1fr)}
  body.market-home .mini .row{font-size:13px}
  body.market-home .nina-card{grid-template-columns:56px minmax(0,1fr)}
  body.market-home .nina-card img{width:56px;height:56px}
  body.market-home .market-toolbar{align-items:stretch;gap:12px}
  body.market-home .market-toolbar .search{width:100%}
  body.market-home .tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow:visible}
  body.market-home .tab{white-space:normal;line-height:1.35;min-height:48px;font-size:13px;padding:10px}
  body.market-home .tbl-wrap th:nth-child(2),body.market-home .tbl-wrap td:nth-child(2){position:sticky;left:0;z-index:1;background:var(--bg);box-shadow:3px 0 0 var(--line)}
  body.market-home .tbl-wrap th:nth-child(2){z-index:3;background:var(--bg-soft)}
  body.market-home .tbl-wrap .coin{gap:7px}
  body.market-home .tbl-wrap .coin .s{display:none}
  body.market-home .section{padding-top:36px}
  body.market-home .about{grid-template-columns:minmax(0,1fr);padding:20px;gap:24px}
  body.market-home .about img{height:280px;aspect-ratio:4/3;object-position:50% 25%}
  body.market-home .tools{grid-template-columns:minmax(0,1fr);gap:12px}
  body.market-home .tool{min-height:0;padding:20px}
  body.market-home .btns{flex-direction:column;align-items:stretch}
  body.market-home .guides{gap:8px}
  body.market-home .guides a{font-size:13px}
  body[class*="cmc-p-"] > main:not(.main):not(.seo-article):not(.cmc-academia){padding-top:24px;padding-bottom:48px}
  body[class*="cmc-p-"] :is(.panel,.scorebox,.chartbox,.workspace){padding:18px}
  body.cmc-p-hodl-panel .metrics{grid-template-columns:minmax(0,1fr);gap:0}
  body.cmc-p-hodl-panel .metrics>div{grid-template-columns:minmax(0,1fr) auto;align-items:center;padding:12px 0;gap:12px}
  body.cmc-p-hodl-panel .metrics strong{font-size:20px}
  .fc-card{padding:18px}
  .fc-chart-head{align-items:flex-start}
  .fc-canvas{min-height:260px}
  .fc-stats dt,.fc-stats dd{font-size:13px!important}
  #volver-inicio{position:static!important;justify-content:center;margin:24px auto!important;flex-wrap:wrap}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}body.market-home .tool{transition:none}}
