html[data-upgrade="cocoa"] .course-editor { width:min(760px,calc(100% - 32px)); background:#fff; }
.course-editor .course-editor-code { margin:18px 0; padding:14px 16px; border-radius:8px; background:#f4f0eb; }
.course-editor .course-editor-field { display:flex; flex-direction:column; gap:7px; min-width:0; font-size:13px; font-weight:650; }
.course-editor .course-editor-field input { width:100%; min-height:44px; padding:10px 12px; border:1px solid #d9cfc3; border-radius:7px; background:#fff; color:#382c24; font:inherit; box-sizing:border-box; }
.course-editor .course-editor-field input:focus { outline:2px solid #7a5943; outline-offset:2px; }
.course-editor .course-editor-field input[readonly] { background:#f7f5f2; color:#61584f; }
.course-editor .course-editor-hint { font-size:12px; line-height:1.6; margin-top:8px; color:#71685f; font-weight:400; }
.course-editor .course-editor-tabs { display:flex; gap:8px; border-bottom:1px solid #e4dcd2; padding-bottom:12px; margin-bottom:18px; }
.course-editor .course-editor-tabs button[aria-selected="true"],.course-editor .course-editor-instructor-tabs button[aria-pressed="true"] { background:#6e4e39; color:#fff; border-color:#6e4e39; }
.course-editor .course-editor-page,.course-editor .course-editor-instructor-body { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.course-editor .course-editor-page[hidden] { display:none!important; }
.course-editor .course-editor-page:last-of-type { display:block; }
.course-editor .course-editor-instructor-tabs { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:18px; }
.course-editor .workspace-error:empty { display:none; }
.course-editor .workspace-error { margin-top:16px; }
@media(max-width:560px){.course-editor .course-editor-page,.course-editor .course-editor-instructor-body{grid-template-columns:1fr}.course-editor .course-editor-tabs{gap:4px}.course-editor .course-editor-tabs button{padding:8px!important;flex:1}}

.course-editor .course-integration-status{grid-column:1 / -1;margin-top:18px;padding:16px;border:1px solid #ded6cc;border-radius:8px;background:#faf8f5}
.course-editor .course-integration-status h3{margin:0 0 12px;font-size:15px}
.course-editor .course-integration-table{width:100%;border-collapse:collapse;font-size:12px;line-height:1.6;table-layout:fixed}
.course-editor .course-integration-table th,.course-editor .course-integration-table td{text-align:left;padding:8px 5px;border-bottom:1px solid #e5ddd3;overflow-wrap:anywhere}
.course-editor .course-integration-table th{color:#685442}
.course-editor .course-integration-systems{display:grid;grid-template-columns:70px 1fr;gap:8px;margin:15px 0;font-size:12px;line-height:1.6}
.course-editor .course-integration-systems dt{font-weight:700}.course-editor .course-integration-systems dd{margin:0}

/* Center the native dialog even when the application resets global margins. */
html[data-upgrade="cocoa"] dialog.course-editor {
 position:fixed;inset:0;margin:auto!important;
 width:min(780px,calc(100vw - 48px));max-height:calc(100dvh - 64px);
 padding:30px 32px 24px;border:1px solid #e4d9ce;border-radius:18px;
 box-shadow:0 24px 80px #30211738;background:#fffdfb;
 overscroll-behavior:contain;scrollbar-gutter:stable;
}
html[data-upgrade="cocoa"] dialog.course-editor::backdrop{background:#30251f66;backdrop-filter:blur(4px);}
html[data-upgrade="cocoa"] .course-editor header h2{font-size:26px;letter-spacing:-.8px;line-height:1.4;}
html[data-upgrade="cocoa"] .course-editor header p{margin-top:7px;line-height:1.6;color:#807267;}
.course-editor .course-editor-code{margin:22px 0;padding:16px 18px;border:1px solid #ede4db;border-radius:12px;background:#f7f3ee;}
.course-editor .course-editor-code input{font-weight:750;letter-spacing:.5px;}
.course-editor .course-editor-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;width:min(100%,480px);margin:0 auto 24px;padding:5px;border:1px solid #e9e0d6;border-radius:12px;background:#f2ede7;}
html[data-upgrade="cocoa"] .course-editor .course-editor-tabs button{border:0;background:transparent;min-height:42px;padding:10px 14px;border-radius:8px;color:#786556;font-weight:700;transition:background .15s,box-shadow .15s;}
html[data-upgrade="cocoa"] .course-editor .course-editor-tabs button[aria-selected="true"]{background:#fff;color:#63432f;box-shadow:0 2px 8px #57402d18;}
.course-editor .course-editor-page,.course-editor .course-editor-instructor-body{gap:20px 22px;}
.course-editor .course-editor-field input{min-height:46px;border-color:#dfd5cb;border-radius:9px;}
.course-editor .course-integration-status{padding:18px;border-radius:12px;border-color:#e9e1d8;background:#f9f6f2;}
html[data-upgrade="cocoa"] .course-editor form>footer{position:sticky;bottom:-24px;z-index:1;margin-top:24px;padding:16px 0 0;border-top:1px solid #eee5dc;background:#fffdfb;}
html[data-upgrade="cocoa"] .course-editor form>footer button{min-height:44px;min-width:88px;border-radius:9px;}
@media(max-width:560px){
 html[data-upgrade="cocoa"] dialog.course-editor{width:calc(100vw - 24px);max-height:calc(100dvh - 24px);padding:22px 18px 18px;border-radius:14px;}
 html[data-upgrade="cocoa"] .course-editor form>footer{bottom:-18px;}
 .course-editor .course-editor-page,.course-editor .course-editor-instructor-body{grid-template-columns:1fr;}
 html[data-upgrade="cocoa"] .course-editor .course-editor-tabs button{padding:9px 5px;font-size:12px;}
}

.course-editor footer button[hidden]{display:none!important;}

.course-editor .integration-overview-heading,.course-editor .integration-card-heading,.course-editor .integration-status-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.course-editor .integration-overview-heading h3{margin:0}
.course-editor .integration-overview-note{font-size:12px;line-height:1.7;color:#776c61;margin:10px 0 14px}
.course-editor .integration-overview-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.course-editor .integration-system-card{padding:14px;border:1px solid #e4ddd5;border-left:3px solid #b8b0a6;border-radius:10px;background:#fff}
.course-editor .integration-system-card[data-kind="configured"]{border-left-color:#4d71ad}
.course-editor .integration-system-card[data-kind="ready"]{border-left-color:#3d817c}
.course-editor .integration-system-card[data-kind="unlinked"]{border-left-color:#bd704d}
.course-editor .integration-card-heading h4{font-size:14px;margin:0}
.course-editor .integration-card-scope{font-size:12px;font-weight:650;line-height:1.6;margin:10px 0 4px;color:#493f35}
.course-editor .integration-card-note{font-size:11px;line-height:1.6;color:#7c7065;margin:0}
.course-editor .integration-badge{display:inline-flex;align-items:center;border-radius:5px;padding:3px 7px;font-size:11px;line-height:1.5;font-weight:700;background:#eeeae5;color:#706459;white-space:nowrap}
.course-editor .integration-badge[data-kind="saved"]{background:#e1f0e5;color:#276345}
.course-editor .integration-badge[data-kind="ready"]{background:#e2efed;color:#286b65}
.course-editor .integration-badge[data-kind="configured"]{background:#e5edf9;color:#375e96}
.course-editor .integration-badge[data-kind="unlinked"],.course-editor .integration-badge[data-kind="error"]{background:#f8e7df;color:#954b2a}
.course-editor .integration-badge[data-kind="pending"]{background:#f6edda;color:#856323}
.course-editor .integration-fields-title{padding-top:16px;border-top:1px solid #e6ddd3;margin-top:16px!important}
.course-editor .course-integration-table small{display:block;font-size:10px;font-weight:400;line-height:1.6;margin-top:4px;color:#786f65}
.course-editor .integration-status-footer{margin-top:12px}
@media(max-width:560px){.course-editor .integration-overview-grid{grid-template-columns:1fr}}

.course-editor .editor-field-heading{display:flex;align-items:center;justify-content:space-between;gap:6px;flex-wrap:wrap;min-height:24px}
.course-editor .editor-field-badges{display:flex;gap:4px;flex-wrap:wrap;align-items:center}
.course-editor .editor-field-badges .integration-badge{font-size:10px;padding:2px 5px;letter-spacing:0;font-weight:650}
.course-editor .course-integration-status{padding:0;background:transparent;border:0;margin-top:12px}
.course-editor .integration-overview-details{border:1px solid #e5dcd2;border-radius:12px;background:#faf7f3;overflow:hidden}
.course-editor .integration-overview-details>summary{cursor:pointer;padding:15px 17px;font-size:13px;line-height:1.7;list-style-position:inside}
.course-editor .integration-summary-text{display:block;margin-left:17px;font-size:12px;font-weight:400;color:#807365}
.course-editor .integration-overview-content{padding:4px 17px 17px;border-top:1px solid #e8dfd5}
.course-editor .course-save-receipt{margin:18px 0;padding:16px;border:1px solid #b9d8c4;border-radius:12px;background:#eef8f1;scroll-margin-top:15px}
.course-editor .course-save-receipt[hidden]{display:none!important}
.course-editor .course-save-receipt h3{margin:0 0 10px;font-size:16px;color:#305a40}
.course-editor .course-save-receipt p{margin-top:10px;font-size:12px;line-height:1.7;color:#52624f}

+.course-editor .course-integration-status{margin-top:20px;padding:18px;border:1px solid #e5dcd2;border-radius:12px;background:#faf7f3}
+.course-editor .editor-field-badges .integration-badge{font-size:11px;padding:2px 6px}
+
.course-editor .integration-system-card[data-kind="saved"]{border-left-color:#3b8655;background:#f7fcf8;}
