/* ==========================================================================
   KUTAY OS — Notes app
   Page-specific styling for notes.html: the note list + editor split view,
   and the "studio letter" read-only treatment for an unedited seed note.
   Split-view grid, sidebar/notes-list responsive hiding and window chrome
   all come from css/shell.css — this file only styles what is unique to
   the Notes app's own content.
   ========================================================================== */

.notes-list { padding: 10px 8px; border-right: 1px solid var(--line-2); overflow: auto; min-height: 0; }
.notes-list-head { display: flex; align-items: center; justify-content: space-between; padding: 3px 8px 10px; font-size: 15px; font-weight: 600; }

.note-item { position: relative; display: block; width: 100%; text-align: left; background: transparent; border-radius: var(--r-sm); padding: 11px 11px 11px 14px; line-height: 1.4; color: var(--text); min-height: 70px; transition: background var(--dur-base), transform var(--dur-fast); }
.note-item::before { content: ""; position: absolute; left: 4px; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--accent); transform: scaleY(0); transition: transform .25s var(--ease-out); }
.note-item.active { background: rgba(255, 255, 255, .08); }
.note-item.active::before { transform: scaleY(1); }
.note-item:active { transform: scale(.985); }
.note-item + .note-item { margin-top: 2px; }
.note-item b { font-size: 13px; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-item span { display: block; margin-top: 3px; font-size: 11px; line-height: 1.4; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.note-editor { padding: 24px 30px; display: flex; flex-direction: column; min-height: 0; overflow: auto; }
.note-editor-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.save-status { font-size: 11px; color: var(--text-dim); transition: color var(--dur-base); }
.note-editor.is-entering > * { animation: pm-rise .34s var(--ease-out) both; }
.note-editor.is-entering > :nth-child(2) { animation-delay: 40ms; }
.note-editor.is-entering > :nth-child(3) { animation-delay: 80ms; }
.note-editor.is-entering > :nth-child(4) { animation-delay: 120ms; }

.note-title { font-size: 26px; font-weight: 600; line-height: 1.3; border: 0; background: transparent; width: 100%; padding: 8px 0; color: var(--text); }
.note-text { flex: 1; min-height: 260px; resize: vertical; margin-top: 14px; padding: 10px 0; font-size: 15px; line-height: 1.8; border: 0; background: transparent; width: 100%; color: var(--text-muted); }

/* ---- "Studio letter" — the read-only view shown for an unedited seed note,
   with a call to action instead of a title/textarea editor. ---- */
.note-editor.studio-letter { display: block; padding: clamp(22px, 4vw, 55px); }
.letter-kicker { font: 9px var(--font-mono); letter-spacing: .12em; opacity: .6; }
.studio-letter h1 { font-size: clamp(24px, 3vw, 40px); font-weight: 550; line-height: 1.16; letter-spacing: -.03em; max-width: 680px; margin: 20px 0; }
.letter-body { max-width: 660px; }
.letter-body p { margin: 0 0 20px; font-size: 15px; line-height: 1.85; color: var(--text); }
.letter-body p:first-child { font-size: 19px; line-height: 1.55; }
.letter-actions { display: flex; flex-wrap: wrap; gap: 9px; max-width: 700px; padding-top: 18px; border-top: 1px solid var(--line); }
.letter-actions .btn { white-space: normal; min-height: 42px; line-height: 1.4; }
.note-title:focus-visible, .note-text:focus-visible { outline: none; box-shadow: inset 0 -1px 0 var(--accent); }

@media (max-width: 900px) {
  .note-editor { padding: 18px; }
  .note-title { font-size: 22px; }
}

@media (max-width: 600px) {
  /* The split view hides the list here (shell.css); Notes swaps it for a
     horizontal strip of cards, as the original did, so switching notes
     stays one tap away. */
  .notes-page { display: flex; flex-direction: column; }
  .notes-page .notes-list { display: flex; gap: 6px; flex-shrink: 0; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--line-2); padding: 8px 10px; scroll-snap-type: x proximity; scrollbar-width: none; }
  .notes-page .notes-list::-webkit-scrollbar { display: none; }
  .notes-list-head { flex-direction: column; justify-content: center; gap: 4px; padding: 0 4px 0 0; font-size: 12px; flex-shrink: 0; scroll-snap-align: start; }
  .notes-list-head b { display: none; }
  .notes-list-head .bar-btn { width: 44px; height: 58px; border: 1px dashed var(--line); border-radius: var(--r-sm); font-size: 20px; }
  .note-item { flex: 0 0 150px; width: 150px; min-height: 60px; padding: 9px 10px 9px 12px; scroll-snap-align: start; }
  .note-item + .note-item { margin-top: 0; }
  .note-item::before { left: 10px; right: 10px; top: auto; bottom: 3px; width: auto; height: 2px; transform: scaleX(0); }
  .note-item.active::before { transform: scaleX(1); }
  .note-editor { padding: 16px; flex: 1; min-height: 0; }
  .note-editor-actions { margin-bottom: 10px; }
  .note-title { font-size: 21px; min-height: 40px; }
  .note-text { min-height: 220px; }
}


/* hover affordances only where hover exists — no sticky rings after a tap */
@media (hover: hover) {
  .note-item:hover:not(.active) { background: rgba(255, 255, 255, .045); }
  .btn.btn-danger:hover { border-color: rgba(255, 138, 122, .5); color: #ffb3a8; background: rgba(255, 138, 122, .08); filter: none; }
}