:root {
  --ink:#172622; --dark:#101e1b; --cream:#f2f0e7; --paper:#faf9f4;
  --muted:#55645d; --brass:#9c7b3c; --line:#d8d8cb; --white:#fff;
  font-family:Arial,Helvetica,sans-serif; color:var(--ink); color-scheme:light;
}
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; height:100vh; height:100dvh; display:grid; grid-template-columns:minmax(0,1fr); overflow:hidden; grid-template-rows:auto minmax(0,1fr) 28px; background:var(--dark); }
button,select,input { font:inherit; }
button,select { min-height:33px; padding:5px 10px; background:var(--paper); border:1px solid var(--line); border-radius:5px; color:var(--ink); }
button { cursor:pointer; font-weight:600; }
button:hover:not(:disabled) { background:#e8e4d7; }
button:focus-visible, select:focus-visible, a:focus-visible, input:focus-visible { outline:2px solid #1a71be; outline-offset:2px; }
button:disabled { cursor:default; opacity:.48; }
button[aria-expanded="true"], button[aria-pressed="true"] { background:var(--ink); color:var(--white); border-color:var(--ink); }
button[aria-expanded="true"]:hover, button[aria-pressed="true"]:hover { background:#31463c; }
.viewer-toolbar { min-width:0; background:var(--cream); border-bottom:1px solid var(--line); box-shadow:0 2px 8px #101e1b2e; z-index:3; }
.viewer-header-row { min-height:51px; display:flex; justify-content:space-between; align-items:center; gap:10px; padding:2px 12px; }
.viewer-heading, .viewer-actions { display:flex; align-items:center; gap:8px; min-width:0; }
.viewer-wordmark { flex:none; width:134px; height:auto; max-width:47vw; }
h1 { display:flex; align-items:center; gap:6px; min-width:0; font:400 20px/1 Georgia,"Times New Roman",serif; margin:0; }
.viewer-subtitle { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.viewer-actions button { min-width:34px; padding:4px; }
.viewer-brand { display:flex; align-items:center; justify-content:center; gap:14px; background:var(--dark); color:#efeede; padding:2px 10px; font-size:13px; }
.viewer-brand a { color:#f2e4b8; font:700 14px/1.2 Georgia,"Times New Roman",serif; text-decoration:none; letter-spacing:.015em; }
.frame-stage { position:relative; min-height:0; overflow:hidden; background:#d9d6c8; }
#mapa { position:absolute; inset:0; }
#mapa .cesium-widget-errorPanel { background:#172622ef; }
.entrada { position:absolute; inset:0; z-index:5; background:#172622; color:#efeede; display:grid; place-content:center; justify-items:center; text-align:center; padding:1rem; gap:12px; font:18px Georgia,"Times New Roman",serif; }
.controles { position:absolute; top:10px; bottom:10px; left:12px; width:min(450px, calc(100% - 24px)); display:flex; flex-direction:column; align-items:flex-start; pointer-events:none; z-index:2; }
.tabs,.zoom { display:flex; gap:4px; }
.tabs { align-items:center; flex-wrap:wrap; column-gap:12px; padding:5px 12px 7px; border-top:1px solid #dfdace; }
.route-tabs,.map-tabs { display:flex; align-items:center; gap:4px; max-width:100%; }
.map-tabs { flex-wrap:wrap; }
.zoom { padding:4px; border:1px solid var(--line); background:var(--cream); border-radius:7px; box-shadow:0 2px 9px #101e1b2e; }
.tabs button,.camera-panel button,.camera-panel select { font-size:13px; white-space:nowrap; }
.panel { background:var(--paper); border:1px solid var(--line); border-radius:7px; width:100%; max-width:410px; max-height:min(100%,45dvh,360px); overflow:auto; padding:12px; box-shadow:0 2px 9px #101e1b2e; pointer-events:auto; }
.panel select,.panel input[type=range] { width:100%; }
.label { display:block; font-weight:700; font-size:13px; margin-bottom:6px; }
.detalle,.range-extremos { font-size:12px; line-height:1.4; color:var(--muted); margin:6px 0 0; }
.detalle:empty { display:none; }
.range-label,.range-extremos,.panel-buttons { display:flex; justify-content:space-between; gap:8px; }
.range-label output { font-size:13px; font-variant-numeric:tabular-nums; }
input[type=range] { margin:2px 0; accent-color:#435a4c; }
.panel-buttons { justify-content:flex-start; }
.panel-buttons button { font-size:13px; }
#gps-toggle[aria-pressed="true"] { background:#155eb5; border-color:#155eb5; }
#gps-toggle::before { content:""; display:inline-block; margin-right:6px; width:8px; height:8px; border-radius:50%; background:#318bed; border:1px solid #d9eeff; }
.fuentes ol { list-style:none; padding:0; margin:0; }
.fuentes li { font-size:13px; line-height:1.36; padding:7px 0; border-bottom:1px solid var(--line); }
.fuentes li:first-child { padding-top:0; }
.fuentes li:last-child { border:0; padding-bottom:0; }
.fuentes li span { display:block; color:var(--muted); }
.fuentes a, .acerca a { color:inherit; text-underline-offset:2px; }
.fuentes a { font-weight:700; }
.zoom { position:absolute; bottom:52px; right:12px; flex-direction:column; z-index:1; }
.zoom button { width:34px; padding:3px; font-size:19px; }
#norte { font:700 14px Georgia,"Times New Roman",serif; color:#685021; }
#estado { position:absolute; left:50%; bottom:28px; transform:translateX(-50%); width:max-content; max-width:calc(100% - 120px); padding:8px 11px; margin:0; border:1px solid var(--line); border-radius:5px; background:var(--paper); color:var(--ink); font-size:12px; z-index:3; }
dialog { width:min(90vw,430px); padding:20px; background:var(--paper); color:var(--ink); border:1px solid var(--brass); border-radius:8px; }
dialog::backdrop { background:#101e1b91; }
dialog h2 { margin:0 0 12px; font:700 24px Georgia,"Times New Roman",serif; }
dialog p { font-size:14px; line-height:1.5; }
dialog form { text-align:right; }
.solo-lectura { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
@media (max-width:820px) {
  .zoom { bottom:55px; right:8px; }
  .controles { top:8px; bottom:8px; left:8px; width:min(450px, calc(100% - 16px)); }
}
@media (max-width:600px) {
  body { grid-template-rows:auto minmax(0,1fr) 36px; }
  .viewer-header-row { min-height:42px; padding:1px 8px; }
  .viewer-wordmark { width:112px; }
  .viewer-brand { flex-direction:column; gap:1px; font-size:12px; line-height:1.2; }
  .viewer-brand a { font-size:12px; }
  .tabs { flex-direction:column; align-items:stretch; gap:3px; padding:4px 8px 1px; }
  .route-tabs { gap:4px; }
  .map-tabs { flex-wrap:nowrap; overflow-x:auto; overscroll-behavior-inline:contain; scrollbar-width:thin; scrollbar-color:#a698ab transparent; padding-bottom:2px; }
  .tabs button, .camera-panel button, .camera-panel select { font-size:12px; padding:5px 8px; min-height:39px; }
  .tabs button { flex:none; }
}
@media (max-width:359px) {
  .tabs button { font-size:11px; padding-inline:5px; }
  h1 { font-size:17px; }
}
#mapa.leaflet-container { background:#ddd8ca; font-family:Arial,Helvetica,sans-serif; }
#mapa .leaflet-tile-pane img { image-rendering:auto; }
#mapa { z-index:0; }

.camera-view,.camera-bottom { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:6px; }
.camera-view { border-bottom:1px solid var(--line); padding-bottom:9px; }
.camera-controls { display:grid; grid-template-columns:1fr 1fr; gap:10px; padding:10px 0; }
.camera-section h3 { margin:0 0 5px; font-size:12px; }
.camera-buttons { display:flex; flex-wrap:wrap; gap:3px; }
.camera-buttons button { min-width:32px; padding-inline:7px; }
.camera-controls button { font-size:17px; line-height:1; }
.camera-bottom { padding-top:7px; border-top:1px solid var(--line); }
.acerca { max-width:450px; max-height:min(100%,58dvh,540px); }
.about-heading { display:flex; align-items:center; gap:9px; padding-bottom:8px; border-bottom:1px solid var(--line); }
.about-heading h2 { margin:0 0 3px; font:700 19px/1.1 Georgia,"Times New Roman",serif; }
.about-heading p,.acerca dd,.acerca address { margin:0; font-size:13px; line-height:1.4; }
.about-heading p,.acerca dd { color:var(--muted); }
.acerca h3 { margin:11px 0 5px; font-size:14px; }
.acerca address { display:grid; gap:2px; font-style:normal; overflow-wrap:anywhere; }
.about-author { display:grid; grid-template-columns:clamp(70px, 18vw, 94px) minmax(0, 1fr); align-items:center; gap:12px; }
.about-author img { display:block; width:100%; height:auto; border:1px solid var(--line); border-radius:7px; }
.acerca dl { margin:0; }
.acerca dt { font-size:13px; font-weight:700; margin:8px 0 2px; }
.engine-credit { margin-top:10px; color:var(--muted); font-size:11px; }
.engine-credit:empty { display:none; }
.engine-credit .cesium-credit-textContainer { display:none; }
.atribucion-pnoa { position:absolute; bottom:0; right:0; z-index:1; min-height:0; padding:3px 7px; border:0; border-radius:4px 0 0 0; background:#faf9f4ed; font-size:10px; font-weight:400; line-height:1.25; }
@media (max-width:420px) {
  .camera-controls { gap:6px; }
  .camera-buttons button { min-width:28px; padding-inline:5px; }
  .camera-controls button { font-size:16px; }
}
.relieve-panel .label[for="terreno"] { margin-top:12px; }

.instalar-panel h2 { margin:0 0 8px; font:700 20px Georgia,"Times New Roman",serif; }
#instalar-boton { margin-top:10px; }
#instalar-instrucciones ol { margin:7px 0; padding-left:20px; }
#instalar-instrucciones li { margin:5px 0; }
.fuentes .source-extra { display:block; font-size:12px; font-weight:400; margin-top:3px; }
