/* â”€â”€ editor.css                               Editor area, toolbar, tabs, empty state, meta â”€â”€ */
.editor-area.hidden,
.hidden {
  display: none !important;
}

.line-numbers {
  padding: 16px 8px;
  color: var(--line-number);
  background: var(--line-number-bg);
  border-right: 1px solid var(--outline);
  overflow: hidden;
  font: 500 12px/1.6 var(--font-mono);
  text-align: right;
  white-space: pre;
  user-select: none;
}

.editor-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--surface);
  border-right: 1px solid var(--outline);
}

.studio-panel {
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-width: 0;
  min-height: 0;
  background: var(--surface);
}

.editor-toolbar {
  --toolbar-control-h: 32px;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: calc(var(--toolbar-control-h) + 16px);
  padding: 8px 12px;
  border-bottom: 1px solid var(--outline);
  background: var(--toolbar-bg);
}

.editor-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding-right: 8px;
  color: var(--text);
}

.editor-meta .breadcrumb {
  color: var(--text-secondary, var(--text));
}

.editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.toolbar-action-group {
  display: inline-flex;
  align-items: stretch;
  flex-shrink: 0;
  height: var(--toolbar-control-h);
  border: 1px solid var(--outline);
  border-radius: 8px;
  background: var(--surface-2);
  overflow: hidden;
  box-sizing: border-box;
}

.toolbar-action-group .preview-external-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 var(--toolbar-control-h);
  width: var(--toolbar-control-h);
  min-width: var(--toolbar-control-h);
  height: 100%;
  padding: 0;
  margin: 0;
  color: var(--muted);
  background: var(--surface-2);
  border: 0;
  border-right: 1px solid var(--outline);
  border-radius: 0;
  box-sizing: border-box;
  cursor: pointer;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}

.toolbar-action-group .preview-external-btn:hover {
  color: var(--accent-text);
  background: #e8f0fe;
  border-right-color: #c6dafc;
}

.toolbar-action-group .preview-external-btn .material-icon {
  font-size: 16px;
  line-height: 1;
}

.toolbar-action-group .toolbar-btn {
  flex: 1 1 auto;
  min-width: 72px;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  position: static;
  z-index: auto;
}

.toolbar-action-group:has(.toolbar-btn.is-ready:not(:disabled)) .preview-external-btn,
.toolbar-action-group:has(.toolbar-btn.is-dirty:not(:disabled)) .preview-external-btn {
  border-right-color: rgba(255, 255, 255, 0.28);
}

.toolbar-action-group:has(.toolbar-btn-primary:not(:disabled):not(.is-ready):not(.is-dirty)) .preview-external-btn {
  border-right-color: #c6dafc;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: var(--toolbar-control-h);
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--outline);
  box-sizing: border-box;
  font: 500 11px/1 var(--font-body);
  white-space: nowrap;
  cursor: default;
  transition: background 0.12s, color 0.12s, border-color 0.12s, filter 0.12s;
}

.toolbar-btn .codicon {
  flex-shrink: 0;
  font-size: 14px !important;
  line-height: 1;
}

.toolbar-btn:not(:disabled) {
  color: var(--text);
  cursor: pointer;
}

.toolbar-btn:not(:disabled):hover {
  background: var(--hover-overlay-strong);
}

.toolbar-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.toolbar-action-group .toolbar-btn:disabled {
  opacity: 1;
  color: var(--muted);
  background: var(--surface-2);
}

.toolbar-btn-primary {
  min-width: 72px;
  background: var(--surface-2);
}

.toolbar-btn-primary:not(:disabled) {
  color: var(--accent-text);
  border-color: #c6dafc;
  background: #e8f0fe;
  z-index: 2;
  position: relative;
}

.toolbar-btn-primary:not(:disabled):hover {
  background: #d2e3fc;
  border-color: #aecbfa;
}

.toolbar-btn.is-ready:not(:disabled) {
  color: var(--accent-foreground);
  background: var(--accent);
  border-color: var(--accent);
  z-index: 2;
  position: relative;
}

.toolbar-btn.is-ready:not(:disabled):hover {
  filter: brightness(1.06);
  background: var(--accent);
}

.toolbar-btn.is-dirty:not(:disabled) {
  color: var(--accent-foreground);
  background: var(--accent);
  border-color: var(--accent);
}

.toolbar-btn.is-dirty:not(:disabled):hover {
  filter: brightness(1.08);
}

.save-status {
  display: inline-flex;
  align-items: center;
  height: var(--toolbar-control-h, 32px);
  padding: 0 10px;
  border-radius: 8px;
  box-sizing: border-box;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
}

.save-status.dirty {
  color: #b45309;
  background: #fffbeb;
}

.save-status.error {
  color: #b91c1c;
  background: #fef2f2;
}

.editor-shell {
  position: relative;
  z-index: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--editor-bg);
}

.editor-empty {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px;
  text-align: center;
  color: var(--muted);
  background: var(--editor-bg);
}

.empty-editor-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  color: #174ea6;
}

.empty-editor-icon svg {
  display: block;
  width: 110px;
  height: 110px;
}

.editor-empty h2 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
}

.editor-empty p {
  max-width: 320px;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

