.workspace-main,.document-workspace{position:relative;min-height:0}
.document-corner-actions{position:absolute;z-index:12;left:12px;bottom:10px;display:flex;align-items:center;gap:2px;border-radius:5px;background:var(--panel,var(--surface));color:var(--muted)}
.document-corner-actions button{width:32px;height:32px;padding:7px;border:0;border-radius:4px;background:transparent;color:inherit;display:grid;place-items:center;cursor:pointer}
.document-corner-actions button:hover,.document-corner-actions button[aria-pressed=true]{background:var(--hover);color:var(--accent)}
.document-corner-actions svg{width:18px;height:18px}
.document-word-count{position:absolute;z-index:12;right:16px;bottom:13px;min-height:26px;display:flex;align-items:center;padding:3px 6px;border:0;border-radius:4px;background:var(--panel,var(--surface));color:var(--muted);font:12px/20px system-ui}
.workspace-main:has(.map-pane:not([hidden])) .document-word-count,.document-workspace:has(.map-panel:not([hidden])) .document-word-count{bottom:64px}
.focus-mode .document-word-count,.focus-mode .document-corner-actions,.presentation-mode .document-corner-actions,.presentation-mode .document-word-count{display:none}
.side-pane{display:flex;flex-direction:column;overflow:hidden}
.side-pane>.file-list,.side-pane>.outline-list{min-height:0;flex:1;overflow:auto}
.sidebar-search{flex-shrink:0}
.sidebar-search input{min-width:0}
.sidebar-search .clear-search{border:0;background:transparent;color:var(--muted);display:grid;place-items:center;width:28px;height:28px;padding:5px;cursor:pointer}
.file-navigation-footer,.sidebar-footer.file-navigation-footer{flex:none;display:flex;align-items:center;gap:2px;height:40px;padding:3px 5px;border-top:1px solid var(--border);position:relative}
.file-navigation-footer button{border:0;background:transparent;color:var(--muted);cursor:pointer;display:flex;align-items:center;justify-content:center;gap:6px;min-width:32px;height:32px;padding:6px;border-radius:4px;flex:none}
.file-navigation-footer button:hover{background:var(--hover);color:var(--fg,var(--text))}
.file-navigation-footer .folder-trigger{flex:1;min-width:0;justify-content:flex-start;font-size:12px}
.folder-trigger span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.file-navigation-footer svg{width:18px;height:18px;flex:none}
.file-navigation-menu{position:absolute;left:6px;bottom:42px;z-index:30;min-width:210px;padding:5px;border:1px solid var(--border);background:var(--panel,var(--surface));box-shadow:0 6px 24px #0002;border-radius:6px}
.file-navigation-menu button{width:100%;justify-content:flex-start;font-size:13px;height:34px}
.file-directory>summary{display:flex;align-items:center;gap:7px;list-style:none;padding:7px 8px;cursor:pointer;font-size:13px;color:var(--muted);min-height:34px}
.file-directory>summary:before{content:'›';width:10px;transform:rotate(90deg);font:18px/18px system-ui}
.file-directory:not([open])>summary:before{transform:none}
.file-directory>summary::-webkit-details-marker{display:none}
.file-directory>summary .ico,.file-directory>summary .icon{width:15px;height:15px}
.file-directory .file-children{padding-left:14px}
.file-directory .file-row{padding-left:10px}
.file-list.file-excerpts{padding:0}
.file-excerpts .file-row{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:5px;margin:0;border:0;border-left:3px solid transparent;border-bottom:1px solid var(--border);border-radius:0;height:92px;width:100%;padding:12px 14px;text-align:left;overflow:hidden}
.file-excerpts .file-row.selected{border-left-color:var(--accent)}
.file-excerpts .file-name{font-size:14px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:none}
.file-excerpts .file-excerpt{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:var(--muted);font-size:12px;line-height:18px;white-space:normal;flex:none;max-height:36px}
.sidebar #files-pane{display:flex;flex:1;min-height:0;overflow:hidden;flex-direction:column}
.sidebar #files-pane>.file-list{flex:1;min-height:0;overflow:auto}
.sidebar #outline-list{flex:1;min-height:0;overflow:auto}
.device-phone .document-corner-actions{left:8px;bottom:4px}
.device-phone .document-corner-actions button{width:44px;height:44px}
.device-phone .document-word-count{right:12px;bottom:12px}
.device-phone .file-navigation-footer{height:52px}
.device-phone .file-navigation-footer button{min-width:40px;height:44px}
.device-phone .file-navigation-menu{bottom:54px}

:root{--document-bg:#fff;--document-fg:#30343b;--document-muted:#606770;--document-border:#dde1e5;--document-code:#f6f7f8;--document-link:#3975a5}
:root[data-theme=dark]{--document-bg:#202124;--document-fg:#e4e5e7;--document-muted:#afb4bb;--document-border:#484c53;--document-code:#292b2f;--document-link:#91bffa}
:is(.instant-scroll,.reading-scroll,.source-scroll,.document-corner-actions,.document-word-count,.type-swatch){--fg:var(--document-fg);--editor-fg:var(--document-fg);--text:var(--document-fg);--muted:var(--document-muted);--md-marker:var(--document-muted);--border:var(--document-border);--line:var(--document-border);--paper:var(--document-bg);--surface:var(--document-bg);--editor-bg:var(--document-bg);--panel:var(--document-code);--code-bg:var(--document-code);--code:var(--document-code);--accent:var(--document-link);--selection:#3975a533;--hover:var(--document-code);background-color:var(--document-bg);color:var(--document-fg)}
.typography-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.typography-popover{width:min(440px,calc(100% - 16px))}
.typography-popover .typography-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.typography-card{padding:8px;border-radius:6px;min-width:0}
.typography-card>small{display:none}
.type-swatch{position:relative;display:block;width:100%;height:140px;overflow:hidden;padding:0;border:0;border-radius:0;pointer-events:none}
.type-swatch .type-document{display:block;width:360px;height:420px;transform:scale(.33);transform-origin:top left;padding:18px;letter-spacing:0}
.type-document h4{font-size:1em;font-weight:600;margin:1.2em 0 .5em}
.type-document h1,.type-document h2,.type-document h3{letter-spacing:0!important}
:root[data-theme=dark] .type-swatch .type-document{--fg:var(--document-fg);--muted:var(--document-muted);--border:var(--document-border)}
.typography-choices{width:100%}
.typography-choices .typography-card{border:1px solid var(--line);background:var(--surface);color:var(--fg)}
.typography-choices .typography-card[aria-pressed=true]{border-color:var(--accent);background:var(--accent-soft)}
@media(max-width:760px){.typography-popover .typography-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
