/* grammarfree notes: a calm writing canvas */
.notes-main { padding: 0; }
/* The app fills the window under the sticky site header (--site-head, site.css). */
.notes-app { display: grid; grid-template-columns: 260px minmax(0, 1fr); height: calc(100dvh - var(--site-head)); min-height: 480px; border-top: 1px solid var(--gf-rule); }
.notes-app[hidden] { display: none; }

/* Sidebar */
.notes-side { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--gf-wash); border-right: 1px solid var(--gf-rule); min-height: 0; }
.notes-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.notes-side h1 { font-size: var(--gf-fs-lg); font-weight: 600; margin: 0; }
.notes-search { width: 100%; }
.notes-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.notes-item { display: block; width: 100%; text-align: left; font: inherit; color: var(--gf-ink); background: none; border: 0; border-radius: var(--gf-r-control); padding: 8px 10px; cursor: pointer; }
.notes-item:hover { background: color-mix(in srgb, var(--gf-ink) 6%, transparent); }
.notes-item[aria-current="true"] { background: var(--gf-paper); box-shadow: var(--gf-hairline); }
.notes-item strong { display: block; font-weight: 600; font-size: var(--gf-fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-item time { margin-right: 4px; color: var(--gf-faint); }
.notes-item span { display: block; font-size: var(--gf-fs-xs); color: var(--gf-graphite); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.notes-empty, .notes-privacy { font-size: var(--gf-fs-xs); color: var(--gf-graphite); margin: 0; padding: 0 2px; }
.notes-privacy { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--gf-rule); }

/* Editor */
.notes-editor { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--gf-paper); }
.notes-bar { display: flex; align-items: center; gap: 6px; padding: 8px 16px; font-size: var(--gf-fs-sm); color: var(--gf-graphite); border-bottom: 1px solid var(--gf-rule); flex-wrap: wrap; }
.notes-bar-group { display: flex; align-items: center; gap: 6px; }
.notes-bar-sep { width: 1px; height: 16px; background: var(--gf-rule); margin: 0 4px; }
.notes-status { display: flex; align-items: center; gap: 6px; margin-right: auto; font-size: var(--gf-fs-xs); }
.notes-status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--save-dot); flex-shrink: 0; }
/* The save dot's own states, as the connection dot in settings: grey while an autosave is due,
   green once kept, amber when the open file lacks the latest edits, red when nothing could be kept. */
.notes-status { --save-dot: var(--gf-faint); }
.notes-status[data-tone='saved'] { --save-dot: var(--gf-engagement); }
.notes-status[data-tone='attention'] { --save-dot: var(--gf-warn); }
.notes-status[data-tone='failed'] { --save-dot: var(--gf-correctness); }
.notes-status[data-tone='failed'] [data-status-text] { color: var(--gf-correctness); }
.notes-count { font-size: var(--gf-fs-xs); color: var(--gf-faint); }
.notes-back { display: none; }

/* Title row */
.notes-title-row { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 760px; margin-inline: auto; padding: 24px 24px 0; box-sizing: border-box; }
.notes-title { flex: 1; padding: 0; font-size: 28px; font-weight: 700; border: 0; outline: 0; background: transparent; color: var(--gf-ink); font-family: var(--gf-text); }
.notes-title::placeholder { color: var(--gf-faint); }

/* Body */
.notes-scroll { flex: 1; overflow-y: auto; }
.notes-body { display: block; width: 100%; max-width: 760px; margin-inline: auto; border: 0; outline: 0; background: transparent; color: var(--gf-ink); font-family: var(--gf-text); box-sizing: border-box; padding: 12px 24px 48px; font-size: 17px; line-height: 1.7; min-height: 100%; resize: none; }
.notes-body::placeholder { color: var(--gf-faint); }

/* File menu dropdown */
.notes-menu { position: relative; }
.notes-menu-btn { font: inherit; font-size: var(--gf-fs-sm); font-weight: 500; color: var(--gf-ink); background: none; border: 0; padding: 6px 10px; border-radius: var(--gf-r-control); cursor: pointer; display: flex; align-items: center; gap: 4px; }
.notes-menu-btn:hover { background: color-mix(in srgb, var(--gf-ink) 6%, transparent); }
.notes-menu-btn::after { content: ''; border: 4px solid transparent; border-top-color: currentColor; margin-top: 2px; }
.notes-dropdown { position: absolute; top: 100%; left: 0; margin-top: 4px; background: var(--gf-paper); border-radius: var(--gf-r-control); box-shadow: var(--gf-shadow); padding: 4px; min-width: 200px; z-index: 100; }
.notes-dropdown[hidden] { display: none; }
.notes-dropdown button { width: 100%; text-align: left; font: inherit; font-size: var(--gf-fs-sm); color: var(--gf-ink); background: none; border: 0; padding: 8px 12px; border-radius: 4px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.notes-dropdown button:hover, .notes-dropdown button:focus-visible { background: var(--gf-tint); }
.notes-dropdown button:focus-visible { outline: 2px solid var(--gf-focus, currentColor); outline-offset: -2px; }
.notes-dropdown button span { color: var(--gf-faint); font-size: var(--gf-fs-xs); }
.notes-dropdown hr { border: 0; height: 1px; background: var(--gf-rule); margin: 4px 0; }
.notes-dropdown .notes-recent-label { font-size: var(--gf-fs-xs); color: var(--gf-faint); padding: 8px 12px 4px; font-weight: 500; }
.notes-dropdown .notes-recent-item { padding-left: 20px; }
.notes-dropdown .notes-recent-item { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.notes-dropdown .notes-recent-section[hidden] { display: none; }

/* Mobile */
@media (max-width: 720px) {
  .notes-app { grid-template-columns: minmax(0, 1fr); }
  .notes-app[data-view="list"] .notes-editor, .notes-app[data-view="edit"] .notes-side { display: none; }
  .notes-back { display: inline-flex; }
  .notes-bar { padding-inline: 12px; }
  .notes-title-row, .notes-body { padding-inline: 16px; }
  .notes-bar-sep { display: none; }
}
