/* notes-editor.css: the note editor (notes-editor.js), in notes and in canvas. Copied by shared/sync.sh: edit this
   file, never the copies. Redesigned (2026-11-17) on the design language: the bar is the notes mockup's word bar (words
   on one baseline, on = ink with a rule under it), the writing is 18px with its title the same size in 500, each
   line's syllable count sits in its own column at the right, and the rhyme tints are the eight note colours (--c1 to
   --c8), which keep their values. Interface colours are the tokens (--mute, --rule, --tile, --signal). */

.ne {
  --ok: #4f9a5e; --near: #8fb35a; --loose: #d1a338; --weak: #c98a5a;
  --ne-size: var(--t-write, 18px); --ne-lh: 1.6;
  --ne-count: 48px;   /* the width of the syllable column, right of the text */
  display: flex; flex-direction: column; min-height: 0; height: 100%; color: var(--ink);
  font: var(--w-text) var(--t-body, 14px)/var(--lead, 1.5) var(--font, "Helvetica Neue", Helvetica, Arial, sans-serif); font-variant-numeric: tabular-nums;
}
:root[data-theme="dark"] .ne { --ok: #6fbf7e; --near: #a6c96a; --loose: #d9b34e; --weak: #c9895f; }
/* Registered so the tints can cross-fade. */
@property --tint { syntax: '<color>'; inherits: false; initial-value: transparent; }
@property --fill { syntax: '<color>'; inherits: false; initial-value: transparent; }

/* The bar: groups of words on one baseline, a gap between groups; the save line and the host's words at the end. */
.ne-bar { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 24px 0 12px; border-bottom: 1px solid var(--rule); white-space: nowrap; flex: none; }
.ne-gap { flex: 1; min-width: 4px; }
.ne-grp { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.ne-status { color: var(--mute); min-width: 50px; transition: opacity var(--mid) var(--ease); }
.ne-status::first-letter { text-transform: uppercase; }
.ne-status:empty { opacity: 0; }
.ne-status.warn { color: var(--signal); }
.ne-link { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: var(--mute); cursor: pointer; white-space: nowrap; text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color var(--fast) var(--ease), text-decoration-color var(--fast) var(--ease); }
.ne-link:hover, .ne-link:focus-visible { color: var(--ink); outline: none; }
.ne-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
/* A switch that is on reads ink with a rule under it; off, grey. */
.ne-tog.on, .ne-tog.on:hover { color: var(--ink); text-decoration-color: var(--rule); }
.ne-tog.on:hover { text-decoration-color: currentColor; }
.ne-fontbtn, .ne-bgbtn { color: var(--ink); }
.ne-tools { display: none; align-items: baseline; gap: 2px 12px; }
.ne.ne-lyrics-on .ne-tools { display: inline-flex; flex-wrap: wrap; }
.ne-drawer { display: none; }
/* The host's controls: at the start (back) and the end (share, archive, delete; done on a board). */
.ne-lead:empty, .ne-acts:empty { display: none; }
.ne-lead, .ne-acts { display: inline-flex; align-items: baseline; gap: 2px 14px; }
.ne-act { display: inline-flex; align-items: baseline; gap: 6px; padding: 0; border: 0; border-radius: 0; background: none; color: var(--ink); font: inherit; cursor: pointer; white-space: nowrap; text-decoration: underline; text-decoration-color: var(--rule); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: text-decoration-color var(--fast) var(--ease); }
.ne-act:hover, .ne-act:focus-visible { text-decoration-color: currentColor; outline: none; }
.ne-act:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.ne-act.danger { color: var(--signal); }
.ne-act .ic { display: none; width: 14px; height: 14px; }
.ne-act.strong { font-weight: var(--w-strong, 500); }
.ne-note-line { color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ne-ro .ne-tools .ne-drawer { display: none !important; }

/* The writing, and the rhymes beside it when the lyric tools are on. */
.ne-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 0; transition: grid-template-columns var(--mid) var(--ease); }
/* The side list's width: slimmer in a narrow editor (a panel on a board), so the words keep their room. */
.ne { --ne-side: 300px; }
.ne.ne-narrow { --ne-side: 180px; }
.ne.ne-side-on .ne-main { grid-template-columns: minmax(0, 1fr) var(--ne-side); }
.ne-scroll { overflow-y: auto; min-height: 0; overscroll-behavior: contain; scrollbar-width: none; }
.ne-scroll::-webkit-scrollbar { display: none; }
/* The right padding holds the syllable column; the text is as wide as the paper less that. */
.ne-paper { --ne-lh-now: var(--ne-lh); max-width: 760px; margin: 0; padding: 28px var(--ne-count) 40vh 0; }
.ne .ne-title, .ne .ne-text, .ne .ne-hl { display: block; width: 100%; background: none; border: 0; padding: 0; margin: 0; color: var(--ink); outline: none; resize: none; font-family: var(--ne-font, var(--font)); border-radius: 0; }
.ne input.ne-title { font-size: var(--ne-size); line-height: calc(var(--ne-size) * var(--ne-lh)); font-weight: var(--w-strong, 500); margin-bottom: calc(var(--ne-size) * var(--ne-lh)); padding: 0; border: 0; }
.ne-title::placeholder, .ne-text::placeholder { color: var(--mute); opacity: .6; }

/* The textarea and the layer under it share exact metrics so the drawn words land under the typed ones. */
.ne-wrap { position: relative; }
.ne-text, .ne-hl { font-size: var(--ne-size); line-height: calc(var(--ne-size) * var(--ne-lh-now)); white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; letter-spacing: normal; tab-size: 4; }
/* The textarea holds the caret and the selection; the layer under it draws the words, so its own text is see-through. */
.ne .ne-text { position: relative; min-height: 40vh; overflow: hidden; color: transparent; caret-color: var(--ink); }
.ne-text::selection { background: color-mix(in srgb, var(--ink) 16%, transparent); color: transparent; }
.ne-hl { position: absolute; inset: 0; pointer-events: none; --focus: color-mix(in srgb, var(--ink) 14%, transparent); }
.ne-hl .ln { position: relative; }
/* Section labels (lyric tools on): a line starting with [ */
.ne-hl .ln.section { color: var(--mute); }
.ne-hl .br { opacity: .35; }
/* Formatting, drawn without changing glyph widths so the caret stays true. */
.ne-hl .fb { -webkit-text-stroke: .45px currentColor; }
.ne-hl .fi { display: inline-block; transform: skewX(-11deg); }
.ne-hl .fu { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: var(--mute); }
/* Rhymes: line endings carry a soft tint; the family under the cursor lights in full (its tint, or grey). */
.ne-hl .wd {
  position: relative; --fill: var(--tint);
  background-image: linear-gradient(var(--fill), var(--fill)); background-repeat: no-repeat; background-position: left; background-size: 0% 100%;
  border-radius: var(--radius-small, 1px); padding: 1px 3px; margin: -1px -3px;
  transition: background-size var(--mid) var(--ease), --fill var(--mid) var(--ease), --tint var(--mid) var(--ease);
}
.ne-paper.rhymes-on .ne-hl .wd.end { --fill: color-mix(in srgb, var(--tint) 70%, transparent); background-size: 100% 100%; }
.ne-paper.rhymes-on .ne-hl .wd.on { --fill: var(--focus); background-size: 100% 100%; }
/* Stress: room under each line, then a dot per syllable under each word. */
.ne-text, .ne-hl, .ne-hl .ct { transition: line-height var(--slow) var(--ease); }
.ne-paper.stress-on { --ne-lh-now: 2.2; }
.ne-hl .wd::after {
  content: attr(data-st); position: absolute; left: 3px; bottom: -.95em; font: 7px/1 var(--font); letter-spacing: 2px; color: var(--mute);
  opacity: 0; transform: translateY(-5px); transition: opacity var(--slow) var(--ease), transform var(--slow) var(--ease); pointer-events: none;
}
.ne-paper.stress-on .ne-hl .wd::after { opacity: .9; transform: none; transition-delay: .12s; }
/* Syllables: each line's count in its own column at the right of the text, on the line's first row. */
.ne-hl .ct {
  position: absolute; left: calc(100% + 14px); top: 0; width: calc(var(--ne-count) - 14px); text-align: left;
  font: var(--w-text) var(--t-body, 14px) var(--font); line-height: calc(var(--ne-size) * var(--ne-lh-now)); color: var(--mute);
  opacity: 0; transition: opacity var(--mid) var(--ease), line-height var(--slow) var(--ease); user-select: none;
}
.ne-paper.syl-on .ne-hl .ct { opacity: 1; }
@keyframes ne-tick { from { opacity: 0; } to { opacity: 1; } }
@keyframes ne-fade { from { opacity: 0; } to { opacity: 1; } }
.ne-paper.syl-on .ne-hl .ln.bump .ct { animation: ne-tick var(--mid) var(--ease) both; }

/* The side column: the rhymes and the word counts (tabs when both are on), set like the mockup's panel: a section
   head over an ink hairline, then the rows. */
.ne-side { min-width: 0; overflow: hidden auto; padding-top: 28px; scrollbar-width: none; }
.ne-side::-webkit-scrollbar { display: none; }
.ne-tabs { display: flex; gap: 16px; width: calc(var(--ne-side) - 32px); margin-left: 32px; padding: 0 0 12px; }
.ne-tabs[hidden] { display: none; }

/* The rhyme list. */
.ne-rhymes { min-width: 0; }
.ne-rhymes > * { width: calc(var(--ne-side) - 32px); margin-left: 32px; }
.ne-rhead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: var(--s-gap, 6px); border-bottom: 1px solid var(--ink); margin-bottom: var(--s-line, 12px); }
.ne-rword { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ne-rword::before { content: "Rhymes for "; }
.ne-rword:empty::before { content: "Rhymes"; }
.ne-pin.on { color: var(--ink); }
.ne-pinned { color: var(--mute); margin: -6px 0 14px; }
.ne-pinned button { margin-left: 8px; }
.ne-hint { color: var(--mute); margin: 0; }
.ne-groups { padding-bottom: 60px; }
.ne-groups.enter { animation: ne-fade var(--mid) var(--ease) both; }
.ne-rgroup { padding-bottom: 14px; }
.ne-rgroup h3 { font-size: inherit; font-weight: var(--w-text, 400); color: var(--mute); margin: 0; padding-bottom: 2px; }
.ne-row { display: flex; align-items: baseline; gap: 10px; padding: 1px 0; }
.ne-w { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color var(--fast) var(--ease), text-decoration-color var(--fast) var(--ease); }
.ne-w:hover { text-decoration-color: currentColor; }
.ne-w.copied { color: var(--mute); }
.ne-rate { width: 7px; height: 7px; border-radius: var(--radius-small, 1px); background: var(--rule); flex-shrink: 0; align-self: center; }
.ne-rate[data-r="5"] { background: var(--ok); }
.ne-rate[data-r="4"] { background: var(--near); }
.ne-rate[data-r="3"] { background: var(--loose); }
.ne-rate[data-r="2"] { background: var(--weak); }
.ne-none { color: var(--mute); }

/* Word counts: the most used first, a bar for scale; the chosen word lights everywhere in the text. */
.ne-freq { min-width: 0; padding-bottom: 60px; }
.ne-freq > * { width: calc(var(--ne-side) - 32px); margin-left: 32px; box-sizing: border-box; }
.ne-fsum { color: var(--mute); padding-bottom: 12px; font-variant-numeric: tabular-nums; }
.ne-flist { display: flex; flex-direction: column; }
.ne-frow { display: flex; align-items: center; gap: 12px; padding: 2px 0; margin: 0; border: 0; border-radius: 0; background: none; color: var(--mute); font: inherit; text-align: left; cursor: pointer; width: 100%; transition: color var(--fast) var(--ease); }
.ne-frow:hover, .ne-frow:focus-visible { color: var(--ink); outline: none; }
.ne-frow:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.ne-frow.cur { color: var(--ink); }
.ne-frow.sel { color: var(--ink); }
.ne-fw { flex: 0 1 96px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ne-fbar { flex: 1 1 0; min-width: 20px; height: 4px; border-radius: var(--radius-small, 1px); background: linear-gradient(var(--tick), var(--tick)) left / var(--p) 100% no-repeat; }
.ne-frow:hover .ne-fbar, .ne-frow.sel .ne-fbar { background: linear-gradient(var(--ink), var(--ink)) left / var(--p) 100% no-repeat; }
.ne-fn { flex: none; min-width: 20px; text-align: right; font-variant-numeric: tabular-nums; }
.ne-fall { margin-top: 10px; }
.ne-ffind { display: block; margin-bottom: 8px; }
.ne-ffind[hidden] { display: none; }
.ne-ffind input { width: 100%; box-sizing: border-box; font: inherit; color: var(--ink); background: none; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; padding: 3px 0 4px; outline: none; }
.ne-ffind input:focus { border-bottom-width: 2px; padding-bottom: 3px; }
.ne-ffind input::placeholder { color: var(--mute); opacity: 1; }

/* The note's font: a word in the bar, a short list under it, each name in its own font. */
.ne-fontbtn { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.ne-fontbtn[hidden] { display: none; }
.ne-fmenu { position: absolute; z-index: 30; display: flex; flex-direction: column; min-width: 190px; padding: 4px 0; background: var(--bg); border: 1px solid var(--tick); border-radius: var(--radius, 2px); box-shadow: none; animation: ne-fade var(--fast) var(--ease) both; }
.ne-fopt { padding: 3px 12px 4px; border: 0; border-radius: 0; background: none; color: var(--mute); font-size: var(--t-body, 14px); text-align: left; cursor: pointer; transition: background-color var(--fast) var(--ease); }
.ne-fopt:hover, .ne-fopt:focus-visible { background: var(--tile); color: var(--ink); outline: none; }
.ne-fopt.on { color: var(--ink); }
.ne-fall[hidden] { display: none; }
.ne-hl .wd.fq { --fill: color-mix(in srgb, var(--loose) 45%, transparent); background-size: 100% 100%; }

/* Narrow (under 760px): the margin to the left drops, a slimmer list, and the bar wraps. Stacked (under 440px, a phone): one column; the
   side list is a drawer under the bar, opened with "list". Between the two the list stays on the right. */
.ne.ne-narrow { --ne-count: 40px; }
.ne.ne-narrow .ne-bar { padding-top: 10px; }
.ne.ne-narrow .ne-paper { padding-top: 18px; }
.ne.ne-stack .ne-main, .ne.ne-stack.ne-side-on .ne-main { grid-template-columns: minmax(0, 1fr); grid-template-rows: 0 minmax(0, 1fr); }
.ne.ne-stack.ne-side-on.ne-drawer-open .ne-main { grid-template-rows: minmax(0, 36%) minmax(0, 1fr); }
/* The counts drawer is as tall as its list, up to the same 36%. */
.ne.ne-stack.ne-words-on:not(.ne-drawer-open) .ne-main { grid-template-rows: fit-content(36%) minmax(0, 1fr); }
.ne.ne-stack .ne-freq { padding-bottom: 12px; }
.ne.ne-stack .ne-side { order: -1; padding-top: 12px; border-bottom: 1px solid var(--rule); }
.ne.ne-stack .ne-rhymes > *, .ne.ne-stack .ne-freq > *, .ne.ne-stack .ne-tabs { width: auto; margin-left: 0; }
/* Stacked: the counts in two columns, without the bars. */
.ne.ne-stack .ne-flist { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
.ne.ne-stack .ne-fbar { display: none; }
.ne.ne-stack.ne-lyrics-on .ne-drawer { display: inline; }
.ne.ne-stack.ne-drawer-open .ne-drawer { color: var(--ink); text-decoration-color: var(--rule); }
.ne.ne-narrow .ne-tools { order: 10; flex-basis: 100%; }
@media (prefers-reduced-motion: reduce) { .ne *, .ne *::before, .ne *::after { transition-duration: 0s !important; animation-duration: 0s !important; } }

/* The note's background (2026-10-13): a soft tint or a custom colour behind the whole editor; the bar's square shows it. */
.ne { background: var(--ne-bg, transparent); transition: background-color var(--mid) var(--ease); }
.ne.ne-has-bg .ne-text::selection { background: color-mix(in srgb, var(--ink) 22%, transparent); }
.ne-bgbtn { display: inline-flex; align-items: baseline; gap: 6px; }
.ne-bgbtn[hidden] { display: none; }
.ne-bgdot { display: none; width: 8px; height: 8px; border-radius: var(--radius-small, 1px); background: var(--dot); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 25%, transparent); }
.ne-bgbtn.on .ne-bgdot { display: inline-block; }
