/* List Marker Styles */
.pem-list-marker {
    cursor: text;
}

/* Pandoc export command builder */
.pem-pandoc-command-modal {
    max-width: calc(100vw - 48px);
    width: min(1040px, calc(100vw - 48px));
}

.pem-pandoc-export-preview-modal {
    max-width: calc(100vw - 48px);
    width: min(1280px, calc(100vw - 48px));
}

.pem-pandoc-command-modal .modal-content {
    overflow-x: hidden;
}

.pem-pandoc-export-preview-modal .modal-content {
    overflow-x: hidden;
}

.pem-pandoc-command-builder {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    width: 100%;
}

.pem-pandoc-export-preview-layout {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(300px, 0.95fr) minmax(420px, 1.25fr);
    min-width: 0;
}

.pem-pandoc-preview-pane {
    border: 1px solid var(--background-modifier-border);
    border-radius: 8px;
    display: grid;
    grid-template-rows: auto minmax(320px, 1fr);
    height: min(68vh, 760px);
    min-height: min(68vh, 760px);
    min-width: 0;
    overflow: hidden;
}

.pem-pandoc-preview-header {
    align-items: center;
    border-bottom: 1px solid var(--background-modifier-border);
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) max-content minmax(0, 1fr);
    min-height: 38px;
    padding: 6px 10px;
}

.pem-pandoc-preview-toolbar-left,
.pem-pandoc-preview-toolbar-center,
.pem-pandoc-preview-toolbar-right {
    align-items: center;
    display: flex;
    gap: 8px;
    min-width: 0;
}

.pem-pandoc-preview-toolbar-left {
    justify-content: flex-start;
}

.pem-pandoc-preview-toolbar-center {
    justify-content: center;
}

.pem-pandoc-preview-toolbar-right {
    justify-content: flex-end;
}

.pem-pandoc-preview-status {
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.pem-pandoc-preview-toolbar-right button.is-loading {
    min-width: 72px;
    position: relative;
}

.pem-pandoc-preview-toolbar-right button.is-loading::after {
    animation: pem-pandoc-preview-spin 0.8s linear infinite;
    border: 2px solid var(--text-muted);
    border-right-color: transparent;
    border-radius: 50%;
    box-sizing: border-box;
    content: "";
    height: 16px;
    left: calc(50% - 8px);
    position: absolute;
    top: calc(50% - 8px);
    width: 16px;
}

@keyframes pem-pandoc-preview-spin {
    to {
        transform: rotate(360deg);
    }
}

.pem-pandoc-preview-body {
    background: var(--background-primary);
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
}

.pem-pandoc-paged-preview {
    display: grid;
    grid-template-rows: minmax(420px, 1fr);
    height: 100%;
    min-height: 100%;
}

.pem-pandoc-paged-preview-topbar {
    align-items: center;
    border-bottom: 1px solid var(--background-modifier-border);
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) max-content;
    padding: 8px;
}

.pem-pandoc-paged-preview-zoom,
.pem-pandoc-paged-preview-page-controls,
.pem-pandoc-paged-preview-bottombar {
    align-items: center;
    display: flex;
    gap: 8px;
}

.pem-pandoc-paged-preview-zoom {
    justify-self: start;
}

.pem-pandoc-paged-preview-page-controls {
    justify-self: center;
}

.pem-pandoc-paged-preview-zoom button {
    min-width: 32px;
    padding-left: 10px;
    padding-right: 10px;
}

.pem-pandoc-paged-preview-zoom-value {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: var(--text-muted);
    font-size: var(--font-ui-smaller);
    height: 26px;
    padding: 0;
    text-align: center;
    width: 48px;
}

.pem-pandoc-paged-preview-zoom-value:focus {
    background: var(--background-primary);
    box-shadow: 0 0 0 1px var(--interactive-accent);
}

.pem-pandoc-paged-preview-page-controls input {
    width: 64px;
}

.pem-pandoc-paged-preview-page-label,
.pem-pandoc-paged-preview-page-total {
    color: var(--text-muted);
    font-size: var(--font-ui-smaller);
    white-space: nowrap;
}

.pem-pandoc-paged-preview-viewport-shell {
    background: var(--background-secondary);
    box-sizing: border-box;
    min-height: 420px;
    min-width: 0;
    overflow: hidden;
    position: relative;
}

.pem-pandoc-paged-preview-viewport {
    box-sizing: border-box;
    height: 100%;
    min-height: 420px;
    min-width: 0;
    overflow: auto;
    padding: 14px;
    position: relative;
}

.pem-pandoc-paged-preview-stage {
    margin: 0 auto;
    max-width: none;
    transform-origin: top center;
    width: max-content;
    zoom: var(--pem-pandoc-preview-zoom, 1);
}

.pem-pandoc-flow-preview {
    background: var(--background-secondary);
    box-sizing: border-box;
    display: grid;
    gap: 10px;
    grid-template-rows: minmax(0, 1fr);
    height: 100%;
    min-height: 420px;
    min-width: 0;
    overflow: hidden;
    padding: 14px;
}

.pem-pandoc-flow-preview.has-notice {
    grid-template-rows: auto minmax(0, 1fr);
}

.pem-pandoc-flow-preview-notice {
    background: var(--background-primary-alt);
    border: 1px solid var(--text-warning);
    border-radius: 6px;
    box-shadow: inset 3px 0 0 var(--text-warning);
    color: var(--text-warning);
    font-size: var(--font-ui-smaller);
    font-weight: 500;
    line-height: 1.3;
    padding: 7px 10px 7px 12px;
}

.pem-pandoc-flow-preview-viewport {
    min-height: 0;
    overflow: auto;
}

.pem-pandoc-flow-preview-frame {
    background: white;
    display: block;
    height: 100%;
    min-height: 100%;
    width: 100%;
}

.pem-pandoc-flow-preview-text {
    margin: 0;
    min-height: 100%;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.pem-pandoc-scrollable-page {
    background: white;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.18);
    box-sizing: border-box;
    max-width: none;
    overflow: auto;
}

.pem-pandoc-paged-preview-stage > .pem-pandoc-odt-preview {
    height: var(--pem-pandoc-page-height);
    max-width: none;
    overflow: hidden;
    width: var(--pem-pandoc-page-width);
}

.pem-pandoc-paged-preview .is-hidden {
    display: none !important;
}

.pem-pandoc-paged-preview-side-nav-overlay {
    inset: 0;
    pointer-events: none;
    position: absolute;
    z-index: 2;
}

.pem-pandoc-paged-preview-side-nav-zone {
    bottom: 0;
    pointer-events: auto;
    position: absolute;
    top: 0;
    width: 20%;
}

.pem-pandoc-paged-preview-side-nav-zone.is-left {
    left: 0;
}

.pem-pandoc-paged-preview-side-nav-zone.is-right {
    right: 0;
}

.pem-pandoc-paged-preview-side-nav {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: var(--text-muted);
    height: 112px;
    line-height: 1;
    opacity: 0;
    padding: 0;
    pointer-events: none;
    position: absolute;
    top: calc(50% - 56px);
    transition: opacity 120ms ease;
    width: 72px;
    z-index: 2;
}

.pem-pandoc-paged-preview-side-nav svg {
    height: 64px;
    width: 64px;
}

.pem-pandoc-paged-preview-side-nav.is-left {
    left: 8px;
}

.pem-pandoc-paged-preview-side-nav.is-right {
    right: 8px;
}

.pem-pandoc-paged-preview.is-hovering-left .pem-pandoc-paged-preview-side-nav.is-left:not(:disabled),
.pem-pandoc-paged-preview.is-hovering-right .pem-pandoc-paged-preview-side-nav.is-right:not(:disabled),
.pem-pandoc-paged-preview-side-nav-zone.is-left:hover .pem-pandoc-paged-preview-side-nav.is-left:not(:disabled),
.pem-pandoc-paged-preview-side-nav-zone.is-right:hover .pem-pandoc-paged-preview-side-nav.is-right:not(:disabled) {
    opacity: 0.42 !important;
    pointer-events: auto;
}

.pem-pandoc-paged-preview-side-nav:disabled {
    opacity: 0 !important;
    pointer-events: none;
    transition: none;
}

.pem-pandoc-paged-preview-side-nav:hover:not(:disabled) {
    opacity: 0.72 !important;
}

.pem-pandoc-paged-preview-stage > .pem-pandoc-docx-preview {
    background: transparent;
    overflow: visible;
    padding: 0;
}

.pem-pandoc-paged-preview .pem-pandoc-pptx-page-shell {
    max-width: none;
    width: var(--pem-pandoc-page-width);
}

.pem-pandoc-preview-frame,
.pem-pandoc-preview-object,
.pem-pandoc-odt-preview {
    border: 0;
    box-sizing: border-box;
    display: block;
    height: 100%;
    min-height: 520px;
    max-width: 100%;
    width: 100%;
}

.pem-pandoc-preview-text {
    font-family: var(--font-monospace);
    font-size: var(--font-ui-small);
    margin: 0;
    min-height: 100%;
    overflow: auto;
    padding: 12px;
    white-space: pre-wrap;
}

.pem-pandoc-preview-message {
    color: var(--text-muted);
    margin: 12px;
}

.pem-pandoc-pdf-pages,
.pem-pandoc-docx-preview {
    background: var(--background-secondary);
    display: grid;
    gap: 14px;
    justify-content: center;
    min-width: 0;
    overflow-x: hidden;
    padding: 14px;
}

.pem-pandoc-pdf-page,
.pem-pandoc-docx-page-shell {
    background: white;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.18);
    height: auto;
}

.pem-pandoc-pdf-page {
    max-width: 100%;
}

.pem-pandoc-docx-preview section.pem-pandoc-docx {
    box-sizing: border-box;
    max-width: none;
}

.pem-pandoc-docx-preview .pem-pandoc-docx-wrapper {
    background: transparent !important;
    box-sizing: border-box;
    display: grid !important;
    gap: 14px;
    justify-content: center;
    max-width: 100%;
    min-width: 0;
    padding: 0 !important;
    width: 100%;
}

.pem-pandoc-docx-page-shell {
    display: flex;
    justify-content: center;
    max-width: 100%;
    overflow: hidden;
}

.pem-pandoc-docx-page-fragment {
    background: white;
    box-sizing: border-box;
    flex: 0 0 auto;
    overflow: hidden;
    position: relative;
    transform: scale(var(--pem-pandoc-docx-page-scale, 1));
    transform-origin: top center;
}

.pem-pandoc-docx-page-viewport {
    background: white;
    box-sizing: border-box;
    overflow: hidden;
    position: absolute;
}

.pem-pandoc-docx-page-viewport > section.pem-pandoc-docx {
    flex: 0 0 auto;
    margin-bottom: 0 !important;
    position: absolute;
}

.pem-pandoc-preview-controls {
    align-items: center;
    border-bottom: 1px solid var(--background-modifier-border);
    display: flex;
    gap: 8px;
    padding: 8px;
}

.pem-pandoc-preview-counter {
    color: var(--text-muted);
    font-size: var(--font-ui-smaller);
}

.pem-pandoc-epub-preview,
.pem-pandoc-pptx-preview {
    display: grid;
    grid-template-rows: auto minmax(420px, 1fr);
    min-height: 100%;
}

.pem-pandoc-epub-viewport {
    min-height: 520px;
    overflow: hidden;
}

.pem-pandoc-pptx-pages {
    background: var(--background-secondary);
    display: grid;
    gap: 14px;
    justify-content: center;
    min-width: 0;
    overflow-x: hidden;
    padding: 14px;
}

.pem-pandoc-pptx-page-shell {
    background: white;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.18);
    display: flex;
    justify-content: center;
    max-width: 100%;
    overflow: hidden;
    width: min(100%, var(--pem-pandoc-page-width));
}

.pem-pandoc-pptx-canvas {
    align-self: start;
    background: white;
    display: block;
    height: auto;
    justify-self: center;
    max-width: none;
    transform: scale(var(--pem-pandoc-pptx-page-scale, 1));
    transform-origin: top center;
}

.pem-pandoc-odt-preview {
    background: white;
}

.pem-pandoc-export-builder {
    min-width: 0;
}

.pem-pandoc-command-panel {
    border: 1px solid var(--background-modifier-border);
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 10px 12px;
}

.pem-pandoc-command-label {
    color: var(--text-muted);
    font-size: var(--font-ui-smaller);
    margin-bottom: 6px;
}

.pem-pandoc-command-preview {
    box-sizing: border-box;
    cursor: text;
    display: block;
    font-size: var(--font-ui-small);
    max-height: 170px;
    max-width: 100%;
    overflow: auto;
    overflow-wrap: anywhere;
    user-select: text;
    -webkit-user-select: text;
    width: 100%;
    white-space: pre-wrap;
    word-break: break-all;
}

.pem-pandoc-preset-section,
.pem-pandoc-option-section {
    border-top: 1px solid var(--background-modifier-border);
    margin-top: 12px;
    padding-top: 8px;
}

.pem-pandoc-preset-section h3,
.pem-pandoc-option-section h3 {
    margin: 0 0 10px;
}

.pem-pandoc-option-summary {
    cursor: pointer;
    list-style-position: inside;
}

.pem-pandoc-option-summary h3 {
    display: inline-block;
    margin: 0;
}

.pem-pandoc-option-section[open] .pem-pandoc-option-summary h3 {
    margin-bottom: 10px;
}

.pem-pandoc-preset-fields {
    align-items: end;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(180px, 1fr);
    margin-bottom: 10px;
}

.pem-pandoc-preset-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.pem-pandoc-preset-field label,
.pem-pandoc-row-type {
    color: var(--text-muted);
    font-size: var(--font-ui-smaller);
}

.pem-pandoc-preset-field input,
.pem-pandoc-preset-field select {
    min-width: 0;
    width: 100%;
}

.pem-pandoc-select-frame {
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
    width: 100%;
}

.pem-pandoc-select-frame::after {
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--text-muted);
    content: "";
    height: 0;
    pointer-events: none;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-35%);
    width: 0;
    z-index: 1;
}

.pem-pandoc-select-frame select {
    appearance: none;
    cursor: pointer;
    padding-right: 36px;
    position: relative;
    width: 100%;
}

.pem-pandoc-preset-select-frame select {
    background-color: var(--background-secondary);
    border-color: var(--interactive-accent);
    font-weight: 500;
}

.pem-pandoc-preset-actions {
    align-items: end;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    margin-bottom: 10px;
    min-width: 0;
}

.pem-pandoc-preset-actions .pem-pandoc-preset-field {
    grid-column: 1 / -1;
}

.pem-pandoc-preset-actions button {
    min-width: 0;
    white-space: nowrap;
    width: 100%;
}

.pem-pandoc-builder-row {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-areas: "key separator value type actions";
    grid-template-columns: minmax(108px, 160px) 10px minmax(60%, 1fr) minmax(44px, 76px) 24px;
    margin-bottom: 8px;
    max-width: 100%;
}

.pem-pandoc-key-input,
.pem-pandoc-key-label,
.pem-pandoc-value-cell input,
.pem-pandoc-value-cell select {
    width: 100%;
}

.pem-pandoc-key-cell {
    display: grid;
    gap: 4px;
    grid-area: key;
    grid-template-columns: minmax(0, 1fr) auto;
    min-width: 0;
    position: relative;
}

.pem-pandoc-key-cell .pem-pandoc-key-input {
    min-width: 0;
}

.pem-pandoc-key-label {
    color: var(--text-muted);
    font-size: var(--font-ui-small);
    line-height: var(--input-height);
    min-width: 0;
}

.pem-pandoc-key-cell > button {
    padding-left: 8px;
    padding-right: 8px;
}

.pem-pandoc-key-suggestions {
    background: var(--background-primary);
    border: 1px solid var(--background-modifier-border);
    border-radius: 6px;
    box-shadow: var(--shadow-s);
    display: none;
    left: 0;
    max-height: 180px;
    overflow-y: auto;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 20;
}

.pem-pandoc-key-suggestions:not(:empty) {
    display: block;
}

.pem-pandoc-key-suggestions button {
    background: transparent;
    border: 0;
    box-shadow: none;
    display: block;
    padding: 6px 8px;
    text-align: left;
    width: 100%;
}

.pem-pandoc-key-suggestions button:hover {
    background: var(--background-modifier-hover);
}

.pem-pandoc-key-suggestions .pem-pandoc-variable-suggestion {
    align-items: baseline;
    display: grid;
    gap: 10px;
    grid-template-columns: max-content minmax(0, 1fr);
}

.pem-pandoc-variable-suggestion-name {
    color: var(--text-normal);
    font-family: var(--font-monospace);
}

.pem-pandoc-variable-suggestion-value {
    color: var(--text-muted);
    font-size: var(--font-ui-smaller);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pem-pandoc-value-cell {
    align-items: center;
    display: flex;
    gap: 6px;
    grid-area: value;
    min-width: 0;
    position: relative;
}

.pem-pandoc-string-input-frame {
    flex: 1 1 auto;
    isolation: isolate;
    min-width: 0;
    position: relative;
}

.pem-pandoc-string-input-frame::before {
    background: var(--background-primary);
    color: var(--text-muted);
    content: "...";
    display: none;
    align-items: center;
    box-sizing: border-box;
    font-size: var(--font-ui-small);
    height: calc(100% - 2px);
    left: 1px;
    line-height: normal;
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 22px, transparent 42px);
    mask-image: linear-gradient(to right, #000 0, #000 22px, transparent 42px);
    padding-left: 7px;
    pointer-events: none;
    position: absolute;
    top: 1px;
    width: 42px;
    z-index: 2;
}

.pem-pandoc-string-input-frame.is-overflowing::before {
    display: flex;
}

.pem-pandoc-string-input-frame.is-overflowing:focus-within::before {
    display: none;
}

.pem-pandoc-string-input-frame.is-display-mode.has-muted-display-prefix::before {
    color: var(--text-faint);
}

.pem-pandoc-string-input-frame .pem-pandoc-string-input {
    box-sizing: border-box;
    direction: ltr;
    position: relative;
    z-index: 0;
}

.pem-pandoc-string-display {
    align-items: center;
    box-sizing: border-box;
    color: var(--text-normal);
    display: none;
    font-size: var(--font-ui-small);
    inset: 0;
    line-height: var(--input-height);
    overflow: hidden;
    padding: 0 10px;
    position: absolute;
    white-space: nowrap;
    z-index: 1;
}

.pem-pandoc-string-input-frame.is-display-mode .pem-pandoc-string-display {
    display: flex;
    justify-content: flex-start;
}

.pem-pandoc-string-input-frame.is-display-mode.is-overflowing .pem-pandoc-string-display {
    justify-content: flex-end;
}

.pem-pandoc-string-display-content {
    flex: 0 0 auto;
    min-width: max-content;
}

.pem-pandoc-string-input-frame.is-display-mode .pem-pandoc-string-input {
    color: transparent;
    caret-color: transparent;
    -webkit-text-fill-color: transparent;
}

.pem-pandoc-string-display-muted {
    color: var(--text-faint);
}

.pem-pandoc-string-input-frame.is-overflowing .pem-pandoc-string-input {
    padding-left: 8px;
    text-align: right;
}

.pem-pandoc-value-cell input,
.pem-pandoc-value-cell select {
    min-width: 0;
}

.pem-pandoc-value-type-select-frame {
    flex: 0 0 112px;
    width: 112px;
}

.pem-pandoc-hybrid-value {
    align-items: center;
    display: flex;
    flex: 1 1 auto;
    gap: 6px;
    min-width: 0;
    position: relative;
}

.pem-pandoc-key-value-control {
    align-items: center;
    display: grid;
    flex: 1 1 auto;
    gap: 6px;
    grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr);
    min-width: 0;
}

.pem-pandoc-output-file-control {
    align-items: center;
    display: grid;
    flex: 1 1 auto;
    gap: 6px;
    grid-template-columns: minmax(0, 1fr) max-content minmax(140px, 0.55fr);
    min-width: 0;
}

.pem-pandoc-output-file-part {
    display: flex;
    min-width: 0;
    position: relative;
}

.pem-pandoc-key-value-separator {
    color: var(--text-muted);
    text-align: center;
}

.pem-pandoc-row-type {
    grid-area: type;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pem-pandoc-row-separator {
    color: var(--text-muted);
    grid-area: separator;
    text-align: center;
}

.pem-pandoc-row-actions {
    grid-area: actions;
    min-width: 24px;
    width: 24px;
}

.pem-pandoc-value-cell button,
.pem-pandoc-row-actions button,
.pem-pandoc-option-section > button {
    white-space: nowrap;
}

.pem-pandoc-row-actions button {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: var(--text-faint);
    height: var(--input-height, 32px);
    padding: 0;
    width: 100%;
}

.pem-pandoc-row-actions button:hover,
.pem-pandoc-row-actions button:focus-visible {
    background: var(--background-modifier-hover);
    color: var(--text-muted);
}

.pem-pandoc-advanced-settings-modal .modal-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pem-pandoc-env-editor h3 {
    font-size: var(--font-ui-medium);
    margin: 0 0 8px;
}

.pem-pandoc-env-table {
    display: grid;
    gap: 8px;
}

.pem-pandoc-env-row {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(128px, 0.35fr) minmax(0, 1fr) 24px;
    position: relative;
}

.pem-pandoc-env-header {
    color: var(--text-muted);
    font-size: var(--font-ui-small);
}

.pem-pandoc-env-row input {
    min-width: 0;
    width: 100%;
}

.pem-pandoc-env-value-cell {
    display: flex;
    min-width: 0;
    position: relative;
}

.pem-pandoc-env-row-actions button {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: var(--text-faint);
    height: var(--input-height, 32px);
    padding: 0;
    width: 24px;
}

.pem-pandoc-env-row-actions button:hover,
.pem-pandoc-env-row-actions button:focus-visible {
    background: var(--background-modifier-hover);
    color: var(--text-muted);
}

@media (max-width: 760px) {
    .pem-pandoc-builder-row {
        grid-template-columns: minmax(96px, 136px) 10px minmax(0, 1fr) minmax(40px, 64px) 24px;
    }

    .pem-pandoc-env-row {
        grid-template-columns: minmax(96px, 0.4fr) minmax(0, 1fr) 24px;
    }
}

.pem-pandoc-validation {
    border-top: 1px solid var(--background-modifier-border);
    margin-top: 12px;
    padding-top: 8px;
}

.pem-pandoc-validation .is-error {
    color: var(--text-error);
}

.pem-pandoc-validation .is-warning {
    color: var(--text-warning);
}

.pem-pandoc-command-footer {
    border-top: 1px solid var(--background-modifier-border);
    margin-top: 12px;
    padding-top: 8px;
}

.pem-pandoc-option-search-modal {
    max-width: calc(100vw - 48px);
    width: min(820px, calc(100vw - 48px));
}

.pem-pandoc-option-search-box {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) max-content max-content;
    margin-bottom: 10px;
}

.pem-pandoc-option-search-box input[type="search"] {
    width: 100%;
}

.pem-pandoc-fuzzy-toggle {
    align-items: center;
    color: var(--text-muted);
    display: inline-flex;
    font-size: var(--font-ui-smaller);
    gap: 6px;
    white-space: nowrap;
}

.pem-pandoc-fuzzy-toggle input[type="checkbox"] {
    flex: 0 0 auto;
    height: var(--checkbox-size, 16px);
    margin: 0;
    min-height: var(--checkbox-size, 16px);
    min-width: var(--checkbox-size, 16px);
    width: var(--checkbox-size, 16px);
}

.pem-pandoc-option-results {
    border-top: 1px solid var(--background-modifier-border);
    max-height: min(52vh, 460px);
    overflow-y: auto;
}

.pem-pandoc-option-result,
.pem-pandoc-option-result-header {
    border-bottom: 1px solid var(--background-modifier-border);
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(140px, 220px) minmax(120px, 160px) minmax(0, 1fr);
    padding: 8px 4px;
}

.pem-pandoc-option-result {
    cursor: pointer;
}

.pem-pandoc-option-result-header {
    background: var(--background-primary);
    color: var(--text-muted);
    font-size: var(--font-ui-smaller);
    font-weight: var(--font-semibold);
    position: sticky;
    top: 0;
    z-index: 1;
}

.pem-pandoc-option-result:hover,
.pem-pandoc-option-result.is-selected {
    background: var(--background-modifier-hover);
}

.pem-pandoc-option-result-key {
    font-family: var(--font-monospace);
}

.pem-pandoc-option-search-highlight {
    background: var(--text-highlight-bg);
    color: inherit;
    font: inherit;
    padding: 0 1px;
}

.pem-pandoc-option-result-type {
    color: var(--text-muted);
    white-space: nowrap;
}

.pem-pandoc-option-result-desc {
    color: var(--text-muted);
    max-height: 8rem;
    overflow-y: auto;
    white-space: pre-wrap;
}

.pem-pandoc-format-modal {
    max-width: calc(100vw - 48px);
    width: min(920px, calc(100vw - 48px));
}

.pem-pandoc-format-panel {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(220px, 0.85fr) minmax(280px, 1.15fr);
    min-width: 0;
}

.pem-pandoc-format-column,
.pem-pandoc-extension-column {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.pem-pandoc-format-field {
    display: grid;
    gap: 6px;
}

.pem-pandoc-format-field label {
    color: var(--text-muted);
    font-size: var(--font-ui-smaller);
}

.pem-pandoc-format-field select {
    width: 100%;
}

.pem-pandoc-format-preview {
    border: 1px solid var(--background-modifier-border);
    border-radius: 6px;
    padding: 10px;
}

.pem-pandoc-format-preview code {
    display: block;
    font-family: var(--font-monospace);
    overflow-wrap: anywhere;
}

.pem-pandoc-extension-column h3 {
    margin: 0;
}

.pem-pandoc-extension-empty {
    color: var(--text-muted);
    margin: 0;
}

.pem-pandoc-format-extension-list {
    border: 1px solid var(--background-modifier-border);
    border-radius: 6px;
    max-height: min(50vh, 420px);
    overflow-y: auto;
}

.pem-pandoc-format-extension-heading {
    background: var(--background-secondary);
    border-bottom: 1px solid var(--background-modifier-border);
    color: var(--text-muted);
    font-size: var(--font-ui-smaller);
    font-weight: 600;
    padding: 6px 8px;
}

.pem-pandoc-format-extension {
    align-items: center;
    border-bottom: 1px solid var(--background-modifier-border);
    display: grid;
    gap: 8px;
    grid-template-columns: 18px minmax(0, 1fr) 28px;
    min-height: 30px;
    padding: 4px 8px;
}

.pem-pandoc-format-extension-section:last-child .pem-pandoc-format-extension:last-child {
    border-bottom: 0;
}

.pem-pandoc-format-extension:not(:has(input:disabled)) {
    cursor: pointer;
}

.pem-pandoc-format-extension input {
    margin: 0;
    width: auto;
}

.pem-pandoc-format-extension-name {
    font-family: var(--font-monospace);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pem-pandoc-extension-help {
    align-items: center;
    border-radius: 50%;
    display: inline-flex;
    font-weight: 600;
    height: 22px;
    justify-content: center;
    min-width: 22px;
    padding: 0;
    width: 22px;
}

.pem-pandoc-extension-detail {
    border: 1px solid var(--background-modifier-border);
    border-radius: 6px;
    display: grid;
    gap: 8px;
    padding: 10px;
}

.pem-pandoc-extension-detail-header {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.pem-pandoc-extension-detail-header code {
    font-family: var(--font-monospace);
    overflow-wrap: anywhere;
}

.pem-pandoc-extension-detail-state {
    color: var(--text-muted);
    font-size: var(--font-ui-smaller);
}

.pem-pandoc-extension-detail p {
    color: var(--text-normal);
    margin: 0;
}

.pem-pandoc-format-extension.is-included,
.pem-pandoc-format-extension.is-incompatible {
    color: var(--text-muted);
}

@media (max-width: 720px) {
    .pem-pandoc-export-preview-layout {
        grid-template-columns: 1fr;
    }

    .pem-pandoc-preview-pane {
        min-height: 420px;
    }

    .pem-pandoc-preset-actions {
        grid-template-columns: 1fr;
    }

    .pem-pandoc-preset-actions .pem-pandoc-preset-field {
        width: 100%;
    }

    .pem-pandoc-builder-row {
        grid-template-areas:
            "key separator"
            "value value"
            "type type"
            "actions actions";
        grid-template-columns: minmax(96px, 1fr) 12px;
    }

    .pem-pandoc-output-file-control {
        grid-template-columns: minmax(0, 1fr) max-content;
    }

    .pem-pandoc-output-file-name-part {
        grid-column: 1 / -1;
    }

    .pem-pandoc-option-search-box {
        grid-template-columns: 1fr;
    }

    .pem-pandoc-option-result {
        gap: 4px;
        grid-template-columns: 1fr;
    }

    .pem-pandoc-format-panel {
        grid-template-columns: 1fr;
    }
}

/* Source-aware unordered list marker styles */
.HyperMD-list-line:not(.cm-active).pem-unordered-list-marker-plus .cm-formatting-list-ul:not(:has(.list-bullet)),
.HyperMD-list-line:not(.cm-active).pem-unordered-list-marker-star .cm-formatting-list-ul:not(:has(.list-bullet)) {
    color: transparent;
    font-size: 0;
}

.HyperMD-list-line.pem-unordered-list-marker-plus .cm-formatting-list-ul .list-bullet,
.HyperMD-list-line.pem-unordered-list-marker-star .cm-formatting-list-ul .list-bullet {
    color: transparent !important;
}

.HyperMD-list-line:not(.cm-active).pem-unordered-list-marker-plus .cm-formatting-list-ul:not(:has(.list-bullet))::before,
.HyperMD-list-line:not(.cm-active).pem-unordered-list-marker-star .cm-formatting-list-ul:not(:has(.list-bullet))::before {
    content: "";
    display: inline-block;
    font-size: var(--font-text-size, 16px);
    width: var(--list-bullet-size);
    min-width: 6px;
    height: var(--list-bullet-size);
    min-height: 6px;
    margin-inline-end: var(--list-bullet-end-padding);
    vertical-align: middle;
}

.HyperMD-list-line:not(.cm-active).pem-unordered-list-marker-plus .cm-formatting-list-ul:not(:has(.list-bullet))::before,
.HyperMD-list-line.pem-unordered-list-marker-plus .cm-formatting-list-ul .list-bullet::after {
    content: "";
    display: inline-block;
    background-color: var(--list-marker-color, var(--text-muted, #8a8a8a));
    border-radius: 1px;
}

.HyperMD-list-line:not(.cm-active).pem-unordered-list-marker-star .cm-formatting-list-ul:not(:has(.list-bullet))::before,
.HyperMD-list-line.pem-unordered-list-marker-star .cm-formatting-list-ul .list-bullet::after {
    content: "";
    display: inline-block;
    background-color: transparent;
    border: 1px solid var(--list-marker-color, var(--text-muted, #8a8a8a));
    border-radius: 50%;
    box-sizing: border-box;
}

.markdown-preview-view li.pem-unordered-list-marker-dash {
    list-style-type: disc;
}

.markdown-preview-view li.pem-unordered-list-marker-plus {
    list-style-type: square;
}

.markdown-preview-view li.pem-unordered-list-marker-star {
    list-style-type: circle;
}

/* Pandoc list spacing enforcement: invalid native lists render as source text */
.markdown-source-view.mod-cm6 .cm-line.pem-pandoc-invalid-native-list {
    padding-inline-start: 0 !important;
    text-indent: 0 !important;
}

.markdown-source-view.mod-cm6 .cm-line.pem-pandoc-invalid-native-list::before {
    content: none !important;
    display: none !important;
}

.markdown-source-view.mod-cm6 .cm-line.pem-pandoc-invalid-native-list .cm-formatting-list,
.markdown-source-view.mod-cm6 .cm-line.pem-pandoc-invalid-native-list .cm-formatting-list .list-bullet {
    color: inherit !important;
    font-size: inherit !important;
}

.markdown-source-view.mod-cm6 .cm-line.pem-pandoc-invalid-native-list .cm-formatting-list::before,
.markdown-source-view.mod-cm6 .cm-line.pem-pandoc-invalid-native-list .cm-formatting-list::after,
.markdown-source-view.mod-cm6 .cm-line.pem-pandoc-invalid-native-list .cm-formatting-list .list-bullet::before,
.markdown-source-view.mod-cm6 .cm-line.pem-pandoc-invalid-native-list .cm-formatting-list .list-bullet::after {
    content: none !important;
    display: none !important;
}

/* Custom Label Placeholder Styles */
.pem-custom-label-placeholder {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: var(--text-muted);
}

/* Inline placeholder number styles */
.pem-inline-placeholder-number {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: var(--text-muted);
    cursor: text;
}

/* Fancy Lists Styles */
.pem-list-upper-alpha {
    list-style-type: upper-alpha;
}

.pem-list-lower-alpha {
    list-style-type: lower-alpha;
}

.pem-list-upper-roman {
    list-style-type: upper-roman;
}

.pem-list-lower-roman {
    list-style-type: lower-roman;
}

.pem-list-paren {
    counter-reset: pem-list;
}

.pem-list-paren > li {
    counter-increment: pem-list;
    list-style: none;
    position: relative;
}

.pem-list-paren > li::before {
    content: counter(pem-list) ") ";
    position: absolute;
    left: -2em;
}

/* Definition Lists Styles */
:where(.pem-definition-list, .cm-pem-definition-term, .cm-pem-definition-paragraph) {
    --pem-definition-list-bg: transparent;
    --pem-definition-list-border-color: transparent;
    --pem-definition-list-border-radius: 0;
    --pem-definition-list-border-style: solid;
    --pem-definition-list-border-width: 0;
    --pem-definition-list-padding: 0;
    --pem-definition-term-align: inherit;
    --pem-definition-term-color: inherit;
    --pem-definition-term-font-size: inherit;
    --pem-definition-term-font-style: normal;
    --pem-definition-term-font-weight: bold;
    --pem-definition-term-text-decoration: underline;
    --pem-definition-desc-align: inherit;
    --pem-definition-desc-color: inherit;
    --pem-definition-desc-font-size: inherit;
    --pem-definition-desc-font-style: normal;
    --pem-definition-desc-font-weight: inherit;
    --pem-definition-desc-indent: 3ch;
    --pem-definition-desc-marker-color: var(--list-marker-color, var(--text-muted));
    --pem-definition-desc-marker-content: "•";
    --pem-definition-desc-text-decoration: none;
}

.markdown-preview-view .pem-definition-list {
    background: var(--pem-definition-list-bg);
    border: var(--pem-definition-list-border-width) var(--pem-definition-list-border-style) var(--pem-definition-list-border-color);
    border-radius: var(--pem-definition-list-border-radius);
    margin: 1em 0;
    padding: var(--pem-definition-list-padding);
}

.markdown-preview-view .pem-definition-term {
    color: var(--pem-definition-term-color);
    font-size: var(--pem-definition-term-font-size);
    font-style: var(--pem-definition-term-font-style);
    font-weight: var(--pem-definition-term-font-weight);
    margin-top: 0.5em;
    margin-bottom: 0.25em;
    text-align: var(--pem-definition-term-align);
    text-decoration: var(--pem-definition-term-text-decoration);
}

.markdown-preview-view .pem-list-definition-desc {
    color: var(--pem-definition-desc-color);
    display: list-item;
    font-size: var(--pem-definition-desc-font-size);
    font-style: var(--pem-definition-desc-font-style);
    font-weight: var(--pem-definition-desc-font-weight);
    list-style-position: outside;
    list-style-type: disc;
    margin-bottom: 0.25em;
    margin-inline-start: var(--pem-definition-desc-indent);
    text-align: var(--pem-definition-desc-align);
    text-decoration: var(--pem-definition-desc-text-decoration);
}

.markdown-preview-view .pem-definition-desc-list {
    list-style-position: outside;
    list-style-type: disc;
    margin: 0;
    padding-inline-start: 0;
}

.markdown-preview-view .pem-definition-desc-item {
    margin-block: var(--list-spacing, 0.075em);
}

.markdown-preview-view .pem-definition-desc-item::marker {
    color: var(--pem-definition-desc-marker-color);
    content: var(--pem-definition-desc-marker-content) " ";
}

.cm-pem-definition-paragraph .pem-list-marker {
    color: var(--pem-definition-desc-marker-color);
}

.pem-definition-items {
    margin-left: 2em;
    margin-top: 0.25em;
    list-style-type: disc;
}

.pem-definition-items li {
    margin: 0.25em 0;
}

/* Definition content paragraphs - override Obsidian's indented text styling */
.cm-pem-definition-paragraph {
    /* No extra padding - indentation handled by spaces/tabs */
    background: var(--pem-definition-list-bg);
    border-color: var(--pem-definition-list-border-color);
    border-radius: var(--pem-definition-list-border-radius);
    border-style: var(--pem-definition-list-border-style);
    border-width: var(--pem-definition-list-border-width);
    color: var(--pem-definition-desc-color);
    font-size: var(--pem-definition-desc-font-size);
    font-style: var(--pem-definition-desc-font-style);
    font-weight: var(--pem-definition-desc-font-weight);
    text-align: var(--pem-definition-desc-align);
    text-decoration: var(--pem-definition-desc-text-decoration);
    text-indent: 0 !important;
}

/* Override code block styling for definition content */
.cm-pem-definition-paragraph .cm-hmd-indented-code,
.cm-pem-definition-paragraph .cm-inline-code,
.pem-definition-content-text {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    color: inherit !important;
    font-family: inherit !important;
    font-size: inherit !important;
}

/* Ensure the indent is visible for proper cursor positioning */
.cm-pem-definition-paragraph .cm-indent {
    opacity: 1;
}

/* In live preview mode */
.cm-line .pem-definition-term {
    color: var(--pem-definition-term-color);
    font-size: var(--pem-definition-term-font-size);
    font-style: var(--pem-definition-term-font-style);
    font-weight: var(--pem-definition-term-font-weight);
    text-decoration: var(--pem-definition-term-text-decoration);
}

:where(.pem-fenced-div),
:where(.cm-pem-fenced-div-line),
:where(.cm-content > .cm-pem-fenced-div-line + .math.math-block.cm-embed-block:has(+ .cm-pem-fenced-div-line)) {
    --pem-fenced-div-accent: var(--interactive-accent);
    --pem-fenced-div-bg: var(--background-secondary);
    --pem-fenced-div-inner-bg: var(--background-primary-alt, var(--background-primary));
    --pem-fenced-div-nest-indent: 1.5em;
    --pem-fenced-div-content-indent: 1.35em;
    --pem-fenced-div-rail-width: 3px;
    --pem-fenced-div-border-color: transparent;
    --pem-fenced-div-border-style: solid;
    --pem-fenced-div-border-width: 0;
    --pem-fenced-div-border-radius: 0;
}

.pem-fenced-div {
    background: var(--pem-fenced-div-bg);
    border: var(--pem-fenced-div-border-width) var(--pem-fenced-div-border-style) var(--pem-fenced-div-border-color);
    border-radius: var(--pem-fenced-div-border-radius);
    box-shadow: inset var(--pem-fenced-div-rail-width) 0 0 var(--pem-fenced-div-accent);
    margin: 1em 0;
    padding: 0.55em 1em 0.7em var(--pem-fenced-div-content-indent);
}

.pem-fenced-div .pem-fenced-div {
    background: var(--pem-fenced-div-inner-bg);
    margin-bottom: 0.4em;
    margin-top: 0.5em;
}

.pem-fenced-div-inner {
    margin-inline-start: var(--pem-fenced-div-nest-indent);
}

.pem-fenced-div > .pem-fenced-div-title {
    display: block;
    margin-bottom: 0.35em;
}

.pem-fenced-div-content > :first-child {
    margin-top: 0;
}

.pem-fenced-div-content > :last-child {
    margin-bottom: 0;
}

/* CodeMirror-specific definition term styling */
.cm-pem-definition-term {
    background: var(--pem-definition-list-bg);
    border-color: var(--pem-definition-list-border-color);
    border-radius: var(--pem-definition-list-border-radius);
    border-style: var(--pem-definition-list-border-style);
    border-width: var(--pem-definition-list-border-width);
    color: var(--pem-definition-term-color);
    font-size: var(--pem-definition-term-font-size);
    font-style: var(--pem-definition-term-font-style);
    font-weight: var(--pem-definition-term-font-weight);
    text-align: var(--pem-definition-term-align);
    text-decoration: var(--pem-definition-term-text-decoration);
}

.cm-pem-fenced-div-line,
.cm-content > .cm-pem-fenced-div-line + .math.math-block.cm-embed-block:has(+ .cm-pem-fenced-div-line) {
    --pem-fenced-div-current-indent: 0px;
    --pem-fenced-div-rail-1: linear-gradient(
            to right,
            transparent 0,
            transparent var(--pem-fenced-div-nest-indent),
            var(--pem-fenced-div-accent) var(--pem-fenced-div-nest-indent),
            var(--pem-fenced-div-accent) calc(var(--pem-fenced-div-nest-indent) + var(--pem-fenced-div-rail-width)),
            var(--pem-fenced-div-inner-bg) calc(var(--pem-fenced-div-nest-indent) + var(--pem-fenced-div-rail-width)),
            var(--pem-fenced-div-inner-bg) 100%
        );
    --pem-fenced-div-rail-2: linear-gradient(
            to right,
            transparent 0,
            transparent calc(var(--pem-fenced-div-nest-indent) * 2),
            var(--pem-fenced-div-accent) calc(var(--pem-fenced-div-nest-indent) * 2),
            var(--pem-fenced-div-accent) calc(var(--pem-fenced-div-nest-indent) * 2 + var(--pem-fenced-div-rail-width)),
            var(--pem-fenced-div-inner-bg) calc(var(--pem-fenced-div-nest-indent) * 2 + var(--pem-fenced-div-rail-width)),
            var(--pem-fenced-div-inner-bg) 100%
        );
    --pem-fenced-div-rail-3: linear-gradient(
            to right,
            transparent 0,
            transparent calc(var(--pem-fenced-div-nest-indent) * 3),
            var(--pem-fenced-div-accent) calc(var(--pem-fenced-div-nest-indent) * 3),
            var(--pem-fenced-div-accent) calc(var(--pem-fenced-div-nest-indent) * 3 + var(--pem-fenced-div-rail-width)),
            var(--pem-fenced-div-inner-bg) calc(var(--pem-fenced-div-nest-indent) * 3 + var(--pem-fenced-div-rail-width)),
            var(--pem-fenced-div-inner-bg) 100%
        );
    --pem-fenced-div-rail-4: linear-gradient(
            to right,
            transparent 0,
            transparent calc(var(--pem-fenced-div-nest-indent) * 4),
            var(--pem-fenced-div-accent) calc(var(--pem-fenced-div-nest-indent) * 4),
            var(--pem-fenced-div-accent) calc(var(--pem-fenced-div-nest-indent) * 4 + var(--pem-fenced-div-rail-width)),
            var(--pem-fenced-div-inner-bg) calc(var(--pem-fenced-div-nest-indent) * 4 + var(--pem-fenced-div-rail-width)),
            var(--pem-fenced-div-inner-bg) 100%
        );
    --pem-fenced-div-rail-5: linear-gradient(
            to right,
            transparent 0,
            transparent calc(var(--pem-fenced-div-nest-indent) * 5),
            var(--pem-fenced-div-accent) calc(var(--pem-fenced-div-nest-indent) * 5),
            var(--pem-fenced-div-accent) calc(var(--pem-fenced-div-nest-indent) * 5 + var(--pem-fenced-div-rail-width)),
            var(--pem-fenced-div-inner-bg) calc(var(--pem-fenced-div-nest-indent) * 5 + var(--pem-fenced-div-rail-width)),
            var(--pem-fenced-div-inner-bg) 100%
        );
    --pem-fenced-div-surface: var(--pem-fenced-div-bg);
    border-inline-end: var(--pem-fenced-div-border-width) var(--pem-fenced-div-border-style) var(--pem-fenced-div-border-color);
    border-inline-start: var(--pem-fenced-div-border-width) var(--pem-fenced-div-border-style) var(--pem-fenced-div-border-color);
    box-shadow: inset var(--pem-fenced-div-rail-width) 0 0 var(--pem-fenced-div-accent) !important;
}

.cm-pem-fenced-div-line {
    background: var(--pem-fenced-div-surface) !important;
    padding-inline-end: 1em;
}

.cm-pem-fenced-div-rail-hover {
    cursor: grab;
}

.cm-pem-fenced-div-dragging,
.cm-pem-fenced-div-dragging .cm-pem-fenced-div-line,
.pem-fenced-div-rail-dragging {
    cursor: grabbing !important;
}

.pem-fenced-div-rail-dragging * {
    cursor: grabbing !important;
}

.pem-fenced-div-drag-ghost {
    border-block-start: 2px solid var(--interactive-accent);
    box-shadow: 0 0 0 1px var(--background-modifier-border), 0 8px 20px rgb(0 0 0 / 12%);
    left: 0;
    max-height: 45vh;
    opacity: 0.58;
    overflow: hidden;
    pointer-events: none;
    position: fixed;
    top: 0;
    transform: translate3d(0, 0, 0);
    transition: transform 90ms ease, opacity 90ms ease;
    z-index: var(--layer-popover, 30);
}

.pem-fenced-div-drag-ghost.is-invalid {
    border-block-start-color: var(--text-error);
    opacity: 0.34;
}

.pem-fenced-div-drop-indicator {
    background: var(--interactive-accent);
    box-shadow: 0 0 0 1px var(--background-primary), 0 0 0 3px color-mix(in srgb, var(--interactive-accent) 22%, transparent);
    height: 2px;
    left: 0;
    pointer-events: none;
    position: fixed;
    top: -1px;
    transform: translate3d(0, 0, 0);
    transition: transform 90ms ease, background-color 90ms ease, opacity 90ms ease;
    z-index: var(--layer-popover, 31);
}

.pem-fenced-div-drop-indicator.is-invalid {
    background: var(--text-error);
    opacity: 0.72;
}

.cm-pem-fenced-div-line:not(.HyperMD-list-line) {
    padding-inline-start: var(--pem-fenced-div-content-indent) !important;
}

.cm-pem-fenced-div-inner,
.cm-content > .cm-pem-fenced-div-inner + .math.math-block.cm-embed-block:has(+ .cm-pem-fenced-div-line) {
    --pem-fenced-div-current-indent: var(--pem-fenced-div-nest-indent);
    --pem-fenced-div-surface: var(--pem-fenced-div-rail-1), var(--pem-fenced-div-bg);
}

.cm-pem-fenced-div-inner:not(.HyperMD-list-line) {
    padding-inline-start: calc(var(--pem-fenced-div-current-indent) + var(--pem-fenced-div-content-indent)) !important;
}

/* Keep the fenced-div rail aligned when themes translate live-preview list lines. */
.cm-pem-fenced-div-line.HyperMD-list-line {
    transform: none !important;
}

/* Preserve Obsidian's native list padding/text-indent and prepend only the fenced-div content offset. */
.cm-pem-fenced-div-line.HyperMD-list-line::before {
    content: "";
    display: inline-block;
    width: calc(
        var(--pem-fenced-div-current-indent) +
        var(--pem-fenced-div-content-indent) +
        var(--adaptive-list-edit-offset, 0px)
    );
}

.cm-pem-fenced-div-depth-3,
.cm-content > .cm-pem-fenced-div-depth-3 + .math.math-block.cm-embed-block:has(+ .cm-pem-fenced-div-line) {
    --pem-fenced-div-current-indent: calc(var(--pem-fenced-div-nest-indent) * 2);
    --pem-fenced-div-surface: var(--pem-fenced-div-rail-2), var(--pem-fenced-div-rail-1), var(--pem-fenced-div-bg);
}

.cm-pem-fenced-div-depth-4,
.cm-content > .cm-pem-fenced-div-depth-4 + .math.math-block.cm-embed-block:has(+ .cm-pem-fenced-div-line) {
    --pem-fenced-div-current-indent: calc(var(--pem-fenced-div-nest-indent) * 3);
    --pem-fenced-div-surface: var(--pem-fenced-div-rail-3), var(--pem-fenced-div-rail-2), var(--pem-fenced-div-rail-1), var(--pem-fenced-div-bg);
}

.cm-pem-fenced-div-depth-5,
.cm-content > .cm-pem-fenced-div-depth-5 + .math.math-block.cm-embed-block:has(+ .cm-pem-fenced-div-line) {
    --pem-fenced-div-current-indent: calc(var(--pem-fenced-div-nest-indent) * 4);
    --pem-fenced-div-surface: var(--pem-fenced-div-rail-4), var(--pem-fenced-div-rail-3), var(--pem-fenced-div-rail-2), var(--pem-fenced-div-rail-1), var(--pem-fenced-div-bg);
}

.cm-pem-fenced-div-depth-6,
.cm-content > .cm-pem-fenced-div-depth-6 + .math.math-block.cm-embed-block:has(+ .cm-pem-fenced-div-line) {
    --pem-fenced-div-current-indent: calc(var(--pem-fenced-div-nest-indent) * 5);
    --pem-fenced-div-surface: var(--pem-fenced-div-rail-5), var(--pem-fenced-div-rail-4), var(--pem-fenced-div-rail-3), var(--pem-fenced-div-rail-2), var(--pem-fenced-div-rail-1), var(--pem-fenced-div-bg);
}

.cm-pem-fenced-div-open {
    border-start-end-radius: var(--pem-fenced-div-border-radius);
    border-start-start-radius: var(--pem-fenced-div-border-radius);
    border-top: var(--pem-fenced-div-border-width) var(--pem-fenced-div-border-style) var(--pem-fenced-div-border-color);
    padding-top: 0.5em;
    padding-bottom: 0.1em;
}

.cm-pem-fenced-div-close {
    border-bottom: var(--pem-fenced-div-border-width) var(--pem-fenced-div-border-style) var(--pem-fenced-div-border-color);
    border-end-end-radius: var(--pem-fenced-div-border-radius);
    border-end-start-radius: var(--pem-fenced-div-border-radius);
    padding-top: 0;
    padding-bottom: 0;
}

.cm-line.cm-pem-fenced-div-close:not(.cm-active):not(.cm-pem-fenced-div-rail-hover) {
    cursor: text;
    height: 0.7em !important;
    line-height: 0.7;
    min-height: 0.7em;
    padding-bottom: 0 !important;
    padding-top: 0 !important;
}

.cm-line.cm-pem-fenced-div-close.cm-active {
    line-height: 1.4;
    min-height: 1.4em;
}

.cm-pem-fenced-div-content {
    padding-top: 0.1em;
    padding-bottom: 0.2em;
}

.cm-content > .cm-pem-fenced-div-line + .math.math-block.cm-embed-block:has(+ .cm-pem-fenced-div-line) {
    background: var(--pem-fenced-div-surface) !important;
    margin: 0;
    padding-bottom: 0.2em !important;
    padding-inline-start: calc(var(--pem-fenced-div-current-indent) + var(--pem-fenced-div-content-indent)) !important;
    padding-inline-end: 1em !important;
    padding-top: 0.1em !important;
}

.cm-line.cm-pem-fenced-div-line :is(.cm-embed-block, .markdown-rendered, .math, .cm-math, mjx-container),
.cm-content > .cm-pem-fenced-div-line + .math.math-block.cm-embed-block:has(+ .cm-pem-fenced-div-line) :is(.markdown-rendered, .math, .cm-math, mjx-container) {
    background: transparent !important;
}

.cm-pem-fenced-div-content-end {
    padding-bottom: 0.5em;
}

.pem-fenced-div-header {
    display: inline-block;
}

.pem-fenced-div-header,
.pem-fenced-div > .pem-fenced-div-title {
    color: var(--text-normal);
    font-weight: 700;
    font-size: var(--font-ui-medium);
    line-height: 1.35;
    margin-inline-start: 0.1em;
    padding-right: 0.3em;
}

.pem-fenced-div-closing {
    display: inline-block;
    height: 0;
    line-height: 1;
    width: 0;
}

.cm-line.cm-pem-fenced-div-open .cm-hashtag,
.cm-line.cm-pem-fenced-div-open .cm-hashtag-begin,
.cm-line.cm-pem-fenced-div-open .cm-hashtag-end,
.cm-line.cm-pem-fenced-div-open [class*="cm-tag-"] {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: inherit !important;
    cursor: text !important;
    font-family: inherit !important;
    font-size: inherit !important;
    padding: 0 !important;
    pointer-events: none !important;
    text-decoration: none !important;
}

.pem-fenced-div-reference {
    color: var(--link-color);
    cursor: pointer;
    font-weight: 600;
}

.pem-fenced-div-reference:hover {
    color: var(--link-color-hover);
    text-decoration: underline;
}

.cm-line .pem-definition-marker {
    display: none;
}

/* Example Lists Styles */
.markdown-preview-view ol.pem-example-list {
    list-style-position: outside;
    list-style-type: decimal;
    padding-inline-start: var(--list-indent, 2em);
}

.markdown-preview-view ol.pem-example-list > li.pem-example-item {
    display: list-item;
    margin: var(--list-spacing, 0.075em) 0;
}

.markdown-preview-view ol.pem-example-list > li.pem-example-item::marker {
    color: var(--list-marker-color, var(--text-muted));
    content: "(" attr(data-example-number) ") ";
}

.markdown-preview-view p.pem-custom-label-item {
    margin: var(--p-spacing, 1rem) 0;
}

.markdown-preview-view p.pem-custom-label-item > strong:first-child {
    color: var(--text-normal);
    display: inline-block;
    margin-inline-end: 0.35em;
    min-width: 2.5em;
}

.markdown-preview-view p.pem-custom-label-item .pem-list-marker {
    color: var(--text-normal);
}

.pem-example-reference {
    color: var(--text-accent);
    cursor: pointer;
}

.pem-example-reference:hover {
    text-decoration: underline;
}

/* Duplicate markers (for both example lists and custom label lists) */
.pem-duplicate-markers {
    color: var(--text-error);
    text-decoration: underline;
    cursor: help;
}

/* Live Preview Mode Specific */
.cm-formatting-list-ol.pem-list-upper-alpha::before {
    content: attr(data-marker);
}

.cm-formatting-list-ol.pem-list-lower-alpha::before {
    content: attr(data-marker);
}

.cm-formatting-list-ol.pem-list-upper-roman::before {
    content: attr(data-marker);
}

.cm-formatting-list-ol.pem-list-lower-roman::before {
    content: attr(data-marker);
}

.cm-formatting-list-ol.pem-example-list::before {
    content: attr(data-original);
}

/* Source Mode - preserve original text */
.is-live-preview:not(.is-readable-line-width) .cm-s-obsidian {
    .pem-list-upper-alpha,
    .pem-list-lower-alpha,
    .pem-list-upper-roman,
    .pem-list-lower-roman,
    .pem-example-list,
    .pem-definition-term,
    .pem-definition-marker {
        all: initial;
        color: inherit;
        font-family: inherit;
        font-size: inherit;
    }
}

/* List Line Indentation - Matching Obsidian's default list behavior */
/* Obsidian already handles text-indent for HyperMD-list-line */
/* We only need to ensure proper padding for alignment */
.HyperMD-list-line.pem-list-line {
    /* Only padding needed - Obsidian handles text-indent internally */
    padding-inline-start: 29px;
}

/* For nested lists */
.HyperMD-list-line-2.pem-list-line {
    padding-inline-start: var(--list-indent-editing, 30px);
}

.pem-list-continuation-widget {
    display: inline-block;
    pointer-events: none;
    white-space: pre;
    width: 0; /* width is set inline by widget */
    flex-shrink: 0;
}

/* Custom Label Reference Clickable */
.pem-custom-label-ref-clickable {
    cursor: pointer;
}

/* Custom Label Lists */
.pem-custom-label-item {
    list-style: none;
    position: relative;
}

/* Example Reference Suggestions */
.pem-suggestion-content {
    padding: 6px 10px;
}

.pem-suggestion-title {
    font-weight: 600;
    color: var(--text-normal);
    margin-bottom: 2px;
}

.pem-suggestion-preview {
    font-size: 0.85em;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.pem-suggestion-number {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    text-decoration-color: var(--text-muted);
}

.pem-suggestion-placeholder {
    font-size: 0.8em;
    color: var(--text-muted);
    opacity: 0.7;
}

/* Superscript and Subscript Styles */
.pem-superscript,
sup.pem-superscript {
    vertical-align: super;
    font-size: 0.85em;
    line-height: 0;
}

.pem-subscript,
sub.pem-subscript {
    vertical-align: sub;
    font-size: 0.85em;
    line-height: 0;
}

/* List Panel View Styles */
.pem-list-panel-view-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 8px;
}

.pem-list-panel-icon-row {
    display: flex;
    flex-direction: row;
    gap: 8px;
    padding: 4px 0;
    margin-bottom: 4px;
}

.pem-list-panel-icon-button {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid var(--background-modifier-border);
    border-radius: 4px;
    background-color: var(--background-primary);
    transition: all 0.2s ease;
}

.pem-list-panel-icon-button:hover {
    background-color: var(--background-modifier-hover);
    border-color: var(--text-accent);
}

.pem-list-panel-icon-button.is-active {
    background-color: var(--interactive-accent);
    border-color: var(--interactive-accent);
}

.pem-list-panel-icon-button.is-active svg {
    color: var(--text-on-accent);
}

.pem-list-panel-icon-button svg {
    width: 20px;
    height: 20px;
}

/* Panel icon container */
.pem-panel-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

/* Text-based icons for panels */
.pem-icon-custom-label,
.pem-icon-example-list,
.pem-icon-definition-list,
.pem-icon-fenced-div,
.pem-icon-footnote {
    font-family: var(--font-monospace);
    font-weight: bold;
    font-size: 10px;
    line-height: 20px;
    color: var(--text-muted);
}

.pem-list-panel-icon-button.is-active .pem-icon-custom-label,
.pem-list-panel-icon-button.is-active .pem-icon-example-list,
.pem-list-panel-icon-button.is-active .pem-icon-definition-list,
.pem-list-panel-icon-button.is-active .pem-icon-fenced-div,
.pem-list-panel-icon-button.is-active .pem-icon-footnote {
    color: var(--text-on-accent);
}

.pem-list-panel-icon-button:hover .pem-icon-custom-label,
.pem-list-panel-icon-button:hover .pem-icon-example-list,
.pem-list-panel-icon-button:hover .pem-icon-definition-list,
.pem-list-panel-icon-button:hover .pem-icon-fenced-div,
.pem-list-panel-icon-button:hover .pem-icon-footnote {
    color: var(--text-normal);
}

.pem-list-panel-separator {
    margin: 8px 0;
    border: none;
    border-top: 1px solid var(--background-modifier-border);
}

.pem-list-panel-content-container {
    flex: 1;
    overflow-y: auto;
}

/* Panel Order Settings Styles */
.pem-panel-order-info {
    flex: 0 0 auto;
    max-width: 200px;
}

.pem-panel-order-container {
    display: flex;
    gap: 12px;
    width: 100%;
}

.pem-panel-order-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 300px;
    border: 1px solid var(--background-modifier-border);
    border-radius: 6px;
    padding: 8px;
}

.pem-panel-order-item {
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pem-panel-order-item.is-selected {
    background-color: var(--interactive-accent);
    color: var(--text-on-accent);
}

.pem-panel-order-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.pem-panel-order-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 140px;
}

.pem-panel-order-button {
    width: 100%;
}

.pem-ordered-list-order-container,
.pem-unordered-list-order-container {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(120px, 150px);
    align-items: flex-start;
    max-width: 100%;
    box-sizing: border-box;
}

.pem-ordered-list-order-list,
.pem-unordered-list-order-list {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.pem-ordered-list-order-container .pem-panel-order-buttons,
.pem-unordered-list-order-container .pem-panel-order-buttons {
    min-width: 0;
    width: 100%;
}

.pem-ordered-list-order-item,
.pem-unordered-list-order-item {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    line-height: 1.35;
}

.pem-ordered-list-order-marker,
.pem-unordered-list-order-marker {
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.pem-ordered-list-order-label,
.pem-unordered-list-order-label {
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: left;
}

/* Custom Label View Styles */
table.custom-label-view-container {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

/* Header styles removed - no longer using header */

tr.custom-label-view-row {
    border-bottom: 1px solid var(--background-modifier-border-hover);
    transition: background-color 0.15s ease;
}

tr.custom-label-view-row:hover {
    background-color: var(--background-modifier-hover);
}

td.custom-label-view-label {
    font-family: var(--font-monospace);
    font-size: 0.9em;
    color: var(--text-accent);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 3px;
    transition: background-color 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 1%;
    min-width: fit-content;
}

td.custom-label-view-label:hover {
    background-color: var(--background-modifier-hover);
}

td.custom-label-view-content {
    font-size: 0.9em;
    color: var(--text-normal);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 3px;
    transition: background-color 0.15s ease;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 4.5em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

/* Normalize paragraph spacing in custom label panel content */
td.custom-label-view-content p {
    margin: 0;
    line-height: 1.3;
}

td.custom-label-view-content p:not(:last-child) {
    margin-bottom: 0.3em;
}

/* Also normalize lists in custom label panel */
td.custom-label-view-content ul,
td.custom-label-view-content ol {
    margin: 0;
    padding-left: 1.2em;
    line-height: 1.3;
}

td.custom-label-view-content ul:not(:last-child),
td.custom-label-view-content ol:not(:last-child) {
    margin-bottom: 0.3em;
}

td.custom-label-view-content li {
    margin: 0;
    line-height: 1.3;
}

td.custom-label-view-content:hover {
    background-color: var(--background-modifier-hover);
    color: var(--text-accent);
}

.custom-label-view-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-style: italic;
}

/* Example List View Styles */
table.pem-example-list-view-container {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

tr.pem-example-list-view-row {
    border-bottom: 1px solid var(--background-modifier-border-hover);
    transition: background-color 0.15s ease;
}

tr.pem-example-list-view-row:hover {
    background-color: var(--background-modifier-hover);
}

td.pem-example-list-view-number {
    font-family: var(--font-monospace);
    font-size: 0.9em;
    color: var(--text-muted);
    cursor: default;
    padding: 6px 8px;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 1%;
    min-width: fit-content;
}

td.pem-example-list-view-label {
    font-family: var(--font-monospace);
    font-size: 0.9em;
    color: var(--text-accent);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 3px;
    transition: background-color 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 1%;
    min-width: fit-content;
}

td.pem-example-list-view-label:hover {
    background-color: var(--background-modifier-hover);
}

td.pem-example-list-view-content {
    font-size: 0.9em;
    color: var(--text-normal);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 3px;
    transition: background-color 0.15s ease;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 4.5em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

/* Normalize paragraph spacing in example list panel content */
td.pem-example-list-view-content p {
    margin: 0;
    line-height: 1.3;
}

td.pem-example-list-view-content p:not(:last-child) {
    margin-bottom: 0.3em;
}

/* Also normalize lists in example list panel */
td.pem-example-list-view-content ul,
td.pem-example-list-view-content ol {
    margin: 0;
    padding-left: 1.2em;
    line-height: 1.3;
}

td.pem-example-list-view-content ul:not(:last-child),
td.pem-example-list-view-content ol:not(:last-child) {
    margin-bottom: 0.3em;
}

td.pem-example-list-view-content li {
    margin: 0;
    line-height: 1.3;
}

td.pem-example-list-view-content:hover {
    background-color: var(--background-modifier-hover);
    color: var(--text-accent);
}

.pem-example-list-view-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-style: italic;
}

/* Definition List View Styles */
table.pem-definition-list-view-container {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875em;
    table-layout: fixed;
}

tr.pem-definition-list-view-row {
    border-bottom: 1px solid var(--background-modifier-border);
    transition: background-color 0.15s ease;
}

tr.pem-definition-list-view-row:hover {
    background-color: var(--background-modifier-hover);
}

td.pem-definition-list-view-term {
    width: 30%;
    padding: 8px;
    font-weight: 600;
    color: var(--text-normal);
    vertical-align: top;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

td.pem-definition-list-view-definitions {
    width: 70%;
    padding: 8px;
    color: var(--text-normal);
    vertical-align: top;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

td.pem-definition-list-view-definitions ul {
    margin: 0;
    padding-left: 1.2em;
    list-style-type: disc;
}

td.pem-definition-list-view-definitions li {
    margin-bottom: 4px;
}

td.pem-definition-list-view-definitions li:last-child {
    margin-bottom: 0;
}

td.pem-definition-list-view-definitions p {
    margin: 0;
    line-height: 1.4;
}

td.pem-definition-list-view-definitions:hover {
    background-color: var(--interactive-hover);
}

.pem-definition-list-view-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-style: italic;
}

/* Fenced Div Panel Styles */
table.pem-fenced-div-panel-container {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

tr.pem-fenced-div-panel-row {
    border-bottom: 1px solid var(--background-modifier-border-hover);
    transition: background-color 0.15s ease;
}

tr.pem-fenced-div-panel-row:hover {
    background-color: var(--background-modifier-hover);
}

td.pem-fenced-div-panel-title {
    width: 1%;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-normal);
    cursor: default;
    padding: 6px 8px;
    vertical-align: top;
    white-space: nowrap;
    overflow: visible;
}

td.pem-fenced-div-panel-label {
    width: 1%;
    font-family: var(--font-monospace);
    font-size: 0.9em;
    color: var(--text-accent);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 3px;
    vertical-align: top;
    white-space: nowrap;
    overflow: visible;
    transition: background-color 0.15s ease;
}

td.pem-fenced-div-panel-label:empty {
    cursor: default;
}

td.pem-fenced-div-panel-label:not(:empty):hover {
    background-color: var(--background-modifier-hover);
}

td.pem-fenced-div-panel-content {
    width: auto;
    font-size: 0.9em;
    color: var(--text-normal);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 3px;
    vertical-align: top;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.3;
    transition: background-color 0.15s ease;
}

td.pem-fenced-div-panel-content p {
    margin: 0;
    line-height: 1.3;
}

td.pem-fenced-div-panel-content p:not(:last-child) {
    margin-bottom: 0.3em;
}

td.pem-fenced-div-panel-content ul,
td.pem-fenced-div-panel-content ol {
    margin: 0;
    padding-left: 1.2em;
    line-height: 1.3;
}

td.pem-fenced-div-panel-content li {
    margin: 0;
    line-height: 1.3;
}

td.pem-fenced-div-panel-content:hover {
    background-color: var(--background-modifier-hover);
    color: var(--text-accent);
}

.pem-fenced-div-panel-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-style: italic;
}

/* Footnote Panel Styles */
table.pem-footnote-panel-container {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

tr.pem-footnote-panel-row {
    border-bottom: 1px solid var(--background-modifier-border);
    transition: background-color 0.15s ease;
}

tr.pem-footnote-panel-row:hover {
    background-color: var(--background-modifier-hover);
}

td.pem-footnote-panel-index {
    font-family: var(--font-monospace);
    font-size: 0.95em;
    color: var(--text-accent);
    cursor: pointer;
    padding: 6px 8px;
    text-align: center;
    white-space: nowrap;
    width: 56px;
}

td.pem-footnote-panel-content {
    font-size: 0.9em;
    color: var(--text-normal);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 3px;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.3;
}

td.pem-footnote-panel-content:hover {
    background-color: var(--background-modifier-hover);
    color: var(--text-accent);
}

.pem-footnote-panel-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-style: italic;
}

/* Hover popover styles */
.pem-hover-popover {
    position: absolute;
    z-index: 1000;
    padding: 8px 12px;
    background-color: var(--background-primary);
    border: 1px solid var(--background-modifier-border);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-size: 0.9em;
}

.pem-hover-popover-label {
    font-family: var(--font-monospace);
    white-space: nowrap;
}

.pem-hover-popover-content {
    max-width: 400px;
    max-height: 300px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Fix excessive line height in popover paragraphs */
.pem-hover-popover p {
    margin: 0;
    line-height: 1.5;
}

.pem-hover-popover p:not(:last-child) {
    margin-bottom: 0.5em;
}

/* Also normalize other block elements that might appear in popovers */
.pem-hover-popover ul,
.pem-hover-popover ol {
    margin: 0;
    padding-left: 1.5em;
    line-height: 1.5;
}

.pem-hover-popover ul:not(:last-child),
.pem-hover-popover ol:not(:last-child) {
    margin-bottom: 0.5em;
}

.pem-hover-popover li {
    margin: 0;
    line-height: 1.5;
}

/* Highlight animation for scrolled-to lines */
@keyframes custom-label-highlight-fade {
    0% {
        background-color: rgba(255, 213, 0, 0.4);
    }
    100% {
        background-color: transparent;
    }
}

.cm-line.custom-label-highlight {
    animation: custom-label-highlight-fade 2s ease-out !important;
    position: relative;
}

/* Custom label hover preview */
.custom-label-hover-preview {
    font-family: var(--font-text);
    line-height: 1.5;
    color: var(--text-normal);
}
