/* Shared look for the inside pages (everything except the landing page, which
   carries its own styles). White, highlighter yellow, thick black lines. */
:root { --yellow: #EEFF42; --ink: #000; --paper: #fff; --muted: #555; --good: #8CF58A; --bad: #FF8E85; --waiting: #DEDEDE; }
* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  padding: 28px 16px 80px;
  color: var(--ink);
  font: 20px/1.5 Literata, "Times New Roman", Times, serif;
}
@media (max-width: 620px) { body { font-size: 18px; padding: 20px 16px 60px; } }
.page { max-width: 760px; margin: 0 auto; }
a { color: #00e; }
a:visited { color: #551a8b; }
a:hover { background: var(--yellow); }
:focus-visible { outline: 4px dashed var(--ink); outline-offset: 3px; }
.mono { font-family: "Courier New", Courier, monospace; }
.back { display: inline-block; margin-bottom: 22px; font: bold 16px "Courier New", Courier, monospace; }

h1 {
  display: inline-block;
  margin: 0 0 8px;
  padding: 0 0.25em 0.3em; /* Literata sits low in its line box: descenders need this much below */
  font-size: clamp(38px, 8vw, 68px);
  font-style: italic;
  line-height: 1.05;
  letter-spacing: -0.01em;
  background: var(--yellow);
  border: 5px solid var(--ink);
  box-shadow: 9px 9px 0 var(--ink);
  transform: rotate(-1.5deg);
}
.sub { margin: 18px 0 26px; font: bold 16px/1.5 "Courier New", Courier, monospace; }
h2 { margin: 38px 0 6px; font-size: 27px; line-height: 1.2; }
.box { border: 3px solid var(--ink); background: var(--paper); padding: 14px 16px; margin: 16px 0; }
.note { font-style: italic; color: var(--muted); font-size: 16px; }
.msg { font: bold 16px/1.5 "Courier New", Courier, monospace; min-height: 1.5em; }
.msg.bad { color: #c00000; }

.chip {
  display: inline-block;
  padding: 1px 8px;
  border: 2px solid var(--ink);
  font: bold 14px/1.5 "Courier New", Courier, monospace;
  text-transform: uppercase;
  white-space: nowrap;
}
.chip.yes { background: var(--yellow); color: var(--ink); }
.chip.no { background: var(--ink); color: var(--paper); }
.chip.plain { background: var(--paper); }

button, .button {
  display: inline-block;
  font: bold 22px Literata, "Times New Roman", Times, serif;
  color: var(--ink);
  background: var(--yellow);
  border: 4px solid var(--ink);
  padding: 10px 22px;
  box-shadow: 7px 7px 0 var(--ink);
  cursor: pointer;
  text-decoration: none;
}
button:hover, .button:hover { background: var(--ink); color: var(--yellow); }
button:active, .button:active { transform: translate(7px, 7px); box-shadow: none; }
button:disabled { background: var(--paper); color: var(--ink); cursor: wait; }
button.quiet { font-size: 17px; padding: 6px 14px; background: var(--paper); box-shadow: 4px 4px 0 var(--ink); }

/* ---- the list of candidates ---- */
.pins { list-style: none; margin: 0; padding: 0; }
.pins li { margin: 0 0 16px; }
.pin-row {
  display: flex;
  flex-wrap: wrap; /* only wraps when the window is too narrow for one line */
  justify-content: space-between;
  align-items: center;
  gap: 8px 16px;
  padding: 10px 14px;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}
.pin-row:visited { color: var(--ink); }
.pin-row:hover { background: var(--yellow); transform: rotate(-0.6deg); }
/* settled one way or the other (mathematically or for real): the whole card says so */
.pin-row.good, .pin-row.good:hover, .box.good { background: var(--good); }
.pin-row.bad, .pin-row.bad:hover, .box.bad { background: var(--bad); }
/* you've voted and it's still undecided: nothing for you to do here, so it recedes */
.pin-row.waiting { background: var(--waiting); }
.pin-row.waiting:hover { background: var(--yellow); }
.pin-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; min-width: 0; }
.pin-name { font: bold 26px/1.15 Literata, "Times New Roman", Times, serif; overflow-wrap: break-word; min-width: 0; }
.pin-verdict { font: bold 14px/1.3 "Courier New", Courier, monospace; text-transform: uppercase; white-space: nowrap; }
.pin-state { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }

/* ---- the ballot ---- */
.question { margin: 30px 0; }
.question h2 { margin-top: 0; }
.question p { margin: 4px 0 12px; }
.scale { display: grid; grid-template-columns: repeat(10, 1fr); gap: 0; border: 3px solid var(--ink); max-width: 560px; }
.scale label { position: relative; display: block; text-align: center; border-left: 3px solid var(--ink); cursor: pointer; }
.scale label:first-child { border-left: 0; }
.scale input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.scale span { display: block; padding: 10px 0; font: bold 20px "Courier New", Courier, monospace; }
.scale label:hover span { background: #f6ffa0; }
.scale input:checked + span { background: var(--ink); color: var(--yellow); }
.scale input:focus-visible + span { outline: 4px dashed var(--ink); outline-offset: 3px; }
.ends { display: flex; justify-content: space-between; max-width: 560px; font: 13px "Courier New", Courier, monospace; color: var(--muted); margin-top: 4px; }
textarea {
  display: block;
  width: 100%;
  min-height: 120px;
  padding: 10px;
  font: 17px/1.4 "Courier New", Courier, monospace;
  border: 3px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
}

/* ---- results ---- */
.verdict { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 18px; }
.verdict-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.verdict-label { font: bold 18px/1.3 "Courier New", Courier, monospace; text-transform: uppercase; text-align: right; }
.box.good .note, .box.bad .note { color: var(--ink); }
/* the four questions, two by two */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 36px; }
.grid h2 { margin-top: 26px; font-size: 22px; }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }
.big { font: bold italic 76px/1 Literata, "Times New Roman", Times, serif; letter-spacing: -0.03em; }
.big small { font: bold 18px "Courier New", Courier, monospace; letter-spacing: 0; font-style: normal; }
.hist { margin: 10px 0 0; max-width: 560px; }
.bars { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; align-items: end; height: 120px; border-bottom: 3px solid var(--ink); }
.bar { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.bar i { display: block; width: 100%; background: var(--yellow); border: 3px solid var(--ink); border-bottom: 0; }
.bar b { font: bold 14px "Courier New", Courier, monospace; }
.bar:hover i { background: var(--ink); }
.ticks { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; text-align: center; font: bold 14px "Courier New", Courier, monospace; padding-top: 4px; }
.ticks .you { background: var(--ink); color: var(--yellow); }
.hist-key { font: 13px "Courier New", Courier, monospace; color: var(--muted); margin-top: 6px; }
blockquote { margin: 14px 0; padding: 10px 14px; border: 3px solid var(--ink); border-left-width: 12px; white-space: pre-wrap; overflow-wrap: anywhere; font: 17px/1.45 "Courier New", Courier, monospace; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font: 15px/1.3 "Courier New", Courier, monospace; }
th, td { border: 3px solid var(--ink); padding: 6px 8px; text-align: center; }
th { background: var(--ink); color: var(--paper); font-size: 13px; vertical-align: bottom; }
td:last-child, th:last-child { text-align: left; white-space: nowrap; }
tr.you td { background: var(--yellow); font-weight: bold; }
[hidden] { display: none !important; }

/* ---- running the search: applicants, rounds, forms ----
   Thick borders mean "you can act on this" (buttons, inputs, cards that hold an action).
   Lists are just thin rules, and secondary actions are text buttons, so pages stay calm. */
input[type="text"], select {
  font: 18px/1.3 "Courier New", Courier, monospace;
  padding: 10px 12px;
  border: 3px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  min-width: 0;
}
input[type="text"]:focus, select:focus, textarea:focus { outline: 0; background: #FBFFD0; box-shadow: 4px 4px 0 var(--ink); }
label.field { display: block; margin: 18px 0; font-weight: bold; }
label.field > input, label.field > select, label.field > textarea { display: block; width: 100%; margin-top: 6px; font-weight: normal; }
label.field .hint { display: block; font-weight: normal; font-style: italic; font-size: 16px; color: var(--muted); }
.inline { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.inline input[type="text"] { flex: 1 1 240px; }

.card { border: 3px solid var(--ink); background: var(--paper); padding: 16px 20px 18px; margin: 22px 0; box-shadow: 6px 6px 0 var(--ink); }
.card.main { background: var(--yellow); }
.card h2 { margin: 0 0 4px; font-size: 25px; }
.card p { margin: 6px 0 12px; }
.card .msg { margin: 10px 0 0; }
.card .msg:empty { display: none; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; }
.pair .card { margin: 0 0 22px; display: flex; flex-direction: column; align-items: flex-start; }
.pair .card p { flex: 1; }
@media (max-width: 620px) { .pair { grid-template-columns: 1fr; } }

.list { list-style: none; margin: 8px 0 0; padding: 0; border-bottom: 1.5px solid var(--ink); }
.list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 16px; padding: 10px 2px; border-top: 1.5px solid var(--ink); }
.list .what { min-width: 0; overflow-wrap: anywhere; font-size: 20px; }
.list .meta { display: block; font: 14px/1.4 "Courier New", Courier, monospace; color: var(--muted); }
.list li.gone .what { color: var(--muted); text-decoration: line-through; }
.list li.gone .meta { text-decoration: none; display: inline-block; }
.list .acts { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.list li.empty { font-style: italic; color: var(--muted); }

/* a quiet button: for the second-most-important thing in a row */
button.link, button.link:disabled {
  font: bold 15px/1.2 "Courier New", Courier, monospace;
  padding: 4px 2px;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
button.link:hover { background: var(--yellow); color: var(--ink); }
button.link:active { transform: none; }
button.link:disabled { color: #aaa; cursor: default; text-decoration: none; }

.log { list-style: none; margin: 8px 0; padding: 0; font: 14px/1.5 "Courier New", Courier, monospace; }
.log li { padding: 5px 0; border-top: 1px dotted #999; }
.log time { color: var(--muted); }
details.undo { margin: 0; border-top: 1.5px solid var(--ink); }
details.undo:last-of-type { border-bottom: 1.5px solid var(--ink); }
details.undo > summary { cursor: pointer; padding: 12px 2px; font: bold 20px Literata, "Times New Roman", Times, serif; list-style-position: outside; }
details.undo > summary:hover { background: var(--yellow); }
details.undo > summary span { font: 14px "Courier New", Courier, monospace; color: var(--muted); font-weight: normal; }
details.undo .list { margin: 0 0 14px; }
details.undo .note { margin: 0 0 8px; }

/* ---- the form editor: you edit the ballot itself ---- */
.bare {
  display: block;
  width: 100%;
  padding: 3px 4px;
  border: 0;
  border-bottom: 2px dashed #999;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  resize: none;
  overflow: hidden;
  min-height: 0;
}
.bare:hover { border-bottom-color: var(--ink); }
.bare:focus { outline: 0; border-bottom: 2px solid var(--ink); background: #FBFFD0; box-shadow: none; }
.bare::placeholder { color: #999; font-style: italic; }
input.bare.form-name { font: bold italic 34px/1.15 Literata, "Times New Roman", Times, serif; }
.q { position: relative; border: 3px solid var(--ink); background: var(--paper); padding: 14px 18px 16px; margin: 18px 0; }
.q-head { display: flex; align-items: flex-start; gap: 10px; }
.q-head .bare { font: bold 27px/1.2 Literata, "Times New Roman", Times, serif; }
.q-tools { display: flex; gap: 6px; flex: none; }
.q-tools button { width: 36px; height: 36px; padding: 0; font: bold 18px/1 "Courier New", Courier, monospace; border-width: 2px; background: var(--paper); box-shadow: none; }
.q-tools button:hover { background: var(--ink); color: var(--yellow); }
.q-tools button:disabled { opacity: 0.25; cursor: default; background: var(--paper); color: var(--ink); }
.q textarea.bare { margin: 8px 0 12px; font: 19px/1.45 Literata, "Times New Roman", Times, serif; }
.q .scale { opacity: 0.4; pointer-events: none; }
.q .scale span { padding: 6px 0; font-size: 16px; }
.q input.bare.q-note { margin-top: 10px; font: italic 16px/1.4 Literata, "Times New Roman", Times, serif; color: var(--muted); }
button.dashed { width: 100%; padding: 16px; font-size: 20px; background: var(--paper); border: 3px dashed var(--ink); box-shadow: none; }
button.dashed:hover { background: var(--yellow); color: var(--ink); }
button.dashed:active { transform: none; }
.savebar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin: 34px -16px 0;
  padding: 12px 16px 16px;
  background: var(--paper);
  border-top: 3px solid var(--ink);
}
.savebar .msg { margin: 0; min-height: 0; }

dialog.confirm { max-width: 540px; width: calc(100% - 32px); padding: 20px 24px; border: 5px solid var(--ink); box-shadow: 12px 12px 0 var(--ink); background: var(--paper); color: var(--ink); }
dialog.confirm::backdrop { background: rgba(255, 255, 255, 0.82); }
dialog.confirm h2 { margin: 0 0 10px; }
dialog.confirm p { margin: 8px 0; }
.confirm-buttons { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 18px !important; }
