/* ============ Today · the student home (today.js) ============ */
/* One column on phones and narrow windows; on a wide screen the glance tiles move into a rail on the right. */
.pg-today { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; align-items: start; }
.pg-today .tdy-side { display: none; }
@media (min-width: 1240px) {
  .pg-today { grid-template-columns: minmax(0, 1fr) 300px; }
  .pg-today .tdy-side { display: grid; gap: 12px; position: sticky; top: calc(var(--topbar-h) + 18px); }
  .pg-today .tdy-glance-m { display: none; }
}
.tdy-main { min-width: 0; }

/* ---- greeting ---- */
.tdy-hello { margin: 2px 2px 16px; }
.tdy-date { font-size: 12.5px; font-weight: 700; color: var(--text-3); }
.tdy-hello h2 { font-size: 28px; line-height: 1.12; letter-spacing: -.032em; font-weight: 800; margin: 6px 0 4px; }
.tdy-hello-sub { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
@media (min-width: 1024px) { .tdy-hello h2 { font-size: 31px; } }

/* ---- the live "Now" card ---- */
.tdy-now { position: relative; overflow: hidden; isolation: isolate; border-radius: 22px; padding: 18px 18px 16px; margin-bottom: 24px;
  color: #fff; background: var(--brand-800); box-shadow: var(--shadow-md); }
.tdy-now::after { content: ''; position: absolute; right: -26px; bottom: -42px; width: 170px; height: 165px; z-index: -1; opacity: .07;
  background: url('../../brand/mark-white.png') center/contain no-repeat; }
.tdy-now-top { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 800; color: var(--hero-ink); letter-spacing: .02em; }
.tdy-live { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 99px; background: rgba(255,255,255,.13); color: #fff; }
.tdy-live svg { width: 13px; height: 13px; }
.tdy-live i { width: 7px; height: 7px; border-radius: 50%; background: #4ADE80; box-shadow: 0 0 0 0 rgba(74,222,128,.6); animation: tdyPulse 2s infinite; }
@keyframes tdyPulse { 70% { box-shadow: 0 0 0 7px rgba(74,222,128,0); } 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); } }
.tdy-now h2 { font-size: 23px; line-height: 1.16; letter-spacing: -.03em; font-weight: 800; margin: 11px 0 4px; color: #fff; }
.tdy-now-meta { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.72); }
.tdy-bar { margin-top: 16px; height: 6px; border-radius: 99px; background: rgba(255,255,255,.15); overflow: hidden; }
.tdy-bar i { display: block; height: 100%; border-radius: inherit; background: #fff; transform-origin: left; transition: transform 1s var(--ease-out); }
.tdy-now-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 9px; font-size: 12px; font-weight: 700; color: rgba(255,255,255,.72); }
.tdy-now-foot b { color: #fff; font-variant-numeric: tabular-nums; }
.tdy-now-next { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-top: 13px; border-top: 1px solid rgba(255,255,255,.13);
  font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,.75); }
.tdy-now-next b { color: #fff; }
.tdy-cta { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 99px; background: #fff; color: var(--brand-800);
  font-weight: 800; font-size: 12.5px; transition: transform var(--d-press) var(--ease-out); }
.tdy-cta svg { width: 14px; height: 14px; }
.tdy-cta:active { transform: scale(.95); }

/* ---- sections ---- */
.tdy-sec { margin-bottom: 26px; }
.tdy-sec.is-empty { display: none; }
.tdy-sec-h { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 10px; }
.tdy-sec-h h3 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.tdy-sec-h a { font-size: 12.5px; font-weight: 700; color: var(--accent); }

/* ---- one timeline ---- */
.tdy-tl { background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--card-hi), var(--shadow-xs); padding: 6px 6px 8px; }
.tdy-day { display: flex; align-items: center; gap: 10px; padding: 12px 12px 6px; font-size: 12px; font-weight: 800; color: var(--text-3); }
.tdy-day::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.tdy-day.is-today { color: var(--accent); }
.tdy-row { display: grid; grid-template-columns: 58px 18px minmax(0, 1fr); gap: 0 8px; align-items: start; width: 100%; padding: 9px 10px; border: 0; border-radius: 14px;
  background: none; text-align: left; color: inherit; cursor: pointer; transition: background .15s linear; }
.tdy-row:hover { background: var(--surface-2); }
.tdy-row:active { background: var(--fill); }
.tdy-time { font-size: 12.5px; padding-top: 1px; font-variant-numeric: tabular-nums; }
.tdy-time b { font-weight: 750; }
.tdy-time small { display: block; font-size: 11px; color: var(--text-3); font-weight: 600; }
.tdy-rail { position: relative; align-self: stretch; display: flex; justify-content: center; }
.tdy-rail::before { content: ''; position: absolute; top: 20px; bottom: -18px; width: 2px; border-radius: 2px; background: var(--fill-2); }
.tdy-row.is-last .tdy-rail::before { display: none; }
.tdy-dot { position: relative; z-index: 1; width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: var(--c, var(--accent)); box-shadow: 0 0 0 3px var(--card); }
.tdy-row.k-deadline .tdy-dot { border-radius: 3px; transform: rotate(45deg) scale(.86); background: var(--warning); }
.tdy-row.k-event .tdy-dot { background: var(--card); box-shadow: 0 0 0 3px var(--card), inset 0 0 0 3px var(--accent); }
.tdy-row.is-live .tdy-dot { background: #22C55E; box-shadow: 0 0 0 3px var(--card), 0 0 0 6px rgba(34,197,94,.22); }
.tdy-row.is-past { opacity: .5; }
.tdy-body { min-width: 0; }
.tdy-title { display: block; font-weight: 750; font-size: 14px; line-height: 1.3; letter-spacing: -.01em; }
.tdy-sub { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 1px; }
.tdy-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.tdy-tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 7px; font-size: 11px; font-weight: 750; background: var(--fill); color: var(--text-2); }
.tdy-tag svg { width: 12px; height: 12px; }
.tdy-tag.is-live { background: rgba(34,197,94,.14); color: #15803D; }
:root[data-theme="dark"] .tdy-tag.is-live { color: #4ADE80; }
.tdy-tag.is-warn { background: var(--warning-tint); color: var(--warning); text-transform: none; }
.tdy-tag.is-acc { background: var(--accent-tint); color: var(--accent); text-transform: capitalize; }
.tdy-empty .empty { padding: 34px 16px; }

/* ---- class details sheet ---- */
.tdy-det-row { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.tdy-det-row:first-child { border-top: 0; }
.tdy-det-row svg { color: var(--text-3); }
.tdy-det-join { margin-top: 10px; }
.tdy-det-btns { display: flex; gap: 8px; margin-top: 14px; }
.tdy-det-btns .btn { flex: 1; }

/* ---- needs you ---- */
.tdy-needs { display: grid; gap: 8px; }
.tdy-need { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--card-hi), var(--shadow-xs); color: inherit; cursor: pointer; touch-action: pan-y; user-select: none;
  transition: transform .32s var(--ease-drawer), border-color var(--t), box-shadow var(--d-ui) var(--ease-out); }
.tdy-need:hover { border-color: var(--line-strong); }
.tdy-need.is-drag { transition: none; }
.tdy-cd { position: relative; width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--fill-2) 0); }
.tdy-cd.is-soon { background: conic-gradient(var(--warning) calc(var(--p) * 1%), var(--fill-2) 0); }
.tdy-cd::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--card); }
.tdy-cd span { position: relative; font-size: 11.5px; font-weight: 800; line-height: 1.05; text-align: center; letter-spacing: -.02em; }
.tdy-cd small { display: block; font-size: 9px; font-weight: 700; color: var(--text-3); letter-spacing: 0; }
.tdy-need-ic { width: 46px; height: 46px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent); }
.tdy-need-ic.ic-grade, .tdy-need-ic.ic-ticket { background: var(--success-tint); color: var(--success); }
.tdy-need-ic.ic-attendance { background: var(--danger-tint); color: var(--danger); }
.tdy-need-main { flex: 1; min-width: 0; }
.tdy-need-t { display: block; font-weight: 750; font-size: 13.5px; line-height: 1.3; letter-spacing: -.01em; }
.tdy-need-s { display: block; font-size: 12px; color: var(--text-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tdy-chev { color: var(--text-3); display: grid; }
.tdy-read { flex: none; width: 34px; height: 34px; border-radius: 11px; border: 1px solid var(--line); background: var(--card); color: var(--text-3);
  display: grid; place-items: center; cursor: pointer; transition: background var(--t), color var(--t), transform var(--d-press) var(--ease-out); }
.tdy-read:hover { background: var(--success-tint); color: var(--success); border-color: transparent; }
.tdy-read:active { transform: scale(.92); }
.tdy-swipe { position: relative; border-radius: 16px; overflow: hidden; background: var(--success); }
.tdy-swipe-act { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding-right: 20px; color: #fff; font-weight: 800; font-size: 12.5px; }
.tdy-hint { font-size: 11.5px; font-weight: 600; color: var(--text-3); margin: 8px 4px 0; }
.only-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .only-touch { display: block; } .tdy-read { display: none; } }
.tdy-clear { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
  color: var(--text-2); font-weight: 650; font-size: 13.5px; }
.tdy-clear svg { color: var(--success); }

/* ---- at a glance ---- */
.tdy-bento { display: grid; gap: 10px; }
.tdy-tile { display: block; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--card-hi), var(--shadow-xs);
  color: inherit; transition: border-color var(--t), transform var(--d-ui) var(--ease-out), box-shadow var(--d-ui) var(--ease-out); }
.tdy-tile:hover { border-color: var(--line-strong); }
.tdy-tile:active { transform: scale(.985); }
.tdy-tile-l { display: block; font-size: 11.5px; font-weight: 750; color: var(--text-3); }
.tdy-tile-s { display: block; font-size: 12px; color: var(--text-2); margin-top: 2px; }
.tdy-att { display: flex; align-items: center; gap: 14px; }
.tdy-ring { position: relative; width: 72px; height: 72px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--success) calc(var(--pct) * 1%), var(--fill-2) 0); }
.tdy-att.is-low .tdy-ring { background: conic-gradient(var(--danger) calc(var(--pct) * 1%), var(--fill-2) 0); }
.tdy-ring::before { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: var(--card); }
.tdy-ring b { position: relative; font-size: 16.5px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tdy-att.is-low .tdy-ring b { color: var(--danger); }
.tdy-att-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.tdy-bar-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) 26px; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 650; color: var(--text-2); }
.tdy-bar-row i { display: block; height: 6px; border-radius: 99px; background: var(--fill-2); overflow: hidden; }
.tdy-bar-row i::after { content: ''; display: block; height: 100%; width: var(--w); background: var(--bc); border-radius: inherit; transform-origin: left; }
.tdy-bar-row b { text-align: right; font-variant-numeric: tabular-nums; }
.tdy-wds { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 10px; }
.tdy-wd { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 0 7px; border-radius: 12px; background: var(--surface-2); font-size: 11px; font-weight: 750; color: var(--text-3); }
.tdy-wd b { font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.tdy-pips { display: flex; gap: 3px; height: 5px; }
.tdy-pips i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.tdy-wd.is-on { background: var(--accent); color: rgba(255,255,255,.8); }
.tdy-wd.is-on b { color: #fff; }
.tdy-wd.is-on .tdy-pips i { background: #fff; }

/* ---- continue learning (the VLE's colourway art, .cw-* in vle.css, or the module's own picture) ---- */
.tdy-shelf, .tdy-around { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -18px; padding: 2px 18px 8px; }
.tdy-shelf::-webkit-scrollbar, .tdy-around::-webkit-scrollbar { display: none; }
@media (min-width: 761px) { .tdy-shelf, .tdy-around { margin: 0; padding: 2px 0 8px; } }
.tdy-mod { position: relative; flex: 0 0 236px; aspect-ratio: 16 / 10; scroll-snap-align: start; border-radius: 16px; overflow: hidden; container-type: inline-size;
  background: #0F0C24 var(--own, var(--art-w)) center / cover no-repeat; box-shadow: var(--shadow-md); color: #fff; transition: transform var(--d-ui) var(--ease-out); }
.tdy-mod::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5,4,15,0) 30%, rgba(5,4,15,.74)); }
.tdy-mod:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .tdy-mod:hover { transform: translateY(-2px); } }
.tdy-mod-n { position: absolute; left: 7cqw; right: 7cqw; bottom: 15cqw; z-index: 1; font-family: 'Bricolage Grotesque', var(--font); font-weight: 800;
  font-size: 10.5cqw; line-height: 1; letter-spacing: -.02em; text-shadow: 0 2px 18px rgba(0,0,0,.35);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tdy-mod-m { position: absolute; left: 7cqw; right: 7cqw; bottom: 6cqw; z-index: 1; font-size: 11px; font-weight: 700; color: rgba(255,255,255,.8);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- around Denning ---- */
.tdy-ev { flex: 0 0 236px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 9px; padding: 14px; text-align: left; color: inherit; font: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--card-hi), var(--shadow-xs); cursor: pointer; overflow: hidden;
  transition: transform var(--d-ui) var(--ease-out), border-color var(--t); }
.tdy-ev:active { transform: scale(.97); }
.tdy-ev:hover { border-color: var(--line-strong); }
.tdy-ev-img { margin: -14px -14px 2px; width: calc(100% + 28px); max-width: none; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.tdy-ev-d { display: flex; align-items: center; gap: 10px; }
.tdy-cal { width: 44px; height: 46px; flex: none; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--accent-tint); color: var(--accent); }
.tdy-cal b { font-size: 17px; line-height: 1; font-weight: 800; }
.tdy-cal span { font-size: 9.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; margin-top: 2px; }
.tdy-ev-t { display: block; font-weight: 750; font-size: 13.5px; line-height: 1.3; letter-spacing: -.01em; }
.tdy-ev-s { display: block; font-size: 12px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tdy-ev-by { font-size: 11.5px; font-weight: 650; margin-top: auto; }
.tdy-ev.is-pinned { background: var(--brand-700); border-color: transparent; color: #fff; }
.tdy-ev.is-pinned .tdy-ev-s, .tdy-ev.is-pinned .tdy-ev-by { color: rgba(255,255,255,.74); }
.tdy-ev.is-pinned .tdy-tag { background: rgba(255,255,255,.15); color: #fff; align-self: flex-start; }

/* ---- motion: the ring and bars fill as the page arrives ---- */
@media (prefers-reduced-motion: no-preference) {
  .tdy-ring { animation: ringFill 1.1s var(--ease-out) .15s both; }
  .tdy-bar-row i::after { animation: tdyGrow .9s var(--ease-out) .2s both; }
}
@keyframes tdyGrow { from { transform: scaleX(0); } }

@media (max-width: 760px) {
  .tdy-hello h2 { font-size: 26px; }
  .tdy-shelf, .tdy-around { margin: 0 -18px; padding: 2px 18px 8px; }
}

/* Course colours are deep purples; in the dark they are lifted so the dot still reads on the card. */
:root[data-theme="dark"] .tdy-row.k-class:not(.is-live) .tdy-dot { background: color-mix(in srgb, var(--c, var(--accent)) 55%, #fff 45%); }
.tdy-ev.is-past { opacity: .72; }

/* ---- a teacher's Today: the teaching tile and the grading queue ---- */
.tdy-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.tdy-num { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); color: inherit;
  transition: background var(--t), transform var(--d-press) var(--ease-out); }
.tdy-num:hover { background: var(--fill); }
.tdy-num:active { transform: scale(.97); }
.tdy-num b { font-size: 24px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tdy-num span { font-size: 11.5px; font-weight: 650; color: var(--text-2); }
.tdy-num:first-child b { color: var(--warning); }
.tdy-need-ic.ic-grade-q { background: var(--warning-tint); color: var(--warning); }
.tdy-count { flex: none; min-width: 30px; height: 26px; padding: 0 9px; border-radius: 99px; display: grid; place-items: center;
  background: var(--warning-tint); color: var(--warning); font-weight: 800; font-size: 12.5px; font-variant-numeric: tabular-nums; }
