/* =====================================================================
   CSCI 5980 S27 additions on top of css/main.css (DK's shared style).
   Works with or without Bootstrap 4.6 loaded; uses no Bootstrap JS.
   ===================================================================== */
:root {
  --umn-maroon: #7A0019;
  --umn-gold: #FFCC33;
  --ink: #222;
  --muted: #666;
  --line: #d9d9d9;
  --due: #c8102e;
  --release: #1740c9;
  --link: #0056b3;
  --lev-weights: #7A0019;
  --lev-inference: #B07A00;
  --lev-harness: #1F6F78;
  --lev-human: #2E6B3A;
  --lev-train: #6B3E75;
  --lev-eval: #5B6770;
  --head-font: "Titillium Web", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --body-font: "Roboto", "Helvetica Neue", Arial, sans-serif;
}

/* ---- minimal reset so the page reads well even if Bootstrap fails to load ---- */
.s27 *, .s27 *::before, .s27 *::after { box-sizing: border-box; }
body.s27 { margin: 0; color: var(--ink); font-family: var(--body-font); -webkit-text-size-adjust: 100%; }
html { scroll-behavior: smooth; }
.s27 a { color: var(--link); text-decoration: none; }
.s27 a:hover { text-decoration: underline; }
.s27 p { margin: 0 0 12px; }
.s27 ul, .s27 ol { margin-top: 0; margin-bottom: 12px; }
.s27 h1, .s27 h2, .s27 h3, .s27 h4, .s27 h5 { font-family: var(--head-font); font-weight: 600; line-height: 1.2; color: var(--ink); }
.s27 h4 { font-size: 20px; margin: 22px 0 10px; }
.s27 h5 { font-size: 16px; margin: 16px 0 8px; }
.s27 code { font-size: 90%; color: #8a1538; background: #f6f2f3; padding: 0 3px; border-radius: 3px; }
.s27 strong { font-weight: 700; }
.s27 details > summary { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ---- navbar with gold accent line ---- */
.s27 .navbar { display: block; border-bottom: 4px solid var(--umn-gold); padding: 8px 0; }
.s27 .navbar .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  max-width: 1080px; margin: 0 auto; padding: 0 16px; background: transparent; }
.s27 .navbar-brand { font-family: var(--head-font); font-weight: 600; letter-spacing: .2px; padding: 0; margin: 0;
  color: #fff; font-size: 1.2em; }
.s27 .navbar-right { font-family: var(--head-font); color: rgba(255,255,255,.85); font-size: 14px; }
.s27 .navbar-right a { color: #fff; }

/* ---- page container ---- */
.s27 main.container { display: block; width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px 8px; }
@media (min-width: 1112px) { .s27 main.container { padding: 0 0 8px; } }

/* cards: keep main.css look; neutralize Bootstrap's flex card */
.s27 .card { display: block; border: 0; border-radius: 2px; overflow-wrap: break-word; }
.s27 .card > h3.sec-title { font-size: 27px; margin: 14px 0 14px; padding: 2px 0 2px 12px;
  border-left: 5px solid var(--umn-maroon); }
.s27 .sec-lead { color: #444; }
.s27 .muted { color: #777; }
.s27 .small { font-size: 13px; line-height: 20px; }

/* ---- hero header ---- */
.hero { text-align: center; padding: 34px 0 18px; }
.hero-code { font-family: var(--head-font); color: var(--umn-maroon); text-transform: uppercase; letter-spacing: 1.2px;
  font-size: 14px; font-weight: 600; }
.s27 .hero h1 { font-size: 50px; font-weight: 700; margin: 6px 0 2px; letter-spacing: -.5px; }
.hero-sub { font-family: var(--head-font); font-size: 23px; color: #333; margin: 0 0 8px !important; }
.hero-meta { color: #555; font-size: 15px; margin: 0 0 16px !important; }
.hero-meta .sep { color: #bbb; margin: 0 6px; }
.quick-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.qbtn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 15px; border-radius: 999px;
  border: 1.5px solid var(--umn-maroon); color: var(--umn-maroon) !important; background: #fff;
  font-family: var(--head-font); font-weight: 600; font-size: 15px; line-height: 20px; text-decoration: none !important;
  transition: background .12s, color .12s; }
.qbtn:hover { background: var(--umn-maroon); color: #fff !important; }
.qbtn.is-pending { border-style: dashed; border-color: #aaa; color: #888 !important; cursor: default; }
.qbtn.is-pending:hover { background: #fff; color: #888 !important; }

/* ---- sticky section nav ---- */
.secnav { position: sticky; top: 0; z-index: 30; background: rgba(239,239,239,.97); margin: 0 -16px;
  padding: 8px 16px; border-bottom: 1px solid #ddd; }
@media (min-width: 1112px) { .secnav { margin: 0; padding: 8px 0; } }
.secnav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; overflow-x: auto;
  scrollbar-width: thin; justify-content: flex-start; }
.secnav li { flex: 0 0 auto; }
/* safe centering: centered when the pills fit, scrollable from the first pill when they do not */
.secnav li:first-child { margin-left: auto; }
.secnav li:last-child { margin-right: auto; }
.secnav a { display: block; padding: 5px 12px; border-radius: 999px; font-family: var(--head-font); font-weight: 600;
  font-size: 15px; color: var(--umn-maroon); white-space: nowrap; text-decoration: none !important; }
.secnav a:hover { background: rgba(122,0,25,.08); }
.secnav a.active { background: var(--umn-maroon); color: #fff; }
.s27 section[id], .s27 .anchor { scroll-margin-top: 64px; }
.s27 tr[id] { scroll-margin-top: 70px; }

/* ---- news + coming up ---- */
.top-row { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 20px; margin-top: 16px; }
.top-row > .card { margin-top: 0 !important; }
@media (max-width: 800px) { .top-row { grid-template-columns: minmax(0, 1fr); } }
.news-list { list-style: none; padding: 0; margin: 0; }
.news-list > li { padding: 10px 0; border-top: 1px solid #eee; }
.news-list > li:first-child { border-top: 0; padding-top: 2px; }
.news-date { font-family: var(--head-font); font-size: 13px; color: #777; text-transform: uppercase; letter-spacing: .6px; }
.news-title { font-weight: 700; }
.news-new { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .5px; color: #5a4200;
  background: var(--umn-gold); border-radius: 3px; padding: 0 5px; margin-left: 6px; vertical-align: 1px; }
.news-body { margin-top: 3px; }
.news-older > summary { color: var(--link); font-size: 14px; margin-top: 8px; }

.coming-up { border-top: 5px solid var(--umn-gold); }
.cu-asof { font-size: 13px; color: #777; margin: -8px 0 10px; }
.cu-block { margin-bottom: 14px; }
.cu-label { font-family: var(--head-font); font-size: 13px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: var(--umn-maroon); margin-bottom: 4px; }
.cu-begin { font-family: var(--head-font); font-size: 20px; font-weight: 700; color: var(--umn-maroon); margin-bottom: 4px; }
.cu-class { font-weight: 500; }
.cu-when { color: #555; }
.cu-read { margin: 4px 0 0; padding-left: 18px; font-size: 14px; line-height: 21px; }
.cu-rr { font-size: 14px; color: #444; margin-top: 4px; }
.cu-deadlines { list-style: none; padding: 0; margin: 0; }
.cu-deadlines li { display: flex; gap: 10px; align-items: baseline; padding: 4px 0; border-top: 1px dashed #e3e3e3; }
.cu-deadlines li:first-child { border-top: 0; }
.cu-d { flex: 0 0 92px; font-weight: 700; color: var(--due); font-size: 14px; }
.cu-t { flex: 1 1 auto; }
.cu-in { flex: 0 0 auto; font-size: 12px; color: #777; }

/* ---- four levers map ---- */
.levers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 14px; row-gap: 0; margin: 18px 0 8px; }
.lever-train { grid-column: 1 / 4; grid-row: 1; position: relative; height: 46px;
  margin: 0 calc(100% / 6 - 2px); border: 3px solid var(--lev-train); border-bottom: 0; border-radius: 10px 10px 0 0; }
.lever-train::after { /* arrowhead into Weights */
  content: ""; position: absolute; left: -9px; bottom: -2px; border: 7.5px solid transparent;
  border-top: 11px solid var(--lev-train); border-bottom: 0; transform: translateY(100%); }
.lever-train-label { position: absolute; left: 50%; top: -13px; transform: translateX(-50%); white-space: nowrap;
  background: var(--lev-train); color: #fff; font-family: var(--head-font); font-weight: 600; font-size: 14px;
  line-height: 22px; padding: 1px 12px; border-radius: 999px; }
.lever-train-label small { font-weight: 400; opacity: .9; font-size: 13px; }
.lever { grid-row: 2; margin-top: 12px; border-top: 6px solid var(--c); background: var(--t); border-radius: 3px;
  padding: 10px 12px 12px; }
.lever h5 { margin: 0 0 4px !important; color: var(--c) !important; font-size: 18px !important; }
.lever p { font-size: 14px; line-height: 20px; margin: 0 0 6px; }
.lever .where { font-size: 12.5px; color: #555; font-family: var(--head-font); font-weight: 600; }
.lever-inference h5 { color: var(--lev-inference) !important; }
.lever-eval { grid-row: 3; grid-column: 1 / -1; margin-top: 10px; background: var(--lev-eval); color: #fff;
  border-radius: 3px; padding: 8px 14px; font-family: var(--head-font); font-size: 15px; text-align: center; }
.lever-eval strong { letter-spacing: .3px; }
.lever-eval span { opacity: .9; }
.levers-caption { text-align: center; font-size: 14px; color: #555; margin: 6px 0 0; }
@media (max-width: 700px) {
  .levers { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 10px; }
  .lever-train { grid-column: 1 / -1; grid-row: 1; height: auto; margin: 0 0 4px; border: 0; border-left: 4px solid var(--lev-train);
    border-radius: 0; background: rgba(107,62,117,.09); padding: 6px 10px; }
  .lever-train::after { display: none; }
  .lever-train-label { position: static; transform: none; white-space: normal; display: inline-block; }
  .lever { grid-row: auto; margin-top: 10px; }
  .lever-eval { grid-row: auto; }
}

/* ---- staff + info ---- */
.s27 .members_wrapper { justify-content: flex-start; gap: 18px 8px; margin: 6px 0 10px; }
.avatar-fallback { width: 120px; height: 120px; border-radius: 80%; margin: 0 auto; display: flex; align-items: center;
  justify-content: center; background: #e6e0e1; color: var(--umn-maroon); font-family: var(--head-font); font-weight: 700;
  font-size: 26px; }
.member_image_caption .role { color: #666; font-size: 14px; }
.member_image_caption .oh { color: #555; font-size: 13px; line-height: 18px; display: block; margin-top: 4px; }
.info-dl { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 6px 18px; margin: 0; }
.info-dl dt { font-weight: 700; }
.info-dl dd { margin: 0; }
@media (max-width: 600px) { .info-dl { grid-template-columns: minmax(0, 1fr); gap: 0; } .info-dl dd { margin-bottom: 8px; } }

/* ---- generic tables (override main.css fixed widths) ---- */
.s27 table { border-collapse: collapse; table-layout: auto; width: 100%; margin-bottom: 12px; }
.s27 table td, .s27 table th { width: auto; overflow: visible; padding: 7px 10px; border: 1px solid var(--line);
  vertical-align: top; text-align: left; }
.s27 table th { background: #f3f3f3; font-weight: 700; font-family: var(--head-font); font-size: 15px; }
.s27 table tfoot td { font-weight: 700; background: #fafafa; }
.s27 td.num, .s27 th.num { text-align: right; white-space: nowrap; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 12px; }
.table-scroll > table { margin-bottom: 0; }

/* ---- schedule ---- */
.sched-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-family: var(--head-font); font-weight: 600; font-size: 14px; line-height: 20px; padding: 3px 11px;
  border-radius: 999px; border: 1.5px solid var(--mc, #555); color: var(--mc, #555); background: #fff; cursor: pointer; }
.chip .cid { opacity: .75; font-weight: 700; margin-right: 3px; }
.chip.active { background: var(--mc, #555); color: #fff; }
.chip:focus-visible, .linkbtn:focus-visible { outline: 2px solid var(--umn-gold); outline-offset: 1px; }
.linkbtn { font-family: var(--head-font); font-size: 14px; border: 0; background: none; color: var(--link); cursor: pointer; padding: 3px 6px; }
.sched-legend { font-size: 13px; color: #555; margin: 0 0 10px; line-height: 20px; }
.sched-legend .star { color: #b07a00; }
.s27 table.sched { table-layout: fixed; min-width: 880px; }
.sched col.c-wk { width: 50px; } .sched col.c-date { width: 78px; } .sched col.c-lec { width: 40%; }
.sched col.c-read { width: 31%; } .sched col.c-due { width: 15%; }
.sched td { font-size: 14.5px; line-height: 21px; }
.sched td.c-wk { text-align: center; color: #555; font-family: var(--head-font); font-weight: 600; padding-left: 4px; padding-right: 4px; }
.sched td.c-wk.wk-label { font-size: 11.5px; line-height: 16px; }
.sched td.c-date { white-space: nowrap; font-family: var(--head-font); }
.sched td.c-date .dow { display: block; color: #666; font-size: 13px; line-height: 16px; }
.sched td.c-date .md { font-weight: 600; }
.srow > td { background: var(--mt, #fff); }
.srow > td:first-child { box-shadow: inset 4px 0 0 var(--mc, transparent); }
.lec-id { display: inline-block; min-width: 34px; text-align: center; font-family: var(--head-font); font-weight: 700; font-size: 12.5px;
  color: #fff; background: var(--mc, #555); border-radius: 3px; padding: 0 5px; margin-right: 5px; line-height: 19px; vertical-align: 1px; }
.lec-title { font-weight: 500; }
.doc-link { white-space: nowrap; font-size: 13.5px; margin-left: 6px; }
.lec-goal { color: #666; font-size: 13px; line-height: 19px; margin-top: 3px; }
.lec-topics { margin-top: 3px; font-size: 13.5px; }
.lec-topics > summary { color: #555; font-size: 13px; }
.lec-topics ul { margin: 3px 0 2px; padding-left: 18px; }
.lec-topics .demo { color: #444; margin-top: 2px; }
.next-badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  background: var(--umn-gold); color: #4a3700; border-radius: 3px; padding: 0 5px; margin-left: 6px; vertical-align: 1px; }
.reads { list-style: none; padding: 0 !important; margin: 0 !important; }
.reads li { padding-left: 16px; text-indent: -16px; margin-bottom: 3px; font-size: 13.5px; line-height: 19px; }
.reads li.req a { font-weight: 700; }
.reads .star { display: inline-block; width: 16px; text-indent: 0; color: #b07a00; }
.reads .dot { display: inline-block; width: 16px; text-indent: 0; color: #999; }
.opt-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .7px; color: #777; margin: 6px 0 2px; font-weight: 700; }
.ev { font-size: 13.5px; line-height: 19px; margin-bottom: 5px; }
.ev-due, .ev-due a { color: var(--due); font-weight: 600; }
.ev-release, .ev-release a { color: var(--release); font-weight: 600; }
.ev-date { font-weight: 400; white-space: nowrap; }
.mod-head > td { background: var(--mt); border-left: 6px solid var(--mc) !important; padding: 7px 12px !important;
  font-family: var(--head-font); }
.mod-head .mh-id { display: inline-block; font-weight: 700; color: #fff; background: var(--mc); border-radius: 3px;
  padding: 0 6px; font-size: 13px; line-height: 20px; margin-right: 6px; vertical-align: 1px; }
.mod-head .mh-name { font-weight: 700; font-size: 17px; color: var(--mc); }
.mod-head .mh-cont { color: #666; font-size: 14px; }
.mod-head .mh-blurb { color: #444; font-size: 14px; margin-left: 8px; font-family: var(--body-font); }
.mod-head .mh-range { float: right; color: #555; font-size: 13px; font-weight: 600; }
.brk > td { background: rgba(128,128,128,.22); color: #444; font-style: italic; }
.drow .lec-title { color: #666; font-style: italic; font-weight: 400; }
.srow.past > td { opacity: .62; }
.srow.past:hover > td { opacity: 1; }
.srow.next-up > td { background-image: linear-gradient(rgba(255,204,51,.22), rgba(255,204,51,.22)); }
.srow.next-up > td:first-child { box-shadow: inset 6px 0 0 var(--umn-gold); }
.is-hidden { display: none !important; }

/* ---- assignments ---- */
.lever-chip { display: inline-block; font-family: var(--head-font); font-weight: 600; font-size: 13px; line-height: 20px;
  padding: 0 8px; border-radius: 999px; color: #fff; background: var(--c, #555); white-space: nowrap; }
.asg-summary td { font-size: 14.5px; }
.asg-summary td.nowrap { white-space: nowrap; }
.asg-card { border: 1px solid #e3e3e3; border-top: 5px solid var(--c); border-radius: 3px; padding: 12px 16px 6px; margin: 16px 0; }
.asg-card h4 { margin: 0 0 8px !important; }
.asg-card h4 .aid { color: var(--c); margin-right: 6px; }
.asg-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 800px) { .asg-grid { grid-template-columns: minmax(0, 1fr); gap: 4px; } }
.asg-card .lbl { font-weight: 700; }
.glance { background: #f7f7f7; border-radius: 3px; padding: 10px 12px; font-size: 14px; line-height: 20px; margin-bottom: 12px; }
.glance dl { margin: 0; }
.glance dt { font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .5px; color: #555; margin-top: 6px; }
.glance dt:first-child { margin-top: 0; }
.glance dd { margin: 0; }
.rubric-pts { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 0; padding: 0; list-style: none; }
.rubric-pts li { font-size: 12.5px; background: #fff; border: 1px solid #ddd; border-radius: 3px; padding: 0 6px; }
.callout { border-left: 5px solid var(--umn-maroon); background: #faf6f6; padding: 10px 14px; margin: 12px 0; border-radius: 0 3px 3px 0; }
.callout.gold { border-left-color: var(--umn-gold); background: #fffaf0; }
.callout > :last-child { margin-bottom: 0; }
.callout h5 { margin-top: 0 !important; }

/* ---- project ---- */
.keybox { border: 1.5px solid var(--umn-maroon); border-radius: 4px; padding: 0 16px 10px; margin: 10px 0 14px; background: #fff; }
.keybox-title { display: inline-block; background: var(--umn-maroon); color: #fff; font-family: var(--head-font);
  font-weight: 600; padding: 2px 12px; border-radius: 0 0 4px 4px; margin-bottom: 8px; font-size: 14px; }
.link-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.link-row .qbtn { font-size: 14px; padding: 5px 12px; }
.milestones td details > summary { font-weight: 600; }
.ms-details { margin: 6px 0 2px; font-size: 14px; line-height: 21px; color: #333; }
.ms-details p { margin: 0 0 6px; }
.ms-details ol, .ms-details ul { margin: 0 0 6px; padding-left: 22px; }
.ms-details li { margin-bottom: 3px; }
.milestones td.due { color: var(--due); white-space: nowrap; }
@media (max-width: 600px) {   /* milestone rows stack as cards on phones */
  .milestones thead { display: none; }
  .s27 .milestones, .milestones tbody, .milestones tfoot, .milestones tr, .milestones td { display: block; width: 100%; }
  .milestones tr { border: 1px solid var(--line); border-radius: 3px; margin-bottom: 8px; background: #fff; }
  .s27 .milestones td { border: 0; padding: 4px 10px; text-align: left; }
  .milestones td.due { white-space: normal; }
  .milestones td.due::before { content: "Due: "; color: #555; font-weight: 700; }
  .milestones tbody td.num::before, .milestones tfoot td.num::before { content: "Points: "; color: #555; font-weight: 700; }
  .milestones tfoot td:empty { display: none; }
}
.types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; padding: 0; list-style: none; counter-reset: t; }
.types li { counter-increment: t; border: 1px solid #e6e6e6; border-radius: 3px; padding: 8px 12px; font-size: 14.5px; line-height: 21px; }
.types li::before { content: counter(t) ". "; font-weight: 700; color: var(--umn-maroon); }
@media (max-width: 700px) { .types { grid-template-columns: minmax(0, 1fr); } }
.ideas-tools { margin: -4px 0 6px; }
.idea-group { border-left: 5px solid var(--c); background: #fafafa; margin: 8px 0; padding: 6px 12px; border-radius: 0 3px 3px 0; }
.idea-group > summary { font-family: var(--head-font); font-weight: 700; font-size: 17px; color: var(--c); }
.idea-group > summary .cnt { color: #777; font-weight: 400; font-size: 14px; margin-left: 6px; }
.idea-group ol { margin: 6px 0 4px; padding-left: 26px; }
.idea-group li { margin-bottom: 6px; font-size: 14.5px; line-height: 21px; }
.idea-group li em { font-style: italic; font-weight: 600; }
.advice li { margin-bottom: 4px; }

/* ---- grading ---- */
.scale { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; padding: 0; list-style: none; }
.scale li { border: 1px solid #ddd; border-radius: 3px; padding: 2px 9px; font-size: 14px; background: #fafafa; }
.scale b { display: inline; margin-right: 4px; color: var(--umn-maroon); }
.policy-list > li { margin-bottom: 6px; }

/* ---- resources ---- */
.related { padding-left: 20px; }
.related li { margin-bottom: 8px; }
.related .who { color: #555; }
.related .use { display: block; font-size: 14px; color: #555; line-height: 20px; }

/* ---- footer ---- */
.s27 footer { border-top: 4px solid var(--umn-gold); padding: 16px 12px 20px; margin-top: 30px; line-height: 22px; }
.s27 footer a { color: #fff; text-decoration: underline; }
.s27 footer .foot-small { font-size: 13px; opacity: .9; }

/* ---- mobile ---- */
@media (max-width: 600px) {
  .s27 .card { padding: 4px 14px 14px; }
  .s27 .card > h3.sec-title { font-size: 23px; }
  .hero { padding: 22px 0 12px; }
  .s27 .hero h1 { font-size: 36px; }
  .hero-sub { font-size: 18px; }
  .hero-meta { font-size: 14px; }
  .qbtn { font-size: 14px; padding: 5px 12px; }
  .s27 .navbar-brand { font-size: 1.05em; }
  .navbar-right { display: none; }
  .mod-head .mh-range { float: none; margin-left: 6px; }
  .s27 .members_wrapper { justify-content: center; }
}

@media print {
  .secnav, .sched-tools, .quick-links { display: none; }
  .srow.past > td { opacity: 1; }
  details { display: block; }
}

/* ---- rubric page ---- */
.rubric-table td.pts { width: 70px; text-align: right; white-space: nowrap; font-weight: 700; color: var(--umn-maroon); }
.rubric-table tr.part > td { background: #f3eced; font-family: var(--head-font); font-weight: 700; font-size: 16px; }
