/* notes.css — Instagram-style notes: a short line (60 characters, 24 hours)
   floating above a profile picture, plus the small sheet used to write one. */

.profile-header-row { --kc-note-bg: #fff; --kc-note-fg: #232842; --kc-note-line: rgba(28,35,61,.18); }
body[data-theme="dark"] .profile-header-row { --kc-note-bg: #242a42; --kc-note-fg: #eef1ff; --kc-note-line: rgba(255,255,255,.12); }

/* someone without a cover photo has no cover to float over, so make room above the picture */
.profile-header:has(#upCover:not(.has-custom-cover)) .profile-header-row.kc-has-note { margin-top: 46px; }

.kc-note {
  align-items: center; background: var(--kc-note-bg); border: 1px solid var(--kc-note-line); border-radius: 16px;
  bottom: 100%; box-shadow: 0 8px 22px rgba(20,26,50,.2), 0 1px 2px rgba(20,26,50,.1); color: var(--kc-note-fg);
  cursor: default; display: inline-flex; font: 600 12px/1.28 inherit; font-family: inherit; left: 6px; margin: 0 0 12px;
  max-width: min(168px, 50vw); min-height: 32px; padding: 7px 12px; position: absolute; text-align: left;
  transform-origin: 14px calc(100% + 10px); z-index: 3;
  animation: kcNotePop .42s cubic-bezier(.2,.9,.3,1.25) both;
}
.kc-note-text { -webkit-box-orient: vertical; -webkit-line-clamp: 2; display: -webkit-box; overflow: hidden; overflow-wrap: anywhere; word-break: break-word; }
/* the two little "thought" dots that tie the bubble to the picture */
.kc-note::before, .kc-note::after { background: var(--kc-note-bg); border: 1px solid var(--kc-note-line); border-radius: 50%; content: ""; position: absolute; }
.kc-note::before { bottom: -9px; height: 10px; left: 12px; width: 10px; }
.kc-note::after { bottom: -16px; height: 6px; left: 8px; width: 6px; }
button.kc-note { cursor: pointer; transition: transform .14s ease, box-shadow .14s ease; }
button.kc-note:hover { box-shadow: 0 8px 22px rgba(106,92,240,.28), 0 1px 2px rgba(20,26,50,.08); }
button.kc-note:active { transform: scale(.95); }
button.kc-note:focus-visible { outline: 2px solid #7868e9; outline-offset: 2px; }

/* long note on someone else's profile: tap to read it all below */
.kc-note.is-expandable { cursor: pointer; padding-right: 8px; transition: transform .14s ease, box-shadow .14s ease; }
.kc-note.is-expandable .kc-note-text { margin-right: 4px; }
.kc-note-chevron { fill: none; flex: 0 0 auto; height: 13px; opacity: .6; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.6; transition: transform .2s ease; width: 13px; }
.kc-note.is-open .kc-note-chevron { transform: rotate(180deg); }
.kc-note.is-expandable:active { transform: scale(.95); }

/* the full note, opened below the picture */
.kc-note-full {
  --kc-full-bg: #f6f5ff; --kc-full-fg: #232842; --kc-full-sub: #7b8296; --kc-full-line: rgba(120,104,233,.22);
  animation: kcNoteFullIn .24s cubic-bezier(.2,.9,.3,1) both; background: var(--kc-full-bg); border: 1px solid var(--kc-full-line);
  border-left: 3px solid #7868e9; border-radius: 14px; box-shadow: 0 6px 18px rgba(20,26,50,.07); color: var(--kc-full-fg);
  cursor: pointer; margin: 14px 4px 0; padding: 11px 14px 13px;
}
body[data-theme="dark"] .kc-note-full { --kc-full-bg: #1b2036; --kc-full-fg: #eef1ff; --kc-full-sub: #98a1bb; --kc-full-line: rgba(255,255,255,.1); box-shadow: none; }
.kc-note-full-label { color: var(--kc-full-sub); display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.kc-note-full-text { font-size: 14px; font-weight: 600; line-height: 1.5; margin: 5px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
@keyframes kcNoteFullIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* "add a note" prompt on your own profile */
.kc-note.is-empty { background: transparent; border: 1.5px dashed rgba(120,104,233,.65); box-shadow: none; color: #6357df; font-weight: 700; }
.kc-note.is-empty::before, .kc-note.is-empty::after { background: transparent; border: 1.5px dashed rgba(120,104,233,.65); }
.kc-note.is-empty svg { fill: none; flex: 0 0 auto; height: 12px; margin-right: 5px; stroke: currentColor; stroke-linecap: round; stroke-width: 2.6; width: 12px; }
.profile-cover ~ .profile-header-row .kc-note.is-empty { background: var(--kc-note-bg); }
body[data-theme="dark"] .kc-note.is-empty { color: #b7acff; }

@keyframes kcNotePop { from { opacity: 0; transform: scale(.4) translateY(6px); } to { opacity: 1; transform: none; } }

/* ------------------------------ write / edit sheet ------------------------------ */
.kc-note-layer { z-index: 160; }
.modal.kc-note-sheet { max-width: 400px; padding: 24px 22px 20px; }
.kc-note-sheet h2 { font-size: 20px; letter-spacing: -.02em; }
.kc-note-sheet .kc-note-sub { color: #7b8296; font-size: 12px; margin: 5px 0 0; }
.kc-note-stage { align-items: flex-end; display: flex; justify-content: center; margin: 22px 0 6px; min-height: 112px; padding-top: 46px; position: relative; }
.kc-note-stage .mini-avatar { flex: 0 0 auto; font-size: 20px; height: 68px; width: 68px; }
.kc-note-stage .kc-note { --kc-note-bg: #fff; --kc-note-fg: #232842; --kc-note-line: rgba(28,35,61,.18); animation: none; bottom: calc(100% - 46px + 4px); left: 50%; margin: 0; max-width: 210px; transform: translateX(-62%); }
body[data-theme="dark"] .kc-note-stage .kc-note { --kc-note-bg: #2b3250; --kc-note-fg: #eef1ff; --kc-note-line: rgba(255,255,255,.12); }
.kc-note-stage .kc-note.is-empty { color: #9aa1b5; border-style: dashed; }
.kc-note-field { display: block; position: relative; }
.kc-note-field textarea {
  background: #f6f7fb; border: 1px solid #e3e6ef; border-radius: 12px; box-sizing: border-box; color: inherit; display: block;
  font: 500 14px/1.4 inherit; font-family: inherit; min-height: 64px; outline: 0; padding: 11px 13px 24px; resize: none; width: 100%;
}
.kc-note-field textarea:focus { border-color: #7868e9; box-shadow: 0 0 0 3px rgba(120,104,233,.14); }
body[data-theme="dark"] .kc-note-field textarea { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); }
.kc-note-count { bottom: 8px; color: #9aa1b5; font-size: 11px; pointer-events: none; position: absolute; right: 12px; }
.kc-note-count.is-full { color: #e0456a; font-weight: 700; }
.kc-note-actions { display: flex; gap: 10px; margin-top: 14px; }
.kc-note-actions .primary-button, .kc-note-actions .secondary-action { flex: 1 1 0; height: 42px; justify-content: center; }
.kc-note-actions .kc-note-delete { color: #d63a5f; }
.kc-note-actions .primary-button[disabled] { opacity: .5; pointer-events: none; }
.kc-note-meta { color: #8b92a6; font-size: 11.5px; margin: 12px 0 0; text-align: center; }

@media (prefers-reduced-motion: reduce) { .kc-note, .kc-note-full { animation: none; } button.kc-note, .kc-note.is-expandable, .kc-note-chevron { transition: none; } }
