#app-preview {
  --pv-orange: #ff795c;
  --pv-text: #f7f3ec;
  --pv-dim: #afaca6;
  --pv-edge: #3b3937;
  --pv-font: Instrument, system-ui, sans-serif;
  --pv-mono: var(--mono, ui-monospace, Consolas, monospace);
  width: 100%;
  min-width: 0;
  container-type: inline-size;
  font-family: var(--pv-font);
  text-align: left;
}

#app-preview * { box-sizing: border-box; }
#app-preview [hidden] { display: none !important; }
#app-preview button, #app-preview select, #app-preview input { font-family: inherit; }
#app-preview svg { display: block; width: 1em; height: 1em; flex: none; }
#app-preview button, #app-preview select, #app-preview input[type="range"] { cursor: pointer; }
#app-preview :focus-visible { outline: 2px solid var(--pv-orange); outline-offset: 3px; }

.pv-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 12px; }
.pv-tabs { display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid #d9d1c5; border-radius: 11px; background: #f2ede5; }
.pv-tab, .pv-reset {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  color: #443e39;
  background: transparent;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.pv-tab:hover, .pv-reset:hover { background: #e6ded2; }
.pv-tab[aria-selected="true"] { color: #fff9ef; background: #292725; box-shadow: 0 1px 3px #32271c24; }
.pv-tab[aria-selected="true"] svg { color: var(--pv-orange); }
.pv-tab svg, .pv-reset svg { font-size: 1rem; }
.pv-reset { min-width: 36px; border: 1px solid #d9d1c5; }

.pv-window {
  overflow: hidden;
  border: 1px solid #4f4942;
  border-radius: 15px;
  color: var(--pv-text);
  background: #191817;
  box-shadow: 0 22px 52px #29201334, 0 4px 8px #211b192c, 0 1px #fff2 inset;
  color-scheme: dark;
}
.pv-titlebar {
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 45px;
  padding: 0 16px;
  border-bottom: 1px solid #45413d;
  background: linear-gradient(100deg, #35312e, #242220 78%);
}
.pv-title { display: flex; align-items: center; gap: 8px; color: #fff6ed; font-size: .87rem; font-weight: 760; letter-spacing: -.025em; white-space: nowrap; }
.pv-mark { display: inline-flex; align-items: flex-end; justify-content: center; gap: 2px; width: 19px; height: 19px; padding: 4px; border-radius: 5px; background: #181614; }
.pv-mark i { width: 2px; height: 55%; border-radius: 3px; background: #feb792; }
.pv-mark i:nth-child(2) { height: 100%; background: var(--pv-orange); }
.pv-mark i:nth-child(3) { height: 75%; background: #7bd7c1; }
.pv-connection { display: flex; align-items: center; gap: 4px; color: #c0bbb4; font: .63rem var(--pv-mono); white-space: nowrap; }
.pv-connection i, .pv-statusbar i { flex: none; width: 6px; height: 6px; margin-right: 3px; border-radius: 50%; background: #8ce2a4; box-shadow: 0 0 8px #8ce2a484; }
.pv-window-controls { display: flex; align-items: center; gap: 14px; margin-left: auto; color: #a59e95; font: .8rem var(--pv-mono); }
.pv-panel { min-height: 377px; }
.pv-statusbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 34px; padding: 0 16px; border-top: 1px solid #383533; background: #211f1d; color: #c6c0b6; font: .63rem var(--pv-mono); }
.pv-statusbar > span:first-child { display: flex; align-items: center; gap: 4px; }
.pv-caption { display: flex; justify-content: space-between; gap: 10px; margin-top: 13px; color: #514943; font-size: .76rem; font-weight: 550; line-height: 1.45; }
.pv-scroll-hint { display: none; }

[data-theme="dark"] .pv-tabs { border-color: var(--control-border); background: var(--surface); }
[data-theme="dark"] .pv-tab, [data-theme="dark"] .pv-reset { color: var(--muted); }
[data-theme="dark"] .pv-tab:hover, [data-theme="dark"] .pv-reset:hover { background: var(--hover); }
[data-theme="dark"] .pv-tab[aria-selected="true"] { color: var(--ink); background: #483127; }
[data-theme="dark"] .pv-reset { border-color: var(--control-border); }
[data-theme="dark"] .pv-caption { color: var(--muted); }

.pv-mixer {
  display: flex;
  gap: 10px;
  padding: 13px 15px 15px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #746a60 #262321;
}
.pv-mix-group { flex: 2 0 0; min-width: 375px; }
.pv-outputs { flex: 1 0 0; min-width: 184px; }
.pv-mix-group h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 7px;
  padding: 0 2px;
  color: #d4cbc0;
  font: 650 .64rem var(--pv-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.pv-mix-group h3 span { color: #a7a099; }
.pv-strips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pv-outputs .pv-strips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pv-strip {
  min-width: 0;
  padding: 10px 8px 8px;
  border: 1px solid #484541;
  border-radius: 8px;
  background: linear-gradient(150deg, #383532, #272624 43%, #242221);
  box-shadow: 0 1px #fff0e415 inset, 0 2px 4px #0005;
}
.pv-strip-head { display: flex; align-items: center; gap: 6px; min-height: 31px; }
.pv-strip-head > div { min-width: 0; }
.pv-strip-head h4 { margin: 0; overflow: hidden; color: #fbf3e9; font-size: .76rem; font-weight: 740; line-height: 1.22; text-overflow: ellipsis; white-space: nowrap; }
.pv-strip-head > div > span { display: block; margin-top: 3px; overflow: hidden; color: var(--pv-dim); font-size: .57rem; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.pv-chip { display: grid; flex: none; width: 27px; height: 27px; place-items: center; border: 1px solid color-mix(in srgb, var(--pv-channel) 30%, transparent); border-radius: 6px; color: var(--pv-channel); background: color-mix(in srgb, var(--pv-channel) 13%, #242221); font-size: .94rem; }
.pv-sends { display: flex; align-items: center; gap: 5px; min-height: 26px; margin: 10px 0 8px; }
.pv-sends button, .pv-bus-tag { min-width: 0; padding: 4px 5px; border: 1px solid #47413b; border-radius: 4px; background: #252322; color: #ccc1b4; font: 650 .6rem/1 var(--pv-mono); }
.pv-sends button { flex: 1; min-height: 25px; }
.pv-sends button:hover { border-color: #87796c; }
.pv-sends button[data-pv-bus="A1"][aria-pressed="true"] { border-color: #f9c980; background: #f7bf75; color: #2a1b11; }
.pv-sends button[data-pv-bus="B2"][aria-pressed="true"] { border-color: #9adbed; background: #79cce1; color: #10242c; }
.pv-bus-tag { padding-inline: 8px; color: var(--pv-channel); }

.pv-fader { display: grid; grid-template-columns: 17px minmax(12px, 18px) 29px; justify-content: center; align-items: stretch; gap: 4px; height: 176px; }
.pv-meter {
  display: flex;
  gap: 2px;
  min-height: 0;
  padding: 4px 2px;
  overflow: hidden;
  border: 1px solid #080808;
  border-radius: 4px;
  background: #101110;
}
.pv-meter i {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: linear-gradient(to top, #203d2b 0%, #253d2d 61%, #463d20 76%, #4a2927 100%);
  mask-image: repeating-linear-gradient(to top, #000 0 2px, transparent 2px 4px);
}
.pv-meter i::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #82e795 0%, #82ef9a 58%, #ffd77f 75%, #f98d72 100%);
  content: "";
  --pv-edge-start: calc(100% - var(--pv-meter-level, 0%));
  clip-path: inset(clamp(0%, var(--pv-edge-start), 100%) 0 0);
  transition: clip-path .14s ease-out;
}
.pv-meter i:nth-child(2)::before { --pv-edge-start: calc(104% - var(--pv-meter-level, 0%)); }
.pv-has-signal .pv-meter i::before { animation: pv-signal 1.45s infinite alternate ease-in-out; }
.pv-has-signal:nth-child(2n) .pv-meter i::before { animation-duration: 1.85s; animation-delay: -.3s; }
.pv-has-signal .pv-meter i:nth-child(2)::before { animation-delay: -.68s; }
@keyframes pv-signal {
  0%, 45% { clip-path: inset(clamp(0%, var(--pv-edge-start), 100%) 0 0); }
  25%, 72% { clip-path: inset(clamp(0%, calc(var(--pv-edge-start) + 4%), 100%) 0 0); }
  100% { clip-path: inset(clamp(0%, calc(var(--pv-edge-start) + 7%), 100%) 0 0); }
}
.pv-scale { position: relative; color: #b9b2aa; font: .51rem var(--pv-mono); }
.pv-scale span { position: absolute; top: calc(10.5px + (100% - 21px) * var(--pv-tick)); right: 0; transform: translateY(-50%); }
.pv-scale span:nth-child(1) { --pv-tick: 0; }
.pv-scale span:nth-child(2) { --pv-tick: .2; color: #faf1e6; }
.pv-scale span:nth-child(3) { --pv-tick: .4; }
.pv-scale span:nth-child(4) { --pv-tick: .6; }
.pv-scale span:nth-child(5) { --pv-tick: 1; }
.pv-gain {
  appearance: none;
  writing-mode: vertical-lr;
  direction: rtl;
  display: block;
  width: 29px;
  height: 100%;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 5px;
  background: linear-gradient(#0d0d0d, #151313) center / 5px 100% no-repeat;
}
.pv-gain::-webkit-slider-runnable-track { width: 5px; height: 100%; }
.pv-gain::-moz-range-track { width: 5px; height: 100%; }
.pv-gain::-webkit-slider-thumb {
  appearance: none;
  width: 26px;
  height: 21px;
  margin-left: -10.5px;
  border: 1px solid #eee6dc;
  border-radius: 4px;
  background: linear-gradient(var(--pv-channel), var(--pv-channel)) center / 64% 2px no-repeat, repeating-linear-gradient(to bottom, #e6dfd74d 0 1px, transparent 1px 4px), linear-gradient(#fbf1e5, #b3aaa0);
  box-shadow: 0 2px 5px #000a, 0 1px #fff inset;
}
.pv-gain::-moz-range-thumb {
  width: 24px;
  height: 19px;
  border: 1px solid #eee6dc;
  border-radius: 4px;
  background: linear-gradient(var(--pv-channel), var(--pv-channel)) center / 64% 2px no-repeat, linear-gradient(#fbf1e5, #b3aaa0);
  box-shadow: 0 2px 5px #000a, 0 1px #fff inset;
}
.pv-readout { margin: 8px 0 7px; color: #fff5e9; text-align: center; font: 650 .78rem/1.3 var(--pv-mono); }
.pv-readout span { color: var(--pv-dim); font-size: .58rem; }
.pv-mute {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-height: 27px;
  padding: 3px;
  border: 1px solid #494541;
  border-radius: 5px;
  color: #e0d7ca;
  background: #34312e;
  font-size: .66rem;
  font-weight: 700;
}
.pv-mute svg { font-size: .83rem; }
.pv-mute:hover { border-color: #928274; }
.pv-mute[aria-pressed="true"] { border-color: #e58c81; color: #ffd4cb; background: #6b322c; }
.pv-muted .pv-fader { opacity: .67; }

.pv-mode-intro h3 { margin: 0; color: #fff5e9; font-size: 1.23rem; font-weight: 750; letter-spacing: -.035em; line-height: 1.2; }
.pv-mode-intro p { margin: 5px 0 0; color: var(--pv-dim); font-size: .8rem; line-height: 1.4; }
.pv-routing, .pv-deck { width: min(100%, 760px); margin-inline: auto; padding: 22px 24px 18px; }
.pv-flow { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(28px, .45fr) minmax(0, .84fr); align-items: end; margin-top: 16px; }
.pv-flow-list h4 { margin: 0 0 9px; color: #d4cbc0; font: 650 .64rem var(--pv-mono); letter-spacing: .09em; text-transform: uppercase; }
.pv-flow-list { display: grid; gap: 8px; }
.pv-flow-node {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 48px;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid #4c4640;
  border-radius: 7px;
  background: linear-gradient(125deg, #37322e, #242221);
}
.pv-node-name { flex: 1; min-width: 0; color: #f9efe2; font-size: .74rem; font-weight: 700; line-height: 1.12; }
.pv-node-name small { display: block; margin-top: 3px; color: var(--pv-dim); font-size: .61rem; font-weight: 500; }
.pv-flow-node select {
  min-width: 0;
  max-width: 47%;
  padding: 4px 3px 4px 6px;
  border: 1px solid #60564d;
  border-radius: 4px;
  color: #f6e9db;
  background: #24211e;
  font-size: .68rem;
}
#app-preview .pv-flow-lines { align-self: end; width: 100%; height: 168px; margin-bottom: -8px; }
.pv-flow-lines path { opacity: .85; }
.pv-routing-note { min-height: 32px; margin: 12px 0 0; padding: 7px 9px; border: 1px solid #3c3833; border-radius: 5px; color: #dbd0c3; background: #211f1d; font-size: .68rem; line-height: 1.4; }

.pv-deck-body { margin-top: 16px; padding: 10px; border: 1px solid #4b4642; border-radius: 11px; background: linear-gradient(145deg, #302d2b, #22211f); box-shadow: 0 1px #fff1 inset, 0 6px 16px #0004; }
.pv-deck-keys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pv-deck-key {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  min-height: 91px;
  min-width: 0;
  padding: 6px 3px;
  border: 1px solid #43413f;
  border-radius: 8px;
  color: #c8c2b9;
  background: linear-gradient(160deg, #232323, #111);
  box-shadow: 0 1px #fff1 inset, 0 2px 3px #0008;
  text-align: center;
}
.pv-deck-key:hover { border-color: var(--pv-key); }
.pv-deck-key > span { font: 700 .53rem/1.2 var(--pv-mono); text-transform: uppercase; }
#app-preview .pv-deck-key svg { width: 24px; height: 24px; color: var(--pv-key); opacity: .76; }
.pv-deck-key strong { min-height: 1.3em; color: #e4d9ce; font-size: .66rem; font-weight: 650; line-height: 1.15; }
.pv-deck-key i { width: min(72%, 40px); height: 3px; border-radius: 99px; background: #42403d; }
.pv-deck-key.pv-lit i { background: var(--pv-key); box-shadow: 0 0 7px color-mix(in srgb, var(--pv-key) 45%, transparent); }
.pv-deck-key.pv-lit svg { opacity: 1; }
.pv-deck-key.pv-key-muted { --pv-key: #ff8a85 !important; }
.pv-deck-dials { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin-top: 8px; }
.pv-deck-dial { min-width: 0; padding: 7px 6px 5px; border: 1px solid #464a4b; border-radius: 5px; background: #171b1d; }
.pv-deck-dial > div { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; column-gap: 4px; color: #ddd5ca; font-size: .64rem; }
.pv-deck-dial strong { color: var(--pv-channel); font: 650 .6rem var(--pv-mono); white-space: nowrap; }
.pv-deck-dial input { display: block; width: 100%; height: 16px; margin: 4px 0 0; accent-color: var(--pv-channel); }

@media (max-width: 730px) {
  .pv-mix-group { min-width: 352px; }
  .pv-outputs { min-width: 178px; }
}

@container (max-width: 567px) {
  #app-preview[data-pv-mode="mixer"] .pv-scroll-hint { display: flex; flex: none; align-items: center; align-self: flex-start; gap: 1px; font-weight: 700; }
}

@media (max-width: 520px) {
  .pv-toolbar { gap: 6px; margin-bottom: 9px; }
  .pv-tabs { flex: 1; gap: 2px; }
  .pv-tab { flex: 1; gap: 4px; padding: 0 5px; font-size: .68rem; }
  .pv-tab svg { font-size: .84rem; }
  .pv-reset { align-self: stretch; min-width: 35px; padding: 0 7px; }
  .pv-reset span { display: none; }
  .pv-titlebar { gap: 10px; min-height: 41px; padding-inline: 11px; }
  .pv-connection { font-size: .57rem; }
  .pv-window-controls { gap: 7px; }
  .pv-panel { min-height: 350px; }
  .pv-mixer { padding: 11px; }
  .pv-mix-group { min-width: 352px; }
  .pv-outputs { min-width: 178px; }
  .pv-strip { padding-inline: 6px; }
  .pv-strip-head { gap: 4px; }
  .pv-strip-head .pv-chip { width: 23px; height: 23px; font-size: .78rem; }
  .pv-strip-head h4 { font-size: .69rem; }
  .pv-fader { height: 167px; }
  .pv-statusbar { padding-inline: 11px; }
  .pv-caption { font-size: .7rem; }
  .pv-routing, .pv-deck { padding: 16px 11px 12px; }
  .pv-flow { grid-template-columns: minmax(0, 1.65fr) 20px minmax(0, 1fr); }
  .pv-flow-node { gap: 4px; padding-inline: 5px; }
  .pv-flow-node .pv-chip { display: none; }
  .pv-flow-target .pv-chip { display: grid; width: 20px; height: 20px; font-size: .72rem; }
  .pv-flow-list h4 { font-size: .59rem; }
  .pv-node-name { font-size: .68rem; }
  .pv-node-name small { font-size: .55rem; }
  .pv-flow-node select { max-width: 52%; padding-inline: 2px; font-size: .61rem; }
  .pv-deck-key { min-height: 69px; gap: 3px; }
  #app-preview .pv-deck-key svg { width: 19px; height: 19px; }
  .pv-deck-dial { padding-inline: 4px; }
  .pv-deck-dial > div { display: block; }
  .pv-deck-dial strong { display: block; margin-top: 2px; }
}

@media (max-width: 340px) {
  .pv-tab svg { display: none !important; }
  .pv-window-controls { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pv-meter i::before, .pv-has-signal .pv-meter i::before { animation: none; transition: none; }
}
