/**
 * "Lab" skin — a research-notebook / corkboard aesthetic layered over labs.css.
 * Applies only under #cbl-app.cbl-skin--lab (enqueued when skin="lab", the default).
 *
 * Content panel = a pinned blueprint sheet; cards = sticky notes with push-pins;
 * Lily's line = a comic speech bubble; the thinking indicator = a "live
 * experiment feed" striped bar. Hand-drawn type via Caveat + Kalam.
 *
 * The illustrated Lily herself is an art asset — drop a URL via the
 * [codebaby_labs lily_image="..."] attribute or CB Content → Settings.
 */

/* ── Corkboard band ─────────────────────────────────────────────────────────── */
#cbl-app.cbl-skin--lab {
  background-color: #a9762f;
  background-image:
    /* fine grain */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E"),
    radial-gradient(circle at 22% 24%, rgba(150, 96, 38, .55), transparent 42%),
    radial-gradient(circle at 82% 72%, rgba(86, 52, 18, .5), transparent 46%),
    radial-gradient(circle at 55% 48%, rgba(214, 164, 96, .4), transparent 52%);
  background-size: 160px 160px, cover, cover, cover;
  padding: 36px 0 52px;
  box-shadow: inset 0 0 140px rgba(54, 32, 8, .45);
}
/* Drop a real cork texture in via CB Content → Settings to replace the CSS one. */
#cbl-app.cbl-skin--lab.cbl-has-cork {
  background-image: var(--cbl-cork-img);
  background-size: 520px auto;
  background-color: #a9762f;
}

/* ── Left: a pinned blueprint sheet holding the notes ───────────────────────── */
.cbl-skin--lab .cbl-content {
  position: relative;
  background-color: #29528c;
  /* major grid (96px) over a fainter minor grid (24px) = classic blueprint */
  background-image:
    linear-gradient(rgba(255, 255, 255, .10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .10) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
  border-radius: 5px;
  padding: 30px 24px 28px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .34), inset 0 0 0 1px rgba(255, 255, 255, .08);
  color: #eef3ff;
}
/* corner pins, so the sheet reads as pinned to the board */
.cbl-skin--lab .cbl-content::before,
.cbl-skin--lab .cbl-content::after {
  content: "";
  position: absolute;
  top: 11px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe08a, #c8920f 70%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .45);
}
.cbl-skin--lab .cbl-content::before { left: 12px; }
.cbl-skin--lab .cbl-content::after { right: 12px; }

/* Drop a real blueprint-paper image in via CB Content → Settings (replaces the
   CSS grid; corner pins stay on top). */
.cbl-skin--lab.cbl-has-blueprint .cbl-content {
  background-image: var(--cbl-blueprint-img);
  background-size: cover;
  background-position: center;
}

.cbl-skin--lab #cbl-profile-chips { color: #dfe7ff; }
.cbl-skin--lab .cbl-chips-label { font-family: "Caveat", cursive; font-size: 21px; color: #fff; }

.cbl-skin--lab #cbl-default h2 {
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: 40px;
  color: #fff;
}
.cbl-skin--lab #cbl-default p { color: #dbe4ff; }

/* Chips → bits of label tape / sticky tabs */
.cbl-skin--lab .cbl-chip {
  background: #fff7cc;
  color: #3a2f12;
  border: 1px solid #e3d27a;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .15);
  font-family: "Kalam", cursive;
}
.cbl-skin--lab .cbl-chip--profile { border-color: #d8b94a; }
.cbl-skin--lab .cbl-chip--action:hover { background: #fff0a8; transform: translateY(-1px) rotate(-1deg); }

/* ── Cards → sticky notes pinned to the board ───────────────────────────────── */
.cbl-skin--lab #cbl-cards { gap: 24px; padding-top: 8px; }
.cbl-skin--lab .cbl-card {
  display: block;
  position: relative;
  background: #fdf28a;
  color: #2a2410;
  border: 0;
  border-radius: 2px;
  box-shadow: 3px 7px 16px rgba(0, 0, 0, .32);
  transform: rotate(-1.4deg);
}
.cbl-skin--lab .cbl-card:nth-child(even) { background: #fffefb; transform: rotate(1.3deg); }
.cbl-skin--lab .cbl-card:hover { transform: rotate(0) scale(1.01); }

/* push-pin */
.cbl-skin--lab .cbl-card::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff8a8a, #c62828 70%);
  box-shadow: 0 2px 3px rgba(0, 0, 0, .4);
  z-index: 2;
}

.cbl-skin--lab .cbl-card-img { display: none; }
.cbl-skin--lab .cbl-card-body { padding: 18px 20px 20px; }
.cbl-skin--lab .cbl-card-reason {
  font-family: "Kalam", cursive;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  color: #b25b00;
}
.cbl-skin--lab .cbl-card-body h3 {
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: 27px;
  line-height: 1.05;
  color: #1c1606;
  margin-bottom: 2px;
}
.cbl-skin--lab .cbl-card-body > p { color: #4a4228; font-size: 14px; }
.cbl-skin--lab .cbl-card-stat { color: #1c1606; }
.cbl-skin--lab .cbl-card-cta {
  background: #2b59b3;
  color: #fff;
  border-radius: 4px;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .25);
  font-family: "Kalam", cursive;
  font-weight: 700;
}
.cbl-skin--lab .cbl-card-cta--ghost {
  background: transparent;
  color: #2b59b3;
  border: 1px dashed #2b59b3;
  box-shadow: none;
}

/* ── Right: Lily at her lab bench ───────────────────────────────────────────── */
.cbl-skin--lab .cbl-avatar-host {
  background: #efe7d6;
  color: #2a2410;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .26);
}
.cbl-skin--lab #avatarContainer {
  background: linear-gradient(180deg, #e3eef8 0%, #cfe0f0 100%);
}
.cbl-skin--lab #avatarContainer::after { color: #6b7790; }
.cbl-skin--lab .cbl-lily { object-position: bottom right; }
.cbl-skin--lab .cbl-avatar-bar { background: #efe7d6; border-top: 0; }

/* Lily's line → a comic speech bubble pointing up at her */
.cbl-skin--lab #cbl-lastline {
  position: relative;
  background: #fff;
  color: #23304a;
  font-family: "Caveat", cursive;
  font-size: 22px;
  line-height: 1.2;
  border: 2px solid #2b59b3;
  border-radius: 14px;
  padding: 12px 14px;
  margin: 14px 0;
}
.cbl-skin--lab #cbl-lastline::after {
  content: "";
  position: absolute;
  top: -12px;
  left: 26px;
  border: 6px solid transparent;
  border-bottom-color: #2b59b3;
}
.cbl-skin--lab #cbl-lastline::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 28px;
  border: 5px solid transparent;
  border-bottom-color: #fff;
  z-index: 1;
}

/* "Live experiment feed" striped progress bar (the thinking indicator) */
.cbl-skin--lab #cbl-thinking.is-on {
  height: 14px;
  border-radius: 6px;
  color: transparent;
  background-image: repeating-linear-gradient(45deg, #2b59b3 0 9px, #6c8cff 9px 18px);
  animation: cbl-feed .9s linear infinite;
}
.cbl-skin--lab #cbl-thinking.is-on::before { content: none; }
@keyframes cbl-feed {
  from { background-position: 0 0; }
  to { background-position: 36px 0; }
}

/* Controls — keep readable on the cream bench */
.cbl-skin--lab #cbl-input { background: #fff; color: #23304a; border: 1px solid #b9c4d8; }
.cbl-skin--lab .cbl-btn { background: #fff; color: #23304a; border: 1px solid #b9c4d8; }
.cbl-skin--lab .cbl-btn--primary { background: #2b59b3; color: #fff; border-color: #2b59b3; }
.cbl-skin--lab .cbl-link { color: #6b5b2e; }

/* ── Mobile: straighten the notes so they don't clip when stacked ───────────── */
@media (max-width: 820px) {
  .cbl-skin--lab .cbl-content { padding: 16px; }
  .cbl-skin--lab .cbl-card,
  .cbl-skin--lab .cbl-card:nth-child(even) { transform: none; }
}
