:root {
  --line: #c8c8c8;
  --tree: #cccccc;
  --chip: #eaeaea;
  --well: #ececec;
  --text: #434343;
  --text-2: #646a73;
  --muted: #818181;
  --faint: #b8b8b8;
  --mono-muted: #8b95ae;
  --accent: #226cbb;
  --accent-bg: #cedef1;
  --add: #04c959;
  --del: #c80848;
  --agent-ring: #d9b970;
  --agent-edge: #f1e9d6;
  --font: "Inter", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --hover: #f1f1f1;

  /* motion: strong curves; UI stays under 300ms */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --press: 160ms;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: #ebebeb; }
body { min-height: 100vh; display: grid; place-items: center; padding: 32px; overflow: hidden; }
body { font: 12px/normal var(--font); letter-spacing: -0.36px; color: var(--text);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
p, ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; letter-spacing: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }

/* every pressable thing answers the press; hover only where a pointer can hover */
button { transition: transform var(--press) var(--ease-out), background-color 150ms ease; }
button:active { transform: scale(0.97); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (hover: hover) and (pointer: fine) {
  .project-tab[aria-selected="false"]:hover, .branch .toggle:hover, .commit[aria-pressed="false"]:hover { background: var(--hover); }
  .commit:hover .id { background: #fff; }
  .icon-btn:hover { background: #e0e0e0; }
  .icon-btn.outline:hover { background: var(--hover); }
  .sandbox:hover { background: var(--hover); }
  .sandbox:hover .slot:not(.on) { background: #dcdcdc; }
  .agent:hover > .name-tip { opacity: 1; transform: translateX(-50%); visibility: visible;
    transition: opacity 125ms var(--ease-out) 300ms, transform 125ms var(--ease-out) 300ms, visibility 0s 300ms; }
  .follow:hover { background: #c2d6ee; }
}
@media (prefers-reduced-motion: reduce) {
  button, .follow { transition: background-color 150ms ease, opacity 150ms ease; }
  button:active, .follow[hidden], .tip-group { transform: none; }
}

/* the view is a panel centred in the window, scaled down (never up) to fit it.
   zoom, not transform: zoom lays text and edges out at the final size, so they stay sharp */
.app { width: 1440px; height: 1024px; position: relative; overflow: hidden; background: #fff; border-radius: 14px; zoom: var(--fit, 1);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .08), 0 2px 4px rgba(0, 0, 0, .04), 0 16px 48px rgba(0, 0, 0, .08); }

/* project tabs */
.projects { height: 48px; display: flex; align-items: center; gap: 8px; padding: 10px; background: #fff; border-bottom: 1px solid var(--line); }
.project-tabs { display: flex; gap: 8px; }
.project-tab { width: 220px; height: 28px; display: flex; align-items: center; gap: 4px; padding: 0 3px; border: 1px solid transparent; border-radius: 9px; }
.project-tab[aria-selected="true"] { background: #f8f8f8; border-color: rgba(0, 0, 0, .1); }
/* a 220px tab at 0.97 loses 6.6px; 0.99 keeps the press to about 2px, like the small buttons */
.project-tab:active { transform: scale(0.99); }
.project-tab .num { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 5px; background: var(--chip); font-size: 10px; letter-spacing: -0.3px; line-height: 1; color: #000; }
.icon-btn { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 5px; background: var(--chip); }
.icon-btn.outline { background: none; border: 1px solid var(--line); }

.body { position: absolute; top: 48px; left: 0; width: 1440px; height: 976px; display: flex; }

/* branch tree */
.branches { position: relative; width: 280px; height: 100%; padding: 32px 6px; background: #fff; border-right: 1px solid var(--line); overflow: hidden; }
.branches ul { display: flex; flex-direction: column; gap: 12px; }
/* the tree's title, in the band above it: centred 16px down, a little
   clear of the first row, from the tree's left edge */
.branches-title { position: absolute; top: 0; left: 10px; height: 32px; display: flex; align-items: center; margin: 0;
  font: inherit; color: var(--muted); }
.tree-art { position: absolute; inset: 0; display: block; pointer-events: none; }
.tree-art path { fill: none; stroke: var(--tree); stroke-width: 1; }
.branches ul { position: relative; }
.branch { height: 28px; display: flex; align-items: center; gap: 4px; padding: 0 4px; border-radius: 6px; position: relative; }
.branch .indent { width: 20px; height: 20px; flex: none; }
.branch .toggle { width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 6px; background: #f7f7f7; }
/* Branch badge, built in CSS from the design's values so the ring, fill and
   inner highlight share one corner centre: radii 7 / 6 / 5 nest exactly */
.badge { --light: #becfe5; --dark: #3f76bf; --ring: rgba(63, 118, 191, .8);
  width: 19px; height: 19px; flex: none; position: relative; display: grid; place-items: center; border-radius: 6px;
  background: radial-gradient(circle 18.68px at 6.5px 1px, var(--light), var(--dark));
  box-shadow: 0 0 0 1px var(--ring), 1px 2px 2px rgba(0, 0, 0, .06);
  color: #fff; font-size: 10px; letter-spacing: -0.2px; line-height: 1; font-variant-numeric: tabular-nums; }
.badge::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(166deg, rgba(255, 255, 255, .7) 0%, rgba(255, 255, 255, 0) 58%, rgba(255, 255, 255, .4) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.badge.teal { --light: #bee5e5; --dark: #3fbabf; --ring: rgba(63, 186, 191, .8); }
/* more tones, so sibling branches never share one (a branch's own branches
   take its tone); each light is its dark taken two thirds of the way to white */
.badge.violet { --light: #d3caea; --dark: #7a5fc0; --ring: rgba(122, 95, 192, .8); }
.badge.amber { --light: #ead8c0; --dark: #c08a3f; --ring: rgba(192, 138, 63, .8); }
.badge.rose { --light: #e9c5ce; --dark: #bf4f6c; --ring: rgba(191, 79, 108, .8); }
.badge.green { --light: #c4ddcb; --dark: #4f9a64; --ring: rgba(79, 154, 100, .8); }
.badge.orange { --light: #efd1bf; --dark: #d0743f; --ring: rgba(208, 116, 63, .8); }
.badge.slate { --light: #c8ced6; --dark: #5b6b85; --ring: rgba(91, 107, 133, .8); }
.badge.stone { --light: #cabebe; --dark: #574e4e; --ring: #6f6161; }

/* timeline */
.timeline { position: relative; flex: 1; height: 100%; background: #fff; overflow: hidden; }
/* the labels sit level with the Follow button: both centred 20px down */
.tick { position: absolute; top: 12.5px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--faint); }
/* as drawn: both lines are their colour at 40% */
.tick::after { content: ""; width: 1px; height: 930.5px; background: rgba(184, 184, 184, .25); }
.tick.now { color: var(--accent); }
.tick.now::after { background: rgba(34, 108, 187, .4); }

.bar { position: absolute; height: 20px; border-radius: 4px; border: 1px solid; }
.bar.past { opacity: .36; }
.bar.main { background: #dadada; border-color: #989898; }
/* the pixel pulse fills the bar inside its border and follows its rounded corners */
.bar { overflow: hidden; }
.bar .pulse { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.commit-mark { position: absolute; width: 4px; height: 20px; border-radius: 4px; }
/* the mark is 4px wide; a wider invisible hit area makes it easy to hover */
.commit-mark::before { content: ""; position: absolute; inset: -2px -5px; }
.commit-mark:active { transform: none; }
/* 1px in the mark's colour, solid so it holds up from a distance */
.merge-line { position: absolute; width: 1px; }

.agent { position: absolute; width: 20px; height: 20px; border-radius: 4px; border: 1px solid var(--agent-edge); box-shadow: 0 0 0 1px var(--agent-ring); }
.agent .sand { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 3px; }
.status { position: absolute; height: 20px; display: flex; align-items: center; padding: 0 8px; border-radius: 4px; background: #f1f1f1; font-size: 10px; letter-spacing: -0.3px; line-height: 1; white-space: nowrap; }

/* the tooltip and its arrow move as one and sit above every line in the timeline;
   they grow from the arrow's tip, and leave faster than they come */
.tip-group { position: absolute; z-index: 10; width: 48px; height: 24px; pointer-events: none; transform-origin: 50% 100%;
  opacity: 0; transform: scale(0.97); visibility: hidden;
  transition: opacity 100ms ease, transform 100ms ease, visibility 0s 100ms; }
.tip-group[data-open] { opacity: 1; transform: none; visibility: visible;
  transition: opacity 125ms var(--ease-out), transform 125ms var(--ease-out), visibility 0s; }
.tip-group[data-instant] { transition-duration: 0ms; }
.tooltip { position: absolute; height: 20px; display: flex; align-items: center; padding: 0 6px; border-radius: 4px; background: #000; color: #e6e6e6; font-size: 10px; letter-spacing: -0.3px; white-space: nowrap; }
.tooltip-arrow { position: absolute; width: 15px; height: 13.25px; transform: rotate(180deg); }
/* an agent's name over its square: waits a beat before it shows, leaves faster */
.name-tip { position: absolute; left: 50%; bottom: calc(100% + 6px); z-index: 10; height: 20px; display: flex; align-items: center; padding: 0 6px; border-radius: 4px;
  background: #000; color: #e6e6e6; font-size: 10px; letter-spacing: -0.3px; white-space: nowrap; pointer-events: none;
  transform-origin: 50% 100%; opacity: 0; transform: translateX(-50%) scale(0.97); visibility: hidden;
  transition: opacity 100ms ease, transform 100ms ease, visibility 0s 100ms; }
.name-tip::after { content: ""; position: absolute; left: 50%; top: 100%; margin-left: -4px; border: 4px solid transparent; border-top-color: #000; }

/* Follow shows only once the view leaves the live edge: in with ease-out, out faster */
.follow { position: absolute; left: 769px; top: 8px; height: 24px; padding: 0 10px; border-radius: 6px; background: var(--accent-bg); color: var(--accent); transform-origin: 50% 0;
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), background-color 150ms ease; }
.follow[hidden] { display: flex; visibility: hidden; opacity: 0; transform: scale(0.95); transition: opacity 150ms ease, transform 150ms ease, visibility 0s 150ms; }
.follow:active { transform: scale(0.97); }
.scrubber { position: absolute; right: 336px; bottom: 8px; width: 816px; height: 36px; }
.scrubber img { display: block; }

/* stats sidebar */
.stats { position: absolute; top: 8px; right: 8px; width: 320px; height: 960px; padding: 11px; display: flex; flex-direction: column; gap: 32px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.stat { position: relative; display: flex; flex-direction: column; gap: 11px; }
/* the number starts on the column's left edge, the label a little way after it */
.stat-head { display: flex; align-items: baseline; gap: 6px; padding: 5px 5px 5px 0; line-height: 1; white-space: nowrap; }
.stat-num { font-size: 24px; letter-spacing: -0.72px; color: var(--text); }
/* the label is set as large as its number, in the lighter grey */
.stat-label { font-size: 24px; letter-spacing: -0.72px; color: var(--faint); }
/* storage leads with its sizes: what is stored, then, greyed after a slash,
   what the history would take without LayerFS; the ratio moves to the foot */
.stat-of { color: var(--faint); }
.stat-toggle { position: absolute; top: 0; left: 272px; }
.stat-foot { display: flex; justify-content: space-between; line-height: 1; color: var(--muted); }
.accent { color: var(--accent); }

.waffle { display: grid; grid-template-columns: repeat(25, 10px); gap: 4px 2px; }
.cell { width: 10px; height: 10px; border-radius: 2px; background: var(--well); position: relative; }
.cell.on { background: var(--accent); }
.cell .part { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border-radius: 1px; background: var(--accent); }

/* each sandbox is a button: its slots and a caption, on a padded surface that
   lights up under the pointer, so the slots line up with the rest at rest */
.sandboxes { display: flex; flex-direction: column; gap: 4px; margin: -6px; }
.sandbox { display: flex; flex-direction: column; gap: 8px; padding: 6px; border-radius: 7px; text-align: left; }
.sandbox:active { transform: scale(0.99); }
.sandbox[aria-expanded="true"] { background: var(--hover); }
/* on the lit surface the empty slots deepen, so the free room still reads */
.slot { transition: background-color 150ms ease; }
.sandbox[aria-expanded="true"] .slot:not(.on) { background: #dcdcdc; }
.slots { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.slot { height: 10px; border-radius: 2px; background: var(--well); }
.slot.on { background: #d9b970; }

/* the workspaces in a sandbox: a card beside the stats column, level with the
   button it belongs to, growing out of it toward the left */
.sandbox-pop { position: absolute; right: 336px; width: 280px; z-index: 15; display: flex; flex-direction: column; gap: 2px; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
  transform-origin: 100% 0; opacity: 0; transform: translateX(6px) scale(0.97); visibility: hidden;
  transition: opacity 120ms ease, transform 120ms ease, visibility 0s 120ms; }
.sandbox-pop[data-open] { opacity: 1; transform: none; visibility: visible; transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out); }
.pop-row { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 6px; }
.pop-row .agent { position: relative; flex: none; }
.pop-branch { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-status { color: var(--muted); }
.pop-status { font: 11px var(--mono); letter-spacing: normal; white-space: nowrap; }

/* the commit list fills what is left of the column and scrolls inside it */
.commits-stat { flex: 1; min-height: 0; }
/* a row's number chip sits 4px in from its hover surface on every side,
   level with the heading; its agent's square sits 6px in on every side,
   centred under the filter button, so the rows reach 4px past the column
   on the right */
.commits { display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overflow-y: auto; margin: 0 -10px 0 -6px; padding: 0 6px 8px;
  scrollbar-width: thin; scrollbar-color: #d6d6d6 transparent; }
.commit { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 4px 4px; border-radius: 7px; text-align: left; }
.commit:active { transform: scale(0.99); }

/* a row narrowed out of the list is left out of it */
.commits li[hidden] { display: none; }
.commits-empty { padding: 8px 4px; color: var(--muted); }

/* the filter: at the heading's right edge, like the storage chart's button,
   and centred on the heading's line (its 24px number in 5px of padding);
   lit while the list is narrowed to one agent */
.commit-filter { position: absolute; top: 5px; left: 272px; }
.commit-filter svg { display: block; fill: none; stroke: #949494; stroke-width: 1.16667; stroke-linecap: round; stroke-linejoin: round; transition: stroke 150ms ease; }
.commit-filter[aria-pressed="true"] { background: var(--accent-bg); border-color: transparent; }
.commit-filter[aria-pressed="true"] svg { stroke: var(--accent); }
.commit-filter[aria-expanded="true"] { background: var(--hover); }
/* its menu drops from the button, growing out of its top right corner;
   it leaves faster than it comes */
.commit-menu { position: absolute; right: 20px; width: 200px; z-index: 16; display: flex; flex-direction: column; gap: 2px; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
  transform-origin: 100% 0; opacity: 0; transform: scale(0.97); visibility: hidden;
  transition: opacity 120ms ease, transform 120ms ease, visibility 0s 120ms; }
.commit-menu[data-open] { opacity: 1; transform: none; visibility: visible; transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out); }
@media (prefers-reduced-motion: reduce) { .commit-menu { transform: none; } }
.menu-item { min-height: 28px; display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; text-align: left; }
.menu-item:active { transform: scale(0.99); }
.menu-item .check { width: 14px; flex: none; visibility: hidden; }
.menu-item[aria-checked="true"] .check { visibility: visible; }
.menu-item .check svg { display: block; fill: none; stroke: var(--accent); stroke-width: 1.16667; stroke-linecap: round; stroke-linejoin: round; }
.menu-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .menu-item:hover { background: var(--hover); } }
/* the number sits on a chip, a lighter grey than the project tabs'; it turns white when its row is hovered or open */
.commit .id { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 3px; background: #f4f4f4; color: var(--muted); line-height: 1; transition: background-color 150ms ease; }
.commit[aria-pressed="true"] .id { background: #fff; }
.commit { gap: 8px; }
.commit .left { flex: 1; display: flex; align-items: center; gap: 4px; min-width: 0; }
.commit .id { flex: none; }
.commit .msg { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); letter-spacing: normal; white-space: nowrap; }
.commit .right { flex: none; }
.commit .right { display: flex; align-items: center; gap: 12px; }
/* counts are grey at rest; the row under the pointer (or the open one) shows
   additions in the design's green and removals in its red */
.diff { font: 11px var(--mono); letter-spacing: normal; color: var(--mono-muted); white-space: nowrap; }
.diff .add, .diff .del { transition: color 150ms ease; }
.diff.colored .add, .commit[aria-pressed="true"] .diff .add { color: var(--add); }
.diff.colored .del, .commit[aria-pressed="true"] .diff .del { color: var(--del); }
@media (hover: hover) and (pointer: fine) {
  .commit:hover .diff .add { color: var(--add); }
  .commit:hover .diff .del { color: var(--del); }
}
.commit:focus-visible .diff .add { color: var(--add); }
.commit:focus-visible .diff .del { color: var(--del); }
/* who made a commit: identity only, so none of the ring that marks an agent
   running in a sandbox; just a 1px frame in the agent's own colour */
.who { position: relative; flex: none; border: 1px solid; box-shadow: none; }

/* diff of the selected commit: a sheet beside the stats column. It slides in
   from the column it came from and leaves faster than it arrives */
.diff-panel { position: absolute; top: 8px; bottom: 8px; right: 336px; width: 560px; z-index: 20; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: 9px; overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .04), 0 12px 32px rgba(0, 0, 0, .08); transform-origin: 100% 50%;
  opacity: 0; transform: translateX(8px) scale(0.99); visibility: hidden; pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease, visibility 0s 150ms; }
.diff-panel[data-open] { opacity: 1; transform: none; visibility: visible; pointer-events: auto;
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out), visibility 0s; }
@media (prefers-reduced-motion: reduce) { .diff-panel, .diff-panel[data-open] { transform: none; } }
.diff-head { display: flex; align-items: center; gap: 8px; padding: 11px 11px 0 11px; }
.diff-head-row { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.diff-head-row .id { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 3px; background: var(--well); color: var(--muted); line-height: 1; flex: none; }
.diff-title { flex: 1; min-width: 0; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.diff-close img { transform: rotate(45deg); }
.diff-meta { padding: 6px 11px 10px 41px; color: var(--muted); border-bottom: 1px solid var(--well); }
.diff-body { flex: 1; min-height: 0; overflow: auto; padding: 8px 11px 12px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; scrollbar-color: #d6d6d6 transparent; }
.diff-body > * { flex: none; }
.diff-file { border: 1px solid var(--well); border-radius: 7px; overflow: hidden; }
.diff-file-head { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; background: #f8f8f8; border-bottom: 1px solid var(--well); }
.diff-file-head .path { font: 11.5px var(--mono); letter-spacing: normal; color: var(--text); }
.diff-lines { font: 11px/18px var(--mono); letter-spacing: normal; }
.dl { display: grid; grid-template-columns: 32px 32px 14px 1fr; white-space: pre; }
.dl .ln { padding-right: 6px; text-align: right; color: var(--faint); user-select: none; }
.dl .sign { text-align: center; user-select: none; }
.dl .code { overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.dl.add { background: #ebfaf0; } .dl.add .sign { color: var(--add); }
.dl.del { background: #fdedf1; } .dl.del .sign { color: var(--del); }
.dl.hunk { display: block; padding: 2px 8px; background: #f3f6fb; color: var(--mono-muted); }
.dl.hunk .code { color: var(--mono-muted); }
