/* Ajustes finais para leitura e navegação por toque. */
.mobile-filter-toggle{display:none}
.mobile-filter-controls{display:contents;min-width:0}

@media(max-width:640px){
 .topbar{position:static;top:auto}
 .top-actions{display:grid;grid-template-columns:minmax(0,1fr) 36px 38px 36px;gap:8px 7px;width:100%;margin:10px 0 0;align-items:center}
 .mobile-filter-toggle{grid-column:1;grid-row:1;display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0;min-height:38px;padding:7px 11px;border:1px solid #49434e;border-radius:7px;background:#1b1a20;color:#eee9f1;font-size:11px;font-weight:650;text-align:left;cursor:pointer}
 .mobile-filter-chevron{font-size:15px;line-height:1;transition:transform .18s ease}
 .mobile-filters-open .mobile-filter-chevron{transform:rotate(180deg)}
 .mobile-filter-controls{grid-column:1/-1;grid-row:2;display:none;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;min-width:0;padding:10px;border:1px solid #39343e;border-radius:9px;background:#19181e}
 .mobile-filters-open .mobile-filter-controls{display:grid}
 .stage-select-wrap,.area-select-wrap{grid-row:1;min-width:0}
 .stage-select-wrap{grid-column:1}
 .area-select-wrap{grid-column:2}
 .stage-select-wrap select,.area-select-wrap select{width:100%;max-width:none;min-height:40px;padding:7px 8px;font-size:11px}
 .mobile-filter-controls .search-box{grid-column:1/-1;grid-row:2;width:100%;height:40px;min-width:0;flex:none}
 .top-actions .theme-button{grid-column:2;grid-row:1}
 .top-actions #fontSizeButton{grid-column:3;grid-row:1}
 .top-actions #aboutButton{grid-column:4;grid-row:1}
 .top-actions .icon-button{width:36px;height:36px;min-width:36px}
 .top-actions #fontSizeButton{width:38px;min-width:38px}
 body[data-theme="light"] .mobile-filter-toggle{border-color:#d5d1db;background:#fff;color:#38323d}
 body[data-theme="light"] .mobile-filter-controls{border-color:#e0dbe4;background:#fff}

 .stage-sticky-shell{margin-top:0}
 .spotlight{margin-top:18px}
 .catalog-rows{gap:22px}
 .row-track{padding-bottom:15px}
 .detail-nav{position:static;top:auto;max-width:100%;padding:8px 16px;overscroll-behavior-x:contain;scrollbar-width:none}
 .detail-nav::-webkit-scrollbar{display:none}
 .detail-nav a{display:inline-flex;align-items:center;min-height:38px}
 .detail-section,.graph-column,.detail-header-info,.detail-header-fact-source{scroll-margin-top:18px}
 .row-track,.row-component-list,.stage-shortcuts,.detail-nav,.map-frame,.graph-canvas-wrap{overscroll-behavior-x:contain;touch-action:pan-x pan-y}
 .stage-chip,.component-chip,.relation-tab{min-height:38px}
 .graph-canvas-wrap{height:50svh;max-height:520px;min-height:240px}
 .graph-actions button,.graph-controls select{min-height:36px}
}

@media(max-width:380px){
 .topbar{padding-left:12px;padding-right:12px}
 .hero{padding-right:16px;padding-left:16px}
 .catalog{padding-right:14px;padding-left:14px}
 .detail-hero{padding-right:16px;padding-left:16px}
 .detail-content{padding-right:16px;padding-left:16px}
 .mobile-filter-controls{padding:8px}
 .stage-select-wrap select,.area-select-wrap select{padding-right:5px;padding-left:6px;font-size:10px}
 .detail-nav{padding-right:12px;padding-left:12px}
 .catalog-rows{gap:18px}
}

@media(max-width:640px) and (max-height:520px){
 .graph-canvas-wrap{height:46svh;min-height:200px}
}

@media(prefers-reduced-motion:reduce){
 .mobile-filter-chevron{transition:none}
}

/* Mantém a habilidade identificada quando a pessoa percorre o conteúdo longo com badge destacado e cores de foco. */
.detail-sticky-summary[hidden]{display:none!important}
.detail-sticky-summary{position:fixed;inset:68px 0 auto;z-index:26;display:grid;grid-template-columns:max-content minmax(0,1fr);align-items:center;gap:14px;height:52px;max-height:52px;padding:4px max(4vw,calc((100vw - 1250px)/2));overflow:hidden;border-bottom:1px solid color-mix(in srgb,var(--detail-accent,#c9a4e0) 20%,rgba(255,255,255,0.08));background:linear-gradient(90deg,color-mix(in srgb,var(--detail-accent,#c9a4e0) 8%,#16151c) 0%,#15141b 40%,#16151c 100%);color:#f7f4f9;box-shadow:0 4px 16px rgba(0,0,0,0.28);backdrop-filter:blur(14px)}
.detail-sticky-summary strong{display:inline-flex;align-items:center;min-width:auto;padding:0;border:none;background:transparent;color:color-mix(in srgb,var(--detail-accent,#c9a4e0) 85%,#ffffff);font-family:Inter,system-ui,-apple-system,sans-serif;font-size:16px;font-weight:800;letter-spacing:-.01em;white-space:nowrap;box-shadow:none;text-shadow:none}
.detail-sticky-summary p{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;margin:0;color:#dcd7e2;font-size:12px;line-height:1.4;font-weight:450;border-left:1px solid color-mix(in srgb,var(--detail-accent,#c9a4e0) 25%,rgba(255,255,255,0.1));padding-left:11px}
.detail-sticky-shell{position:sticky;top:68px;z-index:25}
.detail-sticky-shell .detail-nav{position:static;top:auto}
.detail-page.has-compact-summary .detail-sticky-shell{top:120px}
.detail-page .detail-section,.detail-page #detalhe-mapa-progressao,.detail-page .graph-column,.detail-page .detail-header-info,.detail-page .detail-header-fact-source{scroll-margin-top:112px}
.detail-page.has-compact-summary .detail-section,.detail-page.has-compact-summary #detalhe-mapa-progressao,.detail-page.has-compact-summary .graph-column,.detail-page.has-compact-summary .detail-header-info,.detail-page.has-compact-summary .detail-header-fact-source{scroll-margin-top:164px}
.map-view-panel[hidden]{display:none!important}
.map-view-panel{min-width:0}
.map-workspace .map-view-switch{margin:0 0 18px}
.map-workspace .map-panel{margin:0 0 22px}
.graph-canvas-wrap{touch-action:none}
.graph-controls[hidden],.graph-status[hidden],.graph-directions[hidden],.graph-legend[hidden],.graph-hint[hidden],.graph-canvas-wrap[hidden],.graph-connection-view[hidden]{display:none!important}
.graph-card .map-view-switch{margin:12px 0 14px}
.graph-card .map-view-switch .relation-tab{min-height:36px}
.graph-map-view[hidden]{display:none!important}
.graph-map-view{display:flex;flex-direction:column;min-width:0;overflow:hidden;margin:8px 0 10px;border:1px solid #c9c5d1;border-radius:12px;background:#f5f3f8}
.graph-map-toolbar{display:flex;flex-direction:column;gap:8px;padding:11px 13px 9px;border-bottom:1px solid #d4d0da;background:#e9e7ef;color:#383441}
.graph-map-toolbar .graph-actions{justify-content:flex-end;gap:7px;padding-bottom:8px;border-bottom:1px solid #d4d0da}
.graph-map-toolbar .graph-actions button{min-height:32px;border-color:#c9c2d1;background:#fff;color:#3b3040}
.graph-map-toolbar .graph-actions button:hover{border-color:#9875a8;background:#f4eff7}
.graph-map-toolbar .graph-controls{gap:8px 13px;margin:0;color:#423b49}
.graph-map-toolbar .graph-controls fieldset{gap:7px 10px}
.graph-map-toolbar .graph-controls select{border-color:#c8bbcd;background:#fff;color:#3b3040}
.graph-map-toolbar .graph-controls input{accent-color:#754286}
.graph-map-toolbar .graph-status{margin:0;color:#765425}
.graph-map-toolbar .graph-directions{color:#625b68}
.graph-map-toolbar .graph-hint{margin:0;color:#625b68}
.graph-map-view .graph-canvas-wrap{flex:none;height:min(65vh,620px);min-height:400px;margin:0;border:0;border-radius:0;background:#f5f3f8}
.graph-connection-view{min-width:0}
.graph-connection-view .map-frame{height:min(65vh,620px);min-height:360px;margin:10px 0;border-color:#49424d;border-radius:9px;background:#f5f3f8;touch-action:none}
.graph-connection-view .map-frame svg{min-width:1000px}
.graph-connection-view .map-legend{display:flex;flex-wrap:wrap;gap:9px 16px;margin:12px 2px;color:#d7d1dc;font-size:11px}
.graph-connection-view .map-disclaimer{margin:10px 0 0;color:#bdb6c3;font-size:11px;line-height:1.5}
.graph-card[data-map-mode]:not([data-map-mode="progression"]) .graph-map-warning{display:none!important}
.map-related-list{margin-top:26px}
body[data-theme="light"] .graph-connection-view .map-legend{color:#5f5763}
body[data-theme="light"] .graph-connection-view .map-disclaimer{color:#6e6672}
.graph-card:fullscreen .graph-connection-view,.graph-card.is-expanded .graph-connection-view{flex:1 0 260px;display:flex;flex-direction:column}
.graph-card:fullscreen .graph-connection-view[hidden],.graph-card.is-expanded .graph-connection-view[hidden]{display:none!important}
.graph-card:fullscreen .graph-connection-view .map-frame,.graph-card.is-expanded .graph-connection-view .map-frame{flex:1 1 auto;height:auto;min-height:260px}
.graph-card:fullscreen .graph-map-view,.graph-card.is-expanded .graph-map-view{flex:1;min-height:0}
.graph-card:fullscreen .graph-map-view .graph-canvas-wrap,.graph-card.is-expanded .graph-map-view .graph-canvas-wrap{flex:1 0 260px;height:auto;min-height:260px}
body[data-theme="light"] .detail-sticky-summary{border-bottom:1px solid color-mix(in srgb,var(--detail-accent,#7e3a9f) 18%,#ded9e2);background:linear-gradient(90deg,color-mix(in srgb,var(--detail-accent,#7e3a9f) 8%,#ffffff) 0%,#fbf9fc 50%,#ffffff 100%);color:#26212b;box-shadow:0 3px 12px rgba(0,0,0,0.06)}
body[data-theme="light"] .detail-sticky-summary strong{background:transparent;border:none;padding:0;color:color-mix(in srgb,var(--detail-accent,#7e3a9f) 88%,#1c1024);font-size:16px;font-weight:800;box-shadow:none;text-shadow:none}
body[data-theme="light"] .detail-sticky-summary p{color:#4a4450;font-size:12px;font-weight:450;border-left:1px solid color-mix(in srgb,var(--detail-accent,#7e3a9f) 25%,#ded9e2)}

@media(max-width:640px){
 .detail-sticky-summary{inset:0 0 auto;grid-template-columns:max-content minmax(0,1fr);gap:8px;height:50px;max-height:50px;padding:4px 12px}
 .detail-sticky-summary strong{min-width:0;font-size:13.5px;font-weight:800;padding:0;border:none;background:transparent}
 .detail-sticky-summary p{font-size:11px;line-height:1.3;padding-left:6px}
 .detail-sticky-shell{top:0}
 .detail-page.has-compact-summary .detail-sticky-shell{top:50px}
 .detail-page .detail-section,.detail-page #detalhe-mapa-progressao,.detail-page .graph-column,.detail-page .detail-header-info,.detail-page .detail-header-fact-source{scroll-margin-top:54px}
 .detail-page.has-compact-summary .detail-section,.detail-page.has-compact-summary #detalhe-mapa-progressao,.detail-page.has-compact-summary .graph-column,.detail-page.has-compact-summary .detail-header-info,.detail-page.has-compact-summary .detail-header-fact-source{scroll-margin-top:104px}
 .graph-connection-view .map-frame{height:50svh;max-height:520px;min-height:240px}
 .graph-map-view .graph-canvas-wrap{height:50svh;max-height:520px;min-height:240px}
 .graph-map-toolbar{padding:10px;gap:9px}
 .graph-map-toolbar .graph-actions{justify-content:flex-start;padding-bottom:8px}
 .graph-map-toolbar .graph-controls{gap:9px 12px}
}
.detail-page #detalhe-computacao,.detail-page #detalhe-articulacoes{scroll-margin-top:190px}
@media(max-width:640px){.detail-page #detalhe-computacao,.detail-page #detalhe-articulacoes{scroll-margin-top:120px}}
