/* Matte: a design system drawn from 80s and 90s matte black electronics.
   Opaque powder-coated bodies, machined seams, printed legends, recessed wells and one warm accent.
   Everything lives under .matte and is built from the tokens below; the design system page (tinkering/design-system/) shows and tunes them.
   Light always falls from the top, so highlights sit on upper edges and shadows fall down. */

.matte {
  /* ---- tokens ---- */
  --m-tone: 11;                       /* body lightness, in % */
  --m-hue: 240 2%;                    /* the faint cool cast of the paint */
  --m-speckle: 0.16;                  /* how much grain shows in the paint */
  --m-speckle-gain: 1;                /* a grey body needs more of it to show */
  --m-speckle-ink: none;              /* pale flecks on a dark body; invert(1) turns them dark for a grey one */
  --m-accent: #e08a3c;                /* copper: the accent as a fill, on keys, pads and badges */
  --m-signal: var(--m-accent);        /* the accent as a mark on the body: value rings, lamps, focus, links */
  --m-radius: var(--radius-2xl, 16px);     /* body corners. Shape, space, type and motion come from the site's tokens */
  --m-radius-key: var(--radius-sm, 6px);
  --m-radius-well: var(--radius-xs, 4px);

  --m-pad-y: var(--space-4, 16px);    /* a cell's padding and the gap between its parts */
  --m-pad-x: var(--space-5, 24px);
  --m-gap: var(--space-3, 12px);

  --m-text-legend: 10px;              /* printed legends. Below the 11px floor most systems keep; the decision is open */
  --m-text-legend-lg: 12px;
  --m-text-glass: 9px;                /* small legends behind glass */
  --m-text-help: 12px;
  --m-text-small: var(--text-2xs, 13px);
  --m-text-body: var(--text-xs, 14px);

  --m-press: var(--dur-1, 60ms);      /* motion, by what is moving. Reduced motion sets the travel ones to nothing */
  --m-release: var(--dur-2, 110ms);
  --m-hover: var(--dur-2, 110ms);
  --m-travel: var(--dur-3, 160ms);
  --m-travel-lg: var(--dur-4, 220ms);
  --m-light-on: var(--dur-1, 60ms);
  --m-light-off: var(--dur-4, 220ms);
  --m-enter: var(--dur-4, 220ms);
  --m-enter-lg: var(--dur-5, 320ms);
  --m-exit: var(--dur-3, 160ms);
  --m-ease: var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1));
  --m-ease-exit: var(--ease-in, cubic-bezier(0.4, 0, 1, 1));
  --m-ease-detent: var(--ease-detent, cubic-bezier(0.34, 1.3, 0.64, 1));

  --m-layer-sticky: 10;               /* stacking order. Popovers and dialogs use the browser's top layer */
  --m-layer-toast: 1000;
  --m-layer-tip: 1100;
  --m-hover-lift: 1.12;               /* how much a raised part brightens under the pointer */

  --m-body-hi: hsl(var(--m-hue) calc((var(--m-tone) + 2) * 1%));
  --m-body: hsl(var(--m-hue) calc(var(--m-tone) * 1%));
  --m-body-lo: hsl(var(--m-hue) calc((var(--m-tone) - 2) * 1%));
  --m-cap-hi: hsl(var(--m-hue) calc((var(--m-tone) + 7.5) * 1%));   /* raised parts: knob caps, keys, thumbs */
  --m-cap: hsl(var(--m-hue) calc((var(--m-tone) + 1.5) * 1%));
  --m-knurl-hi: hsl(var(--m-hue) calc((var(--m-tone) + 4) * 1%));
  --m-knurl-lo: hsl(var(--m-hue) calc((var(--m-tone) - 2) * 1%));
  --m-well: #0a0a0a;                  /* recesses cut into the body: slots, the groove under a knob */
  --m-edge: #070707;                  /* the dark hairline round every part */
  --m-wall: #0c0c0c;                  /* the side of a raised key */
  --m-shine: rgb(255 255 255 / calc(0.11 * var(--m-gloss)));   /* the lit upper edge of a part */
  --m-shade: 1;                       /* how dark shadows fall; a pale body takes far less */
  --m-gloss: 1;                       /* how bright lit edges are; a pale body needs far more */

  --m-glass: #0a0a0a;                 /* black glass: displays and meters. The same in both finishes */
  --m-glass-off: #232325;             /* an unlit segment behind glass */
  --m-glass-dim: #8a8a8c;             /* small legends behind glass */
  --m-meter: var(--m-glass);          /* the meter's window, its unlit and lit segments, and its small legends */
  --m-meter-off: var(--m-glass-off);
  --m-meter-on: var(--m-lit);
  --m-meter-hot: var(--m-signal);
  --m-meter-dim: var(--m-glass-dim);

  --m-metal-hi: #7c7c80;              /* spun metal: the sheen, the body of the cap and its darkest turn */
  --m-metal: #232325;
  --m-metal-lo: #0e0e0f;
  --m-metal-mark: var(--m-lit);       /* the line engraved in a metal knob */
  --m-metal-groove: rgb(255 255 255 / 0.05);

  --m-print: #b4b4b6;                 /* silkscreened legends */
  --m-print-dim: #8a8a8c;
  --m-print-hi: #fff;                 /* a legend under the pointer, or the scale dot the knob points at */
  --m-lit: #ebe8e1;                   /* light behind glass: display digits, lit segments */
  --m-mark: var(--m-lit);             /* the indicator on a part: the knob's dot, the fader's line */
  --m-lamp: var(--m-lit);             /* a white lamp set in the body */
  --m-lamp-hot: var(--m-signal);
  --m-pad-on-hi: #f4f1ea;             /* a lit pad */
  --m-pad-on-lo: #d9d5cc;

  --m-ink: var(--m-lit);              /* text typed into a well */
  --m-primary-hi: #f4f1ea;            /* the one key on a panel that matters most */
  --m-primary-lo: #d9d5cc;
  --m-primary-fg: #17110b;
  --m-ok: #8fbf7a;                    /* status: lamps and message text. Each is at least 4.5:1 on its body, in both finishes */
  --m-warn: #e3b341;
  --m-danger: #e8705a;
  --m-info: #9fc4d8;
  --m-well-shadow: 0 2px 4px rgb(0 0 0 / calc(0.9 * var(--m-shade))) inset, 0 0 0 1px var(--m-edge), 0 1px 0 rgb(255 255 255 / calc(0.08 * var(--m-gloss)));
  --m-font-text: var(--font-sans, system-ui, sans-serif);   /* running text: help, messages, card copy */

  --m-font: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  --m-drop: 0 26px 46px rgb(0 0 0 / calc(0.55 * var(--m-shade))), 0 5px 10px rgb(0 0 0 / calc(0.4 * var(--m-shade)));   /* a body resting on the bench */
}

/* ---- Light finish: the same parts in pale powder coat. It follows the site's light theme, or is forced with
        .matte--light; .matte--dark holds the dark finish under a light theme. The body is a mid-light grey, not white,
        so shadows, lit edges and the grain all have something to show against. Metal turns silver, and meters
        read as dark segments in a pale window. Display glass stays black. ---- */
:root[data-theme="light"] .matte:not(.matte--dark), .matte.matte--light {
  --m-tone: 72;
  --m-well: hsl(var(--m-hue) calc((var(--m-tone) - 18) * 1%));
  --m-edge: hsl(var(--m-hue) calc((var(--m-tone) - 44) * 1%));
  --m-wall: hsl(var(--m-hue) calc((var(--m-tone) - 30) * 1%));
  --m-shade: 0.5;
  --m-gloss: 4.5;
  --m-speckle-gain: 2.2;
  --m-speckle-ink: invert(1);
  --m-iron: #4c4d52; --m-iron-lift: 0;   /* the filings in a key's paint (filings.js): dark iron on a grey body, darker still at the tips */
  --m-metal-hi: #fbfbfc;              /* silver */
  --m-metal: #b4b5b9;
  --m-metal-lo: #77787d;
  --m-metal-mark: #1c1c1e;
  --m-metal-groove: rgb(0 0 0 / 0.07);
  --m-meter: hsl(var(--m-hue) calc((var(--m-tone) - 9) * 1%));
  --m-meter-off: hsl(var(--m-hue) calc((var(--m-tone) - 19) * 1%));
  --m-meter-on: #1c1c1e;
  --m-meter-hot: #b23a1e;
  --m-meter-dim: #444448;
  --m-print: #2a2a2d;
  --m-print-dim: #444448;
  --m-print-hi: #000;
  --m-mark: #1c1c1e;
  --m-lamp: var(--m-signal);
  --m-lamp-hot: #b23a1e;
  --m-pad-on-hi: color-mix(in srgb, var(--m-accent) 90%, #fff);
  --m-pad-on-lo: color-mix(in srgb, var(--m-accent) 86%, #000);
  --m-ink: #141416;
  --m-primary-hi: #323236;
  --m-primary-lo: #1d1d20;
  --m-primary-fg: #f1eee7;
  --m-ok: #204e18;
  --m-warn: #5d3d00;
  --m-danger: #802213;
  --m-info: #1a4862;
  --m-signal: color-mix(in srgb, var(--m-accent) 50%, #000);   /* copper is too pale to mark a pale body */
  --m-hover-lift: 0.965;
}

.matte button { appearance: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; background: none; }
/* ---- States, the same for every control.
        Hover: a legend brightens and a raised part catches a little more light.
        Focus: one ring in the signal colour, 2px wide and 3px clear of the part; it appears at once.
        Pressed and on: each part moves as its mechanism does (see the parts below).
        Disabled: dimmed, and it takes no input. Read-only: looks normal, takes no input.
        Error: a ring in the danger colour, with a message that says what to do. ---- */
.matte :focus-visible, .matte .is-focus { outline: 2px solid var(--m-signal); outline-offset: 3px; }
.matte :is(.m-knob, .m-fader, .m-switch, .m-rocker, .m-push, .m-seg button, .m-check input):is(:disabled, [aria-disabled="true"]) { opacity: 0.4; pointer-events: none; }
.matte [aria-readonly="true"] { pointer-events: none; }
.matte [aria-invalid="true"]:not(.m-input) { outline: 2px solid var(--m-danger); outline-offset: 3px; }
.m-switch.is-hover::after, .m-rocker.is-hover::before, .m-rocker.is-hover::after, .m-push.is-hover:not([aria-pressed="true"], [aria-checked="true"])::before, .m-knob.is-hover .m-knob__cap { filter: brightness(var(--m-hover-lift)); }
@media (hover: hover) {
  .m-switch:hover::after, .m-rocker:hover::before, .m-rocker:hover::after, .m-push:hover:not([aria-pressed="true"], [aria-checked="true"])::before, .m-knob:hover .m-knob__cap { filter: brightness(var(--m-hover-lift)); }
}
.matte [hidden] { display: none !important; }   /* the layout classes set display, which would otherwise undo hidden */

/* ---- Body: the powder-coated case. Cells sit side by side, divided by seams. ---- */
.m-panel { position: relative; isolation: isolate; display: inline-flex; align-items: stretch; border-radius: var(--m-radius);
  background: linear-gradient(180deg, var(--m-body-hi), var(--m-body-lo));
  box-shadow: 0 1px 0 var(--m-shine) inset, 0 -1px 0 rgb(0 0 0 / calc(0.6 * var(--m-shade))) inset, 0 0 0 1px var(--m-edge), var(--m-drop);
  user-select: none; -webkit-user-select: none; text-align: left; }
.m-panel::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; opacity: calc(var(--m-speckle) * var(--m-speckle-gain)); filter: var(--m-speckle-ink); pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 -.42'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }
.m-panel--col { flex-direction: column; }
.m-panel--flat { box-shadow: 0 1px 0 var(--m-shine) inset, 0 -1px 0 rgb(0 0 0 / calc(0.6 * var(--m-shade))) inset, 0 0 0 1px var(--m-edge); }   /* a body with no drop shadow, for inside a layout */
.m-cell { display: grid; align-content: center; justify-items: start; gap: var(--m-gap); padding: var(--m-pad-y) var(--m-pad-x); }
.m-cell--row { display: flex; align-items: center; gap: var(--space-4, 16px); }
.matte--compact, .m-panel--compact { --m-pad-y: var(--space-3, 12px); --m-pad-x: var(--space-4, 16px); --m-gap: var(--space-2, 8px); }   /* a denser body, for tight layouts */
.m-cell--centre { justify-items: center; }
.m-seam { flex: none; width: 2px; background: linear-gradient(90deg, var(--m-well) 50%, rgb(255 255 255 / calc(0.055 * var(--m-gloss))) 50%); }
.m-panel--col > .m-seam { width: auto; height: 2px; background: linear-gradient(180deg, var(--m-well) 50%, rgb(255 255 255 / calc(0.055 * var(--m-gloss))) 50%); }

@media (max-width: 480px) {            /* a body marked --reflow stacks its cells on a phone, and its seams turn to match */
  .m-panel--reflow { flex-direction: column; }
  .m-panel--reflow > .m-seam { width: auto; height: 2px; background: linear-gradient(180deg, var(--m-well) 50%, rgb(255 255 255 / calc(0.055 * var(--m-gloss))) 50%); }
}

/* ---- Well: a plain recess, the same one the slot, the display and the meter are cut from ---- */
.m-well { border-radius: var(--m-radius-well); background: var(--m-well); box-shadow: 0 2px 4px rgb(0 0 0 / calc(0.9 * var(--m-shade))) inset, 0 0 0 1px var(--m-edge), 0 1px 0 rgb(255 255 255 / calc(0.08 * var(--m-gloss))); }

/* ---- Legend: silkscreened type ---- */
.m-legend { font: 400 var(--m-text-legend)/1 var(--m-font); letter-spacing: 0.1em; text-transform: uppercase; color: var(--m-print); }
.m-legend--dim { color: var(--m-print-dim); }
.m-legend--lg { font-size: var(--m-text-legend-lg); }
.m-mark { font: 600 13px/1 var(--font-display, var(--m-font)); letter-spacing: 0.02em; color: var(--m-print); }   /* a maker's mark */

/* ---- Lamp: a small LED. Add .is-on to light it. ---- */
.m-led { display: inline-block; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--m-cap-hi);
  box-shadow: 0 1px 1px rgb(0 0 0 / calc(0.8 * var(--m-shade))) inset, 0 0 0 1px var(--m-edge); transition: background var(--m-light-off), box-shadow var(--m-light-off); }
.m-led.is-on, [aria-checked="true"] + .m-state .m-led, [aria-pressed="true"] > .m-led, [aria-checked="true"] > .m-led {
  background: var(--m-signal); box-shadow: 0 0 0 1px var(--m-edge), 0 0 5px color-mix(in srgb, var(--m-signal) 75%, transparent); }
.m-led.is-on, [aria-checked="true"] + .m-state .m-led, [aria-pressed="true"] > .m-led, [aria-checked="true"] > .m-led { transition-duration: var(--m-light-on); }
.m-led--white.is-on { background: var(--m-lamp); box-shadow: 0 0 0 1px var(--m-edge), 0 0 5px color-mix(in srgb, var(--m-lamp) 60%, transparent); }

/* ---- Slide switch: a thumb in a recessed slot, off to the left and on to the right ---- */
.m-switch { position: relative; flex: none; width: 56px; height: 28px; border-radius: 14px; touch-action: manipulation; background: var(--m-well);
  box-shadow: 0 2px 4px rgb(0 0 0 / calc(0.9 * var(--m-shade))) inset, 0 0 0 1px var(--m-edge) inset, 0 1px 0 rgb(255 255 255 / calc(0.08 * var(--m-gloss))); }
.m-switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, hsl(var(--m-hue) calc((var(--m-tone) + 12) * 1%)), hsl(var(--m-hue) calc((var(--m-tone) + 3.5) * 1%)) 75%);
  box-shadow: 0 1px 0 rgb(255 255 255 / calc(0.16 * var(--m-gloss))) inset, 0 -1px 1px rgb(0 0 0 / calc(0.5 * var(--m-shade))) inset, 0 2px 4px rgb(0 0 0 / calc(0.8 * var(--m-shade)));
  transition: transform var(--m-travel-lg) var(--m-ease-detent), scale var(--m-release) var(--m-ease), filter var(--m-hover); }
.m-switch[aria-checked="true"]::after { transform: translateX(28px); }
.m-switch:active::after { scale: 0.94; }
.m-state { display: flex; align-items: center; gap: 7px; }   /* the lamp and legend that follow a switch */
[aria-checked="true"] + .m-state { color: var(--m-print); }

/* ---- Rocker switch: a paddle pivoting in a bezel. Off, the top stands proud and catches the light;
        on, the top is pressed in and the bottom stands proud. Two faces cross-fade as the paddle tips. ---- */
.m-rocker { position: relative; flex: none; width: 36px; height: 62px; border-radius: 7px; touch-action: manipulation; perspective: 140px;
  background: var(--m-well); box-shadow: 0 2px 4px rgb(0 0 0 / calc(0.9 * var(--m-shade))) inset, 0 0 0 1px var(--m-edge) inset, 0 1px 0 rgb(255 255 255 / calc(0.08 * var(--m-gloss))); }
.m-rocker::before, .m-rocker::after { content: ""; position: absolute; inset: 3px; border-radius: 4px; transform: rotateX(-13deg);
  transition: transform var(--m-travel) var(--m-ease-detent), opacity var(--m-release) linear, filter var(--m-hover); }
.m-rocker::before {                                       /* top proud */
  background: linear-gradient(180deg, hsl(var(--m-hue) calc((var(--m-tone) + 13) * 1%)), var(--m-cap-hi) 14%, var(--m-cap) 56%, var(--m-body-lo));
  box-shadow: 0 1px 0 rgb(255 255 255 / calc(0.3 * var(--m-gloss))) inset, 0 0 0 1px var(--m-edge), 0 -2px 3px rgb(0 0 0 / calc(0.6 * var(--m-shade))); }
.m-rocker::after { opacity: 0;                            /* bottom proud */
  background: linear-gradient(180deg, var(--m-body-lo), var(--m-cap) 40%, var(--m-cap-hi) 84%, hsl(var(--m-hue) calc((var(--m-tone) + 10) * 1%)));
  box-shadow: 0 -1px 0 rgb(255 255 255 / calc(0.12 * var(--m-gloss))) inset, 0 0 0 1px var(--m-edge), 0 3px 4px rgb(0 0 0 / calc(0.75 * var(--m-shade))); }
.m-rocker[aria-checked="true"]::before, .m-rocker[aria-checked="true"]::after { transform: rotateX(13deg); }
.m-rocker[aria-checked="true"]::before { opacity: 0; }
.m-rocker[aria-checked="true"]::after { opacity: 1; }

/* ---- Knob: a flat cap with a knurled side and a white dot, on a ring that fills with its value.
        <div class="m-knob" role="slider" data-min data-max data-value data-ticks>; matte.js builds the rest. ---- */
.m-knob { --size: 116px; position: relative; flex: none; width: var(--size); height: var(--size); border-radius: 50%; cursor: grab; touch-action: none; }
.m-knob--sm { --size: 72px; }
.m-knob--lg { --size: 168px; }
.m-knob:active { cursor: grabbing; }
.m-knob__side, .m-knob__cap, .m-knob__grip { position: absolute; border-radius: 50%; }
.m-knob__side { inset: 15.5%; background: repeating-conic-gradient(from 0deg, var(--m-knurl-lo) 0deg 2deg, var(--m-knurl-hi) 2deg 4deg);
  box-shadow: 0 0 0 1px var(--m-edge), 0 calc(var(--size) * 0.14) calc(var(--size) * 0.16) calc(var(--size) * -0.035) rgb(0 0 0 / calc(0.8 * var(--m-shade))), 0 3px 4px rgb(0 0 0 / calc(0.6 * var(--m-shade))); }
.m-knob__cap { transition: filter var(--m-hover); inset: calc(15.5% + var(--size) * 0.045); background: radial-gradient(circle at 50% 22%, var(--m-cap-hi), var(--m-cap) 68%);   /* its light stays put while the grip turns */
  box-shadow: 0 1px 0 rgb(255 255 255 / calc(0.13 * var(--m-gloss))) inset, 0 -1px 1px rgb(0 0 0 / calc(0.55 * var(--m-shade))) inset, 0 0 0 1px rgb(0 0 0 / calc(0.55 * var(--m-shade))); }
.m-knob__grip { inset: 15.5%; will-change: transform; }
.m-knob__dot { position: absolute; left: 50%; top: 15%; width: max(4px, calc(var(--size) * 0.043)); aspect-ratio: 1; translate: -50% 0; border-radius: 50%; background: var(--m-mark); }
.m-knob__ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.m-knob__track { fill: none; stroke: var(--m-well); stroke-width: 2.6; stroke-linecap: round; }
.m-knob__value { fill: none; stroke: var(--m-signal); stroke-width: 1.5; stroke-linecap: round; }
.m-knob__tick { fill: color-mix(in srgb, var(--m-print) 36%, transparent); transition: fill var(--m-hover); }
.m-knob__tick.is-near { fill: var(--m-print-hi); }

/* ---- Metal knob: the alternative finish. Dark spun aluminium with a chamfered edge and an engraved line
        in place of the dot. The sheen is fixed to the light, so it holds still while the line turns. ---- */
.m-knob--metal .m-knob__side { background: conic-gradient(from 20deg, var(--m-metal-hi), var(--m-metal) 10%, var(--m-metal-lo) 24%, var(--m-metal) 38%, var(--m-metal-lo) 46%,
  var(--m-metal-hi) 52%, var(--m-metal) 62%, var(--m-metal-lo) 76%, var(--m-metal) 90%, var(--m-metal-hi)); }
.m-knob--metal .m-knob__cap { inset: calc(15.5% + var(--size) * 0.03);
  background: radial-gradient(circle, rgba(0, 0, 0, 0.55) 0 1.5%, transparent 5%),
    repeating-radial-gradient(circle, var(--m-metal-groove) 0 0.6px, transparent 0.6px 2.2px),      /* the lathe's grooves */
    conic-gradient(from -52deg, var(--m-metal-hi), var(--m-metal) 7%, var(--m-metal-lo) 20%, var(--m-metal) 30%, var(--m-metal-lo) 41%,
      color-mix(in srgb, var(--m-metal-hi) 82%, #000) 50%, var(--m-metal) 58%, var(--m-metal-lo) 70%, var(--m-metal) 80%, var(--m-metal-lo) 92%, var(--m-metal-hi));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset, 0 -1px 1px rgba(0, 0, 0, 0.6) inset, 0 0 0 1px rgba(0, 0, 0, 0.7); }
.m-knob--metal .m-knob__dot { background: var(--m-metal-mark); top: 6%; width: max(2px, calc(var(--size) * 0.016)); height: 15%; aspect-ratio: auto; border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45); }

/* ---- Display: a recessed black window ---- */
.m-display { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; min-width: 128px; height: 60px; padding: 0 10px 9px;
  border-radius: var(--m-radius-well); background: linear-gradient(180deg, #040404, #0b0b0b);
  box-shadow: 0 2px 5px rgb(0 0 0 / calc(0.95 * var(--m-shade))) inset, 0 0 0 1px var(--m-edge), 0 1px 0 rgb(255 255 255 / calc(0.08 * var(--m-gloss)));
  font: 400 25px/1 var(--m-font); letter-spacing: -0.02em; color: var(--m-lit); font-variant-numeric: tabular-nums; }
.m-display__label { position: absolute; left: 10px; top: 9px; }
.m-display__unit { padding-bottom: 2px; }
.m-display__label, .m-display__unit { font: 400 var(--m-text-glass)/1 var(--m-font); letter-spacing: 0.1em; text-transform: uppercase; color: var(--m-glass-dim); }
.m-display--text { font-size: 15px; letter-spacing: 0.02em; padding-bottom: 12px; }

/* ---- Key: a low soft key that sinks when pressed. A latching key carries a lamp; a pad lights whole. ---- */
.matte .m-key { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none; min-width: 40px; height: 28px; margin-bottom: 3px; padding: 0 12px;
  border-radius: var(--m-radius-key); color: var(--m-print); background: linear-gradient(180deg, var(--m-cap-hi), var(--m-cap));
  font: 400 var(--m-text-legend)/1 var(--m-font); letter-spacing: 0.1em; text-transform: uppercase; touch-action: manipulation;
  box-shadow: 0 1px 0 var(--m-shine) inset, 0 0 0 1px var(--m-edge), 0 3px 0 var(--m-wall), 0 6px 7px rgb(0 0 0 / calc(0.5 * var(--m-shade)));
  transition: color var(--m-hover), background var(--m-hover), transform var(--m-release) var(--m-ease), box-shadow var(--m-release) var(--m-ease); }
.matte .m-key:hover, .matte .m-key.is-hover { color: var(--m-print-hi); }
.matte .m-key:active, .matte .m-key.is-down { transition-duration: var(--m-press); transform: translateY(2px); box-shadow: 0 1px 0 rgb(255 255 255 / calc(0.08 * var(--m-gloss))) inset, 0 0 0 1px var(--m-edge), 0 1px 0 var(--m-wall), 0 2px 3px rgb(0 0 0 / calc(0.5 * var(--m-shade))); }
.m-key svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.matte .m-key--pad { width: 34px; min-width: 0; height: 34px; padding: 0; }
.matte .m-key--pad[aria-pressed="true"] { background: linear-gradient(180deg, var(--m-pad-on-hi), var(--m-pad-on-lo)); box-shadow: 0 1px 0 rgb(255 255 255 / 0.7) inset, 0 0 0 1px var(--m-edge), 0 3px 0 var(--m-wall), 0 0 12px color-mix(in srgb, var(--m-pad-on-hi) 30%, transparent); }
.matte .m-key--accent { background: linear-gradient(180deg, color-mix(in srgb, var(--m-accent) 92%, #fff), color-mix(in srgb, var(--m-accent) 82%, #000)); color: #17110b; }
.matte .m-key--accent:hover { color: #000; }

/* ---- Push switch: a round latching button in a collar. Up, the cap stands above the body on a visible wall;
        pressed, it stays down inside the collar until it is pressed again. A lamp in the cap is optional. ---- */
.matte .m-push { --rise: 4px; position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%; touch-action: manipulation; background: var(--m-well);
  box-shadow: 0 2px 4px rgb(0 0 0 / calc(0.9 * var(--m-shade))) inset, 0 0 0 1px var(--m-edge) inset, 0 1px 0 rgb(255 255 255 / calc(0.08 * var(--m-gloss))); }
.matte .m-push--sm { --rise: 3px; width: 30px; height: 30px; }
.m-push::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; transform: translateY(calc(var(--rise) * -1));
  background: radial-gradient(circle at 50% 24%, var(--m-cap-hi), var(--m-cap) 72%);
  box-shadow: 0 1px 0 rgb(255 255 255 / calc(0.17 * var(--m-gloss))) inset, 0 0 0 1px var(--m-edge), 0 var(--rise) 0 var(--m-knurl-lo), 0 calc(var(--rise) + 3px) 7px rgb(0 0 0 / calc(0.75 * var(--m-shade)));
  transition: transform var(--m-travel) var(--m-ease-detent), box-shadow var(--m-travel) var(--m-ease), filter var(--m-travel) var(--m-ease); }
.m-push > .m-led { position: absolute; left: 50%; top: 50%; margin: -3px 0 0 -3px; transform: translateY(calc(var(--rise) * -1)); transition: transform var(--m-travel) var(--m-ease-detent), background var(--m-light-off), box-shadow var(--m-light-off); }
.m-push[aria-pressed="true"]::before, .m-push[aria-checked="true"]::before { transform: none; filter: brightness(0.86);       /* down: the wall is gone and the collar shades the cap */
  box-shadow: 0 1px 0 rgb(255 255 255 / calc(0.06 * var(--m-gloss))) inset, 0 4px 5px rgb(0 0 0 / calc(0.6 * var(--m-shade))) inset, 0 0 0 1px var(--m-edge), 0 0 0 transparent, 0 0 0 transparent; }
.m-push[aria-pressed="true"] > .m-led, .m-push[aria-checked="true"] > .m-led { transform: none; }
.m-push:active::before, .m-push:active > .m-led { transform: translateY(1px); transition-duration: var(--m-press); }   /* a finger pushes it just past its resting depth */

/* ---- Fader: a native range input dressed as a slot and a cap with a white line ---- */
.m-fader { appearance: none; -webkit-appearance: none; width: 168px; height: 28px; margin: 0; background: none; cursor: grab; touch-action: none; }
.m-fader::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--m-well); box-shadow: 0 1px 2px rgb(0 0 0 / calc(0.9 * var(--m-shade))) inset, 0 1px 0 rgb(255 255 255 / calc(0.08 * var(--m-gloss))); }
.m-fader::-moz-range-track { height: 6px; border-radius: 3px; background: var(--m-well); box-shadow: 0 1px 2px rgb(0 0 0 / calc(0.9 * var(--m-shade))) inset, 0 1px 0 rgb(255 255 255 / calc(0.08 * var(--m-gloss))); }
.m-fader::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 26px; margin-top: -10px; border-radius: 3px;
  background: linear-gradient(90deg, transparent 43%, var(--m-mark) 43% 57%, transparent 57%), linear-gradient(180deg, var(--m-cap-hi), var(--m-cap));
  box-shadow: 0 1px 0 rgb(255 255 255 / calc(0.16 * var(--m-gloss))) inset, 0 0 0 1px var(--m-edge), 0 4px 6px rgb(0 0 0 / calc(0.7 * var(--m-shade))); }
.m-fader::-moz-range-thumb { width: 16px; height: 26px; border: 0; border-radius: 3px;
  background: linear-gradient(90deg, transparent 43%, var(--m-mark) 43% 57%, transparent 57%), linear-gradient(180deg, var(--m-cap-hi), var(--m-cap));
  box-shadow: 0 1px 0 rgb(255 255 255 / calc(0.16 * var(--m-gloss))) inset, 0 0 0 1px var(--m-edge), 0 4px 6px rgb(0 0 0 / calc(0.7 * var(--m-shade))); }

/* ---- Meter: a row of segments; the last few run in the accent. matte.js fills it from data-segments. ---- */
.m-meter { display: inline-flex; gap: 3px; padding: 5px 6px; border-radius: var(--m-radius-well); background: var(--m-meter);
  box-shadow: 0 2px 4px rgb(0 0 0 / calc(0.9 * var(--m-shade))) inset, 0 0 0 1px var(--m-edge), 0 1px 0 rgb(255 255 255 / calc(0.08 * var(--m-gloss))); }
.m-meter i { width: 4px; height: 14px; border-radius: 1px; background: var(--m-meter-off); transition: background var(--m-press) linear; }
.m-meter i.is-on { background: var(--m-meter-on); }
.m-meter i.is-hot.is-on { background: var(--m-meter-hot); }

/* Meter variations. All take Matte.meter(el, level); the stereo pair takes a second level for its right channel. */
.m-meter--v { flex-direction: column-reverse; padding: 6px 5px; }                       /* a vertical ladder, for a channel strip */
.m-meter--v i { width: 22px; height: 4px; }
.m-meter--dots { gap: 6px; padding: 0; border-radius: 0; background: none; box-shadow: none; }   /* a row of lamps set straight into the body */
.m-meter--dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--m-cap-hi); box-shadow: 0 1px 1px rgb(0 0 0 / calc(0.8 * var(--m-shade))) inset, 0 0 0 1px var(--m-edge); }
.m-meter--dots i.is-on { background: var(--m-lamp); box-shadow: 0 0 0 1px var(--m-edge), 0 0 5px color-mix(in srgb, var(--m-lamp) 55%, transparent); }
.m-meter--dots i.is-hot.is-on { background: var(--m-lamp-hot); box-shadow: 0 0 0 1px var(--m-edge), 0 0 5px color-mix(in srgb, var(--m-lamp-hot) 75%, transparent); }
.m-meter--stereo { display: inline-grid; gap: 4px; padding: 7px 8px 7px 7px; }          /* left and right, each holding its last peak for a moment */
.m-meter__row { display: flex; align-items: center; gap: 3px; }
.m-meter__row b { width: 9px; font: 400 8px/1 var(--m-font); color: var(--m-meter-dim); }
.m-meter--stereo i { height: 8px; }
.m-meter i.is-peak { background: var(--m-meter-on); }
.m-meter i.is-hot.is-peak { background: var(--m-meter-hot); }
.m-meter--needle { display: block; width: 152px; padding: 0; overflow: hidden; }        /* a moving-coil needle behind glass */
.m-meter--needle svg { display: block; width: 100%; height: auto; }
.m-meter__scale { fill: none; stroke: var(--m-meter-dim); stroke-width: 0.8; }
.m-meter__scale--hot { stroke: var(--m-meter-hot); stroke-width: 1.6; }
.m-meter--needle text { fill: var(--m-meter-dim); font: 400 6px var(--m-font); letter-spacing: 0.08em; text-anchor: middle; }
.m-meter__needle { stroke: var(--m-meter-on); stroke-width: 1; stroke-linecap: round; transform-box: view-box; transform-origin: 60px 86px; transition: transform var(--m-travel) var(--m-ease-detent); }
.m-meter--needle.m-meter--lamp { background: linear-gradient(180deg, #f1ead9, #d9cfb8); box-shadow: 0 2px 5px rgb(0 0 0 / calc(0.45 * var(--m-shade))) inset, 0 0 0 1px var(--m-edge), 0 0 14px rgba(241, 234, 217, 0.12); }   /* the same needle with the lamp on */
.m-meter--lamp .m-meter__scale { stroke: #2a2620; }
.m-meter--lamp .m-meter__scale--hot { stroke: #b23a1e; }
.m-meter--lamp text { fill: #2a2620; }
.m-meter--lamp .m-meter__needle { stroke: #17140f; }

/* =====================================================================================================
   Entry: text goes into a well cut in the body.
   ===================================================================================================== */
.m-field { display: grid; gap: 8px; justify-items: start; min-width: 0; }                /* legend, control, then help or an error */
.m-field__help, .m-field__error { font: 400 var(--m-text-help)/1.4 var(--m-font-text); color: var(--m-print-dim); }
.m-field__error { display: flex; align-items: center; gap: 7px; color: var(--m-danger); }
.m-field__error .m-led { background: var(--m-danger); box-shadow: 0 0 0 1px var(--m-edge), 0 0 5px color-mix(in srgb, var(--m-danger) 70%, transparent); }
.m-input { box-sizing: border-box; width: 220px; height: 36px; margin: 0; padding: 0 11px; border: 0; border-radius: var(--m-radius-well);
  background: var(--m-well); box-shadow: var(--m-well-shadow); color: var(--m-ink); caret-color: var(--m-signal);
  font: 400 13px/1 var(--m-font); letter-spacing: 0.01em; }
.m-input:focus-visible { outline-offset: 2px; }
.m-input::placeholder { color: var(--m-print-dim); opacity: 0.85; }
textarea.m-input { height: auto; min-height: 84px; padding: 10px 11px; line-height: 1.5; resize: vertical; }
.m-input:disabled { opacity: 0.45; cursor: not-allowed; }
.m-input[readonly] { background: none; box-shadow: 0 0 0 1px var(--m-edge) inset; }      /* read-only: printed on the body, not cut into it */
.m-input[aria-invalid="true"] { box-shadow: var(--m-well-shadow), 0 0 0 2px var(--m-danger); }
select.m-input { appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer; color: var(--m-ink);
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-size: 5px 5px; background-repeat: no-repeat; background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; }
.m-number { display: inline-flex; align-items: center; gap: 8px; }
.m-number .m-input { width: 84px; text-align: right; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.m-number .m-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.matte .m-number .m-key { min-width: 30px; padding: 0; font-size: 13px; }
.m-search { position: relative; display: inline-flex; }
.m-search > svg { position: absolute; left: 10px; top: 11px; width: 14px; height: 14px; fill: none; stroke: var(--m-print-dim); stroke-width: 1.5; stroke-linecap: round; pointer-events: none; }
.m-search .m-input { padding-left: 32px; }
.m-search .m-input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* =====================================================================================================
   Selection
   ===================================================================================================== */
/* Tick box and radio dot: native inputs dressed as a small well with a lamp in it */
.m-check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font: 400 var(--m-text-small)/1.3 var(--m-font-text); color: var(--m-print); }
.m-check input { appearance: none; -webkit-appearance: none; flex: none; display: grid; place-items: center; width: 18px; height: 18px; margin: 0; border-radius: 4px; cursor: pointer;
  background: var(--m-well); box-shadow: var(--m-well-shadow); }
.m-check input[type="radio"] { border-radius: 50%; }
.m-check input::after { content: ""; width: 8px; height: 8px; border-radius: 2px; background: transparent; transition: background var(--m-hover), box-shadow var(--m-hover); }
.m-check input[type="radio"]::after { border-radius: 50%; }
.m-check input:checked::after { background: var(--m-signal); box-shadow: 0 0 5px color-mix(in srgb, var(--m-signal) 70%, transparent); }
.m-check input:indeterminate::after { height: 2px; background: var(--m-signal); }
.m-check:has(input:disabled) { opacity: 0.45; cursor: not-allowed; }

/* Bank: interlocked push switches. Pressing one releases the others. <div class="m-bank" role="radiogroup"> */
.m-bank { display: flex; gap: 20px; }
.m-bank__item { display: grid; gap: 10px; justify-items: center; }

/* Segmented control: joined keys in one slot; the chosen key stands up. role="radiogroup" with role="radio" buttons */
.m-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: calc(var(--m-radius-key) + 3px); background: var(--m-well); box-shadow: var(--m-well-shadow); }
.matte .m-seg button { height: 26px; padding: 0 12px; border-radius: var(--m-radius-key); color: var(--m-print-dim);
  font: 400 var(--m-text-legend)/1 var(--m-font); letter-spacing: 0.1em; text-transform: uppercase; transition: color var(--m-hover), background var(--m-hover), box-shadow var(--m-hover); }
.matte .m-seg button:hover { color: var(--m-print-hi); }
.matte .m-seg button[aria-checked="true"] { color: var(--m-print-hi); background: linear-gradient(180deg, var(--m-cap-hi), var(--m-cap));
  box-shadow: 0 1px 0 var(--m-shine) inset, 0 0 0 1px var(--m-edge), 0 2px 3px rgb(0 0 0 / calc(0.5 * var(--m-shade))); }

/* Rotary select: a knob that clicks between named positions, with the choice shown on a display beside it.
   <div class="m-knob" data-options="Phono|CD|Tuner" data-for="id-of-the-read-out"> */
.m-rotary { display: flex; align-items: center; gap: 14px; }

/* =====================================================================================================
   Actions: the key in its ranks. One primary per panel; quiet for the least important.
   ===================================================================================================== */
.matte .m-key--lg { height: 36px; padding: 0 18px; font-size: 11px; }
.matte .m-key--primary { background: linear-gradient(180deg, var(--m-primary-hi), var(--m-primary-lo)); color: var(--m-primary-fg); }
.matte .m-key--primary:hover { color: var(--m-primary-fg); filter: brightness(1.06); }
.matte .m-key--danger { background: linear-gradient(180deg, color-mix(in srgb, var(--m-danger) 92%, #fff), color-mix(in srgb, var(--m-danger) 80%, #000)); color: #fff; }
.matte .m-key--quiet { margin-bottom: 0; background: none; box-shadow: none; }
.matte .m-key--quiet:hover { background: color-mix(in srgb, var(--m-print) 12%, transparent); }
.matte .m-key--quiet:active { transform: none; box-shadow: none; background: color-mix(in srgb, var(--m-print) 20%, transparent); }
.matte .m-key:disabled, .matte .m-key[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }
.m-link { color: var(--m-print-hi); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--m-signal); transition: color var(--m-hover); }
.m-link:hover { color: var(--m-signal); }

/* =====================================================================================================
   Navigation and overlays
   ===================================================================================================== */
/* Tabs: printed legends over a row of lamps; the lit one is the page in view */
.m-tabs { display: flex; gap: 2px; }
.matte .m-tabs [role="tab"] { position: relative; padding: 10px 12px 13px; color: var(--m-print-dim); font: 400 var(--m-text-legend)/1 var(--m-font); letter-spacing: 0.1em; text-transform: uppercase; transition: color var(--m-hover); }
.matte .m-tabs [role="tab"]:hover { color: var(--m-print-hi); }
.m-tabs [role="tab"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px; border-radius: 1px; background: var(--m-well); transition: background var(--m-hover), box-shadow var(--m-hover); }
.matte .m-tabs [role="tab"][aria-selected="true"] { color: var(--m-print-hi); }
.m-tabs [role="tab"][aria-selected="true"]::after { background: var(--m-signal); box-shadow: 0 0 5px color-mix(in srgb, var(--m-signal) 70%, transparent); }

/* Popover: a small module that opens from its trigger. <div class="m-pop m-panel" popover id>, opened by popovertarget */
.m-pop { position: fixed; inset: auto; margin: 0; padding: 0; border: 0; overflow: visible; color: inherit; }
.m-pop:not(:popover-open) { display: none; }
.m-pop:popover-open { opacity: 1; transform: none; transition: opacity var(--m-enter) var(--m-ease), transform var(--m-enter) var(--m-ease); }
@starting-style { .m-pop:popover-open { opacity: 0; transform: translateY(-4px); } }
/* Menu: a popover holding a list of actions */
.m-menu { flex-direction: column; gap: 1px; min-width: 190px; padding: 5px; }
.matte .m-menu__item { display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box; padding: 9px 10px; border-radius: 4px; text-align: left; text-decoration: none;
  color: var(--m-print); font: 400 var(--m-text-legend)/1 var(--m-font); letter-spacing: 0.1em; text-transform: uppercase; }
.matte .m-menu__item:hover, .matte .m-menu__item:focus-visible { background: color-mix(in srgb, var(--m-print) 12%, transparent); color: var(--m-print-hi); }
.m-menu__item > :last-child:not(:first-child) { margin-left: auto; color: var(--m-print-dim); }
.m-menu > .m-seam { width: auto; height: 2px; margin: 4px 0; background: linear-gradient(180deg, var(--m-well) 50%, rgb(255 255 255 / calc(0.055 * var(--m-gloss))) 50%); }

/* Tooltip: a strip of label tape. Add data-tip="…" to any control; matte.js shows it after a short rest */
.m-tip { position: fixed; z-index: var(--m-layer-tip); left: 0; top: 0; padding: 6px 8px; border-radius: 3px; pointer-events: none; white-space: nowrap;
  background: var(--m-glass); color: var(--m-lit); font: 400 var(--m-text-legend)/1 var(--m-font); letter-spacing: 0.1em; text-transform: uppercase;
  box-shadow: 0 0 0 1px var(--m-edge), 0 6px 12px rgb(0 0 0 / calc(0.5 * var(--m-shade)));
  opacity: 0; transition: opacity var(--m-press) linear; }
.m-tip.is-on { opacity: 1; transition-duration: var(--m-hover); }

/* Dialog and drawer: native <dialog> as a module above the bench. Open with data-dialog="id"; close with data-close */
dialog.m-dialog { position: fixed; margin: auto; padding: 0; border: 0; flex-direction: column; width: min(420px, calc(100vw - 32px)); color: inherit; overflow: visible; }
dialog.m-dialog:not([open]) { display: none; }
dialog.m-dialog::backdrop { background: rgb(0 0 0 / 0.6); }
dialog.m-dialog[open] { opacity: 1; transform: none; transition: opacity var(--m-enter-lg) var(--m-ease), transform var(--m-enter-lg) var(--m-ease); }
@starting-style { dialog.m-dialog[open] { opacity: 0; transform: scale(0.96); } }
dialog.m-drawer { margin: 0 0 0 auto; width: min(360px, 100vw); height: 100dvh; max-height: none; border-radius: var(--m-radius) 0 0 var(--m-radius); }
@starting-style { dialog.m-drawer[open] { opacity: 1; transform: translateX(100%); } }
.m-title { margin: 0; font: 600 16px/1.2 var(--font-display, var(--m-font-text)); letter-spacing: -0.005em; color: var(--m-print-hi); }
.m-prose { margin: 0; font: 400 var(--m-text-body)/1.5 var(--m-font-text); color: var(--m-print); text-wrap: pretty; }
.m-cell--end { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }

/* =====================================================================================================
   Feedback
   ===================================================================================================== */
/* Banner: a strip with a status lamp. Inline message: the same lamp and text with no body. */
.m-banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; --m-status: var(--m-info); }
.m-banner .m-prose { flex: 1; font-size: 13px; }
.m-note { display: inline-flex; align-items: center; gap: 8px; font: 400 var(--m-text-small)/1.4 var(--m-font-text); color: var(--m-print); --m-status: var(--m-info); }
.m-banner > .m-led, .m-note > .m-led { background: var(--m-status); box-shadow: 0 0 0 1px var(--m-edge), 0 0 5px color-mix(in srgb, var(--m-status) 70%, transparent); }
.m-status--ok { --m-status: var(--m-ok); }
.m-status--warn { --m-status: var(--m-warn); }
.m-status--danger { --m-status: var(--m-danger); }

/* Toast: a line on a strip of glass at the foot of the screen. Matte.toast("…") */
.m-toasts { position: fixed; z-index: var(--m-layer-toast); left: 50%; bottom: 24px; translate: -50% 0; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.m-toast { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--m-radius-well); background: var(--m-glass); color: var(--m-lit);
  font: 400 12px/1 var(--m-font); letter-spacing: 0.04em; box-shadow: 0 0 0 1px var(--m-edge), 0 12px 24px rgb(0 0 0 / calc(0.5 * var(--m-shade)));
  animation: m-toast-in var(--m-enter) var(--m-ease); }
.m-toast.is-leaving { opacity: 0; transform: translateY(8px); transition: opacity var(--m-exit) var(--m-ease-exit), transform var(--m-exit) var(--m-ease-exit); }
@keyframes m-toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Progress: a native <progress> as a bar of light behind glass */
progress.m-progress { appearance: none; -webkit-appearance: none; display: block; width: 200px; height: 10px; border: 0; border-radius: 5px; overflow: hidden;
  background: var(--m-meter); box-shadow: 0 0 0 1px var(--m-edge), 0 1px 0 rgb(255 255 255 / calc(0.08 * var(--m-gloss))); }
progress.m-progress::-webkit-progress-bar { background: var(--m-meter); }
progress.m-progress::-webkit-progress-value { background: var(--m-meter-on); transition: width var(--m-travel) linear; }
progress.m-progress::-moz-progress-bar { background: var(--m-meter-on); }

/* Loading: a lamp that blinks while work is under way, and a placeholder that breathes where content will land */
.m-led--busy { animation: m-blink 1s steps(1, end) infinite; }
@keyframes m-blink { 0%, 49% { background: var(--m-signal); box-shadow: 0 0 0 1px var(--m-edge), 0 0 5px color-mix(in srgb, var(--m-signal) 75%, transparent); } 50%, 100% { background: var(--m-cap-hi); } }
.m-skeleton { display: block; height: 10px; border-radius: 3px; background: color-mix(in srgb, var(--m-print) 16%, transparent); animation: m-breathe 1.4s ease-in-out infinite alternate; }
@keyframes m-breathe { to { opacity: 0.4; } }

/* Empty state */
.m-empty { display: grid; justify-items: center; gap: 14px; padding: 28px 32px; text-align: center; }
.m-empty .m-prose { max-width: 30ch; font-size: 13px; }

/* =====================================================================================================
   Data
   ===================================================================================================== */
/* Tag: a strip of embossed label tape. The printed form is an outline on the body. Badge: a count. */
.m-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 3px; background: var(--m-glass); color: var(--m-lit);
  font: 400 var(--m-text-legend)/1 var(--m-font); letter-spacing: 0.1em; text-transform: uppercase; box-shadow: 0 0 0 1px var(--m-edge), 0 1px 0 rgb(255 255 255 / calc(0.08 * var(--m-gloss))); }
.m-tag--print { background: none; color: var(--m-print); box-shadow: 0 0 0 1px color-mix(in srgb, var(--m-print) 45%, transparent) inset; }
.m-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; box-sizing: border-box; padding: 0 5px; border-radius: 9px; background: var(--m-accent); color: #17110b;
  font: 400 var(--m-text-legend)/1 var(--m-font); font-variant-numeric: tabular-nums; }

/* Table and list: rows ruled with the same seam that divides a panel */
.m-table { border-collapse: collapse; width: 100%; font: 400 12px/1 var(--m-font); color: var(--m-print); }
.m-table th { padding: 13px 16px 11px; text-align: left; font: 400 var(--m-text-legend)/1 var(--m-font); letter-spacing: 0.1em; text-transform: uppercase; color: var(--m-print-dim); }
.m-table td { padding: 11px 16px; border-top: 1px solid var(--m-well); box-shadow: 0 1px 0 rgb(255 255 255 / calc(0.05 * var(--m-gloss))) inset; }
.m-table .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--m-print-hi); }
.m-table tbody tr:hover td { background: color-mix(in srgb, var(--m-print) 6%, transparent); }
.m-list { list-style: none; margin: 0; padding: 0; min-width: 240px; }
.m-list li { display: flex; align-items: center; gap: 10px; padding: 11px 16px; font: 400 var(--m-text-small)/1.3 var(--m-font-text); color: var(--m-print); }
.m-list li + li { border-top: 1px solid var(--m-well); box-shadow: 0 1px 0 rgb(255 255 255 / calc(0.05 * var(--m-gloss))) inset; }
.m-list li > :last-child:not(:first-child) { margin-left: auto; font: 400 11px/1 var(--m-font); color: var(--m-print-dim); }

@media (prefers-reduced-motion: reduce) {
  .matte { --m-press: 0ms; --m-release: 0ms; --m-travel: 0ms; --m-travel-lg: 0ms; --m-exit: 0ms; --m-light-off: var(--dur-2, 110ms); }
  .m-pop:popover-open, dialog.m-dialog[open] { transition-property: opacity; }      /* overlays fade and do not move */
  .m-toast { animation-name: m-fade-in; }
  .m-toast.is-leaving { transform: none; }
  .m-led--busy, .m-skeleton { animation: none; }
  .m-led--busy { background: var(--m-signal); }
}
@keyframes m-fade-in { from { opacity: 0; } }
