:root {
  --aaep-bg: #f7f6f2;
  --aaep-surface: #ffffff;
  --aaep-text: #171717;
  --aaep-muted: #6d6b65;
  --aaep-border: #dedbd3;
  --aaep-accent: #b35335;
  --aaep-accent-hover: #93442c;
  --aaep-accent-soft: #f6eee9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: var(--aaep-bg);
  color: var(--aaep-text);
  font-family: Arial, Helvetica, sans-serif;
}

#wrapper {
  max-width: none;
  margin: 0;
  padding: 0;
  background: var(--aaep-bg);
  border: 0;
}

#content {
  width: min(100% - 40px, 980px);
  margin: 0 auto;
  padding: 2.75rem 0 4rem;
}

.panel {
  display: none;
}

/* Header */

#banner.edge.booth-header {
  display: block;
  width: 100%;
  padding: 0;
  background: var(--aaep-surface);
  border-bottom: 1px solid var(--aaep-border);
  font-size: 1rem;
}

.booth-header-inner {
  width: min(100% - 40px, 1200px);
  min-height: 82px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.booth-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.booth-logo {
  display: block;
  width: auto;
  max-width: 260px;
  max-height: 52px;
}

.booth-title {
  color: var(--aaep-muted);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.booth-exit,
.booth-exit:visited {
  color: var(--aaep-text);
  font-size: .92rem;
  font-weight: 700;
  text-decoration: none;
}

.booth-exit:hover,
.booth-exit:focus {
  color: var(--aaep-accent);
  text-decoration: none;
}

/* Election heading */

#header {
  padding: 0 0 2.25rem;
  text-align: left;
}

#header h1 {
  max-width: 850px;
  margin: 0;
  padding: 0;
  color: var(--aaep-text);
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.04em;
}

/* Progress */

#progress_div {
  max-width: none;
  margin: 0 0 2.5rem;
  font-size: .85rem;
}

#progress_div table {
  width: 100%;
  border: 0;
  border-collapse: collapse;
  background: transparent;
}

#progress_div td,
#progress_div td.unselected,
#progress_div td.selected {
  width: 33.333%;
  padding: .75rem .5rem;
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--aaep-border);
  color: var(--aaep-muted);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

#progress_div td.selected {
  border-bottom-color: var(--aaep-accent);
  color: var(--aaep-text);
}

/* Intro */

.booth-intro {
  max-width: 760px;
  margin: 0 auto;
}

.booth-lead {
  margin: 0 0 1.5rem;
  font-size: 1.15rem;
  line-height: 1.6;
}

.booth-steps {
  margin: 0 0 2.25rem;
  padding-left: 1.4rem;
}

.booth-steps li {
  margin: .8rem 0;
  padding-left: .3rem;
  line-height: 1.5;
}

.booth-help {
  margin-top: 2rem;
  text-align: center;
  font-size: .9rem;
}

/* Buttons */

button,
.booth-primary-button,
.booth-secondary-button {
  min-height: 46px;
  margin: 0;
  padding: .8rem 1.5rem;
  border-radius: 2px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

button,
.booth-primary-button {
  background: var(--aaep-accent);
  border: 1px solid var(--aaep-accent);
  color: #fff;
}

button:hover,
button:focus,
.booth-primary-button:hover,
.booth-primary-button:focus {
  background: var(--aaep-accent-hover);
  border-color: var(--aaep-accent-hover);
  color: #fff;
}

.booth-secondary-button {
  background: transparent;
  border: 1px solid var(--aaep-border);
  color: var(--aaep-text);
}

.booth-secondary-button:hover,
.booth-secondary-button:focus {
  background: var(--aaep-surface);
  border-color: var(--aaep-text);
  color: var(--aaep-text);
}

.booth-primary-action {
  margin: 2rem 0;
  text-align: center;
}

.booth-primary-action .booth-primary-button {
  min-width: 260px;
}

/* Questions */

#question_div {
  max-width: 820px;
  margin: 0 auto;
}

.question-heading {
  margin: 0 0 1.6rem;
}

.question-text {
  display: block;
  white-space: pre-line;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.25;
}

.question-meta {
  display: block;
  margin-top: .65rem;
  color: var(--aaep-muted);
  font-size: .86rem;
  line-height: 1.4;
}

.ballot-option {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  margin: .7rem 0;
  padding: 1rem 1.1rem;
  background: var(--aaep-surface);
  border: 1px solid var(--aaep-border);
  border-radius: 3px;
  transition: border-color .15s ease, background .15s ease;
}

.ballot-option:hover {
  border-color: #aaa69e;
}

.ballot-option.selected {
  background: var(--aaep-accent-soft);
  border-color: var(--aaep-accent);
}

.ballot-option input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin: .15rem 0 0;
  accent-color: var(--aaep-accent);
}

.ballot-option label.answer {
  flex: 1 1 auto;
  margin: 0;
  color: var(--aaep-text);
  font-size: 1rem;
  line-height: 1.45;
  cursor: pointer;
}

.answer-more-info {
  font-size: .82rem;
}

.question-warning {
  min-height: 46px;
  padding: .8rem 0;
  color: var(--aaep-muted);
  text-align: center;
  font-size: .85rem;
}

.question-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.question-actions-primary {
  display: flex;
  gap: .75rem;
  margin-left: auto;
}

/* Review */

#seal_div,
#audit_div {
  max-width: 820px;
  margin: 0 auto;
}

.review-title {
  margin: 0 0 1.5rem;
  font-size: 1.8rem;
}

.ballot-review {
  margin-bottom: 1.5rem;
  padding: 1.4rem;
  background: var(--aaep-surface);
  border: 1px solid var(--aaep-border);
  line-height: 1.55;
}

.ballot-tracker {
  margin: 1.5rem 0;
  padding: 1rem 1.2rem;
  background: #efeee9;
  border-left: 3px solid var(--aaep-accent);
}

.ballot-tracker-label {
  display: block;
  margin-bottom: .5rem;
  color: var(--aaep-muted);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.ballot-tracker tt {
  display: block;
  overflow-wrap: anywhere;
  color: var(--aaep-text);
  font-size: .95rem;
  line-height: 1.5;
}

.booth-audit-option {
  max-width: 600px;
  margin: 2.5rem 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--aaep-border);
  color: var(--aaep-muted);
  font-size: .9rem;
}

.booth-audit-option h4 {
  margin: 0;
  padding: 0;
  font-size: .92rem;
}

.booth-audit-option h4 span {
  color: var(--aaep-muted);
  font-size: .82rem;
  font-weight: 400;
}

#audit_trail {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--aaep-border);
}

/* Loading and processing */

#election_div > h3,
#processing_div h3,
#encrypting_div h3 {
  margin: 2rem 0;
  color: var(--aaep-text);
  text-align: center;
  font-size: 1.35rem;
}

#loading_div img,
#proceed_loading_img {
  vertical-align: middle;
}

/* Footer / election fingerprint */

#footer.edge {
  display: block;
  width: 100%;
  padding: 0;
  background: #171717;
  color: #aaa;
  font-size: .78rem;
}

.booth-fingerprint {
  width: min(100% - 40px, 1200px);
  margin: 0 auto;
  padding: 1.25rem 0;
  text-align: center;
  line-height: 1.5;
}

#election_hash {
  color: #ddd;
  font-family: monospace;
  font-weight: 400;
  overflow-wrap: anywhere;
}

a,
a:visited {
  color: var(--aaep-accent);
}

a:hover,
a:focus {
  color: var(--aaep-accent-hover);
}

@media screen and (max-width: 640px) {
  #content {
    width: min(100% - 28px, 980px);
    padding-top: 2rem;
  }

  .booth-header-inner {
    width: calc(100% - 28px);
    min-height: 68px;
  }

  .booth-logo {
    max-width: 185px;
    max-height: 42px;
  }

  .booth-title {
    display: none;
  }

  #header {
    padding-bottom: 1.5rem;
  }

  #header h1 {
    font-size: 2.2rem;
  }

  #progress_div td,
  #progress_div td.unselected,
  #progress_div td.selected {
    font-size: .68rem;
    letter-spacing: .02em;
  }

  .question-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .question-actions-primary,
  .question-actions-secondary {
    width: 100%;
  }

  .question-actions-primary {
    flex-direction: column;
  }

  .question-actions button,
  .booth-primary-action .booth-primary-button {
    width: 100%;
  }

  .ballot-option {
    padding: .9rem;
  }
}
