:root {
  color-scheme: dark;
  --abyss: #020408;
  --panel: rgba(4, 8, 15, .92);
  --cyan: #41f5e4;
  --cyan-bright: #bafff8;
  --magenta: #ff2e88;
  --violet: #9c7bff;
  --amber: #f5d742;
  --text: #dce9f5;
  --muted: #8195a8;
  --faint: #4c6174;
  --line: rgba(65, 245, 228, .17);
  --line-strong: rgba(65, 245, 228, .42);
  --bar-height: 0px;
  --bottom-height: 36px;
  --dock-height: var(--bottom-height);
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --display: "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  background: var(--abyss);
}

body,
button,
input,
textarea { font-family: var(--mono); }

button,
a { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
a:focus-visible,
textarea:focus-visible,
input:focus-visible,
.app-window:focus-visible {
  outline: 1px solid var(--cyan);
  outline-offset: -2px;
}

.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;
}

.tron-field,
.atmosphere {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

.tron-field { z-index: 0; }

.atmosphere {
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 44%, transparent 0 22%, rgba(2, 4, 8, .15) 55%, rgba(2, 4, 8, .82) 100%),
    linear-gradient(180deg, rgba(2, 4, 8, .12), rgba(2, 4, 8, .52));
  transition: background .7s ease;
}

body[data-workspace="1"] .atmosphere {
  background:
    linear-gradient(rgba(2, 4, 8, .68), rgba(2, 4, 8, .84)),
    radial-gradient(circle at 72% 40%, rgba(65, 245, 228, .08), transparent 35%);
}

.system-bar {
  position: fixed;
  z-index: 1000;
  inset: 0 0 auto;
  height: var(--bar-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  background: rgba(2, 5, 10, .82);
  border-bottom: 1px solid var(--line-strong);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
  backdrop-filter: blur(20px) saturate(1.4);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-100%);
  transition: opacity .4s ease, transform .4s cubic-bezier(.16, 1, .3, 1);
}

body[data-workspace="1"] .system-bar {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.system-actions,
.system-right,
.system-identity,
.runtime-state {
  display: flex;
  align-items: center;
}

.system-actions { justify-self: start; }
.system-right {
  justify-self: stretch;
  justify-content: flex-end;
  min-width: 0;
  overflow: hidden;
}

.system-button {
  align-self: stretch;
  min-height: var(--bottom-height);
  min-width: 52px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  cursor: pointer;
  transition: color .15s, background .15s;
}

.system-button:hover,
.system-button[aria-expanded="true"] {
  color: var(--cyan-bright);
  background: rgba(65, 245, 228, .08);
}

.workspace-nav-button { font-size: 1.65rem; font-family: system-ui, sans-serif; }
.workspace-nav-button span {
  display: block;
  transform: translateY(-3px);
}

.launcher-mark {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(65, 245, 228, .36));
}

.app-launcher-glyph {
  width: 25px;
  height: 25px;
  display: grid;
  grid-template-columns: repeat(3, 4px);
  grid-auto-rows: 4px;
  place-content: center;
  gap: 4px;
}

.app-launcher-glyph i {
  width: 4px;
  height: 4px;
  display: block;
  border-radius: 50%;
  background: currentColor;
  box-shadow:
    0 0 4px rgba(65, 245, 228, .46),
    0 0 10px rgba(65, 245, 228, .24);
}

.launcher-button,
.workspace-nav-button:not(:disabled) {
  color: #5c9da5 !important;
  text-shadow:
    0 0 4px rgba(65, 245, 228, .28),
    0 0 9px rgba(65, 245, 228, .16);
}

.system-bottom-bar .source-toggle {
  color: var(--cyan-bright) !important;
  font-weight: 800;
  text-shadow: 0 0 7px rgba(65, 245, 228, .48);
}

.launcher-button:hover .app-launcher-glyph i,
.launcher-button[aria-expanded="true"] .app-launcher-glyph i {
  box-shadow:
    0 0 7px rgba(65, 245, 228, 1),
    0 0 20px rgba(65, 245, 228, .82);
}

.launcher-button:hover,
.launcher-button[aria-expanded="true"],
.workspace-nav-button:not(:disabled):hover,
.workspace-nav-button:not(:disabled):active {
  color: var(--cyan-bright) !important;
  text-shadow:
    0 0 6px rgba(65, 245, 228, .78),
    0 0 18px rgba(65, 245, 228, .52);
}

.workspace-nav-button:disabled {
  opacity: .24;
  cursor: default;
  pointer-events: none;
}

.system-identity {
  gap: .65rem;
  justify-self: center;
  letter-spacing: .17em;
  font-size: .62rem;
}

.system-mark {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(49, 207, 234, .4));
}

.system-title { color: var(--text); font-weight: 800; }
.system-context { color: var(--faint); }

.project-tabs {
  height: 100%;
  min-width: 0;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
}

.project-tabs::-webkit-scrollbar { display: none; }

.project-tab {
  position: relative;
  min-width: 92px;
  max-width: 190px;
  height: 100%;
  padding: 0 1rem;
  overflow: hidden;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-left: 1px solid var(--line);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .55rem;
  letter-spacing: .12em;
  cursor: pointer;
}

.project-tab.is-active {
  color: var(--cyan-bright);
  background: rgba(65, 245, 228, .055);
}

.project-tab.is-active::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--cyan);
}

.project-tab-close {
  margin-left: .55rem;
  color: var(--faint);
}

.background-picker {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: 0 .7rem;
  color: var(--faint);
  border-left: 1px solid var(--line);
  font-size: .5rem;
  letter-spacing: .12em;
}

.floating-background-picker {
  position: fixed;
  z-index: 950;
  top: clamp(.75rem, 2vw, 1.25rem);
  left: clamp(.75rem, 2vw, 1.25rem);
  height: auto;
  min-height: 0;
  padding: 0;
  color: rgba(178, 197, 218, .72);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.floating-background-picker .background-menu-toggle {
  min-width: clamp(9.5rem, 18vw, 13rem);
  min-height: 42px;
  padding: .45rem .8rem;
  background:
    linear-gradient(135deg, rgba(3, 8, 15, .86), rgba(5, 9, 17, .62)),
    radial-gradient(circle at 15% 0, rgba(65, 245, 228, .09), transparent 58%);
  border-color: rgba(143, 237, 232, .28);
  border-radius: 16px;
  box-shadow: 0 18px 55px rgba(0, 0, 0, .38), inset 0 1px rgba(255, 255, 255, .07);
  backdrop-filter: blur(22px) saturate(1.3);
}

.floating-background-picker .background-source-menu {
  top: calc(100% + .45rem);
  right: auto;
  bottom: auto;
  left: 0;
  border-radius: 12px;
  background: rgba(2, 6, 11, .92);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .55);
  backdrop-filter: blur(22px) saturate(1.25);
}

.background-menu-toggle {
  min-width: 8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  padding: .35rem .45rem;
  color: var(--cyan);
  background: #03080d;
  border: 1px solid var(--line);
  border-radius: 2px;
  font: inherit;
  letter-spacing: .08em;
  cursor: pointer;
}

.background-source-menu {
  position: absolute;
  z-index: 1400;
  right: 0;
  bottom: calc(100% + 1px);
  width: min(18rem, calc(100vw - 1rem));
  max-height: min(72vh, 38rem);
  overflow: auto;
  padding: .35rem 0;
  background: rgba(2, 6, 11, .98);
  border: 1px solid var(--line-strong);
  box-shadow: 0 -18px 48px rgba(0, 0, 0, .65);
}

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

.background-menu-group h3 {
  margin: .45rem .75rem .2rem;
  color: var(--violet);
  font-size: .44rem;
  font-weight: 700;
  letter-spacing: .14em;
}

.background-menu-group button {
  width: 100%;
  display: block;
  padding: .55rem 1rem;
  color: var(--cyan);
  background: transparent;
  border: 0;
  font: .56rem var(--mono);
  letter-spacing: .06em;
  text-align: left;
  cursor: pointer;
}

.background-menu-group button:hover,
.background-menu-group button:focus-visible,
.background-menu-group button.is-active {
  color: #020408;
  background: var(--cyan);
  outline: none;
}

.background-picker optgroup {
  color: var(--violet);
  font-size: .72em;
  font-weight: 700;
}

.background-picker optgroup option {
  color: var(--cyan);
  font-size: 1.38em;
  font-weight: 500;
  letter-spacing: normal;
  text-indent: 0;
}

body[data-background-name="pong"] .welcome-copy h1,
body[data-background-name="space-invaders"] .welcome-copy h1 {
  opacity: .42;
  mix-blend-mode: screen;
}

.source-toggle,
.background-source-panel button {
  height: 100%;
  padding: 0 .8rem;
  color: var(--cyan);
  background: transparent;
  border: 0;
  border-left: 1px solid var(--line);
  font-size: .52rem;
  letter-spacing: .12em;
  cursor: pointer;
}

.source-toggle[aria-expanded="true"] { background: rgba(65, 245, 228, .1); }

.background-source-panel {
  position: fixed;
  z-index: 900;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--background-editor-width, min(64vw, 960px));
  display: none;
  grid-template-rows: 42px minmax(0, 1fr);
  color: var(--text);
  background: rgba(2, 5, 10, .97);
  border-left: 1px solid var(--line-strong);
  box-shadow: -24px 0 70px rgba(0, 0, 0, .48);
  overflow: hidden;
}

.background-source-panel.is-open { display: grid; }
.background-panel-resizer {
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  left: -5px;
  width: 10px;
  height: auto !important;
  padding: 0 !important;
  border: 0 !important;
  cursor: ew-resize !important;
  touch-action: none;
}
.background-panel-resizer:hover,
.background-panel-resizer.is-dragging {
  background: linear-gradient(90deg, transparent 35%, var(--cyan) 35% 55%, transparent 55%);
}
.background-editor-toolbar {
  position: relative;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
}

.background-editor-toolbar button {
  border-left: 0;
  border-right: 1px solid var(--line);
}

.background-editor-toolbar [data-background-help],
.background-editor-toolbar [data-background-close] {
  width: 42px;
  padding: 0;
  border-right: 0;
  border-left: 1px solid var(--line);
  font-size: .7rem;
}

.background-editor-toolbar [data-background-help] { margin-left: auto; }
.background-editor-toolbar [data-background-close] { font-size: 1rem; }

.background-editor-toolbar [aria-pressed="true"] {
  color: var(--violet);
  background: rgba(156, 123, 255, .1);
}

.background-editor-toolbar .hara-editor-menubar__popover {
  top: calc(100% + 1px);
  right: .5rem;
}

.background-editor-shell {
  min-height: 0;
  border: 0;
  background: #010307;
}

.background-editor-shell .code-highlight,
.background-editor-shell .line-numbers,
.background-editor-shell textarea {
  font-size: var(--background-editor-font-size, .68rem);
  line-height: 1.65;
}

.background-editor-shell .code-highlight {
  overflow: hidden;
}

.background-editor-shell textarea {
  overflow: auto;
}

.runtime-state {
  appearance: none;
  border-block: 0;
  background: transparent;
  cursor: pointer;
  height: 100%;
  gap: .55rem;
  padding: 0 1rem;
  border-inline: 1px solid var(--line);
  color: var(--muted);
  font-size: .55rem;
  letter-spacing: .11em;
}

.runtime-state:hover,
.runtime-state[aria-expanded="true"] {
  color: var(--cyan);
  background:
    radial-gradient(ellipse 28px 100% at 1.2rem 50%, rgba(65, 245, 228, .15), transparent 78%),
    rgba(65, 245, 228, .055);
}

.runtime-state:focus-visible {
  outline: 1px solid var(--cyan);
  outline-offset: -2px;
}

.kernel-statistics {
  position: fixed;
  z-index: 130;
  right: .65rem;
  left: auto;
  bottom: calc(var(--dock-height) + .65rem);
  width: min(440px, calc(100vw - 1.3rem));
  max-height: min(680px, calc(100dvh - var(--dock-height) - 1.3rem));
  overflow: auto;
  border: 1px solid var(--cyan-dim);
  background: rgba(1, 5, 12, .97);
  box-shadow: 0 0 0 1px rgba(65, 245, 228, .06), 0 22px 70px rgba(0, 0, 0, .72);
  color: var(--text);
}

.kernel-statistics[hidden] { display: none; }

.kernel-statistics > header,
.kernel-statistics > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .8rem .9rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: .54rem;
  letter-spacing: .15em;
}

.kernel-statistics > header div {
  display: grid;
  gap: .28rem;
}

.kernel-statistics > header strong {
  color: var(--cyan);
  font-size: .66rem;
}

.kernel-statistics > header button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 1.1rem;
}

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

.kernel-statistics-group {
  min-width: 0;
  padding: .8rem .9rem;
  border-bottom: 1px solid var(--line);
}

.kernel-statistics-group:nth-child(odd) { border-right: 1px solid var(--line); }

.kernel-statistics-group h3 {
  margin: 0 0 .65rem;
  color: var(--violet);
  font-size: .5rem;
  font-weight: 600;
  letter-spacing: .16em;
}

.kernel-statistics-group dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .42rem .7rem;
  margin: 0;
  font-size: .55rem;
}

.kernel-statistics-group dt {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kernel-statistics-group dd {
  margin: 0;
  color: var(--text);
  text-align: right;
  overflow-wrap: anywhere;
}

.kernel-statistics > footer {
  border: 0;
  font-size: .46rem;
}

.runtime-led {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 10px rgba(245, 215, 66, .7);
  animation: blink 1.2s steps(2, end) infinite;
}

.runtime-led.is-live {
  background: var(--cyan);
  box-shadow: 0 0 11px rgba(65, 245, 228, .8);
  animation: none;
}

.runtime-led.is-error {
  background: var(--magenta);
  box-shadow: 0 0 11px rgba(255, 46, 136, .8);
  animation: none;
}

@keyframes blink { 50% { opacity: .25; } }

.workspace-viewport {
  position: fixed;
  z-index: 20;
  inset: 0 0 var(--dock-height);
  overflow: hidden;
}

.workspace-track {
  height: 100%;
  width: 100vw;
  display: flex;
  transform: translate3d(0, 0, 0);
  transition: none;
}

body[data-workspace="1"] .workspace-track { transform: none; }

.desktop-workspace,
.system-bottom-bar .project-tabs {
  display: none !important;
}

.workspace {
  position: relative;
  width: 100vw;
  height: 100%;
  flex: 0 0 100vw;
  overflow: hidden;
}

.welcome-workspace {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  align-content: center;
  gap: clamp(30px, 7vw, 120px);
  padding: clamp(48px, 7vw, 110px);
}

.welcome-copy,
.hero-callout { position: relative; z-index: 2; }

.hero-callout {
  width: clamp(150px, 15vw, 210px);
  height: clamp(60px, 6.3vw, 78px);
  display: grid;
  grid-template-areas: "stage";
  justify-items: stretch;
  justify-self: start;
  isolation: isolate;
  transform: translateY(clamp(8px, 1.5vh, 18px));
}

.welcome-kicker {
  margin: 0;
  color: var(--cyan);
  font-size: clamp(.58rem, .85vw, .78rem);
  letter-spacing: .25em;
}

.welcome-copy h1 {
  margin: .12em 0 .04em;
  color: transparent;
  background: linear-gradient(110deg, #f1ffff 5%, var(--cyan-bright) 28%, var(--cyan) 56%, #4a9fff 78%, var(--violet));
  background-size: 200% 100%;
  background-clip: text;
  font-family: var(--display);
  font-size: clamp(5.8rem, 17vw, 14rem);
  font-weight: 900;
  line-height: .82;
  letter-spacing: .045em;
  filter: drop-shadow(0 0 34px rgba(65, 245, 228, .24));
  animation: title-shift 14s ease-in-out infinite;
}

@keyframes title-shift {
  0%, 12%, 100% { background-position: 0 50%; }
  50%, 62% { background-position: 100% 50%; }
}

.welcome-tagline {
  margin: 0;
  color: #77d9e7;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 1.7vw, 1.4rem);
  font-style: italic;
  letter-spacing: -.03em;
  text-shadow: 0 0 22px rgba(65, 245, 228, .3);
}

.start-button {
  grid-area: stage;
  width: 100%;
  height: 70%;
  align-self: center;
  min-width: 0;
  min-height: 0;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 1.3rem;
  color: #031112;
  background: linear-gradient(115deg, #f2ffff, var(--cyan-bright) 30%, var(--cyan) 58%, #4ba8ff 82%, var(--violet));
  background-size: 220% 100%;
  border: 0;
  border-radius: 0;
  box-shadow: 0 0 25px rgba(65, 245, 228, .35), 0 0 70px rgba(156, 123, 255, .18);
  font-size: clamp(1rem, 1.55vw, 1.25rem);
  font-weight: 700;
  letter-spacing: .23em;
  cursor: pointer;
  transition: transform .5s cubic-bezier(.16, 1, .3, 1), letter-spacing .5s, opacity .3s;
}

.start-button i { font-size: 1.8em; font-style: normal; font-weight: 300; }

body.is-start-ready .start-button {
  display: flex;
  animation: start-breathe 4.5s ease-in-out infinite;
}

.start-button:hover {
  opacity: 1;
  letter-spacing: .13em;
  transform: translateY(-4px) scale(1.04);
}

.start-button:disabled {
  cursor: default;
  opacity: .42;
  filter: saturate(.55);
  animation: none;
}

.start-button:disabled:hover {
  letter-spacing: .23em;
  transform: none;
}

@keyframes start-breathe {
  50% { box-shadow: 0 0 35px rgba(65, 245, 228, .58), 0 0 95px rgba(156, 123, 255, .28); }
}

.desktop-workspace {
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(220px, .28fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) minmax(190px, .68fr);
  gap: 8px;
  padding: 12px 12px 44px;
  background: #020408;
}

.mobile-panel-tabs { display: none; }

.desktop-grid {
  position: absolute;
  z-index: 0;
  inset: 0;
  opacity: .32;
  background-image:
    linear-gradient(rgba(65, 245, 228, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(65, 245, 228, .055) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .9), transparent 95%);
}

.desktop-label,
.desktop-hint {
  position: absolute;
  color: var(--faint);
  font-size: .52rem;
  letter-spacing: .15em;
  pointer-events: none;
}

.desktop-label {
  top: 18px;
  left: 22px;
  right: 22px;
  display: flex;
  justify-content: space-between;
}

.desktop-hint { right: 22px; bottom: 12px; }

.app-window {
  position: absolute;
  z-index: 10;
  min-width: 260px;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  resize: both;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55), inset 0 1px rgba(255, 255, 255, .035);
  backdrop-filter: blur(20px) saturate(1.15);
}

.desktop-workspace .app-window {
  position: relative;
  inset: auto !important;
  width: auto !important;
  height: auto !important;
  min-width: 0;
  min-height: 0;
  resize: none;
  z-index: 2 !important;
  background: #030811;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .72), inset 0 1px rgba(255, 255, 255, .04);
}
.desktop-workspace .files-window { grid-column: 1; grid-row: 1 / span 2; }
.desktop-workspace .editor-window { grid-column: 2; grid-row: 1; }
.desktop-workspace .canvas-window { grid-column: 2; grid-row: 2; }
.desktop-workspace .desktop-hint { display: none; }

body[data-workspace="1"] .background-picker,
body[data-workspace="1"] .source-toggle { display: none; }

.app-window::before,
.app-window::after {
  content: "";
  position: absolute;
  z-index: 5;
  width: 10px;
  height: 10px;
  pointer-events: none;
}

.app-window::before {
  left: -1px;
  top: -1px;
  border-left: 2px solid var(--cyan);
  border-top: 2px solid var(--cyan);
}

.app-window::after {
  right: -1px;
  bottom: -1px;
  border-right: 2px solid var(--cyan);
  border-bottom: 2px solid var(--cyan);
}

.app-window.is-focused {
  border-color: rgba(65, 245, 228, .65);
  box-shadow: 0 26px 80px rgba(0, 0, 0, .65), 0 0 25px rgba(65, 245, 228, .08);
}

.app-window.is-hidden { display: none; }

.app-window.is-maximized {
  inset: 18px 18px 28px !important;
  width: auto !important;
  height: auto !important;
  resize: none;
}

.files-window { left: 2.4vw; top: 7vh; width: min(22vw, 330px); height: 73vh; }
.editor-window { left: 24.8vw; top: 4vh; width: 45vw; height: 78vh; }
.canvas-window { left: 67.5vw; top: 11vh; width: 30vw; height: 64vh; }
.window-titlebar {
  min-height: 38px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  flex: none;
  background: rgba(2, 5, 10, .82);
  border-bottom: 1px solid var(--line);
  user-select: none;
  cursor: move;
  touch-action: none;
}

.window-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .65rem;
  padding-left: .85rem;
  color: var(--muted);
  font-size: .58rem;
  letter-spacing: .15em;
}

.window-number { color: var(--cyan); }

.dirty-indicator {
  width: 6px;
  height: 6px;
  display: none;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 7px var(--amber);
}

.dirty-indicator.is-dirty { display: inline-block; }
.window-controls { display: flex; }

.window-controls button {
  width: 38px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-left: 1px solid var(--line);
  cursor: pointer;
}

.window-controls button:hover {
  color: var(--cyan);
  background: rgba(65, 245, 228, .08);
}

.window-toolbar,
.window-status {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  padding: 0 .8rem;
  color: var(--faint);
  background: rgba(2, 5, 10, .54);
  font-size: .5rem;
  letter-spacing: .12em;
}

.window-toolbar { border-bottom: 1px solid var(--line); }
.window-status { border-top: 1px solid var(--line); }

.window-toolbar button {
  padding: .3rem .45rem;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: .5rem;
  letter-spacing: .1em;
  cursor: pointer;
}

.window-toolbar button:hover:not(:disabled) { color: var(--cyan); }
.window-toolbar button:disabled { opacity: .28; cursor: not-allowed; }

.editor-toolbar .run-button {
  margin-left: .5rem;
  padding: .35rem .7rem;
  color: #031112;
  background: var(--cyan);
  border-radius: 2px;
}

.editor-toolbar .run-button:hover:not(:disabled) {
  color: #031112;
  background: var(--cyan-bright);
}

.editor-toolbar .paredit-button {
  color: var(--violet);
  border-color: rgba(156, 123, 255, .42);
}

.editor-toolbar .paredit-button[aria-pressed="false"] {
  color: var(--faint);
  border-color: rgba(123, 145, 164, .24);
}

.file-tree {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: .55rem 0;
}

.file-group {
  padding: .55rem .8rem .3rem;
  color: var(--faint);
  font-size: .5rem;
  letter-spacing: .14em;
}

.file-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .46rem .8rem;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  text-align: left;
  font-size: .66rem;
  cursor: pointer;
}

.file-row::before { content: "◇"; color: var(--faint); }
.file-row:hover { color: var(--text); background: rgba(65, 245, 228, .04); }

.file-row.is-active {
  color: var(--cyan);
  background: rgba(65, 245, 228, .07);
  border-left-color: var(--cyan);
}

.window-loading {
  padding: 1rem;
  color: var(--faint);
  font-size: .58rem;
  letter-spacing: .1em;
}

.editor-surface {
  position: relative;
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  overflow: hidden;
  background: rgba(1, 3, 7, .42);
}

.line-numbers {
  padding: .9rem .65rem;
  overflow: hidden;
  color: #31485b;
  border-right: 1px solid rgba(65, 245, 228, .08);
  font-size: .68rem;
  line-height: 1.65;
  text-align: right;
  white-space: pre;
  user-select: none;
}

.line-numbers .is-changed { color: var(--amber); }
.line-numbers .is-changed::before { content: "◆ "; color: var(--pink); }

.structural-diff {
  position: absolute;
  z-index: 5;
  top: .7rem;
  right: .7rem;
  width: min(280px, calc(100% - 1.4rem));
  max-height: calc(100% - 1.4rem);
  overflow: auto;
  padding: .7rem .8rem;
  color: var(--text);
  background: rgba(3, 11, 18, .97);
  border: 1px solid rgba(65, 245, 228, .34);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .48);
  font: .58rem/1.65 "SFMono-Regular", Consolas, monospace;
  letter-spacing: .05em;
  white-space: pre-wrap;
}

.editor-surface textarea {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: .9rem 1rem;
  resize: none;
  color: transparent;
  background: transparent;
  border: 0;
  outline: 0;
  caret-color: var(--cyan);
  font-size: .68rem;
  line-height: 1.65;
  tab-size: 2;
  white-space: pre;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.code-highlight {
  grid-column: 2;
  grid-row: 1;
  z-index: 0;
  min-width: 0;
  margin: 0;
  padding: .9rem 1rem;
  overflow: hidden;
  color: #c9d8e6;
  font: .68rem/1.65 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  tab-size: 2;
  white-space: pre;
  pointer-events: none;
}

.code-highlight-content {
  display: block;
  width: max-content;
  min-width: 100%;
  transform-origin: top left;
  will-change: transform;
}

.code-highlight .paren-0 { color: #41f5e4; }
.code-highlight .paren-1 { color: #f5d742; }
.code-highlight .paren-2 { color: #ff2e88; }
.code-highlight .paren-3 { color: #9c7bff; }
.code-highlight .paren-4 { color: #6ee7ff; }
.code-highlight .paren-5 { color: #a6ff6e; }
.code-highlight .comment { color: #53677a; }
.code-highlight .string { color: #f5d742; }
.code-highlight .keyword { color: #9c7bff; }
.code-highlight .unmatched { color: #ff2e88; background: rgba(255, 46, 136, .15); }
.code-highlight .eval-target { background: rgba(65, 245, 228, .12); box-shadow: inset 0 -1px 0 rgba(65, 245, 228, .34); }

.inline-eval {
  position: absolute;
  z-index: 3;
  max-width: min(42%, 340px);
  overflow: hidden;
  padding: 1px 6px;
  color: var(--cyan);
  background: rgba(2, 12, 16, .94);
  border: 1px solid rgba(65, 245, 228, .28);
  font: .61rem/1.35 "SFMono-Regular", Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.inline-eval.is-error { color: var(--pink); border-color: rgba(255, 46, 136, .35); }
.inline-eval.is-pending { color: var(--amber); border-color: rgba(245, 215, 66, .4); }

.hal-completions {
  position: absolute;
  z-index: 4;
  min-width: 190px;
  max-width: 320px;
  max-height: 190px;
  overflow: auto;
  padding: 4px;
  background: #071019;
  border: 1px solid rgba(65, 245, 228, .32);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
}

.hal-completion {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 6px 8px;
  color: var(--text);
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.hal-completion strong { color: var(--cyan); font: .64rem "SFMono-Regular", Consolas, monospace; }
.hal-completion small { color: var(--muted); font-size: .52rem; }
.hal-completion.is-active, .hal-completion:hover { background: rgba(65, 245, 228, .1); }

.editor-surface textarea::selection {
  color: #fff;
  background: rgba(65, 245, 228, .25);
}

.canvas-wrap {
  position: relative;
  min-height: 0;
  flex: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(45deg, rgba(65, 245, 228, .025) 25%, transparent 25%, transparent 75%, rgba(65, 245, 228, .025) 75%),
    #010307;
  background-size: 18px 18px;
}

.canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.canvas-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: .6rem;
  color: var(--faint);
  text-align: center;
  letter-spacing: .16em;
  pointer-events: none;
}

.canvas-empty span {
  color: var(--cyan);
  font-size: 1rem;
  text-shadow: 0 0 18px rgba(65, 245, 228, .5);
}

.canvas-empty small { font-size: .5rem; }
.canvas-empty.is-hidden { display: none; }

.app-launcher {
  position: fixed;
  z-index: 1100;
  top: auto;
  bottom: calc(var(--dock-height) + 12px);
  left: 12px;
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - var(--dock-height) - 20px);
  overflow-y: auto;
  color: #031112;
  background: linear-gradient(115deg, rgba(242, 255, 255, .9), rgba(65, 245, 228, .88) 34%, rgba(49, 207, 234, .88) 61%, rgba(75, 168, 255, .88) 82%, rgba(156, 123, 255, .88));
  border: 1px solid rgba(255, 255, 255, .46);
  border-radius: 24px 5px;
  box-shadow: 0 0 28px rgba(65, 245, 228, .32), 0 24px 75px rgba(0, 0, 0, .48);
  backdrop-filter: blur(24px) saturate(1.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(.97);
  transform-origin: bottom left;
  transition: opacity .18s, transform .25s cubic-bezier(.16, 1, .3, 1), visibility .18s;
}

.site-launcher-links {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .12rem;
  padding: .32rem;
}

.site-launcher-links a {
  min-height: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .32rem;
  color: #031112;
  border-radius: 13px 3px;
  text-decoration: none;
  transition: background .18s, transform .18s;
}

.site-launcher-links a:hover,
.site-launcher-links a:focus-visible {
  background: rgba(255, 255, 255, .28);
  outline: none;
  transform: translateY(-3px);
}

.site-launcher-links a > span {
  min-width: 34px;
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(3, 17, 18, .68);
  border-radius: 10px 3px;
  font: 800 .58rem var(--mono);
}

.site-launcher-links strong {
  font: 800 .42rem var(--mono);
  letter-spacing: .1em;
}

.app-launcher.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.launcher-head,
.launcher-foot {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: .55rem;
  letter-spacing: .16em;
}

.launcher-head {
  position: sticky;
  z-index: 2;
  top: 0;
  background: rgba(3, 7, 13, .98);
}

.launcher-actions {
  display: flex;
  align-self: stretch;
  margin-right: -1rem;
}

.launcher-actions button {
  padding: 0 .65rem;
  color: var(--faint);
  background: transparent;
  border: 0;
  border-left: 1px solid var(--line);
  font: .44rem var(--mono);
  letter-spacing: .1em;
  cursor: pointer;
}

.launcher-actions button:hover {
  color: var(--cyan-bright);
  background: rgba(65, 245, 228, .07);
}

.system-bottom-bar {
  position: fixed;
  z-index: 1000;
  inset: auto 0 0;
  height: var(--dock-height);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  color: #031112;
  overflow: visible;
  background: linear-gradient(90deg, rgba(255, 255, 255, .2), rgba(65, 245, 228, .14));
  border: 0;
  border-radius: 0;
  box-shadow: 0 -10px 42px rgba(65, 245, 228, .07);
  backdrop-filter: blur(18px) saturate(1.15);
}

.bottom-navigation {
  align-self: stretch;
  flex: 0 0 auto;
}

.system-bottom-bar .system-button {
  min-height: var(--bottom-height);
  border: 0;
  color: #031112;
  border-radius: 0;
}

.system-bottom-bar .project-tabs {
  flex: 1 1 auto;
  min-width: 0;
}

.home-tools {
  align-self: stretch;
  display: flex;
  align-items: stretch;
  margin-left: auto;
  border: 0;
}

.publish-button {
  align-self: stretch;
  padding: 0 .9rem;
  color: var(--cyan);
  background: transparent;
  border: 0;
  border-left: 0;
  font: .55rem var(--mono);
  letter-spacing: .12em;
  cursor: pointer;
}

.system-bottom-bar .project-tab,
.system-bottom-bar .source-toggle,
.system-bottom-bar .runtime-state {
  border-inline: 0;
}

.system-bottom-bar .project-tab {
  color: #031112;
}

.system-bottom-bar .source-toggle {
  color: #031112;
  border-radius: 0;
}

.system-bottom-bar .runtime-state {
  width: var(--bottom-height);
  min-width: var(--bottom-height);
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.system-bottom-bar .runtime-state:hover,
.system-bottom-bar .runtime-state[aria-expanded="true"] {
  background: radial-gradient(circle, rgba(65, 245, 228, .18), rgba(65, 245, 228, .04) 55%, transparent 72%);
}

.publish-button:disabled { display: none; }
.publish-button:hover { color: var(--cyan-bright); background: rgba(65, 245, 228, .08); }

.settings-button,
.help-button {
  align-self: stretch;
  padding: 0 .85rem;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-left: 1px solid var(--line);
  font: .55rem var(--mono);
  letter-spacing: .12em;
  cursor: pointer;
}

.settings-button:hover,
.help-button:hover { color: var(--cyan-bright); background: rgba(65, 245, 228, .08); }

.launcher-index { color: var(--cyan); }

.launcher-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  padding: 1px;
  background: var(--line);
}

.app-tile {
  min-height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  color: var(--muted);
  background: #050a12;
  border: 0;
  font-size: .58rem;
  letter-spacing: .12em;
  text-decoration: none;
  cursor: pointer;
  transition: color .15s, background .15s;
}

.app-tile:hover { color: var(--cyan-bright); background: rgba(65, 245, 228, .08); }

.app-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--cyan);
  background: rgba(65, 245, 228, .06);
  border: 1px solid var(--line-strong);
  border-radius: 8px 2px;
  font-size: .8rem;
  font-weight: 800;
  box-shadow: 0 0 18px rgba(65, 245, 228, .07);
}

.app-icon-canvas { color: var(--magenta); border-color: rgba(255, 46, 136, .42); }
.app-icon-editor { color: var(--violet); border-color: rgba(156, 123, 255, .45); font-size: .62rem; }

.launcher-foot {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  color: var(--faint);
}

.launcher-projects {
  border-top: 1px solid var(--line);
  max-height: 210px;
  overflow: auto;
}

.launcher-projects > strong {
  display: block;
  padding: .8rem 1rem .55rem;
  color: var(--faint);
  font-size: .5rem;
  letter-spacing: .15em;
}

.saved-workspace-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  border-top: 1px solid rgba(65, 245, 228, .08);
}

.saved-workspace,
.launcher-empty {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-top: 0;
  font: .55rem var(--mono);
  letter-spacing: .08em;
  text-align: left;
}

.saved-workspace { cursor: pointer; }
.saved-workspace:hover { color: var(--cyan-bright); background: rgba(65, 245, 228, .06); }

.saved-workspace-delete {
  padding: 0 .8rem;
  color: var(--faint);
  background: transparent;
  border: 0;
  border-left: 1px solid rgba(65, 245, 228, .08);
  font: .45rem var(--mono);
  letter-spacing: .09em;
  cursor: pointer;
}

.saved-workspace-delete:hover {
  color: #ff7aa8;
  background: rgba(255, 46, 136, .08);
}

.launcher-scrim {
  position: fixed;
  z-index: 1090;
  inset: 0 0 var(--dock-height);
  display: none;
  background: rgba(0, 0, 0, .16);
}

.launcher-scrim.is-open { display: block; }

.kernel-loading {
  grid-area: stage;
  align-self: center;
  justify-self: stretch;
  position: relative;
  top: auto;
  left: auto;
  width: 100%;
  padding: .1rem .15rem;
  display: grid;
  pointer-events: none;
  grid-template-columns: 1fr auto;
  gap: .3rem .8rem;
  color: var(--cyan-bright);
  background: transparent;
  font-size: .52rem;
  letter-spacing: .14em;
}

.kernel-loading[hidden] { display: none; }
.kernel-loading > span,
.kernel-loading > strong {
  min-width: 0;
  overflow: hidden;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kernel-loading small {
  grid-column: 1 / -1;
  min-width: 0;
  overflow: hidden;
  color: var(--faint);
  font: .42rem var(--mono);
  letter-spacing: .1em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kernel-loading i {
  grid-column: 1 / -1;
  height: 4px;
  overflow: hidden;
  background: rgba(65, 245, 228, .12);
  border-radius: 999px;
}
.kernel-loading b {
  display: block;
  width: 0;
  height: 100%;
  background: var(--cyan);
  box-shadow: 0 0 9px var(--cyan);
  transition: width .18s ease;
}

.hara-dialog {
  width: min(430px, calc(100vw - 30px));
  padding: 0;
  color: var(--text);
  background: #050a12;
  border: 1px solid var(--line-strong);
  box-shadow: 0 35px 110px #000, 0 0 30px rgba(65, 245, 228, .12);
}

.hara-dialog::backdrop {
  background: rgba(0, 2, 5, .72);
  backdrop-filter: blur(4px);
}

.dialog-head {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 1rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: .58rem;
  letter-spacing: .15em;
}

.workspace-template-dialog,
.publish-dialog,
.ai-dialog { width: min(620px, calc(100vw - 24px)); }

.workspace-name-field {
  display: grid;
  gap: .45rem;
  padding: 1rem;
  color: var(--muted);
  font-size: .55rem;
  letter-spacing: .14em;
}

.workspace-name-field input {
  min-height: 42px;
  padding: 0 .8rem;
  color: var(--text);
  background: #020408;
  border: 1px solid var(--line);
  font-size: .75rem;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  padding: 1px;
  background: var(--line);
}

.template-option {
  min-height: 104px;
  display: grid;
  place-content: center;
  gap: .6rem;
  color: var(--muted);
  background: #040911;
  border: 0;
  font: .58rem var(--mono);
  letter-spacing: .09em;
  cursor: pointer;
}

.template-option::before {
  content: attr(data-symbol);
  color: var(--cyan);
  font-size: 1rem;
}

.template-option:hover { color: var(--cyan-bright); background: rgba(65, 245, 228, .07); }

.publish-dialog > p,
.publish-note {
  margin: 0;
  padding: 1rem;
  color: var(--muted);
  font-size: .62rem;
  line-height: 1.6;
}

.publish-visibility {
  display: flex;
  gap: .6rem;
  align-items: center;
  padding: 0 1rem 1rem;
  color: var(--cyan-bright);
  font-size: .6rem;
}

.publish-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
}

.publish-options button {
  min-height: 64px;
  color: var(--muted);
  background: #040911;
  border: 0;
  font: .55rem var(--mono);
  letter-spacing: .08em;
  cursor: pointer;
}

.publish-options button:hover { color: var(--cyan-bright); }

.account-state {
  min-height: 128px;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem;
}
.account-state img {
  width: 58px;
  height: 58px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}
.account-state div { display: grid; gap: .5rem; }
.account-state strong { color: var(--cyan-bright); font-size: .72rem; letter-spacing: .1em; }
.account-state span { color: var(--muted); font-size: .58rem; line-height: 1.5; }
.account-actions { padding-top: 0; }

.settings-options {
  display: grid;
  gap: 1px;
  padding: 1px;
  background: var(--line);
}

.settings-options button {
  display: grid;
  gap: .45rem;
  padding: 1.1rem 1.2rem;
  text-align: left;
  color: var(--muted);
  background: #02060c;
  border: 0;
  cursor: pointer;
}

.settings-options button:hover,
.settings-options button:focus-visible {
  color: var(--cyan-bright);
  background: rgba(65, 245, 228, .08);
  outline: none;
}

.settings-options strong {
  color: var(--cyan-bright);
  font: .65rem var(--mono);
  letter-spacing: .12em;
}

.settings-options span {
  font: .55rem/1.5 var(--mono);
  letter-spacing: .04em;
}

.ai-dialog > p { margin: 0; padding: 1rem 1.2rem .4rem; }
.adapter-list {
  max-height: 150px;
  overflow: auto;
  margin: .7rem 1.2rem 0;
  border: 1px solid var(--line);
}
.adapter-empty,
.adapter-row {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .65rem .8rem;
  color: var(--muted);
  font-size: .55rem;
}
.adapter-row + .adapter-row { border-top: 1px solid var(--line); }
.adapter-row strong { color: var(--cyan-bright); }
.adapter-row button {
  color: var(--magenta);
  background: none;
  border: 0;
  cursor: pointer;
}
.adapter-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: .5rem;
}
.adapter-form label { padding: .55rem !important; }
.adapter-form select {
  width: 100%;
  min-height: 41px;
  padding: 0 .7rem;
  color: var(--text);
  background: #020408;
  border: 1px solid var(--line);
  font: .62rem var(--mono);
}
.adapter-form .dialog-actions { grid-column: 1 / -1; }

.dialog-head button {
  align-self: stretch;
  width: 42px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-left: 1px solid var(--line);
  cursor: pointer;
}

.hara-dialog label {
  display: grid;
  gap: .6rem;
  padding: 1.2rem 1.2rem .7rem;
  color: var(--faint);
  font-size: .52rem;
  letter-spacing: .13em;
}

.hara-dialog input {
  width: 100%;
  padding: .75rem .8rem;
  color: var(--cyan-bright);
  background: #010408;
  border: 1px solid var(--line);
  outline: none;
}

.hara-dialog p {
  min-height: 1.2em;
  margin: 0;
  padding: 0 1.2rem;
  color: var(--muted);
  font-size: .62rem;
}

.help-content { padding: 1.2rem; color: var(--muted); font: .7rem/1.6 system-ui, sans-serif; }
.help-content p { padding: 0; margin: 0 0 1rem; }
.help-content dl { display: grid; gap: .6rem; margin: 0; }
.help-content dl div { display: grid; grid-template-columns: 6rem 1fr; gap: .75rem; }
.help-content dt { color: var(--cyan-bright); font: .58rem var(--mono); letter-spacing: .08em; }
.help-content dd { margin: 0; }

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  padding: 1rem 1.2rem 1.2rem;
}

.dialog-actions button {
  padding: .55rem .8rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  font-size: .55rem;
  letter-spacing: .1em;
  cursor: pointer;
}

.dialog-actions .dialog-confirm {
  color: #031112;
  background: var(--cyan);
  border-color: var(--cyan);
}

.toast-stack {
  position: fixed;
  z-index: 1300;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  max-width: min(420px, calc(100vw - 36px));
  padding: .75rem 1rem;
  color: var(--text);
  background: rgba(4, 9, 16, .96);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--cyan);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
  font-size: .6rem;
  line-height: 1.5;
  letter-spacing: .06em;
  animation: toast-in .3s cubic-bezier(.16, 1, .3, 1);
}

.toast.is-error { border-left-color: var(--magenta); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 900px) {
  .system-context { display: none; }

  .welcome-workspace {
    grid-template-columns: 1fr;
    align-content: center;
    justify-items: start;
  }

  .start-button { min-height: 0; }
}

@media (max-width: 700px) {
  :root {
    --bar-height: 0px;
    --bottom-height: 48px;
    --dock-height: 48px;
  }
  .system-bottom-bar {
    display: flex;
    gap: .1rem;
  }
  .system-bottom-bar .project-tabs { flex: 1 1 auto; }
  .system-bottom-bar .home-tools { flex: 0 0 auto; }
  .system-bottom-bar .bottom-navigation { flex: 0 0 auto; }
  .system-bottom-bar .runtime-state { flex: 0 0 48px; }
  .system-bottom-bar .publish-button {
    display: none;
  }
  .system-button { min-width: 44px; }
  .workspace-nav-button { display: grid; }
  .system-title { display: none; }
  .system-mark { width: 22px; height: 22px; }
  .project-tab { min-width: 66px; padding: 0 .55rem; font-size: .46rem; }
  .background-picker {
    display: flex;
    min-width: 0;
    padding: 0 .35rem;
  }
  .floating-background-picker {
    top: .65rem;
    left: .65rem;
    min-height: 50px;
    max-width: calc(100vw - 1.3rem);
    padding: 0;
    border-radius: 13px;
  }
  .background-picker > span { display: none; }
  .background-menu-toggle {
    width: clamp(5rem, 27vw, 7rem);
    min-width: 0;
    max-width: 100%;
  }
  .site-launcher-links {
    grid-template-columns: repeat(5, minmax(72px, 1fr));
    overflow-x: auto;
  }
  .site-launcher-links a { min-height: 74px; }
  body[data-workspace="1"] .background-picker {
    display: flex;
  }
  .source-toggle { display: block; }
  body[data-workspace="1"] .source-toggle { display: none; }
  .background-source-panel {
    top: auto;
    left: 0;
    width: 100%;
    height: 58vh;
    bottom: calc(var(--dock-height) + 1.3rem);
    resize: vertical;
    border-top: 1px solid var(--line-strong);
    border-left: 0;
  }
  .background-panel-resizer { display: none; }
  .system-bottom-bar .runtime-state { min-width: 46px; padding: 0 .8rem; }
  .settings-button span,
  .help-button span { display: none; }
  .settings-button,
  .help-button { padding: 0 .7rem; }
  .welcome-workspace {
    padding: 9vh 7vw 12vh;
    grid-template-columns: 1fr;
    align-content: center;
    justify-items: stretch;
    gap: 2rem;
  }
  .welcome-copy h1 { font-size: clamp(4.8rem, 28vw, 8rem); }
  .welcome-kicker { font-size: .5rem; letter-spacing: .18em; }
  .welcome-tagline { font-size: 1rem; }
  .start-button {
    gap: .8rem;
    font-size: .9rem;
    justify-self: start;
  }
  .hero-callout { width: min(180px, calc(100vw - 3rem)); height: 48px; }
  .launcher-grid { grid-template-columns: repeat(2, 1fr); }
  .app-tile { min-height: 96px; }
  .template-grid { grid-template-columns: repeat(2, 1fr); }
  .publish-options { grid-template-columns: 1fr; }
  .ai-dialog { max-height: calc(100vh - 24px); overflow: auto; }
  .adapter-form { grid-template-columns: 1fr; }
  .adapter-form .dialog-actions { grid-column: 1; }
  .desktop-workspace {
    display: block;
    padding: 48px 8px 40px;
  }
  .mobile-panel-tabs {
    position: absolute;
    z-index: 20;
    inset: 8px 8px auto;
    height: 40px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .desktop-workspace .app-window {
    position: absolute;
    inset: 56px 8px 40px !important;
    width: auto !important;
    height: auto !important;
  }
  .desktop-workspace .app-window:not(.is-focused) { display: none; }
  .desktop-workspace .app-window.is-focused { display: flex; }
  .window-titlebar { min-height: 42px; }
  .window-controls button { min-width: 44px; }
  .window-toolbar { overflow-x: auto; }
  .editor-toolbar { overflow: visible; }
  .editor-toolbar > div {
    display: flex;
    align-items: center;
    gap: .25rem;
  }
  .editor-toolbar button {
    width: 40px;
    min-width: 40px;
    height: 32px;
    padding: 0;
    display: grid;
    place-items: center;
    font-size: 0;
    letter-spacing: 0;
  }
  .editor-toolbar button::before {
    font: 700 1rem/1 var(--mono);
  }
  .editor-toolbar .paredit-button::before { content: "()"; }
  .editor-toolbar [data-save]::before { content: "⇩"; }
  .editor-toolbar .run-button {
    margin-left: 0;
    padding: 0;
  }
  .editor-toolbar .run-button > span {
    font-size: 1rem;
    line-height: 1;
  }
  .window-toolbar > span,
  .window-status span:last-child { display: none; }
  .toast-stack { right: 10px; bottom: var(--dock-height); }
}

@media (max-width: 480px) {
  .kernel-statistics {
    left: 0;
    bottom: var(--dock-height);
    width: 100vw;
    max-height: calc(100dvh - var(--dock-height));
    border-inline: 0;
  }

  .kernel-statistics-grid { grid-template-columns: 1fr; }
  .kernel-statistics-group:nth-child(odd) { border-right: 0; }
}

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