:root {
  --bg: #181818;
  --bg-secondary: #202020;
  --panel: #252525;
  --surface: #2b2b2b;
  --border: #383838;
  --border-soft: #2e2e2e;
  --text: #d4d4d4;
  --text-secondary: #858585;
  --text-dim: #6d6d6d;
  --accent: #4c8dce;
  --danger: #b35a5a;
  --ui: "Inter", "Segoe UI", "SF Pro Text", Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  min-width: 1024px;
  overflow: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: var(--ui);
  font-size: 12.5px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  font-family: inherit;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

::selection {
  color: #fff;
  background: #2f4a63;
}

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 1024px;
}

/* Title bar */

.titlebar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 0 0 38px;
  height: 38px;
  padding: 0 10px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.app-id {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.app-icon {
  width: 17px;
  height: 17px;
  color: var(--accent);
}

.app-icon svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.5;
}

.app-name {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .02em;
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  height: 26px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.breadcrumb::-webkit-scrollbar {
  display: none;
}

.crumb {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  max-width: 230px;
  height: 22px;
  padding: 0 5px;
  overflow: hidden;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  border-radius: 2px;
  font-family: var(--ui);
  font-size: 11.5px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: color .08s, background-color .08s;
}

.crumb:hover {
  color: var(--text);
  background: var(--surface);
}

.crumb.current {
  color: var(--text);
  background: var(--surface);
}

.crumb.file-crumb {
  color: var(--accent);
  cursor: default;
}

.crumb.file-crumb:hover {
  background: transparent;
}

.crumb-sep {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 10px;
  color: #585858;
  font-size: 10px;
  user-select: none;
}

.titlebar-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  transition: color .08s, background-color .08s, border-color .08s;
}

.tool-btn svg {
  width: 14px;
  height: 14px;
}

.tool-btn:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

.tool-btn:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

/* Workspace */

.workspace {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}

.explorer {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
}

.workspace.preview-open .explorer {
  flex: 1 1 50%;
  width: 50%;
}

/* File toolbar */

.explorer-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 38px;
  height: 38px;
  padding: 0 10px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-soft);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 25px;
  padding: 0 7px;
  color: #c4c4c4;
  background: #252525;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-family: var(--ui);
  font-size: 11.5px;
  font-weight: 400;
  cursor: pointer;
  transition: color .08s, background-color .08s, border-color .08s;
}

.back-btn svg {
  width: 13px;
  height: 13px;
}

.back-btn:hover:not(:disabled) {
  color: var(--text);
  background: var(--surface);
  border-color: #484848;
}

.back-btn:disabled {
  color: #585858;
  background: transparent;
  border-color: #303030;
  cursor: default;
}

.toolbar-sep {
  width: 1px;
  height: 16px;
  margin: 0 3px;
  background: var(--border);
}

.folder-mark {
  width: 14px;
  height: 14px;
  color: #9a9a9a;
}

.folder-mark svg {
  width: 14px;
  height: 14px;
}

.folder-title {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-count {
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 400;
  white-space: nowrap;
}

/* File list */

.list-shell {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
}

.file-list-head,
.file-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 82px 116px 14px;
  gap: 8px;
  align-items: center;
}

.file-list-head {
  flex: 0 0 26px;
  height: 26px;
  padding: 0 12px 0 14px;
  color: var(--text-dim);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-soft);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  user-select: none;
}

.head-size,
.head-date {
  text-align: right;
}

.file-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg);
}

.file-row {
  position: relative;
  height: 30px;
  padding: 0 12px 0 14px;
  border-bottom: 1px solid #232323;
  color: var(--text);
  cursor: default;
  outline: none;
  user-select: none;
  transition: background-color .08s;
}

.file-row:hover {
  background: #202020;
}

.file-row.selected {
  background: #252525;
}

.file-row.selected::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--accent);
  content: "";
}

.file-row:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

.file-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #858585;
}

.file-icon svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.5;
}

.file-row.is-dir .file-icon {
  color: #b0b0b0;
}

.file-icon.kind-pdf {
  color: #b37c7c;
}

.file-icon.kind-code {
  color: #7fa3c4;
}

.file-icon.kind-markdown {
  color: #96a4b2;
}

.file-icon.kind-image {
  color: #86a58a;
}

.file-icon.kind-audio {
  color: #ad9879;
}

.file-icon.kind-video {
  color: #a58c9d;
}

.file-icon.kind-text {
  color: #8d8d8d;
}

.file-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row.is-dir .file-name {
  color: #dedede;
}

.file-row.selected .file-name {
  color: #eeeeee;
}

.file-size,
.file-date {
  overflow: hidden;
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: var(--text-dim);
  opacity: 0;
}

.file-arrow svg {
  width: 11px;
  height: 11px;
}

.file-row.is-dir:hover .file-arrow,
.file-row.is-dir.selected .file-arrow {
  opacity: 1;
}

.file-list::-webkit-scrollbar,
.code-wrap::-webkit-scrollbar,
.markdown-scroll::-webkit-scrollbar,
.pdf-scroll::-webkit-scrollbar,
.preview-body::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.file-list::-webkit-scrollbar-track,
.code-wrap::-webkit-scrollbar-track,
.markdown-scroll::-webkit-scrollbar-track,
.pdf-scroll::-webkit-scrollbar-track,
.preview-body::-webkit-scrollbar-track {
  background: var(--bg);
}

.file-list::-webkit-scrollbar-thumb,
.code-wrap::-webkit-scrollbar-thumb,
.markdown-scroll::-webkit-scrollbar-thumb,
.pdf-scroll::-webkit-scrollbar-thumb,
.preview-body::-webkit-scrollbar-thumb {
  background: #3a3a3a;
  border: 2px solid var(--bg);
}

.file-list::-webkit-scrollbar-thumb:hover,
.code-wrap::-webkit-scrollbar-thumb:hover,
.markdown-scroll::-webkit-scrollbar-thumb:hover,
.pdf-scroll::-webkit-scrollbar-thumb:hover,
.preview-body::-webkit-scrollbar-thumb:hover {
  background: #4a4a4a;
}

.file-list {
  scrollbar-width: thin;
  scrollbar-color: #3a3a3a var(--bg);
}

.empty-state {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 24px;
  text-align: center;
}

.empty-icon {
  width: 28px;
  height: 28px;
  margin-bottom: 3px;
  color: #5c5c5c;
  stroke-width: 1.3;
}

.empty-state p {
  margin: 0;
  color: #a0a0a0;
  font-size: 12.5px;
}

.empty-state span {
  color: var(--text-dim);
  font-size: 10.5px;
}

.loading-state,
.list-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 20px;
  color: var(--text-secondary);
  font-size: 11.5px;
}

.list-error {
  flex-direction: column;
  gap: 10px;
  color: #b08080;
  text-align: center;
}

.list-error a {
  color: var(--accent);
  text-decoration: none;
}

.list-error a:hover {
  text-decoration: underline;
}

.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 26px;
  height: 26px;
  padding: 0 12px;
  color: var(--text-dim);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-soft);
  font-size: 10px;
}

.status-hint {
  color: #666;
}

/* Preview pane */

.preview {
  display: flex;
  flex: 0 0 50%;
  flex-direction: column;
  width: 50%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 46px;
  min-height: 46px;
  padding: 5px 9px 5px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.preview-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.preview-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  color: #8b8b8b;
}

.preview-icon svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.5;
}

.preview-icon.kind-pdf { color: #b37c7c; }
.preview-icon.kind-code { color: #7fa3c4; }
.preview-icon.kind-markdown { color: #96a4b2; }
.preview-icon.kind-image { color: #86a58a; }
.preview-icon.kind-audio { color: #ad9879; }
.preview-icon.kind-video { color: #a58c9d; }
.preview-icon.kind-text { color: #8d8d8d; }

.preview-title-text {
  min-width: 0;
}

.preview-name {
  overflow: hidden;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-path {
  overflow: hidden;
  margin-top: 1px;
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 26px;
  padding: 0 8px;
  color: #bfbfbf;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-family: var(--ui);
  font-size: 10.5px;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color .08s, background-color .08s, border-color .08s;
}

.btn svg {
  width: 13px;
  height: 13px;
}

.btn-raw {
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .04em;
}

.btn-raw:hover {
  color: var(--text);
  background: var(--surface);
  border-color: #484848;
}

.btn-download {
  color: #b8d2e9;
  background: #2a3948;
  border-color: #3d5a76;
}

.btn-download:hover {
  color: #dcebf8;
  background: #314557;
  border-color: var(--accent);
}

.btn-primary {
  color: #dcebf8;
  background: #314557;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: #3a5065;
}

.close-btn {
  color: var(--text-secondary);
}

.close-btn:hover {
  color: #d0a0a0;
  background: #302727;
  border-color: #543c3c;
}

.preview-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  flex: 0 0 auto;
  min-height: 28px;
  padding: 4px 12px;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--mono);
  font-size: 10px;
}

.meta-item {
  white-space: nowrap;
}

.meta-item:first-child {
  color: #b0b0b0;
}

.meta-sep {
  color: #505050;
  user-select: none;
}

.preview-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-secondary);
}

.preview-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  color: var(--text-secondary);
  font-size: 11.5px;
}

.spinner {
  width: 13px;
  height: 13px;
  border: 1.5px solid #3a3a3a;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.preview-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 100%;
  padding: 24px;
  text-align: center;
}

.error-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-bottom: 2px;
  color: var(--danger);
  border: 1px solid #553838;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 14px;
}

.preview-error h3 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.preview-error p {
  max-width: 340px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 11.5px;
  line-height: 1.5;
}

.preview-error .btn {
  margin-top: 8px;
}

.pdf-frame {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--bg);
  border: 0;
}

/* PDF viewer */

.pdf-viewer {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg);
}

.pdf-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 30px;
  height: 30px;
  padding: 0 8px;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.pdf-group {
  display: flex;
  align-items: center;
  gap: 1px;
}

.pdf-group + .pdf-group {
  margin-left: 7px;
  padding-left: 7px;
  border-left: 1px solid #333;
}

.pdf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
  transition: color .08s, background-color .08s;
}

.pdf-btn svg {
  width: 13px;
  height: 13px;
}

.pdf-btn:hover:not(:disabled) {
  color: var(--text);
  background: var(--surface);
}

.pdf-btn.active {
  color: var(--text);
  background: var(--surface);
}

.pdf-btn:disabled {
  color: #4c4c4c;
  cursor: default;
}

.pdf-page-info,
.pdf-zoom-info {
  min-width: 46px;
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 10px;
  text-align: center;
  user-select: none;
}

.pdf-zoom-info {
  min-width: 40px;
}

.pdf-status {
  margin-left: auto;
  padding-right: 2px;
  color: var(--text-dim);
  font-size: 10px;
  user-select: none;
}

.pdf-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: var(--bg);
  scrollbar-width: thin;
  scrollbar-color: #3a3a3a var(--bg);
}

.pdf-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 100%;
  padding: 16px 16px 30px;
}

.pdf-page {
  position: relative;
  flex: 0 0 auto;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
}

.pdf-canvas {
  display: block;
}

.pdf-page-error {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #b08080;
  background: var(--bg-secondary);
  font-size: 11px;
}

/* Code editor */

.code-wrap {
  position: relative;
  height: 100%;
  overflow: auto;
  background: var(--bg-secondary);
  scrollbar-width: thin;
  scrollbar-color: #3a3a3a var(--bg-secondary);
}

.codehilite {
  min-width: 100%;
  margin: 0;
  background: var(--bg-secondary) !important;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  font-variant-ligatures: none;
  tab-size: 4;
}

.codehilite table {
  width: 100%;
  border-spacing: 0;
  border-collapse: collapse;
}

.codehilite td {
  padding: 0;
  vertical-align: top;
}

.codehilite td.linenos {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 1%;
  background: #1b1b1b !important;
  border-right: 1px solid var(--border);
}

.codehilite td.linenos pre {
  padding: 10px 9px 32px 12px;
  background: transparent !important;
  color: #5f5f5f !important;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.84;
  text-align: right;
}

.codehilite td.code pre {
  padding: 10px 18px 32px 12px;
  background: transparent !important;
}

.codehilite pre {
  margin: 0;
  background: transparent !important;
  font-family: var(--mono);
  white-space: pre;
}

.plain-text {
  display: block;
  min-height: 100%;
  margin: 0;
  padding: 12px 16px 40px;
  overflow: auto;
  color: var(--text);
  background: var(--bg-secondary);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 4;
}

.truncated-note {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  color: #b3a07a;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  font-size: 10.5px;
}

/* Media */

.media-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 16px;
  overflow: auto;
  background: var(--bg);
}

.media-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 2px;
}

.media-player {
  width: min(92%, 620px);
  border-radius: 2px;
  background: #111;
}

.media-stage audio {
  width: min(92%, 460px);
}

/* Unsupported */

.unsupported {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 100%;
  padding: 24px;
  text-align: center;
}

.unsupported-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--text-secondary);
}

.unsupported-icon svg {
  width: 28px;
  height: 28px;
}

.unsupported h3 {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.unsupported p {
  max-width: 360px;
  margin: 0 0 4px;
  color: var(--text-secondary);
  font-size: 11.5px;
  line-height: 1.5;
}

/* Markdown */

.markdown-scroll {
  height: 100%;
  overflow: auto;
  background: var(--bg-secondary);
  scrollbar-width: thin;
  scrollbar-color: #3a3a3a var(--bg-secondary);
}

.markdown-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 28px 64px;
  color: #c7c7c7;
  font-size: 12.5px;
  line-height: 1.65;
  overflow-wrap: break-word;
}

.markdown-body > :first-child {
  margin-top: 0 !important;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin: 1.5em 0 .55em;
  color: var(--text);
  font-weight: 600;
  line-height: 1.3;
}

.markdown-body h1 {
  padding-bottom: .32em;
  border-bottom: 1px solid var(--border);
  font-size: 20px;
}

.markdown-body h2 {
  padding-bottom: .28em;
  border-bottom: 1px solid var(--border-soft);
  font-size: 16.5px;
}

.markdown-body h3 { font-size: 14.5px; }
.markdown-body h4 { font-size: 13.5px; }

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body blockquote,
.markdown-body table,
.markdown-body pre {
  margin: 0 0 1em;
}

.markdown-body a {
  color: var(--accent);
  text-decoration: none;
}

.markdown-body a:hover {
  text-decoration: underline;
}

.markdown-body strong {
  color: var(--text);
  font-weight: 600;
}

.markdown-body code {
  padding: 1px 4px;
  color: #d0d0d0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: .88em;
}

.markdown-body pre {
  padding: 10px 12px;
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  line-height: 1.55;
}

.markdown-body pre code {
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  font-size: 10.5px;
}

.markdown-body blockquote {
  padding: 1px 0 1px 11px;
  color: #9c9c9c;
  border-left: 2px solid var(--accent);
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 20px;
}

.markdown-body li + li {
  margin-top: 2px;
}

.markdown-body hr {
  height: 1px;
  margin: 1.5em 0;
  background: var(--border);
  border: 0;
}

.markdown-body img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 2px;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.markdown-body th,
.markdown-body td {
  padding: 5px 8px;
  border: 1px solid var(--border);
  text-align: left;
}

.markdown-body th {
  color: var(--text);
  background: var(--panel);
  font-weight: 600;
}

.markdown-body tr:nth-child(even) td {
  background: #1d1d1d;
}

.markdown-body input[type="checkbox"] {
  margin: 0 5px 0 0;
  vertical-align: middle;
  accent-color: var(--accent);
}

/* Notification */

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  z-index: 100;
  max-width: min(500px, 80vw);
  padding: 7px 11px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 11.5px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity .1s;
}

.toast.visible {
  opacity: 1;
}

.toast.error {
  color: #d6a0a0;
  background: #2b2222;
  border-color: #553838;
}
