html,
body {
  color: #333;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  font-family: Helvetica, arial, freesans, clean, sans-serif;
  font-size: 1em;
  line-height: 1.5em;
  background-color: #fff;
  overscroll-behavior-y: none;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
  font-size: 1em;
  margin: 0;
  padding: 0;
  font-weight: normal;
}

p {
  margin: 1em;
}

a:link,
a:visited,
a:hover a:active {
  text-decoration: none;
}

img {
  border: none;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  width: 100%;
  background-color: #444;
  font-size: 12px;
  color: #fff;
}

header a:link,
header a:hover,
header a:visited,
header a:active {
  color: #fff;
}

header a:hover {
  text-decoration: underline;
}

#menu-items {
  display: flex;
}

#reset-button {
  margin-left: 16px;
}

#copy-button {
  margin-left: 16px;
}

#sync-button {
  margin-left: 16px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

header input[type="checkbox"] {
  vertical-align: middle;
  margin-right: 4px;
  margin-top: 0px;
}

#github {
  padding-right: 32px;
}

#github img {
  display: block;
  width: 16px;
}

#github a {
  display: block;
  width: 16px;
}

footer {
  padding: 8px;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #fff;
  color: #fff;
  text-align: center;
  justify-content: center;
  align-items: center;
}

#container {
  flex-grow: 1;
  overflow: hidden;
  width: 100%;
  margin: 0 auto;
  background-color: #fff;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
}

#editor-wrapper {
  height: 100%;
}

#editor {
  height: 100%;
}

#preview-wrapper {
  padding: 8px 16px 16px 16px;
}

.column {
  width: 50%;
  padding: 0;
  margin: 0;
  white-space: nowrap;
  vertical-align: top;
}

#preview.column {
  overflow-y: scroll;
  white-space: normal;
}

.split-container {
  display: flex;
  height: 100%;
  width: 100%;
}

.editor-pane,
.preview-pane {
  height: 100%;
}

.split-divider {
  width: 5px;
  background: #ccc;
  cursor: col-resize;
  z-index: 1;
}

.split-divider.hover {
  background: #999;
}

.split-divider.active {
  background: #666;
}

/* Dark theme overrides */
[data-theme="dark"] html,
[data-theme="dark"] body {
  background-color: #212830;
  color: #e6edf3;
}

[data-theme="dark"] header {
  background-color: #333;
  color: #e6edf3;
}

[data-theme="dark"] header a:link,
[data-theme="dark"] header a:hover,
[data-theme="dark"] header a:visited {
  color: #e6edf3;
}

[data-theme="dark"] #container {
  background-color: #212830;
  border-bottom: 1px solid #1f2d3a;
}

[data-theme="dark"] .split-divider {
  background: #30363d;
}

[data-theme="dark"] .split-divider.hover {
  background: #444c56;
}

[data-theme="dark"] .split-divider.active {
  background: #768390;
}

[data-theme="dark"] footer {
  background-color: #333;
}

/* Redesign - Hamburger & Logo */

#header-left {
  display: flex;
  align-items: center;
}

#hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 24px;
  height: 24px;
  cursor: pointer;
  margin-right: 16px;
  z-index: 1001;
  /* Above menu items if absolute */
}

#hamburger-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #fff;
  transition: all 0.3s;
}

#logo a {
  font-weight: bold;
  font-size: 14px;
}

#github-link a {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 32px;
  background-color: #fff;
  color: #444;
  border-radius: 50%;
  font-weight: 900;
  font-size: 18px;
  text-decoration: none;
  margin-right: 16px;
  /* Fix cutoff issue */
}

[data-theme="dark"] #github-link a {
  background-color: #e6edf3;
  color: #333;
}

/* Global Menu Styles (Hamburger always active) */

#menu-items {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 48px;
  left: 0;
  width: 250px;
  background-color: #444;
  padding: 16px;
  z-index: 1000;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-bottom-right-radius: 4px;
}

[data-theme="dark"] #menu-items {
  background-color: #333;
  border: 1px solid #444;
}

#menu-items.show {
  display: flex;
}

#menu-items>div {
  margin: 12px 0;
  margin-left: 0 !important;
  /* Override inline styles */
}

#sync-button {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-left: 0 !important;
}

#sync-button>span {
  margin-left: 0 !important;
}

#import-button {
  margin-left: 0 !important;
}

.menu-row {
  display: flex;
  align-items: center;
}

.menu-row label {
  margin-left: 8px;
  cursor: pointer;
}

/* PDF Export overrides */
.pdf-export pre {
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
  height: auto !important;
  overflow: visible !important;
}

.pdf-export code {
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
  line-height: 1.5 !important;
  height: auto !important;
  display: block !important;
  overflow: visible !important;
}

/* Markdown Preview overrides */
.markdown-body pre,
.markdown-body code {
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
  line-height: 1.5 !important;
}