/* The notes app. Loaded by notes/app.js when the overlay unlocks, never with
   the page. Everything is scoped under .nt-app so nothing here can leak into
   the portfolio, and the portfolio's own rules stop at the dialog.

   Colour comes in three layers: the theme (--bg, --tx...), the session
   accent (--c on .nt-app), and each category's own --c on its section and
   its sidebar row. --c-title is the accent as text: as-is on dark, darkened
   on light so a pastel is still readable on a light ground. */

@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 300 800; font-display: swap; src: url(fonts/outfit-300-800.woff2) format('woff2'); }
@font-face { font-family: 'Raleway'; font-style: normal; font-weight: 300 800; font-display: swap; src: url(fonts/raleway-300-800.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 300 800; font-display: swap; src: url(fonts/inter-300-800.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/jetbrains-mono-400-700.woff2) format('woff2'); }
@font-face { font-family: 'Space Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/space-mono-400.woff2) format('woff2'); }
@font-face { font-family: 'Space Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/space-mono-700.woff2) format('woff2'); }

.nt-app {
  --bg: #0B0D11; --bg2: #14171D; --bg3: #1A1E26; --bg4: #222732; --bdr: #292E38;
  --tx: #E8EAF0; --tx2: #82848f; --tx3: #666D79; --tx-body: #C7CBD3;
  --c: #68d121; --c-on: #000; --here: var(--c);
  --c-title: var(--c); --c-bold: var(--tx); --c-body: var(--tx-body); --c-sel: #2a3550;
  --font: 'Outfit', sans-serif; --fs: 17px;
  --hdr: 52px; --sb: 280px; --rail: 50px; --r: 8px;
  --ease: .15s ease;
  --danger: #e05c5c;
  --shadow: 0 10px 40px rgba(0,0,0,.55);
  position: absolute; inset: 0; display: flex; flex-direction: column;
  background: var(--bg); color: var(--tx); font-family: var(--font); font-size: 14px; line-height: 1.4;
  overflow: hidden; -webkit-font-smoothing: antialiased; user-select: none;
  text-align: left; letter-spacing: 0;
}
.nt-app[data-theme="light"] {
  --bg: #B0B7C0; --bg2: #BCC3CB; --bg3: #C5CCD4; --bg4: #CDD4DC; --bdr: #A0A8B2;
  --tx: #1C1F24; --tx2: #3E4550; --tx3: #6A7280; --tx-body: #2b3138;
  --c-title: color-mix(in srgb, var(--c) 62%, #000);
  --c-bold: var(--tx); --c-body: var(--tx-body); --c-sel: #b9c6dd;
  --shadow: 0 10px 40px rgba(0,0,0,.22);
}
.nt-app *, .nt-app *::before, .nt-app *::after { box-sizing: border-box; }
/* :where() so the reset has ZERO specificity. `.nt-app button` is one class
   plus a type, which outranks a plain `.nt-cat-emoji`, so `color: inherit`
   quietly beat every deliberate accent colour set on a button -- the category
   badge's letter was neutral grey no matter what colour the category was. A
   reset must never win against a rule written on purpose. */
:where(.nt-app button) { font: inherit; color: inherit; cursor: pointer; }
:where(.nt-app button:disabled) { cursor: default; opacity: .35; }
.nt-app :focus-visible { outline: 2px solid var(--c-title); outline-offset: 2px; }
.nt-app [contenteditable]:focus-visible { outline: none; }
/* ONE RING, NOT TWO. A field that paints its own focus was getting the
   blanket outline as well, 2px out from its own 2px edge -- and the 2px of
   panel showing between them read as a dark line drawn through the middle of
   a too-thick stroke. It is the one thing the header's search got right
   (.nt-search-input, below) and every other field got wrong. Anything that
   draws its own focus turns this one off; anything that does not still has
   it. */
.nt-app .nt-input:focus, .nt-app .nt-input:focus-visible { outline: none; }
/* The caret and the highlight belong to whatever is being written in, like
   everything else in a category. ::selection reads the custom properties of
   the element it is over, so a body, a title and the sidebar each get their
   own without a rule per place. */
.nt-app ::selection { background: var(--c-sel); }
.nt-app ::-moz-selection { background: var(--c-sel); }
.nt-app svg { width: 18px; height: 18px; display: block; }
.nt-app [hidden] { display: none !important; }

/* light mode's linen ground */
.nt-app[data-theme="light"]::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0; opacity: .55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.38 0 0 0 0 0.42 0 0 0 .18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.nt-app > * { position: relative; z-index: 1; }

/* ---- header ------------------------------------------------------------- */
.nt-header {
  height: var(--hdr); flex: 0 0 auto; position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 0 10px 0 8px; background: var(--bg2); border-bottom: 1px solid var(--bdr); box-shadow: 0 2px 8px rgba(0,0,0,.12); z-index: 5;
}
.nt-app[data-theme="light"] .nt-header { background: rgba(255,255,255,.42); border-color: rgba(255,255,255,.35); }
.nt-header-left, .nt-header-mid, .nt-header-right { display: flex; align-items: center; gap: 2px; min-width: 0; }
/* ABSOLUTELY centred, not centred by a grid track. The header spans the same
   column as the canvas, so the middle of it is the middle of the text below
   -- and nothing put in the left or right slot can shift it off that. A grid
   only centres the middle when the two sides weigh the same, and they never
   will: one of them has the search in it. */
.nt-header-mid { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); white-space: nowrap; }
.nt-header-left, .nt-header-right { min-width: 0; }
.nt-header-right { justify-content: flex-end; gap: 6px; }
.nt-header-right > * { flex: 0 0 auto; }
.nt-header-right .nt-header-search { flex: 0 1 auto; min-width: 0; }
.nt-sep { width: 1px; height: 22px; background: var(--bdr); margin: 0 5px; flex: 0 0 auto; }
.nt-icon-btn {
  width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px; background: none; color: var(--tx2);
  transition: color var(--ease), background var(--ease);
}
.nt-icon-btn:hover { color: var(--tx); background: var(--bg3); }
.nt-icon-btn.is-on { color: var(--c-title); background: color-mix(in srgb, var(--c) 14%, transparent); }
.nt-icon-btn.is-small { width: 26px; height: 26px; } .nt-icon-btn.is-small svg { width: 15px; height: 15px; }
.nt-icon-btn.is-danger:hover { color: var(--danger); }
.nt-icon-btn.is-up svg { transform: rotate(180deg); }
.nt-app:not(.in-body) .nt-fmt { opacity: .55; }
.nt-fmt-list svg { width: 15px; height: 15px; }
/* THE ONE RECTANGULAR CONTROL IN THE HEADER, and it has to be: "abc" with a
   tick through it is readable because it is real text, and real text needs
   the width the letters take. Squeezed into the 34px square every other
   button is, the glyphs came out too small to read as letters at all -- so
   the BUTTON widens as well as the mark. 30x16 is DexNote's own viewBox and
   these are its proportions, scaled up rather than reshaped. */
.nt-spell-btn { width: 42px; }
.nt-spell-btn svg { width: 33px; height: 17.6px; }
/* THE RING IS GONE (Dex, 2026-09-08). It said ON without anyone having to
   compare this button to its neighbours, which is what it was for -- but a
   2px accent box drawn around the one rectangular control in the header read
   as the loudest thing in a row of quiet ones, and it is on nearly all the
   time. What is left is .nt-icon-btn.is-on, the same accent letters and faint
   accent wash every other toggle in the header wears: the mark itself is the
   accent, and that is enough to see at a glance. Deliberately NOT replaced
   with a thinner ring -- the ask was to take it off, not to soften it. */
.nt-pick {
  height: 30px; padding: 0 22px 0 10px; border: 1px solid var(--bdr); border-radius: 7px; background: var(--bg3); color: var(--tx); font-size: 13px;
  position: relative; white-space: nowrap; min-width: 88px; text-align: left;
}
.nt-pick-size { min-width: 52px; }
.nt-pick::after { content: ""; position: absolute; right: 8px; top: 50%; margin-top: -2px; border: 4px solid transparent; border-top-color: currentColor; opacity: .55; }
.nt-pick:hover { border-color: var(--c-title); }
.nt-theme { position: relative; overflow: hidden; }
.nt-theme svg { position: absolute; transition: transform .45s cubic-bezier(.4,0,.2,1), opacity .35s ease; }
.nt-theme svg:first-child { transform: translate(-22px, 22px); opacity: 0; }
.nt-theme svg:last-child { transform: translate(0,0); opacity: 1; }
.nt-app[data-theme="light"] .nt-theme svg:first-child { transform: translate(0,0); opacity: 1; }
.nt-app[data-theme="light"] .nt-theme svg:last-child { transform: translate(22px, 22px); opacity: 0; }
.nt-status {
  font-size: 10.5px; font-weight: 800; letter-spacing: .12em; color: var(--tx3); white-space: nowrap; margin: 0 6px; text-align: right; overflow: hidden; text-overflow: ellipsis;
  transition: color .2s ease;
}
.nt-status.is-saving { color: var(--tx2); }
.nt-status.is-error { color: var(--danger); }
.nt-close:hover { color: var(--danger); }

/* The DexNote mark as the session's colour swatch: in the sidebar head and
   on the canvas title, and clicking either opens the picker. Two strokes of
   the one colour, the lower one darker, which is how the mark is drawn. */
.nt-logo-btn { flex: 0 0 auto; display: grid; place-items: center; border: 0; background: none; padding: 0; transition: transform var(--ease); }
.nt-logo-btn:hover { transform: scale(1.12); }
.nt-logo-btn svg { width: 100%; height: 100%; }
/* BOTH STROKES, ONE COLOUR. The mark is drawn as two paths and DexNote
   shades the lower one, but as a session's colour swatch that shading reads
   as two different sessions rather than as one mark with depth -- and the
   thing it is a swatch OF is a single colour. */
.nt-logo-top, .nt-logo-bottom { fill: var(--c); }

/* search */
.nt-header-search { display: flex; align-items: center; }
/* Rests as its own icon and opens on a click. A 250px field parked in the
   header is 250px of pressure on where everything else sits; as an icon it is
   34, and the group above the text stays above the text. */
.nt-search {
  display: flex; align-items: center; gap: 4px; height: 34px; width: 34px; padding: 0;
  border-radius: 20px; background: var(--bg3); border: 1.5px solid transparent; overflow: hidden;
  transition: width .18s ease, padding .18s ease, border-color var(--ease);
}
.nt-search.is-open { width: 254px; padding: 0 6px 0 0; }
.nt-search.is-open:focus-within { border-color: var(--c-title); box-shadow: 0 0 0 1px var(--c-title); }
.nt-search-btn { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--tx2); padding: 0; transition: color var(--ease); }
.nt-search-btn svg { width: 15px; height: 15px; }
.nt-search-btn:hover { color: var(--tx); }
.nt-search.is-open .nt-search-btn { color: var(--c-title); }
/* display:none rather than clipped, so nothing in a shut field can be tabbed
   into or read out. */
.nt-search:not(.is-open) .nt-search-input,
.nt-search:not(.is-open) .nt-search-count,
.nt-search:not(.is-open) .nt-icon-btn { display: none; }
/* No ring of its own: the pill around it already shows the focus, and two
   rings one inside the other read as a mistake. */
.nt-search-input { flex: 1; min-width: 0; border: 0; background: none; color: var(--tx); font: inherit; font-size: 13.5px; outline: none; }
.nt-search-input:focus-visible { outline: none; }
.nt-search-input::placeholder { color: var(--tx3); }
.nt-search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.nt-search-count { font-size: 11px; color: var(--tx2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nt-search-count.is-none { color: var(--danger); }
.nt-search .nt-icon-btn { flex: 0 0 auto; }

/* The tab that folds the sidebar away, level with the top of the archive --
   a tab ON that divider rather than a control floating on an edge. It lives
   outside the sidebar because the sidebar clips its own overflow, and
   render.syncTab() keeps --tab-y level with the archive as it moves. */
.nt-sb-tab {
  position: absolute; left: var(--sb); top: var(--tab-y, 50%); z-index: 22;
  width: 19px; height: 52px; display: grid; place-items: center; padding: 0;
  background: var(--bg2); border: 1px solid var(--bdr); border-left: 0; border-radius: 0 11px 11px 0;
  color: var(--tx3); transition: left .22s ease, color var(--ease), background var(--ease);
}
.nt-app.is-rail .nt-sb-tab { left: var(--rail); }
.nt-sb-tab svg { width: 11px; height: 11px; transition: transform .22s ease; }
.nt-app.is-rail .nt-sb-tab svg { transform: scaleX(-1); }
.nt-sb-tab:hover { color: var(--c-title); background: var(--bg3); }
.nt-app[data-theme="light"] .nt-sb-tab { background: rgba(255,255,255,.5); }

/* ---- frame -------------------------------------------------------------- */
/* The sidebar runs the full height of the window and the header spans only
   the column beside it -- which is what puts the session's name, emoji and
   colour at the very top-left of the screen. */
.nt-frame { flex: 1 1 auto; min-height: 0; display: flex; }
.nt-col { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; }

/* ---- sidebar ------------------------------------------------------------ */
.nt-sidebar {
  flex: 0 0 var(--sb); width: var(--sb); position: relative; display: flex; background: #11141A; border-right: 1px solid var(--bdr);
  transition: flex-basis .22s ease, width .22s ease; overflow: hidden;
}
.nt-app[data-theme="light"] .nt-sidebar { background: rgba(255,255,255,.34); border-color: rgba(255,255,255,.3); }
.nt-app.is-rail .nt-sidebar { flex-basis: var(--rail); width: var(--rail); }
.nt-sidebar-panel { flex: 1 1 auto; min-width: var(--sb); display: flex; flex-direction: column; transition: opacity .18s ease, transform .22s ease; }
.nt-app.is-rail .nt-sidebar-panel { opacity: 0; pointer-events: none; transform: translateX(-100%); position: absolute; inset: 0; }
.nt-sidebar-top { display: flex; align-items: center; gap: 9px; height: var(--hdr); padding: 0 10px; border-bottom: 1px solid var(--bdr); }
.nt-sidebar-top .nt-logo-btn { width: 26px; height: 26px; }
.nt-session-btn, .nt-rail-session {
  width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 18%, transparent);
  color: var(--c-title); font-weight: 800; font-size: 15px; padding: 0; transition: transform var(--ease), background var(--ease);
}
.nt-session-btn.is-emoji, .nt-rail-session.is-emoji { font-size: 19px; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.nt-session-btn:hover, .nt-rail-session:hover { transform: scale(1.08); background: color-mix(in srgb, var(--c) 30%, transparent); }
/* Renamed where it is read. Double-click, and it is a field. */
.nt-sidebar-session-title {
  flex: 1; min-width: 0; font-size: 17px; font-weight: 800; color: var(--c-title);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 3px 5px; border-radius: 6px;
  cursor: default; caret-color: var(--c-title);
}
.nt-sidebar-session-title:hover { background: color-mix(in srgb, var(--c) 10%, transparent); }
.nt-sidebar-session-title.is-editing,
.nt-row-title.is-editing {
  cursor: text; user-select: text; background: color-mix(in srgb, var(--c) 16%, transparent);
  outline: 1.5px solid var(--c-title); overflow: visible; text-overflow: clip;
}
.nt-row-title.is-editing { border-radius: 5px; padding: 1px 4px; margin: -1px -4px; }
/* The list and the archive share the leftover height, and the number is
   dragged on the edge between them (--list-flex / --arch-flex, saved). */
/* NO GUTTER ANY MORE. The tab used to open into 26px reserved inside this
   column, which every row paid for in width and which put the X in the same
   box as the names. It opens outside the panel now (see .nt-row-x), so the
   rows get that width back and the colour dot is at the row's own edge. */
.nt-rows { flex: var(--list-flex, 72) 1 0; min-height: 0; overflow-y: auto; padding: 8px 8px 20px 6px; scrollbar-width: thin; scrollbar-color: var(--bdr) transparent; }
.nt-row {
  display: flex; align-items: center; gap: 6px; min-height: 34px; padding: 3px 4px 3px 2px; margin: 1px 0; border-radius: var(--r); cursor: pointer;
  color: var(--c-title); position: relative; transition: background var(--ease), opacity var(--ease);
}
.nt-row:hover, .nt-row.is-here { background: var(--bg3); }
.nt-app[data-theme="light"] .nt-row:hover, .nt-app[data-theme="light"] .nt-row.is-here { background: rgba(255,255,255,.38); }
.nt-row.is-here { box-shadow: inset 3px 0 0 var(--c); }
.nt-row.is-dim { opacity: .3; }
.nt-row.is-collapsed .nt-row-title { opacity: .6; }
.nt-row.is-dragging { opacity: .3; }
.nt-row.is-ghost { position: fixed; z-index: 60; pointer-events: none; background: var(--bg4); box-shadow: var(--shadow); opacity: .92; }
/* Carrying more than one: the ghost says how many rather than pretending to
   be a stack, because a stack of four rows under the pointer covers the gap
   the drop line is trying to show you. */
.nt-row.is-ghost[data-carry]::after {
  content: attr(data-carry); position: absolute; top: -6px; right: -6px;
  min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center;
  border-radius: 9px; background: var(--c); color: var(--c-on); font-size: 11px; font-weight: 800;
}
/* PICKED, and the mark is the same in both lists. A ring rather than a fill:
   every row already carries its category's colour as a background on hover
   and as a bar when it is the one being read, and a third fill in that stack
   is a row you cannot tell the state of. */
.nt-row.is-picked, .nt-arch-row.is-picked {
  background: color-mix(in srgb, var(--c) 16%, transparent);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c-title) 60%, transparent);
}
.nt-row.is-picked.is-here { box-shadow: inset 3px 0 0 var(--c), inset 0 0 0 1.5px color-mix(in srgb, var(--c-title) 60%, transparent); }
/* While a pick is up, the controls on its rows are permanently visible: they
   are about to act on all of them, and a control that appears only under the
   pointer cannot say that it is aimed at four rows. */
.nt-app.has-picks .nt-row.is-picked .nt-row-x { opacity: .85; pointer-events: auto; clip-path: inset(0); }
.nt-row-grip { width: 16px; height: 28px; display: grid; place-items: center; color: var(--tx3); opacity: 0; cursor: grab; flex: 0 0 auto; touch-action: none; }
.nt-row-grip svg { width: 14px; height: 14px; }
/* On hover, and on the category you are actually in: a handle that appears
   only under the pointer is a handle you have to go looking for. */
.nt-row:hover .nt-row-grip, .nt-row.is-here .nt-row-grip, .nt-row:focus-within .nt-row-grip { opacity: .7; }
.nt-row-grip:active { cursor: grabbing; }
.nt-row-badge, .nt-rail-cat {
  width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; border: 0; padding: 0;
  background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c-title); font-weight: 800; font-size: 13px; text-transform: uppercase;
}
.nt-row-badge.is-emoji, .nt-rail-cat.is-emoji { font-size: 17px; text-transform: none; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
button.nt-row-badge:hover { background: color-mix(in srgb, var(--c) 30%, transparent); }
.nt-row-title { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
/* THE DOT DOES NOT MOVE (Dex, 2026-09-10), AND THE TAB IS OUTSIDE THE PANEL
   (Dex, 2026-09-11). Two reports about the same 22px.

   The first: the X used to sit last in the row and animate its own width open,
   which pushed the colour dot left -- so the one control you aim at
   deliberately slid out from under the pointer on its way to being clicked. A
   button that moves while you are reaching for it is a button you miss. The X
   left the flow for that, and became a tab on the row's right edge.

   The second: that tab opened into a gutter reserved INSIDE the column, so it
   was still in the same box as the names and every row was 26px narrower to
   pay for it. It comes out past the SIDEBAR's right edge now, over the canvas,
   as though it had been behind the panel all along -- and the dot goes back to
   where it was before any of this.

   position: FIXED, because both ancestors clip: .nt-rows scrolls (overflow-y
   on a box makes overflow-x clip too) and .nt-sidebar is overflow:hidden. Out
   of both, it has no layout position of its own left to inherit, so it is TOLD
   where to sit -- placeRowTabs() in render.js, the same arrangement the
   collapse tab has always used.

   IT IS STILL A CHILD OF THE ROW. That is what keeps `.nt-row:hover` true
   while the pointer is on the tab itself -- :hover walks up the DOM, not the
   painted boxes -- so crossing the sidebar's edge to reach it does not make it
   disappear on the way, and the row stays the thing it belongs to.

   AND .nt-row::after BRIDGES THE GAP BETWEEN THEM. The row ends at the
   column's padding edge and the tab starts at the panel's, which measured 8px
   apart -- 8px that belong to .nt-rows and to nothing else, so the pointer
   crossing them dropped :hover, the tab began to fade AND its pointer-events
   went with it. It was not reachable at all (Dex, 2026-09-12). The strip is an
   invisible pseudo-element hanging off the row's right edge, clipped by the
   column's own padding box, which is the whole width it needs to cover. It
   costs no layout and paints nothing; what it does is make the path from the
   name to the X continuous.

   It is also the other half of "show the X if I hover the space beside a
   category": the strip IS the row for :hover purposes, so pointing at that gap
   highlights the row and brings its tab out without ever touching the row.

   POINTER-EVENTS FOLLOW THE PAINT. The tab is always there at full size and
   clipped to nothing, so it can animate on the compositor -- but a 24px
   invisible button beside every row would be 24px of accidental archiving, so
   it is only clickable while it is actually showing. */
.nt-row-color { width: 13px; height: 13px; flex: 0 0 auto; border-radius: 50%; border: 0; padding: 0; background: var(--c); opacity: .8; margin: 0 2px; transition: transform var(--ease), opacity var(--ease); }
.nt-row-color:hover { transform: scale(1.3); opacity: 1; }
.nt-row::after { content: ""; position: absolute; left: 100%; top: 0; bottom: 0; width: 14px; }
.nt-row-x {
  position: fixed; transform: translateY(-50%); z-index: 15;
  width: 24px; height: 28px; display: grid; place-items: center; overflow: hidden;
  border: 0; border-radius: 0 9px 9px 0; padding: 0;
  background: var(--bg4); color: var(--tx2);
  box-shadow: 3px 0 10px rgba(0,0,0,.35);
  opacity: 0; pointer-events: none;
  clip-path: inset(0 100% 0 0);
  transition: opacity var(--ease), clip-path var(--ease), color var(--ease), background var(--ease);
}
.nt-row-x svg { width: 13px; height: 13px; }
.nt-row:hover .nt-row-x, .nt-row:focus-within .nt-row-x {
  opacity: 1; pointer-events: auto; clip-path: inset(0);
}
.nt-row-x:hover { color: #fff; background: var(--danger); }
@media (prefers-reduced-motion: reduce) { .nt-row-x { transition: opacity var(--ease); } }
.nt-drop-marker { height: 2px; margin: 0 6px; background: var(--c-title); border-radius: 1px; }
.nt-drop-marker.is-rail { margin: 0 7px; }
.nt-rail-cat.is-dragging { opacity: .3; }
.nt-rail-cat.is-ghost { position: fixed; z-index: 60; pointer-events: none; box-shadow: var(--shadow); opacity: .92; }
.nt-rail-cat { touch-action: none; }

.nt-archive { flex: 0 0 auto; border-top: 1px solid var(--bdr); display: flex; flex-direction: column; position: relative; }
.nt-archive.is-open { flex: var(--arch-flex, 28) 1 0; min-height: 92px; }
/* The grab edge. Invisible until the sidebar is under the pointer, because a
   handle you are not reaching for is furniture. */
.nt-archive-grip { position: absolute; top: -5px; left: 0; right: 0; height: 10px; cursor: ns-resize; z-index: 3; }
.nt-archive:not(.is-open) .nt-archive-grip { display: none; }
.nt-archive-grip::after { content: ""; position: absolute; left: 14px; right: 14px; top: 4px; height: 2px; border-radius: 1px; background: transparent; transition: background var(--ease); }
.nt-sidebar:hover .nt-archive-grip::after { background: color-mix(in srgb, var(--bdr) 90%, transparent); }
.nt-archive-grip:hover::after, .nt-sidebar.is-splitting .nt-archive-grip::after { background: var(--c-title); }
.nt-sidebar.is-splitting { cursor: ns-resize; user-select: none; }
.nt-archive-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 0; background: none; color: var(--tx2); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-align: left; }
.nt-archive-head:hover { color: var(--tx); }
.nt-archive-count { font-size: 11px; color: var(--tx3); font-weight: 600; letter-spacing: 0; }
/* Two arms, flat while the archive is open and folded into a chevron when it
   is not -- the same mark doing both jobs, so the header never grows a
   second control. */
.nt-archive-arms { margin-left: auto; display: grid; color: var(--tx3); }
.nt-archive-arms svg { width: 14px; height: 10px; }
.nt-arm-l, .nt-arm-r { transition: transform .2s ease; transform-origin: 7px 5px; }
.nt-archive:not(.is-open) .nt-arm-l { transform: rotate(-40deg); }
.nt-archive:not(.is-open) .nt-arm-r { transform: rotate(40deg); }
.nt-archive-head:hover .nt-archive-arms { color: var(--tx); }
.nt-archive-list { display: none; overflow-y: auto; padding: 0 6px 8px; scrollbar-width: thin; }
.nt-archive.is-open .nt-archive-list { display: block; flex: 1 1 auto; min-height: 0; }
.nt-archive.is-empty .nt-archive-list::after { content: "Nothing archived"; display: block; padding: 4px 10px 6px; font-size: 12px; font-style: italic; color: var(--tx3); }
.nt-arch-row { display: flex; align-items: center; gap: 6px; padding: 2px 4px; border-radius: 6px; color: var(--tx2); }
.nt-arch-row:hover { background: var(--bg3); }
.nt-arch-row .nt-row-badge { width: 22px; height: 22px; font-size: 11px; opacity: .7; }
.nt-arch-row .nt-row-badge.is-emoji { font-size: 14px; }
.nt-arch-row .nt-row-title { font-size: 13px; font-weight: 500; }
.nt-sidebar-foot { padding: 8px 10px 10px; border-top: 1px solid var(--bdr); display: flex; flex-direction: column; gap: 6px; }
.nt-add-btn, .nt-add-bottom {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 12px; border: 1.5px solid color-mix(in srgb, var(--tx3) 60%, transparent); border-radius: 10px;
  background: none; color: var(--tx); font-size: 14px; font-weight: 700; opacity: .8; transition: all var(--ease);
}
.nt-add-btn:hover, .nt-add-bottom:hover { opacity: 1; color: var(--c-title); border-color: var(--c-title); box-shadow: inset 0 0 0 1px var(--c-title); }
.nt-add-bottom svg { width: 16px; height: 16px; }
/* THE LABEL IS CENTRED IN THE BUTTON AND THE MARK IS PINNED TO ITS RIGHT
   EDGE. The two words then line up with each other down the column and the
   two marks line up with each other down the right, so New Category and My
   Sessions read as one panel rather than as two adjacent buttons.
   Absolutely placed, not space-between: with space-between the label's centre
   moves with the mark's width, and the plus and the logo are not the same
   width. The padding is what keeps a long label off the mark. */
.nt-add-btn { position: relative; padding: 9px 42px; }
.nt-add-mark { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; }
/* The plus sits ON the session's colour, so whether it is drawn black or
   white is measured (contrastOn in color.js compares both) rather than
   guessed -- a light blue session used to get a white plus on it. */
.nt-add-plus { background: var(--c); color: var(--c-on); }
/* Heavier than the 2px every other icon is drawn at, and a size up. At 16px
   and hairline weight it read as a faint cross on a colour rather than as
   the button's verb. */
.nt-add-plus svg { width: 19px; height: 19px; stroke-width: 3; }
.nt-rail-add svg { width: 21px; height: 21px; stroke-width: 3; }
.nt-add-logo svg { width: 23px; height: 23px; }

/* The sessions, listed, over their own button. Only where there is room to
   read a name: the rail has the same set behind its badge.

   A SHEET, NOT A SECTION. As a block in the column it pushed the archive and
   everything else down the moment it opened and pulled it back up when it
   shut, so asking what the sessions were rearranged the sidebar twice. It is
   pinned to the top edge of the button that opens it and lies over whatever
   is above -- the New Category button, and as much of the archive as it
   needs. Nothing underneath moves. */
.nt-sess-dock { position: relative; }
.nt-sesslist {
  display: none; position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 12;
  padding: 0; background: var(--bg2); border: 1px solid var(--bdr); border-radius: 12px; box-shadow: var(--shadow);
  overflow: hidden;
}
.nt-app[data-theme="light"] .nt-sesslist { background: #cfd5dc; }
.nt-app.show-sessions .nt-sesslist { display: block; animation: nt-pop .12s ease-out; }
@media (prefers-reduced-motion: reduce) { .nt-app.show-sessions .nt-sesslist { animation: none; } }
/* THE RAIL'S DOCK IS OUTSIDE THE SIDEBAR and told where to sit -- the same
   arrangement as the collapse tab, and for the same reason: the sidebar clips
   its own overflow, so a sheet opening to the right of a 50px rail would
   never be seen. app.js positions it against the rail button's own rect. */
.nt-sess-dock.is-rail { position: absolute; z-index: 30; }
.nt-sess-dock.is-rail .nt-sesslist { position: static; width: 252px; }
/* A window rather than a list that appeared: it says what it is, it can be
   shut from inside itself, and the one thing that is not a session in it gets
   a button of its own instead of a row pretending to be one. */
.nt-sesslist-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 8px 9px 14px; border-bottom: 1px solid var(--bdr);
  font-size: 16px; font-weight: 700; color: var(--tx);
}
.nt-sesslist-x { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--tx3); }
.nt-sesslist-x svg { width: 16px; height: 16px; }
.nt-sesslist-x:hover { color: var(--danger); background: var(--bg4); }
.nt-sesslist-rows { max-height: 40vh; overflow-y: auto; padding: 5px; scrollbar-width: thin; }
.nt-sesslist-foot { padding: 6px 8px 8px; border-top: 1px solid var(--bdr); display: flex; align-items: stretch; gap: 6px; }
/* THE MIDDLE OF THE ROW, not the whole of it any more. flex-basis 0 with
   min-width 0, not `width: 100%`: a 100% basis beside two 38px squares and
   two gaps overflows its own row, and a flex item's default min-width of
   auto will not let it shrink back. */
.nt-sesslist-new {
  flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 12px;
  border: 1.5px solid color-mix(in srgb, var(--tx3) 60%, transparent); border-radius: 10px;
  background: none; color: var(--tx); font-size: 14px; font-weight: 700; transition: all var(--ease);
}
.nt-sesslist-new svg { width: 16px; height: 16px; }
/* SQUARE, and the same height as New rather than a fixed one, so the row is
   one shape however the middle button is sized. */
.nt-sesslist-io {
  flex: 0 0 auto; width: 38px; display: grid; place-items: center; padding: 0;
  border: 1.5px solid color-mix(in srgb, var(--tx3) 45%, transparent);
  border-radius: 10px; background: none; color: var(--tx2);
  transition: color var(--ease), border-color var(--ease), background var(--ease);
}
.nt-sesslist-io svg { width: 18px; height: 18px; }
.nt-sesslist-io:hover { color: var(--c-title); border-color: var(--c-title); background: color-mix(in srgb, var(--c) 12%, transparent); }
.nt-sesslist-new:hover { color: var(--c-title); border-color: var(--c-title); box-shadow: inset 0 0 0 1px var(--c-title); }
/* ALWAYS THERE, dim, and red under the pointer. Hidden until hover it left a
   row ending in a bare number -- the count of its categories, floating with
   nothing beside it -- and the row looked unfinished rather than tidy. */
/* THE ROW'S OWN COLOUR. paintColor() writes --c-title per row, so the count
   and the X are the same colour as the name beside them -- the session's.
   In the shared grey they disappeared into the tinted ground of whichever
   row was active, which is the same complaint the category strip had. */
.nt-sess-row-x { width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--c-title); opacity: .75; transition: opacity var(--ease), color var(--ease); }
.nt-sess-row-x svg { width: 16px; height: 16px; }
.nt-sess-row:hover .nt-sess-row-x { opacity: 1; }
.nt-sess-row-x:hover { opacity: 1; color: var(--danger); background: var(--bg4); }
.nt-sess-row {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 3px 6px; margin: 1px 0;
  border: 0; border-radius: var(--r); background: none; color: var(--c-title); cursor: pointer; text-align: left;
}
.nt-sess-row:hover { background: var(--bg3); }
.nt-sess-row.is-active { background: color-mix(in srgb, var(--c) 14%, transparent); box-shadow: inset 3px 0 0 var(--c); }
.nt-sess-row .nt-row-badge { width: 24px; height: 24px; font-size: 12px; }
.nt-sess-row .nt-row-badge.is-emoji { font-size: 15px; }
.nt-sess-row .nt-row-title { font-size: 18px; font-weight: 600; }
.nt-sess-count { font-size: 15px; color: var(--c-title); opacity: .85; font-variant-numeric: tabular-nums; }


/* the rail */
.nt-rail { position: absolute; inset: 0; width: var(--rail); display: none; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0 8px; }
.nt-app.is-rail .nt-rail { display: flex; }
.nt-rail-session { margin-bottom: 4px; }
.nt-rail-cats { flex: 1 1 auto; min-height: 0; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; overflow-y: auto; overflow-x: hidden; padding: 4px 0; scrollbar-width: none; }
.nt-rail-cats::-webkit-scrollbar { display: none; }
.nt-rail-cat { width: 32px; height: 32px; font-size: 15px; background: none; transition: transform var(--ease), background var(--ease); }
.nt-rail-cat.is-emoji { font-size: 20px; }
.nt-rail-cat:hover { background: color-mix(in srgb, var(--c) 18%, transparent); transform: scale(1.1); }
.nt-rail-cat.is-here { box-shadow: 0 0 0 1.5px var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); transform: scale(1.12); }
.nt-rail-cat.is-dim { opacity: .3; }
/* The rail's foot is the panel's foot in miniature and in the same order:
   New Category, then My Sessions under it. Folding the outliner takes a
   label away, not a door. */
.nt-rail-foot { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.nt-rail-add { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 10px; padding: 0; background: var(--c); color: var(--c-on); }
.nt-rail-add:hover { filter: brightness(1.1); }
.nt-rail-sessions {
  width: 36px; height: 36px; display: grid; place-items: center; padding: 0;
  border: 1.5px solid color-mix(in srgb, var(--tx3) 60%, transparent); border-radius: 10px; background: none;
  transition: border-color var(--ease), background var(--ease);
}
.nt-rail-sessions svg { width: 23px; height: 23px; }
.nt-rail-sessions:hover, .nt-rail-sessions[aria-expanded="true"] { border-color: var(--c-title); background: color-mix(in srgb, var(--c) 14%, transparent); }

/* ---- canvas --------------------------------------------------------------- */
/* position:relative for the slide layer alone -- see .nt-slide-layer below. */
.nt-main { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; position: relative; }
.nt-canvas { flex: 1 1 auto; min-width: 0; overflow-y: auto; overflow-x: hidden; scroll-behavior: auto; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--here) 55%, transparent) transparent; outline: none; }
.nt-canvas::-webkit-scrollbar { width: 8px; }
.nt-canvas::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--here) 55%, transparent); border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { .nt-canvas { scroll-behavior: auto; } }
/* --gutter is the room the chevron and the emoji live in, to the LEFT of
   every text box. It is left padding on the column, not an indent on the
   boxes, which is what keeps the boxes' left edge and the New category
   button's left edge on the same line. */
.nt-canvas-inner { --gutter: 74px; max-width: 1100px; margin: 0 auto; padding: 30px 44px 45vh var(--gutter); }

/* ---- the slide between sessions ---------------------------------------------
   The page you are leaving is a copy that gets pushed off in the direction of
   the session you picked, while the real one comes in from the other side.

   THE COPY LIVES IN ITS OWN LAYER OVER .nt-canvas, never inside it. Everything
   in the app that looks for a category or a body does it through the canvas,
   and a second set of them sitting in there for the length of an animation is
   a scroll spy counting sections twice and a save walking bodies belonging to
   a session nobody is in. The layer clips, so neither half of the swap can
   push a scrollbar out of the window. */
.nt-slide-layer { position: absolute; inset: 0; z-index: 3; overflow: hidden; pointer-events: none; }
.nt-slide-ghost {
  position: absolute; left: 0; right: 0; max-width: 1100px; margin: 0 auto; padding: 30px 44px 0;
  transition: transform .38s cubic-bezier(.4,0,.2,1), opacity .38s ease;
}
.nt-slide-ghost.is-out-left { transform: translateX(-100%); opacity: 0; }
.nt-slide-ghost.is-out-right { transform: translateX(100%); opacity: 0; }
.nt-canvas-inner.is-sliding { transition: transform .38s cubic-bezier(.4,0,.2,1), opacity .38s ease; }
.nt-canvas-inner.is-from-right { transform: translateX(100%); opacity: 0; }
.nt-canvas-inner.is-from-left { transform: translateX(-100%); opacity: 0; }
.nt-session-head { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; padding-bottom: 12px; border-bottom: 4px solid color-mix(in srgb, var(--c) 30%, transparent); }
.nt-app[data-theme="light"] .nt-session-head { background: rgba(255,255,255,.35); border-bottom: 0; border-radius: 9999px; padding: 10px 18px; margin: 0 -14px 28px; }
.nt-session-emoji {
  width: 46px; height: 46px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; border: 0; padding: 0;
  background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c-title); font-weight: 800; font-size: 20px; text-transform: uppercase;
}
.nt-session-emoji.is-emoji { font-size: 28px; text-transform: none; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.nt-session-emoji:hover { background: color-mix(in srgb, var(--c) 30%, transparent); }
.nt-session-title {
  flex: 1; min-width: 0; margin: 0; padding: 2px 8px; border-radius: 6px; font-size: 34px; font-weight: 700; line-height: 1.2; color: var(--c-title); user-select: text;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; caret-color: var(--c-title);
}
.nt-session-title:hover { background: color-mix(in srgb, var(--c) 8%, transparent); }
.nt-session-title:focus { background: color-mix(in srgb, var(--c) 12%, transparent); white-space: normal; text-overflow: clip; }
.nt-session-addtop { opacity: 0; transition: opacity var(--ease); }
.nt-session-head:hover .nt-session-addtop { opacity: 1; }
.nt-session-color { width: 32px; height: 32px; }
.nt-canvas.is-empty .nt-cats::before { content: "Add a category to get started."; display: block; text-align: center; color: var(--tx3); padding: 40px 0; }

/* category */
.nt-cat { margin: 0 0 26px; border-radius: 12px; position: relative; }
.nt-cat.is-new { animation: nt-fadeup .25s ease-out; }
@keyframes nt-fadeup { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* THE TITLE ROW IS INSIDE THE TEXT BOX. The chevron and the emoji are the
   only two things outside it, in an aside to the left, level with the row.

   .nt-cat-box carries the BODY'S fill and 3px of padding, and that padding is
   the "outline the colour of the text box" -- the box showing through around
   a head painted the canvas's colour. Done as a real border it would have to
   be restated on every hover and focus rule the fill has, and would drift out
   of step the first time one of them was missed. This cannot drift: it is the
   same paint. */
/* THE ASIDE IS OUT OF FLOW, so the box is the full width of the column.
   In flow it pushed the box in by its own 70px and the text boxes no longer
   lined up with the New category button under them -- which is the one thing
   that says the canvas is one column. The room it needs comes from the
   canvas's own left padding (--gutter below), so the box's left edge and that
   button's left edge are the same line. */
.nt-cat-shell { position: relative; }
.nt-cat-aside {
  position: absolute; top: 0; right: 100%; z-index: 1;
  /* margin-top is the box's own 3px of padding: the strip starts 3px inside
     the box, so anything meant to be level with it starts 3px down too. As a
     margin rather than a top offset it survives the narrow-screen fallback,
     where this is a flex child and `top` means nothing. */
  margin: 3px 8px 0 0;
  display: flex; align-items: center; gap: 2px; height: 36px;
}
/* NEUTRAL, and it stays neutral on hover: the strip is what lights when a
   category is pointed at. It takes the theme's lighter state only while
   something inside it has focus, which is about typing rather than pointing. */
.nt-cat-box {
  padding: 3px; border-radius: 16px; background: var(--bg2);
  transition: background var(--ease), box-shadow var(--ease);
}
.nt-cat-box:focus-within { background: var(--bg3); box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--c) 35%, transparent); }
.nt-app[data-theme="light"] .nt-cat-box { background: rgba(255,255,255,.45); }
.nt-app[data-theme="light"] .nt-cat-box:focus-within { background: rgba(255,255,255,.62); }
/* The strip is a faint wash of the category's colour and the 3px of box
   padding around it is the frame -- see tints() in color.js. The wash is
   deliberately weak: it says which category the bar belongs to, and the name
   printed on it is the thing meant to carry the colour. */
.nt-cat-head {
  display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 6px 0 12px;
  border-radius: 13px 13px 0 0; background: var(--c-head);
  transition: background var(--ease), box-shadow var(--ease);
}
/* HOVER LIGHTS THE WHOLE TOP CHUNK, corner to corner and behind the controls
   at its right end -- not the text field. The strip is what you are pointing
   at when you are pointing at a category rather than at its words. */
.nt-cat-shell:hover .nt-cat-head { background: var(--c-head-hi); }
/* And typing in the title wraps that same chunk. One ring on the thing being
   edited, at the strip's own radius: the ring around the title alone was a
   second rectangle inside a rectangle, and it fought the name it framed. */
.nt-cat-head:focus-within { background: var(--c-head-hi); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c-title) 32%, transparent); }
.nt-cat.is-collapsed .nt-cat-head { border-radius: 13px; }
.nt-cat.is-collapsed .nt-cat-head:focus-within { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c-title) 32%, transparent); }
.nt-cat-toggle { width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--c-title); padding: 0; transition: transform var(--ease); flex: 0 0 auto; }
.nt-cat-toggle svg { width: 16px; height: 16px; transition: transform .22s ease; }
.nt-cat.is-collapsed .nt-cat-toggle svg { transform: rotate(-90deg); }
.nt-cat-toggle:hover { transform: scale(1.15); }
/* No emoji means a letter, and the letter is the category's colour on a dark
   square ringed in the note box's own line -- so an uncoloured category and a
   green one are told apart at a glance, from the badge alone. */
.nt-cat-emoji {
  width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; padding: 0;
  border: 2px solid var(--bg3); background: color-mix(in srgb, var(--c) 12%, var(--bg));
  color: var(--c-title); font-weight: 800; font-size: 16px; text-transform: uppercase;
  transition: background var(--ease), border-color var(--ease);
}
.nt-cat-emoji.is-emoji { font-size: 22px; text-transform: none; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
/* overflow:visible so the X can sit on the corner rather than inside it --
   the badge is 36px and the mark is meant to overhang, the way it does on a
   session card. */
.nt-cat-emoji { position: relative; overflow: visible; }
.nt-cat-emoji-x {
  position: absolute; top: -7px; right: -7px; width: 18px; height: 18px; display: none; place-items: center;
  border-radius: 50%; background: var(--bg4); color: var(--tx2); cursor: pointer;
  transition: color var(--ease), background var(--ease);
}
.nt-cat-emoji-x svg { width: 11px; height: 11px; }
/* Only when there IS an emoji: with none the badge is already the title's
   first letter, and there is nothing for the X to take off. */
.nt-cat-emoji.has-emoji:hover .nt-cat-emoji-x, .nt-cat-emoji.has-emoji:focus-within .nt-cat-emoji-x { display: grid; }
.nt-cat-emoji-x:hover { color: #fff; background: var(--danger); }
.nt-cat-emoji:hover { background: color-mix(in srgb, var(--c) 26%, var(--bg)); border-color: color-mix(in srgb, var(--c) 40%, var(--bg3)); }
.nt-cat-title {
  flex: 1; min-width: 0; margin: 0; padding: 3px 8px; border-radius: 6px; font-size: calc(var(--fs) + 8px); font-weight: 700; line-height: 1.25; color: var(--c-title);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: text; caret-color: var(--c-title);
}
.nt-cat-title:empty::before { content: "Category name…"; color: var(--tx3); }
/* AN OUTLINE, NOT A FILL. The focused title used to wash the whole line in
   12% of the category's colour, and ::selection paints in --c-sel, which on a
   coloured category is close enough to that wash that you could not see what
   you had selected -- the one thing a highlight exists to show. The ring says
   the same "you are typing here" and leaves the line its own background for
   the selection to stand out against.
   box-shadow rather than outline: `.nt-app [contenteditable]:focus-visible`
   sets outline:none deliberately, and a ring drawn with the property that
   rule turns off is a ring that comes and goes with how you got here. */
/* No ring of its own: .nt-cat-head:focus-within wraps the whole strip. */
.nt-cat-title:focus { background: none; white-space: normal; text-overflow: clip; }
.nt-cat-color { width: 15px; height: 15px; flex: 0 0 auto; border-radius: 50%; border: 0; padding: 0; background: var(--c); opacity: .7; margin: 0 4px; transition: transform var(--ease), opacity var(--ease); }
.nt-cat-shell:hover .nt-cat-color { opacity: 1; }
.nt-cat-color:hover { transform: scale(1.25); }
/* THE CATEGORY'S OWN COLOUR, because the strip they sit on is tinted with
   it: drawn in the body text's grey they were all but invisible against it,
   which is a control you have to already know is there before you can find
   it. Bigger with it -- three 2px dots at 15px square is three specks. */
.nt-cat-more, .nt-cat-x { opacity: 0; color: var(--c-title); transition: opacity var(--ease), color var(--ease), background var(--ease); width: 30px; height: 30px; }
.nt-cat-more svg, .nt-cat-x svg { width: 18px; height: 18px; }
/* Off the head, on to the whole shell: the head is a 36px strip now, and
   controls that appear only while the pointer is on that strip are controls
   you have to aim for before you can see them. */
.nt-cat-shell:hover .nt-cat-more, .nt-cat-shell:hover .nt-cat-x, .nt-cat:focus-within .nt-cat-more, .nt-cat:focus-within .nt-cat-x { opacity: .9; }
.nt-cat-more:hover, .nt-cat-x:hover { opacity: 1 !important; }
.nt-cat-x:hover { color: var(--danger); }
.nt-cat.is-collapsed .nt-cat-body { display: none; }

/* ---- the body: what is typed ------------------------------------------------ */
/* THE FILL, THE HOVER AND THE FOCUS RING ARE ON .nt-cat-box, not here. The
   box is the whole framed thing -- the title row and the text under it -- and
   it is the frame's own paint that has to match the text's ground. A body
   with a background of its own would put a second edge inside that frame. */
.nt-body {
  min-height: 44px; padding: 10px 14px; border: 0; border-radius: 0 0 13px 13px; background: none;
  color: var(--c-body); font-size: var(--fs); line-height: 1.7; user-select: text; cursor: text; caret-color: var(--c-title);
  word-wrap: break-word; overflow-wrap: anywhere;
}
.nt-body:focus { outline: none; }
.nt-body > * { margin: 0; }
.nt-body p { min-height: 1.7em; }
.nt-body p + p, .nt-body p + ul, .nt-body p + ol, .nt-body ul + p, .nt-body ol + p, .nt-body h3 + *, .nt-body * + h3, .nt-body * + pre, .nt-body pre + *, .nt-body * + blockquote, .nt-body blockquote + * { margin-top: 2px; }
.nt-body h3 { font-size: 1.22em; font-weight: 700; color: var(--c-bold); margin-top: 8px; }
.nt-body .al-c { text-align: center; }
.nt-body .al-r { text-align: right; }
.nt-body ul, .nt-body ol { padding-left: 26px; }
.nt-body ul ul, .nt-body ol ol, .nt-body ul ol, .nt-body ol ul { padding-left: 24px; }
.nt-body li { margin: 0; padding-left: 2px; }
/* A shade lighter than the words, so the marks read as structure and the
   text reads as text. --c-bold is already the lighter tier. */
.nt-body li::marker { color: color-mix(in srgb, var(--c-bold) 88%, transparent); }
.nt-body ul { list-style: disc; }
.nt-body ul ul { list-style: circle; }
.nt-body ul ul ul { list-style: square; }
.nt-body ul ul ul ul { list-style: disc; }
.nt-body ol { list-style: decimal; }
.nt-body ol ol { list-style: lower-alpha; }
.nt-body ol ol ol { list-style: lower-roman; }
.nt-body ol ol ol ol { list-style: decimal; }
.nt-body ul.todo { list-style: none; padding-left: 28px; }
.nt-body ul.todo > li { position: relative; }
.nt-body ul.todo > li::before {
  content: ""; position: absolute; left: -24px; top: .5em; width: 15px; height: 15px; border-radius: 4px; border: 1.6px solid color-mix(in srgb, var(--c) 70%, var(--tx3));
  background: transparent; cursor: pointer; transition: background var(--ease);
}
.nt-body ul.todo > li[data-checked]::before { background: var(--c); border-color: var(--c); }
.nt-body ul.todo > li[data-checked]::after {
  content: ""; position: absolute; left: -19.5px; top: calc(.5em + 2px); width: 5px; height: 8px; border: solid var(--c-on); border-width: 0 2px 2px 0; transform: rotate(45deg); pointer-events: none;
}
.nt-body ul.todo > li[data-checked] { color: var(--tx3); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--tx3) 60%, transparent); }
.nt-body ul.todo > li[data-checked] ul, .nt-body ul.todo > li[data-checked] ol { text-decoration: none; color: var(--c-body); }
.nt-body blockquote { border-left: 3px solid color-mix(in srgb, var(--c) 60%, transparent); padding: 2px 12px; color: var(--tx2); font-style: italic; margin: 4px 0 0; min-height: 1.7em; }
.nt-body blockquote + blockquote { margin-top: 0; }
.nt-body blockquote + :not(blockquote) { margin-top: 4px; }
/* Code and quotes stay neutral on purpose: a snippet should not change
   colour because the category around it did. */
.nt-body pre { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .88em; background: var(--bg); border: 1px solid var(--bdr); border-radius: 8px; padding: 10px 12px; margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--tx); }
.nt-body pre b, .nt-body pre strong, .nt-body code b, .nt-body code strong { color: inherit; }
.nt-body code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .88em; background: color-mix(in srgb, var(--tx3) 22%, transparent); border-radius: 4px; padding: .08em .35em; }
.nt-body hr { border: 0; border-top: 2px solid color-mix(in srgb, var(--c) 45%, transparent); margin: 12px 0; }
/* ---- tables ---------------------------------------------------------------
   The category's colour, the same way every other block takes it: var(--c)
   read HERE, on the element that uses it. A --c-table declared on the app
   root would be substituted there, against the root's --c, and every category
   would get the session's colour instead of its own.

   The table SCROLLS SIDEWAYS rather than squeezing. Eight columns are
   readable in the 948px body the widest layout gives; the narrowest is 368px,
   where eight columns would be 46px each. --nt-col-min is the floor a column
   may not go under, and the wrapper carries the overflow so the page itself
   never scrolls horizontally. */
.nt-body table {
  --nt-col-min: 92px;
  display: block; overflow-x: auto; overflow-y: hidden;
  border-collapse: collapse; margin: 8px 0; max-width: 100%;
  scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--c) 45%, transparent) transparent;
}
.nt-body table::-webkit-scrollbar { height: 7px; }
.nt-body table::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--c) 45%, transparent); border-radius: 4px; }
/* AUTO layout, not fixed. `table-layout: fixed` ignores a cell's min-width,
   which is the whole mechanism here: the columns have to be able to push the
   table wider than its container so the container can scroll. */
.nt-body table tbody { display: table; width: 100%; border-collapse: collapse; }
.nt-body table th, .nt-body table td {
  border: 1px solid color-mix(in srgb, var(--c) 34%, var(--bdr));
  padding: 5px 9px; text-align: left; vertical-align: top;
  min-width: var(--nt-col-min); overflow-wrap: anywhere;
}
/* The header row is the category's colour as TEXT, on the faintest wash of
   it -- the same pairing the category title strip uses, so a table reads as
   part of its category rather than as a component dropped into it. */
.nt-body table th { background: color-mix(in srgb, var(--c) 11%, transparent); color: var(--c-title); font-weight: 700; }
.nt-body table td { color: var(--c-body); }
.nt-body table tr:nth-child(even) td { background: color-mix(in srgb, var(--tx3) 7%, transparent); }

/* The handles. They are appended to the app root, not to the body, so they
   are positioned in the root's coordinates by table.js and are hidden until
   the pointer is over a table. */
.nt-tbl-grip, .nt-tbl-add {
  position: absolute; z-index: 40; width: 22px; height: 22px; padding: 0;
  display: none; place-items: center; border-radius: 6px;
  border: 1px solid var(--bdr); background: var(--bg3); color: var(--tx3);
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.nt-tbl-grip.is-on, .nt-tbl-add.is-on { display: grid; }
.nt-tbl-grip svg, .nt-tbl-add svg { width: 14px; height: 14px; }
.nt-tbl-grip.is-col svg { transform: rotate(90deg); }
.nt-tbl-grip:hover, .nt-tbl-add:hover:not(:disabled) { background: var(--bg4); color: var(--c-title); border-color: color-mix(in srgb, var(--c) 55%, var(--bdr)); }
.nt-tbl-add:disabled { opacity: .3; }
/* The second tier. A heading and a bold line are the same thing in these
   notes -- the top of a list, the name of the group under it. */
.nt-body b, .nt-body strong { font-weight: 700; color: var(--c-bold); }
.nt-body a:not(.chip) { color: var(--c-title); text-decoration: underline; text-underline-offset: 2px; }
.nt-body img.nt-img { display: block; max-width: 100%; height: auto; border-radius: 10px; margin: 6px 0; cursor: pointer; border: 2px solid transparent; transition: border-color var(--ease); }
.nt-body img.nt-img:hover { border-color: color-mix(in srgb, var(--c) 40%, transparent); }
.nt-body img.nt-img.is-selected { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent); }
.nt-body img.nt-img.is-pending { opacity: .55; }
.nt-body p:has(> img.nt-img:only-child) { min-height: 0; }

/* chips */
.nt-body .chip {
  display: inline-flex; align-items: center; gap: .3em; vertical-align: baseline; max-width: 340px; padding: .02em .55em .02em .45em; margin: 0 1px;
  border: 1.5px solid; border-radius: 999px; font-size: .92em; font-weight: 600; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer; user-select: none; text-decoration: none; transition: background var(--ease);
}
/* THE MARK IS A REAL ELEMENT, not a ::before, because it is a control: it is
   what you press to fold the chip down to itself. For a link it is the site's
   own initial on a colour derived from the hostname (nodes.js), so the same
   site is the same circle everywhere and no third party is asked what that
   site's icon looks like. */
.nt-chip-mark {
  width: 1.25em; height: 1.25em; flex: 0 0 auto; display: inline-grid; place-items: center;
  border-radius: 50%; background: currentColor; color: inherit; opacity: .85; cursor: pointer;
  font-size: .72em; font-weight: 800; line-height: 1; user-select: none;
  transition: transform var(--ease), opacity var(--ease);
}
.nt-chip-mark.is-site { background: var(--site, #7aa2f7); color: #0b0d11; }
.nt-chip-mark.is-site::before { content: attr(data-l); }
/* Twelve buckets, written out. A hue computed into a style attribute would be
   stripped by scrub() on the next keystroke -- see nodes.js. */
.nt-chip-mark.h0 { --site: hsl(0 62% 60%); }
.nt-chip-mark.h1 { --site: hsl(30 62% 58%); }
.nt-chip-mark.h2 { --site: hsl(52 62% 56%); }
.nt-chip-mark.h3 { --site: hsl(84 52% 56%); }
.nt-chip-mark.h4 { --site: hsl(128 48% 56%); }
.nt-chip-mark.h5 { --site: hsl(160 52% 54%); }
.nt-chip-mark.h6 { --site: hsl(184 58% 56%); }
.nt-chip-mark.h7 { --site: hsl(206 68% 62%); }
.nt-chip-mark.h8 { --site: hsl(232 66% 68%); }
.nt-chip-mark.h9 { --site: hsl(266 58% 68%); }
.nt-chip-mark.h10 { --site: hsl(296 52% 64%); }
.nt-chip-mark.h11 { --site: hsl(330 62% 64%); }
.nt-chip-mark svg { width: .78em; height: .78em; }
/* ---- known sites, drawn here ------------------------------------------
   A brand's colours are a CLASS for the same reason the hue buckets are:
   scrub() takes every style attribute out of a body after each keystroke,
   so a colour written onto the mark would last exactly one character. The
   table that picks between these lives in nodes.js. A glyph fills 84% of
   the circle -- edge to edge reads as a sticker rather than as an icon. */
.nt-chip-mark.is-brand { background: var(--brand-bg); color: var(--brand-fg); opacity: 1; }
.nt-chip-mark.is-brand::before { content: attr(data-l); }
.nt-chip-mark.is-brand svg { width: 84%; height: 84%; }
.nt-chip-mark.b-google { --brand-bg: #fff; --brand-fg: #4285f4; }
.nt-chip-mark.b-youtube { --brand-bg: #fff; --brand-fg: #ff0000; }
.nt-chip-mark.b-x { --brand-bg: #000; --brand-fg: #fff; }
.nt-chip-mark.b-vercel { --brand-bg: #000; --brand-fg: #fff; }
.nt-chip-mark.b-spotify { --brand-bg: #1db954; --brand-fg: #fff; }
.nt-chip-mark.b-facebook { --brand-bg: #1877f2; --brand-fg: #fff; }
.nt-chip-mark.b-linkedin { --brand-bg: #0a66c2; --brand-fg: #fff; }
.nt-chip-mark.b-reddit { --brand-bg: #ff4500; --brand-fg: #fff; }
.nt-chip-mark.b-twitch { --brand-bg: #9146ff; --brand-fg: #fff; }
.nt-chip-mark.b-dropbox { --brand-bg: #0061ff; --brand-fg: #fff; }
.nt-chip-mark.b-npm { --brand-bg: #cb3837; --brand-fg: #fff; }
.nt-chip-mark.b-github { --brand-bg: #181717; --brand-fg: #fff; }
.nt-chip-mark.b-gitlab { --brand-bg: #fc6d26; --brand-fg: #fff; }
.nt-chip-mark.b-stackoverflow { --brand-bg: #f48024; --brand-fg: #fff; }
.nt-chip-mark.b-wikipedia { --brand-bg: #fff; --brand-fg: #111; }
.nt-chip-mark.b-amazon { --brand-bg: #232f3e; --brand-fg: #ff9900; }
.nt-chip-mark.b-netflix { --brand-bg: #141414; --brand-fg: #e50914; }
.nt-chip-mark.b-instagram { --brand-bg: #e1306c; --brand-fg: #fff; }
.nt-chip-mark.b-tiktok { --brand-bg: #010101; --brand-fg: #25f4ee; }
.nt-chip-mark.b-pinterest { --brand-bg: #e60023; --brand-fg: #fff; }
.nt-chip-mark.b-discord { --brand-bg: #5865f2; --brand-fg: #fff; }
.nt-chip-mark.b-slack { --brand-bg: #4a154b; --brand-fg: #fff; }
.nt-chip-mark.b-notion { --brand-bg: #fff; --brand-fg: #111; }
.nt-chip-mark.b-figma { --brand-bg: #f24e1e; --brand-fg: #fff; }
.nt-chip-mark.b-apple { --brand-bg: #000; --brand-fg: #fff; }
.nt-chip-mark.b-microsoft { --brand-bg: #f25022; --brand-fg: #fff; }
.nt-chip-mark.b-openai { --brand-bg: #10a37f; --brand-fg: #fff; }
.nt-chip-mark.b-claude { --brand-bg: #d97757; --brand-fg: #fff; }
.nt-chip-mark.b-steam { --brand-bg: #171a21; --brand-fg: #66c0f4; }
.nt-chip-mark.b-itch { --brand-bg: #fa5c5c; --brand-fg: #fff; }
.nt-chip-mark.b-unity { --brand-bg: #222c37; --brand-fg: #fff; }
.nt-chip-mark.b-unreal { --brand-bg: #0e1128; --brand-fg: #fff; }
.nt-chip-mark.b-roblox { --brand-bg: #e2231a; --brand-fg: #fff; }
.nt-chip-mark.b-epic { --brand-bg: #2a2a2a; --brand-fg: #fff; }
.nt-chip-mark.b-medium { --brand-bg: #000; --brand-fg: #fff; }
.nt-chip-mark.b-substack { --brand-bg: #ff6719; --brand-fg: #fff; }
.nt-chip-mark.b-paypal { --brand-bg: #003087; --brand-fg: #fff; }
.nt-chip-mark.b-ebay { --brand-bg: #e53238; --brand-fg: #fff; }
.nt-chip-mark.b-etsy { --brand-bg: #f1641e; --brand-fg: #fff; }
.nt-chip-mark.b-shopify { --brand-bg: #7ab55c; --brand-fg: #fff; }
.nt-chip-mark.b-wordpress { --brand-bg: #21759b; --brand-fg: #fff; }
.nt-chip-mark.b-vimeo { --brand-bg: #1ab7ea; --brand-fg: #fff; }
.nt-chip-mark.b-soundcloud { --brand-bg: #ff5500; --brand-fg: #fff; }
.nt-chip-mark.b-bandcamp { --brand-bg: #629aa9; --brand-fg: #fff; }
.nt-chip-mark.b-artstation { --brand-bg: #13aff0; --brand-fg: #fff; }
.nt-chip-mark.b-behance { --brand-bg: #1769ff; --brand-fg: #fff; }
.nt-chip-mark.b-dribbble { --brand-bg: #ea4c89; --brand-fg: #fff; }
.nt-chip-mark.b-deviantart { --brand-bg: #05cc47; --brand-fg: #fff; }
.nt-chip-mark.b-mozilla { --brand-bg: #ff9500; --brand-fg: #fff; }
.nt-chip-mark.b-hackernews { --brand-bg: #ff6600; --brand-fg: #fff; }
.nt-chip-mark.b-chrome { --brand-bg: #fff; --brand-fg: #4285f4; }
.nt-chip-mark.b-cloudflare { --brand-bg: #f38020; --brand-fg: #fff; }
.nt-chip-mark.b-zoom { --brand-bg: #2d8cff; --brand-fg: #fff; }
.nt-chip-mark:hover { transform: scale(1.14); opacity: 1; }
/* FOLDED: the chip is its mark and nothing else.
   THE LABEL IS A TEXT NODE, so `display: none` on the chip's element children
   hides nothing -- the first version of this shrank a 119px chip to 112px and
   looked broken. font-size: 0 is what collapses a text node, and the mark
   then has to be sized in absolute units because its own em would collapse
   with it. */
/* FOLDED IS STILL FULL SIZE. The circle stands in for the whole pill, so it
   is drawn at the pill's own height and a shade over -- 27px against the
   ~26px an open chip occupies at the default text size. The first version
   dropped to 19px inside the chip's own border and padding, which made a
   folded node a speck in the line rather than a node you had folded. The
   border goes with the label: the mark is the whole control now. */
.nt-body .chip.is-min {
  max-width: none; padding: 0; border-width: 0; border-radius: 50%; gap: 0;
  font-size: 0; line-height: 0; vertical-align: middle;
}
.nt-body .chip.is-min .nt-chip-mark { width: 27px; height: 27px; font-size: 15px; line-height: 1; }
.nt-body .chip.is-min .nt-chip-mark svg { width: 18px; height: 18px; }
.nt-body .chip.is-min .nt-chip-mark.is-brand svg { width: 84%; height: 84%; }
.nt-body .chip.is-dragging { opacity: .35; }
.nt-body .chip-link { --node: #67A2FF; color: var(--node); border-color: color-mix(in srgb, var(--node) 55%, transparent); background: color-mix(in srgb, var(--node) 12%, transparent); }
.nt-body .chip-md { --node: #9ACB5A; color: var(--node); border-color: color-mix(in srgb, var(--node) 55%, transparent); background: color-mix(in srgb, var(--node) 12%, transparent); }
.nt-body .chip:hover { background: color-mix(in srgb, var(--node) 24%, transparent); }
.nt-app[data-theme="light"] .nt-body .chip-link { color: #fff; background: color-mix(in srgb, var(--node) 78%, #000); border-color: color-mix(in srgb, var(--node) 78%, #000); }
.nt-app[data-theme="light"] .nt-body .chip-md { color: #fff; background: color-mix(in srgb, var(--node) 70%, #000); border-color: color-mix(in srgb, var(--node) 70%, #000); }
.nt-app[data-theme="light"] .nt-body .chip:hover { filter: brightness(1.15); }

/* highlights: spelling, search, an autocorrection */
::highlight(nt-spell) { text-decoration: underline wavy #e05c5c; text-decoration-skip-ink: none; text-underline-offset: 3px; }
::highlight(nt-search) { background-color: rgba(255, 210, 80, .35); }
::highlight(nt-search-current) { background-color: rgba(255, 170, 40, .75); color: #000; }
::highlight(nt-fix) { background-color: rgba(120, 220, 120, .35); }

/* ---- import and export --------------------------------------------------------- */
.nt-io { width: min(420px, 86vw); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.nt-io-head { font-size: 16px; font-weight: 700; color: var(--tx); }
.nt-io-drop {
  display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap;
  padding: 16px 12px; border: 1.5px dashed color-mix(in srgb, var(--tx3) 60%, transparent);
  border-radius: 10px; color: var(--tx2); font-size: 13.5px; text-align: center;
  transition: border-color var(--ease), background var(--ease);
}
.nt-io-drop.is-over { border-color: var(--c-title); background: color-mix(in srgb, var(--c) 12%, transparent); }
.nt-io-drop-icon { display: grid; color: var(--tx3); } .nt-io-drop-icon svg { width: 18px; height: 18px; }
/* The input is the label: a bare file input cannot be styled and says
   "No file chosen" in the browser's words next to a button in ours. */
.nt-io-pick { color: var(--c-title); font-weight: 600; text-decoration: underline; cursor: pointer; }
.nt-io-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.nt-io-text {
  width: 100%; resize: vertical; min-height: 120px; padding: 10px 11px;
  border: 1px solid var(--bdr); border-radius: 9px; background: var(--bg); color: var(--tx);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.5;
  outline: none;
}
.nt-io-text:focus { border-color: var(--c-title); box-shadow: 0 0 0 1px var(--c-title); }
.nt-app .nt-io-text:focus, .nt-app .nt-io-text:focus-visible { outline: none; }
.nt-io-summary { font-size: 13px; color: var(--tx3); line-height: 1.45; }
.nt-io-summary.is-ready { color: var(--c-title); font-weight: 600; }
.nt-io-foot { display: flex; justify-content: flex-end; }
.nt-io-go:disabled { opacity: .45; }

/* ---- floating panels ----------------------------------------------------------- */
.nt-panel { position: fixed; z-index: 70; background: var(--bg2); border: 1px solid var(--bdr); border-radius: 12px; box-shadow: var(--shadow); color: var(--tx); animation: nt-pop .12s ease-out; }
@keyframes nt-pop { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .nt-panel, .nt-cat.is-new { animation: none; } }
.nt-menu { display: flex; flex-direction: column; min-width: 190px; padding: 5px; }
.nt-menu-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 12px; border: 0; border-radius: 7px; background: none; color: var(--tx); font-size: 15px; text-align: left; }
.nt-menu-item:hover, .nt-menu-item:focus-visible { background: var(--bg4); outline: none; }
.nt-menu-item.is-on { color: var(--c-title); font-weight: 600; }
.nt-menu-item.is-danger { color: var(--danger); }
.nt-menu-item:disabled { opacity: .45; }
.nt-menu-icon { display: grid; color: var(--tx2); } .nt-menu-icon svg { width: 17px; height: 17px; }
.nt-menu-label { flex: 1; }
.nt-menu-hint { font-size: 12.5px; color: var(--tx3); margin-left: 12px; }
.nt-menu-sep { height: 1px; background: var(--bdr); margin: 4px 6px; }

/* ---- nodes: the toolbar, the ghost and the drop caret ----------------------
   The toolbar is NOT a .nt-panel: there is one of those at a time and it
   closes on any outside press, so hovering a chip would shut the colour
   picker and opening the colour picker would shut this. It is its own small
   floating thing that never takes focus. */
.nt-chip-bar {
  position: absolute; z-index: 75; display: flex; align-items: center; gap: 2px; padding: 3px;
  border: 1px solid var(--bdr); border-radius: 9px; background: var(--bg2); box-shadow: var(--shadow);
  animation: nt-pop .1s ease-out;
}
@media (prefers-reduced-motion: reduce) { .nt-chip-bar { animation: none; } }
/* Bigger buttons and much bigger marks in them. This bar floats over a line
   of text and is aimed at in a hurry; 15px icons rattling around in 28px
   boxes gave it neither a target worth aiming at nor a legible icon. */
.nt-chip-btn {
  width: 33px; height: 33px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 7px; background: none; color: var(--tx2);
  transition: color var(--ease), background var(--ease);
}
.nt-chip-btn svg { width: 21px; height: 21px; }
.nt-chip-btn:hover { color: var(--tx); background: var(--bg4); }
.nt-chip-btn.is-danger:hover { color: var(--danger); }
/* ARMED. The first press turns it into what it is about to do; the second
   does it. Red and filled, so an armed delete cannot be mistaken for the
   quiet one it was a moment ago. */
.nt-chip-btn.is-armed { color: #fff; background: var(--danger); }
.nt-chip-btn.is-armed:hover { color: #fff; background: var(--danger); filter: brightness(1.1); }

/* What follows the pointer while a node is being dragged, and the line where
   it would land. Both are absolutely positioned over the app and neither is
   ever inserted into a body -- a marker put into a live contenteditable
   splits its text nodes and invalidates the range the drop is aiming at. */
.nt-app.is-node-dragging, .nt-app.is-node-dragging * { cursor: grabbing !important; }
.nt-node-ghost {
  position: absolute; z-index: 90; pointer-events: none; opacity: .95;
  font-size: var(--fs); filter: drop-shadow(0 6px 14px rgba(0,0,0,.45));
}
.nt-node-ghost.is-copy::after {
  content: "+"; position: absolute; top: -8px; right: -10px;
  width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%;
  background: var(--c); color: var(--c-on); font-size: 13px; font-weight: 800;
}
.nt-node-caret {
  position: absolute; z-index: 89; width: 2px; border-radius: 1px; background: var(--c-title);
  display: none; pointer-events: none; box-shadow: 0 0 6px var(--c-title);
}
.nt-node-caret.is-on { display: block; }
.chip-ghost {
  display: inline-flex; align-items: center; gap: .3em; padding: .02em .55em .02em .45em;
  border: 1.5px solid; border-radius: 999px; font-size: .92em; font-weight: 600; line-height: 1.45;
  color: var(--node); border-color: color-mix(in srgb, var(--node) 55%, transparent);
  background: color-mix(in srgb, var(--node) 16%, var(--bg2));
}

/* The header's node control: a split button. The left half inserts the kind
   you used last and is the handle a new node is dragged out of; the chevron
   opens the list. */
.nt-node-btn { display: flex; align-items: center; flex: 0 0 auto; border-radius: 7px; overflow: hidden; }
.nt-node-main, .nt-node-arrow {
  height: 34px; display: grid; place-items: center; padding: 0; border: 0; background: none;
  color: var(--tx2); transition: color var(--ease), background var(--ease);
}
.nt-node-main { width: 32px; cursor: grab; }
.nt-node-main:active { cursor: grabbing; }
.nt-node-arrow { width: 18px; }
.nt-node-arrow svg { width: 12px; height: 12px; }
.nt-node-main:hover, .nt-node-arrow:hover { background: var(--bg3); }
.nt-node-mark { display: grid; place-items: center; }
.nt-node-mark svg { width: 18px; height: 18px; }

/* A menu that lists things WITH COLOURS says so: the icon keeps the node's
   own colour and the row picks it up on hover. */
.nt-menu-head { padding: 7px 12px 8px; margin-bottom: 3px; border-bottom: 1px solid var(--bdr); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--tx2); text-align: center; }
.nt-menu-item.is-tinted:hover, .nt-menu-item.is-tinted:focus-visible { background: color-mix(in srgb, var(--row) 16%, transparent); color: var(--tx); }

/* ---- the information panel -------------------------------------------------
   Every keystroke in the app, in one place, grouped by where you would be
   standing when you wanted it. This is what let the tooltips stop carrying
   keybinds: a shortcut that lives only in a tooltip can be found only by
   hovering the button you were about to press anyway. */
.nt-help-panel { max-height: min(560px, calc(100vh - 90px)); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--bdr) transparent; }
.nt-help-panel::-webkit-scrollbar { width: 5px; }
.nt-help-panel::-webkit-scrollbar-thumb { background: var(--bdr); border-radius: 3px; }
.nt-help { width: 344px; padding: 14px 16px 16px; }
.nt-help-title { text-align: center; font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--tx); padding-bottom: 9px; margin-bottom: 12px; border-bottom: 1.5px solid var(--bdr); }
.nt-help-section + .nt-help-section { margin-top: 14px; }
.nt-help-head { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--c-title); padding-bottom: 4px; margin-bottom: 4px; border-bottom: 1px solid var(--bdr); }
.nt-help-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 3px 0; }
.nt-help-key { color: var(--tx2); font-size: 13px; }
/* WRAPS, and the width above is chosen so almost nothing has to. nowrap made
   one long value run straight out of the panel and off the screen, and this
   is a list nobody measures again after adding a row to it -- so the rule is
   the one that cannot overflow rather than the one that looks tidiest. */
.nt-help-val { flex: 0 1 auto; min-width: 0; color: var(--tx); font-size: 12.5px; text-align: right; font-family: 'JetBrains Mono', ui-monospace, monospace; }
/* A WIDGET ROW: the label, the keystroke, and the control itself at the right
   end. This is the difference between a panel you read and a panel you use --
   the Widgets section exists so a control nobody reaches for with a pointer
   does not have to hold a permanent slot in the header to be reachable at
   all. The button in here is the real one, moved, not a copy. */
.nt-help-row.is-widget { align-items: center; padding: 5px 0; }
.nt-help-row.is-widget .nt-help-val { flex: 1 1 auto; }
.nt-help-row.is-widget .nt-icon-btn { width: 30px; height: 30px; margin-left: 10px; background: var(--bg3); border: 1px solid var(--bdr); }
.nt-help-row.is-widget .nt-icon-btn:hover:not(:disabled) { color: var(--c-title); border-color: var(--c-title); background: var(--bg4); }
.nt-help-row.is-widget .nt-icon-btn svg { width: 15px; height: 15px; }

.nt-tip { position: fixed; z-index: 90; pointer-events: none; background: var(--bg4); color: var(--tx); font-size: 13.5px; padding: 5px 9px; border-radius: 6px; border: 1px solid var(--bdr); box-shadow: 0 2px 8px rgba(0,0,0,.25); opacity: 0; transition: opacity .12s ease; white-space: nowrap; max-width: 320px; }
.nt-tip.is-on { opacity: 1; }
.nt-toast { position: absolute; bottom: 20px; right: 22px; z-index: 80; background: var(--bg4); color: var(--tx); border: 1px solid var(--bdr); border-radius: 10px; padding: 11px 18px; font-size: 15px; opacity: 0; transform: translateY(6px); transition: opacity .18s ease, transform .18s ease; pointer-events: none; max-width: 420px; }
.nt-toast.is-on { opacity: 1; transform: none; }
.nt-toast.is-error { border-color: var(--danger); color: var(--danger); }

.nt-modal { position: absolute; inset: 0; z-index: 85; display: grid; place-items: center; background: rgba(0,0,0,.45); backdrop-filter: blur(5px); }
.nt-modal-card { background: var(--bg2); border: 1px solid var(--bdr); border-radius: 16px; padding: 30px 34px 24px; width: min(440px, 92%); box-shadow: var(--shadow); animation: nt-fadeup .18s ease-out; }
.nt-modal-title { margin: 0 0 10px; font-size: 21px; font-weight: 700; }
.nt-modal-msg { margin: 0; font-size: 16.5px; color: var(--tx2); line-height: 1.6; }
.nt-modal-msg strong { color: var(--tx); font-weight: 600; }
.nt-modal-sub { margin: 8px 0 0; font-size: 14px; color: var(--tx3); }
.nt-modal-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.nt-btn { padding: 9px 18px; border: 0; border-radius: 9px; background: var(--bg4); color: var(--tx); font-size: 15px; font-weight: 600; }
.nt-btn:hover { filter: brightness(1.12); }
.nt-btn.is-primary { background: var(--c); color: var(--c-on); }
.nt-btn.is-danger { background: #b03c3c; color: #fff; }
.nt-btn.is-left { margin-right: auto; }
.nt-btn.is-small { padding: 5px 11px; font-size: 13px; border-radius: 7px; }
.nt-btn.is-on { background: var(--c); color: var(--c-on); }
.nt-input { width: 100%; padding: 9px 11px; border: 1px solid var(--bdr); border-radius: 8px; background: var(--bg); color: var(--tx); font: inherit; font-size: 15.5px; outline: none; }
.nt-input:focus { border-color: var(--c-title); box-shadow: 0 0 0 1px var(--c-title); }
.nt-form { display: flex; flex-direction: column; gap: 8px; padding: 14px; width: 340px; }
.nt-form-title { font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tx2); }
.nt-form-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
/* THE FORM ANSWERS FOR ITSELF. A url-typed input inside a form hands the
   refusal to Chrome, which draws an orange-and-white bubble in its own style,
   in its own place, with its own words -- "Please enter a URL" for a perfectly
   good `google.com`. The inputs are plain text now and this says why. */
.nt-form-err { display: none; align-items: center; gap: 7px; margin: -2px 0 0; font-size: 13.5px; color: var(--danger); }
.nt-form-err.is-on { display: flex; }
.nt-form-err svg { width: 15px; height: 15px; flex: 0 0 auto; }
.nt-input.is-bad { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }

/* emoji */
.nt-emoji-box { display: flex; align-items: flex-end; gap: 6px; padding: 6px; }
.nt-emoji-grid { display: grid; grid-template-columns: repeat(3, 36px); gap: 3px; }
.nt-emoji-sep { grid-column: 1 / -1; height: 1px; background: var(--bdr); margin: 3px 0; }
.nt-emoji-cell { width: 36px; height: 36px; display: grid; place-items: center; border: 1.5px solid transparent; border-radius: 7px; background: none; font-size: 22px; padding: 0; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.nt-emoji-cell:hover, .nt-emoji-cell.is-active { background: var(--bg4); border-color: var(--bdr); }
.nt-emoji-cell.is-empty { opacity: .15; }
.nt-emoji-cell.is-used { opacity: .9; }
.nt-emoji-expand { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--bdr); border-radius: 6px; background: var(--bg3); color: var(--tx2); padding: 0; }
.nt-emoji-expand svg { width: 14px; height: 14px; }
.nt-emoji-expand:hover { color: var(--tx); }
.nt-emoji-full { width: 340px; display: flex; flex-direction: column; gap: 6px; padding: 10px; }
.nt-emoji-search { border-radius: 20px; }
.nt-emoji-recent { display: flex; flex-wrap: wrap; gap: 2px; padding-bottom: 4px; border-bottom: 1px solid var(--bdr); }
.nt-emoji-recent .nt-emoji-cell { width: 32px; height: 32px; font-size: 19px; }
.nt-emoji-tabs { display: flex; border-bottom: 1px solid var(--bdr); }
.nt-emoji-tab { flex: 1; height: 30px; border: 0; background: none; font-size: 16px; opacity: .5; border-radius: 6px 6px 0 0; padding: 0; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.nt-emoji-tab:hover { opacity: .85; }
.nt-emoji-tab.is-on { opacity: 1; background: var(--bg4); }
.nt-emoji-full-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 260px; overflow-y: auto; padding: 4px 2px; scrollbar-width: thin; }
.nt-emoji-full-grid .nt-emoji-cell { width: 100%; height: 36px; font-size: 21px; }
.nt-emoji-none { grid-column: 1 / -1; text-align: center; color: var(--tx3); font-size: 13px; padding: 20px 0; margin: 0; }

/* colour */
.nt-clr { width: 262px; display: flex; flex-direction: column; gap: 9px; padding: 14px; }
.nt-clr-head { display: flex; align-items: center; justify-content: space-between; }
.nt-clr-title { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tx2); }
.nt-clr-field { position: relative; width: 100%; height: 140px; border-radius: 8px; overflow: hidden; cursor: crosshair; touch-action: none; }
.nt-clr-field canvas { width: 100%; height: 100%; display: block; }
.nt-clr-cursor { position: absolute; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.6); transform: translate(-50%, -50%); pointer-events: none; }
.nt-clr-row { display: flex; align-items: center; gap: 8px; }
.nt-clr-label { width: 12px; font-size: 10px; font-weight: 700; color: var(--tx3); }
.nt-clr-slider { flex: 1; -webkit-appearance: none; appearance: none; height: 10px; border-radius: 5px; background: var(--bg4); outline: none; }
.nt-clr-slider.is-h { background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
.nt-clr-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid rgba(0,0,0,.3); cursor: pointer; }
.nt-clr-slider::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid rgba(0,0,0,.3); cursor: pointer; }
.nt-clr-hexrow { display: flex; align-items: center; gap: 6px; }
.nt-clr-hash { color: var(--tx3); font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13px; }
.nt-clr-hex { flex: 1; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13px; letter-spacing: .05em; padding: 6px 8px; }
.nt-clr-swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--bdr); flex: 0 0 auto; }
.nt-clr-slots { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.nt-clr-slot { width: 100%; aspect-ratio: 1; border-radius: 50%; border: 0; padding: 0; background: var(--bg4); color: var(--tx3); display: grid; place-items: center; transition: transform var(--ease); }
.nt-clr-slot svg { width: 10px; height: 10px; }
.nt-clr-slot:hover { transform: scale(1.12); }
.nt-clr-slot.is-full { box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.nt-clr-hint { margin: 0; font-size: 12.5px; color: var(--tx3); line-height: 1.4; }

/* slash */
.nt-slash { display: flex; flex-direction: column; min-width: 240px; max-height: 320px; overflow-y: auto; padding: 5px; }
.nt-slash-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 7px; background: none; color: var(--tx); font-size: 15px; text-align: left; }
.nt-slash-item.is-active, .nt-slash-item:hover { background: var(--bg4); }
.nt-slash-icon { width: 22px; display: grid; place-items: center; color: var(--tx2); font-size: 16px; }
.nt-slash-icon svg { width: 16px; height: 16px; }
.nt-slash-label { flex: 1; }
.nt-slash-hint { font-size: 12.5px; color: var(--tx3); font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* markdown editor */
.nt-md-editor { width: min(900px, 92vw); display: flex; flex-direction: column; }
.nt-md-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--bdr); }
.nt-md-title { flex: 1; font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tx2); }
.nt-md-modes { display: flex; gap: 2px; background: var(--bg); border-radius: 8px; padding: 2px; }
.nt-md-modes .nt-btn { background: none; }
.nt-md-editor.is-edit .nt-md-modes .nt-btn:nth-child(1), .nt-md-editor.is-split .nt-md-modes .nt-btn:nth-child(2), .nt-md-editor.is-preview .nt-md-modes .nt-btn:nth-child(3) { background: var(--bg4); }
.nt-md-panes { display: grid; grid-template-columns: 1fr 1fr; min-height: 300px; max-height: 70vh; }
.nt-md-editor.is-edit .nt-md-panes { grid-template-columns: 1fr; } .nt-md-editor.is-edit .nt-md-preview { display: none; }
.nt-md-editor.is-preview .nt-md-panes { grid-template-columns: 1fr; } .nt-md-editor.is-preview .nt-md-text { display: none; }
.nt-md-text { resize: none; border: 0; border-right: 1px solid var(--bdr); background: var(--bg); color: var(--tx); padding: 14px; font: 14px/1.6 'JetBrains Mono', ui-monospace, monospace; outline: none; min-height: 300px; }
.nt-md-editor.is-edit .nt-md-text { border-right: 0; }
.nt-md-preview { padding: 14px 18px; overflow-y: auto; user-select: text; }
.nt-md-empty { color: var(--tx3); font-style: italic; }
.nt-md { font-size: 15px; line-height: 1.6; color: var(--tx-body); }
.nt-md h1, .nt-md h2, .nt-md h3, .nt-md h4, .nt-md h5, .nt-md h6 { color: var(--tx); margin: .8em 0 .3em; line-height: 1.25; }
.nt-md h1 { font-size: 1.6em; } .nt-md h2 { font-size: 1.35em; } .nt-md h3 { font-size: 1.15em; }
.nt-md p { margin: .4em 0; } .nt-md ul, .nt-md ol { padding-left: 24px; margin: .4em 0; }
.nt-md blockquote { border-left: 3px solid var(--c); padding-left: 12px; color: var(--tx2); margin: .5em 0; }
.nt-md pre { background: var(--bg); border: 1px solid var(--bdr); border-radius: 8px; padding: 10px 12px; overflow-x: auto; font-size: .9em; }
.nt-md code { font-family: 'JetBrains Mono', ui-monospace, monospace; background: color-mix(in srgb, var(--tx3) 22%, transparent); border-radius: 4px; padding: .08em .35em; font-size: .9em; }
.nt-md pre code { background: none; padding: 0; }
.nt-md a { color: var(--c-title); }
.nt-md hr { border: 0; border-top: 1px solid var(--bdr); margin: 1em 0; }
.nt-md .md-todo { display: inline-block; width: 13px; height: 13px; border: 1.5px solid var(--tx3); border-radius: 3px; margin-right: 6px; vertical-align: -2px; }
.nt-md .md-todo.is-done { background: var(--c); border-color: var(--c); }

/* image bar */
.nt-img-bar { display: flex; align-items: center; gap: 4px; padding: 5px; }

/* sessions */
.nt-sess { padding: 8px 12px 14px; min-width: 250px; }
/* One row: options at the left end, close at the right, and the word CENTRED
   ON THE POPUP -- placed absolutely, for the same reason the header's
   formatting group is. Two arms of unequal width cannot centre anything
   between them, and centring it over the cards instead put it in the corner
   whenever there was only one session. */
/* flex-end, not space-between: the label is out of flow (it is centred on the
   popup, not between its neighbours), so the close is the ONLY thing in the
   row and space-between parks it at the left. */
.nt-sess-bar { position: relative; display: flex; align-items: center; justify-content: flex-end; height: 32px; margin-bottom: 12px; border-bottom: 1px solid var(--bdr); padding-bottom: 8px; }
.nt-sess-head {
  position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap;
  font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tx2);
}
.nt-sess-opts, .nt-sess-close {
  width: 26px; height: 26px; flex: 0 0 auto; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 6px; background: none; color: var(--tx3); transition: color var(--ease), background var(--ease);
}
.nt-sess-opts svg, .nt-sess-close svg { width: 15px; height: 15px; }
.nt-sess-opts:hover { color: var(--tx); background: var(--bg4); }
.nt-sess-close:hover { color: var(--danger); background: var(--bg4); }
.nt-sess-grid { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; max-width: 320px; }
/* Reordering. The bar stands in the gap the drop would land in; the card
   being carried stays in place at a third, so the row does not reflow under
   the pointer on every move. */
.nt-sess-card.is-dragging { opacity: .3; }
.nt-sess-marker { width: 3px; height: 40px; flex: 0 0 auto; margin: 0 -3px; border-radius: 2px; background: var(--c-title); }
.nt-sess-card {
  position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 11px; border: 2px solid color-mix(in srgb, var(--c) 45%, transparent);
  background: color-mix(in srgb, var(--c) 14%, var(--bg)); color: var(--c-title); font-weight: 800; font-size: 17px; text-transform: uppercase; padding: 0;
  transition: transform var(--ease), border-color var(--ease);
}
.nt-sess-card.is-emoji { font-size: 24px; text-transform: none; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.nt-sess-card:hover { transform: scale(1.1); border-color: var(--c); }
.nt-sess-card.is-active { box-shadow: 0 0 0 3px var(--c), 0 0 12px color-mix(in srgb, var(--c) 40%, transparent); }
.nt-sess-card.is-add { --c: var(--tx3); border-style: dashed; background: none; color: var(--tx2); }
.nt-sess-card.is-add svg { width: 18px; height: 18px; }
.nt-sess-x { position: absolute; top: -7px; right: -7px; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: var(--bg4); color: var(--tx2); opacity: 0; transition: opacity var(--ease); }
.nt-sess-x svg { width: 11px; height: 11px; }
.nt-sess-card:hover .nt-sess-x { opacity: 1; }
.nt-sess-x:hover { color: #fff; background: var(--danger); }


/* ---- dictation ------------------------------------------------------------ */
/* The microphone lives in the wrapper, not in the text: a button inside a
   contenteditable is somewhere the caret can land. It rests in the box's
   bottom-right corner, dim until the category is hovered, and stays lit
   while it is listening. */
.nt-cat-body { position: relative; }
.nt-mic {
  position: absolute; right: 8px; bottom: 8px; z-index: 2;
  width: 30px; height: 30px; display: grid; place-items: center; padding: 0;
  border: 1.5px solid transparent; border-radius: 50%; background: var(--bg4); color: var(--tx3);
  opacity: 0; transition: opacity var(--ease), color var(--ease), border-color var(--ease), background var(--ease);
}
.nt-mic svg { width: 16px; height: 16px; }
.nt-cat:hover .nt-mic, .nt-cat:focus-within .nt-mic { opacity: .8; }
.nt-mic:hover { opacity: 1 !important; color: var(--c-title); border-color: var(--c-title); }
.nt-mic.is-live {
  opacity: 1 !important; color: #fff; background: #d6423f; border-color: #d6423f;
  animation: nt-mic-pulse 1.6s ease-in-out infinite;
}
.nt-mic.is-live:hover { background: #b93330; border-color: #b93330; color: #fff; }
@keyframes nt-mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(214, 66, 63, .55); }
  50%      { box-shadow: 0 0 0 7px rgba(214, 66, 63, 0); }
}
@media (prefers-reduced-motion: reduce) { .nt-mic.is-live { animation: none; box-shadow: 0 0 0 3px rgba(214,66,63,.4); } }

/* THE BOX BEING DICTATED INTO WEARS THE RING (Dex, 2026-09-09). The mic is a
   30px circle in the bottom-right corner of one box on a canvas of them, and
   "which box are my words going into" is a question you ask from anywhere on
   that canvas -- so the answer is drawn at the size of the box, in the same
   red as the pill and the mic.

   A box-shadow ring, not a border: .nt-cat-box's 3px of padding IS the frame
   around the head strip (see the note above it), so a real border would move
   every word in the category by 3px the moment recording started. A ring is
   painted outside the box and costs no layout.

   It beats :focus-within's ring on specificity, which is the right way round:
   the box being dictated into is also the focused one, and the accent hairline
   under a 3px red ring would only muddy it. The EMOJI gets the same ring --
   it sits outside the box, in the aside, so without it the one part of the
   category hanging off to the left is the part that does not say it is live. */
.nt-cat.is-dictating .nt-cat-box { box-shadow: 0 0 0 3px #d6423f; }
.nt-cat.is-dictating .nt-cat-emoji { box-shadow: 0 0 0 3px #d6423f; }

/* Words the engine is still deciding on. In the DOM so they can be read,
   never in the document: stripped by serialize() and by every history
   capture. */
.nt-interim {
  color: var(--tx3); font-style: italic; opacity: .85; user-select: none;
  border-bottom: 1.5px dotted color-mix(in srgb, var(--tx3) 60%, transparent);
}

/* Scroll the box being dictated into out of sight and this appears at the
   top-left of the canvas, clear of the sidebar. Without it a session left
   running three screens up is invisible and still writing. */
/* LEFT AT EVERY WIDTH, AND NEVER STRETCHED (Dex, 2026-09-09). It used to
   flip to `right: 12px` under 980px and to `left:12px; right:12px` under
   720 -- so a browser window dragged to half a screen showed it hard right,
   and half a screen at 175% Windows scaling is under 720 CSS px, where BOTH
   offsets being set stretched it the full width of the canvas. A status chip
   that changes corner and then becomes a banner is three different objects.

   The 720 rule had a real reason, which is why it is replaced rather than
   deleted: below that width the sidebar is a full-width drawer (--sb: 82vw)
   and `left: calc(var(--sb) + 14px)` puts the pill off the right edge. The
   answer is a smaller LEFT, not a right edge -- the drawer is an overlay
   there, so the canvas starts at 0 and 12px is the correct margin.

   max-width instead of a right offset. Only one offset is ever set, so the
   box stays shrink-to-fit and a long category name ellipsises inside its own
   cap (.nt-pill-main, which needs min-width:0 to be allowed to shrink)
   rather than pushing the pill off the screen. */
.nt-pill {
  position: absolute; top: calc(var(--hdr) + 12px); left: calc(var(--sb) + 14px); z-index: 40;
  right: auto; max-width: calc(100% - var(--sb) - 26px);
  display: none; align-items: center; gap: 4px; padding: 4px 4px 4px 10px;
  /* 3px, double the old 1.5 (Dex, 2026-09-09) -- this is the one thing on
     screen saying a microphone is live, and at a hairline it read as a
     tooltip. Written as 3 and not as 1.5+2: Chrome snaps a border width to
     whole layout pixels, so 3.5px is DRAWN as 3px, and a stylesheet that
     names a width the browser will not use is a stylesheet that lies. The
     ring on the live box below is the same 3px for the same reason. */
  border: 3px solid #d6423f; border-radius: 999px; background: var(--bg2); box-shadow: var(--shadow);
  animation: nt-pill-in .18s ease-out;
}
.nt-app.is-rail .nt-pill { left: calc(var(--rail) + 14px); max-width: calc(100% - var(--rail) - 26px); }
.nt-pill.is-on { display: flex; }
@keyframes nt-pill-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .nt-pill { animation: none; } }
.nt-pill-dot { width: 9px; height: 9px; border-radius: 50%; background: #d6423f; flex: 0 0 auto; animation: nt-mic-pulse 1.6s ease-in-out infinite; }
.nt-pill-main { display: flex; align-items: baseline; gap: 8px; border: 0; background: none; padding: 2px 4px; color: var(--tx); max-width: 320px; min-width: 0; }
.nt-pill-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nt-pill-time { font-size: 12px; color: var(--tx2); font-variant-numeric: tabular-nums; }
.nt-pill-main:hover .nt-pill-name { color: var(--c-title); }
.nt-pill-stop { width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: none; color: #d6423f; }
.nt-pill-stop svg { width: 13px; height: 13px; }
.nt-pill-stop:hover { background: color-mix(in srgb, #d6423f 20%, transparent); }

/* ---- the demo ------------------------------------------------------------- */
/* A sandbox for anyone who opens the preview from the AI Lab. It says so,
   once, where the save status would be. */
.nt-app.is-demo .nt-status { color: var(--c-title); opacity: .9; }
.nt-demo-note {
  margin: 0 0 18px; padding: 10px 14px; border-radius: 10px; font-size: 13px; line-height: 1.5;
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
  background: color-mix(in srgb, var(--c) 10%, transparent); color: var(--tx2);
}
.nt-demo-note strong { color: var(--c-title); }

/* ---- narrow screens ----------------------------------------------------------- */
@media (max-width: 980px) {
  .nt-header { padding: 0 6px; gap: 4px; }
  /* The three alignments go first. nth-child counts EVERY sibling, separators
     included, so these indices are the live positions in the append list in
     app.js -- 9, 10, 11 are left, centre, right. Change that list and change
     this. */
  .nt-header-mid .nt-sep, .nt-header-mid .nt-fmt:nth-child(n+9):nth-child(-n+11), .nt-pick:not(.nt-pick-size) { display: none; }
  .nt-search.is-open { width: 190px; }
  .nt-status { display: none; }
  /* NO ROOM FOR A GUTTER on a narrow screen, so the aside goes back into
     the flow and the box gives up its width to it. Squeezed is worse than
     off the left edge, but only just, and off the edge is unreachable. */
  .nt-canvas-inner { --gutter: 14px; padding: 20px 14px 40vh; }
  .nt-cat-shell { display: flex; align-items: flex-start; gap: 6px; }
  .nt-cat-aside { position: static; margin-right: 0; flex: 0 0 auto; }
  .nt-cat-box { flex: 1 1 auto; min-width: 0; }
  /* The pill does NOT move here. The sidebar is still in flow at this width,
     so the base `left: calc(var(--sb) + 14px)` is still the left edge of the
     canvas, and there is room for a 380px chip in the 700px beside it. */
}
@media (max-width: 720px) {
  .nt-app { --sb: 82vw; }
  /* The sidebar is an overlaid drawer here, so the canvas starts at 0 and the
     pill's usual `--sb + 14` would put it off the right edge. A smaller LEFT,
     not a right edge -- setting both stretched it into a banner. The mic is
     worth keeping visible on a phone, where hover does not exist. */
  .nt-pill { left: 12px; max-width: calc(100% - 24px); }
  .nt-mic { opacity: .75; }
  .nt-sidebar { position: absolute; top: 0; bottom: 0; left: 0; z-index: 20; box-shadow: 8px 0 30px rgba(0,0,0,.4); }
  .nt-app.is-rail .nt-sidebar { box-shadow: none; }
  .nt-session-title { font-size: 26px; }
  .nt-header-mid .nt-fmt:nth-child(n+4) { display: none; }
}

/* Force native live scrollbar dragging (Dex, 2026-10-05).
   smooth behavior breaks drag-scrubbing in Chrome. */
.nt-canvas,
.nt-canvas * {
  scroll-behavior: auto !important;
}

/* Mobile: category color circles 50% smaller (Dex, 2026-10-05) */
@media (max-width:767px){
  .nt-cat-color{width:8px !important;height:8px !important;margin:0 2px}
}

/* ---- accounts (dexnote/account.js) ----------------------------------------
   The sign-in card, the account button in the header and the password field,
   drawn by /dexnote/ and by the homepage overlay alike. Built from the app's
   own modal and button classes, so these only lay them out. */
/* The card and its provider buttons are the site's sign-in panel
   (.signin-card / .signin-provider in styles.css) at the same sizes, with
   dexnote's mark and colour: the primary button is the icon's orange.
   styles.css is not loaded on /dexnote/, so the numbers are repeated here --
   change them there and change them here. */
.dn-card { display: flex; flex-direction: column; align-items: stretch; gap: 10px; text-align: center; width: min(360px, calc(100vw - 32px)); max-width: none; box-sizing: border-box; padding: 28px 28px 22px; border: 0; border-radius: 26px; }
.dn-logo { width: 64px; height: 64px; align-self: center; }
.dn-title { margin: 4px 0 0; font-size: 1.3rem; font-weight: 700; letter-spacing: .01em; }
.dn-note { display: flex; flex-direction: column; margin: 0 0 6px; color: var(--tx2); font-size: .95rem; line-height: 1.45; }
.dn-providers { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.dn-provider {
  display: inline-flex; align-items: center; justify-content: flex-start; gap: 12px;
  min-height: 46px; width: 195px; padding: 0 18px; border: 1px solid transparent; border-radius: 12px;
  background: var(--bg4); color: var(--tx); font: inherit; font-size: 1.3rem; font-weight: 600; cursor: pointer;
  transition: background-color .15s, filter .15s;
}
.dn-provider:hover { background: var(--bdr); }
.dn-provider.is-primary { background: #FF7A45; color: #2A0A17; }
.dn-provider.is-primary:hover { filter: brightness(1.08); }
.dn-mark { width: 24px; height: 24px; flex: 0 0 auto; background-color: currentColor; -webkit-mask: var(--mark) center / contain no-repeat; mask: var(--mark) center / contain no-repeat; }
/* The same three marks as styles.css's [data-icon] (assets/icons/social/). */
.dn-mark[data-provider="google"] { --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M12.48 10.92v3.28h7.84c-.24 1.84-.853 3.187-1.787 4.133-1.147 1.147-2.933 2.4-6.053 2.4-4.827 0-8.6-3.893-8.6-8.72s3.773-8.72 8.6-8.72c2.6 0 4.507 1.027 5.907 2.347l2.307-2.307C18.747 1.44 16.133 0 12.48 0 5.867 0 .307 5.387.307 12s5.56 12 12.173 12c3.573 0 6.267-1.173 8.373-3.36 2.16-2.16 2.84-5.213 2.84-7.667 0-.76-.053-1.467-.173-2.053H12.48z'/%3E%3C/svg%3E"); }
.dn-mark[data-provider="github"] { --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' fill-rule='evenodd' d='M12 .3a12 12 0 0 0-3.79 23.39c.6.11.82-.26.82-.58l-.02-2.04c-3.34.73-4.04-1.6-4.04-1.6-.55-1.39-1.34-1.76-1.34-1.76-1.08-.75.08-.73.08-.73 1.21.09 1.84 1.24 1.84 1.24 1.07 1.83 2.81 1.3 3.5 1 .1-.78.42-1.31.76-1.61-2.67-.3-5.47-1.33-5.47-5.93 0-1.31.47-2.38 1.24-3.22-.13-.3-.54-1.52.11-3.18 0 0 1-.32 3.3 1.23a11.5 11.5 0 0 1 6 0c2.28-1.55 3.28-1.23 3.28-1.23.65 1.66.24 2.88.12 3.18a4.65 4.65 0 0 1 1.23 3.22c0 4.61-2.81 5.62-5.48 5.92.43.36.81 1.1.81 2.22l-.01 3.29c0 .31.21.69.82.57A12 12 0 0 0 12 .3Z'/%3E%3C/svg%3E"); }
.dn-mark[data-provider="discord"] { --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M20.317 4.3698a19.7913 19.7913 0 0 0-4.8851-1.5152.0741.0741 0 0 0-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 0 0-.0785-.037 19.7363 19.7363 0 0 0-4.8852 1.515.0699.0699 0 0 0-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 0 0 .0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 0 0 .0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 0 0-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 0 1-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 0 1 .0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 0 1 .0785.0095c.1202.099.246.198.3728.2924a.077.077 0 0 1-.0066.1276 12.2986 12.2986 0 0 1-1.873.8914.0766.0766 0 0 0-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 0 0 .0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 0 0 .0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 0 0-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189z'/%3E%3C/svg%3E"); }
.dn-card .nt-modal-btns { justify-content: center; }
.dn-error { margin: 0; color: var(--danger); font-size: .9rem; }

.dn-account { overflow: hidden; }
.dn-avatar { width: 24px; height: 24px; border-radius: 50%; display: block; }
.dn-input { width: 100%; box-sizing: border-box; margin: 6px 0 4px; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--bdr); background: var(--bg2); color: var(--tx); font: inherit; font-size: 15px; }
.dn-input:focus { outline: none; border-color: var(--c); }
