.panels {
  flex: 1;
  min-width: 0;
  padding: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #eef2f7;
}

.output-body {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  background: #ffffff;
}

.result-area {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.output-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.42rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.output-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.output-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: none;
  margin-left: 0.1rem;
  padding-left: 0.55rem;
  border-left: 1px solid #e2e8f0;
}

:root[data-theme="dark"] .output-toolbar {
  border-color: #3a404c;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .output-toolbar {
    border-color: #3a404c;
  }
}

.view-actions {
  display: none;
  align-items: center;
  gap: 0.18rem;
}

.view-actions.active {
  display: inline-flex;
}

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

.mini-action {
  position: relative;
  height: 1.55rem;
  width: 1.55rem;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}

.mini-action:hover,
.mini-action:focus-visible {
  background: #e2e8f0;
  color: #0f172a;
  outline: none;
}

.mini-action svg,
.mini-action .app-icon {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mini-action.action-separated {
  margin-left: 0.28rem;
}

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

.file-panel {
  width: 18rem;
  min-width: 11rem;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #cbd5e1;
  background: #ffffff;
  box-shadow: 6px 0 16px rgba(15, 23, 42, 0.05);
  position: relative;
}

.file-panel-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 8;
}

.file-panel-resizer:hover,
.file-panel.resizing .file-panel-resizer {
  background: rgba(37, 99, 235, 0.22);
}

.file-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.5rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.file-panel-title-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.file-panel-title {
  color: #334155;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-panel-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: auto;
}

.file-panel-close {
  position: relative;
  width: 1.6rem;
  height: 1.6rem;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 1.1rem;
  line-height: 1;
}

.file-panel-close .app-icon,
.input-clear .app-icon {
  width: 0.9rem;
  height: 0.9rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.file-panel-close:hover,
.file-panel-close:focus-visible {
  background: #e2e8f0;
  color: #0f172a;
  outline: none;
}

.file-panel-body {
  flex: 1;
  min-height: 0;
  display: block;
  position: relative;
  overflow: hidden;
}

.file-panel-list {
  background: #f8fafc;
  overflow: auto;
  padding: 0.45rem;
  height: 100%;
  min-height: 0;
}

.file-tree-folder {
  margin: 0.2rem 0;
}

.file-tree-folder-name {
  width: 100%;
  border: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  margin: 0.35rem 0 0.12rem;
  overflow: hidden;
  padding: 0.22rem 0.35rem;
  border-radius: 5px;
  text-align: left;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.file-tree-folder-name:hover,
.file-tree-folder-name:focus-visible {
  background: #e2e8f0;
  color: #334155;
  outline: none;
}

.file-tree-folder-chevron {
  width: 0.72rem;
  height: 0.72rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.16s ease;
}

.file-tree-folder-icon {
  width: 0.9rem;
  height: 0.9rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.file-tree-folder-name span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-tree-folder-children {
  border-left: 1px solid #e2e8f0;
  margin-left: 0.45rem;
  padding-left: 0.35rem;
}

.file-tree-folder:not(.collapsed) > .file-tree-folder-name .file-tree-folder-chevron {
  transform: rotate(90deg);
}

.file-tree-folder.collapsed > .file-tree-folder-children {
  display: none;
}

.file-panel-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 5px;
  opacity: 0.52;
  transition: background 0.18s ease, opacity 0.18s ease;
}

.file-panel-row:hover,
.file-panel-row:focus-within,
.file-panel-row.active-spec,
.file-panel-row.active-input,
.file-panel-row.dependency {
  opacity: 1;
}

.file-panel-row.active-spec,
.file-panel-row.active-input {
  background: #eef6ff;
}

.file-panel-row.dependency:not(.active-spec):not(.active-input) {
  background: #f8fbff;
}

.file-panel-file {
  min-width: 0;
  flex: 1;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #334155;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  overflow: hidden;
  padding: 0.4rem 0.5rem;
  text-align: left;
}

.file-panel-file:hover {
  background: #e2e8f0;
}

.file-panel-file.active {
  background: #dbeafe;
  color: #1d4ed8;
}

.file-panel-file-icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.file-panel-file-icon svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.file-panel-file-icon text {
  fill: currentColor;
  font: 800 0.55rem/1 "Inter", "Segoe UI", Helvetica, Arial, sans-serif;
  stroke: none;
}

.file-icon-yaml {
  color: #2563eb;
}

.file-icon-text {
  color: #64748b;
}

.file-panel-row.active-spec .file-icon-yaml,
.file-panel-row.active-input .file-icon-text,
.file-panel-file.active .file-panel-file-icon {
  color: currentColor;
}

.file-panel-file-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-panel-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  flex: none;
}

.file-panel-badge {
  border-radius: 4px;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  padding: 0.18rem 0.28rem;
}

.file-panel-row.active-spec .file-panel-badge {
  background: #dbeafe;
  color: #1d4ed8;
}

.file-panel-row.active-input .file-panel-badge {
  background: #dcfce7;
  color: #15803d;
}

.file-panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex: none;
  opacity: 0;
  padding-right: 0.2rem;
  transition: opacity 0.18s ease;
}

.file-panel-row:hover .file-panel-actions,
.file-panel-row:focus-within .file-panel-actions {
  opacity: 1;
}

.file-panel-action {
  position: relative;
  width: 1.35rem;
  height: 1.35rem;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.file-panel-action:hover {
  border-color: #93c5fd;
  color: #1d4ed8;
  z-index: 20;
}

.file-panel-action svg,
.file-panel-action .app-icon {
  width: 0.85rem;
  height: 0.85rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.file-panel-viewer {
  margin: 0;
  min-width: 0;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.65rem 0.75rem;
  background: #ffffff;
  color: #1f2933;
  font: 0.76rem/1.55 "Menlo", "Consolas", "Ubuntu Mono", monospace;
  white-space: pre;
}

.file-preview {
  position: absolute;
  inset: 0.75rem;
  z-index: 20;
  display: flex;
  flex-direction: column;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.24);
}

.file-preview-header {
  min-height: 2.35rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 8px 8px 0 0;
  background: #f8fafc;
}

.file-preview-title-group {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.file-preview-kicker {
  color: #334155;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.file-preview-title {
  min-width: 0;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.syntax-key {
  color: #2563eb;
}

.syntax-type-key {
  color: #2563eb;
  font-weight: 700;
}

.syntax-type-reference {
  color: #2563eb;
  font-weight: inherit;
}

.syntax-directive-key {
  color: #7c3aed;
  font-weight: inherit;
}

.syntax-field-key,
.syntax-field-reference {
  color: #b45309;
  font-weight: inherit;
}

.syntax-marker {
  color: #94a3b8;
}

.syntax-string {
  color: #0891b2;
}

.syntax-comment {
  color: #94a3b8;
}

.syntax-literal {
  color: #f97316;
}

.syntax-number {
  color: #16a34a;
}

.panel {
  flex: 1;
  min-height: 0;
  display: none;
  flex-direction: column;
  background: #ffffff;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  height: 100%;
  overflow: visible;
  position: relative;
  z-index: 0;
}

.panel.active {
  display: flex;
}

.panel-actions {
  position: absolute;
  top: 0.75rem;
  right: 0.9rem;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 7px;
  background: rgba(248, 250, 252, 0.9);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.icon-button {
  position: relative;
  width: 1.7rem;
  height: 1.7rem;
  border: 0;
  background: transparent;
  color: #475569;
  border-radius: 6px;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.icon-button:hover {
  background: #f1f5f9;
  color: #1d4ed8;
}

.icon-button:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.35);
  outline-offset: 2px;
}

.icon-button svg,
.icon-button .app-icon {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button.copied {
  color: #16a34a;
}
