/* tutor-tools: session notes, weekly summary and mark queries (see tutor-tools.js). Classes are prefixed tn-. */

.tn-muted { color: var(--muted); font-size: .85rem; }
.tn-sub { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 8px; }
.tn-sub .tn-muted { text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 4px; }
.tn-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.tn-status { font-size: .85rem; color: var(--ink-soft); }
.tn-hint { margin-top: 8px; }

/* form fields */
.tn-field { display: grid; gap: 5px; font-size: .78rem; font-weight: 600; color: var(--ink-soft); position: relative; min-width: 0; }
.tn-field textarea { font: inherit; font-size: .9rem; font-weight: 400; color: var(--ink); line-height: 1.45; padding: 9px 10px; border: 1px solid #cfd7e2; border-radius: var(--r-md); background: #fff; width: 100%; min-width: 0; resize: vertical; }
.tn-field textarea:focus, .tn-field input:focus, .tn-field select:focus { outline: 2px solid var(--violet); outline-offset: 1px; border-color: var(--violet); }
.tn-count { justify-self: end; font-size: .72rem; font-weight: 500; color: var(--muted); }
.tn-field-date { max-width: 220px; }

/* session notes */
.tn-note-form { display: grid; gap: 12px; }
.tn-note-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tn-note-list { list-style: none; display: grid; gap: 0; margin: 0; padding: 0; }
.tn-note { padding: 12px 0; border-top: 1px solid #edf0f4; }
.tn-note:first-child { border-top: none; }
.tn-note-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.tn-note-head strong { font-weight: 600; font-size: .94rem; }
.tn-note-parts { display: grid; gap: 8px; margin: 0; }
.tn-note-parts dt { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tn-note-parts dd { margin: 2px 0 0; color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }
.tn-earlier { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.tn-earlier summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--violet); }
.tn-earlier summary:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 4px; }

/* weekly summary */
.tn-week-head { flex-wrap: wrap; }
.tn-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; padding: 3px; background: #f6f7fa; }
.tn-seg button { font: inherit; font-size: .82rem; font-weight: 600; border: 0; background: none; color: var(--ink-soft); padding: 6px 14px; border-radius: 99px; cursor: pointer; }
.tn-seg button[aria-pressed="true"] { background: #fff; color: var(--violet); box-shadow: var(--shadow-sm); }
.tn-seg button:focus-visible { outline: 2px solid var(--violet); outline-offset: 1px; }
.tn-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tn-stat { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fbfbfd; }
.tn-stat-label { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tn-stat-value { font-family: var(--font-display); font-size: 1.55rem; font-weight: 600; line-height: 1.15; }
.tn-stat-value small { font-size: .9rem; font-weight: 500; color: var(--ink-soft); }
.tn-stat-sub { font-size: .8rem; color: var(--muted); }
.tn-week-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tn-bullets { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: .9rem; }
.tn-bullets .st-pill { margin-left: 4px; }
.tn-week-note { border-top: 1px solid var(--line); margin-top: 16px; }
.tn-copy-box { width: 100%; margin-top: 10px; font: .85rem/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 10px; border: 1px solid #cfd7e2; border-radius: var(--r-md); resize: vertical; }

/* the student's week */
.tn-kid-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tn-kid-list li { padding-left: 18px; position: relative; line-height: 1.45; }
.tn-kid-list li::before { content: ''; position: absolute; left: 2px; top: .55em; width: 7px; height: 7px; border-radius: 50%; background: var(--violet-soft); box-shadow: inset 0 0 0 2px var(--violet); }
.tn-kid-lead { color: var(--ink-soft); }

/* query lists (tutor and student) */
.tn-q-list { list-style: none; margin: 0; padding: 0; display: grid; }
.tn-q, .tn-myq { padding: 14px 0; border-top: 1px solid #edf0f4; display: grid; gap: 8px; }
.tn-q:first-child, .tn-myq:first-child { border-top: none; padding-top: 4px; }
.tn-q-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: .86rem; color: var(--ink-soft); }
.tn-q-head strong { color: var(--ink); font-weight: 600; }
.tn-q-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 16px; margin: 0; }
.tn-q-facts dt { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tn-q-facts dd { margin: 2px 0 0; font-size: .9rem; overflow-wrap: anywhere; }
.tn-myq .tn-muted { margin: 0; }

/* exam player: the button under the feedback, the results section */
.tn-ask-btn { margin-top: 10px; }
.tn-sent { display: inline-block; margin-top: 10px; font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
.tn-ask-sec { display: block; margin: 18px 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; }
.tn-ask-sec h3 { font-size: 1.02rem; margin: 0 0 4px; }
.tn-ask-row { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.tn-ask-row .tn-field { flex: 1 1 220px; max-width: 360px; }

/* the dialog */
.tn-modal { position: fixed; inset: 0; z-index: 300; background: rgba(9, 16, 32, .55); display: grid; place-items: center; padding: 16px; }
.tn-dialog { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: var(--r-lg); box-shadow: 0 18px 50px rgba(9, 16, 32, .25); padding: 22px; display: grid; gap: 12px; font-family: var(--font-body); color: var(--ink); }
.tn-dialog h2 { font-family: var(--font-display); font-size: 1.25rem; margin: 0; }
.tn-dialog-sub { margin: -6px 0 0; color: var(--muted); font-size: .88rem; }
.tn-dialog-body { display: grid; gap: 10px; }
.tn-dialog-body .tn-muted { margin: 0; }
.tn-dialog-done { margin: 0; font-weight: 600; }

@media (max-width: 980px) {
  .tn-week-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .tn-note-fields, .tn-stats, .tn-week-cols { grid-template-columns: 1fr; }
  .tn-field-date { max-width: none; }
  .tn-q-head { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* "Ask your tutor": conversations, the safeguarding line, the follow-up box, the lesson card */
.tn-kind { display: inline-block; margin-right: 6px; padding: 1px 8px; border-radius: 99px; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); background: #eef1f5; vertical-align: 1px; }
.tn-kind.is-question { color: var(--violet); background: var(--violet-soft); }
.tn-thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tn-msg { padding: 8px 12px; border-radius: var(--r-md); }
.tn-msg.is-student { border-left: 3px solid var(--violet); background: var(--violet-soft); border-radius: 0 var(--r-md) var(--r-md) 0; }
.tn-msg.is-tutor { border: 1px solid var(--line); background: #fbfbfd; }
.tn-msg-who { display: block; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tn-msg p { margin: 3px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.tn-safe { margin: 0; padding: 8px 12px; border-left: 4px solid #7a2f52; background: #fbf6f8; border-radius: 0 var(--r-md) var(--r-md) 0; font-size: .86rem; line-height: 1.5; color: var(--ink-soft); }
.tn-follow { display: grid; gap: 8px; }
.tn-follow > .btn { justify-self: start; }
.tn-follow-form { display: grid; gap: 8px; }
.tn-follow-form .tn-actions { margin-top: 0; }
.tn-field input[type="text"] { font-weight: 400; color: var(--ink); }
.tn-mine .st-card-head { align-items: center; flex-wrap: wrap; }
.tn-lesson-ask p { margin-top: 6px; color: var(--ink-soft); font-size: .92rem; line-height: 1.5; }
.tn-lesson-ask .tn-actions { margin-top: 10px; }
.tn-lesson-note:empty { display: none; }

/* weekly report for parents (email): preview, recipient, sent log; tutor home "Weekly reports" */
.tn-report-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; align-items: start; }
.tn-report-side { display: grid; gap: 12px; align-content: start; min-width: 0; }
.tn-report-side .tn-actions { margin-top: 0; }
.tn-report-side .tn-sub { margin: 8px 0 0; }
.tn-report-to { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fbfbfd; }
.tn-report-label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tn-report-addr { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.tn-report-addr .tn-muted { font-weight: 400; }
.tn-parent-form { display: grid; gap: 8px; }
.tn-parent-form .tn-muted { margin: 0; }
.tn-field input[type="email"] { font-weight: 400; color: var(--ink); }
.tn-report-why { margin: 0; padding: 8px 12px; border-left: 4px solid var(--sun); background: var(--sun-soft); border-radius: 0 var(--r-md) var(--r-md) 0; font-size: .86rem; line-height: 1.5; color: var(--ink-soft); }
.tn-report-alt a.btn { text-decoration: none; }
.tn-report-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .88rem; }
.tn-report-log li { padding: 6px 0; border-top: 1px solid #edf0f4; overflow-wrap: anywhere; }
.tn-report-log li:first-child { border-top: none; }
.tn-report-preview { min-width: 0; }
.tn-report-cap { margin: 0 0 6px; }
.tn-report-frame { display: block; width: 100%; height: 900px; border: 1px solid var(--line); border-radius: var(--r-md); background: #f4f6f9; }
#tnReportH:focus { outline: none; }
#tnReportH:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 4px; }
.tn-due-list { list-style: none; margin: 0; padding: 0; display: grid; }
.tn-due-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid #edf0f4; }
.tn-due-list li:first-child { border-top: none; }
.tn-due-list .st-pill { margin-left: 6px; }
@media (max-width: 980px) {
  .tn-report-grid { grid-template-columns: 1fr; }
}
