:root {
  color-scheme: light;
  --bg: #f7f6f2;
  --paper: #fffefa;
  --ink: #303b32;
  --muted: #70786e;
  --line: #e0e4da;
  --green: #48684b;
  --pale: #eaf0e4;
  --danger: #9a4a40;
  font:
    15px/1.5 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--ink);
}
.studio-sections {
  display: flex;
  gap: 12px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--line);
}
.operations-preview-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.operations-preview-link:hover { background: var(--pale); }
.operations-preview-link:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.studio-sections button[aria-current="true"],
.runtime-controls button[aria-current="true"] {
  background: var(--pale);
  border-color: var(--green);
  box-shadow: inset 3px 0 0 var(--green);
}
.library-pane {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: calc(100vh - 143px);
}
.library-rail {
  border-right: 1px solid var(--line);
  padding: 26px 18px;
}
.library-rail h2 {
  margin-bottom: 18px;
}
.library-rail button {
  text-align: left;
  width: 100%;
  margin-bottom: 10px;
}
.library-rail button[aria-current="true"] {
  border-color: var(--green);
  background: var(--pale);
}
.library-rail small {
  display: block;
  color: var(--muted);
}
.library-main {
  width: 100%;
  max-width: 1480px;
  padding: 34px clamp(24px, 4vw, 58px) 72px;
  min-width: 0;
}
.stage-overview {
  margin-top: 30px;
}
.stage-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.stage-card {
  min-width: 0;
  padding: 10px;
  text-align: left;
  white-space: normal;
  border-radius: 16px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.stage-card:hover:not(:disabled) {
  transform: translateY(-2px);
}
.stage-card[aria-current="true"] {
  border-color: var(--green);
  box-shadow: 0 0 0 2px #48684b1f, 0 12px 34px #31452e12;
  background: var(--paper);
}
.stage-art {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 11px;
  background: #f4eee4;
}
.stage-art img,
.condition-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.stage-art-placeholder,
.condition-art-placeholder {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}
.stage-card-copy {
  display: grid;
  gap: 2px;
  padding: 10px 4px 3px;
}
.stage-card-copy strong {
  font-size: 15px;
  font-weight: 650;
}
.stage-card-copy small {
  color: var(--muted);
  font-size: 12px;
}
.selected-stage-heading {
  scroll-margin-top: 20px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.selected-stage-heading h2 {
  font-size: 23px;
  letter-spacing: -0.35px;
}
.selected-stage-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.runtime-inspector {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(430px, 1.05fr);
  gap: clamp(28px, 4vw, 54px);
  margin-top: 18px;
  align-items: start;
}
.runtime-preview {
  min-width: 0;
}
.preview-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.preview-heading h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
}
.preview-heading small {
  color: var(--muted);
}
.runtime-canvas-stack {
  position: relative;
  display: block;
  width: 100%;
  max-width: 620px;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f4eee4;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.runtime-canvas-stack canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.runtime-canvas-stack[data-background="Dark"] {
  background: #243b4a;
}
.runtime-canvas-stack[data-background="Transparency grid"] {
  background: repeating-conic-gradient(#ddd 0% 25%, #fff 0% 50%) 50% / 20px 20px;
}
.runtime-preview .hint {
  margin: 10px 0;
}
.runtime-transport {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.runtime-transport input {
  width: 150px;
  flex: 1;
  margin: 0;
  padding: 0;
}
.runtime-transport select {
  width: auto;
  margin: 0;
}
.runtime-controls {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.runtime-controls button {
  text-align: left;
  white-space: normal;
}
.runtime-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.coverage-count {
  color: var(--muted);
  white-space: nowrap;
}
.sequence-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.sequence-option {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 10px 12px;
}
.sequence-option span {
  font-size: 13px;
  font-weight: 650;
}
.sequence-option small {
  color: var(--muted);
  font-size: 11px;
}
.compact-hint {
  margin: 0 0 12px;
}
.care-model-heading {
  margin-top: 12px;
}
.care-rule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.care-rule {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.care-rule-copy {
  display: grid;
  gap: 1px;
  margin-bottom: 8px;
}
.care-rule-copy strong {
  font-size: 12px;
}
.care-rule-copy small {
  color: var(--muted);
  font-size: 10px;
}
.care-rule-cells {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
}
.care-rule-cells span {
  height: 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg);
}
.care-rule-cells span.filled {
  background: #aec4a5;
}
.care-rule-cells span.ideal {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px #48684b35;
}
.condition-heading {
  margin-top: 12px;
}
.condition-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.condition-grid button {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 7px;
}
.condition-art {
  display: grid;
  place-items: center;
  width: 62px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background: #f4eee4;
}
.condition-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.condition-copy strong {
  font-size: 12px;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.condition-copy small {
  color: var(--muted);
  font-size: 10px;
  overflow-wrap: anywhere;
}
.condition-grid button:disabled {
  opacity: 1;
  color: var(--muted);
  border-style: dashed;
  background: #f4f3ef;
}
.condition-grid button:disabled .condition-art {
  background: #ebeae5;
}
.runtime-details {
  margin-top: 6px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}
.runtime-details summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.runtime-metadata {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.runtime-metadata dt {
  color: var(--muted);
  margin-top: 10px;
}
.runtime-metadata dd {
  margin: 0;
}
.runtime-spec {
  max-height: 280px;
  overflow: auto;
  background: var(--paper);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  white-space: pre-wrap;
}
.inspector-note {
  margin: 2px 0 0;
}
@media (max-width: 1080px) {
  .runtime-inspector {
    grid-template-columns: 1fr;
  }
  .runtime-canvas-stack {
    max-width: 680px;
  }
  .library-pane {
    grid-template-columns: 190px minmax(0, 1fr);
  }
}
@media (max-width: 700px) {
  .library-pane {
    display: block;
  }
  .library-rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 18px;
  }
  .library-rail h2 {
    margin-bottom: 10px;
  }
  .library-rail button {
    width: auto;
    min-width: 190px;
    margin: 0 8px 0 0;
  }
  .library-main {
    padding: 24px 18px 54px;
  }
  .stage-gallery {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
  .selected-stage-heading {
    align-items: start;
    flex-direction: column;
    gap: 6px;
  }
}
@media (max-width: 480px) {
  .studio-sections {
    padding: 12px 18px;
    overflow-x: auto;
  }
  .condition-grid,
  .sequence-list,
  .care-rule-grid {
    grid-template-columns: 1fr;
  }
  .stage-art {
    aspect-ratio: 3 / 2;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 13px;
  background: var(--paper);
  color: var(--ink);
  white-space: nowrap;
}
button:hover:not(:disabled) {
  background: var(--pale);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button.primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
button.primary:hover:not(:disabled) {
  background: #3b573e;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #83a778;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
header {
  height: 76px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.brand {
  font-size: 22px;
  font-weight: 650;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.5px;
}
.brand span {
  font-weight: 400;
  color: var(--muted);
  margin-left: 5px;
}
#connection {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
}
h1 {
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -0.8px;
  font-weight: 600;
  margin: 0 0 12px;
}
h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}
p {
  margin: 0 0 18px;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 550;
}
input,
textarea,
select {
  display: block;
  width: 100%;
  margin: 7px 0 20px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  padding: 10px 12px;
  color: var(--ink);
}
textarea {
  resize: vertical;
}
input::placeholder,
textarea::placeholder {
  color: #949a90;
}
.hint {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}
.signin {
  max-width: 530px;
  margin: 100px auto;
  padding: 0 24px;
}
.signin > p {
  color: var(--muted);
}
.signin form {
  margin: 32px 0 18px;
}
.signin button {
  width: 100%;
}
aside {
  padding: 25px 18px;
  border-right: 1px solid var(--line);
}
.rail-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
#notice {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 40px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  padding: 14px 20px;
  box-shadow: 0 5px 30px #253d2414;
  z-index: 10;
}
#notice.error {
  color: var(--danger);
}
@media (max-width: 680px) {
  header {
    height: 64px;
    padding: 0 18px;
  }
  .brand {
    font-size: 19px;
  }
  #connection {
    display: none;
  }
  #disconnect {
    margin-left: auto;
  }
  h1 {
    font-size: 26px;
  }
  .signin {
    margin-top: 70px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
/* Native full-scene stage videos: no checkerboard or silhouette compositing. */
.video-library-inspector { display: grid; grid-template-columns: minmax(280px, 1.2fr) minmax(230px, 1fr); gap: 24px; margin-top: 28px; align-items: start; }
.video-library-media { overflow: hidden; border-radius: 24px; background: #f5f2e8; aspect-ratio: 1; }
.video-library-media video, .video-library-media > img { display: block; width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 800px) { .video-library-inspector { grid-template-columns: 1fr; } }
