:root {
  --bg: #f5f7fb; --card: #ffffff; --text: #111827; --muted: #6b7280; --line: #e5e7eb;
  --brand: #1d4ed8; --brand-ink: #ffffff; --ok: #15803d; --ok-bg: #dcfce7; --warn: #b45309; --warn-bg: #fef3c7;
  --bad: #b91c1c; --bad-bg: #fee2e2; --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
header.top { background: var(--card); border-bottom: 1px solid var(--line); padding: 12px 20px; display: flex; align-items: center; gap: 16px; }
header.top h1 { font-size: 17px; margin: 0; flex: 1; }
main { max-width: 960px; margin: 24px auto; padding: 0 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 0 0 8px; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input, select, textarea { width: 100%; padding: 9px 11px; border: 1px solid #d1d5db; border-radius: 8px; font: inherit; background: #fff; color: inherit; }
textarea { min-height: 120px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; }
button, .btn { display: inline-block; border: 0; border-radius: 8px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; background: var(--brand); color: var(--brand-ink); text-decoration: none; }
button.secondary, .btn.secondary { background: #e5e7eb; color: var(--text); }
button.danger { background: var(--bad); }
button.ok { background: var(--ok); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.small { padding: 5px 10px; font-size: 13px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 1 1 200px; }
.muted { color: var(--muted); }
.error { color: var(--bad); white-space: pre-line; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #e5e7eb; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.bad { background: var(--bad-bg); color: var(--bad); }
.notice { padding: 12px 14px; border-radius: 8px; margin: 12px 0; }
.notice.warn { background: var(--warn-bg); color: #78350f; } .notice.bad { background: var(--bad-bg); color: #7f1d1d; } .notice.ok { background: var(--ok-bg); color: #14532d; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.steps { list-style: none; padding: 0; margin: 12px 0; }
.steps li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; }
.steps .n { width: 26px; height: 26px; border-radius: 50%; background: #e5e7eb; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.steps .n.done { background: var(--ok); color: #fff; }
.steps .grow { flex: 1; }
video, canvas.preview, img.preview { max-width: 100%; border-radius: 8px; background: #000; }
img.preview { background: none; border: 1px solid var(--line); }
.hidden { display: none !important; }
.overlay { position: fixed; inset: 0; background: rgba(17,24,39,.85); color: #fff; display: grid; place-items: center; z-index: 50; padding: 20px; text-align: center; }
.overlay .box { max-width: 520px; }
.toast { position: fixed; right: 16px; bottom: 16px; background: var(--bad); color: #fff; padding: 12px 16px; border-radius: 8px; z-index: 60; max-width: 360px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button { background: transparent; color: var(--text); border-radius: 8px; }
.tabs button.active { background: #e0e7ff; color: var(--brand); }
.grid-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.grid-imgs figure { margin: 0; } .grid-imgs img { width: 100%; border: 1px solid var(--line); border-radius: 6px; cursor: zoom-in; } .grid-imgs figcaption { font-size: 12px; color: var(--muted); }
pre { white-space: pre-wrap; }
@media (max-width: 600px) { main { margin: 12px auto; } .card { padding: 14px; } }
/* assessments */
.badge.type-quiz { background: #e0f2fe; color: #075985; } .badge.type-midterm { background: #ede9fe; color: #5b21b6; } .badge.type-final { background: #fee2e2; color: #991b1b; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 14px 0; }
.facts > div { background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.facts b { display: block; font-size: 14px; } .facts span { font-size: 12px; color: var(--muted); }
table.sections td { padding: 6px 8px; }
details summary { cursor: pointer; font-weight: 600; margin: 8px 0; }
.notice.blocked b { display: block; margin-bottom: 4px; }
.stimulus { background: #f8fafc; border-left: 4px solid var(--brand); padding: 12px 14px; border-radius: 6px; white-space: pre-line; margin: 0 0 14px; }
.part { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.part .ph { display: flex; gap: 8px; align-items: baseline; } .part .ph .lbl { font-weight: 700; } .part .ph .mk { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.part textarea { min-height: 160px; }
.section-banner { background: #eef2ff; color: #3730a3; border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; font-size: 14px; }
.section-banner b { display: block; }
.scheme { font-size: 13px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 6px; padding: 8px 10px; margin-top: 6px; white-space: pre-line; }
.counted-no { opacity: .6; }
/* ---------- portal (YPR brand: navy, red, gold; classic university typography) ---------- */
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-style: normal; font-display: swap; src: url(/fonts/cormorant-garamond-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 600; font-style: normal; font-display: swap; src: url(/fonts/cormorant-garamond-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 700; font-style: normal; font-display: swap; src: url(/fonts/cormorant-garamond-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-style: italic; font-display: swap; src: url(/fonts/cormorant-garamond-latin-500-italic.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url(/fonts/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url(/fonts/inter-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url(/fonts/inter-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url(/fonts/inter-latin-700-normal.woff2) format("woff2"); }

body.portal {
  --navy: #14215b; --navy-deep: #0c1540; --red: #c8202a; --gold: #c9a227; --gold-soft: #e9d9a6;
  --stone: #f6f3ec; --ink: #1a1f36; --rule: #e4dfd3; --brand: var(--navy);
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink);
  background: var(--stone); min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased;
}
.portal .wrap { max-width: 1160px; margin: 0 auto; padding-left: 24px; padding-right: 24px; width: 100%; }
.portal h1, .portal h2, .portal h3, .date-tile .d, .how-steps b, .hero-points b { font-variant-numeric: lining-nums; }
.portal h1, .portal h2, .portal h3 { font-family: var(--serif); font-weight: 600; letter-spacing: .1px; color: var(--navy); }
.portal .small-text { font-size: 13px; }
.eyebrow { margin: 0 0 6px; font: 600 11.5px/1.2 Inter, system-ui, sans-serif; letter-spacing: 2.2px; text-transform: uppercase; color: var(--gold); }
.eyebrow.dark { color: #8a7428; }

/* utility + brand bars */
.utility { background: var(--navy-deep); color: #c7cde6; font-size: 12.5px; }
.utility .wrap { display: flex; justify-content: space-between; align-items: center; height: 34px; gap: 16px; }
.utility nav { display: flex; gap: 22px; } .utility a { color: #c7cde6; text-decoration: none; } .utility a:hover { color: #fff; }
.brandbar { background: #fff; border-bottom: 1px solid var(--rule); position: relative; }
.brandbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 3px; background: linear-gradient(90deg, var(--navy) 0 70%, var(--red) 70% 90%, var(--gold) 90%); z-index: 2; }
.brandbar .wrap { display: flex; align-items: center; gap: 22px; padding-top: 14px; padding-bottom: 14px; }
.brandbar .brand img { display: block; height: 54px; width: auto; }
.brand-title { flex: 1; border-left: 1px solid var(--rule); padding-left: 22px; display: flex; flex-direction: column; line-height: 1.15; }
.brand-title b { font-family: var(--serif); font-size: 25px; font-weight: 600; color: var(--navy); }
.brand-title span { font-size: 11.5px; letter-spacing: 1.8px; text-transform: uppercase; color: #6b6f85; margin-top: 4px; }
.brand-user { display: flex; align-items: center; gap: 12px; font-size: 14px; color: #6b6f85; }

/* hero */
.hero { position: relative; color: #fff; overflow: hidden;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(201,162,39,.16), transparent 60%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 2px, transparent 2px 14px),
    linear-gradient(160deg, #0c1540 0%, #14215b 55%, #1d2f7a 100%); }
.hero .hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 56px; align-items: center; padding-top: 64px; padding-bottom: 72px; }
.hero h1 { color: #fff; font-size: 58px; line-height: 1.02; margin: 6px 0 0; font-weight: 600; }
.hero h1 em { display: block; font-style: italic; font-weight: 500; color: var(--gold-soft); }
.hero-rule { display: block; width: 72px; height: 2px; background: var(--gold); margin: 26px 0 22px; }
.hero .lede { font-size: 17px; line-height: 1.65; color: #d6dbf0; max-width: 560px; margin: 0; }
.hero-points { list-style: none; padding: 0; margin: 32px 0 0; display: flex; gap: 0; }
.hero-points li { padding: 0 26px; border-left: 1px solid rgba(255,255,255,.18); display: flex; flex-direction: column; }
.hero-points li:first-child { padding-left: 0; border-left: 0; }
.hero-points b { font-family: var(--serif); font-size: 22px; font-weight: 600; color: #fff; } .hero-points span { font-size: 13px; color: #aeb6d8; }

/* sign-in card */
.login-card { background: #fff; color: var(--ink); border-radius: 4px; padding: 30px 30px 24px; box-shadow: 0 30px 60px -20px rgba(6,10,40,.55), 0 0 0 1px rgba(255,255,255,.06); border-top: 4px solid var(--gold); }
.login-card h2 { font-size: 34px; margin: 0 0 2px; }
.login-card label { font-size: 13px; font-weight: 600; color: #3b4060; margin: 16px 0 6px; }
.portal input { border: 1px solid #d5d1c4; border-radius: 3px; padding: 11px 12px; background: #fdfcf9; transition: border-color .15s, box-shadow .15s; }
.portal input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(20,33,91,.12); background: #fff; }
.portal button, .portal .btn { border-radius: 3px; letter-spacing: .3px; }
.portal button:not(.secondary):not(.danger):not(.ok), .portal .btn:not(.secondary):not(.ghost) { background: var(--navy); }
.portal button:not(.secondary):not(.danger):not(.ok):hover, .portal .btn:not(.secondary):not(.ghost):hover { background: var(--navy-deep); }
button.block { width: 100%; padding: 13px 16px; margin-top: 4px; font-size: 15px; }
.login-card .fine { font-size: 12px; color: #7a7e93; border-top: 1px solid var(--rule); margin: 20px 0 0; padding-top: 14px; line-height: 1.55; }
.btn.ghost { background: transparent; color: var(--navy); border: 1px solid var(--navy); }
.btn.ghost:hover { background: var(--navy); color: #fff; }

/* main */
.portal-main { max-width: 1160px; width: 100%; margin: 0 auto; padding: 56px 24px 64px; flex: 1; }
.landing { display: flex; flex-direction: column; gap: 56px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--navy); padding-bottom: 12px; margin-bottom: 8px; }
.section-head h2 { font-size: 38px; margin: 0; line-height: 1; }
.portal .card { border-radius: 4px; border-color: var(--rule); box-shadow: 0 1px 2px rgba(20,33,91,.04); }

.assess-list { list-style: none; margin: 0; padding: 0; }
.assess-list li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 26px; align-items: center; padding: 22px 6px; border-bottom: 1px solid var(--rule); transition: background .15s; }
.assess-list li:hover { background: rgba(255,255,255,.6); }
.date-tile { width: 92px; text-align: center; background: #fff; border: 1px solid var(--rule); border-top: 4px solid var(--red); border-radius: 2px; padding: 8px 0 10px; display: flex; flex-direction: column; }
.date-tile.none { border-top-color: #b8b4a8; }
.date-tile .m { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--red); }
.date-tile .d { font-family: var(--serif); font-size: 42px; font-weight: 600; line-height: 1; color: var(--navy); margin: 2px 0; }
.date-tile .y { font-size: 11.5px; color: #7a7e93; }
.al-main { min-width: 0; }
.al-tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.al-main h3 { font-size: 26px; margin: 8px 0 2px; line-height: 1.15; }
.al-main p { margin: 2px 0 0; }
.al-close { font-size: 14px; color: var(--ink); font-weight: 500; margin-top: 8px !important; }
.portal .badge { border-radius: 2px; text-transform: uppercase; letter-spacing: 1px; font-size: 10.5px; padding: 3px 8px; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #eeeae0; color: #4b5068; }
.chip.ok { background: #e6f2ea; color: #1f6b3a; } .chip.warn { background: #fbf1d4; color: #8a5a00; } .chip.urgent { background: #fbe3e4; color: #a3151d; }
.chip.soon { background: #e7eaf6; color: var(--navy); } .chip.closed { background: #e5e7eb; color: #6b7280; }
.fact-close { border-color: #efc5c8 !important; background: #fff7f7 !important; }

.how-steps { margin: 18px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.how-steps li { padding: 8px 24px 4px; border-left: 1px solid var(--rule); display: flex; flex-direction: column; gap: 6px; }
.how-steps li:first-child { border-left: 0; padding-left: 0; }
.how-steps .num { font-family: var(--serif); font-size: 44px; line-height: 1; color: var(--gold); font-weight: 600; }
.how-steps b { font-family: var(--serif); font-size: 22px; color: var(--navy); font-weight: 600; line-height: 1.15; }
.how-steps li > span:last-child { color: #5d6178; font-size: 14px; line-height: 1.55; }

.help-strip { display: flex; align-items: center; justify-content: space-between; gap: 24px; background: #fff; border: 1px solid var(--rule); border-left: 4px solid var(--navy); padding: 22px 26px; }
.help-strip h3 { font-size: 26px; margin: 0 0 4px; } .help-strip p { margin: 0; color: #5d6178; font-size: 14px; }

.portal-foot { background: #fff; border-top: 1px solid var(--rule); font-size: 13px; color: #6b6f85; }
.portal-foot .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 22px; padding-bottom: 22px; }
.foot-brand { display: flex; align-items: center; gap: 14px; } .foot-brand img { height: 36px; width: auto; }
.foot-brand span { font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; border-left: 1px solid var(--rule); padding-left: 14px; }
.foot-meta { display: flex; gap: 22px; flex-wrap: wrap; } .portal-foot a { color: var(--navy); }

/* signed-in dashboard keeps the same look */
.portal #dash .card h2, .portal #dash .card h3 { font-family: var(--serif); }
.portal #dash .card h2 { font-size: 28px; } .portal #dash .card h3 { font-size: 22px; }
.portal .cover h2 { font-size: 30px; }

@media (max-width: 960px) {
  .hero .hero-grid { grid-template-columns: 1fr; gap: 36px; padding-top: 40px; padding-bottom: 48px; }
  .hero h1 { font-size: 42px; }
  .how-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 24px; }
  .how-steps li:nth-child(3) { border-left: 0; padding-left: 0; }
}
@media (max-width: 640px) {
  .portal .wrap { padding-left: 16px; padding-right: 16px; }
  .utility span { display: none; } .utility .wrap { justify-content: center; }
  .brandbar .wrap { gap: 14px; } .brandbar .brand img { height: 40px; }
  .brand-title { padding-left: 14px; } .brand-title b { font-size: 19px; } .brand-title span { display: none; }
  .hero h1 { font-size: 36px; } .hero .lede { font-size: 15.5px; }
  .hero-points li { padding: 0 14px; } .hero-points b { font-size: 18px; } .hero-points span { font-size: 12px; }
  .login-card { padding: 24px 20px 20px; }
  .portal-main { padding: 36px 16px 48px; } .landing { gap: 40px; }
  .section-head h2 { font-size: 30px; }
  .assess-list li { grid-template-columns: 70px minmax(0, 1fr); gap: 16px; }
  .date-tile { width: 70px; } .date-tile .d { font-size: 32px; }
  .al-main h3 { font-size: 21px; }
  .how-steps { grid-template-columns: 1fr; } .how-steps li { border-left: 0; padding-left: 0; }
  .help-strip { flex-direction: column; align-items: flex-start; }
}
