*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

button, input, a, label {
  -webkit-tap-highlight-color: transparent;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  background: none;
  cursor: pointer;
  outline: none;
  user-select: none;
}

button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 1px;
}

/* App Shell Structure */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Main Workspace (Editor + Splitter + Preview) */
.workspace {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background-color: var(--bg-app);
}

.editor-pane {
  display: flex;
  flex-direction: column;
  flex: 55;
  min-width: 260px;
  height: 100%;
  background-color: var(--bg-editor);
  overflow: hidden;
  border-right: 1px solid var(--border-subtle);
}

.preview-pane {
  display: flex;
  flex-direction: column;
  flex: 45;
  min-width: 280px;
  height: 100%;
  background-color: var(--bg-preview-wrapper);
  overflow: hidden;
}

/* Splitter / Resizer Handle */
.resizer {
  width: 4px;
  cursor: col-resize;
  background-color: var(--border-subtle);
  transition: background-color 0.12s ease;
  position: relative;
  z-index: var(--z-resizer);
  user-select: none;
  touch-action: none;
  flex-shrink: 0;
}

.resizer:hover,
.resizer.is-resizing {
  background-color: var(--border-strong);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-editor);
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
  border: 2px solid var(--bg-editor);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
