/* Badges */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 1px var(--space-2);
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

.badge.running,
.badge.dirty {
  /* In-progress / notice — chrome outline, semantic text as a tint. */
  border-color: var(--border);
}

.badge.running {
  color: color-mix(in srgb, var(--running) 32%, var(--text-muted));
  background: color-mix(in srgb, var(--running) 8%, transparent);
}

/* Pass / fail (and accepted / rejected) must stay opposite hues.
   Do not mix them into --text-muted — chrome hue collapses the pair. */
.badge.warn {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  border-color: color-mix(in srgb, var(--danger) 50%, transparent);
}

.badge.clean {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 14%, transparent);
  border-color: color-mix(in srgb, var(--success) 50%, transparent);
}

.badge.dirty {
  color: color-mix(in srgb, var(--warning) 32%, var(--text-muted));
  background: color-mix(in srgb, var(--warning) 8%, transparent);
}

/* Panels */

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border-outer);
  border-radius: var(--radius);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.pane-panel {
  height: 100%;
  min-height: 0;
  border-radius: 0;
  border: none;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
}

.pane-panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.panel-header-end {
  justify-content: flex-end;
}

.panel-actions {
  display: inline-flex;
  gap: var(--space-2);
}

/* Resizable shell splits (columns / rows) — pairs with ResizableSplit */

.split-shell {
  display: grid;
  height: 100%;
  min-height: 0;
  min-width: 0;
}

.split-shell-dragging {
  user-select: none;
  cursor: inherit;
}

.split-shell-dragging.split-shell-horizontal,
.split-shell-dragging .split-handle-col {
  cursor: col-resize;
}

.split-shell-dragging.split-shell-vertical,
.split-shell-dragging .split-handle-row {
  cursor: row-resize;
}

.split-primary,
.split-secondary {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.split-handle {
  background: var(--border-subtle);
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.split-handle::after {
  content: "";
  position: absolute;
  inset: -2px;
}

.split-handle-col {
  cursor: col-resize;
}

.split-handle-row {
  cursor: row-resize;
}

.split-handle:hover,
.split-shell-dragging .split-handle {
  background: var(--accent);
}

/* Status dot — pairs with the StatusDot component */

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-stopped {
  background: var(--border);
}

.dot-pending {
  background: var(--warning);
}

.dot-running {
  background: var(--running);
}

.dot-blocked {
  background: var(--danger);
  opacity: 0.65;
}

.dot-crashed {
  background: var(--danger);
}

/* Empty state */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: var(--space-3);
  text-align: center;
  padding: var(--space-6);
}

.empty-state p {
  max-width: 360px;
  color: var(--text-muted);
}

/* Overlay scrollbars — never reserve gutter space. Styling
   `::-webkit-scrollbar` forces classic (layout-shifting) scrollbars in
   WebKit, so we leave them unstyled and rely on the platform overlay.
   Firefox gets a thin transparent track. */

* {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  scrollbar-gutter: auto;
}

html.is-scrolling,
html.is-scrolling * {
  scrollbar-color: rgba(255, 255, 255, 0.40) transparent;
}

/* Circular panel spinner (first-paint only; named work uses the strip) */

.spinner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.spinner-ring {
  box-sizing: border-box;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-strong, var(--border));
  border-top-color: var(--accent-strong, var(--text-muted));
  border-radius: 50%;
  animation: spinner-rotate 0.7s linear infinite;
}

@keyframes spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}

.panel-spinner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: var(--space-2) 0;
}

/* Floating notify hosts — growl (top), toast (bottom-left), snackbar (bottom-center). */

.notify-growls,
.notify-toasts,
.notify-snackbar-host {
  pointer-events: none;
  position: fixed;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 0 var(--space-4);
}

.notify-growls {
  inset-inline: 0;
  top: var(--space-4);
  align-items: center;
}

.notify-toasts {
  left: var(--space-4);
  bottom: calc(var(--u) * 8 + var(--space-4));
  align-items: flex-start;
  max-width: min(360px, calc(100vw - 2rem));
}

.notify-snackbar-host {
  inset-inline: 0;
  bottom: calc(var(--u) * 8 + var(--space-4));
  align-items: center;
}

.notify-growl,
.notify-toast,
.notify-snackbar {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  width: 100%;
  max-width: 420px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  animation: notify-enter 180ms ease-out;
}

.notify-toast {
  max-width: 360px;
}

.notify-snackbar {
  max-width: 480px;
}

@keyframes notify-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .notify-growl,
  .notify-toast,
  .notify-snackbar {
    animation: none;
  }
}

.notify-growl.is-error,
.notify-toast.is-error,
.notify-snackbar.is-error {
  border-color: var(--danger);
}

.notify-growl.is-error .notify-message,
.notify-toast.is-error .notify-message {
  color: var(--danger);
  font-weight: 500;
}

.notify-toast.is-success .notify-message {
  color: var(--success);
}

.notify-message {
  flex: 1;
  min-width: 0;
}

.notify-action {
  flex-shrink: 0;
  margin: 0;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--accent-strong);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.notify-action:hover {
  border-color: var(--accent);
  color: var(--text);
}

.notify-dismiss {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
}

.notify-dismiss:hover {
  opacity: 1;
}

