/* ═══ THE MEMO ═════════════════════════════════════════════════════════════
   A private note that follows you onto every screen. Ported from the Projects
   prototype, where it began life as a block on the home page — and a note you
   cannot see while you are working is a note you never write in.

   ⚠ It lives OUTSIDE the view in the markup, at the end of <body>. showView()
   redraws the view and the bars; if the box were inside either, every
   unrelated action in the app would tear it out from under the cursor
   mid-sentence.
   ⚠ Positioned by TOP/LEFT, never by bottom/right. A box anchored by its
   bottom edge grows UPWARDS when you drag the corner, which makes resizing
   useless.
   ⚠ No new colour and no new size. Same white, same hairline, 13 for the
   label and 15 for what you wrote — the ladder, nothing added. A yellow
   post-it would be a second accent.
   ⚠ LAPTOP ONLY, like the two bars. A floating box on a phone lands on top of
   the sheet and the thumb band.
   ═════════════════════════════════════════════════════════════════════════ */
#memo{display:none}
@media (min-width:761px){
  #memo{position:fixed;z-index:80;width:300px;
    background:var(--surface);border:1px solid var(--rule);border-radius:8px;
    box-shadow:0 6px 22px -12px rgba(var(--shade-rgb),.35);overflow:hidden;
    display:flex;flex-direction:column}
  #memo:empty{display:none}
  #memo.dragging{box-shadow:0 16px 40px -14px rgba(var(--shade-rgb),.5);user-select:none}
  #memo.shut{cursor:pointer}
  #memo.shut:hover{border-color:var(--ink-faint)}
  .memo-head{display:flex;align-items:center;gap:9px;padding:9px 12px;cursor:grab;
    touch-action:none;font-family:'Inter',sans-serif;font-size:13px;font-weight:500;
    letter-spacing:0;text-transform:none;color:var(--ink-faint)}
  #memo.open .memo-head{border-bottom:1px solid var(--rule-soft)}
  #memo.dragging .memo-head{cursor:grabbing}
  .memo-grip{width:9px;height:9px;flex-shrink:0;opacity:.5;
    background:radial-gradient(currentColor 1px,transparent 1.2px) 0 0/4.5px 4.5px}
  .memo-head .x{margin-left:auto;background:none;border:0;color:var(--ink-faint);
    font-size:13px;line-height:1;padding:2px 4px;cursor:pointer}
  .memo-head .x:hover{color:var(--accent)}
  .memo-head .dot{width:5px;height:5px;border-radius:50%;background:var(--accent);flex-shrink:0}
  /* shut, it still shows the first line — a note you cannot read without
     opening it is a drawer, not a memo */
  .memo-peek{padding:0 12px 11px;font-family:'Inter',sans-serif;font-size:15px;
    line-height:1.45;color:var(--ink);display:-webkit-box;-webkit-line-clamp:2;
    -webkit-box-orient:vertical;overflow:hidden}
  .memo-peek.none{color:var(--ink-faint);font-size:13px}
  #memo textarea{display:block;width:100%;flex:1;border:0;background:var(--surface);
    padding:12px;font-family:'Inter',sans-serif;font-size:15px;line-height:1.6;
    color:var(--ink);resize:none;min-height:150px}
  #memo textarea:focus{outline:none}
  /* the grab corner belongs to the WHOLE box, not to the textarea inside it */
  .memo-size{position:absolute;right:0;bottom:0;width:16px;height:16px;
    cursor:nwse-resize;touch-action:none;z-index:2}
  .memo-size::after{content:'';position:absolute;right:3px;bottom:3px;width:7px;height:7px;
    border-right:1px solid var(--ink-faint);border-bottom:1px solid var(--ink-faint);opacity:.7}
}
