/* owned by the notes screen — prefix .nt- (the sheet renders outside #screen, so it uses the prefix too) */

/* a short list sits in the middle of the screen; a long one starts at the top and scrolls */
.screen.nt-screen { display: flex; flex-direction: column; justify-content: center; min-height: 100dvh; }
.screen.nt-screen.is-held { justify-content: flex-start; }   /* centred when shown, then held (rows.js holdCentre): the composer stays put while notes are added */
.nt-wrap { width: 100%; max-width: 720px; margin: 0 auto; }   /* v6: the same column as Sport (base.css --col-max) */

.nt-title { margin-bottom: 18px; overflow-wrap: anywhere; hyphens: manual; }

/* ---------- composer: a small field that grows while typing ---------- */
.nt-composer {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 7px 7px 7px 14px; border-radius: var(--r-m);
  background: rgb(var(--fg-rgb) / 0.06);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow var(--dur) var(--ease-out), background var(--dur);
}
.nt-composer:focus-within { box-shadow: inset 0 0 0 1.5px var(--line-strong); background: rgb(var(--fg-rgb) / 0.08); }
.nt-input {
  flex: 1; min-width: 0; display: block; min-height: 22px; max-height: 40vh;
  margin: 3px 0; padding: 0; border: 0; background: none; resize: none; outline: none;
  font: 500 16px/1.4 var(--f-sans); letter-spacing: -0.012em; color: var(--fg);
  overflow-wrap: anywhere; word-break: break-word;
}
.nt-input::placeholder { color: var(--faint); font-weight: 450; }
.nt-ok {
  position: relative; flex: none; display: grid; place-items: center;
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%;
  background: rgb(var(--fg-rgb) / 0.1); color: rgb(var(--fg-rgb) / 0.32); cursor: default;
  transition: background 200ms var(--ease-out), color 200ms var(--ease-out), box-shadow 200ms var(--ease-out), transform var(--dur-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
/* grey while the field is empty; the accent colour, with a soft glossy edge, once there is text */
.nt-ok.is-ready {
  background: linear-gradient(180deg, rgb(var(--cta-rgb, var(--accent-rgb)) / 1), rgb(var(--cta-rgb, var(--accent-rgb)) / 0.86)); color: var(--on-accent); cursor: pointer;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.32), inset 0 0 0 1px rgb(255 255 255 / 0.1), 0 6px 14px -8px rgb(var(--cta-rgb, var(--accent-rgb)) / 0.8);
}
.nt-ok::after { content: ''; position: absolute; inset: -7px; }
.nt-ok svg { width: 16px; height: 16px; stroke-width: 2.4; }
.nt-ok.is-ready:active { transform: scale(0.88); }

/* ---------- search (only with more than 8 notes) ---------- */
.nt-searchwrap {
  display: flex; align-items: center; gap: 8px;
  margin-top: 22px; padding: 0 0 8px; border-bottom: 1px solid var(--line);
  color: var(--faint);
}
.nt-searchwrap[hidden] { display: none; }
.nt-searchwrap svg { width: 16px; height: 16px; flex: none; }
.nt-search {
  flex: 1; min-width: 0; padding: 2px 0; border: 0; background: none; outline: none;
  font: 500 14px/1.3 var(--f-sans); letter-spacing: -0.01em; color: var(--fg);
  -webkit-appearance: none; appearance: none;
}
.nt-search::placeholder { color: var(--faint); }
.nt-search::-webkit-search-decoration { -webkit-appearance: none; }
.nt-searchwrap:focus-within { border-bottom-color: var(--line-strong); }

/* ---------- list: quiet rows ---------- */
.nt-list { list-style: none; margin: 14px 0 0; padding: 0; }
.nt-searchwrap:not([hidden]) + .nt-list { margin-top: 0; }
.nt-row {
  display: flex; flex-direction: column; gap: 4px; width: 100%;
  padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); background: none;
  text-align: left; color: var(--fg); cursor: pointer; font-family: var(--f-sans);
  -webkit-tap-highlight-color: transparent;
  transition: opacity var(--dur-fast);
}
.nt-row:active { opacity: 0.6; }
.nt-row__title {
  font-size: 16px; font-weight: 600; line-height: 1.35; letter-spacing: -0.012em;
  overflow-wrap: anywhere; word-break: break-word; hyphens: manual;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.nt-row__when { font-size: var(--t-small); font-weight: 450; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (hover: hover) { .nt-row:hover .nt-row__title { opacity: 0.8; } }
.nt-empty { margin: 18px 0 0; font-size: var(--t-small); color: var(--muted); }
.nt-empty[hidden] { display: none; }

/* ---------- the note sheet ---------- */
.nt-sheet { display: flex; flex-direction: column; gap: 14px; }
.nt-edit {
  display: block; width: 100%; min-height: 140px; max-height: 60dvh;
  padding: 0; margin: 0; border: 0; background: none; resize: none; outline: none;
  font: 450 16px/1.5 var(--f-sans); letter-spacing: -0.01em; color: var(--fg);
  overflow-wrap: anywhere; word-break: break-word; hyphens: manual;
}
.nt-sheet__foot { display: flex; justify-content: flex-start; padding-top: 6px; border-top: 1px solid var(--line); }
.nt-del {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0; border: 0; background: none; cursor: pointer;
  font: 500 13px var(--f-sans); color: var(--muted);
  -webkit-tap-highlight-color: transparent;
}
.nt-del svg { width: 16px; height: 16px; }
@media (hover: hover) { .nt-del:hover { color: var(--red); } }

/* keyboard ring inside the row (PLAN v4 1.10): 8px of inner room each side, the text and the line stay in place */
.nt-row { width: calc(100% + 16px); margin-inline: -8px; padding-inline: 8px; border-radius: 12px; border-bottom: 0; background: linear-gradient(var(--line), var(--line)) bottom center / calc(100% - 16px) 1px no-repeat; }

/* ---------- v8: today's notes, "All notes", pins ---------- */
.nt-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -6px 0 14px; }
.nt-bar__day { min-width: 0; font-size: var(--t-small); font-weight: 500; color: var(--muted); }
.nt-allbtn, .nt-jump { flex: none; gap: 4px; text-decoration: none; }
.nt-allbtn { padding: 0 10px 0 14px; }
.nt-allbtn[hidden], .nt-jump[hidden] { display: none; }
.nt-allbtn svg, .nt-jump svg { width: 15px; height: 15px; }
.nt-backtoday { text-decoration: none; }

/* All notes starts at the top and scrolls (never centred) */
.screen.nt-screen.nt-screen--all { justify-content: flex-start; }
.nt-tools { display: flex; align-items: flex-end; gap: 12px; margin-top: 4px; }
.nt-tools .nt-searchwrap { flex: 1; min-width: 0; margin-top: 0; }
.nt-tools + .nt-list { margin-top: 8px; }
.nt-day { list-style: none; scroll-margin-top: 16px; border-radius: 14px; }
.nt-day + .nt-day { margin-top: 22px; }
.nt-day__t {
  margin: 14px 0 2px; font-size: 13px; font-weight: 600; letter-spacing: 0.02em; color: var(--muted);
  text-transform: none;
}
.nt-day__list { list-style: none; margin: 0; padding: 0; }
.nt-day--pinned .nt-day__t { color: var(--fg); }
.nt-day.is-flash { animation: nt-flash 1.2s var(--ease-out) both; }
@keyframes nt-flash { 0%, 30% { background: rgb(var(--fg-rgb) / 0.07); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .nt-day.is-flash { animation: none; } }

/* a row with its pin on the right; the row line runs under both */
.nt-item { display: flex; align-items: center; gap: 4px; background: linear-gradient(var(--line), var(--line)) bottom center / 100% 1px no-repeat; }
.nt-item .nt-row { flex: 1; min-width: 0; width: auto; margin-right: 0; background: none; }

/* the pin: a quiet outline; filled while the note is pinned */
.nt-pin {
  position: relative; flex: none; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%;
  background: none; color: rgb(var(--fg-rgb) / 0.32); cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: color var(--dur-fast), background var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}
.nt-pin::after { content: ''; position: absolute; inset: -4px; }
.nt-pin svg { width: 17px; height: 17px; transform: rotate(30deg); }
.nt-pin.is-on { color: var(--fg); }
.nt-pin.is-on .pin-head { fill: currentColor; }
.nt-pin:active { transform: scale(0.88); }
@media (hover: hover) { .nt-pin:hover { background: rgb(var(--fg-rgb) / 0.06); color: var(--fg); } }

/* Today (css/screens/today.css draws the notes): the pin beside each closed note, "All notes" at the top */
[data-screen="today"] .td-memo:not(.is-open) { display: flex; align-items: flex-start; gap: 4px; }
[data-screen="today"] .td-memo:not(.is-open) > .td-memo__card { flex: 1; min-width: 0; }
[data-screen="today"] .td-memo__pin { margin-top: 8px; }
[data-screen="today"] .td-body > .td-allnotes.is-top { align-self: flex-end; margin-top: 0; margin-bottom: -4px; }

/* ---------- v8: the letter to yourself — the day it opens (js/screens/letter-sheet.js; the rest is in progress.css) ---------- */
.lt-when {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 40px; margin-top: 10px; padding: 0 12px 0 12px;
  border: 0; border-radius: var(--r-pill); background: rgb(var(--fg-rgb) / 0.07); box-shadow: inset 0 0 0 1px var(--line);
  color: var(--fg); font: 550 14px/1.2 var(--f-sans); letter-spacing: -0.01em; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}
.lt-when svg { flex: none; width: 16px; height: 16px; color: var(--muted); }
.lt-when__t { min-width: 0; overflow-wrap: anywhere; text-align: left; }
.lt-when__more svg { width: 14px; height: 14px; }
.lt-when:active { transform: scale(0.97); }
@media (hover: hover) { .lt-when:hover { background: rgb(var(--fg-rgb) / 0.1); } }

.lt-move { flex: none; margin-left: auto; }
.lt-item__col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lt-item__col .lt-item__main { flex: none; }
