/* ============================================================= *
 *  notes.css — note composer, note rows, notes feed view.
 *  Loads after card.css.
 * ============================================================= */

/* ---------- composer (always open) ---------- */
.composer {
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--panel-alt);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.composer.shake { animation: shake .32s ease; }
.composer-target {
  display: inline-flex;
  flex-wrap: wrap;       /* 4 scopes — wrap instead of overflowing on narrow cards */
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 3px;
  align-self: center;    /* scope selector centered above the note field */
  justify-content: center;
}
.composer-target .seg { padding: 5px 11px; }
.seg {
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.seg.active { background: var(--active); color: var(--active-ink); }
#composer-text {
  width: 100%;
  resize: none;          /* height is driven by content (auto-grow in js/features/composer.js) */
  overflow-y: hidden;    /* no inner scrollbar — the field grows instead */
  min-height: 64px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  padding: 11px 12px;
  font-size: 15px;
  font-family: inherit;
  line-height: 1.4;
}
#composer-text:focus { outline: 2px solid #6f8cff; outline-offset: 1px; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.composer-hint { font-size: 12px; color: var(--faint); }
.composer-hint.warn { color: var(--shit); font-weight: 600; }
.composer-send {
  border: none;
  border-radius: 9px;
  background: #6f8cff;
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  padding: 9px 20px;
  cursor: pointer;
  transition: filter .12s ease, opacity .12s ease;
}
.composer-send:hover { filter: brightness(1.08); }
.composer-send:disabled { opacity: .45; cursor: default; }
.composer-notes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* Cap the note list and scroll inside it — many notes must not grow the page. */
  max-height: 40vh;
  overflow-y: auto;
}
.composer-notes:empty { display: none; }

/* ---------- a single note row (composer + feed) ---------- */
.note-item {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.note-head { display: flex; align-items: center; gap: 9px; }
.note-author { font-weight: 650; font-size: 13px; color: var(--ink); }
.note-time { font-size: 12px; color: var(--faint); }
.note-del {
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--faint);
  font-size: 12px;
  cursor: pointer;
}
.note-del:hover { color: var(--shit); }
.note-body { font-size: 15px; line-height: 1.45; color: var(--ink); white-space: pre-wrap; }
.note-source {
  align-self: flex-start;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--hover);
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12px;
  cursor: pointer;
  overflow: hidden;
  text-align: left;
}
.note-source-ic { flex: none; display: inline-flex; align-items: center; font-size: 13px; }
.note-source-ic svg { display: block; }
.note-source-tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.note-source:hover { color: var(--ink); border-color: var(--line-strong); }

/* ---------- notes view ---------- */
.notes-view {
  width: 100%;
  max-width: 720px;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 100%;
  min-height: 0;
}
.notes-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.notes-scope { font-size: 18px; font-weight: 650; }
.notes-count { color: var(--faint); font-size: 14px; font-variant-numeric: tabular-nums; }
.notes-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  min-height: 0;
  padding-right: 4px;
}
.notes-feed .note-item { background: var(--panel); }
.notes-empty { color: var(--faint); font-size: 14px; padding: 20px 0; text-align: center; }

#viewer.notes-mode { align-items: flex-start; }
