:root{font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;color:var(--ink);background:var(--paper);font-synthesis:none;-webkit-font-smoothing:antialiased;color-scheme:light;--ink:#28352e;--secondary:#5f6d64;--muted:#6e7a71;--accent:#127b58;--accent-dark:#0f694b;--action:#08976a;--paper:#fdfefa;--surface:#fff;--tint:#eaf3eb;--search:#f1f5ee;--line:#e6ece4;--control-line:#c6d5c9;--danger:#b54f4f;--danger-tint:#fbefed;--serif:"Songti SC","STSong","Noto Serif CJK SC",serif}

*{box-sizing:border-box}
body{margin:0;min-width:320px;background:var(--paper);min-height:100vh}
button,input,textarea,select{font:inherit}
button{cursor:pointer;color:inherit;touch-action:manipulation;border:0;background:none}
button,input,select{-webkit-tap-highlight-color:transparent}
button:disabled{cursor:default;opacity:.34}
button:focus-visible,[role=button]:focus-visible{outline:3px solid var(--accent);outline-offset:4px}
input:focus-visible,select:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
button:active:not(:disabled){transform:translateY(1px)}
a{color:var(--accent)}
.hidden{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.icon{width:21px;height:21px;flex-shrink:0;vertical-align:middle;stroke-width:1.7}
.quiet{color:var(--muted)}
.loading{padding:120px 20px;text-align:center;color:var(--muted)}
#app{max-width:636px;margin:0 auto;min-height:100dvh}
.brand-mark{display:grid;place-items:center;background:var(--accent);color:var(--surface);width:42px;height:46px;border-radius:11px 11px 16px 11px;font-family:var(--serif);font-size:23px;letter-spacing:0}
.icon-button{display:inline-grid;place-items:center;padding:10px;border-radius:12px;min-width:40px;min-height:40px;transition:background .18s,color .18s}
.icon-button:hover:not(:disabled){background:var(--tint);color:var(--accent-dark)}
.badges{display:flex;gap:7px;flex-wrap:wrap;align-items:center}
.badge{display:inline-flex;align-items:center;gap:5px;padding:5px 8px;border-radius:6px;font-size:11px;font-weight:400;letter-spacing:.1px;white-space:nowrap;line-height:1.3}
.badge .icon{width:12px;height:12px;stroke-width:1.8}
.source-badge{color:var(--secondary);background:var(--search);border:1px solid var(--line)}
.date-badge{color:var(--accent);background:var(--tint);border:1px solid #d8e7db}
.date-badge.soon{color:#a36218;background:#fff4e5;border-color:#eed9b9}
.date-badge.today,.date-badge.near{color:var(--danger);background:var(--danger-tint);border-color:#efd5d1}
.date-badge.past{color:var(--muted);background:var(--search);border-color:var(--line)}
.badge-label{overflow:hidden;text-overflow:ellipsis}

/* Flat home list; its opaque rows remain the moving surface for swipe actions. */
.home-view{padding:18px 24px calc(98px + env(safe-area-inset-bottom))}
.home-header{margin-bottom:8px}
.home-title{display:flex;justify-content:space-between;align-items:center;gap:10px;min-height:46px}
.home-title h1{margin:0;font-size:21px;line-height:1.35;font-weight:400;letter-spacing:0;white-space:nowrap}
.home-title h1 span{font-size:13px;font-weight:400;letter-spacing:0;color:var(--muted);vertical-align:baseline;margin-left:7px}
.home-title .icon-button{width:44px;height:44px;flex-shrink:0;color:var(--secondary)}
.home-title .home-filter-title:not(.sr-only){flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;font-size:17px;color:var(--accent-dark)}
.card-tags{display:flex;gap:5px 12px;flex-wrap:wrap;color:var(--accent-dark);font-size:12px;line-height:1.7;margin-top:8px;overflow-wrap:anywhere}
.note-hashtag{color:var(--accent-dark);background:var(--tint);border-radius:3px}
.tag-drawer-shell{position:fixed;top:var(--visible-top,0px);left:max(0px,calc((100% - 636px)/2));width:min(636px,100%);height:var(--visible-height,100dvh);overflow:hidden;isolation:isolate;z-index:12;background:var(--paper)}
html[data-native=true] .tag-drawer-shell{top:0;height:var(--native-home-height,100dvh)}
.tag-drawer{position:absolute;inset:0 auto 0 0;width:80%;padding:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none;background:var(--paper);z-index:1;will-change:transform,opacity;touch-action:pan-y;-webkit-overflow-scrolling:touch}
.tag-drawer::-webkit-scrollbar{display:none;width:0;height:0}
.tag-drawer[data-elastic-short=true]{touch-action:none;overscroll-behavior:none}
.tag-home-layer{position:absolute;inset:0;background:var(--paper);overflow:hidden;z-index:2;will-change:transform;box-shadow:-8px 0 28px #28352e1a}
.home-view.tag-home-retained{position:absolute;top:calc(-1 * var(--tag-home-scroll,0px));left:0;width:100%;min-height:100%;background:var(--paper)}
.tag-home-shield{position:absolute;inset:0;width:100%;height:100%;z-index:10;background:transparent;border:0;touch-action:pan-y}
.tag-scroll-content{padding:12px 22px max(35px,env(safe-area-inset-bottom));transform-origin:top center}
.tag-directory-label{margin:0 7px 8px;color:var(--muted);font-size:11px;letter-spacing:2px;line-height:1.5}
.tag-row{display:flex;align-items:center;position:relative;min-height:47px;margin:3px 0;border-radius:0}
.tag-row.selected{color:var(--accent-dark)}
.tag-row.selected:before{content:"";position:absolute;left:-8px;top:15px;bottom:15px;width:3px;border-radius:2px;background:var(--accent)}
.tag-row.selected .tag-select>span{font-weight:700}
.tag-row.selected .tag-select>small{color:var(--accent-dark)}
.tag-row.menu-open{z-index:3}
.tag-select{display:flex;align-items:center;gap:12px;flex:1;min-width:0;min-height:44px;padding:9px;text-align:left;border-radius:9px;font-size:17px;font-weight:500;line-height:1.5}
.tag-select>.icon{width:16px;height:16px;flex:none;color:var(--muted);stroke-width:1.6}
.tag-row.selected .tag-select>.icon{color:var(--accent-dark)}
.tag-select>span{min-width:0;overflow-wrap:anywhere}
.tag-select>small{margin-left:auto;font-size:13px;font-weight:400;color:var(--muted);font-variant-numeric:tabular-nums;flex:none}
.tag-more{display:grid;place-items:center;width:44px;height:44px;flex:none;border-radius:9px;color:var(--muted)}
.tag-more>.icon{width:18px;height:18px}
.tag-more-spacer{width:44px;flex:none}
.tag-all{padding-bottom:18px;margin-bottom:24px;border-bottom:1px solid var(--line)}
.tag-all .tag-select{font-size:19px;padding:7px;font-weight:600}
.tag-all .tag-select>.icon{width:20px;height:20px}
.tag-all .tag-select>small{font-size:19px;font-weight:500}
.tag-all .tag-more-spacer,.tag-untagged .tag-more-spacer{display:none}
.tag-empty{padding:12px 9px;color:var(--muted);font-size:14px;line-height:1.8}
.tag-untagged{margin-top:17px;padding-top:14px;border-top:1px solid var(--line)}
/* Touchscreens must not synthesize a sticky hover that looks like selection. */
@media(hover:hover) and (pointer:fine){
 .tag-select:hover,.tag-more:hover{background:var(--search)}
}
.tag-drawer button:active:not(:disabled){transform:none}
.tag-drawer.is-scrolling .tag-select,.tag-drawer.is-scrolling .tag-more{background:transparent}
.tag-popover{position:absolute;right:0;top:50px;min-width:166px;z-index:5;background:var(--surface);border:1px solid var(--line);border-radius:13px;padding:5px;box-shadow:0 10px 30px #28352e21}
.tag-popover button{display:flex;align-items:center;gap:11px;padding:11px 12px;min-height:44px;width:100%;border-radius:9px;font-size:15px;text-align:left}
@media(hover:hover) and (pointer:fine){.tag-popover button:hover{background:var(--search)}}
.tag-popover .icon{width:18px;height:18px}
.tag-remove{color:var(--danger)}
.tag-dialog-actions{display:flex;gap:12px;justify-content:flex-end;margin-top:16px}
.tag-dialog-actions button{flex:1;max-width:130px;min-height:44px}
.tag-form-error{color:var(--danger);font-size:13px;line-height:1.6}
.tag-dialog #tag-name{font-size:17px}
.tag-suggestions{flex:none;display:flex;gap:6px;flex-wrap:wrap;max-height:112px;overflow-y:auto;background:var(--paper);border-top:1px solid var(--line);padding:7px 14px}
.tag-suggestions[hidden]{display:none}
.tag-suggestions button{display:flex;align-items:center;gap:6px;min-height:40px;max-width:100%;padding:7px 10px;border-radius:9px;background:var(--tint);color:var(--accent-dark);font-size:14px}
.tag-suggestions button span{overflow-wrap:anywhere;min-width:0}
.tag-suggestions .icon{width:16px;height:16px;flex:none}
.tag-suggestions small{font-size:11px;color:var(--muted)}
.editor-view[data-mode=browse] .tag-suggestions{display:none}
@media(max-width:350px){.tag-scroll-content{padding-left:16px;padding-right:16px}.tag-select{gap:8px;padding-left:8px;padding-right:4px;font-size:16px}}
#home-sync-status{font-size:10px;color:var(--muted);margin-left:auto;white-space:nowrap}
.note-list{display:flex;flex-direction:column;gap:0}
.note-row{position:relative;border-radius:0;isolation:isolate;touch-action:pan-y}
.note-card{position:relative;z-index:1;padding:18px 0;background:var(--paper);border:0;border-bottom:1px solid var(--line);border-radius:0;cursor:pointer;overflow:hidden;touch-action:pan-y;-webkit-user-select:none;user-select:none;transition:transform .18s ease,background .18s ease}
.note-row:first-child .note-card{padding-top:13px}
.card-heading{min-width:0;display:flex;align-items:center;gap:10px;margin-bottom:7px}
.card-heading h2{flex:1;min-width:0;font-size:17px;line-height:1.55;font-weight:500;letter-spacing:.08px;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.new-import-label{display:inline-flex;align-items:center;gap:5px;flex-shrink:0;font-size:11.5px;font-weight:400;line-height:18px;color:var(--accent);white-space:nowrap}
.new-import-label::before{content:"";width:4px;height:4px;border-radius:50%;background:currentColor}
.card-excerpt{font-size:14px;line-height:1.75;margin:0;color:var(--secondary);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:normal;overflow:hidden;overflow-wrap:anywhere}
.card-body-heading{display:flex;align-items:flex-start;gap:10px;min-width:0}
.card-plain-text{flex:1;min-width:0;margin:0;font-size:17px;font-weight:400;line-height:1.75;color:var(--ink);display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;white-space:pre-line}
.card-body-heading .new-import-label{margin-top:5px}
.card-meta{display:flex;justify-content:space-between;align-items:baseline;gap:8px;min-height:18px;line-height:1.6;font-size:11.5px;color:var(--muted);font-variant-numeric:tabular-nums;margin-top:11px}
.card-meta time{flex-shrink:0}
.card-context{display:flex;align-items:baseline;gap:6px;min-width:0;flex-wrap:wrap}
.card-source{max-width:125px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.card-source::before{content:"·";margin-right:6px;color:var(--muted)}
.card-reminder{margin-left:auto;flex-shrink:0;font-size:11.5px;color:var(--muted)}
.card-reminder.future{color:#637967}
.card-reminder.soon{color:#a36218}
.card-reminder.near,.card-reminder.today{color:var(--danger)}
.card-reminder.marked{color:var(--secondary)}
.card-meta .badge{font-size:11.5px;line-height:16px;padding:0 4px;border-radius:4px;gap:3px;min-width:0}
.card-meta .source-badge{max-width:112px;flex-shrink:0}
.card-meta .date-badge{overflow:hidden}
.conflict-label{margin-left:auto;flex-shrink:0;color:var(--muted);font-size:11px}
.list-hint{text-align:center;font-size:11px;letter-spacing:0;color:var(--muted);margin:20px 0 0}
.swipe-delete{position:absolute;right:0;top:0;bottom:0;width:78px;background:var(--danger);border:1px solid #ab4747;border-radius:12px;color:var(--surface);display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;font-size:11px;z-index:0;opacity:0;transition:opacity .15s}
.swipe-delete .icon{width:22px;height:22px}
.note-row.swiped .note-card{transform:translateX(-172px)}
.note-row.swiped .swipe-delete,.note-row.swiping .swipe-delete{opacity:1}
.swipe-actions{position:absolute;right:0;top:8px;bottom:8px;display:flex;gap:6px;width:204px;opacity:0;transition:opacity .15s}
.swipe-actions button{position:static;display:flex;flex-direction:column;align-items:center;justify-content:center;width:64px;gap:9px;border-radius:12px;font-size:12px;color:var(--surface)}
.swipe-actions .swipe-date{background:#637967;border:1px solid #576e5b}
.swipe-actions .swipe-share{background:var(--accent);border:1px solid var(--accent-dark)}
.swipe-actions .swipe-delete{opacity:1}
.note-row.swiped .swipe-actions,.note-row.swiping .swipe-actions{opacity:1}
.swipe-actions .icon{width:21px;height:21px}
/* A date picker can propagate :focus-visible to the restored action in WebKit.
   Touch retains logical focus, while keyboard navigation keeps its focus ring. */
html[data-input-modality=pointer] .swipe-actions button:focus-visible{outline:none}
.swipe-delete[aria-busy=true]{font-size:12px;opacity:.72}
.drag-ghost{opacity:.25}
.drag-moving{cursor:grabbing;z-index:10}
.drag-chosen{z-index:4}
.drag-chosen .note-card{transform:translateY(-2px) scale(1.012);background:var(--tint);box-shadow:0 8px 22px #28352e14;cursor:grabbing}
.just-added{animation:arrive .65s ease both}
.just-added .note-card{animation:glow 2s ease}
@keyframes arrive{from{opacity:0;transform:translateY(-12px)}to{opacity:1;transform:translateY(0)}}
@keyframes glow{0%,40%{background:var(--tint)}100%{background:var(--paper)}}

.home-bottom{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:min(636px,100%);display:flex;align-items:center;gap:12px;padding:12px 20px calc(12px + env(safe-area-inset-bottom));background:var(--paper);border-top:1px solid var(--line);z-index:5;pointer-events:none}
.search-box{position:relative;pointer-events:auto;display:flex;align-items:center;flex:1;min-width:0;gap:9px;height:50px;padding:0 14px;background:var(--search);border:1px solid transparent;border-radius:15px}
.search-box:focus-within{background:var(--search);border-color:var(--control-line)}
.search-box>.icon{width:19px;height:19px;color:var(--secondary)}
.search-box input{border:0;outline:none!important;background:none;width:100%;min-width:0;padding:0;height:100%;color:var(--ink);font-size:16px}
.search-box input::placeholder{color:var(--muted);opacity:1}
.search-prompt{position:absolute;left:42px;right:14px;top:50%;transform:translateY(-50%);pointer-events:none;color:var(--muted);font-size:13px;line-height:18px}
.search-box:has(.search-prompt) input::placeholder{color:transparent}
.search-box:has(input:not(:placeholder-shown)) .search-prompt{display:none}
.search-box input::-webkit-search-cancel-button{display:none}
.search-clear{display:grid;place-items:center;min-width:32px;height:44px;padding:0;color:var(--secondary)}
.search-clear .icon{width:18px;height:18px}
.new-note{pointer-events:auto;width:50px;height:50px;flex:0 0 50px;border-radius:16px;display:grid;place-items:center;background:var(--tint);color:var(--accent)}
.new-note:hover{background:#e3eee5}
.new-note .icon{width:28px;height:28px;stroke-width:1.8}

/* Native trial: search has its own target; the whole compose surface owns the
   press gesture, including the caption. Web keeps its existing search bar. */
/* The native home now draws to the screen edge. Keep the former physical dock
   position with padding, so the shadow can fade below the buttons without clipping. */
html[data-native=true] .home-view{--home-safe-bottom:var(--native-home-safe-bottom,env(safe-area-inset-bottom,0px));--home-dock-inset:max(min(22px,var(--home-safe-bottom)),calc(var(--home-safe-bottom) - 12px))}
.home-view:not([data-searching=true]) .native-home-bottom{padding-top:10px;padding-bottom:calc(4px + var(--home-dock-inset,0px));background:transparent;border-top:0}
html[data-native=true][data-home-geometry=true] .home-view:not([data-searching=true]) .native-home-bottom{top:calc(var(--native-home-height) - 64px - var(--home-dock-inset));bottom:auto}
/* Fade notes over the same 82px, then carry paper through the remaining safe area.
   Buttons and their shadows stay above this layer all the way to the screen edge. */
.home-view:not([data-searching=true]) .native-home-bottom::before{content:"";position:absolute;left:0;right:0;bottom:0;height:calc(82px + var(--home-dock-inset,0px));z-index:-1;pointer-events:none;background:linear-gradient(to bottom,rgba(253,254,250,0) 0px,rgba(253,254,250,.12) 20px,rgba(253,254,250,.48) 43px,rgba(253,254,250,.88) 64px,var(--paper) 78px,var(--paper) 100%)}
.native-home-bottom{padding-left:24px;padding-right:24px;--dock-fill:var(--paper);--dock-pressed:#edf2e9;--dock-ink:#4e5c53}
.native-home-bottom .search-box{display:none}
.native-search-button{pointer-events:auto;display:grid;place-items:center;flex:0 0 50px;width:50px;height:50px;background:var(--dock-fill);border-radius:50%;color:var(--dock-ink)}
.native-search-button .icon{width:21px;height:21px}
.voice-compose-button{pointer-events:auto;display:flex;align-items:center;justify-content:center;gap:10px;flex:1;min-width:0;height:50px;padding:0 13px;background:var(--dock-fill);border-radius:25px;color:var(--dock-ink);font-size:15px;line-height:1.4;white-space:nowrap;touch-action:none;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}
.voice-compose-button .icon{flex:0 0 27px;width:27px;height:27px;stroke-width:1.8;color:var(--accent-dark)}
.native-search-button,.voice-compose-button{border:1px solid #ffffffd9;box-shadow:0 5px 22px #28352e14,0 1px 3px #28352e08,inset 0 1px 0 #ffffffe6}
.native-search-button:active,.voice-compose-button[data-pressing=true]{background:var(--dock-pressed)}
/* Material is confined to the two controls. The layout wrapper is transparent,
   so content and scroll gestures continue through the space around them. */
@supports ((-webkit-backdrop-filter:blur(1px)) or (backdrop-filter:blur(1px))){
  .native-home-bottom{--dock-fill:rgba(253,254,250,.82);--dock-pressed:rgba(237,242,233,.92)}
  .native-search-button,.voice-compose-button{-webkit-backdrop-filter:blur(18px) saturate(1.1);backdrop-filter:blur(18px) saturate(1.1)}
}
@media(prefers-reduced-transparency:reduce),(prefers-contrast:more){
  .native-home-bottom{--dock-fill:var(--paper);--dock-pressed:#edf2e9}
  .native-search-button,.voice-compose-button{-webkit-backdrop-filter:none;backdrop-filter:none;border-color:var(--control-line)}
}
.home-view[data-searching=true] .native-home-bottom .search-box{display:flex}
.home-view[data-searching=true] .native-search-button,.home-view[data-searching=true] .voice-compose-button{display:none}
#voice-overlay{position:fixed;inset:0;z-index:10000;display:flex;align-items:flex-end;justify-content:center;padding:16px 20px var(--voice-card-bottom,78px);background:#fdfefada;backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px);touch-action:none;overscroll-behavior:none}
.voice-recording-card{display:flex;flex-direction:column;width:min(420px,100%);height:var(--voice-card-height,360px);min-height:0;overflow:hidden;padding:0;border:1px solid var(--line);border-radius:24px;background:var(--paper);box-shadow:0 10px 45px #20332812;color:var(--ink)}
.voice-recording-header{flex:none;padding:24px 20px 0;text-align:center}
.voice-recording-card h2{font-size:18px;font-weight:500;line-height:27px;white-space:nowrap;margin:12px 0 0}
.voice-listening-mark{height:44px;display:flex;align-items:center;justify-content:center;gap:5px;color:var(--accent)}
.voice-listening-mark span{display:block;width:4px;height:4px;flex:none;background:currentColor;border-radius:4px;transition:height 80ms linear}
#voice-overlay[data-cancelling=true] .voice-listening-mark,#voice-overlay[data-cancelling=true] h2{color:var(--danger)}
#voice-transcript{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;overflow-anchor:none;white-space:pre-wrap;overflow-wrap:anywhere;font-size:17px;line-height:1.8;text-align:left;margin:18px 24px 24px;color:var(--ink);scrollbar-width:thin}
#voice-transcript[data-empty=true]{color:var(--muted)}
#voice-overlay,#voice-overlay *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.voice-cancel-zone{display:grid;place-items:center;flex:0 0 64px;width:100%;min-height:64px;padding:0 18px;border-top:1px solid var(--line);border-radius:0;color:var(--secondary);background:var(--search);font-size:14px;line-height:1.5;touch-action:none;-webkit-user-select:none;user-select:none}
.voice-cancel-zone:active:not(:disabled){transform:none}
.voice-cancel-zone:focus-visible{outline-offset:-4px}
#voice-overlay[data-cancelling=true] .voice-cancel-zone{color:var(--danger);background:var(--danger-tint);border-top-color:#efd5d1}
.voice-prepare-copy{font-size:16px;line-height:1.8;margin:0 0 14px}
.voice-prepare-status{font-size:14px;line-height:1.8;color:var(--accent-dark);margin:0 0 14px}
.voice-prepare-status:empty{display:none}
.voice-prepare-dismiss{margin-top:12px}
@media(prefers-reduced-motion:reduce){.voice-listening-mark span{transition:none}}
@media(max-width:350px){.native-home-bottom{gap:10px;padding-left:20px;padding-right:20px}.voice-compose-button{gap:7px;padding:0 10px;font-size:14px}.voice-compose-button .icon{flex-basis:25px;width:25px;height:25px}#voice-overlay{padding-left:16px;padding-right:16px}.voice-recording-header{padding:20px 16px 0}.voice-recording-card h2{font-size:17px}#voice-transcript{margin:16px 18px 20px}}

/* Search occupies the visible viewport; only its results scroll. */
.search-heading,.cancel-search{display:none}
#search-status{display:none;font-size:12px;line-height:1.5;color:var(--muted)}
.home-view[data-searching=true] #search-status{display:block;flex-shrink:0}
#search-status .text-button{font-size:12px;padding:0 4px}
body.searching{position:fixed;width:100%;overflow:hidden;overscroll-behavior:none}
.home-view[data-searching=true]{position:fixed;top:var(--visible-top,0px);left:50%;transform:translateX(-50%);width:min(636px,100%);height:var(--visible-height,100dvh);padding:12px 24px max(12px,env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:12px;overflow:hidden}
.home-view[data-searching=true] .home-header,.home-view[data-searching=true] .new-note{display:none}
.home-view[data-searching=true] .search-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-shrink:0;min-height:36px}
.search-heading h1{margin:0;font-size:19px;line-height:1.4;font-weight:400}
.search-heading span{font-size:12px;color:var(--muted)}
.home-view[data-searching=true] #list-area{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;overflow-anchor:none;-webkit-overflow-scrolling:touch;padding:2px 0 8px}
.home-view[data-searching=true] .home-bottom{position:static;transform:none;width:100%;padding:0;flex-shrink:0;border-top:0}
.home-view[data-searching=true] .cancel-search{display:grid;place-items:center;pointer-events:auto;width:50px;height:50px;flex-shrink:0;background:var(--tint);border-radius:15px;font-size:14px;color:var(--accent)}
.home-view[data-searching=true] .empty-state{padding:28px 12px}
html[data-keyboard=open] .home-view[data-searching=true]{padding-bottom:10px}

.empty-state{text-align:center;padding:70px 12px;color:var(--secondary)}
.empty-icon{margin:auto auto 20px;display:grid;place-items:center;width:68px;height:68px;border-radius:22px;background:var(--tint);color:var(--accent)}
.empty-icon .icon{width:29px;height:29px}
.empty-state h2{font-size:18px;font-weight:500;color:var(--ink);margin:0 0 12px}
.empty-state h3{font-size:16px;font-weight:500;color:var(--ink)}
.empty-state p{font-size:14px;line-height:1.9;margin-bottom:22px}
.empty-state.compact{padding:26px 8px}
.empty-state.compact>.icon{width:30px;height:30px}

/* One editor scroller keeps navigation and formatting above the keyboard. */
body.editing{position:fixed;inset:0;width:100%;overflow:hidden}
.editor-view{position:fixed;top:var(--visible-top,0px);left:max(0px,calc((100% - 636px)/2));width:min(636px,100%);height:var(--visible-height,100dvh);min-height:0;padding:0;display:flex;flex-direction:column;overflow:hidden;background:var(--paper);z-index:2;box-shadow:-8px 0 24px #28352e0d}
.editor-header{position:relative;top:auto;flex-shrink:0;height:58px;margin:0 13px;display:flex;justify-content:space-between;align-items:center;background:var(--paper);z-index:3}
.back-button{display:flex;gap:2px;align-items:center;min-width:44px;min-height:44px;color:var(--accent);font-size:14px;padding:0 5px}
.back-button .icon{width:22px}
.editor-header-actions{display:flex;gap:0;align-items:center;color:var(--secondary)}
.editor-header-actions .icon{width:22px;height:22px}
.editor-header-actions .icon-button{min-width:40px;min-height:44px;padding:9px}
.editor-header-actions #undo-button,.editor-header-actions #redo-button{color:var(--secondary)}
.editor-mode-button{min-width:44px;min-height:44px;padding:0 8px;font-size:15px;font-weight:500;white-space:nowrap;color:var(--accent)}
.editor-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;overflow-anchor:none;scroll-padding:18px 0;display:flex;flex-direction:column;padding:0 24px}
.editor-meta{display:flex;align-items:center;flex-shrink:0;min-height:48px;gap:8px;padding:10px 0;flex-wrap:wrap}
.editor-meta .badges{gap:5px}
.editor-meta .badge{font-size:11px}
.add-date{font-size:12px;display:flex;align-items:center;gap:5px;padding:6px 8px;color:var(--secondary);border:1px dashed var(--control-line);border-radius:6px}
.add-date .icon{width:13px;height:13px}
.save-status{margin-left:auto;font-size:11px;white-space:nowrap;color:var(--muted)}
.save-status.error{color:var(--danger)}
.editor-paper{padding:20px 0 32px;min-height:0;flex:1;background:var(--paper)}
#editor-mount{position:relative}
#editor-mount,.ProseMirror{min-height:100%}
.editor-placeholder[hidden]{display:none}
.editor-placeholder{position:absolute;left:0;top:2px;color:var(--muted);font-size:17px;line-height:1.82;pointer-events:none}
.ProseMirror{outline:none;white-space:pre-wrap;font-size:17px;line-height:1.82;letter-spacing:.16px;overflow-wrap:anywhere;color:var(--ink);caret-color:var(--action);padding-bottom:12px}
.ProseMirror p{margin:0 0 19px}
.ProseMirror h2{font-size:26px;font-weight:500;color:var(--ink);line-height:1.48;letter-spacing:-.25px;margin:0 0 24px}
.ProseMirror h3{font-size:18px;line-height:1.7;font-weight:500;margin:29px 0 13px;color:var(--ink)}
.ProseMirror strong{font-weight:600}
.ProseMirror ul,.ProseMirror ol{padding-left:24px;margin:12px 0 20px}
.ProseMirror li p{margin:0}
.ProseMirror li{margin:8px 0}
.ProseMirror blockquote{border-left:2px solid #a1c9b1;padding:1px 0 1px 16px;margin:25px 0;color:#567160;font-size:16px;line-height:1.85}
.ProseMirror hr{border:0;border-top:1px solid var(--line);margin:28px 0}
.ProseMirror img{max-width:100%;height:auto;border-radius:9px;display:block;margin:20px 0}
.ProseMirror img.ProseMirror-selectednode{outline:3px solid var(--accent)}
.ProseMirror ul[data-type=taskList],.export-body ul[data-type=taskList]{list-style:none;padding:0}
.ProseMirror li[data-checked],.export-body li[data-type=taskItem]{display:flex;gap:10px;align-items:flex-start;list-style:none}
.ProseMirror li[data-checked]>label,.export-body li[data-type=taskItem]>label{flex:0 0 auto;position:relative;margin-top:6px;line-height:1;user-select:none}
.ProseMirror li[data-checked]>div,.export-body li[data-type=taskItem]>div{flex:1;min-width:0}
.ProseMirror input[type=checkbox],.export-body input[type=checkbox]{appearance:none;-webkit-appearance:none;width:20px;height:20px;border:1.5px solid #9cafa3;border-radius:5px;margin:0;vertical-align:top;cursor:pointer;background:var(--surface)}
.ProseMirror input[type=checkbox]:checked,.export-body input[type=checkbox]:checked{border-color:var(--action);background:var(--action)}
.ProseMirror input[type=checkbox]:checked:after,.export-body input[type=checkbox]:checked:after{content:"";display:block;width:9px;height:5px;border-left:1.7px solid var(--surface);border-bottom:1.7px solid var(--surface);transform:rotate(-45deg);margin:5px 4px}
.ProseMirror li[data-checked=true]>div,.export-body li[data-checked=true]>div{color:var(--muted);text-decoration:line-through;text-decoration-color:#acb9af}
.editor-bottom-info{display:flex;align-items:center;justify-content:space-between;flex-shrink:0;padding:8px 0 18px;color:var(--muted);font-size:11px}
.editor-bottom-info button{padding:5px;min-width:44px;min-height:44px}
.editor-bottom-info .icon{width:15px;height:15px}
.editor-toolbar{position:relative;top:auto;bottom:auto;left:auto;transform:none;width:100%;flex-shrink:0;min-height:60px;padding:8px 14px max(8px,env(safe-area-inset-bottom));display:flex;align-items:center;justify-content:space-between;background:var(--paper);border-top:1px solid var(--line);z-index:5}
.toolbar-group{display:flex;justify-content:space-around;gap:0;flex:2;min-width:0}
.toolbar-group:last-child{flex:1}
.editor-toolbar .icon-button{min-width:44px;width:44px;height:44px;flex-shrink:0;padding:10px;color:var(--secondary)}
.editor-toolbar .icon-button.active{color:var(--accent);background:var(--tint)}
.toolbar-divider{height:18px;width:1px;flex-shrink:0;background:var(--line);margin:0 5px}
.attachment-tools .icon-button span{display:none}
.editor-view[data-mode=browse] #undo-button,.editor-view[data-mode=browse] #redo-button,.editor-view[data-mode=browse] .format-tools,.editor-view[data-mode=browse] .toolbar-divider{display:none}
.editor-view[data-mode=browse] .editor-toolbar{display:none}
.editor-view[data-mode=browse] .editor-scroll{padding-bottom:env(safe-area-inset-bottom)}
.editor-view[data-image-drag-layout=browse] .editor-toolbar{display:none}
.editor-view[data-image-drag-layout=browse] .editor-scroll{padding-bottom:env(safe-area-inset-bottom)}
.editor-view[data-mode=edit] .back-button span{display:none}
html[data-keyboard=open] .editor-toolbar{padding-bottom:8px}
@keyframes editor-in{from{opacity:.5;translate:18px 0}to{opacity:1;translate:0 0}}

/* Preserve the actual home view underneath the detail page during edge-back. */
.home-transition-layer{position:fixed;top:var(--visible-top,0px);left:max(0px,calc((100% - 636px)/2));width:min(636px,100%);height:var(--visible-height,100dvh);overflow:hidden;z-index:1;pointer-events:none;background:var(--paper)}
html[data-native=true][data-home-geometry=true] .home-transition-layer:has(.home-view:not([data-searching=true])){height:var(--native-home-height)}
.home-view.home-underlay{position:absolute;top:calc(-1 * var(--home-scroll,0px));left:0;width:100%;pointer-events:none}
.home-view.home-underlay[data-searching=true]{top:0;left:50%;height:100%;transform:translateX(-50%)}

/* Shared sheets and form controls use the same light palette as the notes. */
.sheet-dialog{padding:0;border:1px solid var(--line);border-radius:24px;background:var(--paper);color:var(--ink);width:min(488px,calc(100% - 32px));max-height:calc(var(--visible-height,100dvh) - 20px);box-shadow:0 28px 100px #20332826;overflow:hidden;outline:none}
.sheet-dialog[open]{display:flex;flex-direction:column;animation:sheet-in .22s ease}
.sheet-dialog::backdrop{background:#22372c40;backdrop-filter:blur(5px)}
.sheet-drag-region{flex-shrink:0;touch-action:none}
.sheet-handle{display:none;width:34px;height:4px}
.sheet-header{display:flex;gap:15px;align-items:flex-start;justify-content:space-between;padding:26px 25px 18px;flex-shrink:0}
.sheet-header h2{font-size:21px;letter-spacing:0;font-weight:500;margin:2px 0 0}
.sheet-header p{font-size:12px;line-height:1.7;color:var(--secondary);margin:8px 0 0}
.sheet-header .icon-button{color:var(--secondary);background:none;margin:-3px -3px 0 0;min-width:44px;min-height:44px;padding:12px}
.sheet-header .icon-button .icon{width:18px;height:18px}
.sheet-body{padding:4px 25px 27px;overflow-y:auto;overscroll-behavior:contain;min-height:0;touch-action:pan-y;-webkit-overflow-scrolling:touch}
body.modal-open #app{pointer-events:none}
.dialog-description,.info-note{font-size:13px;color:var(--secondary);line-height:1.9}
.info-note{background:var(--search);padding:13px;border-radius:10px;margin-top:0}
.field-label{display:block;font-size:13px;color:var(--secondary);margin:19px 0 11px}
.text-field{display:block;width:100%;min-height:45px;border:1px solid var(--control-line);border-radius:10px;background:var(--surface);color:var(--ink);font-size:14px;padding:11px 13px}
.date-field{appearance:none;-webkit-appearance:none;min-width:0;max-width:100%;width:100%;font-size:17px;letter-spacing:0;height:48px;min-height:48px;color-scheme:light}
.date-field::-webkit-date-and-time-value{min-width:0;text-align:left;margin:0}
.date-field::-webkit-datetime-edit{min-width:0;padding:0}
.date-types{padding:0;border:0;margin:16px 0 0;min-width:0}
.date-types legend{font-size:13px;color:var(--secondary);margin-bottom:11px;padding:0}
.date-type-options{display:flex;gap:8px}
.date-type-option{position:relative;flex:1;min-width:0;cursor:pointer}
.date-type-option span{display:flex;justify-content:center;align-items:center;min-height:44px;border:1px solid var(--line);background:var(--search);border-radius:10px;font-size:15px;color:var(--secondary)}
.date-type-option input:checked+span{color:var(--accent);background:var(--tint);border-color:#bcd6c4}
.date-type-option input:focus-visible+span{outline:2px solid var(--accent);outline-offset:2px}
.date-type-help{font-size:12px;line-height:1.6;color:var(--secondary);margin:10px 0 0;min-height:20px}
.choice-button{flex:1;border:1px solid var(--line);background:var(--search);padding:9px;border-radius:9px;font-size:13px;color:var(--secondary)}
.choice-button.selected{color:var(--accent);background:var(--tint);border-color:#bcd6c4}
.date-preview{padding:20px 0;display:flex;justify-content:center;align-items:center;gap:9px;color:var(--accent);font-size:14px;min-height:66px}
.date-preview .icon{width:17px;height:17px}
.date-preview.future{color:#637967}
.date-preview.soon{color:#a36218}
.date-preview.near,.date-preview.today,.date-preview.invalid{color:var(--danger)}
.date-preview.marked{color:var(--secondary)}
.date-preview.past{color:var(--muted)}
.date-actions{display:flex;justify-content:flex-end;gap:12px;padding-top:4px}
.date-actions button{flex:1;max-width:120px;height:44px;min-height:44px;padding:8px 16px;border-radius:10px;font-size:14px;font-weight:500}
.date-actions .date-remove{color:var(--secondary);background:var(--search);border:1px solid var(--control-line)}
.sheet-actions{display:flex;justify-content:flex-end;align-items:center;gap:15px;padding-top:5px}
.primary-button,.secondary-button,.small-button,.danger-button{display:inline-flex;justify-content:center;align-items:center;gap:8px;font-size:13px;font-weight:500;padding:12px 20px;line-height:1.4;border-radius:11px;min-height:45px;transition:background .2s}
.primary-button{background:var(--accent);color:var(--surface);border:1px solid var(--accent)}
.primary-button:hover:not(:disabled){background:var(--accent-dark)}
.secondary-button{color:var(--accent);background:var(--tint);border:1px solid #d8e6db}
.secondary-button:hover:not(:disabled){background:#deece2}
.small-button{font-size:12px;padding:7px 10px;min-height:32px;background:var(--tint);color:var(--accent);border:1px solid #d8e6db;border-radius:8px}
.small-button .icon{width:13px;height:13px}
.danger-button{color:var(--danger);border:1px solid #efd5d1;background:var(--danger-tint)}
.text-button{color:var(--secondary);font-size:13px;padding:12px}
.full-width{width:100%}
.fine-print{font-size:11px;line-height:1.9;color:var(--muted);margin:15px 0 0}
.centered{text-align:center}
.settings-brand{display:flex;gap:14px;align-items:center;padding:10px 0 25px}
.settings-brand strong{font-size:20px;letter-spacing:2px;font-weight:500}
.settings-brand small{display:block;font-size:12px;color:var(--secondary);margin-top:5px}
.settings-section{border-top:1px solid var(--line);padding:17px 0 12px}
.settings-section h3{font-weight:400;font-size:11px;letter-spacing:.3px;margin:0 0 12px;color:var(--muted)}
.setting-row{display:flex;width:100%;gap:11px;align-items:center;text-align:left;padding:12px 0}
.setting-row>div{flex:1;min-width:0}
.setting-row strong{display:block;font-weight:500;font-size:14px}
.setting-row small{display:block;font-size:12px;line-height:1.6;color:var(--secondary);margin-top:6px;overflow-wrap:anywhere}
.setting-row>.icon{width:15px;color:var(--muted)}
.setting-symbol{width:32px;height:34px;display:grid;place-items:center;background:var(--tint);border-radius:9px;color:var(--accent)}
.setting-symbol .icon{width:19px;height:19px}
.status-tag{font-size:11px;background:var(--search);padding:5px 7px;border-radius:6px;color:var(--secondary);white-space:nowrap}
.status-tag.good{color:var(--accent);background:var(--tint)}
.trash-item{display:flex;align-items:center;gap:11px;padding:19px 0;border-bottom:1px solid var(--line)}
.trash-item>span{color:var(--muted)}
.trash-item>div{flex:1;min-width:0}
.trash-item strong{display:block;font-size:14px;font-weight:500;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.trash-item small{display:block;font-size:11px;color:var(--secondary);margin-top:7px}
.order-actions{display:flex;gap:12px;margin:22px 0 12px}
.order-actions>button{flex:1}
.detail-facts{border:1px solid var(--line);background:var(--search);border-radius:12px;padding:9px 17px;margin:8px 0 15px}
.detail-facts p{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:12px;margin:16px 0;color:var(--secondary)}
.detail-facts strong{font-weight:500;color:var(--ink)}
.detail-facts+.setting-row{margin-bottom:15px}
.history-item{padding:16px;background:var(--search);border:1px solid var(--line);border-radius:13px;margin:13px 0}
.history-item>div{display:flex;gap:7px;align-items:center}
.history-item strong{font-size:13px;font-weight:500}
.history-item .icon{width:14px;color:var(--accent)}
.history-item small{font-size:11px;color:var(--muted);display:block;margin:9px 0}
.history-item p{font-size:12px;color:var(--secondary);line-height:1.8}

.demo-notice{display:flex;align-items:center;gap:7px;background:var(--search);border-radius:8px;padding:10px 12px;color:var(--secondary);font-size:11px;margin:0 0 18px}
.demo-notice .icon{width:14px;height:14px}
.source-tabs{display:flex;padding:4px;border:1px solid var(--line);background:var(--search);border-radius:11px;gap:4px}
.source-tabs button{flex:1;display:flex;justify-content:center;align-items:center;gap:7px;font-size:12px;color:var(--secondary);padding:10px;border-radius:8px}
.source-tabs .icon{width:15px;height:15px}
.source-tabs .selected{background:var(--surface);color:var(--accent)}
.chat-sample{margin:23px 0}
.chat-caption{font-size:11px;color:var(--muted);letter-spacing:.3px}
.chat-sample p{font-size:19px;line-height:1.85;margin:10px 0 0;color:var(--ink)}
.ai-note-preview{border:1px solid var(--line);border-radius:13px;padding:16px;margin:0 0 15px;background:var(--search)}
.ai-note-preview>div{display:flex;align-items:center;gap:8px}
.ai-note-preview .icon{width:16px;color:var(--accent)}
.ai-note-preview strong{font-size:14px;font-weight:500}
.ai-note-preview p{font-size:12px;line-height:1.8;color:var(--secondary);margin:9px 0 11px}
.ai-note-preview .badge .icon{width:12px}
.ai-update-section{border-top:1px solid var(--line);margin-top:24px;padding-top:20px}
.ai-update-section h3{font-size:14px;font-weight:500;margin:0}
.ai-update-section p{font-size:12px;line-height:1.9;color:var(--secondary);margin:9px 0 12px}
.ai-update-section select{font-size:13px}
.ai-update-section .secondary-button{margin-top:10px}

/* The exported image shares the reading typography and green identity. */
.export-dialog{width:min(626px,calc(100% - 32px))}
.export-preview{background:var(--search);border:1px solid var(--line);padding:20px;max-height:53dvh;overflow-y:auto;border-radius:12px}
.export-preview img{display:block;width:100%;height:auto;box-shadow:0 5px 16px #28352e12}
.export-info{font-size:11px;display:flex;justify-content:space-between;align-items:center;color:var(--secondary);margin:12px 0 17px;gap:10px}
.export-pagination{display:flex;align-items:center;gap:5px;white-space:nowrap}
.export-pagination .icon-button{min-width:24px;min-height:24px;padding:4px}
.export-pagination .icon{width:14px;height:14px}
.export-actions{display:flex;gap:10px}
.export-actions>.primary-button{flex:1.3}
.export-actions>.secondary-button{flex:1}
.export-loading{padding:80px 10px;text-align:center;color:var(--secondary);font-size:13px}
.spinner{display:inline-block;width:25px;height:25px;border:2px solid #d8e6db;border-top-color:var(--accent);border-radius:50%;animation:spin 1s linear infinite}
.export-loading p{margin:17px 0}
@keyframes spin{to{transform:rotate(360deg)}}
.export-staging{position:fixed;left:-20000px;top:0;pointer-events:none;width:620px;z-index:-1}
.export-sheet{width:620px;background:var(--paper);padding:36px 43px 29px;color:var(--ink)}
.export-topline{display:flex;justify-content:space-between;font-size:11px;color:var(--muted);letter-spacing:.5px;border-bottom:1px solid var(--line);padding-bottom:18px;margin-bottom:28px;gap:15px}
.export-topline span:last-child{letter-spacing:.3px;text-align:right}
.export-body{font-family:-apple-system,BlinkMacSystemFont,"PingFang SC",sans-serif;font-size:17px;line-height:1.82;letter-spacing:.16px;overflow-wrap:anywhere}
.export-body p{margin:0 0 19px}
.export-body h2{font-size:26px;color:var(--ink);line-height:1.48;margin:0 0 24px;font-weight:500}
.export-body h3{font-size:18px;line-height:1.7;margin:29px 0 13px;font-weight:500}
.export-body ul,.export-body ol{padding-left:24px;margin:12px 0 20px}
.export-body li p{margin:0}
.export-body li{margin:8px 0}
.export-body strong{font-weight:600}
.export-body img{display:block;max-width:100%;height:auto;max-height:2100px;object-fit:contain;border-radius:7px;margin:20px 0}
.export-body blockquote{margin:25px 0;padding:1px 0 1px 16px;border-left:2px solid #a1c9b1;color:#567160}
.export-body hr{border:none;border-top:1px solid var(--line);margin:28px 0}
.export-end{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:10px;margin-top:28px;padding-top:18px;border-top:1px solid var(--line);color:var(--muted);font-size:11px;letter-spacing:.3px}
.export-signature{display:flex;align-items:baseline;justify-content:center;gap:10px;white-space:nowrap}
.export-brand{font-size:14px;font-weight:400;line-height:1.6;letter-spacing:.5px;color:var(--accent-dark)}
.export-brand strong{font-weight:600}
.export-brand-quote{font-weight:400}
.export-tagline{font-size:11px;font-weight:400;color:var(--muted)}
.export-end small{font-size:10px}

.toast{position:fixed;bottom:calc(94px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);z-index:9999;display:flex;align-items:center;gap:9px;max-width:calc(100vw - 30px);width:max-content;border:1px solid #304638;background:#304638f5;color:var(--paper);border-radius:12px;padding:13px 17px;font-size:12px;box-shadow:0 8px 30px #2033281c;animation:toast-in .2s ease}
.toast>.icon{width:16px;height:16px;color:#c2dfc9}
.toast button{color:#c2efd4;font-size:12px;white-space:nowrap;padding:2px 5px;margin-left:4px}
.toast span{line-height:1.6}
.dialog-toast-root .toast{position:sticky;bottom:12px;left:auto;transform:none;margin:0 auto 12px;max-width:calc(100% - 24px)}
@keyframes toast-in{from{opacity:0;translate:0 7px}to{opacity:1;translate:0 0}}
@keyframes sheet-in{from{opacity:0;translate:0 9px}to{opacity:1;translate:0 0}}

.login-page{max-width:410px;margin:0 auto;padding:13dvh 28px 40px}
.login-page>.brand-mark{margin-bottom:38px}
.login-page h1{font-size:31px;font-weight:500;margin:14px 0}
.login-description{font-size:14px;line-height:1.9;color:var(--secondary);margin:18px 0 32px}
.login-page .primary-button{margin-top:17px}
.login-page .fine-print{margin-top:36px;line-height:1.9}
#login-status{font-size:12px;color:var(--danger);line-height:1.7;min-height:22px}
.connection-details{margin-top:24px;border-top:1px solid var(--line);padding-top:17px}
.connection-details summary{font-size:12px;color:var(--secondary);cursor:pointer}
.setup-steps{padding-left:22px;margin:20px 0}
.setup-steps>li{padding-left:4px;margin:0 0 24px}
.setup-steps strong{font-size:15px;font-weight:500}
.setup-steps p{font-size:13px;line-height:1.7;color:var(--secondary)}
.setup-buttons{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
.setup-buttons .secondary-button{font-size:12px;padding:10px 12px;text-decoration:none}
.chatgpt-setup-dialog{width:min(560px,calc(100% - 32px))}
.consent-page{max-width:520px;margin:8vh auto;padding:24px}
.consent-page h1{font-size:25px;font-weight:500}
.consent-page p{font-size:15px;line-height:1.8;color:var(--secondary)}
.app-brand-icon{width:48px;height:48px;border-radius:12px;flex-shrink:0}
.login-app-icon{width:76px;height:76px;border-radius:18px;display:block;margin-bottom:22px}
.brand-subtitle{font-size:12px;color:var(--secondary);margin:0 0 24px}
.native-note-image{display:block;min-height:44px}
.native-note-image img{pointer-events:none}
.native-note-image,.native-note-image img{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}
.native-note-image.ProseMirror-selectednode img{outline:3px solid var(--accent)}
.native-note-image.note-image-drag-source img,.ProseMirror img.note-image-drag-source{opacity:.2;outline:none}
.image-text-target{min-height:44px;cursor:text;outline:none}
.native-note-image button{font-size:13px;padding:16px;color:var(--secondary);border:1px dashed var(--control-line);border-radius:8px}

/* Native safe-area ownership and viewport rules match the existing app shell. */
html[data-native=true] .home-view[data-searching=true]{padding-top:10px}
html[data-native=true] .home-view:not([data-searching=true]){padding-bottom:calc(82px + var(--home-dock-inset,0px))}
html[data-native=true] .editor-view,html[data-native=true] .home-transition-layer{top:0;height:100dvh}
html[data-native=true] .editor-header{height:58px;padding-top:0}
html[data-native=true] .login-page{padding-top:calc(60px + env(safe-area-inset-top))}

@media(min-width:1200px){#app{border-left:1px solid var(--line);border-right:1px solid var(--line);background:var(--paper)}}
@media(min-width:700px){.home-view{padding-top:28px}.home-header{margin-bottom:12px}}
@media(max-width:600px){
.sheet-dialog{width:100%;max-width:100%;margin:auto 0 0;border-radius:24px 24px 0 0;border-bottom:none;padding-bottom:env(safe-area-inset-bottom)}
.sheet-handle{display:block;background:var(--control-line);flex-shrink:0;border-radius:3px;margin:11px auto 0}
.sheet-header{padding:18px 21px 16px}
.sheet-header h2{font-size:20px}
.sheet-body{padding:3px 21px 24px}
.text-field{font-size:16px}
.date-field{font-size:17px}
.export-preview{padding:12px;max-height:47dvh}
.export-info{font-size:10px}
.toast{font-size:12px;padding:11px 14px}
}
@media(max-width:350px){.card-meta{gap:6px}.card-context{gap:4px}.card-source{max-width:104px}.card-source::before{margin-right:4px}.home-title{gap:5px}.home-title h1 span{margin-left:4px}.editor-toolbar{padding-left:10px;padding-right:10px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}.editor-view{animation:none}}

/* Fixed independent controls, with the list scrolling beneath them. */
.home-view:not([data-searching=true]){padding-top:72px}
.home-view:not([data-searching=true]) .home-header{position:fixed;left:max(24px,calc((100% - 588px)/2));right:max(24px,calc((100% - 588px)/2));top:12px;z-index:9;pointer-events:none}
.home-header button{pointer-events:auto;border-radius:50%;background:var(--paper);box-shadow:0 2px 14px #28352e0d}
#home-sync-status{font-size:12px;color:var(--muted);background:var(--paper);border-radius:12px}
html[data-native-glass=true] .home-title .icon-button,html[data-native-glass=true] .native-search-button,html[data-native-glass=true] .voice-compose-button{background:transparent!important;border-color:transparent!important;box-shadow:none!important;color:transparent!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
html[data-native-glass=true] .home-title .icon-button>*,html[data-native-glass=true] .native-search-button>*,html[data-native-glass=true] .voice-compose-button>*{opacity:0}

html[data-input-modality=pointer] .tag-drawer button:focus-visible{outline:none}
/* Pointer-triggered programmatic focus must not look like keyboard focus. */
html[data-input-modality=pointer] button:focus-visible,html[data-input-modality=pointer] [role=button]:focus-visible{outline:none}
.home-filter-title:not(.sr-only){margin:0 0 18px;font-size:18px;line-height:1.4;font-weight:500;color:var(--accent-dark);overflow-wrap:anywhere}
.home-view[data-searching=true]>.home-filter-title{display:none}

.note-list{overflow-anchor:none}


/* Native retained pixels and live glass share one moving surface. */
html[data-native-tag-surface="true"] .tag-home-layer { opacity:0; }

.privacy-policy-link{font-size:13px;color:var(--secondary);padding:12px 0;text-decoration:underline;text-underline-offset:3px}
.privacy-policy{font-size:14px;line-height:1.85;color:var(--secondary);overflow-wrap:anywhere}.privacy-policy h3{font-size:16px;color:var(--ink);margin-top:24px}.privacy-policy a{color:var(--accent-dark)}

/* Search uses the same light glass palette as the resting dock. Keep the
   editable DOM input and its tested keyboard/selection behavior. */
.home-view[data-searching=true] .native-home-bottom{background:transparent}
.home-view[data-searching=true] .native-home-bottom .search-box,
.home-view[data-searching=true] .native-home-bottom .cancel-search{
  background:var(--dock-fill);border:1px solid #ffffffd9;border-radius:25px;
  box-shadow:0 5px 22px #28352e14,0 1px 3px #28352e08,inset 0 1px 0 #ffffffe6;
  color:var(--dock-ink);-webkit-backdrop-filter:blur(18px) saturate(1.1);backdrop-filter:blur(18px) saturate(1.1)
}
.home-view[data-searching=true] .native-home-bottom .search-box:focus-within{border-color:var(--control-line)}
@media(prefers-reduced-transparency:reduce),(prefers-contrast:more){
 .home-view[data-searching=true] .native-home-bottom .search-box,
 .home-view[data-searching=true] .native-home-bottom .cancel-search{background:var(--paper);backdrop-filter:none;-webkit-backdrop-filter:none;border-color:var(--control-line)}
}
#home-pull-status{position:absolute;left:58px;top:15px;width:16px;height:16px;border:1.5px solid #0f694b30;border-top-color:var(--accent);border-radius:50%;pointer-events:none}
#home-pull-status[data-loading=true]{animation:home-refresh-turn .8s linear infinite}
#home-pull-status[hidden]{display:none}
@keyframes home-refresh-turn{to{transform:rotate(360deg)}}

/* Hide the fallback only after native glass + input acknowledge readiness. */
html[data-native-search-glass=true] .home-view[data-searching=true] .search-box,
html[data-native-search-glass=true] .home-view[data-searching=true] .cancel-search { opacity:0;pointer-events:none; }

/* Reading shortcuts do not focus the editor or open its keyboard. */
.editor-toolbar .browse-edit{display:none}
.editor-view[data-mode=browse] .editor-toolbar{display:flex;justify-content:space-around}
.editor-view[data-mode=browse] .editor-toolbar .browse-edit{display:flex}
.editor-view[data-mode=browse] .editor-toolbar .format-tools,.editor-view[data-mode=browse] .editor-toolbar .toolbar-divider{display:none}
.editor-view[data-mode=browse] .editor-toolbar .attachment-tools{display:contents}
.editor-view[data-mode=browse] .editor-toolbar .icon-button{gap:7px;font-size:14px}
.editor-view[data-mode=browse] .editor-toolbar .icon-button span{display:inline}

.editor-view[data-mode=browse] .editor-toolbar .icon-button{width:auto;min-width:80px}

.editor-view[data-mode=browse] .editor-toolbar .icon-button{display:flex;align-items:center;justify-content:center;white-space:nowrap;flex:1;min-width:0}

.ai-connections{overflow-wrap:anywhere}
.connection-card{border:1px solid #e4e7e2;border-radius:16px;padding:18px;margin:18px 0;background:#fff}
.connection-card h3{margin:0 0 8px;font-size:19px}
.connection-card p{line-height:1.65;margin:10px 0}
.connection-card label{display:block;font-size:14px;margin:14px 0}
.connection-card input,.connection-card textarea{box-sizing:border-box;display:block;width:100%;min-width:0;padding:12px;margin-top:7px;border:1px solid #d7ddd5;border-radius:10px;background:#f7f8f5;font:14px/1.5 ui-monospace,monospace;resize:none}
.connection-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}
.connection-actions button{min-height:44px;max-width:100%;height:auto;white-space:normal;padding:10px 14px}
.connection-actions button:disabled{opacity:.55}
.connection-error{color:#ab342d;background:#fff0ee;border-radius:10px;padding:12px}
.connection-message{color:#42613f;min-height:1.5em}
.connection-confirm{border-top:1px solid #e4e7e2;margin-top:18px;padding-top:10px}
.connection-page{max-width:620px;margin:0 auto;padding:24px max(18px,env(safe-area-inset-right)) max(32px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left));box-sizing:border-box}
.connection-page h1{font-size:25px;margin:24px 0 8px}
.connection-page .connection-back{display:inline-flex;align-items:center;min-height:44px;color:#42613f}

/* One quiet surface, with hierarchy carried by type and spacing. */
.settings-refined{--settings-muted:#7e897b}
.settings-refined .sheet-header{align-items:center;padding-bottom:8px}
.settings-refined .sheet-header h2{font-size:21px;font-weight:550;letter-spacing:.5px}
.settings-refined.settings-main .sheet-header>.icon-button{display:none}
.settings-refined .sheet-body{padding-top:12px}
.settings-refined .settings-section{border:0;padding:0;margin:26px 0 0}
.settings-refined .settings-section h3{font-size:11px;font-weight:400;color:var(--settings-muted);letter-spacing:.8px;margin:0 0 8px}
.settings-refined .setting-row{padding:17px 0;gap:13px;border-radius:0;min-height:70px;background:transparent}
.settings-refined .setting-row>div{min-width:0;flex:1}
.settings-refined .setting-row strong{font-size:16px;font-weight:500;line-height:1.5}
.settings-refined .setting-row small{font-size:12px;line-height:1.65;margin-top:3px;color:var(--settings-muted)}
.settings-refined .setting-symbol{width:25px;height:28px;min-width:25px;border-radius:0;background:none;color:#65806b}
.settings-refined .setting-symbol svg{width:21px;height:21px;stroke-width:1.6}
.settings-refined .setting-row>svg{width:15px;color:#95a18f}
.settings-refined .setting-row:disabled{opacity:.5}
.settings-account-line{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:17px 0 24px;border-bottom:1px solid #e7ebe4}
.settings-account-line button{background:transparent;border:0;text-align:left;padding:8px 0;color:inherit;min-height:48px}
.settings-account-line strong{display:block;font-size:17px;font-weight:500}
.settings-account-line small{display:block;font-size:11px;color:var(--settings-muted);margin-top:6px}
.settings-account-line .pro-badge{text-align:right;color:#4e7157}
.settings-account-line .pro-badge strong{font-size:15px;letter-spacing:.5px}
.settings-refined .status-tag{background:transparent;padding:0;font-size:11px;color:#74836b;white-space:nowrap}
.settings-ai-summary{display:flex;gap:13px;flex-wrap:wrap;font-size:11px;color:var(--settings-muted);padding:0 0 15px 38px;border-bottom:1px solid #e7ebe4}
.settings-refined .settings-footer{text-align:center;padding:27px 0 10px;color:var(--settings-muted)}
.settings-footer img{width:26px;height:26px;border-radius:7px;opacity:.8;margin-bottom:9px}
.settings-footer p{font-size:12px;letter-spacing:1px;margin:0}
.settings-refined .cloud-toggle{margin-left:auto;position:relative;flex:0 0 44px;width:44px;height:27px;border-radius:20px;background:#d7dcd4;box-shadow:inset 0 0 0 1px #00000005}
.settings-refined .cloud-toggle::after{content:"";position:absolute;width:23px;height:23px;left:2px;top:2px;border-radius:50%;background:white;box-shadow:0 1px 3px #0002;transition:transform .2s}
.settings-refined [aria-checked=true] .cloud-toggle{background:#668969}
.settings-refined [aria-checked=true] .cloud-toggle::after{transform:translateX(17px)}
.connection-steps{list-style:none;counter-reset:steps;padding:0;margin:22px 0}
.connection-steps>li{counter-increment:steps;position:relative;padding:0 0 23px 35px}
.connection-steps>li:before{content:"0" counter(steps);position:absolute;left:0;top:4px;color:#8d9a85;font-size:11px}
.connection-steps strong{font-weight:500;font-size:16px}
.connection-steps p,.settings-refined .connection-details p{font-size:14px;color:#6e7b68;line-height:1.8;margin:9px 0}
.guide-lead{font-size:19px;font-weight:450;color:#4c684f;line-height:1.6}
.guide-code{display:block;background:#f4f6f1;border-radius:8px;padding:12px;font:12px/1.8 ui-monospace,monospace;white-space:pre-wrap;overflow-wrap:anywhere}
.connection-steps blockquote{border-left:2px solid #cddac4;margin:15px 0;padding:4px 0 4px 14px;font-size:15px;line-height:1.8;color:#53694e}
.settings-refined .connection-card{padding:15px 0;border:0;border-bottom:1px solid #e7ebe4;border-radius:0;background:transparent}
.settings-refined .connection-card h3{font-size:15px;font-weight:500}
.connection-details{margin:20px 0}
.connection-details summary{min-height:44px;display:flex;align-items:center;cursor:pointer;font-size:14px;color:#607258}
.public-guide{height:auto;overflow:visible;background:#fdfefa;padding-bottom:80px}
body:has(.public-guide){height:auto;overflow:auto}
.public-guide section{margin-top:42px;border-top:1px solid #e7ebe4;padding-top:20px}
.public-guide h2{font-size:21px;font-weight:500}
.public-guide p{line-height:1.8}
.pairing-code{font:26px/1.7 ui-monospace,monospace;letter-spacing:3px}
.settings-refined .connection-message:empty{display:none}
/* Fill the available viewport. UIKit already owns native safe-area insets. */
.sheet-dialog.settings-navigation{position:fixed;inset:var(--visible-top,0px) 0 auto;margin:0;width:100%;max-width:none;height:var(--visible-height,100dvh);max-height:none;padding:0;border:0;border-radius:0;box-shadow:none;background:transparent}
.sheet-dialog.settings-navigation[open]{display:block;animation:none}
.settings-navigation::backdrop{background:transparent;backdrop-filter:none}
.settings-page{position:absolute;inset:0;display:flex;flex-direction:column;background:var(--paper);touch-action:pan-y;overflow:hidden;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}
.settings-page[hidden]{display:none}
html[data-native=true] .settings-page{padding:0}
.settings-nav-header{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;gap:8px;width:100%;max-width:620px;margin:0 auto;padding:6px 16px;min-height:58px;flex-shrink:0}
.settings-nav-header h2{font-size:19px;font-weight:550;line-height:1.4;text-align:center;margin:0;outline:none}
.settings-navigation .sheet-body{width:100%;max-width:620px;min-height:0;flex:1;margin:0 auto;padding:14px 26px 28px;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.settings-navigation .settings-footer{padding-bottom:20px}
.prompt-actions{margin:20px 0 26px;display:grid;gap:10px}
.prompt-actions .primary-button{width:100%;justify-content:center;min-height:48px}
.prompt-preview{margin-top:12px;max-height:260px;overflow:auto;user-select:text}
.connection-hint{font-size:12px;line-height:1.8;color:var(--settings-muted,#7e897b)}
.public-guide textarea{width:100%;height:190px;resize:vertical;font-size:13px;line-height:1.7;border:1px solid #dce3d8;border-radius:8px;padding:12px;background:#f8faf6;color:#405342}
@media(max-width:370px){.settings-refined .setting-row strong{font-size:15px}.settings-refined .sheet-body{padding-left:22px;padding-right:22px}.settings-account-line strong{font-size:16px}}

.confirmation-dialog{width:calc(100% - 48px);max-width:340px;border:1px solid #dce5dc;border-radius:24px;padding:24px;background:var(--paper,#fdfefa);color:var(--ink,#28382f);box-shadow:0 20px 65px #17281c33;margin:auto;max-height:80dvh;overflow:auto}
.confirmation-dialog::backdrop{background:#14231b55}
.confirmation-dialog h2{font-size:20px;margin:0 0 14px}.confirmation-dialog p{font-size:15px;line-height:1.65;margin:0 0 20px;color:#647468}
.confirmation-actions{display:flex;gap:10px}.confirmation-actions button{flex:1;min-height:48px;padding:10px;font-size:15px}
.settings-page .connection-steps{margin:14px 0}.settings-page .connection-steps>li{padding-bottom:12px}.settings-page .connection-steps p{line-height:1.55;margin:6px 0}.settings-page .guide-lead{font-size:17px;margin:4px 0 16px;line-height:1.5}

.settings-refined .settings-section + .settings-section{border-top:1px solid #e7ebe4;padding-top:24px}
.settings-ai-summary{border-bottom:0}
.settings-refined small[hidden]{display:none}
.settings-page .sheet-body>.full-width+.full-width{margin-top:14px}
.connection-details summary{justify-content:space-between;gap:12px;list-style:none}
.connection-details summary::-webkit-details-marker{display:none}
.connection-details summary::after{content:"";width:7px;height:7px;border-right:1.7px solid currentColor;border-top:1.7px solid currentColor;transform:rotate(45deg);margin:0 5px;flex:none;transition:transform .18s}
.connection-details[open]>summary::after{transform:rotate(135deg)}
.prompt-actions{margin-bottom:6px}
.prompt-actions+.connection-details{margin:0 0 16px}
.provider-connections{border-top:1px solid #e7ebe4;padding-top:14px}
.provider-connections .connection-row{display:flex;align-items:center;gap:16px;justify-content:space-between;min-height:64px}
.provider-connections small{display:block;color:var(--settings-muted);font-size:12px;margin-top:4px}
.provider-connections .connection-state{font-size:13px;color:var(--settings-muted)}

.settings-page{box-shadow:-10px 0 30px #28352e0d}

html[data-native-pages=true] .settings-nav-header,html[data-native-pages=true] .editor-header{display:none}
html[data-native-pages=true] .editor-view{animation:none}

.trash-page .trash-item{gap:14px;padding:18px 0}.trash-select{position:relative;width:44px;height:44px;min-width:44px;border:0;padding:13px;background:transparent;display:grid;place-items:center}.trash-select::before{content:"";position:absolute;inset:9px;border:1.5px solid #95a18f;border-radius:50%}.trash-select[aria-checked=true]::before{background:#0f7b57;border-color:#0f7b57}.trash-select svg{position:relative;color:white;width:18px;height:18px}.trash-actions{position:sticky;bottom:-28px;background:var(--paper);border-top:1px solid var(--line);display:flex;justify-content:space-between;padding:16px 0}.danger-text{color:#ad453d}.trash-list{padding-bottom:12px}

.settings-refined .setting-symbol{width:26px;min-width:26px;height:28px;display:flex;align-items:center;justify-content:center}
.settings-refined .setting-symbol>.icon{width:22px;height:22px;flex:none}
.settings-refined .setting-symbol>.provider-icon{stroke:none;fill:currentColor}
.settings-refined .setting-row{align-items:center}
.settings-refined .setting-symbol{width:26px;min-width:26px;height:26px}
.settings-refined .setting-symbol>.icon{width:22px;height:22px;stroke-width:1.65}
.settings-brand-line{display:flex;align-items:center;justify-content:center;gap:10px}
.settings-brand-line img{width:24px;height:24px;margin:0;flex:none}
.feedback-version{margin-top:12px;font-size:10px;letter-spacing:.2px;color:#8b9488}
.provider-connections .connection-row{flex-direction:column;align-items:stretch;gap:8px;padding:10px 0}
.provider-connections .connection-row>div:empty{display:none}
.provider-connections button:disabled{background:#f0f2ed;color:#8b9488;border-color:#e4e8df;opacity:1}
.trash-page .sheet-body{display:flex;flex-direction:column}.trash-page .dialog-description{flex-shrink:0}.trash-list{flex:1 0 auto}.trash-actions{flex-shrink:0;margin-top:auto}

.feedback-version { text-align:center; margin-top:40px; }

.settings-account-line .account-entry{display:flex;align-items:center;gap:12px;min-width:0;flex:1}
.account-entry>span:last-child{min-width:0}.account-entry strong{overflow-wrap:anywhere}
.account-avatar{display:flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:50%;flex:none;background:#e9f0e8;color:#527259;font-size:19px;font-weight:500}
.account-avatar .icon{width:23px;height:23px}.ai-provider-list .setting-row strong{overflow-wrap:anywhere}

/* Occupied layout space is also the hit area: neighbouring rows/text never
   share an invisible target. The smaller mark stays visually unobtrusive. */
.ProseMirror li.note-task-item[data-checked]{gap:4px;min-height:44px;margin:4px 0;align-items:flex-start}
.ProseMirror .note-task-item>.task-toggle{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;min-width:44px;min-height:44px;margin:0;padding:0;border:0;border-radius:8px;background:transparent;line-height:1;touch-action:manipulation;user-select:none;-webkit-user-select:none}
.ProseMirror .note-task-item>.task-toggle:active{transform:none;background:var(--tint)}
.ProseMirror .note-task-item>.task-toggle:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
.ProseMirror .note-task-item>div{padding-top:calc((44px - 1lh)/2)}
.task-checkbox{display:block;position:relative;width:22px;height:22px;border:1.5px solid #9cafa3;border-radius:5px;background:var(--surface);pointer-events:none}
.task-toggle[aria-checked=true]>.task-checkbox{border-color:var(--action);background:var(--action)}
.task-toggle[aria-checked=true]>.task-checkbox:after{content:"";position:absolute;left:4px;top:5px;width:10px;height:6px;border-left:2px solid var(--surface);border-bottom:2px solid var(--surface);transform:rotate(-45deg)}

.note-row{--swipe-gap:10px;--swipe-width:172px;touch-action:pan-y pinch-zoom}
.note-row .note-card,.note-row .swipe-actions button{touch-action:pan-y pinch-zoom}
.note-row.swiped .note-card{transform:translateX(calc(-1 * var(--swipe-width)))}
.note-row.swiping .note-card,.note-row.swipe-tracking .note-card,.note-row.swipe-settling .note-card{transition:none}
.note-row.swipe-settling .swipe-actions{opacity:1}
.note-row .swipe-actions{pointer-events:none}
.note-row.swiped .swipe-actions{pointer-events:auto}
@media(prefers-reduced-motion:reduce){.note-row .note-card,.note-row .swipe-actions{transition:none}}

/*! PhotoSwipe main CSS by Dmytro Semenov | photoswipe.com */

.pswp {
  --pswp-bg: #000;
  --pswp-placeholder-bg: #222;
  

  --pswp-root-z-index: 100000;
  
  --pswp-preloader-color: rgba(79, 79, 79, 0.4);
  --pswp-preloader-color-secondary: rgba(255, 255, 255, 0.9);
  
  /* defined via js:
  --pswp-transition-duration: 333ms; */
  
  --pswp-icon-color: #fff;
  --pswp-icon-color-secondary: #4f4f4f;
  --pswp-icon-stroke-color: #4f4f4f;
  --pswp-icon-stroke-width: 2px;

  --pswp-error-text-color: var(--pswp-icon-color);
}


/*
	Styles for basic PhotoSwipe (pswp) functionality (sliding area, open/close transitions)
*/

.pswp {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: var(--pswp-root-z-index);
	display: none;
	touch-action: none;
	outline: 0;
	opacity: 0.003;
	contain: layout style size;
	-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* Prevents focus outline on the root element,
  (it may be focused initially) */
.pswp:focus {
  outline: 0;
}

.pswp * {
  box-sizing: border-box;
}

.pswp img {
  max-width: none;
}

.pswp--open {
	display: block;
}

.pswp,
.pswp__bg {
	transform: translateZ(0);
	will-change: opacity;
}

.pswp__bg {
  opacity: 0.005;
	background: var(--pswp-bg);
}

.pswp,
.pswp__scroll-wrap {
	overflow: hidden;
}

.pswp__scroll-wrap,
.pswp__bg,
.pswp__container,
.pswp__item,
.pswp__content,
.pswp__img,
.pswp__zoom-wrap {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

.pswp__img,
.pswp__zoom-wrap {
	width: auto;
	height: auto;
}

.pswp--click-to-zoom.pswp--zoom-allowed .pswp__img {
	cursor: -webkit-zoom-in;
	cursor: -moz-zoom-in;
	cursor: zoom-in;
}

.pswp--click-to-zoom.pswp--zoomed-in .pswp__img {
	cursor: move;
	cursor: -webkit-grab;
	cursor: -moz-grab;
	cursor: grab;
}

.pswp--click-to-zoom.pswp--zoomed-in .pswp__img:active {
  cursor: -webkit-grabbing;
  cursor: -moz-grabbing;
  cursor: grabbing;
}

/* :active to override grabbing cursor */
.pswp--no-mouse-drag.pswp--zoomed-in .pswp__img,
.pswp--no-mouse-drag.pswp--zoomed-in .pswp__img:active,
.pswp__img {
	cursor: -webkit-zoom-out;
	cursor: -moz-zoom-out;
	cursor: zoom-out;
}


/* Prevent selection and tap highlights */
.pswp__container,
.pswp__img,
.pswp__button,
.pswp__counter {
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

.pswp__item {
	/* z-index for fade transition */
	z-index: 1;
	overflow: hidden;
}

.pswp__hidden {
	display: none !important;
}

/* Allow to click through pswp__content element, but not its children */
.pswp__content {
  pointer-events: none;
}
.pswp__content > * {
  pointer-events: auto;
}


/*

  PhotoSwipe UI

*/

/*
	Error message appears when image is not loaded
	(JS option errorMsg controls markup)
*/
.pswp__error-msg-container {
  display: grid;
}
.pswp__error-msg {
	margin: auto;
	font-size: 1em;
	line-height: 1;
	color: var(--pswp-error-text-color);
}

/*
class pswp__hide-on-close is applied to elements that
should hide (for example fade out) when PhotoSwipe is closed
and show (for example fade in) when PhotoSwipe is opened
 */
.pswp .pswp__hide-on-close {
	opacity: 0.005;
	will-change: opacity;
	transition: opacity var(--pswp-transition-duration) cubic-bezier(0.4, 0, 0.22, 1);
	z-index: 10; /* always overlap slide content */
	pointer-events: none; /* hidden elements should not be clickable */
}

/* class pswp--ui-visible is added when opening or closing transition starts */
.pswp--ui-visible .pswp__hide-on-close {
	opacity: 1;
	pointer-events: auto;
}

/* <button> styles, including css reset */
.pswp__button {
	position: relative;
	display: block;
	width: 50px;
	height: 60px;
	padding: 0;
	margin: 0;
	overflow: hidden;
	cursor: pointer;
	background: none;
	border: 0;
	box-shadow: none;
	opacity: 0.85;
	-webkit-appearance: none;
	-webkit-touch-callout: none;
}

.pswp__button:hover,
.pswp__button:active,
.pswp__button:focus {
  transition: none;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  opacity: 1;
}

.pswp__button:disabled {
  opacity: 0.3;
  cursor: auto;
}

.pswp__icn {
  fill: var(--pswp-icon-color);
  color: var(--pswp-icon-color-secondary);
}

.pswp__icn {
  position: absolute;
  top: 14px;
  left: 9px;
  width: 32px;
  height: 32px;
  overflow: hidden;
  pointer-events: none;
}

.pswp__icn-shadow {
  stroke: var(--pswp-icon-stroke-color);
  stroke-width: var(--pswp-icon-stroke-width);
  fill: none;
}

.pswp__icn:focus {
	outline: 0;
}

/*
	div element that matches size of large image,
	large image loads on top of it,
	used when msrc is not provided
*/
div.pswp__img--placeholder,
.pswp__img--with-bg {
	background: var(--pswp-placeholder-bg);
}

.pswp__top-bar {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 60px;
	display: flex;
  flex-direction: row;
  justify-content: flex-end;
	z-index: 10;

	/* allow events to pass through top bar itself */
	pointer-events: none !important;
}
.pswp__top-bar > * {
  pointer-events: auto;
  /* this makes transition significantly more smooth,
     even though inner elements are not animated */
  will-change: opacity;
}


/*

  Close button

*/
.pswp__button--close {
  margin-right: 6px;
}


/*

  Arrow buttons

*/
.pswp__button--arrow {
  position: absolute;
  top: 0;
  width: 75px;
  height: 100px;
  top: 50%;
  margin-top: -50px;
}

.pswp__button--arrow:disabled {
  display: none;
  cursor: default;
}

.pswp__button--arrow .pswp__icn {
  top: 50%;
  margin-top: -30px;
  width: 60px;
  height: 60px;
  background: none;
  border-radius: 0;
}

.pswp--one-slide .pswp__button--arrow {
  display: none;
}

/* hide arrows on touch screens */
.pswp--touch .pswp__button--arrow {
  visibility: hidden;
}

/* show arrows only after mouse was used */
.pswp--has_mouse .pswp__button--arrow {
  visibility: visible;
}

.pswp__button--arrow--prev {
  right: auto;
  left: 0px;
}

.pswp__button--arrow--next {
  right: 0px;
}
.pswp__button--arrow--next .pswp__icn {
  left: auto;
  right: 14px;
  /* flip horizontally */
  transform: scale(-1, 1);
}

/*

  Zoom button

*/
.pswp__button--zoom {
  display: none;
}

.pswp--zoom-allowed .pswp__button--zoom {
  display: block;
}

/* "+" => "-" */
.pswp--zoomed-in .pswp__zoom-icn-bar-v {
  display: none;
}


/*

  Loading indicator

*/
.pswp__preloader {
  position: relative;
  overflow: hidden;
  width: 50px;
  height: 60px;
  margin-right: auto;
}

.pswp__preloader .pswp__icn {
  opacity: 0;
  transition: opacity 0.2s linear;
  animation: pswp-clockwise 600ms linear infinite;
}

.pswp__preloader--active .pswp__icn {
  opacity: 0.85;
}

@keyframes pswp-clockwise {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


/*

  "1 of 10" counter

*/
.pswp__counter {
  height: 30px;
  margin-top: 15px;
  margin-inline-start: 20px;
  font-size: 14px;
  line-height: 30px;
  color: var(--pswp-icon-color);
  text-shadow: 1px 1px 3px var(--pswp-icon-color-secondary);
  opacity: 0.85;
}

.pswp--one-slide .pswp__counter {
  display: none;
}

/* Keep the mature zoom/drag gestures, with a photo-first black presentation. */
.viewing-image { overflow:hidden; background:#000; }
.pswp { --pswp-bg:#000; --pswp-root-z-index:20000; --pswp-icon-color:#fff; }
.note-image-viewer .pswp__top-bar { top:env(safe-area-inset-top,0px); padding-right:max(10px,env(safe-area-inset-right,0px)); }
.note-image-viewer .pswp__button { display:grid; place-items:center; width:48px; height:48px; padding:0; color:#fff; background:rgba(36,36,36,.75); border-radius:50%; }
.note-image-viewer .pswp__button .pswp__icn { position:static; inset:auto; display:block; width:32px; height:32px; margin:0; transform:none; }
.note-image-viewer .pswp__button--close { margin:8px 0; }
.note-image-viewer .pswp__button--share { position:absolute; right:max(10px,env(safe-area-inset-right,0px)); bottom:calc(env(safe-area-inset-bottom,0px) + 12px); z-index:10; }
.note-image-viewer .pswp__button--share .pswp__icn { color:#fff; }
.note-image-viewer:not(.image-controls-visible) .pswp__button { opacity:0; visibility:hidden; pointer-events:none; }
.note-image-viewer .pswp__button:focus-visible { outline:2px solid #fff; outline-offset:3px; }
.note-image-viewer .pswp__button:disabled { opacity:.45; }
.image-viewer-loading { position:fixed; inset:0; z-index:20000; background:#000; color:#fff; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:20px; touch-action:none; }
.image-viewer-preview { position:absolute; inset:0; width:100%; height:100%; object-fit:scale-down; pointer-events:none; }
.image-viewer-close { position:absolute; top:calc(env(safe-area-inset-top,0px) + 8px); right:max(10px,env(safe-area-inset-right,0px)); width:48px; height:48px; border:0; border-radius:50%; background:rgba(36,36,36,.75); color:inherit; font-size:32px; z-index:1; }
.image-viewer-loading:not(.image-controls-visible) .image-viewer-close { visibility:hidden; pointer-events:none; }
.image-viewer-status:not(:empty),.image-viewer-message:not(:empty) { position:absolute; bottom:calc(env(safe-area-inset-bottom,0px) + 76px); left:24px; right:24px; padding:12px; border-radius:10px; background:rgba(0,0,0,.8); color:#fff; text-align:center; font-size:15px; }
.image-viewer-failed .image-viewer-preview { opacity:.3; }
.image-viewer-failed .image-viewer-status { position:relative; inset:auto; }
.image-viewer-retry { position:relative; min-width:88px; min-height:44px; padding:8px 20px; border:1px solid #89968d; border-radius:12px; background:#000; color:inherit; }
