.editor-kyst {
    flex: 1;
    display: flex;
    flex-direction: row;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    width: 100%;
    background-color: transparent;
    height: 100vh;
    overflow: hidden;
}

.editor-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border: 1px solid #ebebeb;
    border-radius: 8px;
    padding: 40px 60px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.editor-summary {
    width: 280px;
    background: white;
    border: 1px solid #ebebeb;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    height: fit-content;
    max-height: calc(100vh - 80px);
    position: sticky;
    top: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.summary-header {
    padding: 16px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-bottom: 1px solid #f5f5f5;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-content {
    overflow-y: auto;
    padding: 8px 0;
}

.summary-item {
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    transition: background 0.2s;
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.summary-item:hover {
    background: #f9f9f9;
}

.summary-item.level-2 {
    padding-left: 28px;
    font-size: 0.82rem;
}

.summary-item.level-3 {
    padding-left: 40px;
    font-size: 0.8rem;
}

.summary-item.level-4 {
    padding-left: 52px;
    font-size: 0.78rem;
}

.summary-item.level-5 {
    padding-left: 64px;
    font-size: 0.76rem;
}

.summary-arrow {
    color: var(--accent);
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.5;
}

.summary-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.block-container {
    position: relative;
}

.alert-icon {
    font-size: 1rem !important;
}

.block-pin-indicator {
    position: absolute;
    left: -30px;
    top: 25%;
    transform: translateY(-50%);
    color: var(--accent);
    font-size: 12px;
    opacity: 0.8;
    pointer-events: none;
    transition: transform 0.2s;
}

.block-controls {
    background: #f7f7f796;
    border: 1px solid #dfdfdf;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-top: -34px;
}

.block-delete-btn {
background: #f7f7f7e6;
    border: 1px solid #e3e3e3;
    color: #e34444;
    cursor: pointer;
    font-size: 16px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.block-delete-btn:hover {
    background: #fff1f0;
}

.pin-btn,
.pin-level-btn {
    background: #f7f7f7e6;
    color: #2c2c2c;
    border: 1px solid #e3e3e3;
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pin-btn:hover,
.pin-level-btn:not(.disabled):hover {
    background: #f0f0f0;
}

.pin-btn.active {
    background: #eef2ff;
    color: var(--accent);
}

.pin-level-display {
    font-size: 10px;
    border-right: 1px solid #e9e9e9;
    font-weight: 600;
    color: #787878;
    display: flex;
    align-items: center;
    min-width: 14px;
    margin-right: 5px;
    padding-right: 5px;
    justify-content: center;
}

.pin-level-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.editor-header {
    margin-bottom: 24px;
}

.doc-title-input {
    width: 100%;
    font-size: 2.5rem;
    font-weight: 700;
    background: transparent;
    border: none;
    color: var(--text-primary);
    outline: none;
}

.editor-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    counter-reset: list-item;
}

.block-wrapper {
    position: relative;
}

.remote-cursors-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
}

.remote-cursor {
    position: absolute;
    top: 4px;
    height: 1.5em;
    transition: left 0.1s ease-out;
}

.cursor-bar {
    width: 2px;
    height: 100%;
    background: var(--accent);
}

.cursor-label {
    position: absolute;
    top: -18px;
    left: -2px;
    background: var(--accent);
    color: white;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 2px;
    white-space: nowrap;
}

.loading {
    color: var(--text-secondary);
    padding: 20px;
    text-align: center;
}

.block-insert-zone {
    height: 8px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -4px 0;
    z-index: 5;
}

.block-insert-btn {
    opacity: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px dashed var(--border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.block-insert-zone:hover .block-insert-btn {
    opacity: 1;
}

.block-insert-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: scale(1.1);
}

.block-insert-zone-bottom {
    height: 40px;
    margin: 0;
    padding-top: 10px;
}

.editor-no-document {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    background: var(--bg-primary);
}

.no-document-content {
    text-align: center;
    padding: 40px;
    max-width: 400px;
}

.no-document-icon {
    color: var(--text-tertiary);
    margin-bottom: 24px;
    opacity: 0.6;
}

.no-document-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.no-document-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}
/* Markdown / Rendered Mode Styles */
.markdown-mode {
    font-family: 'Fira Code', 'Cascadia Code', 'Source Code Pro', monospace;
    color: var(--text-primary);
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 4px;
    padding: 2px 4px;
    white-space: pre-wrap;
    word-break: break-all;
}

.rendered-mode {
    font-family: inherit;
    line-height: 1.6;
}

.rendered-mode p:first-child {
    margin-top: 0;
}

.rendered-mode p:last-child {
    margin-bottom: 0;
}

.rendered-mode p {
    margin-bottom: 0.5em;
}

.rendered-mode h1 { font-size: 2em; font-weight: bold; margin: 0.67em 0; }
.rendered-mode h2 { font-size: 1.5em; font-weight: bold; margin: 0.75em 0; }
.rendered-mode h3 { font-size: 1.17em; font-weight: bold; margin: 0.83em 0; }

.rendered-mode ul, .rendered-mode ol {
    padding-left: 2em;
    margin-bottom: 1em;
}

.rendered-mode li {
    margin-bottom: 0.25em;
}

.rendered-mode code {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: monospace;
}

.rendered-mode blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 1em;
    margin-left: 0;
    color: var(--text-secondary);
    font-style: italic;
}

.manual-save-btn {
    position: absolute;
    right: -30px;
    top: 50%;
    transform: translateY(-50%);
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 100;
    transition: transform 0.1s;
}

.manual-save-btn:hover {
    transform: translateY(-50%) scale(1.1);
    background: #45a049;
}

.alert-editor.rendered-mode p:first-child { margin-top: 0; }
.alert-editor.rendered-mode p:last-child { margin-bottom: 0; }
