@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  color-scheme: dark;
  --bg: #050505;
  --surface: #0b0b0c;
  --surface-2: #111113;
  --surface-3: #171719;
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #f7f4ef;
  --muted: #9b9a96;
  --soft: #5f5d59;
  --accent: #ff5a1f;
  --accent-2: #ffd9c9;
  --ok: #a4ffcb;
  --warn: #ffb086;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --rail: 84px;
  --inspector: 380px;
  --font: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 32px 32px;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  letter-spacing: 0;
}

body.is-gate-visible {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  color: inherit;
}

.inspector,
.key-groups,
.panel.is-visible,
.keyboard-wrap,
.remap-results {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.34) transparent;
}

.inspector::-webkit-scrollbar,
.key-groups::-webkit-scrollbar,
.panel.is-visible::-webkit-scrollbar,
.keyboard-wrap::-webkit-scrollbar,
.remap-results::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.inspector::-webkit-scrollbar-track,
.key-groups::-webkit-scrollbar-track,
.panel.is-visible::-webkit-scrollbar-track,
.keyboard-wrap::-webkit-scrollbar-track,
.remap-results::-webkit-scrollbar-track {
  background: transparent;
}

.inspector::-webkit-scrollbar-thumb,
.key-groups::-webkit-scrollbar-thumb,
.panel.is-visible::-webkit-scrollbar-thumb,
.keyboard-wrap::-webkit-scrollbar-thumb,
.remap-results::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.34);
  background-clip: content-box;
  border: 4px solid transparent;
  border-radius: 999px;
}

.app-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr) var(--inspector);
  gap: 14px;
  padding: 14px;
  transition: opacity 460ms ease, transform 520ms ease, filter 520ms ease;
}

body.is-gate-visible .app-shell {
  opacity: 0;
  transform: scale(0.985);
  filter: blur(8px);
  pointer-events: none;
}

body.is-studio-open .app-shell {
  opacity: 1;
  transform: none;
  filter: none;
}

.connect-gate {
  --chooser-x: 136px;
  --chooser-y: 134px;
  position: fixed;
  inset: 0;
  z-index: 50;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 56px);
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.115) 1px, transparent 0),
    linear-gradient(180deg, rgba(255, 90, 31, 0.035), transparent 38%),
    var(--bg);
  background-size: 22px 22px, auto, auto;
  transition: opacity 520ms ease, transform 620ms ease, filter 620ms ease;
  overflow: hidden;
  isolation: isolate;
}

.connect-gate::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 90, 31, 0.62) 1px, transparent 0),
    radial-gradient(circle at 1px 1px, rgba(255, 244, 238, 0.18) 1px, transparent 0);
  background-position: 0 0, 11px 11px;
  background-size: 22px 22px;
  transform-origin: var(--chooser-x) var(--chooser-y);
  -webkit-mask-image: repeating-radial-gradient(
    circle at var(--chooser-x) var(--chooser-y),
    transparent 0 38px,
    rgba(0, 0, 0, 0.16) 44px 52px,
    rgba(0, 0, 0, 0.92) 56px 64px,
    transparent 74px 114px
  );
  mask-image: repeating-radial-gradient(
    circle at var(--chooser-x) var(--chooser-y),
    transparent 0 38px,
    rgba(0, 0, 0, 0.16) 44px 52px,
    rgba(0, 0, 0, 0.92) 56px 64px,
    transparent 74px 114px
  );
  mix-blend-mode: screen;
  will-change: opacity, transform, background-position;
}

body[data-gate-pulse="active"] .connect-gate::before {
  animation: gateWaterDots 1800ms cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

body[data-gate-pulse="settling"] .connect-gate::before {
  animation: gateWaterSettle 760ms ease-out both;
}

body.is-studio-open .connect-gate {
  opacity: 0;
  transform: scale(1.018);
  filter: blur(14px);
  pointer-events: none;
}

body:not(.is-gate-visible) .connect-gate {
  display: none;
}

.gate-stage {
  width: min(520px, 100%);
  display: block;
  position: relative;
  z-index: 2;
}

.gate-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  text-align: center;
}

.gate-logo-main {
  width: min(164px, 46vw);
  height: auto;
  display: block;
  margin-bottom: 14px;
  transform: translateY(-8px);
}

.gate-copy .eyebrow {
  margin: 0;
  color: var(--text);
  font-size: clamp(34px, 5vw, 58px);
  line-height: 0.96;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.gate-subcopy {
  max-width: 320px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.gate-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}

.gate-connect-button,
.gate-auto-button {
  min-height: 46px;
  border-radius: 999px;
  border: 1px solid var(--line);
  cursor: pointer;
  font-weight: 700;
}

.gate-connect-button {
  position: relative;
  overflow: hidden;
  padding: 0 24px;
  background: var(--text);
  color: #050505;
  border-color: var(--text);
  box-shadow: 0 16px 42px rgba(255, 244, 238, 0.12);
}

.gate-connect-button::before,
.gate-connect-button::after {
  content: "";
  position: absolute;
  inset: 50%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255, 90, 31, 0.5);
  opacity: 0;
  transform: translate(-50%, -50%) scale(1);
  display: none;
}

body[data-gate-phase="connecting"] .gate-connect-button::before,
body[data-gate-phase="connecting"] .gate-connect-button::after {
  animation: none;
}

body[data-gate-phase="connecting"] .gate-connect-button::after {
  animation-delay: 260ms;
}

.gate-connect-button span {
  position: relative;
  z-index: 1;
}

.gate-auto-button {
  position: relative;
  min-width: 226px;
  overflow: hidden;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.gate-connect-button:disabled,
.gate-auto-button:disabled {
  cursor: wait;
}

.gate-auto-button::before,
.gate-auto-button::after,
#autoConnectButton::before,
#autoConnectButton::after {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: 0;
}

.gate-auto-button.is-loading,
#autoConnectButton.is-loading {
  color: transparent;
  border-color: rgba(255, 90, 31, 0.58);
  background: rgba(255, 90, 31, 0.13);
  box-shadow: inset 0 0 0 1px rgba(255, 90, 31, 0.08), 0 0 34px rgba(255, 90, 31, 0.1);
  cursor: wait;
  opacity: 1;
}

.gate-auto-button.is-loading::before,
#autoConnectButton.is-loading::before {
  content: attr(data-busy-label);
  inset: 0;
  color: var(--text);
  display: grid;
  place-items: center;
  opacity: 1;
  transform: none;
}

.gate-auto-button.is-loading::before {
  box-sizing: border-box;
  padding-right: 34px;
}

.gate-auto-button.is-loading::after,
#autoConnectButton.is-loading::after {
  right: 22px;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 244, 238, 0.24);
  border-top-color: var(--accent);
  background: transparent;
  box-shadow: 0 0 18px rgba(255, 90, 31, 0.22);
  opacity: 1;
  transform: translateY(-50%);
  animation: buttonBusySpinner 720ms linear infinite;
}

.gate-status {
  min-height: 20px;
  margin: 16px 0 0;
  color: var(--soft);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

body[data-gate-phase="connecting"] .gate-status {
  color: var(--accent-2);
}

body[data-gate-phase="error"] .gate-status {
  color: var(--warn);
}

.gate-compat {
  display: grid;
  justify-items: center;
  gap: 8px;
  max-width: 340px;
  margin-top: 18px;
  color: rgba(247, 244, 239, 0.34);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.35;
}

.gate-compat p {
  margin: 0;
}

.gate-downloads {
  justify-self: center;
  width: min(860px, calc(100vw - 36px));
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 12px;
}

.gate-downloads > p {
  color: rgba(247, 244, 239, 0.42);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.gate-download-buttons {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.gate-download-buttons a {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(247, 244, 239, 0.72);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.gate-download-buttons a:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
}

.gate-download-buttons img {
  width: 16px;
  height: 16px;
  display: block;
  object-fit: contain;
}

.gate-download-icon-apple {
  filter: brightness(0) invert(1);
}

.gate-browser-icons {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  opacity: 0.54;
}

.gate-browser-icons img {
  width: 15px;
  height: 15px;
  display: block;
  filter: grayscale(1) saturate(0) brightness(1.55);
}

.gate-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.gate-links a {
  min-height: 31px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
}

.gate-links a:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.discord-link img {
  width: 15px;
  height: 15px;
  display: block;
}

.chooser-beacon {
  position: absolute;
  left: 36px;
  top: 34px;
  width: 300px;
  height: 230px;
  z-index: 1;
  pointer-events: none;
}

.ripple-field {
  position: absolute;
  left: -610px;
  top: -610px;
  width: 1500px;
  height: 1500px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 460ms ease;
  will-change: opacity;
}

.ripple-field::before,
.ripple-field::after {
  content: "";
  grid-area: 1 / 1;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  opacity: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 120, 72, 0.74) 1px, transparent 0),
    radial-gradient(circle at 1px 1px, rgba(255, 244, 238, 0.18) 1px, transparent 0);
  background-position: 0 0, 11px 11px;
  background-size: 22px 22px;
  box-shadow: 0 0 92px rgba(255, 90, 31, 0.16);
  -webkit-mask-image: repeating-radial-gradient(
    circle,
    transparent 0 42px,
    rgba(0, 0, 0, 0.2) 46px 54px,
    #000 58px 68px,
    transparent 76px 126px
  );
  mask-image: repeating-radial-gradient(
    circle,
    transparent 0 42px,
    rgba(0, 0, 0, 0.2) 46px 54px,
    #000 58px 68px,
    transparent 76px 126px
  );
  mix-blend-mode: screen;
  animation: none;
  will-change: opacity, transform, background-position;
}

.ripple-field span {
  grid-area: 1 / 1;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255, 90, 31, 0.5);
  border-radius: 50%;
  opacity: 0;
  box-shadow: inset 0 0 62px rgba(255, 90, 31, 0.1), 0 0 68px rgba(255, 90, 31, 0.12);
  animation: none;
}

body[data-gate-pulse="active"] .ripple-field {
  opacity: 1;
}

body[data-gate-pulse="settling"] .ripple-field {
  opacity: 0;
  transition-duration: 760ms;
}

body[data-gate-pulse="active"] .ripple-field span {
  border-color: rgba(255, 217, 201, 0.7);
  animation: chooserRipple 1500ms ease-out infinite;
}

body[data-gate-pulse="settling"] .ripple-field span {
  border-color: rgba(255, 217, 201, 0.56);
  animation: chooserRippleSettle 760ms ease-out both;
}

body[data-gate-pulse="active"] .ripple-field::before,
body[data-gate-pulse="active"] .ripple-field::after {
  animation: chooserDotRipple 1800ms cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

body[data-gate-pulse="settling"] .ripple-field::before,
body[data-gate-pulse="settling"] .ripple-field::after {
  animation: chooserDotSettle 760ms ease-out both;
}

body[data-gate-pulse="active"] .ripple-field::after {
  animation-delay: 340ms;
}

body[data-gate-pulse="active"] .ripple-field span:nth-child(2) {
  animation-delay: 230ms;
}

body[data-gate-pulse="active"] .ripple-field span:nth-child(3) {
  animation-delay: 460ms;
}

@keyframes chooserRipple {
  0% {
    opacity: 0.82;
    transform: scale(0.25);
  }
  100% {
    opacity: 0;
    transform: scale(5.9);
  }
}

@keyframes chooserRippleSettle {
  0% {
    opacity: 0.34;
    transform: scale(3.8);
  }
  100% {
    opacity: 0;
    transform: scale(5.2);
  }
}

@keyframes chooserDotRipple {
  0% {
    opacity: 0;
    transform: scale(0.24) rotate(0deg);
    background-position: 0 0, 11px 11px;
  }
  16% {
    opacity: 0.7;
  }
  56% {
    opacity: 0.28;
    background-position: 8px -5px, 19px 6px;
  }
  100% {
    opacity: 0;
    transform: scale(5.8) rotate(7deg);
    background-position: 24px -16px, 35px -5px;
  }
}

@keyframes chooserDotSettle {
  0% {
    opacity: 0.34;
    transform: scale(3.8) rotate(5deg);
    background-position: 14px -10px, 25px 1px;
  }
  100% {
    opacity: 0;
    transform: scale(5.1) rotate(8deg);
    background-position: 24px -16px, 35px -5px;
  }
}

@keyframes gateWaterDots {
  0% {
    opacity: 0;
    transform: scale(0.965);
    background-position: 0 0, 11px 11px;
  }
  18% {
    opacity: 0.78;
  }
  58% {
    opacity: 0.3;
    transform: scale(1.035);
    background-position: 8px -5px, 19px 6px;
  }
  100% {
    opacity: 0;
    transform: scale(1.13);
    background-position: 24px -16px, 35px -5px;
  }
}

@keyframes gateWaterSettle {
  0% {
    opacity: 0.42;
    transform: scale(1.04);
    background-position: 10px -7px, 21px 4px;
  }
  100% {
    opacity: 0;
    transform: scale(1.12);
    background-position: 24px -16px, 35px -5px;
  }
}

@keyframes buttonBusySpinner {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

.rail,
.workspace,
.inspector {
  border: 1px solid var(--line);
  background: rgba(11, 11, 12, 0.84);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

body.is-resizing .rail,
body.is-resizing .workspace,
body.is-resizing .inspector {
  backdrop-filter: none;
}

body.is-resizing .keycap,
body.is-resizing .axis-key,
body.is-resizing .primary-button,
body.is-resizing .ghost-button,
body.is-resizing .select-button {
  transition: none !important;
}

.rail {
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 12px;
  position: sticky;
  top: 14px;
  height: calc(100svh - 28px);
  z-index: 12;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #f4f0ea;
  color: #050505;
  font-weight: 700;
  font-size: 15px;
}

.brand-mark img {
  width: 24px;
  height: 24px;
  display: block;
  filter: invert(1);
}

.rail-nav {
  margin-top: 44px;
  display: grid;
  gap: 14px;
}

.rail-utility {
  margin-top: auto;
  display: grid;
  gap: 14px;
}

.rail-button {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-weight: 600;
  transition: transform 180ms ease, color 180ms ease, background 180ms ease, border-color 180ms ease;
}

.rail-button[data-label]::before,
.rail-button[data-label]::after {
  position: absolute;
  top: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease, transform 180ms ease;
}

.rail-button[data-label]::before {
  content: "";
  left: calc(100% + 12px);
  z-index: 24;
  width: 12px;
  height: 12px;
  background: rgba(17, 17, 19, 0.96);
  border-left: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  border-bottom-left-radius: 3px;
  transform: translate(6px, -50%) rotate(45deg) scale(0.82);
}

.rail-button[data-label]::after {
  content: attr(data-label);
  left: calc(100% + 17px);
  z-index: 25;
  min-width: max-content;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(17, 17, 19, 0.96);
  color: var(--text);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  text-transform: uppercase;
  transform: translate(6px, -50%) scale(0.96);
  backdrop-filter: blur(14px);
}

.rail-button[data-label]:hover::before,
.rail-button[data-label]:focus-visible::before {
  opacity: 1;
  transform: translate(0, -50%) rotate(45deg) scale(1);
}

.rail-button[data-label]:hover::after,
.rail-button[data-label]:focus-visible::after {
  opacity: 1;
  transform: translate(0, -50%) scale(1);
}

.rail-button img {
  width: 23px;
  height: 23px;
  display: block;
  opacity: 0.52;
  transition: opacity 180ms ease, transform 180ms ease;
}

.rail-button[data-tab="typing"] img {
  width: 25px;
}

.rail-button[data-tab="gamepad"] img,
.rail-button[data-tab="socd"] img {
  filter: brightness(0) invert(1);
}

.rail-button[data-tab="gamepad"] img {
  width: 22px;
  height: 28px;
}

.rail-button[data-tab="socd"] img {
  width: 25px;
  height: 25px;
}

.rail-link img {
  filter: brightness(0) invert(1);
}

.rail-button:hover,
.rail-button.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--line);
}

.rail-button:focus-visible {
  outline: 2px solid rgba(255, 90, 31, 0.68);
  outline-offset: 4px;
}

.rail-button:hover img,
.rail-button.is-active img {
  opacity: 1;
  transform: scale(1.04);
}

.rail-button:active {
  transform: scale(0.96);
}

.status-dot {
  width: 10px;
  height: 10px;
  display: block;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 18px rgba(255, 90, 31, 0.75);
}

.topbar-status-dot {
  margin-right: 2px;
}

.status-dot.is-connected {
  background: var(--ok);
  box-shadow: 0 0 18px rgba(164, 255, 203, 0.65);
}

.workspace {
  border-radius: var(--radius-lg);
  padding: 22px;
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  overflow: hidden;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 14px 18px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  line-height: 1;
  font-weight: 700;
}

h1 {
  font-size: 38px;
}

h2 {
  font-size: 23px;
}

.topbar-actions,
.toolbar-actions,
.action-row,
.profile-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-actions {
  justify-content: flex-end;
  gap: 8px;
}

#layoutSelect {
  min-width: 184px;
}

.topbar-actions .profile-select {
  min-width: 164px;
}

.topbar-actions .select-button,
.topbar-actions .primary-button,
.topbar-actions .ghost-button {
  min-height: 36px;
  font-size: 13px;
}

.topbar-actions .select-button {
  padding: 0 34px 0 14px;
}

.topbar-actions .primary-button,
.topbar-actions .ghost-button {
  padding: 0 14px;
}

.topbar-actions .select-button::after {
  right: 14px;
  width: 7px;
  height: 7px;
}

.topbar-actions .select-option {
  height: 34px;
  border-radius: 11px;
  font-size: 13px;
}

#autoConnectButton {
  min-width: 60px;
}

#connectButton {
  min-width: 92px;
}

.stage-toolbar .toolbar-actions .text-button {
  min-height: 24px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stage-toolbar .toolbar-actions .text-button:hover {
  color: var(--text);
}

.device-summary div,
.mini-list div {
  min-width: 0;
}

.profile-password span,
.drawer-summary span,
.module-head span,
.device-summary span,
.feature-pill,
.mini-list span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  text-transform: uppercase;
  font-weight: 700;
}

.drawer-summary strong,
.module-head strong,
.device-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  line-height: 1;
  font-weight: 700;
}

.profile-password {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.profile-password .control {
  min-height: 36px;
}

.compact-switch {
  min-height: 36px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 12px;
}

.control {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

select.control {
  appearance: none;
  color-scheme: dark;
  padding-right: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 17px,
    calc(100% - 13px) 17px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

select.control option,
select.control optgroup {
  background: #171719;
  background-color: #171719;
  color: var(--text);
  font-weight: 600;
}

select.control option:checked {
  background: #2a211d;
  background-color: #2a211d;
  color: var(--accent-2);
}

select.control option:disabled {
  color: var(--soft);
}

select.control.is-enhanced-native {
  position: absolute;
  width: 1px !important;
  min-width: 0 !important;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.enhanced-select {
  position: relative;
  width: 100%;
  min-width: 0;
  z-index: 1;
}

.enhanced-select.is-open {
  z-index: 90;
}

.enhanced-select-button {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 18px) 17px / 5px 5px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 13px) 17px / 5px 5px no-repeat,
    rgba(255, 255, 255, 0.055);
  color: var(--text);
  padding: 0 36px 0 14px;
  text-align: left;
  outline: none;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.enhanced-select-button:hover,
.enhanced-select.is-open .enhanced-select-button {
  border-color: rgba(255, 90, 31, 0.45);
  background-color: rgba(255, 255, 255, 0.075);
}

.enhanced-select-button:focus-visible {
  border-color: rgba(255, 90, 31, 0.62);
  box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.16);
}

.enhanced-select-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.enhanced-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 238px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #111113;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.46);
  display: none;
}

.enhanced-select.is-open .enhanced-select-menu {
  display: grid;
  gap: 3px;
}

.enhanced-select-option {
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.enhanced-select-option:hover,
.enhanced-select-option.is-active {
  color: var(--text);
  background: rgba(255, 90, 31, 0.16);
}

.enhanced-select-option:disabled {
  color: var(--soft);
  cursor: not-allowed;
}

.advanced-drawer .enhanced-select-button,
.compact-drawer .enhanced-select-button {
  min-height: 34px;
  font-size: 12px;
  background-position:
    calc(100% - 18px) 14px,
    calc(100% - 13px) 14px;
}

.advanced-drawer .enhanced-select-menu,
.compact-drawer .enhanced-select-menu {
  max-height: 214px;
  font-size: 12px;
}

.advanced-drawer .enhanced-select-option,
.compact-drawer .enhanced-select-option {
  min-height: 30px;
}

.custom-select {
  position: relative;
  min-width: 152px;
  z-index: 20;
}

.profile-select {
  min-width: 172px;
}

.skin-select {
  min-width: 118px;
  z-index: 18;
}

.skin-select[hidden] {
  display: none;
}

.select-button {
  position: relative;
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  padding: 0 42px 0 16px;
  cursor: pointer;
  text-align: left;
  font-weight: 600;
  display: flex;
  align-items: center;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.select-kicker {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1;
  font-weight: 800;
  text-transform: uppercase;
}

.select-button::after {
  content: "";
  position: absolute;
  right: 17px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-62%) rotate(45deg);
  transition: transform 180ms ease, border-color 180ms ease;
}

.custom-select.is-open .select-button {
  border-color: rgba(255, 90, 31, 0.62);
  background: rgba(255, 90, 31, 0.1);
}

.custom-select.is-open .select-button::after {
  border-color: var(--accent);
  transform: translateY(-20%) rotate(225deg);
}

.select-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 100%;
  display: none;
  gap: 3px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: rgba(18, 18, 19, 0.96);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(18px);
}

.custom-select.is-open .select-menu {
  display: grid;
}

.select-option {
  height: 38px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  padding: 0 13px;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.select-option small {
  color: var(--accent-2);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.select-option:hover,
.select-option.is-active {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
}

.select-option.is-active {
  color: var(--accent-2);
}

.select-option:disabled,
.select-option.is-disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.select-option:disabled small,
.select-option.is-disabled small {
  opacity: 0.82;
}

.profile-menu {
  width: min(336px, calc(100vw - 28px));
  min-width: 286px;
  gap: 5px;
}

.profile-menu-head,
.profile-menu-row {
  display: grid;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.profile-menu-head {
  grid-template-columns: minmax(0, 1fr) 34px;
  padding: 2px 3px 6px 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-menu-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
  border-radius: 13px;
  padding: 3px;
}

.profile-menu-row:hover {
  background: rgba(255, 255, 255, 0.08);
}

.profile-menu-row.is-active {
  background: rgba(255, 255, 255, 0.075);
}

.profile-menu-name,
.profile-menu-action,
.profile-menu-command,
.profile-menu-settings {
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.profile-menu-name {
  min-width: 0;
  min-height: 32px;
  padding: 0 9px;
  border-radius: 10px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.profile-menu-action {
  min-height: 28px;
  border-radius: 999px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-menu-action:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.profile-menu-settings {
  width: 34px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

.profile-menu-command {
  min-height: 40px;
  border-radius: 12px;
  box-shadow: 0 -1px 0 var(--line);
  margin-top: 6px;
  margin-bottom: 2px;
  padding: 0 12px;
  color: var(--accent-2);
  text-align: left;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
}

.profile-menu-name:hover,
.profile-menu-action:hover,
.profile-menu-command:hover,
.profile-menu-settings:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.profile-menu-row:hover .profile-menu-name,
.profile-menu-name:hover {
  background: transparent;
}

.profile-menu-settings:hover {
  color: var(--accent-2);
  background: transparent;
}

.profile-menu-action.danger:hover,
.ghost-button.danger:hover {
  border-color: rgba(255, 90, 31, 0.58);
  color: var(--accent-2);
}

input.control {
  width: 100%;
}

.primary-button,
.ghost-button,
.text-button {
  min-height: 40px;
  border-radius: 999px;
  padding: 0 16px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.primary-button {
  background: var(--text);
  color: #050505;
  border-color: var(--text);
  font-weight: 700;
}

.ghost-button {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
}

#autoConnectButton.is-loading {
  min-width: 132px;
}

body.is-disconnected .inspector .panel.is-visible:not([data-panel="typing"]) {
  opacity: 0.5;
  filter: grayscale(0.9) saturate(0.28);
}

body.is-disconnected #connectButton {
  background: var(--accent);
  border-color: var(--accent);
  color: #050505;
  box-shadow: 0 0 0 5px rgba(255, 90, 31, 0.14), 0 14px 36px rgba(255, 90, 31, 0.24);
}

body.is-disconnected #autoConnectButton {
  color: var(--accent-2);
  border-color: rgba(255, 90, 31, 0.5);
  background: rgba(255, 90, 31, 0.12);
}

body.is-connected #connectButton {
  box-shadow: 0 0 0 5px rgba(164, 255, 203, 0.08);
}

.text-button {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  padding: 0;
  min-height: 28px;
}

.text-button:hover:not(:disabled) {
  color: var(--text);
}

.text-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.primary-button:disabled,
.ghost-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.ghost-button.is-loading:disabled {
  opacity: 1;
  cursor: wait;
}

.feedback-button {
  position: relative;
  overflow: hidden;
}

.feedback-button::before,
.feedback-button::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 180ms ease;
}

.feedback-button::before {
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 999px;
  transform: translateY(-50%) scale(0.72);
}

.feedback-button::after {
  width: 10px;
  height: 6px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-62%) rotate(-45deg) scale(0.72);
}

.feedback-button.is-busy::before {
  opacity: 0.88;
  transform: translateY(-50%) scale(1);
  animation: buttonFeedbackSpin 760ms linear infinite;
}

.feedback-button.is-done::after {
  opacity: 0.9;
  transform: translateY(-62%) rotate(-45deg) scale(1);
}

.feedback-button.is-busy:disabled,
.feedback-button.is-done:disabled {
  opacity: 1;
  cursor: wait;
}

.feedback-button.is-done:disabled {
  cursor: default;
}

@keyframes buttonFeedbackSpin {
  to {
    transform: translateY(-50%) scale(1) rotate(360deg);
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(14px);
}

.modal-overlay[hidden] {
  display: none;
}

.profile-manager {
  width: min(520px, 100%);
  max-height: min(620px, calc(100svh - 36px));
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: rgba(13, 13, 14, 0.98);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58);
  padding: 18px;
  display: grid;
  gap: 14px;
  overflow: hidden;
}

.profile-manager-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.icon-ghost-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.055);
  cursor: pointer;
  position: relative;
}

.icon-ghost-button::before,
.icon-ghost-button::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 17px;
  height: 2px;
  border-radius: 999px;
  background: var(--muted);
}

.icon-ghost-button::before {
  transform: rotate(45deg);
}

.icon-ghost-button::after {
  transform: rotate(-45deg);
}

.profile-storage-note {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px;
}

.profile-storage-note span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-storage-note strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-manager-list {
  display: grid;
  gap: 8px;
  overflow: auto;
  padding-right: 3px;
}

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

.profile-manager-row .control,
.profile-manager-row .ghost-button,
.profile-manager .primary-button {
  min-height: 36px;
  border-radius: 14px;
  font-size: 12px;
}

.wide {
  width: 100%;
}

.device-stage {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
}

body[data-active-tab="typing"] .device-stage {
  display: none;
}

.typing-stage {
  min-height: 0;
  display: none;
  grid-template-rows: minmax(0, 1fr) 134px;
  gap: 16px;
}

body[data-active-tab="typing"] .typing-stage {
  display: grid;
}

.stage-toolbar,
.keyboard-meta,
.axis-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.toolbar-skin-select {
  min-width: 118px;
}

.toolbar-skin-select .select-button {
  min-height: 36px;
  padding: 0 32px 0 14px;
  font-size: 13px;
  line-height: 1;
}

.toolbar-skin-select .select-button::after {
  right: 13px;
  width: 7px;
  height: 7px;
}

.toolbar-skin-select .select-menu {
  left: 0;
  right: auto;
  min-width: 128px;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.segment {
  min-width: 58px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}

.segment.is-active {
  background: var(--text);
  color: #050505;
  font-weight: 700;
}

.segment:disabled {
  cursor: not-allowed;
  opacity: 0.36;
}

.view-segmented .segment {
  min-width: 44px;
}

.keyboard-wrap {
  --layout-aspect: 2.45;
  min-height: 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.12) 1px, transparent 0),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
  background-size: 18px 18px, auto;
  padding: 18px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  overflow: hidden;
  position: relative;
  contain: layout style;
}

.keyboard-meta {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700;
}

.keyboard-canvas {
  --layout-aspect: 2.45;
  --keyboard-scale: 1;
  --key-label-scale: 1;
  --layout-width: 620;
  --layout-height: 265;
  width: 100%;
  max-height: 100%;
  aspect-ratio: var(--layout-aspect);
  position: relative;
  grid-row: 2;
  grid-column: 1;
  align-self: center;
  justify-self: center;
  overflow: visible;
  contain: layout style;
  transition: opacity 180ms ease, filter 180ms ease;
}

.keyboard-wrap[data-view="3d"] .keyboard-canvas {
  opacity: 0;
  pointer-events: none;
  filter: blur(2px);
}

.keyboard-layer {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--layout-width) * 1px);
  height: calc(var(--layout-height) * 1px);
  transform: translate3d(-50%, -50%, 0) scale(var(--keyboard-scale));
  transform-origin: center;
  contain: layout style;
  will-change: transform;
}

.keycap {
  --press: 0%;
  --keycap-label-padding: 2px;
  --keycap-label-size: 8.8px;
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.035)),
    #111113;
  color: var(--text);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 22px rgba(0, 0, 0, 0.28);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
  contain: layout style;
}

.keycap.is-compact-label {
  --keycap-label-padding: 1px;
  --keycap-label-size: 7.4px;
}

.keycap.is-knob {
  --keycap-label-size: 7.1px;
  border-radius: 50%;
}

.keycap.is-config-locked {
  cursor: not-allowed;
  opacity: 0.58;
}

.keycap.is-config-locked:hover {
  transform: none;
  border-color: rgba(255, 255, 255, 0.14);
}

.keycap::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: var(--press);
  background: linear-gradient(180deg, rgba(164, 255, 203, 0.08), rgba(164, 255, 203, 0.32));
  opacity: 0;
  transition: opacity 70ms linear;
  will-change: height;
  pointer-events: none;
}

.keycap span {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 0 var(--keycap-label-padding);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--keycap-label-size);
  font-weight: 600;
  transform: scale(var(--key-label-scale));
  transform-origin: center;
  will-change: transform;
}

.keycap:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.28);
}

.keycap.is-selected {
  border-color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 0 0 2px rgba(255, 90, 31, 0.22), 0 16px 34px rgba(255, 90, 31, 0.14);
}

.keycap.is-remapped::after,
.keycap.has-trigger::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.keycap.has-trigger::after {
  background: var(--ok);
}

.keycap.is-depth-active {
  border-color: rgba(164, 255, 203, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 12px 30px rgba(164, 255, 203, 0.12);
}

.keycap.is-depth-active::before {
  opacity: 1;
}

.keycap.is-actuated {
  border-color: rgba(255, 90, 31, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 0 0 2px rgba(255, 90, 31, 0.2), 0 16px 34px rgba(255, 90, 31, 0.16);
}

.keycap.is-actuated::before {
  background: linear-gradient(180deg, rgba(255, 217, 201, 0.14), rgba(255, 90, 31, 0.38));
}

body:not([data-active-tab="trigger"]) .keycap.is-depth-active {
  border-color: rgba(255, 255, 255, 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 10px 24px rgba(255, 255, 255, 0.055);
}

body:not([data-active-tab="trigger"]) .keycap.is-depth-active::before {
  opacity: 0.35;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.18));
}

.keycap.is-remapped.has-trigger::after {
  background: linear-gradient(90deg, var(--accent) 0 50%, var(--ok) 50% 100%);
}

.keycap .paint {
  position: absolute;
  inset: auto 5px 5px 5px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.85;
}

.keyboard-3d {
  width: 100%;
  max-height: 100%;
  aspect-ratio: var(--layout-aspect);
  position: relative;
  grid-row: 2;
  grid-column: 1;
  align-self: center;
  justify-self: center;
  overflow: visible;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 220ms ease, transform 220ms ease;
  contain: layout style;
}

.keyboard-wrap[data-view="3d"] .keyboard-3d {
  opacity: 1;
  transform: none;
}

.keyboard-3d-canvas,
.keyboard-3d-canvas canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.keyboard-3d-canvas canvas {
  display: block;
  cursor: pointer;
}

.keyboard-3d-labels {
  --keyboard-3d-label-scale: 1;
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.keyboard-3d-labels.is-hidden {
  display: none;
}

.keyboard-3d-legend {
  position: absolute;
  min-width: calc(16px * var(--keyboard-3d-label-scale));
  max-width: calc(78px * var(--keyboard-3d-label-scale));
  padding: 0 calc(2px * var(--keyboard-3d-label-scale));
  color: rgba(255, 244, 238, 0.92);
  font-size: calc(9px * var(--keyboard-3d-label-scale));
  font-weight: 800;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  text-shadow:
    0 1px 1px rgba(0, 0, 0, 0.82),
    0 0 7px rgba(255, 244, 238, 0.2);
  white-space: nowrap;
  opacity: 0.9;
  transform-origin: center;
  transition: color 120ms ease, opacity 120ms ease, text-shadow 120ms ease;
}

.keyboard-3d-legend.is-pressed {
  color: #ffe2d3;
  opacity: 1;
  padding: calc(2px * var(--keyboard-3d-label-scale)) calc(5px * var(--keyboard-3d-label-scale));
  border-radius: 999px;
  background: rgba(255, 90, 31, 0.16);
  box-shadow:
    0 0 0 1px rgba(255, 90, 31, 0.36),
    0 0 18px rgba(255, 90, 31, 0.36);
  text-shadow:
    0 1px 1px rgba(0, 0, 0, 0.88),
    0 0 12px rgba(255, 90, 31, 0.88),
    0 0 24px rgba(255, 90, 31, 0.62);
}

.keyboard-3d-legend.is-selected {
  color: #ffefe7;
  opacity: 1;
  padding: calc(2px * var(--keyboard-3d-label-scale)) calc(5px * var(--keyboard-3d-label-scale));
  border-radius: 999px;
  background: rgba(255, 90, 31, 0.18);
  box-shadow:
    0 0 0 1px rgba(255, 90, 31, 0.5),
    0 0 18px rgba(255, 90, 31, 0.46);
  text-shadow:
    0 1px 1px rgba(0, 0, 0, 0.9),
    0 0 10px rgba(255, 90, 31, 0.95),
    0 0 24px rgba(255, 90, 31, 0.66);
}

.keyboard-3d-toggle {
  position: absolute;
  right: clamp(22px, 5vw, 68px);
  bottom: clamp(22px, 3vw, 34px);
  z-index: 4;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 160ms ease, opacity 160ms ease;
}

.keyboard-3d-toggle[hidden] {
  display: none;
}

.keyboard-wrap:not([data-view="3d"]) .keyboard-3d-toggle {
  opacity: 0;
  pointer-events: none;
}

.keyboard-3d-toggle.is-active {
  color: var(--text);
}

.keyboard-3d-toggle:hover {
  color: var(--accent-2);
}

.keyboard-3d-status {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  max-width: min(420px, calc(100% - 24px));
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(5, 5, 5, 0.74);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  backdrop-filter: blur(14px);
  pointer-events: none;
}

.keyboard-3d-status[hidden] {
  display: none;
}

.remap-palette {
  position: absolute;
  z-index: 12;
  width: min(430px, calc(100% - 28px));
  max-height: calc(100% - 24px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at 18px 18px, rgba(255, 90, 31, 0.18) 0 1px, transparent 1px),
    linear-gradient(180deg, rgba(18, 18, 19, 0.98), rgba(7, 7, 8, 0.96));
  background-size: 18px 18px, auto;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(255, 90, 31, 0.08);
  padding: 14px;
  backdrop-filter: blur(22px);
  overflow: hidden;
  animation: paletteIn 180ms ease both;
}

.remap-palette[hidden] {
  display: none;
}

.remap-palette::before {
  content: "";
  position: absolute;
  left: -7px;
  top: var(--palette-notch-top, 34px);
  width: 12px;
  height: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  background: #121213;
  transform: rotate(45deg);
}

.remap-palette.is-left::before {
  left: auto;
  right: -7px;
  border-left: 0;
  border-bottom: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.remap-head,
.remap-flow,
.remap-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.remap-head span,
.remap-token span,
.remap-key-meta {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  text-transform: uppercase;
  font-weight: 700;
}

.remap-head strong {
  display: block;
  margin-top: 3px;
  font-size: 21px;
  line-height: 1;
}

.remap-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  padding: 0;
  cursor: pointer;
  position: relative;
  flex: 0 0 auto;
}

.remap-close::before,
.remap-close::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  top: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.remap-close::before {
  transform: rotate(45deg);
}

.remap-close::after {
  transform: rotate(-45deg);
}

.remap-close:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.085);
}

.remap-flow {
  justify-content: stretch;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.remap-token {
  min-width: 0;
  flex: 1;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  padding: 10px;
}

.remap-token strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  line-height: 1;
}

.remap-token.has-target {
  background: rgba(255, 90, 31, 0.13);
  box-shadow: inset 0 0 0 1px rgba(255, 90, 31, 0.28);
}

.remap-arrow {
  width: 28px;
  height: 1px;
  background: var(--line-strong);
  position: relative;
  flex: 0 0 28px;
}

.remap-arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: -4px;
  width: 8px;
  height: 8px;
  border-top: 1px solid var(--line-strong);
  border-right: 1px solid var(--line-strong);
  transform: rotate(45deg);
}

.remap-search {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  outline: none;
  padding: 0 14px;
}

.remap-search:focus {
  border-color: rgba(255, 90, 31, 0.62);
  box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.13);
}

.remap-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.remap-category {
  min-height: 29px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  padding: 0 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}

.remap-category.is-active {
  border-color: rgba(255, 90, 31, 0.58);
  background: rgba(255, 90, 31, 0.14);
  color: var(--text);
}

.remap-results {
  flex: 1 1 auto;
  min-height: 120px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 7px;
  padding-right: 3px;
}

.remap-option {
  min-width: 0;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  padding: 9px 10px;
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.remap-option:hover,
.remap-option.is-active {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
}

.remap-option.is-active {
  border-color: rgba(255, 90, 31, 0.68);
  box-shadow: inset 0 0 0 1px rgba(255, 90, 31, 0.2);
}

.remap-key-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.remap-key-meta {
  margin-top: 5px;
  color: var(--soft);
}

.remap-empty {
  grid-column: 1 / -1;
  min-height: 84px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  font-size: 12px;
}

.remap-footer {
  justify-content: space-between;
}

.trigger-palette {
  --depth: 0%;
  --actuation: 38%;
  --release: 25%;
  position: absolute;
  z-index: 13;
  width: min(360px, calc(100% - 28px));
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at 18px 18px, rgba(255, 90, 31, 0.15) 0 1px, transparent 1px),
    linear-gradient(180deg, rgba(18, 18, 19, 0.98), rgba(7, 7, 8, 0.96));
  background-size: 18px 18px, auto;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(255, 90, 31, 0.08);
  padding: 14px;
  backdrop-filter: blur(22px);
  animation: paletteIn 180ms ease both;
}

.trigger-palette[hidden] {
  display: none;
}

.trigger-palette::before {
  content: "";
  position: absolute;
  left: -7px;
  top: var(--palette-notch-top, 34px);
  width: 12px;
  height: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  background: #121213;
  transform: rotate(45deg);
}

.trigger-palette.is-left::before {
  left: auto;
  right: -7px;
  border-left: 0;
  border-bottom: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.lighting-palette {
  --key-light-color: var(--accent);
  position: absolute;
  z-index: 14;
  width: min(330px, calc(100% - 28px));
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at 18px 18px, rgba(255, 90, 31, 0.15) 0 1px, transparent 1px),
    linear-gradient(180deg, rgba(18, 18, 19, 0.98), rgba(7, 7, 8, 0.96));
  background-size: 18px 18px, auto;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(255, 90, 31, 0.08);
  padding: 14px;
  backdrop-filter: blur(22px);
  animation: paletteIn 180ms ease both;
}

.lighting-palette[hidden] {
  display: none;
}

.lighting-palette::before {
  content: "";
  position: absolute;
  left: -7px;
  top: var(--palette-notch-top, 34px);
  width: 12px;
  height: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  background: #121213;
  transform: rotate(45deg);
}

.lighting-palette.is-left::before {
  left: auto;
  right: -7px;
  border-left: 0;
  border-bottom: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.remap-palette.is-above::before,
.trigger-palette.is-above::before,
.lighting-palette.is-above::before {
  left: var(--palette-notch-left, 34px);
  right: auto;
  top: auto;
  bottom: -7px;
  border-left: 0;
  border-top: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.remap-palette.is-below::before,
.trigger-palette.is-below::before,
.lighting-palette.is-below::before {
  left: var(--palette-notch-left, 34px);
  right: auto;
  top: -7px;
  bottom: auto;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-right: 0;
  border-bottom: 0;
}

.trigger-pop-head,
.trigger-pop-body,
.light-pop-head,
.light-pop-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.trigger-pop-head span,
.trigger-pop-readout span,
.light-pop-head span,
.light-pop-preview span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  text-transform: uppercase;
  font-weight: 700;
}

.trigger-pop-head strong,
.light-pop-head strong {
  display: block;
  margin-top: 3px;
  font-size: 22px;
  line-height: 1;
}

.trigger-pop-head em {
  margin-left: auto;
  color: var(--ok);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  text-transform: uppercase;
}

.light-pop-preview {
  min-height: 74px;
  justify-content: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.light-pop-preview strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 18px;
}

.light-pop-orb {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 18px;
  background: var(--key-light-color);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--key-light-color) 18%, transparent), 0 0 34px color-mix(in srgb, var(--key-light-color) 48%, transparent);
}

.light-pop-swatches {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 7px;
}

.light-swatch {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--swatch);
  cursor: pointer;
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.22);
}

.light-swatch.is-active {
  border-color: var(--text);
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.22), 0 0 0 4px rgba(255, 90, 31, 0.16);
}

.light-pop-picker {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  align-items: center;
  gap: 10px;
  padding: 0 7px 0 15px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.light-pop-picker input {
  width: 42px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.trigger-pop-body {
  justify-content: stretch;
  align-items: stretch;
}

.trigger-pop-meter {
  position: relative;
  flex: 0 0 58px;
  min-height: 148px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.13) 1px, transparent 1px),
    rgba(0, 0, 0, 0.3);
  background-size: 100% 25%;
  overflow: hidden;
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.035);
}

.trigger-pop-readout {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 8px;
}

.trigger-pop-readout div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  padding: 10px;
}

.trigger-pop-readout strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  line-height: 1;
}

.trigger-pop-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.trigger-tune-preset {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.trigger-tune-preset.is-active,
.trigger-tune-preset:hover {
  color: var(--text);
  border-color: rgba(255, 90, 31, 0.55);
  background: rgba(255, 90, 31, 0.14);
}

.trigger-pop-controls {
  display: grid;
  gap: 12px;
}

@keyframes paletteIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.axis-strip {
  height: 156px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 90, 31, 0.11) 1px, transparent 0),
    rgba(255, 255, 255, 0.04);
  background-size: 18px 18px, auto;
  padding: 14px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  contain: layout paint style;
}

.axis-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.axis-bars {
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  gap: 8px;
  min-height: 0;
  align-items: end;
}

.axis-bars.is-trigger {
  align-items: stretch;
}

.axis-bars.is-shortcuts {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: stretch;
}

.axis-shortcut {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.018)),
    rgba(255, 255, 255, 0.035);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 10px;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.axis-shortcut:hover,
.axis-shortcut.is-active {
  border-color: rgba(255, 90, 31, 0.58);
  background: rgba(255, 90, 31, 0.14);
}

.axis-shortcut:active {
  transform: translateY(1px);
}

.axis-shortcut:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.axis-shortcut span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: opacity 160ms ease, transform 180ms ease;
}

.axis-shortcut.feedback-button::before,
.axis-shortcut.feedback-button::after {
  right: auto;
  left: 50%;
}

.axis-shortcut.feedback-button.is-busy span,
.axis-shortcut.feedback-button.is-done span {
  opacity: 0;
  transform: translateY(2px) scale(0.96);
}

.axis-bar {
  height: var(--depth);
  min-height: 6px;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  opacity: 0.9;
  transform-origin: bottom;
}

.axis-key {
  --depth: 0%;
  --actuation: 38%;
  --release: 25%;
  min-width: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  padding: 0;
  display: grid;
  justify-items: center;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
  contain: layout paint;
}

.axis-key:hover,
.axis-key.is-selected {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.035);
}

.axis-key.is-actuated {
  box-shadow: none;
}

.axis-key-meter {
  position: relative;
  width: min(34px, 100%);
  min-height: 68px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  overflow: hidden;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.035);
  contain: paint;
}

.axis-key-meter::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: var(--depth);
  background: linear-gradient(180deg, rgba(164, 255, 203, 0.9), rgba(255, 90, 31, 0.92));
  transition: none;
  will-change: height;
}

.axis-key-meter::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--actuation);
  border-top: 1px solid rgba(255, 244, 238, 0.92);
  box-shadow: 0 0 12px rgba(255, 90, 31, 0.44);
}

.axis-key-release {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--release);
  border-top: 1px dashed rgba(164, 255, 203, 0.62);
}

.axis-key-info {
  min-width: 0;
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.axis-key-name,
.axis-key-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.axis-key-name {
  color: var(--text);
}

.axis-key-value {
  color: var(--soft);
}

.typing-toolbar {
  position: absolute;
  z-index: 2;
  top: 16px;
  left: 20px;
  right: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.typing-control-stack {
  min-width: 0;
  max-width: min(620px, calc(100% - 190px));
  display: grid;
  justify-items: start;
  gap: 6px;
}

.typing-choice-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 5px;
}

.typing-choice {
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  padding: 0 9px;
  cursor: pointer;
  font-size: 10.5px;
  font-weight: 700;
  transition: transform 160ms ease, color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.typing-choice:hover,
.typing-choice.is-active {
  color: var(--text);
  border-color: rgba(255, 90, 31, 0.56);
  background: rgba(255, 90, 31, 0.14);
}

.typing-option-row {
  min-height: 18px;
}

.typing-toggle-row {
  min-height: 18px;
}

.typing-choice-row.is-mode-options .typing-choice {
  min-height: 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 4px;
  color: rgba(245, 241, 235, 0.48);
  font-size: 10.5px;
  box-shadow: none;
}

.typing-choice-row.is-mode-options .typing-choice:hover,
.typing-choice-row.is-mode-options .typing-choice.is-active {
  color: var(--accent-2);
  background: transparent;
  border-color: transparent;
}

.typing-choice:active {
  transform: translateY(1px);
}

.typing-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.typing-toolbar-actions .primary-button,
.typing-toolbar-actions .ghost-button {
  min-height: 28px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 11px;
}

.typing-wrap {
  --typing-pressure: 0%;
  min-height: 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.018)),
    #0a0a0b;
  background-size: 28px 28px, 28px 28px, auto, auto;
  padding: 40px 40px 56px;
  position: relative;
  overflow: hidden;
  cursor: text;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  outline: none;
  contain: layout paint style;
}

.typing-wrap::before,
.typing-wrap::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.typing-wrap::before {
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--typing-pressure);
  opacity: 0.48;
  background: linear-gradient(180deg, rgba(255, 217, 201, 0.06), rgba(255, 90, 31, 0.2));
  box-shadow: 0 -20px 70px rgba(255, 90, 31, 0.16);
  transition: height 80ms linear, opacity 180ms ease;
}

.typing-wrap::after {
  inset: 16%;
  border: 1px solid rgba(255, 90, 31, 0.26);
  border-radius: 999px;
  opacity: 0;
  transform: scale(0.86);
}

.typing-wrap.is-key-impact::after,
.typing-wrap.is-error-impact::after {
  animation: typingImpact 360ms cubic-bezier(0.16, 1, 0.3, 1);
}

.typing-wrap.is-error-impact::after {
  border-color: rgba(255, 176, 134, 0.48);
}

.typing-wrap.is-restart-armed {
  border-color: rgba(255, 217, 201, 0.5);
  box-shadow: inset 0 0 0 1px rgba(255, 90, 31, 0.12), 0 0 52px rgba(255, 90, 31, 0.12);
}

.typing-wrap.is-finished {
  border-color: rgba(164, 255, 203, 0.36);
}

.typing-wrap.is-pressure-error::before {
  background: linear-gradient(180deg, rgba(255, 176, 134, 0.08), rgba(255, 90, 31, 0.28));
}

.typing-focus-glow {
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 90, 31, 0.84), transparent);
  opacity: 0.38;
  transform: scaleX(0.28);
  transform-origin: center;
  animation: typingFocusLine 2400ms ease-in-out infinite;
  pointer-events: none;
}

.typing-meta {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  color: var(--soft);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.typing-text {
  position: relative;
  z-index: 1;
  align-self: center;
  justify-self: center;
  width: min(100%, 1320px);
  height: 4.56em;
  max-height: min(100%, 4.56em);
  overflow: hidden;
  color: rgba(247, 244, 239, 0.32);
  font-size: 44px;
  line-height: 1.52;
  font-weight: 700;
  text-align: left;
  word-break: break-word;
  white-space: pre-wrap;
  scrollbar-width: none;
  animation: typingWindowIn 180ms ease both;
}

.typing-text::-webkit-scrollbar {
  display: none;
}

.typing-char {
  position: relative;
  display: inline;
  border-radius: 6px;
  transition: color 90ms ease, background 90ms ease, text-shadow 90ms ease;
}

.typing-char.is-correct {
  color: rgba(247, 244, 239, 0.92);
  text-shadow: 0 0 18px rgba(255, 244, 238, 0.08);
}

.typing-char.is-wrong {
  color: var(--warn);
  background: rgba(255, 90, 31, 0.13);
  box-shadow: 0 0 0 2px rgba(255, 90, 31, 0.08);
}

.typing-char.is-current::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 0.08em;
  bottom: 0.08em;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(255, 90, 31, 0.85);
  animation: typingCaret 900ms ease-in-out infinite;
}

.typing-char.is-end {
  display: inline-block;
  width: 1ch;
  height: 1em;
}

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

.typing-results {
  position: absolute;
  inset: 18px;
  z-index: 3;
  display: grid;
  grid-template-rows: auto 78px auto;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 90, 31, 0.13) 1px, transparent 0),
    rgba(8, 8, 9, 0.9);
  background-size: 18px 18px, auto;
  backdrop-filter: blur(18px);
  animation: paletteIn 180ms ease both;
}

.typing-results[hidden] {
  display: none;
}

.typing-result-head,
.typing-result-primary,
.typing-result-details,
.typing-result-details div,
.typing-results div,
.typing-stat,
.typing-inspector-stats div {
  min-width: 0;
}

.typing-result-head {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 14px;
  align-items: end;
}

.typing-score-block,
.typing-result-primary > div,
.typing-result-details div,
.typing-stat,
.typing-inspector-stats div {
  display: grid;
  gap: 5px;
}

.typing-result-primary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.typing-results .typing-score-block strong {
  color: var(--accent);
  font-size: 48px;
  line-height: 0.88;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.typing-score-block em {
  color: var(--accent-2);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  text-transform: uppercase;
}

.typing-results strong,
.typing-stat span,
.typing-inspector-stats strong {
  color: var(--text);
  font-size: 32px;
  line-height: 1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.typing-results span,
.typing-score-block span,
.typing-stat strong,
.typing-inspector-stats span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.typing-result-chart {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(32, minmax(0, 1fr));
  align-items: end;
  gap: 5px;
  padding: 10px 12px 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    rgba(255, 255, 255, 0.035);
  background-size: 100% 25%;
}

.typing-chart-bar {
  --wpm: 0%;
  --raw: 0%;
  position: relative;
  min-height: 14px;
  height: var(--raw);
  border-radius: 999px 999px 4px 4px;
  background: rgba(255, 255, 255, 0.18);
  overflow: visible;
}

.typing-chart-bar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--wpm);
  border-radius: inherit;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 18px rgba(255, 90, 31, 0.22);
}

.typing-chart-bar i {
  position: absolute;
  left: 50%;
  top: -12px;
  width: 8px;
  height: 8px;
  transform: translateX(-50%) rotate(45deg);
}

.typing-chart-bar i::before,
.typing-chart-bar i::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 0;
  width: 2px;
  height: 8px;
  border-radius: 999px;
  background: var(--warn);
}

.typing-chart-bar i::after {
  transform: rotate(90deg);
}

.typing-result-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.typing-result-details div {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.typing-result-details strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--accent);
  font-size: 18px;
}

.typing-stat-strip {
  height: 134px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 90, 31, 0.1) 1px, transparent 0),
    rgba(255, 255, 255, 0.04);
  background-size: 18px 18px, auto;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  align-items: stretch;
}

.typing-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-left: 1px solid var(--line);
  padding: 0 12px;
  min-width: 0;
}

.typing-stat:first-child {
  border-left: 0;
}

.typing-stat span {
  font-size: 34px;
}

.typing-stat strong {
  width: 100%;
  text-align: center;
}

@keyframes typingImpact {
  0% {
    opacity: 0.85;
    transform: scale(0.82);
  }
  100% {
    opacity: 0;
    transform: scale(1.14);
  }
}

@keyframes typingCaret {
  0%,
  100% {
    opacity: 0.35;
    transform: scaleY(0.72);
  }
  45% {
    opacity: 1;
    transform: scaleY(1);
  }
}

@keyframes typingFocusLine {
  0%,
  100% {
    opacity: 0.22;
    transform: scaleX(0.25);
  }
  50% {
    opacity: 0.58;
    transform: scaleX(0.82);
  }
}

@keyframes typingWindowIn {
  from {
    opacity: 0.72;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.inspector {
  border-radius: var(--radius-lg);
  padding: 18px;
  min-width: 0;
  position: sticky;
  top: 14px;
  height: calc(100svh - 28px);
  overflow: hidden;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
}

.panel {
  display: none;
}

.panel.is-visible {
  display: grid;
  align-content: start;
  gap: 18px;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
  contain: layout paint style;
}

.panel-head {
  display: grid;
  gap: 2px;
}

.field-row,
.range-field {
  display: grid;
  gap: 9px;
}

.module-section {
  display: grid;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.advanced-drawer,
.hardware-profile-panel,
.compact-drawer {
  gap: 0;
}

.drawer-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  min-height: 44px;
  border-radius: 16px;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease;
}

.drawer-summary-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.drawer-summary::-webkit-details-marker {
  display: none;
}

.drawer-summary::after {
  content: "";
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 180ms ease, border-color 180ms ease;
}

.advanced-drawer[open] .drawer-summary::after,
.hardware-profile-panel[open] .drawer-summary::after,
.compact-drawer[open] .drawer-summary::after {
  border-color: var(--accent);
  transform: translateY(4px) rotate(225deg);
}

.drawer-summary:hover strong {
  color: var(--accent-2);
}

.advanced-drawer .drawer-summary,
.compact-drawer .drawer-summary {
  align-items: flex-start;
}

.advanced-drawer .drawer-summary span:not(.drawer-summary-copy),
.compact-drawer .drawer-summary span:not(.drawer-summary-copy),
.hardware-profile-panel .drawer-summary span:not(.drawer-summary-copy) {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.advanced-drawer .drawer-summary strong,
.compact-drawer .drawer-summary strong {
  margin-top: 0;
  color: var(--soft);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.22;
  white-space: normal;
}

.drawer-content {
  display: grid;
  gap: 16px;
  padding-top: 16px;
}

.drawer-content.compact {
  gap: 12px;
}

.sub-module {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.sub-module:first-child {
  padding-top: 0;
  border-top: 0;
}

.module-head {
  display: grid;
  gap: 2px;
}

.module-head strong {
  font-size: 15px;
}

.advanced-drawer {
  font-size: 12px;
}

.advanced-drawer .drawer-content {
  gap: 14px;
}

.advanced-drawer .sub-module {
  gap: 10px;
}

.advanced-drawer .module-head span,
.advanced-drawer .select-grid label,
.advanced-drawer .range-field > span {
  font-size: 10px;
}

.advanced-drawer .module-head strong {
  font-size: 13px;
}

.advanced-drawer .control,
.advanced-drawer .primary-button,
.advanced-drawer .ghost-button,
.advanced-drawer .poll-choice {
  min-height: 34px;
  font-size: 12px;
}

.advanced-drawer .primary-button,
.advanced-drawer .ghost-button {
  padding: 0 12px;
}

.hardware-profile-panel {
  font-size: 12px;
}

.hardware-profile-panel .drawer-summary strong {
  font-size: 13px;
}

.hardware-profile-panel .drawer-summary {
  align-items: center;
}

.hardware-profile-panel .drawer-content {
  gap: 10px;
}

.hardware-profile-panel .profile-password span,
.hardware-profile-panel .compact-switch span {
  font-size: 10px;
}

.hardware-profile-panel .profile-password .control,
.hardware-profile-panel .ghost-button,
.hardware-profile-panel .file-button,
.hardware-profile-panel .compact-switch {
  min-height: 34px;
  font-size: 12px;
}

.hardware-profile-panel .ghost-button,
.hardware-profile-panel .file-button {
  padding: 0 10px;
  white-space: nowrap;
}

.hardware-profile-panel .toggle-grid {
  gap: 8px;
}

.hardware-profile-panel .profile-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.compact-drawer {
  font-size: 12px;
}

.compact-drawer .drawer-content {
  gap: 10px;
}

.compact-drawer .control,
.compact-drawer .primary-button,
.compact-drawer .ghost-button,
.compact-drawer .poll-choice,
.compact-drawer .switch-line {
  min-height: 34px;
  border-radius: 12px;
  font-size: 12px;
}

.compact-drawer .primary-button,
.compact-drawer .ghost-button {
  padding: 0 11px;
}

.compact-drawer .select-grid label,
.compact-drawer .range-field > span,
.compact-drawer .switch-line span {
  font-size: 10px;
}

.compact-drawer .switch-line span {
  color: var(--text);
  font-weight: 600;
  text-transform: none;
}

.gamepad-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.gamepad-mode-button {
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.gamepad-mode-button:hover,
.gamepad-mode-button.is-active {
  border-color: rgba(255, 90, 31, 0.62);
  background: rgba(255, 90, 31, 0.16);
  color: var(--text);
}

.gamepad-mode-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.gamepad-status {
  min-height: 26px;
  display: flex;
  align-items: center;
  min-width: 0;
  color: var(--soft);
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gamepad-target-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 244px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
}

.gamepad-target {
  min-width: 0;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  cursor: pointer;
  display: grid;
  grid-template-rows: 34px auto auto;
  justify-items: center;
  align-content: center;
  gap: 3px;
  padding: 8px 7px;
  text-align: center;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease, transform 160ms ease;
}

.gamepad-target:hover,
.gamepad-target.is-active {
  border-color: rgba(255, 90, 31, 0.62);
  background: rgba(255, 90, 31, 0.16);
}

.gamepad-target:active {
  transform: scale(0.98);
}

.gamepad-glyph {
  width: 32px;
  height: 32px;
  display: block;
  color: rgba(245, 241, 235, 0.86);
}

.gamepad-glyph svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.gamepad-glyph .gp-surface {
  fill: rgba(255, 255, 255, 0.055);
  stroke: rgba(255, 255, 255, 0.44);
  stroke-width: 1.35;
}

.gamepad-glyph .gp-ring,
.gamepad-glyph .gp-line {
  fill: none;
  stroke: rgba(255, 255, 255, 0.56);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gamepad-glyph .gp-active {
  fill: rgba(255, 90, 31, 0.92);
  stroke: rgba(255, 217, 201, 0.92);
  stroke-width: 0.8;
}

.gamepad-glyph text {
  fill: #050505;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0;
  pointer-events: none;
}

.gamepad-glyph.is-face-a .gp-active {
  fill: #77d765;
}

.gamepad-glyph.is-face-b .gp-active {
  fill: #ff5b52;
}

.gamepad-glyph.is-face-x .gp-active {
  fill: #5aa6ff;
}

.gamepad-glyph.is-face-y .gp-active {
  fill: #ffd35a;
}

.gamepad-target:hover .gamepad-glyph .gp-surface,
.gamepad-target.is-active .gamepad-glyph .gp-surface {
  stroke: rgba(255, 217, 201, 0.86);
}

.gamepad-target.is-active .gamepad-glyph .gp-active {
  filter: drop-shadow(0 0 9px rgba(255, 90, 31, 0.5));
}

.gamepad-target-label,
.gamepad-target strong,
.gamepad-target small {
  min-width: 0;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gamepad-target-label {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.gamepad-target strong {
  color: var(--text);
  font-size: 10.5px;
  line-height: 1.12;
}

.gamepad-target small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.gamepad-actions {
  justify-content: space-between;
  gap: 8px;
}

.field-row > label,
.select-grid label,
.range-field > span,
.color-row label,
.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.select-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

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

.select-grid label {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.select-grid .control,
.profile-password .control,
.module-section .control {
  width: 100%;
  min-width: 0;
  border-radius: 14px;
}

.advanced-travel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mini-list {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  padding: 9px;
  display: grid;
  gap: 6px;
  font-size: 11px;
}

.mini-list div {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.mini-list strong {
  color: var(--accent-2);
  font-size: 12px;
  line-height: 1;
}

.mini-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
  color: var(--muted);
}

.key-groups {
  display: grid;
  gap: 14px;
  min-width: 0;
  max-height: 42svh;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 4px;
}

.key-group {
  display: grid;
  gap: 8px;
}

.key-group-title {
  color: var(--soft);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.key-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.key-choice,
.mode-choice,
.direction-choice,
.poll-choice {
  max-width: 100%;
  min-height: 31px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  padding: 0 11px;
  cursor: pointer;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-choice.is-active,
.mode-choice.is-active,
.direction-choice.is-active,
.poll-choice.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #050505;
  font-weight: 700;
}

.typing-panel {
  --typing-pressure: 0%;
}

.typing-pressure {
  --typing-pressure: 0%;
  min-height: 168px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.11) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.058), rgba(255, 255, 255, 0.02));
  background-size: 100% 25%, auto;
  padding: 14px;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
  position: relative;
}

.typing-pressure::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: var(--typing-pressure);
  background: linear-gradient(180deg, rgba(255, 217, 201, 0.05), rgba(255, 90, 31, 0.2));
  opacity: 0.55;
  pointer-events: none;
}

.typing-pressure.is-pressure-error::before {
  background: linear-gradient(180deg, rgba(255, 176, 134, 0.08), rgba(255, 90, 31, 0.3));
}

.typing-pressure-meter {
  position: relative;
  z-index: 1;
  width: 72px;
  min-height: 138px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    rgba(0, 0, 0, 0.28);
  background-size: 100% 25%;
  overflow: hidden;
  box-shadow: inset 0 0 0 6px rgba(0, 0, 0, 0.2), 0 18px 42px rgba(0, 0, 0, 0.32);
}

.typing-pressure-fill,
.typing-pressure-spark {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--typing-pressure);
  transition: height 80ms linear;
}

.typing-pressure-fill {
  background: linear-gradient(180deg, rgba(255, 244, 238, 0.98), rgba(255, 90, 31, 0.94));
}

.typing-pressure-spark {
  opacity: 0.5;
  filter: blur(16px);
  background: var(--accent);
}

.typing-pressure-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 8px;
}

.typing-pressure-copy span,
.typing-pressure-copy em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  text-transform: uppercase;
}

.typing-pressure-copy strong {
  color: var(--text);
  font-size: 46px;
  line-height: 0.92;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.typing-pressure-copy em {
  color: var(--accent-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.typing-inspector-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.typing-inspector-stats div {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  padding: 10px;
}

.typing-inspector-stats strong {
  font-size: 22px;
}

.typing-custom-text {
  width: 100%;
  min-height: 124px;
  resize: vertical;
  border-radius: 18px;
  padding: 12px 14px;
  line-height: 1.35;
}

.trigger-visual {
  --depth: 0%;
  --actuation: 38%;
  --release: 25%;
  min-height: 318px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 90, 31, 0.13) 1px, transparent 0),
    linear-gradient(180deg, rgba(255, 255, 255, 0.068), rgba(255, 255, 255, 0.025));
  background-size: 18px 18px, auto;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  contain: layout paint;
}

.panel[data-panel="trigger"] .panel-head .eyebrow {
  font-size: 10px;
}

.panel[data-panel="trigger"] .panel-head h2 {
  font-size: 21px;
}

.trigger-meter-stack {
  min-width: 0;
  display: grid;
  grid-template-columns: 72px 24px;
  gap: 10px;
  align-items: stretch;
}

.trigger-meter {
  position: relative;
  min-height: 248px;
  width: 72px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.095), rgba(0, 0, 0, 0.26));
  background-size: 100% 25%;
  box-shadow: inset 0 0 0 6px rgba(0, 0, 0, 0.18), 0 20px 48px rgba(0, 0, 0, 0.38);
  overflow: hidden;
  cursor: ns-resize;
  contain: paint;
}

.trigger-meter-fill,
.trigger-meter-glow {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--depth);
  transition: none;
  will-change: height;
}

.trigger-meter-fill {
  background: linear-gradient(180deg, rgba(255, 240, 231, 0.98), rgba(255, 90, 31, 0.95));
}

.trigger-meter-glow {
  opacity: 0.5;
  filter: blur(18px);
  background: var(--accent);
}

.trigger-line {
  position: absolute;
  left: 7px;
  right: 7px;
  z-index: 2;
  display: block;
  border-top: 2px solid rgba(255, 244, 238, 0.96);
  pointer-events: none;
}

.trigger-line b {
  display: none;
}

.trigger-line-actuation {
  bottom: var(--actuation);
  box-shadow: 0 0 20px rgba(255, 90, 31, 0.74);
}

.trigger-line-reset {
  bottom: var(--release);
  border-top: 1px dashed rgba(164, 255, 203, 0.7);
}

.trigger-line-reset b {
  color: var(--ok);
}

.trigger-scale {
  display: grid;
  align-content: space-between;
  color: var(--soft);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  min-height: 248px;
  padding: 10px 0 16px;
}

.trigger-summary {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
}

.trigger-target,
.trigger-readout,
.trigger-status-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  min-width: 0;
}

.trigger-target {
  display: grid;
  gap: 4px;
}

.trigger-target strong {
  color: var(--text);
  font-size: 19px;
  line-height: 0.98;
  text-transform: none;
}

.trigger-readout strong,
.trigger-status-row strong {
  font-size: 9.5px;
}

.trigger-readout strong,
.trigger-status-row strong {
  color: var(--ok);
}

.trigger-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.trigger-stat {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  padding: 10px;
  min-height: 72px;
  min-width: 0;
}

.trigger-stat .metric-value {
  font-size: 29px;
}

.trigger-stat .metric-label {
  font-size: 10.5px;
}

.metric-value.small {
  font-size: 27px;
}

.trigger-rapid-switch {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  padding: 0 12px;
}

.trigger-rapid-switch span {
  font-size: 13px;
}

.trigger-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.trigger-preset {
  min-height: 40px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease, transform 160ms ease;
}

.trigger-preset:hover,
.trigger-preset.is-active {
  color: var(--text);
  border-color: rgba(255, 90, 31, 0.55);
  background: rgba(255, 90, 31, 0.15);
}

.trigger-preset:active {
  transform: scale(0.98);
}

.keymap-actions,
.trigger-actions {
  width: 100%;
  flex-wrap: nowrap;
}

.keymap-actions {
  justify-content: space-between;
  padding-top: 2px;
}

.keymap-actions .primary-button {
  min-width: 92px;
}

.keymap-actions .text-button,
.trigger-actions .text-button {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.trigger-actions {
  gap: 8px;
}

.trigger-actions .text-button {
  margin-right: auto;
}

.trigger-actions .primary-button,
.trigger-actions .ghost-button {
  min-height: 36px;
  padding: 0 13px;
  font-size: 13px;
  white-space: nowrap;
}

.metric-row {
  min-height: 84px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px;
}

.metric-value {
  display: block;
  min-width: 2.4ch;
  font-size: 32px;
  line-height: 1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.switch-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
}

.switch-line input {
  width: 42px;
  height: 24px;
  appearance: none;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  position: relative;
  cursor: pointer;
}

.switch-line input::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  left: 2px;
  top: 2px;
  background: var(--muted);
  transition: transform 160ms ease, background 160ms ease;
}

.switch-line input:checked {
  background: rgba(255, 90, 31, 0.24);
  border-color: rgba(255, 90, 31, 0.55);
}

.switch-line input:checked::after {
  transform: translateX(18px);
  background: var(--accent);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  appearance: none;
  height: 18px;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0 var(--range-progress, 38%), rgba(255, 255, 255, 0.26) var(--range-progress, 38%) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 19px;
  height: 19px;
  margin-top: -8px;
  border-radius: 50%;
  border: 2px solid rgba(5, 5, 5, 0.9);
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 90, 31, 0.28), 0 6px 18px rgba(0, 0, 0, 0.42);
}

input[type="range"]::-moz-range-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

input[type="range"]::-moz-range-progress {
  height: 5px;
  border-radius: 999px;
  background: var(--accent);
}

input[type="range"]::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid rgba(5, 5, 5, 0.9);
  background: var(--accent);
}

.mode-grid,
.direction-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lighting-toggle-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

#directionGroup {
  margin-bottom: 12px;
}

.compact-segmented {
  width: 100%;
  justify-content: stretch;
}

.compact-segmented .segment {
  flex: 1;
}

.mode-grid.compact .poll-choice {
  min-width: 70px;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.preset-tile {
  --preset-color: var(--accent);
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 8px 10px;
  display: grid;
  align-content: center;
  gap: 4px;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.preset-tile:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.065);
}

.preset-tile span {
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.preset-tile strong {
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
  text-transform: uppercase;
}

.color-row,
.deadband-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.device-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.device-summary div {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px;
}

.device-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.feature-pill {
  min-height: 27px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  padding: 0 9px;
  color: var(--soft);
}

.feature-pill.is-on {
  color: var(--text);
  border-color: rgba(164, 255, 203, 0.42);
  background: rgba(164, 255, 203, 0.09);
}

.device-meta-row {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 18px;
}

.device-meta-row > span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.device-meta-row strong {
  display: inline;
  margin: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.panel[data-panel="performance"],
.panel[data-panel="lighting"],
.panel[data-panel="socd"],
.panel[data-panel="gamepad"] {
  gap: 14px;
  font-size: 12px;
}

.panel[data-panel="performance"] .device-summary {
  gap: 7px;
}

.panel[data-panel="performance"] .device-meta-row {
  gap: 18px;
}

.panel[data-panel="performance"] .device-summary div {
  border-radius: 14px;
  padding: 8px;
}

.panel[data-panel="performance"] .device-summary span,
.panel[data-panel="socd"] .field-row > label,
.panel[data-panel="socd"] .select-grid label,
.panel[data-panel="lighting"] .field-row > label,
.panel[data-panel="lighting"] .range-field > span,
.panel[data-panel="lighting"] .color-row label {
  font-size: 10px;
}

.panel[data-panel="performance"] .device-summary strong {
  font-size: 13px;
}

.panel[data-panel="performance"] .feature-pills {
  gap: 6px;
}

.panel[data-panel="performance"] .feature-pill {
  flex: 1 1 calc(50% - 6px);
  min-width: 0;
  min-height: 23px;
  padding: 0 6px;
  font-size: 9px;
  text-align: center;
  white-space: nowrap;
}

.panel[data-panel="performance"] .field-row,
.panel[data-panel="socd"] .field-row,
.panel[data-panel="lighting"] .field-row,
.panel[data-panel="lighting"] .range-field {
  gap: 7px;
}

.panel[data-panel="performance"] .action-row,
.panel[data-panel="socd"] .action-row,
.panel[data-panel="gamepad"] .action-row,
.panel[data-panel="lighting"] .action-row,
.compact-actions {
  gap: 7px;
}

.panel[data-panel="performance"] .primary-button,
.panel[data-panel="performance"] .ghost-button,
.panel[data-panel="performance"] .poll-choice,
.panel[data-panel="socd"] .primary-button,
.panel[data-panel="socd"] .ghost-button,
.panel[data-panel="socd"] .poll-choice,
.panel[data-panel="gamepad"] .primary-button,
.panel[data-panel="gamepad"] .ghost-button,
.panel[data-panel="gamepad"] .gamepad-mode-button,
.panel[data-panel="lighting"] .primary-button,
.panel[data-panel="lighting"] .ghost-button,
.panel[data-panel="lighting"] .mode-choice,
.panel[data-panel="lighting"] .direction-choice {
  min-height: 34px;
  border-radius: 13px;
  padding: 0 11px;
  font-size: 12px;
}

.panel[data-panel="performance"] .poll-choice {
  min-width: 54px;
}

.performance-poll-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.mode-grid.compact.performance-poll-grid .poll-choice {
  width: 100%;
  min-width: 0;
}

.socd-mode-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.compact-drawer .socd-mode-grid .poll-choice {
  width: 100%;
  min-width: 0;
  padding: 0 4px;
  font-size: 11px;
}

.panel[data-panel="socd"] .socd-mode-grid .poll-choice {
  width: 100%;
  min-width: 0;
  padding: 0 4px;
  font-size: 11px;
}

.panel[data-panel="socd"] .feedback-button {
  padding-right: 34px;
  padding-left: 34px;
}

.socd-power-line {
  min-height: 44px;
}

.socd-power-actions,
.socd-slot-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.socd-power-actions .primary-button,
.socd-power-actions .ghost-button,
.socd-slot-actions .primary-button,
.socd-slot-actions .ghost-button {
  width: 100%;
  min-width: 0;
}

.deadband-primary-actions,
.deadband-secondary-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.deadband-primary-actions .primary-button,
.deadband-primary-actions .ghost-button {
  width: 100%;
}

.deadband-secondary-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel[data-panel="performance"] .deadband-secondary-actions .ghost-button {
  width: 100%;
  min-width: 0;
  padding: 0 2px;
  font-size: 10px;
  white-space: nowrap;
}

.socd-slot-actions {
  align-items: center;
}

.socd-slot-actions .text-button {
  justify-self: start;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.socd-slot-actions .primary-button {
  justify-self: stretch;
  min-width: 0;
}

.socd-slot-field label {
  display: grid;
  gap: 7px;
}

.socd-slot-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.panel[data-panel="gamepad"] .gamepad-target-grid {
  min-height: 0;
  height: 100%;
  max-height: none;
}

.panel[data-panel="gamepad"].is-visible {
  height: 100%;
  align-content: stretch;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.panel[data-panel="gamepad"] .gamepad-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel[data-panel="gamepad"] .gamepad-actions .primary-button,
.panel[data-panel="gamepad"] .gamepad-actions .ghost-button {
  width: 100%;
  min-width: 0;
}

.panel[data-panel="lighting"] .mode-grid,
.panel[data-panel="lighting"] .direction-grid {
  gap: 7px;
}

.panel[data-panel="lighting"] .direction-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.panel[data-panel="lighting"] .direction-choice {
  min-width: 0;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.panel[data-panel="lighting"] .direction-choice img {
  width: 17px;
  height: 17px;
  display: block;
  opacity: 0.78;
  filter: brightness(0) invert(1);
}

.panel[data-panel="lighting"] .direction-choice.is-active img {
  opacity: 1;
  filter: none;
}

.panel[data-panel="lighting"] .compact-segmented .segment.is-disabled,
.panel[data-panel="lighting"] .compact-segmented .segment:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.panel[data-panel="lighting"] .switch-line {
  min-height: 34px;
  font-size: 12px;
}

.panel[data-panel="lighting"] .lighting-toggle-row .switch-line {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  padding: 0 10px;
}

.rainbow-switch > span {
  background: linear-gradient(90deg, #ff5a1f, #ffe866, #9cffc7, #55a7ff, #b56cff, #ff66c7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 5px rgba(255, 130, 90, 0.24));
  font-weight: 800;
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.toggle-grid .switch-line {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  padding: 0 10px;
  font-size: 12px;
}

.calibration-meter {
  height: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.calibration-meter span {
  --calibration-progress: 0%;
  display: block;
  width: var(--calibration-progress);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ok), var(--accent));
  box-shadow: 0 0 22px rgba(255, 90, 31, 0.34);
  transition: width 180ms ease;
}

.color-row label {
  display: grid;
  gap: 8px;
}

.panel[data-panel="lighting"] .color-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 12px;
}

.panel[data-panel="lighting"] .color-row label {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

input[type="color"] {
  width: 38px;
  height: 38px;
  border: 4px solid rgba(255, 255, 255, 0.11);
  background: var(--swatch, var(--accent));
  border-radius: 50%;
  padding: 4px;
  overflow: hidden;
  cursor: pointer;
  appearance: none;
  box-shadow: 0 0 0 1px var(--line), 0 0 16px color-mix(in srgb, var(--swatch, var(--accent)) 32%, transparent);
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 50%;
}

input[type="color"]::-moz-color-swatch {
  border: 0;
  border-radius: 50%;
}

.file-button {
  position: relative;
  overflow: hidden;
  display: inline-grid;
  place-items: center;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.activity-log {
  min-height: 54px;
  max-height: 128px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.045);
  background: rgba(255, 255, 255, 0.009);
  padding: 10px 12px;
  color: rgba(245, 241, 235, 0.3);
  font-size: 10.5px;
  line-height: 1.32;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.activity-log strong {
  color: rgba(245, 241, 235, 0.42);
}

.activity-log span {
  color: rgba(245, 241, 235, 0.26);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .inspector {
    grid-column: 2;
    position: relative;
    top: auto;
    height: auto;
  }

  .rail {
    width: 72px;
  }
}

@media (max-width: 760px) {
  .connect-gate {
    padding: 14px;
  }

  .gate-stage {
    width: min(420px, 100%);
  }

  .gate-subcopy {
    font-size: 12px;
  }

  .chooser-beacon {
    left: 12px;
    top: 18px;
    transform: scale(0.78);
    transform-origin: top left;
  }

  .gate-links {
    gap: 6px;
  }

  .gate-links a {
    font-size: 10px;
    padding: 0 9px;
  }

  .gate-downloads {
    width: 100%;
  }

  .gate-download-buttons {
    display: grid;
    grid-template-columns: 1fr;
    width: min(250px, 100%);
  }

  .gate-download-buttons a {
    justify-content: center;
    width: 100%;
  }

  .app-shell {
    display: flex;
    flex-direction: column;
    padding: 10px;
  }

  .rail {
    position: relative;
    top: auto;
    height: auto;
    width: auto;
    gap: 8px;
    overflow-x: auto;
    flex-direction: row;
    justify-content: space-between;
    border-radius: 22px;
  }

  .rail-nav {
    margin: 0;
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
  }

  .rail-utility {
    margin: 0;
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
  }

  .rail-button {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }

  .rail-button[data-label]::before,
  .rail-button[data-label]::after {
    display: none;
  }

  .workspace,
  .inspector {
    border-radius: 22px;
    padding: 14px;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .topbar-actions .ghost-button,
  .topbar-actions .primary-button,
  .topbar-actions .custom-select {
    flex: 1;
  }

  h1 {
    font-size: 30px;
  }

  .stage-toolbar,
  .keyboard-meta,
  .axis-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-left {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .typing-toolbar {
    left: 16px;
    right: 16px;
    flex-direction: column;
  }

  .typing-control-stack {
    max-width: 100%;
  }

  .typing-toolbar-actions {
    width: 100%;
  }

  .typing-toolbar-actions .primary-button,
  .typing-toolbar-actions .ghost-button {
    flex: 1;
  }

  .typing-wrap {
    padding: 112px 16px 56px;
    min-height: 440px;
  }

  .typing-meta {
    right: 16px;
    bottom: 16px;
  }

  .typing-text {
    font-size: 30px;
    line-height: 1.48;
    height: 4.44em;
    max-height: min(100%, 4.44em);
  }

  .typing-results {
    inset: auto 14px 14px;
    grid-template-rows: auto minmax(110px, 1fr) auto;
  }

  .typing-result-head,
  .typing-result-primary,
  .typing-result-details {
    grid-template-columns: 1fr;
  }

  .typing-score-block strong {
    font-size: 58px;
  }

  .typing-stat-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    height: auto;
    min-height: 156px;
  }

  .typing-stat {
    border-left: 0;
    padding-left: 0;
  }

  .typing-pressure {
    grid-template-columns: 1fr;
  }

  .keyboard-wrap {
    overflow-x: auto;
  }

  .keyboard-canvas {
    min-width: 720px;
  }

  .keyboard-3d {
    min-width: 720px;
  }

  .remap-palette {
    width: calc(100% - 24px);
  }

  .remap-results {
    grid-template-columns: 1fr;
  }

  .axis-bars {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .trigger-visual {
    grid-template-columns: 1fr;
  }

  .trigger-meter-stack {
    grid-template-columns: 78px 28px;
  }

  .trigger-meter {
    min-height: 210px;
    width: 78px;
  }

  .trigger-stat-grid,
  .trigger-presets,
  .select-grid,
  .select-grid.two,
  .advanced-travel-grid,
  .device-summary,
  .preset-grid,
  .toggle-grid,
  .hardware-profile-panel .profile-actions,
  .profile-manager-row {
    grid-template-columns: 1fr;
  }

  .trigger-palette {
    width: calc(100% - 24px);
  }

  .lighting-palette {
    width: calc(100% - 24px);
  }

  .color-row,
  .deadband-grid {
    grid-template-columns: 1fr;
  }
}
