:root {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 100%;
  line-height: 1.55;
  color: #1d293d;
  background: #f5f7fa;
  --muted: #505f72;
  --blue: #174188;
  --border: #d6dfea;
  --module-bg: #f1f6fc;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button, summary, .statuses label { cursor: pointer; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid #2475c3; outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only, .statuses input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.hero {
  position: relative; color: white; overflow: hidden;
  background: linear-gradient(115deg, #12274c, #183f7c 72%, #214c8e);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(147deg, transparent 0 148px, #e9f0ff15 149px, transparent 150px 280px);
}
.top, .hero-content, main, footer { width: min(1130px, calc(100% - 48px)); margin-inline: auto; position: relative; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 0; border-bottom: 1px solid #e5efff33; }
.brand { text-decoration: none; color: white; font-size: 1.08rem; font-weight: 700; display: flex; gap: 10px; align-items: center; }
.brand span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; background: #fff2; }
.year { color: #f4f8ff; font-size: .9rem; text-align: right; }
.eyebrow { font-size: .84rem; letter-spacing: .09em; font-weight: 700; }
.hero-content { padding: 31px 0 36px; }
.hero-content p { margin: 0; color: #e9effa; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.15; margin: 8px 0; }
.hero-content > p:last-child { font-size: 1.08rem; }
.chooser { padding-top: 23px; }
.choose-heading h2 { font-size: 1.12rem; margin: 0 0 11px; }
.line { display: none; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.card {
  min-height: 76px; padding: 12px; text-align: left; background: white; border: 1px solid var(--border);
  border-radius: 8px; color: #182649; display: grid; align-content: center; align-items: center;
  grid-template-columns: 36px 1fr; gap: 0 9px;
}
.card:hover { background: #f8fbff; border-color: #7a96be; }
.card[aria-pressed=true] { border-color: #174188; box-shadow: inset 0 -3px #174188; background: #edf4ff; }
.card strong { font-size: 1rem; line-height: 1.25; }
.card small { grid-column: 2; font-size: .84rem; color: var(--muted); line-height: 1.35; }
.icon { grid-row: span 2; width: 36px; height: 36px; border-radius: 7px; display: grid; place-items: center; font-size: 1.36rem; color: var(--ink); background: var(--pale); }
#simulator { margin-top: 34px; }
.worktop { display: flex; justify-content: space-between; align-items: end; gap: 15px; flex-wrap: wrap; }
.worktop .eyebrow { color: var(--blue); margin: 0 0 4px; }
.worktop h2 { margin: 0; font-size: clamp(1.55rem, 4vw, 2.15rem); line-height: 1.2; }
.actions, .levels { display: flex; gap: 9px; flex-wrap: wrap; }
.actions button, .levels button, .goal button {
  min-height: 42px; padding: 8px 14px; border-radius: 6px; border: 1px solid #9daec4;
  background: white; color: var(--blue); font-weight: 650;
}
.actions .primary, .goal .primary, .levels button[aria-pressed=true] { color: white; background: var(--blue); border-color: var(--blue); }
.actions button:hover, .levels button:hover, .goal button:hover { filter: brightness(.94); }
.levels { padding: 19px 0 14px; }
.levels button { flex: 1; text-align: left; min-width: 125px; }
.summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.metric { padding: 12px 14px; background: white; display: flex; flex-direction: column; justify-content: space-between; gap: 5px; }
.metric span { font-size: .87rem; color: var(--muted); }
.metric strong { font-size: 1.1rem; line-height: 1.35; }
.progress { color: var(--muted); padding: 12px 0 16px; }
.goal { border: 1px solid #b9cce6; border-left: 4px solid var(--blue); border-radius: 6px; background: #edf4ff; }
.goal summary { padding: 13px 16px; color: #16396e; font-weight: 700; }
.goal-body { padding: 0 16px 16px; }
.goal-body > p { margin: 0 0 9px; }
#goal-form label { display: block; font-weight: 600; margin-bottom: 5px; }
.goal-controls { display: flex; gap: 8px; align-items: stretch; }
.goal-controls .grade-box { width: 116px; }
#goal-result { border-top: 1px solid #b9cce6; margin: 13px 0 0; padding-top: 10px; font-weight: 600; }
.entry-heading { margin: 26px 0 12px; }
.entry-heading h3, .entry-heading p { margin: 0; }
.entry-heading p { color: var(--muted); }
.semester { margin-bottom: 18px; border: 1px solid var(--border); background: white; border-radius: 8px; }
.semester > summary { padding: 13px 17px; background: #e8eff9; border-radius: 7px; color: #16396e; font-weight: 750; }
.semester[open] > summary { border-radius: 7px 7px 0 0; }
.semester-average { float: right; font-size: .92rem; font-weight: 650; }
.semester h3 { font-size: 1rem; margin: 0; }
.unit { padding: 10px 16px 8px; border-top: 1px solid var(--border); }
.unit-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.unit-title span, .module-title small { color: var(--muted); font-size: .88rem; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto 116px; gap: 10px 16px; align-items: center; padding: 6px 10px; }
.row { background: var(--module-bg); }
.row + .row { border-top: 1px solid #dee7f1; }
.row:focus-within { box-shadow: inset 3px 0 #6390c5; }
.row.neutral { color: #526072; }
.module-title label { font-weight: 550; overflow-wrap: anywhere; }
.module-title small { display: block; line-height: 1.35; }
.statuses { position: relative; display: grid; grid-template-columns: repeat(4, auto); gap: 1px; justify-content: start; border: 0; margin: 0; padding: 0; min-width: 0; }
.statuses label { position: relative; display: flex; text-align: center; }
.statuses span {
  display: grid; place-items: center; min-height: 38px; padding: 6px 10px; border: 1px solid #9daec4;
  background: white; color: #283a54; font-size: .88rem; line-height: 1.25;
}
.statuses label:first-of-type span { border-radius: 5px 0 0 5px; }
.statuses label:last-of-type span { border-radius: 0 5px 5px 0; }
.statuses label:hover span { background: #f0f5ff; }
.statuses input:checked + span { background: #dce9fc; color: #14366d; border-color: #416ca9; font-weight: 700; box-shadow: inset 0 -2px #416ca9; }
.statuses input:focus-visible + span { outline: 3px solid #2475c3; outline-offset: 2px; z-index: 1; }
.grade-box { display: flex; align-items: center; border: 1px solid #9daec4; background: white; border-radius: 6px; min-width: 0; }
.grade-box input { border: 0; background: transparent; color: inherit; width: 100%; min-width: 0; min-height: 39px; padding: 7px 6px; border-radius: 6px; }
.grade-box span { flex: none; padding-right: 7px; font-size: .87rem; color: var(--muted); }
.grade-box:has(input:disabled) { background: #e5e9ef; }
.grade-box:has(input[aria-invalid=true]) { border-color: #b01e3c; }
.row .error { color: #a1263c; grid-column: 2/-1; margin: 0; }
.info { margin: 30px auto; display: grid; gap: 9px; }
.info details { background: white; border: 1px solid var(--border); border-radius: 7px; padding: 12px 15px; }
.info summary { font-weight: 670; color: #193d76; }
.info p { color: #364760; }
footer { padding: 17px 0 24px; border-top: 1px solid var(--border); display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; color: var(--muted); font-size: .88rem; }
@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .row { grid-template-columns: minmax(0, 1fr) 126px; gap: 7px 10px; padding: 9px 10px; }
  .module-title { grid-column: 1/-1; }
  .row .error { grid-column: 1/-1; }
}
@media (max-width: 520px) {
  .top, .hero-content, main, footer { width: calc(100% - 28px); }
  .card { grid-template-columns: 1fr; padding: 9px; gap: 4px; align-content: start; }
  .card small { grid-column: 1; }
  .icon { grid-row: auto; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .levels button { min-width: 0; padding-inline: 8px; text-align: center; font-size: .9rem; }
  .actions { width: 100%; }
  .actions button { flex: 1 1 auto; }
  .unit { padding-inline: 9px; }
  .row { grid-template-columns: minmax(0, 1fr); padding: 10px 8px; }
  .row .grade-box { width: min(100%, 126px); }
  .statuses { grid-template-columns: repeat(4, minmax(0, 1fr)); justify-content: stretch; gap: 4px; }
  .statuses span { width: 100%; padding-inline: 4px; }
  .statuses label span { border-radius: 5px; }
  .semester-average { float: none; display: block; padding-left: 1em; }
  .semester > summary { padding-inline: 12px; }
}
@media (max-width: 520px), (any-pointer: coarse) {
  .actions button, .levels button, .goal button, .statuses span { min-height: 44px; }
  .grade-box input { min-height: 44px; font-size: 1rem; }
  .info summary { min-height: 44px; align-content: center; }
}
@media (max-width: 360px) {
  .statuses span { font-size: .82rem; padding-inline: 2px; }
}

:root [data-tone="pass"] { color: #145c38; }
:root [data-tone="fail"] { color: #a31f33; }
:root [data-tone="conditional"] { color: #8f4d05; }
.unit-title [data-tone]:not([data-tone="neutral"]) { font-weight: 700; }
