body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: var(--bg-color, #f5f5f5);
    transition: background-color 0.3s;
}
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
h1 {
    color: var(--text-color, #333);
    margin: 0;
    transition: color 0.3s;
}
.theme-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}
.theme-selector label {
    font-size: 14px;
    color: var(--label-color, #666);
    transition: color 0.3s;
}
.theme-selector select {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color, #ccc);
    background: var(--select-bg, white);
    color: var(--text-color, #333);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}
.theme-selector select:hover {
    border-color: var(--border-hover, #999);
}
.mermaid-container {
    background-color: var(--container-bg, white);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s;
}
.mermaid {
    display: flex;
    justify-content: center;
}
.hint {
    color: var(--label-color, #666);
    font-size: 14px;
    margin-top: 16px;
    text-align: center;
    transition: color 0.3s;
}

/* Define CSS variables for the modal context (used by shared styles) */
.data-modal {
    --color-surface-hover: #333;
    --color-text-muted: #888;
    --color-text: #d4d4d4;
    --color-accent: #3b82f6;
    --color-border: #444;
    --color-bg: #1e1e1e;
    --color-success-bg: rgba(16, 185, 129, 0.2);
    --color-success: #10b981;
    --radius-sm: 4px;
    --radius-md: 4px;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;

    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    border-radius: 12px;
    width: 80vw;
    max-width: 1200px;
    max-height: 80vh;
    overflow: auto;
    z-index: 1000;
    display: none;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    min-width: 600px;
}
.data-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #444;
}
.data-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.data-modal-title-primary {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}
.data-modal-title-secondary {
    font-size: 11px;
    font-weight: 400;
    color: #666;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}
.data-modal-close {
    cursor: pointer;
    color: #888;
    font-size: 24px;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}
.data-modal-close:hover {
    background: #333;
    color: #fff;
}

/* Include shared format toolbar and tabs styling */
{% include 'stuff/_stuff_format_tabs.css.jinja2' %}

/* Modal content area */
.data-modal-content {
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.5;
}
.data-modal-content.text-content {
    line-height: 1;
    white-space: pre;
    word-wrap: normal;
    overflow-x: auto;
    padding-right: 20px;
}
.data-modal-content.html-content {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 12px;
    border-radius: 4px;
}
.data-modal-content.html-content table {
    border-collapse: collapse;
    width: 100%;
}
.data-modal-content.html-content th,
.data-modal-content.html-content td {
    border: 1px solid #444;
    padding: 8px 12px;
    text-align: left;
}
.data-modal-content.html-content th {
    background: #252a30;
    color: #e0e0e0;
    font-weight: 600;
}
.data-modal-content.html-content tr:hover {
    background: #2a2530;
}
.data-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}
.clickable-stuff {
    cursor: pointer !important;
}
.clickable-stuff:hover {
    filter: brightness(1.1);
}
.data-modal-content.pdf-content {
    min-height: 500px;
}
.data-modal-content.pdf-content iframe {
    width: 100%;
    height: 100%;
    border: none;
    min-height: 500px;
}
.data-modal-content.image-content {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}
.data-modal-content.image-content img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}
