.bc-editor-page {
    padding: 24px 0 32px;
    color: #1e1e3c;
}

.bc-editor-intro {
    background: linear-gradient(135deg, #402df5, #8f4fff);
    border-radius: 24px;
    padding: 32px;
    margin-bottom: 26px;
    color: #fff;
    overflow: hidden;
    position: relative;
}

.bc-editor-intro::after {
    content: "";
    position: absolute;
    inset: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    pointer-events: none;
}

.bc-editor-intro h1 {
    font-size: 1.95rem;
    margin-bottom: 8px;
    font-weight: 700;
}

.bc-editor-intro p {
    margin-bottom: 0;
    max-width: 680px;
    font-size: 1.05rem;
    opacity: .92;
}

.bc-editor-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.bc-editor-badge {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 6px 16px;
    font-size: .85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.bc-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
    gap: 26px;
    align-items: flex-start;
}

.bc-editor-panel {
    background: #fff;
    border-radius: 22px;
    padding: 24px;
    box-shadow: 0 24px 70px rgba(15, 20, 50, 0.1);
    border: 1px solid #f0f2ff;
    position: relative;
}

.bc-editor-panel header {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.bc-editor-panel header h2 {
    font-size: 1.25rem;
    margin: 0;
    font-weight: 600;
}

.bc-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px;
    border: 1px solid #e2e6f5;
    border-radius: 16px;
    margin-bottom: 18px;
    background: #fdfdff;
}

.bc-editor-toolbar-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding-right: 10px;
    border-right: 1px solid rgba(30, 30, 60, 0.08);
}

.bc-editor-toolbar-group--ai {
    border-right: none;
    padding-right: 0;
    margin-left: auto;
    flex: 0 0 auto;
}

.bc-editor-toolbar-group:last-child {
    border-right: none;
    padding-right: 0;
}

.bc-table-floating {
    position: absolute;
    display: none;
    gap: 8px;
    padding: 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.95);
    box-shadow: 0 12px 30px rgba(31, 38, 135, 0.2);
    z-index: 10;
}

.bc-table-floating.is-visible {
    display: inline-flex;
}

.bc-table-floating .bc-editor-btn {
    min-width: 80px;
    font-size: .85rem;
}

.bc-emoji-panel {
    position: absolute;
    top: -9999px;
    left: -9999px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .15s ease;
    background: #fff;
    border: 1px solid #dedff9;
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 14px 30px rgba(18, 24, 40, 0.2);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 20;
}

.bc-emoji-panel.is-visible {
    opacity: 1;
    visibility: visible;
}

.bc-emoji-group {
    display: flex;
    gap: 6px;
}

.bc-emoji-btn {
    border: none;
    background: #f5f7ff;
    border-radius: 8px;
    font-size: 1.2rem;
    padding: 6px;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease;
}

.bc-emoji-btn:hover {
    transform: translateY(-2px);
    background: #e5e8ff;
}

.bc-editor-btn {
    border: 1px solid transparent;
    background: #f4f6ff;
    color: #2d2a5e;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: .9rem;
    min-width: 34px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .15s ease;
}

.bc-editor-btn i,
.bc-editor-btn span {
    pointer-events: none;
}

.bc-editor-btn:hover {
    background: #2d2a5e;
    color: #fff;
}

.bc-editor-btn.bc-editor-btn--ai {
    position: relative;
    background: linear-gradient(90deg, #6739ff, #d65dff);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 6px 16px;
    gap: 10px;
    flex: 0 0 auto;
    box-shadow: 0 10px 25px rgba(103, 57, 255, 0.35);
    overflow: hidden;
}

.bc-editor-btn.bc-editor-btn--ai::before {
    content: '';
    position: absolute;
    inset: -20% -10%;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0));
    opacity: .6;
    transform: translateX(-50%);
    animation: bc-ai-shine 6s linear infinite;
}

.bc-editor-btn.bc-editor-btn--ai::after {
    content: '✦';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translate(-50%, -50%) scale(1.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.2rem;
    pointer-events: none;
    animation: bc-ai-star 2.4s ease-in-out infinite;
}

.bc-editor-btn.bc-editor-btn--ai:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(103, 57, 255, 0.45);
}

.bc-editor-ai-icon {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    overflow: hidden;
}

.bc-editor-ai-label {
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .03em;
    white-space: nowrap;
}

.bc-editor-btn.bc-editor-btn--ai > * {
    position: relative;
    z-index: 1;
}

@keyframes bc-ai-shine {
    0% {
        transform: translateX(-60%);
        opacity: .3;
    }
    50% {
        transform: translateX(20%);
        opacity: .55;
    }
    100% {
        transform: translateX(80%);
        opacity: .2;
    }
}

@keyframes bc-ai-star {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: .9;
    }
    50% {
        transform: translate(-50%, -60%) scale(1.2);
        opacity: 1;
    }
}

.bc-editor-btn.is-accent {
    background: #ffeeda;
    color: #b35600;
}

.bc-editor-btn.is-danger {
    background: #ffe5ec;
    color: #bf1136;
}

.bc-editor-btn.is-active {
    background: #2f5dff;
    color: #fff;
    border-color: #2f5dff;
    box-shadow: 0 12px 24px rgba(47, 93, 255, 0.25);
}

.bc-editor-btn.is-loading {
    opacity: .6;
    pointer-events: none;
}

.bc-editor-btn.is-disabled {
    opacity: .35;
    pointer-events: none;
}

.bc-editor-btn--gif {
    min-width: 36px;
    padding: 6px;
    display: inline-flex;
}

.bc-icon-gif {
    width: 24px;
    height: 24px;
}

.bc-icon {
    width: 22px;
    height: 22px;
    fill: currentColor;
    display: inline-block;
}

.bc-icon-youtube path {
    fill: currentColor;
}

.bc-icon-lab {
    width: 20px;
    height: 20px;
}

.bc-icon-lab path {
    fill: currentColor;
}

.bc-editor-color {
    border: 1px solid #d3d8f4;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    display: inline-flex;
    align-items: center;
}

.bc-editor-color label {
    font-size: .75rem;
    padding: 2px 10px;
    color: #6a6e92;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.bc-editor-color input[type="color"] {
    border: none;
    width: 42px;
    height: 34px;
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.bc-editor-surface {
    border-radius: 18px;
    border: 1px solid #dfe4fb;
    min-height: 300px;
    max-height: 520px;
    padding: 24px;
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(63, 77, 140, 0.04);
    line-height: var(--bc-editor-line-height, 1.5);
    font-size: 1rem;
    overflow: auto;
    resize: vertical;
}

.bc-editor-surface:focus {
    outline: 2px solid #2f5dff;
    outline-offset: 0;
}

.bc-editor-surface:empty::before {
    content: attr(data-placeholder);
    color: #9ca3c7;
}

.bc-editor-surface.is-hidden {
    display: none;
}

.bc-editor-code {
    display: none;
    width: 100%;
    border-radius: 14px;
    border: 1px solid #dfe4fb;
    padding: 18px;
    min-height: 320px;
    font-family: 'SFMono-Regular', Consolas, Menlo, monospace;
    font-size: .95rem;
    background: #091327;
    color: #f1f1f6;
}

.bc-editor-code.is-active {
    display: block;
}

.bc-editor-status {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    border-radius: 14px;
    border: 1px dashed #d6d8f5;
    background: #fbfbff;
    font-size: .9rem;
    color: #4a4e7a;
}

.bc-editor-status-actions {
    display: inline-flex;
    gap: 10px;
}

.bc-math {
    border-radius: 12px;
    border: 1px solid #dfe3fb;
    background: #f7f9ff;
    padding: 8px 12px;
    color: #111;
    max-width: 100%;
    overflow-x: auto;
    box-shadow: inset 0 0 0 1px rgba(64, 63, 160, 0.05);
}

.bc-math-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.bc-math-block {
    display: block;
    margin: 16px 0;
}

.bc-math math {
    font-size: 1em;
}

.bc-embed-video {
    width: 100%;
    border-radius: 18px;
    overflow: hidden;
    background: #000;
    margin: 18px 0;
}

.bc-embed-video iframe {
    width: 100%;
    height: auto;
    min-height: 260px;
    display: block;
    border: 0;
}

.bc-video-block figcaption {
    text-align: center;
    margin-top: 10px;
    font-size: .86rem;
    color: #5e6380;
}

.bc-chart-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 12, 35, 0.7);
    z-index: 3025;
}

.bc-chart-modal.is-open {
    display: flex;
}

.bc-chart-modal__panel {
    width: min(1080px, 100%);
    max-height: 92vh;
    background: #fff;
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(15, 18, 45, 0.35);
    display: flex;
    flex-direction: column;
}

.bc-chart-modal__header {
    padding: 26px 32px 8px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.bc-chart-modal__eyebrow {
    margin: 0 0 6px;
    text-transform: uppercase;
    font-size: .78rem;
    letter-spacing: .08em;
    color: #9ca1d3;
}

.bc-chart-modal__header h3 {
    margin: 0;
    font-size: 1.6rem;
    color: #27274e;
}

.bc-chart-modal__hint {
    margin: 4px 0 0;
    font-size: .92rem;
    color: #5c6288;
}

.bc-chart-modal__close {
    border: none;
    background: #f1f2ff;
    color: #5b52ff;
    border-radius: 999px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease;
}

.bc-chart-modal__close:hover {
    transform: translateY(-2px);
    background: #e2e4ff;
}

.bc-chart-modal__body {
    padding: 8px 32px 32px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.bc-chart-builder__grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 24px;
}

.bc-chart-builder__left,
.bc-chart-builder__right {
    border: 1px solid #eef0fc;
    border-radius: 20px;
    padding: 18px 20px 22px;
    background: #fafbff;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bc-chart-builder__canvas {
    border-radius: 18px;
    border: 1px solid #dfe3fb;
    background: linear-gradient(145deg, #fefefe, #f2f4ff);
    padding: 12px;
    min-height: 320px;
}

.bc-chart-builder__canvas canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.bc-chart-helper {
    margin: 0;
    font-size: .85rem;
    color: #787fa7;
}

.bc-chart-builder label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
    color: #30345c;
    font-size: .92rem;
}

.bc-chart-builder input,
.bc-chart-builder textarea,
.bc-chart-builder select {
    border-radius: 12px;
    border: 1px solid #dfe3fb;
    padding: 10px 12px;
    background: #fff;
    font-size: .95rem;
}

.bc-chart-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.bc-chart-type {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bc-chart-type span {
    font-size: .82rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #7c80a8;
}

.bc-chart-type__buttons {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.bc-chart-type__buttons button {
    border: 1px solid #dfe2fb;
    border-radius: 12px;
    padding: 10px 0;
    background: #fff;
    font-weight: 600;
    font-size: .9rem;
    color: #4d4f73;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}

.bc-chart-type__buttons button.is-active {
    background: linear-gradient(120deg, #5b67ff, #9b66ff);
    color: #fff;
    box-shadow: 0 8px 20px rgba(91, 103, 255, 0.4);
}

.bc-chart-type__buttons button:hover:not(.is-active) {
    background: #f5f6ff;
}

.bc-chart-pie {
    display: none;
}

.bc-chart-pie.is-visible {
    display: block;
}

.bc-chart-series__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.bc-chart-series__eyebrow {
    margin: 0;
    font-size: .8rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #9aa0cc;
}

.bc-chart-series__header h4 {
    margin: 4px 0 0;
    font-size: 1.1rem;
    color: #2a2d54;
}

.bc-chart-series__tabs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bc-chart-series-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 12px;
    border: 1px solid #e0e4fb;
    padding: 10px 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.bc-chart-series-tab.is-active {
    border-color: #5b67ff;
    box-shadow: 0 0 0 2px rgba(91, 103, 255, 0.2);
}

.bc-chart-series-tab.is-disabled {
    opacity: .45;
    cursor: not-allowed;
}

.bc-chart-series-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.bc-chart-series-status {
    margin-left: auto;
    font-size: .8rem;
    color: #7a80a6;
}

.bc-chart-table {
    border-radius: 14px;
    border: 1px solid #dfe2fb;
    overflow: hidden;
    background: #fff;
}

.bc-chart-table table {
    width: 100%;
    border-collapse: collapse;
}

.bc-chart-table th,
.bc-chart-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eceffe;
    font-size: .88rem;
}

.bc-chart-table input {
    width: 100%;
}

.bc-chart-table td button {
    border: none;
    background: transparent;
    color: #e15462;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.bc-chart-table td button .material-icons {
    font-size: 18px;
}

.bc-chart-table__actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.bc-chart-table__actions button {
    border: 1px solid #dddff9;
    border-radius: 999px;
    padding: 6px 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    cursor: pointer;
    font-weight: 600;
    color: #4e4e74;
}

.bc-chart-table__actions button.is-link {
    border: none;
    background: transparent;
    color: #d9534f;
    padding: 0;
}

.bc-chart-modal__body textarea {
    min-height: 70px;
}

.bc-chart-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    align-items: center;
}

.bc-chart-feedback {
    margin: 0 auto 0 0;
    font-size: .88rem;
    color: #8589b3;
}

.bc-chart-feedback.is-error {
    color: #d64550;
}

.bc-chart-modal__body::-webkit-scrollbar {
    width: 6px;
}

.bc-chart-modal__body::-webkit-scrollbar-thumb {
    background: rgba(94, 102, 158, 0.35);
    border-radius: 999px;
}

.bc-video-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(18, 12, 34, 0.7);
    z-index: 3000;
}

.bc-video-modal.is-open {
    display: flex;
}

.bc-video-modal__panel {
    width: min(960px, 100%);
    background: #fff;
    border-radius: 26px;
    box-shadow: 0 30px 80px rgba(15, 18, 45, 0.35);
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.bc-video-modal__header {
    padding: 26px 32px 12px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.bc-video-modal__eyebrow {
    text-transform: uppercase;
    font-size: .8rem;
    letter-spacing: .08em;
    color: #9a9fc6;
    margin: 0 0 4px;
}

.bc-video-modal__header h3 {
    margin: 0;
    font-size: 1.6rem;
    color: #27274e;
}

.bc-video-modal__hint {
    margin: 6px 0 0;
    color: #5f648c;
    font-size: .95rem;
}

.bc-video-modal__close {
    border: none;
    background: #efefff;
    color: #6c63ff;
    border-radius: 999px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease;
}

.bc-video-modal__close:hover {
    transform: translateY(-2px);
    background: #dedbff;
}

.bc-video-modal__body {
    padding: 0 32px 32px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.bc-video-section {
    border: 1px solid #eef0fc;
    border-radius: 18px;
    padding: 18px 20px;
    background: #fafaff;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bc-video-section header h4 {
    margin: 0 0 6px;
    font-size: 1rem;
}

.bc-video-section header p,
.bc-video-section label {
    font-size: .9rem;
    color: #5b5f7d;
}

.bc-video-section label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
    color: #34375e;
}

.bc-video-section input {
    border-radius: 12px;
    border: 1px solid #dfe3fb;
    padding: 10px 12px;
    background: #fff;
    font-size: .95rem;
}

.bc-video-results {
    border-radius: 12px;
    border: 1px dashed #d6daf6;
    padding: 12px;
    min-height: 120px;
    background: #fff;
}

.bc-video-result {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eef0fb;
    align-items: center;
}

.bc-video-result:last-child {
    border-bottom: none;
}

.bc-video-result__thumb {
    width: 96px;
    height: 54px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.bc-video-result__body {
    flex: 1;
}

.bc-video-result__title {
    margin: 0 0 4px;
    font-weight: 600;
    font-size: .92rem;
}

.bc-video-result__meta {
    margin: 0;
    font-size: .82rem;
    color: #6d7398;
}

.bc-video-result button {
    white-space: nowrap;
}

.bc-video-modal__body::-webkit-scrollbar {
    width: 6px;
}

.bc-video-modal__body::-webkit-scrollbar-thumb {
    background: rgba(79, 86, 125, 0.3);
    border-radius: 999px;
}

.bc-video-section code {
    background: rgba(92, 99, 158, 0.08);
    padding: 0 6px;
    border-radius: 6px;
}

.bc-video-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.bc-video-feedback {
    margin: 0;
    font-size: .85rem;
    color: #6a6f95;
}

.bc-video-more {
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.bc-video-more[hidden] {
    display: none;
}

.bc-ai-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(12, 10, 35, 0.7);
    z-index: 3050;
}

.bc-ai-modal.is-open {
    display: flex;
}

.bc-ai-modal__panel {
    width: min(540px, 100%);
    background: #fff;
    border-radius: 26px;
    box-shadow: 0 32px 80px rgba(16, 20, 54, 0.4);
    overflow: hidden;
}

.bc-ai-modal__header {
    padding: 24px 30px 10px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.bc-ai-modal__eyebrow {
    margin: 0 0 4px;
    text-transform: uppercase;
    font-size: .78rem;
    letter-spacing: .08em;
    color: #95a0d3;
}

.bc-ai-modal__header h3 {
    margin: 0;
    color: #252752;
    font-size: 1.45rem;
}

.bc-ai-modal__hint {
    margin: 6px 0 0;
    color: #5f6489;
    font-size: .92rem;
}

.bc-ai-modal__close {
    border: none;
    background: #f3f4ff;
    border-radius: 999px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #4845d0;
}

.bc-ai-modal__body {
    padding: 12px 30px 26px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bc-ai-modal__body label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
    color: #333762;
    font-size: .92rem;
}

.bc-ai-modal__body textarea,
.bc-ai-modal__body select {
    border-radius: 14px;
    border: 1px solid #dfe2fb;
    padding: 10px 12px;
    font-size: .95rem;
}

.bc-ai-modal__body textarea {
    min-height: 110px;
    resize: vertical;
}

.bc-ai-preview {
    border-radius: 16px;
    border: 1px dashed #cfd3f4;
    padding: 18px;
    min-height: 140px;
    background: #fafbff;
    color: #6b6f93;
    font-size: .95rem;
}

.bc-ai-preview.is-ready {
    border-style: solid;
    color: #232441;
}

.bc-ai-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.bc-ai-status {
    margin: 0;
    font-size: .85rem;
    color: #585c86;
}

.bc-ai-status.is-error {
    color: #c62828;
}

.bc-lab-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 19, 45, 0.78);
    z-index: 3055;
}

.bc-lab-modal.is-open {
    display: flex;
}

.bc-lab-modal__panel {
    width: min(1020px, 100%);
    background: #fff;
    border-radius: 26px;
    box-shadow: 0 35px 90px rgba(9, 12, 42, 0.5);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.bc-lab-modal__header {
    padding: 26px 32px 12px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.bc-lab-modal__eyebrow {
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin: 0 0 4px;
    color: #9aa0c6;
}

.bc-lab-modal__hint {
    margin: 6px 0 0;
    color: #5c6289;
    font-size: .92rem;
}

.bc-lab-modal__close {
    border: none;
    background: #f2f3ff;
    border-radius: 999px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #3f47d4;
}

.bc-lab-modal__body {
    padding: 0 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow-y: auto;
}

.bc-lab-search {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e0e4fb;
    border-radius: 999px;
    padding: 10px 16px;
    background: #f6f7ff;
}

.bc-lab-search input {
    border: none;
    background: transparent;
    flex: 1;
    font-size: .95rem;
}

.bc-lab-search input:focus {
    outline: none;
}

.bc-lab-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}

.bc-lab-card {
    border: 1px solid #e3e6fb;
    border-radius: 20px;
    padding: 18px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bc-lab-card__image {
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    padding-top: 58%;
    background: #f4f6ff;
}

.bc-lab-card__image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bc-lab-card__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.bc-lab-card__meta {
    font-size: .75rem;
    color: #7b81a4;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.bc-lab-card__desc {
    font-size: .85rem;
    color: #4f5474;
    flex: 1;
}

.bc-lab-card__actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.bc-lab-card__actions button {
    flex: 1;
}

.bc-lab-empty {
    margin: 0;
    text-align: center;
    color: #8187ad;
    display: none;
}

.bc-lab-empty.is-visible {
    display: block;
}

.bc-lab-embed {
    margin: 18px 0;
    border: 1px solid #e3e6fb;
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
}

.bc-lab-embed__frame {
    background: #060a1f;
    border-radius: 14px;
    overflow: hidden;
}

.bc-lab-embed__frame iframe {
    width: 100%;
    height: auto;
    min-height: 400px;
    border: none;
    display: block;
}

.bc-lab-embed figcaption {
    margin: 0;
    padding: 12px 16px;
    font-size: .85rem;
    color: #5c6389;
}

.bc-gif-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(16, 11, 39, 0.76);
    z-index: 3056;
}

.bc-gif-modal.is-open {
    display: flex;
}

.bc-gif-modal__panel {
    width: min(880px, 100%);
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(8, 14, 45, 0.35);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bc-gif-modal__header {
    padding: 24px 30px 10px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.bc-gif-modal__eyebrow {
    margin: 0 0 4px;
    text-transform: uppercase;
    font-size: .78rem;
    letter-spacing: .08em;
    color: #969aca;
}

.bc-gif-modal__hint {
    margin: 6px 0 0;
    color: #5a5f87;
    font-size: .9rem;
}

.bc-gif-modal__close {
    border: none;
    background: #f0f1ff;
    border-radius: 999px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #5147d5;
}

.bc-gif-modal__body {
    padding: 0 30px 26px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.bc-gif-modal__body label:not(.bc-gif-search) {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
    color: #323256;
    font-size: .9rem;
}

.bc-gif-modal__body label:not(.bc-gif-search) input[type="text"] {
    border-radius: 12px;
    border: 1px solid #e2e4fb;
    padding: 10px 12px;
    font-size: .95rem;
}

.bc-gif-search {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e1e4fb;
    border-radius: 999px;
    padding: 8px 16px;
    background: #f7f7ff;
}

.bc-gif-search input {
    border: none;
    background: transparent;
    flex: 1;
    font-size: .95rem;
}

.bc-gif-search input:focus {
    outline: none;
}

.bc-gif-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px;
}

.bc-gif-card {
    border: 1px solid #e4e6fb;
    border-radius: 18px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(10, 12, 37, 0.08);
}

.bc-gif-card__preview {
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #eef0ff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bc-gif-card__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bc-gif-card__placeholder {
    font-size: .8rem;
    color: #868ab1;
    padding: 10px;
}

.bc-gif-card__meta {
    margin: 0;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #8b90b8;
}

.bc-gif-card__title {
    margin: 0;
    font-weight: 600;
    color: #2f2f5a;
    font-size: .95rem;
}

.bc-gif-card button {
    align-self: stretch;
    margin-top: auto;
}

.bc-gif-card__btn {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    white-space: nowrap;
    box-sizing: border-box;
    padding-left: 16px;
    padding-right: 16px;
}

.bc-gif-card__btn-icon {
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bc-gif-card__btn-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bc-gif-empty {
    margin: 0;
    text-align: center;
    color: #7a81a8;
    display: none;
}

.bc-gif-empty.is-visible {
    display: block;
}

.bc-gif-empty.is-error {
    color: #d64550;
}

.bc-gif-empty.is-info {
    color: #5c6289;
}

.bc-gif-modal__body::-webkit-scrollbar {
    width: 6px;
}

.bc-gif-modal__body::-webkit-scrollbar-thumb {
    background: rgba(68, 72, 120, 0.35);
    border-radius: 999px;
}

.bc-gif-embed {
    margin: 18px 0;
    text-align: center;
    border-radius: 20px;
    border: 1px solid #e1e4fb;
    padding: 14px;
    background: #fff;
}

.bc-gif-embed img {
    max-width: 100%;
    border-radius: 14px;
    display: block;
    margin: 0 auto;
}

.bc-gif-embed figcaption {
    margin: 10px 0 0;
    font-size: .85rem;
    color: #55597e;
}

.bc-chart-embed {
    margin: 20px auto;
    max-width: 960px;
    border-radius: 22px;
    border: 1px solid #e2e5fb;
    background: linear-gradient(135deg, rgba(86, 102, 246, 0.08), rgba(226, 231, 255, 0.5));
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(23, 30, 68, 0.12);
}

.bc-chart-embed__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 22px 12px;
}

.bc-chart-embed__pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(120deg, #5c87ff, #7c56ff);
    color: #fff;
    font-weight: 600;
    padding: 4px 12px;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.bc-chart-embed__head h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #1f1f3c;
}

.bc-chart-embed__head p {
    margin: 2px 0 0;
    color: #4b4f74;
    font-size: .88rem;
}

.bc-chart-embed__visual {
    padding: 0 22px 22px;
}

.bc-chart-embed__visual canvas {
    width: 100%;
    height: 320px;
    border-radius: 20px;
    border: 1px solid rgba(92, 97, 148, 0.08);
    background: #fff;
}

.bc-chart-embed figcaption {
    margin: 0;
    padding: 14px 22px 22px;
    font-size: .9rem;
    color: #4e5377;
}

.bc-formula-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(20, 16, 46, 0.7);
    z-index: 3100;
}

.bc-formula-modal.is-open {
    display: flex;
}

.bc-formula-modal__panel {
    width: min(520px, 100%);
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 30px 80px rgba(9, 13, 44, 0.4);
    overflow: hidden;
}

.bc-formula-modal__header {
    padding: 22px 26px 8px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.bc-formula-modal__eyebrow {
    margin: 0 0 4px;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .78rem;
    color: #9ea3c7;
}

.bc-formula-modal__header h3 {
    margin: 0;
    font-size: 1.4rem;
    color: #2b2f57;
}

.bc-formula-modal__hint {
    margin: 6px 0 0;
    color: #585f8d;
    font-size: .9rem;
}

.bc-formula-modal__close {
    border: none;
    background: #f0f2ff;
    border-radius: 999px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #3f4ed9;
}

.bc-formula-modal__body {
    padding: 10px 26px 26px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bc-formula-modal__body label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: .9rem;
    color: #34375d;
    font-weight: 600;
}

.bc-formula-modal__body textarea,
.bc-formula-modal__body select {
    border-radius: 14px;
    border: 1px solid #dfe3fb;
    padding: 10px 12px;
    font-size: .95rem;
    min-height: 70px;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.bc-formula-modal__body select {
    min-height: auto;
}

.bc-formula-preview {
    border: 1px dashed #d4d7f2;
    border-radius: 14px;
    padding: 18px;
    background: #fafbff;
    min-height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #7d82a9;
}

.bc-formula-preview.is-ready {
    border-style: solid;
    color: #1c1f3a;
}

.bc-formula-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.bc-formula-feedback {
    margin: 0;
    font-size: .85rem;
    color: #565b82;
}


.bc-editor-hint {
    font-size: .85rem;
    color: #5a5f82;
    margin-top: 6px;
}

.bc-editor-side {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.bc-editor-card {
    background: #fff;
    border-radius: 20px;
    border: 0px solid #eef0fb;
    padding: 20px 22px;
}

.bc-editor-card header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.bc-editor-card header h3 {
    font-size: 1rem;
    margin: 0;
    font-weight: 600;
}

.bc-editor-card select,
.bc-editor-card textarea,
.bc-editor-card input[type="text"] {
    width: 100%;
    border-radius: 12px;
    border: 1px solid #dfe4fb;
    padding: 10px 12px;
    font-size: .95rem;
    background: #fbfbff;
}

.bc-editor-card textarea {
    min-height: 140px;
    resize: vertical;
    font-family: 'SFMono-Regular', Consolas, Menlo, monospace;
    font-size: .9rem;
}

.bc-editor-preview {
    border-radius: 14px;
    border: 1px solid #e7ebff;
    background: #f6f7ff;
    padding: 18px;
    min-height: 200px;
    overflow: auto;
}

.bc-editor-preview h1,
.bc-editor-preview h2,
.bc-editor-preview h3 {
    margin-top: 0;
}

.bc-editor-preview figure,
.bc-editor-preview blockquote {
    margin: 16px 0;
}

.bc-editor-preview blockquote {
    padding-left: 16px;
    border-left: 4px solid #a6b1ff;
    font-style: italic;
    color: #53577c;
}

.bc-editor-log {
    list-style: none;
    padding-left: 0;
    margin: 0;
    font-size: .85rem;
    max-height: 180px;
    overflow: auto;
}

.bc-editor-log li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(226, 230, 255, 0.7);
}

.bc-editor-log time {
    font-size: .78rem;
    color: #8b8fb9;
    margin-right: 6px;
}

.bc-editor-embed {
    border: 1px solid rgba(87, 108, 188, 0.25);
    background: #fff;
    box-shadow: none !important;
    border: 0px !important;
}

.bc-editor-embed__toolbar {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.bc-editor-embed__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bc-editor-embed__title {
    font-size: 1.15rem;
    margin-bottom: 4px;
}

.bc-editor-embed__subtitle {
    color: #5f6c94;
    margin-bottom: 0;
    font-size: .9rem;
}

.bc-editor-embed__status {
    border-radius: 10px;
    font-size: .85rem;
}

.bc-editor-embed__slot {
    margin-top: 14px;
}

.bc-editor-embed .bc-editor-page {
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.bc-editor-embed .bc-editor-grid {
    margin: 0;
    grid-template-columns: 1fr;
}

.bc-editor-embed .bc-editor-side {
    display: none;
}

.bc-editor-embed .bc-editor-embed__toolbar,
.bc-editor-embed .bc-editor-embed__status {
    display: none;
}

.bc-editor-html-output {
    margin-top: 10px;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    background: #0f172a;
    color: #f8fafc;
    border: 0;
    border-radius: 10px;
    min-height: 120px;
}

.bc-editor-preview--compact {
    margin-top: 14px;
    border: 1px dashed #cdd4ff;
    border-radius: 12px;
    padding: 12px;
    background: #f9f9ff;
    min-height: 80px;
}

.bc-editor-toolbar--aux {
    border-top: 1px solid rgba(30,30,60,0.08);
    margin-top: 10px;
    padding-top: 8px;
}

.bc-editor-embed .bc-editor-toolbar {
    flex-wrap: wrap;
}

.bc-editor-embed .bc-editor-toolbar-group {
    border-right: none;
    padding-right: 8px;
    margin-bottom: 4px;
}

.bc-editor-embed .bc-editor-btn {
    min-width: 34px;
    font-size: .9rem;
}

.bc-editor-embed .bc-editor-surface {
    min-height: 200px;
    border: 1px solid #e1e5f9;
}

.bc-editor-surface img,
.bc-editor-preview img {
    max-width: 100%;
    height: auto;
}

[data-bc-editor-anchor] {
    display: none !important;
    border: 0 !important;
}

[data-bc-editor-anchor] + .note-editor {
    display: none !important;
}

[data-bc-editor-anchor] ~ .note-editor {
    display: none !important;
}

.bc-editor-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: .95rem;
}

.bc-editor-table td,
.bc-editor-table th {
    border: 1px solid #dfe4fb;
    padding: 8px 10px;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.bc-editor-table tr:nth-child(even) {
    background: #f8f9ff;
}

.bc-editor-table img {
    max-width: 100%;
    height: auto;
}

.bc-editor-upload {
    display: none;
}

.bc-editor-template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.bc-editor-template-grid label {
    font-size: .85rem;
    color: #565a7f;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bc-editor-template-grid small {
    color: #9aa0c7;
    font-size: .78rem;
}

.bc-editor-card footer {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.bc-editor-card footer button {
    flex: 1;
}

.bc-editor-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .9rem;
}

.bc-bullet-list {
    margin: 0;
    padding-left: 18px;
    font-size: .9rem;
    color: rgba(255,255,255,0.9);
}

.bc-bullet-list li {
    margin-bottom: 4px;
}

@media (max-width: 1100px) {
    .bc-editor-grid {
        grid-template-columns: 1fr;
    }
    .bc-chart-builder__grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .bc-editor-panel,
    .bc-editor-card,
    .bc-editor-intro {
        padding: 18px;
    }

    .bc-editor-toolbar {
        padding: 10px;
    }

    .bc-editor-toolbar-group {
        width: 100%;
        padding-right: 0;
        border-right: none;
        border-bottom: 1px solid rgba(30, 30, 60, 0.08);
        padding-bottom: 8px;
        margin-bottom: 6px;
    }

    .bc-editor-toolbar-group:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .bc-editor-status {
        flex-direction: column;
    }

    .bc-video-modal__body {
        grid-template-columns: 1fr;
        padding: 0 20px 24px;
    }

    .bc-chart-type__buttons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bc-chart-table__actions {
        flex-direction: column;
        align-items: flex-start;
    }
}
