/* Notes — plan/pages/notes.html, plan/page-inventory.md's Notes entry.

   Everything reused from base.css/components.css (.content-column, .page-title, .analytics-wrap,
   .intro-text, .form-box, .selector-box, .field-select*, .field-dropdown*, .filter-apply-btn,
   .col-sort-btn, .table-pagination, .control-select, .info-action-btn, .bookmark-toggle-btn) is
   not redeclared here. `.icon-action-btn` is the one item6-planning.md's own §2.1 list claimed
   was already shared and wasn't — it only exists in wrong-answer-journal.css, so every delete
   and go-to button on this page rendered as a bare unstyled button until this was checked
   directly rather than taken on the earlier claim's word.

   The reply box is a contenteditable div (.note-write-field), not the mockup's textarea, and
   message bodies print unescaped — item6-planning.md's D9/D10, matching item 1's journal panel
   and item 4's sticky-note card. */

/* ---- filter box — one horizontal row, since a note comes from one of two different sources (a
   lesson or a question) with its own taxonomy: Unit/Chapter/Lesson, then Preptest/Section/
   Question, then the universal Tags filter. A vertical divider between each group keeps the
   three taxonomies legible as distinct clusters. ---- */
.note-filter-box { display: block; width: 100%; padding: 18px 28px; }
.note-filter-row { display: flex; align-items: flex-end; gap: 20px; flex-wrap: nowrap; }
/* Each field group grows in proportion to how many fields it holds (3, 3, 1) so every individual
   field ends up the same width regardless of which group it's in. */
.filter-group { display: flex; align-items: flex-end; gap: 16px; flex: 3 1 0; min-width: 0; }
.filter-group.tags-group { flex: 1 1 0; }
.filter-group .field-select { flex: 1 1 0; min-width: 0; }
.filter-group-divider { align-self: stretch; width: 1px; flex-shrink: 0; background: rgba(241,231,219,0.15); }
.note-filter-summary { margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(241,231,219,0.1);
  font-size: 13px; line-height: 1.6; opacity: 0.8; }
.note-filter-summary strong { font-weight: 600; opacity: 1; }
.note-clear-filters-btn { background: none; border: none; color: var(--color-accent);
  font-family: inherit; font-size: 13.5px; cursor: pointer; padding: 0; margin-left: auto; }
.note-clear-filters-btn:hover { text-decoration: underline; }

/* ---- sort row — Date only, this page's one orderable dimension. ---- */
.note-sort-row { display: flex; align-items: center; gap: 22px; margin: -8px 4px 16px; }
.note-sort-label { font-variant: small-caps; font-size: 12.5px; letter-spacing: 0.03em; opacity: 0.55; }
.sort-arrow { font-size: 10px; }

/* Bookmark filter option — injected at the top of the Tags dropdown's own list, kept visually
   separate via a divider from the actual tag checkboxes below it, since it isn't itself a tag
   value (feature-logic.md, "The bookmark filter"). */
.bookmark-filter-option { font-weight: 600; }

.icon-action-btn {
  background: transparent;
  border: 1px solid rgba(255,128,88,0.5);
  border-radius: 2px;
  color: var(--color-accent);
  opacity: 0.85;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
}
.icon-action-btn:hover { opacity: 1; background: rgba(255,128,88,0.12); }
.icon-action-btn svg { width: 13px; height: 13px; display: block; }
.icon-action-btn[aria-disabled] { opacity: 0.3; cursor: default; pointer-events: none; }

/* ---- entry list ---- */
.note-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.note-empty-note { font-size: 13.5px; opacity: 0.6; padding: 10px 4px; }

.note-item { background: rgba(241,231,219,0.04); border: 1px solid rgba(241,231,219,0.12); border-radius: 4px; overflow: hidden; }
.note-item[hidden] { display: none; }

.note-item-header { display: flex; align-items: center; gap: 16px; padding: 16px 20px; cursor: pointer; }
.note-item-header:hover { background: rgba(241,231,219,0.03); }
.note-item-main { flex: 1 1 auto; min-width: 0; }
.note-item-meta { font-size: 13.5px; font-weight: 600; }
.note-meta-sep { opacity: 0.35; font-weight: 400; margin: 0 2px; }
.note-item-title-row { display: flex; align-items: center; gap: 10px; }
.note-item-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.note-item-tags:empty { display: none; margin-top: 0; }
.note-tag-pill {
  display: inline-flex; align-items: center;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  border-radius: 12px;
  padding: 2px 9px;
  font-size: 11px;
}
.note-item-date { font-size: 12px; opacity: 0.55; white-space: nowrap; margin: 0 4px; flex-shrink: 0; }
.note-item-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ---- expanded body ---- */
.note-item-body { display: none; flex-direction: column; border-top: 1px solid rgba(241,231,219,0.12); }
.note-item.expanded .note-item-body { display: flex; }
.note-item-body-inner { flex: 1; min-height: 0; overflow-y: hidden; padding: 18px 20px; }

/* Thread panel — the one deliberate departure from the rest of this page's (and the sticky-notes
   widget's own) navy/coral/cream palette, per Milan's direct call: plain white background, plain
   black text, no per-speaker color wash. Speaker is read from the small-caps label and alignment
   alone (instructor left, student right), not color. */
.note-thread {
  background: #fff;
  color: #000;
  border-radius: 4px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.note-msg { font-size: 13px; line-height: 1.5; max-width: 78%; color: #000; }
.note-msg-from { font-variant: small-caps; font-size: 10.5px; opacity: 0.6; margin-bottom: 2px; letter-spacing: 0.03em; color: #000; }
.note-msg.from-instructor { align-self: flex-start; }
.note-msg.from-student { align-self: flex-end; text-align: right; }
.note-msg.from-student .note-msg-from { text-align: right; }
.note-msg.placeholder { opacity: 0.5; font-style: italic; max-width: 100%; }

/* Reply row — same white/black treatment as the thread above it. Posting only ever appends a
   student-side message; Milan's own reply arrives from his own surfaces (stage 9). */
.note-reply-row { display: flex; gap: 8px; margin-bottom: 14px; position: relative; align-items: flex-end; }
.note-write-field {
  flex: 1;
  min-height: 54px;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 3px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  background: #fff;
  color: #000;
  white-space: pre-wrap;
}
.note-write-field:empty::before { content: attr(data-placeholder); opacity: 0.4; }
.note-post-btn {
  align-self: flex-end;
  background: var(--color-accent);
  color: var(--color-accent-text);
  border: none;
  border-radius: 2px;
  padding: 9px 16px;
  font-family: inherit;
  font-variant: small-caps;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.03em;
  cursor: pointer;
}
.note-post-btn:hover { opacity: 0.92; }

.note-item-error { font-size: 11.5px; color: #c94f4f; margin: 0 0 8px; }
.note-item-error:empty { display: none; }

/* Notification bell — briefly turns solid coral plus a toast, no lasting per-note state. */
.note-bell-btn {
  background: transparent;
  border: 1px solid rgba(255,128,88,0.5);
  border-radius: 2px;
  color: var(--color-accent);
  opacity: 0.85;
  height: 34px;
  width: 36px;
  align-self: flex-end;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.note-bell-btn:hover { opacity: 1; background: rgba(255,128,88,0.12); }
.note-bell-btn svg { width: 13px; height: 13px; }
.note-bell-btn.notified { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-text); opacity: 1; }
.note-toast {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 6px;
  background: var(--color-background);
  color: var(--color-text);
  font-size: 10.5px;
  padding: 4px 8px;
  border-radius: 3px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}
.note-toast.show { opacity: 1; transform: translateY(0); }

/* Tag editing — same Enter/comma-to-commit pill mechanic as the sticky notes widget. Shown here
   in the body, separate from the header's own read-only pill summary above. */
.note-tags-edit-label { display: block; font-variant: small-caps; font-size: 11.5px; font-weight: 600; opacity: 0.65; letter-spacing: 0.03em; margin-bottom: 8px; }
.note-tags-pills { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.note-tags-pills:empty { display: none; margin-bottom: 0; }
.note-edit-tag-pill {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  border-radius: 12px;
  padding: 2px 6px 2px 9px;
  font-size: 11px;
}
.note-edit-tag-pill button { background: none; border: none; color: var(--color-accent); opacity: 0.7; cursor: pointer; font-size: 12px; line-height: 1; padding: 0; }
.note-edit-tag-pill button:hover { opacity: 1; }
.note-tags-input {
  display: block;
  width: 100%;
  border: 1px solid rgba(241,231,219,0.3);
  border-radius: 3px;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 12.5px;
  background: rgba(241,231,219,0.03);
  color: var(--color-text);
}

.note-item-resize-handle {
  height: 10px;
  flex-shrink: 0;
  cursor: row-resize;
  background: rgba(241,231,219,0.03);
  position: relative;
  border-top: 1px solid rgba(241,231,219,0.1);
}
.note-item-resize-handle::after {
  content: ''; position: absolute; top: 3px; left: 50%;
  width: 36px; height: 3px; background: rgba(241,231,219,0.25); border-radius: 2px;
  transform: translateX(-50%);
}

.note-pagination-box { padding: 0; }
