/* Mixed practice homework (rt-homework.js, migration 0012). Nothing here shows until
   rt-homework.js finds the homework table and sets <html data-hw="on">. */

/* Class gaps: "Set as homework" beside "Make a mixed set from these" (!important beats .practice-page [hidden] in tools.css) */
html[data-hw="on"] .cg-hw[hidden] { display: inline-flex !important; }

/* Teacher / tutor panel */
.hw-staff { margin: 0 0 1.25rem; padding: 0.9rem 1rem; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; background: var(--paper); }
.hw-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.hw-head h2 { margin: 0; font-size: 1.15rem; }
.hw-sub { margin: 0.35rem 0 0.6rem; font-size: 0.9rem; color: var(--text-soft); }
.hw-staff .btn { min-height: 44px; display: inline-flex; align-items: center; }
.hw-form { margin: 0.5rem 0 0.75rem; padding: 0.75rem; border: 1px dashed var(--line); border-radius: 10px; }
.hw-form h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.hw-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.hw-form .rag-field { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.9rem; font-weight: 600; max-width: 100%; }
.hw-form select, .hw-form input { min-height: 44px; max-width: 100%; font: inherit; }
.hw-add select { width: 100%; max-width: 28rem; }
.hw-title { margin-top: 0.5rem; }
.hw-title input { width: 100%; max-width: 32rem; }
.hw-label { margin: 0.6rem 0 0.25rem; font-size: 0.9rem; font-weight: 600; }
.hw-topics { margin: 0 0 0.5rem; padding-left: 1.2rem; }
.hw-topics li { margin: 0 0 0.3rem; overflow-wrap: anywhere; }
.hw-btns { margin: 0.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.4rem 0.6rem; }
.hw-list { list-style: none; margin: 0; padding: 0; }
.hw-item { padding: 0.6rem 0; border-top: 1px solid var(--line); }
.hw-item-head strong { display: block; overflow-wrap: anywhere; }
.hw-item-meta { font-size: 0.85rem; color: var(--text-soft); }
.hw-count { margin: 0.25rem 0 0; }
.hw-none { color: var(--text-soft); font-size: 0.9rem; }
.hw-table-wrap { overflow-x: auto; margin-top: 0.5rem; }
.hw-table { border-collapse: collapse; font-size: 0.9rem; min-width: 100%; }
.hw-table th, .hw-table td { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.hw-table th[scope="row"] { white-space: normal; overflow-wrap: anywhere; }
.hw-not { color: var(--text-soft); }
.hw-late { font-size: 0.78rem; font-weight: 700; color: #b83232; }

/* Pills (teacher table and pupil card) */
.hw-pill { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.82rem; font-weight: 700; background: var(--accent-soft, #eef2ff); color: var(--ink); white-space: nowrap; }
.hw-pill--green { background: #1e9e5a; color: #fff; }
.hw-pill--amber { background: #e8a33d; color: #1b1b1b; }
.hw-pill--red { background: #d64545; color: #fff; }
.hw-pill--late { background: #fbe3e3; color: #8f1f1f; }

/* Pupil card: library start screen and My progress */
.hw-card { margin: 1rem 0; padding: 0.8rem 1rem; border: 1px solid var(--line); border-left: 5px solid #e8a33d; border-radius: var(--r, 12px); background: var(--paper); }
.hw-card-h { margin: 0 0 0.2rem; font-size: 1.1rem; }
.hw-card-sub { margin: 0 0 0.5rem; font-size: 0.9rem; color: var(--text-soft); }
.hw-card-list { list-style: none; margin: 0; padding: 0; }
.hw-card-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.3rem 0.75rem; padding: 0.45rem 0; border-top: 1px solid var(--line); }
.hw-card-link { display: flex; flex-direction: column; min-height: 44px; justify-content: center; color: var(--accent); text-decoration: none; flex: 1 1 14rem; min-width: 0; }
.hw-card-link strong { overflow-wrap: anywhere; }
.hw-card-link:hover strong { text-decoration: underline; }
.hw-card-meta { font-size: 0.85rem; color: var(--text-soft); }
html[data-rt-role="teacher"] .hw-card, html[data-rt-role="tutor"] .hw-card { display: none !important; }

/* Mixed practice page in homework mode */
.mx-acct { margin: 0 0 0.75rem; }
.mx-hw-msg { font-weight: 600; }
.mx-hw-msg.is-error { color: #b83232; }

@media print { .hw-card, .hw-staff, .cg-hw, .mx-acct, .mx-hw-msg { display: none !important; } }
