html,
body {
  font-family: var(--font-ui);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  overflow: hidden;
}

.app {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.workspace {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.split-container {
  flex: 1;
  display: flex;
  min-height: 0;
  position: relative;
}

.split-pane {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-pane {
  flex-basis: 50%;
}

.preview-pane {
  flex-basis: 50%;
}

.pane-header {
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 0 var(--space-2) 0 var(--space-4);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}

.pane-header .icon-btn {
  width: 26px;
  height: 26px;
  text-transform: none;
  letter-spacing: normal;
}

.pane-header .icon-btn svg {
  width: 14px;
  height: 14px;
}

.pane-body {
  flex: 1;
  min-height: 0;
  position: relative;
}

.divider {
  flex-shrink: 0;
  width: 10px;
  cursor: col-resize;
  position: relative;
  background-color: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  touch-action: none;
}

.divider::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 40px;
  transform: translate(-50%, -50%);
  border-radius: var(--radius-sm);
  background-color: var(--border-strong);
  opacity: 0.6;
}

.divider:hover::after,
.divider.is-dragging::after {
  opacity: 1;
  background-color: var(--accent-blue);
}

.split-container.is-resizing {
  cursor: col-resize;
  user-select: none;
}

.split-container.is-resizing .pane-body iframe {
  pointer-events: none;
}

.preview-frame-shell {
  height: 100%;
  background-color: #ffffff;
  overflow: hidden;
}

.preview-frame-shell iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 720px) {
  .split-container {
    flex-direction: column;
  }

  .divider {
    width: 100%;
    height: 16px;
    cursor: row-resize;
    border-left: none;
    border-right: none;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
  }

  .divider::after {
    width: 40px;
    height: 4px;
  }

  .pane-header {
    height: 30px;
    font-size: 11px;
    padding: 0 var(--space-3);
  }
}

.run-output {
  display: none;
  height: 100%;
  overflow: auto;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  padding: var(--space-4);
  white-space: pre-wrap;
  word-break: break-word;
}

.run-output.is-visible {
  display: block;
}

.run-output .run-status {
  font-weight: 600;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.run-output .run-status.ok {
  color: var(--accent-green);
}

.run-output .run-status.fail {
  color: var(--accent-red);
}

.run-output .run-section-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: var(--space-3) 0 var(--space-1);
}

.run-output .run-stdout {
  color: var(--text-primary);
}

.run-output .run-stderr {
  color: var(--accent-red);
}

.run-output .run-meta {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 12px;
}

.run-output .run-loading {
  color: var(--text-primary);
}
