/* How it works: BuffApe's workbench as its design draws it (design/workbench), in the dark. The top
   bar (the project and its branch, You're on: Guide, your phone, Send to Cloud); the rail with the
   loop's eight steps until the first build, then the product's places, and this computer's under
   them, with the agents' line at its foot; the page; the agent's chat on the right, with the box to
   ask in. how-parts.css holds the page's parts and the timing; how-plan.css, how-shape.css,
   how-build.css and how-ship.css lay out the steps. Also the window bar Reach's console uses in step
   4 (how-console.css). Only tokens. */

.cw {
  overflow: hidden;
  border-radius: var(--radius-window);
  border: var(--border) solid var(--line-strong);
  background: var(--bg-canvas);
  box-shadow: var(--shadow-window);
  color: var(--text);
  font-size: 14px;
  line-height: var(--leading-ui);
  text-align: start;
}
.cw svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.cw-app {
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr) 288px;
  grid-template-rows: 52px minmax(0, 1fr);
  grid-template-areas:
    "top top top"
    "rail main chat";
  height: 724px;
}

/* The top bar */
.cw-top {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  padding: 0 var(--space-3) 0 var(--space-4);
  border-bottom: var(--border) solid var(--line);
  white-space: nowrap;
}
.cw-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-inline-end: var(--space-1);
  font-weight: var(--weight-semibold);
  color: var(--text-strong);
}
.cw-brand img {
  flex: none;
  border-radius: 6px;
}
.cw-proj {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 var(--space-3);
  border-inline-start: var(--border) solid var(--line);
  font-weight: var(--weight-medium);
  color: var(--text-strong);
}
.cw-where {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-control);
  background: var(--surface-2);
  color: var(--text-muted);
}
.cw-where .mono {
  color: var(--text);
}
.cw-proj svg,
.cw-where svg,
.cw-mode svg {
  width: 14px;
  height: 14px;
}
.cw-live {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-inline-start: auto;
  padding: 2px var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--ok-tint);
  color: var(--ok);
  font-size: 13px;
  font-weight: var(--weight-semibold);
}
.cw-live i,
.lk .lv-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent);
}
.cw-mode,
.cw-tb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-control);
  font-size: 13px;
  font-weight: var(--weight-medium);
  color: var(--text-strong);
}
.cw-mode,
.cw-tb.out {
  border: var(--border) solid var(--line-strong);
}
.cw-mode {
  margin-inline-start: var(--space-2);
  font-weight: var(--weight-regular);
  color: var(--text-muted);
}
.cw-mode b {
  font-weight: var(--weight-semibold);
  color: var(--text-strong);
}
.cw-tb svg {
  width: 16px;
  height: 16px;
}
.cw-ib {
  display: grid;
  place-items: center;
  width: 32px;
  height: 34px;
  color: var(--text-muted);
}

/* The rail: the loop's steps, then the product's places; where you are is lit */
.cw-rail {
  grid-area: rail;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  padding: var(--space-2);
  overflow: hidden;
  border-inline-end: var(--border) solid var(--line);
}
.lps-h {
  display: block;
  padding: var(--space-3) var(--space-3) var(--space-1);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-muted);
}
.lps {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.places,
.hw[data-step="3"] .loop {
  display: none;
}
.hw[data-step="3"] .lps.places {
  display: grid;
}
.hw[data-step="3"] .lps-h.places {
  display: block;
}
.lp {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  padding: 5px var(--space-3);
  border-radius: var(--radius-control);
  transition: background var(--duration-base) var(--ease-out);
}
.pip {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: var(--border) solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 12px;
  font-style: normal;
  color: var(--text-muted);
}
.pip em {
  font-style: normal;
}
.cw .pip svg {
  display: none;
  width: 14px;
  height: 14px;
}
.lp-t {
  display: grid;
  min-width: 0;
}
.lp-t b {
  font-weight: var(--weight-medium);
  color: var(--text-muted);
}
.lp-t small {
  overflow: hidden;
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text-subtle);
}
.cw .lp .seal {
  width: 14px;
  height: 14px;
  color: var(--text-subtle);
}
/* Done: a check in its pip, and an approval's seal lit. Step 2 starts with step 1's two done. */
.lp.on:has(~ .lp.on) .pip,
.hw[data-step="2"] .loop .lp:nth-child(-n + 2) .pip {
  border-color: transparent;
  background: var(--surface-3);
  color: var(--text-strong);
}
.lp.on:has(~ .lp.on) .pip em,
.hw[data-step="2"] .loop .lp:nth-child(-n + 2) .pip em {
  display: none;
}
.cw .lp.on:has(~ .lp.on) .pip svg,
.hw[data-step="2"] .loop .lp:nth-child(-n + 2) .pip svg {
  display: block;
}
.lp.on .lp-t b,
.hw[data-step="2"] .loop .lp:nth-child(-n + 2) .lp-t b {
  color: var(--text-strong);
}
.cw .lp.on:has(~ .lp.on) .seal {
  color: var(--accent-text);
}
/* Where you are: the last step this one has reached */
.lp.on:not(:has(~ .lp.on)) {
  background: var(--surface-3);
}
.lp.on:not(:has(~ .lp.on)) .pip {
  border-color: transparent;
  background: var(--accent);
  color: var(--text-on-accent);
  font-weight: var(--weight-semibold);
}
/* A place: its icon, its name, and what it holds (what waits on you, a version, Live's dot) */
.lk {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 34px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-control);
  transition: background var(--duration-base) var(--ease-out);
}
.cw .lk svg {
  width: 17px;
  height: 17px;
  color: var(--text-muted);
}
.lk b {
  min-width: 0;
  overflow: hidden;
  font-weight: var(--weight-regular);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.lk .cnt,
.lk .ver,
.cw .lk .seal {
  margin-inline-start: auto;
}
.lk .cnt {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--text-on-accent);
  font-size: 12px;
  font-style: normal;
  font-weight: var(--weight-semibold);
}
.lk .ver > * {
  justify-self: end;
}
.lk .ver {
  font-family: var(--font-mono);
  font-size: 12px;
  font-style: normal;
  color: var(--text-muted);
}
.cw .lk .seal {
  width: 14px;
  height: 14px;
}
.lk.on:not(:has(~ .lk.on)),
.hw:not(.js) .lk[data-at="25000"] {
  background: var(--surface-3);
  color: var(--text-strong);
}
.cw .lk.on:not(:has(~ .lk.on)) svg {
  color: var(--text-strong);
}
/* Which agents do what, pinned at the rail's foot */
.cw-agent {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: var(--space-3);
  margin-top: auto;
  padding: var(--space-3);
  border-radius: var(--radius-card);
  border: var(--border) solid var(--line);
  background: var(--bg-canvas);
  font-size: 12px;
  color: var(--text-muted);
}
.cw-agent i {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--ok);
}
.cw-agent b {
  font-weight: var(--weight-medium);
  color: var(--text-strong);
}

/* Reach's console window in step 4: its bar, three dots and the address */
.cw-bar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: 36px;
  padding: 0 var(--space-4);
  border-bottom: var(--border) solid var(--line);
  background: var(--bg-raised);
}
.cw-dots {
  display: flex;
  gap: 6px;
}
.cw-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
}
.cw-url {
  flex: 1;
  max-width: 320px;
  margin-inline: auto;
  padding: 2px var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* Narrower: the rail keeps its pips and icons, the top bar its icons */
@container (max-width: 960px) {
  .cw-app {
    grid-template-columns: 60px minmax(0, 1fr) 248px;
  }
  .cw-rail {
    padding-inline: 6px;
  }
  .lps-h,
  .lp-t,
  .cw .lp .seal,
  .lk b,
  .lk em,
  .cw .lk .seal,
  .cw-agent > span,
  .cw-tb span,
  .cw-ib,
  .cw-where {
    display: none;
  }
  .lp {
    grid-template-columns: 26px;
    justify-content: center;
    padding-inline: 0;
  }
  .lk {
    justify-content: center;
    padding: 0;
  }
  .cw-agent {
    justify-content: center;
    padding: var(--space-2);
  }
  .cw-agent i {
    margin: 0;
  }
}
/* On a phone: no rail; the chat sits under the page */
@container (max-width: 680px) {
  .cw-app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 48px minmax(0, 1fr) 236px;
    grid-template-areas:
      "top"
      "main"
      "chat";
    height: 780px;
  }
  .cw-rail,
  .cw-tb,
  .cw-brand span,
  .cw-proj svg,
  .cw-mode svg {
    display: none;
  }
  .cw-top {
    padding-inline: var(--space-3);
  }
  .cw-mode {
    height: 30px;
    margin-inline-start: auto;
    padding-inline: var(--space-2);
  }
  .cw-live + .cw-mode {
    margin-inline-start: 0;
  }
}
