/* ═══════════════════════════════════════════════════════════════
   n-drawer.css — Notes drawer + floating action button (FAB).
   Converts the old full-width "Field notes" section into a
   right-side slide-in drawer, keeping the main narrative clean
   while notes remain one click away.
═══════════════════════════════════════════════════════════════ */

/* ── FAB: Floating action button bottom-right ──────────────── */
.n-notes-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.05rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #4fc3f7, #22d3ee);
  color: #0f172a;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow:
    0 10px 24px rgba(34, 211, 238, 0.28),
    0 2px 6px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.n-notes-fab:hover {
  transform: translateY(-2px);
  box-shadow:
    0 14px 30px rgba(34, 211, 238, 0.35),
    0 2px 8px rgba(0, 0, 0, 0.22);
}

.n-notes-fab:focus-visible {
  outline: 2px solid #22d3ee;
  outline-offset: 3px;
}

.n-notes-fab-icon { font-size: 1.1rem; line-height: 1; }

.n-notes-fab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.18);
  color: #0f172a;
  font-size: 0.72rem;
  font-weight: 700;
}

.n-notes-fab-count:empty,
.n-notes-fab-count[data-count="0"] { display: none; }

.n-notes-fab--hidden {
  display: none;
}

/* ── Backdrop & drawer container ───────────────────────────── */
.n-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.n-drawer-backdrop--open {
  opacity: 1;
  pointer-events: auto;
}

.n-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(460px, 96vw);
  z-index: 1000;
  background: var(--n-surface-raised, #ffffff);
  border-left: 1px solid var(--n-border-subtle, rgba(15, 23, 42, 0.08));
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.18);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.2, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.n-drawer--open { transform: translateX(0); }

body:not(.theme-light) .n-drawer {
  background: #0b1220;
  border-left-color: rgba(255, 255, 255, 0.08);
}

/* ── Drawer header ─────────────────────────────────────────── */
.n-drawer-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--n-border-subtle, rgba(15, 23, 42, 0.08));
  flex-shrink: 0;
}

.n-drawer-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  margin: 0;
}

body:not(.theme-light) .n-drawer-title { color: #f1f5f9; }

.n-drawer-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
  margin: 0.15rem 0 0 0;
}

.n-drawer-close {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted, #64748b);
  font-size: 1.1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s, color 0.15s;
}

.n-drawer-close:hover {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-primary, #0f172a);
}

body:not(.theme-light) .n-drawer-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
}

/* ── Drawer body (scrollable) ──────────────────────────────── */
.n-drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.25rem 1.5rem;
}

/* When the old annotations panel is placed inside the drawer we want
   the content itself to fill the drawer without duplicating its own
   card chrome. */
.n-drawer-body .n-ann-panel,
.n-drawer-body .annotations-panel {
  border: 0;
  box-shadow: none;
  padding: 0;
  background: transparent;
}

.n-drawer-body .annotations-panel-header {
  padding-top: 0;
}

/* Make the "show on charts" toggle visible in the drawer header area. */
.n-drawer-header .n-ann-toggle {
  margin-left: auto;
  font-size: 0.76rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* ── Mobile ────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .n-drawer { width: 100vw; border-left: 0; }
  .n-notes-fab {
    right: 0.85rem;
    bottom: 0.85rem;
    padding: 0.6rem 0.9rem;
    font-size: 0.82rem;
  }
}
