/* Styles for protocols page */
.protocol-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.protocol-header h1 {
    margin-bottom: 0.25rem;
}

.protocol-header p {
    margin: 0;
    color: #5f6b7a;
}

.protocol-workspace {
    display: grid;
    grid-template-columns: 18rem minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.protocol-main {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.protocol-editor {
    display: grid;
    gap: 1rem;
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    padding: 1rem;
}

.protocol-editor.drop-active {
    border-color: #0070f3;
    background: #f3f8ff;
}

.protocol-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.protocol-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.protocol-canvas {
    display: block;
    min-height: 420px;
    padding: 1.5rem;
    border: 1px solid #d8dee9;
    border-radius: 0 0 8px 8px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
    line-height: 1.55;
    outline: none;
}

.protocol-editor .doc-toolbar {
    border-radius: 8px 8px 0 0;
    border-bottom: 0;
}

.protocol-canvas p,
.protocol-canvas figure {
    margin: 0 0 0.75rem;
}

.protocol-canvas h1,
.protocol-canvas h2,
.protocol-canvas h3 {
    margin: 1rem 0 0.5rem;
}

.protocol-canvas blockquote {
    margin: 0.75rem 0;
    padding-left: 1rem;
    border-left: 3px solid #0070f3;
    color: #475569;
}

.protocol-canvas p:last-child,
.protocol-canvas figure:last-child {
    margin-bottom: 0;
}

.protocol-canvas:empty::before {
    color: #94a3b8;
    content: attr(data-placeholder);
}

.protocol-canvas.drag-over {
    border-color: #0070f3;
    box-shadow: 0 0 0 3px #d7e7ff;
}

.protocol-canvas img {
    display: block;
    max-width: 100%;
    margin: 0.75rem 0;
    border: 1px solid #e6e9ef;
    border-radius: 4px;
}

.attachment-chip {
    display: inline-block;
    margin: 0.25rem 0.35rem 0.25rem 0;
    padding: 0.25rem 0.55rem;
    border: 1px solid #d8dee9;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
}

.protocol-canvas table {
    width: 100%;
    margin: 0.75rem 0;
    border-collapse: collapse;
}

.protocol-canvas td,
.protocol-canvas th {
    min-width: 6rem;
    border: 1px solid #cbd5e1;
    padding: 0.45rem;
}

.protocol-status {
    min-height: 1.25rem;
    margin: 0;
    color: #256029;
}

.protocol-status.error {
    color: #b00020;
}

.protocol-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.protocol-folder-panel {
    position: sticky;
    top: 1rem;
    display: grid;
    gap: 1rem;
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    padding: 1rem;
}

.protocol-folder-header h2 {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
}

.protocol-folder-header p {
    margin: 0;
    color: #5f6b7a;
    font-size: 0.92rem;
}

.protocol-folder-list {
    display: grid;
    gap: 0.45rem;
}

.protocol-folder {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid #d8dee9;
    border-radius: 4px;
    background: #fff;
    color: #1f2a37;
    cursor: pointer;
    text-align: left;
}

.protocol-folder:hover,
.protocol-folder.active {
    border-color: #0070f3;
    background: #f3f8ff;
    color: #0059c1;
}

.protocol-folder-count {
    flex: 0 0 auto;
    min-width: 1.8rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    background: #eef2f7;
    color: #475569;
    font-size: 0.82rem;
    text-align: center;
}

.protocol-item {
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 4px;
    padding: 1rem;
}

.protocol-item h3 {
    margin-top: 0;
}

.protocol-item dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.35rem 0.75rem;
    margin: 0.75rem 0 0;
}

.protocol-item dt {
    color: #5f6b7a;
    font-weight: 700;
}

.protocol-item dd {
    margin: 0;
}

.protocol-body-preview {
    max-height: 9rem;
    overflow: hidden;
    padding: 0.75rem;
    border: 1px solid #eef2f7;
    border-radius: 4px;
    background: #fbfcfe;
    margin-bottom: 0.75rem;
}

@media (max-width: 760px) {
    .protocol-header {
        flex-direction: column;
    }

    .protocol-workspace {
        grid-template-columns: 1fr;
    }

    .protocol-folder-panel {
        position: static;
    }

    .protocol-meta-grid {
        grid-template-columns: 1fr;
    }
}
