:root{font-family:Arial,Helvetica,sans-serif;color:#183744;background:#f1f6f8;font-size:16px;--blue:#063455;--teal:#087d91;--line:#c7d8df}*{box-sizing:border-box}body{margin:0}header{display:flex;align-items:center;gap:16px;padding:12px 22px;background:white;border-bottom:3px solid var(--teal)}header img{object-fit:contain}h1{font-size:25px;margin:0 0 8px;color:var(--blue)}h2{font-size:21px;color:var(--blue)}small,.muted{color:#526871;font-size:13px}.lock{margin-left:12px}.brand{flex:1}nav{display:flex;gap:6px}button,input,select,textarea{font:inherit}button{background:#eef6f8;color:#153c4d;border:1px solid var(--line);border-radius:5px;min-height:42px;padding:9px 13px;cursor:pointer}button:hover{background:#dceef2}button:disabled{opacity:.55;cursor:wait}button.primary{background:#086c80;color:white;border-color:#086c80}button.primary:hover{background:#07586a}button[aria-pressed=true],button.active{border-color:var(--teal);background:#d9eef2;box-shadow:inset 0 -2px var(--teal)}button.danger{color:#9b2637}input,select,textarea{border:1px solid var(--line);border-radius:5px;background:#fff;color:#163744;padding:12px;min-width:0}input,select{min-height:44px}input:read-only{background:#f5f8fa}input:focus,textarea:focus{outline:2px solid #1594a9;outline-offset:1px}:focus-visible{outline:3px solid #1594a9;outline-offset:3px}label{display:block;font-size:14px;margin:6px 0}main{padding:16px;max-width:1800px;margin:auto;min-height:76vh}.card{background:white;border:1px solid #e5edf0;border-radius:8px;padding:16px}.welcome{max-width:840px;margin:36px auto;padding:36px}.welcome h2{font-size:32px;line-height:1.2}.welcome p{line-height:1.6}.eyebrow{font-size:12px;letter-spacing:1.5px;color:#087d91;font-weight:bold}.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.grow,.row>input{flex:1}.actions{display:flex;gap:8px;flex-wrap:wrap}.workspace-head{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.workspace-head h2{margin:4px;flex:1;overflow-wrap:anywhere}.badge{background:#e3eef2;font-size:12px;padding:6px 10px;border-radius:4px}.hint{background:#eaf6f8;border:1px solid #bddce3;border-radius:5px;padding:13px;line-height:1.55;margin:12px 0}#owner-bar span{flex:1}.layout{display:grid;grid-template-columns:285px minmax(0,1fr);gap:14px;align-items:start;margin-top:14px}.layout.collapsed{grid-template-columns:minmax(0,1fr)}.layout.collapsed #sidebar{display:none}#sidebar input,#sidebar select{width:100%}#sidebar label:not(:first-child){margin-top:15px}#sidebar{max-height:calc(100vh - 190px);overflow:auto;position:sticky;top:10px}.note-item{display:block;width:100%;text-align:left;margin-bottom:7px;background:white;padding:12px;overflow-wrap:anywhere}.note-item strong{display:block;margin-bottom:6px}.note-item small{display:block;line-height:1.4}.note-item[aria-current=true]{background:#e7f3f5;border-left:4px solid var(--teal)}.editor-card{min-height:560px;min-width:0}#empty{padding:80px 15px;text-align:center;color:#526871}#note-title{font-size:20px;font-weight:bold;width:100%;color:var(--blue)}.editor-controls{justify-content:space-between;margin:15px 0}#save-state{font-size:13px;color:#34635f}#toolbar{display:flex;gap:5px;flex-wrap:wrap;margin-bottom:10px}#toolbar button{font-size:13px;min-height:36px;padding:7px 10px}.writing{display:grid;grid-template-columns:1fr;gap:18px}.writing.split{grid-template-columns:1fr 1fr}#body{width:100%;height:53vh;min-height:330px;resize:vertical;font:15px/1.65 Consolas,monospace;tab-size:2}.markdown{min-height:330px;overflow-wrap:anywhere;padding:8px 14px;line-height:1.65;max-height:65vh;overflow:auto}.markdown h1{font-size:28px}.markdown h2{font-size:23px}.markdown blockquote{margin:16px 0;border-left:3px solid var(--teal);padding:4px 15px;background:#f2f8f9}.markdown pre{overflow:auto;background:#f1f5f7;padding:16px}.markdown code{font-family:Consolas,monospace;background:#edf3f5}.markdown a,a{color:#086c80}.tags{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px}.tags button{font-size:12px;min-height:30px;padding:5px 9px}footer{padding:18px;display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap;font-size:12px;color:#526871}footer button{font-size:12px;background:transparent}dialog{border:1px solid var(--line);border-radius:9px;max-width:760px;width:calc(100% - 30px);max-height:86vh;padding:22px;color:#183744}dialog::backdrop{background:#052c4566}dialog h2{flex:1;margin:0 0 12px}#dialog-close{font-size:25px}#dialog-content{line-height:1.6}#dialog-content input,#dialog-content select{width:100%}.dialog-actions{margin-top:18px}.share-item,.trash-item{border-top:1px solid var(--line);padding:14px 0;overflow-wrap:anywhere}.share-item .row{margin-top:8px}.link-box{font:12px/1.5 monospace;overflow-wrap:anywhere;max-height:100px;overflow:auto;background:#f3f8fa;padding:12px;margin:10px 0}.error,#notice.error{background:#fff0ed;color:#8f2634;border-color:#d8a6a6}#notice{padding:13px;border:1px solid #9fc8d0;border-radius:5px;background:#e8f5f5;overflow-wrap:anywhere}.skip{position:absolute;top:-100px}.skip:focus{top:0;background:white;z-index:10;padding:12px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}[hidden]{display:none!important}@media(max-width:950px){header{padding:10px;gap:10px}.lock{display:block;margin:4px 0 0}.actions{width:100%}.layout{grid-template-columns:235px minmax(0,1fr)}.writing.split{grid-template-columns:1fr}.writing.split #preview{border-top:1px solid var(--line)}}@media(max-width:650px){header{flex-wrap:wrap}header img{width:54px;height:54px}h1{font-size:21px}nav{margin-left:auto}nav button{padding:7px 10px}main{padding:10px}.welcome{padding:22px;margin:12px 0}.welcome h2{font-size:27px}.layout{grid-template-columns:1fr}#sidebar{position:static;max-height:45vh}.card{padding:12px}.editor-card{min-height:450px}.editor-card>.row>button{font-size:12px}#body{height:48vh}.workspace-head h2{font-size:18px}.actions button{flex:1;font-size:13px}.row>input{flex-basis:180px}.markdown{padding:6px}.writing.split{grid-template-columns:1fr}#owner-bar button{font-size:12px}dialog{padding:16px}}
@media(max-width:650px){.editor-card .grow{flex:1 0 100%;min-width:0}.editor-card .row>button{font-size:13px}header .brand{min-width:110px}.workspace-head h2{min-width:110px}}
.editor-card .grow{min-width:220px}
/* V1.1: compact labels retain touch targets and visible keyboard focus. */
button{font-size:13px;min-height:36px;padding:7px 10px}.primary{font-size:13px}#toolbar button{font-size:12px;min-height:32px;padding:5px 8px}.tags button{font-size:12px;min-height:32px;padding:5px 8px}.note-item{font-size:14px;padding:11px}.note-item small{font-size:12px}.share-actions{gap:6px}.share-actions .muted{flex-basis:100%;margin:4px 0}#reset-filters{margin-top:10px;width:100%}.qr-image{display:block;max-width:100%;width:360px;height:auto;margin:18px auto;image-rendering:pixelated}.editor-shell{position:relative;min-width:0;border-radius:5px;isolation:isolate}.editor-shell #body,.editor-shell #editor-mirror{font:15px/1.65 Consolas,'Courier New',monospace;letter-spacing:0;tab-size:2;white-space:pre-wrap;overflow-wrap:break-word;word-break:normal;padding:12px;border:1px solid var(--line);border-radius:5px;text-align:left;box-sizing:border-box}.editor-shell #body{position:relative;z-index:1;display:block;margin:0;color:transparent;caret-color:#163744;background:transparent;resize:vertical;-webkit-text-fill-color:transparent}.editor-shell #body::selection{background:#087d9140;color:transparent}.editor-shell #editor-mirror{position:absolute;z-index:0;inset:0;margin:0;overflow:hidden;pointer-events:none;color:#163744;background:white}.editor-shell #editor-mirror strong{font-weight:700;color:inherit}#tag-suggestions{position:absolute;z-index:3;left:8px;right:8px;bottom:8px;background:white;border:1px solid var(--teal);border-radius:5px;box-shadow:0 3px 12px #06345522;display:flex;gap:5px;padding:8px;flex-wrap:wrap}#tag-suggestions button[aria-selected=true]{background:#d9eef2;border-color:var(--teal)}@media(pointer:coarse){button,#toolbar button,.tags button{min-height:44px}}@media(forced-colors:active){.editor-shell #body{color:CanvasText;-webkit-text-fill-color:CanvasText;background:Canvas}.editor-shell #editor-mirror{display:none}}@media(max-width:650px){.actions button,.editor-card .row>button,#owner-bar button,nav button{font-size:12px}header nav button{padding:6px 8px}.editor-shell{width:100%}}
/* Inline collection naming retains an accessible label and its own save state. */
.collection-name-field{flex:1 1 240px;min-width:0;max-width:100%}
.collection-name-field input{width:100%;font-size:1.2rem;font-weight:700}
.collection-name-field input[readonly]{background:transparent;border-color:transparent}
#collection-status{display:block;font-size:12px;margin-top:4px}
/* V1.2: QuickDict-style compact controls with a persistent, short brand header. */
/* Compact overrides are last so responsive legacy rules cannot enlarge them. */
:root{--header-height:66px;scroll-padding-top:78px}
body>header{position:sticky;top:0;z-index:20;padding:6px 16px;gap:10px;min-height:var(--header-height);flex-wrap:nowrap;border-bottom-width:2px}
body>header img{display:block;width:48px;height:48px}body>header h1{font-size:21px;margin:0 0 3px}.brand small{font-size:11px}.lock{display:inline;margin-left:8px}header nav{align-items:center;margin:0}header nav button{min-height:34px}
main{padding:10px 14px}.card{padding:10px}.workspace-head{gap:8px}.workspace-head .actions{gap:5px;width:auto;margin-left:auto}.collection-name-field{position:relative;flex:1 1 220px}.collection-name-field input{font-size:17px;min-height:38px;padding:7px 36px 7px 9px}.collection-name-field .compact-status{position:absolute;right:5px;top:3px;margin:0}.layout{margin-top:10px;gap:10px;grid-template-columns:250px minmax(0,1fr)}#sidebar{top:calc(var(--header-height) + 10px);max-height:calc(100dvh - var(--header-height) - 24px)}#sidebar label:not(:first-child){margin-top:9px}#sidebar input,#sidebar select{min-height:36px;padding:7px;font-size:13px}.note-item{padding:8px;margin-bottom:5px}.note-item strong{margin-bottom:3px}#count{margin:8px 0}.editor-card{min-height:440px}#note-title{font-size:18px;min-height:38px;padding:7px 10px}.editor-controls{margin:8px 0}.row{gap:6px}#toolbar{gap:4px;margin-bottom:7px}.icon-button,#toolbar .icon-button{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;min-height:34px;min-width:34px;padding:6px;flex:none;font-size:14px}.icon-button svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.icon-button span{font-weight:600}.compact-status{display:inline-flex!important;align-items:center;justify-content:center;width:28px;height:28px;min-width:28px;font-size:19px!important;color:#087d91}.compact-status[data-state=saved]{color:#178447!important}#body{height:calc(100dvh - 270px);min-height:300px}.skip:focus{z-index:30}footer{margin-top:12px;padding:10px 14px;font-size:12px}
@media(max-width:950px){.layout{grid-template-columns:215px minmax(0,1fr)}.workspace-head .actions{width:auto}.lock{display:inline;margin-left:5px}}
@media(max-width:650px){:root{--header-height:62px}body>header{padding:5px 8px;gap:7px}body>header img{width:40px;height:40px}body>header h1{font-size:17px}header .brand{min-width:0}.brand small{font-size:10px}.lock{display:none}nav{gap:4px}main{padding:8px}.card{padding:8px}.collection-name-field{flex:1 1 150px}.workspace-head .actions{flex-basis:100%;justify-content:flex-end}.workspace-head .actions button{flex:none}.layout{grid-template-columns:1fr}#sidebar{position:static;max-height:40dvh}.editor-card .grow{min-width:0;flex:1 1 100%}#body{height:calc(100dvh - 310px);min-height:280px}.editor-shell #body,.editor-shell #editor-mirror{padding:9px}.editor-card{min-height:350px}}
@media(pointer:coarse){.icon-button,#toolbar .icon-button,header nav button{min-width:44px;min-height:44px;width:44px;height:44px}}
@media(max-width:360px){body>header h1{font-size:15px}body>header img{width:32px;height:32px}header nav{gap:2px}body>header{gap:4px}}
.compact-status[hidden]{display:none!important}
/* Native modal makes the mobile note list independent of editor stacking. */
.dialog-top{display:flex;align-items:center;justify-content:space-between;gap:12px}.dialog-top h2{margin:0}.dialog-x{width:44px;height:44px;min-width:44px;min-height:44px;padding:4px;font-size:27px;flex:none}.notes-dialog{width:calc(100% - 20px);max-width:680px;height:calc(100dvh - 20px);max-height:calc(100dvh - 20px);padding:12px;overflow:hidden}.notes-dialog[open]{display:flex;flex-direction:column;gap:8px}.notes-dialog #sidebar{position:static;display:block;max-height:none;overflow:auto;flex:1;min-height:0;border:0;padding:4px;overscroll-behavior:contain}.notes-dialog #search{font-size:16px}.notes-open{overflow:hidden}.mobile-layout{grid-template-columns:minmax(0,1fr)!important}.file-hover{outline:3px dashed var(--teal);outline-offset:3px;background:#eaf6f8}.notes-dialog .note-item[aria-current=true]{border:2px solid var(--teal);border-left-width:5px}.notes-dialog::backdrop{background:#06345599}
@media print{body>header,footer,.workspace-head,#sidebar,#toolbar,.editor-controls,#notice,dialog,.editor-card .row{display:none!important}main,.card,.layout,.writing{display:block!important;padding:0!important;margin:0!important;border:0!important;max-width:none!important}.editor-shell{display:none!important}#preview[hidden],#preview{display:block!important;color:black;background:white}#editor-area[hidden],#workspace[hidden],#landing[hidden]{display:none!important}}
/* Relative heading/code sizes follow the selected preview base font size. */
#preview h1{font-size:2em}#preview h2{font-size:1.5em}#preview h3{font-size:1.17em}#preview h4{font-size:1em}#preview h5{font-size:.83em}#preview h6{font-size:.67em}#preview pre,#preview code{font-size:.9em}#preview pre code{font-size:inherit}#preview-size-controls{gap:4px}#preview-size-controls button{min-width:38px}#preview-size-reset{font-variant-numeric:tabular-nums;min-width:58px!important}

/* Keep the collection title above one compact navigation/action row on phones.
   Wrapping within the actions preserves touch targets at very narrow widths. */
@media(max-width:650px){
  .workspace-head{display:grid;grid-template-columns:auto minmax(0,1fr);gap:5px 6px}
  .workspace-head .collection-name-field{grid-column:1/-1;grid-row:1;min-width:0;width:100%}
  .workspace-head #toggle-sidebar{grid-row:2;grid-column:1;font-size:12px;padding:7px 8px}
  .workspace-head .actions{grid-row:2;grid-column:2;min-width:0;width:auto;margin:0;justify-content:flex-end;gap:4px}
  .workspace-head #share{white-space:nowrap;padding:7px 8px}
  .workspace-head .collection-name-field input{width:100%;min-height:34px;padding-top:4px;padding-bottom:4px}
}

.menu-link{display:block;padding:12px;margin:8px 0;border:1px solid var(--line);border-radius:5px;text-decoration:none;background:#eef6f8;font-weight:600;min-height:44px}

/* Explicit sizing overrides the generic header logo rules on small screens. */
#help .launchpad-logo{display:block;width:28px;height:28px;object-fit:contain}#help.icon-button{padding:2px}.menu-link .launchpad-logo{width:34px;height:34px;object-fit:contain;vertical-align:middle;margin-right:10px}@media(pointer:coarse){#help .launchpad-logo{width:36px;height:36px}}

/* Offscreen plain-text geometry matches the native textarea wrapping. */
.scroll-measure{position:fixed;left:-100000px;top:0;visibility:hidden;pointer-events:none;box-sizing:border-box;white-space:pre-wrap;overflow-wrap:break-word;word-break:normal;border:0;margin:0}#body,#preview{scroll-behavior:auto;overflow-anchor:none}

/* Reuse the existing metadata row without adding a separate panel. */
.note-metadata{font-size:12px;line-height:1.4;column-gap:10px;row-gap:2px}.note-metadata #note-created,.note-metadata #note-date{white-space:nowrap;font-size:12px}

/* Explicit note actions remain reachable inside the mobile list dialog. */
.note-list-row{display:flex;align-items:stretch;gap:5px;margin-bottom:7px}.note-list-row .note-item{flex:1;min-width:0;margin:0}/* A small trash icon replaces the wide label. Touch targets remain 44 px. */
.note-delete.icon-button{align-self:flex-start;flex:none;border-color:transparent;background:transparent;width:30px;min-width:30px;height:32px;min-height:32px;padding:6px}.note-delete.icon-button:hover{background:#fff0ed;border-color:#d8a6a6}.note-delete.icon-button svg{width:17px;height:17px}#delete.icon-button{margin-left:auto}
@media(max-width:900px),(pointer:coarse){.note-delete.icon-button,#delete.icon-button{width:44px;min-width:44px;height:44px;min-height:44px}.note-delete.icon-button{padding:12px}}

/* Explicit map links are usable beside the editor without changing its text selection. */
.location-link{display:inline-flex;align-items:center;min-height:32px;padding:5px 8px;border:1px solid var(--line);border-radius:5px;font-size:12px;overflow-wrap:anywhere}.location-link:focus-visible{outline:3px solid var(--teal)}@media(pointer:coarse){.location-link{min-height:44px}}

/* A task checkbox replaces the list marker; label provides a generous hit area. */
.markdown li.task-item{list-style:none}
.markdown .task-label{display:flex;align-items:baseline;gap:.55em;font:inherit;margin:0;min-height:32px;cursor:pointer}
.markdown .task-label input[type=checkbox]{flex:none;width:20px;height:20px;min-height:20px;padding:0;margin:0;accent-color:var(--teal)}
.markdown .task-label:has(input:disabled){cursor:default}
@media(pointer:coarse){.markdown .task-label{min-height:44px}}

/* The same control and list serve desktop and the mobile notes dialog. */
#sidebar .note-list-view{display:flex;align-items:center;gap:8px;min-height:44px;margin:8px 0 0;cursor:pointer}
#sidebar #short-note-list{width:20px;height:20px;min-height:20px;margin:0;padding:0;flex:none;accent-color:var(--teal)}
#note-list.titles-only .note-item small{display:none}
#note-list.titles-only .note-item strong{margin-bottom:0}
#note-list.titles-only .note-item{padding-top:8px;padding-bottom:8px}

.note-image{display:block;margin:10px 0;overflow-wrap:anywhere}.note-image img{display:block;max-width:100%;height:auto;object-fit:contain;border-radius:4px}.image-dialog .image-entry{border-top:1px solid var(--line);padding:14px 0}.image-dialog .note-image img{max-height:200px;width:auto}.image-dialog .image-entry input{width:100%}.image-dialog .row{margin-top:8px}

/* Compact inline search preserves access to editor and Undo. */
.find-panel{border:1px solid var(--line);border-radius:5px;padding:10px;margin:8px 0}.find-panel input[type=text]{display:block;width:100%;margin-top:4px}.find-panel .grow{flex:1 1 180px}.find-panel label{display:flex;gap:6px;align-items:center}.find-panel label.grow{display:block}.find-panel input[type=checkbox]{min-height:0;width:auto}.find-panel p{margin:6px 0;font-size:13px}
