/* lab.css — chrome for the prototyping surface only.
 *
 * Every rule is scoped to .is-lab, which lab.js sets only on lab-maestro, so
 * this file is inert on the three published surfaces.
 *
 * Styled to Studio Artifice's system, not Maestro's: this is the studio's tool
 * sitting beside the client's product, and the two should not be mistaken for
 * each other. Tokens are declared locally rather than imported, because the
 * page's own :root belongs to Maestro and must not be overwritten.
 */

.is-lab {
  --sa-bg:      #fafafa;
  --sa-surface: #ffffff;
  --sa-ink:     #111111;
  --sa-ink-2:   #444444;
  --sa-ink-3:   #888888;
  --sa-rule:    #e4e4e4;
  --sa-accent:  #d4ad6a;                   /* brass — sparingly, see below */
  --sa-body:    "Archivo", -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
  --sa-mono:    ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --lab-rail: 300px;
  --lab-gutter: 20px;
}

/* The indicator. Brass is the one accent and it is spent here, on the single
   thing that has to be unmistakable: which surface you are reading. */
.is-lab .lab-flag {
  position: fixed; top: 16px; left: 16px; z-index: 60;
  padding: 5px 10px;
  background: var(--sa-ink); color: var(--sa-bg);
  font-family: var(--sa-mono);
  font-size: 13px; font-weight: 400; letter-spacing: .12em; text-transform: uppercase;
}

.is-lab .lab-rail {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 55;
  width: var(--lab-rail); overflow-y: auto;
  padding: 24px 20px 40px;
  background: var(--sa-bg);
  border-left: 1px solid var(--sa-rule);
  font-family: var(--sa-body);
  display: grid; gap: 40px; align-content: start;
}
.is-lab body { padding-right: var(--lab-rail); }

/* Section label: mono, uppercase, .12em, --ink-3. The system's one label
   treatment, used for all three groups. */
.is-lab .lab-group { display: grid; gap: 0; }
.is-lab .lab-group h2 {
  margin: 0 0 12px;
  font-family: var(--sa-mono);
  font-size: 13px; font-weight: 500; letter-spacing: .12em;
  text-transform: uppercase; color: var(--sa-ink-3);
}

/* Controls. The stage's switch, restated in the studio's palette. */
.is-lab .lab-rail .proto-switch {
  display: grid; gap: 6px; justify-items: start;
  margin: 0; padding: 14px 0; background: none; border-radius: 0;
  border-bottom: 1px solid var(--sa-rule);
}
.is-lab .lab-rail .proto-switch:last-child { border-bottom: 0; }
.is-lab .lab-rail .proto-switch-label {
  font-family: var(--sa-mono); font-size: 13px; font-weight: 400;
  letter-spacing: .02em; text-transform: none; color: var(--sa-ink-3);
}
.is-lab .lab-rail .proto-switch-set { width: 100%; background: none; padding: 0; gap: 0; }
.is-lab .lab-rail .proto-switch-set button {
  flex: 1; white-space: nowrap; border-radius: 0;
  border: 1px solid var(--sa-rule); background: var(--sa-surface);
  font-family: var(--sa-body); font-size: 13px; font-weight: 400;
  color: var(--sa-ink-2); box-shadow: none; padding: 7px 10px;
}
.is-lab .lab-rail .proto-switch-set button + button { border-left: 0; }
.is-lab .lab-rail .proto-switch-set button.is-active {
  background: var(--sa-ink); border-color: var(--sa-ink); color: var(--sa-bg);
  box-shadow: none;
}

/* Screens. A list separated by hairlines, not chips. */
.is-lab .lab-seq { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.is-lab .lab-seq li { counter-increment: step; border-bottom: 1px solid var(--sa-rule); }
.is-lab .lab-seq li:last-child { border-bottom: 0; }
.is-lab .lab-seq button {
  width: 100%; display: flex; align-items: baseline; gap: 10px;
  padding: 12px 0; border: 0; border-radius: 0; background: none; cursor: pointer;
  text-align: left; font-family: var(--sa-body); font-size: 15px; color: var(--sa-ink-2);
}
.is-lab .lab-seq button::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--sa-mono); font-size: 13px; color: var(--sa-ink-3);
}
.is-lab .lab-seq button.is-active { color: var(--sa-ink); }
.is-lab .lab-seq button.is-active::before { color: var(--sa-accent); }

/* Version history. Hairlines separate; nothing is a card. */
.is-lab .lab-revs { list-style: none; margin: 0; padding: 0; }
/* min-width: 0 or the 1fr column refuses to shrink below its content — grid
   items default to min-width: auto, which is how a long commit subject pushes
   itself past the rail instead of wrapping inside it. */
.is-lab .lab-revs li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; }
.is-lab .lab-revs li > * { min-width: 0; }
/* And again one level down: .lab-rev is itself a grid, so its rows default to
   min-width: auto too. A three-surface module list pushed the whole entry 102px
   past the rail and took the time and the subject with it. */
.is-lab .lab-rev > * { min-width: 0; }
.is-lab .lab-rev-subject { overflow-wrap: anywhere; }
.is-lab .lab-rev-graph { position: relative; }
.is-lab .lab-rev-graph svg { display: block; width: 100%; height: 100%; }
.is-lab .lab-lane, .is-lab .lab-join {
  fill: none; stroke: var(--sa-rule); stroke-width: 1; vector-effect: non-scaling-stroke;
}
.is-lab .lab-dot {
  position: absolute; top: 20px; width: 5px; height: 5px;
  margin-left: -2.5px; border-radius: 50%;
  background: var(--sa-ink-3); box-shadow: 0 0 0 3px var(--sa-bg);
}
.is-lab .lab-dot.is-merge {
  background: var(--sa-bg);
  box-shadow: 0 0 0 1px var(--sa-ink), 0 0 0 4px var(--sa-bg);
}
.is-lab .is-here .lab-dot { background: var(--sa-accent); box-shadow: 0 0 0 3px var(--sa-bg); }

.is-lab .lab-day { align-items: center; min-height: 34px; }
.is-lab .lab-day span {
  font-family: var(--sa-mono); font-size: 13px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--sa-ink-3);
}

.is-lab .lab-rev {
  display: grid; gap: 4px; padding: 14px 0;
  border-bottom: 1px solid var(--sa-rule);
  text-decoration: none; color: inherit;
}
.is-lab .lab-rev-head {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--sa-mono); font-size: 13px; letter-spacing: .02em;
  color: var(--sa-ink-3);
}
.is-lab .lab-who { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.is-lab .lab-avatar {
  flex: none; width: 17px; height: 17px; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--sa-surface); border: 1px solid var(--sa-rule); color: var(--sa-ink-2);
  font-family: var(--sa-body); font-size: 9px; font-weight: 500; letter-spacing: 0;
}
.is-lab .lab-who-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-lab .lab-rev-subject {
  font-family: var(--sa-body); font-size: 15px; font-weight: 400; line-height: 1.45;
  color: var(--sa-ink);
}
.is-lab div.lab-rev .lab-rev-subject { color: var(--sa-ink-2); }
.is-lab .lab-rev-foot { display: flex; align-items: baseline; gap: 10px;
  font-family: var(--sa-mono); font-size: 13px; color: var(--sa-ink-3); }
.is-lab .lab-rev-tag { flex: none; font-weight: 500; color: var(--sa-ink-2); }
.is-lab .lab-rev-mod { flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Shipped is stated; lab-only is the one still wanting a decision, so it is the
   only thing besides the current marker that spends the accent. */
.is-lab .lab-ship { flex: none; font-family: var(--sa-mono); font-size: 13px; }
.is-lab .lab-ship.is-prod { color: var(--sa-ink-2); }
.is-lab .lab-ship.is-lab { color: var(--sa-accent); }
.is-lab .lab-rev-here {
  font-family: var(--sa-body); font-size: 13px; font-style: normal;
  font-weight: 500; color: var(--sa-accent);
}

.is-lab .lab-gap { align-items: center; min-height: 20px; }
.is-lab .lab-gap .lab-rev-graph { align-self: stretch; }
.is-lab .lab-gap-time {
  font-family: var(--sa-mono); font-size: 13px; color: var(--sa-ink-3);
}
.is-lab .lab-empty {
  margin: 0; font-family: var(--sa-body); font-size: 15px; color: var(--sa-ink-3);
}

.is-lab .lab-mark {
  position: fixed; z-index: 56;
  right: calc(var(--lab-rail) + var(--lab-gutter)); bottom: var(--lab-gutter);
  display: block; line-height: 0; opacity: .4;
}
.is-lab .lab-mark img { display: block; width: 120px; height: auto; }

@media (max-width: 900px) {
  .is-lab .lab-rail { position: static; width: auto; height: auto;
    border-left: 0; border-top: 1px solid var(--sa-rule); }
  .is-lab body { padding-right: 0; }
  .is-lab .lab-mark { right: var(--lab-gutter); }
}
