:root {
  color-scheme: dark;
  --bg: #071018;
  --bg-deep: #040a10;
  --surface: #0c1724;
  --surface-2: #111f2f;
  --surface-3: #18283a;
  --surface-glass: rgba(12, 23, 36, 0.92);
  --border: #26384b;
  --border-bright: #3b5168;
  --text: #eef5ff;
  --muted: #9badbf;
  --muted-2: #6f8296;
  --cyan: #68e1fd;
  --cyan-strong: #25cbe9;
  --violet: #9b8cff;
  --pink: #ff89c9;
  --green: #68e6ae;
  --yellow: #f7d879;
  --red: #ff7d8b;
  --orange: #ffad72;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.24);
  --radius: 16px;
  --radius-sm: 10px;
  --header-height: 68px;
  --nav-height: 58px;
  --footer-height: 34px;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
}

body {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

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

::selection {
  background: rgba(104, 225, 253, 0.28);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #32465b;
  border: 2px solid transparent;
  border-radius: 99px;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #435d76;
  border: 2px solid transparent;
  background-clip: padding-box;
}

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

.skip-link {
  position: fixed;
  z-index: 9999;
  top: 8px;
  left: 8px;
  transform: translateY(-180%);
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--cyan);
  color: #021116;
  font-weight: 800;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  display: grid;
  grid-template-rows: var(--header-height) var(--nav-height) minmax(0, 1fr) var(--footer-height);
  width: 100vw;
  height: 100vh;
  background:
    radial-gradient(circle at 15% -15%, rgba(104, 225, 253, 0.08), transparent 38%),
    radial-gradient(circle at 90% 5%, rgba(155, 140, 255, 0.08), transparent 35%),
    var(--bg);
}

.app-header {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 420px) minmax(420px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(5, 13, 21, 0.96);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.brand-mark {
  flex: 0 0 auto;
  font-size: 27px;
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 1;
  background: linear-gradient(135deg, var(--cyan), var(--violet) 55%, var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-mark sup,
.welcome-mark sup {
  position: relative;
  top: -0.22em;
  font-size: 0.54em;
  letter-spacing: 0;
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.2;
}

.brand-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy small {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.project-identity input {
  min-width: 0;
  width: 100%;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}

.project-identity input:hover,
.project-identity input:focus {
  border-color: var(--border-bright);
  background: var(--surface);
}

.save-state {
  flex: 0 0 auto;
  color: var(--muted-2);
  font-size: 11px;
  white-space: nowrap;
}

.save-state.is-dirty {
  color: var(--yellow);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.runtime-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 120px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(17, 31, 47, 0.72);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted-2);
  box-shadow: 0 0 0 3px rgba(111, 130, 150, 0.12);
}

.runtime-status.is-loading .status-dot,
.runtime-status.is-running .status-dot {
  background: var(--yellow);
  box-shadow: 0 0 0 3px rgba(247, 216, 121, 0.14);
  animation: pulse 1.15s ease-in-out infinite;
}

.runtime-status.is-ready .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(104, 230, 174, 0.14);
}

.runtime-status.is-error .status-dot {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 125, 139, 0.14);
}

@keyframes pulse {
  50% {
    opacity: 0.45;
    transform: scale(0.78);
  }
}

.button,
.icon-button,
.tool-button,
.text-button,
.footer-button {
  border: 0;
  cursor: pointer;
}

.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 13px;
  border-radius: 9px;
  font-weight: 750;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(135deg, #48d5ef, #7c8cff);
  color: #041119;
  box-shadow: 0 8px 22px rgba(65, 199, 232, 0.18);
}

.button-secondary {
  border: 1px solid var(--border-bright);
  background: var(--surface-2);
  color: var(--text);
}

.button-ghost {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
}

.button kbd {
  padding: 1px 4px;
  border: 1px solid rgba(0, 0, 0, 0.24);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.12);
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 800;
}

.icon-button,
.tool-button {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
}

.icon-button {
  width: 38px;
  height: 38px;
  font-size: 18px;
}

.tool-button {
  width: 32px;
  height: 32px;
  font-family: var(--font-mono);
  font-size: 14px;
}

.icon-button:hover,
.tool-button:hover,
.icon-button[aria-pressed="true"],
.tool-button[aria-pressed="true"] {
  border-color: var(--cyan);
  background: rgba(104, 225, 253, 0.1);
  color: var(--cyan);
}

.text-button,
.footer-button {
  padding: 4px 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}

.text-button:hover,
.footer-button:hover {
  color: var(--cyan);
}

.primary-nav {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(6, minmax(115px, 1fr));
  gap: 1px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 18, 28, 0.94);
}

.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 24px auto;
  grid-template-rows: auto auto;
  align-content: center;
  justify-content: center;
  column-gap: 8px;
  padding: 6px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.nav-item::after {
  position: absolute;
  right: 22%;
  bottom: -1px;
  left: 22%;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  content: "";
  opacity: 0;
  transform: scaleX(0.35);
  transition: opacity 160ms ease, transform 160ms ease;
}

.nav-item:hover,
.nav-item.is-active {
  color: var(--text);
}

.nav-item.is-active {
  background: linear-gradient(180deg, rgba(104, 225, 253, 0.04), rgba(104, 225, 253, 0));
}

.nav-item.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.nav-icon {
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--cyan);
  font-size: 18px;
}

.nav-item span:not(.nav-icon) {
  font-size: 12px;
  font-weight: 750;
  line-height: 1.15;
}

.nav-item small {
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.2;
}

.main-content {
  min-height: 0;
  overflow: hidden;
}

.studio-view {
  display: grid;
  grid-template-columns: minmax(244px, 0.68fr) minmax(430px, 1.42fr) minmax(430px, 1.22fr);
  height: 100%;
  min-height: 0;
}

.context-panel,
.canvas-column,
.code-column {
  min-width: 0;
  min-height: 0;
}

.context-panel {
  overflow: auto;
  border-right: 1px solid var(--border);
  background: rgba(8, 18, 28, 0.78);
}

.context-inner {
  padding: 18px;
}

.context-hero {
  padding: 20px 18px 17px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at 100% 0, rgba(104, 225, 253, 0.11), transparent 45%),
    var(--surface);
}

.context-hero h2,
.context-inner h2,
.context-inner h3 {
  margin: 0;
  line-height: 1.32;
}

.context-hero h2 {
  margin-top: 5px;
  font-size: 18px;
}

.context-hero p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.eyebrow {
  margin: 0;
  color: var(--cyan);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.15em;
  line-height: 1.3;
  text-transform: uppercase;
}

.progress-bar {
  height: 5px;
  margin-top: 15px;
  overflow: hidden;
  border-radius: 99px;
  background: #1b2b3c;
}

.progress-bar > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  transition: width 220ms ease;
}

.step-list,
.parameter-list,
.version-list,
.concept-list,
.file-manager-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-button {
  display: grid;
  grid-template-columns: 27px 1fr auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(17, 31, 47, 0.62);
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.step-button:hover,
.step-button.is-active {
  border-color: var(--border-bright);
  background: var(--surface-2);
  color: var(--text);
}

.step-button.is-active {
  box-shadow: inset 3px 0 0 var(--cyan);
}

.step-index {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid var(--border-bright);
  border-radius: 50%;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.step-button.is-complete .step-index {
  border-color: var(--green);
  background: rgba(104, 230, 174, 0.12);
  color: var(--green);
}

.step-copy strong,
.step-copy small {
  display: block;
}

.step-copy strong {
  font-size: 11px;
}

.step-copy small {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 9px;
}

.step-status {
  color: var(--green);
  font-size: 12px;
}

.lesson-card,
.info-card,
.parameter-card,
.team-card,
.lab-card {
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(17, 31, 47, 0.62);
}

.lesson-card + .lesson-card,
.info-card + .info-card,
.team-card + .team-card,
.lab-card + .lab-card {
  margin-top: 10px;
}

.lesson-card h3,
.info-card h3,
.team-card h3,
.lab-card h3 {
  margin: 0 0 7px;
  font-size: 13px;
}

.lesson-card p,
.info-card p,
.team-card p,
.lab-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.prompt-box {
  padding: 11px;
  border-left: 3px solid var(--yellow);
  border-radius: 0 9px 9px 0;
  background: rgba(247, 216, 121, 0.07);
  color: #e9dfbd;
  font-size: 11px;
}

.context-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.context-section:first-child {
  padding-top: 0;
}

.context-section:last-child {
  border-bottom: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.section-heading h3 {
  font-size: 12px;
}

.section-heading small {
  color: var(--muted-2);
  font-size: 9px;
}

.parameter-card {
  padding: 11px;
}

.workshop-parameter-panel {
  position: relative;
  margin-top: 14px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid rgba(104, 225, 253, 0.42);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(104, 225, 253, 0.09), rgba(124, 140, 255, 0.035)),
    rgba(9, 23, 35, 0.92);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18), inset 3px 0 0 rgba(104, 225, 253, 0.88);
}

.workshop-parameter-panel::after {
  position: absolute;
  top: -52px;
  right: -48px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(104, 225, 253, 0.12), transparent 68%);
  content: "";
  pointer-events: none;
}

.workshop-parameter-panel.is-ready {
  border-color: rgba(104, 230, 174, 0.36);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18), inset 3px 0 0 rgba(104, 230, 174, 0.82);
}

.workshop-parameter-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.workshop-parameter-heading h3 {
  margin-top: 4px;
  font-size: 13px;
}

.parameter-count {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid var(--border-bright);
  border-radius: 999px;
  background: rgba(7, 17, 31, 0.72);
  color: var(--cyan);
  font-size: 9px;
  font-weight: 800;
}

.workshop-control-guide {
  position: relative;
  z-index: 1;
  margin: 0 0 10px;
  padding: 10px;
  border-radius: 9px;
  background: rgba(104, 225, 253, 0.075);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.workshop-control-guide strong {
  color: var(--text);
}

.workshop-parameter-list {
  position: relative;
  z-index: 1;
}

.workshop-parameter-list .parameter-card {
  border-color: rgba(104, 225, 253, 0.2);
  background: rgba(7, 17, 31, 0.74);
}

.workshop-parameter-actions {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.workshop-parameter-actions .button {
  width: 100%;
}

.parameter-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.parameter-label code {
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 9px;
}

.parameter-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 65px;
  align-items: center;
  gap: 8px;
}

.parameter-controls input[type="number"],
.parameter-controls input[type="text"],
.parameter-controls select,
.form-control,
.context-panel input[type="text"],
.context-panel input[type="number"],
.context-panel select,
.context-panel textarea,
.modal input,
.modal select,
.modal textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #09131e;
  color: var(--text);
}

.parameter-controls input[type="number"],
.parameter-controls input[type="text"],
.parameter-controls select {
  padding: 6px 7px;
  font-family: var(--font-mono);
  font-size: 10px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--cyan);
}

.parameter-range {
  height: 26px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: ew-resize;
}

.parameter-range::-webkit-slider-runnable-track {
  height: 6px;
  border: 1px solid rgba(104, 225, 253, 0.42);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(104, 225, 253, 0.82), rgba(124, 140, 255, 0.7));
}

.parameter-range::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -7px;
  appearance: none;
  border: 3px solid var(--cyan);
  border-radius: 50%;
  background: #effcff;
  box-shadow: 0 0 0 4px rgba(104, 225, 253, 0.13), 0 2px 7px rgba(0, 0, 0, 0.38);
}

.parameter-range::-moz-range-track {
  height: 6px;
  border: 1px solid rgba(104, 225, 253, 0.42);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(104, 225, 253, 0.82), rgba(124, 140, 255, 0.7));
}

.parameter-range::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 3px solid var(--cyan);
  border-radius: 50%;
  background: #effcff;
  box-shadow: 0 0 0 4px rgba(104, 225, 253, 0.13), 0 2px 7px rgba(0, 0, 0, 0.38);
}

.parameter-range:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 3px;
}

input[type="color"] {
  width: 100%;
  height: 31px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(17, 31, 47, 0.65);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.badge.is-detected {
  border-color: rgba(104, 230, 174, 0.4);
  background: rgba(104, 230, 174, 0.08);
  color: var(--green);
}

.badge.is-warning {
  border-color: rgba(247, 216, 121, 0.4);
  background: rgba(247, 216, 121, 0.08);
  color: var(--yellow);
}

.canvas-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background:
    linear-gradient(rgba(104, 225, 253, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(104, 225, 253, 0.018) 1px, transparent 1px),
    #08121c;
  background-size: 24px 24px;
}

.panel-heading {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 18, 28, 0.92);
}

.panel-heading h1 {
  margin: 2px 0 0;
  font-size: 14px;
  line-height: 1.3;
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
}

.zoom-control {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 106px;
  color: var(--muted);
  font-size: 9px;
}

.zoom-control output {
  width: 34px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.canvas-stage {
  position: relative;
  display: grid;
  min-height: 0;
  place-items: center;
  overflow: auto;
  padding: 20px;
  background:
    radial-gradient(circle at center, rgba(104, 225, 253, 0.035), transparent 52%),
    rgba(4, 10, 16, 0.36);
}

#art-canvas {
  display: block;
  max-width: none;
  border: 1px solid #2c3b4c;
  border-radius: 5px;
  background: #071018;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  image-rendering: auto;
  cursor: crosshair;
  transform-origin: center;
}

.canvas-empty,
.canvas-busy {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 30px;
  background: rgba(4, 10, 16, 0.79);
  text-align: center;
  backdrop-filter: blur(5px);
}

.canvas-empty h2 {
  margin: 20px 0 5px;
  font-size: 16px;
}

.canvas-empty p {
  max-width: 400px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 11px;
}

.empty-orbit {
  position: relative;
  width: 86px;
  height: 86px;
  border: 1px solid rgba(104, 225, 253, 0.42);
  border-radius: 50%;
}

.empty-orbit::before,
.empty-orbit::after {
  position: absolute;
  inset: 17px -8px;
  border: 1px solid rgba(155, 140, 255, 0.48);
  border-radius: 50%;
  content: "";
  transform: rotate(33deg);
}

.empty-orbit::after {
  transform: rotate(-33deg);
}

.empty-orbit span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 20px var(--cyan);
  transform: translate(-50%, -50%);
}

.canvas-busy[hidden],
.canvas-empty[hidden],
.animation-controls[hidden],
.coordinate-readout[hidden] {
  display: none;
}

.canvas-busy strong {
  margin-top: 12px;
}

.canvas-busy small {
  margin-top: 4px;
  color: var(--muted);
}

.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid rgba(104, 225, 253, 0.18);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

.coordinate-readout {
  position: absolute;
  right: 12px;
  bottom: 10px;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(4, 10, 16, 0.84);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 9px;
  pointer-events: none;
}

.animation-controls {
  display: grid;
  grid-template-columns: 32px minmax(100px, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.animation-controls output,
.animation-controls label {
  color: var(--muted);
  font-size: 9px;
}

.animation-controls select {
  margin-left: 3px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 9px;
}

.canvas-footer {
  display: grid;
  gap: 7px;
  padding: 9px 13px;
  border-top: 1px solid var(--border);
  background: rgba(8, 18, 28, 0.94);
}

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

.metric-strip span {
  overflow: hidden;
  color: var(--muted-2);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-strip strong {
  margin-right: 3px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 10px;
}

.selection-readout {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-column {
  display: grid;
  grid-template-rows: 36px 34px minmax(210px, 1.2fr) minmax(180px, 0.8fr);
  overflow: hidden;
  background: #071018;
}

.file-bar {
  display: flex;
  min-width: 0;
  align-items: end;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: #08121c;
}

.file-tabs {
  display: flex;
  min-width: 0;
  flex: 1;
  align-self: stretch;
  overflow-x: auto;
}

.file-tab {
  position: relative;
  display: inline-flex;
  min-width: 108px;
  max-width: 180px;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid var(--border);
  background: #0a1521;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  cursor: pointer;
}

.file-tab.is-active {
  background: #101d2b;
  color: var(--text);
}

.file-tab.is-active::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--cyan);
  content: "";
}

.file-tab .file-type {
  color: var(--cyan);
  font-size: 8px;
}

.file-tab .file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-bar > .tool-button {
  flex: 0 0 32px;
  align-self: center;
  margin: 0 4px;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
  border-bottom: 1px solid var(--border);
  background: #0d1926;
}

.editor-label,
.editor-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
}

.language-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4b8bbe 50%, #ffd43b 50%);
}

.editor-container {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

#fallback-editor {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  resize: none;
  border: 0;
  outline: 0;
  padding: 14px;
  background: #071018;
  color: #d8e6f4;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  tab-size: 4;
}

.editor-loading {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(7, 16, 24, 0.94);
  color: var(--muted);
  font-size: 11px;
}

.editor-loading[hidden] {
  display: none;
}

.analysis-panel {
  display: grid;
  grid-template-rows: 34px minmax(0, 1fr);
  min-height: 0;
  border-top: 1px solid var(--border);
  background: #0a1521;
}

.analysis-tabs {
  display: flex;
  align-items: stretch;
  gap: 1px;
  border-bottom: 1px solid var(--border);
  background: #08121c;
}

.analysis-tab {
  padding: 0 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted-2);
  font-size: 10px;
  cursor: pointer;
}

.analysis-tab:hover,
.analysis-tab.is-active {
  color: var(--text);
}

.analysis-tab.is-active {
  border-bottom-color: var(--violet);
  background: rgba(155, 140, 255, 0.05);
}

.analysis-content {
  min-height: 0;
  overflow: auto;
  padding: 11px;
}

.analysis-empty {
  display: grid;
  height: 100%;
  min-height: 110px;
  place-items: center;
  color: var(--muted-2);
  font-size: 10px;
  text-align: center;
}

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

.inspector-card {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(17, 31, 47, 0.62);
}

.inspector-card h4 {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.inspector-card strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.variable-table,
.command-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 9px;
}

.variable-table th,
.variable-table td,
.command-table th,
.command-table td {
  padding: 6px 7px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.variable-table th,
.command-table th {
  position: sticky;
  top: -11px;
  z-index: 1;
  background: #0a1521;
  color: var(--muted-2);
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 700;
}

.variable-table td:first-child {
  color: var(--cyan);
}

.value-preview {
  display: block;
  max-width: 240px;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trace-controls {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.trace-controls output {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.trace-detail {
  display: grid;
  gap: 8px;
}

.trace-line {
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #071018;
  color: #d8e6f4;
  font-family: var(--font-mono);
  font-size: 10px;
  white-space: pre-wrap;
}

.console-output {
  min-height: 100%;
  margin: 0;
  color: #cddaea;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.console-output.is-error {
  color: #ffc0c7;
}

.error-card {
  padding: 11px;
  border: 1px solid rgba(255, 125, 139, 0.38);
  border-radius: 10px;
  background: rgba(255, 125, 139, 0.07);
}

.error-card h3 {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 12px;
}

.error-card p,
.error-card li {
  color: #e6c8cc;
  font-size: 10px;
}

.error-card code {
  color: #ffd6da;
  font-family: var(--font-mono);
}

.command-row {
  cursor: pointer;
}

.command-row:hover,
.command-row.is-selected {
  background: rgba(104, 225, 253, 0.07);
}

.command-swatch {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 3px;
  vertical-align: middle;
}

.page-view {
  height: 100%;
  overflow: auto;
  background:
    radial-gradient(circle at 75% 0, rgba(155, 140, 255, 0.08), transparent 34%),
    var(--bg);
}

.page-view[hidden],
.studio-view[hidden] {
  display: none;
}

.page-container {
  width: min(1320px, calc(100% - 36px));
  margin: 0 auto;
  padding: 34px 0 54px;
}

.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px;
  margin-bottom: 24px;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0, rgba(104, 225, 253, 0.12), transparent 45%),
    linear-gradient(135deg, rgba(17, 31, 47, 0.92), rgba(8, 18, 28, 0.92));
  box-shadow: var(--shadow-soft);
}

.page-hero h1 {
  margin: 7px 0 10px;
  font-size: clamp(25px, 3vw, 42px);
  line-height: 1.15;
}

.page-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.hero-stat {
  min-width: 150px;
  padding: 14px;
  border: 1px solid var(--border-bright);
  border-radius: 12px;
  background: rgba(7, 16, 24, 0.65);
  text-align: center;
}

.hero-stat strong,
.hero-stat span {
  display: block;
}

.hero-stat strong {
  color: var(--cyan);
  font-size: 30px;
}

.hero-stat span {
  color: var(--muted);
  font-size: 10px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.filter-chip {
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.filter-chip:hover,
.filter-chip.is-active {
  border-color: var(--cyan);
  background: rgba(104, 225, 253, 0.08);
  color: var(--cyan);
}

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

.gallery-card {
  display: grid;
  grid-template-rows: 190px auto;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform 160ms ease, border-color 160ms ease;
}

.gallery-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-3px);
}

.gallery-preview {
  position: relative;
  overflow: hidden;
  background: #071018;
}

.gallery-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-level {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(4, 10, 16, 0.76);
  color: #e5edf7;
  font-size: 8px;
  backdrop-filter: blur(5px);
}

.gallery-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.gallery-body h2 {
  margin: 0;
  font-size: 15px;
}

.gallery-body p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

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

.gallery-concepts {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 4px;
}

.gallery-concepts span {
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(155, 140, 255, 0.09);
  color: #c7bdff;
  font-size: 8px;
}

.docs-layout {
  display: grid;
  grid-template-columns: 235px minmax(0, 1fr);
  gap: 20px;
}

.docs-nav {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: calc(100vh - 180px);
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
}

.docs-nav button {
  display: block;
  width: 100%;
  padding: 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  text-align: left;
  cursor: pointer;
}

.docs-nav button:hover,
.docs-nav button.is-active {
  background: rgba(104, 225, 253, 0.07);
  color: var(--cyan);
}

.prose {
  padding: clamp(22px, 4vw, 48px);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(12, 23, 36, 0.86);
  box-shadow: var(--shadow-soft);
}

.prose.compact {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.prose h1,
.prose h2,
.prose h3 {
  line-height: 1.3;
}

.prose h1 {
  margin: 0 0 22px;
  font-size: 30px;
}

.prose h2 {
  margin: 34px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 20px;
}

.prose h3 {
  margin: 24px 0 9px;
  color: var(--cyan);
  font-size: 15px;
}

.prose p,
.prose li {
  color: #c1cfdd;
}

.prose code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #06101a;
  color: #a9e9f7;
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.prose pre {
  overflow: auto;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #050d14;
}

.prose pre code {
  padding: 0;
  background: transparent;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.prose th,
.prose td {
  padding: 9px;
  border: 1px solid var(--border);
  text-align: left;
}

.prose th {
  background: var(--surface-2);
}

.callout {
  margin: 16px 0;
  padding: 13px 15px;
  border-left: 3px solid var(--cyan);
  border-radius: 0 9px 9px 0;
  background: rgba(104, 225, 253, 0.06);
}

.callout.warning {
  border-left-color: var(--yellow);
  background: rgba(247, 216, 121, 0.06);
}

.team-form-grid,
.lab-form-grid {
  display: grid;
  gap: 9px;
}

.context-panel label,
.modal label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
}

.context-panel input[type="text"],
.context-panel input[type="number"],
.context-panel select,
.context-panel textarea,
.modal input,
.modal select,
.modal textarea {
  padding: 8px 9px;
  resize: vertical;
}

.member-row,
.role-row,
.version-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(17, 31, 47, 0.56);
}

.member-row strong,
.version-row strong {
  display: block;
  font-size: 10px;
}

.member-row small,
.version-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 8px;
}

.small-action {
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
}

.small-action:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.sweep-grid {
  display: grid;
  grid-template-columns: repeat(var(--sweep-cols, 3), minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.sweep-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
}

.sweep-card canvas,
.sweep-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #050c12;
}

.sweep-card footer {
  padding: 7px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
}

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

.diff-pane {
  min-width: 0;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #050d14;
}

.diff-line {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  min-height: 20px;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.5;
}

.diff-line .line-no {
  padding: 2px 5px;
  color: var(--muted-2);
  text-align: right;
  user-select: none;
}

.diff-line code {
  padding: 2px 7px;
  white-space: pre;
}

.diff-line.added {
  background: rgba(104, 230, 174, 0.08);
}

.diff-line.removed {
  background: rgba(255, 125, 139, 0.08);
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border-top: 1px solid var(--border);
  background: #050d14;
  color: var(--muted-2);
  font-size: 9px;
}

.toast-region {
  position: fixed;
  z-index: 3000;
  right: 16px;
  bottom: 48px;
  display: grid;
  width: min(360px, calc(100vw - 32px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--border-bright);
  border-radius: 11px;
  background: rgba(12, 23, 36, 0.97);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 10px;
  pointer-events: auto;
  animation: toast-in 180ms ease-out;
}

.toast.is-success .toast-icon {
  color: var(--green);
}

.toast.is-error .toast-icon {
  color: var(--red);
}

.toast.is-warning .toast-icon {
  color: var(--yellow);
}

.toast strong,
.toast span {
  display: block;
}

.toast span {
  color: var(--muted);
}

.toast button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.modal {
  width: min(600px, calc(100vw - 30px));
  max-height: min(86vh, 900px);
  overflow: auto;
  border: 1px solid var(--border-bright);
  border-radius: 17px;
  background: #0b1723;
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.62);
}

.modal::backdrop {
  background: rgba(1, 6, 10, 0.76);
  backdrop-filter: blur(7px);
}

.modal > form {
  position: relative;
  padding: 26px;
}

.modal h2 {
  margin: 6px 0 17px;
  line-height: 1.3;
}

.modal-close {
  position: absolute;
  z-index: 1;
  top: 12px;
  right: 12px;
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text);
}

.wide-modal {
  width: min(920px, calc(100vw - 30px));
}

.welcome-modal {
  width: min(760px, calc(100vw - 30px));
}

.welcome-modal > form {
  padding: 36px;
}

.welcome-mark {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 52px;
  font-weight: 900;
  letter-spacing: -0.07em;
  line-height: 1;
  background: linear-gradient(135deg, var(--cyan), var(--violet), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.welcome-modal h2 {
  max-width: 620px;
  margin: 7px 0 11px;
  font-size: 28px;
}

.welcome-modal > form > p:not(.eyebrow) {
  color: var(--muted);
}

.welcome-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 21px 0;
}

.welcome-grid article {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(17, 31, 47, 0.68);
}

.welcome-grid strong,
.welcome-grid span {
  display: block;
}

.welcome-grid strong {
  color: var(--cyan);
  font-size: 11px;
}

.welcome-grid span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 19px;
}

.check-row {
  display: flex !important;
  grid-template-columns: auto 1fr;
  flex-direction: row;
  align-items: center;
  gap: 7px !important;
  margin-top: 12px;
}

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

.action-list button {
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(17, 31, 47, 0.66);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.action-list button:hover {
  border-color: var(--cyan);
  background: rgba(104, 225, 253, 0.06);
}

.action-list strong,
.action-list span {
  display: block;
}

.action-list strong {
  font-size: 11px;
}

.action-list span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.form-modal form {
  display: grid;
  gap: 11px;
}

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

.library-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
}

.library-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #050d14;
}

.library-card-body {
  padding: 11px;
}

.library-card h3 {
  margin: 0;
  font-size: 12px;
}

.library-card p {
  margin: 3px 0 9px;
  color: var(--muted);
  font-size: 9px;
}

.library-card-actions {
  display: flex;
  gap: 6px;
}

.about-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.about-hero .welcome-mark {
  flex: 0 0 auto;
  margin: 0;
}

.about-hero h2 {
  margin: 4px 0 0;
}

.noscript-message {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 30px;
  background: var(--bg);
  color: var(--text);
  text-align: center;
}


/* Core Workshop learning aids */
.concept-lab,
.example-entry {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border-bright);
  border-radius: 14px;
  background: rgba(8, 20, 31, 0.84);
}

.concept-lab {
  border-color: rgba(155, 140, 255, 0.34);
  box-shadow: inset 3px 0 0 rgba(155, 140, 255, 0.72);
}

.concept-lab-heading,
.example-entry-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.concept-lab-heading h3,
.example-entry-heading h3 {
  margin-top: 4px;
  font-size: 13px;
}

.concept-lab-intro,
.example-entry > p {
  margin: 0 0 11px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.concept-intro {
  margin: 0 0 11px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.syntax-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.syntax-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.82fr) minmax(0, 1.4fr);
  gap: 10px;
  align-items: start;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(17, 31, 47, 0.58);
}

.syntax-row > code {
  overflow-wrap: anywhere;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.55;
}

.syntax-row strong {
  display: block;
  color: var(--text);
  font-size: 10px;
}

.syntax-row p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

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

.reference-columns section {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(17, 31, 47, 0.46);
}

.reference-columns h4 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 10px;
}

.reference-columns ul {
  margin: 0;
  padding-left: 17px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.reference-columns .mistake-list {
  border-color: rgba(255, 180, 115, 0.24);
  background: rgba(255, 180, 115, 0.035);
}

.loaded-template-name {
  margin: 4px 0 0;
  color: var(--cyan);
  font-size: 9px;
  font-weight: 700;
}

.concept-details,
.quick-check-block details,
.common-mistakes,
.answer-details {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(17, 31, 47, 0.58);
}

.concept-details + .concept-details,
.quick-check-block details + details {
  margin-top: 7px;
}

.concept-details summary,
.quick-check-block summary,
.common-mistakes summary,
.answer-details summary {
  cursor: pointer;
  list-style: none;
}

.concept-details summary::-webkit-details-marker,
.quick-check-block summary::-webkit-details-marker,
.common-mistakes summary::-webkit-details-marker,
.answer-details summary::-webkit-details-marker {
  display: none;
}

.concept-details > summary {
  display: grid;
  grid-template-columns: minmax(0, auto) 1fr;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
}

.concept-details > summary::after,
.quick-check-block summary::after,
.common-mistakes summary::after,
.answer-details summary::after {
  content: "+";
  justify-self: end;
  color: var(--cyan);
  font-weight: 800;
}

.concept-details[open] > summary::after,
.quick-check-block details[open] summary::after,
.common-mistakes[open] summary::after,
.answer-details[open] summary::after {
  content: "−";
}

.concept-details summary code {
  max-width: 150px;
  overflow: hidden;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.concept-details summary span {
  color: var(--text);
  font-size: 10px;
  font-weight: 750;
}

.concept-details-body {
  padding: 0 10px 10px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.concept-details-body p {
  margin: 0;
}

.reference-points,
.practice-block,
.quick-check-block {
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.reference-points h4,
.practice-block h4,
.quick-check-block h4 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 10px;
}

.reference-points ul,
.common-mistakes ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.practice-block ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.practice-block li {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.practice-block li > strong,
.practice-block li > span {
  display: block;
}

.practice-block li > strong {
  color: var(--text);
}

.answer-details {
  margin-top: 6px;
  background: rgba(104, 225, 253, 0.045);
}

.answer-details summary,
.quick-check-block summary,
.common-mistakes summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 8px 9px;
  color: var(--text);
  font-size: 9px;
  font-weight: 700;
}

.answer-details p,
.quick-check-block details p {
  margin: 0;
  padding: 0 9px 9px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.common-mistakes {
  margin-top: 10px;
  border-color: rgba(255, 180, 115, 0.24);
}

.common-mistakes ul {
  padding: 0 18px 10px 28px;
}

.example-entry {
  border-color: rgba(104, 225, 253, 0.28);
  box-shadow: inset 3px 0 0 rgba(104, 225, 253, 0.68);
}

.example-count {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid rgba(104, 225, 253, 0.36);
  border-radius: 999px;
  color: var(--cyan);
  font-size: 9px;
  font-weight: 800;
}

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

.example-shortcut {
  display: grid;
  grid-template-rows: 66px auto auto;
  min-width: 0;
  overflow: hidden;
  padding: 0 0 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(17, 31, 47, 0.72);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.example-shortcut:hover,
.example-shortcut:focus-visible {
  border-color: var(--cyan);
  transform: translateY(-1px);
}

.example-shortcut img {
  width: 100%;
  height: 66px;
  object-fit: cover;
  background: #071018;
}

.example-shortcut > span {
  min-width: 0;
  padding: 7px 8px 0;
}

.example-shortcut strong,
.example-shortcut small {
  display: block;
}

.example-shortcut strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.example-shortcut small {
  display: -webkit-box;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.example-shortcut .example-shortcut-action {
  color: var(--cyan);
  font-size: 8px;
  font-weight: 750;
}

.example-gallery-button {
  width: 100%;
  margin-top: 10px;
}

.gallery-filter-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(9, 21, 33, 0.66);
}

.gallery-filter-section .filter-bar {
  margin: 6px 0 0;
}

.gallery-result-count {
  margin: 0 0 12px;
  color: var(--muted-2);
  font-size: 10px;
}

@media (max-width: 1320px) {
  .app-header {
    grid-template-columns: 250px minmax(170px, 1fr) auto;
  }

  .runtime-status {
    min-width: 0;
  }

  .runtime-label {
    display: none;
  }

  .studio-view {
    grid-template-columns: 225px minmax(380px, 1.2fr) minmax(390px, 1fr);
  }

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

@media (max-width: 1180px) {
  .syntax-row,
  .reference-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1050px) {
  body {
    overflow: auto;
  }

  .app-shell {
    min-height: 100vh;
    height: auto;
    grid-template-rows: auto auto minmax(900px, auto) auto;
  }

  .app-header {
    grid-template-columns: 1fr auto;
    min-height: var(--header-height);
  }

  .project-identity {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-bottom: 8px;
  }

  .primary-nav {
    overflow-x: auto;
    grid-template-columns: repeat(6, minmax(135px, 1fr));
  }

  .studio-view {
    grid-template-columns: 240px minmax(0, 1fr);
    grid-template-rows: minmax(620px, 1fr) 620px;
  }

  .context-panel {
    grid-row: 1 / span 2;
  }

  .canvas-column {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .code-column {
    grid-column: 2;
  }
}

@media (max-width: 760px) {
  :root {
    --header-height: auto;
    --nav-height: auto;
  }

  .app-shell {
    display: block;
  }

  .app-header {
    position: sticky;
    top: 0;
    display: flex;
    flex-wrap: wrap;
    padding: 10px;
  }

  .brand-copy,
  .runtime-status,
  .header-actions .button kbd,
  #snapshot-button,
  #settings-button {
    display: none;
  }

  .brand {
    flex: 1;
  }

  .project-identity {
    order: 3;
    width: 100%;
    padding: 0;
  }

  .header-actions {
    gap: 5px;
  }

  .primary-nav {
    position: sticky;
    top: 107px;
    z-index: 15;
    display: flex;
    padding: 0 6px;
  }

  .nav-item {
    min-width: 102px;
    height: 52px;
  }

  .nav-item small,
  .nav-icon {
    display: none;
  }

  .studio-view {
    display: block;
    height: auto;
  }

  .context-panel,
  .canvas-column,
  .code-column {
    height: auto;
    min-height: 520px;
    border: 0;
    border-bottom: 1px solid var(--border);
  }

  .context-panel {
    max-height: 520px;
  }

  .canvas-column {
    display: grid;
    grid-template-rows: auto 520px auto auto;
  }

  .code-column {
    display: grid;
    grid-template-rows: 36px 34px 520px 360px;
  }

  .gallery-grid,
  .library-list,
  .welcome-grid,
  .action-list,
  .docs-layout,
  .diff-view {
    grid-template-columns: 1fr;
  }

  .docs-nav {
    position: static;
    max-height: none;
  }

  .page-container {
    width: min(100% - 20px, 1320px);
    padding-top: 18px;
  }

  .page-hero {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .hero-stat {
    display: none;
  }

  .gallery-card {
    grid-template-rows: 220px auto;
  }

  .app-footer {
    min-height: 34px;
  }

  .app-footer span:nth-child(2) {
    display: none;
  }

  .modal > form,
  .welcome-modal > form {
    padding: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

.cga-highlight-line {
  background: rgba(104, 225, 253, 0.12) !important;
  box-shadow: inset 3px 0 0 #68e1fd;
}

.cga-highlight-glyph {
  background: #68e1fd;
  border-radius: 50%;
}

.muted-copy {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
}

/* The in-app setting mirrors the operating-system reduced-motion preference. */
html.reduced-motion *,
html.reduced-motion *::before,
html.reduced-motion *::after {
  scroll-behavior: auto !important;
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}

.presentation-sheet {
  display: grid;
  gap: 18px;
}

.presentation-sheet .about-hero {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(104, 225, 253, 0.08), rgba(247, 216, 121, 0.05));
}

.presentation-sheet ol {
  display: grid;
  gap: 8px;
  padding-left: 24px;
}

.presentation-sheet li {
  padding: 8px 10px;
  border-left: 2px solid rgba(104, 225, 253, 0.36);
  background: rgba(255, 255, 255, 0.025);
}

.presentation-sheet li p {
  margin: 4px 0 0;
}

@media print {
  body {
    overflow: visible;
    background: #ffffff;
    color: #111111;
  }

  .app-shell > :not(dialog),
  dialog .modal-actions {
    display: none !important;
  }

  dialog[open] {
    position: static;
    display: block;
    width: 100%;
    max-width: none;
    max-height: none;
    padding: 0;
    border: 0;
    background: #ffffff;
    color: #111111;
  }

  dialog[open]::backdrop {
    display: none;
  }

  .presentation-sheet,
  .presentation-sheet * {
    color: #111111 !important;
  }
}
