.ct-lesson-builder-content { margin-top: 34px; padding-top: 26px; border-top: 2px solid #eee9f8; }
.ct-builder-topic { padding: 24px; margin: 24px 0; border: 1px solid #dedee8; border-radius: 4px; background: #f0f1f5; scroll-margin-top: 24px; }
.ct-builder-topic-heading { display:flex; align-items:stretch; width:fit-content; max-width:100%; gap:0; margin-bottom:24px; border-radius:4px; overflow:hidden; background:#684781; }
.ct-builder-topic-heading .ct-topic-number { display:flex; align-items:center; justify-content:center; align-self:stretch; min-width:44px; width:auto; height:auto; padding:10px; border-radius:0; background:#503568; color:#fff; border:0; font-size:16px; }
.ct-builder-topic-heading h2 { margin:0; padding:9px 16px; color:#fff; font-size:17px; line-height:1.6; }
.ct-builder-topic-heading h2 span { display:block; }
.ct-builder-topic-heading h2 span[lang="en"] { color:#fff; font-size:15px; font-weight:700; }
.ct-builder-topic-description { margin-bottom:16px; }
.ct-builder-row { display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); gap:16px; margin:18px 0; align-items:start; }
.ct-builder-item { grid-column:span var(--ct-span, 12); min-width:0; }
.ct-builder-item pre { background:#24243a; color:#faf7ff; border-radius:8px; padding:16px; overflow:auto; direction:ltr; text-align:left; }
.ct-builder-item iframe { width:100%; min-height:220px; border:1px solid #dcd8e9; border-radius:8px; background:#fff; }
.ct-builder-item video, .ct-builder-item img { display:block; max-width:100%; height:auto; border-radius:8px; }
.ct-builder-item figure { margin:0; }
.ct-builder-item figcaption { color:#6c6881; font-size:12px; margin-top:6px; }
.ct-builder-container { padding:14px; border:1px dashed #c9bce8; border-radius:8px; background:#fbfaff; }
.ct-builder-prose { line-height:1.9; overflow-wrap:anywhere; }
.ct-builder-prose table { width:100%; max-width:100%; border-collapse:collapse; margin:16px 0; table-layout:fixed; }
.ct-builder-prose :is(td,th) { border:1px solid #d4cfdf; padding:8px 12px; overflow-wrap:anywhere; }
.ct-builder-prose th { background:#eee9f6; font-weight:700; }
.ct-builder-prose :is(ul,ol) { padding-inline-start:28px; }
.ct-builder-prose blockquote { border-inline-start:3px solid #8064ab; margin:16px 0; padding:8px 16px; background:#f5f1fb; }
.ct-builder-prose :is(h3,h4) { margin:16px 0 10px; line-height:1.5; }
.ct-lesson-builder-editor { margin-top:32px; padding:18px; border:2px solid #e2d8f5; border-radius:14px; background:#faf8ff; direction:rtl; text-align:right; }
.ct-builder-toolbar { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; padding-bottom:14px; border-bottom:1px solid #e7e0f3; }
.ct-builder-toolbar strong { color:#5541a7; }
.ct-builder-toolbar [data-ct-save-status] { display:inline-block; margin-inline-start:12px; color:#6b6680; font-size:13px; }
.ct-builder-actions { display:flex; flex-wrap:wrap; gap:6px; }
.ct-builder-button { border:1px solid #cfc5e6; border-radius:6px; background:#fff; color:#4d4270; padding:7px 11px; cursor:pointer; font:inherit; font-size:13px; }
.ct-builder-button:hover { background:#f0ebfb; }
.ct-builder-example-fields [data-example-slug-status] { display:block; min-height:1.4em; margin-top:4px; font-size:12px; }
.ct-builder-example-fields [data-example-slug-status][data-state="available"] { color:#18733b; }
.ct-builder-example-fields [data-example-slug-status][data-state="taken"], .ct-builder-example-fields [data-example-slug-status][data-state="invalid"] { color:#a32636; }
.ct-builder-example-fields [data-example-slug-status][data-state="checking"], .ct-builder-example-fields [data-example-slug-status][data-state="network"] { color:#6b6680; }
[dir="rtl"] .ct-builder-example-fields [data-example-slug-status] { direction:rtl; text-align:right; }
.ct-builder-button:disabled { opacity:.5; cursor:not-allowed; }
.ct-builder-primary { background:#5541a7; border-color:#5541a7; color:#fff; }
.ct-builder-primary:hover { background:#443488; }
.ct-builder-empty { padding:24px 0; color:#77718a; }
.ct-builder-canvas { display:grid; gap:18px; padding-top:18px; }
.ct-builder-topic-card { border:1px solid #dcd1ef; border-radius:10px; background:#fff; padding:14px; }
.ct-builder-topic-card.is-hidden, .ct-builder-node.is-hidden { opacity:.55; }
.ct-builder-card-head, .ct-builder-row-head, .ct-builder-node-head { display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.ct-builder-card-head { border-bottom:1px solid #eeeaf5; padding-bottom:10px; margin-bottom:10px; }
.ct-builder-card-head h3 { flex:1; margin:0; font-size:17px; color:#453878; }
.ct-builder-card-head h3 input { display:block; width:100%; box-sizing:border-box; padding:7px 10px; margin:4px 0; border:1px solid #ddd7e9; border-radius:5px; background:#faf9fd; color:#453878; font:inherit; }
.ct-builder-row-card { border:1px dashed #d1c5e7; padding:10px; margin-top:12px; border-radius:8px; }
.ct-builder-row-head { color:#69627d; font-size:12px; margin-bottom:8px; }
.ct-builder-grid { display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); gap:8px; min-height:70px; padding:8px; background-image:linear-gradient(to left,rgba(104,80,163,.11) 1px,transparent 1px); background-size:8.333333% 100%; }
.ct-builder-node { grid-column:span var(--ct-span,12); position:relative; min-width:0; border:1px solid #dfd8ed; border-radius:7px; background:#fff; padding:9px; }
.ct-builder-drag-handle { display:inline-flex; align-items:center; justify-content:center; color:#806fc1; cursor:grab; user-select:none; padding:0 4px; font-size:16px; }
.ct-builder-drag-handle:active { cursor:grabbing; }
.ct-builder-node-head { justify-content:flex-start; color:#4d4270; font-size:12px; }
.ct-builder-node-title { flex:1; font-weight:600; }
.ct-builder-node-body { margin-top:7px; }
.ct-builder-node textarea, .ct-builder-node input { width:100%; box-sizing:border-box; border:1px solid #ddd7e9; border-radius:4px; padding:5px; font:inherit; font-size:12px; }
.ct-builder-node-head .ct-builder-span { width:45px; height:32px; }
.ct-builder-node input[type="checkbox"] { display:inline-block; width:auto; height:auto; margin-inline-end:6px; }
.ct-builder-node textarea { min-height:140px; resize:vertical; }
.ct-builder-node textarea[dir="ltr"] { text-align:left; font-family:ui-monospace,Consolas,monospace; line-height:1.65; }
.ct-lesson-page .ct-builder-rich-editor { display:block; width:100%; box-sizing:border-box; min-height:90px; border:1px solid #ddd7e9; border-radius:4px; padding:8px; outline:none; line-height:1.7; background:#fff; font-weight:400; overflow-wrap:anywhere; text-align:start; }
.ct-builder-rich-editor:empty::before { content:attr(data-placeholder); color:#aaa5b5; }
.ct-builder-label { display:block; margin:8px 0; font-size:12px; color:#5f5875; }
.ct-builder-rich-toolbar { display:flex; flex-wrap:wrap; gap:3px; margin-bottom:3px; }
.ct-builder-rich-toolbar button { border:1px solid #ddd5eb; background:#fff; border-radius:3px; cursor:pointer; padding:2px 6px; }
.ct-builder-rich-toolbar .ct-builder-link-url { width:150px; max-width:100%; margin:0; padding:3px 6px; font-size:11px; }
.ct-builder-node-head select, .ct-builder-row-head select { width:auto; border:1px solid #d8d0e6; border-radius:4px; padding:2px; font:inherit; font-size:11px; }
.ct-builder-preview { margin-top:18px; padding:18px; border:1px solid #d8ccec; background:#fff; border-radius:8px; }
.ct-builder-node-summary,.ct-builder-topic-summary { padding:12px 14px; color:#4d4664; background:#fbfaff; border:1px solid #e7e0f3; border-radius:6px; }
.ct-builder-node-summary { display:flex; gap:10px; align-items:baseline; min-height:44px; }
.ct-builder-node-summary strong { color:#684781; }
.ct-builder-topic-card h2 { margin:0; display:flex; gap:10px; align-items:baseline; font-size:1.25rem; }
.ct-builder-topic-card h2 small { color:#766d8b; font-size:.75rem; font-weight:400; }
.ct-builder-preview > iframe { display:block; width:100%; height:70vh; min-height:480px; max-height:900px; border:1px solid #ddd; border-radius:6px; }
.ct-builder-mini { border:0; background:transparent; color:#5541a7; cursor:pointer; padding:2px 4px; font-size:12px; }
.ct-builder-span { width:45px; border:1px solid #d8d0e6; border-radius:4px; padding:2px; }
.ct-builder-resizer { cursor:ew-resize; color:#806fc1; touch-action:none; }
.ct-builder-modal[hidden] { display:none; }
.ct-builder-modal-dialog h2 { margin:0 0 6px; color:#453878; }
.ct-builder-modal-dialog p { margin:0 0 15px; color:#6d6780; font-size:13px; }
.ct-builder-modal-dialog label { display:block; margin:12px 0; font-size:13px; font-weight:600; }
.ct-builder-modal-dialog input, .ct-builder-modal-dialog textarea { display:block; box-sizing:border-box; width:100%; margin-top:5px; border:1px solid #d8d0e6; border-radius:6px; padding:9px; font:inherit; font-weight:400; }
.ct-builder-modal-close { position:absolute; inset-inline-end:15px; top:10px; border:0; background:transparent; font-size:25px; color:#69627d; cursor:pointer; }
.ct-builder-modal-actions { display:flex; justify-content:flex-start; gap:8px; margin-top:20px; }
@media(max-width:700px){ .ct-builder-row{display:block}.ct-builder-item,.ct-builder-node{grid-column:span 12!important;margin-bottom:10px}.ct-builder-toolbar{align-items:stretch}.ct-builder-actions{width:100%}.ct-builder-button{flex:1}.ct-lesson-builder-editor{padding:12px} }
[dir="ltr"] .ct-lesson-builder-editor { direction:ltr; text-align:left; }
[dir="ltr"] .ct-lesson-builder-editor .ct-builder-topic-card, [dir="ltr"] .ct-lesson-builder-editor .ct-builder-row-card { text-align:left; }

/* The editor keeps the public lesson hierarchy visible while exposing only compact actions. */
.ct-lesson-builder-editor .ct-builder-topic-card { background:#f0f1f5; border-color:#dedee8; padding:18px; }
.ct-lesson-builder-editor .ct-builder-card-head { border:0; margin:-2px 0 14px; padding:0; }
.ct-lesson-builder-editor .ct-builder-card-head h2 { flex:1; min-width:180px; align-items:stretch; gap:0; margin:0; padding:9px 16px; border-radius:6px; background:#684781; color:#fff; font-size:17px; line-height:1.6; }
.ct-lesson-builder-editor .ct-builder-card-head h2 span { display:block; }
.ct-lesson-builder-editor .ct-builder-card-head h2 small { display:block; color:#fff; font-size:13px; font-weight:700; }
.ct-lesson-builder-editor .ct-builder-topic-description { margin:0 0 14px; padding:0 4px; }
.ct-builder-placeholder { display:inline-block; color:#77718a; font-size:13px; }
.ct-builder-modal-error { margin:8px 0; color:#a13b3b; font-size:12px; }
.ct-builder-image-picker { display:grid; grid-template-columns:1fr; justify-items:center; align-items:start; gap:10px; margin:8px 0 14px; }
.ct-builder-image-button { display:flex; align-items:center; justify-content:center; width:130px; height:130px; padding:0; overflow:hidden; border:1px solid #d8d0e6; border-radius:18px; background:#f5f1fb; color:#684781; cursor:pointer; font:inherit; }
.ct-builder-image-button img { display:block; width:100%; height:100%; object-fit:cover; }
.ct-builder-image-picker input[data-image-file][hidden] { display:none; }
.ct-builder-image-placeholder { padding:10px; text-align:center; }
.ct-builder-image-hint { max-width:420px; color:#6d6780; font-size:12px; line-height:1.7; text-align:center; }
.ct-builder-image-picker [data-image-error] { width:100%; margin:0; text-align:center; }
[dir="rtl"] .ct-builder-image-picker { text-align:center; }
.ct-builder-modal-note { padding:10px; border-radius:6px; background:#f5f1fb; color:#5f5875; font-size:13px; }
.ct-builder-check { display:flex !important; align-items:center; gap:7px; }
.ct-builder-check input { width:auto !important; margin:0 !important; }
.ct-builder-code-input { min-height:180px; font-family:ui-monospace,Consolas,monospace !important; white-space:pre; }
.ct-builder-modal-dialog textarea.ct-builder-code-input { direction:ltr; text-align:left; }
[dir="rtl"] .ct-lesson-builder-editor .ct-builder-topic-card { text-align:right; }
.ct-lesson-builder-editor .ct-builder-drag-handle { touch-action:none; }
.ct-lesson-builder-editor .is-drop-target { outline:2px solid #7652a8; outline-offset:2px; }
.ct-lesson-builder-editor[data-drop-placement="after"] .is-drop-target { box-shadow:0 3px 0 #7652a8; }
.ct-lesson-builder-editor[data-drop-placement="before"] .is-drop-target { box-shadow:0 -3px 0 #7652a8; }
.ct-lesson-builder-editor[data-drop-placement="before"] .is-drop-target[data-drop-axis="horizontal"] { box-shadow:3px 0 0 #7652a8; }
.ct-lesson-builder-editor[data-drop-placement="after"] .is-drop-target[data-drop-axis="horizontal"] { box-shadow:-3px 0 0 #7652a8; }
[dir="ltr"] .ct-lesson-builder-editor[data-drop-placement="before"] .is-drop-target[data-drop-axis="horizontal"] { box-shadow:-3px 0 0 #7652a8; }
[dir="ltr"] .ct-lesson-builder-editor[data-drop-placement="after"] .is-drop-target[data-drop-axis="horizontal"] { box-shadow:3px 0 0 #7652a8; }

/* Builder workspace: preserve the public lesson hierarchy while keeping admin chrome quiet. */
.ct-lesson-builder-editor {
    margin-top: 24px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.ct-lesson-builder-editor .ct-builder-toolbar {
    padding: 0 0 16px;
    border-bottom: 1px solid #e5e5eb;
}
.ct-lesson-builder-editor .ct-builder-toolbar strong { color: #684781; font-size: 15px; }
.ct-lesson-builder-editor .ct-builder-canvas { gap: 20px; padding-top: 20px; }
.ct-lesson-builder-editor .ct-builder-topic-card {
    margin: 0;
    padding: 24px;
    border: 1px solid #dedee8;
    border-radius: 4px;
    background: #f0f1f5;
    box-shadow: none;
}
.ct-lesson-builder-editor .ct-builder-card-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 18px;
    padding: 0;
    border: 0;
}
.ct-lesson-builder-editor .ct-builder-card-head h2 {
    display: flex;
    flex: 0 1 auto;
    flex-direction: column;
    align-items: flex-start;
    width: fit-content;
    max-width: min(100%, 38rem);
    min-width: 0;
    margin-inline-end: auto;
    padding: 8px 14px 9px;
    border-radius: 4px;
    background: #684781;
    color: #fff;
    text-align: right;
    font-size: 18px;
    line-height: 1.55;
}
.ct-lesson-builder-editor .ct-builder-card-head h2 span {
    display: block;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.55;
}
.ct-lesson-builder-editor .ct-builder-card-head h2 small {
    display: block;
    order: -1;
    margin-bottom: 1px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    opacity: .92;
}
.ct-lesson-builder-editor .ct-builder-card-head > .ct-builder-mini {
    flex: 0 0 auto;
    margin-top: 4px;
}
.ct-lesson-builder-editor .ct-builder-topic-description {
    margin: 0 0 18px;
    padding: 0;
    color: #454354;
    font-size: 16px;
    line-height: 1.9;
}
.ct-lesson-builder-editor .ct-builder-row-card {
    margin: 18px 0 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}
.ct-lesson-builder-editor .ct-builder-row-head,
.ct-lesson-builder-editor .ct-builder-node-head {
    position: relative;
    min-height: 28px;
    padding: 3px 6px;
    border: 0;
    border-radius: 4px;
    color: #706c7b;
    font-size: 12px;
    line-height: 1.4;
}
.ct-lesson-builder-editor .ct-builder-row-head .ct-builder-drag-handle,
.ct-lesson-builder-editor .ct-builder-node-head .ct-builder-drag-handle {
    color: #817b8d;
    font-size: 14px;
}
.ct-lesson-builder-editor .ct-builder-row-head > .ct-builder-mini,
.ct-lesson-builder-editor .ct-builder-node-head > .ct-builder-mini {
    border: 1px solid #e2dfe8;
    border-radius: 999px;
    background: #fff;
    color: #5e5570;
    box-shadow: 0 2px 6px rgba(46, 37, 67, .08);
    opacity: 0;
    transition: opacity .15s ease, background-color .15s ease;
}
.ct-lesson-builder-editor .ct-builder-row-head:hover > .ct-builder-mini,
.ct-lesson-builder-editor .ct-builder-row-head:focus-within > .ct-builder-mini,
.ct-lesson-builder-editor .ct-builder-node-head:hover > .ct-builder-mini,
.ct-lesson-builder-editor .ct-builder-node-head:focus-within > .ct-builder-mini,
.ct-lesson-builder-editor .ct-builder-row-head > .ct-builder-mini:hover,
.ct-lesson-builder-editor .ct-builder-node-head > .ct-builder-mini:hover,
.ct-lesson-builder-editor .ct-builder-row-head > .ct-builder-mini:focus-visible,
.ct-lesson-builder-editor .ct-builder-node-head > .ct-builder-mini:focus-visible { opacity: 1; }
.ct-lesson-builder-editor .ct-builder-row-head > [data-action="add-item"] { opacity: .55; }
.ct-lesson-builder-editor .ct-builder-row-head > [data-action="add-item"]:hover,
.ct-lesson-builder-editor .ct-builder-row-head:focus-within > [data-action="add-item"] { opacity: 1; }
.ct-lesson-builder-editor .ct-builder-grid {
    display: grid;
    gap: 20px;
    min-height: 0;
    padding: 0;
    background-image: none;
}
.ct-lesson-builder-editor.is-dragging .ct-builder-grid,
.ct-lesson-builder-editor .ct-builder-grid.is-resizing {
    padding: 8px;
    background-image: linear-gradient(to left, rgba(104, 80, 163, .12) 1px, transparent 1px);
    background-size: 8.333333% 100%;
}
.ct-lesson-builder-editor .ct-builder-node {
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}
.ct-lesson-builder-editor .ct-builder-node-body {
    margin-top: 5px;
    color: #2f2c38;
    font-size: 16px;
    line-height: 1.9;
}
.ct-lesson-builder-editor .ct-builder-node-body .ct-builder-prose {
    font-size: 16px;
    line-height: 1.9;
}
.ct-lesson-builder-editor .ct-builder-node-body textarea,
.ct-lesson-builder-editor .ct-builder-node-body input { font-size: 16px; line-height: 1.7; }
.ct-lesson-builder-editor .ct-builder-node-body pre {
    margin: 0;
    border-radius: 4px;
    line-height: 1.75;
}
.ct-lesson-builder-editor .ct-builder-node-body iframe { border-radius: 4px; }
.ct-lesson-builder-editor > .ct-builder-preview,
.ct-lesson-builder-editor .ct-builder-container { border-radius: 4px; }

/* Dialogs use the same surface and spacing at every editor entry point. */
.ct-builder-modal { padding: 0; background: transparent; }
.ct-builder-modal .ct-builder-modal-dialog {
    width: min(100%, 780px);
    max-height: calc(100vh - 40px);
    padding: 28px;
    border: 1px solid #e2dce9;
    border-radius: 10px;
    background: #fff;
}
.ct-builder-modal-dialog h2 { margin: 0 0 10px; padding-inline-end: 44px; font-size: 20px; line-height: 1.5; }
.ct-builder-modal-dialog p { line-height: 1.7; }
.ct-builder-modal-dialog > p { margin: 0 0 8px; }
.ct-builder-modal-dialog form { display: grid; gap: 2px; }
.ct-builder-modal-dialog label,
.ct-builder-modal .ct-builder-rich-label {
    color: #4c4657;
    font-size: 13px;
    line-height: 1.6;
}
.ct-builder-modal-dialog input,
.ct-builder-modal-dialog select,
.ct-builder-modal-dialog textarea {
    min-height: 40px;
    margin-top: 5px;
    border: 1px solid #d8d0e6;
    border-radius: 5px;
    background: #fff;
    color: #292532;
    font-size: 15px;
    line-height: 1.7;
}
.ct-builder-modal-dialog input:focus-visible,
.ct-builder-modal-dialog select:focus-visible,
.ct-builder-modal-dialog textarea:focus-visible,
.ct-builder-modal-dialog button:focus-visible {
    outline: 2px solid #7652a8;
    outline-offset: 2px;
}
.ct-builder-modal-dialog select[name="initial_type"],
.ct-builder-modal-dialog select[name="type"] {
    display: block;
    width: 100%;
    box-sizing: border-box;
}
.ct-builder-modal-dialog .ct-builder-topic-content {
    min-width: 0;
    margin: 14px 0 0;
    padding: 0 !important;
    border: 0;
}
.ct-builder-modal-dialog .ct-builder-topic-content legend {
    margin-bottom: 4px;
    padding: 0;
    color: #4c4657;
    font-size: 14px;
    line-height: 1.6;
    font-weight: 700;
}
.ct-builder-modal-actions { flex-wrap: wrap; }
@media (hover: none), (pointer: coarse) {
    .ct-lesson-builder-editor .ct-builder-row-head > .ct-builder-mini,
    .ct-lesson-builder-editor .ct-builder-node-head > .ct-builder-mini { opacity: 1; }
}
@media (max-width: 700px) {
    .ct-lesson-builder-editor .ct-builder-topic-card { padding: 18px; }
    .ct-lesson-builder-editor .ct-builder-card-head { gap: 7px; }
    .ct-lesson-builder-editor .ct-builder-card-head h2 { max-width: calc(100% - 36px); font-size: 17px; }
    .ct-lesson-builder-editor .ct-builder-card-head h2 span { font-size: 17px; }
    .ct-lesson-builder-editor .ct-builder-row-head,
    .ct-lesson-builder-editor .ct-builder-node-head { gap: 4px; }
    .ct-builder-modal-dialog { padding: 20px; }
}
@media (max-width: 390px) {
    .ct-builder-modal-dialog { width: 100%; max-height: calc(100vh - 16px); padding: 16px; }
}

/* Content options stay inside the modal and collapse progressively on small screens. */
.ct-builder-advanced { margin-top: 12px; border: 1px solid #e2d9eb; border-radius: 7px; padding: 10px 12px; background: #fbfaff; }
.ct-builder-advanced summary { cursor: pointer; color: #503568; font-weight: 700; }
.ct-builder-example-fields { width: 100%; margin: 10px 0; padding: 10px 12px; border: 1px solid #e2d9eb; border-radius: 7px; background: #fbfaff; }
.ct-builder-example-fields[hidden] { display: none; }
.ct-builder-example-fields label { display: block; }
.ct-builder-example-fields input { width: 100%; direction: ltr; text-align: left; }
.ct-builder-example-url { min-height: 1.4em; margin: 6px 0 0; color: #5d4b69; font: 0.88rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.ct-builder-advanced-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; margin-top: 12px; }
.ct-builder-modal-dialog .ct-builder-advanced-grid > label:has(textarea[name="short_code"], textarea[name="initial_short_code"]),
.ct-builder-modal-dialog .ct-builder-advanced-grid > label:has(input.ct-builder-color-input) { grid-column: 1 / -1; }
.ct-builder-modal-dialog input.ct-builder-color-input { direction: ltr; text-align: left; }
.ct-builder-check-grid, .ct-builder-code-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin-top: 10px; }
.ct-builder-modal .ct-builder-check { position: relative; display: flex !important; align-items: center; gap: 11px; min-height: 52px; margin: 0 !important; padding: 10px 13px; border: 1px solid #e5def0; border-radius: 13px; background: #fcfaff; color: #393145; cursor: pointer; font-size: 14px !important; font-weight: 600 !important; line-height: 1.45; transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease; }
.ct-builder-modal .ct-builder-check:hover { border-color: #c9b8df; background: #faf7ff; }
.ct-builder-modal .ct-builder-check:focus-within { border-color: #7652a8; box-shadow: 0 0 0 3px rgba(118, 82, 168, .16); }
.ct-builder-modal .ct-builder-check input { position: absolute; width: 1px !important; height: 1px; min-height: 0 !important; margin: 0 !important; padding: 0 !important; border: 0 !important; appearance: none; opacity: .001; }
.ct-builder-modal .ct-builder-check-track { position: relative; flex: 0 0 44px; width: 44px; height: 25px; border-radius: 999px; background: #d4cfdb; box-shadow: inset 0 0 0 1px rgba(58, 43, 79, .12); transition: background-color .16s ease, box-shadow .16s ease; }
.ct-builder-modal .ct-builder-check-track::before { position: absolute; inset-block-start: 3px; inset-inline-start: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(41, 31, 54, .28); content: ''; transition: transform .16s ease; }
.ct-builder-modal .ct-builder-check-track::after { position: absolute; inset-block-start: 5px; inset-inline-start: 8px; color: #7652a8; content: '✓'; font-size: 13px; font-weight: 800; line-height: 19px; opacity: 0; transition: opacity .12s ease, transform .16s ease; }
.ct-builder-modal .ct-builder-check input:checked + .ct-builder-check-track { background: #7652a8; box-shadow: inset 0 0 0 1px rgba(61, 37, 92, .16); }
.ct-builder-modal .ct-builder-check input:checked + .ct-builder-check-track::before { transform: translateX(19px); }
.ct-builder-modal .ct-builder-check input:checked + .ct-builder-check-track::after { opacity: 1; transform: translateX(19px); }
.ct-builder-modal .ct-builder-check input:disabled ~ * { opacity: .58; }
.ct-builder-modal .ct-builder-check:has(input:disabled) { cursor: not-allowed; opacity: .7; }
.ct-builder-modal .ct-builder-check-label { min-width: 0; }
[dir="rtl"] .ct-builder-modal .ct-builder-check input:checked + .ct-builder-check-track::before { transform: translateX(-19px); }
[dir="rtl"] .ct-builder-modal .ct-builder-check input:checked + .ct-builder-check-track::after { transform: translateX(-19px); }
[dir="rtl"].ct-builder-modal .ct-builder-check input:checked + .ct-builder-check-track::before { transform: translateX(-19px); }
[dir="rtl"].ct-builder-modal .ct-builder-check input:checked + .ct-builder-check-track::after { transform: translateX(-19px); }
.ct-builder-code-input { width: 100%; min-height: 180px; box-sizing: border-box; direction: ltr; text-align: left; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.ct-builder-rich-field textarea { width: 100%; box-sizing: border-box; }
.ct-builder-modal-dialog label select { display: block; width: 100%; min-width: 0; box-sizing: border-box; }
.ct-builder-modal-dialog form > label input, .ct-builder-modal-dialog form > label textarea { width: 100%; box-sizing: border-box; }
.ct-builder-modal-dialog textarea.ct-builder-code-input { min-height: 180px; resize: vertical; direction: ltr; text-align: left; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.ct-builder-modal-dialog { border-radius: 16px; box-shadow: 0 24px 80px rgba(43, 27, 64, .25); }
.ct-builder-modal-dialog { width: min(100%, 780px) !important; min-width: 0; box-sizing: border-box; }
.ct-builder-modal-dialog form { gap: 14px; }
.ct-builder-modal-dialog form > label:not(.ct-builder-check), .ct-builder-modal-dialog .ct-builder-rich-field { margin: 0; }
.ct-builder-modal-dialog .ct-builder-topic-content { margin-top: 2px; padding: 18px; border: 1px solid #e6dff0; border-radius: 14px; background: #fcfaff; }
.ct-builder-modal-dialog .ct-builder-topic-content legend { margin-bottom: 12px; }
.ct-builder-modal-actions { margin-top: 6px; padding-top: 16px; border-top: 1px solid #eee9f5; }
.ct-builder-modal[dir="rtl"] .ct-builder-modal-actions { justify-content: left; }
.ct-builder-modal[dir="rtl"] .ct-builder-modal-actions .ct-builder-button { flex: 0 1 auto; }
.ct-builder-modal-dialog .ct-builder-modal-close { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; top: 12px; inset-inline-end: 12px; border-radius: 10px; font-size: 25px; }
.ct-builder-modal-dialog .ct-builder-modal-close:hover { background: #f4effa; color: #503568; }
.ct-builder-modal-dialog .ct-builder-modal-actions .ct-builder-button { min-height: 44px; padding-inline: 18px; }
.ct-builder-modal-dialog [data-ct-node-fields] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.ct-builder-modal-dialog [data-ct-node-fields] > .ct-builder-type-field,
.ct-builder-modal-dialog [data-ct-node-fields] > [data-topic-header-fields],
.ct-builder-modal-dialog [data-ct-node-fields] > [data-node-type-fields],
.ct-builder-modal-dialog [data-ct-node-fields] > .ct-builder-topic-content,
.ct-builder-modal-dialog [data-ct-node-fields] > .ct-builder-modal-error { grid-column: 1 / -1; }
.ct-builder-modal-dialog [data-ct-node-fields] > label:not(.ct-builder-type-field):not(.ct-builder-row-selector) { grid-column: span 1; }
.ct-builder-modal-dialog .ct-builder-topic-content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.ct-builder-modal-dialog .ct-builder-topic-content > legend,
.ct-builder-modal-dialog .ct-builder-topic-content > .ct-builder-type-field,
.ct-builder-modal-dialog .ct-builder-topic-content > [data-node-type-fields],
.ct-builder-modal-dialog .ct-builder-topic-content > .ct-builder-modal-note,
.ct-builder-modal-dialog .ct-builder-topic-content > .ct-builder-modal-error,
.ct-builder-modal-dialog .ct-builder-topic-content > [data-topic-add-initial] { grid-column: 1 / -1; }
.ct-builder-modal-dialog .ct-builder-topic-content > label:not(.ct-builder-type-field) { grid-column: span 1; }
.ct-builder-type-field { position: relative; }
.ct-builder-type-select { position: relative; margin-top: 7px; }
.ct-builder-type-select > select[hidden] { display: none; }
.ct-builder-modal-dialog .ct-builder-type-select > select[hidden] { display: none !important; }
.ct-builder-type-trigger { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; margin: 0; padding: 10px 13px; border: 1px solid #cfc3e0; border-radius: 11px; background: #fff; color: #292532; cursor: pointer; font: inherit; font-size: 15px; text-align: start; transition: border-color .16s ease, box-shadow .16s ease; }
.ct-builder-type-trigger:hover, .ct-builder-type-trigger.is-open { border-color: #7652a8; }
.ct-builder-type-trigger:focus-visible { outline: 2px solid #7652a8; outline-offset: 2px; }
.ct-builder-type-trigger-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-builder-type-trigger-value { flex: 0 0 auto; margin: 0; color: #766b88; direction: ltr; font-size: 12px; font-weight: 500; }
.ct-builder-type-trigger-arrow { position: relative; flex: 0 0 10px; width: 10px; height: 10px; margin-inline-start: 2px; border-right: 2px solid #7652a8; border-bottom: 2px solid #7652a8; transform: translateY(-2px) rotate(45deg); }
.ct-builder-type-trigger.is-open .ct-builder-type-trigger-arrow { transform: translateY(2px) rotate(225deg); }
.ct-builder-type-popup { position: absolute; inset-inline: 0; z-index: 12; margin-top: 6px; padding: 8px; border: 1px solid #cfc3e0; border-radius: 13px; background: #fff; box-shadow: 0 14px 30px rgba(52, 34, 75, .18); }
.ct-builder-type-search-row { display: flex; gap: 7px; align-items: center; margin-bottom: 7px; }
.ct-builder-type-search { flex: 1; min-width: 0; min-height: 42px !important; margin: 0 !important; padding: 8px 10px !important; border-radius: 9px !important; }
.ct-builder-type-clear { flex: 0 0 34px; width: 34px; height: 34px; border: 0; border-radius: 8px; background: #f3eef9; color: #5b4772; cursor: pointer; font-size: 20px; line-height: 1; }
.ct-builder-type-clear:hover { background: #eae0f5; }
.ct-builder-type-options { display: grid; gap: 3px; max-height: min(320px, 40vh); overflow-y: auto; overscroll-behavior: contain; }
.ct-builder-type-option { display: flex; align-items: center; gap: 12px; min-height: 43px; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.ct-builder-type-option:hover, .ct-builder-type-option.is-active { background: #f3eef9; }
.ct-builder-type-option[aria-selected="true"] { color: #503568; font-weight: 700; }
.ct-builder-type-option-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-builder-type-option-value { flex: 0 0 auto; margin: 0; color: #837593; direction: ltr; font-size: 12px; font-weight: 500; }
.ct-builder-modal-dialog select.ct-builder-ltr-select { direction: ltr; text-align: left; }
.ct-builder-modal-dialog select[name="note_tone"],
.ct-builder-modal-dialog select[name="initial_note_tone"],
.ct-builder-modal-dialog select[name="note_tone"] option,
.ct-builder-modal-dialog select[name="initial_note_tone"] option { direction: ltr; text-align: left; }
.ct-builder-modal-dialog .ct-builder-type-search::-webkit-search-cancel-button { display: none; }
.ct-builder-modal-dialog .ct-builder-type-clear { flex-basis: 44px; width: 44px; height: 44px; }
.ct-builder-type-no-results { margin: 0 !important; padding: 14px 10px; color: #6d6780; text-align: center; }
.ct-builder-type-select.is-disabled { opacity: .65; }
.ct-builder-row-selector { grid-column: 1 / -1; }
.ct-builder-row-picker { position: relative; display: block; min-width: 0; }
.ct-builder-row-picker > select { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.ct-builder-row-trigger { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid #d8d0e6; border-radius: 8px; background: #fff; color: #514366; font: inherit; text-align: start; cursor: pointer; }
.ct-builder-row-trigger:hover, .ct-builder-row-trigger.is-open { border-color: #7652a8; background: #fbfaff; }
.ct-builder-row-trigger:focus-visible, .ct-builder-row-search:focus-visible, .ct-builder-row-clear:focus-visible, .ct-builder-row-message-action:focus-visible, .ct-builder-row-load-more:focus-visible { outline: 3px solid #8c6cce; outline-offset: 2px; }
.ct-builder-row-trigger-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-builder-row-trigger-arrow { position: relative; flex: 0 0 10px; width: 10px; height: 10px; margin-inline-start: 2px; border-right: 2px solid #7652a8; border-bottom: 2px solid #7652a8; transform: translateY(-2px) rotate(45deg); }
.ct-builder-row-trigger.is-open .ct-builder-row-trigger-arrow { transform: translateY(2px) rotate(225deg); }
.ct-builder-row-popup { position: absolute; inset-inline: 0; z-index: 20; margin-top: 6px; padding: 8px; border: 1px solid #cfc3e0; border-radius: 10px; background: #fff; box-shadow: 0 14px 30px rgba(52, 34, 75, .18); }
.ct-builder-row-popup.is-floating { position: fixed; inset-inline: auto; z-index: 1100; margin-top: 0; }
.ct-builder-row-search-row { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.ct-builder-row-search { flex: 1 1 auto; min-width: 0; min-height: 42px !important; margin: 0 !important; padding: 8px 10px !important; border-radius: 8px !important; }
.ct-builder-modal-dialog .ct-builder-row-search::-webkit-search-cancel-button { display: none; }
.ct-builder-row-clear { flex: 0 0 40px; width: 40px; min-height: 40px; border: 0; border-radius: 8px; background: #f3eef9; color: #5b4772; cursor: pointer; font-size: 20px; line-height: 1; }
.ct-builder-row-options { display: grid; gap: 3px; max-height: min(320px, 40vh); overflow-y: auto; overscroll-behavior: contain; }
.ct-builder-row-option { min-width: 0; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.ct-builder-row-option:hover, .ct-builder-row-option.is-active { background: #f3eef9; }
.ct-builder-row-option[aria-selected="true"] { color: #503568; font-weight: 700; }
.ct-builder-row-option-label { display: block; overflow-wrap: anywhere; line-height: 1.5; }
.ct-builder-row-message { padding: 13px 10px; color: #6d6780; text-align: center; }
.ct-builder-row-message-action, .ct-builder-row-load-more { width: 100%; min-height: 40px; padding: 7px 10px; border: 1px solid #d8ccec; border-radius: 7px; background: #fff; color: #5b3f78; cursor: pointer; font: inherit; }
.ct-builder-row-message-action:hover, .ct-builder-row-load-more:hover { background: #f3eef9; }
.ct-lesson-builder-editor .ct-builder-node { grid-column: span var(--ct-span, 12); }
.ct-lesson-builder-editor .ct-builder-grid > .ct-builder-offset-spacer { grid-column: span var(--ct-offset, 0); grid-row: span 2; }
.ct-lesson-builder-editor .ct-builder-grid > .ct-builder-node { grid-row: span 2; }
@media (max-width: 700px) {
    .ct-lesson-builder-editor .ct-builder-node { grid-column: span 12 !important; margin-inline-start: 0; }
    .ct-lesson-builder-editor .ct-builder-grid > .ct-builder-offset-spacer { display: none; }
    .ct-builder-advanced-grid, .ct-builder-check-grid, .ct-builder-code-options { grid-template-columns: 1fr; }
    .ct-builder-modal-dialog form { grid-template-columns: minmax(0, 1fr); min-width: 0; }
    .ct-builder-modal-dialog [data-ct-node-fields], .ct-builder-modal-dialog .ct-builder-topic-content { grid-template-columns: minmax(0, 1fr); min-width: 0; width: 100%; }
    .ct-builder-modal-dialog [data-ct-node-fields] > *, .ct-builder-modal-dialog .ct-builder-topic-content > *, .ct-builder-modal-dialog .ct-builder-row-selector, .ct-builder-modal-dialog .ct-builder-row-picker { min-width: 0; max-width: 100%; box-sizing: border-box; }
    .ct-builder-modal-dialog .ct-builder-row-trigger, .ct-builder-modal-dialog .ct-builder-row-popup { max-width: 100%; box-sizing: border-box; }
    .ct-builder-modal-dialog [data-ct-node-fields] > label:not(.ct-builder-type-field):not(.ct-builder-row-selector), .ct-builder-modal-dialog .ct-builder-topic-content > label:not(.ct-builder-type-field) { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
    .ct-builder-modal .ct-builder-check,
    .ct-builder-modal .ct-builder-check-track,
    .ct-builder-modal .ct-builder-check-track::before,
    .ct-builder-modal .ct-builder-check-track::after,
    .ct-builder-modal .ct-builder-type-trigger,
    .ct-builder-modal .ct-builder-type-trigger-arrow { transition: none; }
}

.ct-builder-modal .ct-builder-modal-dialog { width: min(100%, 780px) !important; max-width: 100%; min-width: 0; box-sizing: border-box; }

/* Keep each item on one compact metadata line; the handle remains independently usable. */
.ct-lesson-builder-editor .ct-builder-row-card { margin-top: 10px; }
.ct-lesson-builder-editor .ct-builder-row-head { min-height: 24px; padding-block: 1px; }
.ct-lesson-builder-editor .ct-builder-grid { gap: 12px; }
.ct-lesson-builder-editor .ct-builder-node {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 6px;
    row-gap: 0;
    align-items: start;
}
/* Align each node's header and body to the shared canvas row tracks. */
.ct-lesson-builder-editor .ct-builder-grid > .ct-builder-node {
    grid-row: span 2;
    grid-template-rows: subgrid;
}
.ct-lesson-builder-editor .ct-builder-node > .ct-builder-drag-handle {
    grid-column: 1;
    grid-row: 1;
    margin-top: 2px;
}
.ct-lesson-builder-editor .ct-builder-node > .ct-builder-node-head {
    grid-column: 2;
    grid-row: 1;
    min-height: 22px;
    margin: 0;
    padding-block: 1px;
}
.ct-lesson-builder-editor .ct-builder-node > .ct-builder-node-body {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    margin-top: 1px;
}
.ct-lesson-builder-editor .ct-builder-node-head .ct-builder-node-title,
.ct-lesson-builder-editor .ct-builder-node-head .ct-builder-width,
.ct-lesson-builder-editor .ct-builder-node-head > .ct-builder-mini {
    opacity: 0;
    transition: opacity .15s ease;
}
.ct-lesson-builder-editor .ct-builder-node:hover .ct-builder-node-title,
.ct-lesson-builder-editor .ct-builder-node:hover .ct-builder-width,
.ct-lesson-builder-editor .ct-builder-node:hover .ct-builder-node-head > .ct-builder-mini,
.ct-lesson-builder-editor .ct-builder-node:focus-within .ct-builder-node-title,
.ct-lesson-builder-editor .ct-builder-node:focus-within .ct-builder-width,
.ct-lesson-builder-editor .ct-builder-node:focus-within .ct-builder-node-head > .ct-builder-mini { opacity: 1; }
.ct-lesson-builder-editor .ct-builder-topic-description { margin-bottom: 10px; }
.ct-lesson-builder-editor > .ct-builder-canvas > .ct-builder-topic-card > [data-action="add-row"] { margin-top: 8px; }

@media (hover: none), (pointer: coarse) {
    .ct-lesson-builder-editor .ct-builder-node-head .ct-builder-node-title,
    .ct-lesson-builder-editor .ct-builder-node-head .ct-builder-width,
    .ct-lesson-builder-editor .ct-builder-node-head > .ct-builder-mini { opacity: 1; }
}

/* Keep admin media and code inside the lesson card at every viewport width. */
.ct-lesson-builder-editor .ct-builder-node-body {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
.ct-lesson-builder-editor .ct-builder-node-body img,
.ct-lesson-builder-editor .ct-builder-node-body video {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
}
.ct-lesson-builder-editor .ct-builder-node-body figure { max-width: 100%; margin: 0; }
.ct-lesson-builder-editor .ct-builder-node-body figcaption {
    max-width: 100%;
    margin-top: 6px;
    color: #6c6881;
    font-size: 12px;
    line-height: 1.6;
}
.ct-lesson-builder-editor .ct-builder-node-body iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 220px;
    box-sizing: border-box;
    border: 1px solid #dcd8e9;
    border-radius: 4px;
    background: #fff;
}
.ct-lesson-builder-editor .ct-builder-node-body pre {
    display: block;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    overflow: auto;
    direction: ltr;
    text-align: left;
    white-space: pre;
    background: #24243a;
    color: #faf7ff;
    border-radius: 4px;
    padding: 16px;
}
.ct-lesson-builder-editor .ct-builder-node-body pre code { white-space: inherit; }

/* Flexible row editor: all rules stay inside the row modal so the public row grid is unchanged. */
[data-ct-row-modal] .ct-builder-modal-dialog { width: min(100%, 560px); }
[data-ct-row-modal] .ct-builder-row-hint {
    margin: 0 0 14px;
    color: #6d6780;
    font-size: 13px;
    line-height: 1.7;
}
[data-ct-row-modal] .ct-builder-row-count-label {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(64px, 96px);
    align-items: center;
    gap: 12px;
    margin: 0 0 14px;
}
[data-ct-row-modal] [data-row-count] {
    min-width: 64px;
    height: 44px;
    min-height: 44px;
    box-sizing: border-box;
    margin: 0;
    direction: ltr;
    text-align: start;
}
[data-ct-row-modal] .ct-builder-row-columns {
    display: grid;
    gap: 8px;
    padding: 2px;
}
[data-ct-row-modal] .ct-builder-row-column {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(64px, 76px) auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 8px;
    border: 1px solid #e2d9eb;
    border-radius: 7px;
    background: #f8f6fb;
}
[data-ct-row-modal] .ct-builder-row-column-name {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    color: #4d4270;
    font-size: 13px;
    overflow-wrap: anywhere;
}
[data-ct-row-modal] .ct-builder-row-column-name strong { font-weight: 700; }
[data-ct-row-modal] .ct-builder-row-column input[data-row-span] {
    min-width: 64px;
    width: 100%;
    margin: 0;
    direction: ltr;
    text-align: start;
}
[data-ct-row-modal] .ct-builder-row-column-kind {
    display: block;
    min-width: 0;
    color: #6d6780;
    font-size: 12px;
    line-height: 1.35;
}
[data-ct-row-modal] .ct-builder-row-column-kind:empty { display: none; }
[data-ct-row-modal] .ct-builder-row-column-actions {
    display: flex;
    grid-column: 3;
    grid-row: 1;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
}
[data-ct-row-modal] .ct-builder-row-column-actions button,
[data-ct-row-modal] .ct-builder-row-add-column,
[data-ct-row-modal] .ct-builder-row-undo {
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    border: 1px solid #d8ccec;
    border-radius: 6px;
    background: #fff;
    color: #503568;
    cursor: pointer;
    font: inherit;
}
[data-ct-row-modal] .ct-builder-row-column-actions button:hover,
[data-ct-row-modal] .ct-builder-row-add-column:hover,
[data-ct-row-modal] .ct-builder-row-undo:hover { background: #f0ebfb; }
[data-ct-row-modal] .ct-builder-row-column-actions [data-row-remove] { color: #8d3f52; }
[data-ct-row-modal] .ct-builder-row-column input[data-row-span] {
    height: 44px;
    min-height: 44px;
    box-sizing: border-box;
}
[data-ct-row-modal] .ct-builder-row-add-column,
[data-ct-row-modal] .ct-builder-row-undo {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 8px 12px;
}
[data-ct-row-modal] .ct-builder-row-add-column {
    border-color: #684781;
    color: #684781;
}
[data-ct-row-modal] .ct-builder-row-undo { color: #6d6780; }
[data-ct-row-modal] [data-row-error] { margin: 10px 0 0; }
[data-ct-row-modal] .ct-builder-row-preview-wrap {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e5deed;
}
[data-ct-row-modal] .ct-builder-row-preview-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    color: #4d4270;
    font-size: 13px;
    font-weight: 700;
}
[data-ct-row-modal] .ct-builder-row-preview-label,
[data-ct-row-modal] .ct-builder-row-preview-summary {
    color: #6d6780;
    font-size: 12px;
    font-weight: 400;
}
[data-ct-row-modal] .ct-builder-row-preview {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-flow: row;
    gap: 6px;
    min-width: 0;
    direction: inherit;
}
[data-ct-row-modal] .ct-builder-row-preview-cell {
    min-width: 0;
    min-height: 42px;
    padding: 9px 4px;
    border-radius: 5px;
    background: #684781;
    color: #fff;
    text-align: center;
    overflow-wrap: anywhere;
}
[data-ct-row-modal] .ct-builder-row-preview-summary { margin-top: 8px; }
[data-ct-row-modal] .ct-builder-modal-actions { margin-top: 18px; }
[data-ct-row-modal] .ct-builder-modal-actions button { min-height: 44px; }
.ct-lesson-builder-editor .ct-builder-empty-slot button[data-action="edit-node"] {
    min-width: 44px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px dashed #b8a7d4;
    border-radius: 6px;
    background: #fbfaff;
    color: #684781;
    cursor: pointer;
    font: inherit;
}

/* Refined builder dialog shell: the chrome stays present while long editors scroll. */
.ct-builder-modal.ct-bootstrap-modal > .modal-dialog {
    width: calc(100% - 32px) !important;
    max-width: 920px;
    height: min(calc(100vh - 40px), 820px);
    max-height: calc(100vh - 40px);
    min-height: 0;
    margin: 20px auto;
}
.ct-builder-modal.ct-bootstrap-modal > .modal-dialog > .ct-builder-modal-dialog {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
}
.ct-builder-modal .ct-builder-modal-dialog {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: min(calc(100vh - 40px), 820px);
    max-height: calc(100vh - 40px);
    min-height: 0;
    padding: 0 !important;
    overflow: hidden;
    border: 1px solid #e4dfec;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 22px 70px rgba(44, 27, 66, .24);
}
.ct-builder-modal-header { display: flex; align-items: center; gap: 13px; min-width: 0; padding-block: 22px 18px; padding-inline-start: 28px; padding-inline-end: 72px; border-bottom: 1px solid #ece9f1; background: #fff; }
.ct-builder-modal-header > div { min-width: 0; }
.ct-builder-modal-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 11px; background: #f0eafa; color: #684781; }
.ct-builder-modal-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.ct-builder-modal-dialog h2 { margin: 0; padding: 0; color: #31263b; font-size: 20px; line-height: 1.35; }
.ct-builder-modal-dialog .ct-builder-modal-header p { margin: 4px 0 0; color: #756c80; font-size: 12px; line-height: 1.55; }
.ct-builder-modal-close { z-index: 2; top: 16px !important; inset-inline-end: 18px !important; width: 38px !important; height: 38px !important; border-radius: 10px; color: #746b80; }
.ct-builder-modal-close:hover { background: #f6f3f9; color: #4f3760; }
.ct-builder-modal-dialog > form { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; overflow: hidden; gap: 0; }
.ct-builder-modal-body { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 22px 28px 26px; background: #f8f7fb; }
.ct-builder-modal-section { min-width: 0; margin: 0 0 20px; padding: 18px 20px; border: 1px solid #e8e3ee; border-radius: 14px; background: #fff; }
.ct-builder-modal-section:last-child { margin-bottom: 0; }
.ct-builder-modal-section-title { margin-bottom: 14px; color: #4c3a5c; font-size: 14px; font-weight: 800; line-height: 1.5; }
.ct-builder-modal-title-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.ct-builder-modal-dialog label, .ct-builder-modal .ct-builder-rich-label { margin: 0 !important; color: #51495a; font-size: 13px; font-weight: 700; line-height: 1.55; }
.ct-builder-modal-dialog input, .ct-builder-modal-dialog select, .ct-builder-modal-dialog textarea { margin-top: 6px; min-height: 42px; padding: 8px 11px; border-color: #dcd6e5; border-radius: 9px; background: #fff; }
.ct-builder-modal-dialog textarea { min-height: 106px; }
.ct-builder-modal-dialog input:hover, .ct-builder-modal-dialog select:hover, .ct-builder-modal-dialog textarea:hover { border-color: #c6b8d4; }
.ct-builder-modal-actions { display: flex; align-items: center; justify-content: flex-start; gap: 10px; min-height: 76px; box-sizing: border-box; margin: 0 !important; padding: 15px 28px; border-top: 1px solid #e8e4ed; background: #fff; }
.ct-builder-modal-actions .ct-builder-button { min-height: 42px; padding-inline: 18px; border-radius: 9px; }
[dir="rtl"] .ct-builder-modal-actions { direction: ltr; justify-content: flex-start; }
[dir="rtl"] .ct-builder-modal-actions .ct-builder-button { direction: rtl; }
.ct-builder-modal-dialog [data-ct-node-fields] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 18px 18px; }
.ct-builder-modal-dialog [data-ct-node-fields] > .ct-builder-type-field,
.ct-builder-modal-dialog [data-ct-node-fields] > [data-topic-header-fields],
.ct-builder-modal-dialog [data-ct-node-fields] > [data-node-type-fields],
.ct-builder-modal-dialog [data-ct-node-fields] > .ct-builder-topic-content,
.ct-builder-modal-dialog [data-ct-node-fields] > .ct-builder-modal-error { grid-column: 1 / -1; }
.ct-builder-modal-dialog [data-ct-node-fields] > .ct-builder-type-field { padding-bottom: 2px; }
.ct-builder-modal-dialog [data-ct-node-fields] > .ct-builder-row-selector { grid-column: 1 / -1; }
.ct-builder-modal-dialog .ct-builder-topic-content { margin: 0; padding: 18px 20px; border: 1px solid #e8e3ee; border-radius: 14px; background: #fff; }
.ct-builder-modal-dialog fieldset.ct-builder-topic-content { padding: 18px 20px !important; }
.ct-builder-modal-dialog .ct-builder-topic-content legend { margin-bottom: 14px; color: #4c3a5c; font-size: 14px; }
.ct-builder-modal-dialog .ct-builder-topic-content > label { margin: 0 !important; }
.ct-builder-modal-dialog .ct-builder-rich-field { min-width: 0; }
.ct-builder-modal .ct-builder-rich-field { margin: 0 !important; }
.ct-builder-placement, .ct-builder-content-section { min-width: 0; margin: 0; padding: 18px 20px; border: 1px solid #e8e3ee; border-radius: 14px; background: #fff; }
.ct-builder-placement { grid-column: 1 / -1; }
.ct-builder-placement legend { margin-bottom: 14px; padding: 0; color: #4c3a5c; font-size: 14px; font-weight: 800; }
.ct-builder-placement-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(78px, 108px) minmax(78px, 108px); align-items: end; gap: 14px; }
.ct-builder-placement-grid .ct-builder-type-field { min-width: 0; }
.ct-builder-placement-grid .ct-builder-row-selector { grid-column: 1 / -1; }
.ct-builder-placement-grid > label > input,
.ct-builder-placement-grid .ct-builder-type-trigger,
.ct-builder-placement-grid .ct-builder-row-trigger { min-height: 48px; height: 48px; box-sizing: border-box; }
.ct-builder-content-section { grid-column: 1 / -1; }
.ct-builder-content-section > .ct-builder-modal-section-title { margin-bottom: 14px; }
.ct-builder-content-section [data-node-type-fields] { min-width: 0; }
.ct-builder-content-section [data-node-type-fields] { display: grid; gap: 16px; }
.ct-builder-modal-dialog [data-topic-header-fields] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0 0 20px; padding: 18px 20px; border: 1px solid #e8e3ee; border-radius: 14px; background: #fff; }
.ct-builder-modal-dialog [data-topic-content-fields] [data-node-type-fields] { display: grid; gap: 16px; }
.ct-builder-modal[data-ct-modal] [data-ct-topic-fields] { display: grid; gap: 16px; margin-top: 16px; }
.ct-builder-modal-dialog select[name="mode"], .ct-builder-modal-dialog select[name="initial_mode"] { direction: ltr; text-align: left; }
/* Keep every ordinary one-line control on the same 48px rhythm. */
.ct-builder-modal-dialog input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.ct-builder-modal-dialog select,
.ct-builder-modal-dialog .ct-builder-type-trigger,
.ct-builder-modal-dialog .ct-builder-row-trigger { height: 48px; min-height: 48px; box-sizing: border-box; }
/* Jodit owns its toolbar and popup controls; leave those dimensions to the editor. */
.ct-builder-modal-dialog .jodit-container input,
.ct-builder-modal-dialog .jodit-container select,
.ct-builder-modal-dialog .jodit-popup input,
.ct-builder-modal-dialog .jodit-popup select,
.ct-builder-modal-dialog .jodit-dialog input,
.ct-builder-modal-dialog .jodit-dialog select { height: auto; min-height: 0; box-sizing: content-box; }
.ct-builder-modal-dialog .ct-builder-rich-editor { min-height: 125px; border-color: #dcd6e5; border-radius: 10px; }
.ct-builder-modal-dialog .ct-builder-code-input { min-height: 190px; border-radius: 10px; }
.ct-builder-modal-dialog .ct-builder-code-field { display: block; grid-column: 1 / -1; min-width: 0; }
.ct-builder-modal-dialog .ct-builder-code-editor-host { width: 100%; height: 260px; min-height: 180px; margin-top: 7px; overflow: hidden; border: 1px solid #3c394a; border-radius: 10px; background: #22212c; direction: ltr; text-align: left; }
.ct-builder-modal-dialog .ct-builder-short-code-field .ct-builder-code-editor-host { height: 200px; min-height: 150px; }
.ct-builder-modal-dialog .ct-builder-code-editor-host.ace_editor { padding: 0; color: #e5e0f0; background: #22212c; font: 14px/1.7 Consolas, "SFMono-Regular", monospace; }
.ct-builder-modal-dialog .ct-builder-code-editor-host .ace_gutter { padding-inline: 8px; color: #a6a0b8; background: #2b2936; }
.ct-builder-modal-dialog .ct-builder-code-editor-host .ace_gutter-active-line { background: #2c2939; }
.ct-builder-modal-dialog .ct-builder-code-editor-host .ace_marker-layer .ace_active-line { background: #2c2939; }
.ct-builder-modal-dialog .ct-builder-code-editor-host .ace_marker-layer .ace_selection { background: #514269; }
.ct-builder-modal-dialog .ct-builder-code-editor-host .ace_keyword, .ct-builder-modal-dialog .ct-builder-code-editor-host .ace_storage { color: #c8a4ee; }
.ct-builder-modal-dialog .ct-builder-code-editor-host .ace_entity.ace_name.ace_tag, .ct-builder-modal-dialog .ct-builder-code-editor-host .ace_meta.ace_tag { color: #df9cb6; }
.ct-builder-modal-dialog .ct-builder-code-editor-host .ace_string { color: #bae29a; }
.ct-builder-modal-dialog .ct-builder-code-editor-host .ace_constant, .ct-builder-modal-dialog .ct-builder-code-editor-host .ace_entity.ace_other.ace_attribute-name { color: #f2bd90; }
.ct-builder-modal-dialog .ct-builder-code-editor-host .ace_comment { color: #9690a7; font-style: italic; }
.ct-builder-modal-dialog .ct-builder-code-editor-host .ace_support, .ct-builder-modal-dialog .ct-builder-code-editor-host .ace_entity.ace_name.ace_function { color: #8ecfdb; }
.ct-builder-modal-dialog .ct-builder-code-editor-host .ace_cursor { color: #e5e0f0; }
.ct-builder-modal-dialog .ct-builder-code-editor-host .ace_search { max-width: calc(100% - 8px); background: #2b2936; border-color: #3c394a; }
.ct-builder-modal-dialog .ct-builder-code-editor-host .ace_search input { height: auto; min-height: 0; color: #e5e0f0; background: #22212c; }
.ct-builder-modal-dialog .ct-builder-code-editor-host .ace_text-input { width: 1px !important; height: 1px !important; min-height: 1px !important; margin: 0 !important; padding: 0 !important; border: 0 !important; }
.ct-builder-modal-dialog .ct-builder-code-source-hidden { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; border: 0 !important; }
.ct-builder-modal-dialog .ct-builder-advanced { margin: 0; border-color: #e2dce9; border-radius: 11px; background: #fbfaff; }
.ct-builder-modal-dialog .ct-builder-advanced summary { list-style: none; padding: 2px 0; }
.ct-builder-modal-dialog .ct-builder-advanced summary::-webkit-details-marker { display: none; }
.ct-builder-modal-dialog .ct-builder-advanced summary::after { display: inline-block; width: 7px; height: 7px; margin-inline-start: 9px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; content: ''; transform: translateY(-2px) rotate(45deg); }
.ct-builder-modal-dialog .ct-builder-advanced[open] summary::after { transform: translateY(2px) rotate(225deg); }
.ct-builder-modal-dialog .ct-builder-image-picker { order: 99; margin-top: 6px; }
.ct-builder-modal-dialog .ct-builder-image-button { width: 124px; height: 124px; border-radius: 14px; }
.ct-builder-modal-dialog .ct-builder-image-hint { margin-top: 0; }
.ct-builder-modal-dialog .ct-builder-type-popup, .ct-builder-modal-dialog .ct-builder-row-popup { max-width: calc(100vw - 40px); }
[dir="ltr"] .ct-builder-modal-dialog { direction: ltr; }
@media (max-width: 700px) {
    .ct-builder-modal.ct-bootstrap-modal > .modal-dialog { width: calc(100% - 16px) !important; height: min(calc(100vh - 20px), 900px); max-height: calc(100vh - 20px); margin: 10px auto; }
    .ct-builder-modal .ct-builder-modal-dialog { border-radius: 18px; }
    .ct-builder-modal-header { padding-block: 17px 14px; padding-inline-start: 18px; padding-inline-end: 58px; }
    .ct-builder-modal-body { padding: 16px 16px 20px; }
    .ct-builder-modal-actions { min-height: 68px; padding: 12px 16px; }
    .ct-builder-modal-title-grid, .ct-builder-modal-dialog [data-ct-node-fields] { grid-template-columns: minmax(0, 1fr); }
    .ct-builder-modal-dialog [data-topic-header-fields] { grid-template-columns: minmax(0, 1fr); padding: 14px; }
    .ct-builder-placement-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
    .ct-builder-placement-grid .ct-builder-type-field,
    .ct-builder-placement-grid .ct-builder-row-selector { grid-column: 1 / -1; }
    .ct-builder-modal-section, .ct-builder-placement, .ct-builder-content-section { padding: 14px; }
    .ct-builder-modal-actions .ct-builder-button { flex: 0 0 auto; }
}
.ct-builder-modal.ct-bootstrap-modal[data-ct-row-modal] > .modal-dialog { max-width: 640px; }
@media (max-width: 480px) {
    .ct-builder-modal-dialog .ct-builder-advanced-grid,
    .ct-builder-modal-dialog .ct-builder-check-grid,
    .ct-builder-modal-dialog .ct-builder-code-options { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 390px) {
    .ct-builder-modal.ct-bootstrap-modal > .modal-dialog { max-height: calc(100vh - 16px); margin: 8px auto; }
    .ct-builder-modal .ct-builder-modal-dialog { max-height: calc(100vh - 16px); }
    .ct-builder-modal-header { padding-inline-start: 14px; padding-inline-end: 54px; }
    .ct-builder-modal-header .ct-builder-modal-icon { flex-basis: 32px; width: 32px; height: 32px; }
    .ct-builder-modal-dialog h2 { font-size: 18px; }
    .ct-builder-modal-body { padding-inline: 12px; }
    .ct-builder-modal-actions { padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) { .ct-builder-modal-dialog *, .ct-builder-modal-dialog *::before, .ct-builder-modal-dialog *::after { transition: none !important; animation: none !important; } }

@media (max-width: 390px) {
    [data-ct-row-modal] .ct-builder-row-column {
        grid-template-columns: minmax(64px, 72px) minmax(0, 1fr);
        gap: 6px;
        padding: 7px;
    }
    [data-ct-row-modal] .ct-builder-row-column-name {
        grid-column: 1 / -1;
        grid-row: 1;
    }
    [data-ct-row-modal] .ct-builder-row-column input[data-row-span] {
        grid-column: 1;
        grid-row: 2;
    }
    [data-ct-row-modal] .ct-builder-row-column-actions {
        grid-column: 2;
        grid-row: 2;
        justify-content: flex-start;
    }
}

/* Persistent admin controls: row structure and content actions have distinct surfaces. */
.ct-lesson-builder-editor .ct-builder-control-icon {
    display: block;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    pointer-events: none;
}
.ct-lesson-builder-editor .ct-builder-control,
.ct-lesson-builder-editor .ct-builder-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    gap: 7px;
    min-width: 40px;
    min-height: 40px;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid #d8d5e3;
    border-radius: 7px;
    background: #fff;
    color: #514366;
    box-shadow: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    opacity: 1;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.ct-lesson-builder-editor .ct-builder-control-icon-only,
.ct-lesson-builder-editor .ct-builder-drag-handle { width: 40px; padding: 8px; }
.ct-lesson-builder-editor .ct-builder-drag-handle {
    border-color: transparent;
    background: transparent;
    color: #706782;
    cursor: grab;
    touch-action: none;
}
.ct-lesson-builder-editor .ct-builder-control:hover,
.ct-lesson-builder-editor .ct-builder-drag-handle:hover {
    border-color: #bcb0d3;
    background: #eee9f7;
    color: #52358a;
}
.ct-lesson-builder-editor .ct-builder-control:focus-visible,
.ct-lesson-builder-editor .ct-builder-drag-handle:focus-visible {
    outline: 3px solid #8c6cce;
    outline-offset: 3px;
}
.ct-lesson-builder-editor .ct-builder-drag-handle:active { cursor: grabbing; }
.ct-lesson-builder-editor .ct-builder-control[data-action="resize"] { cursor: ew-resize; touch-action: none; }
.ct-lesson-builder-editor .ct-builder-control-danger {
    border-color: transparent;
    background: transparent;
    color: #ae3b4c;
}
.ct-lesson-builder-editor .ct-builder-control-danger:hover { border-color: #efb8c0; background: #fff0f2; color: #9d2638; }
.ct-lesson-builder-editor .ct-builder-control-group,
.ct-lesson-builder-editor .ct-builder-node-actions,
.ct-lesson-builder-editor .ct-builder-row-actions,
.ct-lesson-builder-editor .ct-builder-topic-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 0;
}
.ct-lesson-builder-editor .ct-builder-node-actions,
.ct-lesson-builder-editor .ct-builder-row-actions,
.ct-lesson-builder-editor .ct-builder-topic-actions { gap: 10px; }
.ct-lesson-builder-editor .ct-builder-order-controls {
    padding-inline-start: 9px;
    border-inline-start: 1px solid #dcd6e6;
}
.ct-lesson-builder-editor .ct-builder-order-controls > [data-action^="move-"] { border-color: transparent; background: transparent; }
.ct-lesson-builder-editor .ct-builder-order-controls > [data-action^="move-"]:hover { border-color: #c6b9dc; background: #eee9f7; }
.ct-lesson-builder-editor .ct-builder-row-card { margin-top: 22px; }
.ct-lesson-builder-editor .ct-builder-row-head {
    gap: 12px;
    min-height: 58px;
    margin: 0 0 12px;
    padding: 8px 10px;
    border: 1px solid #dcd3eb;
    border-radius: 10px;
    background: #ede9f4;
    color: #4e3c6a;
}
.ct-lesson-builder-editor .ct-builder-row-meta,
.ct-lesson-builder-editor .ct-builder-node-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    margin-inline-end: auto;
}
.ct-lesson-builder-editor .ct-builder-row-title {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 700;
}
.ct-lesson-builder-editor .ct-builder-row-count { color: #655776; font-size: 12px; white-space: nowrap; }
.ct-lesson-builder-editor .ct-builder-row-actions [data-action="add-item"] {
    border-color: #6843a9;
    background: #6843a9;
    color: #fff;
}
.ct-lesson-builder-editor .ct-builder-row-actions [data-action="add-item"]:hover { border-color: #54338e; background: #54338e; }
.ct-lesson-builder-editor .ct-builder-node {
    grid-template-columns: minmax(0, 1fr);
}
.ct-lesson-builder-editor .ct-builder-node > .ct-builder-node-head {
    container-type: inline-size;
    container-name: builder-content;
    grid-column: 1 / -1;
    align-self: stretch;
    align-content: center;
    gap: 8px 12px;
    min-width: 0;
    min-height: 56px;
    padding: 8px;
    border: 1px solid #dedbe6;
    border-radius: 9px;
    background: #fff;
    color: #494155;
}
.ct-lesson-builder-editor .ct-builder-node-head .ct-builder-node-title {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 1 auto;
    min-width: 0;
    color: #60438b;
    font-size: 13px;
    font-weight: 700;
    opacity: 1;
}
.ct-lesson-builder-editor .ct-builder-node-title > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-lesson-builder-editor .ct-builder-node-head .ct-builder-width {
    padding: 4px 7px;
    border: 1px solid #e6e2ee;
    border-radius: 5px;
    background: #f6f4fa;
    color: #655775;
    font-size: 12px;
    line-height: 1.5;
    white-space: nowrap;
    opacity: 1;
}
.ct-lesson-builder-editor .ct-builder-node > .ct-builder-node-body { margin-top: 12px; }
.ct-lesson-builder-editor .ct-builder-topic-card > [data-action="add-row"] {
    margin-top: 16px;
    border-style: dashed;
    background: #faf8fe;
}
[dir="rtl"] .ct-lesson-builder-editor .ct-builder-row-head,
[dir="rtl"] .ct-lesson-builder-editor .ct-builder-node-head { text-align: right; }
[dir="ltr"] .ct-lesson-builder-editor .ct-builder-row-head,
[dir="ltr"] .ct-lesson-builder-editor .ct-builder-node-head { text-align: left; }
@container builder-content (max-width: 430px) {
    .ct-lesson-builder-editor .ct-builder-node-actions { flex: 1 1 100%; justify-content: space-between; }
    [dir="rtl"] .ct-lesson-builder-editor .ct-builder-node-actions { justify-content: flex-end; }
}
@container builder-content (max-width: 280px) {
    .ct-lesson-builder-editor .ct-builder-node-actions { justify-content: flex-start; gap: 4px; }
    .ct-lesson-builder-editor .ct-builder-node-actions > .ct-builder-control-group { display: contents; }
    .ct-lesson-builder-editor .ct-builder-node-actions .ct-builder-control-label { display: none; }
    .ct-lesson-builder-editor .ct-builder-node-actions .ct-builder-control {
        width: clamp(28px, calc((100cqw - 16px) / 5), 40px);
        min-width: 28px;
        padding: 4px;
    }
}
@container builder-content (max-width: 155px) {
    .ct-lesson-builder-editor .ct-builder-node-actions > .ct-builder-control-group { display: flex; gap: 4px; }
    .ct-lesson-builder-editor .ct-builder-node-actions > .ct-builder-order-controls { padding-inline-start: 0; border-inline-start: 0; }
}
@media (max-width: 700px) {
    .ct-lesson-builder-editor .ct-builder-row-head { padding: 8px; }
    .ct-lesson-builder-editor .ct-builder-row-actions { flex: 1 1 100%; }
    .ct-lesson-builder-editor .ct-builder-row-actions > .ct-builder-control-group { flex-wrap: wrap; }
    .ct-lesson-builder-editor .ct-builder-row-actions > .ct-builder-control-group:first-child .ct-builder-control { padding-inline: 8px; font-size: 12px; }
    .ct-lesson-builder-editor .ct-builder-card-head { align-items: center; }
    .ct-lesson-builder-editor .ct-builder-topic-actions { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .ct-lesson-builder-editor .ct-builder-control,
    .ct-lesson-builder-editor .ct-builder-drag-handle { transition: none; }
}
