body,
html {
  background: #fff;
}

#siteTitle,
body {
  overflow: hidden;
}

* {
  box-sizing: border-box;
  transition:
    background-color 0.2s,
    color 0.2s,
    border-color 0.2s;
}

html.dark {
  background: #0b0b0b;
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  color: #111;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-height: 100dvh;
}

html.dark body {
  background: #0b0b0b;
  color: #e5e5e5;
}

body.initially-hidden {
  visibility: hidden;
}

header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e5e5e5;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.icon-btn,
.menu-card,
aside {
  background: #fff;
}

html.dark header {
  background: rgba(20, 20, 20, 0.9);
  border-color: #333;
}

header .bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0.75rem 1rem;
}

.icon-btn,
.menu-item,
aside,
aside .top {
  display: flex;
}

button {
  appearance: none;
  border: none;
  cursor: pointer;
}

.icon-btn {
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.75rem;
  border: 1px solid #ddd;
  color: #111;
}

.icon-btn:hover {
  background: #f7f7f7;
}

html.dark .icon-btn {
  background: #222;
  border-color: #444;
  color: #eee;
}

html.dark .icon-btn:hover {
  background: #333;
}

#siteTitle {
  justify-self: center;
  font-size: 1.1rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-logo {
  height: 1.5em;
  vertical-align: middle;
}

#sidebarOverlayLeft {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 40;
  display: none;
}

aside {
  position: fixed;
  top: 0;
  left: 0;
  width: 20rem;
  height: 100%;
  border-right: 1px solid #e5e5e5;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
  transform: translateX(-100%);
  transition: transform 0.2s;
  z-index: 50;
  flex-direction: column;
}

html.dark aside {
  background: #000;
  border-color: #333;
  box-shadow: none;
}

aside.active {
  transform: translateX(0);
}

#sidebarOverlayLeft.active {
  display: block;
}

aside .top {
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #e5e5e5;
  display: flex;
}

aside .sidebar-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

html.dark aside .top {
  border-color: #333;
}

#sidebarList {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

#sidebarList a {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  border-radius: 0.25rem;
  color: inherit;
  text-decoration: none;
}

#sidebarList a.active,
#sidebarList a:hover {
  background: #f2f2f2;
}

html.dark #sidebarList a.active,
html.dark #sidebarList a:hover {
  background: #1c1c1c;
}

main {
  flex: 1;
  overflow-y: auto;
}

#contentHtml.hidden,
#messages.hidden {
  display: none;
}

#messages {
  padding: 1.5rem;
}

svg[data-lucide] {
  stroke: currentColor;
  stroke-width: 2;
}

.markdown-body {
  font-size: 14px;
  line-height: 1.6;
}

.markdown-body pre {
  overflow: auto;
}

.msg-bubble {
  overflow-x: auto;
}

img[alt="mascot"] {
  width: 200px;
}

.msg-avatar {
  font-size: 16px;
}

.menu-card {
  position: fixed;
  z-index: 60;
  min-width: 12rem;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.menu-item {
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  align-items: center;
  gap: 0.5rem;
}

#extensionHtmlEditor,
#htmlEditor,
#jsonSchemaEditor {
  outline: 0;
  white-space: pre !important;
  font-size: 11px;
  line-height: 1.5;
}

:not(pre) > code {
  font-size: 85%;
  padding: 0.2em 0.4em;
  margin: 0;
  border-radius: 6px;
  background-color: rgba(175, 184, 193, 0.2);
}

.markdown-body ul {
  list-style: disc;
}

.markdown-body ol {
  list-style: decimal;
}

.markdown-body li {
  display: list-item;
}

.markdown-body li > ol,
.markdown-body li > ul {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
  margin-left: 1rem;
}
