#main table.asbTable {
	width: auto;
	margin-left: auto;
	margin-right: auto;
}

#main table tbody tr {
	vertical-align: middle;
	border: 0;
}

/***********************************************************************************/

/* These two bits highlight every other row */
#main table.asbTable tr:nth-child(even) {
	background-color: #f2f2f2;
}
#main table.asbTable tr:nth-child(odd) {
	background-color: #ffffff;
}
/* This excludes th from background highlight */
#main table.asbTable th {
	background-color: #ffffff;
}

/* Row highlighting */
#main table.asbTable tbody tr.asbTrHighlighted {
	background-color: #eeddee;
}

#main table th, #main table td {
	text-align: center;
	padding: 2px 10px 2px 10px;
	background-color: transparent;
}

/* Borders for tables with header at the top */

#main table.asbTable th {
	border-bottom: double 6px #000000;
	border-top: 0px;
}

#main table.asbTable tbody tr td {
	border-top: solid 2px #000000;
}

#main table.asbTable tbody tr:last-child td {
	border-bottom: 0;
	border-top: solid 2px #000000;
}

#main table.asbTable tr td, #main table.asbTable tr th {
	border-left: solid 2px #000000;
	border-right: solid 2px #000000;
}
#main table.asbTable tr td:first-child, #main table.asbTable th:first-child {
	border-left: 0;
}
#main table.asbTable tr td:last-child, #main table.asbTable th:last-child {
	border-right: 0;
}

#main table.tblSplitThree td:nth-child(3) , #main table.tblSplitThree th:nth-child(3) {
	border-right: double 6px #000000;
}

/* Same thing for tables with a header on the left */

#main table.asbTableLeftHeader tr:nth-child(even) {
	background-color: #f2f2f2;
}
#main table.asbTableLeftHeader tr:nth-child(odd) {
	background-color: #ffffff;
}
#main table.asbTableLeftHeader tr:first-child td {
	border-top: 0px;
}

#main table.asbTableLeftHeader tr td {
	border-bottom: solid 2px #000000;
	border-top: solid 2px #000000;
}

#main table.asbTableLeftHeader tr td, #main table.asbTableLeftHeader tr th {
	border-left: solid 2px #000000;
	border-right: solid 2px #000000;
}
#main table.asbTableLeftHeader tr td:first-child, #main table.asbTableLeftHeader th:first-child {
	border-left: 0;
	border-right: double 6px #000000;
}
#main table.asbTableLeftHeader tr td:last-child, #main table.asbTableLeftHeader th:last-child {
	border-right: 0;
}
#main table.asbTableLeftHeader tr:last-child td {
	border-bottom: 0;
}
#main table.asbInchMetricTable tr:nth-child(even) td {
	border-bottom: double 6px #000000;
}
#main table.asbInchMetricTable tr:last-child td {
	border-bottom: 0;
}

/***********************************************************************************/

/* Unit converter page specific stuff */

#main table.asbTable tr td.unitConverterHeader {
	background-color: #ffffff;
	text-align: center;
	white-space: nowrap;
	font-weight: bold;
}

#main table.asbTable tr td.unitConverterSourceCell {
	text-align: right;
	white-space: nowrap;
}

#main table.asbTable tr td.unitConverterResultCell {
	text-align: left;
	white-space: nowrap;
}

/***********************************************************************************/

/* General Calculators: input fields */

#main table.calcInputForm {
	width: auto;
	margin-left: auto;
	margin-right: auto;
}

#main table.calcInputForm tbody tr td {
	white-space: nowrap;
	min-width: fit-content;

	padding-top: 0;
	padding-bottom: 0;

	font-size: 0.9em; /* Size relative to size of an M on the parent I think */
}

#main table.calcInputForm tbody tr td input, #main table.calcInputForm tbody tr td textarea {
	-moz-appearance: auto;
	-webkit-appearance: auto;
	-ms-appearance: auto;
	appearance: auto;
}

#main table.calcDrawingInput tbody tr td input, #main table.calcDrawingInput tbody tr td textarea {
	-moz-appearance: auto;
	-webkit-appearance: auto;
	-ms-appearance: auto;
	appearance: auto;
}


#main table.calcInputForm tbody tr td input[type="radio"], #main table.calcInputForm tbody tr td input[type="checkbox"] {
	vertical-align: middle;
	margin-right: 0.5em;
	float: none;
}

#main table.calcInputForm tbody tr td form {
	margin: 0;
}

#main table.calcInputForm tbody tr td input, #main table.calcInputForm tbody tr td select {
	height: 2em;
}


#main table.calcInputForm tbody tr td button, #main table.calcInputForm tbody tr td input[type="submit"] {
	height: fit-content;
}

#main table.calcInputForm tbody tr td:nth-child(3n+1) {
	text-align: right;
}

#main table.calcInputForm tbody tr td:nth-child(3n+2) {
	text-align: left;
}

#main table.calcInputForm tbody tr td:nth-child(3n+3) {
	text-align: left;
	line-height: 1.2em;
}

#main table.calcInputForm tbody tr td input {
	display: inline;
}

#main table.calcInputForm tbody tr td input[type="text"] {
	width: 100px; /* Can overwrite with a specific class if required */
}


/***********************************************************************************/

/* Calculators that do drawing: input fields */

#main table.calcDrawingInput {
	width: auto;
	margin-left: auto;
	margin-right: auto;
}

#main table.calcDrawingInput tr td:first-child {
	text-align: right;
}

#main table.calcDrawingInput tr td:nth-child(2) {
	text-align: left;
}

#main table.calcDrawingInput tr td:last-child {
	text-align: left;
}

/***********************************************************************************/

/* Gear Calculator */

#main div table.gearCalcInputTable {
	width: auto;
	margin-left: auto;
	margin-right: auto;
}

#main div table.gearCalcInputTable tbody tr td {
	white-space: nowrap;
	min-width: fit-content;
}

#main div table.gearCalcInputTable tbody tr td:nth-child(3) {
	border-right: double 6px #000000;
}

#main div table.gearCalcInputTable tbody tr td.gcLabelCell {
	text-align: right;
}

#main div table.gearCalcInputTable tbody tr td.gcInputCell input:disabled{
	background-color: #f9fafa;
}

#main div table.gearCalcInputTable tbody tr td.gcInputCell {
	text-align: left;
	width: 80px;
}

#main div table.gearCalcInputTable tbody tr td.gcInputCell input[type="text"] {
	width: 80px;
	height: fit-content;
}

#main div table.gearCalcInputTable tbody tr td.gcInputCell input[type="number"] {
	width: 80px;
	height: fit-content;
	border: solid 1px rgba(210, 215, 217, 0.75);
	border-radius: 0.375em;
	padding: 0 1em;
}

#main div table.gearCalcInputTable tbody tr td.gcInputCell button {
	width: 100px;
	padding-top: 0;
	padding-bottom: 0;
	padding-left: 0.5em;
	padding-right: 0.5em;
	text-transform: none;
}

#main div table.gearCalcInputTable tbody tr td.gcUnitCell {
	text-align: left;
	padding-left: 0;
}


/***********************************************************************************/

/* All of the below is legacy stuff, but kept to make sure any old
 * tables still work
 */
#main table th.asbThFirstRowFirstCol {
	border-left: 0px;
	border-right: solid 2px #000000;
	border-top: 0px;
	border-bottom: double 6px #000000;
}

#main table th.asbThFirstRowMidCol {
	border-left: solid 2px #000000;
	border-right: solid 2px #000000;
	border-top: 0px;
	border-bottom: double 6px #000000;
}

#main table th.asbThFirstRowLastCol {
	border-left: solid 2px #000000;
	border-right: 0px;
	border-top: 0px;
	border-bottom: double 6px #000000;
}

#main table td.asbTdMidRowFirstCol {
	border-left: 0px;
	border-right: solid 2px #000000;
	border-top: solid 2px #000000;
	border-bottom: solid 2px #000000;
}

#main table td.asbTdMidRowMidCol {
	border-left: solid 2px #000000;
	border-right: solid 2px #000000;
	border-top: solid 2px #000000;
	border-bottom: solid 2px #000000;
}

#main table td.asbTdMidRowLastCol {
	border-left: solid 2px #000000;
	border-right: 0px;
	border-top: solid 2px #000000;
	border-bottom: solid 2px #000000;
}

#main table td.asbTdLastRowFirstCol {
	border-left: 0px;
	border-right: solid 2px #000000;
	border-top: solid 2px #000000;
	border-bottom: 0px;
}

#main table td.asbTdLastRowMidCol {
	border-left: solid 2px #000000;
	border-right: solid 2px #000000;
	border-top: solid 2px #000000;
	border-bottom: 0px;
}

#main table td.asbTdLastRowLastCol {
	border-left: solid 2px #000000;
	border-right: 0px;
	border-top: solid 2px #000000;
	border-bottom: 0px;
}

#main table th.asbThFirstRowFirstCol.greyedText { color: #AAAAAA; }
#main table th.asbThFirstRowMidCol.greyedText   { color: #AAAAAA; }
#main table th.asbThFirstRowLastCol.greyedText  { color: #AAAAAA; }
#main table td.asbTdMidRowFirstCol.greyedText   { color: #AAAAAA; }
#main table td.asbTdMidRowMidCol.greyedText     { color: #AAAAAA; }
#main table td.asbTdMidRowLastCol.greyedText    { color: #AAAAAA; }
#main table td.asbTdLastRowFirstCol.greyedText  { color: #AAAAAA; }
#main table td.asbTdLastRowMidCol.greyedText    { color: #AAAAAA; }
#main table td.asbTdLastRowLastCol.greyedText   { color: #AAAAAA; }

#main table th.asbThFirstRowFirstCol.greyedBackground { background-color: #DDDDDD; }
#main table th.asbThFirstRowMidCol.greyedBackground   { background-color: #DDDDDD; }
#main table th.asbThFirstRowLastCol.greyedBackground  { background-color: #DDDDDD; }
#main table td.asbTdMidRowFirstCol.greyedBackground   { background-color: #DDDDDD; }
#main table td.asbTdMidRowMidCol.greyedBackground     { background-color: #DDDDDD; }
#main table td.asbTdMidRowLastCol.greyedBackground    { background-color: #DDDDDD; }
#main table td.asbTdLastRowFirstCol.greyedBackground  { background-color: #DDDDDD; }
#main table td.asbTdLastRowMidCol.greyedBackground    { background-color: #DDDDDD; }
#main table td.asbTdLastRowLastCol.greyedBackground   { background-color: #DDDDDD; }

#main table td.asbLeftHeaderTopRow {
	border-top: 0px;
	border-bottom: solid 2px #000000;
}
#main table td.asbLeftHeaderMidRow {
	border-top: solid 2px #000000;
	border-bottom: solid 2px #000000;
}
#main table td.asbLeftHeaderBottomRow {
	border-top: solid 2px #000000;
	border-bottom: 0px;
}
#main table td.asbLeftHeaderHeaderCol {
	border-left: 0px;
	border-right: double 6px #000000;
}
#main table td.asbLeftHeaderMidCol {
	border-left: solid 2px #000000;
	border-right: solid 2px #000000;
}
#main table td.asbLeftHeaderEndCol {
	border-left: solid 2px #000000;
	border-right: 0px;
}
#main table td.asbInchTableInchRow {
	border-top: double 6px #000000;
}
#main table td.asbInchTableMetricRow {
	border-bottom: double 6px #000000;
}

table td {
	padding-top: 0;
	padding-bottom: 0;
}

#main table.tightHeight td {
	padding-top: 0;
	padding-bottom: 0;
}
