.pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg-panel);
  position: relative;
}

@media (max-width: 880px) {
  .pane {
    border-bottom: 1px dashed var(--border);
  }
}

.paneLabel {
  font-size: var(--fs-label);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 14px 0;
  flex-shrink: 0;
}

/* Monaco editor container — fill all available vertical space */
.editorWrap {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Drag-over highlight: outline the Monaco wrapper instead of the textarea */
.dragging .editorWrap {
  outline: 2px dashed var(--gold);
  outline-offset: -4px;
  z-index: 1;
}

/* ── Playback active-line decoration ─────────────────────────────────
   Monaco injects the className directly into its DOM, so the rule must
   be global (un-hashed).  The :global wrapper keeps it co-located with
   this component while opting out of CSS Modules name-mangling.         */
:global(.ns-playback-line) {
  background: var(--gold-13) !important;
  border-left: 2px solid var(--gold) !important;
}

/* ── Stitch-line number highlight ────────────────────────────────────
   Applied via lineNumberClassName on every line that produced at least
   one stitch in the current compile.  Gold tint echoes the playback
   highlight, making the connection to stitch output visually clear.    */
:global(.ns-stitch-line-num) {
  color: rgba(203, 161, 109, 0.7) !important;
}

/* Loading skeleton shown while Monaco initialises */
.editorLoading {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: var(--fs-code);
  letter-spacing: 0.06em;
  background: var(--bg-panel);
}

.console {
  min-height: 40px;
  overflow-y: auto;
  padding: 6px 14px;
  background: rgba(0, 0, 0, 0.1);
  font-size: var(--fs-code);
  line-height: 1.5;
  color: var(--text-muted);
  flex-shrink: 0;
}

.err {
  color: var(--console-err);
}
.ok {
  color: var(--console-ok);
}
.warn {
  color: var(--gold);
}
.print {
  color: var(--text);
}

/* Warnings that carry a location can be hovered to reveal markers in the
   preview and on the playback bar. */
.locatable {
  cursor: help;
  border-radius: 3px;
  margin: 0 -4px;
  padding: 0 4px;
  transition: background-color 0.12s ease;
}
.locatable:hover {
  background: var(--gold-22, rgba(180, 140, 60, 0.18));
}

/* Timestamp divider printed above each new compile so runs are easy to
   tell apart. A thin rule fills the space to the right of the time label. */
.time {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: var(--fs-label);
  letter-spacing: 0.12em;
  color: var(--text-faint, var(--text-muted));
  opacity: 0.7;
}

.time:first-child {
  margin-top: 0;
}

.time::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.replRow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 10px;
  border-top: 1px dashed var(--border);
  flex-shrink: 0;
  position: relative;
}

/* ── AI model suggestion panel ────────────────────────────────────────
   Floats above the REPL row; bottom-anchored so it grows upward.      */
.suggestBox {
  position: absolute;
  bottom: calc(100% + 2px);
  left: 14px;
  right: 14px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  max-height: 220px;
  overflow-y: auto;
  z-index: 50;
}

.suggestItem {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: var(--fs-code);
  transition: background-color 0.1s ease;
}

.suggestItem:hover {
  background: rgba(255, 255, 255, 0.05);
}

.suggestItemActive {
  background: rgba(203, 161, 109, 0.13) !important;
}

.suggestItemId {
  color: var(--text);
  font-family: var(--font-mono, monospace);
  font-size: var(--fs-code);
  flex-shrink: 0;
}

.suggestItemName {
  color: var(--text-muted);
  font-size: var(--fs-label);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* ── AI input state ────────────────────────────────────────────────── */
.aiReplInput {
  border-color: rgba(203, 161, 109, 0.4) !important;
}

/* ── AI generating spinner ─────────────────────────────────────────── */
.aiSpinner {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  animation: aiPulse 1s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes aiPulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.3;
    transform: scale(0.7);
  }
}

/* ── Model badge ────────────────────────────────────────────────────── */
.modelBadge {
  font-size: var(--fs-label);
  color: var(--text-faint, var(--text-muted));
  font-family: var(--font-mono, monospace);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
  opacity: 0.6;
  flex-shrink: 0;
}

/* ── Active snippet badge ────────────────────────────────────────────── */
/* Gold-tinted; signals that /autosave is available for this name.       */
.snippetBadge {
  font-size: var(--fs-label);
  color: var(--gold);
  font-family: var(--font-mono, monospace);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
  opacity: 0.75;
  flex-shrink: 0;
}

.prompt {
  color: var(--gold);
  font-weight: 600;
}

.dropOverlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--gold);
  font-size: var(--fs-lg);
  letter-spacing: 0.08em;
  background: var(--bg-app-60);
  pointer-events: none;
}
