.compiler-page {
  --compiler-accent: #ffd700;
  width: min(100%, 112rem);
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 2.4vw, 2.25rem) 4rem;
  color: #171717;
}

.compiler-intro { margin: 1.6rem 0 1.15rem; }
.compiler-intro h1 { margin: 0; font: 900 clamp(2rem, 3.3vw, 3.25rem)/1.02 "Space Grotesk", sans-serif; letter-spacing: -.05em; }
.compiler-top-ad { margin: .5rem auto 1.75rem !important; }

.language-constellation { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 1rem; margin: 0 0 1.35rem; }
.language-node { display: flex; align-items: center; gap: .85rem; min-width: 0; padding: .85rem 1rem; border: 1px solid #e0e0e0; border-radius: 1rem; background: #fff; color: #202020; text-decoration: none; box-shadow: 0 7px 20px rgba(0,0,0,.04); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.language-node:hover { transform: translateY(-2px); border-color: #aaa; box-shadow: 0 10px 24px rgba(0,0,0,.08); }
.language-node.is-active { border-color: #2a2a2a; box-shadow: 0 0 0 2px var(--compiler-accent), 0 12px 26px rgba(0,0,0,.08); }
.language-node__mark { display: grid; width: 3.1rem; height: 3.1rem; flex: 0 0 auto; place-items: center; border-radius: .9rem; background: #f1f2f2; color: #343434; }
.language-node__mark img { display: block; width: 1.9rem; height: 1.9rem; object-fit: contain; }
.language-node__mark--python { background: #e8f1ff; color: #2767b2; }
.language-node__mark--c { background: #eef0ff; color: #4d56b8; }
.language-node__mark--cpp { background: #e9f7f3; color: #18765f; }
.language-node__mark--java { background: #fff0e9; color: #b44a27; }
.language-node strong, .language-node small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.language-node strong { font: 800 .94rem/1.2 "Space Grotesk", sans-serif; }
.language-node small { margin-top: .22rem; color: #777; font: 600 .72rem/1 Inter, sans-serif; }

.compiler-layout { display: block; }
.compiler-layout:has(.compiler-ad-rail > .ad-slot:not(.is-unfilled):not(.is-disabled):not([hidden])) { display: grid; grid-template-columns: minmax(0, 1fr) 12rem; align-items: start; gap: 1rem; }
.compiler-app { --c-bg: #f6f6f4; --c-panel: #fff; --c-panel-2: #fafaf9; --c-border: #dededb; --c-text: #191919; --c-muted: #74746f; --c-console: #161714; --c-console-text: #eef0e7; --syntax-comment: #8a94a3; --syntax-keyword: #9146b8; --syntax-type: #1473ad; --syntax-builtin: #2a62b7; --syntax-string: #4c7d2c; --syntax-number: #b85d1d; --syntax-preprocessor: #b5642d; overflow: hidden; border: 1px solid var(--c-border); border-radius: 1rem; background: var(--c-bg); color: var(--c-text); box-shadow: 0 18px 55px rgba(0,0,0,.1); transition: color .2s, background .2s, border-color .2s; }
.compiler-app[data-theme="dark"] { --c-bg: #191c1b; --c-panel: #202423; --c-panel-2: #242827; --c-border: #3b413f; --c-text: #f3f2e9; --c-muted: #a9ada8; --c-console: #121514; --c-console-text: #eef4ed; --syntax-comment: #71809c; --syntax-keyword: #d792ff; --syntax-type: #7dcfff; --syntax-builtin: #7aa6ff; --syntax-string: #b9e970; --syntax-number: #ffc777; --syntax-preprocessor: #ff9e64; box-shadow: 0 22px 60px rgba(17,18,16,.27); }
.compiler-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.3rem; padding: .75rem 1rem; border-bottom: 1px solid var(--c-border); background: var(--c-panel); }
.compiler-file { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.compiler-file strong, .compiler-file small { display: block; }
.compiler-file strong { font: 800 .85rem/1.2 "Space Grotesk", sans-serif; }
.compiler-file small { margin-top: .2rem; color: var(--c-muted); font: 600 .66rem/1 Inter, sans-serif; }
.compiler-fullscreen-brand { display: none; margin-left: .7rem; border-left: 1px solid var(--c-border); padding-left: 1rem; font: 850 .82rem/1 "Space Grotesk", sans-serif; white-space: nowrap; }
.compiler-language-dot { width: .78rem; height: .78rem; border-radius: .2rem .5rem .5rem .5rem; background: var(--compiler-accent); box-shadow: 0 0 0 .22rem rgba(255,215,0,.17); }
.compiler-actions { display: flex; align-items: center; gap: .5rem; }
.compiler-actions button { display: inline-flex; min-height: 2.55rem; align-items: center; justify-content: center; gap: .4rem; border-radius: .65rem; padding: .58rem .75rem; font: 750 .74rem/1 Inter, sans-serif; transition: transform .14s, background .14s, opacity .14s; }
.compiler-actions button:hover { transform: translateY(-1px); }
.compiler-actions .material-symbols-outlined { font-size: 1.05rem; }
.compiler-ghost-button, .compiler-theme-toggle, .compiler-fullscreen-button { border: 1px solid var(--c-border); background: var(--c-panel-2); color: var(--c-text); }
.compiler-fullscreen-button:focus-visible { outline: 2px solid var(--compiler-accent); outline-offset: 2px; }
.compiler-run-button { border: 1px solid #171717; background: var(--compiler-accent); color: #111; box-shadow: 0 5px 14px rgba(204,172,0,.24); }
.compiler-run-button:disabled { cursor: wait; opacity: .58; transform: none; }
.compiler-run-button kbd { border: 1px solid rgba(0,0,0,.22); border-radius: .25rem; padding: .1rem .28rem; font-size: .58rem; }
.compiler-stop-button { border: 1px solid #b54942; background: #c95149; color: #fff; }
.compiler-stop-button[hidden] { display: none; }
.compiler-stop-button:not(:disabled):hover { background: #ae4039; }
.compiler-stop-button:disabled { cursor: wait; opacity: .62; }
.compiler-panels { --compiler-editor-width: 54%; --compiler-resizer-width: 2.5rem; display: grid; grid-template-columns: minmax(0, calc(var(--compiler-editor-width) - (var(--compiler-resizer-width) / 2))) var(--compiler-resizer-width) minmax(0, calc(100% - var(--compiler-editor-width) - (var(--compiler-resizer-width) / 2))); height: clamp(32rem, calc(100dvh - var(--header-offset, 4.5rem) - 2rem), 58rem); min-height: 0; overflow: hidden; isolation: isolate; }
.compiler-editor-panel, .compiler-output-panel { display: flex; min-width: 0; min-height: 0; flex-direction: column; overflow: hidden; background: var(--c-panel); }
.compiler-panel-resizer { position: relative; z-index: 2; display: grid; min-width: 0; place-items: center; border-inline: 1px solid var(--c-border); background: linear-gradient(90deg, transparent 48%, color-mix(in srgb, var(--compiler-accent) 72%, var(--c-border)) 48% 52%, transparent 52%); cursor: col-resize; touch-action: none; outline: none; }
.compiler-panel-resizer:focus-visible { z-index: 3; box-shadow: inset 0 0 0 2px var(--compiler-accent); }
.compiler-panel-resizer__grip { position: relative; display: grid; width: calc(100% - .35rem); max-width: 2.15rem; height: 2.35rem; place-items: center; align-content: center; gap: .2rem; border: 1px solid var(--c-border); border-radius: .62rem; background: var(--c-text); box-shadow: 0 .35rem 1rem rgba(0,0,0,.18); pointer-events: none; }
.compiler-panel-resizer__grip::before { position: absolute; left: .28rem; width: .2rem; height: .9rem; border-radius: .2rem; background: var(--compiler-accent); content: ""; }
.compiler-panel-resizer__grip i { display: block; width: .8rem; height: .11rem; border-radius: .2rem; background: var(--c-panel); opacity: .9; }
.compiler-is-resizing, .compiler-is-resizing * { cursor: col-resize !important; user-select: none !important; }
.compiler-panel-heading { display: flex; align-items: center; justify-content: space-between; min-height: 3.15rem; padding: .7rem 1rem; border-bottom: 1px solid var(--c-border); background: var(--c-panel-2); }
.compiler-panel-heading h2 { margin: 0; font: 800 .78rem/1 "Space Grotesk", sans-serif; letter-spacing: .05em; text-transform: uppercase; }
.compiler-panel-heading__actions { display: flex; min-width: 0; align-items: center; gap: .65rem; }
.compiler-panel-heading__actions > span:not(.compiler-status) { color: var(--c-muted); font: 650 .67rem/1 Inter, sans-serif; }
.compiler-copy-button { display: inline-flex; min-height: 2rem; align-items: center; justify-content: center; gap: .3rem; border: 1px solid var(--c-border); border-radius: .5rem; background: var(--c-panel); color: var(--c-text); padding: .38rem .55rem; cursor: pointer; font: 700 .65rem/1 Inter, sans-serif; transition: border-color .14s, background .14s, opacity .14s; }
.compiler-copy-button:hover:not(:disabled) { border-color: var(--c-muted); background: var(--c-bg); }
.compiler-copy-button:focus-visible { outline: 2px solid var(--compiler-accent); outline-offset: 2px; }
.compiler-copy-button:disabled { cursor: not-allowed; opacity: .42; }
.compiler-copy-button .material-symbols-outlined { font-size: .9rem; }
.compiler-code-wrap { position: relative; min-width: 0; flex: 1; min-height: 35rem; overflow: hidden; background: var(--c-panel); }
.compiler-monaco { display: none; width: 100%; height: 100%; min-height: 35rem; }
.compiler-code-wrap.is-enhanced .compiler-monaco { display: block; }
.compiler-code-fallback { box-sizing: border-box; width: 100%; height: 100%; min-height: 35rem; resize: none; border: 0; border-radius: 0; background: var(--c-panel); color: var(--c-text); padding: 1rem 1.2rem; caret-color: var(--c-text); tab-size: 4; outline: none; box-shadow: none !important; font: 500 .94rem/1.65 "SFMono-Regular", Consolas, monospace; white-space: pre; overflow: auto; }
.compiler-code-wrap.is-enhanced .compiler-code-fallback { display: none; }
.compiler-monaco .monaco-editor, .compiler-monaco .monaco-editor-background, .compiler-monaco .margin { transition: background-color .2s; }
.compiler-console { position: relative; flex: 1 1 auto; min-height: 12rem; overflow: auto; overscroll-behavior: contain; background: var(--c-console); color: var(--c-console-text); font: 500 .92rem/1.7 "SFMono-Regular", Consolas, monospace; }
.compiler-console.is-enhanced { overflow: hidden; }
.compiler-terminal { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; visibility: hidden; }
.compiler-console.is-enhanced .compiler-terminal { visibility: visible; cursor: text; }
.compiler-console.is-enhanced:focus-within { box-shadow: inset 0 0 0 2px rgba(255,215,0,.22); }
.compiler-console.is-enhanced .compiler-console-empty { display: none; }
.compiler-terminal, .compiler-terminal .xterm { background: var(--c-console); }
.compiler-terminal .xterm { box-sizing: border-box; height: 100%; padding: 1rem; }
.compiler-terminal .xterm-viewport { overflow-y: auto; overscroll-behavior: contain; scrollbar-color: #555b56 transparent; scrollbar-width: thin; }
.compiler-terminal .xterm-screen { isolation: isolate; }
.compiler-terminal-notices { border-top: 1px solid var(--c-border); background: var(--c-console); padding: 0 1rem 1rem; }
.compiler-terminal-notices[hidden] { display: none; }
.compiler-console-empty { display: flex; min-height: 100%; align-items: center; justify-content: center; flex-direction: column; gap: .65rem; color: #858b83; text-align: center; }
.compiler-console-empty .material-symbols-outlined { font-size: 2rem; color: #b8bdaf; }
.compiler-console-empty.is-running .material-symbols-outlined { animation: compiler-spin 1s linear infinite; }
.console-stream + .console-stream { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid #343934; }
.console-stream b { display: block; margin-bottom: .45rem; color: #979d94; font: 700 .62rem/1 Inter, sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.console-stream pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.console-stream.is-error pre { color: #ffaaa3; }
.console-stream .terminal-fg-green { color: #84e66a; }
.console-stream .terminal-fg-red { color: #ff8f88; }
.console-stream .terminal-fg-yellow { color: #f6d365; }
.console-stream .terminal-fg-blue { color: #82b9ff; }
.console-stream .terminal-fg-magenta { color: #e5a8ff; }
.console-stream .terminal-fg-cyan { color: #6fe0dc; }
.console-stream .terminal-bold { font-weight: 800; }
.compiler-limit-notice { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .75rem; margin-top: 1.35rem; padding: .9rem 1rem; border: 1px solid #7b6932; border-radius: .7rem; background: #2b291d; color: #f1eedf; font-family: Inter, sans-serif; }
.compiler-limit-notice > .material-symbols-outlined { margin-top: .05rem; color: var(--compiler-accent); font-size: 1.25rem; }
.compiler-limit-notice strong { display: block; font: 800 .78rem/1.25 "Space Grotesk", sans-serif; }
.compiler-limit-notice p { margin: .3rem 0 0; color: #d4d1c1; font: 500 .74rem/1.55 Inter, sans-serif; }
.compiler-preview-notice a { display: inline-flex; margin-top: .55rem; color: var(--compiler-accent); font: 700 .74rem/1.3 Inter, sans-serif; text-underline-offset: .18em; }
.compiler-status { display: inline-flex; align-items: center; gap: .42rem; color: var(--c-muted); font: 700 .68rem/1 Inter, sans-serif; }
.compiler-status i { width: .48rem; height: .48rem; border-radius: 50%; background: #a3a3a3; }
.compiler-status.is-running i, .compiler-status.is-queued i { background: var(--compiler-accent); box-shadow: 0 0 0 .22rem rgba(255,215,0,.15); animation: compiler-pulse 1.2s ease-in-out infinite; }
.compiler-status.is-success i { background: #49c479; }
.compiler-status.is-error i { background: #ef6259; }
.compiler-plots { display: block; flex: 0 0 auto; max-height: 40%; min-height: 0; overflow-y: auto; padding: 1rem; border-top: 1px solid var(--c-border); background: var(--c-panel); }
.compiler-plots[hidden] { display: none; }
.compiler-plots figure { margin: 0; overflow: hidden; border: 1px solid var(--c-border); border-radius: .65rem; background: #fff; }
.compiler-plots figure + figure { margin-top: .75rem; }
.compiler-plots img { display: block; width: 100%; height: auto; }
.compiler-plots figcaption { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: .65rem; padding: .55rem .65rem; border-bottom: 1px solid var(--c-border); background: var(--c-panel-2); color: var(--c-text); font: 700 .68rem/1 Inter, sans-serif; }
.compiler-plots figcaption > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compiler-plot-actions { display: inline-flex; flex: 0 0 auto; gap: .35rem; }
.compiler-plot-action { display: inline-flex; min-height: 1.8rem; align-items: center; gap: .25rem; border: 1px solid var(--c-border); border-radius: .42rem; background: var(--c-panel); color: var(--c-text); padding: .3rem .45rem; cursor: pointer; text-decoration: none; font: 700 .62rem/1 Inter, sans-serif; }
.compiler-plot-action:hover { border-color: var(--c-muted); background: var(--c-bg); }
.compiler-plot-action:focus-visible { outline: 2px solid var(--compiler-accent); outline-offset: 2px; }
.compiler-plot-action .material-symbols-outlined { font-size: .9rem; }
.compiler-ad-rail { display: none; position: sticky; top: calc(var(--header-offset, 72px) + 1rem); }
.compiler-layout:has(.compiler-ad-rail > .ad-slot:not(.is-unfilled):not(.is-disabled):not([hidden])) .compiler-ad-rail { display: block; }
.compiler-side-ad { width: 100% !important; min-height: 500px !important; margin: 0 !important; }
.compiler-libraries { margin-top: 2rem; padding: clamp(1.25rem, 2.4vw, 2rem); border: 1px solid #e2e2df; border-radius: 1rem; background: #fff; box-shadow: 0 12px 34px rgba(0,0,0,.055); }
.compiler-libraries__intro { max-width: 48rem; margin-bottom: 1.25rem; }
.compiler-libraries__intro p { margin: 0 0 .45rem; color: #686863; font: 750 .7rem/1 Inter, sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.compiler-libraries__intro h2 { margin: 0; font: 850 clamp(1.35rem, 2vw, 1.9rem)/1.15 "Space Grotesk", sans-serif; letter-spacing: -.03em; }
.compiler-libraries__intro > span { display: block; margin-top: .55rem; color: #6d6d68; font: 500 .88rem/1.55 Inter, sans-serif; }
.compiler-library-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: .85rem; }
.compiler-library-group { min-width: 0; padding: 1rem; border: 1px solid #e7e7e3; border-radius: .8rem; background: #fafaf8; }
.compiler-library-group h3 { margin: 0 0 .7rem; color: #565650; font: 750 .72rem/1.2 Inter, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.compiler-library-group ul { display: grid; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.compiler-library-group li { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: .75rem; padding: .6rem .15rem; border-top: 1px solid #e8e8e4; }
.compiler-library-group li:first-child { border-top: 0; }
.compiler-library-group li > span { min-width: 0; }
.compiler-library-group strong, .compiler-library-group small { display: block; }
.compiler-library-group strong { overflow-wrap: anywhere; font: 700 .82rem/1.3 Inter, sans-serif; }
.compiler-library-group small { margin-top: .18rem; color: #777771; font: 550 .67rem/1.2 Inter, sans-serif; }
.compiler-library-copy { display: inline-flex; max-width: 58%; min-width: 0; align-items: center; gap: .35rem; overflow: hidden; border: 1px solid #e0e0dc; border-radius: .4rem; background: #fff; color: #3f4f45; padding: .28rem .38rem; cursor: pointer; }
.compiler-library-copy:hover { border-color: #9da69c; background: #f3f7f2; }
.compiler-library-copy:focus-visible { outline: 2px solid var(--compiler-accent); outline-offset: 2px; }
.compiler-library-copy code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 .66rem/1.2 "SFMono-Regular", Consolas, monospace; }
.compiler-library-copy .material-symbols-outlined { flex: 0 0 auto; font-size: .9rem; }
.compiler-library-copy b { flex: 0 0 auto; font: 750 .6rem/1 Inter, sans-serif; }
@keyframes compiler-spin { to { transform: rotate(360deg); } }
@keyframes compiler-pulse { 50% { opacity: .35; } }

body.compiler-fullscreen-fallback { overflow: hidden; }
.compiler-app:fullscreen, .compiler-app.is-immersive {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.compiler-app.is-immersive { position: fixed; inset: 0; z-index: 1000; }
.compiler-app:fullscreen .compiler-fullscreen-brand, .compiler-app.is-immersive .compiler-fullscreen-brand { display: inline; }
.compiler-app:fullscreen .compiler-toolbar, .compiler-app.is-immersive .compiler-toolbar { flex: 0 0 auto; }
.compiler-app:fullscreen .compiler-panels, .compiler-app.is-immersive .compiler-panels { flex: 1 1 auto; height: auto; min-height: 0; }
.compiler-app:fullscreen .compiler-code-wrap, .compiler-app.is-immersive .compiler-code-wrap,
.compiler-app:fullscreen .compiler-monaco, .compiler-app.is-immersive .compiler-monaco,
.compiler-app:fullscreen .compiler-code-fallback, .compiler-app.is-immersive .compiler-code-fallback,
.compiler-app:fullscreen .compiler-console, .compiler-app.is-immersive .compiler-console { min-height: 0; }

@media (max-width: 80rem) {
  .compiler-ad-rail { display: none; }
}
@media (max-width: 62rem) {
  .language-constellation { grid-template-columns: repeat(2, 1fr); }
  .compiler-panels { grid-template-columns: 1fr; height: auto; }
  .compiler-editor-panel { border-bottom: 1px solid var(--c-border); }
  .compiler-panel-resizer { display: none; }
  .compiler-output-panel { min-height: 25rem; max-height: 38rem; }
  .compiler-app:fullscreen .compiler-panels, .compiler-app.is-immersive .compiler-panels { display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
  .compiler-app:fullscreen .compiler-output-panel, .compiler-app.is-immersive .compiler-output-panel { min-height: 0; max-height: none; }
}
@media (max-width: 42rem) {
  .compiler-page { padding: .5rem .75rem 3rem; }
  .compiler-intro { margin-top: .75rem; }
  .language-constellation { display: flex; margin-inline: -.75rem; padding: .2rem .75rem .7rem; overflow-x: auto; scroll-snap-type: x mandatory; }
  .language-node { min-width: 10rem; scroll-snap-align: start; }
  .compiler-app { border-radius: .8rem; }
  .compiler-toolbar { align-items: flex-start; flex-direction: column; }
  .compiler-actions { width: 100%; }
  .compiler-actions button { flex: 1; }
  .compiler-ghost-button { display: none !important; }
  .compiler-theme-toggle [data-theme-label], .compiler-run-button kbd, .compiler-stop-button [data-stop-label] { display: none; }
  .compiler-fullscreen-button [data-fullscreen-label], .compiler-fullscreen-brand { display: none !important; }
  .compiler-copy-button b { display: none; }
  .compiler-code-wrap { min-height: 27rem; }
  .compiler-monaco, .compiler-code-fallback { min-height: 27rem; }
  .compiler-app:fullscreen .compiler-code-wrap, .compiler-app.is-immersive .compiler-code-wrap,
  .compiler-app:fullscreen .compiler-monaco, .compiler-app.is-immersive .compiler-monaco,
  .compiler-app:fullscreen .compiler-code-fallback, .compiler-app.is-immersive .compiler-code-fallback { min-height: 0; }
  .compiler-libraries { margin-top: 1.25rem; }
  .compiler-library-group li { align-items: flex-start; flex-direction: column; }
  .compiler-library-group code { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .compiler-page *, .compiler-page *::before, .compiler-page *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
