/* Nexus layout and laptop accessibility improvements */
/* Online pill beside the wordmark, not beneath the logo */
.brand-block {position:relative !important; overflow:visible !important;}
.brand-copy {position:static !important;}
.nexus-presence-count {position:absolute !important; left:300px !important; top:50% !important; transform:translateY(-50%) !important; margin:0 !important; white-space:nowrap !important; z-index:4; font-size:12px;}
@media(max-width:1050px){.nexus-presence-count{left:275px !important;font-size:11px;}}
@media(max-width:700px){.nexus-presence-count{left:205px !important;padding:4px 6px !important;}}
/* Proper styled, always-visible Presence choices */
.nexus-presence-settings {gap:12px !important;}
.nexus-presence-choice-label {font-size:13px;font-weight:650;color:#ecf3ff;}
.nexus-presence-choices {display:grid;gap:8px;}
.nexus-presence-settings .nexus-presence-choice {width:100%;min-height:55px;display:flex;align-items:center;gap:12px;padding:10px 13px;text-align:left;color:#eaf3ff;border:1px solid rgba(135,180,235,.28);border-radius:12px;background:rgba(13,25,49,.7);cursor:pointer;transition:background .15s,border-color .15s,box-shadow .15s;}
.nexus-presence-choice span:last-child {display:grid;gap:3px;}
.nexus-presence-choice strong {font-size:13px;font-weight:700;}
.nexus-presence-choice small {font-size:11px !important;color:#adc2db !important;}
.nexus-presence-settings .nexus-presence-choice:hover {border-color:rgba(150,203,255,.7);background:rgba(48,76,119,.6);}
.nexus-presence-settings .nexus-presence-choice.selected {border-color:var(--accent,#8d6bff);background:color-mix(in srgb,var(--accent,#8d6bff) 19%,rgba(10,20,40,.9));box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent,#8d6bff) 40%,transparent);}
.nexus-presence-choice:focus-visible{outline:2px solid #b8ddff;outline-offset:2px;}
/* Contained scrolling so hub still doesn't scroll */
.tools-space,.downloads-space{padding:clamp(12px,3vh,32px) clamp(12px,3vw,42px) !important;align-items:center !important;}
.tools-panel,.downloads-panel{display:flex !important;flex-direction:column !important;min-height:0 !important;max-height:calc(100dvh - 24px) !important;transform:none !important;}
.tools-header,.downloads-header{flex:0 0 auto;}
.tools-content,.downloads-content{flex:1 1 auto !important;min-height:0 !important;max-height:none !important;overflow-y:auto !important;overscroll-behavior:contain;}
.archives-space{height:100dvh;min-height:0;}
.archives-space-shell,.archives-content {min-height:0 !important;}
.archives-categories,.archives-articles,.archives-reader{min-height:0 !important;max-height:100% !important;overflow-y:auto !important;overscroll-behavior:contain;align-content:start;}
.archives-reader{display:block !important;place-items:initial !important;}
.archives-reader-empty{margin:clamp(30px,8vh,80px) auto;}
/* More breathing room on common small laptop displays */
@media(max-height:820px){
 .tools-header,.downloads-header{padding:14px 20px !important;}
 .tools-content,.downloads-content{padding:17px 20px 22px !important;}
 .archives-space{padding:6px 10px 10px !important;}
 .archives-space-header{padding:14px 18px !important;}
 .archives-reader{padding:18px !important;}
}
@media(max-width:800px){.tools-panel,.downloads-panel{width:calc(100vw - 24px) !important;}.tools-grid{grid-template-columns:repeat(2,minmax(0,1fr)) !important;}}
@media(max-width:560px){.tools-grid{grid-template-columns:1fr !important;}}


/* 2026-10-19: bounded scrollable Tools and Downloads panels.
   Explicit height prevents the grid's min-content size defeating overflow. */
#toolsSpace, #downloadsSpace {
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  height:100dvh !important;
  min-height:0 !important;
  overflow:hidden !important;
  padding:clamp(10px,2.5vh,28px) clamp(12px,3vw,42px) !important;
}
#toolsSpace[hidden], #downloadsSpace[hidden] {display:none !important;}
#toolsSpace > .tools-panel,
#downloadsSpace > .downloads-panel {
  display:flex !important;
  flex-direction:column !important;
  width:min(100%,1180px) !important;
  height:100% !important;
  max-height:100% !important;
  min-height:0 !important;
  overflow:hidden !important;
  transform:none !important;
}
#toolsSpace .tools-header,
#downloadsSpace .downloads-header {flex:0 0 auto !important;}
#toolsSpace .tools-content,
#downloadsSpace .downloads-content {
  display:block !important;
  flex:1 1 0% !important;
  min-height:0 !important;
  height:auto !important;
  max-height:none !important;
  overflow-x:hidden !important;
  overflow-y:auto !important;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  scrollbar-color:color-mix(in srgb,var(--accent) 65%,transparent) transparent;
  -webkit-overflow-scrolling:touch;
}
@media(max-width:900px) {
  #toolsSpace, #downloadsSpace {padding:10px 12px !important;}
  #toolsSpace > .tools-panel, #downloadsSpace > .downloads-panel {width:100% !important;}
}

/* Archives wiki references: remove default pale browser button backgrounds. */
#archivesReader a,
#archivesReader button:not(.archives-ai) {
  color:color-mix(in srgb,var(--accent) 65%,white) !important;
  background:rgba(112,85,190,.17) !important;
  border:1px solid rgba(165,145,235,.24) !important;
  border-radius:5px !important;
  padding:1px 5px !important;
  font:inherit !important;
  text-decoration:none !important;
  cursor:pointer;
  box-shadow:none !important;
}
#archivesReader a:hover,
#archivesReader button:hover {
  background:rgba(112,85,190,.32) !important;
  color:#fff !important;
}
#archivesReader code {background:rgba(18,21,37,.72);color:#e0d6ff;border-radius:4px;padding:1px 4px;}

/* Keep Tools/Downloads unobstructed when opened.
   The topbar was showing through the translucent Space panels. */
body.tools-space-open .topbar,
body.downloads-space-open .topbar { display:none !important; }
#toolsSpace, #downloadsSpace { z-index:130 !important; }
#toolsSpace .tools-header, #downloadsSpace .downloads-header {
  position:relative !important; z-index:2 !important;
}
