/* The look of the application.
 *
 * The palette is dark and quiet: the ink, the paper, and one colour for
 * every kind of case — a case that fits, a case that is blocked, and a case
 * that waits for a person. The page is read for a long time, and the
 * colours of the cases are the only ones that speak.
 *
 * The styles are a file of the repository, and there is no build: the page
 * is rendered on the server and the browser is given this file.
 */

:root {
  --ink: #e7ebf0;
  --paper: #12151b;
  --card: #191e26;
  --quiet: #141920;
  --line: #2a313c;
  --muted: #8e97a5;
  --fits: #63b98c;
  --blocked: #d17872;
  --review: #d3a559;
  --accent: #7ea2e0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0 1.5rem 0.75rem;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* **A page of the application is a screen of the application,** and not a
   sheet in the middle of it: the rule that held the page to sixty-eight
   rems is gone, and what is left of it is the padding of the page. The
   measure of the text that is read is on the paragraph and not on the
   page. */
main {
  width: 100%;
  max-width: none;
}

/* The bar of the steps of a teacher */

.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.7rem;
  align-items: center;
  margin: 0 auto;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

.steps .brand {
  margin-right: 0.5rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.step {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.step:hover {
  color: var(--ink);
}

.step .number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.step.here {
  color: var(--ink);
}

.step.here .number {
  background: var(--accent);
  border-color: var(--accent);
  color: #10141a;
}

/* The steps behind the one of the page are done, and the ones ahead of it
   are not. */

.step.done {
  color: var(--ink);
}

.step.done .number {
  background: var(--quiet);
}

/* The way on: the step before the one of the page, and the step after it. */

.the-way {
  margin-left: 0.3rem;
  padding: 0.12rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.76rem;
  color: var(--muted);
  text-decoration: none;
}

.the-way:hover {
  color: var(--ink);
  border-color: var(--muted);
}

.the-way.next {
  margin-left: auto;
}

/* The words of the page */

header {
  padding: 2rem 0 0.5rem;
}

h1 {
  margin: 0 0 0.25rem;
  font-size: 1.9rem;
  letter-spacing: -0.02em;
}

h2 {
  margin: 2.25rem 0 0.5rem;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

/* **The text that is read keeps a measure of its own.** A line of two
   hundred characters is not read, and the measure is on the paragraph and
   not on the page. */
p {
  max-width: 44rem;
}

.lead {
  margin: 0;
  max-width: 48rem;
  color: var(--muted);
}

.note {
  margin: 0 0 0.9rem;
  max-width: 46rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.source {
  color: var(--ink);
}

.empty {
  color: var(--muted);
  font-style: italic;
}

/* The funnel of the cases */

.funnel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin: 0.5rem 0;
}

.stage {
  display: grid;
  gap: 0.3rem;
  padding: 0.65rem 0.85rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.6rem;
}

.stage .label {
  color: var(--muted);
  font-size: 0.85rem;
}

.stage .number {
  font-size: 1.5rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.stage .track {
  display: block;
  height: 0.5rem;
  background: var(--quiet);
  border-radius: 999px;
  overflow: hidden;
}

.stage .bar {
  display: block;
  height: 100%;
  min-width: 2px;
  background: var(--muted);
  border-radius: 999px;
  transition: width 0.6s ease;
}

.stage.fits .bar {
  background: var(--fits);
}

.stage.fits .number {
  color: var(--fits);
}

.stage.blocked .bar {
  background: var(--blocked);
}

.stage.blocked .number {
  color: var(--blocked);
}

.stage.review .bar {
  background: var(--review);
}

.stage.review .number {
  color: var(--review);
}

/* The numbers of the term */

.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
  margin: 1.25rem 0 0.5rem;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 1rem 1.1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.7rem;
}

.tile .number {
  font-size: 2rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.tile .label {
  color: var(--muted);
  font-size: 0.9rem;
}

/* The page of the term: one screen */

.the-head {
  padding: 1rem 0 0.35rem;
}

.the-head h1 {
  font-size: 1.5rem;
}

.the-head .lead {
  max-width: 68rem;
  font-size: 0.95rem;
}

.the-term {
  display: grid;
  gap: 0.15rem;
}

.the-term h2 {
  margin: 0.3rem 0 0.05rem;
  font-size: 0.94rem;
}

.the-term .the-title {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  margin-top: 0.35rem;
}

.the-term .the-title h2 {
  margin: 0;
  white-space: nowrap;
}

.the-term .the-title .note {
  flex: 1;
  margin: 0;
}

.the-term .note {
  margin: 0 0 0.3rem;
  font-size: 0.86rem;
}

.the-term .tiles {
  margin: 0.3rem 0 0;
}

.the-term .tile .number {
  font-size: 1.6rem;
}

.the-term .stage .number {
  font-size: 1.3rem;
}

.the-term table th,
.the-term table td {
  padding: 0.3rem 0.7rem;
}

/* The parts of the term that are folded */

.the-term details {
  margin-top: 0.35rem;
  padding-top: 0.2rem;
  border-top: 1px solid var(--line);
}

.the-term summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.95rem;
}

.the-term summary:hover {
  color: var(--ink);
}

/* The actions of the inspector */

.the-top {
  display: grid;
  gap: 0.9rem;
  margin: 1.25rem 0 0.5rem;
}

.the-actions {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.4rem;
  align-items: start;
  padding: 0.9rem 1.1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.7rem;
}

.the-actions h2 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
}

.the-actions .note {
  margin: 0 0 0.6rem;
  font-size: 0.88rem;
}

.the-actions form {
  display: grid;
  grid-template-columns: max-content max-content;
  gap: 0.45rem 0.9rem;
  align-items: center;
}

.the-actions label {
  color: var(--muted);
  font-size: 0.88rem;
}

.the-actions input {
  font: inherit;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--quiet);
  color: var(--ink);
}

.the-actions button {
  grid-column: 1 / -1;
  justify-self: start;
}

/* The cases of the term: the button of the model and the numbers of them */

.the-actions.of-the-cases {
  grid-template-columns: minmax(0, 1fr) 2fr;
}

/* The form of a new run on the home of the school */

.the-actions.of-the-run {
  grid-template-columns: max-content;
}

/* The run of the cases: what it does, and what it has done */

.the-run .the-state {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.the-buttons {
  display: flex;
  gap: 0.6rem;
  margin: 0 0 0.5rem;
}

/* The numbers of the term of the school: six of them in a row */

.tiles.six {
  grid-template-columns: repeat(6, 1fr);
}

/* The pages of the inspector: the term, the generator, the week and the cases */

.the-inspector section {
  margin: 0.6rem 0 1rem;
}

.the-inspector h2 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.the-inspector .note {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
}

/* The chooser of the student of the week */

.the-chooser {
  display: grid;
  grid-template-columns: max-content max-content;
  gap: 0.45rem 0.9rem;
  align-items: center;
  margin: 0 0 0.7rem;
}

.the-chooser label {
  color: var(--muted);
  font-size: 0.88rem;
}

.the-chooser input {
  font: inherit;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--quiet);
  color: var(--ink);
}

.the-chooser button {
  grid-column: 1 / -1;
  justify-self: start;
}

/* The charts of the measurement */

.charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 0.9rem;
  margin: 1.25rem 0 0.5rem;
}

.charts figure {
  margin: 0;
}

svg.chart {
  display: block;
  width: 100%;
  height: auto;
}

/* The tables */

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  overflow: hidden;
  font-size: 0.95rem;
}

/* **A table that is wider than the page scrolls and does not break it,**
   and the forms of the pages are laid out in two columns: the name of the
   thing and the thing itself. */

.scroller {
  overflow-x: auto;
}

.scroller table {
  min-width: 58rem;
}

.rules {
  display: grid;
  grid-template-columns: max-content max-content;
  gap: 0.55rem 0.9rem;
  align-items: center;
  margin: 0 0 1.1rem;
}

.rules label {
  color: var(--muted);
}

.rules input,
.rules select {
  font: inherit;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--card);
  color: var(--ink);
}

.rules .buttons {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

th,
td {
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  background: var(--quiet);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

tbody tr:last-child td {
  border-bottom: none;
}

td.empty {
  color: var(--muted);
  font-style: italic;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86rem;
  color: var(--muted);
}

.verdict {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}

.verdict.fits {
  color: var(--fits);
  background: #1c2c26;
}

.verdict.review {
  color: var(--review);
  background: #2e2818;
}

.verdict.blocked {
  color: var(--blocked);
  background: #2e1e1e;
}

/* The week of a student */

.week {
  margin: 1.25rem 0 0.5rem;
}

.week .grid {
  display: grid;
  grid-template-columns: 3.6rem repeat(var(--days), 1fr);
  grid-template-rows: auto repeat(var(--rows), 1.5rem);
  gap: 2px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  overflow: hidden;
}

.week .corner {
  grid-column: 1;
  grid-row: 1;
  background: var(--quiet);
}

.week .day {
  grid-row: 1;
  padding: 0.45rem 0.6rem;
  background: var(--quiet);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.week .hour {
  grid-column: 1;
  padding-right: 0.5rem;
  background: var(--quiet);
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.week .meeting {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  padding: 0.25rem 0.45rem;
  background: var(--card);
  border-left: 3px solid var(--line);
  border-radius: 0.35rem;
  overflow: hidden;
}

.week .meeting .course {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
}

.week .meeting .clock {
  color: var(--muted);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.week .meeting .room {
  color: var(--muted);
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The courses that do not fit: they are the cases of the student, and they
 * are written in red. The calendar of the student is drawn in one place,
 * and the styles of it are here with the styles of the week. */

.week .meeting.does-not-fit {
  background: #3a1f1f;
  border-left-color: var(--blocked);
  box-shadow: inset 0 0 0 1px var(--blocked);
}

.week .meeting.does-not-fit .course,
.week .meeting .the-case {
  color: var(--blocked);
}

.week .meeting .the-case {
  font-weight: 600;
  text-decoration: none;
}

.week .meeting .the-case:hover {
  text-decoration: underline;
}

/* The dialog of the calendar of a student: the dialog is the same one on
 * every page of the application, and the calendar in it is drawn in one
 * place.
 *
 * **The dialog of the calendar is wide:** most of the screen, centred, and
 * the week of the student in it is the whole of the dialog. */

.the-dialog {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgb(8 10 14 / 78%);
}

.the-dialog .the-card {
  position: relative;
  width: 100%;
  max-height: calc(100vh - 2.5rem);
  overflow-y: auto;
  padding: 1.5rem 1.8rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
}

.the-dialog .the-close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  padding: 0.3rem 0.7rem;
  background: var(--quiet);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.the-dialog .the-close:hover {
  color: var(--ink);
}

.the-dialog .the-calendar h2 {
  margin-top: 0;
}

.the-dialog .the-cases {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

.the-dialog .the-cases li {
  margin-bottom: 0.3rem;
}

/* The case */

.verdict-card {
  padding: 0.9rem 1.1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
  border-radius: 0.7rem;
}

.verdict-card.fits {
  border-left-color: var(--fits);
}

.verdict-card.blocked {
  border-left-color: var(--blocked);
}

.verdict-card.review {
  border-left-color: var(--review);
}

.verdict-card .numbers {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.facts {
  display: grid;
  gap: 0.7rem;
  margin: 1.25rem 0 0.5rem;
}

.fact {
  padding: 0.9rem 1.1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
  border-radius: 0.7rem;
}

.fact.block {
  border-left-color: var(--blocked);
}

.fact.residual {
  border-left-color: var(--review);
}

.fact .code {
  margin: 0 0 0.25rem;
}

.fact .detail {
  margin: 0 0 0.4rem;
}

.fact .numbers {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.fact .numbers .number {
  display: inline-block;
  margin-right: 0.9rem;
}

.fact .numbers strong {
  color: var(--ink);
  font-weight: 550;
}

.answer {
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.7rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.7rem;
}

.answer .question {
  margin: 0 0 0.4rem;
  font-weight: 550;
}

.answer .numbers {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.answer .meter {
  display: block;
  height: 0.35rem;
  min-width: 2px;
  background: var(--accent);
  border-radius: 999px;
}

.actions {
  display: flex;
  gap: 0.6rem;
}

button {
  font: inherit;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--accent);
  border-radius: 0.5rem;
  background: var(--accent);
  color: #10141a;
  cursor: pointer;
}

button.refuse {
  background: var(--card);
  color: var(--blocked);
  border-color: var(--blocked);
}

a {
  color: var(--accent);
}

.given {
  color: var(--fits);
  font-weight: 550;
}

/* The page of a case: the calendar of the student and the course of the case.

   The week of the student is the page, and the card of the course of the
   case stands beside it. The answer of a person is inside the card of the
   course, and nothing else on the page has buttons. */

.of-the-case {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 23rem;
  gap: 1.5rem;
  align-items: start;
  margin-top: 1.25rem;
}

.of-the-case h2 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.of-the-case .the-week {
  min-width: 0;
}

.the-card-of-the-course {
  padding: 1rem 1.1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0.7rem;
}

.the-card-of-the-course .the-course {
  margin: 0 0 0.2rem;
  font-weight: 600;
}

.the-card-of-the-course .the-sentence {
  margin: 0 0 0.7rem;
  font-weight: 550;
}

.the-card-of-the-course .the-facts {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
}

.the-card-of-the-course .the-facts li {
  margin-bottom: 0.45rem;
  font-size: 0.92rem;
}

.the-card-of-the-course .given {
  margin: 0 0 0.7rem;
  font-size: 0.92rem;
}

.the-card-of-the-course .actions {
  flex-wrap: wrap;
}

.the-card-of-the-course .the-next {
  margin: 0.9rem 0 0;
  font-size: 0.92rem;
}

/* The course of the case in the calendar of the student: it is highlighted,
   and it is the one the person is asked about. */

.week .meeting.the-case {
  background: #1d2a3d;
  border-left-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  z-index: 2;
}

.week .meeting.the-case .course {
  color: var(--accent);
}

@media (max-width: 62rem) {
  .of-the-case {
    grid-template-columns: minmax(0, 1fr);
  }
}
