/* Courses (#51): loaded after pages.css, so these win. */

/* Course list: a card never gets wider than its column, and its text wraps inside it
   (before, a long line pushed the centred text past the card edge, which cut it off). */
.cr-cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); min-width: 0; }
.cr-card { width: 100%; min-width: 0; box-sizing: border-box; justify-self: stretch; grid-template-columns: minmax(0, 1fr); text-align: left; align-content: start; }
.cr-card > * { min-width: 0; display: block; white-space: normal; overflow-wrap: anywhere; text-align: left; }
.cr-card > .cr-card-cover { display: grid; }
.cr-card .tag { display: inline-block; }
.page-modal .modal-card, #crBody { min-width: 0; }

/* pictures in text pages: never wider than the box */
.pg-img { display: block; max-width: 100%; height: auto; margin: 10px 0; border-radius: var(--r-ctl); border: 1px solid var(--line); }
.cr-page, .pg-preview { min-width: 0; max-width: 100%; }
.pg-tools .file-btn { display: inline-flex; align-items: center; }

/* import, levels, errors */
.cr-import { justify-self: start; margin-top: 2px; }
.cr-levels { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.cr-levels select { width: auto; flex: none; }
.cr-levels #crLvRange { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.cr-levels #crLvRange[hidden] { display: none; }
.cr-levels .num { width: 64px; flex: none; text-align: center; }
.cr-levels .hint { flex: 1 1 100%; margin: 0; }
.cr-error { color: var(--miss, #e5736b); }

/* Save: quiet until something is changed, then highlighted; "Saved ✓" for a moment */
.save-btn:not(.primary) { opacity: 0.85; }
.save-btn.saved { background: transparent; color: var(--perfect); border-color: var(--perfect); }

/* back to the course (#51) */
.cr-back-chip { white-space: nowrap; flex: none; align-self: center; border-color: var(--accent); color: var(--accent-text, var(--accent)); }
#crBackRes { border-color: var(--accent); white-space: nowrap; }
#crBackRes.primary { order: -1; }
