/* Plan map: proposed design, 2026-10-21.
   Field calibration family. A survey sheet on a light table: the engine draws the map on a quiet plate with nothing
   laid over it, the plan reads as a numbered ledger, and the inspector reads as an instrument card.
   Layout rules carry the `:root .mm.app-map` prefix so the later-injected workspace-layout.css cannot re-place main,
   aside or layers. Motion uses transform and opacity only, and steps down for reduced and static preferences. */

:root {
  color-scheme: light;
  --paper: #eceeed;
  --plate: #f9faf9;
  --plate-2: #e3e6e4;
  --field: #fff;
  --ink: #121412;
  --ink-2: #3a403b;
  --ink-3: #5b625d;
  --rule: rgb(18 20 18 / .11);
  --rule-2: rgb(18 20 18 / .25);
  --tick: rgb(18 20 18 / .2);
  --slab: #121412;
  --on-slab: #edeee8;
  --slab-mark: #c4ee2c;
  --armed: #121412;
  --on-armed: #edeee8;
  --on-armed-2: #aab1aa;
  --armed-rule: rgb(237 238 232 / .3);
  --armed-tick: rgb(237 238 232 / .24);
  --armed-mark: #c4ee2c;
  --on-armed-mark: #121412;
  --signal: #c4ee2c;
  --on-signal: #121412;
  --signal-ink: #3f5a00;
  --signal-wash: rgb(196 238 44 / .26);
  --alert: #b93a0b;
  --alert-wash: rgb(185 58 11 / .08);
  --ok: #12704f;
  --warn: #855300;
  --focus: #3f5a00;
  --map-plate: #e2e5e3;
  --lift: 0 1px 0 rgb(18 20 18 / .04), 0 14px 36px -22px rgb(18 20 18 / .45);
  --sheet-lift: 0 -12px 32px -18px rgb(18 20 18 / .5);
  --f-display: Bahnschrift, "DIN Alternate", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --f-ui: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  --f-num: "Cascadia Mono", "SF Mono", Consolas, "Roboto Mono", ui-monospace, monospace;
  --hit: 2.75rem;
  --ctl: 2.5rem;
  --r: .5rem;
  --r-s: .375rem;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-io: cubic-bezier(.77, 0, .175, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --inspector: clamp(20rem, 26vw, 27rem);
  --mm-peek: 7rem;
}
:root:lang(ja) { --f-ui: "Hiragino Sans", "Yu Gothic UI", "Meiryo UI", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif; }
:root:lang(zh) { --f-ui: "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif; }

/* Light high contrast comes first so the dark blocks below replace it, and dark high contrast comes last. */
:root[data-noise-contrast="high"] {
  --rule: rgb(18 20 18 / .3);
  --rule-2: rgb(18 20 18 / .62);
  --tick: rgb(18 20 18 / .45);
  --ink-2: #1e231f;
  --ink-3: #343a36;
  --map-plate: #d9ddda;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0c0e0d; --plate: #141715; --plate-2: #1e221f; --field: #0f1110;
    --ink: #e8ebe7; --ink-2: #b8beb8; --ink-3: #8d948e;
    --rule: rgb(232 235 231 / .1); --rule-2: rgb(232 235 231 / .24); --tick: rgb(232 235 231 / .18);
    --slab: #e4e9e2; --on-slab: #0c0e0d; --slab-mark: #3f5a00;
    --armed: #222b0c; --on-armed: #eef5d8; --on-armed-2: #b6c197; --armed-rule: rgb(238 245 216 / .26);
    --armed-tick: rgb(238 245 216 / .2); --armed-mark: #d4f347; --on-armed-mark: #121412;
    --signal: #d4f347; --signal-ink: #d4f347; --signal-wash: rgb(212 243 71 / .14);
    --alert: #ff8a5c; --alert-wash: rgb(255 138 92 / .12); --ok: #4ade9a; --warn: #f0b847; --focus: #d4f347;
    --map-plate: #1a1d1b;
    --lift: 0 1px 0 rgb(0 0 0 / .3), 0 16px 40px -20px rgb(0 0 0 / .75);
    --sheet-lift: 0 -14px 36px -16px rgb(0 0 0 / .75);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0c0e0d; --plate: #141715; --plate-2: #1e221f; --field: #0f1110;
  --ink: #e8ebe7; --ink-2: #b8beb8; --ink-3: #8d948e;
  --rule: rgb(232 235 231 / .1); --rule-2: rgb(232 235 231 / .24); --tick: rgb(232 235 231 / .18);
  --slab: #e4e9e2; --on-slab: #0c0e0d; --slab-mark: #3f5a00;
  --armed: #222b0c; --on-armed: #eef5d8; --on-armed-2: #b6c197; --armed-rule: rgb(238 245 216 / .26);
  --armed-tick: rgb(238 245 216 / .2); --armed-mark: #d4f347; --on-armed-mark: #121412;
  --signal: #d4f347; --signal-ink: #d4f347; --signal-wash: rgb(212 243 71 / .14);
  --alert: #ff8a5c; --alert-wash: rgb(255 138 92 / .12); --ok: #4ade9a; --warn: #f0b847; --focus: #d4f347;
  --map-plate: #1a1d1b;
  --lift: 0 1px 0 rgb(0 0 0 / .3), 0 16px 40px -20px rgb(0 0 0 / .75);
  --sheet-lift: 0 -14px 36px -16px rgb(0 0 0 / .75);
}
@media (prefers-color-scheme: dark) {
  :root[data-noise-contrast="high"]:not([data-theme="light"]) {
    --rule: rgb(232 235 231 / .32); --rule-2: rgb(232 235 231 / .62); --tick: rgb(232 235 231 / .45);
    --ink-2: #d6dbd6; --ink-3: #b5bcb6;
  }
}
:root[data-noise-contrast="high"][data-theme="dark"] {
  --rule: rgb(232 235 231 / .32); --rule-2: rgb(232 235 231 / .62); --tick: rgb(232 235 231 / .45);
  --ink-2: #d6dbd6; --ink-3: #b5bcb6;
}

/* Base */
html { background: var(--paper); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.mm *, .mm *::before, .mm *::after { box-sizing: border-box; }
.mm [hidden] { display: none !important; }
:root body.mm.app-map {
  margin: 0;
  padding: 0;
  width: auto;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-areas: "top" "flow" "main" "foot";
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.5 var(--f-ui);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  --workspace-accent: var(--signal-ink);
  --workspace-line: var(--rule);
  --workspace-surface: var(--plate);
  --workspace-ink: var(--ink);
  --workspace-hit: var(--ctl);
}
.mm :is(button, input, select, textarea) { font: inherit; color: inherit; letter-spacing: 0; }
.mm :is(h1, h2, h3, h4, p) { letter-spacing: 0; }
.mm button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mm :disabled { cursor: not-allowed; }
.mm :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mm ::selection { background: var(--signal-wash); }
.mm .ui-icon {
  width: 1.125rem;
  height: 1.125rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mm .mm-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.mm .mm-skip {
  position: absolute;
  left: 1rem;
  top: .5rem;
  z-index: 20;
  padding: .5rem .875rem;
  border-radius: 999px;
  background: var(--slab);
  color: var(--on-slab);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 180ms var(--ease-out);
}
.mm .mm-skip:focus-visible { transform: none; }
.mm .mm-noscript { grid-area: main; margin: 2rem; font-size: 1rem; }

/* Pills: one shape for every chrome command, so the engine's buttons and the shared repeat entry read as one row. */
.mm :is(.mm-btn, .mm-go, .mm-home, .mm-classic, .mm-exit, [id="repeatPlanBtn"]) {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4375rem;
  min-height: var(--ctl);
  margin: 0;
  padding: 0 .9375rem;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  background: var(--field);
  color: var(--ink);
  font: 500 .9375rem/1.2 var(--f-ui);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 120ms var(--ease-out);
}
.mm :is(.mm-btn, .mm-go, .mm-home, .mm-classic, .mm-exit, [id="repeatPlanBtn"]):active:not(:disabled) { transform: scale(.97); }
.mm :is(.mm-btn, .mm-go, [id="repeatPlanBtn"]):is(:disabled, [aria-disabled="true"]) { opacity: .45; }
.mm .mm-go { background: var(--signal); border-color: transparent; color: var(--on-signal); font-weight: 600; }
.mm :is(.mm-home, .mm-classic) { background: transparent; }
.mm .mm-icon-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--ctl);
  height: var(--ctl);
  flex: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  background: var(--field);
  color: var(--ink);
  transition: background-color 160ms ease, border-color 160ms ease, transform 120ms var(--ease-out);
}
.mm .mm-icon-btn:active { transform: scale(.95); }
.mm .mm-eyebrow,
.mm .mm-cap {
  margin: 0;
  font: 500 .75rem/1.3 var(--f-num);
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}
:root:is(:lang(ja), :lang(zh)) .mm :is(.mm-eyebrow, .mm-cap) { font-family: var(--f-ui); font-size: .8125rem; }

/* Bench head */
:root .mm.app-map #mmTop:not(.wc-head) {
  grid-area: top;
  position: relative;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .75rem;
  width: auto;
  height: auto;
  min-width: 0;
  margin: 0;
  padding: max(.625rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) .625rem max(1rem, env(safe-area-inset-left));
  background: var(--plate);
  border: 0;
  border-bottom: 1px solid var(--rule);
}
:root .mm.app-map #mmTop:not(.wc-head) > .workspace-flow {
  order: 9;
  flex: 1 1 100%;
  min-width: 0;
  margin: 0;
  padding-top: .5rem;
  border-top: 1px solid var(--rule);
}
/* Fallback when the shared flow lands on body instead of the header. */
:root .mm.app-map > .workspace-flow {
  grid-area: flow;
  min-width: 0;
  margin: 0;
  padding: .375rem max(1rem, env(safe-area-inset-right)) .375rem max(1rem, env(safe-area-inset-left));
  background: var(--plate);
  border-bottom: 1px solid var(--rule);
}
:root[data-lab-host] .mm :is(.mm-home, .mm-classic) { display: none; }

.mm .mm-ident { display: flex; align-items: center; gap: .625rem; min-width: 0; }
.mm .mm-mark {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  border-radius: var(--r-s);
  background: var(--slab);
  color: var(--slab-mark);
}
.mm .mm-ident-text { min-width: 0; }
.mm .mm-ident h1 {
  margin: 0;
  font: 600 1.25rem/1.15 var(--f-display);
  color: var(--ink);
  white-space: nowrap;
}

.mm .mm-plan { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.mm .mm-well {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
  min-height: var(--ctl);
  padding: 0 .375rem 0 .75rem;
  border: 1px solid var(--rule-2);
  border-radius: var(--r);
  background: var(--field);
  transition: border-color 160ms ease;
}
.mm .mm-well:has(#planSelect:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.mm .mm-well-icon { color: var(--ink-3); }
.mm :is(#planSelect, #mmLang) {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - .6875rem) 55%, calc(100% - .375rem) 55%;
  background-size: .3125rem .3125rem;
  background-repeat: no-repeat;
  color: var(--ink);
  cursor: pointer;
}
.mm #planSelect {
  width: 16rem;
  min-width: 9rem;
  max-width: 100%;
  min-height: calc(var(--ctl) - .125rem);
  padding: 0 1.5rem 0 0;
  font: 600 1rem/1.3 var(--f-ui);
  text-overflow: ellipsis;
}
.mm #planSelect:focus-visible { outline: none; }
.mm #planSelect:disabled { opacity: .55; }
.mm #planCount {
  flex: none;
  padding: .1875rem .5rem;
  border-radius: 999px;
  background: var(--plate-2);
  color: var(--ink-2);
  font: 500 .8125rem/1.25 var(--f-num);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mm #planCount:empty { display: none; }

/* Plan actions. On a wide bench the disclosure stays open with its summary hidden, so the commands read as one row;
   narrower, one labelled summary opens the same commands as a short list anchored under it. */
.mm .mm-more { position: relative; flex: none; min-width: 0; }
.mm .mm-more[open] { z-index: 41; }
.mm .mm-more > summary { list-style: none; }
.mm .mm-more > summary::-webkit-details-marker { display: none; }
.mm .mm-more > summary::marker { content: ""; }
.mm .mm-caret { width: 1rem; height: 1rem; color: var(--ink-3); transition: transform 200ms var(--ease-out); }
.mm .mm-more[open] .mm-caret { transform: rotate(180deg); }
.mm .mm-more[open] > summary { background: var(--plate-2); border-color: color-mix(in oklab, var(--ink) 34%, transparent); }
.mm .mm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; min-width: 0; }
.mm .mm-sep { width: 1px; height: 1.5rem; margin: 0 .25rem; background: var(--rule-2); flex: none; }
@media (min-width: 93.76rem) {
  .mm .mm-more[open] > summary { display: none; }
}
@media (max-width: 93.75rem) {
  .mm .mm-more > .mm-actions {
    position: absolute;
    top: calc(100% + .375rem);
    left: 0;
    z-index: 8;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .125rem;
    width: max-content;
    min-width: min(15rem, calc(100vw - 1.5rem));
    max-width: calc(100vw - 1.5rem);
    padding: .375rem;
    border: 1px solid var(--rule-2);
    border-radius: .75rem;
    background: var(--plate);
    box-shadow: var(--lift), 0 24px 48px -28px rgb(0 0 0 / .45);
    transform-origin: top left;
  }
  .mm .mm-more > .mm-actions > :is(.mm-btn, [id="repeatPlanBtn"]) {
    justify-content: flex-start;
    width: 100%;
    min-height: var(--hit);
    padding: 0 .75rem;
    border-color: transparent;
    border-radius: var(--r);
    background: transparent;
    font-size: 1rem;
    white-space: normal;
    text-align: left;
  }
  .mm .mm-more > .mm-actions > .mm-sep { width: auto; height: 1px; margin: .25rem .5rem; }
}

.mm .mm-prefs { display: flex; align-items: center; gap: .375rem; margin-left: auto; }
.mm .mm-lang {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  min-height: var(--ctl);
  padding: 0 .25rem 0 .75rem;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  background: var(--field);
  color: var(--ink-2);
  cursor: pointer;
}
.mm .mm-lang:has(#mmLang:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.mm #mmLang { min-height: calc(var(--ctl) - .125rem); padding: 0 1.375rem 0 0; font: 600 .875rem/1.2 var(--f-num); }
.mm #mmLang:focus-visible { outline: none; }
.mm #mmLang:disabled { opacity: .55; }
:root .mm.app-map:has(.noise-settings-entry) #mmSettings { display: none !important; }
.mm #mmTop:not(.wc-head) .noise-settings-entry { flex: none; min-height: var(--ctl); border-radius: 999px; }

/* Bench */
:root .mm.app-map #mmMain {
  grid-area: main;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--inspector);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  width: auto;
  max-width: none;
  height: auto;
  max-height: none;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--paper);
}
:root .mm.app-map #mmMain:has(> #detail[hidden]) { grid-template-columns: minmax(0, 1fr); }
:root .mm.app-map #mmStage {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: .625rem;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: .875rem 1rem .75rem max(1rem, env(safe-area-inset-left));
  container: mm-stage / inline-size;
}

/* Task bar: how a tap on the map is read, then the shared panel switches. The plan's commands live on the readout. */
.mm .mm-taskbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; min-width: 0; }
:root .mm.app-map #mmModes {
  position: static;
  display: inline-flex;
  align-items: stretch;
  flex-wrap: wrap;
  flex: none;
  gap: .1875rem;
  width: auto;
  max-width: 100%;
  margin: 0;
  padding: .1875rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--plate-2);
  box-shadow: none;
}
.mm #mmModes [data-mode] {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4375rem;
  min-height: 2.25rem;
  margin: 0;
  padding: 0 .875rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: 500 .9375rem/1.2 var(--f-ui);
  white-space: nowrap;
  transition: background-color 180ms ease, color 180ms ease, transform 120ms var(--ease-out);
}
.mm #mmModes [data-mode]:active:not(:disabled) { transform: scale(.97); }
.mm #mmModes [data-mode]:is(.active, .is-active, .selected, [aria-pressed="true"], [aria-current="true"], [aria-selected="true"]) {
  background: var(--slab);
  color: var(--on-slab);
}
.mm #mmModes [data-mode]:is(.active, .is-active, .selected, [aria-pressed="true"], [aria-current="true"], [aria-selected="true"]) .ui-icon { color: var(--slab-mark); }
.mm #mmModes [data-mode]:disabled { opacity: .42; }
.mm #mmModes [data-mode]:focus-visible { outline-offset: 1px; }
.mm #mmModes .workspace-panel-controls { display: flex; align-items: center; gap: .1875rem; min-width: 0; }
.mm #mmModes .workspace-panel-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4375rem;
  min-width: 0;
  min-height: var(--ctl);
  padding: .375rem .75rem;
  border: 1px solid var(--rule-2);
  border-radius: var(--r);
  background: var(--field);
  color: var(--ink-2);
  font: 500 .9375rem/1.3 var(--f-ui);
}
.mm #mmModes .workspace-panel-toggle[aria-expanded="true"] { background: var(--signal-wash); color: var(--signal-ink); }

/* The engine's plan summary repeats the count beside the plan name and the inspector's plan card, so it stays in
   the document for assistive technology only. */
.mm #campaignSummary {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Plate: the readout is the instrument edge; below it the canvas sits alone. */
.mm .mm-plate {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--rule-2);
  border-radius: var(--r);
  background: var(--map-plate);
  box-shadow: var(--lift);
  overflow: hidden;
}
.mm .mm-readout {
  grid-area: 1 / 1;
  position: relative;
  display: flex;
  align-items: center;
  gap: .625rem;
  height: 3rem;
  min-width: 0;
  padding: 0 .375rem 0 .5rem;
  background: var(--plate);
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}
/* A field-scale edge: minor ticks every half rem, majors every 2.5rem. It sits on the readout, never on the map. */
.mm .mm-readout::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: .375rem;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, var(--tick) 0 1px, transparent 1px 2.5rem) left bottom / 100% .375rem no-repeat,
    repeating-linear-gradient(90deg, var(--tick) 0 1px, transparent 1px .5rem) left bottom / 100% .1875rem no-repeat;
}
.mm .mm-glyph {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  flex: none;
  border-radius: 50%;
  background: var(--plate-2);
  color: var(--ink-2);
  transition: background-color 200ms ease, color 200ms ease;
}
.mm .mm-glyph .ui-icon { position: relative; z-index: 1; width: 1rem; height: 1rem; }
.mm .mm-ping {
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--armed-mark);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}
.mm .mm-mode-copy {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: .875rem;
  line-height: 1.3;
}
/* The engine's help line already opens with the mode name, and the pressed mode button says it again, so the title
   is read aloud but not painted. */
.mm #modeText {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.mm #modeHelp { color: var(--ink-2); }
/* Plan commands on the instrument edge: Review order is secondary, Mark points is the one filled action until Mark
   mode is armed, when Exit takes its place. */
.mm .mm-cmds { display: flex; align-items: center; gap: .375rem; flex: none; min-width: 0; margin-left: auto; }
.mm .mm-cmds :is(.mm-btn, .mm-go, .mm-exit) { min-height: 2.25rem; padding: 0 .75rem; font-size: .875rem; }
.mm .mm-exit { flex: none; }
.mm[data-mm-mode="plan"] #markPointsBtn { display: none; }

/* Armed: Mark, Record and Add point all write on tap, so the edge turns to slab and the glyph keeps a ring. */
.mm:is([data-mm-mode="plan"], [data-mm-mode="add"], [data-mm-mode="entry"]) .mm-readout {
  background: var(--armed);
  color: var(--on-armed);
  border-bottom-color: transparent;
  --tick: var(--armed-tick);
}
.mm:is([data-mm-mode="plan"], [data-mm-mode="add"], [data-mm-mode="entry"]) .mm-glyph { background: var(--armed-mark); color: var(--on-armed-mark); }
.mm:is([data-mm-mode="plan"], [data-mm-mode="add"], [data-mm-mode="entry"]) .mm-glyph::after {
  content: "";
  position: absolute;
  inset: -.25rem;
  border: 1px solid var(--armed-mark);
  border-radius: 50%;
  opacity: .5;
}
.mm:is([data-mm-mode="plan"], [data-mm-mode="add"], [data-mm-mode="entry"]) #modeHelp { color: var(--on-armed-2); }
.mm:is([data-mm-mode="plan"], [data-mm-mode="add"], [data-mm-mode="entry"]) :is(.mm-exit, .mm-cmds .mm-btn) {
  border-color: var(--armed-rule);
  background: transparent;
  color: var(--on-armed);
}
.mm:is([data-mm-mode="plan"], [data-mm-mode="add"], [data-mm-mode="entry"]) #map { cursor: crosshair; }

/* The readout reflows with the stage, not the window, so it also holds when the inspector is docked beside it. */
@container mm-stage (max-width: 52rem) {
  .mm #reviewOrderBtn { width: 2.25rem; padding: 0; }
  .mm #reviewOrderBtn > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@container mm-stage (max-width: 36rem) {
  .mm .mm-readout {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "glyph copy" "cmds cmds";
    align-items: center;
    gap: .5rem .625rem;
    height: auto;
    padding: .5rem .5rem .75rem;
  }
  .mm .mm-glyph { grid-area: glyph; }
  .mm .mm-mode-copy { grid-area: copy; min-height: calc(2 * 1.3em); align-content: center; }
  .mm .mm-cmds { grid-area: cmds; margin-left: 0; }
  .mm .mm-cmds > :is(.mm-btn, .mm-go, .mm-exit) { flex: 1 1 0; min-width: 0; }
  .mm #reviewOrderBtn { width: auto; padding: 0 .75rem; }
  .mm #reviewOrderBtn > span { position: static; width: auto; height: auto; overflow: hidden; clip-path: none; text-overflow: ellipsis; }
  .mm:is([data-mm-mode="add"], [data-mm-mode="entry"]) .mm-cmds > #reviewOrderBtn { flex: none; width: 2.25rem; padding: 0; }
  .mm:is([data-mm-mode="add"], [data-mm-mode="entry"]) #reviewOrderBtn > span { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); }
}

:root .mm.app-map #mapWrap {
  grid-area: 2 / 1;
  position: relative;
  inset: auto;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 12rem;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: var(--map-plate);
}
:root .mm.app-map #map {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  touch-action: none;
}
:root .mm.app-map #map:focus-visible { outline: 2px solid var(--focus); outline-offset: -3px; }
.mm #mapTip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  max-width: min(18rem, calc(100% - 1rem));
  padding: .375rem .5625rem;
  border-radius: var(--r-s);
  background: var(--slab);
  color: var(--on-slab);
  font: 500 .8125rem/1.35 var(--f-ui);
  box-shadow: var(--lift);
  pointer-events: none;
  transition: opacity 140ms ease;
}
.mm #mapTip:empty { display: none; }

/* Layers: inline switches under the plate, then the readout of render cost and the whole-map fit. */
:root .mm.app-map #mmLayers {
  position: static;
  inset: auto;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: .375rem;
  width: auto;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: .125rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--rule-2) transparent;
  border: 0;
  background: none;
  box-shadow: none;
}
.mm #mmLayersCap { flex: none; margin-right: .25rem; }
.mm .mm-check {
  display: inline-flex;
  align-items: center;
  gap: .4375rem;
  flex: none;
  min-height: 2.25rem;
  padding: 0 .75rem 0 .5625rem;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  background: var(--field);
  color: var(--ink-2);
  font: 500 .875rem/1.2 var(--f-ui);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.mm .mm-check input { width: 1rem; height: 1rem; margin: 0; flex: none; accent-color: var(--signal-ink); cursor: inherit; }
.mm .mm-check input:focus-visible { outline: none; }
.mm .mm-check:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.mm .mm-check:has(input:checked) {
  background: var(--signal-wash);
  border-color: color-mix(in oklab, var(--signal-ink) 45%, transparent);
  color: var(--ink);
}
.mm .mm-check:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.mm .mm-gap { flex: 1 1 auto; min-width: .5rem; }
.mm #perf {
  flex: none;
  color: var(--ink-3);
  font: 500 .75rem/1.2 var(--f-num);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mm #perf:empty { display: none; }
.mm #fitBtn { flex: none; }
.mm #mmLayers > button:not(#fitBtn) { flex: none; }
/* The shared close for the layer tools leads the row as a pill-sized switch instead of a floating sticky glyph. */
:root .mm.app-map #mmLayers > .workspace-panel-close {
  position: static;
  float: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--ctl);
  height: var(--ctl);
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  background: var(--field);
  color: var(--ink-2);
}

/* Inspector: the selected point, five sections, then the engine's generated rows and forms. */
:root .mm.app-map #detail {
  position: relative;
  inset: auto;
  z-index: auto;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: auto;
  max-width: none;
  height: auto;
  max-height: none;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--plate);
  border: 0;
  border-left: 1px solid var(--rule);
  border-radius: 0;
  box-shadow: none;
  transform: none;
}
.mm .mm-detail-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  min-width: 0;
  padding: 1rem 1.125rem .75rem;
  padding-inline-end: calc(var(--ctl) + .75rem);
}
:root .mm.app-map #detail > .workspace-panel-close {
  position: absolute;
  inset: .5rem .5rem auto auto;
  z-index: 2;
  float: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--ctl);
  height: var(--ctl);
  margin: 0;
  padding: 0;
  border: 1px solid var(--rule-2);
  border-radius: var(--r);
  background: var(--field);
  color: var(--ink);
}
/* Identity: the caption names the open section, the field label (P3, or the plan's own field ID) leads, and the
   engine's full point ID, coordinates and type follow at reading size rather than as a headline. */
.mm .mm-detail-id {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: .3125rem .5rem;
  flex: 1 1 auto;
  min-width: 0;
}
.mm .mm-detail-id > .mm-eyebrow { grid-column: 1 / -1; overflow: hidden; text-overflow: ellipsis; }
.mm .mm-detail-section { color: var(--ink); }
.mm .mm-detail-section:not(:empty)::before { content: "·"; margin: 0 .375rem; color: var(--ink-3); }
.mm .mm-point-tag {
  grid-column: 1;
  display: inline-grid;
  place-items: center;
  min-width: 1.75rem;
  height: 1.625rem;
  padding: 0 .4375rem;
  border-radius: var(--r-s);
  background: var(--slab);
  color: var(--slab-mark);
  font: 600 .875rem/1 var(--f-num);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
:root .mm.app-map .mm-detail-head { padding-inline-end: calc(var(--ctl) + 1rem); }
.mm #pointInfo {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .125rem .625rem;
  min-width: 0;
  margin: 0;
  color: var(--ink-2);
  font: 400 .875rem/1.4 var(--f-ui);
  font-variant-numeric: tabular-nums;
}
.mm .mm-point-tag[hidden] + #pointInfo { grid-column: 1 / -1; }
.mm #pointInfo > br { display: none; }
.mm #pointInfo > b:first-child {
  flex: 1 1 100%;
  min-width: 0;
  color: var(--ink);
  font: 600 1rem/1.35 var(--f-num);
  overflow-wrap: anywhere;
}
.mm #pointInfo .measurement-summary {
  flex: 1 1 100%;
  margin-top: .25rem;
  padding-left: .5rem;
  border-left: 3px solid var(--signal-ink);
  color: var(--ink);
  font: 500 .875rem/1.35 var(--f-num);
}
.mm #pointInfo .measurement-summary b { color: var(--ink-3); font: 500 .75rem/1.35 var(--f-ui); }
.mm #pointInfo .measurement-summary time { display: inline-block; width: max-content; max-width: 100%; overflow-wrap: anywhere; vertical-align: bottom; }
.mm #pointInfo :where(small, .muted, .hint) { color: var(--ink-3); font: 400 .875rem/1.4 var(--f-ui); }
.mm #pointInfo :where(p) { margin: 0; }
/* A plan card is one line: the plan name, then its point count. */
.mm[data-mm-subject="plan"] #pointInfo { flex-wrap: nowrap; overflow: hidden; white-space: nowrap; }
.mm[data-mm-subject="plan"] #pointInfo > b:first-child {
  flex: 0 1 auto;
  overflow: hidden;
  font: 600 .9375rem/1.35 var(--f-ui);
  text-overflow: ellipsis;
  overflow-wrap: normal;
}
.mm .mm-sheet-toggle { display: none; }
.mm .mm-sheet-toggle .ui-icon { transform: rotate(-90deg); transition: transform 220ms var(--ease-out); }
.mm[data-mm-sheet="open"] .mm-sheet-toggle .ui-icon { transform: rotate(90deg); }

:root .mm.app-map #tabs {
  position: static;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0 .5rem;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: var(--plate);
}
.mm #tabs [data-tab] {
  appearance: none;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  min-width: 0;
  min-height: 3.25rem;
  margin: 0;
  padding: .375rem .125rem .5rem;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font: 500 .8125rem/1.15 var(--f-ui);
  text-align: center;
  transition: color 160ms ease;
}
.mm #tabs [data-tab] > span { max-width: 100%; overflow-wrap: anywhere; }
/* The icon sits in a fixed box on every tab, so the active slab fills in without moving the labels. */
.mm #tabs [data-tab] .ui-icon {
  width: 1.5rem;
  height: 1.5rem;
  padding: .1875rem;
  border-radius: var(--r-s);
  transition: background-color 160ms ease, color 160ms ease;
}
.mm #tabs [data-tab]::after {
  content: "";
  position: absolute;
  left: .5rem;
  right: .5rem;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--ink);
  transform: scaleX(0);
  transition: transform 200ms var(--ease-out);
}
.mm #tabs [data-tab]:is(.active, .is-active, .selected, [aria-pressed="true"], [aria-current="true"], [aria-selected="true"]) { color: var(--ink); font-weight: 600; }
.mm #tabs [data-tab]:is(.active, .is-active, .selected, [aria-pressed="true"], [aria-current="true"], [aria-selected="true"])::after { transform: scaleX(1); }
.mm #tabs [data-tab]:is(.active, .is-active, .selected, [aria-pressed="true"], [aria-current="true"], [aria-selected="true"]) .ui-icon { background: var(--slab); color: var(--slab-mark); }
.mm #tabs [data-tab]:disabled { opacity: .4; }
.mm #tabs [data-tab]:focus-visible { outline-offset: -2px; }

:root .mm.app-map #tabBody {
  container: mm-body / inline-size;
  position: static;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 1rem 1.125rem max(1.25rem, env(safe-area-inset-bottom));
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--rule-2) transparent;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

/* Generated content. Low-specificity :where() keeps the engine's own classes able to refine it. */
.mm #tabBody :where(h2, h3, h4) { margin: 1.25rem 0 .5rem; color: var(--ink); font: 600 1rem/1.3 var(--f-display); }
.mm #tabBody :where(h2, h3, h4):first-child { margin-top: 0; }
.mm #tabBody :where(p) { margin: .5rem 0; }
.mm #tabBody :where(small, .muted, .hint, .note, .campaign-note) { color: var(--ink-3); font-size: .875rem; }
.mm #tabBody :where(a) { color: var(--signal-ink); text-underline-offset: .2em; }
.mm #tabBody :where(hr) { margin: 1rem 0; border: 0; border-top: 1px solid var(--rule); }
.mm #tabBody :where(ol, ul) { margin: .5rem 0; padding-left: 1.375rem; }
.mm #tabBody :where(li) { margin: 0 0 .375rem; }
.mm #tabBody :where(li)::marker { color: var(--ink-3); font: 500 .8125rem var(--f-num); }
.mm #tabBody :where(.error, .danger, .invalid) { color: var(--alert); }
.mm #tabBody :where(.ok, .success, .valid) { color: var(--ok); }
.mm #tabBody :where(.warn, .warning) { color: var(--warn); }
.mm #tabBody :where(.actions, .buttons, .toolbar, .button-row, .row-actions) { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .75rem 0; }

/* Fields: the label always sits on its own row above the control; checkboxes stay inline. */
.mm #tabBody :where(label) { display: grid; gap: .3125rem; margin: 0 0 .75rem; color: var(--ink-2); font: 500 .875rem/1.3 var(--f-ui); }
.mm #tabBody :where(label):has(> :is(input[type="checkbox"], input[type="radio"])) {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--ink);
  font-size: .9375rem;
}
.mm #tabBody :where(input[type="checkbox"], input[type="radio"]) { width: 1.125rem; height: 1.125rem; margin: 0; accent-color: var(--signal-ink); }
.mm #tabBody :where(input:not([type="checkbox"], [type="radio"], [type="hidden"], [type="range"], [type="color"]), select, textarea) {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: var(--ctl);
  margin: 0;
  padding: .5rem .75rem;
  border: 1px solid var(--rule-2);
  border-radius: var(--r-s);
  background-color: var(--field);
  color: var(--ink);
  font: 400 1rem/1.35 var(--f-ui);
  transition: border-color 160ms ease;
}
.mm #tabBody :where(select) {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 1rem) 55%, calc(100% - .6875rem) 55%;
  background-size: .3125rem .3125rem;
  background-repeat: no-repeat;
}
.mm #tabBody :where(textarea) { min-height: 5.5rem; resize: vertical; }
.mm #tabBody :where(input, select, textarea):focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.mm #tabBody :where(input, select, textarea):disabled { opacity: .55; }
.mm #tabBody :where(input, select, textarea)[aria-invalid="true"] { border-color: var(--alert); }
.mm #tabBody :where(input[type="number"], input[type="date"], input[type="time"]) { font-family: var(--f-num); font-variant-numeric: tabular-nums; }
.mm #tabBody :where(fieldset) { margin: 0 0 .75rem; padding: .75rem; border: 1px solid var(--rule); border-radius: var(--r-s); }
.mm #tabBody :where(legend) { padding: 0 .25rem; color: var(--ink-3); font: 500 .75rem/1.3 var(--f-num); text-transform: uppercase; }
.mm #tabBody :where(summary) { min-height: var(--ctl); display: flex; align-items: center; gap: .5rem; cursor: pointer; font-weight: 600; }
.mm #pointName { font-weight: 600; }

/* Reading form: LAeq is the instrument value, so it gets the full row and the meter face. */
.mm #tabBody:has(> label #lamax),
.mm #tabBody :has(> label #lamax) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: .75rem;
  align-content: start;
  align-items: end;
}
.mm #tabBody:has(> label #lamax) > :not(label),
.mm #tabBody :has(> label #lamax) > :not(label) { grid-column: 1 / -1; }
.mm #tabBody:has(> label #lamax) > :is(button, a),
.mm #tabBody :has(> label #lamax) > :is(button, a) { grid-column: auto; }
.mm #tabBody:has(> label #lamax) > label:has(textarea, #laeq, #noiseSource, #abnormalSound),
.mm #tabBody :has(> label #lamax) > label:has(textarea, #laeq, #noiseSource, #abnormalSound) { grid-column: 1 / -1; }
@container mm-body (max-width: 17.5rem) {
  .mm #tabBody :has(> label #lamax) { grid-template-columns: minmax(0, 1fr); }
}
.mm #tabBody label:has(#laeq) { color: var(--ink); font-weight: 600; }
.mm #laeq {
  min-height: 3.25rem;
  padding-block: .375rem;
  border-color: var(--ink-3);
  font: 600 1.625rem/1.1 var(--f-num);
  font-variant-numeric: tabular-nums;
}
.mm :is(#lamax, #lamin, #duration, #measurementDate, #startTime) { font-family: var(--f-num); font-variant-numeric: tabular-nums; }

/* Generated commands: secondary pills, one signal action per section, ink for "do it on the map", alert for removal. */
.mm #tabBody :where(button, a.button, a.btn, a[download], .btn) {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  min-height: var(--ctl);
  margin: .25rem .375rem .25rem 0;
  padding: 0 .875rem;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  background: var(--field);
  color: var(--ink);
  font: 500 .9375rem/1.2 var(--f-ui);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 120ms var(--ease-out);
}
.mm #tabBody :where(button, a.button, a.btn, a[download], .btn):active:not(:disabled) { transform: scale(.97); }
.mm #tabBody :where(button):disabled { opacity: .45; }
.mm #tabBody :where(#savePoint, #saveMeasurement, #newMeasurement) {
  background: var(--signal);
  border-color: transparent;
  color: var(--on-signal);
  font-weight: 600;
}
.mm #tabBody :where(#recordCurrentPoint, #campaignMark, .campaignMark) {
  background: var(--slab);
  border-color: transparent;
  color: var(--on-slab);
  font-weight: 600;
}
.mm #tabBody :where(#cancelMeasurement, #viewMeasurements) { background: transparent; }
.mm #tabBody :where(.deleteMeasurement, .campaignRemove, [id="deleteMeasurement"], [id="campaignRemove"]) {
  border-color: color-mix(in oklab, var(--alert) 38%, transparent);
  background: transparent;
  color: var(--alert);
}
.mm #tabBody :where(.record button, button[data-point-id], button[data-id]) {
  min-height: 2.25rem;
  padding: 0 .6875rem;
  font-size: .875rem;
}
.mm #tabBody :where(button[data-direction]) { min-width: 2.25rem; padding: 0 .5rem; font-family: var(--f-num); }

/* Ledger rows: plan order, readings and audit entries share one row grammar. Table rows keep table layout. */
.mm #tabBody :where(div, li, article, section).record,
.mm #tabBody :where(div, li, article, section).campaign-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .375rem .5rem;
  margin: 0 0 .5rem;
  padding: .625rem .75rem;
  border: 1px solid var(--rule);
  border-radius: var(--r-s);
  background: var(--field);
}
.mm #tabBody :where(div, li, article, section):is(.record, .campaign-row) > :not(button, a) { flex: 1 1 12rem; min-width: 0; }
.mm #tabBody :where(div, li, article, section):is(.record, .campaign-row) > :is(button, a) { flex: none; margin: 0; }
.mm #tabBody :is(.record, .campaign-row):is(.active, .selected, .current, [aria-current="true"], [aria-selected="true"]) {
  border-color: color-mix(in oklab, var(--signal-ink) 55%, transparent);
  box-shadow: inset 3px 0 0 var(--signal-ink);
}
.mm #tabBody :is(.record, .campaign-row) :where(strong, b) { color: var(--ink); font-weight: 600; }

.mm #tabBody :where(table) { width: 100%; border-collapse: collapse; font-size: .875rem; font-variant-numeric: tabular-nums; }
.mm #tabBody :where(th) {
  padding: .375rem .5rem;
  border-bottom: 1px solid var(--rule-2);
  color: var(--ink-3);
  font: 500 .75rem/1.3 var(--f-num);
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.mm #tabBody :where(td) { padding: .4375rem .5rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.mm #tabBody :where(tr.record:is(.active, .selected, .current)) td { background: var(--signal-wash); }

/* Status line: a signal lamp blinks once when the engine reports something new; it never stands in for progress. */
:root .mm.app-map #mmFoot {
  grid-area: foot;
  position: relative;
  /* The shared footer offset would lift this footer over the phone sheet and its Save button. */
  inset: auto;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 2.25rem;
  margin: 0;
  padding: .3125rem max(1rem, env(safe-area-inset-right)) max(.3125rem, env(safe-area-inset-bottom)) calc(max(1rem, env(safe-area-inset-left)) + 1.125rem);
  background: var(--plate);
  border-top: 1px solid var(--rule);
}
.mm #mmFoot::before,
.mm #mmFoot::after {
  content: "";
  position: absolute;
  left: max(1rem, env(safe-area-inset-left));
  top: 50%;
  width: .5rem;
  height: .5rem;
  margin-top: -.25rem;
  border-radius: 50%;
  pointer-events: none;
}
.mm #mmFoot::before { background: var(--ink-3); opacity: .35; }
.mm #mmFoot::after { background: var(--signal-ink); opacity: 0; }
.mm #status {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--ink-2);
  font: 500 .875rem/1.35 var(--f-ui);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Shared repeat-plan dialog: family surface only; its controller, view and own stylesheet stay in charge. */
.mm dialog.repeat-plan-host {
  border: 1px solid var(--rule-2);
  border-radius: .75rem;
  background: var(--plate);
  color: var(--ink);
  font-family: var(--f-ui);
  box-shadow: 0 28px 72px -28px rgb(0 0 0 / .55);
}
.mm dialog.repeat-plan-host::backdrop { background: rgb(12 14 13 / .4); }
.mm dialog.repeat-plan-host #repeatPlanDialogTitle { margin: 0; font: 600 1.125rem/1.3 var(--f-display); }
.mm dialog.repeat-plan-host .campaign-note { color: var(--ink-3); font-size: .875rem; }
.mm dialog.repeat-plan-host[open] { transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out); }
@starting-style {
  .mm dialog.repeat-plan-host[open] { opacity: 0; transform: translateY(.25rem) scale(.97); }
}

/* Narrower desktops: the header sheds the labels its icons already carry. */
@media (max-width: 93.75rem) {
  .mm :is(#mmClassic:not(.wc-style) > span, #mmPlanCap:not(.wc-cap), .mm-ident .mm-eyebrow) {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .mm .mm-classic { width: var(--ctl); padding: 0; }
  .mm #planSelect { width: 12rem; }
}

/* Laptop and tablet widths: the count tucks under the plan name, so the head stays one row above the workspaces. */
@media (max-width: 61.99rem) {
  .mm .mm-mark { display: none; }
  .mm .mm-plan { flex: 1 1 11rem; }
  .mm .mm-well {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: .5rem;
    flex: 1 1 auto;
    padding: .1875rem .5rem .25rem .75rem;
  }
  .mm .mm-well-icon { grid-row: 1 / span 2; }
  .mm #planSelect { grid-column: 2; width: 100%; min-width: 0; min-height: 1.625rem; }
  .mm #planCount { grid-column: 2; justify-self: start; padding: 0; background: none; color: var(--ink-3); font-size: .75rem; line-height: 1.25; }
}

/* A narrow stage, whether a phone or a bench beside the docked inspector: the modes become a four-way switch and
   the panel switches share the row under it. */
@container mm-stage (max-width: 47rem) {
  .mm .mm-taskbar { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: .5rem; }
  :root .mm.app-map #mmModes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    border-radius: .875rem;
  }
  :root .mm #mmModes [data-mode] {
    flex-direction: column;
    gap: .1875rem;
    min-width: 0;
    min-height: 3rem;
    padding: .25rem .125rem;
    border-radius: .6875rem;
    font-size: .8125rem;
    white-space: normal;
    text-align: center;
  }
  .mm #mmModes .workspace-panel-controls { grid-column: 1 / -1; }
  .mm #mmModes .workspace-panel-toggle { flex: 1 1 0; }
}

/* Touch screens of any width get full-height switches. */
@media (pointer: coarse) {
  .mm .mm-check { min-height: var(--ctl); }
  .mm #mmModes [data-mode] { min-height: var(--ctl); }
}

/* Phone: one column. The modes become a four-way switch and the inspector a sheet held inside the bench. */
@media (max-width: 47.99rem) {
  :root body.mm.app-map { height: auto; min-height: 100dvh; overflow: visible; }
  :root .mm.app-map #mmMain { min-height: 34rem; }
  :root .mm.app-map #mmTop:not(.wc-head) { gap: .5rem; padding: max(.5rem, env(safe-area-inset-top)) max(.75rem, env(safe-area-inset-right)) .5rem max(.75rem, env(safe-area-inset-left)); }
  /* Two rows: Home, the title and the preferences; then the plan with its folded actions. The workspaces follow. */
  .mm .mm-home { padding: 0 .75rem; }
  .mm .mm-ident { flex: 1 1 0; gap: .5rem; min-width: 0; }
  .mm .mm-ident-text { overflow: hidden; }
  .mm .mm-ident h1 { font-size: 1.0625rem; line-height: 1.2; white-space: normal; overflow-wrap: anywhere; overflow: visible; text-overflow: clip; }
  .mm .mm-prefs { order: 1; margin-left: 0; }
  /* A zero-height line break holds the rows apart whether or not the host hides Home and Classic. */
  :root .mm.app-map #mmTop:not(.wc-head) { row-gap: .25rem; }
  :root .mm.app-map #mmTop:not(.wc-head)::after { content: ""; order: 2; flex: 0 0 100%; height: 0; }
  .mm .mm-plan { order: 3; flex: 1 1 0; min-width: 0; }
  .mm .mm-more { order: 4; flex: none; }
  /* On a phone the plan actions sit under the map at the foot of the bench: the list opens upward over the map,
     never under the status band. */
  .mm .mm-more > .mm-actions { inset-inline: auto 0; top: auto; bottom: calc(100% + .375rem); max-height: min(28rem, calc(100dvh - 6rem)); overflow-y: auto; overscroll-behavior: contain; transform-origin: bottom right; }
  :root .mm.app-map #mmTop:not(.wc-head) > .workspace-flow { padding-top: .375rem; }

  :root .mm.app-map #mmMain { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  :root .mm.app-map #mmStage { gap: .5rem; padding: .5rem max(.625rem, env(safe-area-inset-right)) .5rem max(.625rem, env(safe-area-inset-left)); }

  /* Map first. Directly under the header the plate opens on the canvas; what a tap does, the modes and the panel
     switches sit under it within thumb reach. A rising sheet then covers the controls, never the planned points. */
  :root .mm.app-map #mmStage { grid-template-rows: minmax(0, 1fr) auto auto; }
  .mm .mm-plate { order: -1; grid-template-rows: minmax(0, 1fr) auto; }
  :root .mm.app-map #mapWrap { grid-area: 1 / 1; }
  .mm .mm-readout {
    grid-area: 2 / 1;
    gap: .5rem;
    padding: .75rem .5rem .5rem .4375rem;
    border-bottom: 0;
    border-top: 1px solid var(--rule);
  }
  .mm:is([data-mm-mode="plan"], [data-mm-mode="add"], [data-mm-mode="entry"]) .mm-readout { border-top-color: transparent; }
  /* The field-scale edge follows the readout to the side that meets the map. */
  .mm .mm-readout::after {
    top: 0;
    bottom: auto;
    background:
      repeating-linear-gradient(90deg, var(--tick) 0 1px, transparent 1px 2.5rem) left top / 100% .375rem no-repeat,
      repeating-linear-gradient(90deg, var(--tick) 0 1px, transparent 1px .5rem) left top / 100% .1875rem no-repeat;
  }
  .mm .mm-mode-copy { font-size: .8125rem; }
  .mm .mm-cmds :is(.mm-btn, .mm-go, .mm-exit) { min-height: var(--ctl); font-size: .875rem; }
  :root .mm.app-map #mapWrap { min-height: 10rem; }
  .mm #mmLayersCap { display: none; }
  .mm .mm-check { min-height: var(--ctl); }
  .mm .mm-gap { min-width: .25rem; }

  :root .mm.app-map #detail { border-left: 0; }
  .mm .mm-detail-head { padding: .875rem .75rem .5rem 1rem; }
  :root .mm.app-map #tabBody { padding: .875rem 1rem max(1rem, env(safe-area-inset-bottom)); }
}

/* Sheet: in peek it shows only the selected point and the five sections, below the layers row, so the map is
   never under it. Opening slides it up inside the bench, over the controls under the map; the upper part of the
   map stays in view so the selected point keeps its place. Header and workspace navigation stay outside. */
@media (max-width: 47.99rem) and (min-height: 36rem) {
  :root .mm.app-map #mmStage { padding-bottom: calc(var(--mm-peek) + .5rem); }
  :root .mm.app-map #mmStage:has(+ #detail[hidden]) { padding-bottom: .5rem; }
  :root .mm.app-map #detail {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 3;
    height: min(100%, max(calc(var(--mm-peek) + 15rem), 62%));
    border-top: 1px solid var(--rule-2);
    border-radius: 1rem 1rem 0 0;
    box-shadow: var(--sheet-lift);
    transform: translateY(calc(100% - var(--mm-peek)));
    transition: transform 280ms var(--ease-drawer);
  }
  :root .mm.app-map[data-mm-sheet="open"] #detail { transform: translateY(0); }
  .mm .mm-detail-head { height: 3.75rem; overflow: hidden; padding: .75rem .625rem .25rem 1rem; cursor: pointer; }
  .mm[data-mm-sheet="open"] .mm-detail-head { height: auto; max-height: 9rem; overflow: auto; padding-bottom: .5rem; cursor: auto; }
  .mm .mm-detail-head::before {
    content: "";
    position: absolute;
    top: .3125rem;
    left: 50%;
    width: 2.25rem;
    height: .25rem;
    margin-left: -1.125rem;
    border-radius: 999px;
    background: var(--rule-2);
  }
  .mm .mm-detail-head .mm-eyebrow { line-height: 1.2; }
  /* In peek the head holds the tag and one identity line; the rest of the engine's lines wait below the fold. */
  .mm:not([data-mm-sheet="open"]) .mm-detail-id { row-gap: .25rem; }
  .mm:not([data-mm-sheet="open"]) #pointInfo > b:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; }
  .mm .mm-sheet-toggle { display: inline-flex; margin-top: -.125rem; }
  :root .mm.app-map #tabs { height: 3.25rem; padding: 0 .25rem; }
  .mm #tabs [data-tab] { min-height: 0; padding-block: .25rem .375rem; }
}

/* Enlarged text uses normal document flow when a sheet no longer fits. */
:root .mm.app-map[data-mm-flow] #mmMain { grid-template-rows: auto auto; overflow: visible; }
:root .mm.app-map[data-mm-flow] #mmStage { padding-bottom: .5rem; }
:root .mm.app-map[data-mm-flow] #detail { position: relative; inset: auto; grid-area: 2 / 1; height: auto; max-height: none; transform: none; }
:root .mm.app-map[data-mm-flow] .mm-detail-head { height: auto; max-height: none; overflow: visible; }
:root .mm.app-map[data-mm-flow] #tabBody { overflow: visible; }
:root .mm.app-map[data-mm-flow] #mmSheet { display: none; }
:root .mm.app-map[data-mm-flow] .mm-well { display: flex; flex-wrap: wrap; }
:root .mm.app-map[data-mm-flow] :is(.mm-plan, .mm-more) { flex: 1 1 100%; }
/* ...but inside the stage's column the folded actions keep one column with the modes, full width, not a second column. */
:root .mm.app-map[data-mm-flow] .mm-taskbar { flex-wrap: nowrap; }
:root .mm.app-map[data-mm-flow] .mm-taskbar > .mm-more { flex: none; }
:root .mm.app-map[data-mm-flow] #planSelect { min-width: 0; flex: 1 1 calc(100% - 3rem); width: 0; }
:root .mm.app-map[data-mm-flow] #mmModes .workspace-panel-controls { flex-wrap: wrap; }
:root .mm.app-map[data-mm-flow] #mmModes .workspace-panel-toggle { flex-basis: 100%; }
:root .mm.app-map[data-mm-flow] .mm-cmds { flex-wrap: wrap; }

/* Short screens and large text: the page scrolls, the map keeps a stable fixed height, nothing is clipped.
   Ordinary short landscape at 48rem and wider then fits the window instead (below). */
@media (max-height: 35.99rem) {
  :root body.mm.app-map { height: auto; min-height: 100dvh; overflow: visible; }
  :root .mm.app-map #mmMain { align-items: start; overflow: visible; }
  :root .mm.app-map #mmStage { grid-template-rows: auto auto auto; }
  .mm .mm-plate { grid-template-rows: auto auto; }
  :root .mm.app-map #mapWrap { height: max(15rem, calc(100dvh - 8.5rem)); }
  .mm .mm-readout { height: auto; min-height: 3rem; padding-block: .375rem; }
  .mm .mm-mode-copy { display: block; -webkit-line-clamp: unset; }
  .mm .mm-taskbar { flex-wrap: wrap; }
  :root .mm.app-map #mmLayers { flex-wrap: wrap; overflow: visible; }
  .mm .mm-cmds { flex-wrap: wrap; }
  .mm #status { white-space: normal; overflow-wrap: anywhere; }
}
/* The folded plan actions may outgrow a short window; the list then scrolls inside itself above the map. */
@media (max-height: 35.99rem) and (max-width: 93.75rem) {
  .mm .mm-more > .mm-actions { max-height: calc(100dvh - 5rem); overflow-y: auto; overscroll-behavior: contain; }
}
@media (max-height: 35.99rem) and (min-width: 48rem) {
  :root .mm.app-map #detail { position: sticky; top: 0; align-self: start; height: 100dvh; max-height: 100dvh; }
}
/* Ordinary short landscape (a phone on its side, a short laptop window): the bench fits the window instead of
   scrolling past repeated bands. The map takes the whole stage height on the right; a rail on the left holds the
   four-way switch, the panel switches and the readout, whose commands keep the bottom edge near the thumb. The
   inspector docks beside the map and scrolls as one column under its pinned sections. The controller checks the
   actual hosted height and reading size; enlarged text keeps the scrolling layout, rather than a cramped rail. */
@media (orientation: landscape) {
  :root body.mm.app-map[data-mm-landscape] { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  :root .mm.app-map[data-mm-landscape] #mmTop:not(.wc-head) { row-gap: .375rem; padding-top: max(.375rem, env(safe-area-inset-top)); padding-bottom: .375rem; }
  :root .mm.app-map[data-mm-landscape] #mmTop:not(.wc-head) > .workspace-flow { padding-top: .375rem; }
  :root .mm.app-map[data-mm-landscape] #mmMain { align-items: stretch; overflow: hidden; }

  :root .mm.app-map[data-mm-landscape] #mmStage {
    --mm-rail: clamp(15.5rem, 33%, 17rem);
    grid-template-columns: var(--mm-rail) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: .5rem .625rem;
    padding: .5rem .75rem .5rem max(.75rem, env(safe-area-inset-left));
  }
  :root .mm.app-map[data-mm-landscape] #mmStage:has(+ #detail[hidden]) { padding-right: max(.75rem, env(safe-area-inset-right)); }
  /* The plate's two parts become separate stage cells: the readout joins the rail, the map fills the right. */
  .mm[data-mm-landscape] .mm-plate { display: contents; }

  /* Rail, top: the modes as the four-way switch, the panel switches under them. */
  .mm[data-mm-landscape] .mm-taskbar { grid-column: 1; grid-row: 1; flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: .5rem; }
  :root .mm.app-map[data-mm-landscape] #mmModes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; border-radius: .875rem; }
  :root .mm[data-mm-landscape] #mmModes [data-mode] {
    flex-direction: column;
    gap: .1875rem;
    min-width: 0;
    min-height: 3rem;
    padding: .25rem .125rem;
    border-radius: .6875rem;
    font-size: .8125rem;
    white-space: normal;
    text-align: center;
  }
  .mm[data-mm-landscape] #mmModes .workspace-panel-controls { grid-column: 1 / -1; }
  .mm[data-mm-landscape] #mmModes .workspace-panel-toggle { flex: 1 1 0; }

  /* Rail, below: the readout. Its help reads from the top and scrolls in place; the commands hold the bottom. */
  .mm[data-mm-landscape] .mm-readout {
    grid-column: 1;
    grid-row: 2 / -1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas: "glyph copy" "cmds cmds";
    align-items: start;
    gap: .375rem .625rem;
    height: auto;
    min-height: 0;
    padding: .5rem 1rem .5rem .5rem;
    overflow: hidden;
    border: 1px solid var(--rule-2);
    border-radius: var(--r);
  }
  .mm[data-mm-landscape]:is([data-mm-mode="plan"], [data-mm-mode="add"], [data-mm-mode="entry"]) .mm-readout { border-color: transparent; }
  /* The field-scale edge stands on the side that meets the map. */
  .mm[data-mm-landscape] .mm-readout::after {
    inset: 0 0 0 auto;
    width: .375rem;
    height: auto;
    background:
      repeating-linear-gradient(180deg, var(--tick) 0 1px, transparent 1px 2.5rem) right top / .375rem 100% no-repeat,
      repeating-linear-gradient(180deg, var(--tick) 0 1px, transparent 1px .5rem) right top / .1875rem 100% no-repeat;
  }
  /* In a short rail the help row can shrink to nothing: the glyph shrinks with it and the commands stay on top,
     so nothing ever lies over a command. */
  .mm[data-mm-landscape] .mm-glyph { grid-area: glyph; align-self: stretch; min-height: 0; overflow: hidden; }
  .mm[data-mm-landscape] .mm-mode-copy {
    grid-area: copy;
    display: block;
    -webkit-line-clamp: unset;
    align-self: stretch;
    align-content: start;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--rule-2) transparent;
  }
  .mm[data-mm-landscape] .mm-cmds { grid-area: cmds; flex-wrap: wrap; margin-left: 0; position: relative; z-index: 1; }
  .mm[data-mm-landscape] .mm-cmds :is(.mm-btn, .mm-go, .mm-exit) { min-height: var(--ctl); }
  .mm[data-mm-landscape] .mm-cmds > :is(.mm-go, .mm-exit) { flex: 1 1 auto; min-width: 0; }
  .mm[data-mm-landscape] #reviewOrderBtn { flex: none; width: var(--ctl); padding: 0; }
  .mm[data-mm-landscape] #reviewOrderBtn > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

  /* The map: the full stage height beside the rail; the layer strip, when open, runs along its foot. */
  :root .mm.app-map[data-mm-landscape] #mapWrap {
    grid-column: 2;
    grid-row: 1 / 3;
    height: auto;
    min-height: 0;
    border: 1px solid var(--rule-2);
    border-radius: var(--r);
    box-shadow: var(--lift);
  }
  :root .mm.app-map[data-mm-landscape] #mmStage:has(> #mmLayers[hidden]) #mapWrap { grid-row: 1 / -1; }
  :root .mm.app-map[data-mm-landscape] #mmLayers { grid-column: 2; grid-row: 3; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }

  /* The docked inspector scrolls as one column so the point form gets the height; its sections stay pinned. */
  :root .mm.app-map[data-mm-landscape] #detail {
    position: relative;
    top: auto;
    display: block;
    align-self: stretch;
    height: auto;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  :root .mm.app-map[data-mm-landscape] #tabs { position: sticky; top: 0; z-index: 1; background: var(--plate); }
  :root .mm.app-map[data-mm-landscape] #tabBody { overflow: visible; }
}
/* The room rail/browser chrome can leave less height than the standalone page. Keep the same composition,
   but let its minimum usable stage scroll instead of overlapping its commands. */
:root body.mm.app-map[data-mm-landscape-scroll] { height: auto; min-height: 100dvh; overflow-y: auto; }
:root .mm.app-map[data-mm-landscape-scroll] #mmMain { height: 14rem; min-height: 14rem; }
@media (max-height: 35.99rem) and (max-width: 47.99rem) {
  :root .mm.app-map #mmMain { grid-template-rows: auto auto; }
  :root .mm.app-map #detail { position: relative; height: auto; border-top: 1px solid var(--rule); }
  :root .mm.app-map #tabBody { overflow: visible; }
}

@media (hover: hover) and (pointer: fine) {
  .mm :is(.mm-btn, .mm-home, .mm-classic, [id="repeatPlanBtn"]):not(:disabled):hover,
  .mm .mm-icon-btn:hover,
  .mm #tabBody :where(button, a.button, a.btn, a[download], .btn):not(:disabled):hover {
    background-color: var(--plate-2);
    border-color: color-mix(in oklab, var(--ink) 34%, transparent);
  }
  .mm .mm-go:not(:disabled):hover,
  .mm #tabBody :where(#savePoint, #saveMeasurement, #newMeasurement):not(:disabled):hover {
    background-color: color-mix(in oklab, var(--signal) 86%, var(--ink));
  }
  .mm #tabBody :where(#recordCurrentPoint, #campaignMark, .campaignMark):not(:disabled):hover {
    background-color: color-mix(in oklab, var(--slab) 86%, var(--paper));
  }
  .mm #tabBody :where(.deleteMeasurement, .campaignRemove, [id="deleteMeasurement"], [id="campaignRemove"]):not(:disabled):hover {
    background-color: var(--alert-wash);
    border-color: var(--alert);
  }
  .mm #mmModes [data-mode]:not(:disabled, .active, .is-active, .selected, [aria-pressed="true"], [aria-current="true"], [aria-selected="true"]):hover {
    background: color-mix(in oklab, var(--ink) 7%, transparent);
    color: var(--ink);
  }
  .mm:is([data-mm-mode="plan"], [data-mm-mode="add"], [data-mm-mode="entry"]) :is(.mm-exit, .mm-cmds .mm-btn):not(:disabled):hover {
    background: color-mix(in oklab, var(--on-armed) 12%, transparent);
    border-color: color-mix(in oklab, var(--on-armed) 48%, transparent);
  }
  .mm .workspace-panel-close:hover { background-color: var(--plate-2); border-color: color-mix(in oklab, var(--ink) 34%, transparent); color: var(--ink); }
  .mm #tabs [data-tab]:not(:disabled):hover { color: var(--ink); }
  .mm .mm-check:not(:has(input:disabled)):hover { border-color: color-mix(in oklab, var(--ink) 34%, transparent); color: var(--ink); }
  .mm .mm-lang:hover, .mm .mm-well:hover { border-color: color-mix(in oklab, var(--ink) 34%, transparent); }
}

/* Reduced motion keeps colour and opacity changes and drops movement; static drops all chrome motion. */
:root:is([data-motion="reduced"], [data-lab-motion="reduced"]) .mm :is(.mm-btn, .mm-go, .mm-home, .mm-classic, .mm-exit, .mm-icon-btn, [id="repeatPlanBtn"], [data-mode]):active { transform: none; }
:root:is([data-motion="reduced"], [data-lab-motion="reduced"]) .mm #tabBody :where(button, a.button, a.btn, a[download], .btn):active { transform: none; }
:root:is([data-motion="reduced"], [data-lab-motion="reduced"]) .mm #detail { transition: none; }
:root:is([data-motion="reduced"], [data-lab-motion="reduced"]) .mm #tabs [data-tab]::after { transform: none; opacity: 0; transition: opacity 160ms ease; }
:root:is([data-motion="reduced"], [data-lab-motion="reduced"]) .mm #tabs [data-tab]:is(.active, .is-active, .selected, [aria-pressed="true"], [aria-current="true"], [aria-selected="true"])::after { opacity: 1; }
:root:is([data-motion="reduced"], [data-lab-motion="reduced"]) .mm .mm-sheet-toggle .ui-icon { transition: none; }
:root:is([data-motion="reduced"], [data-lab-motion="reduced"]) .mm .mm-skip { transition: none; }
@starting-style {
  :root:is([data-motion="reduced"], [data-lab-motion="reduced"]) .mm dialog.repeat-plan-host[open] { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="full"]) .mm :is(.mm-btn, .mm-go, .mm-home, .mm-classic, .mm-exit, .mm-icon-btn, [id="repeatPlanBtn"], [data-mode]):active { transform: none; }
  :root:not([data-motion="full"]) .mm #tabBody :where(button, a.button, a.btn, a[download], .btn):active { transform: none; }
  :root:not([data-motion="full"]) .mm #detail { transition: none; }
  :root:not([data-motion="full"]) .mm #tabs [data-tab]::after { transform: none; opacity: 0; transition: opacity 160ms ease; }
  :root:not([data-motion="full"]) .mm #tabs [data-tab]:is(.active, .is-active, .selected, [aria-pressed="true"], [aria-current="true"], [aria-selected="true"])::after { opacity: 1; }
  :root:not([data-motion="full"]) .mm .mm-sheet-toggle .ui-icon { transition: none; }
  :root:not([data-motion="full"]) .mm .mm-skip { transition: none; }
  @starting-style {
    :root:not([data-motion="full"]) .mm dialog.repeat-plan-host[open] { transform: none; }
  }
}
:root[data-noise-motion="static"] .mm *,
:root[data-noise-motion="static"] .mm *::before,
:root[data-noise-motion="static"] .mm *::after {
  transition: none !important;
  animation: none !important;
}
:root[data-noise-motion="static"] .mm :active { transform: none !important; }

@media (forced-colors: active) {
  .mm #mmModes [data-mode]:is(.active, .is-active, .selected, [aria-pressed="true"], [aria-current="true"], [aria-selected="true"]),
  .mm #tabs [data-tab]:is(.active, .is-active, .selected, [aria-pressed="true"], [aria-current="true"], [aria-selected="true"]) {
    forced-color-adjust: none;
    background: Highlight;
    color: HighlightText;
  }
  .mm .mm-readout, .mm .mm-plate, .mm .mm-check, .mm .mm-well { border: 1px solid CanvasText; }
  .mm .mm-readout::after, .mm #mmFoot::before, .mm #mmFoot::after { display: none; }
}
