*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: Helvetica, Arial, sans-serif;
  line-height: 1.4;
  color: #222;
}

/* Constrain everything (text, table, textarea) to one column width. */
main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1rem;
}

/* Admin results need more room, and read better centered. */
body.wide main {
  max-width: 70rem;
  text-align: center;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.3rem;
  text-align: center;
}

th {
  font-size: 0.9rem;
}

textarea {
  width: 100%;
  font: inherit;
  padding: 0.5rem;
}

.none-btn {
  margin: 0.75rem 0;
  padding: 0.4rem 0.7rem;
  font: inherit;
  color: #555;
  background: transparent;
  border: 1px solid #bbb;
  border-radius: 5px;
  cursor: pointer;
}

.none-btn:hover {
  color: #222;
  border-color: #666;
}

/* "saved" acknowledgement — always occupies space (no layout jump), fades in. */
.saved {
  margin-top: 1rem;
  color: #2e7d32;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.saved.show {
  opacity: 1;
}

.error {
  color: #c0392b;
}

/* --- Voter page: the yes/maybe/no matrix --- */

#votetable {
  table-layout: fixed;
}

#votetable td button {
  width: 100%;
  padding: 0.5rem 0;
  font: inherit;
  color: #222;
  background: transparent;
  border: 1px solid #bbb;
  border-radius: 4px;
  cursor: pointer;
}

#votetable td button:hover {
  border-color: #666;
}

#votetable td button.active {
  color: #fff;
  background: #333;
  border-color: #333;
}

/* --- Admin results table --- */

/* Results table sizes to its content and keeps each row on one line; if it's
   wider than the screen the whole page scrolls sideways. */
.results {
  width: auto;
  margin: 0 auto;
}

.results th,
.results td {
  border-bottom: 1px solid #eee;
  white-space: nowrap;
}

.results td:first-child,
.results td:last-child,
.results th:first-child,
.results th:last-child {
  text-align: left;
}

.results tbody tr:nth-child(even) {
  background: #f7f7f7;
}

.results tfoot td {
  font-weight: bold;
  border-top: 2px solid #ccc;
}

/* Comment: one truncated line by default; click to expand. Long unbroken
   strings wrap instead of blowing out the table. */
.comment-text {
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.comment-text.expanded {
  max-width: 30rem;
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
}

.iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.35rem;
  padding: 0;
  vertical-align: middle;
  color: #aaa;
  background: transparent;
  border: none;
  cursor: pointer;
}

.iconbtn:hover {
  color: #333;
}

/* brief acknowledgement that the link was copied */
.copy.copied {
  color: #2e9e2e;
}

.name-input {
  font: inherit;
  padding: 0.15rem 0.3rem;
}

.add {
  margin-top: 0.75rem;
  padding: 0.3rem 0.7rem;
  font: inherit;
  color: #555;
  background: transparent;
  border: 1px dashed #bbb;
  border-radius: 5px;
  cursor: pointer;
}

.add:hover {
  color: #222;
  border-color: #666;
}
