/* Atlas workspace upgrade: grouped navigation, context actions, music and board. */
.nav-group{border:1px solid #20364a;border-radius:8px;background:#0d1927;padding:3px 5px 6px;margin:3px 0}
.nav-group>summary{list-style:none;cursor:pointer;color:#91b8d7;text-transform:uppercase;letter-spacing:.10em;font-weight:850;font-size:10px;padding:11px 9px;display:flex;align-items:center;justify-content:space-between}
.nav-group>summary::-webkit-details-marker{display:none}
.nav-group>summary:after{content:"+";font-size:17px;color:#87aac6}
.nav-group[open]>summary:after{content:"−"}
.nav-group .nav-link{height:36px;font-size:12px;padding:0 8px}
.nav-group .nav-icon{font-size:16px;width:18px}
.nav-group:has(.nav-link.active){border-color:#315978}
.arc-story-scroller{cursor:grab}
.arc-story-scroller.is-dragging,.arc-story-scroller.is-dragging *{cursor:grabbing!important;user-select:none}
.atlas-actionbar{display:flex;gap:7px;flex-wrap:wrap;margin:10px 0 16px;padding:12px 0;border-block:1px solid #325271}
.atlas-actionbar button{font-size:11px;padding:10px 12px;line-height:1.1;min-height:35px;white-space:nowrap}
.atlas-actionbar.compact{margin:7px 0;padding:9px 0;border-color:#2d4e65}
.atlas-actionbar.compact button{flex:1 1 90px;white-space:normal;padding:8px 6px;font-size:10px}
#readerActionBar{margin:0 17px 12px}
.theory-toolbar,.jukebox-toolbar,.jukebox-player-controls{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:15px 0}
.theory-toolbar .outline-button,.theory-import{cursor:pointer}
.theory-toolbar .active{border-color:#83e0e8;color:#e3fbff;background:#22526c}
.theory-viewport{height:min(70vh,780px);min-height:430px;overflow:auto;background-color:#081522;background-image:linear-gradient(#4c78901d 1px,transparent 1px),linear-gradient(90deg,#4c78901d 1px,transparent 1px);background-size:40px 40px;border:1px solid #375b72;border-radius:9px;scrollbar-width:thin}
.theory-canvas{position:relative;width:1800px;height:1100px}
#theoryEdges{position:absolute;inset:0;width:1800px;height:1100px;pointer-events:none}
.theory-empty{padding:45px;color:#9bbbd1}
.theory-card{position:absolute;width:235px;min-height:145px;border:1px solid #4b819e;border-radius:8px;background:#122d41;box-shadow:0 6px 21px #010609b9;color:#d7e9f6;padding:0 10px 10px;display:flex;flex-direction:column;gap:8px}
.theory-card.connecting{outline:2px solid #bdeaff}
.theory-card-head{display:flex;gap:8px;align-items:center;background:#235070;margin:0 -10px;padding:9px;border-radius:7px 7px 0 0;cursor:grab;touch-action:none}
.theory-card-head strong{flex:1;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.theory-card-head button{border:0;background:transparent;color:#ffe9de;font-size:19px}
.theory-card label{display:grid;gap:4px;font-size:10px;color:#9dbcd4}
.theory-card input,.theory-card textarea{width:100%;font-size:12px;padding:6px;resize:vertical}
.theory-card-links{display:flex;flex-wrap:wrap;gap:5px}
.theory-card-links button,.theory-source{font-size:10px;color:#b9dfff;border:1px solid #496e86;background:#183d56;border-radius:5px;padding:4px}
.jukebox-toolbar input[type=search]{flex:1 1 270px;padding:11px;min-width:130px}
.jukebox-toolbar span{color:#9fbdd5;font-size:11px}
.jukebox-toolbar label{font-size:11px;color:#aac3d6;cursor:pointer}
.jukebox-layout{display:grid;grid-template-columns:225px minmax(0,1fr);gap:13px;align-items:start}
.jukebox-albums{display:flex;flex-direction:column;max-height:500px;overflow:auto;background:#101d2a;border:1px solid #35536b;border-radius:8px}
.jukebox-album{display:flex;flex-direction:column;align-items:start;gap:2px;min-height:49px;text-align:left;padding:9px;border:0;border-bottom:1px solid #223a4c;background:none;color:#b8cede}
.jukebox-album strong{font-size:12px}.jukebox-album small{color:#83a9c7;font-size:10px}
.jukebox-album.active{background:#1b455f;color:#eaf9ff}
#jukeboxAlbumTitle{margin:6px 0 11px;color:#d6efff}
.jukebox-tracks{max-height:500px;overflow:auto;border:1px solid #284862;background:#0c1b2a;border-radius:7px}
.jukebox-track{display:grid;grid-template-columns:31px minmax(0,1fr) 28px auto;gap:9px;align-items:center;padding:11px;border-bottom:1px solid #29435b}
.jukebox-track.playing{background:#17394f}
.jukebox-track>button{border:1px solid #355e79;background:#173b55;color:#bde9ff;border-radius:5px;min-height:27px}
.jukebox-track>div{display:grid;gap:4px;min-width:0}
.jukebox-track strong{font-size:12px;overflow-wrap:anywhere}
.jukebox-track small{font-size:10px;color:#819cb4}
.jukebox-track a{font-size:10px;white-space:nowrap}
.jukebox-player{border:1px solid #355a75;border-radius:8px;background:#112638;padding:15px;margin-top:13px}
#jukeboxNow{color:#d9f0ff;font-weight:800;margin-bottom:10px}
#jukeboxAudio{width:100%;margin:7px 0}
.theory-board-toolbar{display:flex;align-items:end;gap:8px;flex-wrap:wrap;padding:13px;background:#122439;border:1px solid #36536b;border-radius:10px;margin:12px 0 4px}
.theory-board-toolbar label{display:grid;gap:5px;flex:1 1 220px;font-size:10px;font-weight:800;color:#a6cde5;letter-spacing:.08em}
.theory-board-toolbar select{width:100%;min-width:190px;font-size:13px}
.theory-board-toolbar button{font-size:11px}
.theory-finder,.theory-evidence-panel{background:#102537;border:1px solid #38627b;border-radius:9px;padding:15px;margin:12px 0 15px}
.theory-finder-head{display:flex;justify-content:space-between;align-items:center;gap:10px;color:#d5f2ff}
.theory-finder-filters{display:grid;grid-template-columns:minmax(200px,2fr) minmax(160px,1fr);gap:9px;margin:12px 0}
.theory-finder-filters label,#theoryFinderTarget label{display:grid;gap:5px;color:#9bc5e0;font-size:11px}
.theory-find-results{max-height:300px;overflow:auto;display:grid;gap:5px}
.theory-find-result{display:grid;text-align:left;gap:4px;padding:10px 12px;color:#e1f1fc;border:1px solid #2e546f;background:#122e43;border-radius:7px}
.theory-find-result:hover,.theory-find-result:focus-visible{border-color:#82cbea;background:#1c4560}
.theory-find-result span,.theory-evidence-detail small{font-size:9px;color:#79bede;letter-spacing:.07em;font-weight:800;text-transform:uppercase}
.theory-find-result strong{font-size:12px}
.theory-find-result small{font-size:11px;color:#a9bdce;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.theory-evidence-detail{display:flex;align-items:center;gap:8px;border-top:1px solid #345169;padding:9px 0}
.theory-evidence-detail>div{flex:1;min-width:0;display:grid;gap:4px}
.theory-evidence-detail strong{font-size:12px;color:#e3f3ff}
.theory-evidence-detail p{margin:3px 0;color:#9db9d0;font-size:11px;line-height:1.4}
.theory-evidence-detail button{font-size:10px;color:#c5e8ff;background:#163b56;border:1px solid #456987;border-radius:5px;padding:7px}
.theory-card{z-index:1;gap:7px;min-height:195px;padding-bottom:10px}
.theory-card:hover,.theory-card:focus-within{z-index:4;border-color:#84c6e8}
.theory-card-head{position:relative;touch-action:none;min-height:38px}
.theory-card input[data-theory-tag]{font-size:10px;padding:5px 7px}
.theory-notes{font-size:10px;color:#99bed8;border-top:1px solid #284b62;padding-top:4px}
.theory-notes summary{cursor:pointer}
.theory-notes textarea{margin-top:6px;width:100%}
.theory-port{position:absolute;top:49px;width:19px;height:19px;border-radius:50%;border:2px solid #a9e9f9;background:#20577a;box-shadow:0 0 0 3px #091e31;cursor:crosshair;z-index:10}
.theory-port-in{left:-11px;background:#31577c}
.theory-port-out{right:-11px;background:#65c4e8;touch-action:none}
.theory-port-out:hover,.theory-port-out:focus-visible{background:#e5f8ff;box-shadow:0 0 0 5px #26648a}
.theory-card-actions{display:flex;gap:4px;align-items:center;flex-wrap:wrap}
.theory-card-actions button{font-size:9px;min-height:26px;padding:5px;border-radius:5px;border:1px solid #456987;background:#173b56;color:#c8eaff}
.theory-card-actions .primary-button{background:#245e7f;color:#fff}
.theory-evidence-preview{display:grid;gap:4px}
.theory-evidence-preview button{display:flex;gap:5px;align-items:center;width:100%;min-width:0;background:#0a2539;color:#b9d9ed;border:1px solid #31516c;border-radius:5px;padding:5px;text-align:left;cursor:pointer}
.theory-evidence-preview button span{font-size:8px;max-width:78px;min-width:42px;color:#76c8f0;font-weight:800;text-transform:uppercase;overflow-wrap:anywhere}
.theory-evidence-preview button strong{font-size:10px;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.theory-evidence-preview small{color:#9fc1d5;font-size:9px}
.theory-tag-chips{display:flex;gap:3px;flex-wrap:wrap}
.theory-tag-chips button{background:#204962;border:1px solid #3f7995;color:#c1e6fb;padding:3px 5px;border-radius:10px;font-size:9px}
@media(max-width:720px){.theory-finder-filters{grid-template-columns:1fr}.theory-board-toolbar{padding:8px}.theory-board-toolbar button{flex:1 1 auto}}
@media(max-width:720px){
  .sidebar-navigation{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;overflow:visible}
  .nav-group{min-width:0}.nav-group .nav-link{min-width:0;width:100%;font-size:11px}
  .nav-group>summary{padding:8px 5px;font-size:9px}
  .jukebox-layout{grid-template-columns:1fr}.jukebox-albums{max-height:160px}
  .atlas-actionbar{padding:9px 0}
}

#jukeboxPlayer[hidden], #readerChapterLabel[hidden] { display: none !important; }

.reader-scene-search{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:12px 18px 0}
.reader-scene-search label{font-weight:700;color:#c7dbeb}
.reader-scene-search input{flex:1;min-width:180px}
.reader-scene-search-results{display:grid;gap:5px;max-height:220px;overflow:auto;padding:0 18px}
.reader-scene-search-results:empty{display:none}
.reader-scene-search-results button{text-align:left;background:#152b40;color:#e0eef9;border:1px solid #355a75;border-radius:5px;padding:8px}
.reader-scene-search-results button strong{color:#8dcaef;margin-right:8px}
#readerSceneSearchStatus{padding:0 18px}
