html,
body {
  height: 100%;
}

body {
  background-color: #f6f6f6;
  color: #111;
  font-family: "Segoe UI", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  overflow: hidden;
}

.startup-splash {
  align-items: center;
  background: #a8b2de;
  display: flex;
  inset: 0;
  justify-content: center;
  opacity: 1;
  position: fixed;
  transition: opacity 0.24s ease;
  z-index: 5000;
}

.startup-splash[hidden] {
  display: none;
}

.startup-splash.is-fading {
  opacity: 0;
}

.startup-splash-brand {
  align-items: center;
  color: rgba(255, 255, 255, 0.96);
  display: inline-flex;
  font-size: clamp(26px, 4.2vw, 56px);
  font-weight: 600;
  gap: clamp(12px, 1.5vw, 20px);
  letter-spacing: 0.01em;
  transform: translateZ(0);
  animation: startupSplashFloat 1.45s ease-in-out infinite;
}

.startup-splash-mark {
  display: grid;
  gap: 3px;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  height: clamp(28px, 4.1vw, 52px);
  width: clamp(28px, 4.1vw, 52px);
}

.startup-splash-mark span {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 1px;
  display: block;
  transform: translateY(0) scale(0.92);
  animation: startupSplashTilePulse 0.9s ease-in-out infinite;
}

.startup-splash-mark span:nth-child(2) {
  animation-delay: 0.12s;
}

.startup-splash-mark span:nth-child(3) {
  animation-delay: 0.24s;
}

.startup-splash-mark span:nth-child(4) {
  animation-delay: 0.36s;
}

.startup-splash-text {
  animation: startupSplashTextGlow 1.25s ease-in-out infinite;
}

@keyframes startupSplashFloat {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes startupSplashTilePulse {
  0% {
    opacity: 0.72;
    transform: translateY(0) scale(0.88);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px) scale(1.08);
  }
  100% {
    opacity: 0.72;
    transform: translateY(0) scale(0.88);
  }
}

@keyframes startupSplashTextGlow {
  0% {
    opacity: 0.82;
    text-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
  50% {
    opacity: 1;
    text-shadow: 0 0 26px rgba(255, 255, 255, 0.34);
  }
  100% {
    opacity: 0.82;
    text-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
}

a {
  color: #0b57d0;
  text-decoration: none;
}

.page {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.header {
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  background: rgba(24, 32, 74, 0.93);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 2px 32px rgba(0, 0, 0, 0);
  left: 0;
  padding: 4px 10px;
  position: fixed;
  right: 0;
  top: 0;
  transform: translateY(calc(-100% + 3px));
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.22s ease;
  z-index: 200;
}

.header--visible {
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.32);
  transform: translateY(0);
}

.header::after {
  background: rgba(255, 255, 255, 0.28);
  border-radius: 0 0 4px 4px;
  bottom: 0;
  content: '';
  height: 3px;
  left: 50%;
  pointer-events: none;
  position: absolute;
  transform: translateX(-50%);
  width: 56px;
}

.title-row {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: space-between;
  min-width: 0;
  position: relative;
}

h1 {
  font-weight: normal;
  font-size: 140%;
  margin: 0;
}

.brand {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.brand-logo {
  background: #ffffff;
  border-radius: 8px;
  display: block;
  height: 34px;
  max-width: min(42vw, 240px);
  object-fit: contain;
  padding: 4px 6px;
  width: auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand-subtitle {
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
}

.controls {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: flex-end;
  margin-left: auto;
  min-width: 0;
  width: auto;
}

.controls > * {
  flex: 0 0 auto;
}

.header-pill {
  flex: 0 0 auto;
}

.header-quick-actions {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 2px;
  min-width: 0;
  padding: 4px;
}

.header-icon-button {
  align-items: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #eaf0ff;
  cursor: pointer;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  padding: 0;
  flex: 0 0 auto;
  width: 34px;
}

.header-action-button {
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  border-radius: 8px;
  color: #f5f8ff;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
}

.header-action-button-select {
  background: rgba(32, 147, 255, 0.22);
}

.header-action-button svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  height: 16px;
  width: 16px;
}

.header-action-button:hover,
.header-action-button:focus {
  background: rgba(255, 255, 255, 0.22);
  box-shadow: none;
  outline: none;
}

.header-action-label {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.header-icon-button:hover,
.header-icon-button:focus {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: none;
  outline: none;
}

.header-icon-button svg,
.header-signin-button svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  height: 18px;
  width: 18px;
}

.header-settings-wrap {
  position: relative;
}

.header-help-wrap {
  position: relative;
}

.header-help-menu {
  background: #ffffff;
  border: 1px solid #d6dff6;
  border-radius: 10px;
  box-shadow: 0 14px 28px rgba(11, 34, 91, 0.2);
  min-width: 150px;
  overflow: hidden;
  padding: 6px 0;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 1400;
}

.header-help-item {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #26324b;
  cursor: pointer;
  display: flex;
  font-size: 1rem;
  font-weight: 500;
  justify-content: flex-start;
  line-height: 1.2;
  margin: 0;
  min-height: 40px;
  padding: 8px 14px;
  text-align: left;
  width: 100%;
}

.header-help-item:hover,
.header-help-item:focus {
  background: #eef3ff;
  box-shadow: none;
  outline: none;
}

.header-settings-menu {
  background: #ffffff;
  border: 1px solid #d6dff6;
  border-radius: 12px;
  box-shadow: 0 14px 28px rgba(11, 34, 91, 0.2);
  min-width: 220px;
  padding: 10px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 1400;
}

.header-settings-item + .header-settings-item {
  margin-top: 10px;
}

.header-settings-menu .control-label {
  color: #32415f;
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.header-settings-menu #languageMenu {
  width: 100%;
}

.header-settings-theme-button {
  align-items: center;
  background: #f4f7ff;
  border: 1px solid #ccd8f5;
  border-radius: 10px;
  color: #243452;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 600;
  justify-content: space-between;
  min-height: 36px;
  padding: 0 12px;
  width: 100%;
}

.header-settings-theme-button:hover,
.header-settings-theme-button:focus {
  background: #edf3ff;
  border-color: #b9cbf1;
  box-shadow: none;
  outline: none;
}

.header-settings-theme-caret {
  color: #5672ad;
  font-size: 0.72rem;
  margin-left: 10px;
}

.header-settings-menu esp-web-install-button {
  display: block;
  width: 100%;
}

.header-settings-menu esp-web-install-button button {
  width: 100%;
}

.header-settings-toggle {
  align-items: center;
  display: inline-flex;
  gap: 10px;
}

.header-settings-toggle input {
  height: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 0;
}

.header-settings-toggle-track {
  align-items: center;
  background: #e4e9f3;
  border: 1px solid #c3cedf;
  border-radius: 999px;
  display: inline-flex;
  height: 22px;
  padding: 0 2px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  width: 46px;
}

.header-settings-toggle-thumb {
  background: #ffffff;
  border: 1px solid #99a8bf;
  border-radius: 50%;
  display: block;
  height: 16px;
  transition: transform 0.2s ease;
  width: 16px;
}

.header-settings-toggle input:checked + .header-settings-toggle-track {
  background: #3f56cf;
  border-color: #3248b9;
}

.header-settings-toggle input:checked + .header-settings-toggle-track .header-settings-toggle-thumb {
  transform: translateX(22px);
}

.header-settings-toggle-text {
  color: #243452;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1;
}

.header-signin-button {
  align-items: center;
  background: #ffffff;
  border: none;
  border-radius: 8px;
  color: #212632;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.95rem;
  font-weight: 600;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
}

.header-signin-button svg {
  color: #4b5f8f;
}

.header-signin-button:hover,
.header-signin-button:focus {
  box-shadow: none;
  outline: none;
}

#headerSignInLabel {
  font-size: 0.95rem;
  line-height: 1;
}

@media (max-width: 2000px) {
  .header-action-button {
    gap: 4px;
    height: 30px;
    padding: 0 8px;
  }

  .header-action-label {
    font-size: 0.75rem;
  }

  .header-icon-button {
    height: 30px;
    width: 30px;
  }

  .header-signin-button {
    gap: 0;
    height: 30px;
    justify-content: center;
    min-width: 30px;
    padding: 0;
    width: 30px;
  }

  #headerSignInLabel {
    display: none;
  }
}

esp-web-install-button {
  --esp-tools-button-color: #0b57d0;
  --esp-tools-button-text-color: #fff;
  display: inline-block;
}

ewt-install-dialog {
  inset: 0;
  position: fixed;
  z-index: 2147483647 !important;
}

ewt-install-dialog::part(backdrop),
ewt-install-dialog::part(overlay),
ewt-install-dialog::part(base),
ewt-install-dialog::part(dialog) {
  z-index: 2147483647 !important;
}

body.flash-dialog-open .blocklyToolboxDiv,
body.flash-dialog-open .blocklyToolbox,
body.flash-dialog-open .toolbox-search,
body.flash-dialog-open .toolbar-menu,
body.flash-dialog-open .workspace-connect-menu,
body.flash-dialog-open .workspace-device-panel,
body.flash-dialog-open .project-tabs-global,
body.flash-dialog-open .bottom-toolbar {
  visibility: hidden !important;
}

body.flash-dialog-open .blocklyWidgetDiv,
body.flash-dialog-open .blocklyDropDownDiv,
body.flash-dialog-open .blocklyTooltipDiv {
  display: none !important;
}

.status {
  color: #47624f;
  font-size: 0.85rem;
}

.status.connected {
  color: #247448;
}

.status.error {
  color: #bf3a4d;
}

.log-panel {
  background: #111827;
  border: 1px solid #223047;
  border-radius: 8px;
  color: #dbe7ff;
  display: flex;
  flex-direction: column;
  margin: 0 12px 12px;
  min-height: 0;
  overflow: hidden;
}

.log-panel summary {
  color: #e8efff;
  cursor: pointer;
  flex: 0 0 auto;
  font-weight: 600;
  padding: 8px 12px;
}

#serialLogHeader {
  padding-right: 76px;
  position: relative;
}

.serial-log-header-actions {
  align-items: center;
  display: inline-flex;
  gap: 4px;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.serial-log-copy-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #b8c9e9;
  cursor: pointer;
  display: inline-flex;
  height: 22px;
  justify-content: center;
  padding: 0;
  position: static;
  width: 22px;
}

.serial-log-copy-button:hover,
.serial-log-copy-button:focus {
  background: rgba(143, 178, 233, 0.16);
  color: #e7f0ff;
}

.serial-log-copy-button svg {
  height: 14px;
  width: 14px;
}

.script-preview-modal {
  inset: 0;
  position: fixed;
  z-index: 3400;
}

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

.script-preview-modal-backdrop {
  background: rgba(6, 12, 27, 0.64);
  border: 0;
  cursor: pointer;
  inset: 0;
  position: absolute;
  width: 100%;
}

.script-preview-modal-card {
  background: #0f1727;
  border: 1px solid #263857;
  border-radius: 12px;
  box-shadow: 0 24px 50px rgba(7, 13, 30, 0.45);
  color: #e8f0ff;
  display: flex;
  flex-direction: column;
  height: min(84vh, 760px);
  left: 50%;
  max-width: min(1100px, calc(100vw - 40px));
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(1100px, calc(100vw - 40px));
}

.script-preview-modal-header {
  align-items: center;
  border-bottom: 1px solid #263857;
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
}

.script-preview-modal-title {
  font-size: 18px;
  font-weight: 700;
}

.script-preview-modal-actions {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.script-preview-copy-button {
  background: rgba(51, 111, 199, 0.26);
  border: 1px solid rgba(109, 161, 244, 0.5);
  border-radius: 8px;
  color: #eaf2ff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  min-width: 72px;
  padding: 6px 12px;
}

.script-preview-copy-button:hover,
.script-preview-copy-button:focus {
  background: rgba(67, 132, 228, 0.4);
}

.script-preview-modal-close {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #d4e4ff;
  cursor: pointer;
  font-size: 24px;
  height: 32px;
  line-height: 1;
  width: 32px;
}

.script-preview-modal-close:hover,
.script-preview-modal-close:focus {
  background: rgba(109, 161, 244, 0.2);
}

.script-preview-modal-body {
  color: #dce9ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
  overflow: auto;
  padding: 14px 16px 16px;
  white-space: pre;
}

.serial-realtime-latest {
  background: #0b1220;
  border-bottom: 1px solid #223047;
  border-top: 1px solid #223047;
  padding: 6px 12px;
}

.serial-realtime-latest-label {
  color: #8fb2e9;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.serial-realtime-latest-value {
  color: #e6efff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  margin-top: 4px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

#serialLog {
  background: #0b1220;
  border-bottom: 1px solid #223047;
  border-top: 0;
  color: #e6efff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  flex: 1 1 0;
  margin: 0;
  max-height: 260px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 12px;
  white-space: pre-wrap;
  flex: 1;
}

#serialLogEnd {
  display: block;
  height: 0;
}

.control-label {
  color: #f2fff7;
  font-size: 0.9rem;
}

#languageMenu {
  margin-right: 0;
}

.main {
  --left-column-width: 280px;
  display: flex;
  flex: 1 1 auto;
  gap: 0;
  min-height: 0;
  padding: 12px 12px 6px;
}

.left-column {
  display: flex;
  flex: 0 0 var(--left-column-width, 280px);
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-right: 0;
  padding-right: 0;
  scrollbar-width: none;
  transition: flex-basis 0.2s ease, opacity 0.2s ease, width 0.2s ease;
  width: var(--left-column-width, 280px);
}

.left-column::-webkit-scrollbar {
  height: 0;
  width: 0;
}

.left-column-toggle {
  align-self: center;
  align-items: center;
  background: #7d8992;
  border: 0;
  border-radius: 0 12px 12px 0;
  color: #eaf1ff;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 16px;
  height: 144px;
  justify-content: center;
  margin-right: 0;
  padding: 0;
  position: relative;
  transform: translateX(-2px);
  transition: background-color 0.2s ease;
  width: 16px;
  z-index: 15;
}

.left-column-toggle:hover,
.left-column-toggle:focus {
  background: #6f7c86;
  box-shadow: none;
  outline: none;
}

.left-column-toggle svg {
  fill: none;
  height: 14px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
  transition: transform 0.2s ease;
  width: 14px;
}

.main.left-column-collapsed {
  --left-column-width: 0px;
}

.main.left-column-collapsed .left-column {
  flex-basis: 0 !important;
  margin-right: 0;
  min-width: 0 !important;
  opacity: 0;
  overflow: hidden;
  padding-right: 0;
  pointer-events: none;
  width: 0 !important;
}

.main.left-column-collapsed .left-column-toggle {
  margin-right: 0;
  transform: translateX(-2px);
}

.main.left-column-collapsed .left-column-toggle svg {
  transform: rotate(180deg);
}

.main.left-column-collapsed .workspace-stack {
  flex: 1 1 auto;
  width: auto;
}

.workspace-stack {
  flex: 1;
  min-height: 0;
  min-width: 0;
  position: relative;
  --toolbox-search-height: 44px;
  --toolbox-width: 220px;
  --toolbox-footer-height: 74px;
}

.workspace-stack .pane {
  inset: 0;
  position: absolute;
}

.workspace-stack .code-pane {
  display: none;
}

.workspace-stack .ai-pane {
  display: none;
}

.workspace-stack[data-view="ai"] .blocks-pane {
  z-index: 1;
}

.workspace-stack[data-view="ai"] .workspace-connect {
  display: none;
}

.workspace-stack[data-view="ai"] .workspace-tools {
  display: none;
}

.workspace-stack[data-view="ai"] .workspace-run-controls {
  display: none;
}

.workspace-stack[data-view="ai"] .ai-pane {
  display: flex;
  flex-direction: column;
  z-index: 2;
  left: var(--toolbox-width, 220px);
  right: 0;
  top: 0;
  bottom: 0;
}

.workspace-stack[data-view="ai"] .blocklyFlyout {
  display: none;
}

.workspace-stack[data-view="ai"] .blocks-pane .pane-header {
  display: none;
}

.workspace-stack[data-view="ai"] .project-tabs-bar {
  display: flex;
}

.pane {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.project-tabs-global {
  box-sizing: border-box;
  display: flex;
  flex: 0 0 auto;
  padding: 0 10px 0;
  position: relative;
  width: 100%;
}

.simulator-pane {
  flex: 0 0 auto;
  min-height: 0;
}

.pane-header {
  background-color: #f2f2f2;
  border-bottom: 1px solid #ddd;
  font-weight: 600;
  padding: 8px 12px;
}

.blocks-pane .pane-header {
  display: none;
}

.project-tabs-bar {
  align-items: center;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfb 100%);
  border: 1px solid #e1e1e1;
  border-radius: 0;
  box-sizing: border-box;
  display: flex;
  gap: 0;
  min-height: 66px;
  padding: 0;
  width: 100%;
}

.project-tabs-icon-button {
  align-items: center;
  background: #ffffff;
  border: 0;
  border-right: 1px solid #e5e5e5;
  border-radius: 0;
  color: #7f7f7f;
  display: inline-flex;
  height: 66px;
  justify-content: center;
  padding: 0;
  width: 86px;
}

.project-tabs-icon-button svg {
  fill: none;
  height: 36px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.25;
  width: 36px;
}

.project-tabs-icon-button:hover,
.project-tabs-icon-button:focus {
  background: #f6f6f6;
  box-shadow: none;
  outline: none;
}

.project-tabs-save-button svg {
  height: 35px;
  width: 35px;
}

.project-tabs-scroll {
  align-items: center;
  align-self: stretch;
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.project-tabs-list {
  align-items: center;
  display: inline-flex;
  gap: 10px;
  height: 100%;
  min-width: max-content;
  padding: 0 18px;
}

.project-tab {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #222222;
  display: inline-flex;
  gap: 10px;
  height: 52px;
  max-width: 292px;
  min-width: 244px;
  padding: 0 14px 0 22px;
}

.project-tab.is-active {
  background: #ffffff;
  border-color: #eeeeee;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08);
}

.project-tab-main {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: inherit;
  display: inline-flex;
  flex: 1 1 auto;
  height: 42px;
  justify-content: flex-start;
  min-width: 0;
  padding: 0;
}

.project-tab-title {
  font-size: 1rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-tab-option,
.project-tab-close {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: #8d8d8d;
  display: inline-flex;
  font-size: 1.58rem;
  height: 34px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 34px;
}

.project-tab-option {
  font-size: 1.55rem;
  font-weight: 400;
  letter-spacing: 0;
}

.project-tab-close {
  font-size: 2.15rem;
  font-weight: 200;
}

.project-tab-main:hover,
.project-tab-main:focus,
.project-tab-option:hover,
.project-tab-option:focus,
.project-tab-close:hover,
.project-tab-close:focus {
  background: transparent;
  color: #555555;
  outline: none;
}

.project-tabs-add-button {
  align-items: center;
  background: #ffffff;
  border: 0;
  border-left: 1px solid #e5e5e5;
  border-radius: 0;
  color: #777777;
  display: inline-flex;
  font-size: 2.35rem;
  font-weight: 300;
  height: 66px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 72px;
}

.project-tabs-add-button:hover,
.project-tabs-add-button:focus {
  background: #f6f6f6;
  box-shadow: none;
  outline: none;
}

.project-tab-options-menu {
  background: #ffffff;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  box-shadow: 0 10px 16px rgba(0, 0, 0, 0.18);
  min-width: 176px;
  padding: 6px;
  position: fixed;
  z-index: 60;
}

.project-tab-options-menu[hidden] {
  display: none;
}

.save-confirm-modal {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 175;
}

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

.save-confirm-backdrop {
  background: rgba(13, 18, 28, 0.48);
  border: 0;
  border-radius: 0;
  inset: 0;
  margin: 0;
  min-height: 100vh;
  min-width: 100vw;
  padding: 0;
  position: absolute;
  width: 100%;
}

.save-confirm-card {
  align-items: center;
  background: #ffffff;
  border: 1px solid #d7dfef;
  border-radius: 12px;
  box-shadow: 0 22px 46px rgba(15, 23, 42, 0.32);
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: min(420px, calc(100vw - 28px));
  padding: 22px 22px 0;
  position: relative;
  width: min(420px, calc(100vw - 28px));
  z-index: 1;
}

.save-confirm-close {
  align-items: center;
  background: transparent;
  border: 0;
  color: #6b7280;
  cursor: pointer;
  display: inline-flex;
  font-size: 2rem;
  font-weight: 300;
  height: 28px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 10px;
  top: 8px;
  width: 28px;
}

.save-confirm-close:hover,
.save-confirm-close:focus {
  box-shadow: none;
  color: #1f2937;
  outline: none;
}

.save-confirm-icon {
  align-items: center;
  background: #f3f7ff;
  border: 1px solid #dbe7ff;
  border-radius: 50%;
  color: #4b5563;
  display: inline-flex;
  height: 58px;
  justify-content: center;
  width: 58px;
}

.save-confirm-icon svg {
  fill: none;
  height: 30px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 30px;
}

.save-confirm-title {
  color: #1f2937;
  font-size: 1.32rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.save-confirm-message {
  color: #4b5563;
  font-size: 1rem;
  line-height: 1.35;
  text-align: center;
}

.save-confirm-actions {
  border-top: 1px solid #e5e7eb;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 8px;
  width: calc(100% + 44px);
}

.save-confirm-action {
  background: transparent;
  border: 0;
  color: #1d76d2;
  cursor: pointer;
  font-size: 1.04rem;
  font-weight: 700;
  min-height: 52px;
  outline: none;
}

.save-confirm-action + .save-confirm-action {
  border-left: 1px solid #e5e7eb;
}

.save-confirm-action:hover,
.save-confirm-action:focus {
  background: #eff5ff;
  box-shadow: none;
  outline: none;
}

.save-confirm-save {
  color: #2f55d4;
}

body.save-confirm-open {
  overflow: hidden;
}

.new-project-modal {
  align-items: flex-start;
  display: flex;
  inset: 0;
  justify-content: flex-end;
  padding: 76px 34px 0;
  pointer-events: none;
  position: fixed;
  z-index: 170;
}

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

.new-project-backdrop {
  background: transparent;
  border: 0;
  border-radius: 0;
  inset: 0;
  margin: 0;
  min-height: 100vh;
  min-width: 100vw;
  padding: 0;
  pointer-events: auto;
  position: absolute;
  width: 100%;
}

.new-project-card {
  background: #ffffff;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.16);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 288px;
  padding: 34px 34px 28px;
  pointer-events: auto;
  position: relative;
  width: min(570px, calc(100vw - 68px));
  z-index: 1;
}

.new-project-close {
  align-items: center;
  background: transparent;
  border: 0;
  color: #7f7f7f;
  cursor: pointer;
  display: inline-flex;
  font-size: 3rem;
  font-weight: 200;
  height: 42px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 18px;
  top: 14px;
  width: 42px;
}

.new-project-close:hover,
.new-project-close:focus {
  box-shadow: none;
  color: #555555;
  outline: none;
}

.new-project-kicker {
  color: #666666;
  font-size: 1.28rem;
  font-weight: 400;
  line-height: 1.2;
  padding-right: 48px;
}

.new-project-name {
  background: transparent;
  border: 0;
  border-bottom: 1px solid #d5d5d5;
  border-radius: 0;
  box-sizing: border-box;
  color: #d5d5d5;
  font-family: inherit;
  font-size: 2.28rem;
  font-weight: 700;
  line-height: 1.15;
  margin: 34px 0 38px;
  outline: none;
  padding: 0 0 16px;
  width: 100%;
}

.new-project-name:focus {
  border-bottom-color: #bbbbbb;
  box-shadow: none;
}

.new-project-name::selection {
  background: rgba(0, 111, 185, 0.22);
  color: #777777;
}

.new-project-create {
  align-self: center;
  background: #ffffff;
  border: 4px solid #0070b8;
  border-radius: 999px;
  color: #0070b8;
  cursor: pointer;
  font-size: 1.4rem;
  font-weight: 800;
  min-height: 62px;
  min-width: 154px;
  padding: 0 30px;
}

.new-project-create:hover,
.new-project-create:focus {
  background: #f5fbff;
  box-shadow: none;
  outline: none;
}

body.new-project-open {
  overflow: hidden;
}

.project-tab-options-item {
  align-items: center;
  background: #ffffff;
  border: 0;
  border-radius: 6px;
  color: #7a7a7a;
  display: inline-flex;
  font-size: 0.86rem;
  justify-content: flex-start;
  min-height: 34px;
  padding: 0 10px;
  text-transform: uppercase;
  width: 100%;
}

.project-tab-options-item:hover,
.project-tab-options-item:focus {
  background: #f4f4f4;
  outline: none;
}

.project-tab-options-item-danger {
  color: #b11a2c;
}

.project-tab-options-item-danger:hover,
.project-tab-options-item-danger:focus {
  background: #fdf0f2;
}

.pane-body {
  flex: 1;
  min-height: 0;
  position: relative;
}

.blocks-body {
  position: relative;
}

.workspace-connect {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  left: auto;
  position: absolute;
  right: 22px;
  top: 16px;
  z-index: 70;
}

.workspace-connect-button {
  align-items: center;
  background: #f9cf00;
  border: 2px solid #ddb100;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  color: #6f6f6f;
  display: inline-flex;
  height: 56px;
  justify-content: center;
  padding: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, background-color 0.2s ease;
  width: 56px;
}

.workspace-connect-button.state-disconnected {
  background: #3f56cf;
  border-color: #3248b9;
  color: #ffffff;
}

.workspace-connect-button.state-usb {
  background: #ffffff;
  border-color: #3f56cf;
  color: #3f56cf;
}

.workspace-connect-button.state-ble {
  background: #ffffff;
  border-color: #3f56cf;
  color: #3f56cf;
  box-shadow:
    0 0 0 4px rgba(63, 86, 207, 0.28),
    0 4px 10px rgba(0, 0, 0, 0.2);
}

.workspace-connect-button:focus {
  outline: none;
}

.workspace-connect-icon {
  display: inline-flex;
  height: 30px;
  justify-content: center;
  position: relative;
  width: 30px;
}

.workspace-connect-icon svg {
  display: block;
  fill: none;
  height: 30px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 30px;
}

.workspace-connect-check {
  align-items: center;
  background: #3f56cf;
  border: 2px solid #fff;
  border-radius: 999px;
  bottom: -4px;
  color: #fff;
  display: none;
  font-size: 0.72rem;
  font-weight: 700;
  height: 20px;
  justify-content: center;
  line-height: 1;
  position: absolute;
  right: -4px;
  width: 20px;
}

.workspace-connect-button.state-usb .workspace-connect-check,
.workspace-connect-button.state-ble .workspace-connect-check {
  display: inline-flex;
}

.workspace-connect-label {
  color: #555;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.1;
  margin-left: 0;
  text-align: center;
}

.workspace-color-telemetry {
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #d8dfeb;
  border-radius: 999px;
  color: #2b384f;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 700;
  gap: 6px;
  max-width: 170px;
  min-height: 24px;
  padding: 3px 8px;
}

.workspace-color-telemetry[hidden] {
  display: none;
}

.workspace-color-telemetry-label {
  color: #6e7a8c;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.workspace-color-telemetry-value {
  color: #1f2a3b;
  max-width: 108px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-encoder-telemetry {
  max-width: 220px;
}

.workspace-encoder-telemetry .workspace-color-telemetry-value {
  font-family: "Consolas", "SFMono-Regular", "Courier New", monospace;
  font-size: 0.68rem;
  max-width: 164px;
}

.workspace-tools {
  align-items: center;
  background: rgba(250, 250, 250, 0.96);
  border: 1px solid #dbdbdb;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  display: inline-flex;
  gap: 0;
  position: relative;
}

.workspace-tool-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #767676;
  cursor: pointer;
  display: inline-flex;
  height: 46px;
  justify-content: center;
  padding: 0;
  width: 52px;
}

.workspace-tool-button:hover,
.workspace-tool-button:focus {
  background: #f3f3f3;
  box-shadow: none;
  outline: none;
}

.workspace-tool-button:disabled {
  color: #cfcfcf;
  cursor: not-allowed;
  opacity: 1;
}

.workspace-tool-icon {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  height: 24px;
  width: 24px;
}

.workspace-tool-divider {
  background: #e3e3e3;
  display: block;
  height: 24px;
  width: 1px;
}

.workspace-tool-toggle .workspace-tool-icon {
  transition: transform 0.2s ease;
}

.workspace-tools.is-collapsed .workspace-tool-collapsible {
  display: none;
}

.workspace-tools.is-collapsed .workspace-tool-toggle .workspace-tool-icon {
  transform: rotate(180deg);
}

.workspace-connect-menu {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 80;
}

.workspace-connect-menu[hidden] {
  display: none;
}

.workspace-connect-modal-backdrop {
  background: rgba(17, 22, 28, 0.56);
  border: 0;
  border-radius: 0;
  inset: 0;
  margin: 0;
  min-height: 100vh;
  min-width: 100vw;
  padding: 0;
  position: absolute;
  width: 100%;
}

.workspace-connect-modal-backdrop:hover {
  box-shadow: none;
}

.workspace-connect-modal-card {
  background: #fff;
  border: 1px solid #d8dde8;
  border-radius: 14px;
  box-shadow: 0 24px 48px rgba(10, 20, 32, 0.35);
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(720px, calc(100vw - 40px));
  min-height: 300px;
  padding: 24px 26px 26px;
  position: relative;
  width: min(720px, calc(100vw - 40px));
  z-index: 1;
}

.workspace-connect-modal-close {
  align-items: center;
  background: transparent;
  border: 0;
  color: #70757f;
  cursor: pointer;
  display: inline-flex;
  font-size: 2rem;
  font-weight: 300;
  height: 32px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 12px;
  top: 10px;
  width: 32px;
}

.workspace-connect-modal-close:hover,
.workspace-connect-modal-close:focus {
  box-shadow: none;
  color: #2f3440;
  outline: none;
}

.workspace-connect-menu-title {
  color: #1a1f2a;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
  margin-right: 36px;
}

.workspace-connect-menu-subtitle {
  color: #646d79;
  font-size: 0.96rem;
  line-height: 1.35;
  margin-bottom: 6px;
}

.workspace-connect-modal-options {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 6px;
}

.workspace-connect-option {
  align-items: flex-start;
  background: #f6f8fc;
  border: 1px solid #d9e1ee;
  border-radius: 12px;
  color: #1f2733;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  font-size: 1rem;
  font-weight: 600;
  justify-content: center;
  min-height: 128px;
  padding: 14px 14px;
  text-align: left;
  width: 100%;
}

.workspace-connect-option.is-active {
  background: #e8f2ff;
  border-color: #9ec2ff;
  box-shadow: inset 0 0 0 1px #7aa9ff;
}

.workspace-connect-option:focus,
.workspace-connect-option:hover {
  background: #edf2fb;
  outline: none;
}

.workspace-connect-option:disabled {
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.52;
}

@media (max-width: 720px) {
  .workspace-connect-modal-card {
    min-height: 0;
    padding: 20px;
  }

  .workspace-connect-modal-options {
    grid-template-columns: 1fr;
  }
}

body.workspace-device-panel-open {
  overflow: hidden;
}

.workspace-device-panel {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 90;
}

.workspace-device-panel[hidden] {
  display: none;
}

.workspace-device-panel-backdrop {
  background: rgba(14, 18, 24, 0.6);
  border: 0;
  border-radius: 0;
  inset: 0;
  margin: 0;
  min-height: 100vh;
  min-width: 100vw;
  padding: 0;
  position: absolute;
  width: 100%;
}

.workspace-device-panel-backdrop:hover {
  box-shadow: none;
}

.workspace-device-panel-card {
  background: #ffffff;
  border: 1px solid #d8dde8;
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(10, 20, 32, 0.35);
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: min(720px, calc(100vh - 48px));
  max-width: min(980px, calc(100vw - 140px));
  padding: 24px 24px 22px;
  position: relative;
  width: min(980px, calc(100vw - 140px));
  z-index: 1;
}

.workspace-device-panel-close {
  align-items: center;
  background: transparent;
  border: 0;
  color: #70757f;
  cursor: pointer;
  display: inline-flex;
  font-size: 2rem;
  font-weight: 300;
  height: 32px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 12px;
  top: 10px;
  width: 32px;
}

.workspace-device-panel-close:hover,
.workspace-device-panel-close:focus {
  box-shadow: none;
  color: #2f3440;
  outline: none;
}

.workspace-device-panel-header {
  align-items: flex-start;
  border-bottom: 1px solid #e8edf4;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding-right: 42px;
  padding-bottom: 14px;
}

.workspace-device-panel-meta {
  min-width: 0;
}

.workspace-device-panel-board-picker {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.workspace-device-panel-title {
  color: #161c27;
  font-size: 1.66rem;
  font-weight: 700;
  line-height: 1.2;
}

.workspace-device-panel-subtitle {
  color: #677384;
  font-size: 0.95rem;
  line-height: 1.35;
  margin-top: 6px;
}

.workspace-device-panel-disconnect {
  background: #ffffff;
  border: 2px solid #ef4444;
  border-radius: 999px;
  color: #d31919;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  min-height: 44px;
  min-width: 140px;
  padding: 0 18px;
  text-transform: uppercase;
}

.workspace-device-panel-disconnect:hover,
.workspace-device-panel-disconnect:focus {
  background: #fff3f3;
  box-shadow: none;
  outline: none;
}

.workspace-device-panel-disconnect:disabled {
  opacity: 0.48;
}

.workspace-device-panel-body {
  align-items: stretch;
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  gap: 14px;
  min-height: 0;
  overflow: hidden;
}

.workspace-device-panel-simulator-host {
  align-items: flex-start;
  background: #f6f8fc;
  border: 1px solid #e0e6f2;
  border-radius: 14px;
  display: flex;
  flex: 1 1 auto;
  justify-content: center;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: 14px;
}

.workspace-device-panel-simulator-host .simulator {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 236px;
  grid-template-areas:
    "board sensors"
    "attach sensors";
  grid-template-rows: auto auto;
  height: 100%;
  justify-items: stretch;
  margin: 0 auto;
  max-width: 100%;
  width: 100%;
}

.workspace-device-info-panel {
  display: flex;
  flex: 0 0 230px;
  flex-direction: column;
  gap: 10px;
}

.workspace-device-info-card {
  background: #f6f8fc;
  border: 1px solid #dde5f2;
  border-radius: 12px;
  padding: 12px 12px 10px;
}

.workspace-device-info-card-name {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.workspace-device-name {
  color: #0f172a;
  font-size: 1.44rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.workspace-device-rename-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #007be5;
  cursor: pointer;
  display: inline-flex;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  justify-content: flex-start;
  letter-spacing: 0.02em;
  margin: 0;
  padding: 0;
  text-transform: uppercase;
}

.workspace-device-rename-button:hover,
.workspace-device-rename-button:focus {
  box-shadow: none;
  color: #005db7;
  outline: none;
}

.workspace-device-rename-button:disabled {
  color: #8a9bb3;
  cursor: not-allowed;
}

.workspace-device-rename-icon {
  align-items: center;
  display: inline-flex;
  height: 14px;
  justify-content: center;
  width: 14px;
}

.workspace-device-rename-icon svg {
  fill: currentColor;
  height: 14px;
  width: 14px;
}

.workspace-device-info-label {
  color: #637389;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.workspace-device-info-value {
  color: #0f172a;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.workspace-device-info-mac {
  font-family: "Consolas", "SFMono-Regular", "Courier New", monospace;
  font-size: 0.94rem;
}

.workspace-device-panel-simulator-host .simulator-board {
  align-self: flex-start;
  flex: none;
  grid-area: board;
  justify-self: center;
  min-width: 0;
  max-width: min(520px, 100%);
  width: min(520px, 100%);
}

.workspace-device-panel-simulator-host .simulator-attach-dock {
  align-self: start;
  grid-area: attach;
  justify-self: stretch;
  margin: 0;
  width: 100%;
}

.workspace-device-panel-simulator-host .simulator-board-image {
  image-rendering: auto;
}

.workspace-device-panel-simulator-host .simulator-sensors-column {
  flex: 0 0 236px;
  gap: 6px;
  grid-area: sensors;
  height: 100%;
  justify-self: stretch;
  max-width: 236px;
  min-width: 236px;
  overflow-y: auto;
  width: 236px;
}

.workspace-device-panel-simulator-host .simulator-sensor-panel {
  align-self: stretch;
  flex: 0 0 auto;
  gap: 8px;
  justify-content: flex-start;
  margin: 0;
  max-width: none;
  padding: 9px 10px 10px;
  width: 100%;
}

.workspace-device-panel-simulator-host .simulator-sensor-header-row {
  min-height: 0;
}

.workspace-device-panel-simulator-host .simulator-sensor-device-image {
  height: 84px;
  width: 84px;
}

.workspace-device-panel-simulator-host .simulator-sensor-detected-row,
.workspace-device-panel-simulator-host .simulator-sensor-raw-row {
  align-items: center;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.workspace-device-panel-simulator-host .simulator-sensor-raw-item {
  display: inline-flex;
}

.workspace-device-panel-simulator-host .simulator-encoder-config-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.workspace-device-panel-simulator-host .simulator-encoder-config-input {
  background: #ffffff;
  border: 1px solid #d0d7e2;
  border-radius: 6px;
  color: #1f2a3b;
  font-size: 0.74rem;
  line-height: 1.2;
  padding: 3px 6px;
  width: 84px;
}

.workspace-device-panel-simulator-host .simulator-encoder-angle-grid {
  border-top: 1px dashed #dbe3ef;
  margin-top: 2px;
  padding-top: 6px;
}

.workspace-device-panel-simulator-host .simulator-imu-content {
  gap: 6px;
}

.workspace-device-panel-simulator-host .simulator-imu-item {
  font-size: 0.78rem;
}

.workspace-device-panel-simulator-host .simulator-imu-title {
  font-size: 0.73rem;
}

.workspace-disconnect-toast {
  align-items: stretch;
  background: #ffffff;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.22);
  display: flex;
  max-width: min(420px, calc(100vw - 24px));
  min-height: 74px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  position: fixed;
  right: 16px;
  top: 78px;
  transform: translateX(calc(100% + 20px));
  transition: transform 0.28s ease, opacity 0.22s ease;
  width: min(420px, calc(100vw - 24px));
  z-index: 125;
}

.workspace-disconnect-toast[hidden] {
  display: none;
}

.workspace-disconnect-toast.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.workspace-disconnect-toast-icon {
  align-items: center;
  color: #1f2937;
  display: inline-flex;
  flex: 0 0 auto;
  justify-content: center;
  padding: 0 12px 0 14px;
}

.workspace-disconnect-toast-icon svg {
  fill: none;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.8;
  width: 22px;
}

.workspace-disconnect-toast-message {
  align-items: center;
  color: #1f2937;
  display: flex;
  flex: 1 1 auto;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.25;
  min-width: 0;
  padding: 10px 12px 10px 0;
}

.workspace-disconnect-toast-actions {
  border-left: 1px solid #e3e8f3;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  min-width: 104px;
}

.workspace-disconnect-toast-action {
  background: transparent;
  border: 0;
  color: #007be5;
  cursor: pointer;
  flex: 1 1 auto;
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  min-height: 36px;
  padding: 8px 12px;
  text-align: center;
}

.workspace-disconnect-toast-action + .workspace-disconnect-toast-action {
  border-top: 1px solid #e3e8f3;
}

.workspace-disconnect-toast-action:hover,
.workspace-disconnect-toast-action:focus {
  background: #eff5ff;
  box-shadow: none;
  outline: none;
}

.program-save-toast {
  align-items: center;
  background: #ffffff;
  border: 1px solid #dbe8d7;
  border-radius: 12px;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.2);
  color: #1f2937;
  display: flex;
  gap: 10px;
  min-height: 54px;
  opacity: 0;
  padding: 10px 14px;
  pointer-events: none;
  position: fixed;
  right: 16px;
  top: 78px;
  transform: translateY(-10px);
  transition: transform 0.2s ease, opacity 0.18s ease;
  z-index: 180;
}

.program-save-toast[hidden] {
  display: none;
}

.program-save-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.program-save-toast-icon {
  align-items: center;
  background: #22c55e;
  border-radius: 50%;
  color: #ffffff;
  display: inline-flex;
  flex: 0 0 auto;
  height: 26px;
  justify-content: center;
  width: 26px;
}

.program-save-toast-icon svg {
  fill: none;
  height: 17px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
  width: 17px;
}

.program-save-toast-message {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

body.workspace-device-rename-open {
  overflow: hidden;
}

.workspace-device-rename-modal {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 110;
}

.workspace-device-rename-modal[hidden] {
  display: none;
}

.workspace-device-rename-backdrop {
  background: rgba(14, 18, 24, 0.58);
  border: 0;
  border-radius: 0;
  inset: 0;
  margin: 0;
  min-height: 100vh;
  min-width: 100vw;
  padding: 0;
  position: absolute;
  width: 100%;
}

.workspace-device-rename-card {
  background: #ffffff;
  border: 1px solid #d8dde8;
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(10, 20, 32, 0.32);
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: min(460px, calc(100vw - 28px));
  padding: 22px 22px 18px;
  position: relative;
  width: min(460px, calc(100vw - 28px));
  z-index: 1;
}

.workspace-device-rename-close {
  align-items: center;
  background: transparent;
  border: 0;
  color: #70757f;
  cursor: pointer;
  display: inline-flex;
  font-size: 2rem;
  font-weight: 300;
  height: 30px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 10px;
  top: 8px;
  width: 30px;
}

.workspace-device-rename-close:hover,
.workspace-device-rename-close:focus {
  box-shadow: none;
  color: #2f3440;
  outline: none;
}

.workspace-device-rename-title {
  color: #0f172a;
  font-size: 1.95rem;
  font-weight: 700;
  line-height: 1.1;
  margin-right: 28px;
}

.workspace-device-rename-subtitle {
  color: #718096;
  font-size: 1rem;
  line-height: 1.35;
}

.workspace-device-rename-subtitle strong {
  color: #3b4a61;
  display: inline-block;
  margin-left: 4px;
}

.workspace-device-rename-input {
  background: transparent;
  border: 0;
  border-bottom: 1px solid #cbd5e1;
  color: #0f172a;
  font-size: 1.16rem;
  outline: none;
  padding: 8px 0;
}

.workspace-device-rename-input::placeholder {
  color: #94a3b8;
}

.workspace-device-rename-input:focus {
  border-bottom-color: #007be5;
}

.workspace-device-rename-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.workspace-device-rename-action {
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  min-height: 38px;
  min-width: 96px;
  padding: 0 16px;
  text-transform: uppercase;
}

.workspace-device-rename-cancel {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
}

.workspace-device-rename-cancel:hover,
.workspace-device-rename-cancel:focus {
  background: #f8fafc;
  box-shadow: none;
  outline: none;
}

.workspace-device-rename-save {
  background: #007be5;
  border: 1px solid #007be5;
  color: #ffffff;
}

.workspace-device-rename-save:hover,
.workspace-device-rename-save:focus {
  background: #006ac5;
  box-shadow: none;
  outline: none;
}

.workspace-device-rename-save:disabled,
.workspace-device-rename-cancel:disabled {
  opacity: 0.5;
}

@media (max-width: 920px) {
  .workspace-device-panel-card {
    height: calc(100vh - 20px);
    max-width: calc(100vw - 20px);
    padding: 16px 16px 14px;
    width: calc(100vw - 20px);
  }

  .workspace-device-panel-header {
    flex-direction: column;
    padding-right: 36px;
  }

  .workspace-device-panel-board-picker {
    margin-top: 8px;
    width: 100%;
  }

  .workspace-device-panel-board-picker .simulator-board-select {
    width: 100%;
  }

  .workspace-device-panel-disconnect {
    min-width: 0;
  }

  .workspace-device-panel-simulator-host {
    overflow: auto;
    padding: 10px;
  }

  .workspace-device-info-panel {
    flex: 0 0 auto;
    width: 100%;
  }

  .workspace-device-panel-simulator-host .simulator {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 520px;
  }

  .workspace-device-panel-simulator-host .simulator-sensor-panel {
    flex: 0 0 auto;
    max-width: none;
    width: 100%;
  }

  .workspace-device-panel-simulator-host .simulator-sensors-column {
    flex: 0 0 auto;
    max-width: none;
    min-width: 0;
    width: 100%;
  }

  .workspace-device-panel-body {
    flex-direction: column;
    overflow: auto;
  }

  .workspace-device-rename-card {
    padding: 18px 16px 16px;
  }

  .workspace-device-rename-title {
    font-size: 1.6rem;
  }

  .workspace-disconnect-toast {
    left: 10px;
    right: 10px;
    top: 64px;
    width: auto;
  }

  .workspace-disconnect-toast-message {
    font-size: 0.95rem;
  }

  .workspace-disconnect-toast-actions {
    min-width: 88px;
  }

  .workspace-disconnect-toast-action {
    font-size: 0.86rem;
  }
}

.toolbox-search {
  align-ms: center;
  background: #e6e6e6;
  border-bottom: 1px solid #d6d6d6;
  box-sizing: border-box;
  display: flex;
  gap: 8px;
  height: var(--toolbox-row-height, 32px);
  margin: 0;
  padding: 0 10px;
  position: relative;
  width: 100%;
  z-index: 4;
}

.toolbox-mode-tabs {
  align-items: center;
  background: #dce8fb;
  border-bottom: 1px solid #c8d8f4;
  box-sizing: border-box;
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 6px 8px;
  position: relative;
  width: 100%;
  z-index: 5;
}

.toolbox-mode-tabs[hidden] {
  display: none;
}

.toolbox-mode-tab {
  align-items: center;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid #b6caf2;
  border-radius: 999px;
  color: #2d4f9e;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 700;
  justify-content: center;
  min-height: 28px;
  min-width: 92px;
  padding: 0 12px;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.toolbox-mode-tab:hover,
.toolbox-mode-tab:focus {
  background: #ffffff;
  border-color: #9db8ef;
  color: #21478e;
  outline: none;
}

.toolbox-mode-tab.is-active {
  background: #3f56cf;
  border-color: #3349b8;
  color: #ffffff;
}

.toolbox-search input {
  background: transparent;
  border: 0;
  color: #333;
  height: 100%;
  flex: 1;
  font-size: 14px;
  line-height: 1;
  outline: none;
}

.toolbox-search-icon {
  align-items: center;
  color: #777;
  display: inline-flex;
  pointer-events: none;
}

.toolbox-search-icon svg {
  fill: currentColor;
  height: 16px;
  width: 16px;
}

.blocklyToolboxDiv .blocklyTreeRow {
  align-items: center !important;
  box-sizing: border-box;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
}

.blocklyToolboxDiv .blocklyTreeRowContentContainer {
  align-items: center;
  box-sizing: border-box;
  display: flex;
  gap: 6px;
  padding: 6px 0;
  width: 100%;
}

.blocklyToolboxDiv .blocklyTreeLabel {
  align-items: center !important;
  display: inline-flex !important;
  flex: 1 1 auto !important;
  font-size: 20px;
  margin: 0 !important;
  min-width: 0;
  overflow: hidden;
  padding: 0 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blocklyToolboxDiv .blocklyTreeIcon {
  align-items: center !important;
  display: inline-flex !important;
  flex: 0 0 auto !important;
}

.toolbox-cat-icon {
  align-items: center;
  color: var(--cat-color, currentColor);
  display: inline-flex;
  flex: 0 0 auto;
  height: 36px;
  justify-content: center;
  margin: 0 6px 0 0;
  pointer-events: none;
  vertical-align: middle;
  visibility: visible;
  width: 36px;
}

.toolbox-cat-icon svg {
  fill: currentColor;
  height: 34px;
  width: 34px;
}

.toolbox-cat-icon svg path,
.toolbox-cat-icon svg rect,
.toolbox-cat-icon svg circle {
  stroke: currentColor;
}

.blocklyToolboxSelected .toolbox-cat-icon,
.blocklyTreeSelected .toolbox-cat-icon {
  color: #ffffff !important;
}

.toolbox-cat-icon-selected {
  color: #ffffff !important;
}

.blocklyToolboxCategory {
  height: 36px;
  line-height: 36px;
  margin-bottom: 0;
  padding-right: 4px;
}

.blocklyToolboxCategoryContainer {
  width: 100% !important;
}

.blocklyToolboxCategoryGroup {
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-content: flex-start !important;
  width: 100% !important;
  padding-bottom: calc(var(--toolbox-footer-height, 74px) + 8px) !important;
  padding-left: 0 !important;
}

.blocklyToolboxCategoryGroup .blocklyToolboxCategory {
  width: 100% !important;
}

.blocklyToolboxCategoryContainer .blocklyToolboxCategoryGroup .blocklyToolboxCategory {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.blocklyToolbox,
.blocklyToolboxDiv {
  width: var(--toolbox-width, 220px) !important;
  min-width: var(--toolbox-width, 220px) !important;
  max-width: var(--toolbox-width, 220px) !important;
  box-sizing: border-box;
  right: auto !important;
  overflow-x: hidden;
  z-index: 10 !important;
}

.blocklyToolbox {
  padding-bottom: calc(var(--toolbox-footer-height, 74px) + 8px);
}

.blocklyToolboxContents {
  box-sizing: border-box;
  min-height: 100%;
  padding-bottom: var(--toolbox-footer-height, 74px);
}

.toolbox-footer {
  align-items: center;
  background: linear-gradient(180deg, rgba(247, 247, 247, 0.9) 0%, #f1f1f1 24%, #ededed 100%);
  box-sizing: border-box;
  border-top: 1px solid #d8d8d8;
  bottom: 0;
  box-shadow: 0 -10px 18px rgba(0, 0, 0, 0.06);
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  left: 0;
  padding: 10px 10px 12px;
  position: absolute;
  right: 0;
  width: 100%;
  z-index: 22;
}

.toolbox-footer-anchor {
  position: relative;
}

.toolbox-footer-board-anchor {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 0;
}

.toolbox-footer-icon-button,
.toolbox-footer-board-button {
  align-items: center;
  background: transparent;
  border: 0;
  color: #727272;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.toolbox-footer-icon-button {
  border-radius: 14px;
  height: 40px;
  justify-content: center;
  width: 40px;
}

#toolboxExtensionsButton {
  background: #ffffff;
  border: 1px solid #8fb5f2;
  box-shadow: 0 2px 8px rgba(34, 92, 178, 0.2);
  color: #1f6fe5;
}

#toolboxExtensionsButton:hover,
#toolboxExtensionsButton:focus,
#toolboxExtensionsButton:active {
  background: #eef5ff;
  border-color: #2f7de9;
  box-shadow: 0 0 0 3px rgba(53, 131, 240, 0.22);
  color: #145dc8;
  outline: none;
}

.toolbox-footer-icon-button:hover,
.toolbox-footer-board-button:hover {
  color: #444;
}

.toolbox-footer-icon-button svg {
  fill: currentColor;
  height: 22px;
  width: 22px;
}

#toolboxExtensionsButton svg {
  height: 24px;
  width: 24px;
}

#toolboxExtensionsButton .ext-solid {
  fill: currentColor;
}

#toolboxExtensionsButton .ext-line {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.toolbox-footer-board-button {
  align-items: center;
  background: linear-gradient(180deg, #f6f8ff 0%, #e9efff 100%);
  border: 1px solid #c5d3f4;
  border-radius: 12px;
  box-shadow: 0 2px 5px rgba(23, 52, 117, 0.12);
  color: #3a4d71;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
  justify-content: center;
  max-width: 100%;
  min-height: 34px;
  min-width: 0;
  overflow: hidden;
  padding: 0 10px;
  text-align: left;
  width: auto;
}

.toolbox-footer-board-handle {
  align-items: center;
  color: #7d8ba3;
  display: inline-flex;
  flex: 0 0 auto;
  height: 16px;
  line-height: 1;
  width: 16px;
}

.toolbox-footer-board-handle svg {
  display: block;
  height: 16px;
  width: 16px;
}

.toolbox-footer-board-label {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #385fce;
  display: inline-flex;
  flex: 0 1 auto;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbox-footer-board-button:hover {
  background: linear-gradient(180deg, #edf3ff 0%, #dce7ff 100%);
  border-color: #9fb8ef;
  color: #2c456a;
}

.toolbox-footer-board-button:focus,
.toolbox-footer-board-button:active {
  background: linear-gradient(180deg, #e2ecff 0%, #ccdfff 100%);
  border-color: #86a7e8;
  box-shadow: 0 0 0 3px rgba(63, 86, 207, 0.2);
  color: #29416a;
  outline: none;
}

.toolbox-footer-menu {
  background: #f5f5f5;
  border: 1px solid #d7d7d7;
  border-radius: 18px;
  bottom: calc(100% + 10px);
  box-shadow: 0 22px 38px rgba(0, 0, 0, 0.16);
  min-width: 188px;
  padding: 14px 0;
  position: absolute;
  z-index: 40;
}

.toolbox-extensions-menu {
  left: 0;
}

.toolbox-product-menu {
  left: 0;
  min-width: 248px;
  right: auto;
  width: 248px;
}

.toolbox-footer-menu-title {
  color: #8a8a8a;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.35;
  padding: 0 16px 10px;
  white-space: normal;
}

.toolbox-footer-menu-item {
  align-items: center;
  background: transparent;
  border: 0;
  color: #6e6e6e;
  cursor: pointer;
  display: flex;
  font-size: 15px;
  justify-content: flex-start;
  padding: 12px 16px;
  text-align: left;
  width: 100%;
}

.toolbox-footer-menu-item + .toolbox-footer-menu-item {
  border-top: 1px solid #dddddd;
}

.toolbox-footer-product-item {
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  justify-content: flex-start;
  margin: 2px 8px;
  width: calc(100% - 16px);
  white-space: nowrap;
}

.toolbox-footer-product-item.is-active,
.toolbox-footer-product-item:hover {
  background: linear-gradient(180deg, #4e68de 0%, #3f56cf 100%);
  color: #ffffff;
}

.toolbox-footer-toggle-item {
  gap: 10px;
}

.toolbox-footer-toggle-check {
  align-items: center;
  border: 1.5px solid #afafaf;
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  height: 16px;
  justify-content: center;
  width: 16px;
}

.toolbox-footer-toggle-item.is-active .toolbox-footer-toggle-check {
  background: #1da35f;
  border-color: #1da35f;
}

.toolbox-footer-toggle-item.is-active .toolbox-footer-toggle-check::after {
  border-bottom: 2px solid #fff;
  border-right: 2px solid #fff;
  content: "";
  display: block;
  height: 8px;
  margin-top: -1px;
  transform: rotate(45deg);
  width: 4px;
}

.toolbox-footer-menu-empty {
  color: #8d8d8d;
  font-size: 14px;
  padding: 6px 16px 4px;
}

.blocklyWidgetDiv,
.blocklyDropDownDiv,
.blocklyTooltipDiv {
  z-index: 20 !important;
}

.klhbit-flyout-header .blocklyFlyoutLabelBackground {
  fill: transparent !important;
  stroke: none !important;
}

.klhbit-flyout-header .blocklyFlyoutLabelText {
  fill: #000000 !important;
  font-weight: 800 !important;
  font-size: 18px !important;
}

.klhbit-flyout-header-icon {
  color: var(--flyout-cat-color, #ffffff);
}

.blocks-pane .blocklyToolbox,
.blocks-pane .blocklyToolboxDiv {
  box-sizing: border-box;
  width: var(--toolbox-width, 220px) !important;
  min-width: var(--toolbox-width, 220px) !important;
  max-width: var(--toolbox-width, 220px) !important;
}

.code-body {
  padding: 0;
}

.workspace-stack[data-view="ai"] .ai-pane .ai-chat-body {
  bottom: auto;
  box-sizing: border-box;
  flex: 1 1 auto;
  left: auto;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  position: relative;
  right: auto;
  top: auto;
  width: 100%;
}

.simulator-pane .pane-body {
  display: flex;
  flex-direction: column;
  padding: 8px 12px 0;
}

.simulator-panel-inline {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.simulator-panel-inline > summary {
  cursor: pointer;
  flex: 0 0 auto;
}

.log-panel-inline {
  margin: 0;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-height: 0;
}

.serial-status-row {
  background: #111827;
  border-top: 1px solid #223047;
  flex: 0 0 auto;
  min-height: 28px;
  padding: 6px 12px 7px;
}

.serial-status-inline {
  color: #dbe7ff;
  min-height: 1em;
}

.serial-status-inline.status.connected {
  color: #79f0a9;
}

.serial-status-inline.status.error {
  color: #ff9baa;
}

#blocklyDiv {
  inset: 0;
  position: absolute;
}

body.block-region-selecting {
  cursor: crosshair;
  user-select: none;
}

.block-region-selection-rect {
  background: rgba(47, 86, 211, 0.13);
  border: 2px solid rgba(47, 86, 211, 0.88);
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.68) inset;
  box-sizing: border-box;
  pointer-events: none;
  position: fixed;
  z-index: 360;
}

.block-region-selected,
body.lego-mode .blocklyBlockCanvas .block-region-selected {
  filter: none;
}

.block-region-selected > .blocklyPath,
.block-region-selected > .blocklyPathDark,
body.lego-mode .blocklyBlockCanvas .block-region-selected > .blocklyPath,
body.lego-mode .blocklyBlockCanvas .block-region-selected > .blocklyPathDark {
  stroke: #2557d6 !important;
  stroke-width: 2.2px !important;
}

.block-region-selected > .blocklyPathLight,
body.lego-mode .blocklyBlockCanvas .block-region-selected > .blocklyPathLight {
  stroke: rgba(255, 255, 255, 0.82) !important;
  stroke-width: 1.2px !important;
}

.workspace-stack[data-view="ai"] .variable-monitor-panel {
  display: none !important;
}

.workspace-stack[data-view="ai"] .variable-monitor-toggle {
  display: none !important;
}

.variable-monitor-panel {
  background: #ffffff;
  border: 1px solid #d9dee8;
  border-radius: 14px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.14);
  bottom: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: absolute;
  right: 16px;
  top: 98px;
  width: 312px;
  z-index: 30;
}

.variable-monitor-panel[hidden] {
  display: none;
}

.variable-monitor-toggle {
  align-items: center;
  background: #f6f7fb;
  border: 1px solid #d8dce6;
  border-radius: 999px;
  color: #9aa3b2;
  display: inline-flex;
  height: 56px;
  justify-content: center;
  padding: 0;
  position: absolute;
  right: 317px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  z-index: 31;
}

.blocks-body.variable-monitor-collapsed .variable-monitor-toggle {
  right: -12px;
}

.variable-monitor-toggle[hidden] {
  display: none;
}

.variable-monitor-toggle svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 18px;
}

.variable-monitor-toggle:hover,
.variable-monitor-toggle:focus {
  background: #eef1f8;
  border-color: #c8cedc;
  color: #7e889a;
  outline: none;
}

.variable-monitor-header {
  align-items: center;
  border-bottom: 1px solid #e4e8ef;
  color: #1f2937;
  display: flex;
  gap: 10px;
  min-height: 58px;
  padding: 0 16px;
}

.variable-monitor-header-icon {
  color: #1f2937;
  display: inline-flex;
  flex: 0 0 auto;
  height: 20px;
  width: 20px;
}

.variable-monitor-header-icon svg {
  fill: none;
  height: 100%;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 100%;
}

.variable-monitor-title {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.1;
}

.variable-monitor-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding: 14px 14px 16px;
}

.variable-monitor-item {
  align-items: center;
  background: #f08a24;
  border-radius: 12px;
  color: #ffffff;
  display: flex;
  gap: 10px;
  min-height: 36px;
  padding: 8px 10px;
}

.variable-monitor-name {
  flex: 1 1 auto;
  font-size: 0.95rem;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.variable-monitor-value {
  background: #f2f2f2;
  border-radius: 8px;
  color: #4b5563;
  flex: 0 0 auto;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  max-width: 62%;
  min-width: 72px;
  overflow: hidden;
  padding: 6px 10px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.variable-monitor-list-section {
  border-radius: 8px;
  margin-top: 8px;
  overflow: hidden;
  background: #f08a24;
}

.variable-monitor-list-header {
  background: #f08a24;
  border-radius: 8px 8px 0 0;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 6px 10px;
}

.variable-monitor-list-menu-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  padding: 0 4px;
  opacity: 0.75;
}
.variable-monitor-list-menu-btn:hover { opacity: 1; }

.variable-monitor-list-item {
  background: #fde8cc;
  border-radius: 0;
  color: #7a3b00;
  margin-top: 0;
  padding: 3px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.variable-monitor-list-item + .variable-monitor-list-item {
  border-top: 1px solid #f5c890;
}

.variable-monitor-list-index {
  background: #f08a24;
  border-radius: 50%;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.variable-monitor-list-input {
  border: none;
  border-radius: 4px;
  background: #fff;
  color: #333;
  flex: 1;
  font-size: 0.85rem;
  padding: 3px 6px;
  outline: none;
}
.variable-monitor-list-input:focus {
  box-shadow: 0 0 0 2px #f08a24;
}

.variable-monitor-list-empty {
  background: #fde8cc;
  border-radius: 0;
  color: #9ca3af;
  font-size: 0.85rem;
  font-style: italic;
  margin-top: 0;
  padding: 5px 10px;
}

.variable-monitor-list-add-btn {
  background: #f08a24;
  border: none;
  color: #fff;
  cursor: pointer;
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 4px 12px;
  text-align: left;
  width: 100%;
}
.variable-monitor-list-add-btn:hover { background: #d97706; }

.blocklyFlyoutButton.klhbit-variable-monitor-button .blocklyFlyoutButtonBackground {
  fill: #ffffff;
  stroke: #cfd8e5;
  stroke-width: 1px;
}

.blocklyFlyoutButton.klhbit-variable-monitor-button .blocklyText {
  fill: #22324f;
  font-size: 12px;
  font-weight: 700;
}

#pythonCode {
  background-color: #fcfcfc;
  color: #1a2a46;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  height: 100%;
  margin: 0;
  overflow: auto;
  padding: 12px;
  white-space: pre;
  width: 100%;
}

#pythonCode .pln {
  color: inherit;
}

#pythonCode .kwd {
  color: #1149b6;
  font-weight: 600;
}

#pythonCode .str {
  color: #0a7a2f;
}

#pythonCode .com {
  color: #6b7280;
  font-style: italic;
}

#pythonCode .lit {
  color: #8a3ffc;
}

#pythonCode .typ,
#pythonCode .fun {
  color: #0b6e94;
}

#pythonCode .pun,
#pythonCode .opn,
#pythonCode .clo {
  color: #334155;
}

.simulator {
  align-items: stretch;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: flex-start;
  padding: 0;
  width: 100%;
}

.workspace-device-panel-simulator-host .simulator-board-picker {
  display: none !important;
}

.simulator-board-picker {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.simulator-board-picker label,
.workspace-device-panel-board-picker label {
  color: #334155;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.simulator-board-select {
  background: #ffffff;
  border: 1px solid #cdd9ea;
  border-radius: 9px;
  color: #1d4f91;
  font-size: 0.84rem;
  font-weight: 600;
  min-height: 30px;
  min-width: 168px;
  padding: 4px 10px;
}

.simulator-board-select:focus {
  border-color: #2a6bcf;
  box-shadow: 0 0 0 2px rgba(42, 107, 207, 0.16);
  outline: none;
}

.simulator[hidden] {
  display: none !important;
}

.sprite-simulator {
  background: #e8f2fb;
  border: 1px solid #c7dcf1;
  border-radius: 14px;
  box-sizing: border-box;
  color: #1f3f66;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  width: 100%;
}

.sprite-simulator[hidden] {
  display: none !important;
}

.sprite-simulator-stage-shell {
  background: #d9eaf8;
  border: 1px solid #b6d2eb;
  border-radius: 12px;
  padding: 6px;
}

.sprite-simulator-stage {
  aspect-ratio: 4 / 3;
  background: #f7fbff;
  border: 1px solid #bfd5ea;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.sprite-simulator-stage::before,
.sprite-simulator-stage::after {
  content: "";
  inset: 0;
  position: absolute;
}

.sprite-simulator-stage::before {
  background-image:
    linear-gradient(to right, rgba(43, 108, 176, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(43, 108, 176, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
}

.sprite-simulator-stage::after {
  background:
    radial-gradient(circle at 50% 50%, rgba(76, 151, 255, 0.1), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(121, 171, 217, 0.08));
}

.sprite-simulator-stage.is-backdrop-2::after {
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 214, 153, 0.28), transparent 46%),
    radial-gradient(circle at 82% 82%, rgba(255, 165, 123, 0.2), transparent 52%),
    linear-gradient(180deg, rgba(255, 243, 221, 0.62), rgba(255, 220, 186, 0.35));
}

.sprite-simulator-stage.is-backdrop-3::after {
  background:
    radial-gradient(circle at 78% 24%, rgba(165, 239, 255, 0.2), transparent 52%),
    radial-gradient(circle at 20% 84%, rgba(170, 187, 255, 0.2), transparent 50%),
    linear-gradient(180deg, rgba(220, 244, 255, 0.58), rgba(182, 211, 255, 0.34));
}

.sprite-simulator-stage.is-backdrop-2::before {
  background-image:
    linear-gradient(to right, rgba(184, 119, 54, 0.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(184, 119, 54, 0.12) 1px, transparent 1px);
}

.sprite-simulator-stage.is-backdrop-3::before {
  background-image:
    linear-gradient(to right, rgba(56, 103, 214, 0.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(56, 103, 214, 0.12) 1px, transparent 1px);
}

.sprite-simulator-bubble {
  background: #ffffff;
  border: 1px solid #b7d2eb;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(31, 63, 102, 0.18);
  color: #1f3f66;
  font-size: 0.8rem;
  font-weight: 700;
  left: 50%;
  max-width: calc(100% - 20px);
  min-height: 24px;
  min-width: 64px;
  padding: 8px 10px;
  position: absolute;
  text-align: center;
  top: 8px;
  transform: translateX(-50%);
  word-break: break-word;
  z-index: 3;
}

.sprite-simulator-bubble::after {
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 10px solid #ffffff;
  bottom: -9px;
  content: "";
  left: 24px;
  position: absolute;
}

.sprite-simulator-bubble.is-think::after {
  border-left: 0;
  border-right: 0;
  border-top: 0;
  bottom: -10px;
  height: 18px;
  left: 18px;
  width: 26px;
  background:
    radial-gradient(circle, #ffffff 38%, rgba(255, 255, 255, 0) 40%) 0 11px/9px 9px no-repeat,
    radial-gradient(circle, #ffffff 38%, rgba(255, 255, 255, 0) 40%) 9px 5px/11px 11px no-repeat,
    radial-gradient(circle, #ffffff 38%, rgba(255, 255, 255, 0) 40%) 18px 0/14px 14px no-repeat;
}

.sprite-simulator-bubble[hidden] {
  display: none !important;
}

.sprite-simulator-mascot {
  filter: drop-shadow(0 5px 6px rgba(13, 44, 92, 0.24));
  height: 80px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
  transform-origin: center center;
  transition: left 0.18s ease, opacity 0.18s ease, top 0.18s ease, transform 0.18s ease;
  user-select: none;
  width: 80px;
  z-index: 2;
}

.sprite-simulator-mascot.is-costume-2 {
  filter: saturate(1.22) hue-rotate(-18deg);
}

.sprite-simulator-mascot.is-costume-3 {
  filter: contrast(1.14) saturate(1.1) brightness(0.98);
}

.sprite-simulator-tools {
  align-items: center;
  display: flex;
  gap: 6px;
}

.sprite-simulator-tool-button {
  align-items: center;
  background: #f4f8fc;
  border: 1px solid #bfd4ea;
  border-radius: 6px;
  color: #8ea5ba;
  cursor: default;
  display: inline-flex;
  height: 32px;
  justify-content: center;
  padding: 0;
  width: 32px;
}

.sprite-simulator-tool-button svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 18px;
}

.sprite-simulator-tool-button.is-active {
  background: #dff0ff;
  border-color: #38a5ff;
  color: #2598f3;
  box-shadow: 0 0 0 1px rgba(37, 152, 243, 0.25) inset;
}

.sprite-simulator-tool-button:disabled {
  opacity: 1;
}

.sprite-simulator-tabs {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sprite-simulator-tab {
  background: #edf5ff;
  border: 1px solid #b7d2ed;
  border-radius: 10px 10px 0 0;
  color: #375175;
  cursor: default;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.2;
  min-height: 28px;
  padding: 4px 6px;
}

.sprite-simulator-tab:disabled {
  opacity: 1;
}

.sprite-simulator-tab.is-active {
  background: #ffffff;
  border-bottom-color: #ffffff;
  color: #1f90f5;
}

.sprite-simulator-content {
  border: 1px solid #b7d2eb;
  border-radius: 0 0 12px 12px;
  display: grid;
  gap: 8px;
  grid-template-columns: 94px minmax(0, 1fr);
  min-height: 196px;
  padding: 8px;
}

.sprite-simulator-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.sprite-simulator-sprite-card {
  align-items: center;
  background: #f0f7ff;
  border: 1px solid #bfd7f0;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  min-height: 68px;
  padding: 6px;
  text-align: center;
}

.sprite-simulator-sprite-card.is-active {
  border-color: #24a0ff;
  box-shadow: inset 0 0 0 1px rgba(36, 160, 255, 0.32);
}

.sprite-simulator-list-avatar {
  filter: drop-shadow(0 2px 4px rgba(13, 44, 92, 0.2));
  height: 38px;
  object-fit: contain;
  width: 38px;
}

.sprite-simulator-sprite-card span {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.1;
  word-break: break-word;
}

.sprite-simulator-empty-thumb {
  background: linear-gradient(180deg, #c8dff6, #aecce8);
  border-radius: 8px;
  display: inline-block;
  height: 34px;
  width: 34px;
}

.sprite-simulator-add-button {
  align-items: center;
  background: linear-gradient(180deg, #eef7ff 0%, #deefff 100%);
  border: 1px solid #a7ccf1;
  border-radius: 12px;
  color: #1a8be0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  min-height: 68px;
  padding: 4px;
  transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.sprite-simulator-add-button:hover,
.sprite-simulator-add-button:focus {
  background: linear-gradient(180deg, #e4f2ff 0%, #cfe8ff 100%);
  border-color: #88bff1;
  box-shadow: 0 0 0 2px rgba(35, 152, 243, 0.18);
  color: #0b72cb;
  outline: none;
}

.sprite-simulator-add-button[aria-expanded="true"] {
  background: linear-gradient(180deg, #d9ecff 0%, #c1defc 100%);
  border-color: #6eaeea;
  box-shadow: 0 0 0 2px rgba(35, 152, 243, 0.24);
}

.sprite-simulator-add-icon {
  align-items: center;
  background: linear-gradient(180deg, #2da9ff 0%, #1c8ce8 100%);
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 1.2rem;
  height: 28px;
  justify-content: center;
  line-height: 1;
  width: 28px;
}

.sprite-simulator-add-button:disabled {
  opacity: 1;
}

.sprite-simulator-variant-menu {
  background: #ffffff;
  border: 1px solid #9ec7ee;
  border-radius: 12px;
  box-shadow: 0 14px 28px rgba(20, 49, 97, 0.22);
  left: calc(100% + 8px);
  min-width: 170px;
  overflow: hidden;
  padding: 8px;
  position: absolute;
  top: 0;
  z-index: 6;
}

.sprite-simulator-variant-menu-title {
  color: #3b5578;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 6px;
}

.sprite-simulator-variant-option {
  align-items: center;
  background: #f5f9ff;
  border: 1px solid #d4e4f7;
  border-radius: 9px;
  color: #2b4468;
  cursor: pointer;
  display: flex;
  font-size: 0.76rem;
  font-weight: 700;
  gap: 8px;
  justify-content: flex-start;
  margin: 0;
  min-height: 38px;
  padding: 6px 8px;
  text-align: left;
  width: 100%;
}

.sprite-simulator-variant-option + .sprite-simulator-variant-option {
  margin-top: 6px;
}

.sprite-simulator-variant-option img {
  flex: 0 0 auto;
  height: 26px;
  object-fit: contain;
  width: 26px;
}

.sprite-simulator-variant-option span {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sprite-simulator-variant-option:hover,
.sprite-simulator-variant-option:focus {
  background: #ebf5ff;
  border-color: #9dc8ee;
  color: #173c67;
  outline: none;
}

.sprite-simulator-variant-option.is-active {
  background: linear-gradient(180deg, #2a9fff 0%, #1d8de8 100%);
  border-color: #1a81d8;
  color: #ffffff;
}

.sprite-simulator-details {
  border-left: 1px solid #bdd4ea;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding-left: 8px;
}

.sprite-simulator-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sprite-simulator-field-label {
  color: #3a577d;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.1;
}

.sprite-simulator-field-value {
  align-items: center;
  background: #ffffff;
  border: 1px solid #b7d2eb;
  border-radius: 999px;
  color: #233f64;
  display: inline-flex;
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
}

.sprite-simulator-field-grid {
  column-gap: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  row-gap: 8px;
}

.sprite-simulator-show-toggle {
  align-items: center;
  border: 1px solid #b7d2eb;
  border-radius: 999px;
  display: inline-flex;
  gap: 8px;
  min-height: 28px;
  padding: 0 10px;
  width: fit-content;
}

.sprite-simulator-show-dot {
  background: #dce8f4;
  border-radius: 50%;
  display: inline-block;
  height: 10px;
  width: 10px;
}

.sprite-simulator-show-dot.is-on {
  background: #24a0ff;
}

.sprite-simulator-action-button {
  align-items: center;
  background: #24a0ff;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  cursor: default;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 700;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
}

.sprite-simulator-action-button:disabled {
  opacity: 1;
}

.simulator-sensors-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.simulator-board {
  --sim-board-drag-x: 0px;
  --sim-board-drag-y: 0px;
  aspect-ratio: 911 / 679;
  background: #102ca8;
  border-radius: 18px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  position: relative;
  touch-action: none;
  transform: translate3d(var(--sim-board-drag-x), var(--sim-board-drag-y), 0);
  transition: transform 90ms ease-out;
  width: 100%;
  max-width: 100%;
}

.simulator-board.simulator-board-v2 {
  aspect-ratio: 911 / 679;
  background: #102ca8;
}

.simulator-board.simulator-board-v1 {
  aspect-ratio: 1038 / 633;
  background: #edf2fb;
}

.simulator-board.simulator-board-v3 {
  aspect-ratio: 508 / 463;
  background: #e9edf5;
}

.simulator-board.can-shake {
  cursor: grab;
}

.simulator-board.is-dragging {
  cursor: grabbing;
  transition: none;
}

@keyframes simulatorBoardShake {
  0% { transform: translate3d(0, 0, 0); }
  18% { transform: translate3d(-10px, 1px, 0); }
  34% { transform: translate3d(10px, -1px, 0); }
  50% { transform: translate3d(-8px, 1px, 0); }
  66% { transform: translate3d(8px, -1px, 0); }
  82% { transform: translate3d(-4px, 0, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

.simulator-board.is-shaking {
  animation: simulatorBoardShake 280ms ease-in-out;
}

.simulator-board::before,
.simulator-board::after {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transition: opacity 0.18s ease;
  z-index: 6;
}

.simulator-board::before {
  background:
    linear-gradient(115deg, rgba(226, 236, 255, 0.82) 25%, rgba(199, 217, 247, 0.62) 50%, rgba(226, 236, 255, 0.82) 75%);
  background-size: 220% 100%;
  content: "";
  inset: 0;
}

.simulator-board::after {
  animation: simulatorBoardLoaderSpin 0.85s linear infinite;
  border: 3px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  border-top-color: rgba(37, 99, 235, 0.92);
  content: "";
  height: 34px;
  left: 50%;
  margin-left: -17px;
  margin-top: -17px;
  top: 50%;
  width: 34px;
}

.simulator-board.is-loading::before,
.simulator-board.is-loading::after {
  opacity: 1;
}

@keyframes simulatorBoardLoaderSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.simulator-board-image {
  display: block;
  height: 100%;
  left: 0;
  object-fit: contain;
  position: absolute;
  top: 0;
  user-select: none;
  width: 100%;
  -webkit-user-drag: none;
  transition: opacity 0.16s ease;
  z-index: 2;
}

.simulator-board.is-loading .simulator-board-image {
  opacity: 0;
}

.simulator-controls {
  align-items: center;
  display: flex;
  justify-content: center;
  margin: 8px 0 8px;
}

.simulator-control-button {
  align-items: center;
  background: #dedede;
  border: 0;
  border-radius: 0;
  color: #777777;
  cursor: pointer;
  display: inline-flex;
  height: 24px;
  justify-content: center;
  padding: 0;
  transition: background-color 0.16s ease, color 0.16s ease;
  width: 30px;
}

.simulator-control-button:first-child {
  border-radius: 3px 0 0 3px;
}

.simulator-control-button:last-child {
  border-radius: 0 3px 3px 0;
}

.simulator-control-button:hover,
.simulator-control-button:focus {
  background: #d2d2d2;
  color: #555555;
  outline: none;
}

.simulator-control-icon {
  display: block;
  fill: currentColor;
  height: 14px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 14px;
}

.simulator-control-icon-stop {
  stroke: none;
}

.simulator-control-icon-play {
  display: none;
  stroke: none;
}

.simulator-control-icon-restart {
  fill: none;
}

.simulator-control-button-run[data-running="false"] .simulator-control-icon-stop {
  display: none;
}

.simulator-control-button-run[data-running="false"] .simulator-control-icon-play {
  display: block;
}

.simulator-attach-dock {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.simulator-attach-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.simulator-attach-module {
  background: #f7fafc;
  border: 1px solid #dce5f0;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
  color: #23324a;
  min-width: 156px;
  padding: 8px 10px;
  position: relative;
}

.simulator-attach-module[hidden] {
  display: none !important;
}

.simulator-attach-module::before {
  background: linear-gradient(180deg, #94b6dc, #c6d8ed);
  border-radius: 999px;
  content: "";
  height: 8px;
  left: 14px;
  position: absolute;
  top: -8px;
  width: 3px;
}

.simulator-attach-module-head {
  align-items: center;
  display: flex;
  gap: 7px;
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.simulator-attach-port-badge {
  align-items: center;
  background: #1e88e5;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 0.7rem;
  font-weight: 700;
  height: 20px;
  justify-content: center;
  min-width: 20px;
  padding: 0 6px;
}

.simulator-attach-color-body {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: auto auto minmax(0, 1fr);
}

.simulator-attach-color-picker {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  height: 28px;
  padding: 0;
  width: 34px;
}

.simulator-attach-color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}

.simulator-attach-color-picker::-webkit-color-swatch {
  border: 2px solid #c4d4e6;
  border-radius: 8px;
}

.simulator-attach-color-swatch {
  border: 2px solid #c4d4e6;
  border-radius: 999px;
  display: inline-flex;
  height: 18px;
  width: 18px;
}

.simulator-attach-color-name {
  font-family: "Consolas", "SFMono-Regular", "Courier New", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.simulator-attach-module-ultra {
  min-width: 228px;
}

.simulator-attach-ultra-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: flex;
  font-size: 0.76rem;
  font-weight: 700;
  gap: 7px;
  margin: 0;
  padding: 0;
}

.simulator-attach-ultra-value-row {
  color: #2b3f5f;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 6px;
}

.simulator-attach-ultra-visual {
  display: block;
  height: 58px;
  margin-top: 6px;
  position: relative;
  width: 56px;
}

.simulator-attach-ultra-shell {
  background: linear-gradient(180deg, #575b63, #474b54);
  border: 1px solid #2a2d35;
  border-radius: 2px;
  height: 54px;
  left: 0;
  position: absolute;
  top: 2px;
  width: 30px;
}

.simulator-attach-ultra-shell::before,
.simulator-attach-ultra-shell::after {
  background: rgba(255, 255, 255, 0.36);
  content: "";
  height: 2px;
  left: 1px;
  position: absolute;
  right: 1px;
}

.simulator-attach-ultra-shell::before {
  top: 4px;
}

.simulator-attach-ultra-shell::after {
  bottom: 4px;
}

.simulator-attach-ultra-screw {
  background: radial-gradient(circle at 35% 35%, #0d0f13, #08090c 72%);
  border: 1px solid #1f232b;
  border-radius: 999px;
  height: 10px;
  left: 8px;
  position: absolute;
  width: 10px;
}

.simulator-attach-ultra-screw-top {
  top: 11px;
}

.simulator-attach-ultra-screw-bottom {
  bottom: 11px;
}

.simulator-attach-ultra-head {
  background: radial-gradient(circle at 38% 36%, #d7d9dd, #8e9399 72%);
  border: 1px solid #7e8288;
  border-radius: 2px;
  height: 17px;
  position: absolute;
  right: 0;
  width: 18px;
}

.simulator-attach-ultra-head-top {
  top: 10px;
}

.simulator-attach-ultra-head-bottom {
  top: 34px;
}

.simulator-attach-ultra-slider-wrap {
  margin-top: 6px;
}

.simulator-attach-ultra-slider-wrap input[type="range"] {
  width: 100%;
}

.simulator-attach-module-motor {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 164px;
}

.simulator-motor-visual {
  align-items: center;
  display: inline-flex;
  gap: 0;
  position: relative;
}

.simulator-motor-cap {
  background: linear-gradient(180deg, #202a39, #101926);
  border-radius: 5px 0 0 5px;
  height: 12px;
  width: 6px;
}

.simulator-motor-body {
  background: linear-gradient(180deg, #d1b87d, #b3944a);
  border: 1px solid #8e7237;
  border-left: 0;
  border-radius: 0 2px 2px 0;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35);
  height: 10px;
  position: relative;
  width: 16px;
  z-index: 1;
}

.simulator-motor-shaft {
  display: inline-block;
  background:
    radial-gradient(circle at 50% 50%, #18263b 0 42%, #0c1523 43% 72%, transparent 73%);
  border: 3px solid #5fe9ff;
  border-radius: 999px;
  box-shadow:
    inset 0 0 0 2px #1c2f47,
    0 1px 2px rgba(12, 22, 37, 0.35);
  height: 20px;
  margin-left: -6px;
  position: relative;
  transform-origin: 50% 50%;
  width: 20px;
  z-index: 2;
}

.simulator-motor-shaft::before {
  content: none;
}

.simulator-motor-shaft::after {
  background: #ff5d97;
  border: 1px solid #ffcadf;
  border-radius: 999px;
  content: "";
  height: 4px;
  position: absolute;
  right: -3px;
  top: 3px;
  width: 4px;
}

@keyframes simulatorMotorWheelSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.simulator-motor-shaft.is-spinning {
  animation: simulatorMotorWheelSpin var(--sim-motor-spin-duration, 420ms) linear infinite;
}

.simulator-motor-shaft.is-spinning.is-reverse {
  animation-direction: reverse;
}

.simulator-attach-motor-label {
  color: #2f415f;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.simulator-sensor-panel {
  background: #f7fafc;
  border: 1px solid #dce5f0;
  border-radius: 12px;
  column-gap: 10px;
  display: grid;
  grid-template-areas:
    "header sensor-image"
    "control sensor-image"
    "detected sensor-image"
    "raw sensor-image";
  grid-template-columns: minmax(0, 1fr) auto;
  row-gap: 2px;
  align-content: start;
  padding: 8px 10px;
}

.simulator-sensor-panel[hidden] {
  display: none !important;
}

.simulator-sensor-header-row {
  align-items: center;
  display: flex;
  gap: 8px;
  grid-area: header;
  justify-content: space-between;
  min-height: 0;
}

.simulator-sensor-title {
  color: #24324a;
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.simulator-sensor-bus {
  color: #708096;
  font-size: 0.69rem;
  font-weight: 600;
}

.simulator-sensor-device-image {
  align-self: center;
  display: block;
  flex: 0 0 auto;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
  height: 78px;
  grid-area: sensor-image;
  justify-self: end;
  margin: 0;
  object-fit: contain;
  object-position: center center;
  width: 78px;
}

.simulator-sensor-control-row {
  align-items: center;
  display: flex;
  gap: 10px;
  grid-area: control;
  min-height: 16px;
}

.simulator-sensor-picker-label {
  color: #5f6d80;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

.simulator-sensor-picker {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  height: 24px;
  padding: 0;
  width: 34px;
}

.simulator-sensor-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}

.simulator-sensor-picker::-webkit-color-swatch {
  border: 1px solid #c8d3e2;
  border-radius: 6px;
}

.simulator-sensor-chip {
  border: 2px solid #c8d3e2;
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  height: 16px;
  width: 16px;
}

.simulator-sensor-detected-row,
.simulator-sensor-raw-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.simulator-sensor-detected-row {
  grid-area: detected;
}

.simulator-sensor-raw-row {
  grid-area: raw;
}

.simulator-sensor-caption {
  color: #6f7f93;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.2;
  text-transform: uppercase;
}

.simulator-sensor-detected-value {
  color: #1d2940;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
}

.simulator-sensor-raw-item {
  color: #2f3e57;
  font-size: 0.73rem;
  font-weight: 600;
  line-height: 1.2;
}

.simulator-encoder-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  grid-template-areas: none;
  grid-template-columns: minmax(0, 1fr);
}

.simulator-oled-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  grid-template-areas: none;
  grid-template-columns: minmax(0, 1fr);
}

.simulator-oled-screen-wrap {
  background: #060d17;
  border: 1px solid #0e1d31;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  overflow: hidden;
  padding: 6px;
}

.simulator-oled-canvas {
  background: #040a13;
  border-radius: 6px;
  display: block;
  height: auto;
  image-rendering: pixelated;
  max-width: 100%;
  width: 100%;
}

.simulator-oled-meta-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.simulator-rfid-panel {
  display: grid;
  gap: 8px 12px;
  grid-template-areas:
    "header header"
    "card field"
    "card meta";
  grid-template-columns: 68px minmax(0, 1fr);
}

.simulator-rfid-card {
  align-items: center;
  align-self: center;
  background: linear-gradient(135deg, #f8fbff 0%, #edf4ff 100%);
  border: 1px solid #cbd8ea;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.75);
  display: grid;
  grid-area: card;
  height: 58px;
  justify-items: center;
  overflow: hidden;
  position: relative;
  width: 58px;
}

.simulator-rfid-chip {
  background: #176fd0;
  border-radius: 5px;
  box-shadow: 0 0 0 2px rgba(23, 111, 208, 0.18);
  display: block;
  height: 18px;
  position: relative;
  width: 18px;
  z-index: 1;
}

.simulator-rfid-antenna {
  border: 2px solid rgba(23, 111, 208, 0.28);
  border-radius: 999px;
  display: block;
  height: 32px;
  position: absolute;
  width: 32px;
}

.simulator-rfid-antenna-a {
  height: 46px;
  width: 46px;
}

.simulator-rfid-antenna-b {
  height: 34px;
  width: 34px;
}

.simulator-rfid-antenna-c {
  height: 22px;
  width: 22px;
}

.simulator-rfid-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  grid-area: field;
  min-width: 0;
}

.simulator-rfid-input {
  background: #ffffff;
  border: 1px solid #b9c9df;
  border-radius: 8px;
  color: #1d2940;
  font: 700 0.8rem/1.2 "Consolas", "SFMono-Regular", "Courier New", monospace;
  height: 32px;
  outline: none;
  padding: 0 9px;
  text-transform: uppercase;
  width: 100%;
}

.simulator-rfid-input:focus {
  border-color: #2f7eea;
  box-shadow: 0 0 0 3px rgba(47, 126, 234, 0.16);
}

.simulator-rfid-meta-row {
  align-items: center;
  display: flex;
  gap: 8px;
  grid-area: meta;
}

.simulator-encoder-grid {
  display: grid;
  gap: 6px 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.simulator-encoder-grid .simulator-sensor-raw-item {
  display: block;
  font-family: "Consolas", "SFMono-Regular", "Courier New", monospace;
}

.simulator-imu-panel {
  align-items: center;
  display: flex;
  flex-direction: row;
  gap: 10px;
  justify-content: space-between;
  min-height: 44px;
}

.simulator-imu-content {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 12px;
}

.simulator-imu-item {
  color: #2f3e57;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.2;
}

.simulator-imu-item strong {
  color: #0f172a;
  font-weight: 700;
}

.simulator-imu-title {
  color: #007be5;
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Keep sidebar IMU cards visually stable under realtime updates. */
.simulator-pane .simulator-imu-panel {
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  min-height: 38px;
  padding-bottom: 6px;
  padding-top: 6px;
}

.simulator-pane .simulator-imu-content {
  align-content: center;
  align-items: center;
  gap: 3px 6px;
  min-height: 0;
}

.simulator-pane #simImuTiltPanel .simulator-imu-content,
.simulator-pane #simImuGyroPanel .simulator-imu-content,
.simulator-pane #simImuAccelPanel .simulator-imu-content {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  width: auto;
}

.simulator-pane #simImuTiltPanel .simulator-imu-item,
.simulator-pane #simImuGyroPanel .simulator-imu-item,
.simulator-pane #simImuAccelPanel .simulator-imu-item {
  white-space: nowrap;
}

.simulator-pane .simulator-imu-item {
  font-size: 0.72rem;
  line-height: 1.08;
}

.simulator-pane .simulator-imu-item strong {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  min-width: 3.5ch;
  text-align: right;
}

.simulator-pane .simulator-imu-title {
  flex: 0 0 auto;
  font-size: 0.68rem;
  letter-spacing: 0.015em;
  line-height: 1;
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
}

.bottom-toolbar {
  align-items: center;
  background: #f7f7f7;
  border-top: 1px solid #ddd;
  bottom: 0;
  box-sizing: border-box;
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
  justify-content: flex-start;
  padding: 8px 12px;
  position: sticky;
  width: 100%;
  z-index: 80;
}

.toolbar-left,
.toolbar-center,
.toolbar-right {
  align-items: center;
  display: flex;
  gap: 10px;
}

.toolbar-left {
  flex: 0 0 auto;
  gap: 0;
  position: relative;
}

.toolbar-center {
  flex: 0 0 auto;
  justify-content: flex-start;
  gap: 0;
  margin-left: 8px;
}

.toolbar-right {
  flex: 0 0 auto;
  gap: 12px;
  margin-left: auto;
}

.toolbar-primary {
  background: #1f4fbf;
  border: 1px solid #1a43a3;
  border-right: 0;
  border-radius: 10px 0 0 10px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  height: 36px;
  padding: 0 18px;
}

.toolbar-dot {
  align-items: center;
  background: #163a8a;
  border: 1px solid #133274;
  border-left: 0;
  border-radius: 0 10px 10px 0;
  color: #fff;
  display: inline-flex;
  font-size: 0.95rem;
  font-weight: 700;
  gap: 6px;
  justify-content: center;
  margin-left: 0;
  height: 36px;
  min-width: 58px;
  padding: 0 10px;
}

.toolbar-dot-label {
  display: inline-block;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1;
  min-width: 1ch;
  text-align: center;
}

.toolbar-dot-arrow {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-width: 12px;
  width: 12px;
  height: 12px;
  position: relative;
}

.toolbar-dot-arrow::before {
  border-right: 2px solid currentColor;
  border-top: 2px solid currentColor;
  content: "";
  display: block;
  height: 7px;
  width: 7px;
  transform: rotate(-45deg) translateY(1px);
  transform-origin: center;
}

.toolbar-dot[aria-expanded="true"] .toolbar-dot-arrow::before {
  transform: rotate(135deg) translateY(1px);
}

.toolbar-menu {
  background: #ffffff;
  border: 1px solid #d6d6d6;
  border-radius: 10px;
  bottom: 54px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 6px;
  left: 0;
  max-height: min(62vh, 560px);
  min-width: 220px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 10px;
  position: absolute;
  scrollbar-gutter: stable;
  z-index: 30;
}

.toolbar-menu[hidden] {
  display: none;
}

.toolbar-menu-title {
  color: #5a5a5a;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 0;
  text-transform: uppercase;
}

.toolbar-menu-header {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.toolbar-menu-add {
  align-items: center;
  background: #1f4fbf;
  border: 1px solid #1a43a3;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-size: 1rem;
  font-weight: 700;
  height: 28px;
  justify-content: center;
  line-height: 1;
  min-width: 28px;
  padding: 0;
}

.toolbar-menu-add:hover,
.toolbar-menu-add:focus {
  background: #214fb3;
  outline: none;
}

.toolbar-menu-actions {
  display: grid;
  gap: 6px;
  grid-template-columns: 1fr;
}

.toolbar-menu-action {
  align-items: center;
  background: #f8faff;
  border: 1px solid #d6e2ff;
  border-radius: 8px;
  color: #244996;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 700;
  justify-content: center;
  min-height: 30px;
  padding: 0 8px;
  text-align: center;
}

.toolbar-menu-action:hover,
.toolbar-menu-action:focus {
  background: #eaf2ff;
  border-color: #b8cdff;
  outline: none;
}

.toolbar-menu-item {
  align-items: center;
  background: #f3f6ff;
  border: 1px solid #dfe6f5;
  border-radius: 8px;
  color: #1a2a4a;
  display: flex;
  font-size: 0.95rem;
  font-weight: 600;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  text-align: left;
  width: 100%;
}

.toolbar-menu-item:hover,
.toolbar-menu-item:focus {
  background: #e7efff;
  border-color: #c5d6ff;
  outline: none;
}

.toolbar-menu-item.is-active {
  background: #e0ebff;
  border-color: #a7c2fb;
}

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

.toolbar-menu-item-check {
  color: #1f4fbf;
  display: inline-block;
  font-size: 0.9rem;
  min-width: 12px;
  text-align: center;
}

.toolbar-menu-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar-menu-item-id {
  background: #163a8a;
  border-radius: 999px;
  color: #fff;
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  min-width: 22px;
  padding: 4px 6px;
  text-align: center;
}

.toolbar-menu-item-id.is-base {
  background: #4d5e7f;
}

body.extensions-modal-open {
  overflow: hidden;
}

.extensions-modal {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 120;
}

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

.extensions-modal-backdrop {
  background: rgba(26, 31, 42, 0.38);
  border: 0;
  inset: 0;
  padding: 0;
  position: absolute;
}

.extensions-modal-card {
  background: #eceef3;
  border: 1px solid #d7dbe4;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.24);
  display: flex;
  flex-direction: column;
  height: min(840px, calc(100vh - 38px));
  max-width: 1260px;
  position: relative;
  width: min(1260px, calc(100vw - 52px));
  z-index: 1;
}

.extensions-modal-close {
  align-items: center;
  background: transparent;
  border: 0;
  color: #717783;
  cursor: pointer;
  display: inline-flex;
  font-size: 48px;
  font-weight: 300;
  height: 58px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 10px;
  top: 8px;
  width: 58px;
  z-index: 2;
}

.extensions-modal-close:hover,
.extensions-modal-close:focus {
  color: #3f4757;
  outline: none;
}

.extensions-modal-title {
  color: #111827;
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 30px 72px 18px 34px;
}

.extensions-modal-frame {
  background: #eceef3;
  border: 0;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.toolbar-project {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  height: 32px;
  min-width: 150px;
  max-width: 180px;
  padding: 0 12px;
  text-align: center;
  font-size: 1rem;
  line-height: 32px;
  outline: none;
}

.toolbar-project:focus {
  border-color: #8eb3ff;
  box-shadow: 0 0 0 2px rgba(67, 120, 236, 0.2);
  text-align: center;
}

.header-pill {
  background: #3248b9;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 999px;
  display: flex;
  height: 36px;
  left: 50%;
  overflow: hidden;
  padding: 0;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 220px;
}

.header-pill-tab {
  align-items: center;
  background: transparent;
  border: none;
  border-radius: 999px;
  color: #e8fff3;
  display: flex;
  font-size: 0.9rem;
  font-weight: 600;
  flex: 1 1 50%;
  gap: 6px;
  height: 32px;
  justify-content: center;
  line-height: 32px;
  padding: 0;
  text-align: center;
  position: relative;
  z-index: 1;
}

.header-pill-tab-icon {
  display: none;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
}

.header-pill-tab-label {
  display: inline-block;
  line-height: 1;
  white-space: nowrap;
}

.header-pill-tab.active {
  color: #3248b9;
}

.header-pill-indicator {
  background: #ffffff;
  border-radius: 999px;
  bottom: 2px;
  left: 2px;
  position: absolute;
  top: 2px;
  transition: transform 0.25s ease;
  width: calc(50% - 2px);
}

.header-pill[data-active="ai"] .header-pill-indicator {
  transform: translateX(100%);
}

.toolbar-icons {
  display: flex;
  gap: 0;
}

.toolbar-icon {
  align-items: center;
  background: #f0f2f7;
  border: 1px solid #d7dbe2;
  border-radius: 8px;
  display: inline-flex;
  font-size: 1rem;
  height: 32px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 32px;
}

.toolbar-icon:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.toolbar-icon-svg {
  display: block;
  fill: currentColor;
  height: 18px;
  width: 18px;
}

.toolbar-icon-image {
  padding: 0;
}

.toolbar-icon-image img {
  display: block;
  height: 18px;
  margin: 0 auto;
  width: 18px;
}

.toolbar-icon-github {
  background: #3f56cf;
  border-color: #3248b9;
  color: #fff;
  font-weight: 700;
}

.toolbar-icon-green {
  background: #3f56cf;
  border-color: #3248b9;
  color: #fff;
  font-weight: 700;
}

.toolbar-center .toolbar-project {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.toolbar-center .toolbar-icon-green {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin-left: -1px;
}

.toolbar-icons .toolbar-icon-green + .toolbar-icon:not(.toolbar-icon-github) {
  margin-left: -1px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.toolbar-center .toolbar-icon-github {
  margin-left: 6px;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}

.toolbar-icon-svg-github {
  height: 17px;
  width: 17px;
}

.toolbar-pair {
  display: flex;
  gap: 0;
}

.toolbar-pair .toolbar-icon + .toolbar-icon {
  margin-left: -1px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.toolbar-pair .toolbar-icon:first-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.toolbar-right {
  gap: 8px;
}

.toolbar-right .toolbar-pair + .toolbar-pair {
  margin-left: 8px;
}

.run-controls {
  align-items: center;
  display: inline-flex;
  gap: 10px;
}

.workspace-run-controls {
  position: relative;
}

.upload-progress-indicator {
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #d7dce8;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  color: #2f3d5d;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 700;
  gap: 6px;
  margin-right: 2px;
  padding: 4px 9px;
  pointer-events: none;
  position: static;
  white-space: nowrap;
}

.upload-progress-indicator[hidden] {
  display: none;
}

.upload-progress-spinner {
  border: 2px solid rgba(47, 61, 93, 0.25);
  border-radius: 50%;
  border-right-color: #1fb55f;
  border-top-color: #1fb55f;
  display: inline-block;
  height: 12px;
  width: 12px;
  animation: runControlSpin 0.75s linear infinite;
}

.run-controls .run-control-button {
  align-items: center;
  background: #bcbcbc;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  color: #ffffff;
  display: inline-flex;
  height: 46px;
  justify-content: center;
  padding: 0;
  position: relative;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  width: 46px;
}

.run-controls .run-control-button:hover,
.run-controls .run-control-button:focus {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  outline: none;
  transform: translateY(-1px);
}

.run-controls .run-control-button:active {
  transform: translateY(0);
}

.run-controls .run-control-button:disabled {
  cursor: not-allowed;
  opacity: 1;
}

.run-control-play-icon {
  display: inline-block;
  height: 18px;
  margin-left: 2px;
  width: 18px;
  background: currentColor;
  clip-path: polygon(22% 14%, 88% 50%, 22% 86%);
}

.run-control-stop-icon {
  background: currentColor;
  border-radius: 2px;
  display: inline-block;
  height: 14px;
  width: 14px;
}

.run-start-button.is-ready,
.run-start-button.is-running {
  background: #1fb55f;
}

.run-start-button.is-uploading {
  background: #1aa95a;
}

.run-start-button.is-uploading .run-control-play-icon {
  opacity: 0.25;
}

.run-start-button.is-uploading::before {
  border: 3px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  border-right-color: #ffffff;
  border-top-color: #ffffff;
  content: "";
  height: 24px;
  position: absolute;
  width: 24px;
  animation: runControlSpin 0.75s linear infinite;
}

.run-start-button::after {
  border: 3px solid rgba(231, 231, 231, 0.9);
  border-radius: 50%;
  border-right-color: #1fb55f;
  border-top-color: #1fb55f;
  content: "";
  inset: -5px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
}

.run-start-button.is-running::after {
  animation: runControlSpin 0.9s linear infinite;
  opacity: 1;
}

.run-stop-button {
  background: #bcbcbc;
}

.run-stop-button.is-running,
.run-stop-button.is-running:disabled {
  background: #ff1c24;
}

body.compact-mode .header {
  padding: 2px 8px;
}

body.compact-mode .title-row {
  gap: 6px;
}

body.compact-mode .brand-logo {
  border-radius: 6px;
  height: 30px;
  padding: 3px 5px;
}

body.compact-mode .header-pill {
  height: 32px;
  width: 202px;
}

body.compact-mode .header-pill-tab {
  font-size: 0.84rem;
  height: 28px;
  line-height: 28px;
}

body.compact-mode .header-icon-button {
  height: 30px;
  width: 30px;
}

body.compact-mode .header-signin-button {
  font-size: 0.9rem;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
}

body.compact-mode #headerSignInLabel {
  font-size: 0.9rem;
}

body.compact-mode .project-tabs-global {
  padding: 0 8px;
}

body.compact-mode .project-tabs-bar {
  min-height: 66px;
  padding: 0;
}

body.compact-mode .project-tabs-icon-button,
body.compact-mode .project-tabs-add-button {
  height: 66px;
}

body.compact-mode .project-tabs-icon-button {
  width: 86px;
}

body.compact-mode .project-tabs-add-button {
  width: 72px;
}

body.compact-mode .project-tab {
  height: 52px;
}

body.compact-mode .project-tab-main {
  height: 42px;
}

body.compact-mode .main {
  padding: 8px 8px 4px;
}

body.compact-mode .left-column {
  gap: 8px;
}

body.compact-mode .left-column-toggle {
  height: 124px;
}

body.compact-mode .pane-header {
  font-size: 0.95rem;
  padding: 6px 10px;
}

body.compact-mode .simulator-pane .pane-body {
  padding: 6px 10px 0;
}

body.compact-mode .simulator-sensor-panel {
  border-radius: 10px;
  gap: 5px;
  padding: 6px 8px;
}

body.compact-mode .simulator-sensor-title {
  font-size: 0.74rem;
}

body.compact-mode .simulator-sensor-device-image {
  height: 62px;
  width: 62px;
}

body.compact-mode .simulator-sensor-raw-item,
body.compact-mode .simulator-sensor-detected-value {
  font-size: 0.7rem;
}

body.compact-mode .simulator-pane .simulator-imu-panel {
  min-height: 34px;
}

body.compact-mode .simulator-pane .simulator-imu-content {
  min-height: 0;
}

body.compact-mode .simulator-pane .simulator-imu-item {
  font-size: 0.68rem;
}

body.compact-mode .simulator-pane .simulator-imu-item strong {
  min-width: 3ch;
}

body.compact-mode .simulator-pane .simulator-imu-title {
  flex-basis: auto;
  font-size: 0.62rem;
}

body.compact-mode .log-panel summary {
  padding: 6px 10px;
}

body.compact-mode #serialLog {
  font-size: 11px;
  max-height: 190px;
  padding: 6px 10px;
}

body.compact-mode .toolbox-search input {
  font-size: 13px;
}

body.compact-mode .toolbox-mode-tabs {
  gap: 4px;
  padding: 5px 6px;
}

body.compact-mode .toolbox-mode-tab {
  font-size: 0.72rem;
  min-height: 24px;
  min-width: 78px;
  padding: 0 9px;
}

body.compact-mode .blocklyTreeLabel {
  font-size: 18px !important;
}

body.compact-mode .blocklyToolboxDiv .blocklyTreeRowContentContainer {
  padding: 4px 0;
}

body.compact-mode .bottom-toolbar {
  gap: 8px;
  padding: 6px 10px;
}

body.compact-mode .toolbar-left,
body.compact-mode .toolbar-center,
body.compact-mode .toolbar-right {
  gap: 8px;
}

body.compact-mode .toolbar-left {
  gap: 0;
}

body.compact-mode .toolbar-primary,
body.compact-mode .toolbar-dot {
  font-size: 0.88rem;
  height: 32px;
}

body.compact-mode .toolbar-project {
  font-size: 0.92rem;
  height: 30px;
  line-height: 30px;
  min-width: 132px;
}

body.compact-mode .toolbar-icon {
  height: 30px;
  width: 30px;
}

body.compact-mode .toolbar-icon-svg {
  height: 16px;
  width: 16px;
}

body.compact-mode .run-controls .run-control-button {
  height: 40px;
  width: 40px;
}

body.compact-mode .run-control-play-icon {
  height: 16px;
  width: 16px;
}

body.compact-mode .run-control-stop-icon {
  height: 12px;
  width: 12px;
}

/* ===== LEGO MODE ===== */
/* NOTE: In this Blockly build the toolbox container has class .blocklyToolbox (not .blocklyToolboxDiv).
   Category rows are .blocklyToolboxCategory (not .blocklyTreeRow). */

body.lego-mode {
  --lego-toolbox-bg: #efefef;
  --lego-card-bg: #f7f7f7;
  --lego-card-active: #ffffff;
  --lego-flyout-bg: #e6e6e6;
}

/* --- Sidebar container --- */
body.lego-mode .blocklyToolbox {
  background: var(--lego-toolbox-bg) !important;
  border-right: 1px solid #dddddd !important;
  box-sizing: border-box !important;
  min-width: 96px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  scrollbar-width: none !important; /* Firefox */
  width: 96px !important;
  z-index: 30 !important;
}

body.lego-mode .blocklyToolbox::-webkit-scrollbar {
  display: none !important; /* Chrome, Edge, Safari */
}

/* Hide Blockly color-strip/bullet icon in LEGO mode (we render custom circle icon). */
body.lego-mode .blocklyToolbox .blocklyTreeIcon {
  display: none !important;
}

/* Hide search bar in lego mode */
body.lego-mode .toolbox-search {
  display: none !important;
}

/* --- Category group container --- */
body.lego-mode .blocklyToolboxCategoryGroup {
  padding: 10px 0 68px 0 !important;
}

/* --- Each category item (this IS the rowDiv_ in this Blockly build) --- */
body.lego-mode .blocklyToolboxCategory {
  align-items: center !important;
  background: transparent !important;
  border: none !important;
  border-color: transparent !important;
  border-left: none !important;
  border-right: none !important;
  border-left-width: 0 !important;
  border-right-width: 0 !important;
  border-radius: 18px !important;
  box-sizing: border-box !important;
  cursor: pointer;
  height: auto !important;
  justify-content: center !important;
  line-height: normal !important;
  margin: 0 7px 6px !important;
  min-height: 86px !important;
  outline: 0 !important;
  padding: 8px 4px !important;
  transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
  width: calc(96px - 14px) !important; /* 96px toolbox minus 7px*2 margin */
  -webkit-tap-highlight-color: transparent;
}

body.lego-mode .blocklyToolboxCategoryContainer,
body.lego-mode .blocklyToolboxCategoryContainer *,
body.lego-mode .blocklyTreeRow,
body.lego-mode .blocklyTreeRowContentContainer {
  border-color: transparent !important;
  outline: 0 !important;
  -webkit-tap-highlight-color: transparent;
}

/* Remove browser focus ring that appears on category click (especially after Alt+Tab) */
body.lego-mode .blocklyToolboxCategory:focus,
body.lego-mode .blocklyToolboxCategory:focus-visible,
body.lego-mode .blocklyToolboxCategory:focus-within,
body.lego-mode .blocklyToolboxCategoryContainer:focus,
body.lego-mode .blocklyToolboxCategoryContainer:focus-visible,
body.lego-mode .blocklyToolboxCategoryContainer:focus-within,
body.lego-mode .blocklyTreeRow:focus,
body.lego-mode .blocklyTreeRow:focus-visible,
body.lego-mode .blocklyTreeRow:focus-within,
body.lego-mode .blocklyTreeRowContentContainer:focus,
body.lego-mode .blocklyTreeRowContentContainer:focus-visible,
body.lego-mode .blocklyTreeRowContentContainer:focus-within,
body.lego-mode .blocklyToolboxCategory *:focus,
body.lego-mode .blocklyToolboxCategory *:focus-visible,
body.lego-mode .blocklyToolboxCategory *:focus-within {
  outline: none !important;
  box-shadow: none !important;
}

/* Selected state: white card */
body.lego-mode .blocklyToolboxCategory.klh-scroll-active {
  background: var(--lego-card-active) !important;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12) !important;
  transform: translateY(-1px);
}

/* Keep shadow on selected+focused (overrides the focus reset above) */
body.lego-mode .blocklyToolboxCategory.klh-scroll-active:focus {
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12) !important;
}

/* --- Row contents (direct child): column layout so icon is above label --- */
body.lego-mode .blocklyToolboxCategory > .blocklyTreeRowContentContainer {
  align-items: center !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  justify-content: center !important;
  padding: 0 !important;
  width: 100% !important;
}

/* --- Hide Blockly's built-in category icon --- */
body.lego-mode .blocklyToolboxCategoryIcon {
  display: none !important;
}

/* --- Our custom circle icon --- */
body.lego-mode .toolbox-cat-icon {
  background: var(--cat-color, #aaa) !important;
  border-radius: 50% !important;
  box-shadow: none !important;
  display: inline-block !important;
  flex-shrink: 0;
  height: 36px !important;
  margin: 0 !important;
  min-height: 36px !important;
  min-width: 36px !important;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  width: 36px !important;
}

body.lego-mode .toolbox-cat-icon svg {
  display: none !important;
}

/* Selected circle: ring */
body.lego-mode .blocklyToolboxCategory.klh-scroll-active .toolbox-cat-icon,
body.lego-mode .toolbox-cat-icon-selected {
  box-shadow: 0 0 0 3px #ffffff, 0 0 0 5px var(--cat-color, #aaa) !important;
  transform: scale(1.03) !important;
}

/* --- Category label (text below circle) --- */
body.lego-mode .blocklyToolboxCategoryLabel,
body.lego-mode .blocklyTreeLabel {
  color: #4f4f4f !important;
  display: block !important;
  flex: 0 0 auto !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.32px;
  line-height: 1.2;
  margin: 0 !important;
  max-width: 78px !important;
  overflow: hidden;
  padding: 0 !important;
  text-align: center !important;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: normal !important;
  word-break: break-word;
}

/* Selected label: darker */
body.lego-mode .blocklyToolboxCategory.klh-scroll-active .blocklyToolboxCategoryLabel {
  color: #2a2a2a !important;
}

/* --- Flyout panel style in Lego mode --- */
body.lego-mode .blocklyFlyoutBackground {
  fill: var(--lego-flyout-bg) !important;
  fill-opacity: 1 !important;
  opacity: 1 !important;
  stroke: none !important;
}

body.lego-mode .blocklyFlyout {
  opacity: 1 !important;
  /* overflow:visible lets JS (bindLegoFlyoutBlockHover_) extend only the hovered block.
     SVG width stays fixed; per-block clip-path on non-hovered blocks does the clipping. */
  overflow: visible !important;
}

body.lego-mode .blocklyFlyout.klh-lego-hovering-block {
  z-index: 45 !important;
}

body.lego-mode .blocklyFlyout.klh-lego-hovering-block ~ .blocklyFlyoutScrollbar {
  opacity: 0 !important;
  pointer-events: none !important;
}

body.lego-mode .blocklyFlyoutLabelText {
  fill: #5d5d5d !important;
  font-family: "Nunito", "Trebuchet MS", "Segoe UI", "Noto Sans", "Helvetica Neue", Arial, sans-serif !important;
  font-size: 22px !important;
  font-weight: 800 !important;
}

/* Lego mode: no icon in flyout labels, transparent background */
body.lego-mode .klhbit-flyout-header-icon {
  display: none !important;
}
body.lego-mode .blocklyFlyoutLabelBackground {
  fill: transparent !important;
  stroke: none !important;
}

body.lego-mode .klhbit-flyout-header .blocklyFlyoutLabelText {
  fill: #6a6a6a !important;
  font-size: 22px !important;
  font-weight: 800 !important;
}

body.lego-mode .blocklyFlyout .blocklyText,
body.lego-mode .blocklyBlockCanvas .blocklyText {
  font-family: "Nunito", "Trebuchet MS", "Segoe UI", "Noto Sans", "Helvetica Neue", Arial, sans-serif !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0.1px;
}

body.lego-mode .blocklyFlyout .blocklyPath,
body.lego-mode .blocklyBlockCanvas .blocklyPath {
  stroke-width: 1.1px !important;
}

body.lego-mode .blocklyFlyout .blocklyPathLight,
body.lego-mode .blocklyBlockCanvas .klhbit-lego-event-hat-block .blocklyPathLight {
  display: none !important;
  stroke: transparent !important;
}

body.lego-mode .blocklyFlyout .blocklyPathSelected,
body.lego-mode .blocklyBlockCanvas .klhbit-lego-event-hat-block .blocklyPathSelected {
  display: none !important;
  filter: none !important;
}

body.lego-mode .blocklyFlyout .blocklySelected > .blocklyPath,
body.lego-mode .blocklyBlockCanvas .klhbit-lego-event-hat-block.blocklySelected > .blocklyPath {
  filter: none !important;
}

body.lego-mode .klhbit-event-hat-fill,
body.lego-mode .klhbit-event-hat-stroke {
  pointer-events: none;
}

body.lego-mode .blocklyFlyout .blocklyDropdownRect,
body.lego-mode .blocklyBlockCanvas .blocklyDropdownRect {
  fill: rgba(0, 99, 176, 0.34) !important;
  rx: 12px !important;
  ry: 12px !important;
  stroke: rgba(0, 71, 126, 0.55) !important;
}

body.lego-mode .blocklyFlyout .blocklyFieldRect,
body.lego-mode .blocklyBlockCanvas .blocklyFieldRect {
  fill: #ffffff !important;
  rx: 12px !important;
  ry: 12px !important;
  stroke: #c9dcf1 !important;
}

body.lego-mode .blocklyFlyout .blocklyDropdownText,
body.lego-mode .blocklyBlockCanvas .blocklyDropdownText {
  fill: #ffffff !important;
}

body.lego-mode .blocklyFlyout .blocklyEditableText > text,
body.lego-mode .blocklyBlockCanvas .blocklyEditableText > text {
  fill: #0f2f53 !important;
}

body.lego-mode .blocklyFlyout .blocklyEditableField > text,
body.lego-mode .blocklyBlockCanvas .blocklyEditableField > text {
  fill: #0f2f53 !important;
}

body.lego-mode .blocklyFlyout .blocklyDropdownField .blocklyFieldRect,
body.lego-mode .blocklyBlockCanvas .blocklyDropdownField .blocklyFieldRect,
body.lego-mode .blocklyFlyout .blocklyVariableField .blocklyFieldRect,
body.lego-mode .blocklyBlockCanvas .blocklyVariableField .blocklyFieldRect {
  fill: var(--klh-lego-field-fill, rgba(0, 99, 176, 0.54)) !important;
  stroke: var(--klh-lego-field-stroke, rgba(0, 71, 126, 0.65)) !important;
  rx: 12px !important;
  ry: 12px !important;
}

body.lego-mode .blocklyFlyout .blocklyDropdownField > text,
body.lego-mode .blocklyBlockCanvas .blocklyDropdownField > text,
body.lego-mode .blocklyFlyout .blocklyVariableField > text,
body.lego-mode .blocklyBlockCanvas .blocklyVariableField > text,
body.lego-mode .blocklyFlyout .blocklyDropdownField .blocklyText,
body.lego-mode .blocklyBlockCanvas .blocklyDropdownField .blocklyText,
body.lego-mode .blocklyFlyout .blocklyVariableField .blocklyText,
body.lego-mode .blocklyBlockCanvas .blocklyVariableField .blocklyText {
  fill: #ffffff !important;
}

body.lego-mode .blocklyFlyout .blocklyIconSymbol,
body.lego-mode .blocklyBlockCanvas .blocklyIconSymbol {
  fill: #ffffff !important;
}

/* Hide flyout scrollbar in lego mode — scroll still works via mouse wheel */
.klhbit-tilt-popover {
  --tilt-popover-bg: #b49a00;
  background: var(--tilt-popover-bg);
  border-radius: 4px;
  box-shadow: 0 12px 28px rgba(22, 23, 28, 0.22);
  box-sizing: border-box;
  height: 326px;
  overflow: visible;
  position: fixed;
  width: 336px;
  z-index: 550;
}

.klhbit-tilt-popover::before {
  border-bottom: 18px solid var(--tilt-popover-bg);
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  content: "";
  height: 0;
  left: calc(var(--tilt-popover-arrow-left, 168px) - 18px);
  position: absolute;
  top: -17px;
  width: 0;
}

.klhbit-tilt-choice {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  font-family: "Nunito", "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  font-size: 38px;
  font-weight: 900;
  height: 58px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  transition: background 0.16s ease, transform 0.18s ease;
  width: 58px;
  z-index: 3;
}

.klhbit-tilt-choice:hover,
.klhbit-tilt-choice.is-active {
  background: rgba(121, 100, 0, 0.32);
}

.klhbit-tilt-choice:active {
  transform: scale(0.94);
}

.klhbit-tilt-choice-top {
  left: 139px;
  top: 26px;
}

.klhbit-tilt-choice-bottom {
  bottom: 17px;
  left: 139px;
}

.klhbit-tilt-choice-left {
  left: 14px;
  top: 133px;
}

.klhbit-tilt-choice-right {
  right: 14px;
  top: 133px;
}

.klhbit-tilt-move-icon {
  color: #ffffff;
  font-size: 38px;
  font-weight: 900;
  left: 27px;
  line-height: 1;
  opacity: 0.96;
  position: absolute;
  top: 28px;
}

.klhbit-tilt-sensor-icon {
  border-bottom: 5px solid #ffffff;
  border-top: 5px solid #ffffff;
  display: grid;
  gap: 3px;
  grid-template-columns: repeat(2, 5px);
  opacity: 0.96;
  padding: 7px 9px;
  position: absolute;
  right: 30px;
  top: 38px;
}

.klhbit-tilt-sensor-icon span {
  background: #ffffff;
  border-radius: 50%;
  height: 5px;
  width: 5px;
}

.klhbit-tilt-board {
  --tilt-board-depth: 38px;
  --tilt-board-half-depth: 19px;
  --tilt-board-height: 150px;
  --tilt-board-width: 166px;
  height: 196px;
  left: 85px;
  perspective: 820px;
  pointer-events: none;
  position: absolute;
  top: 84px;
  width: 166px;
  z-index: 1;
}

.klhbit-tilt-board-scene {
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  width: 100%;
}

.klhbit-tilt-board-solid {
  height: var(--tilt-board-height);
  left: 0;
  position: absolute;
  top: 14px;
  transform: rotateX(58deg) rotateY(0deg) rotateZ(0deg);
  transform-origin: 50% 50%;
  transform-style: preserve-3d;
  transition: transform 0.42s cubic-bezier(0.2, 0.72, 0.18, 1);
  width: var(--tilt-board-width);
  will-change: transform;
}

.klhbit-tilt-board-face {
  backface-visibility: hidden;
  box-sizing: border-box;
  position: absolute;
}

.klhbit-tilt-board-face-top,
.klhbit-tilt-board-face-bottom {
  border-radius: 3px;
  height: var(--tilt-board-height);
  left: 0;
  top: 0;
  width: var(--tilt-board-width);
}

.klhbit-tilt-board-face-top {
  background: #0d1014;
  box-shadow:
    0 2px 1px rgba(255, 255, 255, 0.2) inset,
    0 -2px 0 rgba(0, 0, 0, 0.42) inset,
    0 0 0 2px rgba(255, 255, 255, 0.14) inset;
  overflow: hidden;
  transform: translateZ(var(--tilt-board-half-depth));
}

.klhbit-tilt-board-face-bottom {
  background: #050607;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  transform: rotateY(180deg) translateZ(var(--tilt-board-half-depth));
}

.klhbit-tilt-board-face-front,
.klhbit-tilt-board-face-back {
  background: linear-gradient(180deg, #202832 0%, #080a0d 100%);
  height: var(--tilt-board-depth);
  left: 0;
  width: var(--tilt-board-width);
}

.klhbit-tilt-board-face-front {
  bottom: 0;
  transform: translateY(100%) translateZ(var(--tilt-board-half-depth)) rotateX(-90deg);
  transform-origin: 50% 0;
}

.klhbit-tilt-board-face-back {
  top: 0;
  transform: translateY(-100%) translateZ(var(--tilt-board-half-depth)) rotateX(90deg);
  transform-origin: 50% 100%;
}

.klhbit-tilt-board-face-left,
.klhbit-tilt-board-face-right {
  background: linear-gradient(90deg, #050607 0%, #262e38 100%);
  height: var(--tilt-board-height);
  top: 0;
  width: var(--tilt-board-depth);
}

.klhbit-tilt-board-face-left {
  left: 0;
  transform: translateX(-100%) translateZ(var(--tilt-board-half-depth)) rotateY(90deg);
  transform-origin: 100% 50%;
}

.klhbit-tilt-board-face-right {
  right: 0;
  transform: translateX(100%) translateZ(var(--tilt-board-half-depth)) rotateY(-90deg);
  transform-origin: 0 50%;
}

.klhbit-tilt-board-image {
  display: block;
  height: 100%;
  object-fit: cover;
  object-position: center;
  user-select: none;
  width: 100%;
  -webkit-user-drag: none;
}

.klhbit-tilt-board-shadow {
  background: rgba(111, 91, 0, 0.35);
  bottom: 2px;
  border-radius: 999px;
  filter: blur(1.5px);
  height: 12px;
  left: 17px;
  position: absolute;
  transition: transform 0.36s cubic-bezier(0.2, 0.72, 0.18, 1), opacity 0.28s ease;
  transform: translateY(0) scaleX(1);
  width: 132px;
}

.klhbit-tilt-popover[data-dir="LEFT"] .klhbit-tilt-board-solid {
  transform: rotateX(55deg) rotateY(-42deg) rotateZ(-28deg) translateX(-8px);
}

.klhbit-tilt-popover[data-dir="RIGHT"] .klhbit-tilt-board-solid {
  transform: rotateX(55deg) rotateY(42deg) rotateZ(28deg) translateX(8px);
}

.klhbit-tilt-popover[data-dir="FRONT"] .klhbit-tilt-board-solid {
  transform: rotateX(84deg) translateY(20px) translateZ(-10px);
}

.klhbit-tilt-popover[data-dir="BACK"] .klhbit-tilt-board-solid {
  transform: rotateX(24deg) translateY(-16px) translateZ(12px);
}

.klhbit-tilt-popover[data-dir="LEFT"] .klhbit-tilt-board-shadow,
.klhbit-tilt-popover[data-dir="RIGHT"] .klhbit-tilt-board-shadow {
  opacity: 0.28;
  transform: translateY(8px) scaleX(0.6);
}

.klhbit-tilt-popover[data-dir="FRONT"] .klhbit-tilt-board-shadow {
  opacity: 0.2;
  transform: translateY(11px) scaleX(0.52);
}

.klhbit-tilt-popover[data-dir="BACK"] .klhbit-tilt-board-shadow {
  opacity: 0.42;
  transform: translateY(-4px) scaleX(1.04);
}

body.lego-mode .klhbit-tilt-direction-field .blocklyFieldRect {
  min-width: 34px;
}

body.lego-mode .klhbit-tilt-direction-field > text,
body.lego-mode .klhbit-tilt-direction-field .blocklyText {
  font-size: 19px !important;
  font-weight: 900 !important;
  text-anchor: middle !important;
}

body.lego-mode .blocklyFlyout .blocklyScrollbar {
  display: none !important;
}

/* --- Flyout fade-in animation (no transform — avoids fighting the X-position !important) --- */
@keyframes legoFlyoutFadeIn {
  from { opacity: 0.7; }
  to   { opacity: 1;   }
}

body.lego-mode .blocklyFlyout.lego-flyout-animate {
  animation: legoFlyoutFadeIn 0.18s ease-out forwards;
}

@keyframes legoFlyoutBlockSlideUp {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

body.lego-mode .blocklyFlyout .lego-flyout-block-enter {
  animation: legoFlyoutBlockSlideUp 0.24s cubic-bezier(0.2, 0.72, 0.18, 1) forwards;
  animation-delay: var(--lego-flyout-delay, 0ms);
  opacity: 0;
}

/* --- Lego mode: compact footer — two icon-only buttons side by side in the 96px sidebar --- */
body.lego-mode .toolbox-footer {
  gap: 4px !important;
  justify-content: center !important;
  padding: 6px 4px 8px !important;
  z-index: 35 !important;  /* must exceed .blocklyToolbox z-index: 30 */
}

/* Hide text, keep only the SVG icon on the Device/Sprite selector */
body.lego-mode .toolbox-footer-board-label {
  display: none !important;
}

/* Make board button a compact square matching the extension button */
body.lego-mode .toolbox-footer-board-button {
  border-radius: 14px !important;
  height: 40px !important;
  justify-content: center !important;
  padding: 0 8px !important;
}

/* Popup menus: open to the right of the 96px sidebar so they're always visible */
body.lego-mode .toolbox-footer-menu {
  bottom: 0 !important;
  left: calc(100% + 8px) !important;
  right: auto !important;
  top: auto !important;
  transform: none !important;
}

@media (max-width: 980px) {
  body.lego-mode .blocklyToolboxCategory {
    margin: 0 5px 5px !important;
    min-height: 78px !important;
    padding: 7px 3px !important;
  }

  body.lego-mode .toolbox-cat-icon {
    height: 32px !important;
    min-height: 32px !important;
    min-width: 32px !important;
    width: 32px !important;
  }

  body.lego-mode .blocklyToolboxCategoryLabel,
  body.lego-mode .blocklyTreeLabel {
    font-size: 10px !important;
  }
}

/* ===== END LEGO MODE ===== */

@keyframes runControlSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.simulator-svg {
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
}

.simulator-svg-klh {
  filter: saturate(1.03) contrast(1.02);
}

.simulator-leds {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(5, minmax(0, 1fr));
  left: 50.5%;
  height: 40.1%;
  pointer-events: none;
  position: absolute;
  top: 47.1%;
  transform: translate(-50%, -50%);
  width: 32.1%;
  z-index: 3;
}

.simulator-board.simulator-board-v3 .simulator-leds {
  left: 48.55%;
  top: 55.8%;
  width: 27.7%;
  height: 30.5%;
}

.simulator-led {
  align-self: center;
  background: rgba(8, 15, 40, 0.78);
  border-radius: 24%;
  box-shadow: inset 0 0 0 1px rgba(58, 86, 156, 0.5);
  height: 34%;
  justify-self: center;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
  width: 34%;
}

.simulator-led.is-off {
  box-shadow: inset 0 0 0 1px rgba(58, 86, 156, 0.5);
}

.sim-button {
  background: transparent;
  border: 0;
  border-radius: 10px;
  box-shadow: none;
  cursor: pointer;
  display: block;
  height: 9.2%;
  margin: 0;
  padding: 0;
  position: absolute;
  width: 8.7%;
  z-index: 4;
}

.sim-button::after {
  display: none;
}

.sim-button.active {
  background: rgba(111, 255, 238, 0.2);
  box-shadow: 0 0 0 2px rgba(111, 255, 238, 0.7), 0 0 10px rgba(111, 255, 238, 0.6);
}

.sim-button-label {
  display: none;
}

.sim-button-bt4 {
  left: 13%;
  top: 43.9%;
  transform: translate(-50%, -50%);
}

.sim-button-bt4 .sim-button-label {
  display: none;
}

.sim-button-bt1 {
  left: 79.7%;
  top: 34.2%;
  transform: translate(-50%, -50%);
}

.sim-button-bt3 {
  left: 79.7%;
  top: 46.8%;
  transform: translate(-50%, -50%);
}

.sim-button-bt2 {
  left: 79.7%;
  top: 59.3%;
  transform: translate(-50%, -50%);
}

.sim-button-bt1 .sim-button-label,
.sim-button-bt3 .sim-button-label,
.sim-button-bt2 .sim-button-label {
  display: none;
}

.sim-button-passive {
  pointer-events: none;
}

.sim-motor-ports {
  align-items: flex-end;
  bottom: 7.1%;
  display: flex;
  justify-content: space-between;
  left: 30.8%;
  position: absolute;
  width: 38.4%;
}

.sim-motor-port {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 22%;
}

.sim-motor-port-label {
  color: #dceaff;
  font-size: clamp(9px, 0.88vw, 13px);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.sim-motor-port-pins {
  background:
    repeating-linear-gradient(
      90deg,
      #9ea9ba 0 5px,
      #4f5a6c 5px 6px,
      #9ea9ba 6px 11px,
      transparent 11px 13px
    );
  border: 1px solid #5f6f86;
  border-radius: 3px;
  display: block;
  height: clamp(7px, 0.74vw, 10px);
  width: 100%;
}

body.theme-dialog-open {
  overflow: hidden;
}

.theme-modal {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 120;
}

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

.theme-modal-backdrop {
  background: rgba(17, 22, 28, 0.58);
  border: 0;
  border-radius: 0;
  inset: 0;
  margin: 0;
  min-height: 100vh;
  min-width: 100vw;
  padding: 0;
  position: absolute;
  width: 100%;
}

.theme-modal-card {
  background: #ffffff;
  border: 1px solid #d8dde8;
  border-radius: 14px;
  box-shadow: 0 24px 48px rgba(10, 20, 32, 0.35);
  max-width: min(980px, calc(100vw - 40px));
  padding: 18px 20px 22px;
  position: relative;
  width: min(980px, calc(100vw - 40px));
  z-index: 1;
}

.theme-modal-close {
  align-items: center;
  background: transparent;
  border: 0;
  color: #70757f;
  cursor: pointer;
  display: inline-flex;
  font-size: 2rem;
  font-weight: 300;
  height: 32px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 12px;
  top: 10px;
  width: 32px;
}

.theme-modal-close:hover,
.theme-modal-close:focus {
  box-shadow: none;
  color: #2f3440;
  outline: none;
}

.theme-modal-title {
  color: #162238;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  margin: 2px 40px 16px 2px;
}

.theme-modal-options {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.theme-option-card {
  align-items: stretch;
  background: #f9fbff;
  border: 1px solid #d9e1ee;
  border-radius: 12px;
  color: #111827;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  gap: 12px;
  min-height: 242px;
  padding: 10px;
  text-align: left;
  width: 100%;
}

.theme-option-card:hover,
.theme-option-card:focus {
  border-color: #9bb4ef;
  box-shadow: 0 0 0 2px rgba(63, 86, 207, 0.14);
  outline: none;
}

.theme-option-card.is-selected {
  border-color: #365ad7;
  box-shadow: 0 0 0 2px rgba(54, 90, 215, 0.24);
}

.theme-option-preview {
  background: #eef3ff;
  border: 1px solid #b8c8ef;
  border-radius: 10px;
  display: grid;
  gap: 0;
  grid-template-columns: 32% 68%;
  grid-template-rows: 18% 82%;
  height: 182px;
  overflow: hidden;
  width: 100%;
}

.theme-option-preview-top {
  grid-column: 1 / span 2;
}

.theme-option-preview-left {
  border-right: 1px solid rgba(0, 0, 0, 0.25);
}

.theme-option-preview-right {
  border-left: 0;
}

.theme-option-preview-light {
  background: #e8edf9;
  border-color: #90a2db;
}

.theme-option-preview-light .theme-option-preview-top {
  background: #3f56cf;
}

.theme-option-preview-light .theme-option-preview-left {
  background: #f5f8ff;
}

.theme-option-preview-light .theme-option-preview-right {
  background: #e9edf4;
}

.theme-option-preview-dark {
  background: #121826;
  border-color: #4f5f8e;
}

.theme-option-preview-dark .theme-option-preview-top {
  background: #111827;
}

.theme-option-preview-dark .theme-option-preview-left {
  background: #1f2937;
  border-right-color: rgba(255, 255, 255, 0.35);
}

.theme-option-preview-dark .theme-option-preview-right {
  background: #2b3040;
}

.theme-option-preview-contrast {
  background: #000000;
  border-color: #ffffff;
}

.theme-option-preview-contrast .theme-option-preview-top {
  background: #000000;
  border-bottom: 1px solid #ffffff;
}

.theme-option-preview-contrast .theme-option-preview-left {
  background: #000000;
  border-right-color: #ffffff;
}

.theme-option-preview-contrast .theme-option-preview-right {
  background: #000000;
}

.theme-option-label {
  color: #15233d;
  display: block;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 0 2px 2px;
  text-align: center;
}

@media (max-width: 1024px) {
  .theme-modal-options {
    grid-template-columns: 1fr;
  }

  .theme-option-card {
    min-height: 180px;
  }
}

body.blockly-prompt-open {
  overflow: hidden;
}

.blockly-prompt-modal {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 150;
}

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

.blockly-prompt-backdrop {
  background: rgba(13, 18, 28, 0.5);
  border: 0;
  border-radius: 0;
  inset: 0;
  margin: 0;
  min-height: 100vh;
  min-width: 100vw;
  padding: 0;
  position: absolute;
  width: 100%;
}

.blockly-prompt-card {
  background: #ffffff;
  border: 1px solid #d5dbe8;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(10, 20, 32, 0.35);
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: min(420px, calc(100vw - 28px));
  min-height: 176px;
  padding: 18px 18px 0;
  position: relative;
  width: min(420px, calc(100vw - 28px));
  z-index: 1;
}

.blockly-prompt-close {
  align-items: center;
  background: transparent;
  border: 0;
  color: #6b7280;
  cursor: pointer;
  display: inline-flex;
  font-size: 2rem;
  font-weight: 300;
  height: 28px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 10px;
  top: 8px;
  width: 28px;
}

.blockly-prompt-close:hover,
.blockly-prompt-close:focus {
  box-shadow: none;
  color: #1f2937;
  outline: none;
}

.blockly-prompt-title {
  color: #374151;
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.2;
  padding-right: 26px;
}

.blockly-prompt-input {
  background: transparent;
  border: 0;
  border-bottom: 1px solid #d1d5db;
  color: #111827;
  font-size: 1.85rem;
  font-weight: 500;
  line-height: 1.25;
  margin: 8px 20px 0;
  min-height: 56px;
  outline: none;
  padding: 0 0 4px;
  text-align: center;
}

.blockly-prompt-actions {
  align-items: center;
  border-top: 1px solid #e5e7eb;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 6px;
}

.blockly-prompt-action {
  background: transparent;
  border: 0;
  color: #1d76d2;
  cursor: pointer;
  font-size: 1.08rem;
  font-weight: 500;
  min-height: 52px;
  outline: none;
}

.blockly-prompt-action + .blockly-prompt-action {
  border-left: 1px solid #e5e7eb;
}

.blockly-prompt-action:hover,
.blockly-prompt-action:focus {
  background: #f8fbff;
  box-shadow: none;
}

body.myblocks-modal-open {
  overflow: hidden;
}

.myblocks-modal {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 155;
}

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

.myblocks-modal-backdrop {
  background: rgba(13, 18, 28, 0.54);
  border: 0;
  border-radius: 0;
  inset: 0;
  margin: 0;
  min-height: 100vh;
  min-width: 100vw;
  padding: 0;
  position: absolute;
  width: 100%;
}

.myblocks-modal-card {
  background: #ffffff;
  border: 1px solid #d9dfeb;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(10, 20, 32, 0.35);
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: min(560px, calc(100vw - 30px));
  padding: 18px 18px 0;
  position: relative;
  width: min(560px, calc(100vw - 30px));
  z-index: 1;
}

.myblocks-modal-close {
  align-items: center;
  background: transparent;
  border: 0;
  color: #6b7280;
  cursor: pointer;
  display: inline-flex;
  font-size: 2rem;
  font-weight: 300;
  height: 28px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 10px;
  top: 8px;
  width: 28px;
}

.myblocks-modal-close:hover,
.myblocks-modal-close:focus {
  box-shadow: none;
  color: #1f2937;
  outline: none;
}

.myblocks-modal-title {
  color: #374151;
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.2;
  padding-right: 26px;
}

.myblocks-field {
  color: #334155;
  display: flex;
  flex-direction: column;
  font-size: 0.95rem;
  gap: 6px;
  font-weight: 600;
}

.myblocks-input {
  background: #ffffff;
  border: 1px solid #d2d8e3;
  border-radius: 8px;
  color: #111827;
  font-size: 1rem;
  min-height: 40px;
  outline: none;
  padding: 0 12px;
}

.myblocks-input:focus {
  border-color: #2e78d7;
}

.myblocks-options {
  border: 1px solid #e3e8f1;
  border-radius: 8px;
  display: grid;
  overflow: hidden;
}

.myblocks-option {
  align-items: center;
  color: #253142;
  cursor: pointer;
  display: flex;
  font-size: 0.96rem;
  font-weight: 600;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
}

.myblocks-option + .myblocks-option {
  border-top: 1px solid #edf1f7;
}

.myblocks-option input {
  accent-color: #ef4f8f;
}

.myblocks-actions {
  align-items: center;
  border-top: 1px solid #e5e7eb;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 4px;
}

.myblocks-action {
  background: transparent;
  border: 0;
  color: #1d76d2;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 500;
  min-height: 52px;
  outline: none;
}

.myblocks-action + .myblocks-action {
  border-left: 1px solid #e5e7eb;
}

.myblocks-action:hover,
.myblocks-action:focus {
  background: #f8fbff;
  box-shadow: none;
}

body.signin-dialog-open {
  overflow: hidden;
}

.signin-modal {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 130;
}

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

.signin-modal-backdrop {
  background: rgba(17, 22, 28, 0.56);
  border: 0;
  border-radius: 0;
  inset: 0;
  margin: 0;
  min-height: 100vh;
  min-width: 100vw;
  padding: 0;
  position: absolute;
  width: 100%;
}

.signin-modal-card {
  background: #ffffff;
  border: 1px solid #d8dde8;
  border-radius: 8px;
  box-shadow: 0 24px 48px rgba(10, 20, 32, 0.35);
  color: #1f2733;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: min(680px, calc(100vw - 40px));
  position: relative;
  width: min(680px, calc(100vw - 40px));
  z-index: 1;
}

.signin-modal-header {
  align-items: center;
  border-bottom: 1px solid #d9dee8;
  display: flex;
  justify-content: space-between;
  min-height: 66px;
  padding: 0 24px;
}

.signin-modal-title {
  color: #1a1f2a;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
}

.signin-modal-close {
  align-items: center;
  background: transparent;
  border: 0;
  color: #70757f;
  cursor: pointer;
  display: inline-flex;
  font-size: 2rem;
  font-weight: 300;
  height: 32px;
  justify-content: center;
  line-height: 1;
  margin-right: -6px;
  padding: 0;
  width: 32px;
}

.signin-modal-close:hover,
.signin-modal-close:focus {
  box-shadow: none;
  color: #2f3440;
  outline: none;
}

.signin-modal-body {
  color: #2d3748;
  font-size: 1.03rem;
  line-height: 1.45;
  padding: 18px 24px 10px;
  text-align: center;
}

.signin-provider-list {
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 8px 24px 0;
}

.signin-provider-button {
  align-items: center;
  background: #ffffff;
  border: 1px solid #6f7785;
  border-radius: 4px;
  color: #1f2937;
  cursor: pointer;
  display: inline-flex;
  font-size: 1.08rem;
  gap: 14px;
  justify-content: center;
  max-width: 310px;
  min-height: 54px;
  padding: 0 18px;
  width: min(310px, 100%);
}

.signin-provider-button:hover,
.signin-provider-button:focus {
  background: #f8fafc;
  box-shadow: none;
  outline: none;
}

.signin-provider-icon {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 1.55rem;
  font-weight: 700;
  justify-content: center;
}

.signin-provider-icon-microsoft {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(2, 9px);
  grid-template-rows: repeat(2, 9px);
  height: 19px;
  width: 19px;
}

.signin-provider-icon-microsoft span {
  display: block;
  height: 9px;
  width: 9px;
}

.signin-provider-icon-microsoft span:nth-child(1) {
  background: #f25022;
}

.signin-provider-icon-microsoft span:nth-child(2) {
  background: #7fba00;
}

.signin-provider-icon-microsoft span:nth-child(3) {
  background: #00a4ef;
}

.signin-provider-icon-microsoft span:nth-child(4) {
  background: #ffb900;
}

.signin-provider-icon-google {
  background: conic-gradient(
    #4285f4 0 25%,
    #34a853 25% 50%,
    #fbbc05 50% 75%,
    #ea4335 75% 100%
  );
  border-radius: 50%;
  color: #ffffff;
  height: 24px;
  line-height: 1;
  width: 24px;
}

.signin-provider-icon-clever {
  background: #3b5be9;
  border-radius: 6px;
  color: #ffffff;
  font-size: 1.05rem;
  height: 24px;
  width: 24px;
}

.signin-provider-label {
  font-size: 1.03rem;
  font-weight: 500;
  line-height: 1.2;
}

.signin-remember-row {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
  padding: 0 24px;
}

.signin-remember-row input {
  margin: 0;
}

.signin-remember-row span {
  color: #1f2937;
  font-size: 1.03rem;
}

.signin-signup-row {
  align-items: baseline;
  color: #1f2937;
  display: inline-flex;
  font-size: 1.03rem;
  gap: 8px;
  justify-content: center;
  margin-top: 18px;
  padding: 0 24px;
}

.signin-link-button,
.signin-learn-more {
  background: transparent;
  border: 0;
  color: #2563eb;
  cursor: pointer;
  font-size: inherit;
  line-height: 1.2;
  margin: 0;
  padding: 0;
  text-decoration: none;
}

.signin-link-button:hover,
.signin-link-button:focus,
.signin-learn-more:hover,
.signin-learn-more:focus {
  box-shadow: none;
  outline: none;
  text-decoration: underline;
}

.signin-learn-more {
  align-self: flex-end;
  font-size: 0.97rem;
  margin: 6px 38px 24px 0;
}

@media (max-width: 720px) {
  .signin-modal-card {
    width: min(680px, calc(100vw - 20px));
  }

  .signin-modal-title {
    font-size: 1.52rem;
  }
}

body.github-signin-dialog-open {
  overflow: hidden;
}

.github-signin-modal {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 131;
}

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

.github-signin-modal-backdrop {
  background: rgba(29, 38, 52, 0.48);
  border: 0;
  border-radius: 0;
  inset: 0;
  margin: 0;
  min-height: 100vh;
  min-width: 100vw;
  padding: 0;
  position: absolute;
  width: 100%;
}

.github-signin-modal-card {
  background: #f8f9fb;
  border: 1px solid #cfd6e3;
  border-radius: 6px;
  box-shadow: 0 22px 44px rgba(12, 22, 35, 0.35);
  color: #222a36;
  display: flex;
  flex-direction: column;
  max-width: min(760px, calc(100vw - 40px));
  min-height: 380px;
  position: relative;
  width: min(760px, calc(100vw - 40px));
  z-index: 1;
}

.github-signin-modal-header {
  align-items: center;
  border-bottom: 1px solid #ced4df;
  display: flex;
  justify-content: space-between;
  min-height: 70px;
  padding: 0 22px;
}

.github-signin-modal-title {
  color: #1f232b;
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.2;
}

.github-signin-modal-close {
  align-items: center;
  background: #1e232d;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font-size: 2rem;
  font-weight: 300;
  height: 38px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 38px;
}

.github-signin-modal-close:hover,
.github-signin-modal-close:focus {
  background: #0f141d;
  box-shadow: none;
  outline: none;
}

.github-signin-modal-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 16px;
  padding: 34px 24px 16px;
}

.github-signin-modal-body p {
  color: #2e3645;
  font-size: 1.03rem;
  line-height: 1.45;
  margin: 0;
}

.github-signin-remember {
  align-items: center;
  color: #2a3342;
  display: inline-flex;
  font-size: 1.03rem;
  gap: 14px;
  width: fit-content;
}

.github-signin-switch-input {
  height: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 0;
}

.github-signin-switch {
  align-items: center;
  background: #e2e5eb;
  border: 1px solid #b7c0ce;
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  height: 26px;
  padding: 0 2px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  width: 58px;
}

.github-signin-switch span {
  background: #ffffff;
  border: 1px solid #97a2b3;
  border-radius: 50%;
  display: block;
  height: 20px;
  transition: transform 0.2s ease;
  width: 20px;
}

.github-signin-switch-input:checked + .github-signin-switch {
  background: #2f8d45;
  border-color: #2f8d45;
}

.github-signin-switch-input:checked + .github-signin-switch span {
  transform: translateX(30px);
}

.github-signin-token-row {
  align-items: baseline;
  color: #2f3747;
  display: inline-flex;
  flex-wrap: wrap;
  font-size: 1rem;
  gap: 8px;
}

.github-signin-link {
  background: transparent;
  border: 0;
  color: #2d6ecf;
  cursor: pointer;
  font-size: inherit;
  margin: 0;
  padding: 0;
}

.github-signin-link:hover,
.github-signin-link:focus {
  box-shadow: none;
  outline: none;
  text-decoration: underline;
}

.github-signin-modal-footer {
  align-items: center;
  border-top: 1px solid #ced4df;
  display: flex;
  justify-content: flex-end;
  min-height: 78px;
  padding: 0 20px;
}

.github-signin-help {
  align-items: center;
  background: #e1e2e4;
  border: 0;
  border-radius: 999px;
  color: #5a6474;
  cursor: pointer;
  display: inline-flex;
  font-size: 1.35rem;
  font-weight: 700;
  height: 44px;
  justify-content: center;
  margin-right: 16px;
  padding: 0;
  width: 44px;
}

.github-signin-help:hover,
.github-signin-help:focus {
  background: #d3d6db;
  box-shadow: none;
  outline: none;
}

.github-signin-submit {
  align-items: stretch;
  background: #1c8d35;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font-size: 1.15rem;
  font-weight: 700;
  min-width: 188px;
  overflow: hidden;
  padding: 0;
}

.github-signin-submit span {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-height: 54px;
}

.github-signin-submit #githubSignInSubmitLabel {
  flex: 1 1 auto;
  padding: 0 18px;
}

.github-signin-submit-check {
  background: #187a2e;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
  flex: 0 0 42px;
  font-size: 1.45rem;
}

.github-signin-submit:hover,
.github-signin-submit:focus {
  background: #187a2e;
  box-shadow: none;
  outline: none;
}

@media (max-width: 820px) {
  .github-signin-modal-card {
    min-height: 0;
    width: min(760px, calc(100vw - 20px));
  }

  .github-signin-modal-title {
    font-size: 1.45rem;
  }

  .github-signin-modal-body {
    padding: 20px 16px 12px;
  }

  .github-signin-modal-body p {
    font-size: 1rem;
  }

  .github-signin-remember {
    font-size: 1.02rem;
  }

  .github-signin-token-row {
    font-size: 0.97rem;
  }

  .github-signin-submit {
    font-size: 1.02rem;
    min-width: 150px;
  }
}

body.share-dialog-open {
  overflow: hidden;
}

body.playground-open {
  overflow: hidden;
}

body.playground-select-open {
  overflow: hidden;
}

.playground-select-modal {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 132;
}

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

.playground-select-backdrop {
  background: rgba(4, 8, 24, 0.72);
  border: 0;
  border-radius: 0;
  inset: 0;
  margin: 0;
  min-height: 100vh;
  min-width: 100vw;
  padding: 0;
  position: absolute;
  width: 100%;
}

.playground-select-card {
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  background: rgba(16, 22, 56, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 16px;
  box-shadow: 0 32px 64px rgba(2, 6, 24, 0.62);
  display: flex;
  flex-direction: column;
  max-height: min(760px, calc(100vh - 28px));
  max-width: min(1180px, calc(100vw - 28px));
  overflow: hidden;
  position: relative;
  width: min(1180px, calc(100vw - 28px));
  z-index: 1;
}

.playground-select-header {
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: #ffffff;
  display: grid;
  gap: 12px;
  grid-template-columns: auto 1fr auto;
  min-height: 62px;
  padding: 0 16px;
}

.playground-select-back-button {
  align-items: center;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  color: #c8d6f5;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.92rem;
  font-weight: 600;
  height: 36px;
  justify-content: center;
  min-width: 80px;
  padding: 0 14px;
}

.playground-select-back-button:hover,
.playground-select-back-button:focus {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  outline: none;
}

.playground-select-title {
  color: #e8eeff;
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.1;
  text-align: center;
}

.playground-select-close-button {
  align-items: center;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  color: #a8badc;
  cursor: pointer;
  display: inline-flex;
  font-size: 1.5rem;
  font-weight: 400;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.playground-select-close-button:hover,
.playground-select-close-button:focus {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  outline: none;
}

.playground-select-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow-y: auto;
  padding: 20px;
}

.playground-select-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.playground-select-item:hover,
.playground-select-item:focus {
  border-color: rgba(100, 160, 255, 0.55);
  box-shadow: 0 8px 28px rgba(40, 90, 200, 0.22);
  outline: none;
  transform: translateY(-2px);
}

.playground-select-item.is-selected {
  border-color: #4f84ff;
  box-shadow: 0 0 0 3px rgba(79, 132, 255, 0.20);
}

.playground-select-thumb {
  display: block;
  height: clamp(140px, 22vw, 210px);
  width: 100%;
}

.playground-select-thumb-current {
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 55%),
    repeating-linear-gradient(0deg, rgba(120, 160, 220, 0.20) 0 2px, transparent 2px 34px),
    repeating-linear-gradient(90deg, rgba(120, 160, 220, 0.20) 0 2px, transparent 2px 34px),
    linear-gradient(180deg, #1e3260 0%, #142448 100%);
}

.playground-select-thumb-saban {
  background:
    linear-gradient(180deg, transparent 0 6%, #ff1d28 6% 22%, transparent 22% 78%, #ff1d28 78% 94%, transparent 94% 100%),
    linear-gradient(90deg, #f4d436 0 9%, transparent 9% 15%, #1986d6 15% 25%, transparent 25% 75%, #1986d6 75% 85%, transparent 85% 91%, #19af62 91% 100%),
    repeating-linear-gradient(90deg, transparent 0 17%, #1f2023 17% 18%, transparent 18% 32%),
    repeating-linear-gradient(0deg, transparent 0 23%, #1f2023 23% 24%, transparent 24% 52%),
    #f7f8fa;
}

.playground-select-item-footer {
  align-items: center;
  background: rgba(0, 0, 0, 0.28);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 14px;
}

.playground-select-item-name {
  color: #d4e2ff;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.15;
}

.playground-select-item-selected {
  background: rgba(79, 132, 255, 0.85);
  border-radius: 999px;
  color: #ffffff;
  display: none;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  padding: 5px 10px;
  text-transform: uppercase;
}

.playground-select-item.is-selected .playground-select-item-selected {
  display: inline-flex;
}

.playground-modal {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 133;
}

.playground-modal.playground-floating-bar {
  align-items: flex-start;
  justify-content: flex-start;
  pointer-events: none;
}

.playground-modal.playground-floating-bar .playground-modal-backdrop {
  display: none;
}

.playground-modal.playground-floating-bar .playground-modal-card {
  align-self: flex-start;
  left: 200px;
  max-height: min(700px, calc(100vh - 72px));
  max-width: min(940px, calc(100vw - 120px));
  pointer-events: auto;
  position: absolute;
  right: auto;
  top: 58px;
  width: min(940px, calc(100vw - 120px));
}

.playground-modal.playground-floating-bar .playground-modal-card.playground-shrunk {
  max-width: min(760px, calc(100vw - 120px));
  width: min(760px, calc(100vw - 120px));
}

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

.playground-modal-backdrop {
  background: rgba(11, 18, 29, 0.62);
  border: 0;
  border-radius: 0;
  inset: 0;
  margin: 0;
  min-height: 100vh;
  min-width: 100vw;
  padding: 0;
  position: absolute;
  width: 100%;
}

.playground-modal-card {
  background: linear-gradient(180deg, #f6f8ff 0%, #eef3fb 100%);
  border: 1px solid #d9e2f4;
  border-radius: 14px;
  box-shadow: 0 26px 48px rgba(8, 19, 40, 0.35);
  display: flex;
  flex-direction: column;
  max-width: min(1120px, calc(100vw - 34px));
  max-height: min(760px, calc(100vh - 34px));
  height: min(760px, calc(100vh - 34px));
  min-height: 560px;
  overflow: hidden;
  position: relative;
  width: min(1120px, calc(100vw - 34px));
  z-index: 1;
}

.playground-modal-header {
  align-items: center;
  background: linear-gradient(90deg, #dce7ff 0%, #d4f0ff 100%);
  border-bottom: 1px solid #c4d3ee;
  cursor: move;
  display: flex;
  gap: 12px;
  min-height: 62px;
  padding: 0 16px;
}

.playground-modal.playground-dragging,
.playground-modal.playground-dragging * {
  user-select: none;
}

.playground-modal-title {
  color: #213657;
  font-size: 1.2rem;
  font-weight: 800;
}

.playground-header-tools {
  align-items: center;
  display: inline-flex;
  gap: 10px;
  margin-left: 8px;
}

.playground-header-tool {
  align-items: center;
  background: rgba(27, 58, 103, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  color: #f4f9ff;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.86rem;
  font-weight: 800;
  gap: 6px;
  height: 34px;
  letter-spacing: 0.03em;
  line-height: 1;
  padding: 0 10px;
  text-transform: uppercase;
}

.playground-header-tool svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  height: 16px;
  width: 16px;
}

.playground-header-tool:hover,
.playground-header-tool:focus {
  background: rgba(31, 71, 124, 0.9);
  box-shadow: none;
  outline: none;
}

.playground-modal-card.playground-shrunk {
  max-height: min(560px, calc(100vh - 34px));
  height: min(560px, calc(100vh - 34px));
  width: min(920px, calc(100vw - 34px));
  max-width: min(920px, calc(100vw - 34px));
}

.playground-modal-card.playground-body-hidden {
  height: auto;
  min-height: 0;
}

.playground-modal.playground-floating-bar .playground-modal-card.playground-body-hidden {
  height: auto;
  max-height: none;
  min-height: 0;
  z-index: 12;
}

.playground-modal.playground-floating-bar .playground-modal-card.playground-body-hidden.playground-shrunk {
  max-width: min(760px, calc(100vw - 120px));
  width: min(760px, calc(100vw - 120px));
}

.playground-modal-card.playground-body-hidden .playground-modal-body {
  display: none;
}

.playground-modal-card.playground-body-hidden .playground-modal-header {
  gap: 8px;
  min-height: 52px;
  padding: 0 12px;
}

.playground-modal-card.playground-body-hidden .playground-modal-title {
  font-size: 1rem;
}

.playground-modal-card.playground-body-hidden .playground-header-tools {
  gap: 6px;
  margin-left: 4px;
}

.playground-modal-card.playground-body-hidden .playground-header-tool {
  font-size: 0.78rem;
  gap: 5px;
  height: 30px;
  padding: 0 9px;
}

.playground-modal-card.playground-body-hidden .playground-header-tool svg {
  height: 14px;
  width: 14px;
}

.playground-modal-card.playground-body-hidden .playground-status {
  font-size: 0.72rem;
  padding: 4px 10px;
}

.playground-modal-card.playground-body-hidden .playground-modal-close {
  font-size: 1.7rem;
  height: 32px;
  width: 32px;
}

.playground-status {
  background: #e8edf8;
  border: 1px solid #c6d2e8;
  border-radius: 999px;
  color: #476081;
  font-size: 0.77rem;
  font-weight: 700;
  margin-left: auto;
  padding: 5px 12px;
  text-transform: uppercase;
}

.playground-status.is-running {
  background: #e5f7ea;
  border-color: #9dd5a8;
  color: #226337;
}

.playground-modal-close {
  align-items: center;
  background: #1b273f;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font-size: 2rem;
  font-weight: 300;
  height: 36px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 36px;
}

.playground-modal-close:hover,
.playground-modal-close:focus {
  background: #101b2e;
  box-shadow: none;
  outline: none;
}

.playground-modal-body {
  flex: 1 1 auto;
  min-height: 420px;
  overflow: hidden;
  position: relative;
}

.playground-loading {
  align-items: center;
  color: #2c4267;
  display: flex;
  flex-direction: column;
  font-size: 1.08rem;
  font-weight: 600;
  gap: 14px;
  inset: 0;
  justify-content: center;
  position: absolute;
  transition: opacity 0.25s ease;
  z-index: 2;
}

.playground-modal.is-ready .playground-loading {
  opacity: 0;
  pointer-events: none;
}

.playground-loading-spinner {
  animation: runControlSpin 0.8s linear infinite;
  border: 3px solid rgba(54, 86, 138, 0.22);
  border-radius: 50%;
  border-top-color: #3f74d6;
  display: inline-block;
  height: 28px;
  width: 28px;
}

.playground-scene-shell {
  display: block;
  height: 100%;
  min-height: 420px;
  position: relative;
}

.playground-activities-toggle {
  align-items: center;
  background: linear-gradient(180deg, #2c8fff 0%, #1f70d2 100%);
  border: 1px solid rgba(13, 47, 96, 0.62);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(8, 36, 79, 0.34);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  height: 46px;
  justify-content: center;
  left: 12px;
  padding: 0;
  position: absolute;
  top: 12px;
  width: 46px;
  z-index: 9;
}

.playground-activities-toggle svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  height: 26px;
  width: 26px;
}

.playground-activities-toggle:hover,
.playground-activities-toggle:focus {
  background: linear-gradient(180deg, #3b9afe 0%, #2078df 100%);
  box-shadow: 0 10px 20px rgba(9, 39, 90, 0.38);
  outline: none;
}

.playground-activities-toggle.is-active {
  background: linear-gradient(180deg, #0f66cb 0%, #0a4ea5 100%);
}

.playground-activities-panel {
  background: linear-gradient(180deg, rgba(25, 103, 191, 0.96) 0%, rgba(13, 80, 156, 0.96) 100%);
  border: 1px solid rgba(7, 41, 86, 0.55);
  border-radius: 9px;
  box-shadow: 0 14px 28px rgba(8, 30, 64, 0.3);
  left: 66px;
  padding: 8px 10px 10px;
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 8;
}

.playground-activities-panel[hidden] {
  display: none;
}

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

.playground-activities-grid-head span {
  color: #f4f8ff;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.18;
  text-align: center;
}

.playground-activities-grid-values {
  background: #edf4ff;
  border: 1px solid rgba(15, 57, 113, 0.24);
  border-radius: 8px;
  margin-top: 7px;
  min-height: 42px;
  padding: 6px 8px;
}

.playground-activities-grid-values span {
  color: #1f3659;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.playground-viewport {
  --camera-tilt: 58deg;
  --camera-spin: -30deg;
  --camera-distance: 0px;
  --robot-x: 0px;
  --robot-z: 0px;
  --robot-yaw: 0deg;
  background:
    radial-gradient(120% 100% at 30% 8%, rgba(255, 255, 255, 0.95) 0%, rgba(225, 236, 255, 0.9) 38%, rgba(191, 218, 250, 0.72) 76%, rgba(152, 196, 244, 0.58) 100%),
    linear-gradient(180deg, #d7ecff 0%, #d1e6ff 48%, #deedff 100%);
  height: 100%;
  inset: 0;
  min-height: 420px;
  overflow: hidden;
  perspective: 980px;
  position: relative;
}

.playground-viewport::before {
  background: linear-gradient(180deg, rgba(20, 44, 81, 0) 0%, rgba(20, 44, 81, 0.12) 100%);
  content: '';
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 4;
}

.playground-canvas {
  display: block;
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
  z-index: 2;
}

.playground-viewport.playground-three-active .playground-world {
  display: none;
}

.playground-world {
  height: 130%;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) translateY(var(--camera-distance)) rotateX(var(--camera-tilt)) rotateZ(var(--camera-spin));
  transform-style: preserve-3d;
  width: 130%;
}

.playground-floor {
  background:
    linear-gradient(90deg, rgba(72, 114, 166, 0.16) 0, rgba(72, 114, 166, 0.16) 1px, transparent 1px, transparent 54px),
    linear-gradient(0deg, rgba(72, 114, 166, 0.16) 0, rgba(72, 114, 166, 0.16) 1px, transparent 1px, transparent 54px),
    linear-gradient(180deg, #f4f9ff 0%, #d7ebff 65%, #c8e3ff 100%);
  border: 2px solid rgba(53, 88, 136, 0.25);
  border-radius: 24px;
  box-shadow: 0 26px 36px rgba(21, 53, 96, 0.2);
  inset: 6% 7%;
  position: absolute;
  transform: translateZ(-2px);
}

.playground-robot {
  height: 74px;
  left: calc(50% + var(--robot-x));
  position: absolute;
  top: calc(50% + var(--robot-z));
  transform: translate(-50%, -50%) rotate(var(--robot-yaw));
  transform-style: preserve-3d;
  transition: left 0.14s linear, top 0.14s linear, transform 0.14s linear;
  width: 96px;
  z-index: 5;
}

.playground-robot::before {
  background: radial-gradient(ellipse at center, rgba(14, 33, 66, 0.35) 0%, rgba(14, 33, 66, 0.08) 65%, rgba(14, 33, 66, 0) 100%);
  content: '';
  height: 26px;
  left: 50%;
  position: absolute;
  top: 46px;
  transform: translateX(-50%);
  width: 86px;
}

.playground-robot-top {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0) 28%),
    linear-gradient(145deg, #eff5ff 0%, #cedaeb 58%, #b5c3d8 100%);
  border: 2px solid rgba(91, 114, 145, 0.38);
  border-radius: 15px;
  box-shadow:
    0 9px 14px rgba(40, 62, 96, 0.34),
    inset 0 -8px 12px rgba(112, 133, 164, 0.2);
  height: 50px;
  left: 50%;
  position: absolute;
  top: 8px;
  transform: translateX(-50%);
  width: 84px;
}

.playground-robot-top::after {
  background:
    radial-gradient(circle at 20% 50%, #9ae7ff 0 24%, transparent 25%) 0 0 / 9px 9px,
    linear-gradient(180deg, #204b9b 0%, #17356f 100%);
  border: 1px solid rgba(26, 61, 120, 0.55);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(155, 224, 255, 0.3);
  content: '';
  height: 16px;
  left: 50%;
  position: absolute;
  top: 7px;
  transform: translateX(-50%);
  width: 36px;
}

.playground-robot-top::before {
  background: linear-gradient(160deg, #50b8d8 0%, #2b87a9 100%);
  border: 1px solid rgba(45, 120, 143, 0.42);
  border-radius: 6px;
  box-shadow: 0 4px 7px rgba(28, 84, 102, 0.25);
  content: '';
  height: 18px;
  position: absolute;
  right: -13px;
  top: 20px;
  width: 22px;
}

.playground-wheel {
  background: linear-gradient(180deg, #233044 0%, #111a28 100%);
  border: 1px solid rgba(10, 17, 28, 0.65);
  border-radius: 9px;
  box-shadow: 0 4px 7px rgba(9, 15, 24, 0.35);
  height: 44px;
  position: absolute;
  top: 12px;
  width: 13px;
}

.playground-wheel.wheel-left {
  left: 8px;
}

.playground-wheel.wheel-right {
  right: 8px;
}

.playground-camera-controls {
  bottom: 14px;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  left: 14px;
  position: absolute;
  z-index: 7;
}

.playground-quick-row {
  align-items: flex-end;
  display: inline-flex;
  flex: 0 0 100%;
  gap: 10px;
}

.playground-quick-controls {
  display: grid;
  gap: 8px;
  grid-template-columns: 50px;
}

.playground-quick-button {
  align-items: center;
  background: #c89a34;
  border: 1px solid rgba(77, 54, 10, 0.35);
  border-radius: 4px;
  color: #0b0f16;
  cursor: pointer;
  display: inline-flex;
  font-size: 2rem;
  font-weight: 900;
  height: 52px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 50px;
}

.playground-quick-button:hover,
.playground-quick-button:focus {
  background: #d9ac45;
  box-shadow: none;
  outline: none;
}

.playground-quick-button:active,
.playground-quick-button.is-active {
  background: #b8861d;
}

.playground-quick-timer {
  align-items: center;
  background: #eceef2;
  border: 2px solid rgba(31, 37, 48, 0.45);
  border-radius: 9px;
  color: #111214;
  display: inline-flex;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 2.05rem;
  font-variant-numeric: tabular-nums;
  height: 56px;
  letter-spacing: 1px;
  line-height: 1;
  min-width: 178px;
  padding: 0 14px;
}

.playground-camera-button {
  background: rgba(12, 29, 54, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: #e9f3ff;
  cursor: pointer;
  font-size: 0.79rem;
  font-weight: 700;
  min-height: 30px;
  min-width: 66px;
  padding: 0 12px;
}

.playground-camera-button:hover,
.playground-camera-button:focus {
  background: rgba(17, 38, 68, 0.95);
  box-shadow: none;
  outline: none;
}

.playground-camera-button.active {
  background: #ffffff;
  border-color: rgba(35, 62, 105, 0.34);
  color: #223c67;
}

.playground-motion-controls {
  bottom: 12px;
  display: grid;
  gap: 8px;
  grid-template-areas:
    '. forward .'
    'left . right'
    '. backward .';
  grid-template-columns: 44px 44px 44px;
  grid-template-rows: 44px 44px 44px;
  position: absolute;
  right: 14px;
  z-index: 7;
}

.playground-motion-button {
  align-items: center;
  background: rgba(12, 29, 54, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  color: #e9f3ff;
  cursor: pointer;
  display: inline-flex;
  font-size: 1.1rem;
  font-weight: 800;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

.playground-motion-button:hover,
.playground-motion-button:focus {
  background: rgba(17, 38, 68, 0.95);
  box-shadow: none;
  outline: none;
}

.playground-motion-button:active,
.playground-motion-button.is-active {
  background: #ffffff;
  border-color: rgba(35, 62, 105, 0.34);
  color: #223c67;
}

.playground-motion-forward {
  grid-area: forward;
}

.playground-motion-left {
  grid-area: left;
}

.playground-motion-right {
  grid-area: right;
}

.playground-motion-backward {
  grid-area: backward;
}

.playground-modal-card.playground-activities-open .playground-viewport {
  inset: 0;
}

.playground-modal-card.playground-activities-open .playground-camera-controls {
  bottom: 14px;
  left: 14px;
}

.playground-modal-card.playground-activities-open .playground-motion-controls {
  bottom: 12px;
  right: 14px;
}

.playground-viewport.camera-top {
  --camera-tilt: 76deg;
  --camera-spin: 0deg;
  --camera-distance: -10px;
}

.playground-viewport.camera-view1 {
  --camera-tilt: 58deg;
  --camera-spin: -28deg;
  --camera-distance: 0px;
}

.playground-viewport.camera-view3 {
  --camera-tilt: 57deg;
  --camera-spin: 34deg;
  --camera-distance: 3px;
}

.share-modal {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 132;
}

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

.share-modal-backdrop {
  background: rgba(20, 30, 48, 0.52);
  border: 0;
  border-radius: 0;
  inset: 0;
  margin: 0;
  min-height: 100vh;
  min-width: 100vw;
  padding: 0;
  position: absolute;
  width: 100%;
}

.share-modal-card {
  background: #ffffff;
  border: 1px solid #d6dce8;
  border-radius: 7px;
  box-shadow: 0 22px 44px rgba(10, 20, 36, 0.35);
  display: flex;
  flex-direction: column;
  max-width: min(1020px, calc(100vw - 48px));
  min-height: 420px;
  position: relative;
  width: min(1020px, calc(100vw - 48px));
  z-index: 1;
}

.share-modal-header {
  align-items: center;
  border-bottom: 1px solid #d8deea;
  display: flex;
  justify-content: space-between;
  min-height: 74px;
  padding: 0 24px;
}

.share-modal-title {
  color: #1f2530;
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.2;
}

.share-modal-close {
  align-items: center;
  background: #1d232d;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font-size: 2.1rem;
  font-weight: 300;
  height: 40px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 40px;
}

.share-modal-close:hover,
.share-modal-close:focus {
  background: #10151d;
  box-shadow: none;
  outline: none;
}

.share-modal-body {
  display: flex;
  flex: 1 1 auto;
  gap: 18px;
  padding: 20px 24px 10px;
}

.share-modal-left {
  flex: 0 0 260px;
}

.share-thumbnail-shell {
  align-items: center;
  background: #0f1320;
  border: 1px solid #d4dbe7;
  border-radius: 16px;
  display: flex;
  height: 188px;
  justify-content: center;
  overflow: hidden;
  width: 100%;
}

.share-thumbnail-image {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.share-thumbnail-update {
  background: transparent;
  border: 0;
  color: #2f6ad5;
  cursor: pointer;
  font-size: 1.03rem;
  margin-top: 12px;
  padding: 0;
}

.share-thumbnail-update:hover,
.share-thumbnail-update:focus {
  box-shadow: none;
  outline: none;
  text-decoration: underline;
}

.share-modal-right {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.share-project-title-label {
  color: #242c39;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.share-project-title-input {
  background: #ffffff;
  border: 1px solid #cfd7e6;
  border-radius: 3px;
  color: #1f2937;
  font-size: 1.03rem;
  height: 50px;
  padding: 0 10px;
  width: 100%;
}

.share-project-title-input:focus {
  border-color: #6f8bde;
  box-shadow: 0 0 0 2px rgba(63, 86, 207, 0.2);
  outline: none;
}

.share-modal-footer {
  align-items: center;
  display: flex;
  justify-content: flex-end;
  min-height: 88px;
  padding: 0 24px 20px;
}

.share-modal-submit {
  background: linear-gradient(180deg, #7346e3 0%, #5e30d3 100%);
  border: 1px solid #532ec1;
  border-radius: 4px;
  color: #ffffff;
  cursor: pointer;
  font-size: 1.03rem;
  font-weight: 700;
  height: 52px;
  min-width: 172px;
  padding: 0 18px;
}

.share-modal-submit:hover,
.share-modal-submit:focus {
  background: linear-gradient(180deg, #6437d9 0%, #5128c0 100%);
  box-shadow: none;
  outline: none;
}

@media (max-width: 920px) {
  .share-modal-card {
    min-height: 0;
    width: min(1020px, calc(100vw - 20px));
  }

  .share-modal-title {
    font-size: 1.45rem;
  }

  .share-modal-body {
    flex-direction: column;
  }

  .share-modal-left {
    flex: 0 0 auto;
    max-width: 280px;
  }

  .share-modal-footer {
    justify-content: flex-start;
  }
}

.help-tour {
  align-items: flex-start;
  display: flex;
  inset: 0;
  justify-content: flex-start;
  position: fixed;
  z-index: 140;
}

.help-tour[hidden] {
  display: none;
}

.help-tour-backdrop {
  background: rgba(17, 22, 28, 0.42);
  border: 0;
  border-radius: 0;
  inset: 0;
  margin: 0;
  min-height: 100vh;
  min-width: 100vw;
  padding: 0;
  position: absolute;
  width: 100%;
}

.help-tour-highlight {
  border: 3px solid rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  box-shadow: 0 0 0 8px rgba(63, 86, 207, 0.34), 0 10px 24px rgba(0, 0, 0, 0.38);
  display: none;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

.help-tour-highlight.is-visible {
  display: block;
}

.help-tour-popover {
  background: #3e57cf;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 12px;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.35);
  color: #ffffff;
  max-width: min(440px, calc(100vw - 32px));
  min-width: 320px;
  padding: 14px 14px 12px;
  position: absolute;
  width: min(440px, calc(100vw - 32px));
  z-index: 3;
}

.help-tour-close {
  align-items: center;
  background: transparent;
  border: 0;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font-size: 2rem;
  font-weight: 300;
  height: 30px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 8px;
  top: 6px;
  width: 30px;
}

.help-tour-close:hover,
.help-tour-close:focus {
  box-shadow: none;
  color: #e7eeff;
  outline: none;
}

.help-tour-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  margin: 2px 34px 10px 2px;
}

.help-tour-body {
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.34;
  margin: 0 2px 12px;
  white-space: pre-line;
}

.help-tour-footer {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.help-tour-step {
  color: #f1f4ff;
  font-size: 1.06rem;
  font-weight: 600;
  min-width: 84px;
}

.help-tour-actions {
  display: inline-flex;
  gap: 8px;
}

.help-tour-button {
  background: rgba(255, 255, 255, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  font-size: 1.02rem;
  font-weight: 600;
  min-width: 70px;
  padding: 6px 14px;
}

.help-tour-button:hover,
.help-tour-button:focus {
  background: rgba(255, 255, 255, 0.34);
  box-shadow: none;
  outline: none;
}

.help-tour-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.help-tour-button-primary {
  background: #e7eeff;
  border-color: #e7eeff;
  color: #2f49c7;
}

.help-tour-button-primary:hover,
.help-tour-button-primary:focus {
  background: #f4f7ff;
}

.help-tour-arrow {
  background: #3e57cf;
  border: 2px solid rgba(255, 255, 255, 0.85);
  display: block;
  height: 16px;
  position: absolute;
  transform: rotate(45deg);
  width: 16px;
}

.help-tour-popover.arrow-top .help-tour-arrow {
  left: 32px;
  top: -10px;
}

.help-tour-popover.arrow-bottom .help-tour-arrow {
  bottom: -10px;
  left: 32px;
}

.help-tour-popover.arrow-left .help-tour-arrow {
  left: -10px;
  top: 48px;
}

.help-tour-popover.arrow-right .help-tour-arrow {
  right: -10px;
  top: 48px;
}

.help-tour-popover.arrow-none .help-tour-arrow {
  display: none;
}

.help-tour-target {
  border-radius: 10px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.95), 0 0 0 8px rgba(63, 86, 207, 0.34);
  position: relative;
  z-index: 141 !important;
}

.help-tour-confetti {
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.help-tour-confetti-piece {
  animation: helpTourConfettiFall 1.8s ease-in forwards;
  border-radius: 2px;
  display: block;
  height: 10px;
  opacity: 0;
  position: absolute;
  top: -12px;
  width: 8px;
}

@keyframes helpTourConfettiFall {
  0% {
    opacity: 0;
    transform: translateY(0) rotate(0deg);
  }
  12% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(72vh) rotate(430deg);
  }
}

body.help-tour-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .help-tour-popover {
    min-width: 0;
    width: min(94vw, 440px);
  }
}

button {
  background-color: #eee;
  border: 1px solid #ddd;
  border-radius: 4px;
  color: #000;
  margin: 0;
  padding: 6px 10px;
}

button.ble-button {
  align-items: center;
  background-color: #e6eef8;
  border-color: #b6c7d8;
  color: #0b3d66;
  display: inline-flex;
  justify-content: center;
  padding: 6px;
}

button.ble-button svg {
  height: 16px;
  width: 16px;
  fill: currentColor;
}

button.ble-button.active {
  background-color: #1e88e5;
  border-color: #1e88e5;
  color: #fff;
  box-shadow: 0 0 10px rgba(30, 136, 229, 0.6);
}

button.ble-button.connected {
  background-color: #2c7a43;
  border-color: #2c7a43;
  color: #fff;
  box-shadow: 0 0 10px rgba(44, 122, 67, 0.6);
}

button.primary {
  background-color: #2c7a43;
  border-color: #2c7a43;
  color: #fff;
}

button.primary > img {
  opacity: 1;
}

button > img {
  opacity: 0.7;
  vertical-align: text-bottom;
}

button:hover > img {
  opacity: 1;
}

button:hover {
  box-shadow: 2px 2px 5px #888;
}

button:active {
  border-color: #888 !important;
}

button.notext {
  font-size: 10%;
}

button:disabled {
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.6;
}

.icon21 {
  height: 21px;
  width: 21px;
  background-image: url(../assets/icons.png);
}

.trash {
  background-position: 0px 0px;
}

.run {
  background-position: -42px 0px;
}

@media (max-width: 900px) {
  .main {
    flex-direction: column;
  }

  .bottom-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .toolbar-left {
    order: 1;
  }

  .toolbar-center {
    flex: 1 1 auto;
    margin-left: 0;
    min-width: 0;
    order: 2;
  }

  .toolbar-center .toolbar-project {
    flex: 1 1 140px;
    max-width: none;
    min-width: 110px;
  }

  .toolbar-right {
    flex: 1 1 100%;
    justify-content: flex-end;
    margin-left: 0;
    min-width: 0;
    order: 3;
  }

  .workspace-tools {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .workspace-tools::-webkit-scrollbar {
    display: none;
  }

  .workspace-run-controls {
    flex: 0 0 auto;
    margin-left: 8px;
  }

  .left-column {
    flex: 0 0 auto;
  }

  .simulator-pane {
    flex: 0 0 auto;
  }

  .run-control-button {
    height: 42px;
    width: 42px;
  }

  .run-control-stop-icon {
    height: 12px;
    width: 12px;
  }

  .run-control-play-icon {
    height: 16px;
    width: 16px;
  }
}

@media (max-width: 1100px) {
  .title-row {
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .controls {
    flex: 1 1 auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    margin-left: 0;
    min-width: 0;
    width: auto;
  }

  .header-pill {
    width: 200px;
  }

  .header-action-label {
    display: none;
  }

  .header-action-button {
    align-items: center;
    gap: 0;
    justify-content: center;
    min-width: 30px;
    padding: 0;
    width: 30px;
  }

  .header-action-button-select {
    background: rgba(255, 255, 255, 0.12);
  }

  .header-action-button svg {
    display: block;
    flex: 0 0 auto;
    height: 15px;
    margin: 0;
    stroke-width: 2;
    width: 15px;
  }
}

@media (max-width: 980px) {
  .brand-text {
    display: none;
  }

  .brand-logo {
    height: 30px;
    max-width: 120px;
    padding: 3px 5px;
  }
}

@media (max-width: 820px) {
  .header {
    padding: 4px 8px;
  }

  .brand {
    display: none;
  }

  .controls {
    align-items: center;
    flex-wrap: nowrap;
    gap: 4px;
    justify-content: flex-end;
    margin-left: 0;
    min-width: 0;
    width: auto;
  }

  .header-pill {
    left: 50%;
    margin: 0;
    order: 0;
    height: 34px;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 188px;
  }

  .header-pill-tab {
    font-size: 0.82rem;
  }

  .header-quick-actions {
    margin-left: auto;
    order: 0;
    gap: 0;
    padding: 3px;
    flex-wrap: nowrap;
    overflow: visible;
  }

  .header-icon-button {
    height: 30px;
    width: 30px;
  }

  .header-action-label {
    display: none;
  }

  .header-action-button {
    gap: 0;
    height: 30px;
    padding: 0;
    width: 30px;
  }

  .header-signin-button {
    order: 0;
    gap: 6px;
    height: 30px;
    padding: 0 9px;
  }

  #headerSignInLabel {
    font-size: 0.88rem;
  }
}

@media (max-width: 640px) {
  .header-pill {
    width: 148px;
    height: 32px;
  }

  .header-pill-tab {
    font-size: 0.78rem;
    height: 28px;
    line-height: 28px;
  }

  .header-action-button-select,
  #headerPlaygroundButton {
    display: none;
  }

  #headerSignInLabel {
    display: none;
  }

  .header-signin-button {
    gap: 0;
    min-width: 30px;
    padding: 0;
    width: 30px;
  }

  .header-quick-actions {
    max-width: none;
    overflow: visible;
  }

  .header-action-label {
    display: none;
  }

  .header-action-button {
    align-items: center;
    gap: 0;
    justify-content: center;
    padding: 0;
    width: 30px;
  }

  .header-icon-button,
  .header-action-button {
    height: 28px;
    width: 28px;
  }

  .header-action-button svg {
    height: 14px;
    width: 14px;
  }

  .toolbar-right .workspace-tool-collapsible,
  .toolbar-right .workspace-tool-divider.workspace-tool-collapsible,
  .toolbar-right .workspace-tool-toggle {
    display: none;
  }
}

@media (max-width: 920px) {
  .playground-select-card {
    max-height: calc(100vh - 12px);
    max-width: calc(100vw - 12px);
    width: calc(100vw - 12px);
  }

  .playground-select-header {
    min-height: 58px;
    padding: 0 10px;
  }

  .playground-select-back-button {
    font-size: 1.2rem;
    min-width: 0;
    padding: 0 8px;
  }

  .playground-select-close-button {
    font-size: 1.55rem;
    height: 34px;
    width: 34px;
  }

  .playground-select-grid {
    gap: 12px;
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .playground-select-thumb {
    height: clamp(120px, 32vw, 190px);
  }

  .playground-select-item-name {
    font-size: 1.15rem;
  }

  .playground-modal-card {
    max-width: calc(100vw - 10px);
    max-height: calc(100vh - 10px);
    min-height: calc(100vh - 10px);
    height: calc(100vh - 10px);
    width: calc(100vw - 10px);
  }

  .playground-modal-header {
    min-height: 56px;
    padding: 0 12px;
  }

  .playground-modal.playground-floating-bar .playground-modal-card.playground-body-hidden {
    left: 8px;
    top: 44px;
    width: min(640px, calc(100vw - 16px));
  }

  .playground-modal.playground-floating-bar .playground-modal-card {
    left: 8px;
    max-height: min(640px, calc(100vh - 52px));
    max-width: min(640px, calc(100vw - 16px));
    top: 44px;
    width: min(640px, calc(100vw - 16px));
  }

  .playground-modal.playground-floating-bar .playground-modal-card.playground-body-hidden.playground-shrunk {
    width: min(520px, calc(100vw - 16px));
  }

  .playground-header-tools {
    gap: 6px;
    margin-left: 4px;
  }

  .playground-header-tool {
    font-size: 0.72rem;
    gap: 4px;
    height: 30px;
    padding: 0 7px;
  }

  .playground-header-tool svg {
    height: 14px;
    width: 14px;
  }

  .playground-camera-controls {
    bottom: 10px;
    left: 10px;
  }

  .playground-quick-controls {
    grid-template-columns: 44px;
  }

  .playground-quick-button {
    font-size: 1.7rem;
    height: 42px;
    width: 44px;
  }

  .playground-quick-timer {
    font-size: 1.5rem;
    height: 44px;
    min-width: 132px;
    padding: 0 10px;
  }

  .playground-motion-controls {
    bottom: 10px;
    right: 10px;
    transform: scale(0.92);
    transform-origin: right bottom;
  }

  .playground-camera-button {
    min-width: 58px;
    padding: 0 9px;
  }

  .playground-activities-panel {
    left: 60px;
    right: 10px;
    top: 10px;
  }

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

  .playground-modal-card.playground-activities-open .playground-viewport {
    inset: 0;
  }
}

@media (max-width: 520px) {
  .header {
    padding: 3px 6px;
  }

  .header-pill {
    width: 112px;
    height: 28px;
  }

  .header-pill-tab {
    font-size: 0.72rem;
    height: 24px;
    line-height: 24px;
    gap: 4px;
  }

  .header-pill-tab-icon {
    display: inline-block;
    font-size: 11px;
  }

  .header-pill-tab-label {
    display: none;
  }

  .header-quick-actions {
    padding: 2px;
  }

  .header-icon-button,
  .header-signin-button {
    height: 26px;
    min-width: 26px;
    width: 26px;
  }

  .header-action-button {
    height: 26px;
    min-width: 26px;
    width: 26px;
  }

  .header-action-button svg {
    height: 13px;
    width: 13px;
  }
}

/*
 * Global scale mode: keep full desktop layout, but scale UI to 0.8x.
 */
body.page-scale-mode {
  overflow: hidden;
}

body.page-scale-mode .page {
  min-height: 100%;
  width: 100%;
  zoom: var(--snap-scale-factor, 0.8);
}

@supports not (zoom: 1) {
  body.page-scale-mode .page {
    min-height: 100%;
    transform: scale(var(--snap-scale-factor, 0.8));
    transform-origin: top left;
    width: calc(100% / var(--snap-scale-factor, 0.8));
  }
}

/*
 * Legacy snap-left fallback (compact layout rules).
 */
body.snap-scale-mode {
  overflow: hidden;
}

body.snap-scale-mode .page {
  min-height: 100%;
  width: 100%;
  zoom: var(--snap-scale-factor, 0.8);
}

body.snap-scale-mode .header {
  padding: 4px 8px;
}

body.snap-scale-mode .title-row {
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
}

body.snap-scale-mode .brand {
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
}

body.snap-scale-mode .brand-logo {
  border-radius: 6px;
  display: block;
  height: 20px;
  max-width: 110px;
  padding: 2px 4px;
}

body.snap-scale-mode .controls {
  align-items: center;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  gap: 4px;
  justify-content: flex-end;
  margin-left: 0;
  min-height: 32px;
  min-width: 0;
  padding-right: 0;
  position: relative;
  width: auto;
}

body.snap-scale-mode .header-pill {
  height: 30px;
  left: 50%;
  margin: 0;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 170px;
}

body.snap-scale-mode .header-pill-tab {
  font-size: 0.8rem;
  height: 26px;
  line-height: 26px;
}

body.snap-scale-mode .header-quick-actions {
  align-items: center;
  gap: 0;
  margin-left: auto;
  padding: 2px;
}

body.snap-scale-mode .header-icon-button {
  height: 28px;
  width: 28px;
}

body.snap-scale-mode .header-action-label {
  display: none;
}

body.snap-scale-mode .header-action-button {
  gap: 0;
  height: 28px;
  padding: 0;
  width: 28px;
}

body.snap-scale-mode .header-signin-button {
  align-items: center;
  gap: 0;
  height: 28px;
  margin-left: 4px;
  min-width: 28px;
  padding: 0;
  width: 28px;
}

body.snap-scale-mode #headerSignInLabel {
  display: none;
}

body.snap-scale-mode .main {
  flex-direction: row;
}

body.snap-scale-mode .left-column {
  flex: 0 0 var(--left-column-width, 280px);
}

body.snap-scale-mode .workspace-stack {
  flex: 1 1 auto;
  --toolbox-footer-height: 62px;
}

body.snap-scale-mode .bottom-toolbar {
  align-items: center;
  bottom: 0;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 6px 8px;
  position: sticky;
  z-index: 55;
}

body.snap-scale-mode .toolbar-left,
body.snap-scale-mode .toolbar-center,
body.snap-scale-mode .toolbar-right {
  gap: 6px;
}

body.snap-scale-mode .toolbar-center {
  flex: 1 1 auto;
  margin-left: 0;
  min-width: 0;
}

body.snap-scale-mode .toolbar-center .toolbar-project {
  max-width: none;
  min-width: 120px;
  width: 100%;
}

body.snap-scale-mode .toolbar-right {
  flex: 0 0 auto;
  margin-left: auto;
  width: auto;
}

body.snap-scale-mode .workspace-tools {
  flex: 0 0 auto;
  min-width: 0;
  width: auto;
}

body.snap-scale-mode .workspace-tool-collapsible {
  display: inline-flex;
}

body.snap-scale-mode .workspace-tool-divider.workspace-tool-collapsible {
  display: block;
}

body.snap-scale-mode .workspace-tool-toggle {
  display: inline-flex;
}

body.snap-scale-mode .workspace-tool-button {
  height: 36px;
  width: 40px;
}

body.snap-scale-mode .workspace-tool-divider {
  height: 20px;
}

body.snap-scale-mode .run-controls {
  gap: 8px;
}

body.snap-scale-mode .run-controls .run-control-button {
  height: 36px;
  width: 36px;
}

body.snap-scale-mode .toolbox-footer {
  align-items: center;
  gap: 6px;
  left: 0;
  padding: 6px 8px 8px;
  right: 0;
}

body.snap-scale-mode .toolbox-footer-icon-button {
  border-radius: 10px;
  height: 34px;
  width: 34px;
}

body.snap-scale-mode #toolboxExtensionsButton {
  border-radius: 10px;
  height: 36px;
  width: 36px;
}

body.snap-scale-mode .toolbox-footer-icon-button svg {
  height: 20px;
  width: 20px;
}

body.snap-scale-mode #toolboxExtensionsButton svg {
  height: 22px;
  width: 22px;
}

body.snap-scale-mode .toolbox-footer-board-button {
  align-items: center;
  align-self: center;
  display: inline-flex;
  gap: 6px;
  height: 30px;
  justify-content: center;
  line-height: 1;
  max-width: 100%;
  min-height: 30px;
  min-width: 0;
  overflow: hidden;
  padding: 0 8px;
  width: auto;
}

body.snap-scale-mode .toolbox-footer-board-anchor {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 0;
}

body.snap-scale-mode .toolbox-footer-board-handle {
  align-items: center;
  display: inline-flex;
  height: 14px;
  line-height: 1;
  width: 14px;
}

body.snap-scale-mode .toolbox-footer-board-handle svg {
  height: 14px;
  width: 14px;
}

body.snap-scale-mode .toolbox-footer-board-label {
  align-items: center;
  display: inline-flex;
  font-size: 12px;
  height: 100%;
  line-height: 1;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.snap-scale-mode .toolbox-mode-tabs {
  gap: 4px;
  padding: 5px 6px;
}

body.snap-scale-mode .toolbox-mode-tab {
  font-size: 0.72rem;
  min-height: 22px;
  min-width: 72px;
  padding: 0 8px;
}

@supports not (zoom: 1) {
  body.snap-scale-mode .page {
    min-height: 100%;
    transform: scale(var(--snap-scale-factor, 0.8));
    transform-origin: top left;
    width: 100%;
  }
}

.blocks-body > .bottom-toolbar.workspace-overlay-toolbar {
  background: transparent !important;
  border: 0 !important;
  bottom: 8px !important;
  box-sizing: border-box;
  display: block !important;
  height: 104px !important;
  left: var(--workspace-overlay-left, calc(var(--toolbox-width, 220px) + 24px)) !important;
  margin: 0 !important;
  overflow: visible !important;
  padding: 0 !important;
  pointer-events: none;
  position: absolute !important;
  right: 28px !important;
  top: auto !important;
  width: auto !important;
  z-index: 75;
}

.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .toolbar-left,
.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .toolbar-right,
.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .workspace-tools,
.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .workspace-run-controls {
  pointer-events: auto;
}

.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .toolbar-center {
  display: none !important;
}

.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .toolbar-left {
  display: none !important;
}

.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .toolbar-primary {
  display: none !important;
}

.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .toolbar-menu {
  bottom: calc(100% + 12px);
  left: auto;
  right: 0;
}

.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .toolbar-right {
  display: contents !important;
}

.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .workspace-tools {
  background: transparent;
  border: 0;
  bottom: 0 !important;
  box-shadow: none;
  gap: 12px;
  left: 0 !important;
  position: absolute !important;
  top: auto !important;
}

.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .workspace-tool-button {
  border-radius: 999px;
  color: #777777;
  height: 48px;
  width: 48px;
}

.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .workspace-tool-button:hover,
.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .workspace-tool-button:focus {
  background: rgba(0, 0, 0, 0.05);
}

.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .workspace-tool-divider {
  display: none !important;
}

.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .workspace-tool-icon {
  height: 32px;
  width: 32px;
}

.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .workspace-run-controls {
  bottom: 0 !important;
  gap: 10px;
  position: absolute !important;
  right: 0 !important;
  top: auto !important;
}

.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .workspace-run-controls > .toolbar-dot {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: #777777;
  display: inline-flex;
  flex: 0 0 auto;
  height: 64px;
  justify-content: center;
  min-width: 64px;
  padding: 0;
  position: relative;
  width: 64px;
}

.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .workspace-run-controls > .toolbar-dot:hover,
.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .workspace-run-controls > .toolbar-dot:focus {
  background: rgba(0, 0, 0, 0.05);
  box-shadow: none;
  outline: none;
}

.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .workspace-run-controls > .toolbar-dot::before {
  content: none;
}

.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .workspace-run-controls > .toolbar-dot .toolbar-dot-label {
  display: none;
}

.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .workspace-run-controls > .toolbar-dot .toolbar-dot-arrow {
  display: inline-block;
  height: 14px;
  margin-left: 4px;
  width: 14px;
}

.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .workspace-run-controls > .toolbar-dot .toolbar-dot-arrow::before {
  border-bottom: 3px solid currentColor;
  border-right: 3px solid currentColor;
  content: "";
  display: block;
  height: 9px;
  transform: rotate(-135deg);
  width: 9px;
}

.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .run-controls .run-control-button {
  background: #b9b9b9;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  height: 72px;
  width: 72px;
}

.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .run-control-stop-icon {
  height: 22px;
  width: 22px;
}

.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .run-control-play-icon {
  height: 28px;
  width: 28px;
}

.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .program-slot-button {
  color: #777777;
  gap: 4px;
}

.program-slot-matrix {
  display: grid;
  flex: 0 0 auto;
  gap: 3px;
  grid-template-columns: repeat(5, 5px);
  grid-template-rows: repeat(5, 5px);
}

.program-slot-led {
  background: rgba(119, 119, 119, 0.28);
  display: block;
  height: 5px;
  width: 5px;
}

.program-slot-led.is-on {
  background: #777777;
}

.program-slot-matrix-large {
  gap: 5px;
  grid-template-columns: repeat(5, 8px);
  grid-template-rows: repeat(5, 8px);
}

.program-slot-matrix-large .program-slot-led {
  height: 8px;
  width: 8px;
}

.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .program-slot-menu {
  align-items: stretch;
  background: #ffffff;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
  gap: 0;
  height: 210px;
  max-height: none;
  min-width: 0;
  overflow: visible;
  padding: 24px 26px;
  width: 360px;
  z-index: 95;
}

.program-slot-menu-title {
  color: #747474;
  font-size: 1.18rem;
  font-weight: 500;
  line-height: 1;
  text-align: center;
}

.program-slot-menu-body {
  align-items: center;
  display: flex;
  flex: 1;
  gap: 30px;
  justify-content: center;
  position: relative;
}

.program-slot-nav-button,
.program-slot-download-button {
  align-items: center;
  background: transparent;
  border: 0;
  color: #7f7f7f;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  padding: 0;
}

.program-slot-nav-button {
  height: 56px;
  width: 56px;
}

.program-slot-nav-button svg {
  fill: none;
  height: 42px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  width: 42px;
}

.program-slot-nav-button:disabled {
  cursor: default;
  opacity: 0.3;
}

.program-slot-device {
  border: 4px solid #7f7f7f;
  border-radius: 14px;
  box-sizing: border-box;
  height: 104px;
  position: relative;
  width: 72px;
}

.program-slot-device .program-slot-matrix {
  left: 50%;
  position: absolute;
  top: 30px;
  transform: translateX(-50%);
}

.program-slot-device.is-slot-sliding > #programSlotMenuMatrix {
  visibility: hidden;
}

.program-slot-device .program-slot-matrix-slide {
  left: 50%;
  pointer-events: none;
  position: absolute;
  top: 30px;
  transform: translateX(-50%);
  will-change: opacity, transform;
}

.program-slot-device.is-slot-slide-next .program-slot-matrix-slide-current {
  animation: programSlotMatrixOutLeft 180ms ease-in forwards;
}

.program-slot-device.is-slot-slide-next .program-slot-matrix-slide-next {
  animation: programSlotMatrixInRight 180ms ease-out forwards;
}

.program-slot-device.is-slot-slide-prev .program-slot-matrix-slide-current {
  animation: programSlotMatrixOutRight 180ms ease-in forwards;
}

.program-slot-device.is-slot-slide-prev .program-slot-matrix-slide-next {
  animation: programSlotMatrixInLeft 180ms ease-out forwards;
}

@keyframes programSlotMatrixOutLeft {
  from {
    opacity: 1;
    transform: translateX(-50%);
  }
  to {
    opacity: 0;
    transform: translateX(calc(-50% - 34px));
  }
}

@keyframes programSlotMatrixInRight {
  from {
    opacity: 0;
    transform: translateX(calc(-50% + 34px));
  }
  to {
    opacity: 1;
    transform: translateX(-50%);
  }
}

@keyframes programSlotMatrixOutRight {
  from {
    opacity: 1;
    transform: translateX(-50%);
  }
  to {
    opacity: 0;
    transform: translateX(calc(-50% + 34px));
  }
}

@keyframes programSlotMatrixInLeft {
  from {
    opacity: 0;
    transform: translateX(calc(-50% - 34px));
  }
  to {
    opacity: 1;
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .program-slot-device .program-slot-matrix-slide {
    animation: none !important;
  }
}

.program-slot-device-dot {
  background: #7f7f7f;
  border-radius: 999px;
  height: 9px;
  position: absolute;
  right: 10px;
  top: 10px;
  width: 9px;
}

.program-slot-device-button {
  border: 4px solid #7f7f7f;
  border-radius: 999px;
  bottom: 9px;
  box-sizing: border-box;
  height: 22px;
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  width: 22px;
}

.program-slot-menu-value {
  height: 1px;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.program-slot-download-button {
  bottom: 0;
  height: 36px;
  position: absolute;
  right: 0;
  width: 36px;
}

.program-slot-download-button svg {
  fill: none;
  height: 31px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 31px;
}

.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .run-start-button.is-ready,
.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .run-start-button.is-running {
  background: #1fb55f;
}

.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .run-stop-button.is-running,
.blocks-body > .bottom-toolbar.workspace-overlay-toolbar .run-stop-button.is-running:disabled {
  background: #ff1c24;
}

.blocks-body .workspace-connect {
  bottom: auto !important;
  flex-direction: column !important;
  gap: 6px !important;
  right: 22px !important;
  top: 16px !important;
  z-index: 90;
}

.blocks-body .workspace-connect::after {
  content: none !important;
}

.blocks-body .workspace-connect-label {
  display: block !important;
}

.blocks-body .workspace-connect-button.state-disconnected {
  background: #3f56cf;
  border-color: #3248b9;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  color: #ffffff;
}

.blocks-body .workspace-connect-button.state-usb {
  background: #ffffff;
  border-color: #3f56cf;
  color: #3f56cf;
}

.blocks-body .workspace-connect-button.state-ble {
  background: #ffffff;
  border-color: #3f56cf;
  color: #3f56cf;
  box-shadow:
    0 0 0 4px rgba(63, 86, 207, 0.28),
    0 4px 10px rgba(0, 0, 0, 0.2);
}

body.app-theme-light .log-panel {
  background: #f5f8ff;
  border-color: #cfd8ea;
  color: #24344f;
}

body.app-theme-light .log-panel summary {
  color: #223351;
}

body.app-theme-light #serialLog {
  background: #ffffff;
  border-top: 1px solid #d6deee;
  border-bottom: 1px solid #d6deee;
  color: #1f2e49;
}

body.app-theme-light .serial-status-row {
  background: #eff3fb;
  border-top: 1px solid #d6deee;
}

body.app-theme-light .serial-status-inline,
body.app-theme-light #serialStatus,
body.app-theme-light .status {
  color: #304764;
}

body.app-theme-dark {
  background: #0d1117;
  color: #e6edf3;
}

body.app-theme-dark .header,
body.app-theme-dark .header-quick-actions,
body.app-theme-dark .project-tabs-global,
body.app-theme-dark .project-tabs-bar,
body.app-theme-dark .project-tab-options-menu,
body.app-theme-dark .main,
body.app-theme-dark .pane,
body.app-theme-dark .pane-header,
body.app-theme-dark .pane-body,
body.app-theme-dark .bottom-toolbar {
  background: #111827;
  border-color: #2b3649;
  color: #e6edf3;
}

body.app-theme-dark .header-signin-button,
body.app-theme-dark .project-tab,
body.app-theme-dark .toolbar-project,
body.app-theme-dark .workspace-tools,
body.app-theme-dark .header-settings-menu,
body.app-theme-dark .simulator-color-card,
body.app-theme-dark .workspace-connect-modal-card,
body.app-theme-dark .workspace-device-panel-card,
body.app-theme-dark .theme-modal-card,
body.app-theme-dark .playground-modal-card,
body.app-theme-dark .share-modal-card {
  background: #1f2937;
  border-color: #374151;
  color: #e6edf3;
}

body.app-theme-dark .header-action-button {
  background: rgba(255, 255, 255, 0.08);
}

body.app-theme-dark .header-action-button-select {
  background: rgba(40, 144, 244, 0.24);
}

body.app-theme-dark .playground-select-card {
  background: #1b2431;
  border-color: #334155;
}

body.app-theme-dark .playground-select-item {
  background: #0f1724;
  border-color: #314257;
}

body.app-theme-dark .playground-select-item-footer {
  background: #162232;
}

body.app-theme-dark .playground-select-item-name {
  color: #e7eef9;
}

body.app-theme-dark .playground-modal-header {
  background: linear-gradient(90deg, #1a2940 0%, #18334b 100%);
  border-bottom-color: #334155;
}

body.app-theme-dark .playground-status {
  background: #213347;
  border-color: #3d556f;
  color: #c8daef;
}

body.app-theme-dark .playground-activities-panel {
  background: linear-gradient(180deg, rgba(18, 74, 138, 0.96) 0%, rgba(9, 54, 108, 0.96) 100%);
  border-color: rgba(95, 165, 242, 0.35);
}

body.app-theme-dark .playground-activities-grid-values {
  background: #1a2d46;
  border-color: rgba(112, 170, 240, 0.3);
}

body.app-theme-dark .playground-activities-grid-values span {
  color: #dcecff;
}

body.app-theme-dark .header-settings-toggle-track {
  background: #243247;
  border-color: #3a4d69;
}

body.app-theme-dark .header-settings-toggle-thumb {
  background: #e8eefc;
  border-color: #9bb2d8;
}

body.app-theme-dark .header-settings-toggle-text {
  color: #dbe7ff;
}

body.app-theme-dark .workspace-connect-menu-title {
  color: #f2f6ff;
}

body.app-theme-dark .workspace-connect-menu-subtitle {
  color: #c0d0ea;
}

body.app-theme-dark .workspace-connect-option {
  background: #0f172a;
  border-color: #2f405a;
  color: #e6edf3;
}

body.app-theme-dark .workspace-connect-option:hover,
body.app-theme-dark .workspace-connect-option:focus {
  background: #16243b;
  border-color: #4b6a9c;
  color: #ffffff;
}

body.app-theme-dark .workspace-connect-option.is-active {
  background: #1f3a64;
  border-color: #7ba6e8;
  box-shadow: inset 0 0 0 1px #8fb8f5;
}

body.app-theme-dark .workspace-device-panel-header {
  border-bottom-color: #374151;
}

body.app-theme-dark .workspace-device-panel-title {
  color: #f3f4f6;
}

body.app-theme-dark .workspace-device-panel-subtitle {
  color: #cbd5e1;
}

body.app-theme-dark .workspace-device-panel-close {
  color: #cbd5e1;
}

body.app-theme-dark .workspace-device-panel-close:hover,
body.app-theme-dark .workspace-device-panel-close:focus {
  color: #ffffff;
}

body.app-theme-dark .workspace-device-panel-simulator-host {
  background: #1f2937;
  border-color: #374151;
}

body.app-theme-dark .workspace-device-info-card {
  background: #273548;
  border-color: #3d4f66;
}

body.app-theme-dark .workspace-device-name,
body.app-theme-dark .workspace-device-info-value {
  color: #f3f4f6;
}

body.app-theme-dark .workspace-device-info-label {
  color: #cbd5e1;
}

body.app-theme-dark .workspace-device-rename-button {
  color: #7db9ff;
}

body.app-theme-dark .workspace-device-rename-button:hover,
body.app-theme-dark .workspace-device-rename-button:focus {
  color: #9dcbff;
}

body.app-theme-dark .workspace-disconnect-toast {
  background: #1f2937;
  border-color: #3b4b62;
}

body.app-theme-dark .workspace-disconnect-toast-icon,
body.app-theme-dark .workspace-disconnect-toast-message {
  color: #e5edf9;
}

body.app-theme-dark .workspace-disconnect-toast-actions,
body.app-theme-dark .workspace-disconnect-toast-action + .workspace-disconnect-toast-action {
  border-color: #3b4b62;
}

body.app-theme-dark .workspace-disconnect-toast-action {
  color: #8fc5ff;
}

body.app-theme-dark .workspace-disconnect-toast-action:hover,
body.app-theme-dark .workspace-disconnect-toast-action:focus {
  background: #203452;
}

body.app-theme-dark .workspace-device-rename-card {
  background: #1f2937;
  border-color: #334155;
}

body.app-theme-dark .workspace-device-rename-title {
  color: #f8fafc;
}

body.app-theme-dark .workspace-device-rename-subtitle {
  color: #cbd5e1;
}

body.app-theme-dark .workspace-device-rename-subtitle strong {
  color: #e2e8f0;
}

body.app-theme-dark .workspace-device-rename-input {
  border-bottom-color: #64748b;
  color: #f8fafc;
}

body.app-theme-dark .workspace-device-rename-input::placeholder {
  color: #94a3b8;
}

body.app-theme-dark .workspace-device-rename-input:focus {
  border-bottom-color: #60a5fa;
}

body.app-theme-dark .workspace-device-rename-cancel {
  background: #1f2937;
  border-color: #64748b;
  color: #e2e8f0;
}

body.app-theme-dark .workspace-device-rename-cancel:hover,
body.app-theme-dark .workspace-device-rename-cancel:focus {
  background: #334155;
}

body.app-theme-dark .workspace-device-rename-save {
  background: #2563eb;
  border-color: #2563eb;
}

body.app-theme-dark .workspace-device-rename-save:hover,
body.app-theme-dark .workspace-device-rename-save:focus {
  background: #1d4ed8;
}

body.app-theme-dark .simulator-board {
  background: #4b5563;
}

body.app-theme-dark .simulator-board.simulator-board-v2 {
  background: #4b5563;
}

body.app-theme-dark .simulator-board.simulator-board-v1 {
  background: #4b5563;
}

body.app-theme-dark .simulator-board.simulator-board-v3 {
  background: #2d3442;
}

body.app-theme-dark .simulator-board-picker label,
body.app-theme-dark .workspace-device-panel-board-picker label {
  color: #d7e4ff;
}

body.app-theme-dark .simulator-board-select {
  background: #0f1d36;
  border-color: #355186;
  color: #d9e6ff;
}

body.app-theme-dark .simulator-board-select:focus {
  border-color: #74a9ff;
  box-shadow: 0 0 0 2px rgba(116, 169, 255, 0.2);
}

body.app-theme-dark .simulator-sensor-panel {
  background: #4b5563;
  border-color: #6b7280;
}

body.app-theme-dark .simulator-sensor-title,
body.app-theme-dark .simulator-sensor-detected-value,
body.app-theme-dark .simulator-sensor-raw-item,
body.app-theme-dark .simulator-imu-item,
body.app-theme-dark .simulator-imu-item strong {
  color: #f3f4f6;
}

body.app-theme-dark .simulator-sensor-picker-label,
body.app-theme-dark .simulator-sensor-caption,
body.app-theme-dark .simulator-imu-title {
  color: #e5e7eb;
}

body.app-theme-dark .simulator-sensor-chip {
  border-color: #9ca3af;
}

body.app-theme-dark .simulator-attach-module {
  background: #4b5563;
  border-color: #6b7280;
  color: #f3f4f6;
}

body.app-theme-dark .simulator-attach-color-name,
body.app-theme-dark .simulator-attach-motor-label,
body.app-theme-dark .simulator-attach-ultra-value-row {
  color: #f3f4f6;
}

body.app-theme-dark .simulator-attach-color-picker::-webkit-color-swatch {
  border-color: #9ca3af;
}

body.app-theme-dark .simulator-attach-color-swatch {
  border-color: #9ca3af;
}

body.app-theme-dark .simulator-attach-ultra-toggle {
  color: #f3f4f6;
}

body.app-theme-dark .simulator-attach-ultra-shell {
  background: linear-gradient(180deg, #666d77, #4a5058);
  border-color: #2f3742;
}

body.app-theme-dark .simulator-attach-ultra-head {
  border-color: #6f7681;
}

body.app-theme-dark .simulator-oled-screen-wrap {
  background: #0b1220;
  border-color: #2b3649;
}

body.app-theme-dark .simulator-oled-canvas {
  background: #070d17;
}

body.app-theme-dark .toolbox-search,
body.app-theme-dark .toolbox-footer,
body.app-theme-dark .toolbox-footer-menu {
  background: #0f172a;
  border-color: #2b3649;
}

body.app-theme-dark .toolbox-mode-tabs {
  background: #102244;
  border-color: #2a3f67;
}

body.app-theme-dark .toolbox-mode-tab {
  background: rgba(203, 221, 255, 0.12);
  border-color: #35548b;
  color: #c4d9ff;
}

body.app-theme-dark .toolbox-mode-tab:hover,
body.app-theme-dark .toolbox-mode-tab:focus {
  background: rgba(203, 221, 255, 0.2);
  border-color: #4f72b5;
  color: #ebf2ff;
}

body.app-theme-dark .toolbox-mode-tab.is-active {
  background: #4e6ef2;
  border-color: #3f5dd4;
  color: #ffffff;
}

body.app-theme-dark .toolbox-footer-icon-button,
body.app-theme-dark .toolbox-footer-board-button {
  color: #b9c8e6;
}

body.app-theme-dark #toolboxExtensionsButton {
  background: #ffffff;
  border-color: #89b2f6;
  box-shadow: 0 2px 8px rgba(14, 44, 99, 0.28);
  color: #1f6fe5;
}

body.app-theme-dark #toolboxExtensionsButton:hover,
body.app-theme-dark #toolboxExtensionsButton:focus,
body.app-theme-dark #toolboxExtensionsButton:active {
  background: #eef5ff;
  border-color: #2f7de9;
  box-shadow: 0 0 0 3px rgba(109, 167, 255, 0.24);
  color: #145dc8;
}

body.app-theme-dark .toolbox-footer-board-button:hover,
body.app-theme-dark .toolbox-footer-board-button:focus,
body.app-theme-dark .toolbox-footer-board-button:active {
  background: linear-gradient(180deg, #2a3f73 0%, #22345f 100%);
  border-color: #5f7cc3;
  box-shadow: 0 0 0 3px rgba(111, 143, 255, 0.2);
  color: #eaf1ff;
  outline: none;
}

body.app-theme-dark .toolbox-footer-board-handle {
  color: #8fa5cc;
}

body.app-theme-dark .toolbox-footer-board-button {
  background: linear-gradient(180deg, #24375f 0%, #1d2c4d 100%);
  border-color: #3f5b93;
  color: #b9c8e6;
}

body.app-theme-dark .toolbox-footer-board-label {
  background: transparent;
  border: 0;
  color: #e6eefc;
}

body.app-theme-dark .toolbox-footer-board-button:hover .toolbox-footer-board-label,
body.app-theme-dark .toolbox-footer-board-button:focus .toolbox-footer-board-label,
body.app-theme-dark .toolbox-footer-board-button:active .toolbox-footer-board-label {
  background: transparent;
  border: 0;
  color: #f8fbff;
}

body.app-theme-dark .toolbox-footer-menu-title {
  color: #9eb2d8;
}

body.app-theme-dark .toolbox-footer-menu-item {
  color: #d4e2fb;
}

body.app-theme-dark .toolbox-footer-menu-item:hover,
body.app-theme-dark .toolbox-footer-menu-item:focus {
  background: rgba(63, 86, 207, 0.22);
  color: #ffffff;
  outline: none;
}

body.app-theme-dark .toolbox-footer-menu-item + .toolbox-footer-menu-item {
  border-top-color: #24354f;
}

body.app-theme-dark .toolbox-footer-product-item.is-active,
body.app-theme-dark .toolbox-footer-product-item:hover {
  background: linear-gradient(180deg, #5a78f5 0%, #4d6ae8 100%);
  color: #ffffff;
}

body.app-theme-dark .toolbox-footer-menu-empty {
  color: #9cb0d5;
}

body.app-theme-dark .share-modal-title {
  color: #f3f4f6;
}

body.app-theme-dark .share-project-title-label {
  color: #dbe7ff;
}

body.app-theme-dark .share-thumbnail-update {
  color: #8ab8ff;
}

body.app-theme-dark .variable-monitor-panel {
  background: #1f2937;
  border-color: #374151;
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.35);
}

body.app-theme-dark .variable-monitor-header {
  border-bottom-color: #374151;
  color: #f3f4f6;
}

body.app-theme-dark .variable-monitor-header-icon {
  color: #f3f4f6;
}

body.app-theme-dark .variable-monitor-value {
  background: #e5e7eb;
  color: #111827;
}

body.app-theme-dark .variable-monitor-toggle {
  background: #1b2433;
  border-color: #3a4558;
  color: #8ea0bb;
}

body.app-theme-dark .variable-monitor-toggle:hover,
body.app-theme-dark .variable-monitor-toggle:focus {
  background: #243146;
  border-color: #50607a;
  color: #c0d4f2;
}

body.app-theme-dark .blocklyFlyoutButton.klhbit-variable-monitor-button .blocklyFlyoutButtonBackground {
  fill: #16243b;
  stroke: #3f5b87;
}

body.app-theme-dark .blocklyFlyoutButton.klhbit-variable-monitor-button .blocklyText {
  fill: #dbe7ff;
}

body.app-theme-dark #pythonCode {
  background-color: #0b1220;
  color: #dbe7ff;
}

body.app-theme-dark #pythonCode .pln {
  color: #dbe7ff;
}

body.app-theme-dark #pythonCode .kwd {
  color: #8db9ff;
}

body.app-theme-dark #pythonCode .str {
  color: #97e57c;
}

body.app-theme-dark #pythonCode .com {
  color: #8aa4c6;
}

body.app-theme-dark #pythonCode .lit {
  color: #d8b4fe;
}

body.app-theme-dark #pythonCode .typ,
body.app-theme-dark #pythonCode .fun {
  color: #7dd3fc;
}

body.app-theme-dark #pythonCode .pun,
body.app-theme-dark #pythonCode .opn,
body.app-theme-dark #pythonCode .clo {
  color: #c8d7f0;
}

body.app-theme-dark .blocklyMainBackground {
  fill: #0f172a !important;
}

body.app-theme-dark .blocklyToolboxDiv {
  background: #111827 !important;
}

body.app-theme-dark .blocklyFlyoutBackground {
  fill: #0b1220 !important;
  stroke: #223047 !important;
}

body.app-theme-dark .blocklyTreeLabel,
body.app-theme-dark .blocklyFlyoutLabelText,
body.app-theme-dark .control-label,
body.app-theme-dark .workspace-connect-label {
  color: #e5e7eb !important;
  fill: #e5e7eb !important;
}

body.app-theme-dark .theme-option-label {
  color: #122033;
}

body.app-theme-dark .theme-modal-title {
  color: #f4f8ff;
}

body.app-theme-contrast .theme-modal-title,
body.app-theme-contrast .theme-option-label {
  color: #ffffff;
}

body.app-theme-dark .log-panel,
body.app-theme-dark .log-panel summary,
body.app-theme-dark #serialLog,
body.app-theme-dark .serial-status-row,
body.app-theme-dark #serialStatus,
body.app-theme-dark .status {
  background: #111827;
  border-color: #2b3649 !important;
  color: #e6edf3 !important;
}

body.app-theme-dark #serialLog {
  background: #0b1220;
}

body.app-theme-dark .serial-status-inline.status.connected {
  color: #7ef0ad !important;
}

body.app-theme-dark .serial-status-inline.status.error {
  color: #ff9ba9 !important;
}

body.app-theme-contrast {
  background: #000000;
  color: #ffffff;
}

body.app-theme-contrast .header,
body.app-theme-contrast .header-quick-actions,
body.app-theme-contrast .project-tabs-global,
body.app-theme-contrast .project-tabs-bar,
body.app-theme-contrast .project-tab-options-menu,
body.app-theme-contrast .main,
body.app-theme-contrast .pane,
body.app-theme-contrast .pane-header,
body.app-theme-contrast .pane-body,
body.app-theme-contrast .bottom-toolbar,
body.app-theme-contrast .header-settings-menu,
body.app-theme-contrast .workspace-connect-modal-card,
body.app-theme-contrast .workspace-device-panel-card,
body.app-theme-contrast .workspace-device-rename-card,
body.app-theme-contrast .theme-modal-card,
body.app-theme-contrast .share-modal-card {
  background: #000000;
  border-color: #ffffff;
  color: #ffffff;
}

body.app-theme-contrast .header-icon-button,
body.app-theme-contrast .workspace-tool-button,
body.app-theme-contrast .toolbar-icon,
body.app-theme-contrast .workspace-connect-option,
body.app-theme-contrast .theme-option-card,
body.app-theme-contrast .header-settings-theme-button {
  background: #000000;
  border-color: #ffffff;
  color: #ffffff;
}

body.app-theme-contrast .header-settings-toggle-track {
  background: #000000;
  border-color: #ffffff;
}

body.app-theme-contrast .header-settings-toggle-thumb {
  background: #ffffff;
  border-color: #ffffff;
}

body.app-theme-contrast .header-settings-toggle input:checked + .header-settings-toggle-track {
  background: #ffffff;
  border-color: #ffffff;
}

body.app-theme-contrast .header-settings-toggle input:checked + .header-settings-toggle-track .header-settings-toggle-thumb {
  background: #000000;
  border-color: #000000;
}

body.app-theme-contrast .header-settings-toggle-text {
  color: #ffffff;
}

body.app-theme-contrast .workspace-connect-menu-title,
body.app-theme-contrast .workspace-connect-menu-subtitle {
  color: #ffffff;
}

body.app-theme-contrast .workspace-device-info-card {
  background: #000000;
  border-color: #ffffff;
}

body.app-theme-contrast .workspace-device-name,
body.app-theme-contrast .workspace-device-info-value,
body.app-theme-contrast .workspace-device-info-label,
body.app-theme-contrast .workspace-device-rename-button,
body.app-theme-contrast .workspace-device-rename-title,
body.app-theme-contrast .workspace-device-rename-subtitle,
body.app-theme-contrast .workspace-device-rename-subtitle strong {
  color: #ffffff;
}

body.app-theme-contrast .workspace-disconnect-toast {
  background: #000000;
  border-color: #ffffff;
}

body.app-theme-contrast .workspace-disconnect-toast-icon,
body.app-theme-contrast .workspace-disconnect-toast-message,
body.app-theme-contrast .workspace-disconnect-toast-action {
  color: #ffffff;
}

body.app-theme-contrast .workspace-disconnect-toast-actions,
body.app-theme-contrast .workspace-disconnect-toast-action + .workspace-disconnect-toast-action {
  border-color: #ffffff;
}

body.app-theme-contrast .workspace-disconnect-toast-action:hover,
body.app-theme-contrast .workspace-disconnect-toast-action:focus {
  background: #1a1a1a;
}

body.app-theme-contrast .workspace-device-rename-input {
  border-bottom-color: #ffffff;
  color: #ffffff;
}

body.app-theme-contrast .workspace-device-rename-input::placeholder {
  color: #c7d2fe;
}

body.app-theme-contrast .workspace-device-rename-cancel {
  background: #000000;
  border-color: #ffffff;
  color: #ffffff;
}

body.app-theme-contrast .workspace-device-rename-save {
  background: #ffffff;
  border-color: #ffffff;
  color: #000000;
}

body.app-theme-contrast .simulator-imu-item,
body.app-theme-contrast .simulator-imu-item strong,
body.app-theme-contrast .simulator-imu-title {
  color: #ffffff;
}

body.app-theme-contrast .blocklyMainBackground {
  fill: #000000 !important;
}

body.app-theme-contrast .blocklyToolboxDiv {
  background: #000000 !important;
}

body.app-theme-contrast .blocklyFlyoutBackground {
  fill: #000000 !important;
  stroke: #ffffff !important;
}

body.app-theme-contrast .blocklyTreeLabel,
body.app-theme-contrast .blocklyFlyoutLabelText,
body.app-theme-contrast .control-label {
  color: #ffffff !important;
  fill: #ffffff !important;
}

body.app-theme-contrast .toolbox-footer,
body.app-theme-contrast .toolbox-footer-menu {
  background: #000000;
  border-color: #ffffff;
}

body.app-theme-contrast .toolbox-mode-tabs {
  background: #000000;
  border-color: #ffffff;
}

body.app-theme-contrast .toolbox-mode-tab {
  background: #000000;
  border-color: #ffffff;
  color: #ffffff;
}

body.app-theme-contrast .toolbox-mode-tab:hover,
body.app-theme-contrast .toolbox-mode-tab:focus,
body.app-theme-contrast .toolbox-mode-tab.is-active {
  background: #ffffff;
  color: #000000;
  outline: none;
}

body.app-theme-contrast .toolbox-footer-icon-button,
body.app-theme-contrast .toolbox-footer-board-button,
body.app-theme-contrast .toolbox-footer-board-label,
body.app-theme-contrast .toolbox-footer-menu-title,
body.app-theme-contrast .toolbox-footer-menu-item,
body.app-theme-contrast .toolbox-footer-menu-empty {
  color: #ffffff;
}

body.app-theme-contrast #toolboxExtensionsButton {
  background: #ffffff;
  border: 1px solid #2f7de9;
  color: #1f6fe5;
  box-shadow: none;
}

body.app-theme-contrast #toolboxExtensionsButton:hover,
body.app-theme-contrast #toolboxExtensionsButton:focus,
body.app-theme-contrast #toolboxExtensionsButton:active {
  background: #eaf2ff;
  border-color: #1f6fe5;
  color: #145dc8;
  outline: none;
}

body.app-theme-contrast .toolbox-footer-board-label {
  background: transparent;
  border: 0;
}

body.app-theme-contrast .toolbox-footer-board-button:hover .toolbox-footer-board-label,
body.app-theme-contrast .toolbox-footer-board-button:focus .toolbox-footer-board-label,
body.app-theme-contrast .toolbox-footer-board-button:active .toolbox-footer-board-label {
  background: transparent;
  color: #000000;
}

body.app-theme-contrast .toolbox-footer-board-button {
  background: #000000;
  border: 1px solid #ffffff;
}

body.app-theme-contrast .toolbox-footer-board-button:hover,
body.app-theme-contrast .toolbox-footer-board-button:focus,
body.app-theme-contrast .toolbox-footer-board-button:active {
  background: #ffffff;
  color: #000000;
}

body.app-theme-contrast .toolbox-footer-menu-item:hover,
body.app-theme-contrast .toolbox-footer-menu-item:focus,
body.app-theme-contrast .toolbox-footer-product-item.is-active {
  background: #ffffff;
  color: #000000;
  outline: none;
}

body.app-theme-contrast .toolbox-footer-menu-item + .toolbox-footer-menu-item {
  border-top-color: #ffffff;
}

body.app-theme-contrast .share-modal-header {
  border-bottom-color: #ffffff;
}

body.app-theme-contrast .share-modal-title,
body.app-theme-contrast .share-project-title-label {
  color: #ffffff;
}

body.app-theme-contrast .variable-monitor-panel {
  background: #000000;
  border-color: #ffffff;
  box-shadow: none;
}

body.app-theme-contrast .variable-monitor-header {
  border-bottom-color: #ffffff;
  color: #ffffff;
}

body.app-theme-contrast .variable-monitor-header-icon {
  color: #ffffff;
}

body.app-theme-contrast .variable-monitor-item {
  background: #f08a24;
  color: #000000;
}

body.app-theme-contrast .variable-monitor-value {
  background: #ffffff;
  color: #000000;
}

body.app-theme-contrast .variable-monitor-toggle {
  background: #000000;
  border-color: #ffffff;
  color: #ffffff;
}

body.app-theme-contrast .variable-monitor-toggle:hover,
body.app-theme-contrast .variable-monitor-toggle:focus {
  background: #ffffff;
  color: #000000;
}

body.app-theme-contrast .blocklyFlyoutButton.klhbit-variable-monitor-button .blocklyFlyoutButtonBackground {
  fill: #000000;
  stroke: #ffffff;
}

body.app-theme-contrast .blocklyFlyoutButton.klhbit-variable-monitor-button .blocklyText {
  fill: #ffffff;
}

body.app-theme-contrast .share-thumbnail-update {
  color: #7fc6ff;
}

body.app-theme-contrast .share-project-title-input {
  background: #000000;
  border-color: #ffffff;
  color: #ffffff;
}

body.app-theme-contrast .share-project-title-input::placeholder {
  color: #b6c7de;
}

body.app-theme-contrast .share-project-title-input:focus {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

body.app-theme-contrast #pythonCode {
  background-color: #000000;
  color: #ffffff;
}

body.app-theme-contrast #pythonCode .pln,
body.app-theme-contrast #pythonCode .pun,
body.app-theme-contrast #pythonCode .opn,
body.app-theme-contrast #pythonCode .clo {
  color: #ffffff;
}

body.app-theme-contrast #pythonCode .kwd {
  color: #ffe24a;
}

body.app-theme-contrast #pythonCode .str {
  color: #7cf29a;
}

body.app-theme-contrast #pythonCode .com {
  color: #9ca3af;
}

body.app-theme-contrast #pythonCode .lit {
  color: #f6b7ff;
}

body.app-theme-contrast #pythonCode .typ,
body.app-theme-contrast #pythonCode .fun {
  color: #8bd3ff;
}

body.app-theme-contrast .log-panel,
body.app-theme-contrast .log-panel summary,
body.app-theme-contrast #serialLog,
body.app-theme-contrast .serial-status-row,
body.app-theme-contrast #serialStatus,
body.app-theme-contrast .status {
  background: #000000;
  color: #ffffff !important;
  border-color: #ffffff !important;
}

body.app-theme-contrast #serialLog {
  background: #000000;
}

body.app-theme-contrast .serial-status-inline.status.connected {
  color: #8dffaf !important;
}

body.app-theme-contrast .serial-status-inline.status.error {
  color: #ff8f9b !important;
}

body.app-theme-dark .left-column-toggle {
  background: #5b6774;
  color: #e5edff;
}

body.app-theme-dark .left-column-toggle:hover,
body.app-theme-dark .left-column-toggle:focus {
  background: #4d5864;
}

body.app-theme-contrast .left-column-toggle {
  background: #000000;
  border: 1px solid #ffffff;
  color: #ffffff;
}

/* ── AI Chat Panel ─────────────────────────────────────────────── */
.ai-pane {
  flex-direction: column;
}

.ai-pane-header {
  align-items: center;
  display: flex;
  gap: 8px;
}

.ai-pane-title {
  flex: 1;
}

.ai-status-dot {
  border-radius: 50%;
  display: inline-block;
  height: 8px;
  transition: background 0.3s;
  width: 8px;
  background: #aaa;
}

.ai-status-dot.ai-online {
  background: #22c55e;
  box-shadow: 0 0 4px #22c55e88;
}

.ai-status-dot.ai-offline {
  background: #ef4444;
}

.ai-status-dot.ai-loading {
  animation: ai-pulse 1s infinite;
  background: #f59e0b;
}

@keyframes ai-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.ai-chat-body {
  box-sizing: border-box;
  display: flex !important;
  flex-direction: column;
  gap: 0;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 0 !important;
}

.ai-messages {
  box-sizing: border-box;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px 16px;
  scroll-behavior: smooth;
}

.ai-message {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: min(90%, 760px);
  min-width: 0;
}

.ai-message-bot {
  align-self: flex-start;
}

.ai-message-user {
  align-self: flex-end;
}

.ai-message-bubble {
  box-sizing: border-box;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.55;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 10px 13px;
  word-break: break-word;
}

.ai-message-bot .ai-message-bubble {
  background: #f0f4ff;
  border: 1px solid #dde5ff;
  border-bottom-left-radius: 3px;
  color: #1a1a2e;
}

.ai-message-user .ai-message-bubble {
  background: #3248b9;
  border-bottom-right-radius: 3px;
  color: #fff;
}

.ai-message-bubble code {
  background: rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.82em;
  padding: 1px 5px;
}

.ai-message-bubble pre {
  background: #1e1e2e;
  box-sizing: border-box;
  border-radius: 8px;
  color: #cdd6f4;
  font-family: monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  margin: 8px 0 4px;
  max-width: 100%;
  overflow-x: auto;
  padding: 10px 12px;
  white-space: pre;
}

.ai-message-bot .ai-message-bubble pre {
  background: #1e1e2e;
}

.ai-think-block {
  margin-bottom: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
}
.ai-think-block summary {
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.78rem;
  color: #64748b;
  user-select: none;
  list-style: none;
}
.ai-think-block summary::-webkit-details-marker { display: none; }
.ai-think-dots { animation: thinkDots 1.2s infinite; }
@keyframes thinkDots {
  0%,100% { opacity: 1; } 50% { opacity: 0.3; }
}
.ai-think-block[open] summary { border-bottom: 1px solid #e2e8f0; }
.ai-think-content {
  padding: 8px 12px;
  font-size: 0.75rem;
  color: #475569;
  line-height: 1.55;
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-code-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.ai-load-btn {
  align-items: center;
  background: #3248b9;
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.8rem;
  font-weight: 600;
  gap: 5px;
  padding: 6px 12px;
  transition: background 0.15s;
}

.ai-load-btn:hover {
  background: #2638a0;
}

.ai-load-btn svg {
  flex-shrink: 0;
  height: 13px;
  width: 13px;
}

.ai-pull-bar-wrap {
  background: #d0d5e8;
  border-radius: 4px;
  height: 6px;
  margin: 8px 0 4px;
  overflow: hidden;
  width: 100%;
}

.ai-pull-bar {
  background: linear-gradient(90deg, #3248b9, #5b7cf7);
  border-radius: 4px;
  height: 100%;
  transition: width 0.4s ease;
  width: 0%;
}

.ai-pull-status {
  color: #666;
  font-size: 0.78rem;
}

.ai-thinking {
  align-items: center;
  color: #888;
  display: flex;
  font-size: 0.82rem;
  gap: 6px;
}

.ai-thinking-dots span {
  animation: ai-blink 1.2s infinite;
  display: inline-block;
}

.ai-thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ai-blink {
  0%, 80%, 100% { opacity: 0; }
  40% { opacity: 1; }
}

.ai-input-row {
  align-items: flex-end;
  border-top: 1px solid #e5e7f0;
  box-sizing: border-box;
  display: flex;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  padding: 10px 12px;
}

.ai-input {
  background: #f7f8fc;
  border: 1px solid #d0d5e8;
  border-radius: 10px;
  color: #1a1a2e;
  flex: 1;
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.5;
  min-width: 0;
  outline: none;
  padding: 8px 10px;
  resize: none;
  transition: border-color 0.15s;
}

.ai-input:focus {
  border-color: #3248b9;
}

.ai-send-btn {
  align-items: center;
  background: #3248b9;
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-shrink: 0;
  height: 38px;
  justify-content: center;
  padding: 0;
  transition: background 0.15s, opacity 0.15s;
  width: 38px;
}

.ai-send-btn:hover { background: #2638a0; }
.ai-send-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.ai-send-btn svg {
  height: 17px;
  width: 17px;
}

/* Dark theme */
body.app-theme-dark .ai-message-bot .ai-message-bubble {
  background: #1e2240;
  border-color: #2d3560;
  color: #e2e8ff;
}

body.app-theme-dark .ai-input {
  background: #1a1d2e;
  border-color: #2d3560;
  color: #e2e8ff;
}

body.app-theme-dark .ai-input-row {
  border-top-color: #2d3560;
}
