/* Registers (script 119): the register-marking page. Mark colours and the
   segmented buttons follow the Register demo. */
:root{--ok:#17845a;--ok-soft:#dff3ea;--late:#a8690f;--late-soft:#fbefd9;--absent:#c03a34;--absent-soft:#fae3e1;--auth:#5d4fc9;--auth-soft:#e9e6fb}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--ok:#4cc58f;--ok-soft:#123326;--late:#e3a646;--late-soft:#3a2c12;--absent:#f07a73;--absent-soft:#3b1918;--auth:#a99cff;--auth-soft:#252047}}
:root[data-theme="dark"]{--ok:#4cc58f;--ok-soft:#123326;--late:#e3a646;--late-soft:#3a2c12;--absent:#f07a73;--absent-soft:#3b1918;--auth:#a99cff;--auth-soft:#252047}

.rfilters{display:flex;flex-wrap:wrap;gap:12px 16px;align-items:flex-end;margin-bottom:16px}
.rfilters label{display:flex;flex-direction:column;gap:4px;min-width:180px;flex:0 1 260px}
.rcohorts{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:12px}
.rcohort{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:14px 16px;display:flex;flex-direction:column;gap:6px;text-align:left;font:inherit;color:inherit;cursor:pointer}
.rcohort:hover{border-color:var(--peri)}
.rcohort b{font-family:var(--f-mono);font-weight:500;font-size:14px}
.rcohort .rtitle{font-weight:600;line-height:1.25}
.rcohort .rmeta{font-size:13px;color:var(--muted)}
.rcohort.rquiet{opacity:.72}
.rcohort .rrun{color:var(--ink);font-weight:500}

.rhead{display:flex;flex-wrap:wrap;gap:12px 24px;align-items:flex-end;justify-content:space-between;margin-bottom:14px}
.reyebrow{font-size:12px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.rheading{font-family:var(--f-brand);font-weight:700;font-size:clamp(22px,2.6vw,28px);line-height:1.1;margin:2px 0 0}
.rmetaline{display:flex;flex-wrap:wrap;gap:4px 16px;font-size:14px;color:var(--muted);margin-top:4px}
.rpanel{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:14px 16px}
.rpanel+.rpanel{margin-top:14px}

.rform{display:flex;flex-wrap:wrap;gap:10px 14px;align-items:flex-end}
.rform label{display:flex;flex-direction:column;gap:4px}
.rform .cfield{width:auto}
.rquick{display:flex;gap:6px;flex-wrap:wrap}
.rchip{border:1px solid var(--line);background:var(--surface);color:var(--ink);font:inherit;font-size:13.5px;padding:6px 11px;border-radius:999px;cursor:pointer}
.rchip:hover{border-color:var(--peri)}
.rchip[aria-pressed="true"]{background:var(--lilac-soft);border-color:var(--peri);color:var(--blue);font-weight:600}
.btn.rsmall{padding:7px 12px;font-size:14px}
.btn.rdanger{background:var(--absent);color:#fff}
.btn:disabled{opacity:.5;cursor:not-allowed;filter:none}

.rstack{display:flex;height:10px;border-radius:5px;overflow:hidden;background:var(--surface-2);border:1px solid var(--line)}
.rstack i{display:block;height:100%}
.rlegend{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:13.5px;margin-top:8px;align-items:center}
.rlegend b{font-variant-numeric:tabular-nums}
.rsw{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:6px;vertical-align:-1px}
.ractions{display:flex;flex-wrap:wrap;gap:8px;margin-left:auto}

.rrows{margin-top:14px;padding:0;overflow:hidden}
.rrow{display:grid;grid-template-columns:44px minmax(0,1fr) auto 36px;gap:12px;align-items:center;padding:8px 14px;border-bottom:1px solid var(--line)}
.rrow:last-child{border-bottom:0}
.rrow.rhdr{font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);font-weight:600;padding-top:10px;padding-bottom:10px;background:var(--surface-2)}
/* Initials until photos are sorted out (Stu, 2026-11-13); the hue comes from the learner ref. */
.ravatar{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;font-weight:600;font-size:14px;letter-spacing:.02em;flex:none;
  background:hsl(var(--h,230) 60% 91%);color:hsl(var(--h,230) 45% 30%)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .ravatar{background:hsl(var(--h,230) 35% 24%);color:hsl(var(--h,230) 70% 84%)}}
:root[data-theme="dark"] .ravatar{background:hsl(var(--h,230) 35% 24%);color:hsl(var(--h,230) 70% 84%)}
.rname{min-width:0}
.rname b{display:block;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rname small{display:block;color:var(--muted);font-size:12.5px}
.rtag{display:inline-block;font-size:11.5px;font-weight:600;padding:1px 7px;border-radius:999px;background:var(--warn-soft);color:var(--warn);margin-left:6px;vertical-align:1px}
.rtime{font-family:var(--f-mono);font-size:13px;color:var(--muted);text-align:right}
.rseg{display:inline-flex;border:1px solid var(--line);border-radius:8px;overflow:hidden}
.rseg button{border:0;background:var(--surface);width:42px;height:36px;font-family:var(--f-mono);font-weight:500;font-size:15px;border-right:1px solid var(--line);color:var(--muted);cursor:pointer}
.rseg button:last-child{border-right:0}
.rseg button:hover:not(:disabled){background:var(--surface-2);color:var(--ink)}
.rseg button[aria-pressed="true"].P{background:var(--ok);color:#fff}
.rseg button[aria-pressed="true"].L{background:var(--late);color:#fff}
.rseg button[aria-pressed="true"].O{background:var(--absent);color:#fff}
.rseg button[aria-pressed="true"].A{background:var(--auth);color:#fff}
.rseg button:disabled{cursor:not-allowed}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .rseg button[aria-pressed="true"]{color:#0b0f22}}
:root[data-theme="dark"] .rseg button[aria-pressed="true"]{color:#0b0f22}
.rnotebtn{border:1px solid var(--line);background:var(--surface);border-radius:8px;width:34px;height:34px;cursor:pointer;color:var(--muted);font-size:15px}
.rnotebtn.has{color:var(--blue);border-color:var(--peri)}
.rnote{grid-column:2 / -1;display:flex;gap:8px;align-items:center}
.rnote .cfield{flex:1}
.rnotetext{grid-column:2 / -1;font-size:13px;color:var(--muted);margin-top:-4px}
.rrow.rsaving{opacity:.7}
.rclosed{display:flex;flex-wrap:wrap;gap:10px;align-items:center;padding:10px 14px;background:var(--surface-2);border-bottom:1px solid var(--line);font-size:14px}
.rkey{font-size:13px;color:var(--muted);margin-top:10px}
.rkey .mono{font-family:var(--f-mono)}

.pill.P{background:var(--ok-soft);color:var(--ok)}
.pill.L{background:var(--late-soft);color:var(--late)}
.pill.O{background:var(--absent-soft);color:var(--absent)}
.pill.A{background:var(--auth-soft);color:var(--auth)}
.pill.open{background:var(--demo-soft);color:var(--demo)}
.pill.closed{background:var(--surface-2);color:var(--muted)}

.rhistory{margin-top:14px}
.rhistory summary{cursor:pointer;font-weight:600;color:var(--blue)}
.rhistory .ctable{margin-top:10px}

.rtoast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);background:var(--ink);color:var(--bg);padding:10px 16px;border-radius:10px;font-size:14px;z-index:50;max-width:calc(100vw - 32px)}

@media (max-width:640px){
  .rrow{grid-template-columns:40px minmax(0,1fr) 34px;row-gap:8px;padding:10px 12px}
  .rrow .rseg{grid-column:1 / -1;justify-self:stretch;display:grid;grid-auto-flow:column;grid-auto-columns:1fr}
  .rrow .rseg button{width:auto;height:42px}
  .rrow .ravatar{grid-column:1;grid-row:1}
  .rrow .rname{grid-column:2;grid-row:1}
  .rrow .rnotebtn{grid-column:3;grid-row:1}
  .rrow .rtime{display:none}
  .rrow.rhdr{display:none}
  .ractions{margin-left:0;width:100%}
  .ractions .btn{flex:1 1 auto}
}

/* Home screen (script 121) */
.rsitepick{display:flex;flex-direction:column;gap:4px;min-width:200px}
.rhomegrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:14px}
.rhomecard{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:16px 18px;display:flex;flex-direction:column;gap:12px}
.rhometitle{font-family:var(--f-brand);font-weight:700;font-size:20px;line-height:1.15;margin:2px 0 0}
.rtoday{display:flex;flex-direction:column;gap:8px;padding:10px 12px;border-radius:10px;background:var(--surface-2)}
.rtoday-top{display:flex;flex-wrap:wrap;gap:6px 12px;align-items:center}
.rtoday .btn{align-self:flex-start}
.rhomefoot{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;font-size:14px;color:var(--muted);border-top:1px solid var(--line);padding-top:10px}

/* Attendance report (script 121) */
.rkpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}
.rkpi{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:12px 14px;display:flex;flex-direction:column;gap:2px}
.rkpi b{font-family:var(--f-brand);font-size:28px;line-height:1.1}
.rkpi small{color:var(--muted);font-size:12.5px}
.rsubhead{font-size:17px;margin:0 0 10px}
.rchart{position:relative;height:280px}
.rtwocol{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:16px;margin-top:18px}
@media (max-width:1100px){.rtwocol{grid-template-columns:minmax(0,1fr)}}
.rmetercell{white-space:nowrap}
.rmeter{display:inline-block;width:70px;height:8px;border-radius:4px;background:var(--surface-2);overflow:hidden;vertical-align:middle;margin-right:8px;border:1px solid var(--line)}
.rmeter i{display:block;height:100%}
tr.rclick{cursor:pointer}
tr.rclick:hover td{background:var(--surface-2)}
tr.rpicked td{background:var(--lilac-soft)}
.rdrill{margin-bottom:12px;border-color:var(--peri)}
.rdots{display:flex;flex-wrap:wrap;gap:6px}
.rdot{display:flex;flex-direction:column;align-items:center;gap:2px;min-width:54px;padding:6px 4px;border-radius:8px;text-decoration:none;font-size:12px;color:var(--muted);background:var(--surface-2);border:1px solid var(--line)}
.rdot b{font-family:var(--f-mono);font-size:15px}
.rdot.P b{color:var(--ok)}.rdot.L b{color:var(--late)}.rdot.O b{color:var(--absent)}.rdot.A b{color:var(--auth)}

/* Sign-in sheet: built into #printsheet and printed on its own. */
#printsheet{display:none}
@media print{
  @page{size:A4 portrait;margin:14mm}
  body.printing>*:not(#printsheet){display:none!important}
  body.printing{background:#fff!important;padding:0!important}
  body.printing #printsheet{display:block;color:#000;font-family:"IBM Plex Sans",Arial,sans-serif;font-size:11pt}
  #printsheet h1{font-size:20pt;margin:2px 0 0}
  #printsheet .ps-head{display:flex;justify-content:space-between;align-items:flex-end;border-bottom:2px solid #2050B9;padding-bottom:6px;margin-bottom:10px}
  #printsheet .ps-brand{font-size:9pt;color:#2050B9;font-weight:600;letter-spacing:.04em;text-transform:uppercase}
  #printsheet .ps-meta{text-align:right}
  #printsheet table{width:100%;border-collapse:collapse}
  #printsheet .ps-info th{text-align:left;width:70px;padding:2px 8px 2px 0;font-weight:600}
  #printsheet .ps-info td{padding:2px 0}
  #printsheet .ps-note{margin:10px 0 6px;font-size:10pt}
  #printsheet .ps-list th,#printsheet .ps-list td{border:1px solid #444;padding:0 8px;height:11mm;text-align:left}
  #printsheet .ps-list thead th{height:auto;padding:5px 8px;background:#eef0fa;font-size:10pt}
  #printsheet .ps-list tr{break-inside:avoid}
  #printsheet .ps-n{width:9mm;text-align:center}
  #printsheet .ps-ref{width:28mm;font-family:"IBM Plex Mono",monospace;font-size:10pt}
  #printsheet .ps-sign{width:65mm}
  #printsheet .ps-foot{display:flex;flex-wrap:wrap;gap:6mm 12mm;margin-top:10mm;font-size:10.5pt}
  #printsheet .ps-small{margin-top:6mm;font-size:8.5pt;color:#555}
}
/* Script 122: the session date and time are the register's heading; sessions
   after the course end are highlighted; late minutes; hours. */
.rregtop{margin-bottom:14px}
.rwhenrow{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin-top:2px}
.rwhen{font-family:var(--f-brand);font-weight:700;font-size:clamp(24px,3vw,32px);line-height:1.1;margin:0}
.rwhensep{color:var(--muted);font-weight:500}
.rcoursename{font-size:15px;color:var(--muted);margin-top:4px}
.rtag.rafter{background:var(--late-soft);color:var(--late);margin-left:6px}
.rafterbox{display:flex;flex-direction:column;gap:6px;margin-top:12px;padding:10px 12px;border:1px solid var(--late);border-left-width:4px;border-radius:10px;background:var(--late-soft);font-size:14px}
.rafterbox .cfield{width:100%;background:var(--surface)}
p.rafternote{display:block;margin:10px 0 0}
p.rafternote .rtag{margin:0 6px 0 0}
tr.rafterrow td{background:var(--late-soft)}
tr.rafterrow td:first-child{box-shadow:inset 4px 0 0 var(--late)}
.rtoday.rafterrow{box-shadow:inset 4px 0 0 var(--late)}
.rnote.rlate{flex-wrap:wrap}
.rmins{display:flex;align-items:center;gap:6px;font-size:13.5px;white-space:nowrap}
.rmins .cfield{width:84px;flex:none}
.rlatetext{color:var(--late);font-weight:600}
.rhoursline{display:flex;flex-wrap:wrap;gap:6px 14px;align-items:center;font-size:14.5px;margin:0 0 14px}
section.rhoursline{display:block}
.rhpill{display:inline-block;font-size:12.5px;font-weight:600;padding:2px 9px;border-radius:999px;color:var(--c);background:color-mix(in srgb,var(--c) 14%,transparent);white-space:nowrap}
.rhmeter{position:relative;display:inline-block;width:90px;height:9px;border-radius:5px;background:var(--surface-2);border:1px solid var(--line);vertical-align:middle;margin-right:8px}
.rhmeter i{display:block;height:100%;border-radius:4px}
.rhmeter b{position:absolute;top:-4px;bottom:-4px;width:2px;margin-left:-1px;background:var(--ink)}
.rkpibtn{font:inherit;color:inherit;text-align:left;cursor:pointer}
.rkpibtn:hover{border-color:var(--peri)}
.rkpibtn.rpicked{border-color:var(--peri);background:var(--lilac-soft)}
.rdot span+b+span{font-size:11px}