/* TaniCode desktop app (html.tc-desktop): the project bar is a LEFT NAVIGATION SIDEBAR.
   Scoped to .tc-desktop (the Electron desktop app only — see code-lab-tanicode.js), so the website and
   in-app Code Lab are untouched. Reuses the REAL .lab-pbar buttons (re-homed on <body> by the JS so this
   fixed column pins to the window's left edge). Founder 2026-11-09. */

:root.tc-desktop { --tc-w: 234px; }

/* The sidebar. Layout props are !important so no other Code Lab stylesheet (premium / clean / a founder-only
   sheet) can knock the fixed left column out of place once the JS has re-homed the bar onto <body>. */
html.tc-desktop .lab-pbar {
  position: fixed !important; left: 0 !important; top: 0 !important; bottom: 0 !important; width: var(--tc-w) !important; z-index: 1200 !important;
  display: flex !important; flex-direction: column !important; align-items: stretch !important; justify-content: flex-start !important;
  flex-wrap: nowrap !important; gap: 3px; padding: 14px 12px 18px; margin: 0; overflow-y: auto; overflow-x: hidden;
  background: linear-gradient(180deg, #0d1a38, #091127);
  border: 0; border-right: 1px solid rgba(120, 170, 255, .18);
  box-shadow: 10px 0 40px -18px rgba(0, 0, 0, .7);
}

/* Each project-bar control as a full-width vertical row (icon + label, left-aligned) */
html.tc-desktop .lab-pbar .lab-pbtn {
  width: 100%; box-sizing: border-box; justify-content: flex-start; gap: 11px;
  min-height: 42px; height: auto; padding: 10px 12px; margin: 0; text-align: left;
  font-size: 13.5px; font-weight: 600; line-height: 1.2; color: #d7e3fa;
  background: rgba(255, 255, 255, .02); border: 1px solid transparent; border-radius: 0;
}
html.tc-desktop .lab-pbar .lab-pbtn:hover { background: rgba(31, 123, 255, .14); border-color: rgba(120, 170, 255, .25); color: #fff; }
html.tc-desktop .lab-pbar .lab-pbtn > svg { flex: none; width: 18px; height: 18px; }
html.tc-desktop .lab-pbar .lab-pbtn > span { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.tc-desktop .lab-pbar .lab-pbtn .lcl-dot { flex: none; }

/* The project name button is the header row */
html.tc-desktop .lab-pbar .lab-pbtn-proj { font-weight: 800; font-size: 15px; color: #eef4ff; min-height: 46px; margin-bottom: 4px; }
html.tc-desktop .lab-pbar .lab-pname { font-weight: 800; }

/* The tools group (Publish, Quick website, Upload, Download, More … via TAALabBar) stacks full width.
   display:flex + column is !important so the per-button `order` (set inline by the JS) always wins — without a
   flex column the buttons would fall back to DOM order and look shuffled. */
html.tc-desktop .lab-pbar .lab-pbar-tools {
  display: flex !important; flex-direction: column !important; align-items: stretch; flex-wrap: nowrap !important;
  gap: 3px; width: 100%; margin: 4px 0 0; padding: 0;
}
html.tc-desktop .lab-pbar .lab-pbar-tools > * { width: 100%; }

/* Make Publish read as the primary action */
html.tc-desktop .lab-pbar [data-track="codelab-publish-open"],
html.tc-desktop .lab-pbar .lab-publish {
  background: linear-gradient(135deg, #1f7bff, #38b6ff); color: #fff; border-color: transparent; font-weight: 800;
}
html.tc-desktop .lab-pbar [data-track="codelab-publish-open"]:hover { filter: brightness(1.08); color: #fff; }

/* The "Not saved yet" sync chip, full width under the header */
html.tc-desktop .lab-pbar .lab-psync { align-self: stretch; margin: 2px 0 2px; }

/* Push the editor + preview to the right of the sidebar */
html.tc-desktop .lab-section { padding-left: var(--tc-w) !important; padding-right: 0; }
html.tc-desktop .lab-container { max-width: none !important; margin: 0 !important; padding-left: 10px; padding-right: 10px; }

/* Keep dropdown menus (Download, More, Projects) readable over the editor */
html.tc-desktop .lab-pbar .lab-dl-menu,
html.tc-desktop .lab-pbar .lcl-menu { z-index: 1260; }

@media (max-width: 820px) {
  :root.tc-desktop { --tc-w: 58px; }
  html.tc-desktop .lab-pbar .lab-pbtn > span:not(.lab-pname) { display: none; }
  html.tc-desktop .lab-pbar .lab-pbtn { justify-content: center; padding: 10px 6px; }
}

/* Buttons moved in from the editor bar (Quick website, Check, Restore, Find) + Connect-my-domain (whose
   original is display:none) — match the sidebar rows and force them visible. */
html.tc-desktop .lab-pbar .tc-moved {
  display: flex !important; align-items: center;
  width: 100%; box-sizing: border-box; justify-content: flex-start; gap: 11px; min-height: 42px;
  height: auto; padding: 10px 12px; margin: 0; text-align: left; font-size: 13.5px; font-weight: 600;
  color: #d7e3fa; background: rgba(255,255,255,.02); border: 1px solid transparent; border-radius: 0;
}
html.tc-desktop .lab-pbar .tc-moved:hover { background: rgba(31,123,255,.14); border-color: rgba(120,170,255,.25); color: #fff; }
html.tc-desktop .lab-pbar .tc-moved > svg, html.tc-desktop .lab-pbar .tc-moved > span:first-child svg { flex: none; width: 18px; height: 18px; }
/* Hide the project bar's own Check/Restore when the canonical editor-bar ones were moved in (no duplicates) */
html.tc-desktop .lab-pbar .tc-dupe { display: none !important; }

/* The moved Check/Restore/Find were icon-only near the tab — reveal their text labels in the sidebar */
html.tc-desktop .lab-pbar .tc-moved > span,
html.tc-desktop .lab-pbar .tc-moved .visually-hidden,
html.tc-desktop .lab-pbar .tc-moved .lcl-near-tx {
  position: static !important; width: auto !important; height: auto !important; margin: 0 !important;
  clip: auto !important; -webkit-clip-path: none !important; clip-path: none !important; overflow: visible !important;
  display: inline !important; white-space: nowrap; color: inherit; font: inherit; letter-spacing: normal;
}

/* The .lcl-near-b buttons carry a full + short label; show only the full one (no doubling) */
html.tc-desktop .lab-pbar .tc-moved .lcl-l-short { display: none !important; }

/* ---- Top header: strip it down to just the "TaniCode" title ---- */
/* Hide the burger + the whole right-side chrome (My Websites/Connect/Remove Watermark/Buy domain/Support/
   points/notification bell/fullscreen/avatar) and the toast + scrim. Keep ONLY the title. */
html.tc-desktop .as-burger,
html.tc-desktop .as-top .as-right,
html.tc-desktop .as-vbar,
html.tc-desktop .as-alerts,
html.tc-desktop .as-scrim { display: none !important; }
/* Start the top bar after the sidebar so the title is no longer hidden behind it */
html.tc-desktop .as-top { left: var(--tc-w) !important; background: linear-gradient(180deg, #0a1530, #081021); border-bottom: 1px solid rgba(120,170,255,.14); }
/* The top bar is empty now that the logo moved into the sidebar corner (TaniChat has no bar above its logo) */
html.tc-desktop .as-top { display: none !important; }
html.tc-desktop .lab-section { padding-top: 10px !important; }
/* The logo fills the FULL width of the sidebar. assets/tanicode-mark.png is the logo with its near-black
   square knocked out to transparent (alpha taken from luminance, the right move for glow-on-black art), the
   same treatment app-mark.png got for tanix.app — so no rectangle/edges show, only the art and its glow
   (founder 2026-11-09: "make it full the sidebar container, don't show the logo image edges"). */
/* The logo is a link home (founder 2026-11-09: "when I click on the logo, take me home") */
html.tc-desktop .lab-pbar a.tc-logowrap {
  display: block; width: calc(100% + 24px); margin: -14px -12px 2px; /* cancel the bar's 12px side padding */
  padding: 0; border-bottom: 0; background: none; text-decoration: none; cursor: pointer;
  transition: filter .15s, transform .15s;
}
html.tc-desktop .lab-pbar a.tc-logowrap:hover { filter: brightness(1.12); transform: translateY(-1px); }
html.tc-desktop .lab-pbar .tc-logo { display: block; width: 100%; height: auto; object-fit: contain; }

/* Generic hide for the buttons folded away (Insert/Class/My website/Sections/Messages/APIs/More) */
html.tc-desktop .lab-pbar .tc-hide,
html.tc-desktop .lcl-more.tc-hide { display: none !important; }

/* The folded-in "More" features (proxy rows that click the real control) — match the sidebar rows */
html.tc-desktop .lab-pbar .tc-more {
  width: 100%; box-sizing: border-box; display: flex; align-items: center; justify-content: flex-start;
  gap: 11px; min-height: 42px; height: auto; padding: 10px 12px; margin: 0; text-align: left;
  font-size: 13.5px; font-weight: 600; color: #d7e3fa;
  background: rgba(255, 255, 255, .02); border: 1px solid transparent; border-radius: 0; cursor: pointer;
}
html.tc-desktop .lab-pbar .tc-more:hover { background: rgba(31, 123, 255, .14); border-color: rgba(120, 170, 255, .25); color: #fff; }
html.tc-desktop .lab-pbar .tc-more > svg { flex: none; width: 18px; height: 18px; }
html.tc-desktop .lab-pbar .tc-more > span { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.tc-desktop .lab-pbar .tc-more.tc-danger { color: #f3a6a6; }
html.tc-desktop .lab-pbar .tc-more.tc-danger:hover { background: rgba(255, 90, 90, .14); border-color: rgba(255, 120, 120, .3); color: #ffbdbd; }

/* ---- Editor-theme picker ---- */
html.tc-desktop .tc-themepop {
  position: fixed; z-index: 2200; width: 296px; max-height: 76vh; overflow: auto;
  background: #0c1730; border: 1px solid rgba(120, 170, 255, .28); border-radius: 14px;
  box-shadow: 0 26px 70px -22px rgba(0, 0, 0, .85); padding: 13px;
}
html.tc-desktop .tc-themepop-h { font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: #8ba0c8; margin: 2px 2px 11px; }
html.tc-desktop .tc-themegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
html.tc-desktop .tc-themecard {
  display: flex; flex-direction: column; gap: 7px; padding: 8px; cursor: pointer;
  background: rgba(255, 255, 255, .03); border: 1.5px solid transparent; border-radius: 10px; text-align: left;
}
html.tc-desktop .tc-themecard:hover { background: rgba(31, 123, 255, .12); }
html.tc-desktop .tc-themecard.is-on { border-color: #3aa0ff; background: rgba(31, 123, 255, .16); }
html.tc-desktop .tc-themecard .tc-sw { display: flex; align-items: center; gap: 5px; height: 42px; border-radius: 7px; padding: 0 11px; border: 1px solid rgba(255, 255, 255, .09); }
html.tc-desktop .tc-themecard .tc-sw i { width: 11px; height: 11px; border-radius: 50%; display: block; }
html.tc-desktop .tc-themecard .tc-themename { font-size: 12.5px; font-weight: 600; color: #dce7fb; }

/* ---- Workspace tabs: the rest of the account (same tanix.app login + data) ---- */
html.tc-desktop .lab-pbar .tc-tabgrp {
  display: flex; flex-direction: column; align-items: stretch; gap: 3px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(120, 170, 255, .16);
}
html.tc-desktop .lab-pbar .tc-grouphead {
  font-size: 10.5px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase;
  color: #6f85ad; padding: 2px 12px 6px;
}
html.tc-desktop .lab-pbar a.tc-tab {
  display: flex; align-items: center; gap: 11px; width: 100%; box-sizing: border-box;
  min-height: 42px; padding: 10px 12px; text-decoration: none; text-align: left;
  font-size: 13.5px; font-weight: 600; color: #d7e3fa;
  background: rgba(255, 255, 255, .02); border: 1px solid transparent; border-radius: 0;
}
html.tc-desktop .lab-pbar a.tc-tab:hover { background: rgba(31, 123, 255, .14); border-color: rgba(120, 170, 255, .25); color: #fff; }
/* Founder-only rows (AI Website Builder = launch group buildai) hidden unless the account is the founder */
html.tc-desktop:not(.as-founder) .lab-pbar a.tc-tab.tc-founder { display: none !important; }
/* The AI Website Builder gets a subtle accent so it stands out in the Workspace list */
html.tc-desktop .lab-pbar a.tc-tab.tc-founder > svg { color: #58b6ff; }
html.tc-desktop .lab-pbar a.tc-tab > svg { flex: none; width: 18px; height: 18px; }
html.tc-desktop .lab-pbar a.tc-tab > span { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 820px) {
  html.tc-desktop .lab-pbar a.tc-tab > span, html.tc-desktop .lab-pbar .tc-grouphead { display: none; }
  html.tc-desktop .lab-pbar a.tc-tab { justify-content: center; padding: 10px 6px; }
}

/* ---- Quick website modal: centre it in the editor area (right of the sidebar) and give it a premium look ----
   The modal (.lpa-wrap backdrop + .lpa-box.lqw-box) is styled inline by code-lab-paste.js and centres over the
   whole window, so in TaniCode it sits shifted left into the sidebar's zone. These tc-desktop overrides shift
   the box into the content area and dress it up. */
html.tc-desktop .lpa-wrap {
  justify-content: flex-start !important;
  padding-left: calc(var(--tc-w) + 22px) !important; padding-right: 22px !important;
  background: rgba(2, 6, 20, .72) !important; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
/* The AI-window-docked variant already left-aligns; keep it clear of the sidebar too */
html.tc-desktop .lpa-wrap.lqw-left { justify-content: flex-start !important; padding-left: calc(var(--tc-w) + 22px) !important; }

/* The box is sized to the code column by the JS (fitQuick); as a flex column the paste area (step 3) grows to
   fill the extra height so there is no empty gap, and the buttons sit at the bottom. */
html.tc-desktop .lqw-box { display: flex !important; flex-direction: column; overflow: auto; }
html.tc-desktop .lqw-box .lpa-text:not(.lqw-desc) { flex: 1 1 auto; min-height: 120px; }
html.tc-desktop .lqw-box {
  max-width: 500px !important; padding: 26px 28px 22px !important; border-radius: 20px !important;
  background: linear-gradient(180deg, #0e1c40, #0a142e) !important;
  border: 1px solid rgba(120, 170, 255, .28) !important;
  box-shadow: 0 34px 90px -24px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .05) !important;
}
html.tc-desktop .lqw-box h2 {
  font-size: 1.4rem !important; font-weight: 800; letter-spacing: .2px; margin-bottom: 4px !important;
  background: linear-gradient(90deg, #9ad4ff, #5b8cff); -webkit-background-clip: text; background-clip: text; color: transparent;
}
html.tc-desktop .lqw-box .lqw-step { color: #c3d8ff !important; font-weight: 800 !important; font-size: .98rem; margin-top: 18px !important; }
html.tc-desktop .lqw-box .lqw-guide { color: #7cc4ff !important; }
/* Text inputs: rounded with a focus ring */
html.tc-desktop .lqw-box .lpa-text,
html.tc-desktop .lqw-box .lqw-desc {
  border-radius: 12px !important; border: 1px solid rgba(120, 170, 255, .22) !important;
  background: rgba(255, 255, 255, .03) !important; padding: 12px 14px !important; transition: border-color .15s, box-shadow .15s;
}
html.tc-desktop .lqw-box .lpa-text:focus,
html.tc-desktop .lqw-box .lqw-desc:focus { border-color: #3aa0ff !important; box-shadow: 0 0 0 3px rgba(58, 160, 255, .18) !important; outline: none; }
/* The three AI buttons: cleaner, with a lift on hover */
html.tc-desktop .lqw-box .lqw-ai {
  min-height: 46px !important; border-radius: 12px !important; border: 1px solid rgba(120, 170, 255, .22) !important;
  background: rgba(255, 255, 255, .035) !important; font-weight: 700 !important; transition: transform .12s, border-color .15s, background .15s;
}
html.tc-desktop .lqw-box .lqw-ai:hover { border-color: #3aa0ff !important; background: rgba(31, 123, 255, .16) !important; transform: translateY(-1px); }
/* The database/payments toggle row, a touch calmer */
html.tc-desktop .lqw-box .lqw-tools { font-size: .9rem; color: #aebfe0; }

/* ---- Faithful themes: give comments each theme's own colour (premium.css forces one slate for all) ----
   Higher specificity than the premium rule, so --code-comment (set per theme in playground-fx.css) wins —
   e.g. Shades of Purple gets lavender comments, Jelly a soft grey, Night Owl a muted teal. */
html.tc-desktop #codeLab:not(.plx-t-light) .lab-panel .cm-comment { color: var(--code-comment, var(--code-muted)) !important; font-style: italic; }

/* ---- The WHOLE code box responds to the theme (founder 2026-11-09: "redesign the code box to respond to
   themes so it looks beautiful"). premium.css paints the editor chrome from a fixed --clp-* palette; remap
   those vars to the current theme's --code-* inside #codeLab, so the editor bar, toolbars, status bar,
   borders, gutter and the preview frame all recolour together. ---- */
html.tc-desktop #codeLab {
  --clp-bg: var(--code-bg) !important;
  --clp-panel: var(--code-bg) !important;
  --clp-bar: var(--plx-ed-bar) !important;
  --clp-line: color-mix(in srgb, var(--code-muted) 24%, transparent) !important;
  --clp-line-hi: color-mix(in srgb, var(--code-muted) 34%, transparent) !important;
  --clp-text: var(--code-text) !important;
  --clp-muted: var(--code-muted) !important;
  --clp-blue: var(--plx-accent) !important;
}
/* The bars sit on the theme's slightly-offset --plx-ed-bar for a touch of depth */
html.tc-desktop #codeLab .lab-editor-bar,
html.tc-desktop #codeLab .lab-tools,
html.tc-desktop #codeLab .plx-status,
html.tc-desktop #codeLab .lab-editor-foot,
html.tc-desktop #codeLab .lab-preview-bar { background: var(--plx-ed-bar) !important; }
/* Editor + preview panels take the theme background; a soft accent ring instead of the fixed blue glow */
html.tc-desktop #codeLab .lab-editor,
html.tc-desktop #codeLab .lab-right { background: var(--code-bg) !important; box-shadow: 0 0 0 1px color-mix(in srgb, var(--code-muted) 18%, transparent), 0 20px 50px -28px rgba(0, 0, 0, .7) !important; }
html.tc-desktop #codeLab .CodeMirror,
html.tc-desktop #codeLab .CodeMirror-gutters { background: var(--code-bg) !important; }
/* The active file tab underlined in the theme accent */
html.tc-desktop #codeLab .lab-tab[aria-selected="true"] { box-shadow: inset 0 -2px 0 var(--plx-accent) !important; }

/* ---- Publish / Check / Restore / Find moved into the code box (founder: "move them to the code container
   box, at the right spots") ---- */
/* Publish = primary action, top-right of the Code tab row */
html.tc-desktop #codeLab .lab-editor-bar .lab-tabs { display: flex !important; align-items: center; flex-wrap: wrap; gap: 8px; }
/* Drop the "index.html" file label and the "Wrap: on" toggle from the code panel (founder 2026-11-09);
   wrapping still works, it is just not a button here. */
html.tc-desktop #codeLab .plx-fname,
html.tc-desktop #codeLab #labWrap { display: none !important; }

/* Pull the panels up to fill the space at the top. The app shell reserves --as-top (56px) of body padding
   for the top bar; that bar is hidden in TaniCode, so reclaim the space and let the panels start at 0. */
html.tc-desktop body { padding-top: 0 !important; }
html.tc-desktop main#main { margin-top: 0 !important; padding-top: 0 !important; }
html.tc-desktop .lab-section { padding-top: 0 !important; }
html.tc-desktop .lab-container { padding-top: 0 !important; }
html.tc-desktop #codeLab { margin-top: 0 !important; }
html.tc-desktop #codeLab .lab-editor, html.tc-desktop #codeLab .lab-right { margin-top: 0 !important; }
html.tc-desktop #codeLab .tc-editpub {
  margin-left: auto !important; order: 99; width: auto !important; min-width: 0 !important;
  height: 32px !important; min-height: 0 !important; padding: 0 18px !important;
  display: inline-flex !important; align-items: center; gap: 7px; white-space: nowrap;
  background: linear-gradient(135deg, #1f7bff, #38b6ff) !important; color: #fff !important;
  border: 0 !important; border-radius: 9px !important; font-weight: 800 !important; font-size: .84rem !important; cursor: pointer;
  box-shadow: 0 6px 18px -8px rgba(31, 123, 255, .8);
}
html.tc-desktop #codeLab .tc-editpub:hover { filter: brightness(1.08); }
html.tc-desktop #codeLab .tc-editpub > svg { width: 15px; height: 15px; flex: none; }
/* Check / Restore / Find = compact buttons in the editor toolbar, next to undo/redo/Upload */
/* One compact row: the moved tools + Clear all fit beside undo/redo/Upload without wrapping */
html.tc-desktop #codeLab .lab-tools { flex-wrap: nowrap; row-gap: 6px; gap: 6px; overflow-x: auto; scrollbar-width: none; }
html.tc-desktop #codeLab .lab-tools::-webkit-scrollbar { display: none; }
html.tc-desktop #codeLab .tc-edittool {
  display: inline-flex !important; align-items: center; gap: 5px; width: auto !important; min-width: 0 !important;
  height: 32px !important; min-height: 0 !important; padding: 0 9px !important; margin: 0 !important;
  white-space: nowrap; flex: none;
  font-size: .79rem !important; font-weight: 600; border-radius: 8px !important;
  background: rgba(255, 255, 255, .04) !important; border: 1px solid color-mix(in srgb, var(--code-muted) 26%, transparent) !important; color: var(--code-text) !important;
}
html.tc-desktop #codeLab .tc-edittool:hover { background: color-mix(in srgb, var(--plx-accent) 18%, transparent) !important; border-color: var(--plx-accent) !important; }
html.tc-desktop #codeLab .tc-edittool > svg { width: 15px; height: 15px; flex: none; }
html.tc-desktop #codeLab .tc-edittool .lcl-l-short { display: none !important; }
/* ---- Merged sidebar rows (AI panel, Domains, Design): one row that opens a small menu ---- */
html.tc-desktop .lab-pbar .tc-menurow { position: relative; }
html.tc-desktop .lab-pbar .tc-menurow .tc-caret { width: 14px; height: 14px; flex: none; opacity: .5; margin-left: auto; }
html.tc-desktop .lab-pbar .tc-menurow:hover .tc-caret { opacity: .9; }
html.tc-desktop .lab-pbar .tc-tabholder { display: contents; }
html.tc-desktop .tc-rowmenu {
  position: fixed; z-index: 2200; min-width: 206px; padding: 7px;
  background: #0c1730; border: 1px solid rgba(120, 170, 255, .28); border-radius: 12px;
  box-shadow: 0 22px 60px -20px rgba(0, 0, 0, .85); display: flex; flex-direction: column; gap: 2px;
}
html.tc-desktop .tc-rowmenu-i {
  display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-radius: 8px;
  background: none; color: #d7e3fa; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
html.tc-desktop .tc-rowmenu-i:hover { background: rgba(31, 123, 255, .18); color: #fff; }

/* The "Auto-saved / Not saved yet" chip, now in the editor status bar */
html.tc-desktop #codeLab .plx-status .tc-syncchip {
  margin: 0 10px 0 0 !important; align-self: center; font-size: .74rem !important; white-space: nowrap; opacity: .9;
}

/* Clear is destructive, so it reads red and sits last in the toolbar */
html.tc-desktop #codeLab .tc-clearbtn { color: #f3a6a6 !important; cursor: pointer; }
html.tc-desktop #codeLab .tc-clearbtn:hover { background: rgba(255, 90, 90, .14) !important; border-color: rgba(255, 120, 120, .45) !important; color: #ffbdbd !important; }

/* ---- Publish dialog sized to the code box (JS pins left/top/width/max-height); dressed to match ---- */
html.tc-desktop .lab-tool-dialog.lab-pub-wide {
  box-sizing: border-box; overflow: auto !important; border-radius: 18px !important;
  border: 1px solid rgba(120, 170, 255, .28) !important;
  background: linear-gradient(180deg, #0e1c40, #0a142e) !important; color: #eaf1ff !important;
  box-shadow: 0 30px 80px -24px rgba(0, 0, 0, .85) !important;
}
html.tc-desktop .lab-tool-dialog.lab-pub-wide::backdrop { background: rgba(2, 6, 20, .72); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }

/* "New" folds into the project menu (the project header already opens a project list), freeing a row */
html.tc-desktop .lab-pbar [data-track="codelab-project-new"] { display: none !important; }

/* The status bar hides extras when narrow; the save chip must survive that */
html.tc-desktop #codeLab .plx-status.is-narrow .tc-syncchip,
html.tc-desktop #codeLab .plx-status.is-tiny .tc-syncchip { display: inline-flex !important; }

/* Fit the toolbar on ONE row: the find button uses its short label ("Find"), Theme is icon-only,
   and the padding tightens. Without this the row overflows by ~140px and Theme wraps. */
html.tc-desktop #codeLab .tc-edittool { padding: 0 8px !important; }
html.tc-desktop #codeLab .tc-edittool[data-track="codelab-find-open"] .lcl-l-full { display: none !important; }
html.tc-desktop #codeLab .tc-edittool[data-track="codelab-find-open"] .lcl-l-short { display: inline !important; }
html.tc-desktop #codeLab .lab-tabs .tc-themebtn { margin-left: auto !important; padding: 0 11px !important; }
html.tc-desktop #codeLab .lab-tabs .tc-editpub { margin-left: 8px !important; }

/* The preview's fake address bar ("preview /index.html") says nothing the student needs — remove it and
   give the space to Publish, which now sits in that bar (founder 2026-11-09). */
html.tc-desktop #codeLab .plx-addr { display: none !important; }
/* ONE tidy row: the "Live preview" label on the left, then Edit on page / expand / Publish grouped
   tightly on the right. The label takes the slack (margin-right:auto) instead of Publish being shoved
   across the bar, which left the three controls floating apart (founder 2026-11-09: "too scattered"). */
html.tc-desktop #codeLab .lab-preview-bar { display: flex !important; align-items: center; gap: 7px; flex-wrap: nowrap; }
html.tc-desktop #codeLab .lab-preview-bar .lab-preview-title { margin-right: auto !important; }
html.tc-desktop #codeLab .lab-preview-bar .tc-editpub { margin-left: 0 !important; order: 60; height: 30px !important; padding: 0 14px !important; }
/* "Edit on page" sits with the other things you press, not stranded in the middle of the bar (founder
   2026-11-09: "Move this Edit on page to the right as well in Tanicode"). The title already carries
   margin-right:auto, so ordering these two just below Publish's 60 puts the whole group flush right and
   leaves ONE gap - after "Live preview" - where there were two. Order, not float or margin, because the
   bar is a flex row and the DOM order is set by code-lab-visual.js, which inserts the button next to the
   Run-again button for the website's own Code Lab. Touching the order here changes the desktop app only. */
html.tc-desktop #codeLab .lab-preview-bar .lab-vis-btn { order: 50; margin-left: 0 !important; }
html.tc-desktop #codeLab .lab-preview-bar .lab-expand { order: 40; margin-left: 0 !important; }
html.tc-desktop #codeLab .lab-preview-bar > button, html.tc-desktop #codeLab .lab-preview-bar > a { flex: none; }

/* "Show all N projects / websites" — the project window now caps its two long lists */
html.tc-desktop .lab-proj-showall, .lab-proj-showall {
  display: block; width: 100%; margin: 8px 0 4px; padding: 11px 14px; cursor: pointer;
  background: rgba(31, 123, 255, .12); border: 1px solid rgba(120, 170, 255, .3); border-radius: 10px;
  color: #cfe0ff; font-size: 13.5px; font-weight: 700;
}
html.tc-desktop .lab-proj-showall:hover, .lab-proj-showall:hover { background: rgba(31, 123, 255, .2); color: #fff; }

/* The project window's footer: one quiet line, not two reassurance cards */
.lab-proj-foot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 10px 0 2px; padding: 10px 2px 0; border-top: 1px solid rgba(148, 163, 184, .16);
  font-size: 12.5px; color: #8fa2c4;
}
.lab-proj-foot .lab-proj-offline { margin-left: auto; }
