#types-panel {
  grid-column: 1;
}

#editor-splitter {
  grid-column: 2;
}

#input-panel {
  grid-column: 3;
}

.studio-editor-panel.collapsed {
  display: none;
}

.studio-editors.types-collapsed {
  grid-template-columns: 0 0 minmax(14rem, 1fr);
}

.studio-editors.input-collapsed {
  grid-template-columns: minmax(18rem, 1fr) 0 0;
}

.studio-editors.types-collapsed.input-collapsed {
  display: none;
}

.studio-editor-splitter,
.studio-output-splitter,
.studio-explorer-splitter {
  background: #cbd5e1;
}

.studio-editor-splitter {
  cursor: col-resize;
}

.studio-output-splitter {
  grid-column: 2 / -1;
  grid-row: 2;
  cursor: row-resize;
}

.studio-editor-splitter:hover,
.studio-editor-splitter.dragging,
.studio-output-splitter:hover,
.studio-output-splitter.dragging,
.studio-explorer-splitter:hover,
.studio-explorer-splitter.dragging {
  background: rgba(37, 99, 235, 0.35);
}

.studio-panel-header {
  height: var(--panel-header-height);
  flex: 0 0 var(--panel-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.28rem 0.6rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.studio-panel-title {
  color: #334155;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.loaded-folder-chip {
  max-width: 8.5rem;
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 5px;
  background: rgba(96, 165, 250, 0.1);
  color: #2563eb;
  font: 740 0.66rem/1 "Inter", "Segoe UI", Helvetica, Arial, sans-serif;
  overflow: hidden;
  padding: 0.22rem 0.36rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loaded-folder-chip.hidden {
  display: none;
}

.studio-panel-meta {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 650;
  white-space: nowrap;
}

.studio-panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.studio-panel-title-group {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.editor-reset-button {
  position: relative;
  width: 1.35rem;
  height: 1.35rem;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex: 0 0 auto;
  transition: background 0.18s ease, color 0.18s ease;
}

.editor-reset-button.hidden {
  display: none;
}

.editor-reset-button:hover,
.editor-reset-button:focus-visible {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  outline: none;
}

.editor-reset-button .app-icon {
  width: 0.82rem;
  height: 0.82rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.editor-reset-button[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 50;
  width: max-content;
  max-width: 14rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
  color: #f8fafc;
  font: 600 0.68rem/1.25 "Inter", "Segoe UI", Helvetica, Arial, sans-serif;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -3px);
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0s linear 0.14s;
  visibility: hidden;
  white-space: nowrap;
}

.editor-reset-button[data-tooltip]::before {
  content: "";
  position: absolute;
  top: calc(100% + 3px);
  left: 50%;
  z-index: 51;
  width: 8px;
  height: 8px;
  background: rgba(15, 23, 42, 0.95);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -3px) rotate(45deg);
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0s linear 0.14s;
  visibility: hidden;
}

.editor-reset-button[data-tooltip]:hover::before,
.editor-reset-button[data-tooltip]:hover::after,
.editor-reset-button[data-tooltip]:focus-visible::before,
.editor-reset-button[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
  transition-delay: var(--button-tooltip-delay), var(--button-tooltip-delay), 0s;
  visibility: visible;
}

.editor-reset-button[data-tooltip]:hover::before,
.editor-reset-button[data-tooltip]:focus-visible::before {
  transform: translate(-50%, 0) rotate(45deg);
}

.studio-panel-action {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 5px;
  color: #64748b;
}

.studio-panel-action:hover,
.studio-panel-action:focus-visible {
  color: #1e293b;
}

.studio-ai-action {
  width: auto;
  gap: 0.22rem;
  padding: 0 0.32rem;
  font-size: 0.72rem;
  font-weight: 650;
  white-space: nowrap;
}

.studio-panel-action.action-separated {
  margin-left: 0.3rem;
  position: relative;
}

.studio-panel-action.action-separated::before {
  content: "";
  position: absolute;
  left: -0.24rem;
  top: 0.3rem;
  bottom: 0.3rem;
  width: 1px;
  background: rgba(148, 163, 184, 0.38);
}

.studio-editor {
  flex: 1;
  min-height: 0;
  width: 100%;
  resize: none;
  border: 0;
  outline: none;
  padding: 0.8rem 0.85rem;
  background: #ffffff;
  color: #1f2933;
  font: 0.8rem/1.55 "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
  overflow-wrap: normal;
}

.studio-editor:focus {
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.studio-editor-shell {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #ffffff;
}

.studio-editor-highlight {
  position: absolute;
  inset: 0;
  margin: 0;
  overflow: auto;
  padding: 0.8rem 0.85rem;
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
  color: #1f2933;
  font: 0.8rem/1.55 "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  tab-size: 2;
  pointer-events: none;
}

.studio-editor-highlight::-webkit-scrollbar {
  display: none;
}

.studio-editor-highlight {
  scrollbar-width: none;
}

.studio-editor-overlay {
  position: absolute;
  inset: 0;
  min-width: 100%;
  width: 100%;
  overflow: auto;
  background: transparent;
  color: transparent;
  caret-color: #1f2933;
  -webkit-text-fill-color: transparent;
  white-space: pre;
  overflow-wrap: normal;
}

.studio-editor-overlay::selection {
  background: rgba(37, 99, 235, 0.26);
  color: transparent;
}

.studio-codemirror {
  display: none;
  position: absolute;
  inset: 0;
  min-width: 100%;
  height: 100%;
}

.yaml-editor-shell.codemirror-enabled .studio-editor-highlight,
.yaml-editor-shell.codemirror-enabled .studio-editor-overlay {
  display: none;
}

.yaml-editor-shell.codemirror-enabled .studio-codemirror {
  display: block;
}

.studio-codemirror .cm-editor {
  height: 100%;
  background: #ffffff;
  color: #1f2933;
  font: 0.8rem/1.55 "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.studio-codemirror .cm-scroller {
  overflow: auto;
  font: inherit;
}

.studio-codemirror .cm-content {
  min-height: 100%;
  padding: 0.8rem 0.85rem;
  caret-color: #1f2933;
  tab-size: 2;
  white-space: pre;
}

.studio-codemirror .cm-focused {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.studio-codemirror .cm-line {
  padding: 0;
  position: relative;
}

.studio-codemirror .cm-gutters {
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  color: #94a3b8;
  font: inherit;
}

.studio-codemirror .cm-lineNumbers {
  font-size: 0.68rem;
}

.studio-codemirror .cm-lineNumbers .cm-gutterElement {
  align-items: center;
  display: flex;
  justify-content: flex-end;
  line-height: 1.55rem;
}

.studio-codemirror .yaml-action-gutter {
  min-width: 1.05rem;
}

.studio-codemirror .yaml-action-gutter .cm-gutterElement {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.studio-codemirror .cm-foldGutter .cm-gutterElement {
  align-items: center;
  display: flex;
  justify-content: center;
  padding: 0 0.18rem;
}

.studio-codemirror .cm-foldGutter span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transform: translateY(-0.08rem);
}

.studio-codemirror .cm-foldPlaceholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1rem;
  height: 1rem;
  margin: 0 0.08rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.25rem;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.72em;
  line-height: 1;
  vertical-align: -0.08em;
}

.yaml-action-dot {
  width: 0.46rem;
  height: 0.46rem;
  border: 0;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.42);
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.1);
  cursor: pointer;
  opacity: 0.58;
  padding: 0;
  transition: background 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease, transform 0.16s ease;
}

.yaml-action-dot:hover,
.yaml-action-dot:focus-visible {
  background: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
  opacity: 1;
  outline: none;
  transform: scale(1.12);
}

.studio-codemirror .cm-activeLine,
.studio-codemirror .cm-activeLineGutter {
  background-color: rgba(37, 99, 235, 0.06);
}

.studio-codemirror .yaml-moving-node {
  background-color: rgba(99, 102, 241, 0.1);
  box-shadow: inset 2px 0 0 rgba(99, 102, 241, 0.4);
  transition: background-color 0.16s ease, box-shadow 0.16s ease;
}

.studio-codemirror .cm-selectionBackground,
.studio-codemirror .cm-focused .cm-selectionBackground,
.studio-codemirror .cm-content ::selection {
  background: rgba(37, 99, 235, 0.24);
}
