.notes-pane-label,.notes-source>label { font-size:10px; font-weight:700; letter-spacing:.13em; color:var(--text-muted); }
.nav-label { display:inline-flex; align-items:center; justify-content:center; gap:5px; white-space:nowrap; }
.nav-pro-badge { padding:2px 5px; border-radius:20px; background:rgba(79,70,229,.1); color:var(--color-primary); font-size:9px; font-weight:700; line-height:1.2; white-space:nowrap; }
.module-menu { position:relative; flex:0 0 auto; }
.module-menu summary { list-style:none; display:grid; place-items:center; width:40px; height:40px; border:1px solid var(--border-color); border-radius:50%; background:var(--bg-input); color:var(--text-light); cursor:pointer; }
.module-menu summary::-webkit-details-marker { display:none; }
.module-menu summary svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; }
.module-menu[open] summary { border-color:var(--color-primary); color:var(--color-primary); }
.module-menu-panel { position:absolute; top:calc(100% + 10px); left:0; z-index:100; display:grid; gap:4px; width:min(300px,calc(100vw - 32px)); padding:8px; border:1px solid var(--border-color); border-radius:14px; background:var(--bg-card); box-shadow:0 14px 36px rgba(15,23,42,.18); }
.module-menu-panel button { display:flex; flex-direction:column; align-items:flex-start; gap:3px; width:100%; padding:11px 12px; border:0; border-radius:9px; background:transparent; color:var(--text-light); text-align:left; font:inherit; cursor:pointer; }
.module-menu-panel button:hover,.module-menu-panel button:focus-visible { background:var(--bg-input); outline:none; }
.module-menu-panel small,.module-menu-pro { color:var(--text-muted); font-size:11px; }
.module-menu-pro { color:var(--color-primary); font-weight:700; }
.module-menu-panel .module-menu-settings { display:flex; flex-direction:column; align-items:flex-start; gap:3px; width:100%; min-height:0; padding:11px 12px; border:0; border-radius:9px; background:transparent; color:var(--text-light); text-align:left; font:inherit; cursor:pointer; }
.module-menu-settings strong { font-size:14px; }
.module-menu-settings small { color:var(--text-muted); font-size:11px; }
.module-menu-settings.active { background:var(--bg-input); color:var(--color-primary); }
.module-menu-controls { display:grid; gap:4px; padding:4px 8px; border-top:1px solid var(--border-color); }
.module-menu-control { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:44px; color:var(--text-muted); font-size:13px; }
.module-menu-controls .btn-theme-toggle,.module-menu-controls .btn-header-icon { display:grid; flex-direction:row; align-items:center; justify-content:center; flex:0 0 40px; width:40px; min-width:40px; height:40px; min-height:40px; padding:0; border:1px solid var(--border-color); border-radius:50%; background:var(--bg-input); }
.module-menu-controls .language-toggle { flex-basis:48px; width:48px; min-width:48px; }
.settings-subscription-summary { display:grid; gap:14px; padding:20px; border:1px solid var(--border-color); border-radius:14px; background:var(--bg-card-elevated); }
.settings-subscription-status { color:var(--color-primary); font-size:18px; font-weight:800; }
.settings-subscription-summary dl { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin:0; }
.settings-subscription-summary dl div { display:grid; gap:5px; min-width:0; }
.settings-subscription-summary dt { color:var(--text-muted); font-size:12px; }
.settings-subscription-summary dd { margin:0; font-weight:700; overflow-wrap:anywhere; }
.settings-subscription-summary p { margin:0; }
.marathon-status { margin:16px 0; color:var(--text-muted); line-height:1.6; }
.marathon-status .btn { margin-top:12px; }
.marathon-runs { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,360px),1fr)); gap:16px; }
.marathon-run { min-width:0; padding:22px; }
.marathon-run-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; }
.marathon-run h2 { font-size:21px; overflow-wrap:anywhere; }
.marathon-run h3 { margin:4px 0 0; color:var(--text-muted); font-size:14px; font-weight:500; }
.marathon-run p { margin:14px 0; color:var(--text-muted); line-height:1.65; white-space:pre-wrap; }
.marathon-progress { color:var(--color-primary); font-size:12px; text-align:right; }
.marathon-lesson-list { display:grid; gap:6px; margin:16px 0 0; padding:0; list-style:none; }
.marathon-lesson-link { display:flex; justify-content:space-between; align-items:center; gap:12px; width:100%; padding:10px 12px; border:1px solid var(--border-color); border-radius:9px; background:var(--bg-card-elevated); color:var(--text-light); text-align:left; font:inherit; cursor:pointer; }
.marathon-lesson-link:disabled { opacity:.55; cursor:not-allowed; }
.marathon-lesson-link small { flex:0 0 auto; color:var(--text-muted); }
.marathon-lesson-view { margin-top:20px; scroll-margin-top:80px; }
.marathon-lesson-card { display:grid; gap:14px; padding:clamp(18px,3vw,30px); border:1px solid var(--border-color); border-radius:16px; background:var(--bg-card); }
.marathon-lesson-card > .btn-secondary { justify-self:start; }
.marathon-lesson-card h2 { font-size:24px; }
.marathon-lesson-card h3 { margin-top:8px; }
.marathon-content-block { line-height:1.8; white-space:pre-wrap; overflow-wrap:anywhere; }
.marathon-media-note { color:var(--text-muted); line-height:1.65; }
.marathon-lesson-card a { color:var(--color-primary); }
.marathon-media { display:block; max-width:min(100%,960px); max-height:70vh; border-radius:12px; background:#000; }
.marathon-lesson-card img.marathon-media { height:auto; object-fit:contain; background:transparent; }
.marathon-document-link { justify-self:start; }
.marathon-lesson-card textarea { width:100%; min-height:130px; padding:12px; border:1px solid var(--border-color); border-radius:10px; background:var(--bg-input); color:var(--text-light); font:inherit; resize:vertical; }
.marathon-lesson-card textarea:focus-visible { outline:2px solid var(--color-primary); outline-offset:2px; }
.notes-workspace { display:grid; grid-template-columns:260px minmax(0,1fr); border:1px solid var(--border-color); border-radius:16px; overflow:hidden; min-height:66vh; background:var(--bg-card); }
.notes-sidebar { padding:20px; border-right:1px solid var(--border-color); min-width:0; display:flex; flex-direction:column; gap:16px; }
.notes-sidebar-actions { display:grid; gap:8px; }
#notes-new { display:flex; align-items:center; justify-content:center; gap:8px; width:100%; }
#notes-new svg,.notes-icon-button svg { display:none; width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; }
.notes-icon-button,#notes-back { display:none; }
.notes-list { display:flex; flex-direction:column; gap:8px; max-height:65vh; overflow:auto; }
.notes-list-item { text-align:left; background:transparent; border:1px solid transparent; border-radius:10px; padding:14px; color:var(--text-light); cursor:pointer; width:100%; }
.notes-list-item:hover { background:var(--bg-card-elevated); }
.notes-list-item.selected { background:var(--bg-input); border-color:var(--color-primary); }
.notes-list-item strong,.notes-list-item span,.notes-list-item small { display:block; overflow-wrap:anywhere; }
.notes-list-item strong { font-size:14px; margin-bottom:7px; }
.notes-list-item span { font-size:12px; color:var(--text-muted); white-space:nowrap; text-overflow:ellipsis; overflow:hidden; }
.notes-list-item small { margin-top:12px; font-size:10px; color:var(--text-muted); }
.notes-list-empty { color:var(--text-muted); font-size:13px; padding:12px; }
.notes-document { min-width:0; }
.notes-empty { padding:80px 32px; text-align:center; color:var(--text-muted); line-height:1.7; }
.notes-empty h2 { color:var(--text-light); font-size:28px; letter-spacing:-.03em; }
.notes-document-header { display:flex; align-items:center; gap:16px; padding:24px; flex-wrap:wrap; }
#notes-title { flex:1 1 220px; min-width:0; width:100%; background:transparent; border:0; color:var(--text-light); font:700 26px var(--font-stack); padding:8px 0; }
#notes-title::placeholder { color:var(--text-muted); }
.notes-actions { display:flex; gap:8px; flex-wrap:wrap; }
.notes-link-dialog { width:min(440px,calc(100vw - 32px)); padding:24px; border:1px solid var(--border-color); border-radius:16px; background:var(--bg-card); color:var(--text-light); box-shadow:0 18px 50px rgba(15,23,42,.24); }
.notes-link-dialog::backdrop { background:rgba(15,23,42,.45); }
.notes-link-dialog form { display:grid; gap:14px; }
.notes-link-dialog h2 { margin:0; font-size:20px; }
.notes-link-dialog label { color:var(--text-muted); font-size:13px; }
.notes-link-dialog .notes-actions { justify-content:flex-end; }
.notes-mode { display:flex; gap:4px; padding:0 24px 16px; }
.notes-mode button,.notes-toolbar button { font:inherit; font-size:12px; border:1px solid var(--border-color); background:transparent; color:var(--text-muted); border-radius:7px; padding:8px 12px; cursor:pointer; }
.notes-mode button[aria-pressed="true"] { background:var(--color-primary); color:white; border-color:var(--color-primary); }
.notes-toolbar { padding:12px 24px; display:flex; flex-wrap:wrap; gap:6px; border-top:1px solid var(--border-color); border-bottom:1px solid var(--border-color); }
.notes-toolbar button:hover { color:var(--text-light); background:var(--bg-card-elevated); }
.notes-panes { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); min-height:48vh; }
.notes-source,.notes-preview-pane { min-width:0; padding:20px 24px; }
.notes-source { border-right:1px solid var(--border-color); display:flex; flex-direction:column; background:var(--bg-input); }
#notes-body { display:block; border:0; background:transparent; color:var(--text-light); width:100%; min-width:0; min-height:42vh; flex:1; resize:vertical; font:14px/1.85 ui-monospace,Consolas,monospace; padding:16px 0; tab-size:4; }
.notes-panes[data-mode="edit"],.notes-panes[data-mode="preview"] { grid-template-columns:minmax(0,1fr); }
.notes-panes[data-mode="edit"] .notes-preview-pane,.notes-panes[data-mode="preview"] .notes-source { display:none; }
.notes-panes[data-mode="edit"] .notes-source { border-right:0; }
.notes-prose { color:var(--text-light); font-size:15px; line-height:1.85; overflow-wrap:anywhere; }
.notes-prose[contenteditable="true"] { min-height:42vh; outline:none; }
.notes-prose>:first-child { margin-top:18px; }
.notes-prose h1,.notes-prose h2,.notes-prose h3 { line-height:1.25; letter-spacing:-.025em; margin:1.3em 0 .5em; }
.notes-prose h1 { font-size:32px; }.notes-prose h2 { font-size:25px; }.notes-prose h3 { font-size:20px; }
.notes-prose p,.notes-prose ul,.notes-prose ol { margin:0 0 1em; }
.notes-prose ul,.notes-prose ol { padding-left:24px; }
.notes-prose blockquote { margin:20px 0; border-left:3px solid var(--color-primary); padding:8px 18px; background:var(--bg-card-elevated); color:var(--text-muted); }
.notes-prose blockquote p:last-child { margin-bottom:0; }
.notes-prose input[type="checkbox"] { margin-right:8px; }
.notes-prose a { color:var(--color-plan); text-decoration:underline; }
.notes-prose pre { position:relative; max-width:100%; overflow:auto; padding:48px 16px 16px; border:0; border-radius:10px; background:var(--bg-input); }
.notes-prose .notes-copy-code { position:absolute; top:10px; right:10px; display:inline-flex; align-items:center; justify-content:center; width:28px; min-width:28px; height:28px; min-height:28px; padding:0; border:1px solid transparent; border-radius:50%; color:var(--text-light); background:transparent; font-size:0; line-height:1; opacity:1; cursor:pointer; }
.notes-prose .notes-copy-code:hover { background:var(--bg-card-elevated); }
.notes-prose .notes-copy-code svg { width:15px; height:15px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.notes-prose .notes-copy-code.is-copied { color:var(--color-primary); background:var(--bg-card-elevated); }
.notes-prose .notes-copy-code.is-error { color:var(--color-danger); background:var(--bg-card-elevated); }
.notes-prose code { font:13px/1.7 ui-monospace,Consolas,monospace; background:var(--bg-input); border-radius:4px; padding:2px 5px; }
.notes-prose pre code { padding:0; }
.notes-prose table { width:100%; display:block; overflow:auto; border-collapse:collapse; margin:20px 0; }
.notes-prose th,.notes-prose td { border:1px solid var(--border-color); padding:10px 16px; text-align:left; }
.notes-prose th { background:var(--bg-card-elevated); }
.notes-prose img { max-width:100%; height:auto; border-radius:8px; }
.notes-prose hr { border:0; border-top:1px solid var(--border-color); margin:28px 0; }
.notes-footer { display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; padding:16px 24px; border-top:1px solid var(--border-color); color:var(--text-muted); font-size:11px; }
.notes-footer .is-error,.notes-payment-error { color:var(--color-danger); }
.notes-access { padding:36px; line-height:1.7; }.notes-access h2 { font-size:28px; }.notes-access p { color:var(--text-muted); }.notes-access button { margin:8px 8px 0 0; }
.pro-page-heading { display:grid; gap:12px; margin-bottom:26px; }.pro-page-heading>button { justify-self:start; }.pro-feature-card p { margin:0; color:var(--text-muted); line-height:1.7; }.pro-feature-card { display:flex; align-items:center; gap:18px; padding:24px; border:1px solid var(--border-color); border-radius:16px; background:var(--bg-card); }.pro-gem { display:grid; place-items:center; width:52px; height:52px; flex:0 0 52px; border-radius:15px; background:rgba(79,70,229,.1); font-size:25px; }.pro-feature-card h2,.pro-pricing-title { margin:0 0 8px; }.pro-pricing-title { margin-top:32px; }.pro-pricing-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }.pro-plan-card { display:flex; flex-direction:column; align-items:flex-start; gap:8px; padding:24px; border:1px solid var(--border-color); border-radius:16px; background:var(--bg-card); }.pro-plan-card-featured { border-color:var(--color-primary); }.pro-plan-period,.pro-plan-detail { color:var(--text-muted); }.pro-plan-card strong { font-size:32px; }.pro-plan-card .btn { margin-top:12px; }.pro-purchase-status { color:var(--text-muted); font-size:13px; line-height:1.6; }
#notes-screen button:focus-visible { outline:2px solid var(--color-primary); outline-offset:3px; }
#notes-screen input:focus,#notes-screen textarea:focus,#notes-preview:focus { outline:none !important; box-shadow:none !important; border:0 !important; }
@media(max-width:1100px) { .notes-workspace { grid-template-columns:220px minmax(0,1fr); }.notes-panes[data-mode="split"] { grid-template-columns:minmax(0,1fr); }.notes-panes[data-mode="split"] .notes-source { border-right:0; border-bottom:1px solid var(--border-color); } }
@media(max-width:700px) {
    .notes-workspace { grid-template-columns:minmax(0,1fr); }
    .notes-sidebar { border-right:0; border-bottom:1px solid var(--border-color); padding:16px; }
    .notes-sidebar-actions { grid-template-columns:minmax(0,1fr) 44px; }
    #notes-new { width:44px; height:44px; padding:0; }
    #notes-new svg,.notes-icon-button svg { display:block; }
    .notes-new-label { display:none; }
    .notes-icon-button { display:grid; place-items:center; width:44px; min-width:44px; height:44px; padding:0; }
    #notes-search { display:none; }
    #notes-screen.notes-search-open #notes-search { display:block; }
    .notes-list { max-height:calc(100dvh - 180px); }
    .notes-document-header,.notes-toolbar,.notes-source,.notes-preview-pane { padding:16px; }
    .notes-document-header { display:grid; grid-template-columns:minmax(0,1fr); }
    #notes-back { display:inline-flex; justify-self:start; }
    #notes-title { font-size:22px; }
    .notes-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; }
    .notes-actions .btn { width:100%; min-width:0; padding-inline:8px; }
    .notes-mode { padding:0 16px 16px; }
    .notes-footer { padding:16px; }
    .notes-access { padding:20px; }
    #notes-screen.notes-mobile-list .notes-document { display:none; }
    #notes-screen.notes-mobile-editor { position:fixed; inset:0; z-index:500; display:block; gap:0; overflow:auto; padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom); background:var(--bg-page); }
    #notes-screen.notes-mobile-editor #notes-access { display:none; }
    #notes-screen.notes-mobile-editor .notes-workspace { display:block; min-height:100dvh; overflow:visible; border:0; border-radius:0; background:var(--bg-card); }
    #notes-screen.notes-mobile-editor .notes-sidebar { display:none; }
    #notes-screen.notes-mobile-editor .notes-document { display:block; min-height:100dvh; }
    .pro-pricing-grid { grid-template-columns:minmax(0,1fr); }
    .pro-feature-card { align-items:flex-start; padding:18px; }
}
@media(max-width:820px) { #top-nav { grid-template-columns:repeat(5,minmax(0,1fr)); }.nav-label { gap:3px; }.nav-pro-badge { padding:2px 4px; font-size:8px; }.marathon-run { padding:16px; }.marathon-run-heading { flex-direction:column; gap:8px; }.marathon-progress { text-align:left; } }
@media(max-width:700px) { .settings-subscription-summary dl { grid-template-columns:minmax(0,1fr); } }

#notes-form.notes-form-readonly .notes-actions, #notes-form.notes-form-readonly .notes-mode, #notes-form.notes-form-readonly .notes-toolbar { display: none; }


.knowledge-workspace { display:grid; grid-template-columns:minmax(240px,300px) minmax(0,1fr); min-height:68vh; border:1px solid var(--border-color); border-radius:16px; overflow:hidden; background:var(--bg-card); }
.knowledge-sidebar { display:flex; flex-direction:column; gap:14px; min-width:0; padding:18px; border-right:1px solid var(--border-color); }
.knowledge-list { display:grid; align-content:start; gap:6px; }
.knowledge-list-item { display:grid; gap:6px; width:100%; padding:14px; border:1px solid transparent; border-radius:10px; background:transparent; color:var(--text-light); text-align:left; font:inherit; cursor:pointer; }
.knowledge-list-item:hover { background:var(--bg-card-elevated); }
.knowledge-list-item[aria-current="true"] { border-color:var(--border-color); background:var(--bg-input); }
.knowledge-list-item small { color:var(--text-muted); font-size:11px; }
.knowledge-list-item strong { font-size:15px; }
.knowledge-list-item span { color:var(--text-muted); font-size:12px; line-height:1.5; }
.knowledge-empty { margin:8px; color:var(--text-muted); font-size:13px; }
.knowledge-article { min-width:0; padding:clamp(22px,5vw,64px); }
.knowledge-article-header { display:grid; gap:10px; margin-bottom:28px; padding-bottom:22px; border-bottom:1px solid var(--border-color); }
.knowledge-article-header h1 { margin:0; font-size:clamp(30px,4vw,46px); letter-spacing:-.035em; }
.knowledge-article-author { margin:0; color:var(--text-muted); font-size:13px; }
.knowledge-article-content { max-width:820px; }
.knowledge-article-content h1 { display:none; }
.knowledge-article-content h2 { margin-top:0; font-size:19px; }
@media(max-width:700px) { .knowledge-workspace { grid-template-columns:minmax(0,1fr); }.knowledge-sidebar { border-right:0; border-bottom:1px solid var(--border-color); padding:14px; }.knowledge-list { grid-template-columns:minmax(0,1fr); max-height:260px; overflow:auto; }.knowledge-article { padding:22px 18px; } }
