/* =========================================================================
   rowen.work motion editor: design system layer.

   Follows the root DESIGN.md (the shop system): a near-black canvas, flat
   charcoal surfaces with 1px hairlines, off-white ink, one hot pink used
   only for signals (focus, playhead, active and selected states, markers,
   record). No glows, gradients, lifts, card shadows, pulsing dots or
   uppercase mono labels. Space Grotesk 500 for headings, buttons and panel
   titles; Inter for everything else; JetBrains Mono only for numbers.
   One white pill on the page: Export.

   Everything is scoped under .mx (the app root, and the floating-layer root
   ui/dom.js adds to <body>), so this file never styles the rest of the site.
   Fonts come from /assets/css/fonts.css (self-hosted, OFL).
   ========================================================================= */

/* ------------------------------------------------------------------ tokens */

.mx{
  /* DESIGN.md colours (same names as styles.css) */
  --black:#08080a;
  --black-2:#0e0e11;
  --card:#111114;
  --card-2:#16161a;
  --surface-hover:#131316;
  --line:rgba(255,255,255,.09);
  --line-strong:rgba(255,255,255,.18);
  --white:#f4f4f2;
  --ink-pressed:#d9d9d6;
  --dim:#9a9aa0;
  --dimmer:#7a7a82;
  --accent:#ff2b83;
  --accent-dim:rgba(255,43,131,.35);
  --accent-wash:rgba(255,43,131,.08);
  --accent-soft:rgba(255,43,131,.12);
  --good:#3ddc84;            /* only "free and immediate" */
  --bad:#ff6161;
  --warn:#f5b454;            /* editor addition: warnings (unconfigured providers, clipping) */
  --scrim:rgba(6,6,7,.72);
  --scrim-strong:rgba(6,6,7,.9);
  --float-shadow:0 16px 40px rgba(0,0,0,.45); /* floating menus, popovers, dialogs only */
  --ease:cubic-bezier(.22,1,.36,1);
  --radius:14px;

  /* type */
  --font-head:'Space Grotesk',system-ui,sans-serif;
  --font-ui:'Inter',system-ui,-apple-system,'Segoe UI',sans-serif;
  --font-mono:'JetBrains Mono',ui-monospace,'Cascadia Mono',Consolas,monospace;

  /* editor surfaces and states */
  --mx-stage:#0b0b0d;        /* neutral background around the project canvas */
  --mx-lane:#0d0d10;         /* timeline lanes */
  --mx-field:var(--black);   /* recessed field well on panel surfaces */
  --mx-hover:rgba(255,255,255,.06);
  --mx-press:rgba(255,255,255,.1);
  --mx-selected:rgba(255,255,255,.1);

  /* track and clip colours, by track role (muted; fills at low alpha, a stronger top bar) */
  --trk-video:#5b7cfa;
  --trk-overlay:#8b7cf6;
  --trk-text:#e8e8e6;
  --trk-captions:#c9c9c4;
  --trk-music:#4fb6c9;
  --trk-sfx:#e0a14b;
  --trk-voice:#e07a9b;
  --trk-ambience:#7f9c8a;

  /* shell geometry (the shell may override these on .mx-app) */
  --mx-top-h:48px;
  --mx-rail-w:56px;
  --mx-panel-w:300px;
  --mx-inspector-w:300px;
  --mx-timeline-h:300px;
  --mx-ctl-h:28px;

  /* stacking, inside the floating layer root */
  --z-panel:20;
  --z-menu:40;
  --z-modal:50;
  --z-toast:60;
  --z-tip:70;

  color-scheme:dark;
  font-family:var(--font-ui);
  font-size:13px;
  line-height:1.4;
  color:var(--white);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  -webkit-tap-highlight-color:transparent;
}

/* --------------------------------------------------------------- base reset */

.mx *,.mx *::before,.mx *::after{box-sizing:border-box;}
.mx :where(h1,h2,h3,h4,h5,h6,p,figure,blockquote,dl,dd,ul,ol,fieldset){margin:0;}
.mx :where(ul,ol){padding:0;list-style:none;}
.mx :where(fieldset){padding:0;border:0;min-width:0;}
.mx :where(h1,h2,h3,h4,h5,h6){font-family:var(--font-head);font-weight:500;letter-spacing:-.02em;line-height:1.2;}
.mx :where(button,input,select,textarea){font:inherit;color:inherit;letter-spacing:inherit;margin:0;}
.mx :where(button){background:none;border:0;padding:0;cursor:pointer;text-align:inherit;}
.mx :where(button:disabled){cursor:not-allowed;}
.mx :where(a){color:inherit;text-decoration-color:var(--line-strong);text-underline-offset:3px;}
.mx :where(a:hover){text-decoration-color:currentColor;}
.mx :where(img,video,canvas){display:block;max-width:100%;}
.mx :where(svg){display:block;flex:0 0 auto;}
.mx [hidden]{display:none !important;}
.mx ::selection{background:var(--accent-dim);color:var(--white);}

body.mx{margin:0;min-height:100dvh;background:var(--black);overscroll-behavior:none;}

/* Focus: 2px pink ring at a 3px offset (DESIGN.md). Fields switch their
   border to pink instead; dense lists use a background plus an inset ring. */
.mx :focus{outline:none;}
.mx :focus-visible{outline:2px solid var(--accent);outline-offset:3px;}

/* Scrollbars: thin and quiet. */
.mx,.mx *{scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.16) transparent;}
.mx ::-webkit-scrollbar{width:10px;height:10px;}
.mx ::-webkit-scrollbar-track{background:transparent;}
.mx ::-webkit-scrollbar-thumb{background:rgba(255,255,255,.14);border-radius:10px;border:3px solid transparent;background-clip:padding-box;}
.mx ::-webkit-scrollbar-thumb:hover{background-color:rgba(255,255,255,.24);}
.mx ::-webkit-scrollbar-corner{background:transparent;}

/* Helpers */
.mx-sr{position:absolute !important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0;}
.mx-mono{font-family:var(--font-mono);font-variant-numeric:tabular-nums;}
.mx-dim{color:var(--dim);}
.mx-dimmer{color:var(--dimmer);}
.mx-icon{flex:0 0 auto;}
html.mx-scrubbing,html.mx-scrubbing *{cursor:ew-resize !important;user-select:none !important;}

/* The floating-layer root (menus, tooltips, toasts, dialogs, sheets). A
   zero-size fixed box, so it adds nothing to the page's layout. */
.mx-layers{position:fixed;top:0;left:0;width:0;height:0;z-index:1000;}

/* ---------------------------------------------------------------- the shell */

/* Desktop: top bar / rail + panel + stage + inspector / timeline dock.
   Close the side columns with data-panel="closed" / data-inspector="closed".
   Tablet (<= 1180px): the inspector is a drawer, shown with data-inspector="open".
   Phone (< 760px): top bar, preview, horizontal tool strip (the rail),
   timeline; the panel and the inspector open as bottom sheets (sheet.js). */
.mx-app{
  position:relative;display:grid;width:100%;height:100dvh;overflow:hidden;background:var(--black);
  grid-template-columns:var(--mx-rail-w) var(--mx-panel-w) minmax(0,1fr) var(--mx-inspector-w);
  grid-template-rows:var(--mx-top-h) minmax(0,1fr) var(--mx-timeline-h);
  grid-template-areas:"top top top top" "rail panel stage inspector" "dock dock dock dock";
  user-select:none;-webkit-user-select:none;
}
.mx-app :where(input,textarea,[contenteditable="true"],.mx-selectable){user-select:text;-webkit-user-select:text;}
.mx-app[data-panel="closed"]{--mx-panel-w:0px;}
.mx-app[data-panel="closed"] > .mx-panel{display:none;}
.mx-app[data-inspector="closed"]{--mx-inspector-w:0px;}
.mx-app[data-inspector="closed"] > .mx-inspector{display:none;}

.mx-topbar{
  grid-area:top;display:flex;align-items:center;gap:6px;min-width:0;padding:0 10px 0 12px;
  background:var(--black);border-bottom:1px solid var(--line);
}
.mx-topbar-group{display:flex;align-items:center;gap:2px;min-width:0;}
.mx-topbar-spacer{flex:1 1 auto;min-width:8px;}
.mx-topbar-title{font-family:var(--font-head);font-weight:500;font-size:13.5px;letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.mx-status{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--dimmer);white-space:nowrap;}

.mx-rail{
  grid-area:rail;display:flex;flex-direction:column;align-items:center;gap:2px;padding:8px 0;min-height:0;
  background:var(--black);border-right:1px solid var(--line);overflow-y:auto;overflow-x:hidden;
}
.mx-rail-btn{
  position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;
  width:48px;min-height:50px;padding:6px 0 5px;border-radius:10px;color:var(--dim);
  font-size:10.5px;line-height:1.1;text-align:center;transition:color .15s,background-color .15s;
}
.mx-rail-btn:hover{color:var(--white);background:var(--mx-hover);}
.mx-rail-btn:is([aria-selected="true"],[aria-pressed="true"],[aria-current="true"]){color:var(--white);background:rgba(255,255,255,.07);}
.mx-rail-btn:is([aria-selected="true"],[aria-pressed="true"],[aria-current="true"])::before{
  content:'';position:absolute;left:-4px;top:13px;bottom:13px;width:2px;border-radius:2px;background:var(--accent);
}
.mx-rail-btn:focus-visible{outline-offset:-2px;}
.mx-rail-sep{width:24px;height:1px;margin:6px 0;background:var(--line);flex:0 0 auto;}

.mx-panel,.mx-inspector{
  display:flex;flex-direction:column;min-width:0;min-height:0;background:var(--black-2);overflow:hidden;
}
.mx-panel{grid-area:panel;border-right:1px solid var(--line);}
.mx-inspector{grid-area:inspector;border-left:1px solid var(--line);}
.mx-panel-head{
  display:flex;align-items:center;justify-content:space-between;gap:8px;flex:0 0 auto;
  height:42px;padding:0 8px 0 14px;border-bottom:1px solid var(--line);
}
.mx-panel-title{font-family:var(--font-head);font-weight:500;font-size:13.5px;letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.mx-panel-body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;}

.mx-stage{
  grid-area:stage;position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;
  background:var(--mx-stage);overflow:hidden;
}
.mx-stage-bar{display:flex;align-items:center;gap:4px;height:40px;padding:0 10px;flex:0 0 auto;}

.mx-dock{
  grid-area:dock;position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;
  background:var(--black-2);border-top:1px solid var(--line);
}
.mx-dock-bar{display:flex;align-items:center;gap:4px;height:38px;padding:0 8px;flex:0 0 auto;border-bottom:1px solid var(--line);}

/* Drag handles between regions (the shell moves them). */
.mx-resizer{position:absolute;z-index:5;touch-action:none;}
.mx-resizer.is-row{left:0;right:0;top:-4px;height:8px;cursor:row-resize;}
.mx-resizer.is-col{top:0;bottom:0;width:8px;cursor:col-resize;}
.mx-resizer.is-col.is-start{left:-4px;}
.mx-resizer.is-col.is-end{right:-4px;}
.mx-resizer::after{content:'';position:absolute;background:transparent;transition:background-color .15s;}
.mx-resizer.is-row::after{left:0;right:0;top:3px;height:2px;}
.mx-resizer.is-col::after{top:0;bottom:0;left:3px;width:2px;}
.mx-resizer:hover::after,.mx-resizer.is-dragging::after{background:var(--accent-dim);}
.mx-resizer:focus-visible{outline:none;}
.mx-resizer:focus-visible::after{background:var(--accent);}

/* A shell inside a box (dev gallery, previews) instead of the full viewport. */
.mx-app.is-contained{height:560px;border:1px solid var(--line);border-radius:var(--radius);}

@media (max-width:1180px){
  .mx-app{
    grid-template-columns:var(--mx-rail-w) var(--mx-panel-w) minmax(0,1fr);
    grid-template-areas:"top top top" "rail panel stage" "dock dock dock";
  }
  .mx-app > .mx-inspector{
    position:absolute;z-index:var(--z-panel);top:var(--mx-top-h);right:0;bottom:var(--mx-timeline-h);
    width:min(var(--mx-inspector-w),86vw);box-shadow:var(--float-shadow);border-left:1px solid var(--line-strong);
    transform:translateX(102%);visibility:hidden;transition:transform .3s var(--ease),visibility 0s .3s;
  }
  .mx-app[data-inspector="open"] > .mx-inspector{display:flex;transform:none;visibility:visible;transition:transform .3s var(--ease);}
  .mx-app[data-inspector="closed"] > .mx-inspector{display:flex;}
}
@media (max-width:759px){
  .mx-app{
    --mx-top-h:44px;--mx-timeline-h:min(38dvh,300px);
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:var(--mx-top-h) minmax(0,1fr) auto var(--mx-timeline-h);
    grid-template-areas:"top" "stage" "rail" "dock";
  }
  .mx-app > .mx-panel,.mx-app > .mx-inspector{display:none !important;}
  .mx-topbar{padding:0 6px 0 10px;gap:4px;}
  .mx-rail{
    flex-direction:row;justify-content:flex-start;gap:2px;padding:4px 8px;overflow-x:auto;overflow-y:hidden;
    border-right:0;border-top:1px solid var(--line);scrollbar-width:none;
  }
  .mx-rail::-webkit-scrollbar{display:none;}
  .mx-rail-btn{width:auto;min-width:62px;min-height:52px;padding:6px 8px 5px;flex:0 0 auto;font-size:11px;}
  .mx-rail-btn:is([aria-selected="true"],[aria-pressed="true"],[aria-current="true"])::before{left:18px;right:18px;top:auto;bottom:-3px;width:auto;height:2px;}
  .mx-rail-sep{width:1px;height:28px;margin:0 4px;align-self:center;}
  .mx-dock{padding-bottom:env(safe-area-inset-bottom);}
  .mx-app.is-contained{height:640px;}
}

/* ------------------------------------------------------------------ buttons */

/* Pill buttons. Outline pills fill white from the bottom on hover (the
   site's .btn); the primary pill is solid white and is used once (Export). */
.mx-btn{
  position:relative;isolation:isolate;overflow:hidden;
  display:inline-flex;align-items:center;justify-content:center;gap:7px;flex:0 0 auto;
  height:32px;padding:0 15px;border-radius:100px;border:1px solid var(--line-strong);
  background:transparent;color:var(--white);white-space:nowrap;
  font-family:var(--font-head);font-weight:500;font-size:13px;letter-spacing:.01em;line-height:1;
  transition:border-color .3s var(--ease),color .35s var(--ease),background-color .2s,transform .15s var(--ease);
}
.mx-btn::before{
  content:'';position:absolute;inset:0;z-index:-1;background:var(--white);
  transform:translateY(101%);transition:transform .4s var(--ease);
}
.mx-btn:hover{color:var(--black);border-color:var(--white);}
.mx-btn:hover::before{transform:translateY(0);}
.mx-btn:active{transform:translateY(1px);}
.mx-btn-icon{display:inline-flex;}
.mx-btn-label{overflow:hidden;text-overflow:ellipsis;}
.mx-btn.is-sm{height:28px;padding:0 12px;font-size:12.5px;gap:6px;}
.mx-btn.is-full{width:100%;}
.mx-btn.is-primary{background:var(--white);color:var(--black);border-color:var(--white);}
.mx-btn.is-primary::before{background:var(--ink-pressed);}
.mx-btn.is-ghost{border-color:var(--line);}
.mx-btn.is-quiet{border-color:transparent;padding:0 10px;}
.mx-btn.is-quiet::before{display:none;}
.mx-btn.is-quiet:hover{color:var(--white);border-color:transparent;background:var(--mx-hover);}
.mx-btn.is-quiet:active{background:var(--mx-press);}
.mx-btn.is-danger{color:var(--bad);border-color:rgba(255,97,97,.42);}
.mx-btn.is-danger::before{background:var(--bad);}
.mx-btn.is-danger:hover{color:var(--black);border-color:var(--bad);}
.mx-btn:is(:disabled,.is-disabled){opacity:.5;cursor:not-allowed;transform:none;}
.mx-btn:is(:disabled,.is-disabled)::before{transform:translateY(101%);}
.mx-btn:is(:disabled,.is-disabled):hover{color:var(--white);border-color:var(--line-strong);}
.mx-btn.is-primary:is(:disabled,.is-disabled):hover{color:var(--black);border-color:var(--white);}
.mx-btn.is-quiet:is(:disabled,.is-disabled):hover{background:transparent;border-color:transparent;}
.mx-btn.is-danger:is(:disabled,.is-disabled):hover{color:var(--bad);border-color:rgba(255,97,97,.42);}
.mx-btn.is-busy{cursor:progress;}
.mx-btn.is-busy::after{
  content:'';width:12px;height:12px;border-radius:50%;flex:0 0 auto;
  border:1.5px solid currentColor;border-top-color:transparent;animation:mx-spin .7s linear infinite;
}
.mx-btn.is-busy .mx-btn-icon{display:none;}

/* Icon buttons: 28 / 30 / 34px, 40px and up on touch. Pressed toggles
   (snap, loop, mute) use the pink signal. */
.mx-ibtn{
  display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;
  width:30px;height:30px;border-radius:8px;border:1px solid transparent;color:var(--dim);background:transparent;
  transition:color .15s,background-color .15s,border-color .15s;
}
.mx-ibtn:hover{color:var(--white);background:var(--mx-hover);}
.mx-ibtn:active{background:var(--mx-press);}
.mx-ibtn.is-sm{width:28px;height:28px;border-radius:7px;}
.mx-ibtn.is-lg{width:34px;height:34px;border-radius:10px;}
.mx-ibtn.is-outline{border-color:var(--line);}
.mx-ibtn.is-outline:hover{border-color:var(--line-strong);}
.mx-ibtn.is-solid{background:var(--white);color:var(--black);border-radius:50%;}
.mx-ibtn.is-solid:hover{background:var(--ink-pressed);color:var(--black);}
.mx-ibtn.is-round{border-radius:50%;}
.mx-ibtn[aria-pressed="true"]{color:var(--accent);background:var(--accent-soft);}
.mx-ibtn[aria-pressed="true"]:hover{background:rgba(255,43,131,.18);}
.mx-ibtn[aria-expanded="true"]{color:var(--white);background:var(--mx-press);}
.mx-ibtn:is(:disabled,.is-disabled){opacity:.38;cursor:not-allowed;}
.mx-ibtn:is(:disabled,.is-disabled):hover{color:var(--dim);background:transparent;}
.mx-ibtn:focus-visible{outline-offset:1px;}

.mx-toolbar{display:flex;align-items:center;gap:2px;min-width:0;}
.mx-divider{flex:0 0 auto;width:1px;align-self:stretch;margin:7px 5px;background:var(--line);}
.mx-divider.is-h{width:auto;height:1px;margin:6px 0;align-self:auto;}

/* --------------------------------------------------------------- segmented */

.mx-seg{
  display:inline-flex;align-items:stretch;gap:2px;padding:2px;max-width:100%;min-width:0;
  background:var(--mx-field);border:1px solid var(--line);border-radius:9px;
  overflow-x:auto;scrollbar-width:none;
}
.mx-seg::-webkit-scrollbar{display:none;}
/* Real radios kept in the flow at zero size, each before its label, so an
   assistive "activate" lands on the option intended. */
.mx-seg-input{
  -webkit-appearance:none;appearance:none;flex:0 0 0;width:0;height:0;margin:0 -2px 0 0;
  padding:0;border:0;opacity:0;pointer-events:none;
}
.mx-seg-opt{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;flex:0 0 auto;
  height:22px;padding:0 10px;border-radius:7px;color:var(--dim);font-size:12.5px;white-space:nowrap;
  cursor:pointer;user-select:none;transition:color .15s,background-color .15s;
}
.mx-seg-opt:hover{color:var(--white);}
.mx-seg-input:checked + .mx-seg-opt{color:var(--white);background:var(--mx-selected);font-weight:500;}
.mx-seg-input:focus-visible + .mx-seg-opt{outline:2px solid var(--accent);outline-offset:1px;}
.mx-seg-input:disabled + .mx-seg-opt{opacity:.4;cursor:not-allowed;}
.mx-seg.is-sm .mx-seg-opt{height:20px;padding:0 8px;font-size:12px;}
.mx-seg.is-icons .mx-seg-opt{width:28px;padding:0;}
.mx-seg.is-fill{display:flex;width:100%;}
.mx-seg.is-fill .mx-seg-opt{flex:1 1 0;min-width:0;}

/* ------------------------------------------------------------------ fields */

.mx-input{
  width:100%;min-width:0;height:var(--mx-ctl-h);padding:0 9px;
  background:var(--mx-field);border:1px solid var(--line);border-radius:8px;color:var(--white);
  font-size:12.5px;transition:border-color .15s,background-color .15s;
}
.mx-input::placeholder{color:var(--dimmer);}
.mx-input:hover{border-color:var(--line-strong);}
.mx-input:focus,.mx-input:focus-visible{outline:none;border-color:var(--accent);background:var(--surface-hover);}
.mx-input:disabled{opacity:.5;cursor:not-allowed;}
.mx-input[aria-invalid="true"]{border-color:var(--bad);}
.mx-input.is-sm{height:24px;font-size:12px;padding:0 7px;}
.mx-input.is-mono{font-family:var(--font-mono);font-size:12px;}
.mx-textarea{height:auto;min-height:64px;padding:7px 9px;resize:vertical;line-height:1.45;}

/* Number field: mono value, drag left/right on it (or on its label) to
   scrub, click to type, arrow keys to step. */
.mx-num{
  position:relative;display:flex;align-items:center;min-width:44px;height:var(--mx-ctl-h);container-type:inline-size;
  background:var(--mx-field);border:1px solid var(--line);border-radius:8px;cursor:ew-resize;
  transition:border-color .15s,background-color .15s;
}
.mx-num:hover{border-color:var(--line-strong);}
.mx-num:focus-within{border-color:var(--accent);background:var(--surface-hover);cursor:auto;}
.mx-num.is-scrubbing{border-color:var(--line-strong);background:var(--surface-hover);}
.mx-num.is-invalid{border-color:var(--bad);}
.mx-num.is-disabled{opacity:.5;cursor:not-allowed;}
.mx-num-label{
  flex:0 0 auto;padding-left:7px;font-size:11.5px;color:var(--dimmer);user-select:none;touch-action:none;cursor:ew-resize;
}
.mx-num:hover .mx-num-label{color:var(--dim);}
.mx-num-input{
  flex:1 1 auto;width:100%;min-width:0;height:100%;padding:0 6px;background:transparent;border:0;
  color:var(--white);font-family:var(--font-mono);font-size:12px;text-align:right;font-variant-numeric:tabular-nums;cursor:inherit;
}
.mx-num-input:focus,.mx-num-input:focus-visible{outline:none;cursor:text;}
.mx-num-input::placeholder{color:var(--dimmer);font-family:var(--font-ui);font-size:12px;}
.mx-num-input:disabled{cursor:not-allowed;}
.mx-num-unit{flex:0 0 auto;margin-left:-3px;padding-right:7px;font-family:var(--font-mono);font-size:11px;color:var(--dimmer);user-select:none;}
/* A number field is a size container: narrow fields drop the unit, then the label, so the value always fits
   (the unit stays in aria-valuetext). Give it a width from its row, pair or the width option. */
@container (max-width:78px){ .mx-num-unit{display:none;} .mx-num-input{padding-right:7px;} }
@container (max-width:50px){ .mx-num-label{display:none;} }

.mx-select{position:relative;display:flex;align-items:center;min-width:0;}
.mx-select-input{
  -webkit-appearance:none;appearance:none;width:100%;min-width:0;height:var(--mx-ctl-h);padding:0 28px 0 9px;
  background:var(--mx-field);border:1px solid var(--line);border-radius:8px;color:var(--white);
  font-size:12.5px;text-overflow:ellipsis;cursor:pointer;transition:border-color .15s;
}
.mx-select-input:hover{border-color:var(--line-strong);}
.mx-select-input:focus,.mx-select-input:focus-visible{outline:none;border-color:var(--accent);}
.mx-select-input:disabled{opacity:.5;cursor:not-allowed;}
.mx-select-input :where(option,optgroup){background:var(--black-2);color:var(--white);}
.mx-select-chev{position:absolute;right:8px;display:flex;color:var(--dim);pointer-events:none;}
.mx-select.is-sm .mx-select-input{height:24px;font-size:12px;}

/* Slider: hairline track, white thumb, mono readout. */
.mx-slider{display:flex;align-items:center;gap:10px;flex:1 1 auto;min-width:0;}
.mx-range{
  -webkit-appearance:none;appearance:none;flex:1 1 auto;min-width:0;height:18px;margin:0;
  background:transparent;cursor:pointer;
}
.mx-range::-webkit-slider-runnable-track{
  height:3px;border-radius:100px;
  background:linear-gradient(to right,rgba(244,244,242,.72) 0 var(--mx-fill,0%),rgba(255,255,255,.14) var(--mx-fill,0%) 100%);
}
.mx-range::-webkit-slider-thumb{
  -webkit-appearance:none;appearance:none;width:14px;height:14px;margin-top:-5.5px;border:0;border-radius:50%;
  background:var(--white);box-shadow:0 1px 4px rgba(0,0,0,.55);transition:transform .15s var(--ease);
}
.mx-range:active::-webkit-slider-thumb{transform:scale(1.12);}
.mx-range::-moz-range-track{height:3px;border-radius:100px;background:rgba(255,255,255,.14);}
.mx-range::-moz-range-progress{height:3px;border-radius:100px;background:rgba(244,244,242,.72);}
.mx-range::-moz-range-thumb{width:14px;height:14px;border:0;border-radius:50%;background:var(--white);}
.mx-range:focus{outline:none;}
.mx-range:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:6px;}
.mx-range:disabled{opacity:.45;cursor:not-allowed;}
.mx-slider-out{flex:0 0 auto;min-width:42px;text-align:right;font-family:var(--font-mono);font-size:11.5px;color:var(--dim);font-variant-numeric:tabular-nums;}

/* Switch: white when on (pink only for the signal variant: record, live). */
.mx-switch{display:inline-flex;align-items:center;gap:8px;flex:0 0 auto;padding:3px 0;border-radius:100px;color:var(--white);font-size:12.5px;}
.mx-switch-track{
  position:relative;flex:0 0 auto;width:30px;height:18px;border-radius:100px;
  background:rgba(255,255,255,.16);transition:background-color .2s var(--ease);
}
.mx-switch-thumb{
  position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:50%;background:var(--white);
  transition:transform .2s var(--ease),background-color .2s var(--ease);
}
.mx-switch:hover .mx-switch-track{background:rgba(255,255,255,.22);}
.mx-switch[aria-checked="true"] .mx-switch-track{background:var(--white);}
.mx-switch[aria-checked="true"] .mx-switch-thumb{transform:translateX(12px);background:var(--black);}
.mx-switch.is-signal[aria-checked="true"] .mx-switch-track{background:var(--accent);}
.mx-switch.is-signal[aria-checked="true"] .mx-switch-thumb{background:var(--white);}
.mx-switch:disabled{opacity:.45;}
.mx-switch:focus-visible{outline-offset:2px;}
.mx-switch-label{line-height:1.2;}

/* Colour field: swatch (opens the native picker) + mono hex + optional swatches. */
.mx-color{display:flex;align-items:center;gap:6px;min-width:0;}
.mx-color-chip{
  position:relative;flex:0 0 auto;width:var(--mx-ctl-h);height:var(--mx-ctl-h);border-radius:8px;overflow:hidden;
  background:var(--c,#000);box-shadow:inset 0 0 0 1px rgba(255,255,255,.16);
}
.mx-color-native{position:absolute;inset:0;width:100%;height:100%;padding:0;border:0;opacity:0;pointer-events:none;}
.mx-color-open{position:absolute;inset:0;width:100%;height:100%;border-radius:inherit;cursor:pointer;}
.mx-color-open:focus-visible{outline:none;}
.mx-color-chip:has(.mx-color-open:focus-visible){outline:2px solid var(--accent);outline-offset:2px;}
.mx-color-hex{
  flex:1 1 auto;width:84px;min-width:0;height:var(--mx-ctl-h);padding:0 8px;
  background:var(--mx-field);border:1px solid var(--line);border-radius:8px;color:var(--white);
  font-family:var(--font-mono);font-size:12px;transition:border-color .15s;
}
.mx-color-hex:hover{border-color:var(--line-strong);}
.mx-color-hex:focus,.mx-color-hex:focus-visible{outline:none;border-color:var(--accent);background:var(--surface-hover);}
.mx-color.is-invalid .mx-color-hex{border-color:var(--bad);}
.mx-color-more{flex:0 0 auto;}

.mx-swatches{display:grid;grid-template-columns:repeat(var(--mx-cols,8),22px);gap:6px;padding:10px;}
.mx-swatch{
  position:relative;width:22px;height:22px;border-radius:6px;background:var(--c);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.14);transition:box-shadow .15s;
}
.mx-swatch:hover{box-shadow:inset 0 0 0 1px rgba(255,255,255,.4);}
.mx-swatch[aria-checked="true"]{box-shadow:0 0 0 2px var(--black-2),0 0 0 3.5px var(--white);}
.mx-swatch:focus-visible{outline-offset:4px;}

/* ------------------------------------------------------------------- tabs */

.mx-tabs{display:flex;flex-direction:column;min-width:0;min-height:0;}
.mx-tablist{display:flex;align-items:stretch;gap:2px;padding:0 8px;border-bottom:1px solid var(--line);overflow-x:auto;scrollbar-width:none;flex:0 0 auto;}
.mx-tablist::-webkit-scrollbar{display:none;}
.mx-tab{
  position:relative;display:inline-flex;align-items:center;gap:6px;flex:0 0 auto;height:38px;padding:0 10px;
  color:var(--dim);font-size:12.5px;font-weight:500;white-space:nowrap;transition:color .15s;
}
.mx-tab:hover{color:var(--white);}
.mx-tab[aria-selected="true"]{color:var(--white);}
.mx-tab[aria-selected="true"]::after{content:'';position:absolute;left:10px;right:10px;bottom:-1px;height:2px;border-radius:2px;background:var(--accent);}
.mx-tab:disabled{opacity:.4;}
.mx-tab:focus-visible{outline-offset:-5px;border-radius:9px;}
.mx-tabs.is-pill .mx-tablist{padding:0;gap:4px;border:0;}
.mx-tabs.is-pill .mx-tab{height:28px;padding:0 12px;border-radius:100px;}
.mx-tabs.is-pill .mx-tab[aria-selected="true"]{background:var(--mx-selected);}
.mx-tabs.is-pill .mx-tab[aria-selected="true"]::after{display:none;}
.mx-tabs.is-pill .mx-tab:focus-visible{outline-offset:1px;border-radius:100px;}
.mx-tabs.is-vertical{flex-direction:row;}
.mx-tabs.is-vertical .mx-tablist{flex-direction:column;border-bottom:0;border-right:1px solid var(--line);padding:6px 0;}
.mx-tabpanels{flex:1 1 auto;min-height:0;overflow:auto;}
.mx-tabpanel:focus-visible{outline-offset:-2px;}

/* ------------------------------------------------------- sections and rows */

.mx-section{border-bottom:1px solid var(--line);}
.mx-section-head{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:40px;padding:0 8px 0 14px;}
.mx-section-title{display:flex;align-items:center;min-width:0;font-family:var(--font-head);font-weight:500;font-size:13px;letter-spacing:-.005em;line-height:1.2;color:var(--white);}
.mx-section-title-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.mx-section-toggle{display:flex;align-items:center;gap:5px;min-width:0;margin-left:-7px;padding:5px 7px 5px 5px;border-radius:7px;font:inherit;color:inherit;letter-spacing:inherit;}
.mx-section-toggle:hover .mx-section-chev{color:var(--white);}
.mx-section-toggle:focus-visible{outline-offset:0;}
.mx-section-chev{display:inline-flex;color:var(--dimmer);transition:transform .2s var(--ease),color .15s;}
.mx-section[data-open="true"] .mx-section-chev{transform:rotate(90deg);}
.mx-section-actions{display:flex;align-items:center;gap:0;margin-right:-2px;}
.mx-section-body{display:flex;flex-direction:column;gap:6px;padding:0 14px 14px;}
.mx-section.is-flush .mx-section-body{padding:0;}

/* Property row: label left (dim), control right, keyframe slot at the end. */
.mx-prop{
  display:grid;align-items:center;column-gap:8px;min-height:30px;
  grid-template-columns:var(--mx-prop-label,72px) minmax(0,1fr) var(--mx-prop-kf,22px);
}
.mx-prop:has(> .mx-prop-kf > .mx-kf-wrap.has-nav){--mx-prop-kf:50px;}
.mx-prop-label{font-size:12px;color:var(--dim);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;user-select:none;}
.mx-prop-control{display:flex;align-items:center;gap:6px;min-width:0;}
.mx-prop-control > *{flex:1 1 auto;min-width:0;}
.mx-prop-control > :is(.mx-switch,.mx-ibtn,.mx-btn,.mx-kbds,.mx-chip,.mx-toolbar,.mx-seg:not(.is-fill)){flex:0 0 auto;}
.mx-prop-kf{display:flex;align-items:center;justify-content:flex-end;min-width:0;}
.mx-prop-hint{grid-column:2 / 4;padding-top:3px;font-size:11.5px;line-height:1.4;color:var(--dimmer);}
.mx-prop.is-stacked{grid-template-columns:minmax(0,1fr) var(--mx-prop-kf,22px);row-gap:6px;}
.mx-prop.is-stacked > .mx-prop-label{grid-column:1;grid-row:1;}
.mx-prop.is-stacked > .mx-prop-kf{grid-column:2;grid-row:1;}
.mx-prop.is-stacked > .mx-prop-control{grid-column:1 / 3;grid-row:2;}
.mx-prop.is-stacked > .mx-prop-hint{grid-column:1 / 3;}
.mx-pair{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:6px;min-width:0;}

/* Keyframe toggle: dim outline (not animated), white outline (animated,
   playhead between keys), pink filled (playhead on a key). */
.mx-kf-wrap{display:inline-flex;align-items:center;}
.mx-kf{
  display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:22px;height:22px;border-radius:6px;
  color:var(--dimmer);transition:color .15s,background-color .15s;
}
.mx-kf:hover{color:var(--white);background:var(--mx-hover);}
.mx-kf:focus-visible{outline-offset:0;}
.mx-kf > .mx-icon[data-icon="keyframe-filled"]{display:none;}
.mx-kf[data-state="animated"]{color:var(--white);}
.mx-kf[data-state="key"]{color:var(--accent);}
.mx-kf[data-state="key"] > .mx-icon[data-icon="keyframe"]{display:none;}
.mx-kf[data-state="key"] > .mx-icon[data-icon="keyframe-filled"]{display:block;}
.mx-ibtn.mx-kf-step{width:14px;height:22px;border-radius:4px;color:var(--dimmer);}
.mx-ibtn.mx-kf-step:hover{color:var(--white);}
.mx-ibtn.mx-kf-step > svg{width:12px;height:12px;}

/* ------------------------------------------------------------ menus, tips */

.mx-menu{
  position:fixed;z-index:var(--z-menu);min-width:208px;max-width:min(340px,calc(100vw - 16px));max-height:calc(100dvh - 16px);
  overflow-y:auto;padding:4px;background:var(--black-2);border:1px solid var(--line-strong);border-radius:10px;
  box-shadow:var(--float-shadow);opacity:0;transform:translateY(-3px);
  transition:opacity .12s var(--ease),transform .14s var(--ease);
}
.mx-menu[data-side="top"]{transform:translateY(3px);}
.mx-menu.is-open{opacity:1;transform:none;}
.mx-menu-item{
  display:flex;align-items:center;gap:8px;min-height:28px;padding:0 8px 0 6px;border-radius:6px;
  color:var(--white);font-size:13px;line-height:1.25;cursor:default;user-select:none;
}
.mx-menu-item:focus,.mx-menu-item[aria-expanded="true"]{background:rgba(255,255,255,.08);}
.mx-menu-item:focus-visible{outline:none;box-shadow:inset 0 0 0 1px var(--accent);}
.mx-menu-check{display:flex;align-items:center;justify-content:center;flex:0 0 14px;width:14px;color:var(--white);}
.mx-menu-icon{display:flex;color:var(--dim);}
.mx-menu-label{flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.mx-menu-hint{flex:0 0 auto;font-size:12px;color:var(--dimmer);}
.mx-menu-keys{display:flex;align-items:center;gap:3px;margin-left:14px;flex:0 0 auto;}
.mx-menu-keys .mx-kbd{min-width:0;height:auto;padding:0;border:0;color:var(--dimmer);font-size:11.5px;}
.mx-menu-sub{display:flex;color:var(--dimmer);margin-right:-3px;}
.mx-menu-item[aria-disabled="true"]{color:var(--dimmer);}
.mx-menu-item[aria-disabled="true"] .mx-menu-icon{opacity:.6;}
.mx-menu-item.is-danger,.mx-menu-item.is-danger .mx-menu-icon{color:var(--bad);}
.mx-menu-sep{height:1px;margin:4px 6px;background:var(--line);}
.mx-menu-heading{padding:7px 8px 3px 28px;font-size:11.5px;font-weight:500;color:var(--dimmer);}
.mx-menu-empty{padding:8px 10px;font-size:12.5px;color:var(--dimmer);}

.mx-popover{
  position:fixed;z-index:var(--z-menu);background:var(--black-2);border:1px solid var(--line-strong);border-radius:12px;
  box-shadow:var(--float-shadow);opacity:0;transition:opacity .12s var(--ease);
}
.mx-popover.is-open{opacity:1;}

.mx-tip{
  position:fixed;z-index:var(--z-tip);display:flex;align-items:center;gap:8px;max-width:260px;padding:5px 8px;
  background:var(--card-2);border:1px solid var(--line-strong);border-radius:7px;box-shadow:var(--float-shadow);
  color:var(--white);font-size:12px;line-height:1.35;pointer-events:none;opacity:0;transition:opacity .12s var(--ease);
}
.mx-tip.is-shown{opacity:1;}
.mx-tip-keys{display:inline-flex;gap:3px;}
.mx-tip .mx-kbd{height:17px;min-width:17px;font-size:10px;}

.mx-kbds{display:inline-flex;align-items:center;gap:3px;}
.mx-kbd{
  display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;
  border:1px solid var(--line-strong);border-radius:5px;background:transparent;color:var(--dim);
  font-family:var(--font-mono);font-size:10.5px;font-weight:400;line-height:1;white-space:nowrap;
}

/* ------------------------------------------------------------------ toasts */

.mx-toasts{
  position:fixed;z-index:var(--z-toast);left:50%;bottom:calc(var(--mx-toast-offset,24px) + env(safe-area-inset-bottom));
  transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;gap:8px;
  width:max-content;max-width:calc(100vw - 32px);pointer-events:none;
}
.mx-toast{
  display:flex;align-items:center;gap:8px;min-height:40px;max-width:min(460px,calc(100vw - 32px));padding:0 18px;
  background:var(--white);color:var(--black);border-radius:100px;box-shadow:var(--float-shadow);pointer-events:auto;
  font-family:var(--font-head);font-weight:500;font-size:13.5px;line-height:1.3;
  opacity:0;transform:translateY(12px);transition:opacity .3s var(--ease),transform .4s var(--ease);
}
.mx-toast:has(button){padding-right:6px;}
.mx-toast.is-shown{opacity:1;transform:none;}
.mx-toast.is-leaving{opacity:0;transform:translateY(6px);}
.mx-toast-text{padding:10px 0;overflow-wrap:anywhere;user-select:text;}
.mx-toast-icon{display:flex;}
.mx-toast-action{
  flex:0 0 auto;height:28px;padding:0 12px;border-radius:100px;background:rgba(8,8,10,.08);color:var(--black);
  font:inherit;font-size:13px;transition:background-color .15s;
}
.mx-toast-action:hover{background:rgba(8,8,10,.15);}
.mx-toast-close{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;color:rgba(8,8,10,.62);}
.mx-toast-close:hover{color:var(--black);background:rgba(8,8,10,.08);}
.mx-toast :focus-visible{outline-offset:2px;}
/* Errors turn red; the text stays near-black so it passes contrast on the red. */
.mx-toast.is-error{background:var(--bad);color:var(--black);}

/* ------------------------------------------------------------ dialog, sheet */

.mx-modal{position:fixed;inset:0;z-index:var(--z-modal);display:flex;align-items:center;justify-content:center;padding:24px;}
.mx-scrim{
  position:absolute;inset:0;background:var(--scrim);
  -webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);opacity:0;transition:opacity .25s var(--ease);
}
.mx-modal.is-open .mx-scrim,.mx-sheet-layer.is-open .mx-scrim{opacity:1;}
.mx-modal.is-closing .mx-scrim,.mx-sheet-layer.is-closing .mx-scrim{opacity:0;}
.mx-dialog{
  position:relative;display:flex;flex-direction:column;width:min(540px,100%);max-height:min(88dvh,100%);
  background:var(--card);border:1px solid var(--line);border-radius:18px;box-shadow:var(--float-shadow);
  opacity:0;transform:scale(.96);transition:opacity .25s var(--ease),transform .3s var(--ease);
}
.mx-modal.is-open .mx-dialog{opacity:1;transform:none;}
.mx-modal.is-closing .mx-dialog{opacity:0;transform:scale(.98);}
.mx-dialog.is-narrow{width:min(420px,100%);}
.mx-dialog.is-wide{width:min(880px,100%);}
.mx-dialog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:18px 14px 4px 22px;}
.mx-dialog-title{padding-top:5px;font-family:var(--font-head);font-weight:500;font-size:17px;letter-spacing:-.02em;line-height:1.25;text-wrap:balance;}
.mx-dialog-body{display:flex;flex-direction:column;gap:14px;min-height:0;padding:6px 22px 20px;overflow-y:auto;user-select:text;}
.mx-dialog-desc{font-size:13px;line-height:1.55;color:var(--dim);text-wrap:pretty;}
.mx-dialog-error{font-size:12.5px;line-height:1.45;color:var(--bad);}
.mx-dialog-foot{display:flex;justify-content:flex-end;gap:8px;padding:14px 22px 18px;border-top:1px solid var(--line);}
@media (max-width:560px){
  .mx-modal{padding:12px;align-items:flex-end;}
  .mx-dialog{width:100%;max-height:calc(100dvh - 24px);}
  .mx-dialog-foot{flex-direction:column-reverse;}
  .mx-dialog-foot .mx-btn{width:100%;height:42px;}
}

.mx-sheet-layer{position:fixed;inset:0;z-index:var(--z-modal);display:flex;align-items:flex-end;justify-content:center;pointer-events:none;}
.mx-sheet-layer.is-modal{pointer-events:auto;}
.mx-sheet{
  position:relative;display:flex;flex-direction:column;width:100%;max-width:640px;max-height:90dvh;pointer-events:auto;
  background:var(--card);border:1px solid var(--line);border-bottom:0;border-radius:28px 28px 0 0;
  box-shadow:0 -16px 40px rgba(0,0,0,.45);padding-bottom:env(safe-area-inset-bottom);
  transform:translateY(100%);transition:transform .35s var(--ease),height .3s var(--ease);
}
.mx-sheet-layer.is-open .mx-sheet{transform:none;}
.mx-sheet-layer.is-closing .mx-sheet{transform:translateY(100%);}
.mx-sheet.is-dragging{transition:none;}
.mx-sheet[data-height="half"]{height:55dvh;}
.mx-sheet[data-height="full"]{height:92dvh;}
.mx-sheet-grab{display:flex;justify-content:center;flex:0 0 auto;padding:9px 0 3px;cursor:grab;touch-action:none;}
.mx-sheet-grab span{width:36px;height:4px;border-radius:100px;background:rgba(255,255,255,.22);}
.mx-sheet-head{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:0 0 auto;padding:2px 10px 8px 20px;touch-action:none;}
.mx-sheet-title{font-family:var(--font-head);font-weight:500;font-size:15.5px;letter-spacing:-.01em;}
.mx-sheet-body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding-bottom:12px;}
.mx-sheet-foot{display:flex;gap:8px;flex:0 0 auto;padding:10px 16px 14px;border-top:1px solid var(--line);}

/* ------------------------------------------------- progress, states, misc */

.mx-progress{position:relative;width:100%;height:4px;border-radius:100px;background:rgba(255,255,255,.1);overflow:hidden;}
.mx-progress.is-sm{height:2px;}
.mx-progress-bar{position:absolute;top:0;bottom:0;left:0;width:var(--mx-p,0%);border-radius:inherit;background:var(--white);transition:width .2s linear;}
.mx-progress.is-indeterminate .mx-progress-bar{width:34%;animation:mx-indeterminate 1.3s var(--ease) infinite;}
@keyframes mx-indeterminate{from{transform:translateX(-100%);}to{transform:translateX(300%);}}

.mx-spinner-wrap{display:inline-flex;align-items:center;}
.mx-spinner{width:16px;height:16px;border-radius:50%;border:2px solid rgba(255,255,255,.22);border-top-color:var(--white);animation:mx-spin .7s linear infinite;}
.mx-spinner-wrap.is-sm .mx-spinner{width:12px;height:12px;border-width:1.5px;}
@keyframes mx-spin{to{transform:rotate(360deg);}}

.mx-empty{display:flex;flex-direction:column;align-items:center;gap:6px;padding:28px 20px;text-align:center;color:var(--dim);}
.mx-empty-icon{display:flex;align-items:center;justify-content:center;width:44px;height:44px;margin-bottom:6px;border-radius:50%;border:1px solid var(--line);color:var(--dim);}
.mx-empty-title{font-family:var(--font-head);font-weight:500;font-size:14px;letter-spacing:-.01em;color:var(--white);text-wrap:balance;}
.mx-empty-body{max-width:32ch;font-size:12.5px;line-height:1.5;color:var(--dim);text-wrap:pretty;}
.mx-empty-action{margin-top:8px;}
.mx-empty.is-compact{padding:16px 14px;gap:4px;}
.mx-empty.is-compact .mx-empty-icon{width:34px;height:34px;margin-bottom:4px;}

.mx-note{display:flex;gap:10px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:rgba(255,255,255,.02);font-size:12.5px;line-height:1.5;color:var(--dim);user-select:text;}
.mx-note-icon{display:flex;padding-top:1px;color:var(--dim);}
.mx-note-text{min-width:0;}
.mx-note-title{margin-bottom:2px;font-weight:500;color:var(--white);}
.mx-note-action{margin-top:8px;}
.mx-note.is-warn{border-color:rgba(245,180,84,.28);}
.mx-note.is-warn .mx-note-icon{color:var(--warn);}
.mx-note.is-bad{border-color:rgba(255,97,97,.32);}
.mx-note.is-bad .mx-note-icon{color:var(--bad);}

.mx-chip{display:inline-flex;align-items:center;gap:5px;height:22px;padding:0 9px;border:1px solid var(--line);border-radius:100px;font-size:11.5px;color:var(--dim);white-space:nowrap;}
.mx-chip.is-signal{color:var(--accent);border-color:var(--accent-dim);}
.mx-chip.is-warn{color:var(--warn);border-color:rgba(245,180,84,.36);}
.mx-chip.is-bad{color:var(--bad);border-color:rgba(255,97,97,.36);}

.mx-field{display:flex;flex-direction:column;gap:6px;min-width:0;}
.mx-field-label{font-size:12.5px;font-weight:500;color:var(--white);}
.mx-field-req{margin-left:2px;color:var(--accent);}
.mx-field-hint{font-size:12px;line-height:1.45;color:var(--dimmer);}
.mx-field-error{font-size:12px;line-height:1.45;color:var(--bad);}

/* ------------------------------------------------------------------ touch */

@media (pointer:coarse){
  .mx{--mx-ctl-h:40px;}
  .mx-ibtn{width:40px;height:40px;}
  .mx-ibtn.is-sm{width:40px;height:40px;}
  .mx-ibtn.is-lg{width:44px;height:44px;}
  .mx-btn{height:40px;padding:0 18px;}
  .mx-btn.is-sm{height:36px;}
  .mx-seg-opt,.mx-seg.is-sm .mx-seg-opt{height:34px;padding:0 14px;}
  .mx-seg.is-icons .mx-seg-opt{width:40px;padding:0;}
  /* 16px text so iOS does not zoom into a field */
  .mx-input,.mx-num-input,.mx-select-input,.mx-color-hex{font-size:16px;}
  .mx-num-label{padding-left:10px;font-size:13px;}
  .mx-range{height:36px;}
  .mx-range::-webkit-slider-thumb{width:22px;height:22px;margin-top:-9.5px;}
  .mx-range::-moz-range-thumb{width:22px;height:22px;}
  .mx-switch-track{width:44px;height:26px;}
  .mx-switch-thumb{width:22px;height:22px;}
  .mx-switch[aria-checked="true"] .mx-switch-thumb{transform:translateX(18px);}
  .mx-kf{width:36px;height:36px;}
  .mx-ibtn.mx-kf-step{width:32px;height:36px;}
  .mx-prop{min-height:44px;--mx-prop-kf:36px;}
  .mx-prop:has(> .mx-prop-kf > .mx-kf-wrap.has-nav){--mx-prop-kf:100px;}
  .mx-tab{height:44px;}
  .mx-menu-item{min-height:42px;font-size:14px;}
  .mx-swatches{grid-template-columns:repeat(var(--mx-cols,8),32px);gap:8px;}
  .mx-swatch{width:32px;height:32px;}
}

/* ----------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion:reduce){
  .mx *,.mx *::before,.mx *::after{
    transition-duration:.01ms !important;animation-duration:.01ms !important;animation-iteration-count:1 !important;scroll-behavior:auto !important;
  }
  .mx-progress.is-indeterminate .mx-progress-bar{animation:none !important;width:100%;opacity:.35;}
  .mx-spinner,.mx-btn.is-busy::after{animation:none !important;border-top-color:rgba(255,255,255,.22);border-right-color:var(--white);}
  .mx-btn.is-busy::after{border-color:currentColor;border-top-color:transparent;}
  .mx-dialog,.mx-modal.is-closing .mx-dialog{transform:none;}
}

/* ---------------------------------------------------------- forced colours */

@media (forced-colors:active){
  .mx-switch-track{border:1px solid CanvasText;}
  .mx-switch[aria-checked="true"] .mx-switch-track{background:Highlight;}
  .mx-ibtn[aria-pressed="true"],.mx-seg-input:checked + .mx-seg-opt,.mx-tab[aria-selected="true"]{outline:1px solid Highlight;}
  .mx-kf[data-state="key"]{color:Highlight;}
  .mx-progress-bar{background:Highlight;}
  .mx-menu-item:focus{outline:2px solid Highlight;}
}

/* The rail's tab list (kit.rail) fills the rail in either direction. */
.mx-rail-list{display:flex;flex-direction:column;align-items:center;gap:2px;}
.mx-rail-label{max-width:52px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
@media (max-width:759px){
  .mx-rail-list{flex-direction:row;}
  .mx-rail-label{max-width:none;}
}
