/* BrainWeave — the ruler: a magnifying table of contents down the left side of a long page.
   js/features/ruler.js builds it and sets, on each row, --d: how far that row is from where you are reading
   (or from the pointer), --h: the row's height, and --l: how many lines its title may take. Everything that
   brightens or glows is worked out here from --d. Tokens only, so it takes on whichever look is switched on.

   WHERE IT SHOWS (js/main.js marks the routes): a note, a hub, a book and a writing page always; a scrapbook only
   when it has a heading for each year. Nowhere else. A heading that is not a part of the page's content (a block of
   controls such as "Remove this book") carries data-ruler-skip, on itself or on the block it heads, and is left out.
   A dated scrapbook lists every year it holds, also the years whose events are not drawn yet; choosing one of those
   draws the events up to it.
     1280px and wider   "full": a column is kept left of the page (--ruler-col) and the titles show all the time.
                        The ruler is as wide as the room left of the page allows, up to 320px: the column's 240px
                        where the page fills its room (to about 1680px), more where the page has room to spare.
     1024px to 1279px   "slim": a narrow strip of ticks with a small contents mark at its top (span.ruler-cue), so
                        even closed it reads as this page's contents, not a scroll bar; resting the pointer on it,
                        tabbing onto it or tapping it opens the titles to the LEFT, over the side bar, never over the
                        page. Its top and foot fall between the side bar's own things (8px below its name and mark,
                        8px above its account button, never across a button or label), so nothing there is half
                        hidden once it opens.
     under 1024px       no ruler.
   From 1024px every page that keeps the column starts its content where a full-width page starts, so the ruler
   stands in the same place on a note, a hub, a book, a scrapbook and a page of writing.

   WHAT IT IS MADE OF
     nav.ruler
       span.ruler-cue           the slim strip's contents mark (a small list, aria-hidden), 7px below the strip's top
                                edge and over the right end of its ticks; not shown on the full ruler.
       ol.ruler-list            the picture: one .ruler-row for each part, holding span.ruler-mark, which holds
                                span.ruler-title and span.ruler-tick. Decoration only: nothing here is clicked.
       div.ruler-groups         the buttons, laid over the picture and see-through: one button.ruler-group for each
                                part while every row can be 24px tall, otherwise one for each few neighbouring parts
                                (.ruler.is-grouped), so nothing to click is ever under 24px.
     A mark is only as big as its title and tick (with 10px on its left and 3px above and below) and always sits
     inside the ruler, so a fill on .ruler-mark[aria-current] is a finished box with round corners (--r-sm). (A row of
     one line that is neither magnified nor the part being read keeps 2px on its left instead: no box is drawn there.)
     The title of the part being read is never cut, at rest, while pointing or from the keyboard: it takes up to three
     lines, then steps its size down (no smaller than --ruler-size). The title under the pointer is never cut either.
     The step down is the same on both sides: the row just above the magnified one and the row just below it are
     always both titled (wherever there is a row on both sides), each on as many lines as its title needs there, up to
     two (one on a tight ruler).
     What a title says: the page keeps its headings and each button its part's whole title as its name, but the words
     drawn are shorter where they can be. "Chapter XV: San Francisco" is drawn "XV · San Francisco" ("Chapter Twelve"
     is "12", "Appendix A" is "A"; Part, Book, Section and Volume keep their word). A far title takes two lines where
     it needs them and the ruler has the height; a title without the room shows its first phrase (before a subtitle or
     a dash: "4 · Three Acts, Three Outcomes"), or is cut at a word with "…" ("XXVI · Halleck Assumes…"), never inside
     one, keeping two whole words or more and never ending on a small word ("of", "the", "for"...). A title one line
     could only cut badly is drawn a little smaller (never under --ruler-size, through --fit) or on two lines. So the
     text of .ruler-title can change as the reading or the pointer moves.
     Air: the first mark stands at least 12px below the ruler's top (less the look's own top padding: --ruler-lead;
     on the slim strip, room for its contents mark). The box of the part being read keeps at least 10px of clear air
     from the titles above and below it, at rest, scrolled, pointing and from the keyboard: its row is given the room,
     and the mark stays in the middle of it. With the keyboard on a button, the rows just outside it are a little
     taller and their titles keep to their far side (.is-ring-after, .is-ring-before, except the part being read), so
     the focus ring has air round it.
     Style the rows, marks, titles and ticks as before. A hover or focus look goes on .ruler.is-pointing and
     .ruler-row.is-near (the row under the pointer or the keys), and on .ruler-group:focus-visible (the focus ring):
     .ruler-mark is no longer a button, so .ruler-mark:hover and .ruler-mark:focus-visible never match.

   HOOKS FOR A LOOK. Set these in the look's own file; nothing in this file needs touching.
   On <html>:
     data-rulerroute="always|parts"   this page may carry a ruler (absent: it never does)
     data-rulercol="on"               the column (or, 1024 to 1279, the strip's room) is kept left of the page
     data-rulerfree="on"              a note, hub or book with nothing for a ruler (too short, not found, failed to
                                      load): its column was given back, the page sits where a no-ruler page sits
     data-rulermode="full|slim"       a ruler is showing right now, and how (absent: none is)
     --ruler-col    240px             width of the column kept for the ruler from 1280px up
     --ruler-strip  16px              extra room kept left of the page from 1024px to 1279px
   On .ruler (for example  :root[data-theme="NAME"] .ruler { --ruler-fill: ...; }):
     --ruler-here            colour of the part being read: its tick, and the glow   (default: the place colour)
     --ruler-ink             titles at rest
     --ruler-ink-near        the magnified title (under the pointer, or where the reading is)
     --ruler-ink-here        the title of the part being read
     --ruler-tick            ticks at rest
     --ruler-tick-near       the magnified tick
     --ruler-tick-w          longest tick                                            (36px)
     --ruler-tick-h          tick thickness at rest                                  (2px)
     --ruler-tick-h-here     thickness of the magnified tick and the current one     (3px)
     --ruler-glow            box-shadow on the current tick                          (none switches it off)
     --ruler-scale           the fine dotted scale the ticks grow from               (transparent switches it off)
     --ruler-font            titles at rest
     --ruler-font-near       the magnified title
     --ruler-size            title size at rest, in px                               (12.5px)
     --ruler-size-near       size of the magnified title, in px                      (17px; 19px from 1600px up)
     --ruler-lines           most lines the magnified title may take                 (3)
     --ruler-gap             space between the ruler and the page content, in px     (20px)
     --ruler-fill            fill behind the whole column                            (transparent)
     --ruler-radius          its corner radius
     --ruler-pad             its padding, in px (the ruler keeps its outer size)     (0px)
     --ruler-shadow          its shadow                                              (none)
     --ruler-fill-slim       fill of the slim strip at rest
     --ruler-panel-fill      fill of the slim strip once opened
     --ruler-panel-shadow    its shadow once opened
     --ruler-panel-edge      the line round it once opened, which sets it above the side bar it covers
     --ruler-cue             colour of the slim strip's contents mark                (--ruler-ink-near)
   Class names and attributes that stay put:
     .ruler  [data-mode="full|slim"]  [data-count="N"] (parts)  [data-groups="N"] (buttons)
             .is-dense (too many parts to show every title: the first part of each button keeps its title, on one
                       line, or on two where one line would cut it and the ruler has the height; the other far rows
                       are ticks alone. A button may start a part or two off the even split, at a part whose title
                       shows whole, so buttons can cover a part more or fewer than their neighbours)
             .is-grouped (a button covers several parts)  .is-pointing (the pointer or the keyboard is on it)
             .is-open (slim, opened)  .ruler-empty (the writing page's one quiet line, before any heading)
     .ruler-list  .ruler-row  .ruler-row.is-sub  .ruler-row.is-near (the magnified row)
     .ruler-row.is-here (the row of the part being read)  .ruler-row.is-one (its title has one line)
     .ruler-row.is-off (its title is not drawn: the row is too thin to hold it)
     .ruler-row.is-lead (on a dense ruler: the first part of a button, whose title shows at rest)
     .ruler-mark  .ruler-mark[aria-current="location"] (the part being read)  .ruler-title  .ruler-tick
     .ruler-groups  .ruler-group  .ruler-group[aria-current="location"] (the button holding the part being read)
     .ruler-hint (the quiet line; its box is div.ruler.ruler-empty with role="navigation", so write .ruler, not
                  nav.ruler, for anything the quiet line should take too. It is a short ruler of its own, as tall
                  as a ruler of two parts, holding an empty div.ruler-list for the scale down its edge and the line
                  at its top: the look's --ruler-fill, --ruler-radius, --ruler-pad and --ruler-shadow dress it as
                  they dress every ruler, so a look needs no rule of its own for it)
     .ruler-row.is-ring-after, .ruler-row.is-ring-before (the rows just outside the button the keyboard is on)
     .ruler-cue (the slim strip's contents mark; it holds one svg drawn in currentColor)
   Do not set, in a look: padding on #main, or a left padding or max-width on .page, at 1024px and wider;
     padding, margin or display on .ruler-title, or the gap of .ruler-mark (they hold the "..." of a cut title
     in place); margin, padding or a height on .ruler-groups or .ruler-group (they make each button at least 24px
     each way); an opacity under .8 on .ruler-title (a title is readable or, with .is-off, not drawn: there is no
     faint in-between, so a look needs no rule of its own for the dense ruler's titles); the position, size or
     display of .ruler-cue (the ticks start below it).
     Nor anything that changes how wide or tall a title's words are (font-family, font-size, font-weight,
     font-stretch, font-style, letter-spacing, word-spacing, text-transform, font-variant, line-height) on a state the
     measuring rows do not carry. ruler.js measures every title in rows built like the ruler's own, inside .ruler and
     with its data-mode, carrying only .ruler-row, .is-sub, .is-near, .is-one, and, for the part being read, .is-here
     and aria-current="location" on its .ruler-mark. So a title's type may be set on .ruler-title and through those
     (and through the tokens above); it must not depend on .ruler.is-pointing, .is-open, .is-dense, .is-grouped,
     .ruler-row.is-lead, .is-off, .is-ring-after, .is-ring-before, :hover, :focus-within, the buttons' states or
     data-count/data-groups, or the title will be drawn wider than it was measured and cut where it fitted.
   Worked out by js/features/ruler.js, not for a look to set: --d  --l  --h  --fit (a smaller size for a long title
     that must show in full, or for a title one line could only cut badly)  --ruler-w  --ruler-r  --ruler-top
     --ruler-h  --ruler-open  --ruler-lead. Nor padding, margin, max-width or align-self on .ruler-mark (they keep the
     box inside the ruler, its air, and its title measured right), the text of .ruler-title, a margin on .page from
     1024px while data-rulercol="on", or anything on .ruler-probe (rows built for measuring, never on screen). */

/* ---------- The column the ruler stands in ---------- */
:root { --ruler-col: 240px; --ruler-strip: 16px; }
@media (min-width: 1024px) and (max-width: 1279px) { :root[data-rulercol="on"] #main { padding-left: var(--ruler-strip); } }
@media (min-width: 1280px) { :root[data-rulercol="on"] #main { padding-left: var(--ruler-col); } }
/* Every page that keeps the column starts its content where a full-width page starts (one --content-max wide, centred
   in the room right of the column), whatever its own width: a note or a page of writing is narrower and keeps its
   spare room on its right. So the ruler stands in the same place on every page at every width, and set from the first
   moment of loading, nothing moves sideways when the page arrives. */
@media (min-width: 1024px) {
  :root[data-rulercol="on"] #main .page { width: auto; margin-left: max(0px, calc((100% - var(--content-max)) / 2)); margin-right: auto; }
}
@media print { :root[data-rulercol="on"] #main { padding-left: 0; } }

/* ---------- The ruler ---------- */
.ruler {
  --ruler-here: var(--place, var(--accent));
  --ruler-ink: var(--ink-2);
  --ruler-ink-near: var(--ink);
  --ruler-ink-here: var(--ruler-ink-near);
  --ruler-tick: var(--ink-3);
  --ruler-tick-near: var(--ink);
  --ruler-tick-w: 36px;
  --ruler-tick-h: 2px;
  --ruler-tick-h-here: 3px;
  --ruler-glow: 0 0 12px var(--ruler-here), 0 0 3px var(--ruler-here);
  --ruler-scale: var(--line-strong);
  --ruler-font: var(--font-ui);
  --ruler-font-near: var(--font-display, var(--font-ui));
  --ruler-size: 12.5px;
  --ruler-size-near: 17px;
  --ruler-lines: 3;
  --ruler-gap: 20px;
  --ruler-fill: transparent;
  --ruler-radius: var(--r-lg);
  --ruler-pad: 0px;
  --ruler-shadow: none;
  --ruler-fill-slim: var(--paper-sunk);
  --ruler-panel-fill: var(--surface);
  --ruler-panel-shadow: var(--shadow-2);
  --ruler-panel-edge: color-mix(in srgb, var(--ruler-here) 55%, var(--line-strong));
  --ruler-cue: var(--ruler-ink-near);

  position: fixed; z-index: calc(var(--z-nav) - 1);
  right: var(--ruler-r, auto); left: var(--ruler-x, auto); top: var(--ruler-top, 40px);
  width: var(--ruler-w, 24px); height: var(--ruler-h, 60vh);
  box-sizing: border-box; padding: var(--ruler-pad);
  /* The picture and the buttons share the one cell: the buttons lie exactly over the rows they cover. */
  display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  background: var(--ruler-fill); border-radius: var(--ruler-radius); box-shadow: var(--ruler-shadow);
  font-family: var(--ruler-font); color: var(--ruler-ink);
}
@media (min-width: 1600px) { .ruler { --ruler-size-near: 19px; } }
.ruler[hidden] { display: none; }
@media (max-width: 1023px) { .ruler { display: none; } }
@media print { .ruler { display: none; } }

.ruler-list { grid-area: 1 / 1; min-width: 0; min-height: 0; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; position: relative; }
/* Air above the first mark (js/features/ruler.js sets --ruler-lead), the same for the picture and the buttons on it. */
.ruler-list, .ruler-groups { padding-top: var(--ruler-lead, 0px); }
/* The scale: fine marks down the edge the ticks grow from. */
.ruler-list::before {
  content: ''; position: absolute; top: 0; bottom: 0; right: 0; width: 6px; pointer-events: none;
  background: repeating-linear-gradient(to bottom, var(--ruler-scale) 0 1px, transparent 1px 9px); opacity: .75;
}

/* A row takes more of the height the nearer it is to the focus: that is the magnifying. js/features/ruler.js works
   the heights out (--h), so that it also knows how many lines each title has room for. */
.ruler-row {
  --d: 6; --l: 1;
  flex: none; height: var(--h, 24px); min-height: 0;
  display: flex; margin: 0; padding: 0;
  transition: height var(--fast) var(--ease);
}
/* A mark is as wide and as tall as its title and tick, and no more: right-aligned, with room on its left and a little
   above and below, and never quite to the ruler's left edge. So a look's fill behind the part being read
   (.ruler-mark[aria-current]) is a finished box with round corners that sits inside the ruler, whatever the row's
   height or the title's length. */
.ruler-mark {
  flex: 0 1 auto; align-self: center; min-width: 0; min-height: 0; max-width: calc(100% - 4px); max-height: 100%;
  display: flex; align-items: center; justify-content: flex-end; gap: 2px;
  margin: 0 0 0 auto; padding: 3px 0 3px 10px; box-sizing: border-box; color: inherit; font: inherit; text-align: right;
  border-radius: var(--r-sm);
}

/* The buttons. Each is as tall as the rows it covers and as wide as the ruler, and draws nothing of its own but
   its focus ring. Its name is on the button itself (aria-label), so it has one whether or not a title is on show. */
.ruler-groups { grid-area: 1 / 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; z-index: 1; }
.ruler-group {
  flex: none; display: block; height: var(--h, 24px); min-height: 0;
  margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit;
  border-radius: var(--r-sm); cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: height var(--fast) var(--ease);
}
/* The ring keeps to the button's own edge, so it never paints over the title of the row above or below; the buttons
   reach a little past the titles at each side, so it does not press on the first letter of a long title either. */
nav.ruler .ruler-group:focus-visible { outline: 2px solid var(--ruler-here); outline-offset: 0; box-shadow: none; }
.ruler[data-mode="full"] .ruler-groups { margin: 0 -6px; }

/* A title never ends cut off bare: it wraps to as many lines as its row has room for (--l) and then ends in "…".
   The room on its right is where that "…" is drawn: on right-aligned text Chrome hangs it past the last word, where
   it would otherwise be clipped away. It is also the space between a title and its tick.
   Only the focus row and the row on each side of it ever wrap; every other row is one line (.is-one). */
.ruler-title {
  min-width: 0; flex: 0 1 auto; overflow: hidden; overflow-wrap: anywhere; text-wrap: balance; padding-right: 1em; margin-right: -.25em;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--l, 1); line-clamp: var(--l, 1);
  font-size: min(clamp(var(--ruler-size), calc(var(--ruler-size-near) - var(--d) * 2.2px), var(--ruler-size-near)), var(--fit, 999px));
  line-height: 1.18; font-weight: 550; letter-spacing: -.005em;
  color: var(--ruler-ink); opacity: clamp(.8, calc(1 - var(--d) * .06), 1);
  transition: font-size var(--fast) var(--ease), opacity var(--fast) var(--ease), color var(--fast) var(--ease);
}
.ruler-tick {
  flex: none; height: var(--ruler-tick-h); border-radius: 2px; background: var(--ruler-tick);
  width: clamp(10px, calc(var(--ruler-tick-w) - var(--d) * 7px), var(--ruler-tick-w)); opacity: clamp(.55, calc(1 - var(--d) * .13), 1);
  transition: width var(--fast) var(--ease), opacity var(--fast) var(--ease), background-color var(--fast) var(--ease), box-shadow var(--slow) var(--ease);
}
/* A title with one line to itself runs to the end of that line before its "…", which is then drawn inside the line.
   A row of one line that is neither magnified nor the part being read has no box drawn round it, so its mark gives the
   room on its left to the words (js/features/ruler.js counts on these 2px when it fits a title to the line). */
.ruler-row.is-one .ruler-title { display: block; white-space: nowrap; text-overflow: ellipsis; padding-right: 0; margin-right: .45em; }
:is(.ruler[data-mode="full"], .ruler.is-open) .ruler-row.is-one:not(.is-near) .ruler-mark:not([aria-current]) { padding-left: 2px; }
.ruler-row.is-sub .ruler-title {
  font-size: min(clamp(calc(var(--ruler-size) - .5px), calc(var(--ruler-size-near) - 2.5px - var(--d) * 1.8px), calc(var(--ruler-size-near) - 2.5px)), var(--fit, 999px));
  font-weight: 450;
}
.ruler-row.is-sub .ruler-tick { height: max(1px, calc(var(--ruler-tick-h) - .5px)); width: clamp(7px, calc(var(--ruler-tick-w) * .7 - var(--d) * 5px), calc(var(--ruler-tick-w) * .7)); }

/* Under the pointer, or where the reading is: the big one. */
.ruler-row.is-near .ruler-title { color: var(--ruler-ink-near); font-weight: 700; font-family: var(--ruler-font-near); opacity: 1; }
.ruler-row.is-near .ruler-tick { background: var(--ruler-tick-near); height: var(--ruler-tick-h-here); }

/* The part being read: the tick glows in the colour of the place you are in. */
.ruler-mark[aria-current] .ruler-tick { background: var(--ruler-here); opacity: 1; height: var(--ruler-tick-h-here); box-shadow: var(--ruler-glow); }
.ruler-mark[aria-current] .ruler-title { color: var(--ruler-ink-here); opacity: 1; }
.ruler-row.is-near .ruler-mark[aria-current] .ruler-tick { height: calc(var(--ruler-tick-h-here) + 1px); }

/* With the keyboard on a button, the rows just outside it are a little taller (js/features/ruler.js) and their titles
   keep to their far side, so the ring round the button has air between it and them. The part being read stays in the
   middle of its row, where its box has its air on both sides. */
.ruler-row.is-ring-after:not(.is-here) > .ruler-mark { align-self: flex-end; }
.ruler-row.is-ring-before:not(.is-here) > .ruler-mark { align-self: flex-start; }

/* A row too thin to hold its title: the title is not drawn at all, never left as a faint smudge. Its tick stays. */
.ruler-row.is-off .ruler-title { visibility: hidden; opacity: 0; transition: opacity var(--fast) var(--ease), visibility 0s linear var(--fast); }

/* ---------- Slim (1024px to 1279px): a strip of ticks that opens to the left, over the side bar ---------- */
.ruler[data-mode="slim"] {
  padding: 10px 4px 6px; overflow: hidden; background: var(--ruler-fill-slim); box-shadow: none;
  transition: width var(--slow) var(--ease), background-color var(--slow) var(--ease), box-shadow var(--slow) var(--ease);
}
.ruler[data-mode="slim"] .ruler-list::before { opacity: 0; top: var(--ruler-lead, 0px); }   /* the scale starts below the contents mark */
/* The buttons reach into the strip's own padding, so each is the full 24px across to click or tap. */
.ruler[data-mode="slim"] .ruler-groups { margin: 0 -4px; }
.ruler[data-mode="slim"] .ruler-title { opacity: 0; visibility: hidden; transition: opacity var(--slow) var(--ease), font-size var(--fast) var(--ease), visibility 0s linear var(--slow); }
.ruler[data-mode="slim"] .ruler-tick { width: clamp(6px, calc(16px - var(--d) * 3px), 16px); }
.ruler[data-mode="slim"]:not(.is-open) .ruler-mark { padding: 0; max-width: 100%; }
/* Opened, it is a layer of its own above the side bar: its own fill, a shadow, and a line round its edge. */
.ruler[data-mode="slim"].is-open {
  width: var(--ruler-open, 280px); z-index: calc(var(--z-nav) + 1); padding: 10px 12px 6px 14px;
  background: var(--ruler-panel-fill); box-shadow: 0 0 0 1.5px var(--ruler-panel-edge), var(--ruler-panel-shadow);
}
.ruler[data-mode="slim"].is-open .ruler-groups { margin: 0 -8px 0 -10px; }
.ruler[data-mode="slim"].is-open .ruler-list::before { opacity: .75; }
.ruler[data-mode="slim"].is-open .ruler-title { visibility: visible; opacity: clamp(.8, calc(1 - var(--d) * .06), 1); transition-delay: 0s; }
.ruler[data-mode="slim"].is-open .ruler-row.is-near .ruler-title, .ruler[data-mode="slim"].is-open .ruler-mark[aria-current] .ruler-title { opacity: 1; }
.ruler[data-mode="slim"].is-open .ruler-row.is-off .ruler-title { visibility: hidden; opacity: 0; }
.ruler[data-mode="slim"].is-open .ruler-tick { width: clamp(10px, calc(var(--ruler-tick-w) - var(--d) * 7px), var(--ruler-tick-w)); }
/* The strip's contents mark: a small list at its top, 7px below its edge and over the right end of the ticks
   (js/features/ruler.js starts the ticks 24px down, less the strip's own top padding, through --ruler-lead), so even
   closed the strip says it is this page's contents and not a scroll bar. Opened, it keeps over the ticks' right end.
   Only the strip has it. */
.ruler-cue { display: none; }
.ruler[data-mode="slim"] > .ruler-cue { position: absolute; top: 7px; right: 5px; display: block; width: 14px; height: 14px; color: var(--ruler-cue); pointer-events: none; }
.ruler[data-mode="slim"].is-open > .ruler-cue { right: 13px; }
.ruler-cue svg { display: block; width: 14px; height: 14px; }

/* ---------- Measuring ----------
   js/features/ruler.js measures how many lines a title takes in rows built like these, at the width the titles have
   once shown (the opened strip's, on the slim strip), and takes them away at once: nothing here is ever on screen. */
.ruler .ruler-probe { position: absolute; top: 0; left: 0; visibility: hidden; pointer-events: none; display: block; }
.ruler .ruler-probe > .ruler-row { height: auto; transition: none; }
.ruler .ruler-probe .ruler-mark { padding: 3px 0 3px 10px; max-width: calc(100% - 4px); }
.ruler .ruler-probe .ruler-title { transition: none; }
.ruler .ruler-probe .ruler-tick { width: clamp(10px, calc(var(--ruler-tick-w) - var(--d) * 7px), var(--ruler-tick-w)); }
.ruler .ruler-probe .ruler-row.is-sub .ruler-tick { width: clamp(7px, calc(var(--ruler-tick-w) * .7 - var(--d) * 5px), calc(var(--ruler-tick-w) * .7)); }
/* Rows that measure how wide a title is on one line: the words run on, uncut. */
.ruler .ruler-probe .ruler-row.is-measure .ruler-mark { max-width: none; }
.ruler .ruler-probe .ruler-row.is-measure .ruler-title { overflow: visible; text-overflow: clip; }

/* ---------- The writing page before it has a heading: one quiet line where the marks will be ----------
   A short ruler of its own (div.ruler.ruler-empty, as tall as a ruler of two parts): the look's fill, radius, padding
   and shadow, the scale down its edge (div.ruler-list, empty) and the line at its top where the first mark will be. */
.ruler.ruler-empty { height: var(--ruler-h, 146px); }
.ruler-empty > .ruler-hint { grid-area: 1 / 1; align-self: start; margin-top: var(--ruler-lead, 0px); padding: 3px 0 3px 10px; }
.ruler-hint { margin: 0; display: flex; align-items: center; justify-content: flex-end; gap: 10px; text-align: right; font-size: var(--ruler-size); line-height: 1.3; color: var(--ruler-ink); }
.ruler-hint .ruler-title { display: block; padding-right: 0; margin-right: 0; font-size: inherit; line-height: inherit; font-weight: 450; opacity: .8; }
.ruler-hint .ruler-tick { width: 14px; opacity: .55; }

/* No gliding or growing for people who ask for less motion; where you are still shows. */
@media (prefers-reduced-motion: reduce) {
  .ruler, .ruler-row, .ruler-group, .ruler-title, .ruler-tick { transition: none !important; }
}
