#lm-ext{--ext-card:#fff;--ext-text:#243247;--ext-muted:#566478;--ext-line:#8996a844;--ext-soft:#f3f6fa;--ext-acc:#1686b8;--ext-eye:#1786b6;max-width:1200px;margin:auto;padding:28px 18px;color:var(--ext-text);font-family:inherit;font-size:16px;line-height:1.55;box-sizing:border-box}
html.s-dark #lm-ext,html.site-s-dark #lm-ext{--ext-card:#142238;--ext-text:#e4edf7;--ext-muted:#b5c3d6;--ext-soft:#1a2c47;--ext-acc:#68c7ec;--ext-eye:#68c7ec;color-scheme:dark}
#lm-ext *{box-sizing:border-box}
#lm-ext header{margin:0 0 18px}#lm-ext h1{font-size:clamp(28px,4vw,42px);line-height:1.15;margin:8px 0 16px;color:var(--ext-text)}
#lm-ext h2{font-size:23px;line-height:1.3;margin:0 0 14px;padding-bottom:12px;border-bottom:1px solid #8996a833;color:var(--ext-text)}
#lm-ext h3{color:var(--ext-text)}#lm-ext p{margin:10px 0;line-height:1.65;color:var(--ext-muted)}
#lm-ext .ext-kicker{font-size:12px;letter-spacing:.15em;font-weight:700;color:var(--ext-eye);margin:0}
.ext-card{background:var(--ext-card);border:1px solid var(--ext-line);border-radius:14px;padding:22px;margin:0 0 24px;color:var(--ext-text);scroll-margin-top:90px}
.ext-sub{font-size:13px;margin:0 0 14px!important;opacity:.9}
.ext-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(205px,1fr));gap:14px}
.ext-box{border:1px solid var(--ext-line);border-radius:12px;padding:14px;background:var(--ext-soft);min-width:0}
.ext-box h3{margin:0;font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--ext-muted);font-weight:700}
.ext-big{font-size:32px;line-height:1.2;font-weight:700;margin:8px 0 2px;font-variant-numeric:tabular-nums;color:var(--ext-acc)}
.ext-big small{font-size:15px;font-weight:600;margin-left:3px}
.ext-where{font-size:14px;margin:0 0 8px!important;color:var(--ext-text)!important;overflow-wrap:anywhere}
.ext-where span{color:var(--ext-muted)}
.ext-list{list-style:none;margin:6px 0 0;padding:0;font-size:13px}
.ext-list li{margin:0;padding:0}
#lm-ext .ext-list button{all:unset;box-sizing:border-box;display:flex;justify-content:space-between;gap:10px;width:100%;padding:6px 2px;border-top:1px solid var(--ext-line);cursor:pointer;min-height:32px;align-items:center;color:var(--ext-text)}
#lm-ext .ext-list button:hover{background:var(--ext-card)}
.ext-list .n{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.ext-list .v{font-variant-numeric:tabular-nums;font-weight:700;white-space:nowrap}
.ext-empty{font-size:13px;color:var(--ext-muted);margin:10px 0 0!important}
.ext-tools{display:flex;flex-wrap:wrap;align-items:end;gap:14px;margin:14px 0 18px}
.ext-tools label{display:flex;flex-direction:column;gap:6px;flex:1;min-width:180px;max-width:420px;font-size:13px;font-weight:600;color:var(--ext-text)}
#lm-ext select,#lm-ext button{font:inherit;background:var(--ext-card);color:var(--ext-text);border:1px solid #8996a866;border-radius:8px;min-height:44px;padding:10px}
.ext-count{font-size:13px;color:var(--ext-muted);padding-bottom:12px}
#ext-map{height:560px;border-radius:10px;z-index:0;background:#cdd9e0;touch-action:pan-y}#ext-map.ext-zoomed{touch-action:none}
.ext-legend{display:flex;align-items:center;gap:10px;margin:12px 0;font-size:12px;color:var(--ext-muted)}
.ext-legend .bar{flex:1;max-width:420px;height:10px;border-radius:5px;border:1px solid var(--ext-line)}
.ext-detail{margin:6px 0;padding:12px 14px;border:1px solid var(--ext-line);border-radius:10px;background:var(--ext-soft);font-size:14px;min-height:48px;color:var(--ext-text)}
.ext-detail b{font-weight:700}.ext-detail .row{display:flex;flex-wrap:wrap;gap:4px 18px;margin-top:4px}
.ext-stamps{display:flex;flex-wrap:wrap;gap:16px 40px;margin-top:16px}.ext-stamps dt{font-size:12px;color:var(--ext-muted)}.ext-stamps dd{margin:4px 0;font-size:14px}
.ext-credit{font-size:12px}
#lm-ext a{color:var(--ext-acc);text-decoration:underline}
#lm-ext :is(button,select,input,a):focus-visible{outline:3px solid #187fc0;outline-offset:3px}
#lm-ext .leaflet-control-attribution{font-size:10px;max-width:90%;white-space:normal}
#lm-ext .leaflet-control-attribution a{color:#126aa1}
.ext-info{font-size:14px}
@media(min-width:900px){#ext-cards-obs{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:760px){#lm-ext{padding:20px 12px}.ext-card{padding:16px 12px}.ext-tools>label{flex:1 1 100%;max-width:none;min-width:100%}#ext-map{height:460px;height:min(65svh,500px)}.ext-grid{grid-template-columns:1fr}}
/* ---- secção percentis da previsão (LM-PERCENTIS-V1) ---- */
.ext-days{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 14px}
#lm-ext .ext-days button{min-height:40px;padding:6px 12px;font-size:13px;cursor:pointer;text-transform:capitalize}
#lm-ext .ext-days button[aria-pressed=true]{background:var(--ext-acc);color:#fff;border-color:var(--ext-acc);font-weight:700}
html.s-dark #lm-ext .ext-days button[aria-pressed=true],html.site-s-dark #lm-ext .ext-days button[aria-pressed=true]{color:#0b1626}
#ext-pct-map{height:620px;border-radius:10px;z-index:0;background:#cdd9e0;touch-action:pan-y}#ext-pct-map.ext-zoomed{touch-action:none}
.ext-pct-title{background:rgba(255,255,255,.92);color:#1b2430;padding:6px 10px;border-radius:10px;font-size:13px;line-height:1.35;box-shadow:0 1px 6px #0003;max-width:min(78vw,420px);margin-bottom:8px!important}
.ext-pct-title span{font-size:12px;opacity:.85}
.ext-pct-lab{background:none;border:0}
.ext-pct-lab span{display:inline-block;transform-origin:center;font:600 11px/1 system-ui,sans-serif;color:#12171e;text-shadow:0 0 2px #fff,0 0 2px #fff,0 0 3px #fff;white-space:nowrap;margin:-6px 0 0 -8px}
.ext-pct-leg{display:flex;flex-wrap:wrap;gap:6px 14px;margin:12px 0;font-size:12px;color:var(--ext-muted)}
.ext-pct-leg .it{display:inline-flex;align-items:center;gap:6px}
.ext-pct-leg i{width:16px;height:12px;border-radius:3px;border:1px solid var(--ext-line);display:inline-block}
.ext-h3{font-size:16px;margin:18px 0 8px}
.ext-tabwrap{overflow-x:auto}
.ext-tabwrap table{border-collapse:collapse;width:100%;font-size:14px;font-variant-numeric:tabular-nums}
.ext-tabwrap th,.ext-tabwrap td{padding:8px 10px;border-top:1px solid var(--ext-line);text-align:right;white-space:nowrap}
.ext-tabwrap thead th{font-size:12px;color:var(--ext-muted);font-weight:700;border-top:0}
.ext-tabwrap th:first-child{text-align:left;font-weight:600}
.ext-tabwrap td.q{color:#c0392b;font-weight:700}.ext-tabwrap td.f{color:#2a6fd0;font-weight:700}
html.s-dark .ext-tabwrap td.q,html.site-s-dark .ext-tabwrap td.q{color:#ff8d7d}
html.s-dark .ext-tabwrap td.f,html.site-s-dark .ext-tabwrap td.f{color:#7fb5ff}
#lm-ext .ext-tabwrap button{all:unset;cursor:pointer;color:var(--ext-acc);text-decoration:underline;min-height:32px;display:inline-flex;align-items:center}
.ext-sr{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}
@media(max-width:760px){.ext-tabwrap th,.ext-tabwrap td{padding:8px 5px}.ext-tabwrap table{font-size:13px}#ext-pct-map{height:auto;aspect-ratio:1/1;max-height:560px}.ext-pct-title{font-size:12px}.ext-pct-leg{gap:4px 10px;font-size:11px}}

#lm-ext{padding-bottom:0!important;margin-bottom:0!important;min-height:0!important}
/* glossário: mesmo estilo que nas outras páginas (cartão transparente, símbolo + / − à direita) */
#lm-ext .ext-info{margin-bottom:0;background:transparent;padding:20px 22px}
#lm-ext .ext-info>summary{display:flex;align-items:center;gap:12px;list-style:none;cursor:pointer;font-family:Cabin,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;font-size:17px;font-weight:700;line-height:1.5;min-height:28px;color:var(--ext-text)}
#lm-ext .ext-info>summary::-webkit-details-marker{display:none}
#lm-ext .ext-info>summary::after{content:"+";margin-left:auto;font-size:20px;font-weight:700;color:var(--ext-text)}
#lm-ext .ext-info[open]>summary::after{content:"−"}
#lm-ext .ext-info[open]>summary{margin-bottom:22px}
#lm-ext .ext-info p{font-size:14px;line-height:1.6;color:var(--ext-text)}
@media(max-width:767px){#lm-ext .ext-info{padding:18px 14px}}

#ext-pct-map.ext-pct-click{cursor:crosshair}
#lm-ext .ext-pct-pop{font-size:13px;line-height:1.45;color:#1f2630}
#lm-ext .ext-pct-pop .c{color:#566478;font-size:12px}

/* controlos do mapa: zoom por baixo da descrição, estilo arredondado, com modo escuro */
#lm-ext .leaflet-top.leaflet-left .leaflet-control{margin-left:10px}
#lm-ext .leaflet-top.leaflet-left .ext-pct-title{margin-top:10px}
#lm-ext .leaflet-bar{border:0;border-radius:10px;box-shadow:0 1px 6px #0003;overflow:hidden}
#lm-ext .leaflet-bar a{width:36px;height:36px;line-height:36px;font-size:20px;background:rgba(255,255,255,.92);color:#1b2430;border-bottom:1px solid #8996a844;text-decoration:none}
#lm-ext .leaflet-bar a:last-child{border-bottom:0}
#lm-ext .leaflet-bar a:hover{background:#fff;color:#1686b8}
#lm-ext .leaflet-bar a.leaflet-disabled{opacity:.45}
html.s-dark #lm-ext .ext-pct-title,html.site-s-dark #lm-ext .ext-pct-title{background:rgba(20,34,56,.92);color:#e4edf7;box-shadow:0 1px 6px #0006}
html.s-dark #lm-ext .leaflet-bar a,html.site-s-dark #lm-ext .leaflet-bar a{background:rgba(20,34,56,.92);color:#e4edf7;border-bottom-color:#8996a855}
html.s-dark #lm-ext .leaflet-bar a:hover,html.site-s-dark #lm-ext .leaflet-bar a:hover{background:#1a2c47;color:#68c7ec}
html.s-dark #lm-ext .leaflet-control-attribution,html.site-s-dark #lm-ext .leaflet-control-attribution{background:rgba(20,34,56,.8);color:#b5c3d6}
html.s-dark #lm-ext .leaflet-control-attribution a,html.site-s-dark #lm-ext .leaflet-control-attribution a{color:#68c7ec}
html.s-dark #lm-ext .leaflet-popup-content-wrapper,html.site-s-dark #lm-ext .leaflet-popup-content-wrapper,html.s-dark #lm-ext .leaflet-popup-tip,html.site-s-dark #lm-ext .leaflet-popup-tip{background:#142238;color:#e4edf7}
html.s-dark #lm-ext .ext-pct-pop,html.site-s-dark #lm-ext .ext-pct-pop{color:#e4edf7}
html.s-dark #lm-ext .ext-pct-pop .c,html.site-s-dark #lm-ext .ext-pct-pop .c{color:#b5c3d6}

/* seletores: mesmo estilo que na Agrometeorologia */
.ext-tools label{gap:8px;font-size:13px;font-weight:600}
#lm-ext .ext-tools select{font-family:Cabin,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;font-size:16px;font-weight:600;line-height:normal;min-height:48px;padding:10px 12px;background-color:transparent;color:var(--ext-text);border:1px solid rgba(137,150,168,.333);border-radius:10px;box-shadow:0 2px 7px -4px rgba(0,0,0,.1);width:100%;box-sizing:border-box}
html.s-dark #lm-ext .ext-tools select option,html.site-s-dark #lm-ext .ext-tools select option{background:#142238;color:#e4edf7}

/* LM-EXT-MOBILE-SEM-TITULO-V1 */
@media(max-width:760px){#lm-ext .ext-pct-title{display:none}}
