:root {
  font: 100%/1.55 Aptos, system-ui, sans-serif;
  color: #17243a;
  background: #f4f7fb;
  --blue: #005bbb;
  --muted: #44556b;
  --line: #d0dbe8;
}
* { box-sizing: border-box; }
body { margin: 0; }
.wrap { width: min(68rem, calc(100% - 2rem)); margin-inline: auto; }
header { background: var(--blue); color: white; }
.course { display: flex; align-items: center; justify-content: space-between; padding-block: .8rem; font-weight: 700; }
.course-code { font-size: 1.125rem; }
main { padding-block: clamp(1.75rem, 5vw, 3.5rem); }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.35rem); line-height: 1.1; letter-spacing: -.045em; }
h2 { margin: 0; font-size: 1.2rem; }
p { margin: .55rem 0 1rem; color: var(--muted); }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; font-weight: 700; }
.role { margin-block: 1.65rem; }
.role label { display: inline-flex; gap: .45rem; align-items: center; margin: .4rem .45rem 0 0; padding: .45rem .9rem; background: white; border: 1px solid var(--line); border-radius: .4rem; cursor: pointer; }
input { accent-color: var(--blue); }
.layout { display: grid; gap: 1rem; grid-template-columns: minmax(0, 2fr) minmax(15rem, 1fr); align-items: start; }
.card { padding: clamp(1rem, 3vw, 1.5rem); border: 1px solid var(--line); background: white; border-radius: .65rem; }
.category { border-top: 1px solid var(--line); padding: .75rem 0; }
.category h3 { font-size: 1rem; margin: 0 0 .35rem; }
.inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; align-items: start; }
.inputs label, .possible { font-size: .875rem; font-weight: 600; }
input[type=number] { width: 100%; min-height: 2.6rem; border: 1px solid #8196af; border-radius: .35rem; font: inherit; margin-top: .25rem; padding: .35rem .45rem; }
.possible span { display: block; font-size: 1rem; margin-top: .45rem; }
.error { color: #9b241c; margin: .4rem 0 0; font-size: .875rem; }
.error:empty, .copy-message:empty, #threshold:empty, #weight:empty { display: none; }
.result { border-top: .25rem solid var(--blue); }
output { display: block; font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 750; color: var(--blue); font-variant-numeric: tabular-nums; }
button { font: inherit; font-weight: 650; cursor: pointer; min-height: 2.6rem; padding: .35rem .8rem; background: var(--blue); color: white; border: 1px solid var(--blue); border-radius: .35rem; }
button.secondary { margin-top: .6rem; color: var(--blue); background: white; }
button:disabled { background: #e6ebf1; color: #44556b; border-color: #c4cfdb; cursor: default; }
:focus-visible { outline: 3px solid #1463c1; outline-offset: 2px; }
[aria-invalid=true] { border-color: #9b241c !important; }
@media (max-width: 43rem) { .layout { grid-template-columns: 1fr; } }
.setup { padding: .85rem 1rem; margin: 0 0 1rem; background: #edf5ff; border-radius: .45rem; }
.setup label, .setup select, small { display: block; }
small, .hint { font-size: .875rem; color: var(--muted); }
.setup select { font: inherit; margin-block: .35rem; padding: .45rem; max-width: 100%; }
.month { margin-block: .65rem; border: 1px solid var(--line); border-radius: .55rem; }
.month > summary { cursor: pointer; padding: .8rem 1rem; background: #f4f8fd; border-radius: .55rem; }
.month-score { display: inline-block; margin-left: .6rem; color: var(--muted); font-size: .875rem; }
.month-body { padding: .15rem 1rem .85rem; }
.category:first-of-type { border-top: 0; }
.inputs { align-items: end; }
.possible { background: #edf5ff; border-radius: .35rem; padding: .4rem .55rem; }
.possible span { margin-top: .1rem; }
.adjust, .scheduled { margin-block: .45rem; font-size: .875rem; }
.adjust summary { cursor: pointer; color: var(--blue); }
.adjust label { display: block; margin-top: .4rem; }
.adjust input, .scheduled input { max-width: 10rem; display: block; }
@media (min-width: 43.01rem) { .result { position: sticky; top: 1rem; } }
@media (max-width: 29rem) { .inputs { grid-template-columns: 1fr 1fr; } .possible { grid-column: 1 / -1; } }
main { padding-block: 1.15rem; }
h1 { font-size: clamp(1.75rem, 4vw, 2.45rem); }
.role { margin-block: .7rem 1rem; }
.role label { margin-top: .2rem; padding: .25rem .65rem; }
.card { padding: .85rem 1rem; }
.setup { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .65rem; padding: .45rem .65rem; margin-bottom: .55rem; }
.setup small { flex-basis: 100%; }
.setup select { margin: 0; padding: .25rem .45rem; }
.month { margin-block: .4rem; }
.month > summary { padding: .45rem .7rem; }
.month-body { padding: .2rem .55rem .45rem; }
.table-wrap { overflow-x: auto; }
.scoring { width: 100%; border-collapse: collapse; font-size: .875rem; }
.scoring th, .scoring td { text-align: left; padding: .3rem .35rem; vertical-align: middle; }
.scoring thead { color: var(--muted); }
.scoring tbody tr { border-top: 1px solid var(--line); }
.scoring td:nth-child(2), .scoring td:nth-child(3) { width: 17%; }
.scoring td:last-child { width: 33%; }
.scoring input[type=number] { margin: 0; min-height: 2.15rem; min-width: 2.9rem; padding: .2rem .35rem; }
.app-points { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .55rem; background: #edf5ff; border-radius: .4rem; padding: .2rem .4rem; }
.app-points > strong { font-size: 1.25rem; color: #07346d; min-width: 1.5em; }
.point-math { display: flex; flex-wrap: wrap; gap: .2rem; }
.point-math span { background: #fff; border-radius: .23rem; padding: 0 .22rem; white-space: nowrap; }
.adjust, .scheduled { margin: .15rem 0 0; }
.scheduled { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.scheduled input { width: 4.4rem; }
.month .hint, #totals + .hint { margin: .3rem 0 .45rem; }
.period-totals { margin: .45rem 0; }
.period-totals div { display: flex; justify-content: space-between; gap: .65rem; padding: .28rem 0; border-bottom: 1px solid var(--line); font-size: .875rem; }
.period-totals dd { margin: 0; text-align: right; font-weight: 650; }
@media (min-width: 43.01rem) { .layout { grid-template-columns: minmax(0, 2.3fr) minmax(15rem, 1fr); } }
.month-tabs { display: flex; gap: .35rem; margin-top: .7rem; border-bottom: 1px solid var(--line); }
.month-tabs button { flex: 1; min-width: 0; color: var(--muted); background: #f4f7fb; border-color: transparent; border-radius: .4rem .4rem 0 0; font-size: .875rem; padding-inline: .35rem; }
.month-tabs button[aria-selected=true] { background: #e7f1ff; color: #07346d; box-shadow: inset 0 -.19rem var(--blue); }
.month { border: 0; margin: 0; }
.month-body { padding: .2rem 0 .5rem; }
.scoring th, .scoring td { padding: .42rem .65rem; }
.scoring th:first-child { width: 24%; padding-left: .15rem; }
.scoring td:nth-child(2), .scoring td:nth-child(3) { width: 20%; }
.scoring td:last-child { width: 36%; padding-right: .1rem; }
.point-math { gap: .35rem; }
.month-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 11rem)); justify-content: space-between; gap: .5rem; padding-top: .45rem; border-top: 1px solid var(--line); }
.month-nav button.secondary { margin: 0; }
@media (max-width: 32rem) { .scoring th, .scoring td { padding-inline: .3rem; } }
.app-points { display: grid; grid-template-columns: 1fr 1fr 1.15fr; gap: 0; padding: .3rem .2rem; text-align: center; font-variant-numeric: tabular-nums; }
.app-points > div { display: grid; align-content: center; line-height: 1.25; padding-inline: .15rem; }
.app-points span { color: var(--muted); font-size: .875rem; }
.app-points b { font-size: 1rem; }
.app-total { border-left: 1px solid var(--line); }
.app-total strong { color: #07346d; font-size: 1.25rem; }
.scheduled { display: grid; justify-items: start; gap: .15rem; font-weight: 400; margin-top: .2rem; }
button.reset { display: block; margin: .65rem 0 0 auto; color: #8b251f; border-color: #ca8c87; background: #fff6f5; }
button.reset:hover { background: #fce8e6; }
@media (min-width: 43.01rem) { .result-area { position: sticky; top: 1rem; } .result { position: static; } }
.wrap { width: min(74rem, calc(100% - 2rem)); }
.setup { display: grid; justify-items: start; gap: .25rem; }
.setup select { margin-top: .2rem; }
.scoring th:first-child { width: 38%; }
.scoring td:nth-child(2), .scoring td:nth-child(3) { width: 15%; }
.scoring td:last-child { width: 32%; }
.scoring input:is([data-field=earned], [data-field=na], [data-field=scheduled]) { width: 3.65rem; }
.category-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .25rem .5rem; }
.scheduled { display: flex; align-items: center; justify-content: flex-end; margin: 0; }
.month-nav button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-width: 0; padding-inline: .35rem; line-height: 1.2; white-space: nowrap; }
.nav-triangle { flex: none; width: .65rem; height: .8rem; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); }
#month-back .nav-triangle { transform: rotate(180deg); }
@media (max-width: 26rem) { .month-nav button { font-size: .875rem; } }
@media (max-width: 22rem) { .month-nav { grid-template-columns: 1fr; } }
button.reset { width: 100%; margin: 1rem 0 0; }
#copy { width: 100%; }
#copy:enabled { background: #17643e; border-color: #17643e; }
#copy:enabled:hover { background: #104d2e; }
.scoring th:first-child { width: 31%; }
.scoring td:nth-child(2), .scoring td:nth-child(3) { width: 17%; }
.scoring td:last-child { width: 35%; }
.scoring thead th:not(:first-child), .scoring tbody td { text-align: center; }
.scoring thead th:not(:first-child) { white-space: nowrap; }
.category-heading { display: block; }
.scheduled { justify-content: flex-start; gap: .4rem; margin: .15rem 0; }
.scheduled-note { display: block; font-size: .8rem; font-weight: 400; line-height: 1.3; }
.scheduled-note span { display: block; }
.scoring .adjust input { margin-inline: auto; }
#copy:disabled { background: #e3f2e9; border-color: #b0cdbb; color: #375b46; }
@media (max-width: 34rem) { .scoring { min-width: 29rem; } }
.category-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: nowrap; gap: .5rem; font-size: .95rem; }
.schedule-count { flex: 0 0 auto; }
.scoring tbody tr.schedule-help { border-top: 0; }
.scoring tbody tr.schedule-help td { text-align: left; padding: 0 .15rem .45rem; }
.schedule-help .scheduled-note { font-size: .75rem; }
.schedule-help .scheduled-note strong { display: block; font-size: .875rem; margin-bottom: .12rem; }
.scoring.with-schedule th:first-child { width: 23%; }
.scoring.with-schedule td:nth-child(2),
.scoring.with-schedule td:nth-child(3),
.scoring.with-schedule td:nth-child(4) { width: 16%; }
.scoring.with-schedule td:last-child { width: 29%; }
.scoring.with-schedule .category:is([data-category="2"], [data-category="0"]) { height: 4.35rem; }
.category-heading:has(.scheduled-note, .take2-note:not([hidden])) { display: block; line-height: 1.2; }
.category-heading :is(.scheduled-note, .take2-note) { margin-top: .12rem; font-size: .75rem; font-weight: 400; line-height: 1.2; }
.take2-note[hidden] { display: none; }
.scheduled-exclusion { white-space: nowrap; }
#copy, button.reset { min-height: 2.6rem; }
button.reset { width: calc(100% - 2rem - 2px); margin-inline: auto; }
.field-guide-intro { margin: .35rem 0 0; font-size: .875rem; line-height: 1.4; }
.field-guide { list-style: disc; margin: .35rem 0 .7rem; padding-inline-start: 1.15rem; color: var(--muted); font-size: .875rem; line-height: 1.4; }
.field-guide li + li { margin-top: .15rem; }
