/* The design editor (design/index.html): the PDF editor's workspace
   (editor.css) as an endless canvas of frames, its start screen, and its
   frame, pen and export controls. */

/* ---- Start screen: new designs by size, the ones kept here, opening one. */
.ds-hero { padding-bottom: 1.2rem; }
.ds-start { display: grid; gap: 1.6rem; padding: 1.4rem; }
.ds-start__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem 1.2rem; margin-bottom: 1rem; }
.ds-start__title { margin: 0; font-size: 1.05rem; font-weight: 650; color: var(--g-ink); letter-spacing: .005em; }
.ds-start__title small { margin-left: .45rem; font-size: .8rem; font-weight: 500; color: var(--g-ink-3); }

.ds-custom { display: flex; align-items: center; gap: .45rem; font-size: .84rem; color: var(--g-ink-3); }
.ds-custom label { display: inline-flex; align-items: center; gap: .35rem; }
.ds-custom .pe-num { width: 5rem; text-align: right; }

.ds-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; height: 30px; padding: 0 .8rem; border-radius: 9px;
  border: 1px solid var(--g-rim-soft); background: rgb(255 255 255 / .05); color: var(--g-ink-2);
  font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease);
}
.ds-btn:hover { color: #fff; background: rgb(179 166 255 / .14); border-color: rgb(179 166 255 / .35); }
.ds-btn:focus-visible { outline: 2px solid var(--g-lilac); outline-offset: 2px; }
.ds-btn--primary { color: #fff; border-color: transparent; background: linear-gradient(180deg, #a08fff, #7462e8); box-shadow: 0 6px 16px -8px rgb(116 98 232 / .9); }
.ds-btn--primary:hover { background: linear-gradient(180deg, #b3a6ff, #8473f0); }

.ds-presets { display: grid; gap: 1.1rem; }
.ds-presets__group h3 { margin: 0 0 .5rem; font-size: .7rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--g-ink-3); }
.ds-presets__row { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.6rem, 1fr)); gap: .55rem; }
.ds-preset {
  display: grid; justify-items: start; gap: .15rem; padding: .7rem .75rem .65rem; border-radius: 14px; text-align: left; cursor: pointer;
  border: 1px solid var(--g-rim-soft); background: linear-gradient(180deg, rgb(255 255 255 / .05), rgb(255 255 255 / .02));
  color: var(--g-ink); font: inherit;
  transition: transform 180ms var(--ease), border-color 180ms var(--ease), background 180ms var(--ease);
}
.ds-preset:hover { transform: translateY(-2px); border-color: rgb(179 166 255 / .4); background: linear-gradient(180deg, rgb(179 166 255 / .14), rgb(179 166 255 / .04)); }
.ds-preset:focus-visible { outline: 2px solid var(--g-lilac); outline-offset: 2px; }
.ds-preset__art { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: .35rem; }
.ds-preset__art i { display: block; border-radius: 3px; background: linear-gradient(160deg, #fff, #d9d4ee); box-shadow: 0 0 0 1px rgb(0 0 0 / .3), 0 6px 14px -6px rgb(0 0 0 / .8); }
.ds-preset__name { font-size: .84rem; font-weight: 600; }
.ds-preset small { font-size: .74rem; color: var(--g-ink-3); font-variant-numeric: tabular-nums; }

.ds-recent[hidden] { display: none; }
.ds-recent__list { list-style: none; margin: .9rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .8rem; }
.ds-recent__item { position: relative; }
.ds-recent__open {
  display: grid; gap: .2rem; width: 100%; padding: .55rem .55rem .65rem; border-radius: 16px; text-align: left; cursor: pointer;
  border: 1px solid var(--g-rim-soft); background: rgb(255 255 255 / .03); color: var(--g-ink); font: inherit;
  transition: transform 180ms var(--ease), border-color 180ms var(--ease);
}
.ds-recent__open:hover { transform: translateY(-2px); border-color: rgb(179 166 255 / .4); }
.ds-recent__open:focus-visible { outline: 2px solid var(--g-lilac); outline-offset: 2px; }
.ds-recent__art { display: grid; place-items: center; height: 8.5rem; margin-bottom: .35rem; border-radius: 11px; overflow: hidden; background: radial-gradient(rgb(255 255 255 / .05) 1px, transparent 1.4px) 0 0 / 12px 12px, #15131c; }
.ds-recent__art img { max-width: 92%; max-height: 92%; box-shadow: 0 0 0 1px rgb(0 0 0 / .3), 0 8px 18px -8px rgb(0 0 0 / .9); }
.ds-recent__name { font-size: .88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 .2rem; }
.ds-recent__open small { padding: 0 .2rem; font-size: .74rem; color: var(--g-ink-3); }
.ds-recent__del {
  position: absolute; top: .9rem; right: .9rem; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--g-rim-soft); background: rgb(12 10 18 / .75); color: var(--g-ink-2); opacity: 0; transition: opacity 160ms var(--ease);
}
.ds-recent__del svg { width: 16px; height: 16px; }
.ds-recent__item:hover .ds-recent__del, .ds-recent__del:focus-visible { opacity: 1; }
.ds-recent__del:hover { color: #ffb3a8; border-color: rgb(255 140 120 / .4); }

.ds-open .pe-drop { min-height: 0; }
.ds-open__icon { width: 30px; height: 30px; color: var(--g-lilac); flex: none; }

/* ---- The canvas: frames placed anywhere, each with its name above it. */
[data-mode="design"] .pe-editor.is-app .pe-pages,
[data-mode="design"] .pe-pages { position: relative; display: block; padding: 0; gap: 0; min-width: 0; width: auto; }
[data-mode="design"] .pe-page { position: absolute; }
[data-mode="design"] .pe-scroll { background: radial-gradient(rgb(255 255 255 / .045) 1px, transparent 1.4px) 0 0 / 20px 20px, #16141d; }
/* The canvas itself: everything outside the frames is on it. It lies under
   them, see-through, as big as the canvas. */
[data-mode="design"] .pe-page.is-board, [data-mode="design"] .pe-page.is-board.is-active { z-index: 0; background: transparent !important; box-shadow: none; content-visibility: visible; }
[data-mode="design"] .pe-page.is-board::after { display: none; }
[data-mode="design"] .pe-page:not(.is-board) { z-index: 1; }
[data-mode="design"] .pe-page:not(.is-board).is-active { z-index: 2; }
[data-mode="design"] .pe-page.is-picked { box-shadow: 0 0 0 1px rgb(0 0 0 / .3), 0 18px 40px -18px rgb(0 0 0 / .9); }

.ds-label {
  position: absolute; z-index: 3; transform: translateY(-100%); padding: 0 0 5px; max-width: 200px;
  font-size: 11.5px; line-height: 1.2; font-weight: 500; color: var(--g-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: default; -webkit-user-select: none; user-select: none;
}
.ds-label:hover { color: var(--g-ink); }
.ds-label.is-picked { color: var(--g-lilac); }
.ds-label__input {
  width: 14rem; max-width: 60vw; height: 20px; padding: 0 .3rem; border: 1px solid var(--g-lilac); border-radius: 5px; outline: none;
  background: #1d1a28; color: #fff; font: inherit; font-size: 11.5px;
}

/* The frame selected: an outline, eight handles, and its size beneath. */
.ds-frame-sel { position: absolute; z-index: 4; pointer-events: none; box-shadow: 0 0 0 1.5px var(--g-lilac); }
.ds-frame-sel[hidden] { display: none; }
.ds-frame-sel__h {
  position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 2px; pointer-events: all;
  background: #fff; box-shadow: 0 0 0 1.5px var(--g-lilac), 0 1px 4px rgb(0 0 0 / .5);
}
.ds-frame-sel__h[data-fh="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.ds-frame-sel__h[data-fh="n"] { left: 50%; top: 0; cursor: ns-resize; }
.ds-frame-sel__h[data-fh="ne"] { left: 100%; top: 0; cursor: nesw-resize; }
.ds-frame-sel__h[data-fh="e"] { left: 100%; top: 50%; cursor: ew-resize; }
.ds-frame-sel__h[data-fh="se"] { left: 100%; top: 100%; cursor: nwse-resize; }
.ds-frame-sel__h[data-fh="s"] { left: 50%; top: 100%; cursor: ns-resize; }
.ds-frame-sel__h[data-fh="sw"] { left: 0; top: 100%; cursor: nesw-resize; }
.ds-frame-sel__h[data-fh="w"] { left: 0; top: 50%; cursor: ew-resize; }
.ds-frame-sel__size, .ds-frame-ghost::after {
  position: absolute; left: 50%; top: calc(100% + 8px); transform: translateX(-50%); padding: 2px 6px; border-radius: 5px; white-space: nowrap;
  background: var(--g-lilac); color: #14121c; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.ds-frame-ghost { position: absolute; z-index: 4; pointer-events: none; box-shadow: 0 0 0 1.5px var(--g-lilac); background: rgb(255 255 255 / .9); }
.ds-frame-ghost::after { content: attr(data-size); }
/* Where a frame being moved lines up with another. */
.ds-guides { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.ds-guides i { position: absolute; top: 0; bottom: 0; width: 1px; background: #ff5c8a; }
.ds-guides i.is-across { top: auto; left: 0; right: 0; bottom: auto; width: auto; height: 1px; }

/* Cursors: the hand and Space to move about, a crosshair to draw. */
[data-mode="design"] .pe-scroll[data-tool="hand"], [data-mode="design"] .pe-scroll[data-tool="hand"] *, .pe-scroll.is-panning, .pe-scroll.is-panning * { cursor: grab !important; }
.pe-scroll.is-grabbing, .pe-scroll.is-grabbing * { cursor: grabbing !important; }
[data-mode="design"] .pe-scroll[data-tool="frame"], [data-mode="design"] .pe-scroll[data-tool="frame"] .pe-page { cursor: crosshair; }
.pe-page[data-tool="pen"] { cursor: crosshair; }

/* The pen: the path so far, its points, and the line on to the pointer. */
.ds-pen-path { fill: none; stroke: var(--g-lilac); stroke-width: 1.5; }
.ds-pen-next { fill: none; stroke: var(--g-lilac); stroke-width: 1; stroke-dasharray: 4 3; opacity: .8; }
.ds-pen-arm { stroke: var(--g-lilac); stroke-width: 1; }
.ds-pen-handle { fill: #fff; stroke: var(--g-lilac); stroke-width: 1.2; }
.ds-pen-node { fill: #fff; stroke: var(--g-lilac); stroke-width: 1.5; }
.ds-pen-node.is-last { fill: var(--g-lilac); }
.ds-pen-node.is-closing { fill: var(--g-lilac); stroke: #fff; stroke-width: 2; }

/* ---- The header: the design's name (typed over), and Export. */
.ds-head { z-index: 8; }
.ds-head .pe-head__file { min-width: 0; flex: 1 1 14rem; display: grid; gap: .1rem; }
.pe-head .ds-name {
  width: 100%; max-width: 26rem; height: 28px; min-height: 0; margin-left: -.35rem; padding: 0 .35rem; border: 1px solid transparent; border-radius: 7px; outline: none;
  background: none; box-shadow: none; color: var(--g-ink); font: inherit; font-size: 1rem; font-weight: 600; text-overflow: ellipsis;
}
.pe-head .ds-name:hover { border-color: var(--g-rim-soft); }
.pe-head .ds-name:focus { border-color: var(--g-lilac); background: rgb(0 0 0 / .3); box-shadow: none; }
.ds-head .pe-restart { margin-left: 0; }
.ds-export-wrap { position: relative; }
.ds-export-btn svg { transition: transform var(--dur-3) var(--ease-out); }
.ds-export-btn:hover svg { transform: translateY(-2px); }
.ds-export {
  position: absolute; right: 0; top: calc(100% + 12px); z-index: 30; width: 17rem;
  display: grid; gap: .7rem; padding: .95rem; border-radius: 18px; font-size: .84rem;
}
.ds-export[hidden] { display: none; }
/* (Over a white frame, a see-through panel can't be read.) */
.ds-export, .ds-share { background: linear-gradient(180deg, rgb(36 32 52 / .97), rgb(23 21 33 / .97)); }
.ds-export__label { font-weight: 650; color: var(--g-ink); }
.ds-export__row { display: flex; gap: .5rem; }
.ds-export__field { display: grid; gap: .3rem; flex: 1 1 0; min-width: 0; color: var(--g-ink-3); font-size: .76rem; }
.ds-export__field[hidden] { display: none; }
.ds-export__field .pe-select { min-width: 0; width: 100%; }
.ds-export__row[hidden], .ds-export__web[hidden], .ds-export__progress[hidden] { display: none; }
.ds-export__web { display: grid; gap: .6rem; }
.ds-export__checks { display: flex; flex: 1 1 0; align-items: end; gap: .8rem; padding-bottom: .4rem; color: var(--g-ink-2, #cfc9e6); font-size: .8rem; }
.ds-export__checks label { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; }
.ds-export__checks input { accent-color: var(--g-lilac); }
.ds-export__progress { display: flex; align-items: center; gap: .6rem; }
.ds-export__progress progress { flex: 1 1 auto; height: 8px; accent-color: var(--g-lilac); }
.ds-export__note { margin: 0; color: var(--g-ink-3); font-size: .78rem; line-height: 1.4; }
.ds-export .ds-btn { height: 34px; }

/* ---- The frame panel. */
.pe-body > .pe-props .ds-frame:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr); gap: .7rem; }
.ds-frame label > span, .ds-frame__fill > span, .ds-frame__export > span { color: var(--g-ink-3); font-size: .78rem; }
.ds-frame__name { display: grid; gap: .3rem; }
.pe-body > .pe-props .ds-frame__name .pe-num { width: 100%; }
.ds-frame__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem; }
.ds-frame__grid .pe-chip > span { width: 1.2rem; text-align: center; font-size: .72rem; font-weight: 600; }
.ds-frame__preset { display: grid; gap: .3rem; }
.ds-frame__preset .pe-select { min-width: 0; width: 100%; }
.ds-frame__fill { display: flex; align-items: center; gap: .45rem; }
.ds-frame__fill > span { flex: 1 1 auto; }
.ds-swatch { position: relative; width: 30px; height: 30px; flex: none; cursor: pointer; }
.ds-swatch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.ds-swatch i { display: block; width: 100%; height: 100%; border-radius: 9px; border: 1px solid rgb(255 255 255 / .28); box-shadow: inset 0 0 0 2px rgb(0 0 0 / .35); }
.ds-swatch:focus-within i { box-shadow: inset 0 0 0 2px rgb(0 0 0 / .35), 0 0 0 2px var(--g-lilac); }
.pe-body > .pe-props .ds-hex { width: 5.4rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; text-transform: uppercase; }
.ds-frame__acts { display: flex; gap: .35rem; }
.ds-frame__acts .ds-btn { flex: 1 1 0; }
.ds-frame__export { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; padding-top: .7rem; border-top: 1px solid rgb(255 255 255 / .07); }
.ds-frame__export > span { flex: 1 1 100%; }
.ds-frame__export .ds-btn { flex: 1 1 0; padding: 0 .4rem; }

/* Several frames: lined up, spaced out, duplicated, deleted, exported. */
.pe-body > .pe-props .ds-frames:not([hidden]), .pe-props .ds-frames:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: .55rem; flex: 0 0 auto; }
.ds-frames__label { color: var(--g-ink-3); font-size: .78rem; }
.ds-frames__align { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.ds-frames__align button svg { width: 18px; height: 18px; }
.ds-frames__acts { display: flex; flex-wrap: wrap; gap: .35rem; }
.ds-frames__acts .ds-btn { flex: 1 1 0; }
.ds-frames__gap { flex: 0 0 5.5rem; }
.ds-frames__gap > span { padding: 0 .3rem; font-size: .72rem; }
/* A canvas marquee, over the frames. */
.ds-marquee { position: absolute; z-index: 6; pointer-events: none; border: 1px solid var(--g-lilac); background: rgb(179 166 255 / .1); }
.ds-frame-sel.is-multi { box-shadow: 0 0 0 1px rgb(179 166 255 / .8); }
.ds-frame-sel.is-multi .ds-frame-sel__h { display: none; }
[data-mode="design"] .pe-page.is-frame-picked { box-shadow: 0 0 0 1.5px var(--g-lilac), 0 18px 40px -18px rgb(0 0 0 / .9); }

/* Components: what's selected is (a main, an instance), and the list of
   them to insert from. */
.pe-body > .pe-props .ds-comp:not([hidden]), .pe-props .ds-comp:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr); gap: .45rem; flex: 0 0 auto; }
.ds-comp__kind { display: flex; align-items: center; gap: .4rem; color: #c7b8ff !important; font-size: .8rem; font-weight: 600; }
.ds-comp__kind svg { width: 16px; height: 16px; }
.ds-comp__acts { display: flex; flex-wrap: wrap; gap: .3rem; }
.ds-comp__acts .ds-btn { flex: 1 1 auto; }
.ds-comp__acts .ds-btn[hidden] { display: none; }
.ds-comp__note { margin: 0; font-size: .74rem; line-height: 1.4; color: var(--g-ink-3); }
.ds-comp__note:empty { display: none; }
.pe-body > .pe-props .ds-assets:not([hidden]), .pe-props .ds-assets:not([hidden]) { display: grid; gap: .4rem; flex: 0 0 auto; }
.ds-assets__title { font-size: .78rem; color: var(--g-ink-3); }
.ds-assets__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.ds-assets__list li { display: flex; align-items: center; gap: .4rem; padding: .3rem .3rem .3rem .5rem; border-radius: 9px; background: rgb(255 255 255 / .03); }
.ds-assets__list li > span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; color: var(--g-ink); }
.ds-assets__list .ds-btn { height: 26px; padding: 0 .55rem; font-size: .74rem; }

/* Prototype links: where a click goes, and the arrows to it. */
.pe-body > .pe-props .ds-link:not([hidden]), .pe-props .ds-link:not([hidden]) { display: grid; gap: .45rem; flex: 0 0 auto; }
.ds-link__title { font-size: .78rem; color: var(--g-ink-3); }
.ds-link__row { display: grid; gap: .25rem; }
.ds-link__row > span { font-size: .74rem; color: var(--g-ink-3); }
.ds-link__row[hidden] { display: none; }
.ds-link__row .pe-select { min-width: 0; width: 100%; }
.ds-links { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: visible; }
.ds-links path { fill: none; stroke: #3ecf8e; stroke-width: 2; }
.ds-links circle { fill: #3ecf8e; stroke: #fff; stroke-width: 1.5; }
.ds-links .ds-links__head { fill: #3ecf8e; stroke: none; }

/* Presenting: a frame at a time, as big as fits, its links working. */
.ds-present { position: fixed; inset: 0; z-index: 400; display: grid; grid-template-rows: minmax(0, 1fr) auto; background: #0b0a10; color: #fff; }
.ds-present[hidden] { display: none; }
.ds-present__stage { position: relative; overflow: hidden; }
.ds-present__frame { position: absolute; left: 50%; top: 50%; box-shadow: 0 30px 80px -20px rgb(0 0 0 / .9); }
.ds-present__frame canvas { display: block; width: 100%; height: 100%; }
.ds-present__hot { position: absolute; cursor: pointer; border-radius: 4px; padding: 0; border: 0; background: none; }
.ds-present__hot:focus-visible { outline: 2px solid #3ecf8e; outline-offset: 2px; }
.ds-present.is-hinting .ds-present__hot { background: rgb(62 207 142 / .25); box-shadow: 0 0 0 2px rgb(62 207 142 / .9); transition: background 200ms, box-shadow 200ms; }
.ds-present__bar { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .6rem 1rem .8rem; }
.ds-present__name { min-width: 10rem; text-align: center; font-size: .86rem; color: rgb(255 255 255 / .75); }
.ds-present__btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid rgb(255 255 255 / .12); background: rgb(255 255 255 / .05); color: #fff; cursor: pointer; }
.ds-present__btn:hover { background: rgb(255 255 255 / .12); }
.ds-present__btn svg { width: 18px; height: 18px; }
.ds-present__btn:focus-visible { outline: 2px solid var(--g-lilac); outline-offset: 2px; }

/* The frame tool's sizes. */
.pe-body > .pe-props .ds-newframe:not([hidden]) { display: block; }
.ds-newframe__list { display: grid; gap: .8rem; }
.ds-newframe__group { display: grid; gap: .1rem; }
.ds-newframe__group > span { margin-bottom: .2rem; font-size: .68rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--g-ink-3); }
.ds-newframe__group button {
  display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; width: 100%; padding: .38rem .5rem; border: 0; border-radius: 8px;
  background: none; color: var(--g-ink-2); font: inherit; font-size: .82rem; text-align: left; cursor: pointer;
}
.ds-newframe__group button:hover { background: rgb(179 166 255 / .12); color: #fff; }
.ds-newframe__group button small { color: var(--g-ink-3); font-size: .74rem; font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .ds-start { padding: 1rem; }
  .ds-export { right: auto; left: 0; }
  /* The panel's a strip above the canvas here: the frame's settings under
     its title, X, Y, W and H in a row, and the rest kept short. */
  .pe-props .ds-frame:not([hidden]) { display: grid; flex: 1 1 100%; grid-template-columns: minmax(0, 1fr); gap: .5rem; }
  .ds-frame__name { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
  .ds-frame__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ds-frame__preset { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
  .ds-frame__export { padding-top: .5rem; }
  .ds-frame__export > span { flex: 0 0 auto; margin-right: .3rem; }
  .pe-props .ds-newframe:not([hidden]) { flex: 1 1 100%; max-height: 40vh; overflow-y: auto; }
}

/* ---- Working together: the Share button, who's here, their pointers. */
.ds-share-wrap { position: relative; display: flex; align-items: center; gap: .4rem; }
.ds-share-dot { display: none; width: 7px; height: 7px; border-radius: 50%; background: #7ee08a; box-shadow: 0 0 0 3px rgb(126 224 138 / .18); }
.ds-share-wrap.is-live .ds-share-dot { display: inline-block; }
.ds-share-wrap.is-live .ds-share-btn svg { display: none; }
.ds-share-wrap[data-status="connecting"] .ds-share-dot, .ds-share-wrap[data-status="offline"] .ds-share-dot { background: #ffb054; box-shadow: 0 0 0 3px rgb(255 176 84 / .18); animation: ds-blink 1.2s ease-in-out infinite; }
@keyframes ds-blink { 50% { opacity: .35; } }
.ds-share {
  position: absolute; right: 0; top: calc(100% + 12px); z-index: 30; width: 19rem;
  display: grid; gap: .7rem; padding: .95rem; border-radius: 18px; font-size: .84rem;
}
.ds-share[hidden] { display: none; }
.ds-share .ds-btn { height: 34px; }
.ds-share .ds-btn[hidden] { display: none; }
.ds-share .ds-btn:disabled { opacity: .45; cursor: not-allowed; }
.ds-share__name { width: 100%; text-align: left; }
.ds-share__link { display: flex; gap: .4rem; }
.ds-share__link[hidden] { display: none; }
.ds-share__link input { flex: 1 1 auto; min-width: 0; text-align: left; font-size: .76rem; }
.ds-share__link .ds-btn { flex: 0 0 auto; height: auto; }
.ds-share__status { margin: 0; color: var(--g-ink-2); font-size: .78rem; }
.ds-share__status:empty { display: none; }
.ds-people { display: flex; flex-direction: row-reverse; }
.ds-people:empty { display: none; }
.ds-person {
  width: 26px; height: 26px; margin-left: -6px; padding: 0; border: 2px solid #15131d; border-radius: 50%;
  background: var(--peer); color: #15131d; font: inherit; font-size: .72rem; font-weight: 750; cursor: pointer;
  transition: transform var(--dur-2, .15s) var(--ease-out, ease-out);
}
.ds-person:hover { transform: translateY(-2px); z-index: 1; }
.ds-person:focus-visible { outline: 2px solid var(--g-lilac); outline-offset: 2px; }
.pe-msg.is-info { color: var(--g-ink-2); }

.ds-peers { position: absolute; inset: 0; z-index: 6; pointer-events: none; overflow: visible; }
.ds-peer__sel { position: absolute; border: 1.5px solid var(--peer); border-radius: 2px; box-shadow: 0 0 0 1px rgb(0 0 0 / .15); }
.ds-peer__sel[hidden], .ds-peer__cursor[hidden] { display: none; }
.ds-peer__cursor { position: absolute; left: 0; top: 0; transition: transform 90ms linear; will-change: transform; }
.ds-peer__cursor svg { display: block; width: 18px; height: 20px; margin: -2px 0 0 -2px; fill: var(--peer); stroke: #fff; stroke-width: 1.4; stroke-linejoin: round; filter: drop-shadow(0 1px 2px rgb(0 0 0 / .35)); }
.ds-peer__cursor span {
  position: absolute; left: 14px; top: 16px; padding: .12rem .45rem; border-radius: 6px; white-space: nowrap;
  background: var(--peer); color: #15131d; font-size: .7rem; font-weight: 650; box-shadow: 0 2px 6px rgb(0 0 0 / .3);
}
@media (prefers-reduced-motion: reduce) { .ds-peer__cursor { transition: none; } }
@media (max-width: 900px) {
  .ds-share-wrap { position: static; }
  .ds-share { left: 12px; right: 12px; top: calc(100% + 8px); width: auto; }
}

/* ---- Effects: shadows and blurs. */
.pe-body > .pe-props .ds-fx:not([hidden]), .pe-props .ds-fx:not([hidden]) { display: grid; gap: .45rem; flex: 0 0 auto; }
.ds-fx__head { display: flex; align-items: center; justify-content: space-between; font-size: .78rem; color: var(--g-ink-3); }
.ds-fx__add-wrap { position: relative; }
.ds-fx__add, .ds-fx__eye, .ds-fx__del {
  display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 7px;
  background: none; color: var(--g-ink-2); cursor: pointer;
}
.ds-fx__add:hover, .ds-fx__eye:hover, .ds-fx__del:hover { background: rgb(179 166 255 / .14); color: #fff; }
.ds-fx__add:focus-visible, .ds-fx__eye:focus-visible, .ds-fx__del:focus-visible { outline: 2px solid var(--g-lilac); outline-offset: 1px; }
.ds-fx__add svg, .ds-fx__eye svg, .ds-fx__del svg { width: 17px; height: 17px; }
.ds-fx__menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; display: grid; min-width: 11rem; padding: .35rem; border-radius: 12px;
  background: linear-gradient(180deg, rgb(36 32 52 / .98), rgb(23 21 33 / .98));
}
.ds-fx__menu[hidden] { display: none; }
.ds-fx__menu button { padding: .45rem .6rem; border: 0; border-radius: 8px; background: none; color: var(--g-ink-2); font: inherit; font-size: .82rem; text-align: left; cursor: pointer; }
.ds-fx__menu button:hover, .ds-fx__menu button:focus-visible { background: rgb(179 166 255 / .14); color: #fff; outline: none; }
.ds-fx__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.ds-fx__row { display: grid; gap: .35rem; padding: .45rem; border: 1px solid rgb(255 255 255 / .07); border-radius: 10px; }
.ds-fx__row.is-off .ds-fx__grid, .ds-fx__row.is-off .ds-fx__type { opacity: .45; }
.ds-fx__top { display: flex; align-items: center; gap: .3rem; }
.ds-fx__type { flex: 1 1 auto; min-width: 0; }
.ds-fx__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem .45rem; }
.ds-fx__grid label { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .35rem; font-size: .72rem; color: var(--g-ink-3); }
.ds-fx__grid .pe-scrub { width: 100%; min-width: 0; }
.ds-fx__colour { grid-column: 1 / -1; grid-template-columns: auto 28px minmax(0, 1fr) !important; align-items: center; }
.ds-fx__colour .pe-swatch { width: 26px; height: 26px; border-radius: 7px; }

/* ---- Constraints. */
.pe-body > .pe-props .ds-cons:not([hidden]), .pe-props .ds-cons:not([hidden]) { display: grid; gap: .4rem; flex: 0 0 auto; }
.ds-cons__title { font-size: .78rem; color: var(--g-ink-3); }
.ds-cons__title small { font-size: .7rem; opacity: .8; }
.ds-cons__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
.ds-cons__row label { display: grid; gap: .25rem; font-size: .72rem; color: var(--g-ink-3); min-width: 0; }
.ds-cons__row .pe-select { width: 100%; min-width: 0; }

/* ---- Rulers, guides and measuring. */
.pe-body > .ds-ruler, .pe-body > .ds-ruler-corner { grid-column: 2; grid-row: 1; z-index: 5; align-self: start; justify-self: start; pointer-events: auto; background: rgb(20 18 29 / .92); }
.pe-body > .ds-ruler[hidden], .pe-body > .ds-ruler-corner[hidden] { display: none; }
.ds-ruler--x { cursor: row-resize; border-radius: 20px 20px 0 0; border-bottom: 1px solid rgb(255 255 255 / .1); }
.ds-ruler--y { cursor: col-resize; border-radius: 20px 0 0 20px; border-right: 1px solid rgb(255 255 255 / .1); }
.pe-body > .ds-ruler-corner { width: 20px; height: 20px; border-radius: 20px 0 0 0; z-index: 6; pointer-events: none; }
.pe-overlay .ds-guide { stroke: #ff5c8a; stroke-width: 1; vector-effect: non-scaling-stroke; }
.pe-overlay .ds-guide.is-moving { opacity: .25; }
.pe-pages.is-over-guide-x { cursor: col-resize; }
.pe-pages.is-over-guide-y { cursor: row-resize; }
.ds-guide-drag { position: absolute; z-index: 9; pointer-events: none; background: #ff5c8a; }
.ds-guide-drag.is-x { top: 0; bottom: 0; width: 1px; }
.ds-guide-drag.is-y { left: 0; right: 0; height: 1px; }
.ds-guide-drag::after {
  content: attr(data-label); position: absolute; padding: .1rem .35rem; border-radius: 4px; background: #ff5c8a; color: #fff;
  font-size: .68rem; font-weight: 650; white-space: nowrap;
}
.ds-guide-drag.is-x::after { left: 6px; top: 50%; }
.ds-guide-drag.is-y::after { top: 6px; left: 50%; }
.ds-measure { position: absolute; inset: 0; z-index: 7; pointer-events: none; overflow: visible; }
.ds-measure__target, .ds-measure__sel { position: absolute; box-shadow: inset 0 0 0 1px #ff5c4d; }
.ds-measure__sel { box-shadow: inset 0 0 0 1px var(--g-lilac); }
.ds-measure__line { position: absolute; background: #ff5c4d; }
.ds-measure__line.is-h { height: 1px; }
.ds-measure__line.is-v { width: 1px; }
.ds-measure__line span {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: .08rem .35rem; border-radius: 4px;
  background: #ff5c4d; color: #fff; font-size: .68rem; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ds-measure__line.is-h span { top: auto; bottom: 4px; transform: translateX(-50%); }
.ds-measure__line.is-v span { left: 6px; transform: translateY(-50%); }
@media (max-width: 900px) { .pe-body > .ds-ruler, .pe-body > .ds-ruler-corner { display: none; } }
.ds-cons__row .pe-dropdown, .ds-fx__top .pe-dropdown, .ds-link__row .pe-dropdown { min-width: 0; width: 100%; }
.ds-fx__top .pe-dropdown { flex: 1 1 auto; }
.ds-fx__grid input.pe-scrub {
  height: 26px; padding: 0 .4rem; border: 0; border-radius: 7px; background: rgb(255 255 255 / .04); color: var(--g-ink);
  font: inherit; font-size: .8rem; font-variant-numeric: tabular-nums; text-align: right; cursor: ew-resize; outline: none;
}
.ds-fx__grid input.pe-scrub:hover { background: rgb(255 255 255 / .07); }
.ds-fx__grid input.pe-scrub:focus { cursor: text; background: rgb(0 0 0 / .35); box-shadow: inset 0 0 0 1px var(--g-lilac); }
.pe-props .ds-fx, .ds-fx__list, .ds-fx__row, .ds-fx__top { min-width: 0; max-width: 100%; }
.ds-fx__top .pe-dropdown { flex: 1 1 0; width: auto; min-width: 0; }
.ds-fx__top > button { flex: none; }

/* ---- Copy as. */
.pe-body > .pe-props .ds-copyas:not([hidden]), .pe-props .ds-copyas:not([hidden]) { display: grid; gap: .35rem; flex: 0 0 auto; }
.ds-copyas > span { font-size: .78rem; color: var(--g-ink-3); }
.ds-copyas__btns { display: flex; gap: .3rem; }
.ds-copyas__btns .ds-btn { flex: 1 1 0; height: 28px; padding: 0 .4rem; }

/* ---- Comments. */
.ds-pins { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
.ds-pin {
  position: absolute; width: 28px; height: 28px; margin: -28px 0 0 0; padding: 0; border: 2px solid #fff; border-radius: 50% 50% 50% 4px;
  background: var(--peer); color: #15131d; font: inherit; font-size: .75rem; font-weight: 750; cursor: pointer; pointer-events: auto;
  box-shadow: 0 4px 12px rgb(0 0 0 / .35); transition: transform var(--dur-2, .15s) var(--ease-out, ease-out);
}
.ds-pin:hover, .ds-pin.is-open { transform: scale(1.12); }
.ds-pin:focus-visible { outline: 2px solid var(--g-lilac); outline-offset: 2px; }
.ds-pin.is-resolved { opacity: .5; filter: grayscale(.6); }
.pe-scroll[data-tool="comment"] .pe-pages, .pe-scroll[data-tool="comment"] .pe-page { cursor: copy; }
.ds-thread {
  position: absolute; z-index: 9; width: 18rem; max-height: 22rem; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: .55rem; padding: .7rem;
  border-radius: 14px; font-size: .82rem; background: linear-gradient(180deg, rgb(36 32 52 / .98), rgb(23 21 33 / .98));
}
.ds-thread[hidden] { display: none; }
.ds-thread__head { display: flex; align-items: center; gap: .3rem; color: var(--g-ink-3); font-size: .74rem; }
.ds-thread__head > span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-thread__head .ds-btn { height: 26px; padding: 0 .55rem; font-size: .74rem; }
.ds-thread__x { display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 7px; background: none; color: var(--g-ink-2); cursor: pointer; }
.ds-thread__x:hover { background: rgb(179 166 255 / .14); color: #fff; }
.ds-thread__x svg { width: 16px; height: 16px; }
.ds-thread__msgs { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; overflow-y: auto; min-height: 0; }
.ds-thread__msgs p, .ds-notes-list__item p { margin: .15rem 0 0; color: var(--g-ink); line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.ds-thread__who { display: flex; align-items: center; gap: .35rem; font-size: .74rem; color: var(--g-ink-2); }
.ds-thread__who i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.ds-thread__who small { color: var(--g-ink-3); font-size: .7rem; }
.ds-thread__form { display: grid; gap: .4rem; }
.ds-thread__form textarea {
  width: 100%; min-height: 2.6rem; resize: vertical; padding: .45rem .55rem; border: 1px solid var(--g-rim-soft); border-radius: 9px;
  background: rgb(0 0 0 / .35); color: var(--g-ink); font: inherit; font-size: .82rem; outline: none;
}
.ds-thread__form textarea:focus { border-color: var(--g-lilac); }
.ds-thread__form .ds-btn { justify-self: end; height: 28px; }
.pe-body > .pe-props .ds-notes-list:not([hidden]), .pe-props .ds-notes-list:not([hidden]) { display: grid; gap: .5rem; flex: 0 0 auto; min-width: 0; }
.ds-notes-list__resolved { display: flex; align-items: center; gap: .4rem; font-size: .76rem; color: var(--g-ink-3); }
.ds-notes-list__items { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.ds-notes-list__item {
  width: 100%; display: grid; gap: .1rem; padding: .5rem .55rem; border: 1px solid rgb(255 255 255 / .06); border-radius: 10px;
  background: none; color: inherit; font: inherit; font-size: .8rem; text-align: left; cursor: pointer;
}
.ds-notes-list__item:hover { background: rgb(179 166 255 / .1); }
.ds-notes-list__item.is-resolved { opacity: .6; }
.ds-notes-list__item p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ds-notes-list__meta { color: var(--g-ink-3); font-size: .7rem; }
.ds-notes-list__empty { margin: 0; color: var(--g-ink-3); font-size: .78rem; line-height: 1.4; }
.ds-notes-list__empty[hidden] { display: none; }

/* ---- Version history. */
.ds-history-wrap { position: relative; }
.ds-history {
  position: absolute; right: 0; top: calc(100% + 12px); z-index: 30; width: 21rem; max-height: min(34rem, 70vh);
  display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: .65rem; padding: .95rem; border-radius: 18px; font-size: .84rem;
  background: linear-gradient(180deg, rgb(36 32 52 / .97), rgb(23 21 33 / .97));
}
.ds-history[hidden] { display: none; }
.ds-history__save { display: flex; gap: .4rem; }
.ds-history__save input { flex: 1 1 auto; min-width: 0; text-align: left; }
.ds-history__save .ds-btn { height: auto; }
.ds-history__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; overflow-y: auto; min-height: 0; }
.ds-history__item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .55rem; padding: .45rem; border-radius: 10px; }
.ds-history__item:hover { background: rgb(179 166 255 / .08); }
.ds-history__item.is-current { grid-template-columns: minmax(0, 1fr); padding-left: .55rem; border-left: 2px solid var(--g-lilac); border-radius: 0 10px 10px 0; }
.ds-history__item b { display: block; color: var(--g-ink); font-size: .82rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-history__item.is-named b { color: #fff; }
.ds-history__item small { display: block; color: var(--g-ink-3); font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-history__art { width: 46px; height: 32px; border-radius: 6px; overflow: hidden; background: rgb(255 255 255 / .06); display: grid; place-items: center; }
.ds-history__art img { max-width: 100%; max-height: 100%; }
.ds-history__acts { display: flex; gap: .25rem; }
.ds-history__acts .ds-btn { height: 26px; padding: 0 .5rem; font-size: .72rem; }
@media (max-width: 900px) {
  .ds-history-wrap { position: static; }
  .ds-history { left: 12px; right: 12px; top: calc(100% + 8px); width: auto; }
}

/* ---- Following someone; viewing only. */
.pe-scroll.is-following { box-shadow: inset 0 0 0 2px var(--peer); }
.pe-body > .ds-following {
  grid-column: 2; grid-row: 1; align-self: start; justify-self: center; z-index: 7; margin-top: 10px; padding: .3rem .7rem; border-radius: 999px;
  background: var(--peer); color: #15131d; font-size: .76rem; font-weight: 650; pointer-events: none; box-shadow: 0 4px 14px rgb(0 0 0 / .35);
}
.pe-body > .ds-following[hidden] { display: none; }
.ds-person.is-followed { box-shadow: 0 0 0 2px #15131d, 0 0 0 4px var(--peer); }
.is-viewing .pe-tool:not([data-tool-btn="hand"]):not([data-tool-btn="select"]),
.is-viewing .pe-tool--group, .is-viewing [data-undo], .is-viewing [data-redo] { display: none !important; }
.is-viewing .pe-props [data-f]:not([data-f="comments"]) { pointer-events: none; opacity: .65; }
.ds-share__links { display: grid; gap: .45rem; }
.ds-share__links[hidden] { display: none; }
.ds-share__links .ds-share__link { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr) auto; align-items: center; }
.ds-share__links .ds-share__link > span { font-size: .74rem; color: var(--g-ink-3); }
@media (max-width: 900px) { .pe-body > .ds-following { grid-column: 1; grid-row: 2; } }

/* ---- Combining shapes. */
.pe-body > .pe-props .ds-bool:not([hidden]), .pe-props .ds-bool:not([hidden]) { display: grid; gap: .35rem; flex: 0 0 auto; }
.ds-bool > span { font-size: .78rem; color: var(--g-ink-3); }
.ds-bool__btns { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .2rem; }
.ds-bool__btn { display: grid; place-items: center; height: 30px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--g-ink-2); cursor: pointer; }
.ds-bool__btn:hover:not(:disabled) { background: rgb(179 166 255 / .14); color: #fff; }
.ds-bool__btn:focus-visible { outline: 2px solid var(--g-lilac); outline-offset: 1px; }
.ds-bool__btn:disabled { opacity: .3; cursor: default; }
.ds-bool__btn svg { width: 19px; height: 19px; }

/* ==== Motion mode ======================================================== */
.ds-mode { display: inline-flex; flex: none; gap: 2px; padding: 3px; border-radius: 12px; background: rgb(0 0 0 / .35); box-shadow: inset 0 1px 3px rgb(0 0 0 / .5); }
.ds-mode button {
  height: 30px; padding: 0 .85rem; border: 0; border-radius: 9px; background: none; color: var(--g-ink-3);
  font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; transition: background 160ms var(--ease), color 160ms var(--ease);
}
.ds-mode button:hover { color: #fff; }
.ds-mode button[aria-checked="true"] { color: #fff; background: linear-gradient(180deg, #a08fff, #7462e8); box-shadow: 0 4px 12px -6px rgb(116 98 232 / .9); }
.ds-mode button:focus-visible { outline: 2px solid var(--g-lilac); outline-offset: 2px; }

/* The timeline: across the bottom, under the canvas and the panels. */
.is-motion .pe-body { grid-template-rows: minmax(0, 1fr) auto; }
.pe-body > .mo-tl { grid-column: 1 / -1; grid-row: 2; margin-top: .6rem; padding: 0; border-radius: 18px; overflow: hidden; min-width: 0; }
.pe-body > .mo-tl[hidden] { display: none; }
.is-motion.pe-editor.is-app .pe-toolbar, .is-motion .pe-editor.is-app .pe-toolbar { bottom: calc(var(--mo-tl-h, 0px) + 1.6rem); }
.mo-tl { display: grid; grid-template-rows: auto auto; font-size: .78rem; color: var(--g-ink-2); background: linear-gradient(180deg, rgb(30 27 44 / .96), rgb(20 18 29 / .97)); }
.mo-bar { display: flex; align-items: center; gap: .3rem; padding: .3rem .55rem; border-bottom: 1px solid rgb(255 255 255 / .06); flex-wrap: wrap; cursor: ns-resize; }
.mo-bar > * { cursor: auto; }
.mo-bar > .mo-gap { cursor: ns-resize; }
.mo-btn { display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--g-ink-2); cursor: pointer; }
.mo-btn:hover { background: rgb(179 166 255 / .14); color: #fff; }
.mo-btn:focus-visible, .mo-key:focus-visible, .mo-chev:focus-visible { outline: 2px solid var(--g-lilac); outline-offset: 1px; }
.mo-btn svg { width: 16px; height: 16px; fill: currentColor; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mo-btn [fill="none"] { fill: none; }
.mo-play { width: 28px; height: 28px; border-radius: 50%; color: #fff; background: linear-gradient(180deg, #a08fff, #7462e8); }
.mo-play:hover { background: linear-gradient(180deg, #b3a6ff, #8473f0); }
.mo-play .mo-i-pause, .mo-play[aria-pressed="true"] .mo-i-play { display: none; }
.mo-play[aria-pressed="true"] .mo-i-pause { display: inline; }
.mo-loop[aria-pressed="true"] { color: var(--g-lilac); background: rgb(179 166 255 / .14); }
.mo-time { min-width: 4.2rem; margin-left: .2rem; color: #fff; font-size: .8rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.mo-total { color: var(--g-ink-3); font-variant-numeric: tabular-nums; margin-right: .4rem; }
.mo-field { display: inline-flex; align-items: center; gap: .3rem; color: var(--g-ink-3); }
.mo-select { height: 24px; padding: 0 .4rem; border: 1px solid var(--g-rim-soft); border-radius: 8px; background: rgb(0 0 0 / .35); color: var(--g-ink); font: inherit; font-size: .78rem; }
.mo-select option { background: #1d1a28; }
.mo-views { display: inline-flex; gap: 2px; padding: 2px; border-radius: 9px; background: rgb(0 0 0 / .3); }
.mo-views button { height: 26px; padding: 0 .6rem; border: 0; border-radius: 7px; background: none; color: var(--g-ink-3); font: inherit; font-size: .76rem; cursor: pointer; }
.mo-views button[aria-checked="true"] { color: #fff; background: rgb(179 166 255 / .22); }
.mo-gap { flex: 1 1 auto; }
.mo-collapse svg { transition: transform 200ms var(--ease); }
.mo-tl.is-collapsed .mo-collapse svg { transform: rotate(180deg); }
.mo-body { position: relative; height: 260px; transition: height 220ms var(--ease); }

.mo-scroll { height: 100%; overflow: auto; overscroll-behavior: contain; }
.mo-grid { position: relative; min-width: 100%; padding-bottom: .6rem; }
.mo-row { position: relative; height: 28px; border-bottom: 1px solid rgb(255 255 255 / .035); }
.mo-label {
  position: sticky; left: 0; z-index: 2; display: flex; align-items: center; gap: .3rem; width: 230px; height: 100%; padding: 0 .5rem;
  background: rgb(24 22 34 / .98); border-right: 1px solid rgb(255 255 255 / .06); overflow: hidden; white-space: nowrap;
}
.mo-ruler { height: 26px; position: sticky; top: 0; z-index: 4; background: rgb(24 22 34 / .98); cursor: ew-resize; }
.mo-ruler .mo-label { color: var(--g-ink-3); font-size: .72rem; }
.mo-tick { position: absolute; top: 0; height: 100%; padding: 6px 0 0 4px; border-left: 1px solid rgb(255 255 255 / .12); color: var(--g-ink-3); font-size: .68rem; font-variant-numeric: tabular-nums; pointer-events: none; }
.mo-section { height: 24px; }
.mo-section .mo-label { color: var(--g-ink-3); font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.mo-scene { height: 34px; }
.mo-scene .mo-label { gap: .35rem; font-weight: 650; color: var(--g-ink); }
.mo-scene.is-current .mo-label { color: #fff; }
.mo-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; cursor: default; }
[data-mo-pick] { cursor: pointer; }
.mo-num { width: 3rem; height: 22px; padding: 0 .3rem; border: 1px solid transparent; border-radius: 6px; background: rgb(0 0 0 / .3); color: var(--g-ink); font: inherit; font-size: .74rem; text-align: right; font-variant-numeric: tabular-nums; }
.mo-num:focus { border-color: var(--g-lilac); outline: none; }
.mo-label small { color: var(--g-ink-3); }
.mo-chev { width: 18px; height: 18px; flex: none; padding: 0; border: 0; border-radius: 5px; background: none; color: var(--g-ink-3); cursor: pointer; }
.mo-chev::before { content: ''; display: block; width: 6px; height: 6px; margin: 0 auto; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(-45deg); transition: transform 160ms var(--ease); }
.mo-chev[aria-expanded="true"]::before { transform: rotate(45deg) translate(-1px, -1px); }
.mo-bar-scene {
  position: absolute; top: 5px; bottom: 5px; display: flex; align-items: center; gap: .4rem; padding: 0 .5rem; border-radius: 8px; overflow: hidden;
  background: linear-gradient(180deg, rgb(160 143 255 / .32), rgb(116 98 232 / .26)); border: 1px solid rgb(179 166 255 / .4); color: #fff; font-size: .74rem;
}
.mo-scene-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mo-trans { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, rgb(255 255 255 / .28), transparent); pointer-events: none; }
.mo-trans-sel { position: relative; height: 20px; padding: 0 .2rem; font-size: .7rem; max-width: 7rem; }
.mo-scene-end { position: absolute; right: 0; top: 0; bottom: 0; width: 8px; cursor: ew-resize; background: rgb(255 255 255 / .18); }
.mo-layer .mo-label { padding-left: 1.3rem; }
.mo-layer.is-selected .mo-label { color: #fff; background: linear-gradient(90deg, rgb(160 143 255 / .2), rgb(24 22 34 / .98)); }
.mo-prop .mo-label { padding-left: 2.6rem; color: var(--g-ink-3); }
.mo-propname { flex: 1 1 auto; }
.mo-x { width: 20px; height: 20px; padding: 0; border: 0; border-radius: 5px; background: none; color: var(--g-ink-3); font-size: .95rem; line-height: 1; cursor: pointer; opacity: 0; }
.mo-prop:hover .mo-x, .mo-x:focus-visible { opacity: 1; }
.mo-x:hover { color: #fff; background: rgb(255 92 77 / .25); }
.mo-key {
  position: absolute; top: 50%; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; padding: 0; border: 1.5px solid #fff; border-radius: 2px;
  background: var(--g-lilac); transform-origin: center; rotate: 45deg; cursor: grab; z-index: 1;
}
.mo-key:hover { background: #fff; }
.mo-key.is-picked { background: #ffd84d; border-color: #ffd84d; box-shadow: 0 0 0 3px rgb(255 216 77 / .3); }
.mo-key.is-sum { width: 8px; height: 8px; margin: -4px 0 0 -4px; border-width: 1px; background: rgb(179 166 255 / .7); cursor: default; pointer-events: none; }
.mo-seg { position: absolute; top: 50%; height: 2px; margin-top: -1px; background: rgb(179 166 255 / .5); pointer-events: none; }
.mo-seg.is-hold { background: repeating-linear-gradient(90deg, rgb(179 166 255 / .6) 0 4px, transparent 4px 8px); }
.mo-hint .mo-label { color: var(--g-ink-3); font-style: italic; }
.mo-hint-text { position: absolute; top: 6px; color: var(--g-ink-3); font-size: .74rem; white-space: nowrap; }
.mo-audio-head { height: 30px; }
.mo-audio-head .mo-label { text-transform: none; letter-spacing: 0; }
.mo-audio-head .mo-name { font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.mo-addsound { height: 22px; padding: 0 .5rem; border: 1px solid rgb(179 166 255 / .4); border-radius: 6px; background: rgb(160 143 255 / .14); color: var(--g-ink); font: inherit; font-size: .72rem; font-weight: 600; letter-spacing: 0; cursor: pointer; }
.mo-addsound:hover { background: rgb(160 143 255 / .3); color: #fff; }
.mo-master { display: inline-flex; align-items: center; gap: .45rem; position: absolute; top: 4px; height: 22px; color: var(--g-ink-3); font-size: .72rem; }
.mo-master input { width: 120px; accent-color: var(--g-lilac); }
.mo-master output { min-width: 2.6rem; color: var(--g-ink); font-variant-numeric: tabular-nums; }
.mo-clip { height: 44px; }
.mo-clip .mo-label { padding-left: .4rem; }
.mo-clip:hover .mo-x, .mo-clip .mo-x:focus-visible { opacity: 1; }
.mo-mute { width: 22px; height: 22px; flex: none; padding: 2px; border: 0; border-radius: 5px; background: none; color: var(--g-ink-2, #cfc9e6); cursor: pointer; }
.mo-mute svg { width: 100%; height: 100%; fill: currentColor; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.mo-mute .mo-mute__off, .mo-mute[aria-pressed="true"] .mo-mute__on { display: none; }
.mo-mute[aria-pressed="true"] .mo-mute__off { display: inline; }
.mo-mute[aria-pressed="true"] { color: #ff8a7a; }
.mo-mute:hover { background: rgb(255 255 255 / .08); }
.mo-clipbar {
  position: absolute; top: 5px; bottom: 5px; border-radius: 7px; overflow: visible; cursor: grab; touch-action: none;
  background: linear-gradient(180deg, rgb(77 208 176 / .26), rgb(54 160 140 / .2)); border: 1px solid rgb(110 226 196 / .45);
}
.mo-clipbar:active { cursor: grabbing; }
.mo-clip.is-muted .mo-clipbar { filter: saturate(0); opacity: .55; }
.mo-clipbar.is-missing { background: repeating-linear-gradient(135deg, rgb(255 92 77 / .18) 0 6px, transparent 6px 12px); border-color: rgb(255 92 77 / .5); }
.mo-clip-note { position: absolute; left: .5rem; top: 50%; transform: translateY(-50%); color: #ffb3a8; font-size: .7rem; white-space: nowrap; }
.mo-wave, .mo-fades { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; border-radius: 7px; }
.mo-wave path { stroke: rgb(150 240 214 / .85); stroke-width: 1; vector-effect: non-scaling-stroke; }
.mo-fades path { fill: rgb(10 10 18 / .5); }
.mo-fades .mo-fades__line { fill: none; stroke: rgb(230 255 248 / .8); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.mo-clip-name { position: absolute; left: .45rem; top: 2px; max-width: calc(100% - 1rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #e6fff8; font-size: .66rem; font-weight: 600; text-shadow: 0 1px 2px rgb(0 0 0 / .6); pointer-events: none; }
.mo-trim { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; z-index: 1; }
.mo-trim.is-start { left: -2px; border-radius: 7px 0 0 7px; }
.mo-trim.is-end { right: -2px; border-radius: 0 7px 7px 0; }
.mo-trim:hover { background: rgb(230 255 248 / .35); }
.mo-fade { position: absolute; top: -4px; width: 10px; height: 10px; margin-left: -5px; border: 1.5px solid #fff; border-radius: 50%; background: #3fbf9f; cursor: ew-resize; z-index: 2; }
.mo-fade:hover, .mo-fade:focus-visible { background: #fff; outline: none; box-shadow: 0 0 0 3px rgb(110 226 196 / .45); }
.mo-playhead { position: absolute; top: 0; bottom: 0; left: 0; width: 0; z-index: 5; pointer-events: none; }
.mo-playhead::before { content: ''; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: #ff5c8a; }
.mo-playhead i { position: absolute; top: 2px; left: -6px; width: 12px; height: 14px; border-radius: 3px 3px 6px 6px; background: #ff5c8a; }

/* Easing. */
.mo-ease {
  position: fixed; z-index: 260; width: 20rem; display: grid; gap: .55rem; padding: .75rem; border-radius: 16px;
  background: linear-gradient(180deg, rgb(36 32 52 / .98), rgb(23 21 33 / .98)); font-size: .78rem;
}
.mo-ease[hidden] { display: none; }
.mo-ease__head { display: flex; align-items: center; gap: .4rem; }
.mo-ease__head small { flex: 1 1 auto; color: var(--g-ink-3); }
.mo-ease__head .mo-x { opacity: 1; }
.mo-ease__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .3rem; }
.mo-ease__opt { display: grid; gap: .15rem; justify-items: center; padding: .35rem .2rem; border: 1px solid transparent; border-radius: 9px; background: rgb(255 255 255 / .03); color: var(--g-ink-2); font: inherit; font-size: .68rem; cursor: pointer; }
.mo-ease__opt:hover, .mo-ease__opt:focus-visible { background: rgb(179 166 255 / .12); color: #fff; outline: none; }
.mo-ease__opt.is-on { border-color: var(--g-lilac); color: #fff; }
.mo-ease__opt svg { width: 100%; height: 34px; }
.mo-ease__opt path { fill: none; stroke: var(--g-lilac); stroke-width: 3; }
.mo-ease__custom { display: grid; gap: .35rem; }
.mo-ease__custom > span { color: var(--g-ink-3); }
.mo-ease__curve { width: 100%; height: 150px; touch-action: none; }
.mo-ease__box { fill: rgb(0 0 0 / .25); stroke: rgb(255 255 255 / .1); }
.mo-ease__arm { stroke: rgb(255 255 255 / .35); stroke-width: 1; fill: none; }
.mo-ease__line { stroke: var(--g-lilac); stroke-width: 2.5; fill: none; }
.mo-ease__h { fill: #fff; stroke: var(--g-lilac); stroke-width: 2; cursor: grab; }
.mo-ease__nums { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.mo-ease__nums label { display: grid; gap: .2rem; color: var(--g-ink-3); }

/* The Animate panel. */
.pe-body > .pe-props .mo-panel:not([hidden]), .pe-props .mo-panel:not([hidden]) { display: grid; gap: .4rem; flex: 0 0 auto; min-width: 0; padding-bottom: .5rem; border-bottom: 1px solid rgb(255 255 255 / .07); }
.mo-panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.mo-panel__title { font-size: .78rem; font-weight: 650; color: var(--g-ink); }
.mo-panel__head small { color: var(--g-ink-3); font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mo-panel__rows { display: grid; gap: .15rem; }
.mo-panel__row { display: grid; grid-template-columns: minmax(0, 1fr) 5rem 22px; align-items: center; gap: .35rem; font-size: .78rem; color: var(--g-ink-3); }
.mo-panel__row.is-animated > span { color: var(--g-lilac); }
.mo-panel__row input.pe-scrub {
  height: 24px; padding: 0 .35rem; border: 0; border-radius: 6px; background: rgb(255 255 255 / .04); color: var(--g-ink);
  font: inherit; font-size: .8rem; text-align: right; font-variant-numeric: tabular-nums; cursor: ew-resize; outline: none; min-width: 0;
}
.mo-panel__row input.pe-scrub:focus { cursor: text; background: rgb(0 0 0 / .35); box-shadow: inset 0 0 0 1px var(--g-lilac); }
.mo-panel__row .mo-panel__swatch { justify-self: end; width: 24px; height: 24px; border-radius: 7px; }
.mo-keybtn { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px; background: none; cursor: pointer; position: relative; }
.mo-keybtn::before { content: ''; position: absolute; inset: 6px; border: 1.5px solid var(--g-ink-3); border-radius: 2px; rotate: 45deg; }
.mo-keybtn:hover::before { border-color: #fff; }
.mo-keybtn.is-on::before { background: var(--g-lilac); border-color: #fff; }
.mo-panel__row.is-animated .mo-keybtn:not(.is-on)::before { border-color: var(--g-lilac); }
.mo-keybtn:focus-visible { outline: 2px solid var(--g-lilac); }
.mo-panel__presets, .mo-panel__split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 3.6rem; gap: .35rem; align-items: end; }
.mo-panel__split { grid-template-columns: 4.6rem minmax(0, 1fr); }
.mo-panel__play { grid-column: 1 / -1; }
.mo-panel__presets label, .mo-panel__split label { display: grid; gap: .15rem; min-width: 0; font-size: .7rem; color: var(--g-ink-3); }
.mo-panel__presets .mo-select, .mo-panel__split .mo-select { width: 100%; min-width: 0; height: 26px; }
.mo-panel__presets input.pe-scrub, .mo-panel__split input.pe-scrub {
  height: 26px; width: 100%; padding: 0 .35rem; border: 0; border-radius: 6px; background: rgb(255 255 255 / .04); color: var(--g-ink);
  font: inherit; font-size: .78rem; text-align: right; font-variant-numeric: tabular-nums; cursor: ew-resize; outline: none; min-width: 0;
}
.mo-panel__presets input.pe-scrub:focus, .mo-panel__split input.pe-scrub:focus { cursor: text; background: rgb(0 0 0 / .35); box-shadow: inset 0 0 0 1px var(--g-lilac); }
.mo-panel__note { margin: 0; color: var(--g-ink-3); font-size: .72rem; line-height: 1.4; }
@media (max-width: 900px) {
  .is-motion .pe-body, .is-motion .pe-body.has-layers { grid-template-rows: auto minmax(0, 1fr) auto 0rem; }
  .pe-body > .mo-tl { grid-row: 3; }
  .mo-label { width: 150px; }
  .mo-views { display: none; }
}
.mo-bar .pe-dropdown, .mo-bar-scene .pe-dropdown { min-width: 0; width: auto; height: 28px; font-size: .78rem; }
.mo-bar-scene .pe-dropdown { height: 20px; font-size: .7rem; padding: 0 .3rem; }
.mo-panel__presets .pe-dropdown, .mo-panel__split .pe-dropdown { width: 100%; min-width: 0; height: 26px; font-size: .78rem; padding: 0 .45rem; }
.mo-panel__presets { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 3.1rem; gap: .3rem; }
.mo-panel__presets .pe-dropdown { padding: 0 .25rem 0 .5rem; gap: .15rem; }
.mo-panel__presets .pe-dropdown svg { width: 13px; height: 13px; flex: none; }

/* ---- Slimmer bars: the file bar along the top, one line. */
.ds-head.pe-head { flex-wrap: nowrap; gap: .3rem .45rem; padding: .3rem .45rem .3rem .5rem; border-radius: 14px; }
.ds-head .ds-mode { padding: 2px; border-radius: 10px; }
.ds-head .ds-mode button { height: 26px; padding: 0 .65rem; border-radius: 8px; font-size: .76rem; }
.ds-head .pe-head__file { display: flex; align-items: center; gap: .45rem; flex: 1 1 8rem; min-width: 0; }
.ds-head .ds-name { width: auto; field-sizing: content; max-width: 18rem; min-width: 4rem; height: 26px; font-size: .88rem; flex: 0 1 auto; }
.ds-head .pe-head__meta { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .72rem; }
.ds-head .pe-restart { height: 28px; gap: .35rem; padding: 0 .5rem; border-radius: 8px; font-size: .78rem; }
.ds-head .pe-restart:hover { background: rgb(255 255 255 / .06); }
.ds-head .pe-restart svg { width: 16px; height: 16px; }
.ds-head .pe-dl { min-width: 0; height: 30px; padding: 0 .8rem; border-radius: 9px; font-size: .8rem; }
.ds-head .pe-dl__face { gap: .4rem; }
.ds-head .pe-dl__face svg { width: 16px; height: 16px; }
.ds-head .pe-dl__done { width: 22px; height: 22px; }
@media (max-width: 1240px) { .ds-head .ds-btn-label { display: none; } .ds-head .pe-restart { padding: 0 .4rem; } }
@media (max-width: 900px) { .ds-head.pe-head { flex-wrap: wrap; } }

/* ---- The timeline: its top edge drags it taller or shorter. */
.mo-tl { position: relative; }
.mo-resize { position: absolute; top: 0; left: 0; right: 0; height: 9px; z-index: 6; display: grid; place-items: center; cursor: ns-resize; touch-action: none; }
.mo-resize i { width: 38px; height: 4px; border-radius: 4px; background: rgb(255 255 255 / .18); transition: background 160ms var(--ease), width 160ms var(--ease); }
.mo-resize:hover i, .mo-tl.is-sizing .mo-resize i { width: 56px; background: var(--g-lilac); }
.mo-resize:focus-visible { outline: none; }
.mo-resize:focus-visible i { background: var(--g-lilac); box-shadow: 0 0 0 2px rgb(179 166 255 / .4); }
.mo-tl.is-sizing .mo-body { transition: none; }
.mo-tl.is-sizing { user-select: none; }
.mo-lock[aria-pressed="true"] { color: #ffd84d; background: rgb(255 216 77 / .14); }
.mo-lock[aria-pressed="false"] .mo-lock__shackle { transform: translate(3.5px, -1.5px) rotate(14deg); transform-origin: 15.5px 10.5px; }
.mo-sep { width: 1px; height: 18px; margin: 0 .15rem; background: rgb(255 255 255 / .1); }
.mo-cliptools { display: inline-flex; align-items: center; gap: .2rem; padding: 1px 3px 1px .5rem; border-radius: 9px; background: rgb(77 208 176 / .12); box-shadow: inset 0 0 0 1px rgb(110 226 196 / .3); }
.mo-cliptools[hidden] { display: none; }
.mo-cliptools__name { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #bff3e4; font-size: .74rem; font-weight: 600; margin-right: .2rem; }
.mo-btn--text { width: auto; padding: 0 .45rem; gap: .3rem; display: inline-flex; align-items: center; font: inherit; font-size: .76rem; }
.mo-btn:disabled { opacity: .35; cursor: default; background: none; }
.mo-clipbar.is-picked { border-color: #e6fff8; box-shadow: 0 0 0 2px rgb(110 226 196 / .55), 0 0 14px -2px rgb(110 226 196 / .6); }
