/* Geology mode (geology.js): sidebar legend, the 3D preview's rock legend
   and tap card, and the map popup. */

.tp-geo-legend { margin-bottom: 4px; }
.tp-geo-row { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.tp-geo-row:last-of-type { border-bottom: 0; }
.tp-geo-row-text { flex: 1 1 auto; min-width: 0; }
.tp-geo-row-top { display: flex; justify-content: space-between; gap: 8px; font-size: 0.78rem; color: #e6e9ec; line-height: 1.25; }
.tp-geo-row-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.tp-geo-row-pct { color: #9fb3b0; font-variant-numeric: tabular-nums; flex: none; }
.tp-geo-row-sub { font-size: 0.7rem; color: #9aa3ab; line-height: 1.3; margin-top: 1px; overflow-wrap: anywhere; }
.tp-geo-sw { display: inline-block; width: 18px; height: 18px; border-radius: 4px; flex: none; border: 1px solid rgba(255, 255, 255, 0.25); margin-top: 1px; }
.tp-geo-color { width: 26px; height: 20px; padding: 0; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 4px; background: none; flex: none; cursor: pointer; margin-top: 1px; }

/* Rock column stick under the middle of the model. */
.tp-geo-col { display: flex; flex-direction: column; border-radius: 6px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.15); margin: 4px 0 6px; }
.tp-geo-col-band { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 6px; min-height: 6px; font-size: 0.66rem; line-height: 1; color: #111; overflow: hidden; }
.tp-geo-col-band span, .tp-geo-col-band em { background: rgba(255, 255, 255, 0.72); border-radius: 3px; padding: 1px 3px; white-space: nowrap; font-style: normal; }
.tp-geo-col-band[style*="height:6px"] span, .tp-geo-col-band[style*="height:6px"] em,
.tp-geo-col-band[style*="height:7px"] span, .tp-geo-col-band[style*="height:7px"] em,
.tp-geo-col-band[style*="height:8px"] span, .tp-geo-col-band[style*="height:8px"] em,
.tp-geo-col-band[style*="height:9px"] span, .tp-geo-col-band[style*="height:9px"] em,
.tp-geo-col-band[style*="height:10px"] span, .tp-geo-col-band[style*="height:10px"] em,
.tp-geo-col-band[style*="height:11px"] span, .tp-geo-col-band[style*="height:11px"] em { display: none; }

/* 3D preview: legend + card, top left. */
.tp-geo-prev {
    position: absolute; top: 16px; left: 16px; z-index: 11; width: 290px; max-width: calc(100% - 32px);
    max-height: calc(100% - 120px); overflow: auto;
    background: rgba(18, 18, 18, 0.88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 12px; color: #e6e9ec; padding: 8px 10px; font-size: 0.8rem;
}
.tp-geo-prev[hidden] { display: none; }
.tp-geo-prev-head { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.82rem; }
.tp-geo-prev-head span { flex: 1 1 auto; }
.tp-geo-prev.folded .tp-geo-prev-body { display: none; }
.tp-geo-prev-hint { font-size: 0.72rem; color: #9aa3ab; margin-top: 4px; }
.tp-geo-prev-card { position: relative; margin-top: 8px; padding: 8px; border-radius: 9px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(47, 165, 150, 0.45); }
.tp-geo-prev-card[hidden] { display: none; }
.tp-geo-x { background: none; border: 0; color: #c9ced6; font-size: 1rem; line-height: 1; padding: 0 4px; cursor: pointer; }
.tp-geo-x:hover { color: #fff; }
.tp-geo-card-x { position: absolute; top: 4px; right: 4px; }
#previewBody.tp-adj-on .tp-geo-prev { display: none; }

/* Card text (preview and map popup). */
.tp-geo-card-head { display: flex; gap: 8px; align-items: flex-start; padding-right: 16px; }
.tp-geo-card-head .tp-geo-sw { width: 22px; height: 22px; }
.tp-geo-title { font-weight: 700; font-size: 0.9rem; line-height: 1.2; }
.tp-geo-line { font-size: 0.78rem; color: #b9e3dc; margin-top: 2px; line-height: 1.3; }
.tp-geo-prints { font-size: 0.74rem; color: #c9ced6; margin-top: 6px; }
.tp-geo-lith { font-size: 0.72rem; color: #9aa3ab; margin: 4px 0 0; }
.tp-geo-more { margin-top: 6px; font-size: 0.74rem; color: #c9ced6; }
.tp-geo-more summary { cursor: pointer; color: #6fd0c2; }
.tp-geo-more p { margin: 4px 0 0; line-height: 1.35; max-height: 160px; overflow: auto; }
.tp-geo-src { margin-top: 6px; font-size: 0.68rem; color: #8b949c; line-height: 1.3; overflow-wrap: anywhere; }
.tp-geo-src a { color: #8fd3c8; }

/* Map popup. */
.tp-geo-popup-wrap .maplibregl-popup-content { background: rgba(18, 18, 18, 0.94); color: #e6e9ec; border-radius: 10px; padding: 10px 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4); }
.tp-geo-popup-wrap .maplibregl-popup-tip { border-top-color: rgba(18, 18, 18, 0.94); border-bottom-color: rgba(18, 18, 18, 0.94); }
.tp-geo-popup-wrap .maplibregl-popup-close-button { color: #c9ced6; font-size: 18px; }

@media (max-width: 700px) {
    .tp-geo-prev { top: auto; bottom: 130px; left: 10px; right: 10px; width: auto; max-width: none; max-height: 45%; }
}
