      :root {
        color-scheme: dark;
        --bg: #05070a;
        --blue: #00005f;
        --blue2: #000040;
        --text: #f8fafc;
        --muted: #93a4b8;
        --accent: #6ee7b7;
        --warn: #fbbf24;
        --ui-bg: #05070a;
        --toolbar-bg: #00005f;
        --control-bg: #000040;
        --menu-bg: #05070a;
        --dialog-bar-bg: #00005f;
        --editor-bar-bg: #00005f;
        --tab-bar-bg: #000040;
        --gutter-bg: #00005f;
        --keyboard-bar-bg: #00005f;
        --keyboard-key-bg: #000040;
        --terminal-bg: #05070a;
        --terminal-text: #f8fafc;
        --cursor-bg: #6ee7b7;
        --cursor-text: #00130d;
        --selection-bg: #f8fafc;
        --selection-text: #00005f;
        --live-bg: #001b35;
        --live-cell-bg: #00d0ff;
        --live-cell-text: #001018;
        --syntax-comment: #9ca3af;
        --syntax-string: #22c55e;
        --syntax-number: #fbbf24;
        --syntax-keyword: #67e8f9;
        --syntax-form: #e879f9;
        --syntax-punct: #93c5fd;
        --repl-result-bg: #07131a;
        --repl-result-text: #93c5fd;
        --repl-error-text: #fca5a5;
        --repl-status-text: #6ee7b7;
        --toolbar-height: calc(1.15em + 2px);
        --tab-bar-height: max(28px, calc(var(--app-font-size) * 1.75));
        --app-font-size: 15px;
        --control-height: calc(var(--app-font-size) * 2.6);
        --compact-control-height: calc(var(--app-font-size) * 2.2);
        --overlay-row-height: calc(var(--app-font-size) * 2.45);
        --keyboard-height: 178px;
        --viewport-bottom-inset: 0px;
        --safe-bottom-inset: max(env(safe-area-inset-bottom, 0px), var(--viewport-bottom-inset));
      }

      html.app-booting body {
        visibility: hidden;
      }

      * {
        box-sizing: border-box;
      }

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

      body {
        --keyboard-height: 0px;
        display: grid;
        grid-template-rows: var(--toolbar-height) var(--tab-bar-height) minmax(0, 1fr) calc(var(--keyboard-height) + var(--safe-bottom-inset));
        font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
        font-size: var(--app-font-size);
        line-height: 1.15;
      }

      .toolbar {
        display: flex;
        align-items: center;
        gap: 0;
        padding: 0;
        border-bottom: 2px solid var(--ui-bg);
        background: var(--toolbar-bg);
        color: var(--text);
        font-family: inherit;
        overflow-x: hidden;
        overflow-y: hidden;
      }

      .tab-bar {
        position: relative;
        z-index: 5;
        display: flex;
        align-items: stretch;
        min-width: 0;
        min-height: var(--tab-bar-height);
        height: var(--tab-bar-height);
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        touch-action: pan-x;
        background: var(--tab-bar-bg);
        color: var(--text);
        border-bottom: 2px solid var(--ui-bg);
        scrollbar-width: thin;
        pointer-events: auto;
      }

      .tab-bar .tab,
      .tab-bar .tab-spacer {
        position: relative;
        z-index: 6;
        flex: 0 0 auto;
        min-width: 12ch;
        min-height: var(--tab-bar-height);
        height: var(--tab-bar-height);
        padding: 0 1ch;
        border: 0;
        border-right: 1px solid var(--ui-bg);
        border-radius: 0;
        background: transparent;
        color: inherit;
        font: inherit;
        line-height: inherit;
        white-space: pre;
        text-align: center;
        display: inline-flex;
        align-items: center;
        justify-content: center;
      }

      .tab-bar .tab {
        cursor: pointer;
        touch-action: pan-x;
        pointer-events: auto;
        user-select: none;
        -webkit-user-select: none;
      }

      .tab-bar .tab.active,
      .tab-bar .tab:focus-visible {
        outline: 0;
        background: var(--selection-bg);
        color: var(--selection-text);
      }

      .brand {
        flex: 0 0 auto;
        align-self: stretch;
        display: inline-flex;
        align-items: center;
        padding: 0 1ch;
        background: var(--toolbar-bg);
        color: var(--text);
        font-weight: 700;
        font-size: inherit;
        white-space: nowrap;
      }

      button.brand {
        border-left: 0;
      }

      button,
      label.button,
      select {
        flex: 0 0 auto;
        align-self: stretch;
        height: auto;
        min-height: 1.15em;
        border: 0;
        border-left: 1px solid var(--ui-bg);
        border-radius: 0;
        background: var(--control-bg);
        color: var(--text);
        padding: 0 1ch;
        font: inherit;
        display: inline-flex;
        align-items: center;
        cursor: pointer;
        white-space: nowrap;
      }

      select {
        appearance: none;
      }

      button:hover,
      label.button:hover,
      select:hover,
      button:focus-visible,
      label.button:focus-within,
      select:focus-visible {
        outline: 0;
        background: var(--selection-bg);
        color: var(--selection-text);
      }

      select {
        min-width: 11ch;
      }

      input[type="file"]:not(.fallback-file-input) {
        display: none;
      }

      input.fallback-file-input {
        position: absolute;
        width: 1px;
        height: 1px;
        opacity: 0;
        pointer-events: none;
      }

      .file-menu {
        position: absolute;
        top: var(--toolbar-height);
        left: 0;
        right: auto;
        width: max-content;
        max-width: calc(100vw - 8px);
        justify-self: start;
        align-self: start;
        z-index: 30;
        min-width: 24ch;
        border: 1px solid var(--text);
        background: var(--menu-bg);
        color: var(--text);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
        max-height: calc(100vh - var(--toolbar-height) - 8px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
      }

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

      .file-menu button {
        width: 100%;
        border-left: 0;
        border-bottom: 1px solid var(--editor-bar-bg);
        justify-content: flex-start;
        background: var(--menu-bg);
      }

      .file-menu button:last-child {
        border-bottom: 0;
      }

      .file-menu button:hover,
      .file-menu button:focus-visible {
        background: var(--warn);
        color: var(--bg);
      }

      .context-menu {
        position: fixed;
        z-index: 50;
        min-width: 12ch;
        border: 1px solid var(--text);
        background: var(--menu-bg);
        color: var(--text);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
        max-height: calc(100vh - 8px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
      }

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

      .context-menu button {
        width: 100%;
        border-left: 0;
        border-bottom: 1px solid var(--editor-bar-bg);
        justify-content: flex-start;
        appearance: none;
        -webkit-appearance: none;
        background: var(--menu-bg);
        color: var(--text);
        -webkit-text-fill-color: var(--text);
      }

      .context-menu button:hover,
      .context-menu button:focus,
      .context-menu button:focus-visible,
      .context-menu button:active {
        background: var(--selection-bg);
        color: var(--selection-text);
        -webkit-text-fill-color: var(--selection-text);
        outline: 0;
      }

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

      .dialog-backdrop {
        position: fixed;
        inset: 0;
        z-index: 40;
        display: grid;
        place-items: center;
        padding: 24px;
        background: rgba(0, 0, 0, 0.45);
      }

      .dialog-backdrop[hidden] {
        display: none;
      }

      .dialog {
        width: min(52ch, 100%);
        border: 1px solid var(--text);
        background: var(--ui-bg);
        color: var(--text);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
      }

      .dialog-title,
      .dialog-actions {
        background: var(--dialog-bar-bg);
      }

      .dialog-title,
      .dialog-body {
        padding: 0.4em 1ch;
        white-space: pre-wrap;
      }

      .dialog-actions {
        display: flex;
        justify-content: flex-end;
      }

      .docs-dialog {
        width: min(980px, calc(100vw - 32px));
        height: min(760px, calc(100vh - 32px));
        display: grid;
        grid-template-rows: auto auto minmax(0, 1fr);
      }

      .docs-controls {
        display: flex;
        gap: 0;
        background: var(--control-bg);
        border-bottom: 1px solid var(--blue);
      }

      .docs-controls input {
        flex: 1 1 auto;
        min-width: 12ch;
        border: 0;
        border-left: 1px solid var(--bg);
        border-radius: 0;
        background: var(--ui-bg);
        color: var(--text);
        padding: 0 1ch;
        font: inherit;
      }

      .docs-frame {
        width: 100%;
        height: 100%;
        border: 0;
        background: #fff;
      }



      .android-file-dialog {
        width: min(560px, calc(100vw - 8px));
        height: min(520px, calc(100vh - 8px));
        display: grid;
        grid-template-rows: auto auto auto minmax(0, 1fr);
      }

      .android-file-controls {
        display: flex;
        background: var(--control-bg);
        border-bottom: 1px solid var(--blue);
      }

      .android-file-controls button {
        min-height: 34px;
        padding: 0 1ch;
      }

      .android-file-path {
        padding: 0.25em 1ch;
        border-bottom: 1px solid var(--editor-bar-bg);
        background: var(--ui-bg);
        color: var(--muted);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .android-file-list {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: var(--menu-bg);
      }

      .android-file-entry {
        width: 100%;
        min-height: 38px;
        justify-content: flex-start;
        border-left: 0;
        border-right: 0;
        border-top: 0;
        border-bottom: 1px solid var(--editor-bar-bg);
        background: var(--menu-bg);
        color: var(--text);
        text-align: left;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .android-file-entry.folder {
        color: var(--text);
      }

      .android-file-entry:active,
      .android-file-entry:focus-visible {
        background: var(--selection-bg);
        color: var(--selection-text);
      }

      .android-file-message {
        padding: 1em 1ch;
        color: var(--muted);
      }

      .android-storage-row button {
        min-height: 34px;
        padding: 0 1ch;
      }

      @media (max-width: 560px) {
        .android-file-backdrop {
          padding: 4px;
          place-items: start center;
        }

        .android-file-dialog {
          width: calc(100vw - 8px);
          height: calc(100vh - 8px);
        }

        .android-file-dialog .dialog-title {
          padding: 0.25em 1ch;
        }
      }

      .prefs-dialog {
        width: min(72ch, calc(100vw - 32px));
        max-height: min(760px, calc(100vh - 32px));
        display: grid;
        grid-template-rows: auto auto minmax(0, 1fr) auto;
      }

      .prefs-body {
        overflow: auto;
        padding: 0;
        white-space: normal;
      }

      .prefs-tabs {
        display: flex;
        background: var(--control-bg);
        border-bottom: 1px solid var(--blue);
      }

      .prefs-tabs button {
        flex: 1 1 0;
        justify-content: center;
      }

      .prefs-tabs button.active {
        background: var(--selection-bg);
        color: var(--selection-text);
      }

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

      .gui-controls {
        display: grid;
        gap: 0;
        padding: 0;
      }

      .gui-section {
        display: grid;
        gap: 0;
        border-bottom: 1px solid var(--editor-bar-bg);
      }

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

      .gui-section-title {
        min-height: var(--compact-control-height);
        display: flex;
        align-items: center;
        padding: 0 1ch;
        background: var(--dialog-bar-bg);
        color: var(--text);
        border-bottom: 1px solid var(--editor-bar-bg);
      }

      .theme-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.5em;
        padding: 0.75em 1ch;
      }

      .theme-option {
        display: grid;
        grid-template-columns: 24px minmax(0, 1fr);
        align-items: center;
        justify-content: start;
        gap: 0.6ch;
        min-height: var(--control-height);
        padding: 0.35em 0.75ch;
        border: 1px solid var(--editor-bar-bg);
        background: var(--control-bg);
        color: var(--text);
      }

      .theme-option.active {
        border-color: var(--accent);
        background: var(--selection-bg);
        color: var(--selection-text);
        box-shadow: inset 0 0 0 1px var(--accent);
      }

      .theme-preview {
        width: 24px;
        height: 24px;
        border: 1px solid currentColor;
        background: linear-gradient(135deg, var(--preview-bg) 0 50%, var(--preview-accent) 50% 100%);
      }

      .theme-preview-classic { --preview-bg: #05070a; --preview-accent: #6ee7b7; }
      .theme-preview-cherry { --preview-bg: #1c0c12; --preview-accent: #ff5c7e; }
      .theme-preview-green { --preview-bg: #1b1f1f; --preview-accent: #6ccf84; }
      .theme-preview-amber { --preview-bg: #1e1b16; --preview-accent: #ffb448; }
      .theme-preview-midnight { --preview-bg: #0c0e18; --preview-accent: #80a8ff; }
      .theme-preview-paper { --preview-bg: #d7d5c8; --preview-accent: #7e3712; }
      .theme-preview-custom { --preview-bg: var(--ui-bg); --preview-accent: var(--accent); }

      .custom-theme-controls { display: contents; }
      .custom-theme-controls[hidden] { display: none; }

      .gui-control-row {
        display: grid;
        grid-template-columns: minmax(13ch, 1fr) minmax(0, 1.5fr) minmax(8ch, auto);
        align-items: center;
        gap: 0.75ch;
        min-height: var(--control-height);
        padding: 0.35em 1ch;
        border-bottom: 1px solid var(--control-bg);
      }

      .gui-control-row:last-child {
        border-bottom: 0;
      }

      .gui-label {
        min-width: 0;
        overflow-wrap: anywhere;
      }

      .gui-value,
      .color-hex {
        color: var(--muted);
      }

      .gui-control-row input[type="range"] {
        width: 100%;
        min-width: 0;
      }

      .gui-control-row input[type="checkbox"] {
        width: calc(var(--app-font-size) * 1.4);
        height: calc(var(--app-font-size) * 1.4);
        margin: 0;
      }

      .color-control {
        grid-template-columns: minmax(13ch, 1fr) minmax(44px, 0.55fr) minmax(8ch, 1fr) auto;
      }

      .color-swatch {
        width: 100%;
        min-width: 44px;
        min-height: var(--compact-control-height);
        height: var(--compact-control-height);
        border: 1px solid var(--text);
        border-radius: 0;
        background: var(--color-value, var(--control-bg));
        padding: 0;
      }

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

      .color-swatch::-webkit-color-swatch {
        border: 0;
      }

      .color-hex {
        min-width: 0;
        width: 100%;
        height: var(--compact-control-height);
        border: 1px solid var(--text);
        border-radius: 0;
        background: var(--menu-bg);
        padding: 0 0.5ch;
        font: inherit;
        text-transform: lowercase;
      }

      .color-reset {
        min-height: var(--compact-control-height);
        justify-content: center;
      }


      .shortcut-table {
        width: 100%;
        border-collapse: collapse;
      }

      .shortcut-table th,
      .shortcut-table td {
        border-bottom: 1px solid var(--blue);
        padding: 0 1ch;
        text-align: left;
        white-space: nowrap;
      }

      .shortcut-table th {
        background: var(--control-bg);
      }

      .shortcut-table td:first-child {
        width: 100%;
      }

      .shortcut-key {
        color: var(--warn);
      }

      .shortcut-key.empty {
        color: var(--muted);
      }

      .terminal {
        position: relative;
        z-index: 1;
        height: 100%;
        min-width: 0;
        min-height: 0;
        outline: none;
        overflow: hidden;
        background: var(--terminal-bg);
        color: var(--terminal-text);
        font-size: inherit;
        line-height: inherit;
        letter-spacing: 0;
        touch-action: none;
        overscroll-behavior: contain;
        user-select: none;
      }

      .soft-keyboard-proxy {
        position: fixed;
        left: 0;
        bottom: 0;
        z-index: -1;
        width: 1px;
        height: 1px;
        border: 0;
        padding: 0;
        opacity: 0.01;
        color: transparent;
        background: transparent;
        caret-color: transparent;
        resize: none;
      }

      body.keyboard-hidden {
        --keyboard-height: 0px;
      }

      .app-keyboard {
        display: none !important;
        min-height: 0;
        border-top: 2px solid var(--ui-bg);
        background: var(--keyboard-bar-bg);
        color: var(--text);
        display: none !important;
        grid-template-rows: 22px minmax(0, 1fr);
        padding-bottom: var(--safe-bottom-inset);
        overflow: hidden;
        touch-action: none;
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
      }

      body.keyboard-hidden .app-keyboard {
        display: none;
      }

      .keyboard-bar {
        display: flex;
        align-items: center;
        gap: 0;
        background: var(--keyboard-bar-bg);
        border-bottom: 2px solid var(--ui-bg);
        user-select: none;
      }

      .keyboard-grip {
        flex: 1 1 auto;
        align-self: stretch;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: ns-resize;
      }

      .keyboard-bar:focus-visible {
        outline: 1px solid var(--accent);
        outline-offset: -1px;
      }

      .keyboard-grip::before {
        content: "";
        width: 4ch;
        height: 5px;
        margin-right: 1ch;
        border-top: 1px solid var(--text);
        border-bottom: 1px solid var(--text);
        opacity: 0.75;
      }


      .keyboard-bar button {
        min-height: 22px;
        align-self: stretch;
        background: var(--keyboard-key-bg);
      }

      .keyboard-rows {
        min-height: 0;
        display: grid;
        grid-template-rows: repeat(8, minmax(0, 1fr));
        gap: 4px;
        padding: 4px;
        background: var(--keyboard-bar-bg);
      }

      .keyboard-page {
        display: contents;
      }

      .keyboard-page[hidden] {
        display: none;
      }

      .keyboard-row {
        display: grid;
        grid-template-columns: repeat(10, minmax(0, 1fr));
        gap: 4px;
        min-height: 0;
      }

      .keyboard-row.controls {
        grid-template-columns: repeat(10, minmax(0, 1fr));
      }


      .key-button {
        min-width: 0;
        min-height: 0;
        height: 100%;
        align-self: stretch;
        justify-content: center;
        border: 0;
        border-left: 1px solid var(--bg);
        border-bottom: 1px solid var(--bg);
        border-radius: 0;
        background: var(--keyboard-key-bg);
        color: var(--text);
        padding: 0 0.2ch;
        font-size: max(14px, calc(var(--app-font-size) * 0.95));
        line-height: 1;
        overflow: hidden;
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
        -webkit-tap-highlight-color: transparent;
      }

      .keyboard-row.keyboard-syntax .key-button {
        font-size: max(12px, calc(var(--app-font-size) * 0.8));
      }

      .key-button.wide {
        grid-column: span 2;
      }

      .key-button.xwide {
        grid-column: span 3;
      }

      .key-button.space {
        grid-column: span 5;
      }

      .key-button.command {
        background: var(--keyboard-bar-bg);
      }

      .key-button.active {
        background: var(--warn);
        color: var(--bg);
      }


      .app-keyboard .key-button:hover,
      .app-keyboard .key-button:focus {
        background: var(--keyboard-key-bg);
        color: var(--text);
      }

      .app-keyboard .key-button:focus-visible {
        outline: 1px solid var(--accent);
        outline-offset: -1px;
        background: var(--selection-bg);
        color: var(--selection-text);
      }

      .app-keyboard .key-button.command:hover,
      .app-keyboard .key-button.command:focus {
        background: var(--keyboard-bar-bg);
        color: var(--text);
      }

      .app-keyboard .key-button.command:focus-visible {
        background: var(--selection-bg);
        color: var(--selection-text);
      }

      .app-keyboard .key-button.active:hover,
      .app-keyboard .key-button.active:focus,
      .app-keyboard .key-button.active:focus-visible {
        background: var(--warn);
        color: var(--bg);
      }

      .key-button.pressed {
        background: var(--selection-bg);
        color: var(--selection-text);
      }

      @media (max-width: 700px) {
        :root {
          --toolbar-height: max(40px, var(--control-height));
        }

        body {
          font-size: var(--app-font-size);
        }

        button,
        label.button,
        select,
        .brand {
          min-height: var(--toolbar-height);
          padding-left: 1ch;
          padding-right: 1ch;
          line-height: 1.2;
        }

        .file-menu button,
        .context-menu button,
        .dialog-actions button,
        .docs-controls button,
        .shortcut-table button {
          min-height: var(--control-height);
          padding-left: 1ch;
          padding-right: 1ch;
          font-size: var(--app-font-size);
        }

        .prefs-dialog {
          width: min(44ch, calc(100vw - 16px));
          max-height: calc(100vh - 16px);
        }

        .prefs-body {
          overflow-x: hidden;
        }

        .shortcut-table {
          table-layout: fixed;
          font-size: max(10px, calc(var(--app-font-size) * 0.82));
        }

        .shortcut-table th,
        .shortcut-table td {
          padding: 0.25em 0.35ch;
          white-space: normal;
          overflow-wrap: anywhere;
        }

        .shortcut-table th:first-child,
        .shortcut-table td:first-child {
          width: 38%;
        }

        .shortcut-table th:nth-child(2),
        .shortcut-table td:nth-child(2) {
          width: 28%;
        }

        .shortcut-table th:nth-child(3),
        .shortcut-table td:nth-child(3),
        .shortcut-table th:nth-child(4),
        .shortcut-table td:nth-child(4) {
          width: 17%;
        }

        .shortcut-table button {
          min-height: var(--compact-control-height);
          width: 100%;
          padding-left: 0.25ch;
          padding-right: 0.25ch;
          font-size: max(10px, calc(var(--app-font-size) * 0.82));
        }

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

        .gui-control-row {
          grid-template-columns: minmax(0, 1fr);
          gap: 0.35em;
          min-width: 0;
          padding: 0.5em 1ch;
        }

        .color-control {
          grid-template-columns: minmax(44px, 0.7fr) minmax(8ch, 1fr) auto;
        }

        .color-control .gui-label {
          grid-column: 1 / -1;
        }

        .gui-control-row input[type="range"] {
          width: 100%;
          max-width: 100%;
          min-width: 0;
        }

        .docs-backdrop {
          padding: 8px;
          place-items: stretch;
        }

        .docs-dialog {
          width: 100%;
          max-width: 100%;
          height: calc(100vh - 16px);
          max-height: calc(100vh - 16px);
          min-width: 0;
        }

        .docs-dialog .dialog-title {
          padding: 0.25em 1ch;
          font-size: 13px;
        }

        .docs-controls {
          overflow-x: auto;
          -webkit-overflow-scrolling: touch;
        }

        .docs-controls input {
          min-height: 40px;
          font-size: 14px;
        }

        .docs-frame {
          min-width: 0;
        }

        /* docs-dialog phone sizing */
        .overlay {
          top: 8px;
          max-height: calc(100vh - 16px);
        }

        .overlay .row {
          height: var(--overlay-row-height);
          line-height: var(--overlay-row-height);
          padding-left: 1.25ch;
          padding-right: 1.25ch;
        }

        select {
          min-width: 8ch;
        }
      }

      .terminal > .row {
        height: calc(100% / var(--terminal-rows, 24));
        line-height: inherit;
        white-space: pre;
        overflow: hidden;
        contain: layout paint style;
      }

      .row {
        height: 1.15em;
        white-space: pre;
        overflow: hidden;
      }

      .header,
      .footer {
        background: var(--editor-bar-bg);
        color: var(--text);
      }

      .inverse {
        background: var(--selection-bg);
        color: var(--selection-text);
      }

      .editor-line.inverse {
        background: var(--terminal-bg);
      }

      .editor-line.live-scene.inverse {
        background: var(--live-bg);
      }

      .editor-line.inverse .editor-code {
        background: var(--selection-bg);
        color: var(--selection-text);
      }

      .inline-repl-result {
        background: var(--terminal-bg);
        color: var(--terminal-text);
        user-select: text;
        -webkit-user-select: text;
      }

      .inline-repl-result .inline-repl-prefix {
        color: var(--accent);
      }

      .inline-repl-error,
      .inline-repl-error .inline-repl-prefix {
        color: var(--syntax-number);
      }

      .inline-repl-status,
      .inline-repl-status .inline-repl-prefix {
        color: var(--accent);
      }

      .selection-cell {
        background: var(--selection-bg);
        color: var(--selection-text);
      }

      .live-scene {
        background: var(--live-bg);
      }

      .overlay-item[data-overlay-index],
      .overlay-back[data-overlay-back],
      .overlay-search[data-overlay-search],
      .overlay-close[data-overlay-close] {
        cursor: pointer;
        touch-action: manipulation;
        user-select: none;
        -webkit-user-select: none;
      }

      .overlay-item:focus-visible,
      .overlay-back:focus-visible,
      .overlay-search:focus-visible,
      .overlay-close:focus-visible {
        outline: 1px solid var(--accent);
        outline-offset: -1px;
      }

      .gutter {
        display: inline-block;
        height: 100%;
        background: var(--gutter-bg);
        color: var(--text);
        vertical-align: top;
      }

      .editor-code {
        display: inline-block;
        min-width: calc(100% - (var(--editor-gutter-width, 5) * 1ch));
        height: 100%;
        vertical-align: top;
        white-space: pre;
      }

      .cursor {
        background: var(--cursor-bg);
        color: var(--cursor-text);
      }

      .paren {
        background: var(--warn);
        color: #111827;
      }

      .live-cell {
        background: var(--live-cell-bg);
        color: var(--live-cell-text);
      }

      .syntax-comment {
        color: var(--syntax-comment);
      }

      .syntax-string {
        color: var(--syntax-string);
      }

      .syntax-number {
        color: var(--syntax-number);
      }

      .syntax-keyword {
        color: var(--syntax-keyword);
      }

      .syntax-form {
        color: var(--syntax-form);
      }

      .syntax-punct {
        color: var(--syntax-punct);
      }

      .inverse .syntax-comment,
      .inverse .syntax-string,
      .inverse .syntax-number,
      .inverse .syntax-keyword,
      .inverse .syntax-form,
      .inverse .syntax-punct,
      .live-cell .syntax-comment,
      .live-cell .syntax-string,
      .live-cell .syntax-number,
      .live-cell .syntax-keyword,
      .live-cell .syntax-form,
      .live-cell .syntax-punct {
        color: inherit;
      }



      .overlay {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        top: min(48px, calc(var(--toolbar-height) + 8px));
        min-width: min(560px, calc(100vw - 24px));
        max-width: calc(100vw - 24px);
        max-height: calc(100vh - var(--toolbar-height) - 16px);
        overflow: hidden;
        background: var(--menu-bg);
        border: 1px solid var(--text);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
        white-space: pre;
        touch-action: none;
      }

      .overlay .row {
        padding: 0 1ch;
      }

      .overlay-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1ch;
      }

      .overlay-title {
        min-width: 0;
        overflow: hidden;
        text-overflow: clip;
      }

      .overlay-search {
        cursor: pointer;
        color: var(--muted);
        height: calc(var(--overlay-row-height) * 0.72);
        line-height: calc(var(--overlay-row-height) * 0.72);
        border-bottom: 1px solid var(--control-bg);
      }

      .overlay-search.active {
        background: var(--control-bg);
        color: var(--text);
      }

      .overlay-search-label {
        display: block;
        overflow: hidden;
        text-overflow: clip;
        white-space: pre;
      }

      .overlay-close {
        flex: 0 0 auto;
        min-width: 4ch;
        height: calc(var(--overlay-row-height) - 6px);
        align-self: center;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        border: 1px solid var(--text);
        padding: 0 1ch;
        margin-right: 0;
        line-height: 1;
      }

      .overlay-back {
        border-top: 1px solid var(--control-bg);
      }

      .overlay .overlay-item,
      .overlay .overlay-back,
      .overlay .overlay-close {
        cursor: pointer;
      }

      .overlay .overlay-item:hover,
      .overlay .overlay-back:hover,
      .overlay .overlay-close:hover {
        background: var(--selection-bg);
        color: var(--selection-text);
      }

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