/* NexusNote Web design layer. Loaded last. Colors come from the app's own tokens (--nw-*, --primary-*), so every accent choice keeps working. */

/* The bundle's .hidden{display:none!important} sits in @layer legacy, and an important rule in a layer beats any unlayered one.
   nn-first is declared before the bundle in index.html, and the earliest layer wins for important rules. */
@layer nn-first{
  html body .dialog-overlay.hidden{ display: flex !important; }
  html body :is(.dropdown-content,#landing-language-menu).hidden{ display: block !important; }
  html body .toast-card.hidden{ display: flex !important; }
  html body .nn-block.nn-closing.hidden, html body .nn-block.nn-closing[hidden]{ display: block !important; }
  html body #formatting-toolbar.nn-closing.hidden{ display: flex !important; }
  html body #note-tools-panel.nn-closing.hidden{ display: block !important; }
  html body .detail-color-input{ width: 48px !important; max-width: 48px !important; flex: 0 0 48px !important; }
}

/* 1. Tokens ---------------------------------------------------------------- */
html body.theme-light, html body.theme-dark{
  --nw-r-sm: 6px; --nw-r-md: 10px; --nw-r-lg: 14px; --nw-r-xl: 20px;
  --nn-r-sheet: 24px; --nn-r-field: 12px;
  --nn-ease: cubic-bezier(.2,.8,.2,1); --nn-ease-out: cubic-bezier(.4,0,1,1);
  --nn-fast: 140ms; --nn-mid: 220ms; --nn-slow: 300ms;
  --nn-field: var(--nw-surface-2);
}
html body.theme-light{
  --nn-page: #f3f4f6; --nn-card: #ffffff; --nn-tile: var(--primary-soft);
  --nn-seg: #eceef1; --nn-seg-on: #ffffff;
  --nn-shadow-sm: 0 1px 2px rgba(23,28,38,.05), 0 2px 8px rgba(23,28,38,.04);
  --nn-shadow-md: 0 2px 4px rgba(23,28,38,.04), 0 8px 24px rgba(23,28,38,.08);
  --nn-shadow-lg: 0 8px 16px rgba(23,28,38,.06), 0 24px 56px rgba(23,28,38,.14);
  --nn-shadow-seg: 0 1px 2px rgba(23,28,38,.10), 0 1px 4px rgba(23,28,38,.06);
  --nn-shadow-primary: 0 2px 4px rgba(32,44,72,.10), 0 6px 16px rgba(32,44,72,.14);
}
html body.theme-dark{
  --nn-page: #101216; --nn-card: #1b1e24; --nn-tile: var(--primary-soft);
  --nn-seg: #24272e; --nn-seg-on: #343843;
  --nw-surface-2: #22252c;
  --nn-shadow-sm: 0 1px 2px rgba(0,0,0,.24);
  --nn-shadow-md: 0 2px 4px rgba(0,0,0,.2), 0 8px 24px rgba(0,0,0,.28);
  --nn-shadow-lg: 0 8px 16px rgba(0,0,0,.24), 0 24px 56px rgba(0,0,0,.44);
  --nn-shadow-seg: 0 1px 2px rgba(0,0,0,.3);
  --nn-shadow-primary: 0 2px 8px rgba(0,0,0,.3);
}

/* 2. Base: touch, focus, type ------------------------------------------------ */
html body{ -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
html body :is(button,a,summary,label,select,[role=button],.note-item,.folder-content){ touch-action: manipulation; }
html.nn-pointer body :is(button,a,summary,select,[tabindex],.note-item,.folder-content,dialog):focus-visible{ outline: none; box-shadow: none; }
html body :is(h1,h2,h3,h4,.start-title,.dialog-content h2,.dialog-content h3){ text-wrap: balance; letter-spacing: -.02em; }
html body .nn-rel{ position: relative; }

/* 3. Press bubble -------------------------------------------------------------- */
html body nn-b{ display: block; }
html body .nn-bubble{ position: absolute; inset: 0; z-index: 0; border-radius: inherit; background: currentColor; opacity: 0; pointer-events: none; transition: opacity var(--nn-mid) var(--nn-ease), scale var(--nn-mid) var(--nn-ease); }
html body .nn-bubble.is-on{ opacity: .08; transition-duration: 90ms; }
html body .nn-held > .nn-bubble.is-on{ opacity: .12; transition-duration: 220ms; }
html body .nn-bubble--round{ inset: auto; left: 50%; top: 50%; width: var(--nn-b); height: var(--nn-b); margin: calc(var(--nn-b) / -2) 0 0 calc(var(--nn-b) / -2); border-radius: 50%; scale: .62; }
html body .nn-bubble--round.is-on{ scale: 1; opacity: .1; transition-duration: 140ms; }
html body .nn-held > .nn-bubble--round.is-on{ scale: 1.12; opacity: .13; }
html body :is(.primary-button,.dialog-button.primary,.dialog-button.danger,.start-new,.sync-action-button.primary) > .nn-bubble.is-on{ opacity: .16; }
html body .nn-pressed{ scale: .975; }
html body :is(.note-item,.workspace-nav-item,.folder-content,.sidebar-utility,.start-source-button,.nw-tray__item).nn-pressed{ scale: .988; }
html body :is(.icon-button,.chip-button,.panel-inline-toggle,.formatting-action,.toast-dismiss-button,.nw-panel__close,.preview-close).nn-pressed{ scale: .92; }
html body :is(.icon-button,.chip-button,.panel-inline-toggle,.formatting-action,.toast-dismiss-button,.nw-panel__close,.preview-close,.primary-button,.secondary-button,.dialog-button,.start-new,.nw-sample-entry,.start-source-button,.start-resume,.start-discard,.start-settings-link,.welcome-language,.text-button,.note-item,.workspace-nav-item,.folder-content,.sidebar-utility,.mobile-tab-button,.markdown-view-button,.note-filter-chip,.note-tool-chip,.resource-tab,.resource-add,.resource-toggle,.save-note-button,.header-search-button,.sync-action-button,.sync-auth-button,.sync-alert-button,.detail-toggle-button,.detail-color-clear,.editor-lock-action,.nw-panel button,.nw-tray__item,.web-settings-links button,.preview-download){
  transition: scale var(--nn-mid) var(--nn-ease), color var(--nn-mid) var(--nn-ease), background-color var(--nn-mid) var(--nn-ease), border-color var(--nn-mid) var(--nn-ease), box-shadow var(--nn-mid) var(--nn-ease), opacity var(--nn-mid) var(--nn-ease);
}
html body .nn-pressed{ transition-duration: 90ms !important; }
html body :is(.icon-button,.formatting-action,.chip-button,.panel-inline-toggle){ position: relative; }

/* 4. Sliding selection ----------------------------------------------------------- */
html body .nn-slide-host{ position: relative; }
html body nn-s{ display: block; }
html body .nn-slide{ position: absolute; left: 0; top: 0; z-index: 0; opacity: 0; pointer-events: none; will-change: transform; transition: transform var(--nn-slow) var(--nn-ease), width var(--nn-slow) var(--nn-ease), height var(--nn-slow) var(--nn-ease), opacity var(--nn-fast) linear; }
html body .nn-slide--seg{ border-radius: var(--nw-r-md); background: var(--nn-seg-on); box-shadow: var(--nn-shadow-seg); }
html body .nn-slide--tint{ border-radius: var(--nw-r-md); background: var(--primary-soft); }
html body .nn-slide--tab{ border-radius: 16px; background: var(--primary-soft); }
html body .nn-slide--nav{ border-radius: var(--nw-r-md); background: var(--nn-card); box-shadow: var(--nn-shadow-sm); }
html body .nn-slide--note{ border-radius: var(--nw-r-lg); background: var(--nw-surface-2); }
html body .nn-slide-host > :not(.nn-slide):not(.nn-ghost){ position: relative; z-index: 1; }
html body #left-panel.nn-slide-host > :not(.nn-slide){ position: relative; z-index: 1; }
html body.theme-dark .nn-slide--nav{ background: var(--nw-surface-2); }

/* The moving background replaces each item's own one, once it is in place. */
html body .nn-slide-ready :is(.mobile-tab-button.active,.mobile-tab-button[aria-pressed=true]) .material-symbols-outlined{ background: transparent; }
html body .markdown-view-switch.nn-slide-ready :is(.markdown-view-button.active,.markdown-view-button[aria-pressed=true]){ background: transparent; box-shadow: none; }
html body .resource-tabs.nn-slide-ready .resource-tab[aria-selected=true]{ background: transparent; box-shadow: none; }
html body .nw-seg.nn-slide-ready button[aria-pressed=true]{ background: transparent; border-color: transparent; }
html body #note-filter-group.nn-slide-ready :is(.note-filter-chip.active,.note-filter-chip[aria-pressed=true]){ background: transparent; border-color: transparent; }
html body #attachment-filter-group.nn-slide-ready :is(.note-tool-chip.active,.note-tool-chip[aria-pressed=true]){ background: transparent; border-color: transparent; }
html body #left-panel.nn-slide-ready .workspace-nav-item.active{ background: transparent; box-shadow: none; }
html body #left-panel.nn-slide-ready .folder-item.selected > .folder-content{ background: transparent; box-shadow: none; }

/* 5. Controls ---------------------------------------------------------------------- */
html body .icon-button{ width: 40px; height: 40px; min-width: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--nw-text-2); box-shadow: none; }
html body .icon-button.subtle{ width: 36px; height: 36px; min-width: 36px; color: var(--nw-text-3); }

html body :is(.icon-button[aria-pressed=true],.icon-button[aria-expanded=true]){ background: var(--primary-soft); color: var(--primary-color); }
html body .icon-button:disabled{ opacity: .4; }
@media (hover: hover) and (pointer: fine){
  html body .icon-button:not(:disabled):not([aria-pressed=true]):not([aria-expanded=true]):hover{ background: color-mix(in srgb, var(--nw-text) 6%, transparent); color: var(--nw-text); }
}

html body :is(.primary-button,.dialog-button.primary){ border: 0; background: var(--primary-color); color: var(--on-primary); box-shadow: var(--nn-shadow-primary); }
html body .dialog-button{ min-height: 48px; padding: 0 20px; border-radius: var(--nw-r-lg); font: 600 15px/1 var(--nw-font); }
html body .dialog-button.secondary{ border: 0; background: var(--nn-seg); color: var(--nw-text); }
html body .dialog-button.danger{ border: 0; box-shadow: none; }
html body .dialog-buttons{ margin-top: 24px; gap: 8px; }
html body .dialog-buttons .dialog-button{ min-height: 52px; }
@media (hover: hover) and (pointer: fine){
  html body .dialog-button.secondary:hover{ background: color-mix(in srgb, var(--nw-text) 12%, var(--nn-seg)); }
}
html body .secondary-button{ min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--nw-r-md); background: var(--nn-seg); color: var(--nw-text); font: 500 14px/1.2 var(--nw-font); box-shadow: none; }
html body .secondary-button.attachment-danger{ color: var(--nw-danger); }

/* Fields: quiet fill, no heavy outline */
html body :is(.dialog-input,.dialog-select,.dialog-content input:not([type=checkbox]):not([type=color]):not([type=radio]),.detail-input,.dialog-content select,.attachment-dialog input[type=text],.nw-tray__search){
  min-height: 48px; padding: 12px 14px; border: 1px solid transparent; border-radius: var(--nn-r-field); background-color: var(--nn-field); color: var(--nw-text); font: 400 15px/1.4 var(--nw-font); box-shadow: none;
  transition: border-color var(--nn-fast) var(--nn-ease), background-color var(--nn-fast) var(--nn-ease);
}
html body :is(.dialog-input,.dialog-select,.dialog-content input,.detail-input,.dialog-content select,.attachment-dialog input[type=text],.nw-tray__search):focus,
html body :is(.dialog-input,.dialog-select,.dialog-content input,.detail-input,.dialog-content select,.attachment-dialog input[type=text],.nw-tray__search):focus-visible{ border-color: var(--primary-color); background-color: var(--nn-card); box-shadow: none; outline: none; }
html body :is(.dialog-content select,select.detail-input,.dialog-select,.web-setting-row select,#note-sort-select){
  -webkit-appearance: none; appearance: none; padding-inline-end: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b92a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
html[dir=rtl] body :is(.dialog-content select,select.detail-input,.dialog-select,.web-setting-row select,#note-sort-select){ background-position: left 12px center; }
html body .field-label, html body .detail-label{ display: block; margin: 16px 0 6px; font: 500 13px/1.4 var(--nw-font); color: var(--nw-text-3); }
html body .detail-label{ margin-top: 0; }

/* Switch */
html body :is(.switch-input,.web-setting-row.switch-setting input[type=checkbox]){
  -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 48px; height: 28px; min-height: 28px; margin: 0; padding: 0; border: 0; border-radius: 14px; background: var(--nw-line-strong); cursor: pointer;
  transition: background-color var(--nn-mid) var(--nn-ease);
}
html body :is(.switch-input,.web-setting-row.switch-setting input[type=checkbox])::before{ content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(23,28,38,.24); transition: translate var(--nn-mid) var(--nn-ease); }
html body :is(.switch-input,.web-setting-row.switch-setting input[type=checkbox]):checked{ background: var(--primary-color); }
html body :is(.switch-input,.web-setting-row.switch-setting input[type=checkbox]):checked::before{ translate: 20px 0; }
html[dir=rtl] body :is(.switch-input,.web-setting-row.switch-setting input[type=checkbox]):checked::before{ translate: -20px 0; }
html body.theme-dark :is(.switch-input,.web-setting-row.switch-setting input[type=checkbox]):checked::before{ background: #16181d; }
html body :is(.switch-input,.web-setting-row.switch-setting input[type=checkbox]):disabled{ opacity: .45; cursor: default; }

/* Segmented controls */
html body .markdown-view-switch{ gap: 2px; padding: 3px; border: 0; border-radius: var(--nw-r-lg); background: var(--nn-seg); }
html body .markdown-view-button{ min-height: 34px; padding: 0 12px; gap: 6px; border-radius: var(--nw-r-md); color: var(--nw-text-3); font: 500 14px/1 var(--nw-font); }
html body :is(.markdown-view-button.active,.markdown-view-button[aria-pressed=true]){ color: var(--nw-text); font-weight: 600; }
html body .markdown-view-button:hover{ background: transparent; }
html body .resource-tabs{ gap: 2px; padding: 3px; border-radius: var(--nw-r-lg); background: var(--nn-seg); }
html body .resource-tab{ position: relative; border: 0; background: transparent; color: var(--nw-text-3); border-radius: var(--nw-r-md); }
html body .resource-tab[aria-selected=true]{ color: var(--nw-text); font-weight: 600; }
html body :is(.note-filter-chip,.note-tool-chip){ min-height: 36px; padding: 0 12px; border: 0; border-radius: var(--nw-r-md); background: transparent; color: var(--nw-text-2); font: 500 14px/1 var(--nw-font); box-shadow: none; }
html body :is(.note-filter-chip.active,.note-filter-chip[aria-pressed=true],.note-tool-chip.active,.note-tool-chip[aria-pressed=true]){ background: var(--primary-soft); color: var(--primary-color); font-weight: 600; }
html body .note-tag-filter-list button{ border-radius: var(--nw-r-md); }

/* Toggles in the details sheet */
html body .detail-toggle-button{ min-height: 48px; border: 0; border-radius: var(--nn-r-field); background: var(--nn-field); color: var(--nw-text-2); font: 500 14px/1.2 var(--nw-font); box-shadow: none; }
html body .detail-toggle-button[aria-pressed=true]{ background: var(--primary-soft); color: var(--primary-color); }

/* 6. Start screen ------------------------------------------------------------------ */
html body #landing-page{ background: var(--nn-page); }
html body .welcome-nav{ background: transparent; }
html body .start-main{ width: min(480px, calc(100% - 40px)); margin-inline: auto; }
html body .start-title{ font: 700 clamp(28px, 4.4vw, 34px)/1.3 var(--nw-font); letter-spacing: -.03em; color: var(--nw-text); }
html body .start-description{ margin-top: 8px; font-size: 16px; line-height: 1.6; color: var(--nw-text-3); }
html body .start-workspace{ display: flex; flex-direction: column; gap: 8px; }
html body .start-new, html body .start-workspace:has(.nw-sample-entry) .start-new{
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 58px; padding: 0 20px; border: 0; border-radius: var(--nw-r-lg); background: var(--primary-color); color: var(--on-primary); font: 600 16px/1 var(--nw-font); box-shadow: var(--nn-shadow-primary);
}
html body .start-new .material-symbols-outlined{ color: inherit; }
html body .start-new:hover{ background: var(--primary-strong); }
html body .start-workspace:has(.start-recovery:not(.hidden)) .start-new{ border: 0; border-radius: var(--nw-r-lg); background: var(--nn-card); color: var(--nw-text); box-shadow: var(--nn-shadow-sm); }
html body .start-workspace:has(.start-recovery:not(.hidden)) .start-new .material-symbols-outlined{ color: var(--primary-color); }
html body .start-workspace:has(.start-recovery:not(.hidden)) .start-new:hover{ background: var(--nn-card); }
html body .nw-sample-entry{ width: 100%; min-height: 58px; border: 0 !important; border-radius: var(--nw-r-lg) !important; background: var(--nn-card); color: var(--nw-text); box-shadow: var(--nn-shadow-sm); font: 600 16px/1 var(--nw-font); }
html body .nw-sample-note, html body .start-local-notice{ margin: 0; padding-inline: 4px; font-size: 13px; line-height: 1.55; color: var(--nw-text-3); }
html body .start-local-notice{ display: flex; gap: 8px; align-items: flex-start; }
html body .start-local-notice .material-symbols-outlined{ flex: none; width: 16px; height: 16px; margin-top: 2px; }
html body .start-recovery{ border: 0; border-radius: var(--nw-r-xl); background: var(--nn-card); box-shadow: var(--nn-shadow-sm); padding: 20px; }
html body .start-resume{ min-height: 52px; border-radius: var(--nw-r-lg); background: var(--primary-color); color: var(--on-primary); border: 0; font-weight: 600; box-shadow: var(--nn-shadow-primary); }
html body .start-discard{ min-height: 44px; border-radius: var(--nw-r-md); }
html body .start-backups h2, html body #start-backups-title{ margin: 0 0 8px; padding-inline: 4px; font: 600 14px/1.4 var(--nw-font); letter-spacing: 0; color: var(--nw-text-3); }
html body .start-source-grid{ border: 0; border-radius: var(--nw-r-xl); background: var(--nn-card); box-shadow: var(--nn-shadow-sm); overflow: hidden; padding: 4px; }
html body .start-source-button{ grid-template-columns: 44px minmax(0,1fr) 18px; gap: 12px; min-height: 68px; padding: 8px 12px; border: 0; border-radius: 16px; background: transparent; }
html body .start-source-button + .start-source-button{ border-top: 0; }
html body .start-source-button:hover{ background: var(--nw-surface-2); }
html body .start-source-button .start-source-icon{ box-sizing: border-box; width: 44px; height: 44px; padding: 11px; border-radius: var(--nw-r-lg); background: var(--nn-tile); color: var(--primary-color); }
html body .start-source-copy strong{ font: 600 16px/1.35 var(--nw-font); color: var(--nw-text); }
html body .start-source-copy > span{ font-size: 13px; color: var(--nw-text-3); }
html body .start-source-button:hover .start-source-arrow{ color: var(--nw-text-3); }
html body .start-settings-link{ min-height: 44px; padding: 0 8px; border-radius: var(--nw-r-md); color: var(--nw-text-2); }
html body .welcome-language{ border: 0; border-radius: var(--nw-r-md); background: transparent; }
html body .welcome-footer{ border-top: 1px solid var(--nw-line); }
html body .brand-lockup img{ box-shadow: none; }
@media (prefers-reduced-motion: no-preference){
  html body #landing-page:not(.hidden) :is(.start-intro,.start-workspace,.start-backups){ animation: nn-rise 480ms var(--nn-ease) both; }
  html body #landing-page:not(.hidden) .start-workspace{ animation-delay: 50ms; }
  html body #landing-page:not(.hidden) .start-backups{ animation-delay: 100ms; }
}
@keyframes nn-pane-in{ from{ transform: translate3d(calc(var(--nn-dir, 0) * 20px), 0, 0); } to{ transform: none; } }
@keyframes nn-rise{ from{ opacity: 0; translate: 0 10px; } to{ opacity: 1; translate: 0 0; } }

/* 7. Workspace ---------------------------------------------------------------------- */
html body .app-header{ border-bottom: 1px solid var(--nw-line); background: var(--nw-bg); }
html body .header-search-button{ min-height: 38px; border: 0; border-radius: var(--nw-r-md); background: var(--nw-surface-2); color: var(--nw-text-3); font-size: 14px; }
html body #left-panel{ background: var(--nw-sidebar); }
html body .sidebar-new-note{ min-height: 44px; border-radius: var(--nw-r-lg); font: 600 14px/1 var(--nw-font); }
html body .sidebar-new-note kbd{ background: color-mix(in srgb, var(--on-primary) 18%, transparent); border: 0; color: var(--on-primary); }
html body :is(.workspace-nav-item,.folder-content,.sidebar-utility){ border-radius: var(--nw-r-md); }
html body :is(.workspace-nav-item.active){ color: var(--nw-text); font-weight: 600; }
html body .folder-content{ background: transparent; }
html body .folder-item.selected > .folder-content{ color: var(--nw-text); font-weight: 600; }
html body .sidebar-profile{ border-top: 1px solid var(--nw-line); }
html body .profile-avatar{ border-radius: 50%; background: var(--nn-tile); color: var(--primary-color); }

/* Note list: soft rows, no divider lines, selection slides */
html body #note-list-container{ padding: 0 8px 24px; }
html body #note-list:not([data-view-type=GRID]):not([data-view-type=LARGE_GRID]) .note-item{ margin: 0 0 2px; padding: 12px; border: 0; border-radius: var(--nw-r-lg) !important; }
html body #note-list:not([data-view-type=GRID]):not([data-view-type=LARGE_GRID]) .note-item::after{ content: none; }
html body #note-list:not([data-view-type=GRID]):not([data-view-type=LARGE_GRID]) .note-item:hover{ background: color-mix(in srgb, var(--nw-text) 3%, transparent); }
html body #note-list:not([data-view-type=GRID]):not([data-view-type=LARGE_GRID]) .note-item.selected{ border: 0; border-left: 0; background: var(--nw-surface-2) !important; }
html[data-ys-motion=on] #note-list:not([data-view-type=GRID]):not([data-view-type=LARGE_GRID]) .note-item::before{ content: none !important; }
html body #note-list:is([data-view-type=GRID],[data-view-type=LARGE_GRID]) .note-item{ border: 0 !important; background: var(--nw-surface-2) !important; border-radius: var(--nw-r-lg) !important; }
html body #note-list:is([data-view-type=GRID],[data-view-type=LARGE_GRID]) .note-item.selected{ box-shadow: inset 0 0 0 2px var(--primary-color); }
html body #note-list-container.nn-slide-ready > .nn-slide--note{ }
html body #note-list:is([data-view-type=GRID],[data-view-type=LARGE_GRID]) ~ .nn-slide,
html body #note-list-container:has(#note-list[data-view-type=GRID]) > .nn-slide--note,
html body #note-list-container:has(#note-list[data-view-type=LARGE_GRID]) > .nn-slide--note{ background: transparent; }
html body .note-search-shell{ min-height: 44px; border: 0; border-radius: var(--nw-r-lg); background: var(--nw-surface-2); box-shadow: none; }
html body .note-search-shell:focus-within{ background: var(--nw-surface-2); box-shadow: inset 0 0 0 1.5px var(--primary-color); outline: none; }
html body .note-tools-panel{ border: 0; border-radius: var(--nw-r-lg); background: var(--nw-surface-2); box-shadow: none; }

/* Editor */
html body .editor-command-bar{ min-height: 56px; }
html body .save-note-button{ min-height: 36px; border-radius: 18px; padding: 0 12px; }
html body .formatting-toolbar{ border: 0; border-radius: var(--nw-r-lg); background: var(--nw-surface-2); padding: 4px; }
html body .formatting-action{ width: 36px; height: 36px; min-width: 36px; border-radius: 50%; }
html body .formatting-action:hover{ background: transparent; }
html body #editor-empty-state .empty-art-spark{ display: none; }
html body #editor-empty-state .empty-note-art{ width: 72px; height: 72px; border: 0; border-radius: var(--nw-r-xl); background: var(--nn-tile); color: var(--primary-color); box-shadow: none; transform: none; rotate: none; }
html body #editor-empty-state .empty-note-art .material-symbols-outlined{ transform: none; rotate: none; }
html body .resource-add{ border: 0; border-radius: 18px; background: var(--primary-soft); color: var(--primary-color); font-weight: 600; }
html body .resource-toggle{ border: 0; border-radius: 50%; background: transparent; }

/* Mobile tab bar */
html body .mobile-tab-bar{ border-top: 1px solid var(--nw-line); }
html body .mobile-tab-button{ min-height: 56px; }
html body .mobile-tab-button.active{ font-weight: 600; }
html body .mobile-tab-button .material-symbols-outlined{ position: relative; z-index: 1; width: 56px; height: 32px; padding: 4px 16px; border-radius: 16px; transition: color var(--nn-mid) var(--nn-ease); }

/* 8. Overlays: keep them laid out so they can leave as smoothly as they arrive --------- */
html body .dialog-overlay{ transition: opacity var(--nn-mid) var(--nn-ease), visibility 0s linear 0s; opacity: 1; animation: none !important; }
html body .dialog-overlay.hidden{ visibility: hidden; opacity: 0; pointer-events: none; transition: opacity 180ms var(--nn-ease-out), visibility 0s linear 180ms; }
html body .dialog-overlay > .dialog-content{ animation: none !important; transition: transform var(--nn-slow) var(--nn-ease), opacity var(--nn-mid) var(--nn-ease); border: 0; border-radius: var(--nn-r-sheet); box-shadow: var(--nn-shadow-lg); background: var(--nn-card); }
html body .dialog-overlay.hidden > .dialog-content{ transform: translateY(12px) scale(.98); opacity: 0; transition: transform 180ms var(--nn-ease-out), opacity 180ms var(--nn-ease-out); }
html body .dialog-symbol{ width: 48px; height: 48px; border: 0; border-radius: var(--nw-r-lg); background: var(--nn-tile); color: var(--primary-color); box-shadow: none; }
html body .dialog-symbol.warning{ background: var(--nw-warning-soft); color: var(--nw-warning-text); }
html body #confirmation-dialog .dialog-symbol{ background: var(--nw-danger-soft); color: var(--nw-danger); }
html body .dialog-content :is(h2,h3){ font: 700 20px/1.4 var(--nw-font); letter-spacing: -.02em; }
html body :is(.detail-section-heading,.web-settings-section h3){ margin: 8px 0 4px; font: 600 14px/1.4 var(--nw-font); letter-spacing: 0; color: var(--nw-text-3); text-transform: none; }

/* Native dialogs share the same entrance and exit */
html body dialog{ border: 0; border-radius: var(--nn-r-sheet); background: var(--nn-card); color: var(--nw-text); box-shadow: var(--nn-shadow-lg); }
html body dialog::backdrop{ background: var(--nw-scrim); backdrop-filter: none; }
@media (prefers-reduced-motion: no-preference){
  html body dialog{ opacity: 0; transform: translateY(12px) scale(.98); animation: none !important; transition: opacity 180ms var(--nn-ease-out), transform 180ms var(--nn-ease-out), overlay 180ms allow-discrete, display 180ms allow-discrete; }
  html body dialog[open]{ opacity: 1; transform: none; transition: opacity var(--nn-mid) var(--nn-ease), transform var(--nn-slow) var(--nn-ease), overlay var(--nn-slow) allow-discrete, display var(--nn-slow) allow-discrete; }
  @starting-style{ html body dialog[open]{ opacity: 0; transform: translateY(16px) scale(.98); } }
  html body dialog::backdrop{ opacity: 0; transition: opacity 180ms linear, overlay 180ms allow-discrete, display 180ms allow-discrete; }
  html body dialog[open]::backdrop{ opacity: 1; }
  @starting-style{ html body dialog[open]::backdrop{ opacity: 0; } }
}

/* Menus */
html body :is(.dropdown-content,#landing-language-menu){ border: 0; border-radius: var(--nw-r-lg); background: var(--nn-card); box-shadow: var(--nn-shadow-md); padding: 6px; animation: none !important; transform-origin: top right; transition: opacity var(--nn-fast) var(--nn-ease), transform var(--nn-mid) var(--nn-ease), visibility 0s linear 0s; }
html body :is(.dropdown-content,#landing-language-menu).hidden{ visibility: hidden; opacity: 0; transform: translateY(-4px) scale(.97); pointer-events: none; transition: opacity 120ms var(--nn-ease-out), transform 120ms var(--nn-ease-out), visibility 0s linear 120ms; }
html body :is(.dropdown-content,#landing-language-menu) :is(button,a){ position: relative; min-height: 44px; border-radius: var(--nw-r-md); }

/* Toast */
html body .toast-card{ border: 0; border-radius: var(--nw-r-lg); box-shadow: var(--nn-shadow-md); transition: opacity var(--nn-mid) var(--nn-ease), translate var(--nn-slow) var(--nn-ease), visibility 0s linear 0s; animation: none !important; }
html body .toast-card.hidden{ visibility: hidden; opacity: 0; translate: 0 12px; transition: opacity 160ms var(--nn-ease-out), translate 160ms var(--nn-ease-out), visibility 0s linear 160ms; }

/* Blocks collapse through height (nn-ui.js animates between the measured sizes) */
html body .nn-block{ overflow: clip; }
html body .nn-block.nn-closing.hidden, html body .nn-block.nn-closing[hidden]{ visibility: visible; pointer-events: none; }
html body #note-tools-panel:not(.hidden), html body #formatting-toolbar:not(.hidden){ overflow: clip; }

/* 9. Graph and side panels ------------------------------------------------------------ */
html body .nw-panel{ background: var(--nn-card); }
html body .nw-panel button{ border: 0; border-radius: var(--nw-r-md); background: var(--nw-surface-2); min-height: 40px; }
html body .nw-panel .nw-panel__close{ border-radius: 50%; background: transparent; }
html body .nw-seg{ gap: 2px; padding: 3px; border-radius: var(--nw-r-lg); background: var(--nn-seg); }
html body .nw-seg button{ background: transparent; border: 0; min-height: 34px; }
html body .nw-seg button[aria-pressed=true]{ color: var(--primary-color); font-weight: 600; background: var(--primary-soft); }
html body .nw-seg .nn-slide--tint{ background: var(--nn-seg-on); box-shadow: var(--nn-shadow-seg); }
html body .nw-graph__card{ border: 0; border-radius: var(--nw-r-lg); box-shadow: var(--nn-shadow-md); }
html body .nw-sample-bar{ border-bottom: 0; }

/* 10. Mobile --------------------------------------------------------------------------- */
@media (max-width: 760px){
  /* No field may trigger iOS focus zoom */
  html body :is(input:not([type=checkbox]):not([type=radio]):not([type=color]),select,textarea){ font-size: 16px; }
  html body #note-title-input{ font-size: 24px; }

  /* Sheets rise from the bottom and always stay above the keyboard */
  html body .dialog-overlay{ top: var(--nn-vvt, 0px); bottom: auto; height: var(--nn-vvh, 100dvh); align-items: flex-end; padding: 0; }
  html body .dialog-overlay > .dialog-content{ width: 100%; max-height: calc(var(--nn-vvh, 100dvh) - 24px); border-radius: var(--nn-r-sheet) var(--nn-r-sheet) 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -8px 32px rgba(23,28,38,.14); }
  html.nn-kb body .dialog-overlay > .dialog-content{ padding-bottom: 16px; }
  html body .dialog-overlay.hidden > .dialog-content{ transform: translateY(100%); opacity: 1; transition: transform 220ms var(--nn-ease-out), visibility 0s; }
  html body dialog{ margin: auto 0 0; width: 100%; max-width: 100%; max-height: calc(var(--nn-vvh, 100dvh) - 24px); bottom: var(--nn-kb, 0px); border-radius: var(--nn-r-sheet) var(--nn-r-sheet) 0 0; box-shadow: 0 100vh 0 100vh var(--nn-card); }
  @media (prefers-reduced-motion: no-preference){
    html body dialog{ opacity: 1; transform: translateY(100%); }
    html body dialog[open]{ transform: none; }
    @starting-style{ html body dialog[open]{ opacity: 1; transform: translateY(100%); } }
  }

  /* App fits the visible part of the screen */
  html body:has(#app-container:not(.hidden)){ position: fixed; inset: 0; overflow: hidden; }
  html.nn-ui body #app-container:not(.hidden){ position: fixed; left: 0; right: 0; top: var(--nn-vvt, 0px); height: var(--nn-vvh, 100dvh); min-height: 0; }
  html[data-nw-sample] body #app-container:not(.hidden){ top: calc(var(--nn-vvt, 0px) + var(--nw-sample-bar, 0px)); height: calc(var(--nn-vvh, 100dvh) - var(--nw-sample-bar, 0px)); }
  html.nn-kb body #mobile-tab-bar, html.nn-kb body #editor-footer, html.nn-kb body #note-resources{ display: none !important; }
  html.nn-kb-write body :is(#editor-toolbar,#editor-note-meta,.markdown-view-switch){ display: none !important; }
  html.nn-kb-write body #editor-content{ min-height: 0; }
  html.nn-kb-write body #markdown-workspace{ flex: 1 1 0; min-height: 0; }
  html.nn-kb-write body #formatting-toolbar:not(.hidden){ order: 10; flex: none; width: 100%; margin: 0; border-radius: 0; border-top: 1px solid var(--nw-line); background: var(--nn-card); }

  /* Panes share one cell and slide with the tab order */
  html body #app-container.mode-mobile{ --nn-dir: 0; overflow: hidden; }
  html body #app-container.mode-mobile :is(#left-panel,#note-browser-panel,#editor-container){
    display: flex !important; visibility: hidden !important; grid-column: 1; grid-row: 2; min-height: 0; z-index: 1; opacity: 0 !important; transform: none !important; animation: none !important; pointer-events: none !important;
    background: var(--nw-bg); transition: opacity 0s linear 240ms, visibility 0s linear 240ms;
  }
  /* The new pane fades in on top of the old one, so the screen never passes through an empty frame. */
  html body #app-container.mode-mobile:is(.mobile-view-utility) #left-panel,
  html body #app-container.mode-mobile:is(.mobile-view-browse) #note-browser-panel,
  html body #app-container.mode-mobile:is(.mobile-view-editor) #editor-container{
    visibility: visible !important; z-index: 2; opacity: 1 !important; pointer-events: auto !important; transition: opacity var(--nn-mid) var(--nn-ease), visibility 0s;
  }
  @media (prefers-reduced-motion: no-preference){
    html body #app-container.mode-mobile:is(.mobile-view-utility) #left-panel,
    html body #app-container.mode-mobile:is(.mobile-view-browse) #note-browser-panel,
    html body #app-container.mode-mobile:is(.mobile-view-editor) #editor-container{ animation: nn-pane-in var(--nn-slow) var(--nn-ease) !important; }
  }
  html body #app-container.mode-mobile #note-browser-panel, html body #app-container.mode-mobile #left-panel{ flex-direction: column; }
  html body #app-container.mode-mobile:not(.mobile-view-utility) #left-panel *{ visibility: hidden !important; }
  html body .header-search-button{ background: transparent; }

  html body .app-header{ padding-inline: 4px; }
  html body .header-right{ gap: 0; }
  html body .note-item-title{ font-size: 16px; }
  html body .note-item-snippet{ font-size: 14px; }
  html body .editor-command-bar{ min-height: 52px; padding-inline: 8px; }
  html body .dialog-buttons{ position: sticky; bottom: 0; }
}

/* 11. Reduced motion -------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce){
  html body *, html body *::before, html body *::after{ transition-duration: 1ms !important; transition-delay: 0s !important; animation-duration: 1ms !important; }
  html body .nn-pressed{ scale: 1; }
}

/* 12. Icons drawn from outside, so text the app rewrites on a language change keeps them ---- */
html body{
  --i-center: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='7'/%3E%3Ccircle cx='12' cy='12' r='2.5'/%3E%3Cpath d='M12 2v3M12 19v3M2 12h3M19 12h3'/%3E%3C/svg%3E");
  --i-list: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M8 6h12M8 12h12M8 18h12M4 6h.01M4 12h.01M4 18h.01'/%3E%3C/svg%3E");
  --i-go: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
  --i-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  --i-restore: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12a8 8 0 1 0 2.6-5.9L4 8.5'/%3E%3Cpath d='M4 4v4.5h4.5'/%3E%3C/svg%3E");
  --i-eye: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z'/%3E%3Ccircle cx='12' cy='12' r='2.8'/%3E%3C/svg%3E");
  --i-unlink: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.5 14.5 8 16a3.5 3.5 0 0 1-5-5l3-3a3.5 3.5 0 0 1 4.5-.4M14.5 9.5 16 8a3.5 3.5 0 0 1 5 5l-3 3a3.5 3.5 0 0 1-4.5.4M4 4l16 16'/%3E%3C/svg%3E");
  --i-swap: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h13M13 4l4 4-4 4M20 16H7M11 12l-4 4 4 4'/%3E%3C/svg%3E");
  --i-trash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M9 7V4.5h6V7M6.5 7l1 13h9l1-13'/%3E%3C/svg%3E");
  --i-text: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 7V5h14v2M12 5v14M9 19h6'/%3E%3C/svg%3E");
  --i-align: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M4 6h16M4 12h10M4 18h13'/%3E%3C/svg%3E");
  --i-tool: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16zM13 7l4 4'/%3E%3C/svg%3E");
  --i-view: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='17' height='14' rx='2.5'/%3E%3Cpath d='M12 5v14'/%3E%3C/svg%3E");
  --i-folder: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 7.5a2 2 0 0 1 2-2h4l2 2.5h7a2 2 0 0 1 2 2v7.5a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2z'/%3E%3C/svg%3E");
  --i-grid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='7' height='7' rx='1.5'/%3E%3Crect x='13' y='4' width='7' height='7' rx='1.5'/%3E%3Crect x='4' y='13' width='7' height='7' rx='1.5'/%3E%3Crect x='13' y='13' width='7' height='7' rx='1.5'/%3E%3C/svg%3E");
  --i-mode: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Cpath d='M12 4v16' /%3E%3Cpath d='M12 8h5M12 12h7M12 16h5'/%3E%3C/svg%3E");
  --i-lines: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 6h10M10 12h10M10 18h10M5 8V5m0 0L3.5 6.5M5 5l1.5 1.5M5 16v3m0 0-1.5-1.5M5 19l1.5-1.5'/%3E%3C/svg%3E");
}
html body :is(.nw-graph__center,.nw-graph__view,#link-editor-remove,#link-editor-apply,.trash-restore,#attachment-replace-button,#attachment-unlink-button,#attachment-delete-button,#web-toolbar-customizer-reset,#web-settings-reset,#web-settings-reset)::before{
  content: ""; display: inline-block; width: 16px; height: 16px; margin-inline-end: 6px; vertical-align: -3px; background: currentColor; -webkit-mask: var(--nn-i) center / contain no-repeat; mask: var(--nn-i) center / contain no-repeat;
}
html body .nw-graph__center{ --nn-i: var(--i-center); }
html body .nw-graph__view{ --nn-i: var(--i-list); }
html body #link-editor-remove{ --nn-i: var(--i-unlink); }
html body #link-editor-apply{ --nn-i: var(--i-check); }
html body .trash-restore{ --nn-i: var(--i-restore); }
html body #attachment-replace-button{ --nn-i: var(--i-swap); }
html body #attachment-unlink-button{ --nn-i: var(--i-unlink); }
html body #attachment-delete-button{ --nn-i: var(--i-trash); }
html body :is(#web-toolbar-customizer-reset,#web-settings-reset){ --nn-i: var(--i-restore); }

/* Settings rows lead with an icon tile */
html body .web-settings-section{ border: 0; background: transparent; box-shadow: none; padding: 0; }
html body .web-settings-grid{ gap: 24px; }
html body .web-settings-dialog{ background: var(--nn-card); }
html body .web-setting-row{ display: grid; grid-template-columns: 40px minmax(0,1fr) minmax(112px,auto); align-items: center; gap: 12px; min-height: 60px; padding: 8px 0; border: 0; }
html body .web-setting-row::before{ content: ""; width: 40px; height: 40px; border-radius: var(--nw-r-lg); background: var(--nn-tile) ; }
html body .web-setting-row::after{ content: ""; position: absolute; left: 14px; width: 20px; height: 20px; background: var(--primary-color); -webkit-mask: var(--nn-i, var(--i-tool)) center / contain no-repeat; mask: var(--nn-i, var(--i-tool)) center / contain no-repeat; }
html body .web-setting-row{ position: relative; padding-inline-start: 4px; }
html[dir=rtl] body .web-setting-row::after{ left: auto; right: 14px; }
html body .web-setting-row > span strong{ font: 500 15px/1.4 var(--nw-font); color: var(--nw-text); }
html body .web-setting-row > span small{ display: block; margin-top: 2px; font-size: 13px; line-height: 1.45; color: var(--nw-text-3); }
html body .web-setting-row :is(select,input[type=number]){ min-height: 44px; padding-block: 8px; border: 0; border-radius: var(--nn-r-field); background-color: var(--nn-field); font-size: 15px; }
html body .web-setting-row[for=web-theme-mode]{ --nn-i: var(--i-mode); }
html body .web-setting-row[for=web-list-density]{ --nn-i: var(--i-list); }
html body .web-setting-row[for=web-reading-line-height]{ --nn-i: var(--i-lines); }
html body .web-setting-row[for=web-setting-font-size]{ --nn-i: var(--i-text); }
html body .web-setting-row[for=web-setting-default-align]{ --nn-i: var(--i-align); }
html body .web-setting-row[for=web-setting-formatting-enabled]{ --nn-i: var(--i-tool); }
html body .web-setting-row[for=web-setting-preview-mode]{ --nn-i: var(--i-view); }
html body .web-setting-row[for=web-setting-folder-path]{ --nn-i: var(--i-folder); }
html body .web-setting-row[for=web-setting-note-view]{ --nn-i: var(--i-grid); }
html body .web-setting-row[for=web-setting-folder-sort]{ --nn-i: var(--i-swap); }
html body .web-setting-row:is([for=web-theme-mode],[for=web-list-density],[for=web-reading-line-height]) > select{ grid-column: 3; }
html body .web-setting-row:is([for=web-theme-mode],[for=web-list-density],[for=web-reading-line-height]){ font: 500 15px/1.4 var(--nw-font); color: var(--nw-text); }
html body .web-setting-row.switch-setting input[type=checkbox]{ justify-self: end; }
html body .web-settings-links button{ position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 4px; border: 0; border-radius: var(--nw-r-md); background: transparent; color: var(--nw-text); font: 500 15px/1.4 var(--nw-font); }
html body .web-settings-links button .material-symbols-outlined{ box-sizing: border-box; flex: none; width: 40px; height: 40px; padding: 10px; border-radius: var(--nw-r-lg); background: var(--nn-tile); color: var(--primary-color); }

/* Accent swatches share one sliding frame */
html body .calm-swatches button{ position: relative; border: 0; border-radius: var(--nn-r-field); background: var(--nn-field); min-height: 48px; }
html body .calm-swatches.nn-slide-ready button:is(.active,[aria-pressed=true],[aria-checked=true]){ background: transparent; box-shadow: none; border: 0; }
html body .nn-slide--ring{ border-radius: var(--nn-r-field); background: var(--primary-soft); box-shadow: inset 0 0 0 1.5px var(--primary-color); }

/* Customizer rows and handles */
html body .web-toolbar-customizer{ border: 0; border-radius: var(--nw-r-lg); background: var(--nw-surface-2); }
html body .web-toolbar-customizer summary{ min-height: 52px; padding: 0 14px; border-radius: var(--nw-r-lg); font-weight: 500; position: relative; }
html body .toolbar-customizer-row{ min-height: 52px; padding: 4px 8px 4px 4px; border: 0; border-radius: var(--nn-r-field); background: var(--nn-card); box-shadow: var(--nn-shadow-sm); gap: 4px; margin-bottom: 6px; }
html body .toolbar-customizer-drag-handle{ position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: var(--nw-text-3); cursor: grab; touch-action: none; }
html body .toolbar-customizer-drag-handle:active{ cursor: grabbing; }
html body .toolbar-customizer-control{ position: relative; width: 36px; height: 36px; min-width: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--nw-text-3); }
html body .toolbar-customizer-control[aria-pressed=true]{ background: var(--primary-soft); color: var(--primary-color); }

/* Round close buttons everywhere */
html body :is(.preview-close,.nas-close,.trash-close){ position: relative; width: 40px; height: 40px; min-width: 40px; min-height: 40px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--nw-text-2); box-shadow: none; }
html body .preview-download{ position: relative; min-height: 40px; border: 0; border-radius: 20px; background: var(--nn-seg); color: var(--nw-text); box-shadow: none; }
html body .preview-zoom button{ position: relative; border: 0; border-radius: 50%; background: var(--nn-seg); }

/* Note details: section heads carry the app's own quiet rhythm */
html body .detail-color-row{ align-items: center; gap: 8px; }
html body .detail-color-input{ height: 48px; min-height: 48px; padding: 0 !important; border-radius: 50% !important; overflow: hidden; background: transparent !important; }
html body .detail-color-input::-webkit-color-swatch-wrapper{ padding: 0; }
html body .detail-color-input::-webkit-color-swatch{ border: 1px solid var(--nw-line-strong); border-radius: 50%; }
html body .detail-color-input::-moz-color-swatch{ border: 1px solid var(--nw-line-strong); border-radius: 50%; }
html body .detail-color-clear{ position: relative; min-height: 44px; padding: 0 14px; border: 0; border-radius: var(--nw-r-md); background: var(--nn-seg); color: var(--nw-text-2); }
html body .detail-sidecard{ border: 0; border-radius: var(--nw-r-lg); background: var(--nw-surface-2); box-shadow: none; }
html body .related-details{ border: 0; border-radius: var(--nw-r-lg); background: var(--nw-surface-2); }
html body .related-details summary{ position: relative; min-height: 48px; padding: 12px 14px; border-radius: var(--nw-r-lg); }

/* Language menu marks the current language */
html body .dropdown-action{ display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border: 0; background: transparent; color: var(--nw-text); font: 400 15px/1.3 var(--nw-font); }
html body .dropdown-action.active{ background: transparent; color: var(--primary-color); font-weight: 600; }
html body .dropdown-action.active::after{ content: ""; width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--i-check) center / contain no-repeat; mask: var(--i-check) center / contain no-repeat; }

/* Sheets for native dialogs on phones */
@media (max-width: 760px){
  html body #attachment-edit-dialog{ inset: auto 0 var(--nn-kb, 0px) 0; margin: 0; width: 100%; max-width: 100%; }
  html body #attachment-preview-dialog{ inset: 0; width: 100%; max-width: 100%; height: var(--nn-vvh, 100dvh); max-height: none; margin: 0; border-radius: 0; box-shadow: none; }
  html body #resource-sheet{ inset: auto 0 0 0; margin: 0; }
  html body .web-setting-row{ grid-template-columns: 40px minmax(0,1fr) auto; }
  html body .web-setting-row > :is(select,input[type=number]){ max-width: 148px; }
}

/* Dialog headers sit on the same surface as their sheet */
html body :is(.detail-dialog-header,.web-settings-header,.web-settings-footer,.renewal-dialog-heading,.link-editor-header,.link-editor-footer){ background: var(--nn-card); box-shadow: none; }
html body :is(.detail-dialog-content,.web-settings-dialog,.backup-dialog,.link-editor-dialog){ background: var(--nn-card); }
html body :is(.detail-dialog-header,.web-settings-header){ border-bottom: 0; }
/* Graph labels use the same switch as the settings */
html body .nw-panel__foot input[type=checkbox]{ -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 40px; height: 24px; margin: 0; border-radius: 12px; background: var(--nw-line-strong); cursor: pointer; transition: background-color var(--nn-mid) var(--nn-ease); }
html body .nw-panel__foot input[type=checkbox]::before{ content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(23,28,38,.24); transition: translate var(--nn-mid) var(--nn-ease); }
html body .nw-panel__foot input[type=checkbox]:checked{ background: var(--primary-color); }
html body .nw-panel__foot input[type=checkbox]:checked::before{ translate: 16px 0; }
html[dir=rtl] body .nw-panel__foot input[type=checkbox]:checked::before{ translate: -16px 0; }

/* The graph sheet steps aside while typing, so it never covers the field in use */
@media (max-width: 760px){
  html.nn-kb body .nw-panel{ display: none; }
}

/* Keyboard open: the empty tab row gives its height back, and a form-like editor scrolls instead of squeezing */
@media (max-width: 760px){
  html.nn-kb body #app-container.mode-mobile{ grid-template-rows: auto minmax(0,1fr) 0px; }
  html.nn-kb:not(.nn-kb-write) body #editor-content{ overflow-y: auto; }
  html.nn-kb:not(.nn-kb-write) body #editor-content > *{ flex-shrink: 0; }
  html.nn-kb:not(.nn-kb-write) body #markdown-workspace{ min-height: 160px; }
}

/* Only the scrim fades. The sheet itself stays solid while it moves, so nothing shows through it. */
html body .dialog-overlay{ background: transparent; opacity: 1; transition: visibility 0s linear 0s; }
html body .dialog-overlay::before{ content: ""; position: absolute; inset: 0; background: var(--nw-scrim); opacity: 1; transition: opacity var(--nn-mid) var(--nn-ease); }
html body .dialog-overlay > .dialog-content{ position: relative; z-index: 1; }
html body .dialog-overlay.hidden{ opacity: 1; transition: visibility 0s linear 220ms; }
html body .dialog-overlay.hidden::before{ opacity: 0; transition: opacity 180ms var(--nn-ease-out); }
html body .dialog-overlay.hidden > .dialog-content{ transition: transform 200ms var(--nn-ease-out), opacity 160ms var(--nn-ease-out); }
@media (max-width: 760px){
  html body .dialog-overlay > .dialog-content{ opacity: 1; }
  html body .dialog-overlay.hidden > .dialog-content{ opacity: 1; transition: transform 220ms var(--nn-ease-out); }
}
/* A finger leaves :hover stuck on touch screens */
@media (hover: none){
  html body .icon-button:not([aria-pressed=true]):not([aria-expanded=true]):hover{ background: transparent; color: var(--nw-text-2); }
  html body .icon-button.danger:hover{ background: transparent; color: var(--nw-text-2); }
  html body :is(.start-source-button,.start-new,.workspace-nav-item,.folder-content,.sidebar-utility,.markdown-view-button):hover{ box-shadow: none; }
  html body #note-list:not([data-view-type=GRID]):not([data-view-type=LARGE_GRID]) .note-item:hover:not(.selected){ background: transparent; }
  html body .start-source-button:hover{ background: transparent; }
}

html body .note-tools-panel{ background: var(--nn-card); box-shadow: var(--nn-shadow-md); }

/* 13. Short screens: every control keeps its height, the writing area gives way ------------- */
@media (max-width: 760px){
  html body #editor-content > :not(#markdown-workspace){ flex-shrink: 0; }
  html body #editor-content{ overflow-y: auto; }
  html body #markdown-workspace{ min-height: 140px; }
  html body .markdown-view-switch{ flex: none; overflow: visible; }
}
@media (max-width: 760px) and (max-height: 700px){
  html body .editor-command-bar{ min-height: 44px; }
  html body #editor-toolbar{ padding-block: 4px; }
  html body #note-title-input{ font-size: 20px; min-height: 36px; }
  html body #editor-note-meta{ min-height: 24px; padding-block: 0; }
  html body .markdown-view-switch{ margin-top: 2px; }
  html body .mobile-tab-button{ min-height: 48px; }
  html body #mobile-tab-bar{ --nw-tabbar-h: 56px; height: calc(56px + env(safe-area-inset-bottom, 0px)); }
  html body #app-container.mode-mobile{ grid-template-rows: auto minmax(0,1fr) auto; }
  html body .mobile-tab-button .material-symbols-outlined{ height: 28px; padding-block: 2px; }
  html body #editor-footer{ min-height: 24px; }
}

/* 14. Backup center: one surface per provider, filled buttons, drawn arrows ------------------- */
html body .bc-provider-grid > .bc-provider, html body .bc-provider-grid > .bc-zip{ border: 0; border-radius: var(--nw-r-xl); background: var(--nw-surface-2); box-shadow: none; }
html body .bc-provider-icon{ border: 0; border-radius: var(--nw-r-lg); background: var(--nn-tile); color: var(--primary-color); }
html body .bc-provider-title h3{ font: 600 16px/1.4 var(--nw-font); letter-spacing: -.01em; }
html body .bc-provider-caption, html body .bc-kicker{ text-transform: none; letter-spacing: 0; font-size: 13px; }
html body .bc-provider-description, html body .bc-provider-note, html body .bc-shell > .dialog-intro{ font-size: 13px; line-height: 1.55; }
html body .bc-provider-description{ min-height: 0; margin-block: 12px; }
html body .bc-action{ position: relative; min-height: 48px; border: 0; border-radius: var(--nw-r-lg); background: var(--nn-seg); color: var(--nw-text); font: 600 14px/1 var(--nw-font); box-shadow: none; }
html body.theme-light .bc-action:not(.export){ background: var(--nn-card); }
html body .bc-action.export{ background: var(--primary-color); color: var(--on-primary); }
html body .bc-action:not(:disabled):hover{ box-shadow: none; }
html body .bc-action-icon{ width: 16px; height: 16px; font-size: 0; line-height: 0; background: currentColor; -webkit-mask: var(--i-down) center / contain no-repeat; mask: var(--i-down) center / contain no-repeat; }
html body .bc-action.export .bc-action-icon{ -webkit-mask-image: var(--i-up); mask-image: var(--i-up); }
html body{
  --i-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M6 13l6 6 6-6'/%3E%3C/svg%3E");
  --i-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5M6 11l6-6 6 6'/%3E%3C/svg%3E");
}
html body .bc-recovery, html body .bc-auto{ border: 0; border-radius: var(--nw-r-lg); background: var(--nw-surface-2); }
html body .bc-recovery summary, html body .bc-auto summary{ position: relative; min-height: 48px; padding: 12px 14px; border-radius: var(--nw-r-lg); }
html body #backup-modal .bc-shell{ background: var(--nn-card); border: 0; }
html body .backup-local-callout{ border: 0; background: var(--nw-surface-2); }

/* 15. Trash: centered on large screens again, a sheet on phones like every other dialog -------- */
html body dialog.trash-dialog{ transform: translateY(calc(-50% + 12px)) scale(.98); }
html body dialog.trash-dialog[open]{ transform: translateY(-50%); }
@starting-style{ html body dialog.trash-dialog[open]{ opacity: 0; transform: translateY(calc(-50% + 16px)) scale(.98); } }
@media (max-width: 760px){
  html body dialog.trash-dialog{ inset: auto 0 var(--nn-kb, 0px) 0; margin: 0; width: 100%; max-width: 100%; max-height: calc(var(--nn-vvh, 100dvh) - 24px); transform: translateY(100%); }
  html body dialog.trash-dialog[open]{ transform: none; }
  @starting-style{ html body dialog.trash-dialog[open]{ opacity: 1; transform: translateY(100%); } }
  html body .trash-footer{ padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}
html body .trash-search-shell{ border: 0; border-radius: var(--nw-r-lg); background: var(--nw-surface-2); box-shadow: none; }
html body .trash-restore, html body .trash-more, html body .trash-retry{ position: relative; border: 0; border-radius: var(--nw-r-md); background: var(--nn-seg); color: var(--nw-text); }

/* Every size: toolbars keep their full height, even when they wrap to two rows */
html body #editor-content > :not(#markdown-workspace){ flex-shrink: 0; }
html body #editor-content{ overflow-y: auto; }
@media (max-height: 760px){ html body #markdown-workspace{ min-height: 140px; } }
/* Dialog header and footer share the sheet's own surface */
html body #web-settings-modal :is(.web-settings-header,.web-settings-footer){ background: var(--nn-card); }

/* Very little room above the keyboard: writing keeps the space, the note's command row returns on blur */
@media (max-width: 760px){
  html.nn-kb-tight.nn-kb-write body .editor-command-bar{ display: none; }
  html.nn-kb-tight body .dialog-buttons{ position: static; }
}

/* Round 3: one sidebar highlight, warnings when they apply, rebuilt rows never blink */
html body #note-list .note-item.selected.nn-fade-from:not(#_):not(#_):not(#_){ background-color:color-mix(in srgb,var(--nw-surface-2) 0%,transparent) !important; transition:none !important; }
html body #note-list .note-item.selected:not(#_){ transition:background-color 200ms cubic-bezier(.2,.8,.2,1); }
html body #left-panel[data-nn-in-folder] .workspace-nav-item.active[data-workspace-view=all]:not(#_):not(#_){ font-weight:500; color:var(--nw-text-2); }
html body #left-panel:not([data-nn-in-folder]) .folder-item[data-folder-id=default]>.folder-content:not(#_):not(#_){ font-weight:500; color:var(--nw-text-2); }
html body .nas-privacy:not(:has(#nas-remember-password:checked)) .nas-help:not(#_):not(#_){ position:absolute; width:1px; height:1px; margin:0; overflow:hidden; clip-path:inset(50%); }
html body #note-details-panel:not(:has(:is(#lock-note-button,#note-dday-button,#note-habit-button)[aria-pressed=true]))>.detail-sidecard:not(#_){ position:absolute; width:1px; height:1px; margin:0; padding:0; overflow:hidden; clip-path:inset(50%); }

/* 14. Full review pass, shared with ClipboardNote. :not(#_) only lifts specificity over bundle rules that carry ids. */
html body{ --cn-pad:24px; --cn-vh:var(--nn-vvh,100dvh); --cn-field:var(--nw-surface-2); --cn-field-focus:var(--nw-bg); --cn-fast:var(--nn-fast); --cn-mid:var(--nn-mid); --cn-ease:var(--nn-ease);
  --cn-tint-0:rgba(23,28,38,0); --cn-tint-1:rgba(23,28,38,.05); --cn-tint-2:rgba(23,28,38,.09); --nw-line-strong:var(--nw-line-strong); --cn-card:var(--nn-card);
  --cn-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f6672' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
html body.theme-light{ --cn-sheet:#fff; }
html body.theme-dark{ --cn-sheet:#1b1e24; --cn-field:#272a31; --cn-field-focus:#16181d; --cn-tint-0:rgba(255,255,255,0); --cn-tint-1:rgba(255,255,255,.06); --cn-tint-2:rgba(255,255,255,.11);
  --cn-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa1ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
@media (max-width:760px){ html body{ --cn-pad:20px; } }
/* 12. Full review pass. :not(#_) only lifts specificity over bundle rules that carry ids. */
html body.theme-light{ --cn-sheet:#fff; }
html body.theme-dark{ --cn-sheet:#1f1f25; --cn-field:#2c2c35; --cn-field-focus:#17171c; }

/* selects, inputs, checkboxes: one control */
html body select:not(#note-sort-select):not(#_):not(#_){ appearance:none; -webkit-appearance:none; padding-inline:14px 36px; background-image:var(--cn-chevron); background-repeat:no-repeat; background-position:right 10px center; background-size:18px; }
html[dir=rtl] body select:not(#note-sort-select):not(#_):not(#_){ background-position:left 10px center; }
html body :is(.detail-input,.dialog-input,.dialog-content select,.dialog-content input:not([type=checkbox]):not([type=color]):not([type=radio]),dialog input:not([type=checkbox]):not([type=color]):not([type=radio]),dialog select,.nas-field input,.nas-field select):not(#_){ font:500 15px/1.3 var(--nw-font); color:var(--nw-text); }
@media (max-width:760px){ html body :is(.detail-input,.dialog-input,.dialog-content select,.dialog-content input:not([type=checkbox]):not([type=color]):not([type=radio]),dialog input:not([type=checkbox]):not([type=color]):not([type=radio]),dialog select,.nas-field input,.nas-field select):not(#_){ font-size:16px; } }
html body input::-webkit-calendar-picker-indicator{ opacity:.55; }
html body.theme-dark input::-webkit-calendar-picker-indicator{ filter:invert(1); }
html body :is(.dialog-content,.nas-settings-form) input:is([type=date],[type=time]){ min-width:0; width:100%; }
html body input[type=checkbox]:not(.switch-input):not(.switch-setting input):not(.sync-toggle-row input):not(.nw-panel input){ appearance:none; -webkit-appearance:none; flex:0 0 auto; width:22px; height:22px; margin:0; border:0; border-radius:7px; background:var(--cn-field); box-shadow:inset 0 0 0 1.5px var(--nw-line-strong); position:relative; cursor:pointer; transition:background-color var(--cn-fast) var(--cn-ease),box-shadow var(--cn-fast) var(--cn-ease); }
html body input[type=checkbox]:not(.switch-input):not(.switch-setting input):not(.sync-toggle-row input):not(.nw-panel input):checked{ background:var(--primary-color); box-shadow:none; }
html body input[type=checkbox]:not(.switch-input):not(.switch-setting input):not(.sync-toggle-row input):not(.nw-panel input)::after{ content:""; position:absolute; inset:3px; background:var(--on-primary); opacity:0; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 13 4 4L19 7'/%3E%3C/svg%3E") center/contain no-repeat; transition:opacity var(--cn-fast) var(--cn-ease); }
html body input[type=checkbox]:not(.switch-input):not(.switch-setting input):not(.sync-toggle-row input):not(.nw-panel input):checked::after{ opacity:1; }
/* note colour: one round chip */
html body .detail-color-row{ display:flex; align-items:center; gap:8px; min-height:48px; padding:0 12px; border-radius:12px; background:var(--cn-field); }
html body .detail-color-row>.detail-color-input:not(#_){ appearance:none; -webkit-appearance:none; flex:0 0 auto; width:28px; min-width:28px; height:28px; min-height:28px; padding:0; border:0; border-radius:50%; background:none; box-shadow:none; overflow:hidden; }
html body .detail-color-input::-webkit-color-swatch-wrapper{ padding:0; }
html body .detail-color-input::-webkit-color-swatch{ border:0; border-radius:50%; }
html body .detail-color-input::-moz-color-swatch{ border:0; border-radius:50%; }
html body .detail-color-clear{ border:0; padding:0 8px; min-height:32px; border-radius:999px; background-color:var(--cn-tint-1); color:var(--nw-text-2); font:500 13px/1 var(--nw-font); }
/* disclosure rows use the same chevron */
html body details>summary{ list-style:none; cursor:pointer; }
html body details>summary::-webkit-details-marker{ display:none; }
html body :is(.nas-advanced,.nas-settings-form details)>summary{ display:flex; align-items:center; justify-content:space-between; min-height:44px; color:var(--nw-text-2); font:500 14px/1.3 var(--nw-font); border-radius:10px; }
html body :is(.nas-advanced,.nas-settings-form details)>summary::after{ content:""; flex:0 0 18px; height:18px; background:var(--cn-chevron) center/contain no-repeat; transition:transform var(--cn-mid) var(--cn-ease); }
html body :is(.nas-advanced,.nas-settings-form details)[open]>summary::after{ transform:rotate(180deg); }

/* every sheet: same head, same foot, nothing shows behind them */
html body .dialog-content,html body dialog.attachment-dialog,html body dialog.trash-dialog,html body dialog.resource-sheet{ background:var(--cn-sheet); }
html body .nw-sample-bar{ z-index:60; }
html body .dialog-content:is(.detail-dialog-content,.web-settings-dialog,.drawer-content):not(#_){ padding-block:0; padding-inline:var(--cn-pad); max-height:calc(var(--cn-vh) - 48px); }
html body :is(.detail-dialog-header,.web-settings-header,.drawer-header):not(#_){ position:sticky; top:0; z-index:3; display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0 calc(var(--cn-pad) * -1) 8px; padding:20px var(--cn-pad) 12px; min-height:0; background:var(--cn-sheet); border:0; }
html body :is(.detail-dialog-header,.web-settings-header,.drawer-header) :is(h2,h3){ margin:0; font:700 20px/1.4 var(--nw-font); }
html body .web-settings-footer:not(#_){ position:sticky; bottom:0; z-index:3; display:flex; gap:8px; margin:24px calc(var(--cn-pad) * -1) 0; padding:12px var(--cn-pad) calc(16px + env(safe-area-inset-bottom,0px)); background:var(--cn-sheet); border:0; }
html body .web-settings-footer .dialog-button{ flex:1 1 0; }
html body .detail-dialog-content>:last-child{ padding-bottom:calc(20px + env(safe-area-inset-bottom,0px)); }
html body .nas-editor-header:not(#_){ align-items:center; gap:12px; border:0; }
html body .nas-editor-header h2{ margin:0; }
html body :is(.nas-close,.trash-close,.preview-close,#close-note-details-button,[data-close-web-settings].icon-button,.link-editor-close,.shortcuts-dialog .icon-button):not(#_){ flex:0 0 auto; width:40px; height:40px; min-width:40px; padding:0; display:inline-flex; align-items:center; justify-content:center; border:0; border-radius:999px; background-color:var(--cn-tint-0); color:var(--nw-text-3); font-size:24px; line-height:1; box-shadow:0 0 0 0 var(--cn-tint-0); transition:background-color var(--cn-fast) var(--cn-ease),box-shadow var(--cn-mid) var(--cn-ease),transform var(--cn-fast) var(--cn-ease); }
html body :is(.nas-close,.trash-close,.preview-close,#close-note-details-button,[data-close-web-settings].icon-button,.link-editor-close,.shortcuts-dialog .icon-button):not(#_):is(:active,.is-pressed){ background-color:var(--cn-tint-2); box-shadow:0 0 0 4px var(--cn-tint-1); transform:scale(.92); }
html body :is(.nas-close,.trash-close,.preview-close,#close-note-details-button,[data-close-web-settings].icon-button,.shortcuts-dialog .icon-button):not(#_):focus-visible{ outline:2px solid var(--primary-color); outline-offset:0; }
html body .dialog-buttons:not(#_){ display:flex; align-items:stretch; gap:8px; }
html body .dialog-buttons .dialog-button:not(#_){ flex:1 1 0; height:52px; min-height:52px; margin:0; border:0; }
@media (min-width:761px){
  html body .dialog-buttons .dialog-button:not(#_),html body .web-settings-footer .dialog-button:not(#_){ flex:0 0 auto; height:44px; min-height:44px; min-width:88px; }
  html body .dialog-buttons:not(#_),html body .web-settings-footer:not(#_){ justify-content:flex-end; }
  html body .dialog-overlay:not(#_){ padding:24px; }
  html body .dialog-content:not(.drawer-content):not(#_){ max-height:calc(var(--cn-vh) - 48px); }
}
html body :is(.dialog-symbol,.dialog-emblem){ width:44px; height:44px; margin-bottom:12px; }
/* details grid: two even columns, no orphan */
html body .detail-grid:not(#_){ display:grid; grid-template-columns:1fr 1fr; gap:16px 12px; }
html body .detail-grid>*:not(#_){ grid-column:auto; min-width:0; }
html body .detail-grid>:is(:has(#editor-folder-select),.detail-field-wide):not(#_){ grid-column:1/-1; }
html body .detail-sidecard:not(#_){ padding:16px 0 0; border:0; border-radius:0; background:transparent; }
html body .detail-sidecars{ margin-top:16px; }
html body .detail-toggle-button:not(#_){ justify-content:flex-start; padding:0 14px; gap:8px; font:500 15px/1 var(--nw-font); color:var(--nw-text); }
html body .detail-dialog-content{ width:min(100%,560px); }

/* needless text stays for screen readers only */
html body :is(.nas-editor-body>p.nas-help:first-child,#new-folder-modal .dialog-intro,#new-folder-modal .dialog-content>p,#shortcuts-modal .dialog-content>p,#sync-center-modal .dialog-intro,.drawer-footnote,#web-history-scope-hint,.web-toolbar-customizer>p,.resource-section-label):not(#_){ position:absolute; width:1px; height:1px; margin:0; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }

/* one gutter on the phone: text on 16px, fills inset on 8px */
@media (max-width:760px){
  html body #note-browser-panel:not(#_){ border-right:0; }
  html body .note-panel-section .panel-header:not(#_){ padding-inline:16px; }
  html body .note-search-shell:not(#_){ margin-inline:16px; }
  html body .note-summary-row:not(#_){ padding-inline:16px; }
  html body #note-list:not([data-view-type=GRID]):not([data-view-type=LARGE_GRID]) .note-item:not(#_){ padding-inline:8px; }
  html body .editor-heading:not(#_),html body .editor-note-meta:not(#_){ margin-inline:16px; padding-inline:0; }
  html body .editor-heading:not(#_){ padding-block:12px 4px; min-height:0; }
  html body #note-content-textarea:not(#_),html body .markdown-preview:not(#_){ padding-inline:16px; }
  html body .formatting-toolbar:not(#_){ margin-inline:16px; }
  html body .resource-header:not(#_){ padding-inline:8px; }
  html body .editor-statusbar:not(#_){ padding-inline:16px; }
  html body .app-header:not(#_){ padding-inline:8px; }
  html body .app-brand:not(#_){ margin-inline-start:8px; }
  html body dialog:is(.trash-dialog,.attachment-dialog):not(#_){ inset:auto 0 var(--cn-bottom,0px) 0; transform:none; margin:0; width:100%; max-width:none; max-height:calc(var(--cn-vh) - 32px); border-radius:24px 24px 0 0; }
}
/* writing surfaces show the caret, not a ring */
html body :is(#note-content-textarea,#note-title-input):focus-visible{ outline:none; box-shadow:none; }
html body #note-content-textarea{ word-break:keep-all; overflow-wrap:anywhere; }
html body #note-search-input:focus-visible{ outline:none; box-shadow:none; }
html body .note-search-shell:focus-within:not(#_){ box-shadow:inset 0 0 0 1.5px var(--primary-color); outline:none; }

/* editor head */
html body .editor-note-meta:not(#_){ display:flex; flex-wrap:wrap; align-items:center; gap:4px 12px; padding-block:0; min-height:24px; }
html body .editor-chip:not(#_)::before,html body .editor-chip:not(#_)::after{ content:none; }
html body #pin-note-button:not(#_)::after,html body #pin-note-button:not(#_)::before{ content:none; }
html body #pin-note-button:not(#_){ width:38px; min-width:38px; padding:0; }
html body .save-note-button:not(#_){ min-height:38px; }
/* tags: one chip everywhere */
html body .note-tag:not(#_){ padding:1px 6px; border:0; border-radius:6px; background:var(--cn-field); color:var(--nw-text-2); font-size:12px; line-height:1.5; white-space:nowrap; }
html body .note-item.selected .note-tag:not(#_){ background:var(--cn-sheet); color:var(--primary-color); }
html body :is(.note-tag-chip):not(#_){ display:inline-flex; align-items:center; gap:4px; min-height:36px; padding:0 12px; border:0; border-radius:999px; background:var(--cn-field); color:var(--nw-text-2); font:500 13px/1 var(--nw-font); transition:background-color var(--cn-fast) var(--cn-ease),color var(--cn-fast) var(--cn-ease),transform var(--cn-fast) var(--cn-ease); }
html body .note-tag-chip[aria-pressed=true]:not(#_){ background:var(--primary-soft); color:var(--primary-color); font-weight:600; }
html body .note-tag-chip:is(:active,.is-pressed){ transform:scale(.97); }
html body .note-tools-panel:not(#_){ inset-inline:16px; padding:16px; }
/* single-choice file filter is a segment */
html body #attachment-filter-group:not(#_){ position:relative; display:flex; gap:0; padding:4px; border-radius:12px; background:var(--cn-field); }
html body #attachment-filter-group .note-tool-chip:not(#_){ flex:1 1 0; justify-content:center; min-height:32px; border-radius:9px; background:transparent; color:var(--nw-text-3); transition:color var(--cn-fast) var(--cn-ease),transform var(--cn-fast) var(--cn-ease); }
html body #attachment-filter-group .note-tool-chip.active:not(#_){ color:var(--nw-text); font-weight:600; }
/* sidebar */
html body #folder-list-container.cn-has-slide .folder-item.selected>.folder-content:not(#_){ background-color:var(--cn-tint-0); box-shadow:none; border-color:transparent; }
html body .folder-content:not(#_){ box-shadow:none; }
html body .trash-entry:not(#_){ margin-top:4px; padding:0 12px; gap:10px; min-height:40px; border-radius:10px; font:500 14px/1.4 var(--nw-font); color:var(--nw-text-2); }
html body .trash-entry svg{ width:18px; height:18px; color:var(--nw-text-3); }
html body .trash-entry[aria-expanded=true]:not(#_){ background-color:var(--cn-tint-1); color:var(--nw-text); }
html body .sidebar-backup-button:not(#_){ min-height:44px; border:0; border-radius:12px; background-color:var(--cn-tint-1); color:var(--nw-text); }
html body .sidebar-file-actions{ display:flex; gap:8px; }
html body .sidebar-file-button:not(#_){ flex:1 1 0; justify-content:center; min-height:40px; border:0; border-radius:10px; color:var(--nw-text-2); font:500 13px/1 var(--nw-font); }
@media (min-width:761px){ html body #left-panel :is(.note-filter-chip,.folder-content,.trash-entry):not(#_){ min-height:36px; } }
/* settings: value controls line up, rows are rows */
html body .web-setting-row :is(select,input[type=number]):not(#_){ flex:0 0 136px; width:136px; min-width:136px; max-width:136px; min-height:44px; }
html body .web-setting-row input[type=number]:not(#_){ padding-inline:14px; }
html body .web-setting-row:not(#_){ min-height:60px; padding:8px 0; border:0; }
html body .web-settings-grid:not(#_){ display:flex; flex-direction:column; gap:24px; }
html body .web-settings-section:not(#_){ display:block; }
html body .web-settings-section>h3:not(#_){ margin:0 0 4px; }
html body .web-settings-links:not(#_){ display:block; }
html body .web-settings-links>button:not(#_){ display:flex; align-items:center; justify-content:flex-start; gap:12px; width:calc(100% + 16px); min-height:52px; margin-inline:-8px; padding:0 8px; border:0; border-radius:12px; color:var(--nw-text); font:500 15px/1.3 var(--nw-font); text-align:start; }
html body .web-settings-links>button:not(#_)::after{ content:""; margin-inline-start:auto; flex:0 0 18px; height:18px; background:var(--cn-chevron) center/contain no-repeat; transform:rotate(-90deg); }
html[dir=rtl] body .web-settings-links>button:not(#_)::after{ transform:rotate(90deg); }
html body .web-settings-links>button .material-symbols-outlined{ color:var(--nw-text-3); }
html body .web-toolbar-customizer:not(#_){ margin-top:8px; border:0; border-radius:0; background:transparent; }
html body .web-toolbar-customizer>summary:not(#_){ min-height:60px; padding:0; border-radius:10px; color:var(--nw-text); font:500 15px/1.4 var(--nw-font); }
html body .web-toolbar-customizer>:not(summary):not(#_){ margin-inline:0; }
html body .toolbar-customizer-row:not(#_){ min-height:48px; padding:0; border:0; border-radius:10px; background:transparent; }
html body .toolbar-customizer-list:not(#_){ gap:0; }
html body .toolbar-customizer-label:not(#_){ font:500 14px/1.3 var(--nw-font); color:var(--nw-text); }
html body .toolbar-customizer-control:not(#_){ border:0; border-radius:999px; background-color:var(--cn-tint-0); transition:background-color var(--cn-fast) var(--cn-ease),transform var(--cn-fast) var(--cn-ease); }
html body .toolbar-customizer-control:disabled:not(#_){ opacity:.4; }
html body .toolbar-customizer-control[aria-pressed=true]:not(#_){ background-color:var(--primary-soft); color:var(--primary-color); }
html body .toolbar-customizer-control:is(:active,.is-pressed):not(:disabled):not(#_){ background-color:var(--cn-tint-2); transform:scale(.92); }
html body .toolbar-customizer-drag-handle .material-symbols-outlined:not(#_){ opacity:1; color:var(--nw-text-3); }
html body .toolbar-customizer-reset:not(#_){ min-height:44px; margin-block:12px 0; }
/* NAS sheet */
html body .nas-section:not(#_){ margin:0 0 20px; padding:0; border:0; }
html body .nas-section legend:not(#_){ padding:0; margin-bottom:12px; font:600 14px/1.4 var(--nw-font); color:var(--nw-text-3); }
html body .nas-field>span:not(#_){ font:500 13px/1.5 var(--nw-font); color:var(--nw-text-3); }
html body .nas-privacy:not(#_){ display:block; margin:8px 0 0; padding:14px; border:0; border-radius:14px; background:var(--cn-field); color:var(--nw-text-3); font-size:13px; line-height:1.55; }
html body .nas-remember:not(#_){ display:flex; align-items:center; gap:12px; min-height:44px; padding:0; border:0; background:transparent; color:var(--nw-text); font:500 14px/1.4 var(--nw-font); }
html body .nas-privacy>*:not(#_){ white-space:normal; writing-mode:horizontal-tb; }
html body .nas-url-preview:not(#_),html body .nas-settings-form blockquote:not(#_){ border:0; padding:0; }
html body .nas-remember>span:not(#_){ background:transparent; }
html body .nas-editor-footer:not(#_){ margin:0; border:0; background:var(--cn-sheet); }
html body .nas-settings-form:not(#_){ background:var(--cn-sheet); border:0; }
html body .nas-editor-body:not(#_){ background:transparent; }
/* landing and bars */
html body .landing-header-right .language-pill:not(#_){ height:36px; padding:0 14px; }
html body .landing-header-right .icon-button:not(#_){ width:40px; height:40px; min-width:40px; }
html body .web-badge:not(#_){ border:0; padding:3px 7px; border-radius:6px; background:var(--cn-tint-1); }
html body .landing-footer:not(#_){ display:flex; flex-wrap:wrap; align-items:center; gap:0 16px; margin-top:24px; }
html body .landing-footer .text-button,html body .landing-footer .nw-about-link{ min-height:40px; font:500 13px/1.4 var(--nw-font); }
html body .ys-web__in:not(#_),html body .ys-studio__in:not(#_){ gap:0 16px; padding:0; }
html body .ys-web :is(a,[aria-current=page]):not(#_),html body .ys-studio a:not(#_){ min-height:36px; }
html body .nw-sample-bar__exit:not(#_){ text-decoration:none; }
/* primaries always read */
html body :is(.compose-button,.sidebar-new-note,.dialog-button.primary,#empty-create-note-button,#nas-settings-save-button,.bc-action.export):not(:disabled):not(#_){ color:var(--on-primary); }
html body :is(.compose-button,.sidebar-new-note) kbd:not(#_){ color:inherit; background:transparent; border-color:currentColor; opacity:.7; }
/* language menu: current choice carries a check */
html body .dropdown-action:not(#_){ display:flex; align-items:center; justify-content:space-between; gap:8px; }
html body .dropdown-action.active:not(#_)::after{ content:""; flex:0 0 18px; height:18px; background:currentColor; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 13 4 4L19 7'/%3E%3C/svg%3E") center/contain no-repeat; }
html body :is(#language-dropdown,#landing-language-menu):not(#_){ margin-top:8px; max-height:min(420px,calc(var(--cn-vh) - 120px)); overflow-y:auto; overscroll-behavior:contain; }
/* quick copy tray */
html body .nw-panel__head:not(#_){ padding:12px 16px; gap:8px; }
html body .nw-panel:not(#_){ background:var(--cn-sheet); }

/* sort: a quiet label over the real select, which keeps 16px so iOS does not zoom */
html body .note-sort-shell:not(#_){ position:relative; display:inline-flex; align-items:center; gap:6px; min-height:36px; margin-inline-start:auto; padding:0 8px; border-radius:10px; color:var(--nw-text-3); transition:background-color var(--cn-fast) var(--cn-ease); }
html body .note-sort-shell:is(:active,:focus-within){ background-color:var(--cn-tint-1); }
html body .cn-sort-label{ font:500 13px/1 var(--nw-font); white-space:nowrap; }
html body .note-sort-shell::after{ content:""; flex:0 0 14px; height:14px; background:var(--cn-chevron) center/contain no-repeat; }
html body .note-sort-shell.is-ready select:not(#_){ position:absolute; inset:0; width:100%; height:100%; opacity:0; font-size:16px; cursor:pointer; }
html body [data-link-text=eyebrow]:not(#_){ display:none; }
html body .note-summary-row:not(#_){ display:flex; align-items:center; justify-content:space-between; }
/* hover fills never touch text */
html body .web-toolbar-customizer>summary:not(#_){ margin-inline:-8px; padding-inline:8px; }
html body :is(.nas-advanced,.nas-settings-form details)>summary:not(#_){ margin-inline:-8px; padding-inline:8px; }
html body .nas-settings-form [id*=preview]:not(#_),html body .nas-settings-form [class*=preview]:not(#_){ border:0; padding-inline:0; }
html body .sidebar-file-button:not(#_){ white-space:nowrap; gap:6px; padding-inline:8px; font-size:12px; }
html body .empty-list-state :is(p,span):not(.material-symbols-outlined):not(#_){ font-size:14px; }
html body #pin-note-button:not(#_){ height:38px; min-height:38px; }
@media (max-width:760px){ html body #pin-note-button:not(#_){ width:40px; min-width:40px; height:40px; min-height:40px; } }
@media (min-width:761px){ html body #resources-toggle-button:not(#_){ width:36px; min-width:36px; height:36px; min-height:36px; padding:0; justify-content:center; } }

/* 13. Third review pass */
html body.theme-dark{ color-scheme:dark; }
html body.theme-light{ color-scheme:light; }
html body.theme-dark input::-webkit-calendar-picker-indicator{ filter:none; opacity:.8; }
/* scrollbars no longer reserve room, so inset fills stay symmetric */
/* one sheet shape on the phone */
@media (max-width:760px){
  html body :is(#nas-settings-modal,#link-editor-modal,#sync-center-modal,#shortcuts-modal):not(#_){ align-items:flex-end; padding:0; }
  html body :is(.nas-settings-form,.link-editor-dialog,.shortcuts-dialog):not(#_){ width:100%; max-width:none; margin:0; border-radius:24px 24px 0 0; max-height:calc(var(--cn-vh) - 32px); }
  html body .drawer-content:not(#_){ max-height:calc(var(--cn-vh) - 32px); height:calc(var(--cn-vh) - 32px); border-radius:24px 24px 0 0; }
  html[data-nw-sample] body .nw-sample-bar:not(#_){ z-index:60; }
}
/* grips here are not draggable, so they go */
html body .sheet-grip:not(#_){ display:none; }
html body .nw-panel:not(#_)::before{ content:none; }
/* same side padding from header to footer in every form sheet */
html body :is(.nas-editor-header,.nas-editor-body,.nas-editor-footer):not(#_){ padding-inline:var(--cn-pad); }
html body .nas-editor-header:not(#_){ padding-block:20px 12px; }
html body .nas-editor-body:not(#_){ padding-block:4px 16px; }
html body .nas-editor-footer:not(#_){ padding-block:12px calc(16px + env(safe-area-inset-bottom,0px)); justify-content:stretch; box-shadow:0 -1px 0 var(--nw-line); }
html body .nas-privacy .nas-help:not(#_){ margin:8px 0 0; padding:0; font-size:13px; line-height:1.55; }
html body #nas-url-preview:not(#_){ margin:12px 0; padding:0; border:0; font-size:13px; }
html body details.nas-help:not(#_){ margin:0; padding:0; border:0; }
/* one head: tile beside the title */
html body .dialog-content:has(>.dialog-emblem,>.dialog-symbol):not(#_){ display:block; }
html body .dialog-content>:is(.dialog-emblem,.dialog-symbol):not(#_){ float:left; width:40px; height:40px; margin:0 12px 12px 0; display:inline-flex; align-items:center; justify-content:center; }
html body .dialog-content>:is(.dialog-emblem,.dialog-symbol)+:is(h2,h3):not(#_){ margin:0 0 16px; line-height:40px; }
html body .dialog-content:has(>.dialog-emblem,>.dialog-symbol)>:not(:is(.dialog-emblem,.dialog-symbol)):not(:is(.dialog-emblem,.dialog-symbol)+*):not(#_){ clear:both; }
html body .trash-heading>svg:not(#_){ box-sizing:content-box; width:20px; height:20px; padding:10px; border-radius:50%; background:var(--cn-field); color:var(--nw-text-2); }
html body .trash-header:not(#_){ padding:16px var(--cn-pad) 8px; }
html body .trash-scroll:not(#_){ padding-inline:var(--cn-pad); margin:0; }
html body .trash-footer:not(#_){ display:none; }
html body .trash-empty:not(#_){ border:0; }
html body .link-editor-header:not(#_){ align-items:center; }
html body .link-editor-header h2:not(#_){ margin:0; }
html body .link-editor-header .icon-button:not(#_){ width:40px; height:40px; min-width:40px; border-radius:999px; }
html body .link-editor-empty:not(#_){ margin:0; padding:24px 0; border:0; background:transparent; color:var(--nw-text-3); font-size:14px; }
html body .link-editor-panel:not(#_){ min-height:0; }
html body .link-editor-footer:not(#_){ border:0; padding-top:12px; }
html body .link-editor-footer .dialog-button:not(#_){ height:52px; min-height:52px; border:0; flex:1 1 0; min-width:0; }
html body .link-editor-footer-spacer:not(#_){ display:none; }
@media (min-width:761px){ html body .link-editor-footer .dialog-button:not(#_){ height:44px; min-height:44px; flex:0 0 auto; min-width:88px; } html body .link-editor-footer:not(#_){ justify-content:flex-end; } }
html body .dialog-buttons:not(#_){ border:0; padding-top:0; }
html body :is(.dialog-buttons,.web-settings-footer,.link-editor-footer) .dialog-button:not(#_){ min-width:0; font:600 15px/1 var(--nw-font); }
@media (min-width:761px){ html body :is(.dialog-buttons,.web-settings-footer,.link-editor-footer) .dialog-button:not(#_){ min-width:88px; } }
html body .web-settings-footer:not(#_){ box-shadow:0 -1px 0 var(--nw-line); }
/* backup center */
html body .bc-body:not(#_){ padding:0; margin:0; }
html body .bc-provider-grid:not(#_){ display:grid; gap:12px; margin:0; padding:0; width:100%; }
html body .bc-provider-title h3:not(#_){ font:600 16px/1.4 var(--nw-font); margin:0; }
html body .bc-provider-caption:not(#_){ margin:0; text-transform:none; letter-spacing:0; font-size:13px; }
html body :is(.bc-provider-note,.bc-compat):not(#_){ position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
html body .bc-provider-description:not(#_){ margin:8px 0 12px; font-size:13px; line-height:1.5; }
html body .bc-action:not(#_){ font:600 14px/1 var(--nw-font); }
html[lang^=en] body .bc-provider-caption:not(#_){ text-transform:none; }
/* secondary search fields carry the same icon */
html body{ --cn-search:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7684' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.8-3.8'/%3E%3C/svg%3E"); }
/* editor: one left edge */
@media (min-width:761px){
  html body :is(.editor-utility-bar,.resource-header,.editor-statusbar):not(#_){ padding-inline:max(32px,calc((100% - 720px)/2)); }
  html body .formatting-toolbar:not(#_){ margin-inline:max(32px,calc((100% - 720px)/2)); width:auto; }
}
html body .formatting-toolbar:not(#_){ flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; }
html body .formatting-toolbar::-webkit-scrollbar{ display:none; }
html body .formatting-action:not(#_){ flex:0 0 auto; }
html body .formatting-separator:not(#_){ flex:0 0 1px; background:var(--nw-line-strong); }
@media (max-width:760px){
  html body .formatting-toolbar:not(#_){ width:auto; }
  html body .save-note-button:not(#_){ width:40px; height:40px; min-width:40px; min-height:40px; padding:0; justify-content:center; border-radius:999px; }
  html body .editor-utility-bar>*:not(.editor-path):not(#_){ gap:0; }
  html body .resource-header:not(#_){ min-height:52px; padding-block:6px; border-top:1px solid var(--nw-line); }
  html body .editor-statusbar:not(#_){ min-height:28px; border-top:0; }
  html body .note-panel-section .panel-header:not(#_){ padding-block:12px 8px; min-height:0; }
  html body .note-summary-row:not(#_){ padding-block:4px; min-height:0; border-bottom:0; }
}
/* landing: one edge */
html body .start-backups h2:not(#_),html body .start-local-notice:not(#_),html body .start-connection-help:not(#_),html body .start-drop-hint:not(#_){ margin-inline:0; padding-inline:0; }
html body .language-pill[aria-expanded=true]:not(#_){ background-color:var(--cn-tint-2); }
/* sidebar: one row inset, one count edge */
html body :is(.note-filter-chip,.folder-content,.trash-entry,.workspace-nav-item):not(#_){ padding-inline:12px; }
html body .sidebar-backup-button:not(#_){ padding:0 12px; gap:10px; background-color:var(--cn-tint-0); color:var(--nw-text-2); font:500 14px/1.4 var(--nw-font); min-height:40px; }
html body .sidebar-file-button:not(#_){ background-color:var(--cn-tint-1); }
/* counts */
html body .browser-count:not(#_){ min-width:20px; padding:0 6px; border:0; border-radius:999px; background:var(--cn-field); text-align:center; line-height:20px; }
html body .resource-count:not(#_){ background:var(--nw-line-strong); }
html body.theme-light .resource-count:not(#_){ background:var(--nw-line); }
html body .resource-tab[aria-selected=true] .resource-count:not(#_){ background:var(--cn-sheet); }
/* resource rows: one layout */
html body .resource-linked-note:not(#_){ margin:0; padding:8px; border:0; border-radius:12px; background-color:var(--cn-tint-0); color:var(--nw-text); }
html body .resource-sheet .resource-header:not(#_){ border-top:0; }
html body #note-font-size-input::placeholder{ color:var(--nw-text); opacity:1; }
html body .note-tools-panel:not(#_){ background:var(--cn-sheet); inset-inline:auto; }
/* copy */
html body :is(.editor-status-tip,#web-history-scope-hint):not(#_){ position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
html body #note-details-panel>.detail-sidecard:not(#_){ color:var(--nw-text-3); font-size:13px; line-height:1.55; }
/* accent chips: compact, left aligned, dot under the label's edge */
html body #link-note-list:empty:not(#_){ display:none; }
html body .link-editor-empty:not(#_){ text-align:center; }
html body dialog.resource-sheet:not(#_){ overflow:hidden; border-radius:24px 24px 0 0; }
html body dialog.resource-sheet .resource-surface:not(#_){ border-radius:24px 24px 0 0; }
@media (min-width:761px){ html body dialog.resource-sheet:not(#_){ border-radius:24px; } }
html body .formatting-toolbar:not(#_){ justify-content:flex-start; }
/* the toolbar takes the column width and scrolls inside it; it must never size to its content */
html body .formatting-toolbar:not(#_):not(#_){ align-self:stretch; box-sizing:border-box; min-width:0; max-width:none; width:auto; }
/* counts sit at the row's end in either direction */
html body :is(.nav-count,.filter-chip-count,.folder-count):not(#_){ margin-left:0; margin-right:0; margin-inline-start:auto; }
/* NAS footer follows every other dialog */
html body .nas-editor-footer:not(#_):not(#_){ align-items:stretch; justify-content:flex-end; padding-block:16px calc(16px + env(safe-area-inset-bottom,0px)); }
html body .nas-settings-status:not(#_){ margin-inline-end:auto; align-self:center; }
/* the editor column always fits: the bundle's fixed floor is gone at every width */
html body #markdown-workspace,html body #note-content-textarea,html body .markdown-editor-pane{ min-height:96px; }
html body #editor-content:not(#_){ min-height:0; }
html body :is(.resource-dock,.editor-statusbar,.editor-footer):not(#_){ flex-shrink:0; }
@media (max-height:640px){
  html body #editor-content:has(.formatting-toolbar:not(.hidden)) :is(.editor-statusbar,.editor-footer):not(#_){ display:none; }
}
/* page footer: everything starts on one edge */
html body .ys-studio__in:not(#_){ justify-content:flex-start; }
html body .ys-studio__mark:not(#_){ margin-inline-end:0; margin-right:0; }
html body .ys-studio__copy:not(#_){ margin-inline-start:auto; margin-left:auto; }
@media (max-width:599px){ html body .ys-studio__copy:not(#_){ margin-inline-start:0; margin-left:0; } }
/* start point for a selection cross-fade after a list rebuild */
html body #note-list .note-item.selected.cn-fade-from:not(#_):not(#_):not(#_){ background-color:color-mix(in srgb,var(--primary-soft) 0%,transparent) !important; transition:none !important; }
html body #note-list .note-item.selected:not(#_){ transition:background-color 200ms var(--cn-ease),transform var(--cn-fast) var(--cn-ease),box-shadow var(--cn-mid) var(--cn-ease); }


/* 15. NexusNote only */
/* the toolbar scrolls: every tool stays reachable */
html body #formatting-toolbar:not(#_):not(#_){ overflow-x:auto; overflow-y:hidden; scrollbar-width:none; mask:none; -webkit-mask:none; flex-wrap:nowrap; justify-content:flex-start; align-self:stretch; box-sizing:border-box; min-width:0; max-width:none; width:auto; margin-inline:16px; }
@media (min-width:761px){ html body #formatting-toolbar:not(#_):not(#_){ margin-inline:32px; } }
html.nn-kb-write body #formatting-toolbar:not(.hidden):not(#_):not(#_){ margin:0; width:100%; }
/* needless text stays for screen readers only */
html body :is(.web-setting-row small,#new-folder-modal .dialog-content>p,.resource-section-label,.nas-editor-body>p.nas-help:first-child,#shortcuts-modal .dialog-content>p,[data-link-text=eyebrow],.web-toolbar-customizer>p,.link-editor-header .eyebrow):not(#_){ position:absolute; width:1px; height:1px; margin:0; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
html body .nw-sample-note,html body #landing-nas-helper,html body .start-connection-help p{ display:none; }
@media (hover:none){ html body .start-drop-hint,html body .nw-graph__hint,html body :is(.sidebar-new-note,#new-note-button) kbd,html body .sidebar-shortcuts>kbd,html body .search-key{ display:none; } }
/* accent swatches: one row */
html body .calm-swatches:not(#_){ display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:4px; margin-bottom:16px; }
html body .calm-swatches>button:not(#_){ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; min-height:72px; padding:8px 0; border:0; border-radius:14px; background-color:transparent; font:500 12px/1.2 var(--nw-font); }
html body .calm-swatch:not(#_){ width:28px; height:28px; border-radius:50%; }
/* filter button is a plain round control, tinted only while open */
html body #note-tools-toggle-button:not(#_):not(#_){ width:40px; height:40px; min-width:40px; padding:0; justify-content:center; border:0; border-radius:999px; background-color:var(--cn-tint-0); }
html body #note-tools-toggle-button[aria-expanded=true]:not(#_):not(#_){ background-color:var(--primary-soft); color:var(--primary-color); }
/* the list behind the filter panel is not blurred or lightened */
html body :is(#note-browser-panel.note-tools-open,#note-browser-panel.note-tools-open *):not(#note-tools-panel):not(#_){ backdrop-filter:none; -webkit-backdrop-filter:none; filter:none; }
html body .note-tools-panel:not(#_):not(#_){ max-height:calc(var(--cn-vh) - 220px); overflow-y:auto; overflow-x:hidden; background:var(--cn-sheet); }
html body .note-tag-chip-count:not(#_){ background:transparent; color:inherit; opacity:.75; min-width:0; padding:0; }
/* row indicators hold their place when selected */
html body .note-item.selected :is(.note-status-chip,.note-item-status-row):not(#_){ display:inline-flex; visibility:visible; }
html body .note-selected-indicator:not(#_){ display:none; }
/* graph panel never covers the editor tools on wide screens */
@media (min-width:1181px){
  html.nw-panel-open body #editor-container:not(#_):not(#_){ margin-inline-end:320px; }
  html.nw-panel-open body #editor-container #save-note-text:not(#_){ position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
  html.nw-panel-open body #editor-container .save-note-button:not(#_){ width:38px; min-width:38px; padding:0; justify-content:center; border-radius:999px; }
}
/* graph list reads like the note list */
html body .nw-graph__list:not(#_){ padding:0 8px; }
html body .nw-graph__list li:not(#_){ border:0; }
html body .nw-graph__list button:not(#_){ min-height:48px; padding:8px; border-radius:12px; font:500 14px/1.4 var(--nw-font); }
html body .nw-panel__foot .nw-graph__summary:not(#_){ font-size:12px; }
html body .nw-panel:not(#_){ background:var(--cn-sheet); }
/* one edge on phones: inset fills on 8px, text on 16px */
@media (max-width:760px){
  html body .note-panel-section .panel-header:not(#_){ margin:0; padding:12px 16px 8px; left:0; }
  html body #browse-heading:not(#_){ padding:0; }
  html body .markdown-view-switch:not(#_):not(#_){ width:calc(100% - 32px); max-width:none; margin:4px 16px 8px; box-sizing:border-box; display:flex; }
  html body .markdown-view-button:not(#_){ flex:1 1 0; justify-content:center; }
  html body #resources-files-tab:not(#_),html body #resources-links-tab:not(#_){ min-height:40px; }
  html body .note-search-shell:not(#_){ min-height:48px; }
  html body #note-search-input:not(#_){ min-height:40px; }
  html body .brand-home:not(#_){ min-height:40px; }
}
/* language menu stays on screen under its button */
html body #language-dropdown:not(#_):not(#_){ left:auto; right:0; inset-inline-start:auto; inset-inline-end:0; }
/* details: section heads and toggles span the sheet, single fields do not leave holes */
html body .detail-grid>.detail-section-heading:not(#_):not(#_){ grid-column:1/-1; margin:8px 0 0; }
html body .detail-grid>.detail-toggles:not(#_):not(#_){ grid-column:1/-1; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
html body .detail-grid>.detail-field:has(input[type=time]):not(#_):not(#_){ grid-column:1/-1; }
html body .detail-toggle-button:not(#_):not(#_){ white-space:nowrap; padding:0 10px; gap:6px; font-size:14px; min-width:0; }
html body .detail-toggle-button>*:not(#_){ white-space:nowrap; word-break:keep-all; }
html body .detail-toggle-field:not(#_){ min-width:0; }
html body .related-details>summary:not(#_),html body details.related-details:not(#_){ border:0; background:transparent; }
html body .related-details>summary:not(#_){ display:flex; align-items:center; justify-content:space-between; min-height:48px; padding:0; color:var(--nw-text-2); font:500 14px/1.3 var(--nw-font); list-style:none; }
html body .related-details>summary:not(#_)::after{ content:""; flex:0 0 18px; height:18px; background:var(--cn-chevron) center/contain no-repeat; transition:transform var(--cn-mid) var(--cn-ease); }
html body .related-details[open]>summary:not(#_)::after{ transform:rotate(180deg); }
html body .bc-kicker:not(#_){ display:none; }
/* accent ring sits on the dot, not the whole cell */
html body .nn-slide--ring:not(#_){ border-radius:50%; background:transparent; box-shadow:0 0 0 2px var(--cn-sheet),0 0 0 4px var(--nw-text); }
/* graph: folder colours stay inside the theme, the switch matches settings, the button leaves the labels alone */
html body.theme-light .nw-graph{ --nw-danger:#b86a76; --nw-warning-text:#b08a4a; --nw-success:#4f9a86; }
html body.theme-dark .nw-graph{ --nw-danger:#d9939b; --nw-warning-text:#d6b676; --nw-success:#7fc4b2; }
html body .nw-graph__stage{ --nw-bg:var(--cn-sheet); }
html body .nw-graph__center:not(#_){ min-height:40px; border-radius:12px; }
html body .save-note-button:not(#_){ white-space:nowrap; flex:0 0 auto; }
html body .editor-document-label:not(#_){ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
html body .toolbar-actions:not(#_){ flex-shrink:0; }
@media (max-width:760px){
  /* status keeps its icon and its spoken text; the row always fits */
  html body #editor-container #save-note-text:not(#_){ position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
  html body #editor-container .save-note-button:not(#_):not(#_){ width:40px; height:40px; min-width:40px; min-height:40px; padding:0; justify-content:center; border-radius:999px; }
  html body .toolbar-actions:not(#_):not(#_){ flex-shrink:1; min-width:0; gap:0; }
  html body .toolbar-actions .icon-button:not(#_):not(#_){ width:40px; height:40px; min-width:0; flex:0 1 40px; padding:0; }
  html body #close-note-details-button:not(#_):not(#_),html body .web-settings-header .icon-button:not(#_):not(#_){ width:40px; height:40px; min-height:40px; }
  html body #resources-toggle-button:not(#_):not(#_),html body #editor-add-attachment-button:not(#_):not(#_){ width:40px; height:40px; min-width:40px; min-height:40px; padding:0; justify-content:center; border-radius:999px; }
  html body .note-tool-chip:not(#_){ min-height:36px; }
  html body .markdown-view-button:not(#_):not(#_){ min-height:36px; }
}
@media (min-width:761px){ html body #resources-toggle-button:not(#_):not(#_){ width:36px; height:36px; min-width:36px; padding:0; justify-content:center; border-radius:999px; } }
@media (max-width:760px){ html body .toolbar-actions .icon-button:not(#_):not(#_){ min-height:40px; max-height:40px; aspect-ratio:1; } }
/* formatting toolbar: wide pointers see every tool, touch scrolls with a fade cue */
@media (hover:hover) and (pointer:fine) and (min-width:761px){ html body #formatting-toolbar:not(#_):not(#_){ flex-wrap:wrap; overflow:visible; row-gap:2px; } }
html body #formatting-toolbar.has-more:not(#_):not(#_){ -webkit-mask:linear-gradient(to right,#000 calc(100% - 28px),transparent); mask:linear-gradient(to right,#000 calc(100% - 28px),transparent); }
html[dir=rtl] body #formatting-toolbar.has-more:not(#_):not(#_){ -webkit-mask:linear-gradient(to left,#000 calc(100% - 28px),transparent); mask:linear-gradient(to left,#000 calc(100% - 28px),transparent); }

/* final review */
html body #language-dropdown:not(#_):not(#_){ margin-top:8px; }
@media (max-width:760px){ html body #language-dropdown:not(#_):not(#_){ position:fixed; top:calc(var(--nn-vvt,0px) + var(--nw-sample-bar,0px) + 56px); right:12px; left:auto; inset-inline:auto 12px; width:min(240px,calc(100vw - 24px)); max-height:calc(var(--cn-vh) - 80px); } }
/* backup center: one inset, real buttons */
html body #backup-modal .bc-heading:not(#_):not(#_){ padding-inline:var(--cn-pad); }
html body #backup-modal .bc-body:not(#_):not(#_){ padding:0 var(--cn-pad) var(--cn-pad); overflow-y:auto; }
html body #backup-modal .bc-shell>.dialog-intro:not(#_){ padding-inline:var(--cn-pad); }
html body .bc-provider:not(#_):not(#_){ border:0; border-radius:20px; background:var(--cn-field); box-shadow:none; }
html body .bc-provider-icon:not(#_){ border:0; border-radius:50%; background:var(--primary-soft); color:var(--primary-color); }
html body .bc-action:not(#_):not(#_){ min-height:48px; border:0; border-radius:12px; background:var(--cn-sheet); color:var(--nw-text); transition:background-color var(--cn-fast) var(--cn-ease),transform var(--cn-fast) var(--cn-ease); }
html body .bc-action.export:not(#_):not(#_){ background:var(--primary-color); color:var(--on-primary); }
html body .bc-action:disabled:not(#_):not(#_){ background:var(--cn-tint-1); color:var(--nw-text-3); opacity:.7; }
html body .bc-action:is(:active,.nn-pressed):not(:disabled){ transform:scale(.97); }
html body .bc-recovery:not(#_):not(#_){ margin-top:12px; padding:0 16px; border:0; border-radius:16px; background:var(--cn-field); }
html body .bc-recovery>summary:not(#_){ display:flex; align-items:center; justify-content:space-between; min-height:52px; list-style:none; font:500 14px/1.3 var(--nw-font); color:var(--nw-text-2); }
html body .bc-recovery>summary:not(#_)::after{ content:""; flex:0 0 18px; height:18px; background:var(--cn-chevron) center/contain no-repeat; }
html body .bc-recovery>summary::-webkit-details-marker{ display:none; }
/* graph: its button leaves the fit area, the bar stays calm beside the panel */
html body .nw-graph__center:not(#_):not(#_){ inset:8px 8px auto auto; }
@media (min-width:1181px){
  html.nw-panel-open body #editor-container .resource-add-label:not(#_),html.nw-panel-open body #editor-container #editor-footer>:last-child:not(:first-child):not(#_){ position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  html.nw-panel-open body #editor-container #editor-add-attachment-button:not(#_):not(#_){ width:36px; min-width:36px; height:36px; padding:0; justify-content:center; border-radius:999px; }
}
/* colour chip is round, long placeholders fade with an ellipsis */
html body .detail-color-row>.detail-color-input:not(#_):not(#_):not(#_){ width:28px; min-width:28px; max-width:28px; height:28px; min-height:28px; flex:0 0 28px; padding:0; border-radius:50%; aspect-ratio:1; }
html body .detail-input:not(#_){ text-overflow:ellipsis; min-width:0; }
html body #attachment-filter-group .note-tool-chip:not(#_):not(#_){ white-space:nowrap; font-size:13px; padding-inline:6px; min-width:0; }
/* sheets: a hairline under the fixed head, nothing half visible, one heading weight */
html body :is(.detail-dialog-header,.web-settings-header,.nas-editor-header,.bc-heading):not(#_):not(#_){ box-shadow:0 1px 0 var(--nw-line); background:var(--cn-sheet); }
html body .nas-settings-form:not(#_):not(#_){ overflow:clip; }
html body .web-toolbar-customizer>summary:not(#_):not(#_){ font:500 15px/1.4 var(--nw-font); color:var(--nw-text); }
html body .ys-studio__in:not(#_){ justify-content:flex-start; gap:0 16px; }
html body .ys-studio__mark:not(#_){ margin-inline-end:0; margin-right:0; }
html body .ys-studio__copy:not(#_){ margin-inline-start:auto; margin-left:auto; }
@media (max-width:599px){ html body .ys-studio__copy:not(#_){ margin-inline-start:0; margin-left:0; } }
html body.theme-dark .dialog-overlay>.dialog-content:not(#_){ background:var(--cn-sheet); }
/* right-to-left: the thumb starts on the right, so its move stays inside the track */
html[dir=rtl] body :is(.switch-input,.web-setting-row.switch-setting input[type=checkbox],.nw-panel__foot input[type=checkbox])::before{ left:auto; right:3px; }
/* long translated labels wrap inside the button */
html body .web-settings-footer .dialog-button:not(#_):not(#_){ white-space:normal; line-height:1.2; padding-inline:12px; min-width:0; }
html body .web-settings-footer .dialog-button>*:not(#_){ white-space:normal; }
