:root {
  --surface: #151718;
  --editor-panel: #1f2223;
  --play-panel: #1e2121;
  --editor-edge: #444947;
  --play-edge: #494f4b;
  --text: #f2ecdc;
  --muted: #9a9f97;
  --warning: #eb6f5c;
  --outer: #191c1c;
  --ink: #0a0c0d;
  --left-blob: #63b8ee;
  --linked-blob: #80d6a6;
  --right-blob: #ecbb5a;
  --shadow: rgba(0, 0, 0, 0.38);
  --edge-soft: rgba(242, 236, 220, 0.08);
  --edge-strong: rgba(128, 214, 166, 0.32);
  --header-height: 48px;
  --radius: 8px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(31, 34, 35, 0.28), rgba(21, 23, 24, 0.0) 260px),
    var(--outer);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

a {
  color: inherit;
}

.plugin-page {
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow: auto;
  padding: 22px 14px;
  background: var(--surface);
  border-right: 1px solid rgba(73, 79, 75, 0.86);
  box-shadow: 12px 0 32px rgba(0, 0, 0, 0.24);
}

.rail-title {
  margin: 0 0 18px;
  padding: 0 7px;
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
}

.rail a.rail-title {
  margin: 0 0 18px;
  padding: 0 7px;
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  text-transform: none;
}

.rail a {
  display: block;
  margin: 0 0 6px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: rgba(154, 159, 151, 0.92);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
}

.rail a:hover,
.rail a:focus-visible {
  color: var(--text);
  background: rgba(128, 214, 166, 0.12);
  border-color: rgba(128, 214, 166, 0.36);
  outline: none;
}

.manual {
  width: min(1120px, calc(100vw - 184px));
  margin: 0 auto;
  padding: 22px 24px 56px;
}

.plugin-header {
  display: flex;
  align-items: center;
  min-height: 76px;
  margin-bottom: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid rgba(68, 73, 71, 0.86);
  border-radius: var(--radius);
  box-shadow: 0 16px 36px var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 14px;
}

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--ink);
  border: 1px solid rgba(242, 236, 220, 0.12);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 2px;
  color: var(--text);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.05;
}

.brand p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mode-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.button,
.preset-box,
.bpm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 11px;
  border: 1px solid rgba(242, 236, 220, 0.10);
  border-radius: 5px;
  background: rgba(31, 34, 35, 0.78);
  color: rgba(242, 236, 220, 0.92);
  box-shadow: inset 0 1px 0 rgba(242, 236, 220, 0.04);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.button.green {
  color: var(--text);
  border-color: rgba(128, 214, 166, 0.42);
  background: rgba(128, 214, 166, 0.14);
}

.button.yellow {
  color: var(--text);
  border-color: rgba(236, 187, 90, 0.48);
  background: rgba(236, 187, 90, 0.15);
}

.button.warning {
  color: var(--text);
  border-color: rgba(235, 111, 92, 0.46);
  background: rgba(235, 111, 92, 0.13);
}

.button.arrow {
  width: 26px;
  padding: 0;
}

.preset-box {
  min-width: 112px;
  justify-content: flex-start;
  background: rgba(21, 23, 24, 0.78);
  border-color: rgba(68, 73, 71, 0.9);
}

.bpm {
  color: rgba(242, 236, 220, 0.86);
  background: rgba(242, 236, 220, 0.045);
}

.panel {
  margin-top: 14px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(242, 236, 220, 0.018), rgba(0, 0, 0, 0)),
    var(--editor-panel);
  border: 1px solid rgba(68, 73, 71, 0.78);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.20);
  scroll-margin-top: 16px;
}

.manual-shot {
  margin: 16px 0 18px;
}

.manual-shot img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--ink);
  border: 1px solid rgba(128, 214, 166, 0.24);
  border-radius: var(--radius);
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.30),
    inset 0 1px 0 rgba(242, 236, 220, 0.05);
}

.manual-shot figcaption {
  width: 100%;
  margin: 8px 0 0;
  padding: 0 2px;
  color: rgba(242, 236, 220, 0.76);
  font-size: 12.5px;
  line-height: 1.42;
}

.manual-shot figcaption strong {
  color: var(--right-blob);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.manual-shot--hero {
  margin: 0 0 16px;
}

.manual-shot--hero img {
  border-color: rgba(236, 187, 90, 0.50);
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(236, 187, 90, 0.12);
}

.manual-shot--strip img,
.manual-shot--compact img {
  border-radius: 7px;
}

.manual-shot--compact {
  max-width: 520px;
}

.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: start;
  gap: 14px;
  margin: 16px 0 18px;
}

.shot-grid .manual-shot {
  margin: 0;
}

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

.section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(242, 236, 220, 0.07);
  padding-bottom: 10px;
}

.number {
  color: var(--right-blob);
  font-size: 12px;
  font-weight: 800;
}

h2 {
  margin-bottom: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

p {
  max-width: 82ch;
  margin-bottom: 12px;
  color: rgba(242, 236, 220, 0.88);
}

table {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
  background: rgba(21, 23, 24, 0.34);
  border: 1px solid rgba(242, 236, 220, 0.06);
  border-radius: 7px;
  overflow: hidden;
}

th,
td {
  padding: 9px 11px;
  border-bottom: 1px solid rgba(242, 236, 220, 0.06);
  vertical-align: top;
}

th {
  background: rgba(10, 12, 13, 0.34);
  color: rgba(154, 159, 151, 0.96);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
  text-transform: uppercase;
}

td {
  color: rgba(242, 236, 220, 0.87);
  font-size: 13px;
}

td:first-child {
  width: 28%;
  color: var(--text);
  font-weight: 800;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.plain-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: rgba(242, 236, 220, 0.88);
}

.plain-list li {
  margin: 5px 0;
}

.control-map {
  display: grid;
  grid-template-columns: repeat(6, minmax(96px, 1fr));
  grid-auto-rows: minmax(72px, auto);
  gap: 8px;
  margin: 16px 0;
  padding: 12px;
  background: var(--play-panel);
  border: 1px solid rgba(73, 79, 75, 0.72);
  border-radius: var(--radius);
}

.control-map .meter {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  border: 1px solid rgba(128, 214, 166, 0.28);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(128, 214, 166, 0.11), rgba(99, 184, 238, 0.05)),
    rgba(21, 23, 24, 0.66);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.control-map .meter span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: none;
}

.control-map .control {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  border-radius: 7px;
  border: 1px solid rgba(242, 236, 220, 0.08);
  background: rgba(21, 23, 24, 0.58);
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.control-map .control.blue {
  border-color: rgba(99, 184, 238, 0.30);
  box-shadow: inset 0 0 0 999px rgba(99, 184, 238, 0.045);
}

.control-map .control.green {
  border-color: rgba(128, 214, 166, 0.34);
  box-shadow: inset 0 0 0 999px rgba(128, 214, 166, 0.055);
}

.control-map .control.yellow {
  border-color: rgba(236, 187, 90, 0.34);
  box-shadow: inset 0 0 0 999px rgba(236, 187, 90, 0.055);
}

.control-map .wide {
  grid-column: span 2;
}

.note {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(236, 187, 90, 0.22);
  border-radius: 7px;
  background: rgba(236, 187, 90, 0.055);
  color: rgba(242, 236, 220, 0.88);
  font-size: 13px;
}

.symbol-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(228px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.symbol-card,
.symbol-ref {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  border: 1px solid rgba(242, 236, 220, 0.07);
  border-radius: 7px;
  background: rgba(21, 23, 24, 0.42);
}

.symbol-card {
  padding: 9px;
}

.symbol-card strong,
.symbol-ref strong {
  display: inline;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.symbol-card p {
  margin: 2px 0 0;
  color: rgba(242, 236, 220, 0.78);
  font-size: 12.5px;
  line-height: 1.35;
}

.symbol-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0;
  padding: 10px;
  background: rgba(21, 23, 24, 0.42);
  border: 1px solid rgba(242, 236, 220, 0.06);
  border-radius: 7px;
}

.symbol-ref {
  min-height: 34px;
  padding: 5px 8px;
  color: rgba(242, 236, 220, 0.82);
  font-size: 12px;
  line-height: 1.25;
}

.symbol-button,
.button-chip,
.switch-sample {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 24px;
  border: 1px solid rgba(128, 214, 166, 0.42);
  border-radius: 6px;
  background: rgba(128, 214, 166, 0.14);
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
}

.symbol-button {
  width: 30px;
  padding: 0;
}

.glyph-svg {
  display: block;
  width: 18px;
  height: 18px;
  overflow: visible;
}

.glyph-svg path,
.glyph-svg rect {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7px;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.glyph-svg circle,
.glyph-svg .glyph-fill {
  fill: currentColor;
  stroke: none;
}

.button-chip {
  min-width: 0;
  padding: 0 7px;
}

.button-chip.warning {
  border-color: rgba(235, 111, 92, 0.46);
  background: rgba(235, 111, 92, 0.13);
}

.die-face {
  position: relative;
  width: 15px;
  height: 15px;
  border: 1.5px solid currentColor;
  border-radius: 4px;
}

.die-face i {
  position: absolute;
  width: 3px;
  height: 3px;
  background: currentColor;
  border-radius: 50%;
}

.die-face i:nth-child(1) {
  left: 3px;
  top: 3px;
}

.die-face i:nth-child(2) {
  right: 3px;
  top: 3px;
}

.die-face i:nth-child(3) {
  left: 3px;
  bottom: 3px;
}

.die-face i:nth-child(4) {
  right: 3px;
  bottom: 3px;
}

.init-mark {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 16px;
  color: currentColor;
  background:
    linear-gradient(currentColor, currentColor) center / 2px 16px no-repeat,
    linear-gradient(90deg, currentColor, currentColor) center / 16px 2px no-repeat,
    linear-gradient(45deg, transparent 44%, currentColor 45% 55%, transparent 56%) center / 16px 16px no-repeat,
    linear-gradient(-45deg, transparent 44%, currentColor 45% 55%, transparent 56%) center / 16px 16px no-repeat;
  border-radius: 50%;
}

.init-mark::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  width: 4px;
  height: 4px;
  background: currentColor;
  border-radius: 50%;
}

.save-mark {
  position: relative;
  width: 15px;
  height: 15px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
}

.save-mark::before,
.save-mark::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  border: 1px solid currentColor;
}

.save-mark::before {
  top: 2px;
  height: 3px;
  background: currentColor;
}

.save-mark::after {
  bottom: 2px;
  height: 4px;
  border-radius: 2px;
}

.switch-sample {
  position: relative;
  width: 40px;
  border-radius: 999px;
}

.switch-sample span {
  display: block;
  width: 13px;
  height: 13px;
  margin-left: 15px;
  background: var(--linked-blob);
  border-radius: 50%;
}

.colour-dot {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(242, 236, 220, 0.16);
}

.green-dot {
  background: var(--linked-blob);
}

.blue-dot {
  background: var(--left-blob);
}

.yellow-dot {
  background: var(--right-blob);
}

.warning-dot {
  background: var(--warning);
}

.mode-strip {
  justify-content: flex-start;
  margin: 12px 0;
  padding: 10px;
  background: rgba(21, 23, 24, 0.42);
  border: 1px solid rgba(242, 236, 220, 0.06);
  border-radius: 7px;
}

@media (max-width: 980px) {
  .plugin-page {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    height: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(73, 79, 75, 0.86);
  }

  .rail-title {
    width: 100%;
    margin-bottom: 6px;
  }

  .rail a {
    margin: 0;
  }

  .manual {
    width: 100%;
    padding: 14px;
  }

  .plugin-header {
    min-height: 72px;
  }

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

  .control-map .meter {
    grid-row: span 1;
    min-height: 72px;
  }

  .control-map .wide {
    grid-column: span 1;
  }

  .shot-grid,
  .shot-grid--two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 14px;
  }

  .panel {
    padding: 14px;
  }

  .brand {
    align-items: flex-start;
  }

  h1 {
    font-size: 24px;
  }

  .brand-icon {
    width: 40px;
    height: 40px;
  }

  .control-map {
    grid-template-columns: 1fr;
  }

  .manual-shot {
    margin: 14px 0;
  }

  .manual-shot figcaption {
    font-size: 12px;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    border-bottom: 1px solid rgba(242, 236, 220, 0.08);
  }

  tr:last-child {
    border-bottom: 0;
  }

  td {
    border-bottom: 0;
    padding: 6px 9px;
  }

  td:first-child {
    width: auto;
    padding-top: 10px;
    color: var(--right-blob);
  }

  td:last-child {
    padding-bottom: 10px;
  }
}
