* {
  box-sizing: border-box;
}

table {
  background: white;
}

#Inputs {
  margin-right: 1em;
  clear: both;
}

#Grades {
  background: #f2eddb;
}

#Options {
  background: #ddd;
  padding: 0.3em;
  border-top: 1px solid #aaa;
}

#Options #Options * {
  font-size: 90%;
}

input[type="number"] {
  width: 4em;
}

#Output {
  text-align: center;
  display: none;
  margin-left: 1em;
  width: 100%;
}

#Output tr > :nth-child(4n + 1) {
  border-left: 2px solid black !important;
}

#N, #P, #K, #S, .area {
  width: 4em;
  text-align: right;
}

input:focus, select:focus {
  background: yellow;
}

input, select {
  background: lightyellow;
}

th {
  background: #def;
  vertical-align: bottom;
}

input:focus {
  background: yellow;
}

#Main h2 {
  font-size: 110%;
  margin-bottom: 0;
}

label:hover {
  color: red;
  cursor: pointer;
}

.hidden {
  display: none;
}

.surplus {
  font-weight: bold;
  color: blue;
}

.deficit {
  font-weight: bold;
  color: red;
}

.exact {
  font-weight: bold;
  color: green;
}

#Main caption {
  background: #47a;
  color: white;
  font-weight: bold;
  padding: 0.5em;
  caption-side: top;
  text-align: center;
}

/* 
#Output tr:nth-child(3n + 3) td {
  border-top: 1px solid black;
}
*/

#Output td {
  min-width: 5em;
}

#Main td[colspan] {
  text-align: left;
  border-top: 2px solid #333;
  background: #eee;
}

body .S {
  position: fixed;
  top: -10em;
}

body.S .S {
  position: static
}

option.S {
  display: none;
}

body.S option.S {
  display: inline;
}

th.cost {
  display: none;
}

body.cost th.cost {
  display: table-cell;
}

#Main {
  font: 13px arial;
  max-width: 1250px;
  margin: auto;
  padding: 0.5em;
  background: #f8f8f8;
  border: 1px solid #aaa;
  box-shadow: 5px 5px 15px 5px #000000;
}

.farm {
  display: none;
}

.farm td:nth-child(1) {
  width: 50%;
}

#Main h2 {
  background: #369;
  color: white;
  font-size: 15px;
  font-weight: bold;
  padding: 0.3em;
  text-align: center;
}

#Main h2 span {
  color: silver;
}

#Abstract {
  float: right;
  width: 23em;
  background: white;
  border: 1px solid black;
}

#Abstract p {
  padding: 0 0.5em;
}

#Instructions {
  background: #f8f8f8;
  padding: 0.5em;
}

#Instructions li {
  margin-bottom: 1em;
}

.heading {
  text-align: center;
}

#Main th {
  text-align: center;
}

#All {
  background: #eee;
}

nav {
  margin: 0 !important;
}

#fluid2 {
  margin: 0 !important;
}

section {
  width: 100%;
  margin-bottom: 2em;
  border: 1px solid #333;
}

.lawn td {
  vertical-align: top;

  label {
    white-space: nowrap;
  }
}

#CalcArea, #Scoring, #Help {
  position: fixed;
  display: none;
  top: calc(50% - 12em);
  bottom: calc(50% - 12em);
  left: calc(50% - 25em);
  right: calc(50% - 25em);
  background: #fefdfc;
  padding: 1em;
  border: 1px solid #eee;
  box-shadow: 5px 5px 15px 5px #333;
  border-radius: 10px;
  z-index: 1000;
}

#CalcArea table {
  height: 16em;
  width: 80%;
  margin-left: 10%;
}

#CalcArea table td:nth-child(3) {
  text-align: center;
}

#CalcArea nav {
  text-align: center;
}

#CalcArea button {
  width: 8em;
}

#CalcArea table {
  display: none;
}

#CalcArea #SRectangle {
  display: table;
}

.selected {
  background: #cfc;
}

#Overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  background: silver;
  opacity: 0.5;
  display: none;
}

.center {
  text-align: center;
}

section table {
  width: 100%;
}

section p, section table {
  margin-left: 1em;
}

#OtherGrades {
  width: 20em !important;
}

#OtherGrades td {
  text-align: center;
  height: 1.8em;
}

#Layout {
  width: 100%;
  margin-top: 3em;
}

#Layout table {
  width: calc(100% - 2em);
}

#Layout > tbody > tr > td:nth-child(1) {
  width: 45%;
}

#Layout > tbody > tr > td:nth-child(2) {
  background: #eee;
}

#Layout {
  border: none;
}

#Layout > tbody > tr > td {
  padding: 0;
  border: none;
}

#Layout tr {
  vertical-align: top;
}

#Grades label {
  margin: 0 1em;
}

.RArea td:nth-child(n + 1):not(:last-child) {
  text-align: center;
}

.RArea {
  background-color: #eee;
}

.gray {
  color: gray;
}

.indent {
  margin-left: 2em;
}

#Rec {
  width: 3em;
}

#RecGrade {
  width: 6em;
}

.reported2 {
  display: none;
}

.reported2 .example {
  margin-top: 1em;
  background: #333;
  color: #eee;
  padding: 0.5em;
}

.reported2 table {
  width: 20em !important;
  margin: 1em auto;
}

#Given {
  background: #eee;
  padding: 0.5em;
  border-bottom: 1px solid #666;
  margin-bottom: 1em;
}

#Inputs {
  background: #eee;
  padding-bottom: 1em;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type=number] {
  -moz-appearance: textfield;
}

.scoring, .help {
  text-decoration: underline;
  cursor: pointer;
  color: blue;
}

#Scoring, #Help {
  font: 13px verdana;
}

#Help {
  top: 20vh;
  height: 60vh;
  overflow: auto;
  padding: 0;
}

#Help p {
  padding: 0 1em;
}

#Help nav, #Scoring nav {
  position: sticky;
  top: 0;
  background-color: #333;
  padding: 0.5em;
}

.addown {
  text-decoration: underline;
  color: blue;
  cursor: pointer;
}

[contenteditable]:focus {
  background-color: yellow;
}

#Main table {
  border-collapse: separate;
}

p.output {
  font-size: 120%;
  margin-top: 1em;
}

div.output {
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow: auto;
}

#Output tr:nth-child(1) th {
  position: sticky;
  top: 0;
}

#Output tr:nth-child(2) th {
  position: sticky;
  top: 2.5em;
}

#RecBasis {
  display: none;
}