/* Irrigation Lab, wearing the ryankm.com design system.
 *
 * EXP-039 is hosted on its own subdomain, so this page has to do the work the
 * site's /lab/<slug> route normally does: the route back up, the record voice,
 * the claim in display type, the lede, the experiment, then bench notes.
 *
 * Colors, radii, easings and the measure come from tokens.css, a vendored copy
 * of the site's tokens that is never edited on this side.
 *
 * The site conventions doing most of the work:
 *   the label voice — 12px, 500, uppercase, 0.12em tracking, muted. Structural
 *                     eyebrows only: the record line, section heads, card
 *                     titles. Buttons, fields and table headers are sentence
 *                     case at 13px, because the voice stops being a voice when
 *                     everything on screen is speaking in it.
 *   the card recipe — surface ground, hairline stroke, 12px radius, stroke
 *                     warms toward the accent on hover. No lift, no shadow.
 *   two rule weights— hairline for rhythm, heavy for section breaks.
 *
 * The one departure: the plan itself is drawn as paper, not as a satellite
 * photo. This tool draws a *plan*, not a map — everything on it is a measured
 * polygon someone typed or traced — and dark aerial styling was the single
 * biggest thing making the old version read as a picture of a place rather
 * than a document about one.
 */

@import "./tokens.css";

:root {
  /* One border colour for anything that is a box with a visible edge. The
     vendored hairline is rhythm ink (1.2:1 on surface), not structure; 45 % of
     --strong reaches the 3:1 that WCAG 1.4.11 asks of a component boundary.
     --line keeps its job: rules *inside* a container. */
  --edge: color-mix(in srgb, var(--strong) 45%, var(--line));

  /* The zone palette.
   *
   * Validated on the cream surface: lightness band, chroma floor, adjacent and
   * all-pairs CVD separation, normal-vision separation and 3:1 contrast all
   * pass, except the all-pairs deutan separation between zone 1 and zone 5,
   * which lands at ΔE 6.6 — inside the 6–8 floor band that is legal only with
   * secondary encoding. So the secondary encoding is not optional here: every
   * head on the plan carries its zone number, every pipe carries a per-zone
   * dash pattern, and the zone table lists the number beside the swatch.
   *
   * Five, not six, and never cycled. Six all-pairs-safe categorical hues do not
   * exist under deuteranopia at usable contrast. A plan with more than five
   * zones drops the extras to neutral ink and asks you to focus one at a time,
   * which is the better way to read a big plan regardless. */
  --zone-1: #0b8fa8;
  --zone-2: #b3300a;
  --zone-3: #8f7ce8;
  --zone-4: #2f6b33;
  --zone-5: #b02f86;
  --zone-over: #bf3400;

  /* The drawing surface. Paper, ink, and the three ground tints. */
  --paper: #fbf3e4;
  --paper-line: #cdbfa5;
  --ink: #1d2b2e;
  --lawn: #cfdcbd;
  --lawn-line: #8ba173;
  --bed: #e6d3b4;
  --bed-line: #b99a68;
  --paving: #ded5c6;
  --paving-line: #ab9f8c;
  --built: #c3bbae;
  --built-line: #6d6659;
  --rough: #c6d2c2;
  --rough-line: #7f9179;
}

*, *::before, *::after { box-sizing: border-box; }

/* .screen-plan is a flex column, which outranks the UA sheet's [hidden]
   rule and left the planner visible underneath the printed sheet. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent); color: var(--accent-contrast); }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
a, button, summary, label, [role="button"] { touch-action: manipulation; }

.container {
  margin: 0 auto;
  width: 100%;
  max-width: var(--maxw);
  padding: 0 24px;
}
@media (min-width: 768px) { .container { padding: 0 40px; } }

/* --- The bar ----------------------------------------------------------- */
/* A bar, not a breadcrumb. A breadcrumb says "you are inside this section",
   and here the parent link leaves the origin — it would be an exit dressed as
   a way back up. The wordmark carries the brand where a visitor expects to
   find it, and the rule under it is the site's section rule rather than a
   hairline: this is a boundary, not rhythm. Same bar as attention-lab. */

.site-bar { border-bottom: 1px solid var(--rule); background: var(--bg); }
.bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  padding-bottom: 18px;
}
/* Matches the site header exactly: 20px, 700, -0.02em, and the dot pops in
   on load the way the site's does. */
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--strong);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark .dot { display: inline-block; transform-origin: 50%; animation: dot-pop 0.36s var(--ease-expo) both; }
@keyframes dot-pop {
  0% { transform: scale(0); }
  60% { transform: scale(1.08); }
  to { transform: scale(1); }
}
.bar-back {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-ink);
  text-decoration: none;
  white-space: nowrap;
}
.bar-back::after, .arrow-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  height: 1.5px;
  width: 100%;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform var(--dur-struct) var(--ease-expo);
}
.bar-back span, .arrow-link span { transition: transform 0.2s ease; }
@media (hover: hover) and (pointer: fine) {
  .bar-back:hover::after, .arrow-link:hover::after { transform: scaleX(1); transform-origin: left center; }
  .bar-back:hover span { transform: translateY(-2px); }
  .arrow-link:hover span { transform: translateX(3px); }
}

/* --- Type -------------------------------------------------------------- */

.label, .eyebrow {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.label-strong { color: var(--strong); }
/* The wordmark dot: the site's one vermillion accent in display type. */
.dot { color: var(--accent-warm); }

/* The display size is capped lower than the site's hero, on purpose. This is a
   tool, and a bigger masthead pushes the instrument below the fold. */
.t-h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(44px, 6.6vw, 78px);
  line-height: 0.92;
  letter-spacing: -0.03em;
  color: var(--strong);
  text-wrap: balance;
  margin: 24px 0 0;
  max-width: 16ch;
}
.t-display {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 3.8vw, 54px);
  line-height: 1.04;
  letter-spacing: -0.015em;
  color: var(--strong);
  text-wrap: balance;
  margin: 0;
  max-width: 18ch;
}
.t-lede {
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.55;
  color: var(--body-2);
  text-wrap: pretty;
  max-width: 58ch;
  margin: 24px 0 0;
}
.small { font-size: 13px; line-height: 1.5; }
.muted { color: var(--muted); }
.danger-text { color: var(--signal-bad); }
.empty { color: var(--muted); font-size: 13px; margin: 0; }
.note {
  color: var(--body-2);
  font-size: 13.5px;
  background: var(--tint);
  border: 1px solid var(--edge);
  padding: 12px 14px;
  border-radius: 8px;
}

/* --- The experiment page shell ----------------------------------------- */

.exp-head { padding-top: 40px; }
@media (min-width: 768px) { .exp-head { padding-top: 56px; } }

/* Record voice: number, kind, state, then a rule that runs out to the stack. */
.exp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.exp-state { display: flex; align-items: center; gap: 8px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.exp-rule { flex: 1; min-width: 40px; height: 1px; background: var(--line); }
.exp-stack { display: none; }
@media (min-width: 640px) { .exp-stack { display: block; } }

.exp-body { padding-top: 40px; padding-bottom: 40px; }
@media (min-width: 768px) { .exp-body { padding-top: 56px; padding-bottom: 56px; } }

/* The masthead gives way on a laptop screen: the type and the two section
   paddings stop scaling with the width on screens that do not have the height
   for them, so the panel's controls stay above a 900px fold. */
@media (min-height: 640px) and (max-height: 950px) {
  .t-h1 { font-size: clamp(40px, 4.4vw, 60px); margin-top: 18px; }
  .t-lede { margin-top: 18px; }
  .exp-head { padding-top: 32px; }
  .exp-body { padding-top: 32px; }
  .setup-copy .t-display { font-size: clamp(28px, 3vw, 40px); }
  .panel-lede { margin: 14px 0 20px; }
}

/* --- Start screen: the setup panel ------------------------------------- */

.screen-start { padding-bottom: 0; }
.resume-row { margin: 0 0 24px; }

.panel-card {
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--r-card);
  padding: 28px;
  margin-bottom: 32px;
}
@media (min-width: 768px) { .panel-card { padding: 40px; } }

/* Two measures in one panel: the copy wants a reading measure, the controls
   want the panel. Two columns let each keep its own width. */
.setup-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
@media (min-width: 1000px) {
  .setup-panel { grid-template-columns: minmax(300px, 36%) minmax(0, 1fr); gap: 56px; align-items: stretch; }
}
.setup-copy { display: flex; flex-direction: column; }
.setup-copy .eyebrow { margin: 0 0 14px; }
.panel-lede {
  max-width: 62ch;
  color: var(--body-2);
  font-size: 16px;
  line-height: 1.6;
  margin: 16px 0 26px;
}
.setup-copy > .setup-privacy { margin: 24px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}
.lock-glyph { position: relative; flex-shrink: 0; width: 10px; height: 12px; margin-top: 3px; }
.lock-glyph::before {
  content: ""; position: absolute; top: 0; left: 1.5px; width: 7px; height: 6px;
  border: 1.5px solid currentColor; border-bottom: 0; border-radius: 3.5px 3.5px 0 0;
}
.lock-glyph::after {
  content: ""; position: absolute; bottom: 0; left: 0; width: 10px; height: 7px;
  background: currentColor; border-radius: 2px;
}

/* The three ways in, as rows: copy on the left, the one control on the right,
   a hairline between them. */
.setup-controls { display: flex; flex-direction: column; }
.start-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px 32px;
  align-items: center;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.start-item:first-child { border-top: 0; padding-top: 0; }
.start-item:last-child { padding-bottom: 0; }
@media (min-width: 640px) { .start-item { grid-template-columns: minmax(0, 1fr) auto; } }
.start-copy { display: flex; flex-direction: column; gap: 6px; }
.start-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--strong); letter-spacing: -0.01em; }
.start-body { font-size: 14px; line-height: 1.55; color: var(--body-2); max-width: 52ch; }

.field-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.times { color: var(--muted); padding-bottom: 8px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--body-2); }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--body-2); }

.linkish {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent-ink);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.linkish:hover { color: var(--accent-hover); }

/* --- Bench notes + footer ---------------------------------------------- */

.app-footer { padding-top: 8px; padding-bottom: 64px; }
.notes-title { max-width: 16ch; }
.bench-notes { margin: 32px 0 0; }
.note-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.note-row:last-child { border-bottom: 1px solid var(--line); }
@media (min-width: 768px) { .note-row { grid-template-columns: 220px 1fr; gap: 40px; } }
.note-row dt { padding-top: 3px; }
.note-row dd { margin: 0; max-width: 64ch; font-size: 16px; line-height: 1.65; color: var(--body); }
.footer-credit { margin: 36px 0 0; display: flex; flex-wrap: wrap; gap: 10px 32px; }
/* The site's arrow link: chase underline, arrow nudges on hover. */
.arrow-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  color: var(--accent-ink);
  text-decoration: none;
}
.arrow-link::after { bottom: -2px; }

/* --- Controls ---------------------------------------------------------- */

.ghost, .tool {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  padding: 8px 13px;
  border-radius: 8px;
  border: 1px solid var(--edge);
  background: var(--surface);
  color: var(--body);
  cursor: pointer;
  transition: background var(--dur-micro) var(--ease-quint), border-color var(--dur-micro) var(--ease-quint), color var(--dur-micro) var(--ease-quint);
}
.ghost:hover, .tool:hover { border-color: var(--accent); background: var(--tint); color: var(--strong); }
/* The site's button: an outlined pill that fills on hover, one filled per
   screen for the committing action. Same recipe as attention-lab, a size down
   so it sits inside the planner's panel. */
.btn {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.005em;
  line-height: 1.2;
  background: transparent;
  color: var(--strong);
  border: 1.5px solid var(--edge);
  border-radius: var(--r-chip);
  padding: 10px 18px;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.btn:hover { border-color: var(--strong); }
.btn-primary, .btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover, .btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-contrast); }
.btn-file { display: inline-flex; align-items: center; }
.tool[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
button:disabled { opacity: 0.45; cursor: not-allowed; }

input[type="number"], input[type="text"], select {
  font: inherit;
  font-size: 13px;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid var(--edge);
  background: var(--bg);
  color: var(--body);
  max-width: 100%;
}
input[type="number"] { width: 7ch; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--body-2); white-space: nowrap; }
.check input { accent-color: var(--accent); }

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  background: transparent;
}
.sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 2px; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline.right { justify-content: flex-end; }

/* --- Planner shell ----------------------------------------------------- */

/* The planner sits on the same measure as the head above it — attention-lab's
   session screen does the same — rather than bleeding to the viewport edge on
   a wide monitor, where the drawing floated small in a field of paper while
   the tools stayed 340px. --bar-h is the site bar's height: 18 + 32 + 18 + 1. */
:root { --bar-h: 69px; }
.screen-plan {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--bar-h));
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px 24px;
}
@media (min-width: 768px) { .screen-plan { padding: 0 40px 32px; } }
.plan-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 0;
}
.plan-bar-left { display: flex; align-items: center; gap: 12px; }
.back { font-size: 13px; text-decoration: none; }
.site-name {
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  color: var(--strong);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 6px;
  width: 18ch;
}
.site-name:hover, .site-name:focus { border-color: var(--edge); background: var(--surface); }
.toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hint {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: var(--muted);
}

/* The drawing and its panel share one card, the way attention-lab's session
   panel does; the toolbar and the hint sit above it on the page. */
.plan-body {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
  border: 1px solid var(--edge);
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--paper);
}
#map {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  background: var(--paper);
  overflow: hidden;
}
#plan { width: 100%; height: 100%; display: block; touch-action: none; }
#map.mode-select #plan { cursor: grab; }
#map.mode-head #plan, #map.mode-pipe #plan, #map.mode-area #plan, #map.mode-measure #plan { cursor: crosshair; }

.compass, .scalebar, .zoomctl, .legend {
  position: absolute;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border: 1px solid var(--edge);
  border-radius: 8px;
  color: var(--body);
}
.compass {
  top: 14px; right: 14px;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  color: var(--accent-ink);
}
.compass svg { width: 22px; height: 22px; }
.compass span { position: absolute; bottom: 1px; font-size: 9px; font-weight: 700; letter-spacing: 0.08em; color: var(--muted); }
.scalebar { bottom: 14px; left: 14px; padding: 6px 9px; font-size: 11px; display: flex; align-items: center; gap: 8px; }
.scalebar .bar { height: 5px; border: 1px solid var(--ink); border-top: 0; width: 60px; }
.zoomctl { top: 14px; left: 14px; display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.zoomctl button {
  border: 0; background: none; font: inherit; font-size: 16px; line-height: 1;
  width: 30px; height: 30px; cursor: pointer; color: var(--body);
}
.zoomctl button:first-child { border-bottom: 1px solid var(--line); }
.zoomctl button:hover { background: var(--tint); color: var(--accent-ink); }
.legend { bottom: 14px; right: 14px; padding: 9px 11px; font-size: 11.5px; max-width: 210px; }
.legend[data-quiet="true"] { opacity: 0.55; }
.legend:hover { opacity: 1; }
.legend h3 { margin: 0 0 5px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.legend .lrow { display: flex; align-items: center; gap: 7px; margin-top: 3px; }
.legend .chip { width: 13px; height: 9px; border-radius: 2px; border: 1px solid var(--edge); flex: none; }

/* --- Panel ------------------------------------------------------------- */

.panel {
  flex: 0 0 340px;
  overflow-y: auto;
  padding: 16px;
  border-left: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
@media (max-width: 900px) {
  .screen-plan { height: auto; }
  .plan-body { flex-direction: column; }
  #map { height: 62vh; }
  .panel { flex: 1 1 auto; border-left: 0; border-top: 1px solid var(--line); }
}
.card {
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--r-card);
  padding: 14px;
  transition: border-color var(--dur-micro) var(--ease-quint);
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--edge)); }
.card > h2 { margin: 0 0 10px; }
.card .row { margin-top: 10px; }
.card .row > label { display: block; font-size: 12.5px; color: var(--body-2); margin-bottom: 4px; }
.card .inline { margin-top: 10px; }
.card p.small:first-of-type { margin-top: 0; }
.sub { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.sub summary { font-size: 13px; cursor: pointer; color: var(--accent-ink); }
.sub > *:not(summary) { margin-top: 8px; }

.layout-notes { margin-top: 10px; display: grid; gap: 5px; }
.layout-notes p {
  margin: 0;
  font-size: 12.5px;
  color: var(--body-2);
  padding-left: 11px;
  border-left: 2px solid var(--line);
}
.layout-notes p:first-child { border-left-color: var(--accent-warm); color: var(--strong); }

.list { margin-top: 8px; display: grid; gap: 1px; }
.item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}
.item.sel { background: var(--tint); }
.item .name { flex: 1 1 auto; cursor: pointer; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .name:hover { color: var(--accent-ink); }
.item button { padding: 3px 7px; font-size: 12px; }
.swatch { width: 11px; height: 11px; border-radius: 3px; flex: none; border: 1px solid color-mix(in srgb, var(--strong) 25%, transparent); }

table.zones { width: 100%; border-collapse: collapse; font-size: 13px; }
table.zones th {
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  padding: 0 6px 5px 0;
  border-bottom: 1px solid var(--line);
}
table.zones td { padding: 5px 6px 5px 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
table.zones td:first-child { display: flex; align-items: center; gap: 6px; }
table.zones .over { color: var(--signal-bad); font-weight: 600; }
table.zones tr.focused { background: var(--tint); }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.stat { border: 1px solid var(--line); border-radius: 8px; padding: 8px 9px; background: var(--bg); }
.stat .k { display: block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.stat .v { display: block; font-size: 1.15rem; font-weight: 700; color: var(--strong); letter-spacing: -0.02em; }
.stat .v.warn { color: var(--signal-warn); }
.stat .v.bad { color: var(--signal-bad); }
.stat-inline { font-size: 12.5px; color: var(--muted); }

/* --- Scale dialog ------------------------------------------------------ */

dialog#scale-dialog {
  border: 1px solid var(--edge);
  border-radius: var(--r-card);
  background: var(--surface);
  color: var(--body);
  padding: 20px;
  max-width: min(760px, 92vw);
}
dialog#scale-dialog::backdrop { background: color-mix(in srgb, var(--strong) 55%, transparent); }
.scale-form { display: grid; gap: 12px; }
.scale-stage { border: 1px solid var(--edge); border-radius: 8px; overflow: hidden; background: var(--bg); }
#scale-canvas { display: block; width: 100%; height: auto; cursor: crosshair; }

/* --- Plan sheet -------------------------------------------------------- */

.screen-sheet { padding: 28px 0 80px; }
.sheet-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
#sheet h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.025em; color: var(--strong); margin: 0 0 4px; }
#sheet h2 {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  font-weight: 500;
  margin: 34px 0 10px; padding-top: 12px; border-top: 2px solid var(--rule);
}
#sheet table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
#sheet th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 0 10px 6px 0; border-bottom: 1px solid var(--edge); }
#sheet td { padding: 7px 10px 7px 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
#sheet td:first-child { display: flex; align-items: center; gap: 7px; }
#sheet .sheet-lede { color: var(--body-2); max-width: 68ch; }
#sheet .caveat {
  margin-top: 34px; padding: 14px 16px;
  border: 1px solid var(--edge); border-left: 3px solid var(--accent-warm);
  border-radius: var(--r-card); background: var(--surface); font-size: 13.5px;
}
#sheet .sheet-figure { margin: 18px 0 0; border: 1px solid var(--edge); border-radius: var(--r-card); overflow: hidden; background: var(--paper); }
#sheet .sheet-figure svg { display: block; width: 100%; height: auto; }

@media print {
  .site-bar, .sheet-actions, .screen-start, .screen-plan { display: none !important; }
  html, body { background: #fff; font-size: 11pt; }
  .screen-sheet { padding: 0; }
  .container { max-width: none; padding: 0; }
  #sheet h2 { margin-top: 22px; break-after: avoid; }
  #sheet table { break-inside: auto; }
  #sheet tr { break-inside: avoid; }
  #sheet .caveat { break-inside: avoid; }
}

/* --- The drawing ------------------------------------------------------- */

.shape { cursor: pointer; }
.drag { cursor: grab; }
#map.mode-select .vtx, #map.mode-select .mid { cursor: crosshair; }
