/* Student portal. Builds on ../styles.css (same tokens as the course site and decks). */
.proto { background: #FFF4CC; border-bottom: 1px dashed #A07A00; color: var(--navy); font-size: 14px; padding: 9px 16px; text-align: center; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--navy); }
.btn.ghost:hover { background: var(--navy); color: var(--bg); }
.btn.sm { font-size: 15px; padding: 9px 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.mt-s { margin-top: 24px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Login */
.login { max-width: 1120px; margin: 0 auto; padding: 72px 40px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 72px; align-items: start; }
.login-side h1 { font-size: 42px; margin-top: 40px; }
.login-side p { font-size: 19px; color: var(--grey); margin-top: 20px; max-width: 520px; }
.login-form { border-top: 2px solid var(--navy); padding-top: 28px; display: grid; gap: 20px; }
.login-form h2 { font-size: 28px; }
.login-form .ph-note { margin-top: 0; }
.demo-btns { display: grid; gap: 12px; }
.demo-btns .btn { text-align: center; }
.field input:disabled { background: var(--tint); color: var(--muted); }

/* Shell */
.ptop { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 24px; padding: 18px 40px; border-bottom: 1px solid var(--rule); }
.who { display: flex; gap: 20px; font-size: 15px; color: var(--grey); align-items: baseline; flex-wrap: wrap; }
.who #who { font-weight: 700; color: var(--navy); }
.pshell { display: grid; grid-template-columns: 280px minmax(0, 1fr); max-width: 1320px; margin: 0 auto; }
.pnav { border-right: 1px solid var(--rule); padding: 28px 0 60px; position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; }
.pnav a { display: block; padding: 10px 28px 10px 40px; text-decoration: none; color: var(--grey); font-size: 15px; border-left: 3px solid transparent; }
.pnav a:hover { background: var(--tint); color: var(--navy); }
.pnav a[aria-current="page"] { border-left-color: var(--blue); color: var(--navy); background: var(--tint); }
.pnav a .nt { display: block; font-weight: 700; color: var(--navy); }
.pnav a .nsub { display: block; font-size: 13px; line-height: 1.35; margin-top: 2px; }
.pnav a .ndot { display: block; font-size: 12px; margin-top: 3px; font-weight: 700; }
.pnav a.wk { padding-top: 8px; padding-bottom: 8px; }
.pnav-mobile { display: none; }
.pmain { padding: 48px 56px 96px; min-width: 0; }
.pmain:focus { outline: none; }
.pmain h1 { font-size: 38px; max-width: 860px; }
.pmain .intro { margin-top: 16px; }
.psec { margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--rule); }
.psec h2 { font-size: 26px; margin-bottom: 20px; }
.h3 { font-size: 20px; margin: 32px 0 12px; }

/* Status text: colour plus words, never colour alone */
.st { font-size: 14px; font-weight: 700; }
.st-complete { color: #1B6B3A; }
.st-submitted { color: var(--blue); }
.st-returned { color: #A33A12; }
.st-none, .st-locked { color: var(--muted); }
.st-open { color: var(--navy); }
.wkstat { margin-top: 14px; }
.dot { display: inline-block; width: 14px; height: 14px; background: var(--rule); vertical-align: middle; }
.dot.st-complete { background: #1B6B3A; } .dot.st-submitted { background: var(--blue); } .dot.st-returned { background: #A33A12; }

.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule); }
.pgrid > div { padding: 18px 20px 4px 0; }
.pgrid > div + div { border-left: 1px solid var(--rule); padding-left: 20px; }
.pgrid .k, .prow .k { font-weight: 700; }
.pgrid p + p { margin-top: 4px; }
.bar { height: 8px; background: #E6E9EE; margin-top: 10px; }
.bar span { display: block; height: 100%; background: var(--blue); }
.bignum { font-family: var(--serif); font-size: 48px; color: var(--blue); line-height: 1.1; }
.bignum span { font-size: 24px; color: var(--muted); }

.palert { margin-top: 28px; border-left: 3px solid #A33A12; background: #FBEFEA; padding: 14px 18px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: baseline; }
.palert a { font-weight: 700; }

.pstrip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, 1fr); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.pstrip li { border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); border-top: 4px solid var(--rule); }
.pstrip li.st-complete { border-top-color: #1B6B3A; } .pstrip li.st-submitted { border-top-color: var(--blue); } .pstrip li.st-returned { border-top-color: #A33A12; } .pstrip li.st-open { border-top-color: var(--navy); }
.pstrip a { display: block; padding: 12px 10px; text-decoration: none; height: 100%; }
.pstrip a:hover { background: var(--tint); }
.pstrip .wk { display: block; font-weight: 700; color: var(--navy); font-size: 15px; }
.pstrip .lab { display: block; font-size: 12px; color: var(--grey); margin-top: 4px; line-height: 1.3; }

.ann { border-top: 1px solid var(--rule); padding: 16px 0; }
.ann:last-child { border-bottom: 1px solid var(--rule); }
.meta { font-size: 13px; color: var(--muted); margin-bottom: 6px; }

.prows { border-bottom: 1px solid var(--rule); }
.prow { display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding: 16px 0; border-top: 1px solid var(--rule); }
.prow .v { color: var(--grey); }

.readings { margin: 0; padding-left: 22px; color: var(--grey); }
.readings li { padding: 4px 0; }
.checks { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--rule); }
.checks li { border-top: 1px solid var(--rule); }
.checks label { display: flex; gap: 14px; align-items: baseline; padding: 13px 0; cursor: pointer; }
.checks input { width: 18px; height: 18px; accent-color: var(--blue); flex: none; transform: translateY(3px); }

.pform { display: grid; gap: 18px; max-width: 720px; }
.pform .field input[type="file"] { background: var(--bg); padding: 10px; }
.hintline { color: var(--grey); }
.hint { font-weight: 400; color: var(--muted); }
.wc { font-size: 13px; color: var(--muted); margin-top: 6px; }
.perr { color: #A33A12; font-weight: 700; min-height: 0; }
.perr:empty { display: none; }
.btns { display: flex; gap: 12px; flex-wrap: wrap; }
.pform button { justify-self: start; cursor: pointer; font-family: var(--sans); }

.ver { border-top: 1px solid var(--rule); padding: 16px 0; }
.vh { margin-bottom: 8px; }
.files { list-style: none; margin: 0; padding: 0; }
.files li { display: grid; grid-template-columns: 150px minmax(0, 1fr) 80px; gap: 12px; padding: 8px 0; border-bottom: 1px dotted var(--rule); font-size: 15px; }
.fpart { color: var(--muted); }
.fname { font-weight: 700; overflow-wrap: anywhere; }
.fsize { color: var(--muted); text-align: right; }
.fb { margin-top: 14px; padding: 12px 16px; border-left: 3px solid var(--rule); background: var(--tint); }
.fb-complete { border-left-color: #1B6B3A; }
.fb-returned { border-left-color: #A33A12; }
.quote { border-left: 3px solid var(--rule); padding-left: 16px; color: var(--grey); }

.dq { border-left: 3px solid var(--blue); padding: 4px 0 4px 22px; margin-bottom: 24px; }
.dq .label { margin-bottom: 6px; }
.dq .big { font-family: var(--serif); font-size: 22px; line-height: 1.4; }
.posts { margin-top: 28px; border-bottom: 1px solid var(--rule); }
.post { border-top: 1px solid var(--rule); padding: 18px 0; }
.ptext p + p, .reply p + p { margin-top: 8px; }
.replies { margin: 12px 0 0 28px; border-left: 1px solid var(--rule); padding-left: 20px; }
.reply { padding: 10px 0; }
.replyf { display: flex; gap: 10px; align-items: flex-start; margin-top: 8px; }
.replyf textarea { flex: 1; min-width: 0; font: inherit; font-size: 15px; border: 1px solid #8A95A3; padding: 8px 10px; min-height: 42px; height: 42px; resize: vertical; border-radius: 0; }
.replyf button { cursor: pointer; flex: none; }
.badge { font-size: 11px; font-weight: 700; color: var(--bg); background: var(--navy); padding: 2px 6px; vertical-align: 1px; }
.badge.light { background: var(--tint); color: var(--muted); border: 1px solid var(--rule); }

.ptable { border-bottom: 1px solid var(--rule); }
.cols-subs { grid-template-columns: 220px 200px 90px 1fr; }
.cols-cap { grid-template-columns: 40px 1fr 260px; }
.cols-cap .n { font-family: var(--serif); color: var(--blue); font-size: 20px; }
.cols-rub { grid-template-columns: 1fr 80px; }
.cols-rub .num { text-align: right; }
.cols-roster { grid-template-columns: 200px repeat(8, 1fr); align-items: center; }
.qrow { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 0; border-top: 1px solid var(--rule); }
.qrow:last-child { border-bottom: 1px solid var(--rule); }

@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; gap: 40px; padding: 40px 16px; }
  .login-side h1 { font-size: 32px; margin-top: 28px; }
  .ptop { padding: 14px 16px; }
  .pshell { grid-template-columns: minmax(0, 1fr); }
  .pnav { display: none; }
  .pnav-mobile { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--rule); background: var(--tint); font-weight: 700; font-size: 15px; }
  .pnav-mobile select { flex: 1; min-width: 0; width: 100%; font: inherit; font-weight: 400; padding: 8px; border: 1px solid #8A95A3; border-radius: 0; background: #fff; color: var(--navy); }
  .pmain { padding: 28px 16px 72px; }
  .pmain h1 { font-size: 28px; }
  .pgrid { grid-template-columns: 1fr; }
  .pgrid > div + div { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); }
  .pstrip { grid-template-columns: repeat(4, 1fr); }
  .prow { grid-template-columns: 1fr; gap: 4px; }
  .files li { grid-template-columns: 1fr auto; }
  .fpart { grid-column: 1 / -1; font-size: 13px; }
  .replies { margin-left: 8px; padding-left: 12px; }
  .replyf { flex-direction: column; align-items: stretch; }
  .replyf textarea { width: 100%; }
  .replyf button { align-self: flex-start; }
  .cols-roster { grid-template-columns: 1fr repeat(8, 22px) !important; gap: 6px !important; }
  .tr.th.cols-roster { display: grid; }
  .tr.cols-roster { grid-template-columns: 1fr repeat(8, 22px) !important; }
  .cols-rub { grid-template-columns: 1fr 60px !important; }
}

/* ---------- v5 additions: MIT-style week structure, AI-drafted feedback, groups, Q&A ---------- */
.mt-xs { margin-top: 10px; }
.h2 { font-size: 24px; margin: 20px 0 16px; }
.st-review { color: var(--blue); }
.dot.st-review { background: var(--blue); }
.pstrip li.st-review { border-top-color: var(--blue); }
.late { display: inline-block; font-size: 11px; font-weight: 700; color: #A33A12; border: 1px solid #A33A12; padding: 0 5px; vertical-align: 1px; }
.count { display: inline-block; min-width: 20px; text-align: center; font-size: 11px; font-weight: 700; color: var(--bg); background: var(--navy); padding: 1px 5px; margin-left: 6px; vertical-align: 1px; }

.banner { background: var(--navy); color: var(--bg); padding: 30px 32px 32px; }
.banner .label { color: #8FB0FF; margin-bottom: 10px; }
.banner .bh { font-family: var(--serif); font-size: 34px; line-height: 1.2; font-weight: 600; max-width: 820px; }
.banner + .intro { margin-top: 22px; }

.summary { margin-top: 18px; padding: 14px 18px; background: var(--tint); border-left: 3px solid var(--navy); color: var(--grey); max-width: 860px; }
.inweek { list-style: none; margin: 22px 0 0; padding: 0; border-top: 1px solid var(--rule); max-width: 860px; }
.inweek li { border-bottom: 1px solid var(--rule); }
.inweek a { display: flex; gap: 14px; align-items: center; padding: 11px 4px; text-decoration: none; color: var(--navy); }
.inweek a:hover { background: var(--tint); }
.tick { width: 18px; height: 18px; border: 2px solid var(--rule); flex: none; position: relative; }
.tick.on { background: #1B6B3A; border-color: #1B6B3A; }
.tick.on::after { content: ''; position: absolute; left: 4px; top: 0; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

.callout { border-left: 3px solid var(--blue); background: #EEF2FD; padding: 16px 20px; max-width: 860px; }
.aiflag { margin-top: 18px; font-size: 14px; color: var(--grey); border-top: 1px dotted var(--rule); padding-top: 12px; }
.crit { margin: 0; padding-left: 22px; color: var(--grey); }
.crit li { padding: 3px 0; }
.rub { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 15px; }
.rub th { text-align: left; font-size: 13px; color: var(--muted); border-bottom: 2px solid var(--navy); padding: 6px 8px 6px 0; }
.rub td { border-bottom: 1px solid var(--rule); padding: 8px 8px 8px 0; vertical-align: top; }
.rub td.ok { color: #1B6B3A; font-weight: 700; white-space: nowrap; }
.rub td.no { color: #A33A12; font-weight: 700; white-space: nowrap; }
.rub input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blue); }
.numin { width: 72px; font: inherit; padding: 6px 8px; border: 1px solid #8A95A3; border-radius: 0; }

.rate { border: 0; padding: 0; margin: 0; }
.rate legend { font-weight: 700; font-size: 16px; margin-bottom: 6px; padding: 0; }
.rate label { display: inline-flex; gap: 6px; align-items: center; margin-right: 18px; font-size: 16px; cursor: pointer; }
.rate input { accent-color: var(--blue); width: 16px; height: 16px; }

.tabs { display: flex; flex-wrap: wrap; gap: 0 28px; border-bottom: 1px solid var(--rule); margin-top: 28px; }
.tabs a { padding: 10px 0; text-decoration: none; color: var(--grey); border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 700; font-size: 15px; }
.tabs a[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--blue); }
.subj { font-weight: 700; margin-bottom: 4px; }

.lrows { border-bottom: 1px solid var(--rule); }
.lrow { display: grid; grid-template-columns: 150px 1fr; gap: 20px; padding: 14px 0; border-top: 1px solid var(--rule); align-items: center; }
.lthumb { height: 84px; background: var(--tint); border: 1px solid var(--rule); display: flex; align-items: flex-end; padding: 8px; }
.lthumb.rec { background: var(--navy); border-color: var(--navy); }
.lthumb span { font-size: 12px; font-weight: 700; color: var(--muted); }
.lthumb.rec span { color: #B8C2CF; }

.people { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.people li { padding: 10px 0; border-bottom: 1px solid var(--rule); }

.cert { margin-top: 28px; border: 2px solid var(--navy); padding: 40px 32px; text-align: center; max-width: 720px; background: #fff; }
.cert.locked { opacity: 0.45; }
.cert .cname { font-family: var(--serif); font-size: 34px; margin: 14px 0 6px; }
.cert .ctitle { font-family: var(--serif); font-size: 24px; margin: 6px 0 10px; color: var(--navy); }

.cols-prog { grid-template-columns: 1.6fr 120px 190px 80px 1fr; }

/* Student guide pages */
.guide { max-width: 860px; margin: 0 auto; padding: 32px 40px 80px; }
.guide h1 { font-size: 34px; margin: 18px 0 10px; }
.guide h2 { font-size: 26px; margin: 34px 0 10px; }
.guide h3, .guide h4 { font-size: 20px; margin: 24px 0 8px; }
.guide p, .guide li { color: var(--grey); }
.guide p + p { margin-top: 10px; }
.guide ul, .guide ol { padding-left: 22px; }
.guide hr { border: 0; border-top: 1px solid var(--rule); margin: 28px 0; }
.guide code { font-size: 0.9em; background: var(--tint); padding: 1px 4px; overflow-wrap: anywhere; }
.gtable { overflow-x: auto; margin: 14px 0; }
.gtable table { border-collapse: collapse; width: 100%; font-size: 15px; }
.gtable th { text-align: left; border-bottom: 2px solid var(--navy); padding: 6px 10px 6px 0; }
.gtable td { border-bottom: 1px solid var(--rule); padding: 7px 10px 7px 0; vertical-align: top; color: var(--grey); }

@media (max-width: 900px) {
  .banner { padding: 22px 18px; }
  .banner .bh { font-size: 26px; }
  .lrow { grid-template-columns: 96px 1fr; gap: 14px; }
  .lthumb { height: 60px; }
  .guide { padding: 24px 16px 64px; }
  .cert { padding: 28px 16px; }
  .cert .cname { font-size: 26px; }
  .rate label { margin-right: 12px; }
}
