/* ─── Notes page (Brief 2) ───────────────────────────────────
   Composes on tokens.css + shell.css. Single-column note list,
   sticky filter bar, expanded row with SFX preview + reply
   thread, structured tag picker, multi-select floating toolbar.
*/

/* ── Page frame ─────────────────────────────────────────────── */
.np-page {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-app);
  position: relative;
}

/* ── Filter bar (36, sticky) ────────────────────────────────── */
.np-filterbar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 44px;
  padding: 0 16px;
  background: transparent;
  border-bottom: 1px solid var(--line);
  flex: 0 0 44px;
}
.np-fb-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.np-fb-sep {
  width: 1px;
  height: 18px;
  background: var(--line);
  margin: 0 4px;
}
.np-fb-spacer { flex: 1; }
.np-fb-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 8px;
  color: var(--fg-mute);
  font: 500 11px/1 var(--ui);
  letter-spacing: 0.04em;
  border-radius: var(--r-btn);
  cursor: pointer;
}
.np-fb-sort:hover { color: var(--fg); background: var(--bg-row-hover); }
.np-fb-sort .nt-mono { color: var(--fg); font-size: 11px; }
.np-fb-iconbtn {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg-mute);
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  background: var(--bg-deep);
  cursor: pointer;
}
.np-fb-iconbtn:hover { color: var(--fg); border-color: var(--line-strong); }

/* ── Note list ──────────────────────────────────────────────── */
.np-list {
  flex: 1 1 auto;
  overflow: hidden;
  padding: 8px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ── Note row ───────────────────────────────────────────────── */
.np-row {
  position: relative;
  display: grid;
  grid-template-columns: 100px 56px 1fr auto auto 22px;
  gap: 14px;
  align-items: center;
  padding: 13px 16px 13px 18px;
  background: var(--bg-row);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  transition: background var(--t-fast), border-color var(--t-fast);
  cursor: pointer;
}
.np-row:hover { background: var(--bg-row-hover); }
.np-row.hover  { background: var(--bg-row-hover); }
.np-row.sel {
  background: var(--bg-row-sel);
  border-color: var(--teal-line);
}
.np-row.multi {
  background: var(--bg-row-multi);
  border: 1px dashed var(--teal-line);
}
.np-row.expanded {
  background: var(--bg-row-hover);
  border-color: var(--line-strong);
  cursor: default;
}

/* Category left bar (full-height, slightly inset on the row's radius) */
.np-catbar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
}
.np-catbar.foley { background: var(--cat-foley); }
.np-catbar.fx    { background: var(--cat-fx); }
.np-catbar.dlg   { background: var(--cat-dlg); }
.np-catbar.mus   { background: var(--cat-mus); }

/* Hold-edge rail */
.np-rail {
  position: absolute;
  right: 0; top: 4px; bottom: 4px;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--fg-faint), transparent);
  opacity: 0;
  border-radius: 1px;
  transition: opacity var(--t-fast), background var(--t-fast);
  pointer-events: none;
}
.np-row:hover .np-rail,
.np-row.expanded .np-rail {
  opacity: 1;
  background: linear-gradient(180deg, transparent, var(--teal-line), transparent);
}

/* Select check badge (multi & selected) */
.np-checkbadge {
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--teal);
  color: #0d0f12;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 3px var(--bg-app), 0 0 10px var(--teal-glow);
  z-index: 2;
}

/* Cells */
.np-c-tc {
  font: 500 12.5px/1 var(--mono);
  letter-spacing: 0.02em;
  color: var(--fg-strong);
}
.np-c-cat {
  display: flex;
  justify-content: flex-start;
}
.np-c-body { min-width: 0; }
.np-c-body .desc {
  font: 500 13px/1.3 var(--ui);
  color: var(--fg);
  letter-spacing: -0.005em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.np-c-indicators {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.np-replies {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: 500 11px/1 var(--mono);
  color: var(--fg-dim);
  letter-spacing: 0.02em;
}
.np-replies svg { color: var(--fg-dim); }
.np-c-asg {
  display: flex;
  justify-content: flex-end;
}
.np-c-asg .nt-asg { width: 20px; height: 20px; font-size: 9px; }

/* ── Expanded body ──────────────────────────────────────────── */
.np-expanded-body {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.np-extdesc {
  font: 400 12.5px/1.55 var(--ui);
  color: var(--fg-mute);
  max-width: 820px;
  margin-left: 114px; /* aligns with body column (100 + 14 gap) */
}

/* ── SFX preview panel ──────────────────────────────────────── */
.np-sfx {
  margin-left: 114px;
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  background: var(--bg-sub);
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  box-shadow: var(--inset-panel);
  max-width: 720px;
}
.np-sfx-play {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--teal-bg);
  border: 1px solid var(--teal-line);
  border-radius: 2px;
  color: var(--teal);
  cursor: pointer;
  box-shadow: 0 0 8px var(--teal-glow);
}
.np-sfx-meta { min-width: 0; }
.np-sfx-meta .ln1 {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 4px;
}
.np-sfx-name {
  font: 600 11.5px/1 var(--ui);
  color: var(--fg);
  letter-spacing: 0.01em;
}
.np-sfx-dur {
  font: 500 10px/1 var(--mono);
  color: var(--fg-dim);
  letter-spacing: 0.04em;
}
.np-sfx-fmt {
  font: 500 9px/1 var(--mono);
  color: var(--fg-faint);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-left: 1px solid var(--line);
  padding-left: 8px;
}
.np-sfx-path {
  font: 500 10px/1 var(--mono);
  color: var(--fg-dim);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.np-wave {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 22px;
}
.np-wave i {
  display: inline-block;
  width: 2px;
  background: var(--teal);
  opacity: 0.85;
  border-radius: 1px;
}
.np-wave i:nth-child(odd) { opacity: 0.55; }

/* ── Reply thread ───────────────────────────────────────────── */
.np-thread {
  margin-left: 114px;
  padding-left: 14px;
  border-left: 2px solid var(--line-strong);
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 820px;
}
.np-reply {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: flex-start;
}
.np-reply .nt-asg { width: 18px; height: 18px; font-size: 8px; }
.np-reply-body { min-width: 0; }
.np-reply-head {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 3px;
}
.np-reply-name {
  font: 600 11.5px/1 var(--ui);
  color: var(--fg);
}
.np-reply-ts {
  font: 500 10px/1 var(--mono);
  color: var(--fg-dim);
  letter-spacing: 0.02em;
}
.np-reply-text {
  font: 400 12.5px/1.5 var(--ui);
  color: var(--fg-mute);
}
.np-reply-prompt {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 10px;
  align-items: center;
}
.np-reply-prompt .nt-input {
  height: 28px;
  background: var(--bg-deep);
}
.np-reply-prompt .nt-input input { font-size: 12px; }

/* ── Action bar ─────────────────────────────────────────────── */
.np-actions {
  margin-left: 114px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.np-actions .sep {
  width: 1px; height: 16px;
  background: var(--line);
  margin: 0 4px;
}

/* ── Page status bar (bottom) ───────────────────────────────── */
.np-statusbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  height: 28px;
  background: var(--bg-deep);
  border-top: 1px solid var(--line);
  font: 500 11px/1 var(--mono);
  color: var(--fg-dim);
  letter-spacing: 0.02em;
  flex: 0 0 28px;
}
.np-statusbar .mid { flex: 1; text-align: center; color: var(--fg-mute); }
.np-statusbar .r   { color: var(--fg-faint); }
.np-statusbar .dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--fg-faint); display: inline-block; margin: 0 8px;
  vertical-align: middle;
}
.np-statusbar .v-resolved { color: var(--st-resolved); }
.np-statusbar .v-open     { color: var(--fg-mute); }
.np-statusbar .v-flagged  { color: var(--st-flagged); }

/* ── Floating multi-select toolbar ──────────────────────────── */
.np-floattool {
  position: absolute;
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  padding: 6px;
  background: var(--bg-sub);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-panel);
  box-shadow: var(--float);
  z-index: 20;
  font-family: var(--ui);
}
.np-floattool .ct {
  display: inline-flex; align-items: center;
  padding: 0 12px 0 8px;
  font: 600 12px/1 var(--mono);
  color: var(--teal);
  letter-spacing: 0.04em;
  border-right: 1px solid var(--line);
  margin-right: 4px;
}
.np-floattool .nt-btn { height: 28px; border: 0; background: transparent; box-shadow: none; }
.np-floattool .nt-btn:hover { background: var(--bg-row-hover); }
.np-floattool .nt-btn.danger { color: var(--st-danger); }
.np-floattool .nt-btn.danger:hover { color: var(--st-danger); background: rgba(180,104,104,0.08); }
.np-floattool .esc {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 8px 0 10px;
  color: var(--fg-dim);
  font: 500 10px/1 var(--ui);
  letter-spacing: 0.06em;
  border-left: 1px solid var(--line);
  margin-left: 4px;
}

/* ── New-note creation card ─────────────────────────────────── */
.np-newnote {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  box-shadow: var(--inset-panel);
  padding: 16px 18px 18px;
  margin: 8px 14px 0;
  position: relative;
}
.np-newnote::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--teal-line), transparent);
}
.np-nn-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.np-nn-title {
  font: 500 11px/1 var(--ui);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.np-nn-tc {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 10px; height: 24px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 2px;
  font: 500 11.5px/1 var(--mono);
  color: var(--fg);
  letter-spacing: 0.04em;
}
.np-nn-tc .lb {
  font: 500 9px/1 var(--ui);
  letter-spacing: 0.16em;
  color: var(--fg-dim);
  text-transform: uppercase;
  margin-right: 4px;
}

.np-nn-pickers {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 10px;
  margin-bottom: 14px;
}
.np-picker {
  position: relative;
}
.np-picker-lab {
  display: block;
  font: 500 9px/1 var(--ui);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 5px;
}
.np-picker-trig {
  display: flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 10px 0 12px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  box-shadow: var(--inset-input);
  cursor: pointer;
  font: 500 12.5px/1 var(--ui);
  color: var(--fg);
}
.np-picker-trig:hover { border-color: var(--line-strong); }
.np-picker-trig.empty { color: var(--fg-dim); }
.np-picker-trig.open {
  border-color: var(--teal-line);
  box-shadow:
    inset 0 1px 1px rgba(0,0,0,0.45),
    0 0 0 1px var(--teal-line),
    0 0 12px var(--teal-glow);
}
.np-picker-trig .val { flex: 1; }
.np-picker-trig .chev { color: var(--fg-mute); }
.np-picker-trig.open .chev { color: var(--teal); }

/* Picker dropdown panel */
.np-picker-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  box-shadow: var(--float);
  z-index: 30;
  overflow: hidden;
}
.np-picker-search {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-sub);
}
.np-picker-search .nt-input { height: 28px; background: var(--bg-deep); }
.np-picker-search .nt-input input { font-size: 12px; }
.np-picker-list { max-height: 240px; overflow: hidden; }
.np-picker-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px 8px 14px;
  font: 500 12.5px/1.2 var(--ui);
  color: var(--fg);
  cursor: pointer;
  border-bottom: 1px solid var(--line-soft);
}
.np-picker-item:last-child { border-bottom: 0; }
.np-picker-item:hover { background: var(--bg-row-hover); }
.np-picker-item.active {
  background: var(--bg-row-sel);
  color: var(--fg-strong);
}
.np-picker-item.active::before {
  content: ""; position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 3px; background: var(--teal); border-radius: 0 1.5px 1.5px 0;
}
.np-picker-item .meta {
  margin-left: auto;
  font: 500 10px/1 var(--mono);
  color: var(--fg-dim);
  letter-spacing: 0.04em;
}
.np-picker-item.active .meta { color: var(--teal); }

/* Canonical label preview */
.np-nn-preview {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding-top: 4px;
}
.np-nn-canon {
  font: 500 12.5px/1.2 var(--mono);
  letter-spacing: 0.02em;
  color: var(--fg-mute);
}
.np-nn-canon .arrow {
  color: var(--fg-faint);
  margin-right: 8px;
}
.np-nn-canon .v {
  color: var(--fg-strong);
}
.np-nn-canon .v::before { content: "\""; color: var(--fg-faint); }
.np-nn-canon .v::after  { content: "\""; color: var(--fg-faint); }
.np-nn-freetext {
  font: 500 11px/1 var(--ui);
  color: var(--fg-dim);
  cursor: pointer;
  letter-spacing: 0.02em;
}
.np-nn-freetext:hover { color: var(--teal); }
.np-nn-freetext::after {
  content: " ↗";
  font-size: 10px;
  color: inherit;
  opacity: 0.7;
}

.np-nn-foot {
  display: flex; align-items: center; gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.np-nn-mini {
  display: inline-flex; align-items: center; gap: 8px;
}
.np-nn-mini-lab {
  font: 500 9px/1 var(--ui);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.np-nn-mini-trig {
  display: inline-flex; align-items: center; gap: 7px;
  height: 26px; padding: 0 9px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  cursor: pointer;
  font: 500 11.5px/1 var(--ui);
  color: var(--fg);
}
.np-nn-mini-trig:hover { border-color: var(--line-strong); }
.np-nn-mini-trig .chev { color: var(--fg-mute); margin-left: 2px; }
.np-nn-mini-trig .nt-asg { width: 18px; height: 18px; font-size: 8px; }
.np-nn-mini-trig .swatch { width: 7px; height: 7px; border-radius: 1px; }
.np-nn-foot .spacer { flex: 1; }
.np-nn-foot .nt-kbd { margin-left: 0; }

/* ── Mobile (390) ───────────────────────────────────────────── */
.np-page.mobile { background: var(--bg-app); }
.np-page.mobile .np-filterbar {
  height: 44px;
  padding: 0 10px;
  gap: 8px;
  overflow: hidden;
}
.np-page.mobile .np-fb-chips {
  display: flex; gap: 6px;
  flex: 1; min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.np-page.mobile .np-fb-chips::-webkit-scrollbar { display: none; }
.np-page.mobile .np-fb-chips .nt-chip { flex: 0 0 auto; scroll-snap-align: start; }
.np-page.mobile .np-list { padding: 8px 10px; gap: 6px; }

/* Mobile row layout (stacked) */
.np-mrow {
  position: relative;
  padding: 10px 12px 10px 14px;
  background: var(--bg-row);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  display: flex; flex-direction: column; gap: 6px;
}
.np-mrow.expanded {
  background: var(--bg-row-hover);
  border-color: var(--line-strong);
}
.np-mrow-l1 {
  display: flex; align-items: center; gap: 8px;
}
.np-mrow-l1 .tc {
  font: 500 11px/1 var(--mono);
  color: var(--fg-strong);
  letter-spacing: 0.02em;
}
.np-mrow-l1 .sp { flex: 1; }
.np-mrow-l2 {
  font: 500 13px/1.35 var(--ui);
  color: var(--fg);
  letter-spacing: -0.005em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.np-mrow-l3 {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
}
.np-mrow-l3 .np-replies { color: var(--fg-dim); }
.np-mrow .np-catbar { border-radius: 3px 0 0 3px; }
.np-mrow .np-rail   { right: 0; top: 4px; bottom: 4px; }
.np-mrow:hover .np-rail,
.np-mrow.expanded .np-rail { opacity: 1; background: linear-gradient(180deg, transparent, var(--teal-line), transparent); }

/* Mobile expanded body */
.np-mexp {
  display: flex; flex-direction: column; gap: 12px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.np-mexp .np-extdesc,
.np-mexp .np-sfx,
.np-mexp .np-thread,
.np-mexp .np-actions { margin-left: 0; }
.np-mexp .np-sfx { max-width: none; }
.np-mexp .np-thread {
  padding-left: 8px;
  max-width: none;
}
.np-mexp .np-actions { gap: 4px; }
.np-mexp .np-actions .nt-btn { padding: 0; width: 30px; height: 30px; justify-content: center; }

/* Mobile bottom sync transport (44px) */
.np-mtransport {
  display: flex; align-items: center; gap: 12px;
  padding: 0 14px;
  height: 44px;
  background: var(--bg-panel);
  border-top: 1px solid var(--line);
  flex: 0 0 44px;
}
.np-mtransport-play {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--teal-bg);
  border: 1px solid var(--teal-line);
  border-radius: 2px;
  color: var(--teal);
  box-shadow: 0 0 8px var(--teal-glow);
}
.np-mtransport-tc {
  flex: 1;
  text-align: center;
  font: 500 14px/1 var(--mono);
  letter-spacing: 0.04em;
  color: var(--fg-strong);
}
.np-mtransport-sync {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 9px/1 var(--ui);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal);
}
.np-mtransport-sync .pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 6px var(--teal-glow);
  animation: np-pulse 1.6s ease-in-out infinite;
}
@keyframes np-pulse {
  0%, 100% { box-shadow: 0 0 4px var(--teal-glow); opacity: 1; }
  50%      { box-shadow: 0 0 10px var(--teal); opacity: 0.7; }
}

/* Mobile picker (stacks vertically) */
.np-page.mobile .np-newnote { margin: 8px 10px 0; padding: 14px; }
.np-page.mobile .np-nn-pickers { grid-template-columns: 1fr; gap: 8px; }
.np-page.mobile .np-nn-foot { flex-wrap: wrap; gap: 8px; }
.np-page.mobile .np-extdesc { font-size: 13px; }
