:root {
  --panel-width: 312px;
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #d7d9d8;
  color: #1d2325;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

body.panel-resizing {
  cursor: ew-resize;
  user-select: none;
}

button,
input,
select {
  font: inherit;
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: linear-gradient(180deg, #f1f4f4 0%, #dce1e2 58%, #c5cccf 100%);
}

.show-grid #app {
  background:
    linear-gradient(rgba(82, 96, 103, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(82, 96, 103, 0.07) 1px, transparent 1px),
    linear-gradient(180deg, #f1f4f4 0%, #dce1e2 58%, #c5cccf 100%);
  background-size: 96px 96px, 96px 96px, auto;
}

.dark-background #app {
  background: linear-gradient(180deg, #2a3032 0%, #1b2022 58%, #121617 100%);
}

.dark-background.show-grid #app {
  background:
    linear-gradient(rgba(210, 220, 220, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(210, 220, 220, 0.055) 1px, transparent 1px),
    linear-gradient(180deg, #2a3032 0%, #1b2022 58%, #121617 100%);
  background-size: 96px 96px, 96px 96px, auto;
}

#viewport {
  display: block;
  width: 100%;
  height: 100%;
}

#panel {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 4;
  display: grid;
  width: min(var(--panel-width), calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  gap: 10px;
  overflow: auto;
  padding: 13px;
  border: 1px solid rgba(75, 86, 91, 0.2);
  border-radius: 8px;
  background: rgba(246, 248, 248, 0.86);
  box-shadow: 0 18px 60px rgba(48, 59, 65, 0.18);
  backdrop-filter: blur(16px);
  overscroll-behavior: contain;
  transition:
    transform 180ms ease,
    opacity 180ms ease;
  scrollbar-gutter: stable both-edges;
}

.panel-resize-handle {
  position: absolute;
  top: 10px;
  right: -6px;
  width: 12px;
  height: calc(100% - 20px);
  border-radius: 999px;
  cursor: ew-resize;
  touch-action: none;
}

.panel-resize-handle::after {
  position: absolute;
  top: 50%;
  left: 4px;
  width: 3px;
  height: 54px;
  border-radius: 999px;
  background: rgba(75, 86, 91, 0.18);
  content: "";
  transform: translateY(-50%);
}

.hide-ui #panel,
.hide-ui .panel-toggle,
.hide-ui #eventDock,
.hide-ui .axis-overlay,
.hide-ui .veto-map-overlay,
.hide-ui .four-up-veto-tile {
  display: none;
}

.controls-collapsed #panel {
  display: none;
}

.panel-toggle {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 5;
  display: block;
  min-width: 112px;
  min-height: 44px;
  border-color: rgba(75, 86, 91, 0.2);
  background: rgba(246, 248, 248, 0.9);
  box-shadow: 0 12px 34px rgba(48, 59, 65, 0.18);
  backdrop-filter: blur(16px);
  font-weight: 700;
}

body:not(.controls-collapsed) .panel-toggle {
  top: 16px;
  bottom: auto;
  left: calc(min(var(--panel-width), calc(100vw - 32px)) + 28px);
}

.axis-overlay {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 3;
  width: 104px;
  height: 104px;
  border: 1px solid rgba(75, 86, 91, 0.12);
  border-radius: 8px;
  background: rgba(246, 248, 248, 0.34);
  box-shadow: 0 10px 30px rgba(48, 59, 65, 0.12);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.veto-map-overlay {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: grid;
  width: min(230px, calc(100vw - 32px));
  gap: 8px;
  pointer-events: none;
}

.veto-map-card {
  display: grid;
  gap: 5px;
  padding: 8px;
  border: 1px solid rgba(75, 86, 91, 0.18);
  border-radius: 8px;
  background: rgba(246, 248, 248, 0.72);
  box-shadow: 0 12px 38px rgba(48, 59, 65, 0.14);
  backdrop-filter: blur(14px);
}

.dark-background .veto-map-card {
  border-color: rgba(210, 220, 220, 0.18);
  background: rgba(25, 31, 33, 0.7);
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.2);
}

.veto-map-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: rgba(38, 49, 55, 0.62);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.dark-background .veto-map-title {
  color: rgba(229, 237, 237, 0.68);
}

.veto-map-card canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 5px;
}

.veto-map-card .veto-color-scale {
  height: 24px;
}

.veto-map-title .mini-button {
  min-height: 18px;
  padding: 0 6px;
  font-size: 9px;
  opacity: 0.8;
  pointer-events: auto;
}

.veto-map-title .mini-button.active {
  border-color: rgba(35, 126, 170, 0.52);
  background: rgba(35, 126, 170, 0.16);
  color: #0e3d54;
}

.four-up-mode .veto-map-overlay,
.four-up-mode .axis-overlay {
  display: none;
}

.four-up-veto-tile {
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: grid;
  width: 50vw;
  height: 50vh;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 7px;
  padding: 12px;
  border-top: 1px solid rgba(75, 86, 91, 0.18);
  border-left: 1px solid rgba(75, 86, 91, 0.18);
  background: rgba(238, 242, 242, 0.68);
  backdrop-filter: blur(12px);
  pointer-events: auto;
}

.four-up-veto-tile[hidden] {
  display: none !important;
}

.dark-background .four-up-veto-tile {
  border-color: rgba(210, 220, 220, 0.18);
  background: rgba(24, 30, 32, 0.68);
}

.four-up-veto-head,
.four-up-veto-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.four-up-veto-head {
  color: rgba(38, 49, 55, 0.74);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.dark-background .four-up-veto-head {
  color: rgba(232, 240, 240, 0.76);
}

.four-up-veto-head span {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.four-up-veto-maps {
  display: grid;
  min-height: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: center;
  align-items: center;
  gap: 7px;
}

.four-up-map {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto auto;
  align-content: center;
  gap: 4px;
}

.four-up-map span {
  color: rgba(38, 49, 55, 0.58);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.dark-background .four-up-map span {
  color: rgba(232, 240, 240, 0.62);
}

.four-up-map canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 26 / 15;
  min-height: 0;
  border-radius: 5px;
}

.four-up-veto-scale {
  width: 100%;
  height: 30px;
}

.four-up-veto-controls {
  grid-template-columns: 58px minmax(0, 1fr);
}

.four-up-veto-controls input {
  width: 100%;
}

.row,
label,
.file,
.check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.title {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.title > span {
  min-width: 0;
}

.title .actions {
  width: 100%;
}

.control-section {
  display: grid;
  gap: 9px;
  padding-top: 10px;
  border-top: 1px solid rgba(75, 86, 91, 0.14);
}

.title + .control-section {
  padding-top: 2px;
  border-top: 0;
}

.section-title {
  color: rgba(38, 49, 55, 0.54);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 3px;
  border: 1px solid rgba(75, 86, 91, 0.16);
  border-radius: 8px;
  background: rgba(215, 221, 222, 0.56);
}

.file {
  justify-content: stretch;
}

.file span {
  width: 100%;
  text-align: center;
}

.event-section {
  gap: 8px;
}

#eventDock {
  position: fixed;
  right: 266px;
  bottom: 16px;
  left: calc(min(var(--panel-width), calc(100vw - 32px)) + 32px);
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(210px, 1.35fr) minmax(250px, 0.95fr) 52px;
  align-items: center;
  gap: 8px;
  max-width: none;
  padding: 7px 9px;
  border: 1px solid rgba(75, 86, 91, 0.18);
  border-radius: 8px;
  background: rgba(246, 248, 248, 0.76);
  box-shadow: 0 16px 46px rgba(48, 59, 65, 0.16);
  backdrop-filter: blur(16px);
  pointer-events: auto;
}

.event-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
}

.event-meta strong {
  color: #1d2325;
  font-size: 13px;
  font-weight: 700;
}

.event-meta span {
  overflow: hidden;
  color: rgba(38, 49, 55, 0.62);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-nav {
  display: grid;
  grid-template-columns: 45px 45px 54px 45px 45px;
  justify-content: center;
  gap: 5px;
}

.event-nav input {
  min-width: 0;
  height: 30px;
  border: 1px solid rgba(75, 86, 91, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.62);
  color: #1d2325;
  text-align: center;
}

.event-nav button {
  min-width: 0;
  padding: 0 6px;
}

.dock-play {
  width: 100%;
  min-height: 30px;
  padding: 0 6px;
}

.event-nav input:focus {
  border-color: rgba(35, 126, 170, 0.58);
  outline: none;
}

.timeline-row {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 8px;
  align-items: center;
}

.timeline-row input[type="range"] {
  width: 100%;
}

.timeline-label {
  color: rgba(38, 49, 55, 0.58);
  font-size: 11px;
  line-height: 1.2;
}

#eventDock .timeline-label {
  display: none;
}

.slider-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.slider-row input[type="range"] {
  width: 100%;
}

.control-value {
  min-width: 42px;
  color: rgba(38, 49, 55, 0.66);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

.track-section {
  max-height: min(36vh, 360px);
}

.track-section.tracks-collapsed {
  max-height: none;
}

.track-section.tracks-collapsed .selection-details,
.track-section.tracks-collapsed .track-tree {
  display: none;
}

.selection-details {
  overflow: hidden;
  padding: 7px 8px;
  border: 1px solid rgba(75, 86, 91, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.4);
  color: rgba(38, 49, 55, 0.68);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-tree {
  display: grid;
  max-height: 260px;
  gap: 4px;
  overflow: auto;
  padding-right: 2px;
}

.track-node {
  display: grid;
  gap: 3px;
}

.track-node .track-node {
  margin-left: 10px;
  padding-left: 8px;
  border-left: 1px solid rgba(75, 86, 91, 0.16);
}

.track-row,
.hit-row {
  display: grid;
  width: 100%;
  min-height: 0;
  justify-items: start;
  padding: 5px 7px;
  border-radius: 5px;
  color: rgba(29, 35, 37, 0.8);
  font-size: 11px;
  line-height: 1.25;
  text-align: left;
}

.track-row {
  grid-template-columns: auto 1fr;
  gap: 6px;
}

.track-row .particle {
  font-weight: 700;
}

.track-row .track-meta,
.hit-row .hit-meta {
  overflow: hidden;
  color: rgba(38, 49, 55, 0.58);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hit-list {
  display: grid;
  gap: 3px;
  margin-left: 18px;
}

.hit-row {
  grid-template-columns: 40px 1fr;
  border-color: rgba(75, 86, 91, 0.11);
  background: rgba(255, 255, 255, 0.36);
}

.track-row.selected,
.hit-row.selected {
  border-color: rgba(35, 126, 170, 0.54);
  background: rgba(35, 126, 170, 0.14);
  color: #0e3d54;
}

.track-empty {
  color: rgba(38, 49, 55, 0.48);
  font-size: 11px;
  line-height: 1.35;
}

.toggles.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.toggles.compact:empty {
  display: none;
}

.toggles.compact .check {
  min-height: 24px;
  padding: 0 6px;
  border: 1px solid rgba(75, 86, 91, 0.11);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.28);
  font-size: 10px;
}

button,
.file span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 30px;
  padding: 0 10px;
  overflow: hidden;
  border: 1px solid rgba(75, 86, 91, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.58);
  color: #1d2325;
  cursor: pointer;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-button {
  min-height: 22px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

button,
.file span,
select,
input {
  min-width: 0;
}

button:hover,
.file:hover span {
  border-color: rgba(35, 126, 170, 0.46);
  background: rgba(91, 163, 196, 0.14);
}

button:disabled {
  border-color: rgba(75, 86, 91, 0.08);
  background: rgba(255, 255, 255, 0.28);
  color: rgba(38, 49, 55, 0.34);
  cursor: default;
}

button:disabled:hover {
  border-color: rgba(75, 86, 91, 0.08);
  background: rgba(255, 255, 255, 0.28);
}

button.active {
  border-color: rgba(35, 126, 170, 0.62);
  background: rgba(35, 126, 170, 0.16);
  color: #0e3d54;
}

label {
  color: rgba(29, 35, 37, 0.84);
  font-size: 13px;
}

select {
  width: min(168px, 100%);
  height: 30px;
  border: 1px solid rgba(75, 86, 91, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.62);
  color: #1d2325;
}

.server-section label,
.control-section > label:not(.file):not(.check):not(.slider-row) {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
}

#rootFileSelect {
  width: 100%;
}

.server-section button {
  width: 100%;
}

.server-section input[type="number"] {
  width: 84px;
  height: 30px;
  border: 1px solid rgba(75, 86, 91, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.62);
  color: #1d2325;
  text-align: center;
}

.server-status {
  position: relative;
  overflow: hidden;
  min-height: 16px;
  padding-left: 0;
  color: rgba(38, 49, 55, 0.58);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-section.loading .server-status {
  padding-left: 18px;
  color: rgba(38, 49, 55, 0.72);
}

.server-section.loading .server-status::before {
  position: absolute;
  top: 1px;
  left: 0;
  width: 11px;
  height: 11px;
  border: 2px solid rgba(35, 126, 170, 0.22);
  border-top-color: rgba(35, 126, 170, 0.82);
  border-radius: 50%;
  animation: spin 780ms linear infinite;
  content: "";
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

input[type="range"] {
  width: min(168px, 100%);
  accent-color: #237eaa;
}

.event-section input[type="range"] {
  width: 100%;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #237eaa;
}

.file input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.toggles {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px 10px;
}

.inline-checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.check {
  justify-content: flex-start;
}

.check span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clip-direction-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  padding: 3px;
  border: 1px solid rgba(75, 86, 91, 0.14);
  border-radius: 8px;
  background: rgba(215, 221, 222, 0.42);
}

.clip-direction-grid button {
  min-height: 28px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1180px) {
  #eventDock {
    grid-template-columns: minmax(160px, 0.8fr) minmax(220px, 1.2fr);
    right: 16px;
  }

  #eventDock .event-nav {
    grid-column: span 1;
  }
}

.clip-direction-grid button.active {
  border-color: rgba(35, 126, 170, 0.58);
  background: rgba(35, 126, 170, 0.18);
  color: #0e3d54;
}

.clip-enabled {
  min-height: 26px;
}

#status {
  margin: 0;
  padding-top: 2px;
  color: rgba(38, 49, 55, 0.62);
  font-size: 12px;
  line-height: 1.35;
}

@media (max-width: 680px) {
  .axis-overlay {
    display: none;
  }

  .veto-map-overlay {
    top: max(10px, env(safe-area-inset-top));
    right: 10px;
    width: min(172px, calc(100vw - 20px));
    gap: 7px;
  }

  .controls-collapsed .veto-map-overlay {
    display: none;
  }

  body:not(.controls-collapsed) .panel-toggle {
    top: max(10px, env(safe-area-inset-top));
    bottom: auto;
    left: max(10px, env(safe-area-inset-left));
  }

  button,
  .file span {
    min-height: 36px;
  }

  input[type="checkbox"] {
    width: 18px;
    height: 18px;
  }

  #panel {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100vw;
    max-height: min(74vh, 640px);
    overflow: auto;
    gap: 12px;
    padding: 14px 14px max(16px, env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -18px 60px rgba(48, 59, 65, 0.2);
  }

  .panel-resize-handle {
    display: none;
  }

  #eventDock {
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    grid-template-columns: 1fr 54px;
    max-width: none;
    padding: 9px;
    border-radius: 10px;
  }

  .controls-collapsed .panel-toggle {
    opacity: 0.96;
    bottom: calc(max(10px, env(safe-area-inset-bottom)) + 108px);
  }

  .controls-collapsed #eventDock {
    gap: 7px;
  }

  .controls-collapsed #eventDock .section-title,
  .controls-collapsed #eventDock .timeline-row,
  .controls-collapsed #eventDock .timeline-label {
    display: none;
  }

  .controls-collapsed .event-meta {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
    align-items: baseline;
    gap: 8px;
  }

  .controls-collapsed .event-meta strong,
  .controls-collapsed .event-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .controls-collapsed .slider-row {
    grid-column: 1;
    grid-template-columns: 44px minmax(0, 1fr) 52px;
    gap: 7px;
  }

  .controls-collapsed .event-nav {
    grid-column: 1;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
  }

  .controls-collapsed .dock-play {
    grid-column: 2;
    grid-row: 2 / span 2;
    align-self: stretch;
    min-height: 32px;
  }

  .controls-collapsed .event-nav input {
    grid-column: auto;
    grid-row: auto;
    order: 0;
    height: 32px;
    text-align: center;
  }

  .controls-collapsed .event-nav button {
    min-height: 32px;
    padding: 0 6px;
    font-size: 12px;
  }

  .title {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .title .actions {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .segmented {
    grid-template-columns: repeat(2, 1fr);
  }

  .control-section {
    gap: 10px;
  }

  .server-section label,
  .control-section > label:not(.file):not(.check):not(.slider-row) {
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
  }

  select,
  .server-section input[type="number"] {
    width: 100%;
    height: 36px;
  }

  .event-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .event-nav input {
    grid-column: 1 / -1;
    grid-row: 1;
    height: 36px;
    order: -1;
  }

  .timeline-row {
    grid-template-columns: 68px 1fr 46px;
  }

  .slider-row {
    grid-template-columns: 58px minmax(0, 1fr) 48px;
  }

  .toggles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .track-section {
    max-height: none;
  }

  .track-tree {
    max-height: min(30vh, 220px);
  }
}

@media (max-width: 420px) {
  #panel {
    max-height: 78vh;
    padding-right: 12px;
    padding-left: 12px;
  }

  .timeline-row {
    grid-template-columns: 1fr 46px;
  }

  .timeline-row button {
    grid-column: 1 / -1;
  }

  .server-section label,
  .control-section > label:not(.file):not(.check):not(.slider-row) {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

@media (max-height: 560px) and (max-width: 900px) {
  .panel-toggle {
    display: block;
  }

  #panel {
    top: 8px;
    right: auto;
    bottom: 8px;
    left: 8px;
    width: min(316px, calc(100vw - 16px));
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
  }

  .panel-resize-handle {
    display: none;
  }

  .controls-collapsed #panel {
    display: none;
  }

  .controls-collapsed .panel-toggle {
    bottom: 126px;
  }

  body:not(.controls-collapsed) .panel-toggle {
    top: 12px;
    right: 12px;
    bottom: auto;
    left: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  #panel {
    transition: none;
  }
}
