/* Lab shell — a light, PCL-native workspace built around the WPF preview */

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background:
    radial-gradient(ellipse at 12% 8%, rgba(255, 255, 255, 0.9), transparent 42%),
    radial-gradient(ellipse at 88% 96%, hsl(var(--pcl-hue) 70% 86% / 0.66), transparent 46%),
    linear-gradient(138deg, hsl(calc(var(--pcl-hue) - 18) 70% 94%), hsl(var(--pcl-hue) 66% 90%) 52%, hsl(calc(var(--pcl-hue) + 14) 68% 92%));
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient__sky {
  position: absolute;
  inset: -14%;
  background:
    radial-gradient(ellipse at 24% 16%, rgba(255, 255, 255, 0.62), transparent 38%),
    radial-gradient(ellipse at 72% 80%, hsl(calc(var(--pcl-hue) + 16) 80% 88% / 0.62), transparent 42%);
  filter: blur(8px);
}

.ambient__grid {
  position: absolute;
  inset: 0;
  opacity: 0.55;
  background-image:
    linear-gradient(rgba(52, 61, 74, 0.038) 1px, transparent 1px),
    linear-gradient(90deg, rgba(52, 61, 74, 0.038) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at 50% 44%, #000 20%, transparent 76%);
}

.ambient__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(6px);
}

.ambient__glow--one {
  top: -16%;
  right: 8%;
  width: 42vw;
  height: 42vw;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.72), transparent 68%);
}

.ambient__glow--two {
  bottom: -26%;
  left: -8%;
  width: 52vw;
  height: 52vw;
  background: radial-gradient(circle, hsl(calc(var(--pcl-hue) + 24) 88% 82% / 0.5), transparent 66%);
}

.ambient__block {
  position: absolute;
  image-rendering: pixelated;
  opacity: 0.46;
  filter: drop-shadow(26px 34px 26px rgba(36, 61, 99, 0.22));
}

.ambient__block--one {
  top: 7%;
  right: 4.5%;
  width: 92px;
  transform: rotate(-7deg) skewY(-7deg);
}

.ambient__block--two {
  bottom: 7%;
  left: 3.5%;
  width: 64px;
  opacity: 0.28;
  transform: rotate(9deg) skewY(5deg);
}

.ambient__wordmark {
  position: absolute;
  right: -2.4vw;
  bottom: -13vh;
  color: rgba(255, 255, 255, 0.2);
  font-family: "PCL English", var(--pcl-font);
  font-size: 25vw;
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.7;
  transform: rotate(-4deg);
  user-select: none;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.lab-header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex: none;
  width: 100%;
  max-width: 1660px;
  height: 72px;
  margin: 0 auto;
  padding: 0 clamp(20px, 3vw, 44px);
}

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

.lab-brand__mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 10px;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.24), transparent 48%),
    linear-gradient(145deg, var(--pcl-c3), var(--pcl-c2));
  box-shadow:
    0 9px 18px -10px rgba(11, 91, 203, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.lab-brand__mark svg {
  width: 26px;
  height: auto;
}

.lab-brand__mark--image {
  position: relative;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.lab-brand__mark--image img {
  display: block;
  width: auto;
  height: 36px;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lab-brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.lab-brand__eyebrow {
  color: var(--pcl-c2);
  font-family: var(--pcl-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.14em;
  opacity: 0.66;
}

.lab-brand__title {
  color: var(--pcl-c1);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lab-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.runtime-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 14px;
  color: var(--pcl-gray2);
  background: rgba(255, 255, 255, 0.46);
  box-shadow: 0 2px 8px rgba(52, 61, 74, 0.04);
  font-size: 10.5px;
  backdrop-filter: blur(10px);
}

.runtime-pill__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22a06b;
  box-shadow: 0 0 0 3px rgba(34, 160, 107, 0.15);
  animation: runtime-pulse 2.4s ease-in-out infinite;
}

.runtime-pill.is-busy .runtime-pill__dot {
  background: #f0a020;
  box-shadow: 0 0 0 3px rgba(240, 160, 32, 0.16);
}

.runtime-pill.is-error .runtime-pill__dot {
  background: var(--pcl-red-light);
  box-shadow: 0 0 0 3px rgba(255, 76, 76, 0.14);
}

@keyframes runtime-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.48; }
}

.lab-text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  color: var(--pcl-c3);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.lab-text-button svg {
  width: 15px;
  height: 15px;
  opacity: 0.85;
}

.lab-text-button:hover {
  color: var(--pcl-c2);
  background: rgba(255, 255, 255, 0.56);
}

/* --------------------------------------------------------------------------
   Workspace + source panel
   -------------------------------------------------------------------------- */

.workspace {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: clamp(18px, 2vw, 30px);
  flex: 1;
  width: 100%;
  max-width: 1660px;
  min-height: 0;
  margin: 0 auto;
  padding: 0 clamp(20px, 3vw, 44px) 24px;
  overflow: hidden;
}

.lab-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow:
    0 28px 60px -38px rgba(52, 61, 74, 0.46),
    0 4px 14px -10px rgba(52, 61, 74, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(24px);
}

.lab-panel::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 2;
  height: 3px;
  background: linear-gradient(90deg, var(--pcl-c2), var(--pcl-c4) 48%, var(--pcl-c6));
  pointer-events: none;
}

.lab-panel__scroll {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 22px 22px 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(52, 61, 74, 0.18) transparent;
}

.lab-panel__scroll::-webkit-scrollbar {
  width: 6px;
}

.lab-panel__scroll::-webkit-scrollbar-thumb {
  border-radius: 3px;
  background: rgba(52, 61, 74, 0.16);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading__index,
.section-heading__index {
  color: var(--pcl-c4);
  font-family: var(--pcl-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.panel-heading__title {
  margin: 4px 0 0;
  color: var(--pcl-c1);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.panel-heading__badge {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 7px;
  border: 1px solid rgba(19, 112, 243, 0.18);
  border-radius: 3px;
  color: var(--pcl-c3);
  background: rgba(234, 242, 254, 0.6);
  font-family: var(--pcl-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
}

.panel-heading__caption {
  margin: 9px 0 0;
  color: var(--pcl-gray2);
  font-size: 10.8px;
  line-height: 1.6;
}

.panel-heading__caption code,
.field-note code,
.var-chips code {
  padding: 1px 3px;
  border-radius: 2px;
  color: var(--pcl-c2);
  background: rgba(213, 230, 253, 0.55);
  font-family: var(--pcl-mono);
  font-size: 0.92em;
}

/* Source tabs */

.source-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin-top: 15px;
  padding: 3px;
  border: 1px solid rgba(52, 61, 74, 0.05);
  border-radius: 6px;
  background: rgba(52, 61, 74, 0.055);
}

.source-tab {
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  color: var(--pcl-gray2);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.source-tab:hover {
  color: var(--pcl-c3);
}

.source-tab.is-active {
  color: var(--pcl-c2);
  background: #fff;
  box-shadow: 0 1px 4px rgba(52, 61, 74, 0.12);
}

.source-tab-panels {
  min-height: 170px;
  margin-top: 13px;
}

.source-pane[hidden] {
  display: none;
}

.source-pane {
  animation: pane-in 180ms ease both;
}

@keyframes pane-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Dropzone */

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  min-height: 138px;
  padding: 17px;
  border: 1px dashed rgba(19, 112, 243, 0.3);
  border-radius: 6px;
  color: var(--pcl-gray2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), transparent),
    rgba(234, 242, 254, 0.46);
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--pcl-c3);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent),
    rgba(213, 230, 253, 0.64);
  box-shadow: 0 8px 20px -16px rgba(11, 91, 203, 0.55);
  transform: translateY(-1px);
}

.dropzone__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 4px;
  border-radius: 7px;
  color: var(--pcl-c3);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 3px 9px -6px rgba(11, 91, 203, 0.5);
}

.dropzone__icon svg {
  width: 23px;
  height: 23px;
}

.dropzone__title {
  color: var(--pcl-c1);
  font-size: 12.5px;
  font-weight: 700;
}

.dropzone__title code {
  color: var(--pcl-c2);
  font-family: var(--pcl-mono);
  font-size: 0.94em;
}

.dropzone__hint {
  color: var(--pcl-gray3);
  font-size: 10.5px;
}

.dropzone__meta {
  max-width: 100%;
  margin-top: 7px;
  overflow: hidden;
  color: var(--pcl-c4);
  font-family: var(--pcl-mono);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--pcl-gray2);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.field-label--spaced {
  margin-top: 12px;
}

.input-row {
  display: flex;
  gap: 7px;
}

.lab-input {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 9px;
  border: 1px solid rgba(52, 61, 74, 0.14);
  border-radius: 4px;
  color: var(--pcl-c1);
  background: rgba(255, 255, 255, 0.72);
  font-family: var(--pcl-mono);
  font-size: 10.5px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.lab-input::placeholder {
  color: var(--pcl-gray4);
}

.lab-input:focus {
  border-color: var(--pcl-c3);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(19, 112, 243, 0.1);
}

.compact-button {
  flex: none;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--pcl-c2);
  border-radius: 4px;
  color: var(--pcl-c2);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.compact-button:hover {
  border-color: var(--pcl-c3);
  color: var(--pcl-c3);
  background: var(--pcl-c7);
}

.compact-button:active {
  transform: scale(0.965);
}

.compact-button--accent {
  border-color: var(--pcl-c3);
  color: #fff;
  background: var(--pcl-c3);
  box-shadow: 0 3px 9px -6px rgba(11, 91, 203, 0.8);
}

.compact-button--accent:hover {
  border-color: var(--pcl-c2);
  color: #fff;
  background: var(--pcl-c2);
}

.field-note {
  margin: 9px 0 0;
  color: var(--pcl-gray3);
  font-size: 10px;
  line-height: 1.55;
}

.example-strip {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(52, 61, 74, 0.07);
  color: var(--pcl-gray3);
  font-size: 9.5px;
}

.example-strip button {
  align-self: flex-start;
  padding: 0;
  border: 0;
  color: var(--pcl-c3);
  background: transparent;
  font-size: 10.5px;
  text-align: left;
  cursor: pointer;
}

.example-strip button:hover {
  color: var(--pcl-c2);
  text-decoration: underline;
}

/* Code editor */

.code-editor {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  height: 188px;
  overflow: hidden;
  border: 1px solid rgba(16, 27, 43, 0.8);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 20%),
    #232b38;
  box-shadow:
    0 12px 24px -20px rgba(16, 27, 43, 0.9),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.code-lines {
  grid-column: 1;
  margin: 0;
  padding: 10px 7px 10px 0;
  overflow: hidden;
  color: rgba(191, 209, 234, 0.34);
  background: rgba(0, 0, 0, 0.14);
  font-family: var(--pcl-mono);
  font-size: 10.5px;
  line-height: 1.6;
  text-align: right;
  user-select: none;
}

.code-input {
  grid-column: 2;
  width: 100%;
  height: 100%;
  padding: 10px 11px;
  border: 0;
  outline: 0;
  resize: none;
  color: #dbe7fb;
  background: transparent;
  font-family: var(--pcl-mono);
  font-size: 10.5px;
  line-height: 1.6;
  tab-size: 2;
  white-space: pre;
  caret-color: #7fb6ff;
  scrollbar-width: thin;
  scrollbar-color: rgba(191, 209, 234, 0.24) transparent;
}

.code-input::selection {
  color: #fff;
  background: rgba(72, 144, 245, 0.55);
}

.code-input::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.code-input::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: rgba(191, 209, 234, 0.2);
}

.code-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.shortcut-hint {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--pcl-gray3);
  font-size: 9.5px;
}

.shortcut-hint kbd {
  display: inline-block;
  min-width: 16px;
  padding: 1px 4px;
  border: 1px solid rgba(52, 61, 74, 0.14);
  border-radius: 3px;
  color: var(--pcl-gray2);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 1px 0 rgba(52, 61, 74, 0.08);
  font-family: var(--pcl-mono);
  font-size: 8.5px;
  text-align: center;
}


/* Panel sections */

.panel-section {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid rgba(52, 61, 74, 0.075);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-heading__title {
  margin: 0;
  color: var(--pcl-c1);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.section-heading__en {
  margin-left: auto;
  color: var(--pcl-gray4);
  font-family: var(--pcl-mono);
  font-size: 7.5px;
  letter-spacing: 0.13em;
}

.section-heading__action {
  margin-left: auto;
  padding: 0;
  border: 0;
  color: var(--pcl-gray3);
  background: transparent;
  font-size: 9.5px;
  cursor: pointer;
  transition: color 140ms ease;
}

.section-heading__action:hover {
  color: var(--pcl-c3);
}

/* Presets */

.preset-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 9px;
}

.preset-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--pcl-c1);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.preset-item:hover {
  background: rgba(255, 255, 255, 0.62);
  transform: translateX(2px);
}

.preset-item.is-active {
  border-color: rgba(19, 112, 243, 0.16);
  background: #fff;
  box-shadow: 0 3px 10px -8px rgba(52, 61, 74, 0.4);
}

.preset-item__glyph {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 5px;
  color: var(--pcl-gray2);
  background: rgba(52, 61, 74, 0.05);
  transition: color 160ms ease, background-color 160ms ease;
}

.preset-item__glyph svg {
  width: 17px;
  height: 17px;
}

.preset-item.is-active .preset-item__glyph {
  color: var(--pcl-c3);
  background: var(--pcl-c8);
}

.preset-item__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.preset-item__body strong {
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset-item__body small {
  overflow: hidden;
  color: var(--pcl-gray3);
  font-size: 9.5px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset-item__arrow {
  color: var(--pcl-c4);
  font-family: var(--pcl-mono);
  font-size: 11px;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.preset-item:hover .preset-item__arrow,
.preset-item.is-active .preset-item__arrow {
  opacity: 1;
  transform: translateX(0);
}

/* About */

.panel-section--about .about-credit {
  margin: 10px 0 0;
  color: var(--pcl-c1);
  font-size: 11px;
  line-height: 1.7;
}

.panel-section--about .about-credit strong {
  color: var(--pcl-c2);
  font-weight: 700;
}

.panel-section--about a {
  color: var(--pcl-c2);
  text-decoration: none;
  border-bottom: 1px solid rgba(11, 91, 203, 0.25);
}

.panel-section--about a:hover {
  border-bottom-color: var(--pcl-c2);
}

.panel-section--about .field-note {
  margin-top: 8px;
}

/* Variables */

.var-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.var-chips__empty {
  color: var(--pcl-gray4);
  font-size: 9.5px;
  line-height: 1.5;
}

.var-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 2px 6px;
  border: 1px solid var(--pcl-c6);
  border-radius: 3px;
  color: var(--pcl-c2);
  background: rgba(234, 242, 254, 0.7);
  font-family: var(--pcl-mono);
  font-size: 9px;
  line-height: 1.5;
}

.var-chip span {
  overflow: hidden;
  max-width: 150px;
  color: var(--pcl-gray2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.var-chip strong {
  font-weight: 600;
}

/* Footer */

.lab-panel__footer {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
  padding: 12px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 -8px 18px -18px rgba(52, 61, 74, 0.4);
  backdrop-filter: blur(18px);
}

.render-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--pcl-c2);
  border-radius: 5px;
  color: #fff;
  background: linear-gradient(180deg, var(--pcl-c3), var(--pcl-c2));
  box-shadow:
    0 7px 16px -10px rgba(11, 91, 203, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: filter 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.render-button:hover {
  filter: brightness(1.06) saturate(1.04);
  box-shadow:
    0 9px 20px -10px rgba(11, 91, 203, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.render-button:active {
  transform: scale(0.985);
}

.render-button:disabled {
  opacity: 0.55;
  pointer-events: none;
}

.render-button svg {
  width: 12px;
  height: 12px;
}

.render-button__hint {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.64);
  font-family: var(--pcl-mono);
  font-size: 8.5px;
  letter-spacing: 0.02em;
}

.icon-button {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(52, 61, 74, 0.13);
  border-radius: 5px;
  color: var(--pcl-gray2);
  background: rgba(255, 255, 255, 0.58);
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease, transform 150ms ease;
}

.icon-button:hover {
  border-color: rgba(19, 112, 243, 0.24);
  color: var(--pcl-c3);
  background: #fff;
}

.icon-button:active {
  transform: scale(0.95);
}

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


/* --------------------------------------------------------------------------
   Stage
   -------------------------------------------------------------------------- */

.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  gap: 9px;
}

.stage__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: none;
  min-height: 28px;
}

.stage__identity {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.stage__label {
  flex: none;
  color: var(--pcl-c2);
  font-family: var(--pcl-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.13em;
  opacity: 0.68;
}

.stage__source {
  overflow: hidden;
  color: var(--pcl-c1);
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.render-stats {
  margin-right: 5px;
  color: var(--pcl-gray3);
  font-family: var(--pcl-mono);
  font-size: 8.5px;
  letter-spacing: 0.02em;
}

.stage-icon-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--pcl-gray2);
  background: transparent;
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.stage-icon-button svg {
  width: 16px;
  height: 16px;
}

.stage-icon-button:hover {
  border-color: rgba(255, 255, 255, 0.8);
  color: var(--pcl-c2);
  background: rgba(255, 255, 255, 0.52);
}

.stage-icon-button:active {
  transform: scale(0.92);
}

.stage__frame {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 4px 0 0;
  overflow: hidden;
}

.stage__frame::before {
  content: "";
  position: absolute;
  inset: 6% 4% 4%;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 30%),
    rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 40px 90px -60px rgba(52, 61, 74, 0.6);
  pointer-events: none;
}

.stage__aura {
  position: absolute;
  top: 12%;
  left: 50%;
  width: min(78%, 980px);
  height: 68%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0) 68%);
  filter: blur(18px);
  transform: translateX(-50%);
  pointer-events: none;
}

.pcl-scaler {
  position: relative;
  z-index: 2;
  margin: auto;
}

.stage__caption {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: none;
  height: 21px;
  color: rgba(52, 61, 74, 0.5);
  font-family: var(--pcl-mono);
  font-size: 8px;
  letter-spacing: 0.03em;
}

.stage__caption-key {
  color: rgba(52, 61, 74, 0.66);
  font-weight: 600;
}

.stage__caption-divider {
  width: 1px;
  height: 9px;
  background: rgba(52, 61, 74, 0.18);
}

.stage__caption-grow {
  flex: 1;
  max-width: 34px;
}

.stage__caption-zoom {
  min-width: 32px;
  color: var(--pcl-c4);
  text-align: right;
}

.stage__empty {
  position: absolute;
  inset: 10% 12%;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px dashed rgba(19, 112, 243, 0.25);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  animation: pane-in 220ms ease both;
}

.stage__empty[hidden] {
  display: none;
}

.stage__empty-title {
  color: var(--pcl-c1);
  font-size: 17px;
  font-weight: 700;
}

.stage__empty-text {
  margin-bottom: 7px;
  color: var(--pcl-gray2);
  font-size: 10.5px;
}

.event-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  height: 32px;
  padding: 0 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 5px;
  color: var(--pcl-gray2);
  background: rgba(255, 255, 255, 0.46);
  box-shadow:
    0 10px 24px -22px rgba(52, 61, 74, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  font-family: var(--pcl-mono);
  font-size: 9px;
  backdrop-filter: blur(10px);
}

.event-strip__prompt {
  color: var(--pcl-c3);
  font-weight: 700;
}

.event-strip__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-strip__grow {
  flex: 1;
}

.event-strip__more {
  flex: none;
  padding: 2px 5px;
  border: 0;
  border-radius: 3px;
  color: var(--pcl-gray3);
  background: transparent;
  font-family: var(--pcl-mono);
  font-size: 8.5px;
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease;
}

.event-strip__more:hover {
  color: var(--pcl-c2);
  background: rgba(255, 255, 255, 0.7);
}

.event-strip__more span {
  display: inline-block;
  min-width: 14px;
  padding: 0 3px;
  border-radius: 7px;
  color: var(--pcl-c3);
  background: var(--pcl-c8);
  text-align: center;
}


/* --------------------------------------------------------------------------
   Fullscreen preview
   -------------------------------------------------------------------------- */

.stage:fullscreen {
  width: 100vw;
  height: 100vh;
  padding: 18px 26px 16px;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(255, 255, 255, 0.82), transparent 56%),
    var(--pcl-page-gradient);
}

.stage:fullscreen .stage__frame::before {
  inset: 2% 6% 3%;
}

.stage:fullscreen .stage__caption {
  height: 24px;
  font-size: 9px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1240px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
    padding-bottom: 32px;
  }

  .stage {
    order: 1;
    min-height: 610px;
  }

  .lab-panel {
    order: 2;
    overflow: visible;
  }

  .lab-panel__scroll {
    overflow: visible;
  }

  .ambient__block--one {
    opacity: 0.24;
  }
}

@media (max-width: 820px) {
  .lab-header {
    height: 62px;
    padding: 0 16px;
  }

  .lab-brand__mark {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }

  .lab-brand__mark svg {
    width: 22px;
  }

  .lab-brand__mark--image img {
    height: 30px;
  }

  .lab-brand__eyebrow {
    font-size: 7px;
  }

  .lab-brand__title {
    font-size: 17px;
  }

  .runtime-pill {
    display: none;
  }

  .lab-text-button {
    padding: 0 7px;
  }

  .workspace {
    gap: 16px;
    padding: 0 14px 24px;
  }

  .stage {
    min-height: 470px;
  }

  .stage__label {
    display: none;
  }

  .render-stats {
    display: none;
  }

  .stage__frame {
    align-items: flex-start;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    padding-top: 12px;
  }

  .stage__frame::before {
    inset: 2% 1% 2%;
  }

  .stage__caption {
    justify-content: flex-start;
    overflow: hidden;
    padding: 0 3px;
    white-space: nowrap;
  }

  .stage__caption-grow {
    display: none;
  }

  .stage__caption-zoom {
    margin-left: auto;
  }

  .event-strip__text {
    max-width: none;
  }

  .source-tab-panels {
    min-height: 0;
  }

  .code-editor {
    height: 230px;
  }

  .ambient__block {
    display: none;
  }

  .ambient__wordmark {
    right: -8vw;
    font-size: 48vw;
    opacity: 0.55;
  }
}

@media (max-width: 520px) {
  .lab-brand__eyebrow {
    display: none;
  }

  .lab-brand__title {
    font-size: 16px;
  }

  .lab-text-button {
    font-size: 10.5px;
  }

  .stage {
    min-height: 410px;
  }

  .stage__identity {
    gap: 0;
  }

  .stage__caption > span:not(.stage__caption-key):not(.stage__caption-zoom) {
    display: none;
  }

  .preset-item__body small {
    display: none;
  }

  .preset-item {
    grid-template-columns: 30px minmax(0, 1fr) 14px;
  }

  .event-strip__more {
    font-size: 0;
  }

  .event-strip__more span {
    font-size: 8.5px;
  }
}

@media (max-height: 780px) and (min-width: 1241px) {
  .lab-header {
    height: 62px;
  }

  .stage__caption {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */

[hidden] {
  display: none !important;
}

.boot-fallback {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: min(620px, calc(100vw - 32px));
  padding: 13px 16px;
  border: 1px solid rgba(11, 91, 203, 0.22);
  border-radius: 8px;
  color: var(--pcl-gray2);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 30px -12px rgba(21, 48, 92, 0.45);
  font-size: 11px;
  line-height: 1.6;
  transform: translateX(-50%);
}

.boot-fallback strong {
  color: var(--pcl-c2);
  font-size: 13px;
}

.boot-fallback code {
  padding: 1px 4px;
  border-radius: 3px;
  color: var(--pcl-c1);
  background: var(--pcl-c7);
  font-family: var(--pcl-mono);
  font-size: 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.is-dragging-file .stage__frame::after {
  content: "松开以加载 XAML";
  position: absolute;
  inset: 4% 3%;
  z-index: 9;
  display: grid;
  place-items: center;
  border: 2px dashed var(--pcl-c3);
  border-radius: 12px;
  color: var(--pcl-c2);
  background: rgba(234, 242, 254, 0.78);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  backdrop-filter: blur(6px);
  pointer-events: none;
}

