/* The staff portal's own styles, on top of ui.css (docs/REDESIGN_PLAN.md, "Approved design"):
   the tutor's pages in the redesign's look. Class names are prefixed by page: sh- Home, ls- Lessons,
   cm- the completion dialog, ts- Timesheet, sd- My students, av- My availability, py- Pay summaries,
   dc- Resources and How to use. */

.staff-app .hidden { display: none !important; }
.staff-app .muted { color: var(--ot-muted); }

/* ---------- Signing in (Home, signed out): the card alone, without the menu ---------- */
.staff-app.login-mode { background: linear-gradient(160deg, #E6F1FB 0%, #F4F6F8 46%, #E8F2FB 100%); }
.staff-app.login-mode .ot-shell { display: block; }
.staff-app.login-mode .ot-side, .staff-app.login-mode .ot-topbar { display: none; }
.staff-app.login-mode .ot-content { max-width: none; padding: 0; }
.login-hero { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card { background: #fff; border: 1px solid var(--ot-line); border-radius: 20px; box-shadow: 0 18px 50px rgba(32,135,201,.15); padding: 40px 34px 32px; width: 100%; max-width: 470px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.login-card img.stacked { width: 330px; max-width: 86%; height: auto; margin-bottom: 2px; }
.login-card h2 { margin: 0; font-size: 22px; }
.login-card p.muted { max-width: 380px; margin: 0; }
.gbtn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; margin-top: 8px; background: #fff; color: #3C4043; border: 1px solid #DADCE0; border-radius: 8px; padding: 11px 18px; font: 600 15px var(--ot-font); cursor: pointer; }
.gbtn:hover { background: #F7F8F8; box-shadow: 0 1px 3px rgba(0,0,0,.10); }
.sh-login-msg { text-align: left; max-width: 380px; }
.sh-login-help { margin-top: 6px !important; font-size: 14.5px; }
.sh-login-help a { font-weight: 600; white-space: nowrap; }

/* ---------- Home ---------- */
.sh-announce { position: relative; overflow: hidden; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 16px; padding: 20px 24px; border-radius: var(--ot-r-lg); background: linear-gradient(120deg, #1657C4 0%, #124AA6 100%); color: #fff; margin-bottom: 20px; box-shadow: 0 8px 22px rgba(22,87,196,.25); }
.sh-announce::after { content: ""; position: absolute; right: -40px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.08); pointer-events: none; }
.sh-announce-ic { width: 48px; height: 48px; border-radius: 14px; background: rgba(255,255,255,.16); color: #fff; display: grid; place-items: center; }
.sh-announce-from { font-size: 13.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #EAF4FB; }
.sh-announce h2 { font-size: 19px; margin: 2px 0 4px; color: #fff; }
.sh-announce p { white-space: pre-wrap; color: #fff; margin: 0; position: relative; overflow-wrap: anywhere; }
.sh-g2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 24px; align-items: start; margin-top: 24px; }
.sh-g3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: start; margin-top: 24px; }
.sh-head { padding-bottom: 14px; }
.sh-ph { display: flex; align-items: center; gap: 10px; }
.sh-ph h2 { font-size: 18px; }
.sh-pi { width: 34px; height: 34px; border-radius: 10px; background: var(--ot-blue-soft); color: var(--ot-blue-strong); display: grid; place-items: center; flex: none; }
.sh-pi .ot-ic { width: 18px; height: 18px; }
.sh-pi-lg { width: 40px; height: 40px; border-radius: 12px; }
.sh-pad { padding: 4px 24px 18px; }
.sh-pad > .ot-callout + .ot-btn { margin-top: 10px; }
.sh-sub { padding: 0 24px 10px; margin: -6px 0 0; font-size: 13.5px; }
.sh-lrow { display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 24px; border-top: 1px solid var(--ot-line-soft); }
.sh-when { font-weight: 700; line-height: 1.3; }
.sh-when span { display: block; font-weight: 500; font-size: 14px; color: var(--ot-muted); }
.sh-who { font-weight: 650; overflow-wrap: anywhere; }
.sh-meta { font-size: 14px; color: var(--ot-muted); }
.sh-act { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.sh-rule { margin: 0; padding: 12px 24px 18px; border-top: 1px solid var(--ot-line-soft); font-size: 14px; color: var(--ot-ink-2); }
.sh-empty { border-top: 1px solid var(--ot-line-soft); }
.sh-big { padding: 4px 24px 14px; }
.sh-big .k { font-size: 14px; color: var(--ot-muted); }
.sh-big .v { font-size: 34px; font-weight: 750; letter-spacing: -.01em; color: var(--ot-blue-strong); font-variant-numeric: tabular-nums; }
.sh-big .hrs { font-size: 15px; color: var(--ot-ink-2); }
.sh-runs, .sh-mini { list-style: none; margin: 0; padding: 0 0 6px; }
.sh-runs li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 24px; border-top: 1px solid var(--ot-line-soft); font-size: 14.5px; }
.sh-runs .r { color: var(--ot-ink-2); }
.sh-runs .a { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.sh-runs .a small { display: block; font-weight: 500; font-size: 13px; color: var(--ot-muted); }
.sh-mini li { display: flex; align-items: center; gap: 12px; padding: 11px 24px; border-top: 1px solid var(--ot-line-soft); }
.sh-mini .t { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.sh-mini .s { font-size: 13.5px; color: var(--ot-muted); }
.sh-end { margin-left: auto; }
.sh-pf { padding: 12px 24px 18px; border-top: 1px solid var(--ot-line-soft); }
.sh-avg { display: grid; grid-template-columns: 34px repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px 24px 12px; }
.sh-avg .gh { font-size: 11.5px; font-weight: 600; color: var(--ot-muted); text-align: center; }
.sh-avg .gd { font-size: 13px; font-weight: 650; color: var(--ot-ink-2); }
.sh-avg .c { height: 20px; border-radius: 5px; background: #EEF2F6; }
.sh-avg .c.on { background: var(--ot-blue); }
.sh-avail-foot { display: grid; gap: 12px; justify-items: start; }
.sh-avail-foot .ot-callout { font-size: 14px; }
.sh-links { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.sh-links a { display: flex; align-items: center; gap: 14px; padding: 16px 20px; text-decoration: none; color: var(--ot-ink); background: #fff; border: 1px solid var(--ot-line); border-radius: var(--ot-r-md); }
.sh-links a:hover { border-color: var(--ot-line-input); }
.sh-links b { display: block; }
.sh-links span.s { font-size: 13.5px; color: var(--ot-muted); }
.sh-chev { margin-left: auto; color: var(--ot-muted); width: 16px; height: 16px; }
@media (max-width: 1180px) { .sh-g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 1100px) { .sh-g2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .sh-g3, .sh-links { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .sh-announce { grid-template-columns: 1fr; padding: 16px; }
  .sh-lrow { grid-template-columns: minmax(0, 1fr) auto; padding: 14px 16px; gap: 6px 12px; }
  .sh-lrow .sh-body, .sh-lrow .sh-act { grid-column: 1 / -1; }
  .sh-lrow .sh-act { justify-content: flex-start; }
  .sh-pad, .sh-sub, .sh-rule, .sh-big, .sh-runs li, .sh-mini li, .sh-pf, .sh-avg { padding-left: 16px; padding-right: 16px; }
}

/* ---------- Lessons ---------- */
.ls-msg { margin-bottom: 20px; }
.ls-msg:empty { display: none; }
.ls-rule { margin-bottom: 20px; border-left: 5px solid var(--ot-warn); }
.ls-head { padding-bottom: 4px; }
.ls-count { font-size: 14px; }
.ls-sub { margin: 0; padding: 0 24px 14px; font-size: 14px; }
.ls-pad { padding: 4px 24px 20px; }
.ls-pad > .ot-callout + .ot-btn { margin-top: 10px; }
.ls-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 170px 300px; gap: 16px; align-items: center; padding: 16px 24px; border-top: 1px solid var(--ot-line-soft); }
.ls-when { font-weight: 700; line-height: 1.3; }
.ls-when span { display: block; font-weight: 500; font-size: 14px; color: var(--ot-muted); }
.ls-who { font-weight: 650; overflow-wrap: anywhere; }
.ls-meta { font-size: 14px; color: var(--ot-muted); }
.ls-act { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.ls-blocked { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--ot-warn); font-weight: 600; line-height: 1.4; }
.ls-blocked .ot-ic { width: 16px; height: 16px; margin-top: 2px; flex: none; }
.ls-more { position: relative; }
.ls-more .ot-ic { transition: transform var(--ot-t); }
.ls-empty { border-top: 1px solid var(--ot-line-soft); }
.ls-add-hint { margin-top: 12px; }
#addMsg:empty, #cm-msg:empty, #cm-errs:empty { display: none; }
#addMsg { margin-bottom: 16px; }
@media (max-width: 1100px) { .ls-row { grid-template-columns: 110px minmax(0, 1fr) auto; } .ls-act { grid-column: 2 / -1; justify-content: flex-start; } }
@media (max-width: 640px) {
  .ls-row { grid-template-columns: minmax(0, 1fr) auto; padding: 14px 16px; gap: 6px 12px; }
  .ls-pay { grid-column: 2; grid-row: 1; }
  .ls-body, .ls-act { grid-column: 1 / -1; }
  .ls-act { flex-wrap: wrap; }
  .ls-act > .ot-btn-primary { flex: 1 1 auto; }
  .ls-sub, .ls-pad { padding-left: 16px; padding-right: 16px; }
}

/* ---------- Completing a lesson: three parts in one dialog ---------- */
dialog.ot-dlg.cm { width: min(1060px, calc(100vw - 48px)); height: min(920px, calc(100vh - 48px)); overflow: hidden; }
.cm-wrap { flex: 1; min-height: 0; display: grid; grid-template-columns: 230px minmax(0, 1fr); border-top: 1px solid var(--ot-line); margin-top: 14px; }
.cm-steps { border-right: 1px solid var(--ot-line); padding: 20px 14px; background: #FAFBFC; }
.cm-steps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.cm-steps button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 10px; border: 0; border-radius: 10px; background: none; text-align: left; font: 600 15px var(--ot-font); color: var(--ot-ink-2); cursor: pointer; }
.cm-steps button:hover { background: #F0F4F8; }
.cm-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #E6ECF2; color: var(--ot-ink-2); font-size: 13px; font-weight: 700; flex: none; }
.cm-steps .cm-done .cm-n { background: var(--ot-ok); color: #fff; }
.cm-st { display: block; font-size: 12.5px; font-weight: 500; color: var(--ot-muted); }
.cm-body { position: relative; overflow-y: auto; padding: 24px 32px 40px; }
.cm-body > #cm-msg, .cm-body > #cm-errs { max-width: 720px; margin-bottom: 20px; }
.cm-sec { max-width: 720px; }
.cm-sec + .cm-sec { margin-top: 36px; padding-top: 32px; border-top: 1px solid var(--ot-line-soft); }
.cm-sec > h3 { display: flex; align-items: center; gap: 10px; font-size: 19px; margin: 0 0 14px; }
.cm-family { margin-bottom: 18px; }
.cm-gen-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.cm-once { margin-top: 14px; }
.cm-skip { margin-top: 14px; }
.cm-done-msg { display: flex; margin-bottom: 14px; }
.cm-sum { min-height: 120px; }
.cm-hw-field { margin-top: 18px; }
.cm-tabs { margin-bottom: 12px; }
.cm-hw { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; min-height: 220px; }
.cm-ws { border: 1px solid var(--ot-line); border-radius: var(--ot-r-md); padding: 18px 20px; background: #fff; overflow-x: auto; }
.cm-drop { border: 1.5px dashed #AFC0CF; border-radius: var(--ot-r-md); padding: 18px; text-align: center; background: var(--ot-blue-tint); color: var(--ot-ink-2); }
.cm-drop.drag { border-color: var(--ot-blue-strong); background: var(--ot-blue-soft); }
.cm-drop > .ot-ic { color: var(--ot-blue-strong); }
.cm-linkish { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--ot-blue-strong); text-decoration: underline; cursor: pointer; }
.cm-filerow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--ot-blue-soft-line); background: var(--ot-blue-soft); border-radius: var(--ot-r-md); }
.cm-fname { font-weight: 650; word-break: break-all; }
.cm-remove { margin-left: auto; color: var(--ot-bad); }
.cm-family-box { border: 1px solid var(--ot-line); border-radius: var(--ot-r-md); overflow: hidden; margin-top: 22px; }
.cm-fh { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: #F8FAFB; border-bottom: 1px solid var(--ot-line-soft); font-weight: 700; }
.cm-fb { padding: 14px 16px; display: grid; gap: 10px; font-size: 15px; overflow-wrap: anywhere; }
.cm-fam-head { font-size: 13.5px; font-weight: 600; color: var(--ot-muted); }
.cm-fam-line { display: flex; gap: 8px; align-items: center; }
.cm-foot { border-top: 1px solid var(--ot-line); align-items: center; }
.cm-foot-note { margin-right: auto; font-size: 14px; color: var(--ot-muted); }
@media (max-width: 860px) {
  .cm-wrap { grid-template-columns: minmax(0, 1fr); }
  .cm-steps { display: none; }
  .cm-body { padding: 16px 16px 32px; }
}
@media (max-width: 640px) {
  dialog.ot-dlg.cm { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .cm-wrap { margin-top: 10px; }
  .cm-foot-note { display: none; }
  .ot-scale { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* ---------- Timesheet ---------- */
.ts-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 24px; }
.ts-facts > div { padding: 16px 24px; }
.ts-facts > div + div { border-left: 1px solid var(--ot-line-soft); }
.ts-facts .k { font-size: 13.5px; color: var(--ot-muted); }
.ts-facts .v { font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; }
.ts-facts .ts-owed { color: var(--ot-blue-strong); }
.ts-head { padding-bottom: 4px; }
.ts-count { font-size: 14px; }
.ts-sub { margin: 0; padding: 0 24px 14px; font-size: 14px; }
.ts-pad { padding: 4px 24px 20px; }
.ts-pad > .ot-callout + .ot-btn { margin-top: 10px; }
.ts-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 120px 300px; gap: 16px; align-items: center; padding: 14px 24px; border-top: 1px solid var(--ot-line-soft); }
.ts-when { font-weight: 700; }
.ts-who { font-weight: 650; overflow-wrap: anywhere; }
.ts-meta, .ts-notes { font-size: 14px; color: var(--ot-muted); overflow-wrap: anywhere; }
.ts-notes { color: var(--ot-ink-2); }
.ts-pay { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.ts-k { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ts-act { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.ts-old { font-size: 14px; }
.ts-empty { border-top: 1px solid var(--ot-line-soft); }
.ts-ai { display: grid; gap: 16px; }
.ts-gen-row, .ts-prev-row, .ts-save-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ts-state { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ts-sum { min-height: 110px; }
.ts-hw { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; min-height: 200px; }
.ts-ws { border: 1px solid var(--ot-line); border-radius: var(--ot-r-md); padding: 16px 20px; background: #fff; overflow-x: auto; }
.ts-ws .ot-section-title { margin-bottom: 8px; }
.ts-filebox { display: grid; gap: 8px; padding-top: 16px; border-top: 1px solid var(--ot-line-soft); }
@media (max-width: 1100px) { .ts-row { grid-template-columns: 110px minmax(0, 1fr) auto; } .ts-act { grid-column: 2 / -1; justify-content: flex-start; } }
@media (max-width: 640px) {
  .ts-facts { grid-template-columns: 1fr 1fr; }
  .ts-facts > div { padding: 12px 16px; }
  .ts-facts > div:first-child { grid-column: 1 / -1; border-bottom: 1px solid var(--ot-line-soft); }
  .ts-facts > div:nth-child(2) { border-left: 0; }
  .ts-row { grid-template-columns: minmax(0, 1fr) auto; padding: 14px 16px; gap: 4px 12px; }
  .ts-body, .ts-act { grid-column: 1 / -1; }
  .ts-pay { grid-column: 2; grid-row: 1; }
  .ts-act { justify-content: flex-start; margin-top: 6px; }
  .ts-sub, .ts-pad { padding-left: 16px; padding-right: 16px; }
}

/* ---------- My students ---------- */
.sd-sum { font-size: 14px; }
.sd-pick { padding: 4px 24px 16px; max-width: 420px; }
.sd-tl { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ot-line); }
.sd-item { padding: 14px 24px; border-bottom: 1px solid var(--ot-line-soft); overflow-wrap: anywhere; }
.sd-item:last-child { border-bottom: 0; }
.sd-date { font-weight: 700; }
.sd-date span { font-weight: 500; font-size: 14px; color: var(--ot-muted); margin-left: 6px; }
.sd-title { font-weight: 600; margin-top: 4px; }
.sd-fb { margin-top: 4px; color: var(--ot-ink-2); white-space: pre-wrap; }
.sd-none { margin: 0; padding: 4px 24px 20px; }
@media (max-width: 640px) { .sd-pick, .sd-item, .sd-none { padding-left: 16px; padding-right: 16px; } .sd-pick { max-width: none; } }

/* ---------- My availability ---------- */
.av-upd { font-size: 14px; }
.av-sub { margin: 0; padding: 0 24px 16px; font-size: 14px; }
.av-grid { display: grid; grid-template-columns: 110px repeat(3, minmax(0, 1fr)); gap: 6px; max-width: 640px; padding: 0 24px; }
.av-gh { font-size: 13px; font-weight: 600; color: var(--ot-muted); text-align: center; align-self: end; }
.av-gd { font-weight: 650; font-size: 14.5px; display: flex; align-items: center; }
.av-cell { min-height: 44px; border: 1.5px solid var(--ot-line-button); border-radius: 8px; background: #fff; cursor: pointer; font: 600 13px var(--ot-font); color: #fff; }
.av-cell:hover { border-color: var(--ot-line-input); }
.av-cell.on { background: var(--ot-blue-strong); border-color: var(--ot-blue-strong); }
.av-cell:focus-visible { outline: 3px solid var(--ot-blue-strong); outline-offset: 2px; }
.av-acts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 20px 24px 24px; }
@media (max-width: 640px) { .av-grid { grid-template-columns: 74px repeat(3, minmax(0, 1fr)); gap: 4px; padding: 0 16px; } .av-gd { font-size: 13.5px; } .av-sub, .av-acts { padding-left: 16px; padding-right: 16px; } }

/* ---------- Pay summaries ---------- */
.py-table { border-top: 1px solid var(--ot-line); }
.py-table td:first-child { white-space: nowrap; }
.py-owed { font-weight: 700; }
.py-msg { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 0 24px; }
.py-msg p { margin: 12px 0; }
.py-msg p:empty { display: none; }
.py-empty { margin: 0; padding: 4px 24px 20px; }

/* ---------- Resources and How to use ---------- */
.dc-form { overflow: hidden; }
.dc-form iframe { display: block; width: 100%; height: 1100px; border: 0; }
.dc-panel + .dc-panel { margin-top: 24px; }
.dc-body { padding: 4px 24px 24px; }
.dc-body > p { margin: 0 0 12px; }
.dc-ol, .dc-ul { margin: 0; padding-left: 22px; display: grid; gap: 10px; }
.dc-item { display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--ot-line-soft); }
.dc-item:first-child { border-top: 0; padding-top: 0; }
.dc-item .d { color: var(--ot-muted); font-size: 14.5px; line-height: 1.5; margin-top: 2px; }
.dc-ul + p { margin: 16px 0 0; }
@media (max-width: 640px) { .dc-body { padding: 4px 16px 18px; } .dc-form iframe { height: 78vh; } }

/* ---------- Homework worksheets, as worksheet.js renders them ---------- */
.ws { font-size: 15.5px; line-height: 1.7; max-width: 68ch; overflow-x: auto; }
.ws-h { font-size: 15.5px; font-weight: 800; margin: 14px 0 4px; }
.ws-h:first-child { margin-top: 0; }
.ws-q { display: flex; gap: 10px; margin: 8px 0; }
.ws-qn { font-weight: 700; min-width: 1.8em; flex: none; }
.ws p { margin: 6px 0; }
.katex { font-size: 1.04em; }
