/* Course templates, course sessions and course emails (2026-09-25). Every class starts ct-, so
   nothing here can restyle another part of the dashboard. Colours come from styles.css's own
   variables, with fallbacks so the preview page renders the same without it. */
.ct-root { --ct-line: var(--line, #e5e7eb); --ct-muted: var(--muted, #6b7280); --ct-blue: var(--blue, #3a6ea5);
  --ct-green: var(--green, #2e8b57); --ct-amber: var(--amber, #b9770e); --ct-amber-bg: var(--amber-bg, #fdf3e3);
  --ct-red: var(--red, #c0504d); background: var(--panel, #fff); border-radius: var(--radius, 10px);
  box-shadow: var(--shadow, 0 1px 3px rgba(0,0,0,.08)); padding: 1rem 1.1rem 1.4rem; max-width: 1100px; }
.ct-root h2 { margin: 0; font-size: 1.25rem; }
.ct-root h3 { margin: 1rem 0 .4rem; font-size: 1.05rem; }
.ct-root h4 { margin: .9rem 0 .35rem; font-size: .92rem; }
.ct-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-bottom: .6rem; }
.ct-banner { background: #eef2f7; border: 1px solid var(--ct-line); border-radius: 8px; padding: .5rem .7rem; font-size: .88rem; margin: .4rem 0 .6rem; }
.ct-status { min-height: 1.2em; color: var(--ct-muted); font-size: .85rem; margin: .2rem 0; }
.ct-error { color: var(--ct-red); font-weight: 600; }
.ct-muted { color: var(--ct-muted); font-size: .85rem; }
.ct-ok-text { color: var(--ct-green); }
.ct-warn-text { color: var(--ct-amber); }
.ct-inline { display: inline-flex; align-items: center; gap: .4rem; }
.ct-root label { display: block; margin: .35rem 0; font-size: .9rem; }
.ct-root label.ct-inline, .ct-root label.ct-check { display: inline-flex; margin-right: .8rem; }
.ct-root input, .ct-root select, .ct-root textarea { font: inherit; padding: .35rem .45rem; border: 1px solid var(--ct-line); border-radius: 6px; max-width: 100%; }
.ct-root label > input:not([type=checkbox]):not([type=radio]), .ct-root label > textarea { display: block; width: 100%; box-sizing: border-box; margin-top: .15rem; }
.ct-root textarea { font-family: inherit; line-height: 1.4; }
.ct-root button { font: inherit; padding: .4rem .75rem; border-radius: 6px; border: 1px solid var(--ct-line); background: #fff; color: inherit; cursor: pointer; }
.ct-root button.ct-primary { background: var(--ct-blue); color: #fff; border-color: var(--ct-blue); }
.ct-root button:disabled { opacity: .5; cursor: not-allowed; }
.ct-root button:focus-visible, .ct-root summary:focus-visible { outline: 2px solid var(--ct-blue); outline-offset: 2px; }
.ct-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .6rem 0; }
.ct-off { color: var(--ct-muted); font-size: .8rem; font-style: italic; }
.ct-pill { display: inline-block; font-size: .75rem; padding: .08rem .45rem; border-radius: 999px; background: #eef0f3; margin-left: .3rem; white-space: nowrap; }
.ct-pill.ct-ok { background: #e3f3ea; color: #1f6b43; }
.ct-pill.ct-warn { background: var(--ct-amber-bg); color: #6b4a06; }
.ct-callout { background: #eef2f7; border: 1px solid var(--ct-line); border-radius: 8px; padding: .55rem .75rem; margin: .6rem 0; font-size: .9rem; }
.ct-callout.ct-warn { background: var(--ct-amber-bg); border-color: #f0d9ad; }
.ct-callout ul { margin: .3rem 0 0 1.1rem; padding: 0; }
.ct-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .5rem; margin: .5rem 0; }
.ct-kpi { border: 1px solid var(--ct-line); border-radius: 8px; padding: .5rem .6rem; font-size: .8rem; color: var(--ct-muted); background: #fafbfc; }
.ct-kpi span { display: block; font-size: 1.3rem; font-weight: 700; color: var(--ink, #1f2933); }
.ct-kpi.ct-ok span { color: var(--ct-green); }
.ct-kpi.ct-warn span { color: var(--ct-amber); }
.ct-card { border: 1px solid var(--ct-line); border-radius: 10px; padding: .7rem .9rem; margin: .8rem 0; }
.ct-card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem; }
.ct-card-head h3 { margin: 0; }
.ct-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .4rem 1.2rem; }
.ct-grid ul, .ct-times { margin: .2rem 0; padding-left: 1.1rem; font-size: .9rem; }
.ct-rule { font-weight: 600; margin: .2rem 0; }
.ct-problems { background: var(--ct-amber-bg); border-radius: 8px; padding: .4rem .7rem; margin: .5rem 0; }
.ct-problems ul { margin: .2rem 0 .2rem 1.1rem; padding: 0; font-size: .88rem; }
.ct-preview { border: 1px solid var(--ct-line); border-radius: 8px; padding: .5rem .7rem; background: #fcfcfd; }
.ct-subject { font-weight: 600; margin: .1rem 0 .4rem; }
.ct-body { white-space: pre-wrap; word-wrap: break-word; font-family: inherit; font-size: .9rem; margin: 0; }
.ct-chip { display: inline-block; background: #e8eef7; border-radius: 4px; padding: 0 .3rem; font-size: .85em; }
.ct-chips { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin: .3rem 0; }
.ct-root button.ct-chip-btn { font-size: .78rem; padding: .15rem .45rem; background: #e8eef7; border-color: #d3dceb; }
.ct-text-version, .ct-approved, .ct-not-approved { margin: .15rem 0; font-size: .88rem; }
.ct-approved { color: var(--ct-green); font-weight: 600; }
.ct-not-approved { color: var(--ct-amber); font-weight: 600; }
.ct-editor, .ct-create, .ct-settings, .ct-materials, .ct-move { border: 1px solid var(--ct-line); border-radius: 8px; padding: .6rem .8rem; margin: .5rem 0; background: #fbfcfe; }
.ct-editor fieldset, .ct-create fieldset { border: 1px solid var(--ct-line); border-radius: 6px; margin: .5rem 0; padding: .4rem .6rem; }
.ct-when input[type=number] { width: 4.5rem; }
.ct-table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.ct-table th, .ct-table td { border-bottom: 1px solid var(--ct-line); padding: .4rem .35rem; text-align: left; vertical-align: top; }
.ct-steps { padding-left: 1.3rem; }
.ct-step { border-bottom: 1px solid var(--ct-line); padding: .45rem 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem; }
.ct-step-main { flex: 1 1 320px; }
.ct-step-actions { display: flex; flex-wrap: wrap; gap: .3rem; align-items: flex-start; }
.ct-programs { list-style: none; padding: 0; }
.ct-program { border: 1px solid var(--ct-line); border-radius: 8px; padding: .5rem .8rem; margin: .5rem 0; }
.ct-program ul { padding-left: 1.1rem; }
.ct-program li { margin: .3rem 0; }
.ct-more summary { cursor: pointer; font-size: .85rem; color: var(--ct-blue); }
.ct-help { display: inline-block; vertical-align: middle; font-size: .8rem; font-weight: 400; }
.ct-help > summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; width: 1.25rem; height: 1.25rem;
  border-radius: 50%; border: 1px solid var(--ct-line); cursor: pointer; color: var(--ct-blue); }
.ct-help > summary::-webkit-details-marker { display: none; }
.ct-help-body { position: absolute; z-index: 20; max-width: 320px; background: #fff; border: 1px solid var(--ct-line); border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,.12); padding: .5rem .7rem; margin-top: .3rem; color: var(--ink, #1f2933); }
.ct-help-body p { margin: .35rem 0; }
@media (max-width: 600px) {
  .ct-root { padding: .7rem; }
  .ct-table thead { display: none; }
  .ct-table tr { display: block; border-bottom: 1px solid var(--ct-line); padding: .3rem 0; }
  .ct-table th, .ct-table td { display: block; border: 0; padding: .15rem 0; }
  .ct-help-body { left: .7rem; right: .7rem; max-width: none; }
}
.ct-settings, .ct-create { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .2rem 1rem; align-items: end; }
.ct-create h3, .ct-create fieldset, .ct-create .ct-actions, .ct-create table, .ct-create ul, .ct-create p, .ct-create .ct-off { grid-column: 1 / -1; }
.ct-root label > select { display: block; margin-top: .15rem; }
.ct-root label.ct-inline > select, .ct-root .ct-when select { display: inline-block; margin-top: 0; }
.ct-root label.ct-inline { flex-wrap: wrap; max-width: 100%; }
.ct-root label.ct-inline > select { flex: 1 1 12rem; min-width: 0; max-width: 100%; }
.ct-root .ct-body, .ct-root .ct-subject, .ct-root li, .ct-root p { overflow-wrap: anywhere; }
.ct-tabs { display: flex; flex-wrap: wrap; gap: .3rem; margin: .4rem 0 .6rem; }
.ct-root .ct-tabs button[aria-current="page"] { background: var(--ct-blue); color: #fff; border-color: var(--ct-blue); }
.ct-cell-actions { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.ct-file-btn { display: inline-flex !important; align-items: center; gap: .3rem; border: 1px solid var(--ct-line); border-radius: 6px; padding: .3rem .6rem; cursor: pointer; margin: 0 !important; }
.ct-file-btn input[type=file] { width: 12rem; max-width: 100%; font-size: .8rem; }
.ct-history { margin: .2rem 0; padding-left: 1.1rem; font-size: .88rem; }

/* release 3: the course-level confirmation hold (course-templates-common.js holdPanel) */
.ct-hold { border: 1px solid var(--ct-line); border-radius: 10px; padding: .6rem .85rem; margin: .8rem 0; }
.ct-hold h3 { margin: 0 0 .35rem; font-size: 1rem; }
.ct-hold p { margin: .3rem 0; }
.ct-table-wrap { max-width: 100%; overflow-x: auto; }
/* release 3: a help trigger sits BESIDE its heading, never inside it (the dashboard's rule,
   tests/render_check_context_help.mjs B2c), so the heading's text and accessible name stay clean */
.ct-hwh { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.ct-create .ct-hwh { grid-column: 1 / -1; }

/* release 3: the Courses page (course-catalogue.js) */
.cc-list { list-style: none; margin: .6rem 0 0; padding: 0; }
.cc-item { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .4rem 1rem;
  border: 1px solid var(--ct-line); border-radius: 10px; padding: .6rem .8rem; margin-bottom: .6rem; }
.cc-item h3 { margin: 0 0 .15rem; }
.cc-item p { margin: 0; }
.cc-main { flex: 1 1 18rem; min-width: 0; }
.cc-crumb { font-size: .9rem; margin-bottom: .3rem; }
.cc-parts { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin: .4rem 0 .8rem; }
.cc-parts a { padding: .25rem 0; text-decoration: none; color: var(--ct-blue); border-bottom: 2px solid transparent; }
.cc-parts a[aria-current="page"] { border-bottom-color: var(--ct-blue); font-weight: 600; color: inherit; }
.cc-parts a.cc-schedule { margin-left: auto; }
.cc-deliveries { padding-left: 1.1rem; }
.cc-deliveries li { margin: .3rem 0; }
.cc .ct-root { box-shadow: none; padding: 0; }
