.workspace-leaf-content[data-type="zen-space-view"] .view-content {
	padding: 0px !important;
}

.zen-space-modal-input-container {
    margin-bottom: 15px;
}

.zen-space-modal-input {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid var(--background-modifier-border);
}

.zen-space-modal-button-container {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.nav-folder-title {
    position: relative;
}

.zen-space-button {
    opacity: 0.7;
    cursor: pointer;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    z-index: 1;
    transition: color 0.2s ease-in-out, opacity 0.2s ease-in-out;
    padding: 0px 4px !important;
}

.zen-space-button:hover {
    opacity: 1;
    color: var(--interactive-accent);
}

.nav-folder.has-index-file .zen-space-button,
.nav-folder.zen-space-active .zen-space-button,
.active-zen-space {
    color: var(--interactive-accent) !important;
    opacity: 0.9;
    padding: 0px 4px !important;
}

.nav-folder-title-content {
    padding-right: 30px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zen-space-nav-bar {
    padding: 8px 16px;
    border-bottom: 1px solid var(--background-modifier-border);
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.zen-space-title-container {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zen-space-nav-bar h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text-normal);
    overflow: hidden;
    text-overflow: ellipsis;
}

.zen-space-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.zen-space-controls button {
    flex-shrink: 0;
}

.zen-space-name-container {
	height: fit-content !important;
    max-width: 100%; 
    overflow: hidden;
	text-align: center;
    display: flex
;
}


.zen-space-new-file-button,
.zen-space-new-folder-button,
.zen-space-new-canvas-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent !important;
	box-shadow: 0px 0px 0px 0px transparent !important;
    color: var(--text-muted) !important;
	border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
	padding: 0px 4px !important;
}

.zen-space-new-file-button:hover,
.zen-space-new-folder-button:hover,
.zen-space-new-canvas-button:hover {
    background-color: var(--background-modifier-hover);
    color: var(--text-normal);
}

.zen-space-nav-forward,
.zen-space-nav-back,
.zen-space-sort-button {
    background-color: transparent !important;
	box-shadow: 0px 0px 0px 0px transparent !important;
    color: var(--text-muted) !important;
	border: none;
    cursor: pointer;
    padding: 4px;
}

.zen-space-nav-forward:hover,
.zen-space-nav-back:hover,
.zen-space-sort-button:hover {
    background-color: var(--background-modifier-hover);
    color: var(--text-normal);
}

.zen-space-sort-selector {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
}

.zen-space-sort-label {
    margin-right: 4px;
}

.zen-space-sort-select {
    color: var(--text-normal);
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 12px;
	text-align: center;
}

.zen-space-sort-order {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent !important;
	box-shadow: 0px 0px 0px 0px transparent !important;
    color: var(--text-muted) !important;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.2s ease;
    padding: 0px 6px !important;
}

.zen-space-sort-order:hover {
    color: var(--text-normal);
}

.zen-space-file-list {
    padding: 0 10px;
	padding-bottom: 35px;
}

.zen-space-file-item {
	margin-bottom: var(--size-2-1);
    display: flex;
    border-radius: var(--radius-s);
    cursor: var(--cursor);
    color: var(--nav-item-color);
    font-size: var(--nav-item-size);
    font-weight: var(--nav-item-weight);
    line-height: var(--line-height-tight);
	align-items: center;
	height: 24.5px;
	padding: 2px 6px !important;
    position: relative;
    gap: 5px;
}

/* Depth-based indentation */
.zen-space-depth-0 {
    padding-left: 6px !important;
}

.zen-space-depth-1 {
    padding-left: 36px !important;
}

.zen-space-depth-2 {
    padding-left: 46px !important;
}

.zen-space-depth-3 {
    padding-left: 66px !important;
}

.zen-space-depth-4 {
    padding-left: 86px !important;
}

.zen-space-depth-5 {
    padding-left: 106px !important;
}

.zen-space-file-item .zen-space-folder-item .zen-space-name-container span.zen-space-item-name.zen-space-file-name{
    padding-left: 20px !important;
}

.zen-space-pinned-item {
    background-color: var(--background-secondary-alt);
}

.zen-space-pinned-item {
    font-weight: 700 !important;
}

.zen-space-file-item:hover {
    background-color: var(--background-modifier-hover);
}

.zen-space-item-icon {
    display: flex;
    align-items: center;
    margin-right: 6px;
    color: var(--text-muted);
}

.zen-space-folder-item {
    font-weight: 500;
}

.zen-space-folder-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    margin-right: 1px;
    cursor: pointer;
    transition: transform 0.2s ease;
	position: relative;
	right: 5px;
}

.zen-space-folder-toggle:hover {
    color: var(--text-normal);
}

.zen-space-item-name {
	display: inline-block;
    overflow-wrap: anywhere;
    overflow: hidden;
    white-space: nowrap;
	text-overflow: ellipsis;
    max-width: 100%;
}

.zen-space-file-name {
    margin: 0px;
}

.zen-space-empty-message {
    padding: 10px;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
}

.zen-space-subfolder-container {
    display: none;
}

.zen-space-subfolder-container.zen-space-expanded {
    display: block;
}

.zen-space-extension-badge {
    border-radius: var(--radius-s);
    font-size: 9px;
    font-weight: var(--font-semibold);
    letter-spacing: 0.05em;
    line-height: var(--line-height-normal);
    margin-left: auto;
    padding: 0 var(--size-4-1);
    text-transform: uppercase;
    align-self: center;
    color: var(--nav-file-tag-color);
    background: var(--nav-file-tag-bg);
    margin-top: 1px;
    
}


.workspace-tab-header[data-type="zen-space-view"] .workspace-tab-header-inner-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.workspace-tab-header[data-type="zen-space-view"] .workspace-tab-header-inner-icon svg {
    width: 16px;
    height: 16px;
}

.zen-space-search-container {
    margin: 0 16px 8px;
    position: relative;
}

.zen-space-search-input {
    width: 100%;
    padding: 0px 34px !important;
    border-radius: 4px;
    border: 1px solid var(--background-modifier-border);
    background-color: var(--background-primary);
    color: var(--text-normal);
    font-size: 13px;
}

.zen-space-search-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.zen-space-file-actions {
    display: flex;
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.2s ease;
	position: absolute;
    right: -0.07vw;
    float: right;
	align-items: center;
	background: var(--background-secondary-alt);
	margin-right: 4px;
	height: 24.5px;
}

.zen-space-file-item:hover .zen-space-file-actions {
    opacity: 1;
}

.zen-space-file-action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent !important;
	box-shadow: 0px 0px 0px 0px transparent !important;
    color: var(--text-muted) !important;
    border: none;
    padding: 2px;
    margin-left: 4px;
    border-radius: 3px;
    cursor: pointer;
    padding: 0px 4px !important;
}

.zen-space-file-action-button:hover {
    color: var(--interactive-accent) !important;
    background-color: var(--background-modifier-hover);
}

.zen-space-file-action-button.is-pinned {
    color: var(--interactive-accent) !important;
}

.zen-space-breadcrumbs {
    padding: 4px 15px;
    display: flex;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 12px;
    gap: 4px;
    flex-direction: row;
    align-items: center;
    bottom: 0.1vh;
    position: absolute;
    box-shadow: 0px 0px 1px 0px gray;
    width: 100%;
    left: 0vw;
	background: var(--background-secondary);
	z-index: 2;
	margin-bottom: -1px;
}

.zen-space-breadcrumb-item {
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
}

.zen-space-breadcrumb-item:hover {
    color: var(--text-normal);
    background-color: var(--background-modifier-hover);
}

.zen-space-breadcrumb-separator {
    display: flex;
    align-items: center;
    justify-content: center;
}

.zen-space-pinned-items-container {
    margin-top: 10px;
    margin-bottom: 20px;
}

.zen-space-no-pinned-items {
    color: var(--text-muted);
    font-style: italic;
}

.zen-space-pinned-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}



.zen-space-pinned-path {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zen-space-unpin-button {
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--background-modifier-border);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.zen-space-unpin-button:hover {
    background-color: var(--background-modifier-hover);
    color: var(--text-normal);
}

.theme-dark {
    --zen-grid-bg-color: rgba(50, 50, 50, 0.2);
    --zen-grid-border-color: rgba(80, 80, 80, 0.2);
    --zen-grid-card-bg: rgba(40, 40, 40, 0.4);
    --zen-grid-card-hover-bg: rgba(50, 50, 50, 0.5);
    --zen-grid-accent-1: rgba(65, 135, 230, 0.6);
    --zen-grid-accent-2: rgba(65, 180, 170, 0.6);
    --zen-grid-accent-3: rgba(90, 180, 90, 0.6);
    --zen-grid-accent-4: rgba(180, 180, 70, 0.6);
    --zen-grid-accent-5: rgba(220, 150, 80, 0.6);
    --zen-grid-accent-6: rgba(220, 100, 100, 0.6);
    --zen-grid-accent-7: rgba(200, 100, 200, 0.6);
    --zen-grid-accent-8: rgba(150, 100, 220, 0.6);
    --zen-grid-shadow: rgba(0, 0, 0, 0.15);
    --zen-grid-shadow-hover: rgba(0, 0, 0, 0.25);
}

.theme-light {
    --zen-grid-bg-color: rgba(240, 240, 240, 0.3);
    --zen-grid-border-color: rgba(210, 210, 210, 0.4);
    --zen-grid-card-bg: rgba(250, 250, 250, 0.7);
    --zen-grid-card-hover-bg: rgba(255, 255, 255, 0.9);
    --zen-grid-accent-1: rgba(65, 135, 230, 0.4);
    --zen-grid-accent-2: rgba(65, 180, 170, 0.4);
    --zen-grid-accent-3: rgba(90, 180, 90, 0.4);
    --zen-grid-accent-4: rgba(180, 180, 70, 0.4);
    --zen-grid-accent-5: rgba(220, 150, 80, 0.4);
    --zen-grid-accent-6: rgba(220, 100, 100, 0.4);
    --zen-grid-accent-7: rgba(200, 100, 200, 0.4);
    --zen-grid-accent-8: rgba(150, 100, 220, 0.4);
    --zen-grid-shadow: rgba(0, 0, 0, 0.08);
    --zen-grid-shadow-hover: rgba(0, 0, 0, 0.12);
}

.zen-grid ul {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0;
    margin: 1.5em 0;
    list-style-type: none;
}

.zen-grid ul > li {
    flex: 1 1 calc(33.333% - 12px);
    min-width: 180px;
    position: relative;
    display: flex;
    border-radius: 6px;
    background-color: var(--zen-grid-card-bg);
    border: 1px solid var(--zen-grid-border-color);
    padding: 0;
    margin: 0 !important;
    box-shadow: 0 1px 3px var(--zen-grid-shadow);
    transition: all 0.2s ease;
    overflow: hidden;
}

.zen-grid ul > li .list-bullet:after {
    display: none;
}

.zen-grid ul > li:hover {
    transform: translateY(-2px);
    background-color: var(--zen-grid-card-hover-bg);
    box-shadow: 0 3px 8px var(--zen-grid-shadow-hover);
}

.zen-grid ul > li a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 15px;
    width: 100%;
    text-align: center;
    color: var(--text-normal);
    font-weight: 500;
    text-decoration: none !important;
    line-height: 1.4;
    margin-left: 25px;
}

.zen-grid ul > li::before {
    content: none;
}

.zen-grid ul > li::after {
    content: none;
}

.zen-grid ul > li:nth-of-type(8n+1) {
    border-top: 3px solid var(--zen-grid-accent-1);
}
.zen-grid ul > li:nth-of-type(8n+2) {
    border-top: 3px solid var(--zen-grid-accent-2);
}
.zen-grid ul > li:nth-of-type(8n+3) {
    border-top: 3px solid var(--zen-grid-accent-3);
}
.zen-grid ul > li:nth-of-type(8n+4) {
    border-top: 3px solid var(--zen-grid-accent-4);
}
.zen-grid ul > li:nth-of-type(8n+5) {
    border-top: 3px solid var(--zen-grid-accent-5);
}
.zen-grid ul > li:nth-of-type(8n+6) {
    border-top: 3px solid var(--zen-grid-accent-6);
}
.zen-grid ul > li:nth-of-type(8n+7) {
    border-top: 3px solid var(--zen-grid-accent-7);
}
.zen-grid ul > li:nth-of-type(8n) {
    border-top: 3px solid var(--zen-grid-accent-8);
}

.zen-grid body.simple-zen-grid .zen-grid ul > li:nth-of-type(n) {
    border-top: none;
}

.zen-grid :is(.markdown-preview-view,.markdown-rendered).is-readable-line-width.zen-grid .markdown-preview-sizer>div>ul {
    max-width: 100%;
}

.zen-grid .markdown-source-view.mod-cm6 .cm-content .HyperMD-list-line .cm-hmd-list-indent {
    display: none;
}

.zen-grid .markdown-source-view.mod-cm6 .cm-content .HyperMD-list-line {
    display: inline-block;
    flex: 1 1 calc(33.333% - 12px);
    min-width: 180px;
    margin: 0 6px 12px;
    background-color: var(--zen-grid-card-bg);
    border: 1px solid var(--zen-grid-border-color);
    border-radius: 6px;
    box-shadow: 0 1px 3px var(--zen-grid-shadow);
    transition: all 0.2s ease;
    padding: 20px 15px;
    overflow: hidden;
    box-sizing: border-box;
}

.zen-grid .markdown-source-view.mod-cm6 .cm-content .HyperMD-list-line:hover {
    transform: translateY(-2px);
    background-color: var(--zen-grid-card-hover-bg);
    box-shadow: 0 3px 8px var(--zen-grid-shadow-hover);
}

.zen-grid .markdown-source-view.mod-cm6 .cm-content .HyperMD-list-line .cm-formatting-list {
    display: none;
}

.zen-grid .markdown-source-view.mod-cm6 .cm-content .HyperMD-list-line .cm-list-1 {
    text-align: center;
}

.zen-grid .markdown-source-view.mod-cm6 .cm-content {
    display: flex;
    flex-wrap: wrap;
    padding: 1em 0;
}

@media (max-width: 768px) {
    .zen-grid ul > li,
    .zen-grid .markdown-source-view.mod-cm6 .cm-content .HyperMD-list-line {
        flex: 1 1 calc(50% - 12px);
    }
}

@media (max-width: 480px) {
    .zen-grid ul > li,
    .zen-grid .markdown-source-view.mod-cm6 .cm-content .HyperMD-list-line {
        flex: 1 1 100%;
    }
}

.zen-space-button.active {
    color: var(--interactive-accent);
}

/* 1. Allow long filenames to wrap and show tooltip */
.zen-grid .zen-space-file-list .zen-space-file-item {
  word-break: break-word;
  white-space: normal;
  overflow: visible;
}
.zen-grid .zen-space-file-list .zen-space-file-item .zen-space-item-name {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}
.zen-grid .zen-space-file-list .zen-space-file-item .zen-space-item-name[title] {
  cursor: help;
}

.markdown-preview-section :is(p,div):has(> .cm-formatting-list-ul) {
  margin-left: 1.5em;
}

.zen-space-sort-menu {
  background: var(--background-secondary, #222);
  border: 1px solid var(--background-modifier-border, #444);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  min-width: 220px;
  padding: 6px 0;
  z-index: 9999;
}

.zen-space-sort-menu-item {
  padding: 8px 18px;
  color: var(--text-normal, #fff);
  cursor: pointer;
  font-size: 15px;
  transition: background 0.15s;
  user-select: none;
}

.zen-space-sort-menu-item:hover,
.zen-space-sort-menu-item.is-active {
  background: var(--background-modifier-hover, #333);
  color: var(--interactive-accent, #ffd700);
}



.zen-space-depth-r {
    padding-left: 28px !important;
}

.zen-space-depth-0 {
    padding-left: 6px !important;
}

.zen-space-depth-1 {
    padding-left: 36px !important;
}

.zen-space-depth-2 {
    padding-left: 56px !important;
}

.zen-space-depth-3 {
    padding-left: 76px !important;
}

.zen-space-depth-4 {
    padding-left: 96px !important;
}

.zen-space-depth-5 {
    padding-left: 106px !important;
}