.floating-notes-bar[hidden],
.ns-floating-head { display: none; }
.floating-notes-bar {
  position: fixed;
  z-index: 110;
  top: var(--floating-notes-top, 96px);
  right: max(14px, env(safe-area-inset-right));
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: min(300px, calc(100vw - 28px));
  min-height: 46px;
  padding: 6px 14px;
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  background: var(--surface);
  color: var(--fg);
  box-shadow: 0 5px 18px #0008;
  font: 600 16px/1.2 var(--display);
  cursor: pointer;
}
.floating-notes-bar strong { color: var(--muted); font-weight: 400; }
.floating-notes-bar:hover { border-color: var(--teal); }
.floating-notes-bar:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.floating-notes-chevron { display: inline-flex; flex: 0 0 24px; width: 24px; height: 24px; color: var(--teal); }
.floating-notes-chevron svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .16s ease; }
.floating-notes-bar.is-open .floating-notes-chevron svg { transform: rotate(180deg); }
body.newsletter-library-page .floating-notes-bar {
  position: sticky;
  z-index: 110;
  top: 8px;
  right: auto;
  left: auto;
  width: 100%;
  max-width: none;
  margin: 12px 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  box-shadow: 0 5px 18px #0006;
}
body.newsletter-library-page .floating-notes-chevron:first-child { justify-self: start; }
body.newsletter-library-page .floating-notes-chevron:last-child { justify-self: end; }
.ns-panel.floating-notes-panel {
  position: fixed !important;
  z-index: 109;
  top: var(--floating-notes-panel-top, 146px) !important;
  right: max(14px, env(safe-area-inset-right));
  left: max(14px, env(safe-area-inset-left));
  box-sizing: border-box;
  width: auto;
  max-width: 960px;
  max-height: calc(100dvh - var(--floating-notes-panel-top, 146px) - env(safe-area-inset-bottom) - 12px) !important;
  margin: 0 auto;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 48px #000b;
}
.floating-notes-panel .ns-floating-head {
  position: sticky;
  z-index: 5;
  top: -14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -14px -14px 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
}
.ns-floating-head > strong { color: var(--muted); font: 400 18px/1.3 var(--display); }
.ns-floating-head .ns-floating-close {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--teal);
  border-radius: 999px;
  background: color-mix(in srgb, var(--teal) 20%, var(--surface));
  color: var(--fg);
  font: 600 14px/1.2 var(--display);
}
.ns-floating-close span { padding-left: 5px; font-size: 18px; font-weight: 400; }
.floating-notes-panel .ns-toolbar button {
  min-height: 40px;
  min-width: 40px;
  padding: 7px 11px;
  border: 1px solid color-mix(in srgb, var(--fg) 35%, transparent);
  border-radius: 9px;
  background: var(--bg);
  color: var(--fg);
  font: 600 15px/1.2 var(--display);
}
.floating-notes-panel .ns-toolbar .ns-send { border-color: var(--accent); color: var(--accent); }
@media (max-width: 600px) {
  .floating-notes-bar { right: max(10px, env(safe-area-inset-right)); width: min(280px, calc(100vw - 20px)); }
  .ns-panel.floating-notes-panel {
    right: max(10px, env(safe-area-inset-right));
    left: max(10px, env(safe-area-inset-left));
    padding: 10px;
    max-height: calc(100dvh - var(--floating-notes-panel-top, 146px) - env(safe-area-inset-bottom) - 10px) !important;
  }
  .floating-notes-panel .ns-floating-head { top: -10px; margin: -10px -10px 10px; padding: 10px; }
  .floating-notes-panel .ns-editor { max-height: 34dvh; }
}
@media (prefers-reduced-motion: reduce) {
  .floating-notes-chevron svg { transition: none; }
}
@media print { .floating-notes-bar, .ns-panel.floating-notes-panel { display: none !important; } }

/* One blink every two seconds, only while the arrows point upward/open. */
@keyframes hlf-floating-notes-up-blink{0%,70%,90%,100%{opacity:1}80%{opacity:.25}}
@media screen and (prefers-reduced-motion:no-preference){
 html:not([data-screenshot]) .floating-notes-bar.is-open .floating-notes-chevron svg{animation:hlf-floating-notes-up-blink 2s ease-in-out infinite}
}
