/* ========== NOTEBOOK EMBED (inside RevealJS slides) ========== */

.nb-embed-slide {
    text-align: left !important;
}

.nb-embed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.nb-embed-title {
    font-size: 1.3em !important;
    color: var(--accent-purple, #c678dd) !important;
    margin: 0 !important;
}

.nb-embed-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nb-colab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    font-size: 0.6em;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    color: #e5c07b;
    background: rgba(229, 192, 123, 0.12);
    border: 1px solid rgba(229, 192, 123, 0.3);
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
    cursor: pointer;
    white-space: nowrap;
}
.nb-colab-btn:hover {
    background: rgba(229, 192, 123, 0.22);
    border-color: rgba(229, 192, 123, 0.5);
    color: #e5c07b;
    text-decoration: none;
}
.nb-colab-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.nb-view-full-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    font-size: 0.6em;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    color: #61afef;
    background: rgba(97, 175, 239, 0.12);
    border: 1px solid rgba(97, 175, 239, 0.3);
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}
.nb-view-full-btn:hover {
    background: rgba(97, 175, 239, 0.22);
    border-color: rgba(97, 175, 239, 0.5);
    color: #61afef;
    text-decoration: none;
}

/* Scrollable container */
.nb-embed-scroll {
    max-height: 55vh;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(8, 11, 17, 0.7);
    padding: 1rem 1.2rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.nb-embed-scroll::-webkit-scrollbar {
    width: 6px;
}
.nb-embed-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.nb-embed-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}
.nb-embed-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Cells */
.nb-embed-cell {
    margin-bottom: 1rem;
}
.nb-embed-cell:last-child {
    margin-bottom: 0;
}

/* Markdown cells */
.nb-embed-md {
    font-size: 0.68em;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.88);
}
.nb-embed-md h1 {
    font-size: 1.4em !important;
    color: #c678dd !important;
    margin: 0.8rem 0 0.4rem !important;
    text-transform: none !important;
}
.nb-embed-md h2 {
    font-size: 1.15em !important;
    color: #d4a24e !important;
    margin: 0.6rem 0 0.3rem !important;
    text-transform: none !important;
}
.nb-embed-md h3 {
    font-size: 1em !important;
    color: #61afef !important;
    margin: 0.5rem 0 0.2rem !important;
    text-transform: none !important;
}
.nb-embed-md p {
    margin: 0.3rem 0;
}
.nb-embed-md strong {
    color: #fff;
}
.nb-embed-md code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    color: #d4a24e;
}
.nb-embed-md ul, .nb-embed-md ol {
    margin: 0.3rem 0 0.3rem 1.2rem;
    padding: 0;
}
.nb-embed-md li {
    margin: 0.15rem 0;
    font-size: 1em;
}

/* Code cells */
.nb-embed-code {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
    background: rgba(13, 17, 23, 0.8);
}

.nb-embed-code-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    user-select: none;
}
.nb-embed-code-header:hover {
    background: rgba(255, 255, 255, 0.07);
}

.nb-embed-code-toggle {
    font-size: 0.55em;
    color: rgba(255, 255, 255, 0.4);
    transition: transform 0.2s;
}
.nb-embed-code.collapsed .nb-embed-code-toggle {
    transform: rotate(-90deg);
}

.nb-embed-code-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55em;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.04em;
}

.nb-embed-code-source {
    padding: 0.6rem 0.8rem;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62em;
    line-height: 1.5;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.2s;
    max-height: 1500px;
    opacity: 1;
}
.nb-embed-code.collapsed .nb-embed-code-source {
    max-height: 0;
    padding: 0 0.8rem;
    opacity: 0;
    overflow: hidden;
}

.nb-embed-code-source .highlight {
    white-space: pre;
}

/* Scroll hint */
.nb-embed-scroll-hint {
    text-align: center;
    font-size: 0.5em;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 0.4rem;
    font-family: 'DM Sans', sans-serif;
}

/* Mobile */
@media (max-width: 768px) {
    .nb-embed-scroll {
        max-height: 45vh;
        padding: 0.8rem;
    }
    .nb-embed-md { font-size: 0.6em; }
    .nb-embed-code-source { font-size: 0.55em; }
    .nb-embed-header { flex-direction: column; gap: 0.4rem; align-items: flex-start; }
}
