.compute { display: flex; flex-direction: column; gap: 6px; width: 100%; height: 100%; min-width: 0; min-height: 0; }
.compute-status {
  padding: 4px 10px;
  border-radius: var(--radius);
  background: var(--board-raised);
  color: var(--chalk-dim);
  font-size: 13px;
}
.compute-status[data-state="loading"]::before,
.compute-status[data-state="running"]::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--yellow);
  animation: compute-pulse 1s ease-in-out infinite alternate;
}
.compute-header .compute-status { flex: 0 1 auto; min-width: 0; padding: 0; overflow: hidden; background: none; text-overflow: ellipsis; white-space: nowrap; }
/* The error box below already says this. */
.compute-header .compute-status[data-state="error"] { display: none; }
.compute-status[data-state="ok"] { color: var(--peach); }
.compute-status[data-state="error"] { color: var(--danger); }
@keyframes compute-pulse { from { opacity: 0.25; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .compute-status::before { animation: none !important; }
}

.compute-panel {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 52vh;
  max-height: 52dvh;
  overflow: hidden;
  background: var(--board-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.compute-header { display: flex; align-items: center; gap: 8px; flex: none; padding-left: 12px; border-bottom: 1px solid var(--line); }
.compute-lang { flex: none; color: var(--yellow); font-size: 13px; font-weight: 600; }
.compute-purpose { flex: 1 1 0; min-width: 0; overflow: hidden; color: var(--chalk-dim); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.compute-close { flex: none; width: 44px; border: 0; background: none; color: var(--chalk-dim); font-size: 22px; line-height: 1; }

.compute-source, .compute-output { margin: 0; font-family: var(--font-mono); font-size: 13px; line-height: 1.5; }
.compute-source { flex: 1 1 0; min-height: 64px; padding: 8px 0; overflow: auto; counter-reset: compute-line; -webkit-overflow-scrolling: touch; }
.compute-line { position: relative; display: block; width: max-content; min-width: 100%; padding-right: 12px; white-space: pre; counter-increment: compute-line; }
.compute-line::before {
  content: counter(compute-line);
  display: inline-block;
  width: 4ch;
  margin-right: 1.5ch;
  color: var(--chalk-dim);
  opacity: 0.6;
  text-align: right;
  user-select: none;
  -webkit-user-select: none;
}
.compute-line.is-marked { background: color-mix(in srgb, var(--yellow) 16%, transparent); }
.compute-line.is-error { background: color-mix(in srgb, var(--danger) 20%, transparent); }
.compute-line-marker { position: absolute; top: 0; bottom: 0; left: 0; width: 3px; background: var(--yellow); }
.is-error > .compute-line-marker { background: var(--danger); }

.compute-results { flex: none; display: flex; flex-direction: column; gap: 8px; max-height: 17vh; max-height: 17dvh; padding: 10px 12px; overflow: auto; border-top: 1px solid var(--line); }
.compute-output { white-space: pre-wrap; overflow-wrap: anywhere; }
.compute-stderr { color: var(--danger); }
.compute-value { color: var(--blue); }
.compute-muted { color: var(--chalk-dim); }
.compute-error { display: flex; flex-direction: column; gap: 2px; color: var(--danger); font-size: 14px; overflow-wrap: anywhere; }
.compute-retry { align-self: flex-start; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--board); }

/* Inside the player's dock the panel fills the pane edge to edge. */
.code-dock .compute-panel { border: 0; border-radius: 0; }

@media (min-width: 900px) {
  .compute-panel { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); }
  .compute-results { max-height: 30vh; max-height: 30dvh; }
}
