:is(.tpl-book-tools,.tpl-study-dialog){margin-top:22px;padding:18px;border:1px solid #dedfd8;border-radius:8px;background:#fffef9;color:#242a27;font:14px/1.6 Arial,sans-serif;max-width:1050px}
:is(.tpl-book-tools,.tpl-study-dialog) .tpl-book-actions{display:flex;flex-wrap:wrap;gap:12px}
:is(.tpl-book-tools,.tpl-study-dialog) button,.tpl-map-dialog button{font:600 14px Arial,sans-serif;cursor:pointer;color:#17362f;background:#fffef9;border:1px solid #c7cac1;border-radius:6px;padding:10px 14px;line-height:1.4}
:is(.tpl-book-tools,.tpl-study-dialog) button[aria-expanded=true],:is(.tpl-book-tools,.tpl-study-dialog) .tpl-map-button{background:#17362f;border-color:#17362f;color:#fff}
:is(.tpl-book-tools,.tpl-study-dialog) button:focus-visible,:is(.tpl-book-tools,.tpl-study-dialog) a:focus-visible,.tpl-map-dialog button:focus-visible,.tpl-map-dialog a:focus-visible{outline:3px solid #bb8b33;outline-offset:3px}
:is(.tpl-book-tools,.tpl-study-dialog) [hidden]{display:none!important}
:is(.tpl-book-tools,.tpl-study-dialog) h2,:is(.tpl-book-tools,.tpl-study-dialog) h3{font-family:Georgia,serif;font-weight:600;color:#17362f;line-height:1.3;margin:18px 0 10px}
:is(.tpl-book-tools,.tpl-study-dialog) h2{font-size:24px}:is(.tpl-book-tools,.tpl-study-dialog) h3{font-size:19px}
:is(.tpl-book-tools,.tpl-study-dialog) p{margin:8px 0 14px}:is(.tpl-book-tools,.tpl-study-dialog) a{color:#17362f;text-decoration:underline;text-underline-offset:4px}
:is(.tpl-book-tools,.tpl-study-dialog) .tpl-book-panel{border-top:1px solid #dedfd8;margin-top:16px;padding-top:4px}
:is(.tpl-book-tools,.tpl-study-dialog) .tpl-outline{padding-left:20px;margin:12px 0}:is(.tpl-book-tools,.tpl-study-dialog) .tpl-outline li{margin:7px 0}
:is(.tpl-book-tools,.tpl-study-dialog) .tpl-book-small{font-size:12px;color:#606965}
:is(.tpl-book-tools,.tpl-study-dialog) .tpl-place-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr));gap:14px;margin:14px 0}
:is(.tpl-book-tools,.tpl-study-dialog) .tpl-place-card{padding:16px;background:#f6f4ee;border:1px solid #dedfd8;border-radius:7px}
:is(.tpl-book-tools,.tpl-study-dialog) .tpl-place-card h3{margin:0 0 8px}:is(.tpl-book-tools,.tpl-study-dialog) .tpl-place-card p{margin:6px 0 12px}
:is(.tpl-book-tools,.tpl-study-dialog) .tpl-place-actions{display:flex;gap:14px;flex-wrap:wrap;align-items:center;font-size:13px}
.tpl-map-dialog{box-sizing:border-box;position:fixed;inset:0;margin:auto;width:min(1050px,calc(100% - 32px));height:min(760px,calc(100dvh - 48px));max-width:none;max-height:none;padding:0;border:1px solid #dedfd8;border-radius:10px;background:#fffef9;color:#242a27;font:14px/1.5 Arial,sans-serif}
.tpl-map-dialog::backdrop{background:#17362fa3}
.tpl-map-dialog .tpl-map-shell{display:flex;flex-direction:column;height:100%;min-height:0}
.tpl-map-dialog .tpl-map-head{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:16px 20px;border-bottom:1px solid #dedfd8;flex-shrink:0}
.tpl-map-dialog h2{font:600 26px/1.2 Georgia,serif;margin:0;color:#17362f}
.tpl-map-dialog .tpl-map-frame{width:100%;border:0;flex:1;min-height:0;background:#f6f4ee}
.tpl-map-dialog .tpl-map-footer{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:12px 20px;border-top:1px solid #dedfd8;font-size:12px;flex-shrink:0}
.tpl-map-dialog .tpl-map-footer a{color:#17362f;text-decoration:underline;text-underline-offset:4px}
.tpl-map-dialog .tpl-map-state{color:#606965}
@media(max-width:700px){:is(.tpl-book-tools,.tpl-study-dialog){padding:14px;margin-top:16px}.tpl-map-dialog{width:calc(100% - 16px);height:calc(100dvh - 24px);border-radius:8px}.tpl-map-dialog .tpl-map-head{padding:12px 14px}.tpl-map-dialog h2{font-size:23px}.tpl-map-dialog .tpl-map-footer{padding:10px 14px}:is(.tpl-book-tools,.tpl-study-dialog) h2{font-size:22px}}

:is(.tpl-book-tools,.tpl-study-dialog) p{color:#242a27}:is(.tpl-book-tools,.tpl-study-dialog) .tpl-book-small{color:#606965}

/* Janela de estudo fora do cabeçalho: cores independentes do tema. */
.tpl-book-tools{max-width:1320px;width:calc(100% - 64px);margin:18px auto;padding:12px 18px;background:#fffef9;color:#242a27}
.tpl-study-dialog{box-sizing:border-box;position:fixed;inset:0;margin:auto;padding:0;width:min(1000px,calc(100% - 32px));max-width:none;height:min(750px,calc(100dvh - 48px));max-height:none;border:1px solid #dedfd8;border-radius:12px;background:#fffef9;color:#242a27;font:16px/1.75 Arial,sans-serif}
.tpl-study-dialog::backdrop{background:#17362fa3}
.tpl-study-dialog[open]{display:flex;flex-direction:column}
.tpl-study-dialog *{box-sizing:border-box}
.tpl-study-dialog [hidden]{display:none!important}
.tpl-study-dialog p,.tpl-study-dialog li{color:#242a27;font-size:16px;line-height:1.75;max-width:76ch}
.tpl-study-dialog .tpl-book-small{color:#52615a;font-size:14px}
.tpl-study-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 24px;border-bottom:1px solid #dedfd8;flex-shrink:0}
.tpl-study-dialog .tpl-study-head h2{margin:0;font-size:28px;color:#17362f}
.tpl-study-body{overflow:auto;min-height:0;padding:0 24px 24px}
.tpl-study-tabs{display:flex;overflow-x:auto;gap:6px;padding:16px 0;background:#fffef9;position:sticky;top:0;z-index:1;border-bottom:1px solid #dedfd8}
.tpl-study-tabs button{flex-shrink:0;padding:10px 14px;font-size:15px}
.tpl-study-tabs button[aria-selected=true]{background:#17362f;color:#fff;border-color:#17362f}
.tpl-study-dialog .tpl-study-page{padding:8px 0;animation:tpl-study-enter .16s ease-out}
.tpl-study-dialog .tpl-study-page h3{font-size:25px;margin:16px 0;color:#17362f}
.tpl-study-card{padding:16px 18px;background:#f6f4ee;border:1px solid #dedfd8;border-radius:8px;margin:14px 0}
.tpl-study-dialog .tpl-study-card h4{font:600 20px/1.4 Georgia,serif;color:#17362f;margin:0 0 8px}
.tpl-study-dialog .tpl-study-card p{margin:0 0 10px}
.tpl-study-dialog>.tpl-book-panel{margin:0;padding:12px 24px 24px;overflow:auto}
@keyframes tpl-study-enter{from{opacity:.6;transform:translateX(8px)}to{opacity:1;transform:translateX(0)}}
@media(prefers-reduced-motion:reduce){.tpl-study-dialog .tpl-study-page{animation:none}}
@media(max-width:700px){.tpl-book-tools{width:calc(100% - 32px)}.tpl-study-dialog{width:calc(100% - 16px);height:calc(100dvh - 24px)}.tpl-study-head{padding:14px}.tpl-study-dialog .tpl-study-head h2{font-size:24px}.tpl-study-body{padding:0 16px 16px}.tpl-study-dialog>.tpl-book-panel{padding:12px 16px 16px}.tpl-study-tabs{gap:6px}.tpl-study-tabs button{font-size:14px;padding:10px}}

.tpl-map-dialog,.tpl-study-dialog{overscroll-behavior:contain}
.tpl-study-body,.tpl-study-dialog>.tpl-book-panel{overscroll-behavior:contain}

/* Ações secundárias de leitura e navegação: destaque suave. */
.tpl-map-dialog .tpl-map-footer{align-items:center}
.tpl-map-dialog .tpl-map-footer a,.tpl-study-dialog .tpl-study-card a{
 display:inline-flex;align-items:center;justify-content:center;min-height:40px;
 padding:8px 12px;box-sizing:border-box;max-width:100%;
 border:1px solid #cad8ce;border-radius:6px;background:#edf3ee;
 color:#17362f;font:600 14px/1.5 Arial,sans-serif;text-decoration:none;
}
.tpl-map-dialog .tpl-map-footer a:hover,.tpl-study-dialog .tpl-study-card a:hover{
 background:#e2ece5;border-color:#a8beaf;color:#17362f;text-decoration:none;
}

.tpl-study-dialog .tpl-reading-sources{margin-top:24px;padding-top:12px;border-top:1px solid #dedfd8;font:400 13px/1.6 Arial,sans-serif;color:#526156;}
.tpl-study-dialog .tpl-panorama-sources,.tpl-study-dialog .tpl-editorial-block{margin:26px 0;}
.tpl-study-dialog .tpl-panorama-sources>h4,.tpl-study-dialog .tpl-editorial-block>h4{font:600 20px/1.4 Georgia,serif;color:#17362f;margin:0 0 14px;}
.tpl-study-dialog .tpl-source-card{padding:16px 18px;margin:12px 0;border:1px solid #dedfd8;border-left:3px solid #a6782f;border-radius:6px;background:#f8f7f2;}
.tpl-study-dialog .tpl-source-card h5,.tpl-study-dialog .tpl-editorial-question h5{font:600 16px/1.5 Arial,sans-serif;color:#17362f;margin:0 0 6px;}
.tpl-study-dialog .tpl-source-card .tpl-source-citation{font:400 13px/1.6 Arial,sans-serif;color:#526156;margin:4px 0 9px;}
.tpl-study-dialog .tpl-source-card .tpl-source-contribution{font-size:14px;margin:0;}
.tpl-study-dialog .tpl-editorial-question{margin:16px 0;padding-top:14px;border-top:1px solid #dedfd8;}
@media(max-width:600px){.tpl-study-dialog .tpl-source-card{padding:13px 14px;}.tpl-study-dialog .tpl-panorama-sources>h4,.tpl-study-dialog .tpl-editorial-block>h4{font-size:18px;}}

/* Ações compartilhadas pelo panorama e pelo mapa. */
:is(.tpl-book-tools,.tpl-study-dialog) button,.tpl-map-dialog button{min-height:44px;}
.tpl-study-dialog .tpl-study-card h4{font:600 18px/1.5 Arial,sans-serif;color:#17362f;}
.tpl-study-dialog .tpl-study-card a,.tpl-place-actions a{display:inline-flex;align-items:center;min-height:44px;font:600 14px/1.5 Arial,sans-serif;}
.tpl-study-dialog .tpl-study-tabs{scroll-padding-inline:4px;}
/* 0.2.84 — a cartografia do Atlas não é equiparada ao local exato da cena. */
.tpl-map-dialog .tpl-map-precision{width:100%;margin:4px 0 0;padding:10px 12px;border-left:3px solid #be995c;background:#f8f2e5;color:#514a3a;font:400 13px/1.55 Arial,sans-serif}
.tpl-map-dialog .tpl-map-state{flex:1 1 60%}
.tpl-map-dialog .tpl-map-footer a{flex:0 0 auto}
.tpl-map-dialog .tpl-map-footer{max-height:min(35vh,240px);overflow-y:auto}
@media(max-width:700px){.tpl-map-dialog .tpl-map-footer{max-height:37vh;padding:10px}.tpl-map-dialog .tpl-map-precision{font-size:12px}}


/* 0.2.90 — panorama: painel editorial com navegação lateral responsiva. */
.tpl-study-dialog:has(.tpl-study-body){width:min(1120px,calc(100% - 42px));height:min(820px,calc(100dvh - 42px));background:#fffefb;border-color:#d7e0d6;border-radius:16px;box-shadow:0 25px 90px #091f1a42}
.tpl-study-dialog:has(.tpl-study-body) .tpl-study-head{padding:23px 32px 21px;background:linear-gradient(120deg,#f1f6f1 0%,#fffefb 78%);align-items:flex-start;border-color:#dfe7de;gap:18px}
.tpl-study-dialog .tpl-study-heading{min-width:0}
.tpl-study-dialog .tpl-study-eyebrow{display:block;font:700 10px/1.4 Arial,sans-serif;letter-spacing:.14em;color:#9a7035;margin-bottom:7px}
.tpl-study-dialog:has(.tpl-study-body) .tpl-study-head h2{font:600 clamp(23px,2.8vw,30px)/1.2 Georgia,serif;color:#17362f;margin:0}
.tpl-study-dialog .tpl-study-subtitle{font:400 13px/1.5 Arial,sans-serif;color:#5c6b60;margin:6px 0 0;max-width:72ch}
.tpl-study-dialog .tpl-study-close{background:white;border-color:#d1dcd0;border-radius:8px;padding:9px 16px;flex-shrink:0}
.tpl-study-dialog .tpl-study-body{flex:1;min-height:0;display:grid;grid-template-columns:216px minmax(0,1fr);padding:0;overflow:hidden}
.tpl-study-dialog .tpl-study-tabs{position:static;display:flex;flex-direction:column;align-items:stretch;gap:5px;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;background:#f5f7f2;padding:24px 12px;border-bottom:0;border-right:1px solid #e2e7df}
.tpl-study-dialog .tpl-study-tabs .tpl-study-tab{display:flex;align-items:center;gap:12px;width:100%;flex:0 0 auto;min-height:48px;padding:12px 13px;text-align:left;border:1px solid transparent;border-radius:8px;background:transparent;color:#355144;font:600 14px/1.3 Arial,sans-serif}
.tpl-study-dialog .tpl-study-tabs .tpl-study-tab:hover{background:#e9f0e8;border-color:#d6e1d6}
.tpl-study-dialog .tpl-study-tabs .tpl-study-tab[aria-selected=true]{color:#17362f;background:#fff;border-color:#b3cdb9;box-shadow:inset 3px 0 0 #2d674e}
.tpl-study-dialog .tpl-study-tabs .tpl-study-tab-index{font:600 11px/1 Arial,sans-serif;letter-spacing:.05em;color:#89988b}
.tpl-study-dialog .tpl-study-tabs .tpl-study-tab[aria-selected=true] .tpl-study-tab-index{color:#346649}
.tpl-study-dialog .tpl-study-pages{min-width:0;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:26px clamp(20px,4vw,44px) 34px}
.tpl-study-dialog .tpl-study-page{max-width:790px;padding:0;min-height:0}
.tpl-study-dialog .tpl-study-page-kicker{display:block;font:700 10px/1.4 Arial,sans-serif;letter-spacing:.13em;text-transform:uppercase;color:#966e36;margin:0 0 11px}
.tpl-study-dialog .tpl-study-page h3{font:600 clamp(23px,2.3vw,29px)/1.26 Georgia,serif;margin:0 0 20px;color:#17362f}
.tpl-study-dialog .tpl-study-page>p{font:400 16px/1.8 Arial,sans-serif;margin:0 0 18px;max-width:72ch;color:#33443c}
.tpl-study-dialog .tpl-study-page>p.tpl-study-lead{padding:0 0 18px;border-bottom:1px solid #e2e9df;color:#244335;font-size:16px;line-height:1.78}
.tpl-study-dialog .tpl-study-card{margin:16px 0;padding:18px 20px;border:1px solid #dce6db;border-left:3px solid #7da68a;border-radius:9px;background:#f7f9f5}
.tpl-study-dialog .tpl-study-card h4{color:#17362f;margin:0 0 9px}
.tpl-study-dialog .tpl-study-card p{font-size:15px;line-height:1.75;color:#38473e}
.tpl-study-dialog .tpl-panorama-sources,.tpl-study-dialog .tpl-editorial-block{margin-top:30px}
@media(max-width:740px){
 .tpl-study-dialog:has(.tpl-study-body){width:calc(100% - 16px);height:calc(100dvh - 18px);border-radius:11px}
 .tpl-study-dialog:has(.tpl-study-body) .tpl-study-head{padding:16px;align-items:flex-start}
 .tpl-study-dialog .tpl-study-subtitle{font-size:12px}
 .tpl-study-dialog .tpl-study-body{display:flex;flex-direction:column}
 .tpl-study-dialog .tpl-study-tabs{flex-direction:row;align-items:center;min-height:0;overflow-x:auto;overflow-y:hidden;gap:7px;padding:10px 14px;border-right:0;border-bottom:1px solid #e2e7df;scroll-padding-inline:14px}
 .tpl-study-dialog .tpl-study-tabs .tpl-study-tab{width:auto;min-height:42px;gap:7px;padding:9px 12px;white-space:nowrap;font-size:13px}
 .tpl-study-dialog .tpl-study-tabs .tpl-study-tab[aria-selected=true]{box-shadow:inset 0 -3px 0 #2d674e}
 .tpl-study-dialog .tpl-study-pages{flex:1;padding:21px 19px 30px}
 .tpl-study-dialog .tpl-study-page>p{font-size:15px;line-height:1.75}
 .tpl-study-dialog .tpl-study-page>p.tpl-study-lead{font-size:15px}
 .tpl-study-dialog .tpl-study-page h3{font-size:23px;margin-bottom:17px}
}
@media(prefers-reduced-motion:reduce){.tpl-study-dialog .tpl-study-page{animation:none}}
