/* Project notebook — the feed, and the history vine that navigates it. */

/* Every display rule below would otherwise outrank the [hidden] attribute, and
   a hidden panel would show as an empty box or a stray rule. One guard, higher
   specificity than any single class here, holds for all of them. */
.nb-workspace [hidden] { display: none; }

/* The rail shares a row with the feed, so the vine starts where the entries
   start. Reading width is capped: the vine gets the room the prose gives up. */
/* The rail shares a row with the feed, so the vine starts where the entries
   start, and it takes a share of the width rather than a fixed strip. */
.nb-workspace { display: grid; grid-template-columns: minmax(258px, .9fr) minmax(0, 5fr); gap: var(--panel-gap); align-items: start; }
.nb-head, .nb-composer-slot { grid-column: 1 / -1; }
.nb-rail { grid-column: 1; grid-row: 3; }
.nb-feed { grid-column: 2; grid-row: 3; }

/* --- the vine ----------------------------------------------------------- */

/* Above the feed: the feed is positioned (for offset measuring) and comes later
   in the document, so without this the hover tip paints underneath it. */
.nb-rail {
  position: sticky; top: 0; z-index: 3; height: 100vh; touch-action: none; cursor: grab;
  -webkit-user-select: none; user-select: none;
}
.nb-rail.is-scrubbing { cursor: grabbing; }
/* Absolutely positioned children ignore padding, so the inset lives here. */
.nb-rail-inner { position: absolute; inset: 0 0 0 10px; }
.nb-rail-layer { position: absolute; inset: 0; overflow: hidden; }
.nb-vine-svg { position: absolute; top: 0; left: 0; width: 100%; }
.nb-yard { transition: opacity .16s ease; opacity: .75; }
.nb-rail:hover .nb-yard { opacity: 1; }
.nb-spine { stroke: var(--line); stroke-width: 1; }
.nb-tick { stroke: var(--line); stroke-width: 1; }
/* A year is a heavier gradation than a day. */
.nb-tick.is-year { stroke: var(--muted); stroke-width: 1; opacity: .6; }
.is-blank { opacity: .5; }
.nb-strand { fill: none; stroke: var(--strand); stroke-width: 3.6; stroke-linecap: round; cursor: pointer; }
.nb-strand:hover { stroke-width: 5; }
.nb-strand.is-closed { opacity: .55; }
/* Work filed onto this line that predates the fork: roots, not stem. */
.nb-strand.is-early { stroke-dasharray: 2 6; opacity: .55; }
/* The tip thins as it winds into a fiddlehead. */
.nb-curl { fill: none; stroke: var(--strand); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.nb-marker { fill: var(--ink); opacity: .5; }

.nb-rail-labels { position: absolute; inset: 0; pointer-events: none; }
/* The label knocks out the gradation it sits on, the way a ruler is numbered. */
.nb-date {
  position: absolute; left: 0; width: 38px; padding-right: 8px; transform: translateY(-50%);
  background: var(--paper);
  color: var(--muted); font: 400 var(--text-label)/1.1 var(--sans); text-align: right;
  letter-spacing: .02em; white-space: nowrap;
}
/* The year that a date opens, carried under it rather than floating alone. */
.nb-date.is-year { line-height: 1.25; }
.nb-date.is-year i {
  display: block; color: var(--ink); font: 500 var(--text-meta)/1.2 var(--sans);
  font-style: normal; letter-spacing: var(--tracking-label);
}
/* A ghost of paper behind the name, so it reads over ticks and strands. */
.nb-milestone-label {
  position: absolute; padding: 2px 5px; transform: translateY(-50%);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border-radius: 2px; background: rgba(251, 249, 243, .82);
  font: 400 var(--text-meta)/1.1 var(--sans); color: var(--ink);
}

.nb-rail-nodes { position: absolute; inset: 0; }
/* Rotation belongs in the transform, not the rotate property: that one applies
   before it, which would spin the centring translate along with the diamond. */
.nb-node {
  position: absolute; width: 13px; height: 13px; padding: 0; transform: translate(-50%, -50%);
  border: 2.5px solid var(--strand); border-radius: 999px; background: var(--paper-raised); cursor: pointer;
  transition: transform .12s ease;
}
.nb-node:hover, .nb-node:focus-visible { transform: translate(-50%, -50%) scale(1.45); }
.nb-node.is-milestone {
  width: 14px; height: 14px; border-radius: 2px; background: var(--strand);
  transform: translate(-50%, -50%) rotate(45deg);
}
.nb-node.is-milestone:hover, .nb-node.is-milestone:focus-visible {
  transform: translate(-50%, -50%) rotate(45deg) scale(1.35);
}
.nb-vine-tip {
  position: absolute; width: max-content; max-width: 230px; z-index: 5; display: grid; gap: 1px;
  padding: 5px 8px; transform: translateY(-50%);
  border: 1px solid var(--line); border-radius: 3px; background: var(--paper-raised);
  box-shadow: 0 6px 20px rgba(23, 23, 19, .12); pointer-events: none;
}
.nb-vine-tip b { font: 400 var(--text-control)/1.3 var(--sans); }
.nb-vine-tip span { color: var(--muted); font: 400 var(--text-meta)/1.2 var(--sans); }

/* --- head and composer -------------------------------------------------- */

.nb-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.nb-search { flex: 1; min-width: 160px; min-height: var(--tap); padding: 0 10px; border: 1px solid var(--line); border-radius: 3px; background: var(--paper-raised); }
.nb-author { min-height: var(--tap); padding: 0 8px; border: 1px solid var(--line); border-radius: 3px; background: var(--paper-raised); }
/* Sized and shaped like the search field beside it, so the row lines up. */
.nb-vine-open {
  display: none; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 14px;
  border: 1px solid var(--line); border-radius: 3px; background: var(--paper-raised);
  color: var(--ink); cursor: pointer; font: 400 var(--text-control)/1 var(--sans);
}
.nb-vine-open:hover { border-color: var(--ink); }
.nb-vine-open svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.nb-filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 10px; border-left: 3px solid var(--strand); background: var(--paper-raised); font: 400 var(--text-control)/1 var(--sans); }
.nb-mention-filter-chip { border-left-color: var(--blue); }
.nb-tag-filter { position: relative; width: 150px; }
.nb-tag-search { width: 100%; min-height: var(--tap); padding: 0 10px; border: 1px solid var(--line); border-radius: 3px; background: var(--paper-raised); }
.nb-tag-search:focus { border-color: var(--blue); }
.nb-filter-chip button { border: 0; background: none; cursor: pointer; }

/* The composer reads as the top of the page you are about to write: a title
   line, an open field, and the controls held quietly underneath a rule. */
.nb-composer {
  display: grid; gap: 2px; padding: 16px 18px 12px;
  border: 1px solid var(--line); border-left: 3px solid var(--line);
  background: var(--paper-raised); box-shadow: 0 9px 28px rgba(34, 31, 25, .045);
}
.nb-composer:focus-within { border-left-color: var(--ink); }
.nb-title, .nb-body-input {
  width: 100%; padding: 4px 0; border: 0; background: none; color: var(--ink);
}
.nb-title { font: var(--font-panel-title); font-size: 19px; }
.nb-title::placeholder { color: var(--line); }
.nb-body-input { font: 400 var(--text-reading)/1.6 var(--sans); resize: none; overflow: hidden; }
.nb-title:focus, .nb-body-input:focus { outline: none; }

.nb-write-tabs { display: flex; gap: 2px; margin: 6px 0 4px; }
.nb-write-tab {
  padding: 3px 10px; border: 1px solid transparent; border-radius: 3px; background: none;
  color: var(--muted); cursor: pointer; font: 400 var(--text-control)/1 var(--sans);
}
.nb-write-tab:hover { color: var(--ink); }
.nb-write-tab.is-active { border-color: var(--line); background: var(--paper); color: var(--ink); }
.nb-body-preview { min-height: 60px; padding: 4px 0; }

.nb-when { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0 2px; color: var(--muted); font: 400 var(--text-control)/1 var(--sans); }
.nb-when label { display: inline-flex; align-items: center; gap: 5px; }
.nb-when input { min-height: var(--tap-dense); padding: 0 7px; border: 1px solid var(--line); border-radius: 3px; background: var(--paper); color: var(--ink); }

.nb-composer-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.nb-composer-foot .nb-save { min-height: var(--tap); margin-left: auto; }
.nb-branch-field { display: inline-flex; align-items: center; gap: 6px; padding-left: 8px; border: 1px solid var(--line); border-radius: 999px; }
.nb-branch-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--line); }
.nb-branch-pick { min-height: var(--tap-dense); padding: 0 6px 0 2px; border: 0; border-radius: 999px; background: none; color: var(--ink); cursor: pointer; }
.nb-foot-tools { display: flex; gap: 2px; }
.nb-pending { display: flex; flex-wrap: wrap; gap: 6px; }
.nb-pending-item {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 4px 3px 8px;
  border: 1px solid var(--line); border-radius: 3px; color: var(--muted); font: 400 var(--text-meta)/1 var(--sans);
}
.nb-pending-item svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.nb-pending-item b { color: var(--ink); font-weight: 400; }
.nb-pending-item button {
  width: var(--tap-dense); height: var(--tap-dense); display: grid; place-items: center;
  border: 0; border-radius: 3px; background: none; color: var(--muted); cursor: pointer; font-size: 15px;
}
.nb-pending-item button:hover { background: var(--paper); color: var(--red); }
.nb-new-entry { display: none; }

/* --- feed --------------------------------------------------------------- */

.nb-feed { position: relative; display: grid; gap: 14px; transition: filter .2s ease; }
.nb-feed.is-rewinding { filter: blur(.7px); }
.nb-day { margin: 12px 0 0; color: var(--muted); font: 400 var(--text-label)/1 var(--sans); letter-spacing: var(--tracking-label); text-transform: uppercase; }
.nb-empty { color: var(--muted); font: 400 var(--text-body)/1.4 var(--sans); }
/* An empty feed is a lot of paper; the message sits in the middle of it. */
.nb-blank {
  display: grid; align-content: center; justify-items: center; gap: 8px;
  min-height: min(52vh, 420px); margin: 0; padding: 30px 20px;
  color: var(--muted); font: var(--font-panel-title); text-align: center;
}
.nb-blank small { max-width: 32ch; color: var(--muted); font: 400 var(--text-body)/1.5 var(--sans); opacity: .8; }

/* Stepped in by lane, so a glance down the feed shows the same branching the
   vine does. 14px a lane matches the vine's own spacing. */
.nb-entry {
  display: grid; gap: 8px; margin-left: calc(var(--lane, 0) * 14px);
  padding: 14px 18px 14px 22px; border: 1px solid var(--line); border-left: 3px solid var(--strand);
  background: var(--paper-raised); box-shadow: 0 9px 28px rgba(34, 31, 25, .045);
}
.nb-entry.is-landed { animation: nb-land .9s ease; }
@keyframes nb-land { from { background: var(--blue-soft); } to { background: var(--paper-raised); } }
.nb-entry-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font: 400 var(--text-control)/1 var(--sans); }
.nb-entry-head b { color: var(--ink); font-weight: 500; }
.nb-star { width: 13px; height: 13px; }
.nb-star svg { width: 13px; height: 13px; fill: var(--strand); stroke: none; }
.nb-branch-chip { padding: 2px 8px; border: 1px solid var(--strand); border-radius: 999px; background: transparent; color: var(--muted); font: inherit; cursor: pointer; }
.nb-edited { border: 0; background: none; color: var(--muted); font: inherit; text-decoration: underline dotted; cursor: pointer; }
.nb-entry-title { margin: 0; font: var(--font-panel-title); font-size: 19px; }
.nb-entry-body input[type="checkbox"] { margin-right: 6px; }
.nb-tools { display: flex; gap: 4px; margin-left: auto; }
.nb-tool {
  position: relative;
  width: var(--tap-dense); height: var(--tap-dense); display: grid; place-items: center; padding: 0;
  border: 1px solid transparent; border-radius: 3px; background: none; color: var(--muted); cursor: pointer;
  transition: color .12s, border-color .12s;
}
.nb-tool:hover { border-color: var(--line); background: var(--paper); color: var(--ink); }
.nb-tool svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.nb-tool.is-on { color: var(--strand); }
.nb-tool.is-on svg { fill: var(--strand); stroke: none; }
.nb-tool[data-act="delete"]:hover { color: var(--red); }

/* Hover hint, drawn rather than left to the browser's own tooltip. */
.nb-tool[data-hint]::after {
  content: attr(data-hint);
  position: absolute; z-index: 8; right: 0; bottom: calc(100% + 6px);
  padding: 4px 8px; border: 1px solid var(--line); border-radius: 3px;
  background: var(--paper-raised); box-shadow: 0 6px 20px rgba(23, 23, 19, .12);
  color: var(--ink); font: 400 var(--text-meta)/1.2 var(--sans); white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .1s .28s;
}
.nb-tool[data-hint]:hover::after, .nb-tool[data-hint]:focus-visible::after { opacity: 1; }
/* In the composer the row sits low; the hint reads better above the left edge. */
.nb-foot-tools .nb-tool[data-hint]::after { right: auto; left: 0; }

.nb-entry-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.nb-entry-extra { display: grid; gap: 8px; padding-top: 4px; border-top: 1px solid var(--line); }
.nb-inline { display: flex; align-items: center; gap: 8px; color: var(--muted); font: 400 var(--text-control)/1 var(--sans); }
.nb-inline input, .nb-inline select { min-height: var(--tap-dense); padding: 0 8px; border: 1px solid var(--line); border-radius: 3px; background: var(--paper); }
.nb-revision { display: grid; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.nb-revision-when { margin: 0; color: var(--muted); font: 400 var(--text-meta)/1 var(--sans); }

.nb-attachments { display: flex; flex-wrap: wrap; gap: 8px; }
.nb-attachment { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 3px; font: 400 var(--text-control)/1 var(--sans); }
.nb-attachment svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.nb-attachment.is-image { padding: 0; border-color: transparent; }
.nb-attachment img { max-height: 132px; border: 1px solid var(--line); }

/* A mention in a rendered entry: the name of the thing, on its own ground. */
.nb-chip {
  display: inline-flex; align-items: baseline; gap: 4px; padding: 1px 7px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--paper);
  color: var(--ink); cursor: pointer; font: inherit; font-size: .93em; line-height: 1.4;
}
.nb-chip::before { content: "@"; color: var(--muted); }
.nb-chip:hover { border-color: var(--blue); color: var(--blue); }
.nb-chip.is-inert { cursor: default; }
.nb-chip.is-inert:hover { border-color: var(--line); color: var(--ink); }

.nb-mention-anchor { position: relative; }
/* Positioned in JS, right at the caret — this is only the frame. */
.nb-mentions {
  position: absolute; z-index: 20; top: 0; left: 0; width: min(300px, calc(100% - 16px));
  max-height: 400px; display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-radius: 6px; background: var(--paper-raised);
  box-shadow: 0 10px 28px rgba(23, 23, 19, .16);
}
.nb-mentions:focus { outline: none; }
/* Button-triggered mode's own search box — the field never gets typed into,
   so there's nothing for the usual @-text-scanning search to read. */
.nb-mention-query {
  flex-shrink: 0; margin: 6px 8px 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 3px;
  background: var(--paper); color: var(--ink); font: 400 var(--text-control)/1 var(--sans);
}
.nb-mention-query:focus { outline: none; border-color: var(--blue); }
/* Step 1: which kind of thing. Tag-filter's search-only dropdown never sets
   this — .nb-mention-kinds only appears on the composer's kind picker. */
.nb-mention-kinds { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 6px; overflow-y: auto; }
.nb-mention-kind {
  min-height: var(--tap-dense); padding: 0 10px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--paper); color: var(--ink); cursor: pointer; font: 400 var(--text-control)/1 var(--sans); text-align: left;
}
.nb-mention-kind.is-active, .nb-mention-kind:hover { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
/* Step 2: search within that kind — or, for Collections, drill down through
   buckets and batches to a file. */
.nb-mention-head {
  display: flex; align-items: center; gap: 2px; padding: 4px 10px 4px 4px; flex-shrink: 0;
  border-bottom: 1px solid var(--line); color: var(--muted); font: 400 var(--text-meta)/1 var(--sans);
  text-transform: uppercase; letter-spacing: var(--tracking-label);
}
.nb-mention-head span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-mention-back {
  width: var(--tap-dense); height: var(--tap-dense); flex-shrink: 0; display: grid; place-items: center;
  padding: 0; border: 0; border-radius: 3px; background: none; color: var(--muted); cursor: pointer;
}
.nb-mention-back:hover { background: var(--paper); color: var(--ink); }
.nb-mention-back svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.nb-mention-results { overflow-y: auto; }
/* A drillable row (collection/bucket/batch): the label picks it, the chevron
   opens it. A leaf row (file, or any flat search result) is just .nb-mention
   on its own, no wrapper. */
.nb-mention-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.nb-mention-row:last-child { border-bottom: 0; }
.nb-mention-row .nb-mention { border-bottom: 0; }
.nb-mention-drill {
  width: var(--tap-dense); flex-shrink: 0; display: grid; place-items: center;
  padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer;
}
.nb-mention-drill:hover { background: var(--blue-soft); color: var(--blue); }
.nb-mention-drill svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.nb-mention {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: var(--tap); padding: 0 12px;
  border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink);
  cursor: pointer; font: 400 var(--text-body)/1.3 var(--sans); text-align: left;
}
.nb-mention:last-child { border-bottom: 0; }
.nb-mention.is-active, .nb-mention:hover { background: var(--blue-soft); }
.nb-mention b { min-width: 0; overflow: hidden; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.nb-mention span { margin-left: auto; color: var(--muted); font-size: var(--text-meta); }
.nb-mention-empty { margin: 0; padding: 10px 12px; color: var(--muted); font-size: var(--text-meta); }

/* The "Tagged…" filter box is a plain search input, not a textarea — the
   dropdown just sits below it, no caret math needed. */
.nb-tag-filter .nb-mentions { position: absolute; top: 100%; left: 0; margin-top: 4px; width: max(240px, 100%); }

/* Traces sit between the entries as a hairline: something happened, the
   notebook noticed, and it takes one line to say so. */
.nb-trace { margin-left: 3px; }
.nb-trace-line {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 3px 0;
  border: 0; border-bottom: 1px solid var(--line); background: none;
  color: var(--muted); cursor: pointer; font: 400 var(--text-meta)/1.4 var(--sans); text-align: left;
}
.nb-trace-line:hover { color: var(--ink); }
.nb-trace-what::before { content: "· "; }
.nb-trace-who { margin-left: auto; }
.nb-trace-line time { min-width: 42px; text-align: right; }
.nb-trace-list {
  display: grid; gap: 2px; margin: 0; padding: 6px 0 8px 12px; list-style: none;
  color: var(--muted); font: 400 var(--text-meta)/1.5 var(--sans);
}
.nb-trace-list li { display: flex; gap: 10px; }
.nb-trace-list li span { margin-left: auto; opacity: .7; }

.nb-older { justify-self: center; }

/* --- phone -------------------------------------------------------------- */

/* The guide: shown in place of the feed before anything is written, and from
   the ? in the head at any time after. */
.nb-guide {
  width: min(520px, calc(100% - 28px)); padding: 0;
  border: 1px solid var(--line); border-radius: 3px; background: var(--paper-raised);
  color: var(--ink); box-shadow: var(--shadow);
}
.nb-guide::backdrop { background: rgba(23, 23, 19, .46); }
.nb-guide-body { display: grid; gap: 14px; padding: 26px 28px; }
.nb-guide-map { justify-self: center; }
.nb-guide-body h3 { margin: 0; font: var(--font-panel-title); }
.nb-guide-body p { margin: 0; color: var(--muted); font: 400 var(--text-reading)/1.55 var(--sans); }
.nb-guide-body dl { display: grid; gap: 9px; margin: 0; }
.nb-guide-body dt { color: var(--ink); font: 400 var(--text-label)/1 var(--sans); letter-spacing: var(--tracking-label); text-transform: uppercase; }
.nb-guide-body dd { margin: 3px 0 0; color: var(--muted); font: 400 var(--text-body)/1.5 var(--sans); }
.nb-guide-body code { padding: 1px 4px; border-radius: 2px; background: rgba(23, 23, 19, .06); font-size: 11px; }
/* The same notation as the real vine: nodes on a strand, a diamond for a
   milestone, a curl where a line is still growing. */
.nb-guide-map { width: 100%; max-width: 300px; height: auto; }
.nb-guide-map .g-strand { fill: none; stroke-width: 2.6; stroke-linecap: round; }
.nb-guide-map .g-curl { fill: none; stroke-width: 1.8; stroke-linecap: round; opacity: .85; }
.nb-guide-map .g-node { fill: var(--paper); stroke-width: 2.4; }
.nb-guide-map .g-mile { stroke: none; }
.nb-guide-map .g-label { stroke: none; fill: var(--ink); font: 400 9px/1 var(--sans); letter-spacing: .05em; }
.nb-guide-map .g-time { stroke: none; fill: var(--muted); font: 400 8px/1 var(--sans); letter-spacing: var(--tracking-label); text-transform: uppercase; }
/* A mention chip and a trace line, drawn as they appear in the feed. */
.nb-guide-map .g-chip rect { fill: var(--paper); stroke-width: 1; }
.nb-guide-map .g-chip text { stroke: none; fill: var(--ink); font: 400 8px/1 var(--sans); }
.nb-guide-map .g-trace { stroke: none; fill: var(--muted); font: 400 8px/1 var(--sans); }
.nb-guide-close { margin: 0 28px 24px; }
.nb-guide-open { margin-left: auto; font: 400 var(--text-body)/1 var(--sans); }

.nb-sheet { padding: 0; border: 0; }
.nb-sheet-body { display: grid; gap: 14px; padding: 18px; }
.nb-sheet-branch { display: grid; gap: 4px; padding-left: 10px; border-left: 3px solid var(--strand); }
.nb-sheet-branch h3 { margin: 0; font: 400 var(--text-reading)/1.2 var(--sans); }
.nb-sheet-branch button { display: grid; gap: 2px; padding: 8px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; }
.nb-sheet-branch small { color: var(--muted); font: 400 var(--text-meta)/1 var(--sans); }
.nb-sheet-close { margin: 0 18px 18px; }

@media (max-width: 700px) {
  .nb-workspace { grid-template-columns: minmax(0, 1fr); }
  .nb-head, .nb-composer-slot, .nb-feed { grid-column: 1; }
  .nb-feed { grid-row: auto; max-width: none; }
  /* A phone has no room for four lanes of indent; keep the hint, drop the cost. */
  .nb-entry { margin-left: calc(var(--lane, 0) * 5px); padding: 12px 14px 12px 17px; }
  .nb-rail { display: none; }
  /* Its own row: a full-width flex item wraps the line to itself. */
  .nb-vine-open { display: flex; order: 3; width: 100%; }
  .nb-search, .nb-author { min-height: var(--tap); }

  /* The composer stays out of the way until the + button calls it up. */
  .nb-composer-slot .nb-composer { display: none; }
  .nb-composer-slot.is-open .nb-composer {
    position: fixed; inset: 0; z-index: 40; display: grid; align-content: start; gap: 10px;
    padding: 18px; overflow: auto; border: 0; background: var(--paper);
  }
  .nb-composer-slot.is-open .nb-body-input { min-height: 40vh; }
  .nb-composer-slot.is-open .nb-new-entry { z-index: 50; }
  .nb-new-entry {
    position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 30;
    width: 48px; height: 48px; display: grid; place-items: center;
    border: 1px solid var(--ink); border-radius: 999px; background: var(--ink); color: white;
    font-size: 24px; line-height: 1; cursor: pointer;
  }
  .nb-composer-slot.is-open + .nb-feed { display: none; }
}
