/* Approved note surfaces, using the original composer and controls. */
#notesTree[hidden]{display:none}
#notesDesktopFilters{display:none}
#noteComposer{position:static;inset:auto;width:100%;padding:0;background:transparent;backdrop-filter:none;z-index:auto}
#noteComposer>.modalbox{width:100%;max-width:none;max-height:none;margin:0;box-shadow:none;display:flex;flex-direction:column;padding:14px 24px;min-height:calc(100dvh - 180px)}
#noteComposer .modalhead{background:transparent;border:0;padding:0;min-height:36px;margin:0 0 12px;justify-content:flex-end}
#noteEditorTitle{display:none}
#noteComposer .note-main-field{display:flex;flex:1;align-items:stretch;min-height:240px;margin:0}
:root[data-app-theme] body:not(.zen-mode) #noteComposer #noteBodyInput{flex:1 1 auto;width:100%;min-height:240px;height:auto;max-height:none;resize:none;background:transparent;color:var(--ink);-webkit-text-fill-color:var(--ink);border:0;border-radius:0;box-shadow:none;padding:4px 0;font-size:1.06rem;line-height:1.75;caret-color:var(--ink)}
#noteComposer #noteBodyInput:focus{outline:none;box-shadow:none}
#noteComposer .note-editor-actions{flex:none;border-top:1px solid var(--line);padding-top:9px;margin-top:0}
#noteComposer #noteMicBtn{flex:none;width:40px;min-width:40px;min-height:40px;padding:0;border:1px solid var(--line);background:var(--theme-control,var(--panel));color:var(--ink)}
@media (min-width:901px) and (hover:hover), (min-width:901px) and (pointer:fine), (min-width:901px) and (pointer:none), (min-width:901px) and (min-height:501px), (min-width:901px) and (orientation:portrait){
  body.notes-view:not(.nav-collapsed):not(.zen-mode){--app-nav-width:270px}
  body.notes-view .app{max-width:1550px}
  #notesTree{flex:1 1 0;min-height:80px;overflow-y:auto;overscroll-behavior:contain;border-top:1px solid var(--line);padding-top:4px}
  body.nav-collapsed #notesTree{display:none}
  .notes-tree-folder{display:flex;align-items:center;min-width:0}
  .notes-tree-disclosure{width:28px;min-width:28px;min-height:36px;padding:3px;border:0;background:transparent;color:var(--muted)}
  .notes-tree-tag{display:flex;align-items:center;flex:1;min-width:0;gap:8px;min-height:36px;padding:6px;border:0;background:transparent;color:var(--ink);text-align:left;font-size:.83rem;font-weight:600;border-radius:7px}
  .notes-tree-tag small{margin-left:auto;color:var(--muted);font-weight:400;font-size:.72rem}
  .notes-tree-titles{padding-left:17px;margin-left:13px;border-left:1px solid var(--line)}
  .notes-tree-title{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;max-width:100%;padding:8px;margin:1px 0;border:0;border-radius:7px;text-align:left;background:transparent;color:var(--ink);font-size:.81rem;line-height:1.4;font-weight:400}
  .notes-tree-title[aria-current="true"],.notes-tree-title:hover{background:var(--soft)}
  #notesDesktopFilters{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-bottom:10px;position:relative;min-height:40px}
  #notesFilterToggle{width:40px;min-height:40px;border-radius:50%;padding:10px;background:var(--theme-control,var(--panel))}
  #notesFilterToggle svg{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
  #notesDesktopFilters #noteTagBar{display:none;position:absolute;right:48px;top:0;z-index:12;max-width:min(680px,calc(100vw - 360px));padding:6px;background:var(--theme-card,var(--panel));border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow)}
  #notesDesktopFilters #noteTagBar.is-open{display:flex;flex-wrap:wrap}
  .notes-editor-open #captureForm,.notes-editor-open .app>.hint{display:none}
}
@media (max-width:900px), (orientation:landscape) and (hover:none) and (pointer:coarse) and (max-height:500px){
  #notesTree{display:none}
}
body.notes-mobile-editor{background:var(--theme-card,var(--panel))}
body.notes-mobile-editor .app>.top,body.notes-mobile-editor #captureForm,body.notes-mobile-editor .app>.hint,body.notes-mobile-editor #notesDesktopFilters{display:none}
body.notes-mobile-editor:not(.zen-mode):not(.landing-mode) .app{padding-top:calc(12px + env(safe-area-inset-top,0px));padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
body.notes-mobile-editor #noteComposer>.modalbox{background:transparent;border:0;border-radius:0;padding:0;min-height:calc(100dvh - 120px)}
body.notes-mobile-editor #noteComposer .note-editor-left{width:100%;gap:4px;flex-wrap:wrap}
body.notes-mobile-editor #noteComposer #noteDeleteBtn{margin-left:auto}
body.notes-mobile-editor #noteComposer #noteSaveBtn{margin-left:auto}
body.notes-mobile-editor #noteComposer .note-editor-left:has(#noteDeleteBtn:not([hidden])) #noteSaveBtn{margin-left:0}
@media (min-width:901px) and (hover:hover), (min-width:901px) and (pointer:fine), (min-width:901px) and (pointer:none), (min-width:901px) and (min-height:501px), (min-width:901px) and (orientation:portrait){
 body.notes-mobile-editor:not(.zen-mode):not(.landing-mode){padding-left:0}
 body.notes-mobile-editor .navrow{display:none}
}

@media (max-width:900px), (orientation:landscape) and (hover:none) and (pointer:coarse) and (max-height:500px){
 #view-notes .notes-layout>.card>.panel-title{flex-wrap:nowrap;gap:8px}
 #view-notes .note-head-controls{flex-wrap:nowrap;gap:5px;min-width:0}
 #view-notes .note-head-controls :is(.shared-mic-btn,.shared-create-btn){width:36px;min-width:36px;min-height:40px;padding:5px}
 #view-notes #noteBulkToggle{padding:8px;font-size:.82rem;white-space:nowrap}
}

@media(max-width:360px){#view-notes .panel-title h2{font-size:1.1rem}#view-notes .note-head-controls{gap:4px}#view-notes .note-head-controls :is(.shared-mic-btn,.shared-create-btn){width:32px;min-width:32px}#view-notes #noteBulkToggle{font-size:.78rem;padding:6px}}

/* One bounded text scroller, also on a phone wider than 900px in landscape. */
body.notes-mobile-editor{position:fixed;inset:0;top:var(--note-viewport-top,0px);bottom:auto;height:var(--note-viewport-height,100dvh);overflow:hidden}
body.notes-mobile-editor .app{height:var(--note-viewport-height,100dvh);min-height:0;display:flex;flex-direction:column;padding-bottom:var(--note-nav-height,84px);overflow:hidden}
body.notes-mobile-editor #view-notes{flex:1;min-height:0}
body.notes-mobile-editor #view-notes .notes-layout,body.notes-mobile-editor #noteComposer{height:100%;min-height:0}
body.notes-mobile-editor #noteComposer>.modalbox{height:100%;min-height:0;overflow:hidden}
body.notes-mobile-editor #noteComposer .modalhead{flex:none}
body.notes-mobile-editor #noteComposer .note-main-field{min-height:0;overflow:hidden}
body.notes-view.notes-mobile-editor:not(.zen-mode) #noteComposer #noteBodyInput{min-height:0;height:100%;overflow-y:auto;overscroll-behavior:contain}
:root[data-app-theme] body.notes-mobile-editor:not(.zen-mode):not(.landing-mode){background:var(--theme-card,var(--panel))}
@media (max-width:900px) and (max-height:450px), (orientation:landscape) and (hover:none) and (pointer:coarse) and (max-height:500px) and (max-height:450px){
 body.notes-editor-open #noteComposer .modalhead{margin-bottom:0}
 body.notes-editor-open #noteComposer .note-editor-actions{padding-top:4px}
}
body.notes-mobile-editor.notes-editor-compact #noteComposer>.modalbox{position:relative}
body.notes-mobile-editor.notes-editor-compact #noteComposer .modalhead{position:absolute;right:0;top:0;width:44px;margin:0;padding:0;min-height:44px}
body.notes-mobile-editor.notes-editor-compact #noteComposer .note-editor-actions{padding-top:4px}
body.notes-view.notes-mobile-editor.notes-editor-compact:not(.zen-mode) #noteComposer #noteBodyInput{padding-right:50px}
/* Human-approved: writing with the software keyboard keeps the editor actions. */
body.notes-mobile-editor.notes-keyboard-open .navrow{display:none}
body.notes-mobile-editor.notes-keyboard-open .app{padding-bottom:8px}
/* iPhone portrait: close remains accessible without reserving a header row.
   The bottom padding belongs to the text scroller, so the last paragraph can
   be moved above the tools without shrinking the editor itself. */
body.notes-phone-writing #noteComposer>.modalbox{position:relative}
body.notes-phone-writing #noteComposer .modalhead{position:absolute;right:0;top:0;width:44px;margin:0;padding:0;min-height:44px;z-index:1}
:root[data-app-theme] body.notes-phone-writing:not(.zen-mode) #noteComposer #noteBodyInput{padding-right:52px;padding-bottom:clamp(48px,16dvh,96px);scroll-padding-bottom:48px}
/* Keep the complete action row; give the remaining visible height to writing. */
@media (orientation:landscape) and (hover:none) and (pointer:coarse) and (max-height:500px){
 body.notes-mobile-editor.notes-keyboard-open:not(.zen-mode) .app{padding-top:4px;padding-bottom:4px}
 body.notes-mobile-editor.notes-keyboard-open #noteComposer>.modalbox{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:minmax(0,1fr) auto auto;gap:0 8px}
 body.notes-mobile-editor.notes-keyboard-open #noteComposer .note-main-field{grid-column:1/-1;grid-row:1;min-height:0}
 body.notes-mobile-editor.notes-keyboard-open #noteAttachmentList{grid-column:1/-1;grid-row:2;max-height:40px;overflow:auto;margin-top:0}
 body.notes-mobile-editor.notes-keyboard-open #noteAttachmentList:empty{display:none}
 body.notes-mobile-editor.notes-keyboard-open #noteLinkLine{grid-column:1;grid-row:3;align-self:center;margin:0;min-width:0}
 body.notes-mobile-editor.notes-keyboard-open #noteComposer .note-editor-actions{grid-column:2;grid-row:3;margin:0;padding-top:2px;min-width:0}
 body.notes-mobile-editor.notes-keyboard-open #noteComposer .note-editor-left{gap:4px;flex-wrap:nowrap}
 :root[data-app-theme] body.notes-view.notes-mobile-editor.notes-keyboard-open:not(.zen-mode) #noteComposer #noteBodyInput{font-size:16px;line-height:20px;padding-top:2px;padding-bottom:2px;padding-right:50px}
}
