/* src/look/tokens.css */
/*
 * The design's values, from DESIGN.md. This is the only file where a colour, a font, a font size, a
 * radius or a shadow is written, and the only file that declares custom properties; everything else
 * refers to these by name (tests/design_literals_test.ts, tests/look_boundary_test.ts).
 * Dark is the default look. Light redefines only what changes: the paper, the glass and the text
 * on glass. Trays and tiles are dark in both.
 */
:root {
  color-scheme: dark;

  /* Colour */
  --paper: #0e0f11;
  --ink: #eceef0;
  --ink-soft: #969da6;
  --hair: rgba(255, 255, 255, 0.08);
  --tray: #1c1d1f;
  --tile: #2d2f32;
  --tile-hi: #404347;
  --tile-hi-hover: #4a4d51;
  --tile-edge: rgba(255, 255, 255, 0.07);
  --tile-sheen: rgba(255, 255, 255, 0.05);
  --on-tile: #f4f4f5;
  --on-tile-soft: #9a9fa6;
  --active: #cdcfd3;
  --on-active: #19191a;
  --glass: rgba(44, 47, 52, 0.46);
  --glass-edge: rgba(255, 255, 255, 0.13);
  --btn: rgba(255, 255, 255, 0.13);
  --btn-hover: rgba(255, 255, 255, 0.2);
  --alert: #f2811d;
  --ok: #42d17f;
  --jack: #121314;
  --port-free-edge: rgba(255, 255, 255, 0.14);
  --selected: #ffffff;
  --tick: #8b9199;
  --symbol-picture-paper: #0b0c0d;
  --symbol-picture-ink: #ffffff;
  --symbol-picture-fill: #e6e6e6;
  /* A library symbol's picture, which has no kind's colour: a faint light edge (the mock-ups) */
  --symbol-picture-plain-edge: rgba(255, 255, 255, 0.18);
  --callout-gray: #8a8a96;

  /* Type */
  --font-text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-title: "Outfit", "Inter", system-ui, sans-serif;
  --font-icon: "Material Symbols Rounded";
  --text: 12.5px;
  --text-small: 11px;
  --text-caption: 10.5px;
  --text-button: 11.5px;
  --text-count: 13px;
  --text-chip-count: 12px;
  --text-control: 12px;
  --text-status: 12px;
  --text-working: 13px;
  --title-tile: 14px;
  --title-pane: 14px;
  --title-card: 20px;
  --text-field: 13px;
  --title-app: 15px;
  --title-idf: 17px;
  --number-big: 23px;
  --number-big-tracking: -0.02em;
  --icon: 18px;
  --icon-small: 15px;
  /* A symbol's lettering in its magnified picture: one unit of the drawing, scaled to each piece */
  --lettering-unit: 1px;

  /* Shape */
  --r-tray: 20px;
  --r-tile: 14px;
  --r-pane: 18px;
  --r-button: 8px;
  --r-port: 4px;
  --r-line: 2px;
  --r-round: 50%;
  --r-picture: 4px;
  --r-mark: 6px;
  --r-field: 6px;
  --r-tile-small: 10px;

  /* Size */
  --tray-pad: 6px;
  --tray-gap: 6px;
  --pane-gap: 14px;
  --control-height: 38px;
  --stat-height: 60px;
  --round: 28px;
  --round-small: 22px;
  --gauge: 46px;
  --ring: 12px;
  --ring-width: 3px;
  --glass-blur: 6px;
  --port-size: 18px;
  --port-gap: 3px;
  --port-mid-gap: 8px;
  --jack-width: 12px;
  --jack-height: 10px;
  --swatch-width: 18px;
  --swatch-height: 4px;
  --linework-strength: 0.55;
  --column-width: 276px;
  --page-side: 16px;
  --page-min-width: 900px;
  --group-gap: 10px;
  --toggle-height: 34px;
  --zoom-readout-width: 40px;
  --slider-width: 124px;
  --slider-track: 4px;
  --slider-thumb: 14px;
  --notice-width: 320px;
  --status-width: 230px;
  --working-width: 270px;
  --progress-height: 4px;
  --symbol-picture: 20px;
  --symbol-picture-edge: 1.5px;
  --symbol-picture-line: 1.3px;
  /* The magnified picture a click on a symbol's picture opens */
  --symbol-magnified: 168px;
  --symbol-magnified-drawing: 148px;
  --symbol-magnified-line: 1.6px;
  --magnified-gap: 8px;
  /* The panes wider than their column */
  --choose-pane-width: 470px;
  /* The signed-out screens' card, and the Admin pane */
  --card-width: 360px;
  --admin-pane-width: 760px;
  --wide-pane-min-width: 786px;
  --tick-size: 14px;
  /* The file widget's two lists (Projects, Sheets): never shorter than this */
  --file-list-least: 56px;
  --mark-line: 2px;
  --disabled-strength: 0.4;
  /* A row left out (Edit Library's unticked symbols): dimmed */
  --off-strength: 0.45;
  --drop-mark-strength: 0.55;

  /*
   * The sheet: three layers in their own colours. In the dark look the neutral layers (Blueprint,
   * Symbol layer) are inverted, light lines on the dark paper; the colour layer keeps its hues
   * (inverted, then turned half way round the colour wheel), so a red cloud stays red. The layers
   * together meet the paper in screen, so the white that covers things takes the paper's colour.
   */
  --sheet-neutral-filter: invert(1);
  --sheet-colour-filter: invert(1) hue-rotate(180deg);
  --sheet-blend: screen;

  /* Motion: a layer sliding in and out (DESIGN.md, Layers; src/look/layer_slide.ts) */
  --slide-rise: 370ms;
  --slide-settle: 310ms;
  --slide-leave: 600ms;
  --slide-overshoot: 0.015;
  --slide-rise-easing: cubic-bezier(0.2, 0.7, 0.3, 1);
  --slide-settle-easing: ease-in-out;
  --slide-leave-easing: cubic-bezier(0.5, 0, 0.85, 0.45);
  /* How long a kind's halos wait before sliding with its symbols: starting value, the owner to tune */
  --slide-halo-lag: 80ms;
  /* How long a symbol's picture is held before its magnified picture shows: starting value, the owner to tune */
  --hold-delay: 350ms;
  /*
   * The ping, Closing Rings (DESIGN.md, the ping; the owner, 16 Nov 2026): the approved page's
   * version B. Starting values, the owner to tune.
   */
  --ping-rings: 3;
  --ping-ring-time: 650ms;
  --ping-ring-gap: 180ms;
  --ping-ring-line: 1.5px;
  --ping-ring-reach: 120px;
  --ping-ring-margin: 5px;
  --ping-ring-easing: cubic-bezier(0.33, 1, 0.68, 1);
  --ping-ring-fade-in: 2.5;
  --ping-ring-fade-out: 0.15;
  --ping-tint: 0.38;
  --ping-tint-time: 420ms;
  --ping-tint-lead: 100ms;
  --ping-step: 90ms;
  /* The view gliding to a thing (DESIGN.md, the glide): starting values, the owner to tune */
  --glide-time: 700ms;
  --glide-easing: ease-in-out;

  /* Motion: the working sign (DESIGN.md, Telling the user what is happening) */
  --working-wait: 150ms;
  --progress-step: 250ms;

  /* Shadow */
  --shadow-tray: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 12px 36px rgba(0, 0, 0, 0.5);
  --shadow-glass: 0 12px 36px rgba(0, 0, 0, 0.35);
  --shadow-tile: inset 0 0 0 1px var(--tile-edge), inset 0 1px 0 var(--tile-sheen);
  --shadow-field: inset 0 0 0 1px var(--tile-edge);
  --ring-free: inset 0 0 0 1.5px var(--port-free-edge);
  --ring-selected: 0 0 0 2px var(--tile), 0 0 0 3.5px var(--selected);
  --ring-flagged: 0 0 0 2px var(--tile), 0 0 0 4px var(--alert);

  /*
   * Contextual: what a control and soft text use on the surface they sit on. These are the values
   * on paper and glass; a tile overrides them below, so controls need no rule per surface.
   */
  --control-fill: var(--btn);
  --control-fill-hover: var(--btn-hover);
  --soft-text: var(--ink-soft);
  /*
   * Behind a category's heading in a long list, which its rows scroll under: solid, so they do not
   * show through. The tray's in the dark look (the mock-ups), the paper's in the light.
   */
  --heading-fill: var(--tray);
  /*
   * The keyboard's focus ring, drawn round a control on the surface it sits on: white on the dark
   * paper and glass; `ink` on the light look's paper and glass, where white cannot be seen; white
   * again on trays and tiles, which are dark in both looks.
   */
  --focus-ring: var(--selected);
}

/* On a tile, controls are tile-hi and soft text is on-tile-soft (DESIGN.md, Button). */
.lk-tile {
  --control-fill: var(--tile-hi);
  --control-fill-hover: var(--tile-hi-hover);
  --soft-text: var(--on-tile-soft);
}

/* Trays and tiles are dark in both looks: the focus ring on them stays white. */
.lk-tray,
.lk-tile {
  --focus-ring: var(--selected);
}

:root[data-look="light"] {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #17191c;
  --ink-soft: #5b636d;
  --hair: rgba(23, 25, 28, 0.09);
  --tray: #19191a;
  --tile: #2b2c2e;
  --tile-hi: #3c3e41;
  --glass: rgba(236, 239, 243, 0.42);
  --glass-edge: rgba(255, 255, 255, 0.95);
  --btn: #19191a;
  --btn-hover: #333437;
  --shadow-tray: 0 12px 36px rgba(23, 25, 28, 0.22);
  --shadow-glass: 0 0 0 1px rgba(23, 25, 28, 0.05), 0 12px 36px rgba(23, 25, 28, 0.1);
  --sheet-neutral-filter: none;
  --sheet-colour-filter: none;
  --sheet-blend: normal;
  --heading-fill: var(--paper);
  --focus-ring: var(--ink);
}

/* src/look/look.css */
/*
 * The building blocks' styles. Every value that is part of the design comes from tokens.css.
 * One block of rules per building block, named after its component.
 */
html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
  font: var(--text) / 1.35 var(--font-text);
  -webkit-font-smoothing: antialiased;
}

.lk-plain-page {
  padding: var(--pane-gap);
}

.lk-plain-page a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* The keyboard's focus: a ring in the colour that shows on the surface around it (--focus-ring). */
button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Icon */
.lk-icon {
  font-family: var(--font-icon);
  font-size: var(--icon);
  width: var(--icon);
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  flex: none;
  font-feature-settings: "liga";
}

.lk-icon-small {
  font-size: var(--icon-small);
  width: var(--icon-small);
}

/* Text */
.lk-soft {
  color: var(--soft-text);
  font-size: var(--text-small);
}

.lk-emphasis {
  font-weight: 500;
}

.lk-title {
  font-family: var(--font-title);
  font-weight: 500;
  font-size: var(--title-tile);
}

.lk-title-app {
  font-size: var(--title-app);
}

.lk-title-idf {
  font-size: var(--title-idf);
}

.lk-section-heading {
  margin: 0;
  font: 500 var(--title-idf) var(--font-title);
}

.lk-big-number {
  font: 600 var(--number-big) / 1 var(--font-text);
  letter-spacing: var(--number-big-tracking);
}

.lk-big-number-unit {
  font-size: var(--text-count);
  font-weight: 400;
  color: var(--soft-text);
  margin-left: 3px;
}

/* Tray */
.lk-tray {
  background: var(--tray);
  border-radius: var(--r-tray);
  padding: var(--tray-pad);
  display: flex;
  gap: var(--tray-gap);
  box-shadow: var(--shadow-tray);
  box-sizing: border-box;
}

.lk-tray-column {
  flex-direction: column;
}

.lk-tray-fit {
  width: max-content;
  max-width: 100%;
}

/* Tile */
.lk-tile {
  background: var(--tile);
  border-radius: var(--r-tile);
  color: var(--on-tile);
  box-shadow: var(--shadow-tile);
  box-sizing: border-box;
  min-width: 0;
}

.lk-tile-padded {
  padding: 9px 12px;
}

.lk-tile-grow {
  flex: 1;
}

/* Glass pane */
.lk-glass {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-pane);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-glass);
  box-sizing: border-box;
  min-width: 0;
}

.lk-glass-list {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lk-glass-grow {
  flex: 1;
}

/* Under a pane's list: what sits here (one button) spans the pane. */
.lk-glass-footer {
  margin: 8px;
  display: flex;
  gap: 8px;
}

.lk-glass-footer > .lk-button {
  flex: 1;
  padding: 8px;
}

/* A padded pane holds fixed-size blocks (the rack): when the pane is narrower, they scroll in it. */
.lk-glass-padded {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-x: auto;
}

.lk-pane-title {
  margin: 0;
  padding: 8px 14px 6px;
  font: 500 var(--title-pane) var(--font-title);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.lk-pane-title + .lk-row {
  border-top: 0;
}

/* Button */
.lk-button {
  background: var(--control-fill);
  color: var(--on-tile);
  border-radius: var(--r-button);
  padding: 5px 10px;
  font-size: var(--text-button);
  font-weight: 500;
  white-space: nowrap;
}

.lk-button:hover {
  background: var(--control-fill-hover);
}

/* A button that cannot act just now: greyed, and pressing it does nothing (its tip says why). */
.lk-button[aria-disabled="true"],
.lk-button[aria-disabled="true"]:hover {
  opacity: var(--disabled-strength);
  background: var(--control-fill);
  cursor: default;
}

/* Round button */
.lk-round {
  width: var(--round);
  height: var(--round);
  border-radius: var(--r-round);
  background: var(--control-fill);
  color: var(--on-tile);
  display: grid;
  place-items: center;
  flex: none;
}

.lk-round:hover {
  background: var(--control-fill-hover);
}

.lk-round-small {
  width: var(--round-small);
  height: var(--round-small);
}

/* Tool tile and view switch */
.lk-tool {
  width: var(--control-height);
  height: var(--control-height);
  display: grid;
  place-items: center;
  color: var(--on-tile-soft);
}

.lk-tool:hover {
  color: var(--on-tile);
}

.lk-view {
  height: var(--control-height);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--on-tile-soft);
  font-weight: 500;
}

.lk-view:hover {
  color: var(--on-tile);
}

.lk-tool.lk-active,
.lk-view.lk-active {
  background: var(--active);
  color: var(--on-active);
  box-shadow: none;
}

/* List row */
.lk-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  border-top: 1px solid var(--hair);
  min-width: 0;
}

.lk-row .lk-icon {
  color: var(--ink-soft);
}

.lk-row-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* A one-line row: a name too long for it ends in an ellipsis (the full name is its hover tip). */
.lk-row-name-one-line {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow-wrap: normal;
}

.lk-row-detail {
  display: block;
}

/* A symbol's number before its name, in soft bold */
.lk-row-mark {
  font-weight: 600;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  margin-right: 3px;
}

/* A row that is its tick box's label: pressing anywhere on it turns the box */
.lk-row-ticks {
  cursor: pointer;
}

.lk-count {
  font: 500 var(--text-count) var(--font-title);
  font-variant-numeric: tabular-nums;
}

.lk-swatch {
  width: var(--swatch-width);
  height: var(--swatch-height);
  border-radius: var(--r-line);
  background: var(--type-color);
  flex: none;
}

/* Attention ring */
.lk-attention {
  width: var(--ring);
  height: var(--ring);
  border-radius: var(--r-round);
  border: var(--ring-width) solid var(--alert);
  box-sizing: border-box;
  flex: none;
  display: inline-block;
}

.lk-row > .lk-attention {
  margin: 0 3px;
}

/* Stat tile */
.lk-stat {
  height: var(--stat-height);
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

/* Gauge tile */
.lk-gauge {
  height: var(--stat-height);
  padding: 0 14px 0 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.lk-gauge svg {
  width: var(--gauge);
  height: var(--gauge);
  flex: none;
}

.lk-gauge-track {
  fill: none;
  stroke: var(--tile-hi);
}

.lk-gauge-value {
  fill: none;
  stroke: var(--ok);
}

.lk-gauge-number {
  font: 600 var(--text-count) var(--font-text);
  fill: var(--on-tile);
}

.lk-gauge .lk-title,
.lk-gauge .lk-soft {
  display: block;
}

/* Chip */
.lk-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--tile-hi);
  color: var(--on-tile);
  border-radius: var(--r-button);
  padding: 3px 9px;
  font-size: var(--text-button);
}

.lk-chip .lk-count {
  font-size: var(--text-chip-count);
}

/*
 * Port and port row. The rack is a fixed size: these never stretch with the page. PortRow sets
 * --ports-per-half from its PORTS_PER_ROW, so the row's length is written in one place.
 */
.lk-port-row,
.lk-port-captions {
  display: grid;
  grid-template-columns:
    repeat(var(--ports-per-half), var(--port-size)) var(--port-mid-gap)
    repeat(var(--ports-per-half), var(--port-size));
  column-gap: var(--port-gap);
  width: max-content;
}

.lk-port-captions {
  margin-top: 5px;
}

.lk-port {
  width: var(--port-size);
  height: var(--port-size);
  background: var(--type-color);
  border-radius: var(--r-port);
  display: grid;
  place-items: center;
}

.lk-port:hover {
  filter: brightness(1.15);
}

.lk-port-jack {
  width: var(--jack-width);
  height: var(--jack-height);
  display: block;
  fill: var(--jack);
}

.lk-port-free {
  background: transparent;
  box-shadow: var(--ring-free);
  cursor: default;
  filter: none;
}

.lk-port-selected {
  box-shadow: var(--ring-selected);
}

.lk-port-flagged {
  box-shadow: var(--ring-flagged);
}

.lk-port-caption {
  font-size: var(--text-caption);
  color: var(--on-tile-soft);
  border-top: 2px solid var(--type-color);
  padding-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Linework: a stand-in sheet's lines. Fills its box; the screen places the box. */
.lk-linework {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 1;
  opacity: var(--linework-strength);
}

/* Round button with nothing to do this way just now */
.lk-round[aria-disabled="true"] {
  color: var(--on-tile-soft);
  cursor: default;
}

.lk-round[aria-disabled="true"]:hover {
  background: var(--control-fill);
}

/* A list row that is itself pressed (a sheet in the file widget), and the current one */
.lk-row-pressable {
  width: 100%;
  text-align: left;
  background: none;
  color: var(--ink);
}

.lk-row-pressable:hover,
.lk-row-current {
  background: var(--hair);
}

/*
 * Page frame: the settled layout. The map fills the page behind everything; the rail, the two
 * columns of the same width and the bottom tray are pinned. Below the least width the page
 * scrolls sideways instead of rearranging.
 */
/* The frame fills the window whatever holds it, and scrolls sideways below its least width. */
.lk-frame-scroll {
  position: fixed;
  inset: 0;
  overflow: auto;
  /* The paper is painted here, so the sheet's layers meet it (--sheet-blend). */
  background: var(--paper);
}

.lk-frame {
  position: relative;
  height: 100%;
  min-width: var(--page-min-width);
  box-sizing: border-box;
  display: grid;
  gap: var(--pane-gap);
  grid-template:
    "rail left top right" minmax(0, 1fr)
    "bottom bottom bottom bottom" auto
    / auto var(--column-width) 1fr var(--column-width);
  padding: var(--pane-gap) var(--page-side);
  overflow: hidden;
}

.lk-frame > :not(.lk-frame-map) {
  position: relative;
  min-width: 0;
}

.lk-frame-map {
  position: absolute;
  inset: 0;
}

.lk-frame-notice {
  grid-area: top;
  align-self: center;
  justify-self: center;
}

.lk-frame-rail {
  grid-area: rail;
  align-self: start;
}

.lk-frame-left,
.lk-frame-right {
  display: flex;
  flex-direction: column;
  gap: var(--pane-gap);
  align-self: start;
  max-height: 100%;
}

.lk-frame-left > *,
.lk-frame-right > * {
  flex: none;
}

/* A column taller than the window scrolls inside itself; the bottom tray stays put. */
.lk-frame-left {
  grid-area: left;
  overflow-y: auto;
  scrollbar-width: none;
  border-radius: var(--r-pane);
}

.lk-frame-left::-webkit-scrollbar {
  display: none;
}

.lk-frame-right {
  grid-area: right;
}

.lk-frame-top-right {
  align-self: flex-end;
}

/* Never wider than the window's room: a tray too wide for it gives way inside (the pager's name). */
.lk-frame-bottom {
  grid-area: bottom;
  justify-self: center;
  max-width: 100%;
  z-index: 2;
}

/* The layers bar floats just above the bottom tray, centred on it, moving nothing else. */
.lk-frame-layers {
  position: absolute;
  bottom: calc(100% + var(--group-gap));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

/*
 * The working sign's place: centred over the map, above everything. While it shows, the shield
 * over the map takes the map's presses; the panes and trays come after it, so they lie above it
 * and stay usable. Both wait --working-wait before they appear, so fast work does not flash.
 */
.lk-frame > .lk-frame-shield {
  position: absolute;
  inset: 0;
  touch-action: none;
  animation: lk-working-wait var(--working-wait);
}

.lk-frame > .lk-frame-working {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  pointer-events: none;
  animation: lk-working-wait var(--working-wait);
}

/* Hidden for as long as it runs, then gone, leaving the element as it is. */
@keyframes lk-working-wait {
  from,
  to {
    visibility: hidden;
  }
}

/* Tool rail: one small column tray per job */
.lk-rail {
  display: flex;
  flex-direction: column;
  gap: var(--group-gap);
}

.lk-rail > .lk-tray {
  flex-direction: column;
}

/* Map viewer: the sheet behind everything, moved by drag, wheel and pinch */
.lk-map {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.lk-map-movable {
  cursor: grab;
}

.lk-map-moving {
  cursor: grabbing;
}

/*
 * The sheet's layers, laid one over the other, then meeting the paper (--sheet-blend). A layer's
 * strength is an inline opacity on it (only the Blueprint's is below full: the sheet fade).
 */
.lk-map-layers {
  position: absolute;
  inset: 0;
  mix-blend-mode: var(--sheet-blend);
}

/* One layer in its own colours: in the dark look, neutral ink turns light, coloured keeps its hues. */
.lk-map-layer {
  position: absolute;
  inset: 0;
}

.lk-map-layer-neutral {
  filter: var(--sheet-neutral-filter);
}

.lk-map-layer-coloured {
  filter: var(--sheet-colour-filter);
}

.lk-map-layer-parked {
  visibility: hidden;
}

.lk-map-picture {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}

/* Under the crisp crop of the same view: kept, not shown, so its soft lines do not show round the crisp ones. */
.lk-map-picture-resting {
  visibility: hidden;
}

.lk-map-sharp {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.lk-map-sharp[hidden] {
  display: none;
}

/* File widget: the app's name and what is open; its arrow opens it in place. */
.lk-file-head {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 8px 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  text-align: left;
  background: none;
}

.lk-file-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.lk-file-open .lk-file-arrow .lk-icon {
  transform: rotate(180deg);
}

/*
 * Open, its sections share its length: only their lists shrink (to --file-list-least); when even
 * that does not fit, the body scrolls as a whole, so the sections never overlap.
 */
.lk-file-body {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.lk-file-body[hidden] {
  display: none;
}

/* Sheet pager: as tall as a stat tile. Only it gives way when the bottom tray runs out of room. */
.lk-pager {
  flex: 0 1 auto;
  min-width: 0;
  height: var(--stat-height);
  padding: 0 8px 0 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.lk-pager-name {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  white-space: nowrap;
}

/*
 * A name too long for the room the window leaves the bottom tray is cut with an ellipsis at its end
 * (its full name is its hover tip). A name that fits is never cut.
 */
.lk-pager-title {
  overflow: hidden;
  text-overflow: ellipsis;
}

.lk-pager-steps {
  flex: none;
  display: flex;
  gap: 5px;
}

/* Zoom tile */
.lk-zoom {
  flex: none;
  height: var(--control-height);
  padding: 0 5px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-control);
}

.lk-zoom-readout {
  min-width: var(--zoom-readout-width);
  height: 100%;
  font-weight: 500;
  text-align: center;
  background: none;
  color: var(--on-tile);
}

/* Save state tile: the Saved dot and the words, at the top right */
.lk-save-state {
  flex: none;
  height: var(--control-height);
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: var(--text-control);
  white-space: nowrap;
}

.lk-save-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--r-round);
  background: var(--ok);
}

/* Slider tile: a small label over the slider */
.lk-slider {
  flex: none;
  height: var(--stat-height);
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
}

.lk-slider-input {
  width: var(--slider-width);
  height: var(--slider-track);
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: var(--tile-hi);
  border-radius: var(--r-line);
  cursor: pointer;
}

.lk-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: var(--slider-thumb);
  height: var(--slider-thumb);
  border-radius: var(--r-round);
  background: var(--on-tile);
}

.lk-slider-input::-moz-range-thumb {
  width: var(--slider-thumb);
  height: var(--slider-thumb);
  border: 0;
  border-radius: var(--r-round);
  background: var(--on-tile);
}

.lk-slider-input:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 4px;
}

/* Layers bar and its layer toggles: on is the active light gray, off a plain tile */
.lk-layers-bar[hidden] {
  display: none;
}

.lk-layer {
  height: var(--toggle-height);
  padding: 0 12px 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--on-tile-soft);
  font-size: var(--text-control);
  font-weight: 500;
  white-space: nowrap;
}

.lk-layer:hover {
  color: var(--on-tile);
}

.lk-layer.lk-active {
  background: var(--active);
  color: var(--on-active);
  box-shadow: none;
}

/* Notice: a short message on glass over the map, with one button */
.lk-notice {
  width: var(--notice-width);
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.lk-notice-text {
  margin: 0;
}

/* Working sign: one tile in a tray, the stage in words, and a thin bar when it knows how far */
.lk-working-tile {
  min-width: var(--working-width);
  padding: 12px 16px 13px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: var(--text-working);
}

.lk-working-bar {
  height: var(--progress-height);
  border-radius: var(--r-line);
  background: var(--tile-hi);
  overflow: hidden;
}

.lk-working-fill {
  display: block;
  height: 100%;
  border-radius: var(--r-line);
  background: var(--on-tile);
  transition: width var(--progress-step) linear;
}

/* Status tile: a fixed width at the end of the bottom tray, the message on three lines at most */
.lk-status {
  flex: none;
  width: var(--status-width);
  height: var(--stat-height);
  padding: 0 16px;
  display: flex;
  align-items: center;
  font-size: var(--text-status);
  line-height: 1.3;
}

.lk-status-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

/*
 * Rail modes: one group owning the choice, each mode a toggle tool tile in a tray of its own
 * whose tray opens downward into its items while it is chosen. The group lays no box of its own,
 * so each mode's tray sits in the rail like any other.
 */
.lk-rail-modes {
  display: contents;
}

.lk-mode-items {
  display: flex;
  flex-direction: column;
  gap: var(--tray-gap);
}

/* A tool with nothing it can do just now */
.lk-tool:disabled {
  opacity: var(--disabled-strength);
  cursor: default;
}

.lk-tool:disabled:hover {
  color: var(--on-tile-soft);
}

/*
 * List pane: folds on a double-click of its title and moves by its title bar. While dragged it
 * floats under the pointer at its own width and height (a pane that gives way in its column keeps
 * the height it had there, its list scrolling inside it), never taken out of the page; a dashed
 * outline stands where it will land.
 */
.lk-pane-handle {
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

.lk-pane-folded > .lk-pane-title {
  padding-bottom: 8px;
}

.lk-pane-dragging {
  position: fixed;
  z-index: 50;
  margin: 0;
}

.lk-pane-dragging > .lk-pane-handle {
  cursor: grabbing;
}

/* A pane's place in its column. */
.lk-pane-slot {
  display: flex;
  flex-direction: column;
}

/*
 * While a pane is dragged, the outline is drawn inside the slot of the pane it lands before, so no
 * slot moves in the page mid-drag (a pane moved in the page loses its list's scroll). That slot
 * then lays no box of its own: the outline and the pane stand in the column as two of its items, a
 * pane gap apart, and every pane is as tall as with the outline anywhere else. Only the pane that
 * gives way shrinks (below); any other keeps its height, as its slot does.
 */
.lk-pane-slot:has(> .lk-drop-mark) {
  display: contents;
}

.lk-pane-slot:has(> .lk-drop-mark) > * {
  flex: none;
}

/*
 * The safety net of a pane that gives way in its column (the Symbols pane): when the column has no
 * room for all of it, its slot shrinks, the pane stops at the column's end (above the bottom
 * tray) and its list scrolls inside it; the title and the rows above the list stay put. A column
 * that scrolls as a whole (the left one) lets this pane give way first.
 */
.lk-frame-left > .lk-pane-slot:has(> .lk-pane-fits),
.lk-frame-right > .lk-pane-slot:has(> .lk-pane-fits) {
  flex: 0 1 auto;
  min-height: 0;
}

/* With the outline in its slot, which then lays no box, the pane itself gives way as its slot did. */
.lk-frame-left > .lk-pane-slot:has(> .lk-drop-mark) > .lk-pane-fits,
.lk-frame-right > .lk-pane-slot:has(> .lk-drop-mark) > .lk-pane-fits {
  flex: 0 1 auto;
  min-height: 0;
}

.lk-pane-fits {
  min-height: 0;
}

.lk-pane-fits > .lk-pane-title,
.lk-pane-fits > .lk-row {
  flex: none;
}

.lk-pane-list {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.lk-pane-title + .lk-pane-list > .lk-row:first-child {
  border-top: 0;
}

.lk-drop-mark {
  flex: none;
  box-sizing: border-box;
  border: 1.5px dashed var(--ink-soft);
  border-radius: var(--r-pane);
  opacity: var(--drop-mark-strength);
}

/* A row's tick box: gray, never in a type's colour */
.lk-tick {
  width: var(--tick-size);
  height: var(--tick-size);
  margin: 0;
  flex: none;
  accent-color: var(--tick);
}

/* Symbol picture: the library's drawing, white on a dark box outlined in its kind's colour */
.lk-symbol-picture {
  width: var(--symbol-picture);
  height: var(--symbol-picture);
  box-sizing: border-box;
  border: var(--symbol-picture-edge) solid var(--type-color);
  border-radius: var(--r-picture);
  background: var(--symbol-picture-paper);
  display: grid;
  flex: none;
  overflow: hidden;
}

.lk-symbol-picture svg {
  width: 100%;
  height: 100%;
}

.lk-symbol-line {
  fill: none;
  stroke: var(--symbol-picture-ink);
  stroke-width: var(--symbol-picture-line);
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.lk-symbol-fill {
  fill: var(--symbol-picture-fill);
  stroke: none;
}

/* A library symbol's picture: no kind's colour, a faint light edge */
.lk-symbol-picture-plain {
  border-color: var(--symbol-picture-plain-edge);
}

/*
 * A picture held to see it larger: a held press or finger selects nothing, scrolls nothing and
 * opens no context menu on it.
 */
.lk-symbol-picture-magnifies {
  cursor: zoom-in;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/*
 * The magnified picture a click on a symbol's picture opens: its true drawing and its lettering,
 * white on the picture's dark box, in the page's top layer (a popover) so no pane clips it.
 */
.lk-magnified {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 0;
  border: 0;
  width: var(--symbol-magnified);
  height: var(--symbol-magnified);
  box-sizing: border-box;
  border-radius: var(--r-tile);
  background: var(--symbol-picture-paper);
  box-shadow: var(--shadow-tray);
  place-items: center;
  overflow: hidden;
}

.lk-magnified:popover-open {
  display: grid;
}

.lk-magnified svg {
  width: var(--symbol-magnified-drawing);
  height: var(--symbol-magnified-drawing);
}

.lk-magnified .lk-symbol-line {
  stroke-width: var(--symbol-magnified-line);
}

.lk-magnified-lettering {
  fill: var(--symbol-picture-ink);
  font-family: var(--font-text);
  font-weight: 600;
  /* One unit of the drawing: each piece is scaled to its own height (magnified.ts). */
  font-size: var(--lettering-unit);
}

/* The Keynote callouts row's picture: an oval, leader and arrowhead, outlined in the callouts' gray */
.lk-callout-picture {
  border-color: var(--callout-gray);
}

.lk-callout-picture-presses {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.lk-callout-line {
  fill: none;
  stroke: var(--symbol-picture-ink);
}

.lk-callout-head {
  fill: var(--symbol-picture-ink);
  stroke: none;
}

/*
 * Boxes round found things on the sheet: an outline in the thing's colour and nothing inside,
 * and a small tag above in the look's ink. Drawn over the sheet in a layer of their own.
 */
.lk-map-boxes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.lk-map-box {
  position: absolute;
  box-sizing: border-box;
  border: var(--mark-line) solid var(--type-color);
  border-radius: var(--r-mark);
}

.lk-map-box-tag {
  position: absolute;
  transform: translateY(-100%);
  font: 600 var(--text-small) / 1 var(--font-text);
  color: var(--ink);
  white-space: nowrap;
}

/*
 * Text and number boxes: on a tile's fill with its inner edge, filling the room they are given.
 */
.lk-field {
  background: var(--tile);
  color: var(--on-tile);
  border: 0;
  border-radius: var(--r-field);
  padding: 1px 7px;
  font: inherit;
  line-height: 1.35;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  box-shadow: var(--shadow-field);
}

.lk-field::placeholder {
  color: var(--on-tile-soft);
}

.lk-field-number {
  padding-right: 2px;
}

.lk-tick:disabled {
  opacity: var(--disabled-strength);
}

/*
 * The wide panes (Choose Symbols, Edit Library): in the left column under the file widget, wider
 * than it and lying over the sheet. The column lets them out (it no longer scrolls as a whole
 * while one is open) and lifts them above the sheet; each gives way at the column's end, so its
 * list scrolls inside it above the bottom tray.
 */
.lk-frame-left:has(> .lk-wide-pane) {
  overflow: visible;
  z-index: 3;
}

/*
 * While the layers bar is shown, the lifted column ends above it, one gap of the panes short of
 * its top, as it ends above the bottom tray otherwise: the pane gives way there and the bar's
 * toggles are never under it. The bar is the layer toggle's height in a tray's padding, one
 * --group-gap above the bottom tray, which is one --pane-gap below the column.
 */
.lk-frame:has(.lk-layers-bar:not([hidden])) > .lk-frame-left:has(> .lk-wide-pane) {
  max-height: calc(100% - var(--group-gap) - var(--toggle-height) - 2 * var(--tray-pad));
}

.lk-frame-left > .lk-wide-pane {
  flex: 0 1 auto;
  min-height: 0;
}

.lk-wide-pane-choose {
  width: var(--choose-pane-width);
}

.lk-wide-pane-across {
  min-width: var(--wide-pane-min-width);
}

.lk-wide-pane > .lk-pane-title,
.lk-wide-tools,
.lk-wide-intro,
.lk-library-head,
.lk-wide-footer {
  flex: none;
}

.lk-wide-tools {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 2px 14px 8px;
}

.lk-wide-tools > .lk-button {
  padding: 3px 9px;
  flex: none;
}

.lk-wide-pane-across .lk-wide-tools > .lk-field {
  max-width: 320px;
}

.lk-wide-intro {
  margin: 0;
  padding: 0 14px 8px;
  font-size: var(--text-small);
  color: var(--ink-soft);
  max-width: 110ch;
}

.lk-wide-list {
  border-top: 1px solid var(--hair);
}

.lk-wide-list > .lk-category-group:first-child > .lk-category {
  border-top: 0;
}

.lk-wide-empty {
  padding: 14px;
  color: var(--ink-soft);
}

/* A wide pane's footer: a soft note, then its buttons; or the question asked before a deletion. */
.lk-wide-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px;
}

.lk-wide-footer > .lk-button {
  padding: 8px 14px;
  border-radius: var(--r-tile-small);
}

.lk-wide-footer-note {
  flex: 1;
  color: var(--ink-soft);
  font-size: var(--text-small);
  padding-left: 6px;
}

.lk-wide-footer-question {
  flex: 1;
  color: var(--ink);
  font-size: var(--text-control);
  padding-left: 6px;
}

.lk-field-answer {
  width: 70px;
  flex: none;
  padding: 6px 8px;
}

/* A category's heading in a long list: it stays at the list's top while its rows scroll under it. */
.lk-category {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 8px;
  border-top: 1px solid var(--hair);
  font-weight: 600;
  color: var(--ink);
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--heading-fill);
}

.lk-category-fold {
  background: none;
  color: var(--ink-soft);
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex: none;
  padding: 0;
}

.lk-category-folded .lk-category-fold .lk-icon {
  transform: rotate(-90deg);
}

.lk-category-name {
  flex: 1;
  min-width: 0;
}

.lk-category-count {
  font-weight: 400;
  font-size: var(--text-small);
  color: var(--ink-soft);
}

/* Edit Library's columns: tick box, picture, name, lettering, cables, Use #, type letter, pieces, tag. */
.lk-library-grid {
  display: grid;
  grid-template-columns: 14px 20px minmax(220px, 1fr) 80px 50px 40px 62px 54px 96px;
  gap: 9px;
  align-items: center;
  padding: 5px 14px;
}

.lk-library-grid > .lk-tick {
  justify-self: center;
}

.lk-library-head {
  font-size: var(--text-small);
  color: var(--ink-soft);
  border-top: 1px solid var(--hair);
  padding-right: 22px;
}

.lk-library-head > span:nth-child(n + 6):nth-child(-n + 8) {
  text-align: center;
}

.lk-library-row {
  border-top: 1px solid var(--hair);
}

.lk-library-off > .lk-field,
.lk-library-off > .lk-symbol-picture {
  opacity: var(--off-strength);
}

.lk-library-pieces {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/*
 * The pings over the map (MapPings): each ping's rings, thin circles in its colour, and its tint,
 * its box filled with its colour, which the ping fades (ping.ts). Taking no presses.
 */
.lk-map-pings {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.lk-ping-ring {
  fill: none;
  stroke: var(--type-color);
  stroke-width: var(--ping-ring-line);
}

.lk-ping-tint {
  fill: var(--type-color);
  rx: var(--r-mark);
}

/* A card's main button: the active fill, as the chosen tool's */
.lk-button-main,
.lk-button-main:hover {
  background: var(--active);
  color: var(--on-active);
}

/*
 * The signed-out screens: one glass card in the middle of the paper (DESIGN.md). The page leaves
 * room under the card as the mock-up did, so it sits a little above the middle.
 */
.lk-card-page {
  min-height: 100vh;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  padding: 24px var(--page-side) 150px;
  background: var(--paper);
}

.lk-card {
  width: min(var(--card-width), 100%);
  box-sizing: border-box;
  padding: 18px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
}

.lk-card-title {
  margin: 0;
  font: 500 var(--title-card) var(--font-title);
  text-wrap: balance;
}

.lk-card-lead {
  margin: 0;
  color: var(--soft-text);
}

.lk-card-note {
  margin: 0;
  color: var(--soft-text);
  font-size: var(--text-button);
}

.lk-labelled-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--text-button);
  color: var(--soft-text);
}

.lk-labelled-input {
  background: var(--tile);
  color: var(--on-tile);
  border: 0;
  border-radius: var(--r-button);
  padding: 8px 10px;
  font: var(--text-field) var(--font-text);
  box-shadow: var(--shadow-field);
  min-width: 0;
}

.lk-labelled-input::placeholder {
  color: var(--on-tile-soft);
}

.lk-text-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--ink);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.lk-button-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lk-button-row > .lk-button {
  padding: 8px 14px;
  border-radius: var(--r-tile-small);
  font-size: var(--text-control);
}

/* What a card or pane says: soft while working, orange when something went wrong, green when done */
.lk-message {
  margin: 0;
  font-size: var(--text-button);
  color: var(--soft-text);
}

.lk-message:empty {
  display: none;
}

.lk-message-alert {
  color: var(--alert);
}

.lk-message-ok {
  color: var(--ok);
}

.lk-card-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: var(--text-button);
  color: var(--soft-text);
  border-top: 1px solid var(--hair);
  padding-top: 10px;
}

/* The file widget's line for who is signed in, with Admin and Sign Out */
.lk-file-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  border-top: 1px solid var(--hair);
  font-size: var(--text-small);
  min-width: 0;
}

.lk-file-account-line {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lk-file-account-actions {
  display: flex;
  gap: 6px;
  flex: none;
}

.lk-file-account-actions > .lk-button {
  padding: 3px 9px;
}

/* The Admin pane: a wide pane of its own width, with sections of rows */
.lk-wide-pane-admin {
  width: min(var(--admin-pane-width), calc(100vw - 2 * var(--page-side)));
}

.lk-pane-section {
  display: flex;
  justify-content: space-between;
  padding: 7px 14px;
  font-weight: 600;
  border-top: 1px solid var(--hair);
  background: var(--heading-fill);
}

.lk-pane-section-note {
  font-weight: 400;
  font-size: var(--text-small);
  color: var(--soft-text);
}

.lk-member-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px 136px 72px;
  gap: 10px;
  align-items: center;
  padding: 7px 14px;
  border-top: 1px solid var(--hair);
}

.lk-member-email {
  min-width: 0;
  overflow-wrap: anywhere;
}

.lk-member-soft {
  color: var(--soft-text);
  font-size: var(--text-button);
}

.lk-member-row > .lk-button {
  padding: 4px 10px;
  justify-self: end;
}

.lk-message-in-pane {
  padding: 0 14px 8px;
}

/*
 * The file widget's projects and sheets (step 4B): open, it gives way in its column as the Symbols
 * pane does, so its two sections' lists share its length and scroll inside it, never shorter than
 * --file-list-least; a folded section leaves the room to the other.
 */
.lk-frame-left > .lk-file {
  flex: 0 1 auto;
  min-height: 0;
}

.lk-file > .lk-file-head,
.lk-file > .lk-file-account {
  flex: none;
}

/*
 * A section never shrinks below its title, its list's least height and its button (its own least
 * height is its content's: no min-height of 0), so it cannot be drawn over the next one.
 */
.lk-file-section {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
}

.lk-file-section-title {
  flex: none;
  border-top: 1px solid var(--hair);
  cursor: default;
  -webkit-user-select: none;
  user-select: none;
}

.lk-file-section-folded > .lk-file-section-title {
  padding-bottom: 8px;
}

.lk-file-section > .lk-glass-footer {
  flex: none;
}

.lk-file-list {
  min-height: var(--file-list-least);
}

.lk-file-section-title + .lk-file-list > .lk-row:first-child {
  border-top: 1px solid var(--hair);
}

.lk-file-list-empty {
  padding: 7px 14px;
  border-top: 1px solid var(--hair);
  color: var(--ink-soft);
  font-size: var(--text-small);
}

/* A row's second line, kept to one line with the name (a project's "who · when") */
.lk-row-name-one-line > .lk-row-detail {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* A row's buttons: shown only while the row is pointed at or has the keyboard's focus */
.lk-row-actions {
  display: none;
  gap: 4px;
  flex: none;
}

.lk-project-row:hover > .lk-row-actions,
.lk-project-row:focus-within > .lk-row-actions,
.lk-pdf-heading:hover > .lk-row-actions,
.lk-pdf-heading:focus-within > .lk-row-actions {
  display: flex;
}

/* A project's row: pressed as a whole by its name, its buttons at its right */
.lk-project-row {
  padding: 6px 8px 6px 14px;
  gap: 8px;
}

.lk-project-row:hover {
  background: var(--hair);
}

.lk-project-open {
  flex: 1;
  min-width: 0;
  display: flex;
  padding: 0;
  background: none;
  color: var(--ink);
  text-align: left;
}

/* A PDF's heading in the Sheets list: as a category's heading, with buttons in its count's place */
.lk-pdf-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 14px;
  border-top: 1px solid var(--hair);
  color: var(--ink);
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--heading-fill);
  min-width: 0;
}

.lk-pdf-heading:has(.lk-row-actions:not(:empty)):hover,
.lk-pdf-heading:has(.lk-row-actions:not(:empty)):focus-within {
  padding-right: 8px;
}

.lk-pdf-heading-fold {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 0 7px 8px;
  background: none;
  color: var(--ink);
  font-weight: 600;
  text-align: left;
}

.lk-pdf-heading-fold .lk-icon {
  color: var(--ink-soft);
}

.lk-pdf-heading-open .lk-pdf-heading-fold .lk-icon {
  transform: rotate(180deg);
}

.lk-pdf-heading-count {
  flex: none;
  font-size: var(--text-small);
  color: var(--ink-soft);
}

.lk-pdf-heading:has(.lk-row-actions:not(:empty)):hover > .lk-pdf-heading-count,
.lk-pdf-heading:has(.lk-row-actions:not(:empty)):focus-within > .lk-pdf-heading-count {
  display: none;
}

/* A name box in a list, in a row's place: the box, then Create (or Save) and Cancel */
.lk-name-row {
  padding: 6px 8px 6px 14px;
  gap: 6px;
}

.lk-name-row > .lk-field {
  flex: 1;
  padding: 3px 7px;
}

.lk-name-row > .lk-button {
  flex: none;
  padding: 3px 9px;
}

/* A question in a list, under the row it asks about: the question, then the box and buttons */
.lk-list-ask {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 14px 10px;
  border-top: 1px solid var(--hair);
  background: var(--hair);
}

.lk-list-ask-question {
  margin: 0;
  font-size: var(--text-control);
  color: var(--ink);
}

.lk-list-ask-answer {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lk-list-ask-answer > .lk-field-answer {
  padding: 3px 7px;
}

.lk-list-ask-answer > .lk-button {
  flex: none;
  padding: 3px 9px;
}

/* The Admin pane's Room Used: the bar, and the note under it */
.lk-meter {
  margin: 2px 14px 10px;
}

.lk-pane-note {
  margin: 0 14px 10px;
  font-size: var(--text-small);
  color: var(--soft-text);
}

/* src/screens/reference/reference.css */
/*
 * Layout of the reference page only. Colours, fonts, radii and shadows come from the look's
 * building blocks; this file places them (tests/look_boundary_test.ts).
 */
.ref-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 16px 56px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.ref-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ref-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ref-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ref-grow {
  flex: 1;
  min-width: 0;
}

.ref-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px 18px;
  align-items: end;
}

.ref-block {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.ref-block-wide {
  grid-column: span 2;
}

.ref-block-body {
  display: flex;
  align-items: flex-end;
  min-height: 48px;
}

.ref-block-name {
  display: flex;
}

.ref-column {
  width: var(--column-width);
}

/* A stand-in sheet for the boxes round found symbols: a map of its own size. */
.ref-map {
  position: relative;
  width: var(--column-width);
  height: 160px;
}

.ref-panes {
  display: flex;
  flex-direction: column;
  gap: var(--pane-gap);
}

.ref-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* The assembled examples sit over a quiet stand-in for a plan sheet. */
.ref-stage {
  position: relative;
  display: grid;
  grid-template: "symbols rack" auto "stats rack" auto / 250px 1fr;
  gap: var(--pane-gap);
  padding: var(--pane-gap);
  align-items: start;
  justify-items: start;
}

.ref-backdrop {
  position: absolute;
  inset: 0;
}

.ref-stage > :not(.ref-backdrop) {
  position: relative;
  min-width: 0;
  max-width: 100%;
}

.ref-stage-symbols {
  grid-area: symbols;
  justify-self: stretch;
}

.ref-stage-rack {
  grid-area: rack;
  justify-self: end;
}

.ref-stage-stats {
  grid-area: stats;
  align-self: end;
  grid-column: 1 / -1;
  grid-row: 3;
}

.ref-rack-head,
.ref-panel-head,
.ref-detail {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ref-rack-head {
  padding: 2px 4px 0;
}

.ref-panel-head {
  gap: 8px;
  margin-bottom: 7px;
}

.ref-panel-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ref-detail {
  gap: 14px;
}

.ref-detail-name {
  display: flex;
  align-items: center;
  gap: 7px;
}

@media (max-width: 860px) {
  .ref-stage {
    grid-template: "symbols" auto "rack" auto "stats" auto / 1fr;
  }

  .ref-stage-rack {
    justify-self: stretch;
  }

  .ref-stage-stats {
    grid-row: auto;
  }
}
