.hero-art {
  min-width: 0;
  padding: 0;
}

.preview-icon-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.preview-icon {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-preview {
  --preview-bg: #1e1e1e;
  --preview-bg-secondary: #161616;
  --preview-bg-hover: #2c2c2c;
  --preview-border: #333333;
  --preview-text: #dcddde;
  --preview-text-strong: #f2f2f2;
  --preview-text-muted: #a0a0a0;
  --preview-text-faint: #929292;
  --preview-accent: #8b6cff;
  --preview-accent-dim: #8b6cff40;
  --preview-selection: #8b6cff59;
  --preview-highlight: #3d8f3d;
  overflow: hidden;
  height: clamp(380px, 29vw, 500px);
  border: 1px solid var(--preview-border);
  border-radius: 7px;
  background: var(--preview-bg);
  box-shadow: 0 18px 48px #00000035, 0 2px 8px #00000020;
  color: var(--preview-text);
  transform: none;
  transition: none;
}

.app-preview ::selection {
  background: var(--preview-selection);
  color: #ffffff;
}

.app-content {
  height: 100%;
  display: grid;
  grid-template-columns: 24px 125px minmax(0, 1fr) 135px;
  background: var(--preview-bg);
  color: var(--preview-text);
}

.app-ribbon,
.app-sidebar {
  background: var(--preview-bg-secondary);
}

.app-ribbon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
  border-right: 1px solid var(--preview-border);
}

.app-ribbon .mini-mark {
  width: 21px;
  height: 21px;
  margin-bottom: 4px;
  border-radius: 5px;
}

.ribbon-button {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 4px;
  color: var(--preview-text-muted);
  font-size: 12px;
  transition: background-color 140ms ease, color 140ms ease;
}

.ribbon-button:hover {
  background: var(--preview-bg-hover);
  color: var(--preview-text);
}

.ribbon-active {
  background: var(--preview-accent-dim);
  color: var(--preview-accent);
}

.ribbon-button.ribbon-active:hover {
  background: var(--preview-bg-hover);
  color: var(--preview-accent);
}

.ribbon-settings {
  margin-top: auto;
}

.app-sidebar {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  border-right: 1px solid var(--preview-border);
  color: var(--preview-text);
}

.sidebar-header {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--preview-border);
}

.sidebar-heading {
  margin-right: auto;
  color: var(--preview-text-faint);
  font-size: 7px;
  font-weight: 600;
}

.sidebar-action {
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  color: var(--preview-text-muted);
  font-size: 10px;
  border-radius: 4px;
  transition: background-color 140ms ease, color 140ms ease;
}

.sidebar-action:hover {
  background: var(--preview-bg-hover);
  color: var(--preview-text);
}

.file-tree {
  flex: 1;
  overflow: hidden;
  padding: 6px 4px 30px;
}

.file-row {
  display: flex;
  min-width: 0;
  min-height: 22px;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--preview-text-muted);
  font-size: 8px;
  white-space: nowrap;
  transition: background-color 140ms ease, color 140ms ease;
}

.file-row:not(.folder-row):hover {
  background: var(--preview-bg-hover);
  color: var(--preview-text);
}

.folder-row {
  color: var(--preview-text);
}

.folder-spaced {
  margin-top: 4px;
}

.file-child {
  margin-left: 8px;
}

.selected-file {
  background: var(--preview-accent-dim);
  color: var(--preview-text-strong);
}

.tree-chevron {
  width: 8px;
  height: 8px;
  color: var(--preview-text-faint);
}

.file-glyph {
  width: 11px;
  height: 11px;
  color: var(--preview-text-muted);
  font-size: 9px;
}

.vault-switch {
  display: flex;
  min-height: 31px;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-top: 1px solid var(--preview-border);
  color: var(--preview-text);
  font-size: 8px;
  font-weight: 600;
  transition: background-color 140ms ease, color 140ms ease;
}

.vault-switch:hover {
  background: var(--preview-bg-hover);
  color: var(--preview-text-strong);
}

.vault-name {
  flex: 1;
}

.vault-chevron {
  width: 11px;
  height: 11px;
  color: var(--preview-text-faint);
}

.editor-pane {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: var(--preview-bg);
}

.tab-bar {
  display: flex;
  min-height: 27px;
  flex-shrink: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--preview-border);
  background: var(--preview-bg-secondary);
}

.tab-item {
  display: flex;
  min-width: 100px;
  max-width: 150px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border-right: 1px solid var(--preview-border);
  color: var(--preview-text-muted);
  font-size: 8px;
  transition: background-color 140ms ease, color 140ms ease;
}

.tab-item:not(.active):hover {
  background: var(--preview-bg-hover);
  color: var(--preview-text);
}

.tab-item.active {
  position: relative;
  background: var(--preview-bg);
  color: var(--preview-text);
  box-shadow: inset 0 2px 0 var(--preview-accent);
}

.tab-file-icon {
  color: var(--preview-text-muted);
}

.tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-close {
  display: grid;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  place-items: center;
  border-radius: 3px;
  color: var(--preview-text-muted);
}

.tab-close .preview-icon {
  width: 10px;
  height: 10px;
}

.note-header {
  display: flex;
  flex-wrap: wrap;
  min-height: 36px;
  flex-shrink: 0;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-bottom: 1px solid var(--preview-border);
}

.note-title {
  min-width: 80px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--preview-text-strong);
  font-size: 9px;
  font-weight: 600;
}

.note-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.note-action-label,
.note-action-icon {
  display: grid;
  min-height: 18px;
  place-items: center;
  padding: 2px 4px;
  border-radius: 4px;
  color: var(--preview-text-muted);
  font-size: 6.5px;
  white-space: nowrap;
  transition: background-color 140ms ease, color 140ms ease;
}

.note-action-label:hover,
.note-action-icon:hover {
  background: var(--preview-bg-hover);
  color: var(--preview-text);
}

.note-action-icon {
  width: 18px;
  padding: 2px;
}

.mode-select {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 5px;
  border: 1px solid var(--preview-border);
  border-radius: 4px;
  background: var(--preview-bg-secondary);
  color: var(--preview-text);
  font-size: 6.5px;
  white-space: nowrap;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.mode-select:hover {
  border-color: var(--preview-text-muted);
  background: var(--preview-bg-hover);
}

.preview-properties {
  display: flex;
  min-height: 25px;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-bottom: 1px solid var(--preview-border);
  color: var(--preview-text-muted);
  font-size: 7px;
}

.preview-properties .preview-icon {
  width: 9px;
  height: 9px;
}

.visual-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--preview-border);
  background: var(--preview-bg);
}

.visual-toolbar span {
  padding: 2px 4px;
  border: 1px solid var(--preview-border);
  border-radius: 3px;
  color: var(--preview-text-muted);
  font-size: 6px;
  white-space: nowrap;
}

.note-viewport {
  min-height: 0;
  flex: 1;
  overflow: hidden;
  background: var(--preview-bg);
}

.note-document {
  max-width: 460px;
  margin: 0 auto;
  padding: 12px 18px 28px;
  color: var(--preview-text);
  font-size: 9px;
  line-height: 1.55;
}

.note-document .note-title,
.note-document h2,
.note-document h3,
.note-document h4 {
  margin: 1.2em 0 0.45em;
  line-height: 1.3;
}

.note-document .note-title {
  padding-bottom: 0.2em;
  border-bottom: 1px solid var(--preview-border);
  color: var(--preview-text-strong);
  font-size: 1.65em;
  font-weight: 700;
}

.note-document h2 {
  color: #c9b8ff;
  font-size: 1.5em;
}

.note-document h3 {
  color: #9fd3ff;
  font-size: 1.25em;
}

.note-document h4 {
  margin-bottom: 0.2em;
  color: #ffd479;
  font-size: 1.1em;
}

.note-document p {
  margin: 0.5em 0;
}

.note-document strong {
  color: var(--preview-text-strong);
}

.note-document blockquote {
  margin: 0.8em 0;
  padding: 0 1em;
  border-left: 3px solid var(--preview-accent);
  color: var(--preview-text-muted);
}

.note-document mark {
  border-radius: 2px;
  background: var(--preview-highlight);
  color: #ffffff;
}

.note-document u {
  text-underline-offset: 2px;
}

.note-document .document-tag {
  display: flex;
  gap: 5px;
  margin-top: 13px;
}

.document-tag span {
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--preview-accent-dim);
  color: var(--preview-accent);
  font-size: 7px;
}

.app-right-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-left: 1px solid var(--preview-border);
  background: var(--preview-bg-secondary);
}

.panel-tabs {
  display: flex;
  justify-content: center;
  gap: 2px;
  padding: 5px 3px;
  border-bottom: 1px solid var(--preview-border);
}

.panel-tab {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 4px;
  color: var(--preview-text-muted);
}

.panel-tab.active {
  color: var(--preview-accent);
  background: var(--preview-bg-hover);
}

.panel-body {
  flex: 1;
  overflow: hidden;
  padding: 7px;
}

.panel-section-title {
  margin: 8px 2px 5px;
  color: var(--preview-text-faint);
  font-size: 6px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.backlink {
  padding: 6px 5px;
  border-bottom: 1px solid var(--preview-border);
}

.backlink-title {
  margin-bottom: 3px;
  color: var(--preview-text-strong);
  font-size: 7px;
  font-weight: 600;
}

.backlink-snippet {
  color: var(--preview-text-muted);
  font-size: 6px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.status-bar {
  display: flex;
  min-height: 22px;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  padding: 3px 7px;
  border-top: 1px solid var(--preview-border);
  background: var(--preview-bg-secondary);
  color: var(--preview-text-muted);
  font-size: 5.5px;
}

.status-item {
  display: inline-flex;
  align-items: center;
}

@media (max-width: 900px) {
  .app-content {
    grid-template-columns: 24px 118px minmax(0, 1fr) 128px;
  }
}

@media (max-width: 680px) {
  .app-preview {
    height: 340px;
  }

  .app-content {
    grid-template-columns: 22px 110px minmax(0, 1fr);
  }

  .app-right-panel {
    display: none;
  }

  .app-ribbon {
    gap: 3px;
  }

  .ribbon-button {
    width: 20px;
    height: 21px;
  }

  .app-sidebar {
    padding-bottom: 0;
  }

  .sidebar-header {
    min-height: 30px;
    gap: 2px;
    padding-inline: 4px;
  }

  .sidebar-action {
    width: 15px;
    height: 15px;
  }

  .file-row {
    gap: 3px;
    min-height: 19px;
    padding-inline: 4px;
    font-size: 6px;
  }

  .file-child {
    margin-left: 5px;
  }

  .tab-item {
    min-width: 0;
    padding-inline: 7px;
  }

  .note-header {
    align-items: flex-start;
    gap: 3px;
    padding-inline: 5px;
  }

  .note-title {
    flex-basis: 100%;
  }

  .note-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .note-action-label,
  .note-action-icon,
  .visual-toolbar {
    display: none;
  }

  .note-document {
    padding: 9px 10px 22px;
    font-size: 7px;
  }

  .status-bar {
    gap: 2px 5px;
    padding-inline: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-preview,
  .app-preview * {
    transition: none !important;
  }
}
