/* CodeLab: public code example library (/codelab) and snippet pages. Builds on site.css and courses.css. */

/* Per-language accent colours, used by cards, badges and the snippet header. */
[data-lang] { --cl-a: #000080; --cl-b: #3a3ac4; }
[data-lang="html"] { --cl-a: #c2410c; --cl-b: #f97316; }
[data-lang="css"] { --cl-a: #1d4ed8; --cl-b: #3b82f6; }
[data-lang="javascript"] { --cl-a: #a16207; --cl-b: #eab308; }
[data-lang="php"] { --cl-a: #4338ca; --cl-b: #818cf8; }
[data-lang="sql"] { --cl-a: #0e7490; --cl-b: #22d3ee; }
[data-lang="python"] { --cl-a: #1e40af; --cl-b: #facc15; }
[data-lang="java"] { --cl-a: #b91c1c; --cl-b: #f87171; }
[data-lang="c"], [data-lang="cpp"] { --cl-a: #334155; --cl-b: #64748b; }
[data-lang="json"], [data-lang="xml"] { --cl-a: #6d28d9; --cl-b: #a78bfa; }
[data-lang="bash"] { --cl-a: #111827; --cl-b: #4b5563; }

.cl-section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.cl-section-head h2 { font-size: 1.35rem; font-weight: 800; margin: 0; }
.cl-section-head a { font-weight: 700; font-size: .9rem; }

/* ---- Hero ---- */
.cl-hero h1 em { font-style: normal; color: inherit; }
.cl-hero-stats { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.6rem; }
.cl-hero-stats div { min-width: 104px; padding: .6rem .9rem; border-radius: 14px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); }
.cl-hero-stats strong { display: block; font-size: 1.45rem; font-weight: 800; color: #fff; line-height: 1.1; }
.cl-hero-stats span { font-size: .78rem; font-weight: 600; color: rgba(255, 255, 255, .78); }
.cl-hero-art { position: relative; transform: rotate(-1.5deg); }
.cl-hero-art .cl-window { box-shadow: 0 30px 70px rgba(0, 0, 0, .45); }
.cl-hero-art .cl-peek { min-height: 210px; font-size: .84rem; }
.cl-hero-play { position: relative; display: flex; align-items: center; gap: .8rem; margin: -1.2rem 1.5rem 0 auto; width: max-content; max-width: 100%; transform: rotate(1.5deg);
  background: #fff; color: var(--ink); border-radius: 16px; padding: .75rem 1rem; box-shadow: 0 18px 40px rgba(0, 0, 0, .3); text-decoration: none !important; transition: transform .2s; }
.cl-hero-play:hover { transform: rotate(1.5deg) translateY(-3px); color: var(--ink); }
.cl-hero-play .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--gold); color: #3a2a00; font-size: 1.1rem; }
.cl-hero-play strong { display: block; font-size: .95rem; }
.cl-hero-play small { color: var(--muted); }
.cl-hero-play > .fa-arrow-right { color: var(--g-700); }

/* "Just added" strip under the hero */
.cl-new { background: #fff; border-bottom: 1px solid var(--line); }
.cl-new .container { display: flex; align-items: center; gap: 1rem; padding-top: .75rem; padding-bottom: .75rem; min-width: 0; }
.cl-new-label { flex: none; display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; font-weight: 800; color: var(--gold-600); }
.cl-new-list { display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.cl-new-list::-webkit-scrollbar { display: none; }
.cl-new-list a { flex: none; display: inline-flex; align-items: center; gap: .45rem; max-width: 280px; padding: .35rem .8rem; border-radius: 999px; background: var(--bg); border: 1px solid var(--line);
  color: var(--ink); font-size: .84rem; font-weight: 600; text-decoration: none; transition: border-color .15s, background .15s; }
.cl-new-list a:hover { border-color: var(--g-200); background: #fff; color: var(--ink); }
.cl-new-list a i { color: var(--cl-a); }
.cl-new-list a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Cards: an editor window with the first lines of code, then the details. The whole card is one link. ---- */
.cl-card { position: relative; display: flex; flex-direction: column; height: 100%; background: #fff; border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s, border-color .2s; }
.cl-card:hover { transform: translateY(-4px); box-shadow: 0 22px 44px rgba(7, 7, 63, .14); border-color: var(--g-200); }
.cl-card:focus-within { outline: 3px solid rgba(28, 28, 168, .35); outline-offset: 2px; }
.cl-window { background: #0d1117; border-radius: 16px; overflow: hidden; border: 1px solid #20234a; }
.cl-card .cl-window { border-radius: 0; border: 0; border-bottom: 3px solid var(--cl-b); }
.cl-window-bar { display: flex; align-items: center; gap: .6rem; padding: .55rem .8rem; background: #161b22; border-bottom: 1px solid #21262d; }
.cl-dots { display: inline-flex; gap: 5px; }
.cl-dots i { width: 9px; height: 9px; border-radius: 50%; background: #ff5f57; }
.cl-dots i:nth-child(2) { background: #febc2e; }
.cl-dots i:nth-child(3) { background: #28c840; }
.cl-window-name { display: inline-flex; align-items: center; gap: .4rem; min-width: 0; color: #c9d1d9; font: 600 .78rem ui-monospace, Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-window-name i { color: var(--cl-b); }
.cl-window-tag { margin-left: auto; flex: none; font-size: .7rem; font-weight: 800; color: #0d1117; background: var(--cl-b); border-radius: 999px; padding: .1rem .5rem; }
.cl-peek { margin: 0; height: 132px; padding: .75rem .9rem; overflow: hidden; color: #c9d1d9; font: .76rem/1.55 ui-monospace, "SFMono-Regular", Consolas, monospace; white-space: pre; position: relative;
  -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent); mask-image: linear-gradient(180deg, #000 60%, transparent); }
.cl-card.lg .cl-peek { height: 170px; }
.cl-peek code, .cl-peek code.hljs { padding: 0; background: transparent; font: inherit; white-space: pre; }
.cl-card-body { display: flex; flex-direction: column; flex: 1; padding: 1rem 1.15rem 1rem; }
.cl-badges { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .55rem; }
.cl-diff { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 800; padding: .16rem .6rem; border-radius: 999px; background: var(--g-100); color: var(--g-800); }
.cl-diff.intermediate { background: var(--gold-100); color: #6b4a00; }
.cl-diff.advanced { background: #fde6ea; color: #8f2035; }
.cl-prev { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 700; padding: .16rem .6rem; border-radius: 999px; background: #e0f2fe; color: #075985; }
.cl-prev i { font-size: .62rem; }
.cl-prev.off { background: #f1f2f8; color: var(--muted); }
.cl-star { margin-left: auto; color: var(--gold); font-size: .9rem; }
.cl-card h3 { font-size: 1.05rem; line-height: 1.35; margin: 0 0 .35rem; }
.cl-card h3 a { color: var(--ink); text-decoration: none; }
.cl-card:hover h3 a { color: var(--g-700); }
.cl-card p { color: var(--muted); font-size: .87rem; margin-bottom: .75rem; }
.cl-card .cl-langs { margin-bottom: .9rem; }
.cl-card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding-top: .75rem; border-top: 1px solid var(--line); font-size: .8rem; font-weight: 600; color: var(--muted); }
.cl-card-foot i { margin-right: .35rem; color: var(--g-600); }
.cl-go { color: var(--g-700); font-weight: 800; }
.cl-go i { margin: 0 0 0 .35rem; color: inherit; transition: transform .2s; }
.cl-card:hover .cl-go i { transform: translateX(3px); }

/* Languages in a project (cards) */
.cl-langs { display: flex; flex-wrap: wrap; gap: .3rem; }
.cl-langs span { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 700; color: var(--cl-a); background: #f5f6fb; border: 1px solid var(--line); border-radius: 999px; padding: .12rem .55rem; }

/* ---- Browsing: language chips, level, topic, sort ---- */
.cl-main { padding-top: 2.6rem; }
.cl-count { display: inline-grid; place-items: center; min-width: 2rem; height: 1.6rem; padding: 0 .5rem; margin-left: .4rem; border-radius: 999px; background: var(--g-100); color: var(--g-800); font-size: .85rem; vertical-align: middle; }
.cl-sort .form-select { min-width: 11rem; font-weight: 600; }
.cl-lang-chips { display: flex; gap: .45rem; overflow-x: auto; padding: .2rem .1rem .6rem; scrollbar-width: thin; }
.cl-lang-chips a { flex: none; display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .9rem; border-radius: 999px; background: #fff; border: 1.5px solid var(--line);
  color: var(--ink); font-size: .88rem; font-weight: 700; text-decoration: none; transition: border-color .15s, background .15s, color .15s; }
.cl-lang-chips a:hover { border-color: var(--g-200); color: var(--ink); }
.cl-lang-chips a i { color: var(--cl-a, var(--g-700)); }
.cl-lang-chips a small { font-size: .72rem; font-weight: 800; color: var(--muted); background: var(--bg); border-radius: 999px; padding: .05rem .45rem; }
.cl-lang-chips a.active { background: var(--g-800); border-color: var(--g-800); color: #fff; }
.cl-lang-chips a.active i { color: var(--gold); }
.cl-lang-chips a.active small { background: rgba(255, 255, 255, .18); color: #fff; }
.cl-subfilters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin: .4rem 0 1.2rem; }
.cl-subfilters .form-select { min-width: 12rem; font-weight: 600; }
.cl-diff-filter { display: inline-flex; flex-wrap: wrap; gap: .25rem; padding: .25rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.cl-diff-filter a { padding: .35rem .8rem; border-radius: 9px; font-size: .84rem; font-weight: 700; color: var(--muted); text-decoration: none; }
.cl-diff-filter a:hover { color: var(--g-800); }
.cl-diff-filter a.active { background: var(--g-100); color: var(--g-800); }
@media (max-width: 575.98px) {
  .cl-subfilters > * { width: 100%; }
  .cl-diff-filter { justify-content: space-between; }
  .cl-sort .form-select, .cl-subfilters .form-select { min-width: 0; width: 100%; }
  .cl-browse .cl-section-head { flex-wrap: wrap; }
}

/* ---- Bottom promos ---- */
.cl-bottom { padding-top: 0; }
.cl-promo { display: flex; align-items: center; gap: 1rem; height: 100%; padding: 1.3rem 1.4rem; border-radius: 20px; text-decoration: none !important; color: rgba(255, 255, 255, .88);
  background: var(--g-700); transition: transform .2s, box-shadow .2s; }
.cl-promo:hover { transform: translateY(-3px); box-shadow: 0 20px 40px rgba(7, 7, 63, .25); color: rgba(255, 255, 255, .95); }
.cl-promo.gold { background: linear-gradient(135deg, #fff1d6, #fbe3a1); color: #5b4200; }
.cl-promo.gold:hover { color: #5b4200; }
.cl-promo .ico { width: 52px; height: 52px; flex: none; border-radius: 16px; display: grid; place-items: center; font-size: 1.3rem; background: rgba(255, 255, 255, .14); color: var(--gold); }
.cl-promo.gold .ico { background: #fff; color: var(--gold-600); }
.cl-promo strong { display: block; font-size: 1.08rem; color: #fff; }
.cl-promo.gold strong { color: #3a2a00; }
.cl-promo small { font-size: .88rem; }
.cl-promo > .fa-arrow-right { margin-left: auto; }

/* ---- Snippet page header ---- */
.cl-show-hero { padding-bottom: 3rem; }
.cl-show-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, var(--cl-a), var(--cl-b)); }
.cl-hero-badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .2rem; }
.cl-lang-badge, .cl-hero-chip { display: inline-flex; align-items: center; gap: .45rem; border-radius: 999px; padding: .28rem .85rem; font-size: .8rem; font-weight: 800; }
.cl-lang-badge { background: linear-gradient(135deg, var(--cl-a), var(--cl-b)); color: #fff; }
.cl-hero-chip { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); color: #fff; }
.cl-show-hero .cl-diff { padding: .28rem .85rem; font-size: .8rem; }
.cl-hero-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin-top: 1.1rem; font-size: .9rem; font-weight: 600; color: rgba(255, 255, 255, .88); }
.cl-hero-meta i { color: var(--gold); margin-right: .45rem; }
.cl-draft { display: inline-block; background: #fde6ea; color: #8f2035; border-radius: 12px; padding: .45rem .9rem; font-weight: 700; font-size: .85rem; margin-bottom: 1rem; }
.cl-draft a { color: #8f2035; text-decoration: underline; }

/* ---- Snippet page body ---- */
.cl-body { padding: 2.4rem 0 4rem; background: #fff; }
.cl-block { margin-bottom: 1.6rem; }
.cl-block h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: .8rem; }
.cl-prose { font-size: 1.02rem; line-height: 1.75; color: var(--text); }
.cl-objectives { background: var(--g-50); border: 1px solid var(--g-200); border-radius: 18px; padding: 1.2rem 1.3rem; }
.cl-objectives .objectives { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.cl-objectives .objectives li { display: flex; gap: .6rem; align-items: flex-start; }
.cl-objectives .objectives i { color: var(--g-600); margin-top: .3rem; }

/* The code panel: a gutter of line numbers plus a horizontally scrolling <pre> that never widens the page. */
.cl-code { border-radius: 18px; overflow: hidden; background: #0d1117; border: 1px solid #20234a; box-shadow: 0 20px 50px rgba(7, 7, 63, .18); margin-bottom: 1.6rem; }
.cl-code-bar, .cl-preview-bar { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; padding: .6rem .7rem .6rem 1rem; background: #161b22; border-bottom: 1px solid #262a4d; }
.cl-file { display: inline-flex; align-items: center; gap: .5rem; color: #c9d1d9; font: 600 .85rem ui-monospace, Consolas, monospace; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-file i { color: var(--gold); }
.cl-code-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.cl-btn { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid #30363d; background: #21262d; color: #e6edf3; border-radius: 10px; padding: .38rem .75rem; font-size: .82rem; font-weight: 700; text-decoration: none !important; transition: background .15s, border-color .15s, color .15s; cursor: pointer; }
.cl-btn:hover { background: #30363d; color: #fff; }
.cl-btn:disabled { opacity: .45; cursor: default; }
.cl-btn.primary { background: var(--g-600); border-color: var(--g-600); color: #fff; }
.cl-btn.primary:hover { background: var(--g-700); }
.cl-btn.done { background: var(--g-700); border-color: var(--g-700); }
.cl-btn[aria-pressed="true"] { background: #30363d; border-color: var(--gold); }
.cl-code-scroll { display: flex; max-height: 70vh; overflow: auto; overscroll-behavior: contain; }
.cl-gutter { flex: none; display: flex; flex-direction: column; padding: 1rem .7rem 1rem .9rem; text-align: right; color: #4a4e70; background: #0d1117; border-right: 1px solid #20234a; user-select: none; position: sticky; left: 0; z-index: 1;
  font: .86rem/1.6 ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace; }
.cl-pre { flex: 1; min-width: 0; margin: 0; padding: 1rem 1.2rem; background: transparent; color: #e6edf3; overflow: visible; tab-size: 4;
  font: .86rem/1.6 ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace; }
.cl-pre:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.cl-pre code, .cl-pre code.hljs { display: block; padding: 0; background: transparent; font: inherit; white-space: pre; }
.cl-code.wrapped .cl-pre code { white-space: pre-wrap; overflow-wrap: anywhere; }
.cl-code.wrapped .cl-gutter { display: none; }

/* ---- Live preview ---- */
.cl-preview { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #fff; box-shadow: var(--shadow-sm); margin-bottom: 1.6rem; }
.cl-status { display: inline-flex; align-items: center; gap: .5rem; color: #c9d1d9; font-size: .84rem; font-weight: 700; }
.cl-status .dot { width: 9px; height: 9px; border-radius: 50%; background: #6b7280; }
.cl-status.loading .dot { background: var(--gold); animation: clBlink 1s infinite; }
.cl-status.running .dot { background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .25); }
@keyframes clBlink { 50% { opacity: .3; } }
.cl-demo-note { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem 1rem; background: var(--gold-100); color: #6b4a00; font-size: .86rem; border-bottom: 1px solid #f1dca0; }
.cl-demo-note i { margin-top: .2rem; }
.cl-stage { position: relative; height: 420px; background: repeating-conic-gradient(#f5f6fa 0% 25%, #fff 0% 50%) 50% / 20px 20px; }
.cl-stage iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.cl-stage-idle { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; text-align: center; padding: 1.5rem; color: var(--muted); }
.cl-stage-idle i { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--g-700); color: #fff; font-size: 1.2rem; margin-bottom: .5rem; box-shadow: 0 12px 26px rgba(0, 0, 128, .3); }
.cl-stage-idle strong { color: var(--ink); }
.cl-stage-idle span { font-size: .86rem; max-width: 22rem; }
.cl-stage-idle[hidden] { display: none; }
.cl-preview:fullscreen { border-radius: 0; display: flex; flex-direction: column; }
.cl-preview:fullscreen .cl-stage { flex: 1; height: auto; }
.cl-preview.is-full { position: fixed; inset: 0; z-index: 2000; border-radius: 0; display: flex; flex-direction: column; }
.cl-preview.is-full .cl-stage { flex: 1; height: auto; }
@media (max-width: 575.98px) { .cl-stage { height: 340px; } }

.cl-noprev { display: flex; gap: .9rem; align-items: flex-start; padding: 1rem 1.1rem; border: 1px dashed var(--g-200); border-radius: 16px; background: var(--g-50); margin-bottom: 1.6rem; }
.cl-noprev > i { font-size: 1.3rem; color: var(--g-700); margin-top: .15rem; }
.cl-noprev strong { display: block; color: var(--ink); }
.cl-noprev span { font-size: .9rem; color: var(--muted); }

/* ---- Sidebar ---- */
@media (min-width: 992px) { .cl-side { position: sticky; top: 5.5rem; } }
.cl-side-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 1.15rem 1.2rem; box-shadow: var(--shadow-sm); margin-bottom: 1rem; }
.cl-side-card h2 { font-size: .8rem; font-weight: 800; color: var(--muted); margin-bottom: .8rem; }
.cl-side-card dl { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; margin: 0; font-size: .92rem; }
.cl-side-card dt { color: var(--muted); font-weight: 600; }
.cl-side-card dd { margin: 0; font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.cl-side-card code { color: var(--g-800); background: var(--g-50); padding: .1rem .35rem; border-radius: 6px; }
.cl-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .9rem; }
.cl-tags a { font-size: .78rem; font-weight: 700; background: var(--g-50); border: 1px solid var(--g-200); color: var(--g-800); border-radius: 999px; padding: .15rem .6rem; text-decoration: none; }
.cl-lesson { display: flex; gap: .75rem; align-items: center; padding: .7rem; border-radius: 14px; background: var(--g-50); color: var(--ink); text-decoration: none !important; }
.cl-lesson:hover { background: var(--g-100); color: var(--ink); }
.cl-lesson .ico { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--g-700); color: #fff; }
.cl-lesson strong { display: block; font-size: .92rem; line-height: 1.3; }
.cl-lesson small { color: var(--muted); }

@media (prefers-reduced-motion: reduce) { .cl-card, .cl-promo, .cl-hero-play { transition: none; } .cl-card:hover, .cl-promo:hover { transform: none; } }

/* ---- Project file tabs (snippet page and Playground) ---- */
.cl-tabs { display: flex; gap: .25rem; overflow-x: auto; padding: .45rem .5rem 0; background: #0d1117; border-bottom: 1px solid #262a4d; scrollbar-width: thin; scrollbar-color: #30363d transparent; }
.cl-tab { flex: none; display: inline-flex; align-items: center; gap: .5rem; padding: .55rem .9rem; border: 1px solid transparent; border-bottom: 0; border-radius: 10px 10px 0 0;
  background: transparent; color: #8b949e; font: 600 .84rem ui-monospace, Consolas, monospace; text-decoration: none !important; cursor: pointer; position: relative; transition: color .15s, background .15s; }
.cl-tab:hover { color: #e6edf3; background: #161b22; }
.cl-tab i { color: var(--cl-b); font-size: .95rem; }
.cl-tab.active { color: #fff; background: #161b22; border-color: #262a4d; }
.cl-tab.active::after { content: ""; position: absolute; left: 10px; right: 10px; top: 0; height: 2px; border-radius: 2px; background: var(--cl-b); }
.cl-tab:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.cl-code-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; padding: .55rem .7rem .55rem 1rem; background: #161b22; border-top: 1px solid #262a4d; color: #8b949e; font-size: .82rem; }

/* Sidebar file list */
.cl-filelist { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.cl-filelist a { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border-radius: 11px; color: var(--ink); text-decoration: none; font: 600 .86rem ui-monospace, Consolas, monospace; }
.cl-filelist a:hover { background: var(--g-50); color: var(--ink); }
.cl-filelist i { width: 1.1rem; text-align: center; color: var(--cl-a); }
.cl-filelist span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-filelist small { font-family: var(--font); color: var(--muted); font-weight: 600; }

/* "Edit in Playground" invitation */
.cl-try { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem 1.2rem; padding: 1rem 1.2rem; border-radius: 18px; margin-bottom: 1.6rem;
  background: var(--g-700); color: rgba(255, 255, 255, .88); }
.cl-try strong { display: block; color: #fff; }
.cl-try span { font-size: .9rem; }

/* ---- Playground ---- */
.cl-pg-hero { padding-bottom: 2.2rem; }
.cl-pg-hero h1 { margin-top: .4rem; }
.cl-pg-from { margin-top: .6rem !important; font-size: .92rem !important; }
.cl-pg-from a { color: var(--gold); font-weight: 700; }
.cl-pg { padding: 1.6rem 0 3rem; background: var(--bg); }
.cl-pg-wrap { max-width: 1500px; padding-left: max(16px, 2vw); padding-right: max(16px, 2vw); }
.cl-pg-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: stretch; }
@media (max-width: 991.98px) { .cl-pg-grid { grid-template-columns: 1fr; } }
.cl-pg-editor { display: flex; flex-direction: column; min-width: 0; border-radius: 18px; overflow: hidden; background: #0d1117; border: 1px solid #20234a; box-shadow: 0 20px 50px rgba(7, 7, 63, .18); }
.cl-pg-pane { flex: 1; display: flex; }
.cl-pg-pane[hidden] { display: none; }
.cl-pg-code { flex: 1; width: 100%; min-height: 460px; resize: vertical; border: 0; border-radius: 0; outline: 0; padding: 1rem 1.1rem; margin: 0;
  background: #0d1117; color: #e6edf3; caret-color: var(--gold); font: .9rem/1.6 ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace; tab-size: 2; white-space: pre; overflow: auto; }
.cl-pg-code:focus { box-shadow: inset 0 0 0 2px rgba(255, 165, 0, .35); }
.cl-pg-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; padding: .6rem .7rem; background: #161b22; border-top: 1px solid #262a4d; }
.cl-pg-spacer { flex: 1; }
.cl-pg-auto { display: inline-flex; align-items: center; gap: .4rem; color: #c9d1d9; font-size: .84rem; font-weight: 700; cursor: pointer; margin: 0 .2rem; }
.cl-pg-auto input { accent-color: var(--g-500); }
.cl-pg-output { display: flex; flex-direction: column; margin: 0; min-height: 520px; }
.cl-pg-output .cl-preview-bar { background: #161b22; }
.cl-pg-output .cl-stage { flex: 1; height: auto; min-height: 460px; }
@media (max-width: 991.98px) { .cl-pg-code { min-height: 320px; } .cl-pg-output { min-height: 400px; } .cl-pg-output .cl-stage { min-height: 340px; } }
.cl-pg-note { margin: 1rem 0 0; font-size: .84rem; color: var(--muted); text-align: center; }
.cl-new-list { -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); padding-right: 2rem; }
