:root{

  --bg: #ffffffff;
  --panel: #3a506b;
  --header: #0b132b;
  --header-border: #1c2541;
  --divider: #3a506b;
  --divider-hover: #5e64f9;
  --text: #ffffff;
  --btn-bg: #3a506b;
  --btn-bg-hover: #4d62c7ff;
  --font-sans: 'Google Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { height: 100%; }

body{
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  height: 100vh;
}

body.dragging {
  cursor: col-resize;
  user-select: none;
}

.app-header{
  background: var(--header);
  border-bottom: 1px solid var(--header-border);
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  z-index: 100;
  flex-shrink: 0;
}
.app-header__inner{
  height: 3.25rem;
  max-width: 75rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.app-title{
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
}

.header-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-group--left, .header-group--right {
  flex: 1;
}
.header-group--center {
  flex: 0 1 auto;
  justify-content: center;
}
.header-group--right {
  display: flex;
  justify-content: flex-end;
}


.view-btn {
  background-color: var(--btn-bg);
  color: var(--text);
  border: none;
  border-radius: 0.375rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  padding: 0 1rem;
}

#btn-toggle-view {
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 7rem;
}

.view-btn.icon-btn {
  padding: 0;
  width: 2.5rem;
}

.view-btn:hover {
  background-color: var(--btn-bg-hover);
}

.view-btn.active {
  background-color: var(--btn-bg-hover);
}

.view-btn.active svg {
  stroke: #ffffff;
}

.view-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: var(--text);
}

.filename-input {
  background-color: #44fae8ff;
  border: none;
  border-radius: 0.375rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  color: #000000;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  width: 10rem;
  transition: box-shadow 0.2s ease;
}

.filename-input::placeholder {
  color: #000000;
  opacity: 0.6;
}

.filename-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--divider-hover);
}


.app-main{
  flex-grow: 1;
  display: flex;
  overflow: hidden;
}

.split-root{
  width: 100%;
  height: 100%;
  margin-top: 5px;
  background: var(--panel);
  display: flex;
  position: relative;
  visibility: hidden;
}

.split-root.initialized {
  visibility: visible;
}


.pane{
  height: 100%;
  background: #ffffff;
  color: #111827;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  min-width: 7.5rem;
  overflow: hidden;
}

.pane--editor, .pane--preview {
  width: 50%;
}


.editor-surface{
  flex: 1;
  min-height: 0;
}

.output-surface{
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  min-height: 0;
}

#editor{
  height: 100%;
  width: 100%;
}

.divider{
  flex: 0 0 0.25rem;
  background: var(--divider);
  transition: background-color .15s ease;
  cursor: col-resize;
  position: relative;
  z-index: 50;
  touch-action: none;
}
.divider:hover{
  background: var(--divider-hover);
}

.divider::before{
  content: "";
  position: absolute;
  top: 0;
  left: -0.5rem;
  width: 1.25rem;
  height: 100%;
  cursor: col-resize;
}

.split-root.mode-edit .pane--preview,
.split-root.mode-edit .divider {
  display: none;
}
.split-root.mode-edit .pane--editor {
  width: 100% !important;
  min-width: 100%;
}

.split-root.mode-preview .pane--editor,
.split-root.mode-preview .divider {
  display: none;
}
.split-root.mode-preview .pane--preview {
  width: 100% !important;
  min-width: 100%;
}


.output-surface::-webkit-scrollbar,
.editor-surface .monaco-scrollable-element::-webkit-scrollbar {
  width: 0.625rem;
  height: 0.625rem;
}

.output-surface::-webkit-scrollbar-track,
.editor-surface .monaco-scrollable-element::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.output-surface::-webkit-scrollbar-thumb,
.editor-surface .monaco-scrollable-element::-webkit-scrollbar-thumb {
  background: #9daabaff;
  border-radius: 0.3125rem;
}

.output-surface::-webkit-scrollbar-thumb:hover,
.editor-surface .monaco-scrollable-element::-webkit-scrollbar-thumb:hover {
  background: #758499ff;
}
