/* ================================================================== */
/* Atlas Studio V6 — módulo Ciencias de la Tierra (sísmico y geológico) */
/* ================================================================== */

/* ---------- Panel izquierdo ---------- */
.earth-panel { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; }
.earth-kicker { display: flex; align-items: center; gap: 7px; color: var(--aqua); font: 800 10px Manrope, sans-serif; letter-spacing: .13em; text-transform: uppercase; }
.earth-kicker svg { width: 14px; height: 14px; }
.earth-label { display: block; color: var(--muted); font-size: 12px; font-weight: 600; margin: 12px 0 7px; }
.earth-panel .switch-row { margin-top: 9px; padding: 8px 9px; border: 1px solid rgba(157,190,205,.09); background: rgba(255,255,255,.018); border-radius: 9px; }
.earth-panel .switch-row span { min-width: 0; }
.earth-panel .switch-row small { line-height: 1.3; }
.earth-refresh { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; }
.earth-btn { min-height: 32px; padding: 0 11px; font-size: 12px; flex: none; }
.earth-btn svg { width: 14px; }
.earth-btn.loading svg { animation: spin .9s linear infinite; }
.earth-updated { color: var(--muted-2); font-size: 10.5px; line-height: 1.35; }
.earth-updated strong { color: var(--ink); font-weight: 700; }
.earth-hint { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 2px; padding: 9px 10px; border-radius: 10px; background: rgba(73,214,197,.07); border: 1px solid rgba(73,214,197,.2); color: #bfe9e3; font-size: 11.5px; line-height: 1.4; }
.earth-hint svg { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--aqua); }

/* Tarjetas */
.earth-card { margin-top: 12px; padding: 11px 11px 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: linear-gradient(180deg, rgba(20,44,60,.75), rgba(9,24,36,.9)); box-shadow: 0 10px 26px rgba(0,0,0,.28); animation: earthCardIn .22s ease-out; }
@keyframes earthCardIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.earth-card header { display: flex; align-items: center; gap: 10px; }
.earth-card header > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.earth-card header strong { font-size: 12.5px; line-height: 1.25; }
.earth-card header small { color: var(--muted); font-size: 10.5px; }
.earth-card-bar { justify-content: space-between; color: var(--muted); font: 800 9.5px Manrope, sans-serif; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 8px; }
.earth-card-bar span { display: inline-flex; align-items: center; gap: 6px; }
.earth-card-bar svg { width: 13px; height: 13px; color: var(--gold); }
.earth-close { flex: none; width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--muted); display: grid; place-items: center; cursor: pointer; padding: 0; }
.earth-close:hover { color: var(--ink); background: rgba(255,255,255,.08); }
.earth-close svg { width: 14px; height: 14px; }
.earth-card dl { margin: 10px 0 0; display: grid; gap: 5px; }
.earth-card dl > div { display: grid; grid-template-columns: 74px 1fr; gap: 7px; font-size: 11px; line-height: 1.35; }
.earth-card dt { color: var(--muted-2); font-weight: 600; }
.earth-card dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.earth-link { margin-top: 11px; width: 100%; min-height: 34px; font-size: 12px; color: #06201e; background: var(--aqua); border-color: transparent; font-weight: 800; text-decoration: none; }
.earth-link:hover { background: #67e1d3; }
.earth-link svg { width: 14px; }
.earth-empty, .earth-loading { margin: 8px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.earth-loading { display: flex; align-items: center; gap: 8px; }

/* Insignia de magnitud */
.earth-mag { --c: #ff6a3d; flex: none; min-width: 34px; height: 24px; padding: 0 6px; border-radius: 7px; display: inline-grid; place-items: center; font: 800 12px Manrope, sans-serif; color: #0b1116; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255,255,255,.35), 0 0 12px color-mix(in srgb, var(--c) 45%, transparent); }
.earth-mag.big { min-width: 46px; height: 38px; font-size: 17px; border-radius: 10px; }

/* Nota educativa */
.earth-edu { margin-top: 12px; padding: 11px 12px; border-radius: 12px; background: linear-gradient(160deg, rgba(242,184,75,.12), rgba(242,184,75,.03)); border: 1px solid rgba(242,184,75,.28); font-size: 11.3px; line-height: 1.5; color: #e3dccb; }
.earth-edu strong { display: flex; align-items: center; gap: 7px; color: var(--gold); font: 800 12px Manrope, sans-serif; margin-bottom: 4px; }
.earth-edu strong svg { width: 15px; height: 15px; }
.earth-edu p { margin: 5px 0 0; }
.earth-edu b { color: #fff3d6; }

/* Estadísticas */
.earth-stats, .earth-timescale { margin-top: 14px; }
.earth-stats-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.earth-stats-head strong { font: 800 12px Manrope, sans-serif; }
.earth-stats-head small { color: var(--muted-2); font-size: 10px; text-align: right; }
.earth-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.earth-kpis div { padding: 8px 7px; border-radius: 9px; background: rgba(255,255,255,.03); border: 1px solid var(--line); display: grid; gap: 2px; min-width: 0; }
.earth-kpis span { color: var(--muted-2); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.earth-kpis strong { color: var(--gold); font: 800 14px Manrope, sans-serif; white-space: nowrap; }
.earth-depthbar { display: flex; height: 7px; border-radius: 99px; overflow: hidden; margin-top: 10px; background: rgba(255,255,255,.05); gap: 2px; }
.earth-depthbar-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; color: var(--muted); font-size: 10px; }
.earth-depthbar-legend span { display: inline-flex; align-items: center; gap: 4px; }
.earth-depthbar-legend i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.earth-hist-title { margin: 12px 0 5px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.earth-hist svg { width: 100%; height: auto; display: block; }
.earth-hist .tick { fill: var(--muted-2); font: 600 8.5px "DM Sans", sans-serif; }
.earth-hist .count { fill: var(--muted); font: 700 8px "DM Sans", sans-serif; }
.earth-hist .axis { stroke: rgba(157,190,205,.3); }
.earth-top { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.earth-top button { width: 100%; display: flex; align-items: center; gap: 9px; padding: 6px 7px; border-radius: 9px; border: 1px solid var(--line); background: rgba(255,255,255,.02); color: var(--ink); cursor: pointer; text-align: left; transition: .15s ease; }
.earth-top button:hover, .earth-top button:focus-visible { border-color: rgba(73,214,197,.45); background: rgba(73,214,197,.07); }
.earth-top-text { min-width: 0; display: grid; gap: 1px; }
.earth-top-text strong { font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.earth-top-text small { color: var(--muted-2); font-size: 10px; }

/* Unidad geológica */
.earth-unit-head { display: flex; gap: 10px; align-items: center; }
.earth-unit-head .swatch { width: 30px; height: 30px; border-radius: 8px; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25), 0 0 0 1px rgba(255,255,255,.18); }
.earth-unit-head div { display: grid; gap: 2px; min-width: 0; }
.earth-unit-head strong { font-size: 12.5px; line-height: 1.25; }
.earth-unit-head small { color: var(--muted); font-size: 10.5px; }
.earth-volcano-head { display: flex; gap: 10px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.earth-volcano-head .tri { width: 0; height: 0; flex: none; margin-top: 3px; border-left: 9px solid transparent; border-right: 9px solid transparent; border-bottom: 15px solid #e8413c; filter: drop-shadow(0 0 5px rgba(232,65,60,.55)); }
.earth-volcano-head div { display: grid; gap: 2px; }
.earth-volcano-head strong { font-size: 12.5px; }
.earth-volcano-head small { color: var(--gold); font-size: 10.5px; }
.earth-volcano-head p { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.earth-desc { margin-top: 9px; font-size: 11px; color: var(--muted); }
.earth-desc summary { cursor: pointer; color: var(--aqua); font-weight: 600; }
.earth-desc p { margin: 6px 0 0; line-height: 1.45; }
.earth-ref { margin: 9px 0 0; color: var(--muted-2); font-size: 10px; line-height: 1.4; }
.earth-ref a { color: var(--aqua); }

/* Escala del tiempo */
.earth-periods { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.earth-periods li { display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 6px; font-size: 11px; color: #c6d6dd; border: 1px solid transparent; transition: .2s ease; }
.earth-periods .chip { width: 14px; height: 12px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
.earth-periods .age { color: var(--muted-2); font-size: 10px; font-variant-numeric: tabular-nums; }
.earth-periods li.hit { background: rgba(242,184,75,.12); border-color: rgba(242,184,75,.45); color: #fff; font-weight: 700; }
.earth-periods li.hit .age { color: var(--gold); }
.earth-footnote { margin: 8px 0 0; color: var(--muted-2); font-size: 9.5px; line-height: 1.4; }

/* ---------- Tooltip con varias líneas ---------- */
.tooltip.earth-tip { max-width: 290px; }
.tooltip.earth-tip small { white-space: pre-line; }

/* ---------- Capas del mapa ---------- */
.earth-pb-case { fill: none; stroke: rgba(3, 10, 16, .55); stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; pointer-events: none; }
svg[data-tone="light"] .earth-pb-case { stroke: rgba(255, 255, 255, .7); }
.earth-pb-line { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.earth-pb-line.cls-T { stroke-dasharray: 6 3; }
.earth-pb-line.cls-U { stroke-dasharray: 2 3; }
.earth-pb-teeth { stroke: none; pointer-events: none; }
.earth-pb-hit { fill: none; stroke: transparent; stroke-width: 10px; vector-effect: non-scaling-stroke; pointer-events: stroke; cursor: help; }
.earth-plate-label { fill: rgba(236, 244, 248, .62); font: italic 700 12px "DM Sans", sans-serif; letter-spacing: .16em; text-transform: uppercase; text-anchor: middle; paint-order: stroke; stroke: rgba(4, 12, 20, .72); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.earth-plate-label.rank-2 { font-size: 9.5px; letter-spacing: .12em; }
svg[data-tone="light"] .earth-plate-label { fill: rgba(40, 32, 30, .72); stroke: rgba(255, 252, 244, .8); }

/* Sismos */
.earth-quake { cursor: pointer; }
.earth-quake-dot { fill-opacity: .62; stroke: rgba(255, 255, 255, .85); stroke-width: .8; vector-effect: non-scaling-stroke; transition: fill-opacity .15s; }
.earth-quake:hover .earth-quake-dot { fill-opacity: .95; stroke: #fff; stroke-width: 1.6; }
.earth-quake.selected .earth-quake-dot { fill-opacity: .95; stroke: #ffd15d; stroke-width: 2.6; }
.earth-quake-pulse { display: none; fill: none; stroke-width: 1.6; vector-effect: non-scaling-stroke; pointer-events: none; }
.earth-quake.recent .earth-quake-pulse { display: inline; opacity: .8; transform: scale(1.7); transform-box: fill-box; transform-origin: center; }
.earth-quake.recent.animated .earth-quake-pulse { animation: earthPulse 2.4s cubic-bezier(.2, .6, .3, 1) infinite; }
@keyframes earthPulse {
  0% { transform: scale(1); opacity: .95; }
  100% { transform: scale(3.2); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .earth-quake.recent.animated .earth-quake-pulse { animation: none; }
  .earth-card { animation: none; }
}
.earth-nest-mark circle { fill: rgba(255, 210, 63, .08); stroke: #ffd23f; stroke-width: 1.4; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.earth-nest-mark text { fill: #ffe7a0; font: 700 10.5px "DM Sans", sans-serif; paint-order: stroke; stroke: rgba(4, 12, 20, .9); stroke-width: 3px; stroke-linejoin: round; }
.earth-nest-mark text.sub { fill: #cdd9df; font-weight: 500; font-size: 9px; }
.earth-nest-mark { cursor: help; }

/* Volcanes */
.earth-volcano { cursor: pointer; }
.earth-volcano-halo { fill: rgba(255, 255, 255, .85); }
svg[data-tone="dark"] .earth-volcano-halo { fill: rgba(4, 12, 20, .8); }
.earth-volcano-symbol { fill: #e8413c; stroke: #7a0f12; stroke-width: .8; stroke-linejoin: round; }
.earth-volcano.co .earth-volcano-symbol { fill: #f0312b; }
.earth-volcano:hover .earth-volcano-symbol { fill: #ff6a3d; }
.earth-volcano-label { fill: #3a0d0b; font-family: "DM Sans", sans-serif; font-weight: 700; paint-order: stroke; stroke: rgba(255, 252, 244, .92); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
svg[data-tone="dark"] .earth-volcano-label { fill: #ffd9cf; stroke: rgba(4, 12, 20, .92); }

/* Marcador de consulta geológica */
.earth-probe { pointer-events: none; }
.earth-probe .ring { fill: rgba(242, 184, 75, .16); stroke: #f2b84b; stroke-width: 2; }
.earth-probe .dot { fill: #fff; stroke: #1b242b; stroke-width: 1.2; }
.earth-probe .cross { stroke: #1b242b; stroke-width: 2.2; stroke-linecap: round; }
