/* Thaqib (ثاقب): one small stylesheet, no external fonts or scripts (CSP: default-src 'self'). */
:root {
  --ink: #1d2327;
  --muted: #5b6770;
  --line: #d5dbe0;
  --paper: #ffffff;
  --wash: #f4f6f8;
  --accent: #0b5f7a;
  --above: #fff4d6;
  --above-line: #c98a00;
  --above-bar: #946200;  /* darker than --above-line: about 3.75:1 against the score bar's track */
  --error: #9b1c1c;
  --error-wash: #fdecec;
  --mark: #d9eef5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  background: var(--paper);
  min-height: 100vh;
}

/* Header of the public pages (not the admin pages). main's min-height leaves room for it. */
.site-header {
  max-width: 72rem; margin: 0 auto; min-height: 3.5rem; padding: .5rem 1rem;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem 1.5rem;
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.site-header .brand { font-weight: 700; font-size: 1.1rem; color: var(--ink); text-decoration: none; }
.site-header nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.site-header nav a[aria-current="page"] { color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: .25em; }
.site-header ~ main { min-height: calc(100vh - 3.5rem); }
.skip { position: absolute; left: -999rem; }
.skip:focus { position: static; display: block; padding: .5rem 1rem; background: var(--paper); }

h1 { font-size: 1.6rem; margin: 0 0 .5rem; }
h2 { font-size: 1.2rem; margin: 2rem 0 .5rem; }
h3 { font-size: 1rem; margin: 0 0 .4rem; }
a { color: var(--accent); }
code { font-size: .9em; background: var(--wash); padding: 0 .2em; }

.tagline { margin: -.4rem 0 .8rem; color: var(--muted); font-size: 1.1rem; }
.lead { margin-top: 0; max-width: 48rem; }
.version { max-width: 72rem; margin: 0 auto; padding: .6rem 1rem 1.5rem; background: var(--paper);
            border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.meta { color: var(--muted); font-size: .95rem; }

.notice {
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--wash);
  padding: .6rem .8rem;
  margin: 1rem 0;
}
.notice.error { border-color: var(--error); background: var(--error-wash); }

form.check { margin: 1.25rem 0; }
form.check .row, form.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; }
form.filters { margin: 1rem 0 .3rem; }
.field { display: flex; flex-direction: column; flex: 0 1 12rem; }
.field.grow { flex: 1 1 18rem; }
.field label { font-weight: 600; margin-bottom: .3rem; }
.optional { font-weight: normal; color: var(--muted); }

input[type=text], input[type=password], input[type=date], input[type=number], input[type=time], select {
  font: inherit;
  padding: .5rem .6rem;
  border: 1px solid var(--line);
  border-radius: 4px;
}
input:focus, select:focus, button:focus, a.button:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button, a.button {
  font: inherit;
  padding: .5rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
button.secondary, a.button.secondary { background: var(--paper); color: var(--accent); }
a.button { display: inline-block; text-decoration: none; }

table { border-collapse: collapse; width: 100%; margin: .5rem 0 1rem; font-size: .95rem; }
th, td { text-align: left; vertical-align: top; padding: .4rem .5rem; border-bottom: 1px solid var(--line); }
thead th { background: var(--wash); }
td.num { text-align: right; white-space: nowrap; }

table.results tr.above td { background: var(--above); }
table.results tr.cutline td {
  border-top: 3px solid var(--above-line);
  border-bottom: 3px solid var(--above-line);
  font-weight: 600;
  background: var(--paper);
}
/* Decorative score bar (the number is the information): grey, amber at or above the cut-off. */
meter.score-bar { appearance: none; -webkit-appearance: none; display: block; width: 5rem; height: .5rem; margin: .2rem 0 0 auto;
                  border: 0; border-radius: .25rem; background: var(--line); }
meter.score-bar::-webkit-meter-bar { background: var(--line); border: 0; border-radius: .25rem; height: .5rem; }
meter.score-bar::-webkit-meter-optimum-value,
meter.score-bar::-webkit-meter-suboptimum-value,
meter.score-bar::-webkit-meter-even-less-good-value { background: var(--muted); border-radius: .25rem; }
meter.score-bar::-moz-meter-bar { background: var(--muted); border-radius: .25rem; }
tr.above meter.score-bar::-webkit-meter-optimum-value,
tr.above meter.score-bar::-webkit-meter-suboptimum-value,
tr.above meter.score-bar::-webkit-meter-even-less-good-value { background: var(--above-bar); }
tr.above meter.score-bar::-moz-meter-bar { background: var(--above-bar); }
@media (forced-colors: active) { meter.score-bar { display: none; } }
.parts, .sub { display: block; color: var(--muted); font-size: .8rem; font-weight: normal; }
.parts { white-space: pre-line; }  /* one score part a line, though the cell is nowrap */
.tag {
  display: inline-block;
  font-size: .75rem;
  padding: 0 .4rem;
  border: 1px solid var(--error);
  color: var(--error);
  border-radius: 3px;
  margin-left: .3rem;
}
.tag.registered { border-color: var(--line); color: var(--muted); }
.tag.under_study, .tag.same { border-color: var(--accent); color: var(--accent); }
.tag.same { background: var(--wash); }
.tag.hint { border-style: dashed; border-color: var(--muted); color: var(--ink); }
.tag.combo { border-color: var(--accent); color: var(--accent); cursor: help; }
.labels { display: block; }
/* Hover or keyboard-focus tooltip; the text stays in the page for screen readers (clipped like .vh). */
.tip { position: relative; }
.tip:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.tiptext {
  position: absolute; left: 0; top: calc(100% + .3rem); z-index: 2;
  width: max-content; max-width: min(22rem, 80vw); white-space: normal;
  padding: .35rem .55rem; border-radius: 4px; background: var(--ink); color: var(--paper);
  font-size: .8rem; line-height: 1.4; clip-path: inset(50%);
}
.tip:hover .tiptext, .tip:focus .tiptext { clip-path: none; }
mark { background: var(--mark); color: var(--ink); border-bottom: 2px solid var(--accent); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.labels .tag:first-child { margin-left: 0; }
.group + .group { margin-top: .4rem; }
ul.regs { margin: .2rem 0 0; padding-left: 1.1rem; font-size: .85rem; }
ul.regs li.more { list-style: none; color: var(--muted); }

.about ul { padding-left: 1.2rem; max-width: 52rem; }

table.history td { font-size: .9rem; }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.topbar-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; }
.card { border: 1px solid var(--line); border-radius: 6px; padding: .9rem; }
.card p { font-size: .9rem; margin: 0 0 .6rem; }
.card input[type=file] { display: block; margin-bottom: .6rem; max-width: 100%; }
.buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
section.list { border-top: 2px solid var(--line); margin-top: 2rem; }
section.list h3 { margin-top: 1.2rem; }
details summary { cursor: pointer; margin: 1rem 0 .5rem; color: var(--accent); }
label.check { display: block; margin-bottom: .6rem; font-size: .9rem; }
.card .field { margin-bottom: .6rem; }
form.stack { display: flex; flex-direction: column; gap: .5rem; max-width: 22rem; }

tr.status-fail td { color: var(--error); font-weight: 600; }
pre.log {
  background: var(--wash);
  border: 1px solid var(--line);
  padding: .75rem;
  max-height: 32rem;
  overflow: auto;
  font-size: .85rem;
  white-space: pre-wrap;
}

@media (max-width: 40rem) {
  table.results th:nth-child(4), table.results td:nth-child(4) { display: none; }
}
