/* Notes (public/notes.js): the Momo button on every page and the panel with his own notes, grouped by project. */
:root { --notes-w: 360px; }

.notes-fab { position: fixed; right: 24px; bottom: 24px; z-index: 41; width: 56px; height: 56px; padding: 0; border-radius: 50%; border: 2px solid var(--butter); background: var(--butter-pale); box-shadow: 0 18px 32px -18px rgba(29, 26, 22, .6); cursor: pointer; transition: transform .3s var(--ease); }
.notes-fab:hover { transform: translateY(-3px); }
.notes-fab:focus-visible { outline: 2px solid var(--pen); outline-offset: 3px; }
.notes-fab img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; pointer-events: none; }
/* A small pencil tells his notes apart from the chat's Momo above it. */
.notes-fab-badge { position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--on-ink); display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); pointer-events: none; }
.notes-fab[hidden], .notes-panel[hidden], .notes-icon-btn[hidden] { display: none; }
/* Something dragged over Momo or the open panel: Momo grows a ring, the panel says where it goes. */
.notes-fab.notes-dropping { transform: scale(1.12); border-color: var(--pen); box-shadow: 0 0 0 6px var(--butter-soft), 0 18px 32px -18px rgba(29, 26, 22, .6); }
.notes-panel.notes-dropping::after { content: "Drop to save as a note"; position: absolute; inset: 8px; z-index: 1; display: grid; place-items: center; border: 2px dashed var(--pen); border-radius: calc(var(--radius) - 4px); background: var(--butter-pale); color: var(--ink); font-size: 16px; font-weight: 600; opacity: .94; pointer-events: none; }

.notes-panel { position: fixed; top: 12px; right: 12px; bottom: 12px; z-index: 39; width: var(--notes-w); max-width: calc(100vw - 24px); display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: 0 1px 0 rgba(29, 26, 22, .04), 0 28px 56px -28px rgba(29, 26, 22, .55); overflow: hidden; animation: rise .3s var(--ease) both; }
/* Pinned on a wide screen: docked at the edge, and the page makes room for it so nothing is covered. */
.notes-panel.pinned { top: 0; right: 0; bottom: 0; border-radius: 0; border-width: 0 0 0 1px; box-shadow: none; animation: none; }
@media (min-width: 861px) {
  .notes-docked .shell { padding-right: var(--notes-w); }
  .notes-docked .dock-bubble { right: calc(var(--notes-w) + 24px); }
}

.notes-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); }
.notes-head h2 { flex: 1; margin: 0; font-size: 18px; }
.notes-momo { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--butter-pale); }
.notes-icon-btn { flex: none; width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 1px solid transparent; background: transparent; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.notes-icon-btn:hover { background: var(--hover); color: var(--ink); }
.notes-icon-btn:focus-visible { outline: 2px solid var(--pen); outline-offset: 1px; }
.notes-pin[aria-pressed="true"] { background: var(--butter-soft); border-color: var(--butter-edge); color: var(--ink); }

.notes-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 14px 24px; display: flex; flex-direction: column; gap: 14px; }

.notes-meeting { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 10px 14px; border: 1px solid var(--butter-edge); border-radius: 16px; background: var(--butter-soft); font-size: 14px; }
.notes-meeting[hidden] { display: none; }
.notes-meeting-text { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.notes-meeting-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--ink); }

.notes-add, .notes-card { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.notes-add { border-color: var(--line-2); }
.notes-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.notes-add-text, .notes-text { width: 100%; box-sizing: border-box; resize: none; border: 0; padding: 4px 2px; background: transparent; color: var(--ink); font: inherit; font-size: 15px; line-height: 1.45; max-height: 50vh; overflow-y: auto; }
.notes-add-text { min-height: 48px; }
.notes-add-text:focus, .notes-text:focus { outline: none; }
.notes-add:focus-within, .notes-card:focus-within { border-color: var(--ink-3); }
.notes-project { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink-2); font: inherit; font-size: 13.5px; }
.notes-add-btn, .notes-send { flex: none; }
.notes-meta { min-height: 16px; font-size: 12.5px; color: var(--ink-3); }
.notes-meta:empty { display: none; }

.notes-group { display: flex; flex-direction: column; gap: 8px; }
.notes-group-head { display: flex; align-items: center; gap: 8px; margin: 6px 2px 0; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.notes-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.notes-group-items { display: flex; flex-direction: column; gap: 8px; }
.notes-list { display: flex; flex-direction: column; gap: 12px; }
.notes-gone { flex-direction: row; align-items: center; justify-content: space-between; color: var(--ink-2); font-size: 14px; background: var(--fill); }
.notes-empty { margin: 8px 4px; color: var(--ink-3); font-size: 14px; }
.notes-empty[hidden] { display: none; }
/* Pictures and files dropped with a note (the chat's attachment strip, smaller and on the left). */
.notes-card .bubble-shots { justify-content: flex-start; }
.notes-card .bubble-shots img { width: 96px; height: 72px; }

/* The desktop app's notes window: only the panel, filling the window. */
.notes-solo .shell, .notes-solo .dock, .notes-solo .dock-bubble, .notes-solo .notes-fab { display: none !important; }
.notes-solo .notes-panel { inset: 0; z-index: 2147483000; width: auto; max-width: none; border: 0; border-radius: 0; box-shadow: none; animation: none; }
/* "Saved to notes" and other short lines show above the window's panel. */
.notes-solo .toasts { z-index: 2147483001; }

@media (max-width: 860px) {
  /* Phone: the Momo button rests above the chat box; the panel is a sheet above the tabs, so pinned it still lets
     him move between pages. */
  .notes-fab { right: 16px; bottom: calc(160px + env(safe-area-inset-bottom)); width: 52px; height: 52px; }
  .shell:has(.composer textarea:focus) ~ .notes-fab { display: none; }
  .notes-panel, .notes-panel.pinned { top: max(56px, env(safe-area-inset-top)); left: 0; right: 0; bottom: calc(74px + env(safe-area-inset-bottom)); width: auto; max-width: none; border-radius: 22px 22px 0 0; border: 1px solid var(--line-2); border-bottom: 0; box-shadow: 0 -18px 40px -24px rgba(29, 26, 22, .5); animation: rise .3s var(--ease) both; }
  .notes-solo .notes-panel { inset: 0; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .notes-fab, .notes-panel { transition: none; animation: none; }
}
