/* 2026-10-14 08:15 | y6y.io v2.10 | notepad layout (theme-neutral: colours, lines and shapes come from the shared theme.css tokens)
   Notes list on the left, the editor on the right; below 761 px wide they take turns (list, then the open note). */

.nt-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 22px; align-items: start; }

/* ---------- list ---------- */
.nt-side {
  display: flex; flex-direction: column; gap: 10px; padding: 14px;
  position: sticky; top: 16px; max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); min-height: 0;
}
.nt-side__top, .nt-side__tools { display: flex; gap: 8px; align-items: center; }
.nt-side__top > .ui-btn--primary { flex: 1; }
.nt-side__tools .nt-sort { flex: 1; min-width: 0; min-height: var(--ui-control-sm); padding-top: 4px; padding-bottom: 4px; }
.nt-search { min-height: var(--ui-control-sm); }
.nt-filters { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px; }
.nt-filters__field { display: flex; flex-direction: column; gap: 4px; font-size: var(--ui-fs-label); font-weight: 600; }
.nt-filters__field .ui-field { min-height: var(--ui-control-sm); padding-top: 4px; padding-bottom: 4px; }
.nt-filters__num { max-width: 120px; }
.nt-filters .dz-setting { font-size: var(--ui-fs-label); font-weight: 600; }
.nt-binbar { display: flex; gap: 8px; }
.nt-list__note { margin: 0; }
.nt-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; min-height: 0; margin: 0 -4px; padding: 0 4px 4px; }
.nt-row {
  display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 9px 11px; text-align: left; cursor: pointer;
  background: var(--ui-tint); color: var(--ui-ink); border: var(--ui-line); border-radius: var(--ui-r-control); font: inherit;
}
.nt-row:hover { background: var(--ui-surface); }
.nt-row.is-active { background: var(--ui-highlight-bg); color: var(--ui-highlight-ink); }
.nt-row.is-active .ui-meta { color: inherit; opacity: 0.8; }
.nt-row:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 1px; }
.nt-row__title { display: flex; align-items: center; gap: 6px; font-weight: var(--ui-content-weight); min-width: 0; }
.nt-row__title > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-row__pin { display: inline-flex; flex: none; }
.nt-row__snippet { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-row__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.nt-row__tag { line-height: 16px; }

/* ---------- editor ---------- */
.nt-editor { display: flex; flex-direction: column; gap: 10px; padding: 14px; min-height: calc(100vh - 150px); min-height: calc(100dvh - 150px); }
.nt-editor__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nt-back { display: none; }
.nt-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1; min-width: 0; }
.nt-toolbar__gap { flex: 1; }
.nt-tool { min-width: var(--ui-control-sm); padding: 4px 8px; font-weight: 800; }
.nt-tool--bold { font-weight: 900; }
.nt-tool[aria-pressed="true"] { background: var(--ui-highlight-bg); color: var(--ui-highlight-ink); }
.nt-mic.is-recording, .nt-mic.is-recording:hover { background: var(--ui-danger-bg); color: var(--ui-danger-ink); border-color: var(--ui-danger-line); }
.nt-text {
  flex: 1; min-height: 50vh; resize: none; padding: 14px 16px;
  font-size: 15px; line-height: 1.6; tab-size: 2; white-space: pre-wrap; overflow-wrap: break-word;
}
/* the note's text size is the user's (A- and A+); the interface around it, the hint included, stays smaller */
.nt-text::placeholder { font-size: var(--ui-fs-label); line-height: 1.6; }
.nt-tool--size { min-width: 30px; padding: 4px 6px; }
.nt-text[readonly] { opacity: 0.75; }
.nt-editor__foot { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.nt-status { margin-right: auto; }
.nt-status[data-kind="failed"] { color: var(--ui-failed); font-weight: 700; }
.nt-binnote { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 12px; border: var(--ui-line-dashed); border-radius: var(--ui-r-control); }
.nt-binnote__actions { display: flex; gap: 8px; }

/* dictation strip under the toolbar */
.nt-dict { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; }
.nt-dict.is-warning { border-color: var(--ui-failed); }
.nt-dict__live { display: flex; align-items: center; gap: 10px; }
.nt-dict__level { flex: 1; max-width: 260px; }
.nt-dict__warn { font-weight: 800; color: var(--ui-failed); font-size: var(--ui-fs-label); }
.nt-dict__msg { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.nt-dict__held { display: flex; flex-direction: column; gap: 6px; }
.nt-dict__row { flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
.nt-dict__what { flex: 1; min-width: 160px; font-size: var(--ui-fs-label); }

/* autotext picker (sheet) */
.nt-atlist { display: flex; flex-direction: column; gap: 6px; }
.nt-atlist__item { flex-direction: column; align-items: flex-start; gap: 2px; cursor: pointer; font: inherit; color: var(--ui-ink); text-align: left; width: 100%; }
.nt-atlist__item:hover { background: var(--ui-surface); }
.nt-atlist__name { font-weight: 800; }
.nt-atlist__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* autotext suggestions at the caret */
.nt-textwrap { flex: 1; position: relative; display: flex; min-height: 50vh; }
.nt-atpop { position: absolute; z-index: 30; padding: 4px; display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; box-shadow: var(--ui-shadow-sm); }
.nt-atpop__item {
  display: flex; align-items: baseline; gap: 10px; width: 100%; padding: 7px 10px; border: 0; border-radius: var(--ui-r-control);
  background: none; color: var(--ui-ink); font: inherit; font-size: var(--ui-fs-label); text-align: left; cursor: pointer;
}
.nt-atpop__item.is-active, .nt-atpop__item:hover { background: var(--ui-highlight-bg); color: var(--ui-highlight-ink); }
.nt-atpop__name { font-weight: 800; flex: none; }
.nt-atpop__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0.8; }

/* autotext library (Settings, notepad) and its edit window */
.nt-at__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.nt-at__find { min-height: var(--ui-control-sm); }
.nt-at__list { display: flex; flex-direction: column; gap: 6px; }
.nt-at__item {
  display: flex; align-items: baseline; gap: 14px; width: 100%; padding: 9px 12px; text-align: left; cursor: pointer; font: inherit;
  background: var(--ui-tint); color: var(--ui-ink); border: var(--ui-line); border-radius: var(--ui-r-control);
}
.nt-at__item:hover { background: var(--ui-surface); }
.nt-at__item:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 1px; }
.nt-at__name { font-weight: 800; flex: none; }
.nt-at__preview { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-at__label { display: flex; flex-direction: column; gap: 6px; }
.nt-at__namewrap { display: flex; align-items: center; gap: 4px; }
.nt-at__dot { font-weight: 900; font-size: var(--ui-fs-body); }
.nt-at__namefield { max-width: 320px; }
.nt-at__textfield { min-height: 45vh; min-height: 45dvh; resize: vertical; line-height: 1.55; }
.nt-at__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nt-at__gap { flex: 1; }
.nt-at__link { align-self: flex-start; }

/* ---------- narrow: list and note take turns ---------- */
@media (max-width: 760px) {
  .nt-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .nt-side { position: static; max-height: none; }
  .nt-list { overflow: visible; }
  .nt-layout:not(.is-editing) .nt-editor { display: none; }
  .nt-layout.is-editing .nt-side { display: none; }
  .nt-back { display: inline-flex; }
  .nt-editor { min-height: calc(100vh - 150px); min-height: calc(100dvh - 150px); padding: 10px; }
  .nt-editor__head { align-items: flex-start; }
  .nt-toolbar { flex: 1 1 100%; }
  .nt-toolbar__gap { display: none; }
  .nt-text { padding: 12px; }
}
