:root{font-family:'DM Sans',system-ui,Arial,sans-serif;color-scheme:light;--bg:#f5f8fc;--panel:#fff;--panel-sub:#f3f7fc;--line:#e1e9f1;--text:#111e36;--muted:#73829a;--soft:#91a0b5;--blue:#1782ea;--sun:#ffad23;--shadow:0 8px 32px rgba(45,75,117,.045)}
*{box-sizing:border-box}html{background:var(--bg)}body{margin:0;background:var(--bg);color:var(--text);-webkit-font-smoothing:antialiased}button,input{font:inherit}button{cursor:pointer}a{color:inherit}.app-shell{min-height:100vh}
.topbar{height:82px;display:flex;align-items:center;justify-content:space-between;background:var(--panel);border-bottom:1px solid var(--line);padding:0 clamp(18px,3.2vw,58px);gap:12px}.brand-lockup{display:flex;align-items:center;gap:14px}.brand-mark{height:43px;width:43px;border-radius:14px;display:grid;place-items:center;background:linear-gradient(150deg,#fceac7,#fff8ee);color:#efa824}.brand-mark svg{height:27px;width:27px}.brand-top{font-weight:800;font-size:15px;letter-spacing:.5px;white-space:nowrap}.brand-dot{color:#8d9ab0}.brand-variant{font-weight:700;color:#3479bd}.brand-sub{font-size:11px;color:var(--muted);margin-top:3px}.top-controls{display:flex;align-items:center;gap:10px}.beta-label{font-size:10px;letter-spacing:.1em;color:#6994bc;background:#edf5fc;padding:9px 13px;border-radius:99px;font-weight:800;margin-right:8px}.icon-button{border:1px solid var(--line);background:var(--panel);color:var(--text);border-radius:11px;width:40px;height:40px;display:grid;place-items:center}.lang-button{font-weight:800;font-size:12px}.icon-button:hover,.nav-square:hover,.today-btn:hover,.quick-chip:hover{border-color:#87b9ed}
.app-grid{display:grid;grid-template-columns:minmax(335px,34%) minmax(0,66%);min-height:calc(100vh - 82px)}.sidebar{background:var(--panel);border-right:1px solid var(--line);padding:26px clamp(17px,2.1vw,36px);display:flex;flex-direction:column;gap:20px}.pane-header h1{margin:8px 0 9px;font-size:clamp(22px,1.9vw,29px);letter-spacing:-1px;line-height:1.15}.pane-header p{color:var(--muted);line-height:1.6;font-size:13px;margin:0;max-width:420px}.eyebrow{font-size:10px;font-weight:800;letter-spacing:.15em;color:#4592d3}.map-shell{height:min(48vh,490px);min-height:285px;border-radius:19px;overflow:hidden;position:relative;border:1px solid var(--line);background:#e9f2f9}.map-shell #map{height:100%;width:100%;}.map-hint{position:absolute;left:12px;bottom:14px;z-index:2;padding:10px 13px;background:rgba(255,255,255,.96);border-radius:10px;box-shadow:0 6px 20px rgba(23,64,101,.13);font-size:11px;color:#38536e;display:flex;gap:8px;align-items:center;font-weight:700;pointer-events:none}.pulse-dot,.small-dot{width:8px;height:8px;border-radius:50%;background:#2196f3;box-shadow:0 0 0 4px #e1f2ff;display:inline-block}.map-center{position:absolute;right:11px;top:12px;width:38px;height:38px;border:1px solid #d9e5f2;z-index:2;border-radius:11px;background:rgba(255,255,255,.96);color:#215e91;font-size:25px}.maplibregl-ctrl-bottom-right{bottom:0!important}
.location-details{border:1px solid var(--line);background:var(--panel-sub);padding:17px;border-radius:16px}.location-label{font-size:10px;display:flex;align-items:center;gap:10px;font-weight:800;letter-spacing:.12em;color:var(--muted)}.coords-large{font-size:18px;font-weight:800;margin-top:13px;line-height:1.1}.coords-secondary{font-size:12px;color:var(--muted);margin-top:6px;font-variant-numeric:tabular-nums}.location-form{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;align-items:end;margin-top:17px}.location-form label{display:flex;flex-direction:column;gap:5px;color:var(--muted);font-size:11px;font-weight:700;min-width:0}.location-form input{background:var(--panel);color:var(--text);min-width:0;width:100%;padding:11px 9px;border-radius:10px;border:1px solid var(--line);outline-color:var(--blue);font-size:12px}.button-action{border:0;background:var(--blue);color:white;padding:12px 13px;border-radius:10px;font-weight:700;font-size:11px}.sidebar-footer{margin-top:auto}.quick-label{font-size:10px;letter-spacing:.12em;color:var(--soft);font-weight:800;margin-bottom:12px}.quick-links{display:flex;flex-wrap:wrap;gap:7px}.quick-chip{padding:9px 11px;background:var(--panel-sub);border:1px solid var(--line);border-radius:10px;color:var(--text);font-size:12px;font-weight:700}.map-source{font-size:10px;color:var(--soft);margin-top:18px}
.main-panel{padding:27px clamp(18px,3vw,55px) 38px;max-width:1450px;width:100%;margin:0 auto}.content-heading{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:20px}.content-heading h2{font-size:clamp(28px,2.3vw,37px);font-weight:800;letter-spacing:-1.45px;margin:4px 0 5px}.location-description{font-size:12px;color:var(--muted)}.date-controls{display:flex;align-items:center;gap:6px}.date-controls input{height:39px;padding:0 9px;background:var(--panel);border:1px solid var(--line);border-radius:10px;color:var(--text);font-size:12px;min-width:126px}.nav-square,.today-btn{border:1px solid var(--line);background:var(--panel);border-radius:10px;height:39px;color:var(--text);font-weight:800}.nav-square{width:33px;font-size:24px;line-height:1}.today-btn{padding:0 12px;font-size:12px}.status-message{display:none;align-items:center;gap:8px;background:#ecf6ff;border:1px solid #c4e3fd;color:#21659a;border-radius:12px;padding:11px 15px;font-size:12px;margin-bottom:14px}.status-message.shown{display:flex}.status-message.error{background:#fff3f3;border-color:#f4cece;color:#a43737}.spinner{width:15px;height:15px;border-radius:50%;border:2px solid #acd2f5;border-top-color:#2987dc;animation:spin .8s linear infinite;flex-shrink:0}.status-message.error .spinner{display:none}@keyframes spin{to{transform:rotate(360deg)}}
.sky-card{background:var(--panel);box-shadow:var(--shadow);border:1px solid var(--line);border-radius:20px;margin-bottom:18px;padding:21px 24px 16px;min-width:0}.card-head{display:flex;align-items:center;gap:12px}.section-icon{width:50px;height:50px;border-radius:15px;display:grid;place-items:center;flex-shrink:0}.sun-icon{color:#f5ae28;background:#fff6e4}.moon-icon{color:#8095b4;background:#edf3fa}.card-heading h3{font-size:22px;letter-spacing:-.7px;line-height:1.15;margin:0}.card-heading p{color:var(--muted);font-size:12px;margin:5px 0 0}.metric-box{margin-left:auto;background:var(--panel-sub);border:1px solid var(--line);padding:10px 16px;border-radius:13px;min-width:160px;text-align:left}.metric-box div{font-size:9px;font-weight:800;color:var(--muted);letter-spacing:.11em}.metric-box strong{display:block;font-size:20px;margin:3px 0 1px;letter-spacing:-.6px}.metric-box span{font-size:11px;color:var(--muted)}
.events-row{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:10px 0 0;padding:0 max(18px,12%)}.event{display:flex;align-items:center;justify-content:center;gap:11px;min-width:0}.event-icon{font-size:29px;font-weight:800;line-height:1;color:#e8a12d}.event.moon-event .event-icon{color:var(--blue)}.event small{display:block;color:var(--muted);font-size:11px}.event strong{display:block;font-size:19px;letter-spacing:-.3px;line-height:1.1;margin-top:1px;font-variant-numeric:tabular-nums}.event.empty strong{font-size:14px;color:var(--muted)}
.trajectory-container{position:relative;width:100%;margin-top:5px;touch-action:pan-y}.trajectory-container svg{width:100%;height:auto;max-height:220px;min-height:140px;display:block;overflow:visible}.chart-tip{position:absolute;top:12px;padding:10px 13px;z-index:4;transform:translateX(-50%);border-radius:10px;background:#152841;color:white;font-size:11px;pointer-events:none;white-space:nowrap;box-shadow:0 6px 24px rgba(0,0,0,.16)}.chart-tip span{color:#bfd2e6}.card-footer{display:flex;align-items:center;flex-wrap:wrap;gap:16px;border-top:1px solid var(--line);padding-top:10px;color:var(--muted);font-size:10px}.card-footer>span{display:flex;align-items:center;gap:6px}.card-footer .footer-note{margin-left:auto;color:var(--soft)}.legend-swatch{display:inline-block;width:16px;height:3px;border-radius:4px}.legend-sun{background:#f8ad22}.legend-moon{background:#c3d6ed}.legend-dashed{border-top:2px dashed #728eac;height:1px;border-radius:0}
.phase-section{border-top:1px solid var(--line);padding-top:16px;margin-top:17px}.phase-head{display:flex;justify-content:space-between;align-items:center}.phase-head strong{display:block;font-size:15px;font-weight:800;letter-spacing:-.3px}.phase-head span{display:block;font-size:11px;color:var(--muted);margin-top:3px}.phase-degree{font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}.phase-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:5px;margin-top:13px}.phase-item{padding:12px 3px 10px;display:flex;align-items:center;flex-direction:column;border:1px solid transparent;border-radius:12px;gap:9px;min-width:0}.phase-item.active{background:rgba(28,139,244,.065);border-color:#5baaff}.phase-item svg{width:43px;height:43px;overflow:visible}.phase-item span{font-size:10px;text-align:center;color:var(--muted);line-height:1.3}.phase-item.active span{color:var(--blue);font-weight:800}.phase-item .current-dot{font-size:9px;font-weight:800;color:var(--blue);margin-top:-5px}.source-footnote{color:var(--muted);font-size:11px;line-height:1.5;padding:4px 9px 0}.source-footnote strong{font-size:9px;color:var(--soft);letter-spacing:.12em;margin-right:8px}
body.dark{color-scheme:dark;--bg:#101c2c;--panel:#18283b;--panel-sub:#20334a;--line:#31445b;--text:#e9f2fd;--muted:#a2b2c9;--soft:#8196b0;--shadow:0 8px 32px rgba(0,0,0,.07)}body.dark .brand-mark{background:#3d372a}body.dark .beta-label{background:#24405b;color:#95c9ec}body.dark .location-details{background:#1e3046}body.dark .map-shell{background:#20374d}body.dark .status-message{background:#204059;border-color:#3b6685;color:#c2e4ff}body.dark .status-message.error{background:#523039;color:#ffe3e4;border-color:#855363}body.dark .sun-icon{background:#423729}body.dark .moon-icon{background:#293e56}body.dark .map-source{color:#9baac0}
@media(max-width:1190px){.app-grid{grid-template-columns:minmax(305px,36%) minmax(0,64%)}.main-panel{padding:25px 17px}.sky-card{padding:18px 15px 14px}.events-row{padding:0}.card-footer .footer-note{display:none}}
@media(max-width:900px){.app-grid{display:block}.sidebar{padding:19px 22px;gap:13px}.map-shell{height:320px;min-height:0}.sidebar-footer{margin-top:0}.main-panel{padding:23px 22px}.content-heading{gap:18px}.pane-header h1{font-size:24px}.topbar{height:70px}.beta-label{display:none}}
@media(max-width:580px){.topbar{padding:0 15px;height:65px}.brand-mark{width:35px;height:35px}.brand-top{font-size:12px}.brand-sub{font-size:9px}.icon-button{height:35px;width:35px}.top-controls{gap:5px}.sidebar,.main-panel{padding-left:14px;padding-right:14px}.content-heading{flex-direction:column;align-items:flex-start}.date-controls{width:100%}.date-controls input{flex:1}.sky-card{padding:13px 11px}.card-head{gap:8px}.section-icon{height:40px;width:40px;border-radius:12px}.section-icon svg{height:25px;width:25px}.card-heading h3{font-size:18px}.card-heading p{font-size:10px}.metric-box{min-width:117px;padding:8px}.metric-box strong{font-size:16px}.metric-box span{font-size:9px}.events-row{gap:4px;padding:2px 0}.event{gap:7px}.event-icon{font-size:24px}.event strong{font-size:16px}.phase-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.phase-item{gap:7px;padding:9px 2px}.map-shell{height:285px}.location-form{grid-template-columns:1fr 1fr auto}.location-form input{font-size:11px}}
.picked-marker{width:27px;height:38px;position:relative;filter:drop-shadow(0 4px 5px rgba(19,64,107,.27))}.picked-marker:before{content:'';position:absolute;left:1px;top:0;width:25px;height:25px;border-radius:50% 50% 50% 0;transform:rotate(-45deg);background:#1782ea;border:2px solid white}.picked-marker span{position:absolute;left:10px;top:10px;width:8px;height:8px;background:white;border-radius:50%;z-index:1}.map-failed{padding:28px;color:#a94242;font-size:13px}
/* V2: twin solar duration metrics and interactive per-time inspector. */
.sun-metrics{display:flex;gap:9px;align-items:stretch;margin-left:auto;min-width:0}
.sun-metrics .metric-box{margin-left:0;min-width:150px;max-width:194px}
.sun-metrics .night-metric{background:linear-gradient(135deg,#eef3fa,#e5edf9)}
.sun-metrics .night-metric strong{color:#34527b}
.sun-metrics .night-metric span{display:block;max-width:168px;line-height:1.2}
body.dark .sun-metrics .night-metric{background:linear-gradient(135deg,#25354f,#1d314b)}
body.dark .sun-metrics .night-metric strong{color:#dceaff}
.trajectory-container svg{cursor:crosshair;touch-action:pan-y;outline-offset:4px}
.trajectory-container svg:focus-visible{outline:2px solid var(--blue);border-radius:8px}
.track-layer{transition:none}
.chart-tip{display:flex;align-items:center;gap:7px 11px;flex-wrap:wrap;justify-content:center;max-width:calc(100% - 12px);min-width:0;padding:8px 12px;white-space:normal;line-height:1.35;top:4px;text-align:center;border:1px solid rgba(255,255,255,.1)}
.chart-tip[hidden]{display:none}
.chart-tip strong{font-size:13px;white-space:nowrap;font-variant-numeric:tabular-nums;color:#fff}
.chart-tip span{font-size:10.5px;white-space:normal}
@media (max-width:1250px){.sun-metrics .metric-box{min-width:125px;padding:9px 11px;max-width:185px}}
@media (max-width:650px){
  .sky-card:has(.sun-metrics) .card-head{flex-wrap:wrap}
  .sun-metrics{flex:1 0 100%;margin-left:0;gap:8px}
  .sun-metrics .metric-box{max-width:none;min-width:0;flex:1 1 0;padding:9px}
  .sun-metrics .metric-box span{font-size:10px}
  .chart-tip{top:4px;padding:6px 8px;gap:2px 8px}
  .chart-tip strong{font-size:12px}
  .chart-tip span{font-size:10px}
}

/* V3: terrain horizon controls and direct-sun visibility panel. */
.terrain-controls{display:flex;flex-wrap:wrap;align-items:center;gap:12px 18px;border:1px solid var(--line);background:var(--panel);border-radius:13px;padding:12px 15px;margin:0 0 15px;min-width:0}
.terrain-toggle{display:inline-flex;align-items:center;gap:8px;font-size:12px;font-weight:800;cursor:pointer}
.terrain-toggle input{accent-color:#e59d38;width:18px;height:18px;cursor:pointer;flex-shrink:0}
.eye-field{display:inline-flex;gap:8px;align-items:center;color:var(--muted);font-size:11px}
.eye-field input{width:76px;background:var(--panel-sub);border:1px solid var(--line);border-radius:7px;color:var(--text);height:32px;padding:4px 8px;font-size:13px}
.terrain-control-hint{font-size:10px;color:var(--muted);flex-basis:100%}
.terrain-report{margin:7px 0 10px}.terrain-details{border:1px solid var(--line);background:var(--panel-sub);border-radius:13px;padding:12px 14px}.terrain-meta{display:flex;gap:7px 13px;flex-wrap:wrap;align-items:center;color:var(--muted);font-size:11px}.terrain-meta b{color:var(--text);font-size:12px}.terrain-solar-result{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:10px;border-top:1px solid var(--line);padding-top:10px}.terrain-solar-result>div{min-width:0}.terrain-solar-result small{display:block;font-size:10px;color:var(--muted);margin-bottom:4px}.terrain-solar-result strong{font-size:20px;letter-spacing:-.4px;display:block;color:var(--text)}.terrain-solar-result>div:first-child strong{color:#c77b12}.terrain-solar-result.no-direct strong{color:#b7504a}.terrain-windows{margin-top:8px;font-size:11px;line-height:1.5;color:var(--muted)}.terrain-windows b{color:var(--text)}.terrain-disclaimer{color:var(--muted);font-size:10px;margin-top:7px}.terrain-notice{background:var(--panel-sub);border:1px dashed var(--line);border-radius:10px;padding:9px 13px;color:var(--muted);font-size:11px;overflow-wrap:anywhere}.terrain-moon-report{margin:6px 0 0;font-size:11px;color:var(--muted)}.terrain-moon-bar{background:var(--panel-sub);border:1px solid var(--line);border-radius:10px;padding:8px 11px}.terrain-moon-bar b{color:var(--text)}
@media(max-width:580px){.terrain-controls{gap:10px;padding:10px}.eye-field{width:100%;justify-content:space-between}.terrain-solar-result{gap:5px}.terrain-solar-result strong{font-size:14px}.terrain-solar-result small{font-size:9px}.terrain-meta{font-size:10px;gap:5px 8px}.terrain-details{padding:10px}.terrain-windows{font-size:10px}}
.flat-events-note{text-align:center;font-weight:650;font-size:10px;letter-spacing:.02em;color:var(--muted);margin:12px 0 0}
.legend-terrain{height:1px;min-width:18px;background:transparent;border-top:2px dashed #b68262;border-radius:0}
.card-footer span.terrain-legend{display:inline-flex;gap:6px;align-items:center}
.horizon-details{border-top:1px solid var(--line);margin-top:9px;padding-top:7px}
.horizon-details summary{cursor:pointer;font-size:11px;font-weight:750;color:var(--text);padding:3px}
.horizon-details svg{width:100%;max-height:145px;display:block;margin-top:7px;color:var(--muted)}
.card-footer span.terrain-legend[hidden]{display:none}

/* V3.1 DEM downloader diagnostics */
.dem-download-row{flex-basis:100%;display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;border-top:1px solid var(--line);padding-top:9px;min-width:0}
.dem-state{color:var(--muted);font-size:11px;flex:1 1 220px;min-width:0;overflow-wrap:anywhere;line-height:1.45}
.dem-state.active{color:#1c87c4}.dem-state.failed{color:#b84434}.dem-state.ready{color:#328465}
.dem-retry{background:var(--panel-sub);border:1px solid var(--line);border-radius:8px;color:var(--text);font-weight:750;font-size:11px;padding:8px 11px;min-height:34px;white-space:normal}
.dem-retry:hover{border-color:var(--blue)}.dem-retry:disabled{opacity:.55;cursor:default}
body.dark .dem-state.active{color:#8fcbfd}body.dark .dem-state.failed{color:#fa9b9b}body.dark .dem-state.ready{color:#80d1ab}

/* V3.2: real elevation degree tick labels and terrain-shaded daytime. */
.elevation-axis{font-variant-numeric:tabular-nums}
.elevation-tick text{paint-order:stroke;stroke:transparent;stroke-width:0.7px}
.legend-shade{height:10px;width:15px;border:1px solid #829bb3;border-radius:3px;background:#6885a8;opacity:.6}
body.dark .legend-shade{background:#132a45;border-color:#7993b1;opacity:1}
.card-footer span.terrain-shade-legend{display:inline-flex;gap:6px;align-items:center}
.card-footer span.terrain-shade-legend[hidden]{display:none}


/* V4: fullscreen map + floating, scrollable astronomical cassette. */
html,body{width:100%;height:100%;overflow:hidden}
.app-shell{height:100%;min-height:0;isolation:isolate}
.app-grid{display:block!important;height:100%;min-height:0;position:relative}
.sidebar{display:block!important;position:absolute;inset:0;padding:0!important;min-width:0;background:transparent;border:0;z-index:0}
.map-shell{height:100%!important;min-height:0!important;border:none!important;border-radius:0!important;margin:0!important;position:absolute;inset:0;overflow:hidden;background:#dce7f1}
#map{width:100%!important;height:100%!important;border-radius:0!important;position:absolute;inset:0}
body.dark .map-shell{background:#12181c}
.map-hint{position:absolute;bottom:32px;left:50%;transform:translateX(-50%);z-index:2;width:max-content;max-width:calc(100% - 40px);pointer-events:none;box-shadow:0 6px 20px rgba(0,0,0,.13);border-radius:40px}
.map-source{position:absolute;bottom:5px;left:16px;margin:0;z-index:3;font-size:10px!important;padding:2px 5px;background:rgba(255,255,255,.78);border-radius:5px;color:#3b4c64!important}
body.dark .map-source{background:rgba(21,28,36,.72);color:#b8c8d9!important}
.topbar{position:fixed;top:0;left:0;right:0;z-index:24;height:66px!important;background:transparent!important;border:none!important;box-shadow:none!important;padding:0 21px!important;display:flex;align-items:center;justify-content:space-between;pointer-events:none}
.topbar>*{pointer-events:auto}
.topbar .brand-lockup{background:rgba(255,255,255,.95);border:1px solid rgba(178,194,211,.52);box-shadow:0 5px 22px rgba(7,18,33,.12);border-radius:14px;padding:7px 12px 7px 8px;gap:8px;color:#152a41}
.topbar .brand-mark{height:31px;width:31px;border-radius:10px}
.topbar .brand-mark svg{height:22px;width:22px}
.topbar .brand-top{font-size:11px;letter-spacing:.02em}
.topbar .brand-sub{font-size:8px;margin-top:2px}
body.dark .topbar .brand-lockup{background:#e9edf3;color:#17283b}
.portal-nav{position:absolute;left:50%;transform:translateX(-50%);top:7px;display:flex;align-items:center;gap:3px;background:#f3f6f9;color:#31465e;border-radius:15px;border:1px solid rgba(193,203,213,.8);box-shadow:0 4px 18px rgba(7,17,33,.19);padding:5px;white-space:nowrap}
.portal-nav a{display:block;text-decoration:none;border-radius:10px;padding:9px 11px;font-size:12px;font-weight:800;letter-spacing:.01em}
.portal-nav a:hover,.portal-nav a:focus-visible{background:#dbe9f5;color:#24577b;outline:none}
.portal-nav a:last-child{background:#d5edfc;color:#105577}
.topbar .top-controls{display:flex;gap:6px;background:rgba(246,248,251,.96);padding:5px;border-radius:12px;border:1px solid #d5e0ed;box-shadow:0 5px 22px rgba(7,18,33,.12)}
.topbar .top-controls .icon-button{height:34px;width:34px;color:#23425f;border:1px solid #d5e1ee;background:white;border-radius:8px}
.location-search{position:fixed;top:75px;left:50%;transform:translateX(-50%);z-index:20;display:flex;align-items:stretch;flex-direction:column;width:min(432px,calc(100vw - 30px));pointer-events:auto;gap:4px}
.search-form{display:flex;height:47px;background:#f7f9fc;border:1px solid #c5d3e1;box-shadow:0 7px 22px rgba(4,22,48,.21);border-radius:13px;overflow:hidden;color:#182f48;min-width:0}
.search-form input{flex:1 1 0;min-width:0;border:0;background:transparent;padding:0 13px;font-size:13px;color:#18344c;outline:0}
.search-form input::placeholder{color:#7b8b9e}
.search-submit,.locate-submit{height:100%;width:44px;min-width:44px;border:none;border-left:1px solid #c6d4e1;background:#e5edf7;color:#253c52;font-size:23px;font-weight:750}
.locate-submit{background:#f6f9fc;font-size:18px}
.search-submit:hover,.locate-submit:hover{background:#cde7f9}
.search-actions{display:flex;justify-content:center;gap:6px}
.coords-toggle{border:1px solid rgba(255,255,255,.23);border-radius:999px;padding:5px 12px;background:rgba(20,36,56,.72);color:#f5f9ff;font-size:10px;font-weight:750;box-shadow:0 3px 15px rgba(0,0,0,.13)}
.location-details{position:relative;top:auto;left:auto;max-width:none;margin:2px 0 0;border-radius:13px;padding:14px;box-shadow:0 7px 20px rgba(4,20,39,.19);background:var(--panel);border:1px solid var(--line);color:var(--text)}
.location-details[hidden]{display:none!important}
.location-details .quick-label{margin-top:12px}
.location-details .quick-links{margin-top:6px;display:flex;gap:7px;flex-wrap:wrap}
.location-details .quick-chip{border-radius:8px}
body.dark .location-details{background:#282f39;color:#eef4fb}
.search-error{background:#fff7ed;border:1px solid #f2c99b;color:#9c3e13;padding:8px 12px;border-radius:10px;font-size:12px;box-shadow:0 7px 15px rgba(0,0,0,.1)}
.search-error[hidden]{display:none}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
/* Desktop: show the map behind the panel, with persistent map interaction on the left. */
.main-panel{position:fixed;right:12px;top:12px;bottom:12px;left:auto;z-index:40;display:block;width:min(51vw,860px);max-width:none!important;height:auto;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;background:#fff;border:1px solid #dfe7ed;border-radius:19px;padding:0 18px 26px;margin:0;box-shadow:0 14px 44px rgba(3,14,28,.22);transform:translateX(calc(100% + 30px));visibility:hidden;pointer-events:none;transition:transform .24s cubic-bezier(.22,.8,.18,1),visibility .24s;scrollbar-width:thin;scrollbar-color:#b3c2d1 transparent}
body.panel-open .main-panel{transform:translateX(0);visibility:visible;pointer-events:auto}
body.dark .main-panel{background:#242b35;border-color:#3a4654;box-shadow:0 12px 40px rgba(0,0,0,.45);scrollbar-color:#5d7186 transparent}
body.dark{--panel:#282f39;--panel-sub:#333f4c;--line:#405064;--bg:#131b25;--text:#eef3fa;--muted:#bdc9d9;--soft:#8c9fb5}
body.dark .sky-card{background:#282f39}
body.dark .terrain-controls{background:#282f39}
body.dark .night-metric{background:#293b54}
.panel-toolbar{position:sticky;top:0;z-index:15;display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 -18px 12px;padding:10px 16px;background:inherit;border-bottom:1px solid var(--line);min-height:52px}
.panel-caption{display:flex;align-items:center;gap:8px;font-size:11px;font-weight:800;letter-spacing:.045em;color:var(--muted)}
.panel-dot{font-size:16px;color:#f3ae40}
.panel-close{height:34px;width:34px;flex-shrink:0;border:1px solid var(--line);background:var(--panel-sub);color:var(--text);font-size:23px;line-height:1;border-radius:10px;display:grid;place-items:center}
.panel-close:hover,.panel-close:focus-visible{background:#dfebf9;color:#1c527c}
.content-heading{margin-bottom:15px}
.content-heading h2{font-size:clamp(24px,2vw,31px)}
.sky-card{padding:16px 15px 12px!important;margin-bottom:15px;border-radius:14px}
.card-heading h3{font-size:19px}
.card-heading p{font-size:11px}
.sun-metrics .metric-box{min-width:0;max-width:none;padding:9px}
.metric-box strong{font-size:17px}
.card-footer{gap:8px 13px}
.maplibregl-control-container .maplibregl-ctrl-top-right{top:140px!important;right:7px!important}
@media(max-width:1150px){
 .main-panel{width:min(55vw,730px);padding:0 13px 22px}
 .panel-toolbar{margin:0 -13px 12px}
 .topbar .brand-sub{display:none}
 .topbar .brand-top{font-size:10px}
 .portal-nav a{font-size:11px;padding:8px}
}
@media(max-width:830px){
 .topbar .brand-lockup{display:none}
 .portal-nav{left:14px;transform:none;max-width:calc(100% - 118px);overflow:auto;scrollbar-width:none}
 .portal-nav a{font-size:10px;padding:8px}
 .topbar .top-controls{margin-left:auto}
 .main-panel{width:min(81vw,650px);top:9px;right:9px;bottom:9px}
 .location-search{top:66px}
}
@media(max-width:600px){
 .topbar{top:0;left:0;right:0;padding:0 9px!important;height:55px!important}
 .portal-nav{top:7px;left:7px;max-width:calc(100% - 101px);gap:0;padding:4px;border-radius:11px}
 .portal-nav a{font-size:10px;padding:8px 6px}
 .topbar .top-controls{padding:3px;gap:3px;border-radius:9px}
 .topbar .top-controls .icon-button{height:30px;width:30px}
 .location-search{top:60px;width:calc(100vw - 30px)}
 .map-hint{bottom:48px;font-size:11px}
 .main-panel{inset:0;left:0;right:0;top:0;bottom:0;width:100%;height:100%;border-radius:0;border:0;padding:0 12px 28px;transform:translateX(105%);box-shadow:none}
 .panel-toolbar{margin:0 -12px 14px;padding:9px 13px}
 .main-panel .content-heading{gap:9px}
 .main-panel .date-controls{width:100%}
 .main-panel .date-controls input{min-width:0}
 .sky-card{padding:12px 10px!important}
 .sun-metrics{flex:1 0 100%;gap:6px}
 .sun-metrics .metric-box{min-width:0;flex:1}
 .trajectory-container svg{min-height:130px}
 .events-row{padding:0!important}
 .phase-item{gap:5px}
 .maplibregl-control-container .maplibregl-ctrl-top-right{top:130px!important}
}
@media(prefers-reduced-motion:reduce){.main-panel{transition:none!important}}

/* Fine tuning: map search remains accessible while the results cassette is open. */
.panel-actions{display:flex;align-items:center;gap:6px}
.panel-action{height:34px;min-width:34px;padding:0 7px;border:1px solid var(--line);background:var(--panel-sub);color:var(--text);border-radius:9px;font-size:11px;font-weight:800}
.panel-action:hover{filter:brightness(.96)}
.panel-backdrop{display:none}
body.panel-open .topbar .brand-lockup{display:none}
@media(min-width:831px){
 body.panel-open .location-search{left:calc((100vw - min(51vw,860px) - 14px)/2);width:min(420px,calc(100vw - min(51vw,860px) - 38px));}
 body.panel-open .portal-nav{left:calc((100vw - min(51vw,860px) - 14px)/2)}
 body.panel-open .topbar .top-controls{display:none}
}
@media(min-width:831px) and (max-width:1150px){
 body.panel-open .location-search{left:calc((100vw - min(55vw,730px) - 14px)/2);width:min(390px,calc(100vw - min(55vw,730px) - 36px))}
 body.panel-open .portal-nav{left:calc((100vw - min(55vw,730px) - 14px)/2)}
}
@media(max-width:830px){
 body.panel-open .portal-nav,body.panel-open .location-search,body.panel-open .topbar .top-controls{visibility:hidden;pointer-events:none}
}

/* V5: shared Meteograms mode, freely-positioned cassette and cleaned map controls */
.portal-nav .portal-meteograms{border:0;background:#d5edfc;color:#105577;border-radius:10px;padding:9px 11px;font-size:12px;font-weight:800;letter-spacing:.01em;cursor:pointer}
.portal-nav .portal-meteograms:hover,.portal-nav .portal-meteograms:focus-visible{background:#c4e3f9}
.map-mode-row{display:flex;justify-content:center;align-items:center;gap:8px;min-height:33px;flex-wrap:nowrap}
.location-search .map-hint{position:static;left:auto;bottom:auto;transform:none;padding:9px 12px;max-width:none;box-shadow:0 4px 15px rgba(4,22,45,.19);white-space:nowrap;flex-shrink:1;min-width:0}
.mode-buttons{display:flex;align-items:center;gap:2px;border-radius:999px;padding:3px;background:rgba(255,255,255,.96);box-shadow:0 4px 17px rgba(4,22,45,.19);border:1px solid #dae4ee}
.mode-btn{border:0;border-radius:999px;padding:7px 10px;background:transparent;font-size:11px;font-weight:800;color:#415871;white-space:nowrap}
.mode-btn.active{background:#dbefff;color:#135d99}
.mode-btn:hover,.mode-btn:focus-visible{background:#d9ebf8;outline-offset:2px}
body.dark .mode-buttons{background:#27313e;border-color:#42546b}
body.dark .mode-btn{color:#d2deea}
body.dark .mode-btn.active{background:#426f96;color:white}
.main-panel[aria-hidden="true"]{pointer-events:none}
.panel-position-controls{display:flex;gap:3px;align-items:center;background:var(--panel-sub);border-radius:10px;padding:3px}
.position-btn{border:1px solid transparent;border-radius:7px;min-width:35px;height:31px;background:transparent;color:var(--muted);font-size:20px;font-weight:700;display:grid;place-items:center}
.position-btn.active{background:var(--panel);border-color:var(--line);color:var(--blue)}
.position-btn:hover{background:var(--panel)}
#astronomyBody[hidden],#weatherBody[hidden]{display:none!important}
body.panel-left .main-panel{left:12px;right:auto;transform:translateX(calc(-100% - 24px))}
body.panel-left.panel-open .main-panel{transform:translateX(0)}
body.panel-center .main-panel{left:50%;right:auto;transform:translate(-50%,calc(100vh + 36px))}
body.panel-center.panel-open .main-panel{transform:translate(-50%,0)}
@media(min-width:831px){
 body.panel-left.panel-open .location-search{left:calc((100vw + min(51vw,860px) + 12px)/2);width:min(432px,calc(100vw - min(51vw,860px) - 38px))}
 body.panel-left.panel-open .portal-nav{left:calc((100vw + min(51vw,860px) + 12px)/2)}
 body.panel-center.panel-open .portal-nav{left:12px;top:76px;transform:none;display:flex;flex-direction:column;align-items:stretch;gap:3px;white-space:normal;padding:5px;width:145px}
 body.panel-center.panel-open .portal-nav>*{width:100%;text-align:left;white-space:normal}
 body.panel-center.panel-open .location-search{left:auto;right:12px;top:76px;transform:none;width:min(285px,calc((100vw - min(51vw,860px))/2 - 26px))}
 body.panel-center.panel-open .map-mode-row{flex-wrap:wrap}
 body.panel-center.panel-open .topbar .top-controls{display:none}
}
@media(min-width:831px) and (max-width:1150px){
 body.panel-left.panel-open .location-search{left:calc((100vw + min(55vw,730px) + 12px)/2);width:min(390px,calc(100vw - min(55vw,730px) - 36px))}
 body.panel-left.panel-open .portal-nav{left:calc((100vw + min(55vw,730px) + 12px)/2)}
 body.panel-center.panel-open .location-search{width:min(230px,calc((100vw - min(55vw,730px))/2 - 25px))}
}
body.dark #sunChart .cirrus-layer{opacity:1}
/* Astronomy daylight uses the same pale sky palette across both UI themes;
   night stays dark and terrain-blocked daylight receives a separate blue veil. */
.weather-view{padding:10px 2px 28px;min-width:0}
.weather-view h2{margin:4px 0 6px;font-size:clamp(23px,2vw,32px);letter-spacing:-.7px}
.weather-caption{font-size:12px;color:var(--muted);margin:5px 0 16px}
.weather-status{font-size:12px;color:var(--muted);padding:10px 0}
.weather-status.failed{color:#e26b4b}
.weather-card{background:var(--panel);border:1px solid var(--line);border-radius:15px;padding:15px;margin:14px 0}
.weather-card h3{font-size:15px;letter-spacing:-.3px;margin:2px 0 13px}
.weather-chart-scroll{width:100%;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin}
.weather-chart-scroll svg{display:block;width:100%;height:auto;min-width:440px}
.weather-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin-top:8px}
.weather-summary>div{background:var(--panel-sub);border:1px solid var(--line);border-radius:12px;padding:12px;min-width:0}
.weather-summary small{display:block;font-size:10px;color:var(--muted);min-height:26px}
.weather-summary strong{display:block;font-size:clamp(14px,1.2vw,21px)}
.weather-attribution{color:var(--muted);font-size:11px;line-height:1.5}
.weather-provider-link{font-size:12px;color:var(--blue)}
@media(max-width:830px){
 .location-search .map-hint{padding:8px;font-size:10px}
 .mode-btn{padding:7px 10px;font-size:10px}
 .main-panel{height:100%;}
 body.panel-left .main-panel,body.panel-center .main-panel{left:0;right:0;top:0;bottom:0;transform:translateX(105%)}
 body.panel-left.panel-open .main-panel,body.panel-center.panel-open .main-panel{transform:translateX(0)}
 .position-btn{display:none}
 .panel-position-controls{display:none}
}
@media(max-width:600px){
 .location-search{width:calc(100vw - 18px);left:50%}
 .map-mode-row{gap:4px}
 .location-search .map-hint{font-size:9px;padding:7px 8px}
 .mode-buttons{padding:2px}
 .mode-btn{font-size:10px;padding:7px}
 .trajectory-container{overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;touch-action:pan-x pan-y;overscroll-behavior-inline:contain}
 .trajectory-container svg{width:930px!important;min-width:930px!important;max-width:none!important;height:227px!important;min-height:227px!important;max-height:227px!important;display:block;overflow:visible}
 .weather-chart-scroll svg{min-width:800px;width:800px}
 .sun-container,.moon-container{background:var(--panel);border-radius:10px}
 .chart-tip{position:sticky;z-index:7;display:block;max-width:180px;white-space:normal;top:5px!important;pointer-events:none}
 .chart-tip[hidden]{display:none!important}
 .main-panel .sky-card{padding:12px 9px!important}
 .weather-summary{gap:5px}
 .weather-summary>div{padding:7px}
}

.panel-mode-buttons{display:none;align-items:center;gap:3px;background:var(--panel-sub);padding:3px;border-radius:9px}
@media(max-width:830px){
 .panel-mode-buttons{display:flex;margin-left:auto}
 .panel-mode-btn{font-size:10px;padding:8px 7px}
 .panel-actions{margin-left:0}
}
@media(max-width:360px){.panel-action{min-width:29px;height:30px;padding:0 4px}.panel-close{width:30px;height:30px}.panel-mode-btn{font-size:9px}}

/* V5.1 compact annotation and unified functional theme switch */
.theme-glyph{display:inline-flex;align-items:center;justify-content:center;width:19px;height:19px;vertical-align:middle;pointer-events:none}
.theme-glyph svg{width:19px;height:19px;display:block}
/* Graph daylight starts with #e4f0f9, then #264e7a overlays at 24% opacity when blocked by terrain. */
.legend-shade,body.dark .legend-shade{background:linear-gradient(rgba(38,78,122,.24),rgba(38,78,122,.24)),#e4f0f9;opacity:1;border-color:#9eb4c9}
.location-description{font-weight:700;letter-spacing:.01em}
.terrain-meta>span:first-child{margin-left:0}

/* V5.2: twilight diagram with clear categories and warmer daylight colors */
.night-metric{align-self:center}
.twilight-card{padding:18px 20px 20px!important}
.twilight-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:17px}
.twilight-heading-main{display:flex;align-items:center;gap:10px;min-width:0}
.twilight-heading-main h3{margin:0;font-size:19px;font-weight:800;letter-spacing:-.4px}
.twilight-heading-main p{margin:3px 0 0;color:var(--muted);font-size:11px}
.twilight-heading-icon{width:38px;height:38px;display:grid;place-items:center;border-radius:11px;color:#d79b2a;background:#fff1cf;font-size:23px;flex-shrink:0}
.twilight-date{border:1px solid var(--line);padding:9px 11px;border-radius:9px;font-size:11px;color:var(--text);font-weight:700;white-space:nowrap;background:var(--panel-sub)}
.twilight-chart-scroll{overflow-x:auto;scrollbar-width:thin;-webkit-overflow-scrolling:touch;outline-offset:4px}
.twilight-chart{position:relative;min-width:540px;height:103px;padding-top:20px}
.twilight-strip{position:relative;height:55px;width:100%;overflow:hidden;border-radius:10px;box-shadow:inset 0 0 0 1px rgba(44,66,86,.18);background:#263d56}
.twilight-slice{position:absolute;top:0;bottom:0}
.twilight-night,.twilight-cat-night .twilight-color{background:#263d56}
.twilight-astronomical,.twilight-cat-astronomical .twilight-color{background:#55568d}
.twilight-nautical,.twilight-cat-nautical .twilight-color{background:#5386a1}
.twilight-civil,.twilight-cat-civil .twilight-color{background:#9fc5d2}
.twilight-daylight,.twilight-cat-daylight .twilight-color{background:#f6d38e}
.twilight-time-labels{position:absolute;top:0;left:0;right:0;height:19px;color:var(--muted);font-size:10px;font-variant-numeric:tabular-nums}
.twilight-tick{position:absolute;transform:translateX(-50%);white-space:nowrap}
.twilight-tick:first-child{transform:none}
.twilight-tick:last-child{transform:translateX(-100%)}
.twilight-marker-line{position:absolute;left:0;right:0;top:20px;height:55px;pointer-events:none}
.twilight-transit-mark{position:absolute;top:0;bottom:0;border-left:1.5px dashed;opacity:.85}
.twilight-transit-mark.transit-noon{border-color:#dc7835}
.twilight-transit-mark.transit-midnight{border-color:#a5bbf3}
.twilight-legend-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin-top:2px}
.twilight-category{min-width:0;border-radius:11px;background:var(--panel-sub);border:1px solid var(--line);padding:10px 9px 8px;display:flex;flex-direction:column;gap:7px}
.twilight-category-head{display:flex;align-items:center;gap:6px;min-height:33px}
.twilight-color{width:12px;height:22px;border-radius:3px;display:block;flex-shrink:0}
.twilight-category-head strong{font-size:10.5px;line-height:1.3;overflow-wrap:anywhere}
.twilight-periods{font-size:10.5px;color:var(--muted);line-height:1.5;font-variant-numeric:tabular-nums;min-height:33px}
.twilight-category-total{margin-top:auto;padding-top:8px;border-top:1px solid var(--line);font-size:10px;color:var(--muted);font-variant-numeric:tabular-nums}
.twilight-category-total strong{color:var(--text);font-weight:800;white-space:nowrap}
.twilight-transit-summary{display:flex;gap:10px;flex-wrap:wrap;border-top:1px solid var(--line);margin-top:15px;padding-top:12px}
.twilight-transit{display:flex;align-items:center;gap:8px;background:var(--panel-sub);padding:8px 12px;border:1px solid var(--line);border-radius:9px;font-size:11px;color:var(--muted)}
.twilight-transit strong{color:var(--text);font-size:12px;font-weight:800;margin-left:3px;font-variant-numeric:tabular-nums}
.twilight-transit-line{width:18px;height:2px;display:block;flex-shrink:0}
.twilight-transit-line.transit-noon{background:#dc7835}
.twilight-transit-line.transit-midnight{background:#a5bbf3}
body.dark .twilight-heading-icon{background:#483e31;color:#f2c16c}
body.dark .twilight-category{background:#303c4b}
@media(max-width:1350px){.twilight-legend-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:830px){.twilight-legend-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){
 .twilight-card{padding:13px 10px 15px!important}
 .twilight-heading{align-items:flex-start}
 .twilight-heading-main h3{font-size:16px}
 .twilight-heading-main p{font-size:10px}
 .twilight-date{padding:7px;font-size:10px}
 .twilight-chart{min-width:690px;height:118px}
 .twilight-strip{height:69px}
 .twilight-marker-line{height:69px}
 .twilight-legend-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
 .twilight-category{padding:9px}
 .twilight-transit-summary{gap:7px}
 .twilight-transit{padding:7px 9px;font-size:10px}
}

/* V5.3 twilight refinements */
.twilight-heading{align-items:center}
.twilight-heading-main{gap:12px}
.twilight-heading-icon{font-size:0;padding:0}
.twilight-heading-icon svg{display:block}
.twilight-legend-grid{grid-template-columns:repeat(4,minmax(0,1fr));margin-top:8px}
.twilight-transit-summary{justify-content:center;align-items:center}
.twilight-transit{min-width:220px;justify-content:center}
body.dark .twilight-heading-icon{background:#4a4033;color:#f0c16f}
@media(max-width:1350px){.twilight-legend-grid{grid-template-columns:repeat(4,minmax(0,1fr));}}
@media(max-width:980px){.twilight-legend-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:640px){.twilight-transit-summary{justify-content:center}.twilight-transit{min-width:0;width:100%;max-width:260px}}

/* V5.4: source-provided sun and moon pictogram in twilight header. */
.twilight-heading-icon{height:43px;width:43px;flex:0 0 43px;border-radius:10px;background:rgba(243,171,49,.10);color:inherit}
.twilight-heading-icon img{display:block;width:36px;height:36px;max-width:none;object-fit:contain}
body.dark .twilight-heading-icon{background:rgba(243,171,49,.13)}

/* Public astronomy integration: centered terrain options and left-side zoom controls. */
.terrain-controls{justify-content:center;text-align:center}
@media(max-width:580px){.terrain-controls{justify-content:center}.eye-field{width:auto;max-width:100%;justify-content:center}}
.maplibregl-control-container .maplibregl-ctrl-top-left{
 top:130px!important;left:12px!important;z-index:5
}
@media(max-width:600px){.maplibregl-control-container .maplibregl-ctrl-top-left{top:118px!important;left:10px!important}}

/* Unified Weather mode: the original forecast renderer fills this cassette. */
body.weather-mode .main-panel{display:flex;flex-direction:column;overflow:hidden;padding-bottom:0}
body.weather-mode .panel-toolbar{flex:0 0 auto}
body.weather-mode #weatherBody.wx-original-meteograms{display:flex;flex:1 1 auto;min-height:0;min-width:0;padding:0!important;margin:0;overflow:hidden}
body.weather-mode #weatherBody.wx-original-meteograms[hidden]{display:none}
#operationalMeteograms{display:block;flex:1 1 auto;width:100%;height:100%;min-width:0;min-height:0;border:0;background:transparent}
body.weather-mode .panel-actions{flex-shrink:0}


/* v6.2 — native weather forecasting, same map and same page.
   The forecast graphics need their original ~1180 px desktop canvas space.
   Keep a narrow exposed strip of the shared map for changing locations. */
@media(min-width:901px){
 body.weather-mode .main-panel{
   width:min(1370px,calc(100vw - 172px))!important;
   max-width:none!important;min-width:0!important;
   top:8px!important;bottom:8px!important;right:8px!important;
   padding-left:0!important;padding-right:0!important;
   border-radius:16px!important;
 }
 body.weather-mode.panel-left .main-panel{right:auto!important;left:8px!important}
 body.weather-mode.panel-center .main-panel{right:auto!important;left:50%!important}
 body.weather-mode.panel-open.panel-center .main-panel{transform:translate(-50%,0)!important}
 body.weather-mode .panel-toolbar{margin:0!important;padding:7px 12px!important;
   min-height:51px!important;flex-wrap:wrap!important;gap:6px!important}
 body.weather-mode .location-search{max-width:min(440px,calc(100vw - 32px))}
 body.weather-mode .panel-position-controls{flex:0 0 auto}
 body.weather-mode .panel-mode-buttons{flex:0 0 auto}
 body.weather-mode .panel-actions{margin-left:auto}
}
@media(min-width:901px) and (max-width:1180px){
 body.weather-mode .main-panel{width:calc(100vw - 115px)!important}
 body.weather-mode .panel-toolbar{gap:5px!important}
 body.weather-mode .panel-position-controls{display:none!important}
}
@media(max-width:900px){
 body.weather-mode .main-panel{
   position:fixed!important;inset:0!important;width:100vw!important;height:100%!important;
   min-height:0!important;max-width:none!important;padding:0!important;
   border:0!important;border-radius:0!important;
 }
 body.weather-mode .panel-toolbar{margin:0!important;min-height:56px!important;padding:7px 8px!important;gap:5px!important}
 body.weather-mode .panel-position-controls{display:none!important}
 body.weather-mode .panel-mode-buttons{flex-shrink:0!important}
 body.weather-mode .panel-actions{margin-left:auto!important;gap:3px!important}
 body.weather-mode .panel-actions>*{min-width:30px!important;width:33px!important;height:34px!important;padding:0!important}
}
body.weather-mode #weatherBody.wx-original-meteograms{
 flex:1 1 auto!important;min-height:0!important;
 width:100%!important;max-width:none!important;
 padding:0!important;margin:0!important;overflow:hidden!important;
}
body.weather-mode .panel-toolbar{flex-shrink:0!important}
body.weather-mode #operationalMeteograms{
 display:block!important;width:100%!important;height:100%!important;
 flex:1 1 100%!important;min-width:0!important;min-height:0!important;
 border:0!important;background:transparent!important;
}

/* V6.3: shared centered cassette; controls never hide behind the panel. */
@media (min-width:901px){
 body.panel-center.panel-open .portal-nav{left:12px!important;top:74px!important;width:132px!important;padding:4px!important;}
 body.panel-center.panel-open .portal-nav a,
 body.panel-center.panel-open .portal-nav button{font-size:11px!important;padding:9px 7px!important;}
 body.panel-center.panel-open .location-search{display:none!important;}
 body.panel-center.panel-open .main-panel{width:min(1180px,calc(100vw - 306px))!important;max-width:none!important;}
 body.weather-mode.panel-center .main-panel{width:min(1360px,calc(100vw - 306px))!important;max-width:none!important;left:50%!important;right:auto!important;}
 body.panel-center.panel-open .main-panel{transform:translate(-50%,0)!important;}
 body.weather-mode .panel-toolbar{display:flex!important;justify-content:space-between!important;align-items:center!important;flex-wrap:nowrap!important;min-height:49px!important;gap:8px!important;}
 body.weather-mode .panel-position-controls{display:flex!important;flex:0 0 auto!important;}
 .panel-toolbar .panel-mode-buttons{display:flex!important;flex:0 1 auto!important;min-width:0!important;margin:0 auto!important;}
 .panel-toolbar .panel-actions{margin-left:auto!important;flex:0 0 auto!important;}
 .panel-mode-btn{font-size:11px!important;padding:7px 10px!important;}
 .panel-position-controls .position-btn{min-width:30px!important;height:30px!important;font-size:18px!important;}
 .panel-actions{display:flex!important;align-items:center!important;gap:5px!important;}
}
@media(min-width:901px) and (max-width:1240px){
 body.weather-mode.panel-center .main-panel{width:calc(100vw - 240px)!important;}
 body.panel-center.panel-open .main-panel{width:calc(100vw - 240px)!important;}
 body.panel-center.panel-open .portal-nav{width:104px!important;}
 body.panel-center.panel-open .portal-nav a,
 body.panel-center.panel-open .portal-nav button{font-size:10px!important;}
}
@media(max-width:900px){
 .panel-toolbar{display:flex!important;align-items:center!important;flex-wrap:nowrap!important;justify-content:space-between!important;gap:6px!important;}
 .panel-mode-buttons{display:flex!important;order:0!important;margin-left:0!important;margin-right:auto!important;min-width:0!important;flex:0 1 auto!important;}
 .panel-actions{display:flex!important;order:2!important;margin-left:auto!important;flex:0 0 auto!important;gap:4px!important;}
 .panel-position-controls{display:none!important;}
 .panel-mode-btn{padding:8px 9px!important;font-size:11px!important;}
 .change-point-action{display:none!important;}
}
@media(max-width:370px){
 .panel-mode-btn{padding:8px 6px!important;font-size:10px!important;}
 .panel-actions{gap:2px!important;}
}

/* V6.4: left/right desktop forecast cassette, with a dedicated map-control rail.
   Width of the cassette and of the map rail come from the same variable, so
   the map navigation and search never slide under the weather forecast. */
@media (min-width:901px){
  body.weather-mode.panel-open.panel-right,
  body.weather-mode.panel-open.panel-left{
    --wx-map-side-rail:clamp(282px,25vw,425px);
  }
  body.weather-mode.panel-open.panel-right .main-panel,
  body.weather-mode.panel-open.panel-left .main-panel{
    width:calc(100vw - var(--wx-map-side-rail) - 18px)!important;
    max-width:none!important;
    min-width:0!important;
  }
  body.weather-mode.panel-open.panel-right .main-panel{
    left:auto!important;right:9px!important;
    transform:translateX(0)!important;
  }
  body.weather-mode.panel-open.panel-left .main-panel{
    left:9px!important;right:auto!important;
    transform:translateX(0)!important;
  }
  body.weather-mode.panel-open.panel-right .portal-nav,
  body.weather-mode.panel-open.panel-left .portal-nav{
    position:fixed!important;
    width:calc(var(--wx-map-side-rail) - 24px)!important;
    max-width:calc(var(--wx-map-side-rail) - 24px)!important;
    min-width:0!important;
    top:9px!important;
    transform:none!important;
    display:flex!important;
    flex-wrap:wrap!important;
    white-space:normal!important;
    justify-content:center!important;
    gap:3px!important;
    box-sizing:border-box!important;
  }
  body.weather-mode.panel-open.panel-right .portal-nav{
    left:12px!important;right:auto!important;
  }
  body.weather-mode.panel-open.panel-left .portal-nav{
    right:12px!important;left:auto!important;
  }
  body.weather-mode.panel-open:is(.panel-left,.panel-right) .portal-nav a,
  body.weather-mode.panel-open:is(.panel-left,.panel-right) .portal-nav button{
    flex:0 1 auto!important;
    font-size:clamp(10px,.78vw,12px)!important;
    line-height:1.2!important;
    padding:8px 9px!important;
    white-space:normal!important;
    max-width:100%!important;
    text-align:center!important;
  }
  body.weather-mode.panel-open.panel-right .location-search,
  body.weather-mode.panel-open.panel-left .location-search{
    width:calc(var(--wx-map-side-rail) - 24px)!important;
    max-width:calc(var(--wx-map-side-rail) - 24px)!important;
    top:112px!important;
    transform:none!important;
    box-sizing:border-box!important;
  }
  body.weather-mode.panel-open.panel-right .location-search{
    left:12px!important;right:auto!important;
  }
  body.weather-mode.panel-open.panel-left .location-search{
    right:12px!important;left:auto!important;
  }
  body.weather-mode.panel-open:is(.panel-left,.panel-right) .location-search .map-mode-row{
    flex-wrap:wrap!important;
    width:100%!important;
    justify-content:center!important;
  }
  body.weather-mode.panel-open:is(.panel-left,.panel-right) .search-form{
    width:100%!important;
    min-width:0!important;
  }
  body.weather-mode.panel-open:is(.panel-left,.panel-right) .search-form input{
    min-width:0!important;
    flex:1 1 70px!important;
  }
  body.weather-mode.panel-open.panel-left .map-source{
    right:14px!important;left:auto!important;
    max-width:calc(var(--wx-map-side-rail) - 22px)!important;
  }
  body.weather-mode.panel-open.panel-right .map-source{
    left:14px!important;right:auto!important;
    max-width:calc(var(--wx-map-side-rail) - 22px)!important;
  }
  body.weather-mode.panel-open:is(.panel-left,.panel-right) .map-source{
    white-space:normal!important;
    overflow-wrap:anywhere!important;
    line-height:1.3!important;
  }
}
/* Custom credits include OpenFreeMap, OpenMapTiles, OpenStreetMap and Mapzen;
   MapLibre's extra compact control is never created in JS. */

/* Keep the single provider-credit pill readable on phone-sized viewports. */
.map-source{max-width:calc(100vw - 46px);white-space:normal;overflow-wrap:anywhere;line-height:1.3}
@media(max-width:600px){
 .map-source{left:8px;bottom:7px;right:auto;max-width:calc(100vw - 64px);font-size:9px!important}
}

/* V6.5: position controls and mode switch form ONE left-aligned group.
   Language, theme, location, and close remain on the far right. */
.panel-toolbar .panel-leading-controls{
 display:flex!important;align-items:center!important;justify-content:flex-start!important;
 gap:9px!important;min-width:0!important;flex:0 1 auto!important;
 margin:0!important;
}
.panel-toolbar .panel-leading-controls .panel-position-controls{
 display:flex!important;flex:0 0 auto!important;margin:0!important;
}
.panel-toolbar .panel-leading-controls .panel-mode-buttons{
 display:flex!important;flex:0 0 auto!important;
 margin:0!important;order:initial!important;
}
.panel-toolbar .panel-actions{margin-left:auto!important;flex:0 0 auto!important;}
@media(max-width:900px){
 .panel-toolbar .panel-leading-controls{gap:0!important;flex:0 1 auto!important;}
 .panel-toolbar .panel-leading-controls .panel-position-controls{display:none!important;}
 .panel-toolbar .panel-leading-controls .panel-mode-buttons{display:flex!important;}
}
@media(min-width:901px) and (max-width:1090px){
 .panel-toolbar .panel-leading-controls{gap:4px!important;}
 .panel-toolbar .panel-leading-controls .position-btn{min-width:27px!important;}
 .panel-toolbar .panel-leading-controls .panel-mode-btn{font-size:10px!important;padding:7px 7px!important;}
}

/* 31 Oct: all five physically disjoint twilight states visible. */
.twilight-legend-grid{grid-template-columns:repeat(5,minmax(0,1fr))!important}
@media(max-width:1000px){.twilight-legend-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}}
@media(max-width:620px){.twilight-legend-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
