/*
 * The tool row, and the slide that arrives with it.
 *
 * ## Why this is not in `dnx.css`
 *
 * The probe did not link `dnx.css` when this was written. It was a self-contained page with its own
 * `<style>` block, so the choice was between copying these rules into it — a second home for a
 * thing that must look identical on four pages — and giving them a file of their own. Every page
 * links this one; nobody copies anything.
 *
 * **The probe links `dnx.css` now**, at `probe.html:7`, so that original reason has expired. The
 * file stays for a better one: the bar is not the visual language, it is one component that must
 * never move, and a guard in `web.test.ts` holds `dnx.css` to not describing it. Folding the two
 * together would put the thing nobody may change back into the file everybody edits.
 *
 * It leans on four custom properties (`--teal`, `--muted`, `--fg`, `--line`) that every page
 * declares with the same values, and falls back where one is missing: `--focus` comes from
 * `dnx.css`, so the outline names a colour after it rather than assuming it.
 *
 * ## What the design is for
 *
 * The order of the row is fixed on every page, so each tool is a permanent screen position and
 * therefore muscle memory. Only the highlight moves — a row that reorders is a row you have to read
 * every time instead of aim at.
 *
 * The underline is a pseudo-element rather than a `border-bottom`, so appearing and disappearing
 * cannot change the element's height and the header cannot twitch as you navigate between tools.
 */

/*
 * ## The bar itself lives here too, and that is the point
 *
 * `.topbar` used to live in `dnx.css` while the probe built a bespoke `<header>` beside it — and
 * the comment in `dnx.css` already made the argument against that: *a row that has to look
 * identical on every page cannot have two homes.* It had three. The brand and the tool row moved
 * here; the bar containing them did not, so they drifted anyway.
 *
 * **The leading edge is fixed on every page.** `dnx.css` indents `body.page > .status` to line up
 * with the centred 78rem column, and `.topbar` was indented with it. That put the brand and the
 * tool row roughly 330px further right on the expander than on the manager at 1920px, so switching
 * tools moved the control you were aiming at. The status line keeps its indent — it is the page's
 * own commentary and belongs with the content — but the chrome does not. Chrome spans the app,
 * starts at the app's edge, and does not move when the thing underneath it changes shape.
 *
 * `flex-wrap` is here for the probe, which carries far more controls than the others and would
 * otherwise overflow its row. It costs the other pages nothing: their `.spacer` takes up the slack
 * long before anything needs to wrap.
 */
.topbar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .55rem .9rem;
  background: linear-gradient(#22282a, #1b2022); border-bottom: 1px solid var(--line);
  /*
   * **Stated, so no page's contents can set it.** The bar carries identity and navigation; a page
   * that put buttons in it made the bar taller than its neighbours, and the row moved vertically as
   * you switched tools — the same complaint as the font size and the leading edge, arriving a third
   * time by a third route.
   *
   * The value is the height of a badge row at this padding, so nothing is clipped and nothing
   * stretches. `test/web.test.ts` keeps commands out of the bar, which is what makes it hold.
   */
  min-height: 2.35rem; box-sizing: border-box;
  /*
   * **The bar states its own typography, so nothing in it inherits the page's.**
   *
   * Stating it on `.toolnav` alone was not enough, and the browser said so: with the probe's 14px
   * body the *brand* rendered wider, so the tool row started at x=61 there against x=58 on the
   * other three. The row was the same size and in the wrong place — which is the same complaint as
   * §8c and §10a arriving a fourth time, through the one element nobody had stated a size for.
   *
   * On the bar rather than on each child, because the next thing added to it would inherit the page
   * again otherwise. `--*`-sized children are unaffected: they use `rem`, which is root-relative.
   */
  font-size: 13px;
}

/** Pushes everything after it to the right — the one layout primitive the bar needs. */
.spacer { flex: 1; }

.brand {
  display: flex; align-items: baseline; gap: .45rem; font-weight: 700; letter-spacing: -.01em;
  /* A link since the landing page exists: every tool needs a way back to the front. */
  color: inherit; text-decoration: none;
}
.brand:hover .d { text-decoration: underline; }
.brand .d { color: var(--teal); }
.brand .sub { color: var(--muted); font-weight: 500; }

/*
 * **The size is stated, not inherited.** `dnx.css` sets a 13px body and the probe sets 14px in its
 * own `<style>` block, so a row that inherited was a different size on the probe than on the other
 * two — reported as "in probe the text of the page names seems bigger". A navigation control that
 * is a permanent screen position has to *be* the same position on every page, and a font size that
 * varies moves it.
 *
 * Absolute rather than `rem` for the same reason: `rem` would still track a root size that any one
 * page could change, and this row must not.
 */
/*
 * `line-height` as well as `font-size`, and for the same reason one level up.
 *
 * §8c stated the size here and the row still came out a pixel taller on the probe: the `<span
 * id="toolnav">` *wrapper* is page markup and inherits the page's body font — 14px on the probe,
 * 13px everywhere else — and with `align-items: baseline` the wrapper's line box is what the
 * baseline is measured against. Setting the size on the nav alone left the strut inherited.
 *
 * Measured in a browser rather than reasoned about: 23px on the probe against 22px on the other
 * three, brand and nav otherwise identical at x=14 and x=58.
 */
.toolnav { display: flex; align-items: baseline; gap: .9rem; font-size: 13px; line-height: 19px; }
.toolnav .tool {
  position: relative; color: var(--muted); text-decoration: none; font-weight: 500;
  padding: .1rem 0; transition: color .12s ease;
}
.toolnav .tool::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -.15rem; height: 2px;
  background: var(--teal); border-radius: 2px; opacity: 0;
  transform: scaleX(.4); transform-origin: center; transition: opacity .16s ease, transform .16s ease;
}
.toolnav .tool:hover { color: var(--fg); }
.toolnav .tool[aria-current="page"] { color: var(--teal); font-weight: 700; }
.toolnav .tool[aria-current="page"]::after { opacity: 1; transform: scaleX(1); }
.toolnav .tool:focus-visible {
  outline: 2px solid var(--focus, var(--teal)); outline-offset: 3px; border-radius: 2px;
}

/*
 * The arrival slide.
 *
 * On `body` rather than on `main`, so the header travels with the page and the whole tool reads as
 * one card moving sideways. `overflow-x: hidden` on the root stops the offset start state from
 * producing a horizontal scrollbar for the one frame it exists.
 *
 * **None of this is required for the page to work.** With reduced motion, with `sessionStorage`
 * unavailable, or if the transition never fires because the tab was in the background, these
 * classes are simply absent and the page sits exactly where it always did.
 */
html { overflow-x: hidden; }
/*
 * **Stamped on `<html>`, applied to the body's children.** `arrival.js` runs in the head, before
 * `<body>` exists, so `documentElement` is the only thing it can mark.
 *
 * ## Why the children and not the body itself
 *
 * **A transformed element becomes the containing block for every `position: fixed` descendant.**
 * `dnx.css` fixes the status bar to the bottom of the viewport on the flowing pages
 * (`body.page > .status`), so while the body carried the transform that bar anchored to the *body
 * box* instead — appearing mid-screen on arrival and snapping to the bottom the moment the
 * transform was removed. Reported on the expander and the library, which are exactly the two pages
 * with a fixed status bar; the manager and the probe keep theirs in flow and never showed it.
 *
 * Transforming the children and excluding `.status` means nothing that contains a fixed element is
 * transformed, so the bar keeps the viewport as its containing block throughout. It also happens to
 * be the truer reading of the thing: **the status bar is a constant across all four tools, and a
 * constant should not move when you change tool.**
 *
 * The header still travels with the page — it is one of the children being moved. The page reads as
 * a card sliding sideways behind a status bar that stays where it is.
 */
html.slide-from-right > body > *:not(.status) { transform: translateX(3.5rem); opacity: 0; }
html.slide-from-left > body > *:not(.status) { transform: translateX(-3.5rem); opacity: 0; }
body.sliding > *:not(.status) {
  transform: translateX(0); opacity: 1;
  transition: transform .22s cubic-bezier(.22, .8, .3, 1), opacity .18s ease-out;
}
/*
 * **The motion decision is not here, and must not be.**
 *
 * This block used to read `@media (prefers-reduced-motion: reduce)` and flatten the transition.
 * That was right while the system had the only say, and it became wrong the moment the preference
 * could be overridden: it would have cancelled the animation in CSS after `arrival.js` had decided
 * to play it, and the opt-in would have looked broken with nothing to point at.
 *
 * Two places deciding one thing is how this row has failed three times already — its size, its
 * position, its height. `arrival.js` decides, and it decides once. If it did not stamp the root,
 * these rules never match and nothing animates; the media query was doing that job twice.
 *
 * It also named `body.slide-from-*`, which moved to `html.slide-from-*` when the stamp had to
 * happen before `<body>` existed. Dead selectors, quietly.
 */

/*
 * The source link is a licence term (AGPL section 13), not navigation, so it does not look like a
 * tool: no highlight, no shortcut, and set apart from the row it sits in.
 */
.toolnav .source {
  margin-left: 1.1rem;
  padding-left: 1.1rem;
  border-left: 1px solid color-mix(in srgb, currentColor 22%, transparent);
  opacity: .55;
  font-size: .85em;
}
.toolnav .source:hover,
.toolnav .source:focus-visible { opacity: 1; }

/*
 * The write switch.
 *
 * Loud when armed, and that is the point: the state persists across the four pages for a whole
 * browsing session, so the cost of persistence is somebody forgetting they armed it. A lit pixel
 * would not be enough to notice half an hour later.
 */
.toolnav .writeenable {
  margin-left: auto;
  padding: .18rem .6rem;
  border: 1px solid currentColor;
  border-radius: 3px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: .78em;
  letter-spacing: .06em;
  opacity: .55;
  cursor: pointer;
}
.toolnav .writeenable:hover { opacity: .85; }
.toolnav .writeenable[aria-pressed="true"] {
  background: var(--crit, #b03b2e);
  border-color: var(--crit, #b03b2e);
  color: #fff;
  opacity: 1;
  font-weight: 600;
}

/* A control that writes, while writing is off. Not `disabled`: the page owns that property. */
[data-write-gated="off"] {
  opacity: .4;
  cursor: not-allowed;
}

/*
 * Says why nothing happened, on the control that was pressed.
 *
 * **An outline, not a shake.** `arrival.js` decides once whether this application animates, and it
 * stamps nothing a stylesheet can read — so a `@media (prefers-reduced-motion)` block here would be
 * a second thing deciding motion, which is the fault `web.test.ts` guards against and which this
 * row has already had over its size, its position and its height. An outline needs no such
 * decision.
 */
.write-refused { outline: 2px solid var(--crit, #b03b2e); outline-offset: 1px; }

/*
 * The whole page is edged in red while writing is armed.
 *
 * `position: fixed` with `inset: 0` on a pseudo-element: it frames the viewport without entering
 * the layout, so nothing reflows when writing is switched on, and `pointer-events: none` keeps it
 * from eating a click at the edge of the window. Below `boot-error`'s 9999, which has to sit above
 * everything including this.
 */
html.write-armed::after {
  content: "";
  position: fixed;
  inset: 0;
  border: 2px solid var(--crit, #b03b2e);
  pointer-events: none;
  z-index: 9998;
}

/* The settings link. Styled as the source link is, since neither is navigation between tools. */
.toolnav .settingslink {
  font: inherit;
  font-size: .85em;
  margin-left: 1.1rem;
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
  opacity: .55;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.toolnav .settingslink:hover,
.toolnav .settingslink:focus-visible { opacity: 1; }

/* ---- the settings sheet ------------------------------------------------------------------ */
.sheet-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 90; }
.sheet {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(30rem, 92vw); z-index: 91;
  background: var(--panel); border-left: 1px solid var(--line);
  padding: 1rem 1.2rem 2.5rem; overflow: auto; box-shadow: -18px 0 40px rgba(0, 0, 0, .45);
}
.sheet header { display: flex; align-items: baseline; gap: .6rem; margin-bottom: .7rem; }
.sheet header h3 { margin: 0; font-size: .95rem; }
.sheet .sheet-close {
  margin-left: auto; font: inherit; font-size: .82em; padding: .18rem .6rem;
  background: var(--panel-2); color: var(--fg); border: 1px solid var(--line);
  border-radius: 3px; cursor: pointer;
}
.set-group { border-top: 1px solid var(--line); padding: .8rem 0 .2rem; }
.set-group:first-of-type { border-top: 0; }
.set-group > h4 {
  margin: 0 0 .5rem; font-size: .72rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.set-row { display: flex; align-items: flex-start; gap: .9rem; padding: .42rem 0; }
.set-row .label { flex: 1; min-width: 0; }
.set-row .label b { display: block; font-weight: 500; }
.set-row .label span { color: var(--muted); font-size: .84em; }
.set-row .control { flex: 0 0 auto; padding-top: .1rem; }
.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch-track {
  position: relative; width: 2.1rem; height: 1.15rem; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.switch-track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: .8rem; height: .8rem;
  border-radius: 50%; background: var(--muted);
}
.switch input:checked + .switch-track { background: var(--teal); border-color: var(--teal); }
.switch input:checked + .switch-track::after { left: auto; right: 2px; background: var(--panel); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--teal); outline-offset: 2px; }
.folder-control {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .35rem;
  max-width: 14rem;
}
.folder-control .folder-name { flex-basis: 100%; text-align: right; font-size: .84em; overflow-wrap: anywhere; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.seg button {
  font: inherit; font-size: .84em; padding: .2rem .55rem; cursor: pointer;
  background: transparent; color: var(--muted); border: 0; border-left: 1px solid var(--line);
}
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--panel-2); color: var(--fg); }
.sheet .act {
  display: inline-block; font: inherit; font-size: .86em; padding: .25rem .7rem; border-radius: 3px;
  background: var(--panel-2); color: var(--fg); border: 1px solid var(--line); cursor: pointer;
  text-decoration: none;
}
.sheet .act:disabled { opacity: .5; cursor: default; }

/* The backup progress bar. Hidden until something runs, because a bar at zero reads as stuck. */
.set-progress {
  position: relative;
  height: 1.05rem;
  margin: .1rem 0 .5rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel-2);
  overflow: hidden;
}
.set-progress .fill {
  height: 100%;
  width: 0;
  background: var(--teal-dim, #2b6b74);
  transition: width .15s linear;
}
.set-progress .count {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  letter-spacing: .02em;
  color: var(--fg);
}

/*
 * The backup, a row per kind.
 *
 * One bar cannot say what a long backup is doing: 1,835 sounds and 18 projects share a total, so a
 * bar at 40% is somewhere in the sounds and says nothing about whether the projects are safe.
 */
.set-stages { margin: .2rem 0 .5rem; display: grid; gap: .28rem; }
.set-stages .stage {
  display: grid;
  grid-template-columns: 5.2rem 5.2rem 5.6rem 1fr;
  align-items: center;
  gap: .5rem;
  font-size: .78rem;
}
.set-stages .what { color: var(--fg); }
.set-stages .count { color: var(--muted); font-variant-numeric: tabular-nums; }
.set-stages .state { color: var(--muted); }
.set-stages .track {
  height: .5rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--panel-2);
  overflow: hidden;
}
.set-stages .track .fill { display: block; height: 100%; background: var(--teal-dim, #2b6b74); }
.set-stages .stage[data-state="reading"] .state { color: var(--teal); }
.set-stages .stage[data-state="done"] .state { color: var(--fg); opacity: .75; }
.set-stages .stage[data-state="done"] .track .fill { background: var(--teal); }
.set-stages .stage[data-state="pending"] { opacity: .55; }

/* ---- help ---------------------------------------------------------------------------------- */
.toolnav .helplink {
  font: inherit; font-size: .85em; margin-left: 1.1rem; padding: 0;
  background: none; border: 0; color: inherit; opacity: .55; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.toolnav .helplink:hover, .toolnav .helplink:focus-visible { opacity: 1; }

.help-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 92; }

/* Wider than the settings sheet: this holds two columns and a screenshot. */
.help-panel {
  position: fixed; inset: 2.5vh 2.5vw; z-index: 93;
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .55); overflow: hidden;
}
.help-panel > header {
  display: flex; align-items: baseline; gap: .6rem;
  padding: .7rem 1rem; border-bottom: 1px solid var(--line);
}
.help-panel > header h2 { margin: 0; font-size: .95rem; }
.help-close {
  margin-left: auto; font: inherit; font-size: .82em; padding: .18rem .6rem;
  background: var(--panel-2); color: var(--fg); border: 1px solid var(--line);
  border-radius: 3px; cursor: pointer;
}

.help-columns { display: flex; min-height: 0; flex: 1; }
.help-nav {
  flex: 0 0 11rem; border-right: 1px solid var(--line); padding: .6rem 0; overflow: auto;
}
.help-nav button {
  display: block; width: 100%; text-align: left; font: inherit; font-size: .84rem;
  padding: .32rem 1rem; background: none; border: 0; color: var(--muted); cursor: pointer;
}
.help-nav button:hover { color: var(--fg); }
.help-nav button[aria-current="page"] {
  color: var(--fg); background: var(--panel-2);
  box-shadow: inset 2px 0 0 var(--teal);
}

.help-body { flex: 1; min-width: 0; overflow: auto; padding: 1rem 1.4rem 2rem; }
.help-body > h2 { margin: 0 0 .3rem; font-size: 1.05rem; }
.help-intro { color: var(--muted); margin-bottom: .5rem; }

.help-section { border-top: 1px solid var(--line); padding-top: .9rem; margin-top: .9rem; }
.help-section:first-of-type { border-top: 0; }
.help-section > h3 { margin: 0 0 .5rem; font-size: .88rem; }

/* Body left, screenshot right. One column when there is no room for two. */
.help-row { display: flex; gap: 1.2rem; align-items: flex-start; }
.help-row .help-md { flex: 3; min-width: 0; }
.help-shot { flex: 2; min-width: 0; margin: 0; }
.help-shot img {
  display: block; max-width: 100%; height: auto; border-radius: 3px;
  border: 1px solid var(--line); cursor: zoom-in;
}
@media (max-width: 60rem) { .help-row { flex-direction: column; } .help-shot { width: 100%; } }

/* A section written before its screenshot was taken. Its alt text is the placeholder. */
.help-pending {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .35rem; text-align: center; min-height: 6rem; padding: 1rem .8rem;
  border: 1px dashed var(--line); border-radius: 3px; background: var(--panel-2);
  color: var(--muted); font-size: .78rem;
}
.help-pending .label { text-transform: uppercase; letter-spacing: .08em; font-size: .68rem; }

.lightbox {
  position: fixed; inset: 0; z-index: 94; cursor: zoom-out;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .85); padding: 3vh 3vw;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 3px; }

/* Markdown rendered by `markdown.ts`. Tight, because help is read in a hurry. */
.help-md { font-size: .84rem; line-height: 1.5; color: var(--fg); }
.help-md p { margin: 0 0 .5rem; }
.help-md ul, .help-md ol { margin: 0 0 .6rem; padding-left: 1.15rem; }
.help-md li { margin: .12rem 0; }
.help-md code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .92em;
  background: var(--panel-2); padding: .05rem .28rem; border-radius: 2px;
}
.help-md pre {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 3px;
  padding: .5rem .7rem; overflow-x: auto; margin: 0 0 .6rem;
}
.help-md pre code { background: none; padding: 0; }
.help-md table { border-collapse: collapse; margin: 0 0 .6rem; font-size: .95em; }
.help-md th, .help-md td {
  border: 1px solid var(--line); padding: .2rem .5rem; text-align: left; vertical-align: top;
}
.help-md th { font-weight: 600; color: var(--muted); }
.help-md blockquote {
  margin: 0 0 .6rem; padding: .1rem 0 .1rem .7rem;
  border-left: 2px solid var(--teal-dim, #2b6b74); color: var(--muted);
}
.help-md a { color: var(--teal); }

/*
 * The `?` that links a control to the help section explaining it.
 *
 * Unintrusive at rest and discoverable on approach. A permanently loud `?` on every panel is noise
 * on a page somebody uses for hours; one that appears only on hover cannot be found by a keyboard,
 * a touch screen, or anyone not already looking for it. So: dim but present, lifting when the
 * pointer enters the block it belongs to.
 */
.helpq {
  margin-left: .35rem;
  width: 1.05rem; height: 1.05rem; padding: 0; line-height: 1;
  flex: none; vertical-align: middle;
  background: none; border: 1px solid currentColor; border-radius: 50%;
  color: var(--muted); font: inherit; font-size: .66rem; font-weight: 600;
  opacity: .32; cursor: help;
  /*
   * No transition, and no `prefers-reduced-motion` block to switch one off. `arrival.js` decides
   * once whether this application animates and stamps nothing a stylesheet can read, so a media
   * query here would be a second decider — the fault `web.test.ts` guards for this file, and the
   * second time this session it has been tripped. The state change is legible without a fade.
   */
}
.has-helpq:hover > .helpq { opacity: .8; }
.helpq:hover, .helpq:focus-visible { opacity: 1; color: var(--teal); }
.helpq:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

/*
 * Where a `?` landed you. A flat tint removed on a timer rather than an animation, for the same
 * reason the marker has no transition: motion is decided in one place and this stylesheet is not it.
 */
.help-section.help-landed {
  background: color-mix(in srgb, var(--teal) 12%, transparent);
  border-radius: 3px;
}

/* ---- picking one thing out of a backup ----------------------------------------------------- */
/*
 * A wider sheet than settings. Settings is a column of rows; this is a list of up to 128 projects
 * a reader is scanning by name, and a narrow column turns that into scrolling.
 */
.pick-sheet { width: min(38rem, 94vw); }
.pick-sheet header { flex-wrap: wrap; }
.pick-from { margin: 0; width: 100%; color: var(--muted); font-size: .84em; }
/*
 * Warnings sit above the list and are not dismissable. `openBackup` reports damage instead of
 * refusing the file, which is only worth doing if the reader is told.
 */
.pick-warn {
  margin: 0 0 .6rem; padding: .5rem .7rem; font-size: .86em;
  border: 1px solid var(--warn, #b7791f); border-radius: 3px;
  background: color-mix(in srgb, var(--warn, #b7791f) 12%, transparent);
}
.pick-note { margin: .2rem 0 .4rem; color: var(--muted); font-size: .86em; }
.pick-group { border-top: 1px solid var(--line); padding: .8rem 0 .2rem; }
.pick-group > h4 {
  margin: 0 0 .5rem; font-size: .72rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.pick-list { display: flex; flex-direction: column; }
.pick-row {
  display: flex; align-items: baseline; gap: .7rem; width: 100%; text-align: left;
  font: inherit; padding: .35rem .5rem; cursor: pointer; color: var(--fg);
  background: transparent; border: 1px solid transparent; border-radius: 3px;
}
.pick-row:hover, .pick-row:focus-visible { background: var(--panel-2); border-color: var(--line); }
.pick-row b { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 500; }
.pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-where { color: var(--muted); font-size: .82em; font-variant-numeric: tabular-nums; }

/*
 * Another application on the instrument's MIDI port.
 *
 * A strip under the tool row rather than a modal: the read it is warning about may be running, and
 * taking the page away from somebody mid-read helps nobody. `--warn` and not `--crit`, because
 * nothing has gone wrong yet — what has happened is that something *might*.
 */
.othertraffic {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem .9rem;
  margin: .7rem 0 0; padding: .55rem .75rem; font-size: .86em;
  border: 1px solid var(--warn, #b7791f); border-radius: 3px;
  background: color-mix(in srgb, var(--warn, #b7791f) 12%, transparent);
}
.othertraffic-say { margin: 0; flex: 1 1 22rem; min-width: 0; }
.othertraffic-count {
  color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.othertraffic-close {
  font: inherit; color: var(--fg); background: transparent; cursor: pointer;
  border: 1px solid var(--line); border-radius: 3px; padding: .15rem .55rem;
}
.othertraffic-close:hover { border-color: var(--warn, #b7791f); }

/*
 * Reporting a problem, from the tool it was met in.
 *
 * The button sits with `help` and `settings` because it is chrome rather than a tool, and the
 * sheet reuses `.sheet` so it is the same object as Settings with different contents.
 */
.reportlink {
  font: inherit; color: var(--muted); background: transparent; border: 0;
  padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.reportlink:hover { color: var(--fg); }

.report-form { display: flex; flex-direction: column; gap: .45rem; padding: 0 1rem 1rem; }
.report-form > label {
  font-size: .72rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin-top: .5rem;
}
.report-form > input, .report-form > textarea {
  font: inherit; color: var(--fg); background: var(--bg2, #12171a);
  border: 1px solid var(--line); border-radius: 3px; padding: .45rem .6rem; width: 100%;
  box-sizing: border-box;
}
.report-form > textarea { resize: vertical; min-height: 7rem; font-family: var(--mono, ui-monospace, monospace); font-size: .88em; }

.report-heading {
  margin: .8rem 0 0; font-size: .72rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
/* Scrolls rather than growing: the sheet must not push its own buttons off the bottom. */
.report-preview {
  border: 1px solid var(--line); border-radius: 3px; padding: .6rem .8rem;
  max-height: 16rem; overflow-y: auto; font-size: .92em;
}
.report-preview :is(h1, h2, h3) { font-size: 1em; margin: 0 0 .4rem; }
.report-preview p { margin: 0 0 .5rem; }
.report-preview hr { border: 0; border-top: 1px solid var(--line); margin: .6rem 0; }
.report-preview ul { margin: 0; padding-left: 1.1rem; }

.report-note { margin: .2rem 0 0; color: var(--muted); font-size: .86em; }
.report-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin-top: .6rem; }
.report-said { color: var(--muted); font-size: .86em; }
