@font-face {
  font-family: Inter Tight;
  src: url("./fonts/InterTight-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Inter Tight;
  src: url("./fonts/InterTight-SemiBold.ttf") format("truetype");
  font-weight: 600 800;
  font-display: swap;
}
@font-face {
  font-family: Inter Tight;
  src: url("./fonts/InterTight-Black.ttf") format("truetype");
  font-weight: 900;
  font-display: swap;
}
@font-face {
  font-family: Silkscreen Cyrillic;
  src: url("./fonts/SoundstageSilkscreenCyrillic.ttf") format("truetype");
  font-display: swap;
}
:root {
  color-scheme: dark;
  --ink: #0d0d0d;
  --paper: #f0efea;
  --red: #e31b2b;
  --panel: #21211f;
  --line: #494944;
  --muted: #a5a49d;
  --pixel: "Silkscreen Cyrillic", monospace;
  font-family: "Inter Tight", sans-serif;
  font-size: 16px;
  background: var(--ink);
  color: var(--paper);
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
select {
  background: var(--panel);
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 2px;
  min-height: 44px;
  padding: 10px 12px;
  max-width: 100%;
  font: inherit;
}
.masthead,
.quick-access,
.music-dock,
.scene-mini,
dialog,
.transport:not(.youtube) {
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "masthead" "scene" "main" "quick" "music" "footer";
  grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
button,
input,
select {
  font: inherit;
}
button,
a,
input {
  touch-action: manipulation;
}
button {
  color: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  min-height: 44px;
  padding: 10px 16px;
  font-weight: 600;
  transition: transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1);
}
button:disabled {
  cursor: wait;
  opacity: 0.45;
}
button:active {
  transform: translateY(1px);
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}
button:focus:not(:focus-visible) {
  outline: none;
}
button svg {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  flex-shrink: 0;
}
a {
  color: inherit;
  text-underline-offset: 3px;
}
input[type="range"] {
  accent-color: var(--red);
  width: 100%;
  height: 24px;
  cursor: pointer;
  min-width: 0;
}
input[type="text"],
input[type="url"],
input[type="search"] {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 12px;
  min-height: 48px;
  width: 100%;
  min-width: 0;
}
input[type="checkbox"] {
  accent-color: var(--red);
  width: 18px;
  height: 18px;
}
label {
  cursor: pointer;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-weight: 900;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.04;
  text-transform: uppercase;
  letter-spacing: -0.03em;
}
h1 .dot {
  color: var(--red);
}
h2 {
  font-weight: 900;
  font-size: 24px;
  line-height: 1.15;
}
h3 {
  font-size: 19px;
  font-weight: 900;
}
.muted {
  color: var(--muted);
}
.meta {
  font-family: var(--pixel);
  font-size: 10px;
  line-height: 1.7;
  letter-spacing: 0.07em;
}
.red-text {
  color: var(--red);
}
.text-btn {
  border: 0;
  padding: 4px 0;
  text-align: left;
}
.icon-btn {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.red,
.primary {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.primary {
  min-width: 120px;
}
.light {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}
.subtle {
  border-color: var(--line);
}
.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.kicker {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 10px;
  color: var(--muted);
}
.kicker b {
  color: var(--red);
  font-weight: 400;
}
.empty {
  color: var(--muted);
  padding: 28px 0;
  font-size: 15px;
  line-height: 1.6;
}
.divider {
  border-top: 1px dashed var(--line);
  margin: 24px 0;
}
.masthead {
  grid-area: masthead;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  background: var(--paper);
  color: var(--ink);
  padding: 10px 22px;
  flex-shrink: 0;
  z-index: 4;
  border-bottom: 1px solid #c5c4be;
}
.brand {
  padding: 0;
  border: 0;
  text-align: left;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
}
.brand strong {
  font-size: 32px;
  font-style: italic;
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -1px;
}
.brand strong span {
  color: var(--red);
}
.brand small {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.global-controls {
  display: flex;
  gap: 6px;
}
.masthead .icon-btn {
  border-color: var(--ink);
}
.masthead .red {
  border-color: var(--red);
}
#library-toggle svg {
  transition: transform 0.28s ease;
}
#library-toggle.is-library svg {
  transform: rotate(45deg);
}
.master {
  width: 148px;
  grid-column: 2;
  grid-row: 1;
}
.global-controls {
  grid-column: 3;
  grid-row: 1;
}
.master label {
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.master input {
  display: block;
  height: 22px;
  margin: 1px 0 0;
}
#main {
  grid-area: main;
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  outline: none;
}
.page {
  padding: 24px;
  max-width: 1440px;
  margin: 0 auto;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
}
.workspace {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
.workspace .page {
  width: 100%;
  flex: 1;
}
.table-tools {
  display: flex;
  gap: 8px;
}
.mood-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 10px;
}
.mood-card {
  border: 1px solid var(--line);
  background: var(--panel);
  min-height: 122px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px;
  position: relative;
  overflow: hidden;
}
.mood-card.playing {
  border-left: 3px solid var(--red);
}
.mood-main {
  border: 0;
  border-radius: 0;
  min-width: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
}
.mood-main strong {
  font-size: 21px;
  font-weight: 900;
  font-style: italic;
  line-height: 1.1;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.mood-main .mood-title {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.mood-main svg {
  width: 13px;
  height: 16px;
  margin-top: 3px;
}
.mood-main small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.mood-art {
  background: #161614;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  position: relative;
}
.mood-art img {
  width: 100%;
  height: 100%;
  position: absolute;
  object-fit: cover;
  opacity: 0.45;
  pointer-events: none;
}
.mood-art .icon-btn {
  z-index: 1;
  border: 0;
  color: var(--paper);
  background: rgba(13, 13, 13, 0.2);
}
.mood-art .favorite {
  color: var(--paper);
}
.favorite svg {
  fill: currentColor;
}
.drag-handle {
  touch-action: none;
  cursor: grab;
  opacity: 0.65;
}
.drag-source {
  opacity: 0.25;
}
.drop-target {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}
.drag-preview {
  position: fixed;
  pointer-events: none;
  z-index: 30;
  width: 260px;
  opacity: 0.9;
  box-shadow: 0 10px 30px #0008;
  transform: rotate(-1deg);
}
.quick-access {
  padding: 14px 24px 16px;
  background: var(--paper);
  color: var(--ink);
  flex-shrink: 0;
}
.quick-access header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 600;
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
.quick {
  min-width: 0;
  padding: 9px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-size: 12px;
  border-color: #b7b6af;
  min-height: 44px;
}
.quick span {
  color: var(--red);
  font-family: var(--pixel);
  font-size: 12px;
}
.quick strong {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quick.unassigned {
  border-style: dashed;
  color: #6b6b65;
}
.quick.unassigned span {
  color: #6b6b65;
}
.quick-access .text-btn {
  font-size: 12px;
  min-height: 30px;
}
.library {
  display: grid;
  grid-template-columns: 174px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
#main.library-open {
  overflow: hidden;
  scrollbar-gutter: auto;
}
.library-nav {
  border-right: 1px solid var(--line);
  padding: 22px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  overflow: auto;
}
.library-nav .meta {
  margin: 0 10px 12px;
}
.library-nav button {
  border: 0;
  text-align: left;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 12px;
  font-size: 15px;
  white-space: nowrap;
}
.library-nav .selected {
  border-left: 3px solid var(--red);
  padding-left: 9px;
  background: var(--panel);
}
.library-nav small {
  color: var(--muted);
  font-size: 12px;
}
.library-body.page {
  flex: 1;
  min-width: 0;
  min-height: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.library-heading {
  flex-shrink: 0;
  padding: 24px 24px 0;
}
.library-heading .page-head {
  height: 96px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.library-heading .page-head > div {
  min-width: 0;
}
.library-heading h1 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.library-heading [data-tab="locations"] svg {
  rotate: 90deg;
}
.library-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 0 24px 24px;
}
.effect-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 16px;
}
.effect-filters .search {
  max-width: none;
  margin: 0;
}
.library .mood-card {
  height: 138px;
}
.library .mood-main {
  gap: 8px;
}
.library .mood-main strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.library .mood-main small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.section-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 18px;
}
.section-tabs button {
  white-space: nowrap;
}
.section-tabs .selected {
  background: var(--red);
  border-color: var(--red);
  color: white;
}
.pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 12px;
  align-content: start;
}
.pack-card {
  border: 1px solid var(--line);
  min-width: 0;
  background: var(--panel);
  position: relative;
  height: 248px;
}
.pack-open {
  display: block;
  border: 0;
  text-align: left;
  padding: 0;
  width: 100%;
  height: 100%;
}
.pack-cover {
  height: 130px;
  position: relative;
  background: #191917;
  overflow: hidden;
}
.pack-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
}
.pack-cover .meta {
  position: absolute;
  left: 14px;
  bottom: 12px;
  color: var(--paper);
}
.pack-info {
  padding: 15px;
  height: 116px;
}
.pack-info strong {
  font-size: 23px;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  height: 49px;
  line-height: 1.05;
  margin-bottom: 10px;
}
.pack-info small {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}
.pack-delete {
  position: absolute;
  right: 8px;
  top: 8px;
  background: #0d0d0d99;
  border: 0;
}
.import-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}
.import-card {
  border: 1px solid var(--line);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  background: var(--panel);
  height: 270px;
}
.import-card > .actions,
.import-card > button {
  margin-top: auto;
}
.import-card .meta {
  color: var(--red);
}
.import-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  max-width: 34em;
}
.storage-panel {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
.storage-panel small {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.storage-panel .actions {
  font-size: 13px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0 14px;
}
.search {
  max-width: 400px;
  margin-bottom: 18px;
}
.list {
  border-top: 1px solid var(--line);
}
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  height: 76px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.list-row .row-title {
  flex: 1;
  min-width: 0;
}
.row-title strong {
  font-size: 17px;
  font-weight: 600;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-title small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
}
.list-row .icon-btn {
  flex-shrink: 0;
}
.list-row .selected {
  color: var(--red);
  border-color: var(--red);
}
.source-dot {
  height: 8px;
  width: 8px;
  flex-shrink: 0;
  background: #aaa99f;
}
.source-dot.youtube {
  background: var(--red);
}
.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.add-to-table {
  font-size: 13px;
  white-space: nowrap;
  padding: 9px 12px;
}
.effect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 8px;
}
.effect-row {
  border: 1px solid var(--line);
  display: flex;
  min-width: 0;
  height: 78px;
}
.effect-row > button:first-child {
  border: 0;
  flex: 1;
  min-width: 0;
  text-align: left;
  padding: 14px;
}
.effect-row strong {
  display: block;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}
.effect-row small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.effect-row .icon-btn {
  border: 0;
  align-self: center;
}
.count {
  font-weight: 400;
  color: var(--muted);
  font-size: 14px;
}
.scene-mini {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 12px 24px;
  background: var(--paper);
  color: var(--ink);
}
#quick-dock {
  grid-area: quick;
  min-width: 0;
  flex-shrink: 0;
}
#scene-dock {
  grid-area: scene;
  min-width: 0;
}
#main.music-open {
  scroll-padding-top: 0;
}
.scene-mini .row-title {
  flex: 1;
  min-width: 0;
}
.scene-mini small {
  font-family: var(--pixel);
  font-size: 9px;
}
.scene-mini strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
}
.scene-mini .icon-btn {
  border-color: var(--ink);
}
.music-dock {
  grid-area: music;
  min-width: 0;
  background: var(--paper);
  color: var(--ink);
  flex-shrink: 0;
  border-top: 1px solid #b5b4ae;
}
.dock-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  border: 0;
  padding: 9px 24px;
  border-radius: 0;
}
.dock-heading .meta {
  font-size: 11px;
}
.dock-heading .track-summary {
  font-family: "Inter Tight", sans-serif;
  font-size: 13px;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dock-controls {
  display: flex;
  gap: 12px;
  padding: 0;
  align-items: center;
}
.dock-controls .row-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
}
.dock-controls .row-title strong {
  font-size: 14px;
}
.dock-controls .icon-btn {
  border-color: var(--ink);
}
.dock-body {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 24px 12px;
}
.dock-body:not(:has(.dock-controls)) {
  display: none;
}
.dock-tracks {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.youtube-compact .quick-access {
  padding-top: 7px;
  padding-bottom: 7px;
}
.youtube-compact .quick-grid {
  display: flex;
  overflow-x: auto;
  padding-bottom: 4px;
}
.youtube-compact .quick {
  flex: 1 0 60px;
  min-height: 44px;
  flex-direction: row;
  align-items: center;
  gap: 7px;
}
.youtube-compact .quick strong {
  max-width: 90px;
}
.youtube-compact .quick-access header {
  margin-bottom: 4px;
}
.transport-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.transport {
  border: 1px solid var(--line);
  padding: 18px;
  background: var(--paper);
  color: var(--ink);
  min-width: 0;
}
.transport.youtube {
  background: var(--panel);
  color: var(--paper);
}
.transport h2 {
  font-size: 22px;
  margin: 8px 0 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.transport .meta {
  color: var(--red);
}
.transport .icon-btn {
  border-color: currentColor;
}
.transport-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.transport-controls label {
  font-size: 13px;
  display: flex;
  gap: 5px;
  align-items: center;
  margin-left: auto;
}
.seek-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  font-size: 12px;
}
.volume-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 6px;
  font-size: 12px;
}
.volume-row input {
  max-width: 180px;
}
.volume-row output {
  min-width: 32px;
}
.youtube-placeholder {
  width: 100%;
  height: 200px;
  margin-top: 16px;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
}
.youtube-placeholder.youtube-mini {
  flex: 0 0 200px;
  width: 200px;
  height: 200px;
  margin: 0;
}
#youtube-host {
  position: fixed;
  z-index: 5;
  background: #000;
}
#youtube-host iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
footer {
  grid-area: footer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 24px calc(4px + env(safe-area-inset-bottom));
  gap: 16px;
  color: var(--muted);
  font-size: 11px;
  flex-shrink: 0;
  min-height: 23px;
}
footer a {
  text-decoration: none;
}
#connection {
  font-size: 10px;
}
.layer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.layer {
  border: 1px solid var(--line);
  padding: 14px;
}
.layer-top {
  display: flex;
  gap: 12px;
  align-items: center;
}
.layer-top strong {
  font-size: 16px;
  font-weight: 600;
  flex: 1;
  overflow-wrap: anywhere;
}
.layer-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.layer-controls output {
  font-size: 13px;
  min-width: 40px;
  text-align: right;
}
.layer .enabled {
  background: var(--red);
  border-color: var(--red);
  color: white;
}
.layers-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(380px, calc(100% - 24px));
  max-width: none;
  height: 100%;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom)
    env(safe-area-inset-left);
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  color-scheme: dark;
  overflow: hidden;
  transform: translateX(-100%);
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}
.layers-drawer[open] {
  display: flex;
  flex-direction: column;
}
.layers-drawer.is-open {
  transform: translateX(0);
}
.layers-drawer::backdrop {
  opacity: 0;
  background: #0009;
  backdrop-filter: blur(3px);
  transition: opacity 240ms ease;
}
.layers-drawer.is-open::backdrop {
  opacity: 1;
}
.drawer-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 {
  font-size: 32px;
  text-transform: uppercase;
}
.drawer-head .meta {
  color: var(--red);
  font-size: 10px;
}
.drawer-content {
  flex: 1;
  min-height: 0;
  padding: 20px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.drawer-content > p {
  font-size: 13px;
  margin-bottom: 18px;
}
dialog {
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  padding: 24px;
  max-width: 640px;
  width: calc(100% - 32px);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  scrollbar-gutter: stable;
}
dialog::backdrop {
  background: #000b;
  backdrop-filter: blur(5px);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 22px;
}
.dialog-head h2 {
  font-size: 28px;
  text-transform: uppercase;
}
.dialog-head .icon-btn {
  border-color: var(--ink);
}
.dialog-body p {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 15px;
}
.dialog-body .actions {
  margin-top: 22px;
}
.dialog-body label.field {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 16px 0 6px;
}
.dialog-body input[type="text"],
.dialog-body input[type="url"] {
  background: white;
  color: var(--ink);
  border-color: #999;
}
.dialog-body .layer {
  border-color: #aaa;
}
.dialog-body .layer .icon-btn {
  border-color: var(--ink);
}
.dialog-body .meta {
  font-size: 10px;
}
.dialog-body .muted {
  color: #686860;
}
.dialog-body .list-row {
  border-color: #b7b6af;
}
.dialog-body .row-title small {
  color: #686860;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(32px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 40;
  background: var(--paper);
  color: var(--ink);
  padding: 14px 18px;
  border-left: 4px solid var(--red);
  box-shadow: 0 5px 30px #0005;
  width: max-content;
  max-width: calc(100% - 28px);
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
}
#toast[hidden] {
  display: none;
}
.busy-bar {
  height: 3px;
  background: var(--red);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  animation: pulse 1s ease-in-out infinite alternate;
}
.import-progress {
  font-size: 14px;
  color: var(--muted);
  min-height: 21px;
  margin-top: 16px;
  white-space: pre-wrap;
}
.danger {
  border-color: var(--red);
  color: var(--red);
}
.wake-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
@media (hover: hover) {
  button:not(:disabled):hover {
    transform: translateY(-1px);
  }
}
@media (max-width: 760px) {
  .masthead {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 14px 16px 10px;
    gap: 12px;
  }
  .brand strong {
    font-size: 30px;
  }
  .brand small {
    font-size: 11px;
    max-width: 190px;
  }
  .global-controls {
    grid-column: 2;
    gap: 4px;
  }
  .global-controls .icon-btn {
    width: 40px;
    height: 40px;
    padding: 9px;
    min-height: 40px;
  }
  .master {
    grid-column: 1/-1;
    grid-row: 2;
    display: flex;
    align-items: center;
    gap: 14px;
    width: auto;
  }
  .master label {
    min-width: 116px;
    gap: 12px;
  }
  .master input {
    max-width: 280px;
    flex: 1;
  }
  .page {
    padding: 22px 16px;
  }
  .page-head {
    margin-bottom: 20px;
    align-items: flex-start;
  }
  .kicker {
    gap: 9px;
    margin-bottom: 10px;
  }
  .kicker .meta {
    font-size: 9px;
  }
  .table-tools .icon-btn {
    width: 42px;
    height: 42px;
  }
  .mood-grid {
    gap: 9px;
  }
  .mood-card {
    min-height: 116px;
    grid-template-columns: minmax(0, 1fr) 78px;
  }
  .mood-main {
    padding: 14px;
  }
  .mood-main strong {
    font-size: 21px;
  }
  .quick-access {
    padding: 12px 16px;
  }
  .quick-grid {
    gap: 5px;
  }
  .quick {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding: 8px;
    min-height: 56px;
  }
  .quick strong {
    max-width: 100%;
    font-size: 10px;
  }
  .quick span {
    font-size: 11px;
  }
  .quick-access header {
    font-size: 12px;
    margin-bottom: 8px;
  }
  .quick-access .text-btn {
    font-size: 11px;
  }
  .library {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .library-nav {
    position: sticky;
    z-index: 3;
    top: 0;
    background: var(--ink);
    flex-direction: row;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 8px 12px 0;
    gap: 4px;
    overflow-x: auto;
    flex-shrink: 0;
  }
  .library-nav .meta {
    display: none;
  }
  .library-nav button {
    padding: 11px 10px;
    font-size: 13px;
    min-height: 46px;
    border-bottom: 3px solid transparent;
  }
  .library-nav .selected {
    border-left: 0;
    border-bottom-color: var(--red);
    padding-left: 10px;
    background: none;
  }
  .library-nav small {
    display: none;
  }
  .library-heading {
    padding: 20px 16px 0;
  }
  .library-heading .page-head {
    height: 86px;
    margin-bottom: 12px;
  }
  .library-scroll {
    padding: 0 16px 20px;
  }
  .effect-filters {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding-bottom: 12px;
  }
  .import-grid {
    grid-template-columns: 1fr;
  }
  .import-card {
    padding: 18px;
  }
  .import-card h2 {
    font-size: 23px;
  }
  .storage-panel {
    align-items: flex-start;
  }
  .pack-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .pack-cover {
    height: 110px;
  }
  .pack-card {
    height: 226px;
  }
  .pack-info {
    padding: 12px;
  }
  .pack-info strong {
    font-size: 19px;
    line-height: 20px;
    height: 40px;
  }
  .pack-info small {
    font-size: 11px;
  }
  .pack-delete {
    right: 2px;
    top: 2px;
    width: 38px;
    height: 38px;
    min-height: 38px;
  }
  .list-row {
    gap: 9px;
    padding: 12px 0;
  }
  .row-title strong {
    font-size: 15px;
  }
  .row-title small {
    font-size: 11px;
  }
  .add-to-table {
    font-size: 11px;
    padding: 8px;
    min-width: 0;
  }
  .row-actions {
    gap: 4px;
  }
  .row-actions .icon-btn {
    width: 38px;
    height: 40px;
    min-height: 40px;
    padding: 8px;
  }
  .transport-grid {
    grid-template-columns: 1fr;
  }
  .transport {
    padding: 16px;
  }
  .transport h2 {
    font-size: 20px;
  }
  .scene-mini {
    padding: 10px 16px;
  }
  .scene-mini .row-title strong {
    max-width: calc(100vw - 175px);
  }
  .scene-mini .icon-btn {
    width: 40px;
    height: 40px;
    min-height: 40px;
  }
  .dock-heading {
    padding: 11px 16px;
    gap: 12px;
  }
  .dock-heading .track-summary {
    font-size: 12px;
  }
  .dock-controls {
    gap: 8px;
  }
  .dock-body {
    padding: 0 12px 12px;
    gap: 8px;
  }
  .youtube-compact .dock-controls {
    flex-wrap: wrap;
  }
  .youtube-compact .dock-controls .row-title {
    flex-basis: 100%;
  }
  .dock-controls .row-title strong {
    font-size: 13px;
  }
  .dock-controls .icon-btn {
    width: 40px;
    height: 40px;
    min-height: 40px;
  }
  .dock-heading .meta {
    font-size: 10px;
  }
  footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  dialog {
    padding: 20px 16px;
  }
  .dialog-head h2 {
    font-size: 25px;
  }
  .search {
    max-width: none;
  }
  .layer {
    padding: 12px;
  }
  .page-head .text-btn {
    font-size: 13px;
  }
  .section-tabs button {
    font-size: 13px;
  }
  .actions button {
    font-size: 14px;
  }
}
@media (max-width: 375px) {
  .masthead {
    padding-left: 12px;
    padding-right: 12px;
  }
  .global-controls .icon-btn {
    width: 36px;
    min-height: 40px;
    padding: 7px;
  }
  .brand small {
    max-width: 155px;
  }
  .brand strong {
    font-size: 28px;
  }
  .page {
    padding: 20px 12px;
  }
  .quick-access {
    padding: 10px 12px;
  }
  .quick strong {
    font-size: 9px;
  }
  .quick-access header {
    font-size: 11px;
  }
  .quick {
    padding: 7px 5px;
  }
  .pack-info strong {
    font-size: 17px;
  }
}
@media (max-height: 480px) and (orientation: landscape) {
  .masthead {
    grid-template-columns: minmax(0, 1fr) 148px auto;
    padding: 7px 16px;
  }
  .global-controls {
    grid-column: 3;
    grid-row: 1;
  }
  .master {
    grid-column: 2;
    grid-row: 1;
    display: block;
    width: 148px;
  }
  .master label {
    min-width: 0;
  }
  .brand small {
    display: none;
  }
  .brand strong {
    font-size: 28px;
  }
  .quick-access {
    padding: 7px 16px;
  }
  .quick-grid {
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }
  .quick {
    min-height: 42px;
    gap: 4px;
    padding: 6px;
  }
  .quick-access header {
    margin-bottom: 4px;
  }
  .page {
    padding-top: 16px;
  }
  .page-head {
    margin-bottom: 16px;
  }
  .dock-heading {
    min-height: 40px;
    padding-top: 7px;
    padding-bottom: 7px;
  }
  .youtube-compact {
    grid-template-columns: minmax(0, 1fr) 224px;
    grid-template-areas: "masthead masthead" "main music" "quick music" "footer footer";
    grid-template-rows: auto minmax(0, 1fr) auto auto;
  }
  .youtube-compact .masthead {
    grid-column: 1 / -1;
  }
  .youtube-compact #main {
    grid-row: 2;
    grid-column: 1;
  }
  .youtube-compact #quick-dock {
    grid-row: 3;
    grid-column: 1;
  }
  .youtube-compact #music-dock {
    grid-row: 2 / 4;
    grid-column: 2;
    min-height: 0;
    border-left: 1px solid var(--line);
    overflow: auto;
  }
  .youtube-compact .dock-heading {
    padding: 7px 12px;
  }
  .youtube-compact .dock-heading .track-summary {
    display: none;
  }
  .youtube-compact .dock-body {
    display: block;
    padding: 0 11px 8px;
  }
  .youtube-compact .dock-tracks {
    margin-top: 8px;
    gap: 8px;
  }
  .youtube-compact .dock-controls {
    gap: 5px;
  }
  .youtube-compact .dock-controls .row-title {
    flex-basis: 0;
  }
  .youtube-compact .dock-controls .icon-btn {
    width: 36px;
    height: 36px;
    min-height: 36px;
  }
  .youtube-compact footer {
    grid-column: 1 / -1;
    grid-row: 4;
  }
  .library-heading {
    padding-top: 12px;
  }
  .library-heading .page-head {
    height: 62px;
    margin-bottom: 8px;
  }
  .library-heading h1 {
    font-size: 28px;
    -webkit-line-clamp: 1;
  }
  .effect-filters {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@keyframes pulse {
  from {
    opacity: 0.35;
  }
  to {
    opacity: 1;
  }
}
