html {
  height: 100%;
  font: 16px/24px sans-serif;
}

body {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  background: #41980a;
  height: 100%;
}

body * {
  box-sizing: border-box;
}

.print-only {
  display: none;
}

#download-link {
  height: 0;
  opacity: 0;
}

.form {
  flex: 1 1 40%;
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  height: 100%;
}

h1 {
  font-size: 2rem;
  line-height: 1em;
  margin: 0;
}

h2 {
  text-transform: capitalize;
  line-height: 1em;
}

h2 .index {
  margin-right: 7px;
  color: #aaa;
  font-size: 1.5rem;
}

h3 {
  margin: 0 0 1rem;
}

p {
  margin: 0 0 1rem;
}

.main-header {
  margin-bottom: 2rem;

  h2 {
    color: #888;
  }
}

.directions {
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 2rem;
  box-shadow: 0 0 10px #0002;
}

.question {
  margin-bottom: 3rem;
}

.question .index {
  margin-right: 7px;
  color: #aaa;
  font-weight: 800;
  font-size: 1.5rem;
}

.result-component {
  display: flex;
  margin-top: 10px;
}

.result-component .radio {
  text-align: center;
  background: #eee;
  padding: 10px;
}

.result-component .radio:hover {
  background: #ddd;
}

.result-component .radio .label {
  display: block;
  text-align: center;
}

.result-component .radio .sub-label {
  color: #aaa;
  font-size: 0.8rem;
  line-height: 1.5;
}

.score {
  flex: 1 0 320px;
  background: #000;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.score h2 {
  margin: 0 0 20px;
}

.scroll-panel {
  flex: 1;
  padding: 0 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 2px solid #000;
}

.score-table th,
.score-table td {
  border: 1px solid #ddd;
  text-align: right;
  vertical-align: top;
  width: 20%;
}

.score-table th {
  padding: 10px;
}

.score-table td {
  padding: 5px 10px;
}

.score-table th.item-number,
.score-table td.item-number,
.score-table .total-row td:first-child {
  text-align: left;
}

.score-table td.item-number {
  text-align: left;
  cursor: pointer;
  color: #666;
}

.score-table td.item-number:hover {
  background: #eee;
  color: #000;
}

.score-table td.blank {
  background: #ddd;
}

.score-table tr.total-row td {
  background: #666;
  border-left-color: #888;
  border-right-color: #888;
  border-top-color: #666;
  border-bottom-color: #666;
  color: #fff;
  font-weight: 800;
  text-transform: capitalize;
  padding: 10px;
  vertical-align: top;
}

.score-table tr.total-row td:last-child {
  border-right-color: #666;
}

.controls {
  padding: 20px 20px 0;
  background: #000;
  text-align: right;
}

.btn {
  border: none;
  padding: 10px 15px;
  border-radius: 3px;
  background: #41980a;
  font-size: 1rem;
  cursor: pointer;
  color: #fff;
}

.btn:hover {
  background: #138510;
}

@media print {
  html {
    font: 13px/18px sans-serif;
  }

  .print-only {
    display: block;
  }

  h2, h3 {
    margin: 0;
    line-height: 0;
  }

  .form,
  .controls {
    display: none;
  }

  .score,
  .scroll-panel {
    padding: 0;
  }

  .score-table {
    border: none;
  }

  .score-table tr.total-row td {
    background: #fff;
    border-color: #ddd;
    padding-bottom: 1.3rem;
    color: #000;
    border-bottom: 1px solid #ddd;
    border-left-color: #fff;
    border-right-color: #fff;
  }

  .score-table tr.total-row td:last-child {
    border-right-color: #fff;
  }

  .score-table tr:last-child td {
    border-bottom-color: #fff;
  }
}

@page {
  size: A4;
}

@media (max-width: 720px) {
  body {
    display: block;
  }

  .form {
    padding: 15px;
  }

  .score {
    padding: 5px 0 20px;
    font-size: 0.75rem;
  }

  .scroll-panel {
    padding: 0 5px;
  }

  .score-table {
    border-width: 1;
  }

  .form,
  .score {
    height: auto;
  }
}