*{box-sizing:border-box}body{margin:0;font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#222b2c;background:#fff;font-size:16px}button,input,textarea{font:inherit}button{cursor:pointer}button:disabled{opacity:.5;cursor:wait}input,textarea{min-width:0}button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #40a791;outline-offset:3px}button{border:0;background:none;color:inherit;border-radius:7px}input{border:1px solid #dce2df;border-radius:7px;padding:12px;width:100%;background:white;color:#263735}input:focus,textarea:focus{outline:2px solid #21876d;outline-offset:2px}label{display:block;font-size:14px;font-weight:550}label input{margin-top:8px}p{line-height:1.65;color:#677370}h1,h2,p{margin-top:0}.primary{background:#176e58;color:#fff;padding:13px 19px;font-size:14px;font-weight:600;display:flex;align-items:center;justify-content:space-between;gap:20px}.primary:hover{background:#105440}.brand-icon{display:inline-grid;place-items:center;background:#20785f;color:#fff;font-family:Georgia,serif;border-radius:9px;width:36px;height:40px;font-size:27px;box-shadow:inset -5px 0 #ffffff20}.gate{min-height:100svh;background:#f4f7f6;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto 1fr auto;gap:30px 8vw;padding:38px 7vw}.gate-brand{display:flex;align-items:center;gap:12px;font-size:25px;font-weight:650;grid-column:1/-1;letter-spacing:-1px}.local-label{margin-left:auto;font-size:12px;letter-spacing:1.5px;font-weight:500;color:#6a7d74}.gate-content{align-self:center}.eyebrow{font-size:12px;letter-spacing:1.8px;font-weight:650;color:#6e8179}.gate h1{font-family:Georgia,serif;font-size:clamp(45px,5.3vw,78px);font-weight:400;line-height:1.08;letter-spacing:-2px;margin:25px 0}.gate h1 em{color:#1d785d;font-weight:400}.gate-content p{font-size:17px}.gate-caption{font-size:12px;letter-spacing:2px;color:#71847b;border-top:1px solid #d7e1db;padding-top:24px;margin-top:40px;max-width:340px}.unlock-card{background:white;padding:34px 38px;border:1px solid #dfe7e2;box-shadow:0 18px 65px #16362508;border-radius:14px;max-width:460px;align-self:center;width:100%}.lock-symbol{display:block;color:#22745e;font-size:36px;margin-bottom:15px}.unlock-card h2{font-size:25px;letter-spacing:-.5px;margin-bottom:12px}.unlock-card p{font-size:14px}.unlock-card input{font-size:14px;margin:8px 0 18px}.unlock-card .primary{width:100%;justify-content:center;gap:8px;text-align:center}.small{font-size:13px!important}.text-button{font-size:14px;color:#226d58;padding:12px 0;width:100%}.notice{font-size:12px;line-height:1.6;background:#f5f7f6;padding:12px;border-radius:7px;color:#607068}.gate-footer{grid-column:1/-1;display:flex;justify-content:space-between;gap:24px;font-size:12px;color:#6b7b73;padding-top:20px}.gate-footer span{max-width:410px}.brand{color:inherit;text-decoration:none;font-size:25px;font-weight:650;letter-spacing:-1px;display:flex;align-items:center;gap:11px;margin-bottom:42px}#workspace{display:grid;grid-template-columns:235px 320px 1fr;height:100svh}.sidebar{background:#f2f6f3;border-right:1px solid #dde5df;padding:30px 18px 20px;display:flex;flex-direction:column}.personal,.section-label{font-size:11px;letter-spacing:1.7px;color:#76857c;font-weight:600;margin:0 10px 15px}.sidebar>.primary{width:100%;margin-bottom:22px}.nav-item{font-size:14px;display:flex;justify-content:space-between;align-items:center;text-align:left;width:100%;padding:12px 10px;margin:2px 0;color:#5c6b63;gap:10px}.nav-item span:first-child{overflow:hidden;text-overflow:ellipsis}.nav-item.active{background:#e0ece3;color:#24654a;font-weight:600}.nav-item:hover{background:#e4ede6}.section-label{margin-top:36px}#notebooks{overflow:auto;max-height:25vh}.sidebar-bottom{margin-top:auto;padding-top:25px}.device{border-top:1px solid #dce5de;padding:20px 9px 15px;margin-top:15px;font-size:12px;color:#42745b}.device small{display:block;font-size:11px;color:#78877d;margin-top:7px}.lock-button{font-size:14px;border:1px solid #cddbd0;padding:11px;width:100%;text-align:left}.notes-column{border-right:1px solid #e5e9e6;display:flex;flex-direction:column;min-height:0;background:#fcfdfc}.notes-column header{padding:35px 23px 0}.notes-column h2{font-size:24px;font-weight:600;letter-spacing:-.7px;margin:12px 0 25px}.search{display:flex;align-items:center;border:1px solid #e2e8e3;border-radius:8px;background:#f4f7f4;padding:0 12px;color:#7d8b82;gap:9px}.search input{background:transparent;border:0;margin:0;padding:12px 0;font-size:14px;font-weight:400}.search span{font-size:24px}.list-meta{display:flex;justify-content:space-between;margin:24px 0 18px;font-size:12px;color:#849086}#note-list{overflow-y:auto;flex:1;padding:0 12px}.note-card{display:block;text-align:left;padding:19px 14px;width:100%;border:1px solid transparent;border-bottom-color:#edf0ed;border-radius:8px;margin-bottom:5px}.note-card.active{background:#eaf3ed;border-color:#d7e7db}.note-card h3{margin:0 0 9px;font-size:15px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.note-card p{font-size:13px;margin:0 0 15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#7a857e}.note-card footer{display:flex;justify-content:space-between;font-size:11px;color:#7c887f;gap:12px}.list-footer{padding:18px 24px;border-top:1px solid #edf0ed;font-size:12px;color:#8a948d}.editor{min-width:0;display:flex;flex-direction:column;position:relative}.editor-bar{border-bottom:1px solid #e9edea;min-height:78px;padding:18px 30px;display:flex;align-items:center;justify-content:space-between;font-size:13px;color:#819087;gap:10px}.editor-bar>div{display:flex;align-items:center;gap:12px}.icon-button{font-size:23px;width:32px;height:32px;color:#87958b}.icon-button:hover{background:#f0f5f1}.empty{margin:auto;text-align:center;padding:35px;max-width:530px}.empty-symbol{display:block;color:#3d8261;font-size:56px;margin-bottom:30px}.empty h2{font-family:Georgia,serif;font-size:33px;letter-spacing:-.6px;font-weight:400;margin:20px 0}.empty p{font-size:15px}.empty .primary{margin:25px auto}#editor-form{display:flex;flex:1;min-height:0;flex-direction:column}.note-heading{padding:20px 48px 16px}#title{border:0;padding:0;font-family:Georgia,serif;font-size:35px;letter-spacing:-.7px}.note-details{margin-top:10px;display:flex;align-items:center;gap:20px;font-size:12px;color:#8a948d;flex-wrap:wrap}.note-details label{display:flex;align-items:center;gap:8px;font-size:12px;color:#829086}.note-details input{font-size:12px;background:#f3f7f3;border:0;margin:0;padding:7px 10px;max-width:150px;color:#497558}#credentials{margin:0 48px;border-top:1px solid #e9eee9;border-bottom:1px solid #e9eee9;padding:17px 0}summary{cursor:pointer;font-size:14px;color:#42694f}summary span{font-size:12px;margin-left:12px;color:#8b968e}.credential-grid{display:grid;grid-template-columns:1fr 1fr;gap:15px;margin-top:18px}.credential-grid label{font-size:12px;color:#75817a}.credential-grid input{font-size:14px}.password-label{grid-column:1/-1}.password-label>div{display:flex;align-items:center;gap:8px}.password-label button{font-size:12px;color:#377056}.password-label input{flex:1}#body{resize:none;border:0;flex:1;min-height:180px;padding:28px 48px;color:#3b4740;line-height:1.9;font-size:16px}#body:focus{outline:none}.editor-footer{padding:18px 30px;border-top:1px solid #eef1ee;display:flex;justify-content:space-between;font-size:11px;color:#8b968e;gap:12px}.error{background:#fff1e8;color:#974528;padding:15px;font-size:14px}.danger{background:#a33333;color:white;padding:12px 18px}dialog{border:1px solid #dce4dd;border-radius:14px;padding:32px;max-width:540px;width:calc(100% - 32px);color:#26372c}dialog::backdrop{background:#132d23a0;backdrop-filter:blur(4px)}dialog h2{font-size:24px}dialog p{font-size:14px}.dialog-actions{display:flex;justify-content:flex-end;gap:16px;margin-top:24px}#gate-error,#restore-error{color:#a33333}[hidden]{display:none!important}@media(min-width:1450px){#workspace{grid-template-columns:255px 350px 1fr}.note-heading{padding-top:24px}#body{padding-top:40px}}@media(max-width:1050px){#workspace{grid-template-columns:195px 255px 1fr}.sidebar{padding:24px 12px}.editor-bar{padding:16px}#save-status{font-size:11px}.note-heading{padding:18px 24px 14px}#credentials{margin:0 24px}#body{padding:24px}.editor-footer{padding:16px;flex-wrap:wrap}.gate{padding:30px 5vw;gap:30px 5vw}.unlock-card{padding:28px}.credential-grid{grid-template-columns:1fr}}@media(max-width:760px){.gate{display:flex;flex-direction:column;padding:25px}.gate-content h1{font-size:45px}.gate-content h1 br{display:none}.gate-content h1 em{display:block}.gate-content{align-self:stretch}.gate-content p,.gate-caption{display:none}.unlock-card{max-width:none}.gate-footer{flex-direction:column;font-size:12px}#workspace{height:auto;min-height:100svh;grid-template-columns:1fr}.sidebar{display:block;padding:18px}.brand{margin:0 0 15px}.sidebar .personal,.sidebar .section-label,#notebooks,.device{display:none}.sidebar>.primary{float:right;margin:-52px 0 0;width:auto}.sidebar nav{display:flex;gap:8px}.sidebar-bottom{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0 0;padding:0}.sidebar-bottom .nav-item{width:auto;font-size:12px;padding:8px}.lock-button{width:auto;font-size:12px;padding:8px}.notes-column header{padding:20px}.notes-column .eyebrow,.list-footer{display:none}.notes-column h2{font-size:20px;margin:0 0 14px}.list-meta{margin-bottom:0}#note-list{max-height:210px}.editor{min-height:550px}.empty{padding:50px 24px}.editor-bar{min-height:65px}.note-heading{padding:16px 24px 14px}#title{font-size:30px}.gate-brand .local-label{font-size:10px}#body{min-height:300px}.editor-footer{font-size:11px}}

.new-notebook{display:block;width:100%;padding:10px;text-align:left;color:#24654a;font-size:14px;margin-bottom:8px}.new-notebook:hover{background:#e0ece3}#notebook-error{color:#a33333;font-size:14px;margin-top:12px}@media(max-width:760px){#notebooks{display:flex;max-height:130px;overflow:auto;gap:8px}#notebooks .nav-item{width:auto;white-space:nowrap}.new-notebook{margin-top:12px;width:auto}}

#master-dialog label{margin-top:16px}#master-error{color:#a33333;font-size:14px}

/* Rich text editor, entirely local. */
#format-toolbar{border:0;border-bottom:1px solid #e4ebe6;padding:12px 24px;background:#fafcfb;display:flex;flex-wrap:wrap;gap:6px;flex-shrink:0}
#format-toolbar .ql-formats{margin:0;padding-right:8px;border-right:1px solid #e2e9e4;display:inline-flex;align-items:center;gap:2px}
#format-toolbar .ql-formats:last-child{border-right:0}
#format-toolbar button{width:30px;height:30px;border-radius:5px;font-size:22px;padding:5px}
#format-toolbar button:hover,#format-toolbar button.ql-active{background:#e1efe5;color:#176e58}
#format-toolbar .ql-picker-label{border-radius:4px}
#format-toolbar .ql-header{width:122px;font-size:14px}
#format-toolbar .ql-picker-label::before{content:'Texto normal'}
#format-toolbar .ql-picker-label[data-value='1']::before,#format-toolbar .ql-picker-item[data-value='1']::before{content:'Título 1'}
#format-toolbar .ql-picker-label[data-value='2']::before,#format-toolbar .ql-picker-item[data-value='2']::before{content:'Título 2'}
#format-toolbar .ql-picker-label[data-value='3']::before,#format-toolbar .ql-picker-item[data-value='3']::before{content:'Título 3'}
#format-toolbar .ql-picker-item[data-value='']::before{content:'Texto normal'}
#rich-body{flex:1;min-height:200px;border:0;font-family:inherit;font-size:16px;overflow:auto}
#rich-body .ql-editor{padding:28px 48px;line-height:1.85;color:#3b4740;min-height:220px;overflow-wrap:anywhere}
#rich-body .ql-editor.ql-blank::before{left:48px;right:48px;font-style:normal;color:#8a968e}
#rich-body .ql-editor h1{font-size:2em;line-height:1.3;margin:18px 0 10px}
#rich-body .ql-editor h2{font-size:1.5em;line-height:1.4;margin:16px 0 8px}
#rich-body .ql-editor h3{font-size:1.2em;line-height:1.5;margin:14px 0 6px}
#rich-body .ql-editor blockquote{border-left:3px solid #78a58b;color:#65776a;margin:12px 0;padding-left:18px}
#rich-body .ql-editor .ql-code-block-container{background:#f0f4f1;color:#244733;border-radius:6px;padding:12px 16px;font-size:14px}
#rich-body:focus-within{box-shadow:inset 2px 0 #529b74}
@media(max-width:1050px){#rich-body .ql-editor{padding:24px}#rich-body .ql-editor.ql-blank::before{left:24px;right:24px}#format-toolbar{padding:10px 16px}}
@media(max-width:760px){#rich-body{min-height:300px}#format-toolbar{gap:8px}#format-toolbar button{width:34px;height:34px}}

.sidebar{min-height:0;overflow-y:auto}

#rich-body .ql-editor hr{display:block;border:0;border-top:2px solid #a3b9ac;margin:22px 0;clear:both}#text-divider{font-weight:600}



#notebooks{display:grid;grid-template-columns:minmax(0,1fr) 32px;align-items:center;gap:2px}#notebooks .nav-item{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;min-width:0;width:100%}.delete-notebook-button{width:30px;height:32px;font-size:22px;color:#76857c}.delete-notebook-button:hover,.delete-notebook-button:focus-visible{background:#fce7e7;color:#a33333}#delete-notebook-option{display:flex;align-items:flex-start;gap:10px;line-height:1.5;margin:20px 0}#delete-notebook-notes{width:18px;height:18px;flex-shrink:0;margin:2px 0 0;accent-color:#a33333}#delete-notebook-error{color:#a33333;font-size:14px}

/* Shared field rhythm, including labels outside their input. */
:root{--field-gap:10px;--focus-color:#21876d}
label{line-height:1.5}
label + input:not([type="checkbox"]),label > input:not([type="checkbox"]){display:block;margin-top:var(--field-gap)}
.unlock-card input{margin-top:var(--field-gap)}
input:not([type="checkbox"]):not([type="file"]){min-height:44px;line-height:1.5}
input:focus{outline:2px solid var(--focus-color);outline-offset:2px}
.password-label>div{margin-top:var(--field-gap);gap:12px}
.password-label>div input{margin-top:0}
.credential-grid{gap:20px}
.credential-grid label{font-size:14px}
.credential-grid input{font-size:16px}
.note-details label{gap:12px;font-size:14px}
.note-details label>input{margin-top:0;font-size:14px}
.search input{margin-top:0;min-height:44px}
.search:focus-within{outline:2px solid var(--focus-color);outline-offset:2px}
.search input:focus{outline:none}
#title{padding:6px 8px;line-height:1.3}
#title:focus{outline-offset:2px}
#reveal{min-height:44px;padding:8px;font-size:14px;flex-shrink:0}
dialog{max-height:calc(100dvh - 32px);overflow-y:auto;overscroll-behavior:contain;padding:32px;scroll-padding:24px}
dialog h2{line-height:1.3;overflow-wrap:anywhere}
dialog p{line-height:1.65}
dialog input:not([type="checkbox"]){font-size:16px}
.dialog-actions{flex-wrap:wrap;align-items:stretch;gap:12px;padding:4px}
.dialog-actions button{min-height:44px;padding:11px 16px;white-space:normal;line-height:1.4}
.dialog-actions .primary{justify-content:center}
[role="alert"]:empty{display:none}
#delete-notebook-option{line-height:1.6}
#notebooks{padding:4px;scroll-padding:6px}
.editor-bar{flex-wrap:wrap}
.editor-bar>div{min-width:0;flex-wrap:wrap}
#breadcrumb{overflow-wrap:anywhere;min-width:0}
#save-status{line-height:1.5}
@media(max-width:760px){
 dialog{padding:24px;max-height:calc(100dvh - 24px);width:calc(100% - 24px)}
 .dialog-actions{flex-direction:column-reverse}
 .dialog-actions button{width:100%}
 .unlock-card input,.search input,.note-details label>input{font-size:16px}
 .credential-grid{gap:20px}
 summary span{display:block;margin:6px 0 0 16px}
 .gate-brand{flex-wrap:wrap}
 .local-label{letter-spacing:1px}
}
@media(pointer:coarse){
 #format-toolbar button,.icon-button,.delete-notebook-button{min-width:44px;min-height:44px}
 #notebooks{grid-template-columns:minmax(0,1fr) 44px}
}

.data-actions{margin:2px 0 10px;min-width:0}.data-badge{display:inline-flex;align-items:center;justify-content:space-between;gap:12px;list-style:none;border:1px solid #cdded2;border-radius:999px;background:#e7f0e9;padding:9px 14px;color:#35634a;font-size:14px;font-weight:550;line-height:1.5;cursor:pointer}.data-badge::-webkit-details-marker{display:none}.data-badge span{display:inline-block;margin:0;color:inherit;font-size:16px;transition:transform .15s}.data-actions[open] .data-badge span{transform:rotate(180deg)}.data-badge:hover{background:#dceadf}.data-actions-list{margin-top:10px;padding:6px;background:#fff;border:1px solid #dce6de;border-radius:10px}.data-actions-list .nav-item{width:100%;min-height:42px;margin:0;font-size:14px}.sidebar-bottom .data-actions-list .nav-item{width:100%;font-size:14px;padding:10px}@media(max-width:760px){.data-actions{flex-basis:100%;margin-bottom:4px}.data-actions-list{max-width:300px}.data-badge span{margin:0;display:inline-block}}

/* Compact collapsible navigation. */
.sidebar .brand{margin-bottom:28px;font-size:23px}
.sidebar-section{margin-bottom:10px;min-width:0}
.sidebar-section-heading{display:flex;align-items:center;gap:4px;border-radius:7px;min-height:36px}
.sidebar-section-heading:hover{background:#e6eee8}
.section-toggle{display:flex;align-items:center;gap:8px;min-width:0;flex:1;padding:8px 6px;text-align:left;font-size:14px;line-height:20px}
.section-toggle svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.5;flex-shrink:0;color:#627269}
.section-chevron{display:inline-block;width:12px;font-size:14px;line-height:16px;transition:transform .15s}
.section-toggle[aria-expanded="false"] .section-chevron{transform:rotate(-90deg)}
.section-add{flex-shrink:0;width:30px;height:30px;font-size:21px;line-height:1;color:#547260;border-radius:6px;padding:0}
.section-add:hover,.section-add:focus-visible{background:#d8e8dc;color:#176e58}
.section-items{margin-left:20px}
#notes-nav .nav-item{font-size:14px;padding:7px 10px;min-height:34px;margin:1px 0}
#notes-nav .nav-item>span:last-child{font-size:12px;color:#728278}
.sidebar #notebooks{grid-template-columns:minmax(0,1fr) 26px;padding:3px;gap:1px;max-height:35vh}
.sidebar #notebooks .nav-item{display:flex;align-items:center;justify-content:flex-start;gap:7px;padding:6px;min-height:32px;font-size:14px;margin:0}
.notebook-glyph{font-size:15px;line-height:18px;flex-shrink:0;color:#6f8175}
.notebook-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sidebar .delete-notebook-button{font-size:17px;width:24px;height:28px;min-width:24px;min-height:28px;color:#87958b}
.sidebar-bottom .data-badge{font-size:13px;padding:7px 12px}
@media(max-width:760px){
 .sidebar-section{margin:10px 0}.sidebar #notes-nav{display:block}
 .sidebar #notebooks{max-height:200px}.sidebar .brand{margin-bottom:16px}
 .section-add{min-width:36px;min-height:36px}
}
@media(pointer:coarse){.section-toggle,.section-add{min-height:44px}.section-add{min-width:44px}.sidebar #notebooks{grid-template-columns:minmax(0,1fr) 44px}.sidebar .delete-notebook-button{min-width:44px;min-height:44px}}

/* Open settings upward without changing sidebar layout. */
.data-actions{position:relative}.data-actions-list{position:absolute;bottom:calc(100% + 8px);left:0;z-index:30;width:100%;min-width:0;max-width:300px;margin:0;box-shadow:0 8px 28px #173b2526;max-height:260px;overflow-y:auto}.data-actions-list .nav-item{white-space:normal;text-align:left}.sidebar-bottom{position:relative;z-index:5;flex-shrink:0}

/* Two complete themes. Light preserves the original Caderno palette. */
:root{color-scheme:light}
.theme-control{padding:10px 8px 14px;border-bottom:1px solid #dce6de;margin-bottom:5px}
.theme-label{display:block;font-size:12px;font-weight:600;letter-spacing:.03em;color:#64756a;margin-bottom:9px}
.theme-options{display:flex;padding:3px;gap:4px;border-radius:8px;background:#f0f5f1}
.theme-options button{flex:1;min-width:0;min-height:34px;padding:6px 8px;font-size:13px;border-radius:6px;border:1px solid transparent;white-space:nowrap}
.theme-options button[aria-pressed="true"]{background:#fff;color:#176e58;border-color:#cadcce;box-shadow:0 1px 4px #132d230a}
.gate{position:relative}
.gate-theme{position:absolute;right:7vw;top:92px;z-index:1;display:inline-flex;gap:8px;align-items:center;border:1px solid #cdded2;border-radius:999px;padding:8px 13px;min-height:38px;font-size:13px;color:#35634a;background:#fff}
.data-actions-list{max-height:min(340px,65dvh)}
html[data-theme="dark"]{color-scheme:dark;--focus-color:#53c58b;--dark-bg:#151918;--dark-sidebar:#1c2220;--dark-surface:#222a26;--dark-text:#e8eee9;--dark-muted:#a1aea5;--dark-line:#35423a;--dark-accent:#53c58b}
html[data-theme="dark"] body{background:var(--dark-bg);color:var(--dark-text)}
html[data-theme="dark"] p{color:var(--dark-muted)}
html[data-theme="dark"] input{background:#1b221e;color:var(--dark-text);border-color:var(--dark-line)}
html[data-theme="dark"] input::placeholder{color:#91a096;opacity:1}
html[data-theme="dark"] button:focus-visible,
html[data-theme="dark"] a:focus-visible,
html[data-theme="dark"] summary:focus-visible{outline-color:var(--dark-accent)}
html[data-theme="dark"] .gate{background:var(--dark-bg)}
html[data-theme="dark"] .gate h1 em{color:var(--dark-accent)}
html[data-theme="dark"] .gate-caption{color:var(--dark-muted);border-color:var(--dark-line)}
html[data-theme="dark"] .unlock-card{background:var(--dark-surface);border-color:var(--dark-line);box-shadow:0 18px 65px #0002}
html[data-theme="dark"] .brand-icon{background:#286a4a;color:#e8eee9}
html[data-theme="dark"] .primary{background:var(--dark-accent);color:#10291b}
html[data-theme="dark"] .primary:hover{background:#72d5a1}
html[data-theme="dark"] .text-button,
html[data-theme="dark"] .lock-symbol,
html[data-theme="dark"] .empty-symbol{color:var(--dark-accent)}
html[data-theme="dark"] .notice{background:#1b221e;color:var(--dark-muted)}
html[data-theme="dark"] .gate-footer,
html[data-theme="dark"] .local-label,
html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .list-meta,
html[data-theme="dark"] .list-footer,
html[data-theme="dark"] .editor-bar,
html[data-theme="dark"] .editor-footer,
html[data-theme="dark"] .note-details,
html[data-theme="dark"] .note-details label{color:var(--dark-muted)}
html[data-theme="dark"] .sidebar{background:var(--dark-sidebar);border-color:var(--dark-line)}
html[data-theme="dark"] .notes-column{background:#191f1c;border-color:var(--dark-line)}
html[data-theme="dark"] .editor{background:var(--dark-surface)}
html[data-theme="dark"] .nav-item,
html[data-theme="dark"] .section-toggle,
html[data-theme="dark"] .section-toggle svg{color:#bfcac2}
html[data-theme="dark"] .nav-item.active{background:#2a3d31;color:#8ee0b1}
html[data-theme="dark"] .nav-item:hover,
html[data-theme="dark"] .sidebar-section-heading:hover{background:#2a332d}
html[data-theme="dark"] .section-add{color:#a1b8a8}
html[data-theme="dark"] .section-add:hover,
html[data-theme="dark"] .section-add:focus-visible{background:#2a3d31;color:var(--dark-accent)}
html[data-theme="dark"] .notebook-glyph,
html[data-theme="dark"] .sidebar .delete-notebook-button,
html[data-theme="dark"] #notes-nav .nav-item>span:last-child{color:#a1aea5}
html[data-theme="dark"] .delete-notebook-button:hover{background:#482c2b;color:#ffb3ad}
html[data-theme="dark"] .device{color:#91b79f;border-color:var(--dark-line)}
html[data-theme="dark"] .device small{color:var(--dark-muted)}
html[data-theme="dark"] .lock-button{border-color:#46594b}
html[data-theme="dark"] .search{background:#222a26;border-color:var(--dark-line);color:var(--dark-muted)}
html[data-theme="dark"] .search input{background:transparent;border:0}
html[data-theme="dark"] .note-card{border-bottom-color:#2b352e}
html[data-theme="dark"] .note-card.active{background:#283b2f;border-color:#3b5543}
html[data-theme="dark"] .note-card p,
html[data-theme="dark"] .note-card footer{color:var(--dark-muted)}
html[data-theme="dark"] .list-footer,
html[data-theme="dark"] .editor-bar,
html[data-theme="dark"] .editor-footer{border-color:var(--dark-line)}
html[data-theme="dark"] #title{background:transparent;color:var(--dark-text)}
html[data-theme="dark"] .note-details input{background:#2c3b31;color:#a4dbb9}
html[data-theme="dark"] .icon-button{color:#b2c0b7}
html[data-theme="dark"] .icon-button:hover{background:#304034}
html[data-theme="dark"] .data-badge,
html[data-theme="dark"] .gate-theme{background:#283b2f;border-color:#415847;color:#b9dfc7}
html[data-theme="dark"] .data-badge:hover,
html[data-theme="dark"] .gate-theme:hover{background:#314837}
html[data-theme="dark"] .data-actions-list,
html[data-theme="dark"] dialog{background:var(--dark-surface);border-color:var(--dark-line);color:var(--dark-text);box-shadow:0 10px 36px #0005}
html[data-theme="dark"] dialog::backdrop{background:#060e09b3}
html[data-theme="dark"] .theme-control{border-color:var(--dark-line)}
html[data-theme="dark"] .theme-label{color:var(--dark-muted)}
html[data-theme="dark"] .theme-options{background:#161d19}
html[data-theme="dark"] .theme-options button{color:#b8c8bd}
html[data-theme="dark"] .theme-options button[aria-pressed="true"]{background:#2d4435;border-color:#456d52;color:#9ae6ba}
html[data-theme="dark"] .danger{background:#a73d3a;color:#fff}
html[data-theme="dark"] #gate-error,
html[data-theme="dark"] #restore-error,
html[data-theme="dark"] #master-error,
html[data-theme="dark"] #notebook-error,
html[data-theme="dark"] #delete-notebook-error{color:#ffb3ad}
html[data-theme="dark"] .error{background:#432b22;color:#ffd0b3}
html[data-theme="dark"] #delete-notebook-notes{accent-color:#e68a83}
html[data-theme="dark"] #format-toolbar{background:#1c2420;border-color:var(--dark-line)}
html[data-theme="dark"] #format-toolbar .ql-formats{border-color:var(--dark-line)}
html[data-theme="dark"] #format-toolbar .ql-stroke{stroke:#b9c8be}
html[data-theme="dark"] #format-toolbar .ql-fill{fill:#b9c8be}
html[data-theme="dark"] #format-toolbar .ql-picker{color:#b9c8be}
html[data-theme="dark"] #format-toolbar .ql-picker-options{background:#222d26;border-color:#465b4b;box-shadow:0 6px 16px #0005}
html[data-theme="dark"] #format-toolbar button:hover,
html[data-theme="dark"] #format-toolbar button.ql-active{background:#304c39;color:var(--dark-accent)}
html[data-theme="dark"] #format-toolbar button:hover .ql-stroke,
html[data-theme="dark"] #format-toolbar button.ql-active .ql-stroke{stroke:var(--dark-accent)}
html[data-theme="dark"] #format-toolbar button:hover .ql-fill,
html[data-theme="dark"] #format-toolbar button.ql-active .ql-fill{fill:var(--dark-accent)}
html[data-theme="dark"] #format-toolbar .ql-picker-item:hover,
html[data-theme="dark"] #format-toolbar .ql-picker-item.ql-selected{color:#8fe0b0}
html[data-theme="dark"] #rich-body .ql-editor{color:var(--dark-text)}
html[data-theme="dark"] #rich-body .ql-editor.ql-blank::before{color:#a1aea5}
html[data-theme="dark"] #rich-body .ql-editor blockquote{border-color:#53a875;color:#b2c8ba}
html[data-theme="dark"] #rich-body .ql-editor .ql-code-block-container{background:#141d17;color:#b3ddbf}
html[data-theme="dark"] #rich-body .ql-editor hr{border-color:#536f5c}
html[data-theme="dark"] #rich-body:focus-within{box-shadow:inset 2px 0 #53c58b}
html[data-theme="dark"] ::selection{background:#3f7454;color:#fff}
@media(max-width:760px){.gate-theme{position:static;align-self:flex-end;order:-1;margin-bottom:-12px}.theme-options button{min-height:40px}}
html[data-theme="dark"] #rich-body .ql-editor p{color:inherit}

/* Desktop workspace: each column scrolls independently. */
@media(min-width:761px){
 body:has(#workspace:not([hidden])){height:100dvh;overflow:hidden}
 #workspace{height:100dvh;min-height:0;grid-template-rows:minmax(0,1fr);overflow:hidden}
 .editor,.notes-column{min-height:0;overflow:hidden}
 #editor-form{min-height:0;overflow:hidden}
 .editor-bar,.note-heading,#format-toolbar,.editor-footer,.notes-column>header,.list-footer{flex-shrink:0}
 #rich-body{flex:1 1 0;min-height:0;height:auto;overflow:hidden}
 #rich-body .ql-editor{height:100%;min-height:0;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-gutter:stable}
 #note-list{min-height:0;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-gutter:stable}
 .sidebar,#notebooks{overscroll-behavior-y:contain}
}

#cloud-login-form{display:flex;flex-direction:column;gap:10px}#cloud-login-form label{margin-top:8px}#cloud-login-form input{width:100%}#cloud-message,#cloud-status{font-size:13px;line-height:1.6;overflow-wrap:anywhere}#cloud-dialog .text-button{display:block}#cloud-conflict{border:1px solid var(--border);padding:16px;border-radius:12px;margin:16px 0}#cloud-conflict button{display:block;margin:12px 0}#cloud-auth[hidden],#unlock-form[hidden]{display:none}

.gate-account{position:absolute;top:24px;left:24px;z-index:2;font-size:13px}
