/* grades.golisano.dev. Tokens and rules are in docs/design/DESIGN_CONSTRAINTS.md. */
:root {
  --navy: #013D7A;
  --ink: #10263B;
  --slate: #51677E;
  --mist: #E9F0F6;
  --line: #D5E0EB;
  --gold: #EAB234;
  --green: #1E7B4F;
  --red: #B42318;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: Montserrat, var(--sans);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: #fff;
}
@media (max-width: 600px) { body { font-size: 16px; } }

h1, h2, h3 { font-family: var(--display); font-weight: 800; color: var(--navy); text-wrap: balance; margin: 0 0 0.5rem; line-height: 1.15; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; font-weight: 700; }
p { text-wrap: pretty; margin: 0 0 1rem; }
a { color: var(--navy); }
.lede { font-size: 1.05rem; color: var(--slate); max-width: 44rem; }
.small { font-size: 0.9rem; color: var(--slate); max-width: 40rem; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--line);
}
.wordmark { display: inline-flex; align-items: baseline; gap: 0.6rem; text-decoration: none; }
.wordmark .mark { font-family: var(--display); font-weight: 800; font-size: 1.15rem; color: var(--navy); letter-spacing: -0.01em; }
.wordmark .inst { font-weight: 500; color: var(--slate); font-size: 0.9rem; }
.who { display: flex; align-items: center; gap: 1rem; color: var(--slate); font-size: 0.95rem; }
.who form { margin: 0; }

/* Header and body share one left edge: the page gutter. Nothing is centred. */
main { max-width: 64rem; margin: 0; padding: 2rem 1.25rem 4rem; }
main.wide { max-width: none; }
@media (max-width: 600px) { main { padding: 1.5rem 1.25rem 3rem; } }

.card { border: 1px solid var(--line); border-radius: 6px; padding: 1.5rem; background: #fff; }
.card.narrow { max-width: 34rem; margin: 2rem auto; }
@media (max-width: 600px) { .card { padding: 1.25rem; } .card.narrow { margin: 0.5rem auto; } }

/* The sign-in page: a short document, not an auth card. One measure, one rhythm. */
.intro { max-width: 35rem; margin: 4rem 0 0; }
.intro h1 { margin-bottom: 1rem; }
.intro p { margin: 0 0 1.5rem; }
.intro form { margin: 0 0 1rem; }
.intro .small { margin: 0; }
@media (max-width: 600px) { .intro { margin-top: 2.5rem; } }

button, input, select, textarea { font: inherit; color: inherit; }
button.primary {
  background: var(--navy); color: #fff; border: 1px solid var(--navy); border-radius: 6px;
  padding: 0.6rem 1.1rem; font-weight: 600; cursor: pointer;
}
button.primary:hover { background: #022f5e; }
button.link { background: none; border: 0; padding: 0; color: var(--navy); text-decoration: underline; cursor: pointer; }

.notice { padding: 0.75rem 1rem; border: 1px solid var(--line); border-radius: 6px; background: var(--mist); }
.notice.err { border-color: var(--red); color: var(--red); background: #fff; }

.num { font-variant-numeric: tabular-nums; }
th.num, td.num { text-align: right; }

button.secondary {
  background: #fff; color: var(--navy); border: 1px solid var(--line); border-radius: 6px;
  padding: 0.4rem 0.8rem; font-weight: 500; cursor: pointer;
}
button.secondary:hover { background: var(--mist); }
form.inline { display: inline; }

/* Lists: the Stripe invoices table, calm and dense. */
table.list { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: 0.95rem; }
table.list th { text-align: left; font-weight: 500; color: var(--slate); font-size: 0.85rem; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:hover td { background: var(--mist); }
table.list td.act { text-align: right; white-space: nowrap; }
table.list .sub { color: var(--slate); font-size: 0.85rem; margin-top: 0.1rem; }
table.list code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; background: var(--mist); padding: 0.1rem 0.4rem; border-radius: 4px; }
table.list .nowrap { white-space: nowrap; }
table.list .ph { white-space: nowrap; }
table.list td.waiting { min-width: 17rem; }
table.list th:first-child { width: 42%; }
.m-only, .t-only { display: none; }
@media (max-width: 1000px) {
  table.list td.t-hide, table.list th.t-hide { display: none; }
  .t-only { display: inline; }
  table.list th:first-child { width: auto; }
}
@media (max-width: 700px) {
  /* Stacked rows: the first cell is the title, every other cell carries its column name. */
  table.list, table.list thead, table.list tbody, table.list tr, table.list td { display: block; }
  table.list thead { display: none; }
  table.list tr { border-bottom: 1px solid var(--line); padding: 0.75rem 0; }
  table.list tr:hover td { background: none; }
  table.list td { border: 0; padding: 0.15rem 0; }
  table.list td:first-child { padding-bottom: 0.4rem; }
  table.list td[data-label]::before { content: attr(data-label) ": "; color: var(--slate); font-size: 0.85rem; }
  table.list td[data-label] .sub { display: inline; margin-left: 0.25rem; }
  table.list td.act, th.num, td.num { text-align: left; }
  table.list td:empty, table.list td.m-hide { display: none; }
  table.list td.act { padding-top: 0.35rem; }
  table.list td.waiting { min-width: 0; }
  table.list td.waiting .sub { display: inline; margin-left: 0.25rem; white-space: normal; }
  table.list td.waiting .sub::before { content: '· '; }
  .m-only { display: inline; }
}
@media (max-width: 600px) {
  .top { padding: 0.75rem 1.25rem; }
  .wordmark .inst, .who > a { display: none; }
  .who { font-size: 0.9rem; }
}

/* Tabs: plain words with a count, one underlined; the page's actions sit on the same row. */
.tabs { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 1.5rem 0 0; }
.tabs nav { display: flex; gap: 1.5rem; }
.tabs nav a { text-decoration: none; color: var(--slate); padding: 0.4rem 0 0.6rem; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs nav a.on { color: var(--navy); border-bottom-color: var(--navy); }
.tabs nav a .num { margin-left: 0.3rem; }
.tabs form { font-size: 0.9rem; padding-bottom: 0.6rem; }
.tabs + table.list { margin-top: 0; }
.tabs + table.list th { border-top: 0; }

.ok { color: var(--green); font-weight: 500; }
.todo { color: var(--gold); font-weight: 600; }
.warn { color: var(--red); font-weight: 500; }
.muted { color: var(--slate); }

.crumb { font-size: 0.9rem; margin-bottom: 0.5rem; }
dl.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.75rem 2rem; margin: 0 0 1.5rem; padding: 0.75rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
dl.facts div { margin: 0; }
dl.facts dt { font-size: 0.8rem; color: var(--slate); font-weight: 500; }
dl.facts dd { margin: 0; }

table.list .name { display: inline-block; text-wrap: balance; max-width: 34rem; }

/* ---- the review screens ---- */
.summary { max-width: 44rem; margin: 0 0 1rem; }
.summary h2 { font-size: 1rem; margin-bottom: 0.25rem; }
.tabs .actions { display: flex; gap: 0.75rem; align-items: center; padding-bottom: 0.5rem; }
.tabs nav .on { color: var(--navy); border-bottom: 2px solid var(--navy); padding: 0.4rem 0 0.6rem; margin-bottom: -1px; font-weight: 500; }
.tabs nav .muted { padding: 0.4rem 0 0.6rem; }
.navlinks { float: right; display: inline-flex; gap: 1rem; }
.review { display: grid; grid-template-columns: minmax(0, 7fr) minmax(22rem, 5fr); grid-template-areas: "head draft" "paper draft"; gap: 0 2rem; align-items: start; }
.review .paperhead { grid-area: head; }
.review .paper { grid-area: paper; }
.review .draft { grid-area: draft; }
/* In one column: whose paper, then the draft, then the work. */
@media (max-width: 1000px) { .review { grid-template-columns: 1fr; grid-template-areas: "head" "draft" "paper"; } .review .draft { margin-bottom: 2rem; } }
.deduction .quote { color: var(--navy); text-decoration: underline; }
.facts-row { color: var(--slate); margin: 0 0 1rem; }
.dot { color: var(--line); margin: 0 0.15rem; }
.rowhead { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 1.5rem 0 0; }
.rowhead p { margin: 0; padding: 0.4rem 0 0.6rem; font-weight: 500; }
.rowhead .actions { display: flex; gap: 0.75rem; align-items: center; padding-bottom: 0.5rem; }
.rowhead + table.list { margin-top: 0; }
.sheetname { font-weight: 500; margin: 0.5rem 0 0.25rem; }
.paper h1 { font-size: 1.4rem; }
.doc { margin: 1rem 0 2rem; }
.doc h3 { font-size: 1rem; font-weight: 600; color: var(--ink); font-family: var(--sans); margin: 0 0 0.5rem; }
.doc .page, .pdfpage canvas { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.pdfpage { position: relative; margin: 0 0 0.75rem; }
.pdfpage .mark { position: absolute; display: none; border: 2px solid var(--gold); border-radius: 3px; background: rgba(234, 178, 52, 0.18); pointer-events: none; }
.pdfpage .mark.on { display: block; }
.entry { border: 1px solid var(--line); padding: 1rem; border-radius: 6px; max-width: 44rem; }
.sheet { margin: 0 0 1rem; }
.sheet summary { cursor: pointer; font-weight: 500; }
.grid { overflow: auto; max-height: 28rem; border: 1px solid var(--line); margin-top: 0.5rem; }
.grid table { border-collapse: collapse; font-size: 0.95rem; font-variant-numeric: tabular-nums; min-width: 100%; }
.grid th { background: var(--mist); color: var(--slate); font-weight: 500; padding: 0.15rem 0.4rem; border: 1px solid var(--line); position: sticky; top: 0; }
.grid td { padding: 0.25rem 0.6rem; border: 1px solid var(--line); white-space: nowrap; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; vertical-align: top; }
.grid td.b { font-weight: 600; }
.grid td .f { display: block; color: var(--slate); font-family: ui-monospace, Menlo, monospace; font-size: 0.8rem; }
.draft { position: sticky; top: 1rem; }
@media (max-width: 1000px) { .draft { position: static; } }
.draft h2 { font-size: 0.85rem; font-family: var(--sans); font-weight: 600; color: var(--slate); text-transform: uppercase; letter-spacing: 0.04em; margin: 1.25rem 0 0.4rem; }
.scoreline { display: flex; align-items: baseline; gap: 1.5rem; flex-wrap: wrap; }
.scoreline input[type="number"] { width: 5rem; font-size: 1.4rem; font-weight: 600; padding: 0.2rem 0.4rem; border: 1px solid var(--line); border-radius: 6px; color: var(--navy); }
.deductions { padding: 0; margin: 0; list-style: none; }
.deduction { margin: 0 0 0.6rem; cursor: pointer; padding: 0.1rem 0.25rem; border-radius: 4px; }
.deduction:hover { background: var(--mist); }
.deduction .num { color: var(--navy); font-weight: 600; }
.deduction blockquote { margin: 0.2rem 0 0; padding: 0; font-size: 0.9rem; }
.draft textarea { width: 100%; padding: 0.5rem 0.6rem; border: 1px solid var(--line); border-radius: 6px; resize: vertical; field-sizing: content; min-height: 2.6lh; }
.draft form.locked textarea, .draft form.locked input { background: var(--mist); color: var(--slate); }
.hidden { display: none; }
.buttons { margin: 0.75rem 0 0; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.approve { margin: 1.5rem 0 0; padding: 1rem 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem; }
.approve .primary { padding: 0.7rem 1.1rem; text-wrap: balance; max-width: 22rem; }
.approve .small { align-self: flex-start; margin: 0; }
.settled { margin: 1.5rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); }
.saved { margin-left: auto; }
.flags li, .history li { margin: 0 0 0.3rem; font-size: 0.9rem; }
.flags { padding-left: 1.2rem; }
.history { list-style: none; padding: 0; }

.rules { list-style: none; padding: 0; margin: 0 0 1.5rem; max-width: 44rem; }
.rule { border-top: 1px solid var(--line); padding: 0.75rem 0; }
.rule textarea { width: 100%; padding: 0.4rem 0.6rem; border: 1px solid var(--line); border-radius: 6px; }
.rule .sub { color: var(--slate); font-size: 0.85rem; margin-top: 0.25rem; }
.who a { color: var(--slate); text-decoration: none; }

table.list th.student { width: 15rem; }
table.list th.comment { width: 40%; }

.rubric { max-width: 44rem; }
.rubric label { display: block; margin: 0 0 1rem; }
.rubric input[type="text"], .rubric input:not([type]), .rubric textarea { width: 100%; padding: 0.4rem 0.6rem; border: 1px solid var(--line); border-radius: 6px; }
.rubric input.pts, .rubric .rating input.num { width: 5rem; }
.criterion { border: 0; border-top: 1px solid var(--line); padding: 1rem 0 0.5rem; margin: 0; }
.criterion .name { font-weight: 600; margin-bottom: 0.4rem; }
.criterion label { display: inline-block; margin: 0 0 0.5rem; }
.criterion textarea { margin-bottom: 0.5rem; field-sizing: content; min-height: 2.6lh; }
.rating { display: flex; gap: 0.5rem; margin-bottom: 0.35rem; }
.rating input:not(.num) { flex: 1; }
.rubric .approve { flex-direction: row; justify-content: flex-end; }
