/* Royal CIC dashboard - the teacher's home and its short forms (v25). Loaded after admin.css. Phone first (390 px), 44 px minimum targets,
   logical properties only (right-to-left safe). */
.tday { display: grid; gap: var(--space-4); min-inline-size: 0; }
.tday-date { margin: 0; font-size: 1.375rem; line-height: 1.25; font-weight: 700; color: var(--text-heading); }

/* check-in: one line */
.tday-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 8px 12px; background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius-md); }
.tday-in .tday-line { flex: 1 1 10rem; min-inline-size: 0; }
.tday-in .btn { min-block-size: 48px; text-decoration: none; justify-content: center; }
.tday-st.is-ok { color: var(--success-text); font-weight: 700; }
.tday-st.is-todo { color: var(--warning-text); font-weight: 700; }

/* lessons */
.th-h { margin-block-end: var(--space-2); }
.th-sec { display: grid; gap: var(--space-3); }
/* the old red/green side stripe of admin.css (.th-slot) meant posted / not posted: not used any more */
.tday .th-slot { border-inline-start: 1.5px solid var(--border); }
.th-card { background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4); display: grid; gap: var(--space-3); min-inline-size: 0; }
.th-card.is-now, .th-card.is-next { border: 3px solid var(--blue-700); background: var(--blue-25); padding: calc(var(--space-4) - 1.5px); }
.th-card-h { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.th-time { font-size: 1.25rem; font-weight: 700; color: var(--text-heading); }
.th-pill { display: inline-flex; align-items: center; min-block-size: 28px; padding: 2px 12px; border-radius: var(--radius-pill); background: var(--blue-700); color: #fff; font-weight: 700; font-size: var(--text-sm); }
.th-card:not(.is-now):not(.is-next) .th-pill { background: var(--blue-100); color: var(--blue-800); }
.th-what { font-size: var(--text-lg); line-height: 1.4; overflow-wrap: anywhere; }
.th-per { display: inline-block; margin-inline-start: 8px; color: var(--text-muted); font-size: var(--text-sm); white-space: nowrap; }
.th-flash { margin: 0; padding: 10px 12px; border-radius: var(--radius-md); background: var(--success-bg); color: var(--success-text); font-weight: 700; }
.th-att { min-block-size: 56px; inline-size: 100%; justify-content: center; text-decoration: none; }
.th-none { text-align: center; justify-items: center; }
.th-none-t { margin: 0; font-size: var(--text-lg); font-weight: 700; }

/* the three big buttons */
.th-acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.th-act { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-block-size: 72px; padding: 8px 4px; background: #fff; color: var(--blue-800);
  border: 1.5px solid var(--blue-700); border-radius: var(--radius-md); font: 700 1rem/1.2 var(--font-body); text-align: center; cursor: pointer; white-space: normal; word-break: keep-all; overflow-wrap: normal; min-inline-size: 0; }
.th-act .i { inline-size: 28px; block-size: 28px; flex: none; }
.th-act-l { display: block; max-inline-size: 100%; }
.th-act-d { font-size: var(--text-xs); font-weight: 600; }
@media (hover: hover) { .th-act:hover { background: var(--blue-50); } }
.th-act:active { background: var(--blue-100); }
.th-act:focus-visible, .th-link:focus-visible, .th-chip:focus-visible, .th-past > summary:focus-visible { outline: var(--focus-width) solid var(--focus-color); outline-offset: var(--focus-offset); }
.th-act.is-done { background: var(--success-bg); border-color: var(--success-text); color: var(--success-text); }
@media (hover: hover) { .th-act.is-done:hover { background: #d8eedf; } }

/* finished lessons: thin rows */
.th-pastbox { display: grid; gap: 8px; margin-block-start: var(--space-2); }
.th-h3 { margin: 0; font-size: var(--text-base); color: var(--text-muted); }
.th-past { border: 1.5px solid var(--border); border-radius: var(--radius-md); background: #fff; padding: 0 12px; }
.th-past > summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 10px; min-block-size: 64px; padding-block: 8px; cursor: pointer; list-style: none; }
.th-past > summary::-webkit-details-marker { display: none; }
.th-past .th-time { font-size: var(--text-base); flex: none; }
.th-past-w { flex: 1 1 100%; order: 3; min-inline-size: 0; overflow-wrap: anywhere; font-weight: 600; }
.th-past-s { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: var(--text-sm); font-weight: 700; }
.th-past-s .i { inline-size: 18px; block-size: 18px; }
.th-past-s.is-ok { color: var(--success-text); }
.th-past-s.is-todo { color: var(--warning-text); }
.th-past[open] { padding-block-end: 12px; }
.th-past[open] > .th-acts, .th-past[open] > .th-flash { margin-block-start: 6px; }

/* single rows under the lessons */
.tday .th-det > summary { min-block-size: 56px; gap: 10px; }
.tday .th-det > summary .i { inline-size: 22px; block-size: 22px; flex: none; }
.th-row-t { flex: 1 1 auto; }
.th-count-b { display: inline-flex; align-items: center; justify-content: center; min-inline-size: 28px; block-size: 28px; padding-inline: 8px; border-radius: 14px; background: var(--red-700); color: #fff; font-weight: 700; font-size: var(--text-sm); }
.th-count-b[hidden] { display: none; }
.tday-msgbody { padding-block-end: var(--space-3); }
.tday .th-asg { padding-block: 12px; }
.tday-morelinks { display: grid; gap: var(--space-2); padding-block-start: var(--space-3); }
.tday-morelinks .btn { min-block-size: 56px; justify-content: center; text-decoration: none; }

/* the forms (bottom sheet on a phone) */
.th-sheet .dialog-title { font-size: var(--text-h3); }
.th-sheet .dialog-actions .btn { min-block-size: 56px; font-size: 1.0625rem; }
.th-body { display: grid; gap: var(--space-3); min-inline-size: 0; }
.th-sub { margin: 0; font-weight: 700; color: var(--text-muted); overflow-wrap: anywhere; }
.th-when { display: grid; gap: 4px; }
.th-when-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.th-when-t { font-weight: 600; }
.th-link { min-block-size: 44px; }
.th-form .control { min-block-size: 56px; font-size: 1.0625rem; }
.th-form textarea.control { min-block-size: 88px; }
.th-chipbox { display: grid; gap: 6px; }
.th-chip-h { margin: 0; font-weight: 700; }
.th-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.th-chip { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-block-size: 56px; min-inline-size: 5.5rem; padding: 6px 16px; gap: 0;
  background: #fff; border: 1.5px solid var(--border-control); border-radius: 28px; color: var(--blue-800); font: 700 1rem/1.25 var(--font-body); cursor: pointer; white-space: normal; word-break: keep-all; text-align: center; }
.th-chip-s { font-size: var(--text-xs); font-weight: 500; }
.th-chip[aria-pressed="true"] { background: var(--blue-700); border-color: var(--blue-700); color: #fff; }
@media (hover: hover) { .th-chip:hover { background: var(--blue-50); } .th-chip[aria-pressed="true"]:hover { background: var(--blue-800); } }
.th-more { margin-block-start: 0; }
.th-more > summary { min-block-size: 56px; }
.th-more[open] { padding-block-end: var(--space-3); }
.th-more > .field, .th-more > .med-pick, .th-more > .check, .th-more > .th-fill { margin-block-start: var(--space-3); }

/* marks */
.th-mbox { display: grid; gap: var(--space-3); min-inline-size: 0; }
.th-max .control { max-inline-size: 8rem; text-align: center; }
.th-search { inline-size: 100%; }
.th-mlist { margin: 0; }
.th-mrow { grid-template-columns: minmax(0, 1fr); gap: 6px; padding-block: 12px; }
.th-mrow[hidden] { display: none; }
.th-mname { font-size: var(--text-base); }
.th-mctl { display: flex; align-items: center; gap: 8px; min-inline-size: 0; }
.th-stars { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; inline-size: 100%; }
.th-star.ev-star { inline-size: auto; block-size: 56px; border-radius: var(--radius-md); font-size: 1.25rem; }
.th-score.ev-score { inline-size: 6rem; min-block-size: 56px; font-size: 1.25rem; }
.th-note { grid-column: 1 / -1; }
.th-fill { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.th-fill .field { flex: 1 1 9rem; }
.th-fill .btn { min-block-size: 56px; }
.th-count { position: sticky; inset-block-end: 0; margin: 0; padding: 10px 0; background: #fff; border-block-start: 2px solid var(--blue-100); font-weight: 700; color: var(--blue-800); z-index: 2; }

/* what I saved */
.th-saved { display: grid; gap: var(--space-3); }
.th-saved-list { display: grid; gap: var(--space-3); }
.th-saved-item { display: grid; gap: 8px; padding: 12px; border: 1.5px solid var(--border); border-radius: var(--radius-md); }
.th-saved-main { display: grid; gap: 2px; overflow-wrap: anywhere; }
.th-saved-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.th-saved-acts .btn { min-block-size: 44px; }

@media (max-width: 399px) { .th-act { font-size: .9375rem; } .th-chip { min-inline-size: 4.5rem; padding-inline: 12px; } }
@media print { .th-acts, .th-att, .th-link { display: none !important; } }
