/* Sylva 0.999 beta 2 — Reader, Maps and board navigation. Theme tokens stay shared. */
html[data-route="reader"]{--reader-chrome-height:72px}
html.workspace-entered[data-route="reader"] .topbar{display:grid!important;opacity:1!important;pointer-events:auto!important;transform:none!important}
html.workspace-entered[data-route="reader"] #rail{display:flex!important}
html[data-route="reader"] .main-area{position:relative!important;inset:auto!important;grid-column:1!important;grid-row:2!important;width:100%!important;height:calc(100dvh - var(--reader-chrome-height))!important;margin:0!important;z-index:auto}
html[data-route="reader"] .topbar-center,html[data-route="reader"] .writer-project-actions{display:none!important}
#readerView .reader-shell{min-height:0;overflow:hidden}
#readerView .reader-bar{position:relative;top:auto;left:auto;transform:none;flex:0 0 auto;width:100%;max-width:none;height:auto;min-height:78px;padding:14px 24px;gap:18px;display:flex;flex-wrap:wrap;justify-content:space-between;border:0!important;border-bottom:1px solid var(--line)!important;border-radius:0!important;opacity:1!important;box-shadow:none!important;background:var(--surface-strong)!important;backdrop-filter:none;color:var(--text)!important;z-index:80}
#readerView .reader-position{padding:0;min-width:180px;max-width:none;flex:1 1 240px}
#readerView .reader-position small{display:block;color:var(--muted)!important;font-size:.8125rem!important;line-height:1.4!important;letter-spacing:.02em;white-space:normal;overflow-wrap:anywhere}
#readerView .reader-position h1{font-family:var(--theme-heading,var(--theme-ui,system-ui));font-size:1.35rem;font-weight:550;line-height:1.3;margin:5px 0 0;color:var(--text);overflow-wrap:anywhere}
.reader-main-actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px;min-width:0}
#readerView .reader-main-actions button,#readerView .reader-main-actions summary{min-height:44px;font-size:.875rem!important;padding:9px 12px;border-radius:8px;white-space:nowrap}
#readerView .reader-main-actions .soft-btn{display:inline-flex;align-items:center;gap:8px}
#readerView .reader-main-actions svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex:none}
#readerView .reader-notes-toggle{position:static;width:auto;height:auto;min-width:0;border:1px solid var(--line);background:var(--surface);color:var(--text)}
#readerView .reader-notes-toggle span{position:static;background:none;color:inherit;font:inherit;width:auto;min-width:0;height:auto;border:0;padding:0}
#readerNotesCount{font-variant-numeric:tabular-nums;color:var(--muted)!important}
#readerView .reader-edit-text{border-color:var(--accent);background:var(--accent-soft)}
.reader-options{position:relative}
.reader-options>summary{cursor:pointer;border:1px solid var(--line);background:var(--surface);color:var(--text);border-radius:8px}
.reader-options-body{position:absolute;right:0;top:calc(100% + 8px);width:280px;max-width:calc(100vw - 40px);padding:20px;display:grid;gap:9px;border:1px solid var(--line);border-radius:10px;background:var(--surface-strong);box-shadow:var(--shadow);z-index:100}
.reader-options-body>label{font-size:.875rem;color:var(--muted);margin-top:6px}
.reader-options-body>small{font-size:.8125rem;line-height:1.5;color:var(--muted);margin-top:6px}
#readerView .reader-options .reader-scope,#readerView .reader-options .reader-book-format,#readerView .reader-view-toggle{width:100%;max-width:none;height:auto;min-height:44px;font-size:.9375rem!important;display:flex;gap:10px;align-items:center;padding:10px 12px;color:var(--text)!important;border:1px solid var(--line);border-radius:7px;background:var(--surface)}
#readerView .reader-view-toggle svg{width:20px;height:20px}
#readerView .reader-view-toggle{justify-content:flex-start;padding-left:44px}
#readerView .reader-view-toggle .reader-view-icon{left:22px}
#readerView .reader-navigation{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:0 0 auto;padding:4px 24px;border-bottom:1px solid var(--line);background:var(--surface-strong);color:var(--muted);font-size:.8125rem}
.reader-navigation>div{display:flex;align-items:center;gap:12px}
#readerView .reader-navigation .reader-icon-btn{min-width:44px;min-height:44px;width:44px;height:44px;border-radius:8px;color:var(--text);background:none}
#readerScenePosition{font-variant-numeric:tabular-nums;min-width:90px;text-align:center}
#readerView .reader-viewport{padding:24px 24px 40px!important;min-height:0;flex:1 1 0;overflow:auto;scroll-padding-top:24px}
#readerView .reader-viewport.book-active{padding:12px 16px 16px!important;overflow:hidden}
#readerView .reader-document{width:min(840px,100%);max-width:100%;margin:0 auto;padding:clamp(24px,5vw,62px);border-radius:6px;box-shadow:0 10px 35px #00000010}
#readerView .reader-sheet{padding-inline:0;max-width:100%;border:0;box-shadow:none}
#readerView .reader-editor:not(.reader-book-editor){font-size:20px!important;line-height:1.8!important}
#readerView .reader-editor[contenteditable="false"]{cursor:text;outline:none;user-select:text;-webkit-user-select:text}
#readerView .reader-editor:focus-visible{outline:1px solid var(--line);outline-offset:8px}
#readerView .reader-scene-label{font-size:.8125rem!important;line-height:1.5;white-space:normal;overflow-wrap:anywhere}
#readerView .reader-book-view{height:100%;min-height:0;padding:0}
#readerView .reader-book-stage{flex:1 1 0;min-height:0}
#readerView .reader-book-status{flex:0 0 auto;font-size:.8125rem!important;padding-top:12px}
#readerView .reader-book-nav{min-width:44px;min-height:44px}
#readerView .reader-annotation-tools{position:absolute;bottom:18px;left:50%;transform:translateX(-50%);z-index:90;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px;width:max-content;max-width:calc(100% - 32px);padding:12px 16px;border:1px solid var(--line);border-radius:10px;background:var(--surface-strong);box-shadow:var(--shadow);color:var(--text)}
.reader-annotation-tools>span{font-size:.8125rem;color:var(--muted)}
#readerView .reader-highlights{display:flex;gap:4px;padding:0;border:0}
#readerView .reader-highlights button{width:44px!important;height:44px!important;min-width:44px;min-height:44px;border-radius:8px!important;position:relative;background:transparent!important;border:1px solid var(--line)!important}
#readerView [data-reader-highlight]::before{content:'';position:absolute;inset:12px;border-radius:3px;background:var(--reader-highlight);border:1px solid #00000020}
#readerView .reader-note-btn{min-height:44px;min-width:44px;width:auto;font-size:.875rem!important;gap:8px;color:var(--text)!important}
#readerView .reader-note-btn span{display:inline}
#readerAnnotationClose{min-width:44px;min-height:44px}
#readerView .reader-notes-panel{position:absolute;inset:0 0 0 auto;width:min(380px,calc(100% - 24px));max-width:none;z-index:100;border:0;border-left:1px solid var(--line);border-radius:0;background:var(--surface-strong)!important;backdrop-filter:none;padding:0;box-shadow:-8px 0 30px #00000010;display:flex;flex-direction:column;color:var(--text);transform:translateX(105%);visibility:hidden;pointer-events:none}
#readerView .reader-notes-panel.open{transform:none;visibility:visible;pointer-events:auto}
#readerView .reader-notes-head{padding:18px 20px;min-height:72px;gap:12px}
#readerView .reader-notes-head h2{font-size:1.25rem;margin:0;font-family:var(--theme-heading,var(--theme-ui,system-ui))}
#readerView .reader-notes-head button{width:44px;height:44px;font-size:24px}
.reader-side-tabs{padding:0 14px 8px;margin:0!important}
#readerView .reader-notes-list,.reader-contents-list{padding:16px 20px;overflow:auto;min-height:0;flex:1 1 auto}
#readerView .reader-note-item{padding:16px 0;border:0;border-bottom:1px solid var(--line);border-radius:0;background:none;gap:10px}
#readerView .reader-note-item small{font-size:.8125rem!important;line-height:1.5}
#readerView .reader-note-item b{font-size:1rem;line-height:1.5}
#readerView .reader-note-item em,#readerView .reader-notes-empty span{font-size:.9375rem!important;line-height:1.65;white-space:pre-wrap;-webkit-line-clamp:unset;overflow-wrap:anywhere}
.reader-contents-act{margin:0 0 24px}
.reader-contents-act h3{font-size:.875rem;color:var(--muted);font-weight:550;margin:0 0 10px;overflow-wrap:anywhere}
.reader-contents-act details{margin-bottom:8px}
.reader-contents-act summary{cursor:pointer;min-height:44px;padding:12px 0;font-size:.9375rem;font-weight:600;overflow-wrap:anywhere}
.reader-contents-act button{display:block;width:100%;min-height:44px;margin:2px 0;padding:10px 12px;text-align:left;border:0;border-left:2px solid transparent;background:none;color:var(--text);font:inherit;font-size:.9375rem;line-height:1.5;overflow-wrap:anywhere;border-radius:0 6px 6px 0}
.reader-contents-act button[aria-current="true"]{border-left-color:var(--accent);background:var(--accent-soft);font-weight:600}
.reader-contents-act button:hover{background:var(--surface-2)}
#readerView [hidden]{display:none!important}
#readerView button:focus-visible,#readerView summary:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* Maps: same surfaces as the rest of Sylva, with reading before editing. */
#mapsView .sylva-map-view{grid-template-columns:300px minmax(0,1fr);--map-text:var(--text);--map-muted:var(--muted);--map-panel:var(--surface-strong);--map-panel-soft:var(--surface-2);--map-line:var(--line);font-family:var(--theme-ui,system-ui)}
#mapsView .sylva-map-sidebar{background:var(--surface-strong);backdrop-filter:none;min-height:0}
#mapsView .sylva-map-sidebar-head{padding:18px 18px 16px}
#mapsView .sylva-map-kicker{font-size:.75rem;letter-spacing:.08em;font-weight:550}
#mapsView .sylva-map-title-row{margin-top:10px;gap:8px}
#mapsView .sylva-map-title-row select{font-family:inherit;font-size:1rem;line-height:1.4;min-height:44px;border:1px solid var(--line);border-radius:7px;padding:8px;outline:revert}
#mapsView .sylva-map-title-row button{width:44px;height:44px;min-width:44px;min-height:44px;flex-basis:44px}
#mapsView .sylva-map-storage{font-size:.8125rem;line-height:1.5;align-items:start;flex-wrap:wrap;gap:8px;margin-top:14px}
#mapsView .sylva-map-storage i{display:none}
#mapsView .sylva-map-storage span{flex:1 1 140px}
#mapsView .sylva-map-cloud-pick{font-size:.8125rem;min-height:44px;padding:8px 10px;flex:0 0 auto}
#mapsView .sylva-map-search{padding:14px 16px 8px}
#mapsView .sylva-map-search input{font-size:.9375rem;min-height:44px;border-radius:7px;padding:10px 12px}
#mapsView .sylva-map-side-tabs{padding:4px 14px 10px;gap:6px}
#mapsView .sylva-map-side-tabs button{min-height:44px;font-size:.9375rem;border-radius:7px}
#mapsView .sylva-map-side-pane{padding:0 16px 16px;overflow:auto;min-height:0}
#mapsView .sylva-map-list-item{border:0;border-bottom:1px solid var(--line);border-radius:0;background:none;padding:14px 0;min-height:62px;gap:10px}
#mapsView .sylva-map-list-item.active{background:var(--accent-soft);border-left:2px solid var(--accent);padding-left:8px}
#mapsView .sylva-map-list-copy b{font-size:.9375rem;line-height:1.4;white-space:normal;overflow-wrap:anywhere}
#mapsView .sylva-map-list-copy small{font-size:.8125rem;line-height:1.5;white-space:normal;overflow-wrap:anywhere}
#mapsView .sylva-map-list-kind{font-size:.75rem;align-self:start;margin-top:2px}
#mapsView .sylva-map-sidebar-foot{font-size:.8125rem;line-height:1.6;padding:12px 18px}
#mapsView .sylva-map-main{display:grid;grid-template-rows:auto minmax(0,1fr);min-width:0;min-height:0}
#mapsView .sylva-map-top-actions{position:relative;inset:auto;transform:none;grid-row:1;grid-column:1;display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px;padding:12px 18px;border-bottom:1px solid var(--line);background:var(--surface-strong);z-index:32;max-width:none}
#mapsView .sylva-map-top-actions>.sylva-map-primary{margin-right:auto}
#mapsView .sylva-map-top-actions button,#mapsView .sylva-map-file-menu>summary{min-height:44px;font-size:.875rem;padding:9px 12px;border-radius:7px;gap:8px}
#mapsView .sylva-map-top-actions button svg{width:18px;height:18px}
.sylva-map-file-menu{position:relative}
.sylva-map-file-menu>summary{cursor:pointer;border:1px solid var(--line);color:var(--text);background:var(--surface)}
.sylva-map-file-menu>div{position:absolute;top:calc(100% + 8px);right:0;min-width:180px;padding:10px;background:var(--surface-strong);border:1px solid var(--line);border-radius:8px;box-shadow:var(--shadow);display:grid;gap:6px}
#mapsView .sylva-map-stage{position:relative;inset:auto;grid-row:2;grid-column:1;min-height:0;min-width:0;overflow:hidden}
#mapsView .sylva-map-toolbar{top:auto;bottom:18px;left:50%;right:auto;transform:translateX(-50%);max-width:calc(100% - 32px);flex-direction:row;gap:3px;padding:6px;border-radius:10px;background:var(--surface-strong);backdrop-filter:none;overflow-x:auto;z-index:22}
#mapsView .sylva-map-toolbar .sylva-map-tool{width:auto;min-width:58px;min-height:52px;display:flex;flex-direction:column;gap:5px;padding:7px 8px;border-radius:6px;flex-shrink:0;font-size:.75rem}
#mapsView .sylva-map-toolbar .sylva-map-tool span{display:block;font-size:.75rem}
#mapsView .sylva-map-toolbar [hidden]{display:none!important}
#mapsView .sylva-map-zoom{grid-row:2;grid-column:1;top:18px;bottom:auto;left:auto;right:18px;border-radius:8px;background:var(--surface-strong);padding:3px}
#mapsView .sylva-map-zoom button{min-width:44px;min-height:44px;font-size:20px}
#mapsView #sylvaMapZoomText{font-size:.8125rem;min-width:44px}
#mapsView .sylva-map-draw-actions{grid-row:2;grid-column:1;top:18px;right:auto;left:18px;transform:none;max-width:calc(100% - 190px);border-radius:8px;padding:8px;gap:8px;flex-wrap:wrap;background:var(--surface-strong);font-size:.8125rem}
#mapsView .sylva-map-draw-actions button{min-height:44px;font-size:.8125rem}
#mapsView .sylva-map-measure-card{bottom:96px;font-size:.875rem;max-width:calc(100% - 32px);border-radius:8px;background:var(--surface-strong);backdrop-filter:none}
#mapsView .sylva-map-measure-card span{white-space:normal}
#mapsView .sylva-map-measure-card button{min-width:44px;min-height:44px}
#mapsView .sylva-map-drawer{top:0;right:0;bottom:0;width:min(410px,100%);max-width:100%;border:0;border-left:1px solid var(--line);border-radius:0;background:var(--surface-strong);z-index:40;box-shadow:-10px 0 30px #00000012;backdrop-filter:none}
#mapsView .sylva-map-drawer-head{padding:18px 22px;min-height:76px}
#mapsView .sylva-map-drawer-head h3{font-size:1.25rem;line-height:1.4;overflow-wrap:anywhere}
#mapsView .sylva-map-drawer-close{width:44px;height:44px;min-width:44px;min-height:44px;font-size:24px}
#mapsView .sylva-map-drawer-body{padding:22px;min-height:0}
#mapsView .sylva-map-drawer-body label,#mapsView .sylva-map-drawer-body .label{font-size:.875rem;line-height:1.5}
#mapsView .sylva-map-drawer-body input:not([type="range"]):not([type="checkbox"]),#mapsView .sylva-map-drawer-body select,#mapsView .sylva-map-drawer-body button{min-height:44px;font-size:.9375rem}
#mapsView .sylva-map-drawer-body textarea{font-size:1rem;line-height:1.65;min-height:130px;resize:vertical}
#mapsView .sylva-map-color-control{flex-wrap:wrap}
#mapsView .sylva-map-swatches{grid-template-columns:repeat(5,44px);gap:5px}
#mapsView .sylva-map-swatches button{width:44px;height:44px;min-height:44px;padding:0;position:relative;border:1px solid var(--line);border-radius:7px;background:none;box-shadow:none}
#mapsView .sylva-map-swatches button::before{content:'';position:absolute;inset:11px;border-radius:50%;background:var(--swatch);border:1px solid var(--line)}
#mapsView .sylva-map-swatches button.active{transform:none;outline:2px solid var(--accent);outline-offset:1px}
#mapsView .sylva-map-help,#mapsView .sylva-map-upload-status{font-size:.8125rem;line-height:1.55}
#mapsView .sylva-map-drawer-actions{position:static;background:none;border-top:1px solid var(--line);padding-top:18px;margin-top:18px;box-shadow:none}
#mapsView .sylva-map-layer,#mapsView .sylva-map-section-label{font-size:.8125rem;line-height:1.5;min-height:44px}
#mapsView .sylva-map-layer b{font-size:.75rem}
#mapsView .sylva-map-layer-edit,#mapsView .sylva-map-section-actions button{min-height:44px;min-width:44px;font-size:.8125rem}
#mapsView .sylva-map-layer-row{grid-template-columns:minmax(0,1fr) 44px}
#mapsView .sylva-map-scale-card{grid-template-columns:1fr}
#mapsView .sylva-map-scale-card b,#mapsView .sylva-map-scale-card button{font-size:.875rem}
#mapsView .sylva-map-scale-card small{font-size:.8125rem}
#mapsView .sylva-map-scale-card button{min-height:44px}
.sylva-map-read-actions{display:flex;align-items:center;gap:16px;margin:0 0 24px}
.sylva-map-read-actions span{color:var(--muted);font-size:.875rem}
.sylva-map-facts{display:grid;gap:0;margin:0 0 24px}
.sylva-map-facts>div{display:grid;grid-template-columns:minmax(100px,.8fr) minmax(0,1.2fr);gap:16px;padding:10px 0;border-bottom:1px solid var(--line);align-items:baseline}
.sylva-map-facts dt{font-size:.8125rem;color:var(--muted);line-height:1.5}
.sylva-map-facts dd{margin:0;font-size:.9375rem;line-height:1.6;overflow-wrap:anywhere}
.sylva-map-reading-note,.sylva-map-reading-link{margin-bottom:26px}
.sylva-map-reading-note h4,.sylva-map-reading-link h4{font-size:.875rem;margin:0 0 10px;color:var(--muted);font-weight:500}
.sylva-map-reading-note p,.sylva-map-reading-link p{font-size:1rem;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere;margin:0 0 14px}
.sylva-map-reading-link b{font-size:1rem;line-height:1.5;overflow-wrap:anywhere;display:block;margin-bottom:10px}
.sylva-map-appearance .sylva-map-facts{margin-bottom:10px}
.sylva-map-editor-warning{font-size:.9375rem;line-height:1.6;border-left:3px solid var(--danger);padding:12px;color:var(--text);background:var(--surface-2)}
#mapsView .sylva-map-empty-card{max-width:440px;padding:30px}
#mapsView .sylva-map-empty-card p{font-size:.9375rem;line-height:1.65}
#mapsView .sylva-map-dialog-body label,#mapsView .sylva-map-dialog-body .sylva-map-help{font-size:.875rem;line-height:1.5}
#mapsView .sylva-map-dialog-body input,#mapsView .sylva-map-dialog-body select,#mapsView .sylva-map-dialog-body button{font-size:.9375rem;min-height:44px}
#mapsView .sylva-map-dialog-body small{font-size:.8125rem!important;line-height:1.55}
#mapsView .sylva-map-dialog-body p{font-size:.9375rem;line-height:1.65}
#mapsView button:focus-visible,#mapsView summary:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
#mapsView .sylva-map-mobile-side{position:static;min-width:44px;min-height:44px;width:auto;height:auto;gap:8px;transform:none}
#mapsView .sylva-map-mobile-back{top:90px;font-size:.875rem;min-height:44px}
#mapsView .sylva-map-side-pane[hidden]{display:none!important}

/* Board collection: explicit selector and local save feedback. */
#boardsView .board-head{display:flex;flex-wrap:wrap;gap:14px 24px;padding:16px 22px;align-items:center}
#boardsView .board-identity{min-width:260px;flex:1 1 340px;max-width:600px}
#boardsView .board-identity>small{font-size:.75rem!important;letter-spacing:.03em;overflow-wrap:anywhere;white-space:normal;margin-bottom:8px;display:block}
.board-switch-label{font-size:.8125rem;color:var(--muted);display:block;margin-bottom:5px}
.board-switcher{display:flex;align-items:center;gap:6px;min-width:0}
#boardsView .board-switcher select{flex:1 1 0;min-width:0;border:1px solid var(--line);border-radius:7px;background:var(--surface);min-height:44px;padding:9px 12px;font-size:1rem;font-weight:550;max-width:none}
#boardPosition{font-size:.8125rem;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap;margin:0 4px}
#boardsView .board-head-actions{display:flex;flex-wrap:wrap;gap:8px}
#boardsView .board-head-actions .board-label{display:inline}
#boardsView .board-button{min-height:44px;font-size:.875rem!important;border-radius:7px}
#boardsView .board-step{min-width:44px;width:44px;font-size:24px!important;padding:0}
#boardsView .board-footer{padding:8px 18px;flex-wrap:wrap;gap:8px 18px}
.board-save-copy{display:grid;gap:3px;min-width:0;flex:1 1 200px}
#boardSaveStatus{font-size:.8125rem;color:var(--text)}
#boardsView .board-hint{font-size:.75rem;max-width:100%;line-height:1.5}
#boardsView .board-footer .board-button{min-height:40px;font-size:.8125rem!important}
#boardsView .board-tool{font-size:.6875rem!important;min-width:48px;min-height:54px}
#boardsView .board-side-head h3{font-size:1rem}
#boardsView .board-side label,#boardsView .board-small{font-size:.8125rem;line-height:1.6}
#boardsView .board-side input:not([type="checkbox"]),#boardsView .board-side textarea{font-size:1rem;min-height:44px;line-height:1.6}
.board-dialog button{min-height:44px}
.board-dialog input{min-height:44px;font-size:1rem}
.board-dialog p{font-size:.9375rem;line-height:1.65}
.board-dialog.board-manager{max-width:680px}
.board-manager-list{display:grid;margin-bottom:22px;gap:0}
.board-manager-item{display:flex;align-items:center;justify-content:space-between;gap:20px;text-align:left;width:100%;padding:16px 12px;min-height:72px;border:0;border-bottom:1px solid var(--line);border-left:2px solid transparent;background:none;color:var(--text);cursor:pointer}
.board-manager-item[aria-current="true"]{background:var(--accent-soft);border-left-color:var(--accent)}
.board-manager-item>span:first-child{min-width:0;display:grid;gap:6px}
.board-manager-item b{font-size:1rem;overflow-wrap:anywhere}
.board-manager-item small,.board-manager-item>span:last-child{font-size:.8125rem;color:var(--muted);line-height:1.5}
.board-manager-item>span:last-child{flex-shrink:0}
#boardsView button:focus-visible,.board-dialog button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media(max-width:1100px){
 #mapsView .sylva-map-view{grid-template-columns:270px minmax(0,1fr)}
 #mapsView .sylva-map-top-actions{padding:10px 12px;gap:6px}
 #mapsView .sylva-map-top-actions button{font-size:.8125rem;padding:8px 10px}
 #mapsView .sylva-map-top-actions #sylvaMapMapSync svg{display:none}
 #mapsView .sylva-map-top-actions #sylvaMapManage svg{display:none}
}
@media(max-width:900px),(pointer:coarse) and (min-width:561px) and (max-width:1366px){
 html[data-route="reader"]{--reader-chrome-height:66px}
 html.workspace-entered[data-route="reader"] .topbar{height:66px!important;min-height:66px!important;padding-left:max(72px,calc(env(safe-area-inset-left) + 72px))!important}
}
@media(max-width:820px){
 #readerView .reader-bar{padding:14px 18px;gap:12px}
 #readerView .reader-navigation{padding:2px 18px}
 #readerView .reader-viewport{padding:18px 16px 32px!important}
 #readerView .reader-document{padding:28px 24px}
 #readerView .reader-position h1{font-size:1.25rem}
 #readerView .reader-annotation-tools{bottom:12px;padding:10px}
 #readerView .reader-annotation-tools>span{flex-basis:100%;text-align:center}
 #mapsView .sylva-map-view{grid-template-columns:minmax(0,1fr)}
 #mapsView .sylva-map-sidebar{position:absolute;inset:0 auto 0 0;width:min(340px,calc(100% - 60px));max-width:none;z-index:45}
 #mapsView .sylva-map-top-actions{justify-content:flex-start;min-height:68px}
 #mapsView .sylva-map-top-actions>.sylva-map-primary{margin-right:0}
 #mapsView .sylva-map-file-menu{margin-left:auto}
 #mapsView .sylva-map-mobile-side{display:flex}
 #mapsView .sylva-map-toolbar .sylva-map-tool{min-width:54px}
 #mapsView .sylva-map-drawer{width:min(400px,calc(100% - 24px))}
 #boardsView .board-head{padding:12px 16px;gap:12px}
 #boardsView .board-identity{flex-basis:100%;max-width:none}
 #boardsView .board-head-actions{gap:6px}
 #boardsView .board-head-actions .board-button{padding:8px 10px}
 #boardsView .board-head-actions [data-action="help"] .board-label,#boardsView .board-head-actions [data-action="library"] .board-label{display:none}
}
@media(prefers-reduced-motion:reduce){#readerView .reader-notes-panel{transition:none}}

/* Keep long action labels and metadata inside the element editor. */
#mapsView .sylva-map-drawer-actions{display:flex;flex-direction:column;align-items:stretch}
#mapsView .sylva-map-drawer-actions>div:last-child{display:flex;flex-wrap:wrap;flex-basis:auto;width:100%}
#mapsView .sylva-map-drawer-actions>div:last-child>*{flex:1 1 105px;width:auto;white-space:normal;line-height:1.4}
#mapsView .sylva-map-drawer-actions>div:last-child>.sylva-map-primary{flex-basis:100%}
.sylva-map-read-icon{display:grid;place-items:center;width:42px;height:42px;flex:none;background:var(--accent-soft);border-radius:8px}
.sylva-map-read-icon svg,.sylva-map-read-icon img{width:26px;height:26px;object-fit:contain}
.sylva-map-read-icon svg{fill:none;stroke:currentColor;stroke-width:1.6}

#readerView.reader-mode-book .reader-navigation{display:none}
@media(max-width:900px){
 #readerView .reader-position{flex-basis:100%}
 #readerView .reader-main-actions{width:100%}
 #readerView .reader-main-actions .reader-options{margin-left:auto}
}
