/* Page layout: one screen on a laptop (header, two panes, dock), panels laid over the panes. */
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font: 15px / 1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
.sprite {
  position: absolute;
  width: 0;
  height: 0;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  margin: 0;
  white-space: nowrap;
}

.top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px 0;
}
.top .tabs {
  margin-left: auto;
}
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  padding: 0 20px;
}
.pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.pane-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
}

.panel {
  position: absolute;
  inset: 0 20px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.995);
  transition:
    opacity var(--med) var(--ease),
    transform var(--med) var(--ease),
    visibility 0s var(--med);
}
.panel.open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 18px;
  border-bottom: 1px solid var(--line);
}
.panel-head .close {
  margin-left: auto;
}
.panel-head .seg,
.panel-head .filters {
  margin-left: 4px;
}
.panel-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.dock {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 20px 16px;
}
.transport {
  display: flex;
  align-items: center;
  gap: 8px;
}
.transport input[type="range"] {
  flex: 1;
  min-width: 80px;
  margin-left: 8px;
}
.options {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px 20px;
}
.group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 9;
  margin: 0;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 10px);
  transition:
    opacity var(--med) var(--ease),
    transform var(--med) var(--ease),
    visibility 0s var(--med);
}
.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition-delay: 0s;
}

/* Header, narrowing step by step: tagline first, then the build chip, then the GitHub link. */
.top > *,
.actions > * {
  flex: none;
  white-space: nowrap;
}
@media (max-width: 1100px) {
  .brand .tag {
    display: none;
  }
}
@media (max-width: 1240px) {
  .options {
    gap: 10px 16px;
  }
  .dock .seg label {
    padding: 0 8px;
  }
}
@media (max-width: 1040px) {
  .top .release {
    display: none;
  }
}
@media (max-width: 899px), (max-height: 559px) {
  body {
    display: block;
    height: auto;
    overflow: auto;
  }
  .top {
    flex-wrap: wrap;
    padding-bottom: 14px;
  }
  .top .brand {
    margin-right: auto;
  }
  .top .tabs {
    order: 3;
    width: 100%;
    margin-left: 0;
  }
  .tab {
    flex: 1;
  }
  .options,
  .group,
  .group .seg {
    width: 100%;
  }
  .slide,
  .slide:has(.rand) {
    max-width: none;
  }
  .dock .seg {
    grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  }
  .dock .seg label {
    padding: 0;
    font-size: 11.5px;
  }
  .transport {
    flex-wrap: wrap;
  }
  .transport input[type="range"] {
    flex-basis: 100%;
    order: 9;
    margin: 4px 0 0;
  }
  #pos-out {
    margin-left: auto;
  }
  .stage {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
  }
  .pane {
    height: 56svh;
    min-height: 260px;
  }
  .panel {
    position: fixed;
    inset: 12px;
  }
  .dock {
    padding-top: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .panel,
  .toast {
    transition: none;
  }
}
