/* The original G58 unit map, with its own clickable and keyboard markers. */
.geo-session .chapter-lesson[data-topic="G58"][data-step="1"] .chapter-model>.rock-distribution-model[data-g58-unit-map="true"]{
 display:grid;grid-template-rows:auto auto;gap:4px;align-items:stretch;
 box-sizing:border-box;width:100%;height:auto;min-height:0;overflow:visible;padding:4px;
}
.geo-session .chapter-lesson[data-topic="G58"][data-step="1"] [data-g58-unit-map="true"]>[data-rock-distribution-host]{
 flex:1 1 auto;height:auto;min-height:0;overflow:hidden;
}
.geo-session .chapter-lesson[data-topic="G58"][data-step="1"] [data-g58-map-course][data-compact="false"]{
 display:grid;grid-template-rows:auto minmax(180px,auto) auto auto;gap:6px;height:auto;min-height:0;
}
.geo-session .chapter-lesson[data-topic="G58"][data-step="1"] [data-g58-unit-map="true"] .g58-map-controls{display:flex;align-items:center;justify-content:center}
.geo-session .chapter-lesson[data-topic="G58"][data-step="1"] [data-g58-unit-map="true"] .g58-map-units,
.geo-session .chapter-lesson[data-topic="G58"][data-step="1"] [data-g58-unit-map="true"] .g58-map-controls>span{display:none}
.geo-session .chapter-lesson[data-topic="G58"][data-step="1"] [data-g58-unit-map="true"] .g58-map-legend{display:grid;color:var(--topic-ink,#243c3c)}
.geo-session .chapter-lesson[data-topic="G58"][data-step="1"] [data-g58-unit-map="true"] .g58-map-svg{
 width:100%;height:100%;min-height:0;overflow:hidden;
}
.geo-session .chapter-lesson[data-topic="G58"][data-step="1"] [data-g58-unit-map="true"] .g58-map-svg svg{
 display:block;width:100%!important;height:100%!important;max-height:100%;
}
.geo-session .chapter-lesson[data-topic="G58"][data-step="1"] [data-g58-unit-map="true"] .g58-map-caption{
 margin:0;color:var(--topic-ink,#294b49);font-size:14px;line-height:1.25;overflow-wrap:anywhere;
}
.geo-session .chapter-lesson[data-topic="G58"][data-step="1"] [data-g58-unit-map="true"] .g58-unit-buttons{
 display:flex;flex-wrap:wrap;justify-content:center;gap:4px;min-width:0;
}
.geo-session .chapter-lesson[data-topic="G58"][data-step="1"] .g58-unit-buttons button{
 display:grid;place-items:center;flex:1 0 44px;box-sizing:border-box;
 min-width:44px;min-height:44px;padding:0;border:1px solid #739da1;border-radius:10px;
 background:#fff;color:#23464b;font:600 16px/1 var(--font-sans);cursor:pointer;
}
.geo-session .chapter-lesson[data-topic="G58"][data-step="1"] .g58-unit-buttons button.chosen{
 background:#007d8d;border-color:#007d8d;color:#fff;
}
.geo-session .chapter-lesson[data-topic="G58"][data-step="1"] .g58-unit-buttons button:disabled{opacity:.5;cursor:default}
/* Expand original marker hit areas without inserting nodes into React's tree.
   Closest source anchors are 64.48 SVG units apart; r=20+12 gives 32 units. */
.geo-session .chapter-lesson[data-topic="G58"][data-step="1"] [data-g58-unit-map="true"] [data-unit-marker] circle{
 r:20px;stroke:transparent;stroke-width:24px;paint-order:stroke;pointer-events:all;
 filter:drop-shadow(0 0 1.5px #23464b);
}
.geo-session .chapter-lesson[data-topic="G58"][data-step="1"] [data-g58-unit-map="true"] [data-unit-marker] text{font-size:23px}

/* Keep the map, original lithology filter and legend readable on phones. */
@media(max-width:700px){
 .geo-session .chapter-lesson[data-topic="G58"][data-step="1"] .chapter-model:has([data-g58-unit-map="true"]){flex:0 0 auto;min-height:330px;height:auto;overflow:visible}
 .geo-session .chapter-lesson[data-topic="G58"][data-step="1"] [data-g58-map-course][data-compact="false"] .g58-map-svg{height:min(45vw,230px);min-height:180px}
 .geo-session .chapter-lesson[data-topic="G58"][data-step="1"] .g58-map-legend li{font-size:14px;line-height:1.35}
 .geo-session .chapter-lesson[data-topic="G58"][data-step="1"] .g58-map-controls label{font-size:14px;display:flex;align-items:center;gap:6px}
 .geo-session .chapter-lesson[data-topic="G58"][data-step="1"] .g58-map-controls select{min-height:40px;max-width:70vw}
 .geo-session .chapter-lesson[data-topic="G58"][data-step="1"] .g58-unit-buttons button:first-child{flex:1 0 64px}
}
