.sheet-expand {
  display: none;
}
canvas.frames {
  display: block;
  background-image: none;
  pointer-events: none;
}
.track {
  height: clamp(42px, 5.5vh, 60px);
  background: var(--stage);
}
.ruler {
  position: relative;
  display: block;
  height: 19px;
}
.ruler span {
  position: absolute;
  transform: translateX(-50%);
}
.ruler span:first-child {
  transform: none;
}
.ruler span:last-child {
  transform: translateX(-100%);
}
.scrub-time {
  position: absolute;
  z-index: 3;
  bottom: calc(100% + 5px);
  transform: translateX(-50%);
  pointer-events: none;
  padding: 3px 5px;
  border-radius: 3px;
  background: var(--text);
  color: var(--bg);
  font: 10px/1.2 var(--mono);
}
.scrub-time[hidden] {
  display: none;
}

@media (max-width: 700px), (max-width: 940px) and (max-height: 560px) and (pointer: coarse) {
  body {
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) 0
      env(safe-area-inset-left, 0px);
  }
  .topbar {
    flex: none;
    height: 50px;
    padding: 0 9px;
  }
  .top-actions,
  .brand {
    gap: 3px;
  }
  .top-actions > .divider,
  .top-actions .import-btn span,
  .top-actions .preset-btn span {
    display: none;
  }
  .top-actions .icon,
  .top-actions .plain,
  .top-actions .import-btn {
    width: 38px;
    min-width: 38px;
    min-height: 38px;
    padding: 0;
  }
  .top-actions .primary {
    min-height: 36px;
  }
  .mobile-tabs {
    z-index: 4;
    flex: none;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    height: auto;
    padding: 2px 7px max(3px, env(safe-area-inset-bottom, 0px));
    background: var(--panel);
    border: 0;
    border-top: 1px solid var(--line);
  }
  .mobile-tabs button {
    min-height: 44px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 550;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }
  .mobile-tabs button.on {
    background: var(--blue-tint);
    color: var(--blue);
    box-shadow: none;
  }
  .mobile-tabs .ico {
    width: 15px;
    height: 15px;
  }
  #mobile-layer-count {
    border-radius: 3px;
    padding: 1px 4px;
    background: var(--raised);
    color: var(--muted);
    font: 10px var(--mono);
    font-variant-numeric: tabular-nums;
  }
  .editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
  .editor > aside,
  .editor > section {
    grid-column: 1;
    height: auto;
    min-height: 0;
    border: 0;
    display: none;
  }
  .editor > .workspace,
  .editor[data-mobile='preview'] > .workspace {
    grid-row: 1;
    display: flex;
  }
  .editor[data-mobile='library'],
  .editor[data-mobile='inspector'] {
    grid-template-rows: clamp(100px, 28dvh, 245px) minmax(0, 1fr);
  }
  .editor[data-mobile='library'] > .library,
  .editor[data-mobile='inspector'] > .inspector {
    display: flex;
    grid-row: 2;
    border-top: 1px solid var(--line);
  }
  .editor:not([data-mobile='preview']) .preview-head,
  .editor:not([data-mobile='preview']) .edit-tools,
  .editor:not([data-mobile='preview']) .timeline,
  .editor:not([data-mobile='preview']) .sample-import,
  .editor[data-mobile='library'] .preview-gesture-hud {
    display: none;
  }
  .editor[data-expanded='true']:not([data-mobile='preview']) {
    grid-template-rows: minmax(0, 1fr);
  }
  .editor[data-expanded='true'] > .workspace {
    display: none;
  }
  .editor[data-expanded='true'] > aside {
    grid-row: 1;
  }
  .sheet-expand {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 100%;
    height: 24px;
    flex: none;
    color: var(--dim);
    touch-action: none;
  }
  .sheet-expand span {
    width: 33px;
    height: 3px;
    border-radius: 2px;
    background: currentColor;
  }
  .sheet-expand .ico {
    width: 12px;
    height: 12px;
    transform: rotate(180deg);
  }
  .sheet-expand[aria-expanded='true'] .ico {
    transform: none;
  }
  .pane-heading {
    height: 42px;
  }
  .editor > aside .pane-heading {
    height: 36px;
  }
  .group-toggle {
    min-height: 43px;
    font-size: 13px;
  }
  .library .search {
    min-height: 38px;
  }
  .library .search input,
  .effe-dialog input:not([type='range']) {
    font-size: 16px;
  }
  .library .selector,
  .library .selector select,
  .view-modes .icon,
  .library-heading-actions .fold-all {
    min-height: 36px;
  }
  .view-modes .icon,
  .library-heading-actions .fold-all {
    min-width: 36px;
  }
  .library-add {
    min-height: 35px;
    min-width: 35px;
    opacity: 1;
    pointer-events: auto;
  }
  .catalog.list .fx-card {
    padding-right: 40px;
  }
  .group-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .group-cards .fx-name {
    font-size: 12px;
  }
  .catalog,
  .inscroll,
  .effe-dialog {
    overscroll-behavior: contain;
  }
  .edit-tools {
    height: 44px;
    padding: 0 4px;
    gap: 2px;
  }
  .edit-tools .tool-group {
    gap: 0;
  }
  .edit-tools .tool-group .divider {
    margin: 0 2px;
  }
  .edit-tools button.icon,
  .edit-tools button.plain {
    min-width: 33px;
    min-height: 38px;
  }
  .edit-tools .plain {
    padding: 0 4px;
  }
  .workspace .timeline {
    padding-inline: 10px;
  }
  .timeline-heading {
    height: 32px;
  }
  .file-meta {
    display: block;
    font-size: 10px;
  }
  .transport {
    height: 42px;
  }
  .play-controls .icon,
  .play-controls .play,
  .transport > .icon {
    width: 36px;
    height: 36px;
  }
  .stack-row .grip {
    min-width: 30px;
    height: 39px;
  }
  .stack-row .icon {
    width: 36px;
    height: 39px;
  }
  .stack-info b {
    font-size: 14px;
  }
  .inspector .ins-block summary {
    min-height: 38px;
  }
  .range-wrap,
  .range-wrap input {
    height: 27px;
  }
  .range-wrap input::-webkit-slider-thumb {
    width: 15px;
    height: 15px;
    margin-top: -6px;
  }
  .range-wrap input::-moz-range-thumb {
    width: 15px;
    height: 15px;
  }
  .field-select select {
    min-height: 38px;
  }
  .statusbar {
    display: none;
  }
  .effe-dialog:not(.preset-gallery-dialog) {
    max-height: calc(
      100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 18px
    );
  }
  .effe-dialog .efp-button,
  .effe-dialog .efp-icon {
    min-height: 42px;
  }
  #toast {
    bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  }
}
@media (max-width: 385px) {
  .top-actions .icon,
  .top-actions .plain,
  .top-actions .import-btn {
    width: 35px;
    min-width: 35px;
  }
  .edit-tools .plain span {
    display: none;
  }
  .mobile-tabs button {
    gap: 4px;
  }
}
@media (max-width: 940px) and (max-height: 560px) and (orientation: landscape) and (pointer: coarse) {
  .topbar {
    height: 43px;
  }
  .topbar .ds-mark {
    width: 37px;
  }
  .mobile-tabs button {
    min-height: 35px;
  }
  .editor[data-mobile='library'],
  .editor[data-mobile='inspector'] {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    grid-template-rows: minmax(0, 1fr);
  }
  .editor[data-mobile='library'] > .library,
  .editor[data-mobile='inspector'] > .inspector {
    grid-column: 2;
    grid-row: 1;
    border-top: 0;
    border-left: 1px solid var(--line);
  }
  .editor[data-expanded='true']:not([data-mobile='preview']) {
    grid-template-columns: minmax(0, 1fr);
  }
  .editor[data-expanded='true'] > aside {
    grid-column: 1;
  }
  .editor[data-mobile='preview'] > .workspace {
    display: grid;
    grid-template: 'head tools' 39px 'view film' minmax(0, 1fr) / minmax(0, 1fr) minmax(235px, 37%);
  }
  .editor[data-mobile='preview'] .preview-head {
    grid-area: head;
    height: auto;
  }
  .editor[data-mobile='preview'] .stage {
    grid-area: view;
  }
  .editor[data-mobile='preview'] .edit-tools {
    grid-area: tools;
    height: auto;
  }
  .editor[data-mobile='preview'] .timeline {
    grid-area: film;
    align-self: end;
  }
  .edit-tools .plain span {
    display: none;
  }
}
.stage-exit {
  display: none;
}
.stage.viewport-full {
  position: fixed;
  inset: 0;
  z-index: 50;
  width: 100%;
  height: 100%;
  background-color: var(--stage);
}
.stage.viewport-full .sample-import,
.stage:fullscreen .sample-import {
  display: none;
}
.stage.viewport-full .stage-exit,
.stage:fullscreen .stage-exit {
  position: absolute;
  display: flex;
  top: max(8px, env(safe-area-inset-top, 0px));
  right: max(8px, env(safe-area-inset-right, 0px));
  width: 42px;
  height: 42px;
  z-index: 8;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
}
.sheet-play {
  display: none;
}
@media (max-width: 700px), (max-width: 940px) and (max-height: 560px) and (pointer: coarse) {
  .editor:not([data-mobile='preview']) .sheet-play:not(:disabled) {
    display: grid;
    place-items: center;
    position: absolute;
    z-index: 3;
    left: 8px;
    bottom: 8px;
    width: 38px;
    height: 38px;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--line);
  }
}
@media (max-width: 420px) {
  .preview-head .compare-btn span {
    display: none;
  }
}
@media (max-width: 360px) {
  .top-actions .primary {
    width: 40px;
    padding: 0;
  }
  .top-actions .primary span {
    display: none;
  }
  .topbar {
    padding-inline: 7px;
  }
  .preview-head {
    padding-inline: 7px;
  }
}
