/* The scripts page. The folders page's sheet, so the three contest tools sit
   beside each other (#33), plus the controls this page has and that one does
   not: the directory search box and the segmented switches. */
:root {
  --ink: #1C208B;
  --accent: #FCC200;
  --body: #1b1b20;
  --muted: #6b6b76;
  --rule: #e4e4ea;
  --panel: #f7f7fa;
  --warn: #8a5a00;
}
* { box-sizing: border-box }

body {
  margin: 0;
  background: #fff;
  color: var(--body);
  font: 15px/1.55 Montserrat, system-ui, -apple-system, sans-serif;
}

header {
  background: var(--ink);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}
header h1 { margin: 0; font-size: 17px; font-weight: 500; letter-spacing: .04em }
header a { color: var(--accent); font-size: 13px; text-decoration: none }
header a:hover { text-decoration: underline }

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 16px 64px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: start;
}
@media (max-width: 900px) { main { grid-template-columns: 1fr } }

section + section { margin-top: 34px }
h2 {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 4px;
}
.hint { color: var(--muted); font-size: 13px; margin: 0 0 14px }

/* rows of fields: labels above, controls on one baseline, a steady 12px gutter */
.row { display: flex; gap: 14px 18px; flex-wrap: wrap; align-items: flex-start }
.row + .row { margin-top: 14px }
.field { display: block }
.field-label, label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px }
.field .hint { display: block; margin: 4px 0 0; font-size: 11.5px }
input, select {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: #fff;
  color: inherit;
  height: 38px;
}
input::placeholder { color: #a3a3ad }
input[type=number] { width: 74px }
input[type=checkbox] { width: auto; height: auto; padding: 0; margin: 0 8px 0 0; vertical-align: middle }
input:focus-visible, select:focus-visible, button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; height: 38px }
.seg button {
  font: inherit; font-size: 13.5px; padding: 0 13px; border: 0; background: #fff; cursor: pointer; color: var(--body);
}
.seg button + button { border-left: 1px solid var(--rule) }
.seg button[aria-pressed=true] { background: var(--ink); color: #fff }
.seg button[disabled] { color: var(--muted); cursor: default }

.combo { position: relative; min-width: 300px }
.combo input { width: 100% }
.combo ul {
  position: absolute; z-index: 5; left: 0; right: 0; top: 38px; margin: 3px 0 0; padding: 4px 0; list-style: none;
  background: #fff; border: 1px solid var(--rule); border-radius: 6px; max-height: 240px; overflow: auto;
  box-shadow: 0 6px 20px rgba(0,0,0,.08); font-size: 13.5px;
}
.combo li { padding: 6px 10px; cursor: pointer }
.combo li:hover { background: var(--panel) }
/* The match the arrow keys are on. A left bar as well as a fill, so it is not
   colour alone that says which one Enter would take. */
.combo li.is-active { background: var(--panel); box-shadow: inset 3px 0 0 var(--ink) }
.combo li small { color: var(--muted); margin-left: 6px; font-size: 12px }
.combo li.none { color: var(--muted); cursor: default }
.resolved { font-size: 11.5px; color: var(--muted); margin-top: 4px; max-width: 320px }

.override { display: flex; gap: 4px; align-items: center }
.revert { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 15px; padding: 4px }
.revert:hover { color: var(--ink) }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px }
.chip {
  font: inherit; font-size: 14px; border: 1px solid var(--rule); border-radius: 999px; padding: 7px 14px;
  cursor: pointer; background: #fff; color: inherit; display: flex; align-items: center; gap: 9px;
}
.chip:hover { border-color: var(--ink) }
/* The running order is filled in; the row of contests to add from is not. It
   used to key off aria-pressed, which stopped meaning anything once a contest
   could be picked twice — the bottom row adds, the top row removes, and neither
   is a toggle (#83). */
.chips--picked .chip { border-color: var(--ink); background: var(--ink); color: #fff }
.chips--picked .chip:hover { background: #151a6e }
.chip .pos {
  background: var(--accent); color: var(--ink); border-radius: 999px; width: 19px; height: 19px;
  display: grid; place-items: center; font-size: 11px;
}
.muted-chips .chip { color: var(--muted) }

table { width: 100%; border-collapse: collapse; margin-top: 10px }
th {
  text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  font-weight: 400; padding: 6px 8px; border-bottom: 1px solid var(--rule);
}
td { padding: 8px; border-bottom: 1px solid var(--rule); vertical-align: top }
td.n, th.n { text-align: right; white-space: nowrap }
td:first-child { padding-top: 15px }
.warn { color: var(--warn); font-size: 12px; margin-top: 4px; text-align: left; white-space: normal; max-width: 180px }
.warn:empty { display: none }
.scope { color: var(--muted); font-size: 12px }
.tag {
  display: inline-block; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; padding: 2px 7px;
  border-radius: 999px; background: var(--panel); color: var(--muted); margin-left: 6px; vertical-align: middle;
}
.tag.online { background: var(--ink); color: #fff }
.tag.ours { background: var(--accent); color: var(--ink) }
.check { font-size: 13.5px; color: var(--body); display: flex; align-items: center; margin: 8px 0 }
.check + .row, .row + .check { margin-top: 12px }

aside {
  position: sticky; top: 24px; background: var(--panel); border-radius: 10px; padding: 20px;
}
aside h3 { margin: 0 0 2px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink) }
.total { font-size: 30px; margin: 10px 0 0; line-height: 1.2 }
.total small { font-size: 13px; color: var(--muted); display: block; margin-top: 2px }
.stack { margin: 16px 0 0; padding: 0; list-style: none; font-size: 13px }
.stack li { padding: 6px 0; border-bottom: 1px solid var(--rule) }
.stack li .file { color: var(--muted); font-size: 11.5px; word-break: break-word }
aside .check { margin-top: 14px }
button.go {
  margin-top: 12px; width: 100%; background: var(--ink); color: #fff; border: 0; border-radius: 8px; padding: 13px;
  font: inherit; cursor: pointer;
}
button.go:hover { background: #151a6e }
button.go[disabled] { background: var(--muted); cursor: default }
.progress { font-size: 12px; color: var(--muted); margin: 8px 0 0 }
.note { font-size: 12px; color: var(--muted); margin-top: 14px; line-height: 1.5 }

footer {
  border-top: 1px solid var(--rule); padding: 22px 16px 40px; max-width: 1180px; margin: 0 auto;
  color: var(--muted); font-size: 12.5px;
}
footer p { margin: 0 0 6px }
footer a { color: var(--ink) }
