/* Find in note (NexusNote Web + ClipboardNote Web share this file). */
html body{
  --nf-ease: cubic-bezier(.2,.8,.2,1);
  --nf-fast: 160ms; --nf-mid: 260ms;
  --nf-surface: var(--editor-surface, var(--nw-bg, #fff));
  --nf-field: var(--nw-surface-2, var(--surface-muted));
  /* every fill is opaque: a translucent yellow is mixed into the editor surface first */
  --nf-amber: 255 199 46;
  --nf-hit: color-mix(in srgb, rgb(var(--nf-amber)) 34%, var(--nf-surface));
  --nf-cur: color-mix(in srgb, rgb(var(--nf-amber)) 62%, var(--nf-surface));
  --nf-ring: rgb(232 166 0);
  --nf-ring-0: rgb(232 166 0 / 0);
  --nf-inset: 24px;
}
html body.theme-dark{
  --nf-hit: color-mix(in srgb, rgb(var(--nf-amber)) 30%, var(--nf-surface));
  --nf-cur: color-mix(in srgb, rgb(var(--nf-amber)) 40%, var(--nf-surface));
  --nf-ring: rgb(255 210 86);
  --nf-ring-0: rgb(255 210 86 / 0);
}
@media (max-width:760px){ html body{ --nf-inset: 16px; } }

/* ---------- bar ---------- */
html body .nf-wrap{
  flex: 0 0 auto; display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows var(--nf-mid) var(--nf-ease);
}
html body .nf-wrap[data-open=true]{ grid-template-rows: 1fr; }
html body .nf-clip{ min-height: 0; overflow: hidden; }
html body .nf-pad{ padding: 10px var(--nf-inset) 4px; }
html body .nf-bar{
  display: flex; align-items: center; gap: 2px;
  height: 44px; padding-inline: 14px 4px;
  border-radius: var(--nw-r-lg, 14px);
  background: var(--nf-field);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--primary-color) 0%, var(--nf-field));
  opacity: 0; translate: 0 -6px;
  transition: opacity var(--nf-fast) var(--nf-ease), translate var(--nf-mid) var(--nf-ease), box-shadow var(--nf-fast) var(--nf-ease);
}
html body .nf-wrap[data-open=true] .nf-bar{ opacity: 1; translate: 0 0; }
html body .nf-bar:has(.nf-input:focus){ box-shadow: inset 0 0 0 1.5px var(--primary-color); }
html body .nf-bar .nf-lead{ flex: none; width: 20px; height: 20px; margin-inline-end: 8px; color: var(--nw-text-3, var(--on-surface-variant)); }
html body .nf-bar .nf-input{
  flex: 1 1 auto; min-width: 0; height: 100%; padding: 0; margin: 0;
  border: 0; outline: none; background: none; box-shadow: none; border-radius: 0;
  font: 500 16px/1.4 var(--nw-font, inherit); color: var(--nw-text, var(--on-surface));
}
html body .nf-bar .nf-input::placeholder{ color: var(--nw-placeholder, var(--nw-text-3)); font-weight: 400; }
html body .nf-bar .nf-count{
  flex: none; min-width: 3ch; padding-inline: 6px; text-align: center;
  font: 600 13px/1 var(--nw-font, inherit); font-variant-numeric: tabular-nums; letter-spacing: 0;
  color: var(--nw-text-3, var(--on-surface-variant));
  transition: color var(--nf-fast) var(--nf-ease);
}
html body .nf-bar .nf-count[data-state=hit]{ color: var(--primary-color); }
html body .nf-bar .nf-count[data-state=empty]{ min-width: 0; padding: 0; }
html body .nf-bar .nf-sep{ flex: none; width: 1px; height: 20px; margin-inline: 4px; background: var(--nw-line, var(--hairline)); }
html body .nf-bar .nf-btn:not(#_){
  flex: none; position: relative; width: 36px; height: 36px; min-width: 36px; padding: 0; margin: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; cursor: pointer;
  color: var(--nw-text-2, var(--on-surface));
  background-color: color-mix(in srgb, var(--nw-text, #000) 0%, var(--nf-field));
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--nw-text, #000) 6%, var(--nf-field));
  transition: background-color var(--nf-fast) var(--nf-ease), opacity var(--nf-fast) var(--nf-ease), scale var(--nf-fast) var(--nf-ease), box-shadow var(--nf-mid) var(--nf-ease);
}
html body .nf-bar .nf-btn:not(#_) .material-symbols-outlined{ width: 22px; height: 22px; }
html body .nf-bar .nf-btn:not(#_):disabled{ opacity: .35; cursor: default; }
html body .nf-bar .nf-btn:not(#_):not(:disabled):active{ scale: .9; background-color: color-mix(in srgb, var(--nw-text, #000) 10%, var(--nf-field)); }
@media (hover:hover) and (pointer:fine){
  html body .nf-bar .nf-btn:not(#_):not(:disabled):hover{ background-color: color-mix(in srgb, var(--nw-text, #000) 6%, var(--nf-field)); }
}
/* ClipboardNote marks presses with .is-pressed / .is-held; NexusNote draws its own bubble inside the button */
html body .nf-bar .nf-btn:not(#_).is-pressed:not(:disabled){ scale: .9; background-color: color-mix(in srgb, var(--nw-text, #000) 10%, var(--nf-field)); }
html body .nf-bar .nf-btn:not(#_).is-held:not(:disabled){ box-shadow: 0 0 0 4px color-mix(in srgb, var(--nw-text, #000) 6%, var(--nf-field)); }
html body .nf-bar .nf-btn:not(#_):focus-visible{ outline: 2px solid var(--primary-color); outline-offset: -2px; }
html body .nf-down{ rotate: 180deg; }

/* ---------- highlights behind the editor text ---------- */
html body .nf-host{ position: relative; }
html body .nf-host > #note-content-textarea{ position: relative; z-index: 1; }
html body .nf-mirror{
  position: absolute; z-index: 0; overflow: hidden; pointer-events: none; user-select: none;
  opacity: 1; transition: opacity var(--nf-mid) var(--nf-ease);
}
html body .nf-mirror.nf-gone{ opacity: 0; }
html body .nf-sheet{
  box-sizing: border-box; margin: 0; border: 0; min-height: 100%;
  color: transparent; background: none; will-change: transform;
}
html body :is(.nf-sheet, #markdown-preview) mark.nf-hit{
  padding: 0; border-radius: 3px;
  background-color: var(--nf-hit);
  box-shadow: 0 0 0 1px var(--nf-hit), 0 0 0 2.5px var(--nf-ring-0);
  transition: background-color var(--nf-fast) var(--nf-ease), box-shadow var(--nf-fast) var(--nf-ease);
}
html body .nf-sheet mark.nf-hit{ color: transparent; }
html body #markdown-preview mark.nf-hit{ color: inherit; }
html body :is(.nf-sheet, #markdown-preview) mark.nf-hit.nf-cur{
  background-color: var(--nf-cur);
  box-shadow: 0 0 0 1px var(--nf-cur), 0 0 0 2.5px var(--nf-ring);
}

@media (prefers-reduced-motion: reduce){
  html body :is(.nf-wrap, .nf-bar, .nf-mirror, .nf-btn, mark.nf-hit){ transition: none !important; }
}
@media (forced-colors: active){
  html body :is(.nf-sheet, #markdown-preview) mark.nf-hit{ background-color: Mark; forced-color-adjust: none; }
  html body .nf-sheet mark.nf-hit{ color: transparent; }
  html body :is(.nf-sheet, #markdown-preview) mark.nf-hit.nf-cur{ outline: 2px solid Highlight; }
}
/* short screens: decided once from the screen, so the keyboard never resizes the bar */
html body .nf-wrap[data-compact] .nf-pad{ padding-block: 6px 2px; }
html body .nf-wrap[data-compact] .nf-bar{ height: 40px; }
