/* Code Lab: premium coding look (founder 2026-10-12: "give premium coding vibe design to code lab").
   A look layer only, loaded after every other Code Lab stylesheet on codelab.html (website and app). It changes
   colours, borders, glows and fonts. It never changes sizes or positions, so every tool, the phone layout and the
   editor themes (playground-fx.js: Midnight, Dracula, Ocean, Light) keep working.
   - The page: a deep night background with a faint blue and violet glow and a fine dot grid.
   - Both panels: glass cards with a thin still top edge, like a modern code editor.
   - Bars, tabs and labels: JetBrains Mono, small caps, IDE-style tabs with a glowing underline.
   - Run and Publish: Academy blue (#1f7bff) with a light shadow; other buttons are quiet outlined chips.
   - The preview bar looks like a browser address bar; the console looks like a terminal; the status bar like an IDE's. */
@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap");

:root {
  --clp-bg: #05070d;
  --clp-panel: rgba(12, 16, 26, 0.86);
  --clp-bar: rgba(255, 255, 255, 0.025);
  --clp-line: rgba(148, 163, 184, 0.2);
  --clp-line-hi: rgba(148, 163, 184, 0.22);
  --clp-text: #e6edf6;
  --clp-muted: #8b98ad;
  --clp-blue: #2f81f7;
  --clp-cyan: #22d3ee;
  --clp-violet: #8b5cf6;
  --clp-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --clp-grad: linear-gradient(180deg, #2f8bff 0%, #1f7bff 100%);
  --clp-edge: linear-gradient(90deg, rgba(47, 129, 247, 0) 0%, #2f81f7 20%, #8b5cf6 50%, #22d3ee 80%, rgba(34, 211, 238, 0) 100%);
}

/* ---------- Premium Night: the default editor colours (the Midnight theme) ---------- */
html body #codeLab.plx-t-midnight, html body #codeLab:not([class*="plx-t-"]) {
  --code-bg: #0a0e1a; --code-gutter: #0a0e1a; --code-text: #c9d4f0; --code-muted: #4e5a78;
  --code-tag: #f7768e; --code-attr: #7dcfff; --code-string: #9ece6a; --code-keyword: #bb9af7; --code-number: #ff9e64;
  --code-prop: #7aa2f7; --code-def: #e0af68; --code-select: rgba(122, 162, 247, 0.25);
  --plx-line: rgba(122, 162, 247, 0.08); --plx-ed-bar: #070a13; --plx-mini: rgba(169, 177, 214, 0.45); --plx-accent: #7aa2f7;
}

/* ---------- The page behind the Code Lab ---------- */
body.lab-bare, html.taa-app body:has(#codeLab) {
  background-color: var(--clp-bg) !important;
  background-image:
    radial-gradient(900px 520px at 12% -8%, rgba(47, 129, 247, 0.1), transparent 60%),
    radial-gradient(760px 460px at 96% 4%, rgba(139, 92, 246, 0.07), transparent 62%),
    radial-gradient(rgba(148, 163, 184, 0.07) 1px, transparent 1px) !important;
  background-size: auto, auto, 22px 22px !important;
  background-attachment: fixed !important;
}

/* ---------- The two panels: glass cards with a glowing top edge ---------- */
#codeLab .lab-editor, #codeLab .lab-right {
  position: relative;
  background: var(--clp-panel) !important;
  border: 1px solid transparent !important;   /* the gradient ring below IS the edge */
  border-radius: 14px !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 30px 80px -30px rgba(0, 0, 0, 0.85),
    0 0 34px -12px rgba(47, 129, 247, 0.26), 0 0 90px -34px rgba(47, 129, 247, 0.28) !important;
    /* The halo is the same blue as the ring. It used to be a neutral cool grey because the ring
       changed hue and a strongly coloured halo would have clashed for most of the cycle; the ring
       is one fixed blue now, so the halo can simply match it. */
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  overflow: hidden;
}
/* The lit edge. Conic, not linear: a linear gradient fades across the BOX, so most of the perimeter
   gets its weak end and the edge looks patchy. Conic travels around the rim, so every side is lit.
   ::after is the 1px edge itself, masked so only its rim shows; ::before is the same ring blurred and
   sitting just outside, which is what makes it read as lit rather than drawn. Both are
   pointer-events: none, so neither can intercept a click in the editor or the preview. */
@property --clp-ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes clpEdge { to { --clp-ang: 360deg; } }

#codeLab .lab-editor::after, #codeLab .lab-right::after {
  content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none;
  border-radius: inherit; padding: 1.5px;
  /* ONE BLUE (founder 2026-10-23: "only keep the blue one ... the panel edges", then "Use the same blue
     edges on AI WEBSITE BUILDER and CODE LAB in tanix.app"). It was blue, violet and cyan. The light and
     dark stops are both blue on purpose: that difference is what reads as the travelling highlight, and a
     single flat colour would look painted on rather than lit. */
  background: conic-gradient(from var(--clp-ang),
    rgba(47, 129, 247, .95) 0deg, rgba(47, 129, 247, .28) 110deg,
    rgba(56, 182, 255, .85) 180deg, rgba(47, 129, 247, .28) 250deg, rgba(47, 129, 247, .95) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  /* One movement now: the lit point travels around the rim. The ring used to drift through the
     spectrum as well (clpHue, a hue-rotate filter), which is what sent the edges through green and
     orange; it is gone with the colours (founder 2026-10-23). */
  animation: clpEdge 18s linear infinite;
}
/* The outward glow is a box-shadow, NOT a blurred copy of the ring. The panels are overflow:hidden,
   which clips a blurred pseudo-element INWARD - it then washes over whatever sits near the edge (the
   status bar along the bottom of the editor, most visibly). A shadow is not clipped, so it spills
   outward the way a glow should, and costs nothing to repaint. */
#codeLab .lab-editor::before, #codeLab .lab-right::before { content: none; }

/* No reduced-motion rule here on purpose. styles.css already states a site-wide policy -
   `*, *::before, *::after { animation-duration: 0.001ms !important }` under
   prefers-reduced-motion - so every animation on the site stops for anyone who asks for that, this
   ring included. Re-animating it here would mean beating that !important, i.e. quietly exempting a
   decoration from an accessibility decision the whole site has already made. Not worth it.
*/
/* A conic gradient repainting every frame is real work for a cheap phone. This used to be
   max-width: 899px, which also silenced a desktop window merely dragged narrow - the thing being
   protected is a weak battery, not a small window, so ask about the DEVICE. Last, so a touch device
   that also asks for reduced motion still stops completely. */
@media (hover: none) and (pointer: coarse) {
  #codeLab .lab-editor::after, #codeLab .lab-right::after { animation: none; }
}

/* The website-only copy of the blue ring that stood here on 2026-10-23 is gone: the rule above is blue for
   everyone now (founder: "Use the same blue edges on AI WEBSITE BUILDER and CODE LAB in tanix.app"), so the
   website, the app's Code Lab and the AI Website Builder all take it from the one place. */

#codeLab .lab-preview, #codeLab .lab-preview-bar, #codeLab .lab-site-pbar { background: transparent !important; }

/* ---------- Bars ---------- */
#codeLab .lab-pbar, #codeLab .lab-editor-bar, #codeLab .lab-preview-bar, #codeLab .lab-site-pbar {
  background: var(--clp-bar) !important;
  border-color: var(--clp-line) !important;
}
#codeLab .lab-pbar { border-bottom: 1px solid var(--clp-line) !important; }
#codeLab .lab-editor-bar { border-bottom: 1px solid var(--clp-line) !important; }

/* ---------- Buttons: quiet outlined chips ---------- */
#codeLab .lab-pbtn, #codeLab .lcl-near-b, #codeLab .lab-icon-btn, #codeLab .lab-site-dev, #codeLab .lab-quick-btn, #codeLab .lab-askai-btn,
#codeLab .btn-secondary {
  color: #dbe4f0 !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--clp-line) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
#codeLab .lab-pbtn:hover, #codeLab .lcl-near-b:hover, #codeLab .lab-icon-btn:hover, #codeLab .lab-site-dev:hover, #codeLab .lab-quick-btn:hover,
#codeLab .lab-askai-btn:hover, #codeLab .btn-secondary:hover {
  color: #fff !important;
  background: rgba(47, 129, 247, 0.08) !important;
  border-color: rgba(47, 129, 247, 0.45) !important;
  box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.08) !important;
}
#codeLab .lab-pbtn svg, #codeLab .lcl-near-b svg, #codeLab .lab-icon-btn svg { color: #7cc4ff; }
#codeLab .lab-site-dev[aria-pressed="true"], #codeLab .lab-site-dev.is-on {
  color: #fff !important; border-color: rgba(34, 211, 238, 0.55) !important; background: rgba(34, 211, 238, 0.08) !important;
}

/* ---------- Primary: Run and Publish ---------- */
#codeLab .lab-run, #codeLab .btn-primary, #codeLab .lab-pbtn-pub, #codeLab .lab-pbar-tools .lab-pbtn.is-primary, #codeLab [data-track="codelab-publish-open"] {
  color: #ffffff !important;
  background: var(--clp-grad) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 9px !important;
  font-weight: 700 !important;
  box-shadow: 0 3px 10px -4px rgba(31, 123, 255, 0.3), 0 1px 0 rgba(255, 255, 255, 0.12) inset !important;
  text-shadow: none !important;
}
#codeLab .lab-run svg, #codeLab .btn-primary svg, #codeLab [data-track="codelab-publish-open"] svg { color: #ffffff !important; }
#codeLab .lab-run svg path { fill: currentColor; }
#codeLab .lab-run:hover, #codeLab .btn-primary:hover, #codeLab [data-track="codelab-publish-open"]:hover {
  filter: brightness(1.08); box-shadow: 0 4px 14px -4px rgba(31, 123, 255, 0.4), 0 1px 0 rgba(255, 255, 255, 0.16) inset !important;
}

/* ---------- The Code tab: an IDE file tab ---------- */
#codeLab .lab-tabs { background: transparent !important; border: 0 !important; box-shadow: none !important; }
#codeLab .lab-tab {
  font-family: var(--clp-mono) !important; font-size: 0.82rem !important; font-weight: 600 !important; letter-spacing: 0.01em;
  color: var(--clp-muted) !important; background: transparent !important; border: 1px solid transparent !important; border-radius: 8px 8px 0 0 !important;
  box-shadow: none !important;
}
#codeLab .lab-tab[aria-selected="true"] {
  color: #fff !important;
  background: linear-gradient(180deg, rgba(47, 129, 247, 0.12), rgba(47, 129, 247, 0.02)) !important;
  border-color: var(--clp-line) var(--clp-line) transparent !important;
  box-shadow: inset 0 -2px 0 0 var(--clp-cyan) !important;
}

/* ---------- The editor ---------- */
#codeLab .CodeMirror { font-family: var(--clp-mono) !important; font-feature-settings: "liga" 1, "calt" 1; background: transparent; }
#codeLab .lab-panel { background: rgba(5, 8, 14, 0.55); }
#codeLab .CodeMirror-gutters { border-right: 1px solid var(--clp-line) !important; background: rgba(255, 255, 255, 0.012) !important; }
#codeLab .CodeMirror-linenumber { color: #4b5568 !important; }
#codeLab .CodeMirror-activeline-background { background: rgba(47, 129, 247, 0.07) !important; }
#codeLab .CodeMirror-activeline-gutter .CodeMirror-linenumber, #codeLab .CodeMirror-activeline .CodeMirror-linenumber { color: #9fb6d9 !important; }
#codeLab .CodeMirror-cursor { border-left: 2px solid var(--clp-cyan) !important; }
#codeLab .CodeMirror-selected, #codeLab .CodeMirror-focused .CodeMirror-selected { background: rgba(47, 129, 247, 0.22) !important; }

/* ---------- Status bar: an IDE status bar ---------- */
#codeLab .plx-status {
  font-family: var(--clp-mono) !important; font-size: 0.72rem !important; letter-spacing: 0.02em;
  color: #eaf2ff !important; background: linear-gradient(90deg, #1f6feb 0%, #6d4aff 100%) !important; border-top: 0 !important;
}
#codeLab .plx-status * { color: inherit; }

/* ---------- Preview: a browser window ---------- */
#codeLab .lab-dots i { box-shadow: none; }
#codeLab .lab-preview-title {
  font-family: var(--clp-mono) !important; font-size: 0.78rem !important; font-weight: 600 !important;
  color: #cfe3ff !important; background: rgba(0, 0, 0, 0.35) !important; border: 1px solid var(--clp-line) !important; border-radius: 999px !important;
}
#codeLab .lab-frame { border-radius: 10px !important; box-shadow: 0 0 0 1px var(--clp-line-hi), 0 18px 40px -18px rgba(0, 0, 0, 0.8) !important; }
#codeLab .lab-site-dev { font-family: var(--clp-mono) !important; font-size: 0.74rem !important; }

/* ---------- Console: a terminal ---------- */
#codeLab .lab-console { background: rgba(3, 5, 10, 0.9) !important; border-top: 1px solid var(--clp-line) !important; }
#codeLab .lab-console summary { background: transparent !important; font-family: var(--clp-mono) !important; font-size: 0.78rem !important; color: var(--clp-muted) !important; }
#codeLab .lab-console summary span:first-child::before { content: "> "; color: var(--clp-cyan); }
#codeLab .lab-console-out { font-family: var(--clp-mono) !important; }

/* ---------- Small labels in mono ---------- */
#codeLab .lab-askai-label, #codeLab .lab-pname, #codeLab .lab-autosave, #codeLab .lab-run-status { font-family: var(--clp-mono) !important; }
#codeLab .lab-askai-label { color: var(--clp-muted) !important; text-transform: uppercase; font-size: 0.7rem !important; letter-spacing: 0.08em; }

/* ---------- Menus and dialogs opened from the Code Lab ---------- */
#codeLab .lcl-menu, #codeLab .lab-dl-menu {
  background: rgba(10, 14, 24, 0.96) !important; border: 1px solid var(--clp-line-hi) !important; border-radius: 12px !important;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.75) !important; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
#codeLab .lcl-head { font-family: var(--clp-mono) !important; letter-spacing: 0.1em; color: #5f6b80 !important; }

/* ---------- Phones: keep it light ---------- */
@media (max-width: 640px) {
  #codeLab .lab-editor, #codeLab .lab-right { backdrop-filter: none; -webkit-backdrop-filter: none; border-radius: 12px !important; }
  body.lab-bare, html.taa-app body:has(#codeLab) { background-attachment: scroll !important; }
}
@media (prefers-reduced-motion: reduce) {
  #codeLab .lab-pbtn, #codeLab .lcl-near-b, #codeLab .lab-icon-btn { transition: none; }
}

/* ---------- Highlights ---------- */
#codeLab .lab-quick-btn { color: #a5f3fc !important; border-color: rgba(34, 211, 238, 0.5) !important; background: rgba(34, 211, 238, 0.08) !important;
  box-shadow: 0 0 12px -6px rgba(34, 211, 238, 0.3) !important; }
#codeLab .lab-quick-btn svg { color: #67e8f9 !important; }
#codeLab .lab-welcome { background: rgba(34, 197, 94, 0.06) !important; border: 1px solid rgba(148, 163, 184, 0.14) !important; border-left: 3px solid #22c55e !important; border-radius: 10px !important; }
#codeLab .plx-auto, #codeLab .lab-autorun, #codeLab label:has(#labAutoRun) { font-family: var(--clp-mono) !important; font-size: 0.78rem !important; color: var(--clp-muted) !important; }
#codeLab .lab-dots i:nth-child(1) { background: #ff5f57 !important; } #codeLab .lab-dots i:nth-child(2) { background: #febc2e !important; } #codeLab .lab-dots i:nth-child(3) { background: #28c840 !important; }

/* Brackets and punctuation in the code: soft, so the words stand out. */
html body #codeLab:not(.plx-t-light) .lab-panel .cm-bracket, html body #codeLab:not(.plx-t-light) .lab-panel .cm-tag.cm-bracket { color: #565f89 !important; }
html body #codeLab:not(.plx-t-light) .lab-panel .cm-tag { color: var(--code-tag) !important; }
html body #codeLab:not(.plx-t-light) .lab-panel .cm-attribute { color: var(--code-attr) !important; }
html body #codeLab:not(.plx-t-light) .lab-panel .cm-string { color: var(--code-string) !important; }
html body #codeLab:not(.plx-t-light) .lab-panel .cm-keyword { color: var(--code-keyword) !important; }
html body #codeLab:not(.plx-t-light) .lab-panel .cm-number { color: var(--code-number) !important; }
html body #codeLab:not(.plx-t-light) .lab-panel .cm-property { color: var(--code-prop) !important; }
html body #codeLab:not(.plx-t-light) .lab-panel .cm-def, html body #codeLab:not(.plx-t-light) .lab-panel .cm-variable-2 { color: var(--code-def) !important; }
html body #codeLab:not(.plx-t-light) .lab-panel .cm-comment { color: #565f89 !important; font-style: italic; }
html body #codeLab:not(.plx-t-light) .lab-panel .CodeMirror { color: var(--code-text) !important; background: var(--code-bg) !important; }
html body #codeLab:not(.plx-t-light) .lab-panel .CodeMirror-gutters { background: var(--code-bg) !important; }

/* The editor's foot (website Code Lab: "Saved in this browser"; app: Update preview as I type): IDE-style. */
#codeLab .lab-editor-foot { font-family: var(--clp-mono) !important; font-size: 0.76rem !important; color: var(--clp-muted) !important;
  background: rgba(255, 255, 255, 0.02) !important; border-top: 1px solid var(--clp-line) !important; }
#codeLab .lab-saved { color: #9ece6a !important; }
#codeLab .lab-saved::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #9ece6a; box-shadow: 0 0 4px rgba(158, 206, 106, 0.6); vertical-align: 1px; }

/* ---------- Quick website keeps its cyan on hover, just a little brighter ---------- */
#codeLab .lab-quick-btn:hover { color: #cffafe !important; border-color: rgba(34, 211, 238, 0.75) !important; background: rgba(34, 211, 238, 0.14) !important;
  box-shadow: 0 0 14px -6px rgba(34, 211, 238, 0.4) !important; }
#codeLab .lab-quick-btn:hover svg { color: #a5f3fc !important; }

/* ---------- Full screen preview (founder 2026-10-13: "I clicked on the full screen mode ... it doesn't work") ----------
   The glass blur on .lab-right (backdrop-filter above) makes it the box that position: fixed is measured from, so the
   full screen preview (html.lab-full .lab-preview, playground.css) stayed inside the right panel and ran off the screen.
   In full screen nothing around the preview may blur, filter, transform or contain it. */
html.lab-full :has(.lab-preview) { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; filter: none !important; transform: none !important; contain: none !important; }
/* The panel's glass was the preview's only background: in full screen the bar gets a solid one, so the page behind it never shows through. */
html.lab-full #codeLab .lab-preview { background: #0a0e18 !important; width: auto !important; } /* inset: 0 sizes it to the window; 100vw also counted the scrollbar space and cut off the shrink button */

/* ===== Code Lab: clean + professional — FOUNDER-ONLY PREVIEW (2026-10-23) =====
   Every rule is gated on html.as-founder, which app-shell.js adds only when the
   server says the signed-in account is the founder. Students see no change at all.
   Appearance only: nothing is hidden and no feature is removed.
   To retire this preview, delete this block. To ship it to everyone, drop the
   "html.as-founder" prefix from each selector. */

/* 1. This used to tone the flat 2px top edge down to one accent hue, "so the page reads as a single
      system". That edge is gone - the panels now carry a lit ring the whole way round (above), and
      it is the same ring on every page, which serves the same intent. Overriding ::before here
      would paint a flat gradient over the bloom, so the rule is retired rather than re-pointed. */
/* the pink-purple loading sweep across the editor */
html.as-founder #codeLab .plx-load { opacity: 0 !important; }

/* 2. One consistent, quiet style for every secondary control */
html.as-founder #codeLab .lab-share-btn,
html.as-founder #codeLab .lab-myproj,
html.as-founder #codeLab .lab-vis-btn,
html.as-founder #codeLab .lab-askai-btn,
html.as-founder #codeLab .lab-quick-btn {
  min-height: 36px !important;
  padding: 0 13px !important;
  border-radius: 9px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(146, 170, 210, 0.06) !important;
  color: #d7e0f2 !important;
  font: 600 0.84rem/1 var(--font-head, inherit) !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  box-shadow: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  transition: background 0.15s ease, border-color 0.15s ease !important;
}
html.as-founder #codeLab .lab-share-btn:hover,
html.as-founder #codeLab .lab-myproj:hover,
html.as-founder #codeLab .lab-vis-btn:hover,
html.as-founder #codeLab .lab-askai-btn:hover,
html.as-founder #codeLab .lab-quick-btn:hover {
  border-color: rgba(255, 255, 255, 0.26) !important;
  background: rgba(146, 170, 210, 0.12) !important;
}

/* 3. The blue accent is reserved for the two real actions: Run and Publish */
html.as-founder #codeLab .lab-run,
html.as-founder #codeLab .lab-pub-moved,
html.as-founder #codeLab [data-track="codelab-publish-open"] {
  min-height: 36px !important;
  padding: 0 18px !important;
  border-radius: 9px !important;
  border: 1px solid transparent !important;
  color: #fff !important;
  background: linear-gradient(135deg, #2f8bff, #1f6feb) !important;
  box-shadow: 0 8px 18px -10px rgba(47, 129, 247, 0.7) !important;
  font-weight: 700 !important;
}

/* 4. Quick website keeps a gentle tint so it still invites, without a third colour */
html.as-founder #codeLab .lab-quick-btn {
  border-color: rgba(47, 129, 247, 0.42) !important;
  background: rgba(47, 129, 247, 0.09) !important;
  color: #cfe0ff !important;
}

/* 5. Drop the status dot on the Code / CSS / JS tabs */
html.as-founder #codeLab .lab-tab::before { display: none !important; }

/* 6. Phone: even button rows and an editor that fills the screen */
@media (max-width: 640px) {
  html.as-founder #codeLab .lab-tools,
  html.as-founder #codeLab .lab-askai-btns {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  /* the small tools wrap into even rows of about three, labels still readable.
     flex-basis, not "1 1 0": squeezing five onto one row truncated them to "My pro…". */
  html.as-founder #codeLab .lab-tools > *:not(.lab-run),
  html.as-founder #codeLab .lab-askai-btns > * {
    flex: 1 1 92px !important;
    min-width: 92px !important;
    padding: 0 8px !important;
  }
  html.as-founder #codeLab .lab-run { flex: 1 0 100% !important; }
  /* the editor takes the space that used to be empty below it */
  html.as-founder #codeLab .lab-panel .CodeMirror,
  html.as-founder #codeLab .lab-panel textarea { min-height: 46vh !important; }
}
