*,*:before,*:after{box-sizing:border-box}html,body,#root{margin:0;padding:0;height:100%;width:100%;overflow:hidden}html{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}body{font-family:var(--font-ui);font-size:15px;color:var(--text);background:var(--bg);overscroll-behavior:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility;transition:background-color .2s ease,color .2s ease}button{font:inherit;color:inherit;background:none;border:none;padding:0;cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation}input,textarea{font:inherit;color:inherit}::selection{background:var(--selection);color:var(--text)}.app{position:fixed;top:0;right:0;bottom:0;left:0;overflow:hidden}.main-pane{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;overflow:hidden;background:var(--bg);z-index:1;transition:transform .28s cubic-bezier(.22,.61,.36,1);will-change:transform}.main-pane.is-shifted{transform:translate(var(--library-width))}:root{--library-width: 86vw;--kb-offset: 0px;--toolbar-h: 50px}@media (min-width: 720px){:root{--library-width: 380px}}.backdrop{position:absolute;top:0;right:0;bottom:0;left:0;z-index:5;background:transparent;pointer-events:none;transition:background-color .22s ease}.backdrop.is-active{background:#00000040;pointer-events:auto;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px)}.library-pane{position:absolute;top:0;left:0;bottom:0;width:var(--library-width);background:var(--bg-elevated);border-right:1px solid var(--border);z-index:10;transform:translate(-100%);transition:transform .28s cubic-bezier(.22,.61,.36,1);will-change:transform}.library-pane.is-open{transform:translate(0)}.library-pane.is-dragging{transition:none}.top-bar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 14px;padding-top:max(10px,env(safe-area-inset-top));background:var(--bg);z-index:4;transition:opacity .18s ease,transform .18s ease}.top-bar.is-hidden{pointer-events:none;opacity:0;transform:translateY(-12px)}.top-bar .left,.top-bar .right{display:flex;align-items:center;gap:4px}.icon-button{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:10px;color:var(--text);transition:background-color .12s ease,color .12s ease}.icon-button:hover{background:var(--hover)}.icon-button:active{background:var(--hover);transform:scale(.96)}.icon-button.is-active{color:var(--accent)}.icon-button svg{width:22px;height:22px;stroke-width:1.7}.title-input{flex:1;min-width:0;background:transparent;border:none;outline:none;padding:8px;font-family:var(--font-reader);font-weight:600;font-size:17px;color:var(--text)}.title-input::placeholder{color:var(--text-muted);opacity:.7}.title-display{flex:1;min-width:0;padding:8px;font-family:var(--font-reader);font-weight:600;font-size:17px;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.content-area{flex:1;position:relative;overflow:hidden;display:flex;flex-direction:column}.scroll-area{flex:1;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch}.scroll-area::-webkit-scrollbar{width:0}.measure{max-width:var(--measure, 36em);margin:0 auto;padding:18px 22px;padding-bottom:calc(80px + var(--kb-offset, 0px) + env(safe-area-inset-bottom))}@media (min-width: 720px){.measure{padding:24px 32px 120px}}.reader-mode .measure{padding-bottom:calc(120px + env(safe-area-inset-bottom))}.read-meta{display:flex;gap:14px;font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--text-muted);margin-bottom:12px;font-family:var(--font-ui)}.toolbar{position:absolute;left:0;right:0;bottom:var(--kb-offset, 0);z-index:6;display:flex;align-items:center;overflow-x:auto;background:var(--bg);border-top:1px solid var(--border);padding:7px 8px calc(7px + env(safe-area-inset-bottom));scrollbar-width:none;transition:bottom 80ms ease}.main-pane.no-kb-offset .toolbar{padding-bottom:7px}.toolbar::-webkit-scrollbar{display:none}.toolbar .group{display:flex;align-items:center;gap:2px;padding:0 6px;border-right:1px solid var(--border);flex-shrink:0}.toolbar .group:first-child{padding-left:2px}.toolbar .group:last-child{border-right:none;padding-right:2px}.toolbar button{display:inline-flex;align-items:center;justify-content:center;min-width:36px;height:36px;padding:0 7px;border-radius:8px;color:var(--text);font-size:14px;transition:background-color .1s ease,color .1s ease}.toolbar button:hover{background:var(--hover)}.toolbar button:active{background:var(--hover);transform:scale(.95)}.toolbar button.is-active{background:var(--accent-soft);color:var(--accent)}.toolbar button svg{width:19px;height:19px;stroke-width:1.8}.toolbar .heading-pill{font-family:var(--font-reader);font-weight:700;font-size:13px;letter-spacing:.01em}.toolbar .swatch{width:18px;height:18px;border-radius:50%;border:1px solid var(--border)}.action-bar{position:absolute;top:max(10px,env(safe-area-inset-top));left:12px;right:12px;z-index:8;display:flex;align-items:center;gap:4px;padding:6px;background:var(--bg-elevated);border:1px solid var(--border);border-radius:14px;box-shadow:var(--shadow);animation:actionIn .2s cubic-bezier(.22,.61,.36,1);overflow-x:auto;scrollbar-width:none}.action-bar::-webkit-scrollbar{display:none}@keyframes actionIn{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.action-bar .group{display:flex;align-items:center;gap:2px;padding:0 4px;border-right:1px solid var(--border);flex-shrink:0}.action-bar .group:last-child{border-right:none}.action-bar button{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:10px;color:var(--text);transition:background-color .1s ease;flex-shrink:0}.action-bar button:hover,.action-bar button:active{background:var(--hover)}.action-bar button.is-active{background:var(--accent-soft)}.action-bar button svg{width:19px;height:19px;stroke-width:1.8}.action-bar .color-dot{width:20px;height:20px;border-radius:50%}.action-bar .label-text{font-size:12px;font-weight:600;color:var(--text-muted);letter-spacing:.02em;padding:0 6px}.sheet-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:50;background:#00000052;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);animation:fadeIn .16s ease;display:flex;align-items:flex-end;justify-content:center}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.sheet{position:relative;z-index:51;width:100%;max-width:580px;max-height:88vh;background:var(--bg-elevated);border-radius:22px 22px 0 0;box-shadow:var(--shadow);overflow-y:auto;padding:14px 18px calc(24px + env(safe-area-inset-bottom));animation:slideUp .24s cubic-bezier(.22,.61,.36,1);touch-action:pan-y}@media (min-width: 720px){.sheet{border-radius:22px;margin-bottom:28px}}@keyframes slideUp{0%{transform:translateY(40px);opacity:.4}to{transform:translateY(0);opacity:1}}.sheet.is-dragging{animation:none;transition:none}.sheet-handle{width:40px;height:4px;border-radius:999px;background:var(--border);margin:4px auto 12px;cursor:grab}.sheet h3{margin:0 0 10px;font-family:var(--font-reader);font-weight:600;font-size:13px;text-transform:uppercase;letter-spacing:.1em;color:var(--text-muted)}.sheet section{margin-bottom:22px}.note-popover{display:flex;flex-direction:column;gap:12px}.note-popover .quote{margin:0;font-family:var(--font-reader);font-style:italic;color:var(--text);font-size:15px;line-height:1.5;max-height:6em;overflow:hidden;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;padding:6px 12px;background:var(--hover);border-left:3px solid currentColor;border-radius:3px 8px 8px 3px}.note-popover textarea{width:100%;min-height:90px;max-height:240px;border:1px solid var(--border);border-radius:12px;padding:11px 12px;background:var(--bg);color:var(--text);outline:none;font-family:var(--font-ui);font-size:15px;line-height:1.45;resize:none;transition:border-color .12s ease}.note-popover textarea:focus{border-color:var(--accent)}.note-popover .actions{display:flex;align-items:center;justify-content:space-between;gap:8px}.note-popover .swatches{display:flex;align-items:center;gap:6px}.note-popover .swatch-btn{width:28px;height:28px;border-radius:50%;border:2px solid transparent;transition:transform .1s ease,border-color .12s ease}.note-popover .swatch-btn.is-active{border-color:var(--text);transform:scale(1.08)}.note-popover .ghost-btn{padding:8px 12px;border-radius:10px;color:var(--text-muted);font-size:14px;font-weight:500;transition:background-color .1s ease,color .1s ease}.note-popover .ghost-btn:hover{background:var(--hover);color:var(--text)}.note-popover .ghost-btn.danger:hover{color:#e85d5d;background:#e85d5d14}.note-popover .primary-btn{padding:8px 16px;border-radius:10px;background:var(--accent);color:var(--accent-on);font-weight:600;font-size:14px;transition:opacity .12s ease}.note-popover .primary-btn:active{opacity:.85}.library{height:100%;display:flex;flex-direction:column;overflow:hidden;padding-top:env(safe-area-inset-top)}.library .head{padding:14px 16px 8px;display:flex;align-items:center;justify-content:space-between}.library h2{margin:0;font-family:var(--font-reader);font-weight:600;font-size:22px;letter-spacing:-.01em}.library .search-row{padding:0 16px 10px}.library .search-input{width:100%;padding:9px 12px;border-radius:10px;background:var(--bg);border:1px solid var(--border);font-size:14px;color:var(--text);outline:none;transition:border-color .12s ease}.library .search-input:focus{border-color:var(--accent)}.library .search-input::placeholder{color:var(--text-muted)}.library .list{flex:1;overflow-y:auto;padding:4px 10px calc(24px + env(safe-area-inset-bottom))}.library .list::-webkit-scrollbar{width:0}.library .empty{padding:60px 22px;text-align:center;color:var(--text-muted);font-family:var(--font-reader);font-style:italic}.doc-item{display:flex;flex-direction:column;align-items:stretch;gap:4px;padding:12px 42px 12px 12px;border-radius:14px;cursor:pointer;transition:background-color .12s ease;width:100%;text-align:left;position:relative}.doc-item:hover{background:var(--hover)}.doc-item.is-active{background:var(--accent-soft)}.doc-item .title{font-family:var(--font-reader);font-weight:600;font-size:16px;line-height:1.3;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}.doc-item .preview{font-size:13px;color:var(--text-muted);line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.doc-item .meta{display:flex;gap:10px;font-size:11px;color:var(--text-muted);margin-top:4px;letter-spacing:.02em;text-transform:uppercase;align-items:center}.doc-item .meta .dot{width:5px;height:5px;border-radius:50%;background:currentColor;opacity:.4}.doc-item .delete-btn{position:absolute;top:50%;right:8px;transform:translateY(-50%);width:32px;height:32px;border-radius:8px;display:inline-flex;align-items:center;justify-content:center;color:var(--text-muted);transition:background-color .12s ease,color .12s ease}.doc-item .delete-btn:hover{background:var(--bg);color:#e85d5d}.new-doc-btn{margin:2px 12px 8px;padding:11px;border-radius:12px;display:flex;align-items:center;justify-content:center;gap:8px;background:var(--accent);color:var(--accent-on);font-weight:600;font-size:14px;transition:opacity .12s ease}.new-doc-btn:active{opacity:.9}.new-doc-btn svg{width:16px;height:16px;stroke-width:2.2}.theme-row{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.theme-tile{display:flex;flex-direction:column;align-items:center;gap:6px;padding:10px 6px;border-radius:12px;border:1.5px solid var(--border);transition:border-color .12s ease,background-color .12s ease;background:transparent}.theme-tile.is-active{border-color:var(--accent);background:var(--accent-soft)}.theme-swatch{width:100%;height:44px;border-radius:8px;display:flex;flex-direction:column;justify-content:center;padding:6px 8px;gap:3px;border:1px solid var(--border)}.theme-swatch span{display:block;height:3px;border-radius:99px}.theme-tile .label{font-size:12px;font-weight:500}.font-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}@media (min-width: 480px){.font-grid{grid-template-columns:1fr 1fr 1fr}}.font-tile{display:flex;flex-direction:column;align-items:flex-start;gap:6px;padding:10px 12px;border-radius:12px;border:1.5px solid var(--border);text-align:left;transition:border-color .12s ease,background-color .12s ease;min-height:64px}.font-tile.is-active{border-color:var(--accent);background:var(--accent-soft)}.font-tile .sample{font-size:20px;font-weight:500;letter-spacing:-.01em;line-height:1}.font-tile .name{font-size:11px;color:var(--text-muted);font-family:var(--font-ui);letter-spacing:.02em}.slider-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:6px 0}.slider-row .label{font-size:14px;color:var(--text-muted)}.slider-row .controls{display:flex;align-items:center;gap:4px}.step-btn{width:34px;height:34px;border-radius:9px;background:var(--bg);border:1px solid var(--border);font-weight:600;font-size:16px;color:var(--text);transition:background-color .1s ease}.step-btn:hover{background:var(--hover)}.step-btn:active{transform:scale(.96)}.value-pill{min-width:56px;height:34px;padding:0 12px;display:inline-flex;align-items:center;justify-content:center;border-radius:9px;background:var(--bg);border:1px solid var(--border);font-variant-numeric:tabular-nums;font-size:14px;font-weight:500}:root{--hl-yellow: rgba(252, 211, 77, .42);--hl-blue: rgba(96, 165, 250, .32);--hl-green: rgba(134, 239, 172, .4);--hl-red: rgba(248, 113, 113, .32)}mark[data-color=yellow]{background:var(--hl-yellow)}mark[data-color=blue]{background:var(--hl-blue)}mark[data-color=green]{background:var(--hl-green)}mark[data-color=red]{background:var(--hl-red)}mark[data-has-note=true]{position:relative}mark[data-has-note=true]:after{content:"";position:absolute;top:0;right:-2px;width:4px;height:4px;border-radius:50%;background:var(--text);opacity:.55}.empty-state{display:flex;flex-direction:column;align-items:flex-start;gap:18px;padding:24px 0 0}.empty-state .blurb{display:flex;flex-direction:column;gap:6px}.empty-state h2{margin:0;font-family:var(--font-reader);font-weight:500;font-size:26px;color:var(--text);letter-spacing:-.015em}.empty-state p{margin:0;color:var(--text-muted);line-height:1.55;font-size:15px}.empty-state .paste-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.empty-state .paste-btn{display:inline-flex;align-items:center;gap:8px;padding:11px 18px;border-radius:12px;background:var(--accent);color:var(--accent-on);font-weight:600;font-size:15px;transition:opacity .12s ease,transform .12s ease}.empty-state .paste-btn:active{transform:scale(.97)}.empty-state .paste-btn svg{width:18px;height:18px;stroke-width:2}.empty-state .secondary{font-size:13px;color:var(--text-muted);padding:8px 6px}.toast{position:fixed;bottom:calc(20px + env(safe-area-inset-bottom));left:50%;transform:translate(-50%);background:var(--bg-elevated);border:1px solid var(--border);color:var(--text);padding:10px 16px;border-radius:999px;font-size:13px;box-shadow:var(--shadow);z-index:100;animation:toastIn .18s ease,toastOut .22s ease 1.4s forwards;pointer-events:none}@keyframes toastIn{0%{opacity:0;transform:translate(-50%,8px)}to{opacity:1;transform:translate(-50%)}}@keyframes toastOut{to{opacity:0;transform:translate(-50%,4px)}}.prose{-webkit-touch-callout:none}.action-bar-active .prose mark[data-just-applied=true]{animation:pulseHl .36s ease}@keyframes pulseHl{0%{box-shadow:0 0 0 2px transparent}50%{box-shadow:0 0 0 2px var(--accent-soft)}to{box-shadow:0 0 0 2px transparent}}:root,:root.theme-light{color-scheme:light;--bg: #fafaf7;--bg-elevated: #ffffff;--text: #1a1a1a;--text-muted: #707070;--border: #e8e6e0;--hover: rgba(0, 0, 0, .045);--selection: rgba(96, 165, 250, .25);--accent: #2563eb;--accent-soft: rgba(37, 99, 235, .1);--accent-on: #ffffff;--shadow: 0 10px 40px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .05)}:root.theme-dark{color-scheme:dark;--bg: #1c1c1e;--bg-elevated: #2a2a2c;--text: #ececec;--text-muted: #9a9a9c;--border: #38383a;--hover: rgba(255, 255, 255, .06);--selection: rgba(96, 165, 250, .35);--accent: #7aa9ff;--accent-soft: rgba(122, 169, 255, .16);--accent-on: #0d1424;--shadow: 0 16px 50px rgba(0, 0, 0, .55), 0 2px 10px rgba(0, 0, 0, .35)}:root.theme-ultra-dark{color-scheme:dark;--bg: #000000;--bg-elevated: #0a0a0a;--text: #d8d8d8;--text-muted: #6a6a6a;--border: #1a1a1a;--hover: rgba(255, 255, 255, .05);--selection: rgba(96, 165, 250, .35);--accent: #93c5fd;--accent-soft: rgba(147, 197, 253, .12);--accent-on: #04101f;--shadow: 0 20px 60px rgba(0, 0, 0, .85), 0 2px 10px rgba(0, 0, 0, .6)}:root.theme-sepia{color-scheme:light;--bg: #f4ecd8;--bg-elevated: #faf3df;--text: #4a3a2a;--text-muted: #8a7558;--border: #e3d6b6;--hover: rgba(74, 58, 42, .06);--selection: rgba(139, 111, 71, .25);--accent: #9b6e2b;--accent-soft: rgba(155, 110, 43, .12);--accent-on: #fff8e8;--shadow: 0 14px 40px rgba(74, 58, 42, .18), 0 2px 8px rgba(74, 58, 42, .08)}:root.theme-sepia .top-bar,:root.theme-sepia .toolbar{background:var(--bg)}:root{--font-ui: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;--font-reader: "EB Garamond", Georgia, "Times New Roman", serif}:root.font-system{--font-reader: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif}:root.font-inter{--font-reader: "Inter", system-ui, sans-serif}:root.font-eb-garamond{--font-reader: "EB Garamond", Georgia, serif}:root.font-lora{--font-reader: "Lora", Georgia, serif}:root.font-crimson-pro{--font-reader: "Crimson Pro", Georgia, serif}:root.font-merriweather{--font-reader: "Merriweather", Georgia, serif}:root.font-source-serif{--font-reader: "Source Serif 4", Georgia, serif}:root.font-playfair{--font-reader: "Playfair Display", Georgia, serif}:root.font-bitter{--font-reader: "Bitter", Georgia, serif}:root.font-newsreader{--font-reader: "Newsreader", Georgia, serif}:root.font-spectral{--font-reader: "Spectral", Georgia, serif}:root.font-georgia{--font-reader: Georgia, "Times New Roman", serif}:root.font-times{--font-reader: "Times New Roman", Times, serif}:root.font-jetbrains-mono{--font-reader: "JetBrains Mono", "SF Mono", Consolas, monospace}.prose{font-family:var(--font-reader);font-size:var(--reader-size, 18px);line-height:var(--reader-line, 1.7);color:var(--text);font-weight:400;letter-spacing:.005em;word-wrap:break-word}.prose:focus{outline:none}.prose p{margin:0 0 1em}.prose p:last-child{margin-bottom:0}.prose h1,.prose h2,.prose h3{font-family:var(--font-reader);font-weight:700;letter-spacing:-.015em;line-height:1.25;margin:1.4em 0 .5em}.prose h1{font-size:1.7em}.prose h2{font-size:1.4em}.prose h3{font-size:1.18em}.prose h1:first-child,.prose h2:first-child,.prose h3:first-child{margin-top:0}.prose strong{font-weight:700}.prose em{font-style:italic}.prose u{text-decoration:underline;text-underline-offset:.15em}.prose s{text-decoration:line-through}.prose blockquote{margin:1.2em 0;padding:.3em 0 .3em 1em;border-left:3px solid var(--accent);color:var(--text-muted);font-style:italic}.prose ul,.prose ol{margin:.5em 0 1em;padding-left:1.5em}.prose li{margin-bottom:.3em}.prose li>p{margin:0}.prose code{font-family:JetBrains Mono,SF Mono,Consolas,monospace;font-size:.92em;background:var(--hover);padding:.12em .36em;border-radius:5px}.prose pre{background:var(--hover);padding:12px 14px;border-radius:10px;overflow-x:auto;font-family:JetBrains Mono,SF Mono,Consolas,monospace;font-size:.9em;line-height:1.5}.prose pre code{background:transparent;padding:0}.prose hr{border:none;border-top:1px solid var(--border);margin:2em 0}.prose a{color:var(--accent);text-underline-offset:.18em;text-decoration:underline;text-decoration-thickness:1px}.prose .is-empty:first-child:before{content:attr(data-placeholder);color:var(--text-muted);opacity:.55;pointer-events:none;float:left;height:0}.prose mark{border-radius:3px;padding:1px;color:inherit}.prose mark[data-color=yellow]{background:var(--hl-yellow)}.prose mark[data-color=blue]{background:var(--hl-blue)}.prose mark[data-color=green]{background:var(--hl-green)}.prose mark[data-color=red]{background:var(--hl-red)}.prose .ProseMirror-selectednode{outline:2px solid var(--accent)}
