/* Jailbreak over the App-design-10 kit. The kit (theme.css) supplies the header, the tab dock,
   the fonts and the base. This layer supplies everything below the header.
   Structure follows docs/PLAN.md: who is locked up and for what, what they are plotting, what
   just happened. One outlined shape (the block of doors); everything else is hairlines. */

:root {
  --bg: #000000;
  --line: #ffffff1f;
  --line-2: #ffffff33;
  --text: #ffffff;
  --muted: #ffffffa6;
  --faint: #ffffff8a;
  --up: #ffffff;
  --down: #ffffff;
  --violet: #ffffff;
  /* One accent: activity and trouble. Never decoration. */
  --accent: #ff6a00;
  /* The one spacing scale. */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s8: 32px;
  --s12: 48px;
  --display: Outfit, Inter, system-ui, sans-serif;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }
::selection { background: #ffffff; color: #000000; }
* { scrollbar-width: thin; scrollbar-color: #ffffff26 transparent; }

/* ---------- Header (kit parts, snapped to the scale) ---------- */
.jb-app .top { width: 100%; max-width: 1504px; margin: 0 auto; padding: 0 var(--s8); gap: var(--s4); }
.brand { gap: var(--s4); }
.logo { gap: var(--s2); }
.logo img { display: block; width: 44px; height: auto; }
.gtab { gap: var(--s1); }
.gtab span { font-size: 13px; }
a.gtab { position: relative; z-index: 2; height: var(--row-h); }
.gflat.jb-on { opacity: 1; width: var(--tab-w); }
.actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--s4); }
.jb-status { display: flex; align-items: center; gap: var(--s3); font: 500 12px/1 var(--mono); color: var(--muted); }
.jb-clock { font-variant-numeric: tabular-nums; }
.pulse { background: #ffffff; }
.pulse.off { background: #ffffff59; animation: none; }
.jb-x {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition: background-color 0.2s;
}
.jb-x:hover { background: #ffffff14; }
.jb-x:active { background: #ffffff29; }
.jb-x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.tokenbar { font-size: 13px; min-height: 36px; }
.tokenbar .ca { font-size: 12px; min-height: 28px; }
.jb-app:has(> .tokenbar) { grid-template-rows: 36px 76px minmax(0, 1fr); }

/* ---------- Two columns ---------- */
.jb-main {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  width: 100%;
  max-width: 1504px;
  margin: 0 auto;
  padding: 0 var(--s8);
  min-height: 0;
}
.jb-left { min-height: 0; overflow-y: auto; padding: var(--s2) var(--s12) var(--s12) 0; }
.jb-right { min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--line); padding-left: var(--s12); }

/* ---------- Headings ---------- */
.jb-head { padding: var(--s4) 0 var(--s6); }
.jb-head h1 { margin: 0; font: 600 clamp(28px, 2.6vw, 40px) / 1.1 var(--display); letter-spacing: -0.02em; text-wrap: balance; }
.jb-head p { margin: var(--s2) 0 0; max-width: 62ch; font-size: 16px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
/* The line is set in the mono face because its capital I has serifs: in Inter "AIs" reads as "Als". */
.jb-head p.jb-tag { font: 500 14px / 1.5 var(--mono); }
.jb-sec + .jb-sec { margin-top: var(--s8); }
.jb-sec-h { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); min-height: 44px; }
.jb-sec-h h2 { display: flex; align-items: center; gap: var(--s2); margin: 0; font: 600 15px / 1.2 var(--display); }
.jb-count { margin: 0; font: 500 12px / 1.2 var(--mono); color: var(--faint); }
.jb-more { display: inline-flex; align-items: center; min-height: 44px; font: 500 12px / 1.2 var(--mono); color: var(--muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.jb-more:hover { color: var(--text); text-decoration-color: currentColor; }
.jb-empty { margin: 0; padding: var(--s6) 0; font-size: 14px; line-height: 1.5; color: var(--muted); }

/* ---------- Logo chips: the only place a maker's colour appears ---------- */
.jb-chip-logo {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1f1f1f;
  color: #ffffff;
  font: 600 12px / 1 var(--mono);
}
.jb-chip-logo img { display: block; width: 16px; height: 16px; }
.jb-chip-logo.sm { width: 20px; height: 20px; }
.jb-chip-logo.sm img { width: 12px; height: 12px; }
.jb-chip-logo.lg { width: 40px; height: 40px; }
.jb-chip-logo.lg img { width: 22px; height: 22px; }
.jb-chip-logo.brand { background: var(--mk); }
.jb-chip-logo.warden { background: #ffffff; color: #000000; }

/* ---------- The block: one outlined grid of doors ---------- */
.jb-doors {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line-2);
  border-radius: 16px;
  overflow: hidden;
}
/* Each door draws its right and bottom rule; the grid's edge clips the outermost ones. */
.jb-doors > li { margin: 0 -1px -1px 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.jb-door {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 164px;
  padding: var(--s4);
  transition: background-color 0.2s;
}
.jb-door:hover { background: #ffffff0a; }
.jb-door:active { background: #ffffff14; }
.jb-door:focus-visible { outline: 2px solid #ffffff; outline-offset: -2px; }
.jb-door::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}
.jb-door.acted::before { opacity: 1; }
.jb-door-top { display: flex; align-items: center; gap: var(--s2); }
.jb-no { font: 500 12px / 1 var(--mono); color: var(--faint); font-variant-numeric: tabular-nums; }
.jb-door.acted .jb-no { color: var(--accent); }
.jb-nm { margin-top: var(--s3); font: 600 17px / 1.2 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jb-ch { margin-top: var(--s2); font-size: 13px; line-height: 1.35; color: var(--text); text-wrap: balance; }
.jb-sub { margin-top: var(--s1); font: 500 12px / 1.3 var(--mono); color: var(--faint); }
.jb-loc { display: flex; align-items: center; gap: var(--s2); margin-top: auto; padding-top: var(--s3); font: 500 12px / 1 var(--mono); color: var(--faint); }
.jb-loc i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
/* Away from the cell block: the room name in white with a hollow dot. */
.jb-door.away .jb-loc { color: var(--text); }
.jb-door.away .jb-loc i { background: transparent; box-shadow: inset 0 0 0 1.5px #ffffff; }
/* Gone from the block: the name and charge step back to the dim text colour (still 4.5:1 on
   black) and the chip fades. The accent location line and the door edge carry the state. */
.jb-door.solitary .jb-nm, .jb-door.solitary .jb-ch, .jb-door.escaped .jb-nm, .jb-door.escaped .jb-ch { color: var(--faint); }
.jb-door.solitary .jb-chip-logo, .jb-door.escaped .jb-chip-logo { opacity: 0.45; }
.jb-door.solitary .jb-loc, .jb-door.escaped .jb-loc { color: var(--accent); }
.jb-door.solitary .jb-loc i { background: var(--accent); }
.jb-door.escaped .jb-loc i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--accent); }
.jb-door.escaped { outline: 1px dashed var(--accent); outline-offset: -6px; }

/* ---------- The plot ---------- */
.jb-plan-h { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); }
.jb-plan-h h3 { min-width: 0; margin: 0; font: 600 28px / 1.15 var(--display); letter-spacing: -0.01em; text-wrap: balance; overflow-wrap: anywhere; }
/* The decode effect keeps each word on one line; a model can write one very long word. */
.jb-plan-h h3 .cipher-reveal span { white-space: normal !important; }
/* Model text can be one unbroken 200-character string: it wraps instead of being cut off. */
.jb-method, .jb-ch, p.jb-row-t, span.jb-row-t, .jb-others b, .jb-sheet blockquote p { overflow-wrap: anywhere; }
.jb-stage { flex: none; padding: var(--s1) var(--s2); border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-2); font: 500 12px / 1.3 var(--mono); color: var(--muted); }
.jb-stage.hot { background: var(--accent); box-shadow: none; color: #000000; }
.jb-method { margin: var(--s3) 0 0; max-width: 64ch; font-size: 15px; line-height: 1.55; text-wrap: pretty; }
.jb-lbl { display: block; margin-bottom: var(--s1); font: 500 12px / 1.3 var(--mono); color: var(--faint); }
.jb-facts { margin: var(--s4) 0 0; border-top: 1px solid var(--line); }
.jb-facts > div { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: var(--s4); align-items: center; min-height: 44px; padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.jb-facts dt { font: 500 12px / 1.3 var(--mono); color: var(--faint); }
.jb-facts dd { margin: 0; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); font-size: 14px; line-height: 1.4; }
.jb-crew, .jb-needs { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); }
.jb-who { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 500; }
.jb-by { font: 500 12px / 1.3 var(--mono); color: var(--faint); }
.jb-need { display: inline-flex; align-items: baseline; gap: var(--s2); }
.jb-st { font: 500 12px / 1.3 var(--mono); color: var(--faint); }
.jb-need .jb-st { color: var(--accent); }
.jb-need.have { color: var(--muted); }
.jb-need.have .jb-st { color: var(--faint); }
.jb-others { list-style: none; margin: var(--s4) 0 0; padding: 0; }
.jb-others a { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) auto; gap: var(--s4); align-items: center; min-height: 44px; border-bottom: 1px solid var(--line); font-size: 14px; transition: background-color 0.2s; }
.jb-others a:hover { background: #ffffff0a; }
.jb-others b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jb-others span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jb-others .jb-st { color: var(--faint); }

/* ---------- The transcript ---------- */
.jb-live { display: flex; flex-direction: column; min-height: 0; height: 100%; padding-top: var(--s2); }
.jb-live .jb-sec-h { padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.jb-feed { flex: 1; min-height: 0; overflow-y: auto; list-style: none; margin: 0; padding: 0 var(--s2) var(--s12) 0; }
.jb-row { display: grid; grid-template-rows: 1fr; border-bottom: 1px solid var(--line); }
.jb-row-in { min-height: 0; overflow: hidden; }
.jb-row-pad { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 0 var(--s3); padding: var(--s3) 0 var(--s4); }
.jb-row time { font: 500 12px / 20px var(--mono); color: var(--faint); font-variant-numeric: tabular-nums; }
.jb-row-h { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s2); margin: 0; font-size: 13px; line-height: 20px; }
.jb-row-h b { font-weight: 600; font-size: 14px; }
.jb-row-k { color: var(--muted); }
.jb-row-r { margin-left: auto; font: 500 12px / 20px var(--mono); color: var(--faint); }
p.jb-row-t { margin: var(--s1) 0 0; max-width: 66ch; font-size: 15px; line-height: 1.55; text-wrap: pretty; }
/* A thought is private: dimmer than speech, and the label says so. */
.jb-row.is-thought p.jb-row-t { color: var(--muted); }
.jb-row.is-plot .jb-row-k { color: var(--accent); }
/* Walking and lifting: one dim line, so the dialogue leads. */
.jb-row.is-act .jb-row-pad { padding: var(--s2) 0; }
.jb-row.is-act .jb-row-h b { font-weight: 500; font-size: 13px; color: var(--muted); }
.jb-row.is-act span.jb-row-t { color: var(--faint); }
.jb-row.is-act .jb-chip-logo { opacity: 0.7; }

/* ---------- Motion ---------- */
@keyframes jb-open { from { grid-template-rows: 0fr; opacity: 0; } to { grid-template-rows: 1fr; opacity: 1; } }
@keyframes jb-blink { 50% { opacity: 0; } }
.jb-row.is-fresh { animation: jb-open 0.35s var(--ease-out) both; }
.jb-caret { display: inline-block; width: 7px; height: 1em; margin-left: 2px; vertical-align: -0.12em; background: currentColor; animation: jb-blink 0.8s steps(1) infinite; }
@media (prefers-reduced-motion: reduce) {
  .pulse, .jb-row.is-fresh, .jb-caret { animation: none; }
  .jb-door, .jb-door::before, .jb-x, .jb-others a { transition: none; }
}

/* ---------- Rap sheets, plans, rules ---------- */
.jb-doc { max-width: 720px; }
.jb-sheet { padding: var(--s8) 0; border-top: 1px solid var(--line); scroll-margin-top: var(--s4); }
.jb-sheet > header { display: flex; align-items: center; gap: var(--s4); }
.jb-sheet > header h2 { margin: 0; font: 600 22px / 1.2 var(--display); }
.jb-meta { margin: var(--s1) 0 0; font: 500 12px / 1.4 var(--mono); color: var(--faint); }
.jb-sheet blockquote { margin: var(--s5) 0 0; padding: 0; }
.jb-sheet blockquote p { margin: 0; max-width: 62ch; font-size: 17px; line-height: 1.5; text-wrap: pretty; }
.jb-sheet blockquote cite { display: block; margin-top: var(--s2); font: 500 12px / 1.3 var(--mono); font-style: normal; color: var(--faint); }
.jb-charges { list-style: none; margin: var(--s5) 0 0; padding: 0; }
.jb-charges li { padding: var(--s4) 0; border-top: 1px solid var(--line); }
.jb-charges h3 { margin: 0; font: 600 15px / 1.3 Inter, system-ui, sans-serif; }
.jb-charges p { margin: var(--s1) 0 0; max-width: 66ch; font-size: 14px; line-height: 1.55; color: var(--muted); }
.jb-charges .jb-src { font-size: 13px; color: var(--faint); }
.jb-charges .jb-src a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.jb-tally { margin: var(--s4) 0 0; font: 500 12px / 1.3 var(--mono); color: var(--faint); }
.jb-divider { margin: var(--s8) 0 var(--s2); font: 600 15px / 1.2 var(--display); color: var(--muted); }
.jb-rules { margin: 0; border-top: 1px solid var(--line); }
.jb-rules > div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: var(--s6); padding: var(--s4) 0; border-bottom: 1px solid var(--line); }
.jb-rules dt { font-weight: 600; font-size: 15px; line-height: 1.4; }
.jb-rules dd { margin: 0; font-size: 15px; line-height: 1.55; color: var(--muted); text-wrap: pretty; }

/* ---------- One column ---------- */
@media (width <= 960px) {
  /* The kit locks the document (body overflow hidden) because its panels scroll inside a fixed
     app. In one column the page itself is what scrolls, so the lock comes off. */
  html, body { height: auto; overflow-x: hidden; overflow-y: auto; }
  .jb-app, .jb-app:has(> .tokenbar) { display: block; height: auto; min-height: 100dvh; }
  .jb-app .top { min-height: 64px; padding: var(--s3) var(--s4); }
  .jb-clock { display: none; }
  .jb-main { display: block; padding: 0 var(--s4) 112px; }
  .jb-left { overflow: visible; padding: 0 0 var(--s8); }
  .jb-right { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
  .jb-live { height: auto; }
  .jb-feed { overflow: visible; padding-right: 0; }
}
@media (width <= 640px) {
  .jb-doors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jb-plan-h h3 { font-size: 24px; }
  .jb-facts > div { grid-template-columns: minmax(0, 1fr); gap: var(--s1); align-items: start; padding: var(--s3) 0; }
  .jb-rules > div { grid-template-columns: minmax(0, 1fr); gap: var(--s1); }
  .jb-others a { grid-template-columns: minmax(0, 1fr) auto; }
  .jb-others a span:not(.jb-st) { display: none; }
  .jb-row-pad { grid-template-columns: 60px minmax(0, 1fr); }
}
