@page {
  margin-top: 0;
  margin-bottom: 0;
}

:root {
  --default-max-width: 50em;
  --regular-background: rgb(226, 223, 210);
  --alternate-regular-back: lightblue;
  --regular-text: black;
  --hilite-background: yellow;
  --hilite-text: black;
  --error-background: red;
  --error-text: white;
  --button-background: #7fbb98;
  --button-text: black;
  --button-disabled-back: gray;
  --button-disabled-text: black;
  --button-focused-border: solid 5px orange;
  --input-background: rgb(249, 246, 238);
  --input-text: black;
  --topbar-background: lightblue;
  --topbar-text: black;
  --topline-background: burlywood;
  --topline-text: black;
  --scorex-background: lightblue;
  --scorex-text: black;
  --hover-background: yellow;
  --hover-color: black;

  --selected-flag-border: 16px solid green;
  --widescreen-width: 1200px;
  --popover-background: #f8eeec;
  --popover-text: black;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 14pt;
}

body {
  background-color: var(--regular-background);
}

form {
  display: inline;
  padding: 0;
  margin: 0;
}
fieldset {
  padding: 0;
}

input,
select {
  display: inline-block;
  margin-right: 0.5em;
  padding: 4px;
  border: none;

  background-color: var(--input-background);
  color: var(--input-text);
  border-radius: 12px;

  font-weight: bold;
}

button:not(.icon),
.button {
  background-color: var(--button-background);
  color: var(--button-text);
  border-radius: 10px;
  border: black 2px solid;

  cursor: pointer;

  padding: 0 0.5em 0.2em 0.5em;
}

button:disabled,
.button:disabled {
  background-color: var(--button-disabled-back);
  color: var(--button-disabled-text);
}

button:not([disabled]):not(.icon):hover,
.button:not([disabled]):hover {
  background-color: var(--hover-background);
  color: var(--hover-text);
}

table,
th,
td,
tr {
  border: none;
}

.ruleset {
  max-width: var(--default-max-width);
  margin: auto;
}
.singlerule {
  max-width: var(--default-max-width);
  margin: auto;
  display: grid;
}

.field {
  margin: 1em;
  border: none;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}
.field.help {
  grid-template-columns: 3fr;
  p {
    margin: 0 1em 0.5em 1em;
    font-size: smaller;
    display: inherit;
    font-style: italic;
  }
}

.field label {
  text-align: right;
  padding-right: 1em;
}
.field fieldset {
  border: none;
  display: inline;
  margin: 0;
}
.row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border: none;
  padding: 0.5em;
}
.row.altrow {
  background: var(--alternate-regular-back);
}
.row.combo {
  grid-template-columns: 1fr 2fr 2em 3fr 3fr; /* --widescreen-width */
}
.row.ebc {
  grid-template-columns: 4fr 2fr 2fr 1fr;
}
.row.claims {
  grid-template-columns: 4fr 2fr 2fr 2fr 1fr;
}

.row.rankings {
  grid-template-columns: 4em 4fr 1fr 1fr 1fr;
}
.row:not(.hdr):hover {
  background: var(--hover-background);
  color: var(--hover-text);
  cursor: pointer;
}
.row.rankings:hover {
  cursor: default;
}
.target:hover {
  cursor: pointer;
  background: var(--hover-background);
  color: var(--hover-text);
}
.col {
  border: none;
  display: inline;
  text-align: left;
  margin: 0 0.2em 0 0;
}
.mid {
  text-align: center;
}
.num {
  text-align: right;
  padding: 0 0.2em 0 0;
}
.hdr {
  font-weight: bold;
}
.flexspread input {
  margin: 0 2em;
}
.singlerule input[type="number"] {
  width: 5em;
}

fieldset.inline {
  display: inline;
  border: none;
}
fieldset.filter  {
  padding: 12px 10px 13px 13px;
  border: 1px solid;
  border-radius: 10px;
  margin-bottom: 2px;
}
.bold {
  font-weight: bold;
}

img.flagicon {
  width: 44px;
  padding: 3px;
  cursor: pointer;
}
.bonusnotes {
  display: inline-block;
  min-width: 20em;
}

button.plus,
button.minus {
  width: 3em;
  margin: 0 1em 0 0;
}
.closebutton {
  width: 98%;
  max-width: 20em;
  padding: 5px;
  margin: 1em 1em 0.5em 0;
}
.closebutton:focus {
  border: var(--button-focused-border);
}
.closebutton:hover {
  background: var(--hover-background);
  color: var(--hover-text);
  cursor: pointer;
}
.judgesnotes {
  width: 98%;
  max-width: var(--default-max-width);
  margin-top: 3px;
}

.warn {
  padding: 5px;
  background-color: var(--hilite-background);
  color: var(--hilite-text);
}

#imgdivimg {
  width: 100%;
}
#ebcimgdiv {
  width: 50%;
  float: left;
}

#imgdivs {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto;
}

#imgdivs img {
  width: 100%;
}
.bonusimgdiv {
  width: 50%;
  float: right;
}

.cangrow {
  cursor: zoom-in;
}
.canshrink {
  cursor: zoom-out;
}
.topbar {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  flex-flow: row wrap;
  background-color: var(--topbar-background);
  color: var(--topbar-text);
  border-bottom: solid 2px black;
  margin-bottom: 1em;
  button {
    margin: 3px 0.3em 3px 0.3em;
    font-size: 1.1em;
    padding: 4px 8px 6px 8px;
  }
  span {
    background-color: inherit;
    margin: 0 2em 0 0.3em;
  }
}

.link {
  cursor: pointer;
}
.sort {
  cursor: ns-resize;
}

#about_chasm {
  background-color: lightgray;
  color: black;
  padding: 2px 5px 3px 5px;
  border-color: darkgray;
}

.entrant {
  max-width: var(--default-max-width);
  margin: auto;
  padding: 5px;
  fieldset {
    border: none;
    margin: 0 0 1em 0;
    label {
      margin: 0 0.5em 0 0;
    }
  }
}

.odo {
  width: 5em;
}
.CorrectedMiles {
  width: 5em;
}
.TotalPoints {
  width: 5em;
}
.BikeReg {
  width: 7em;
}
.RiderEmail,
.PillionEmail {
  width: 98%;
  max-width: 20em;
}

article.recalc {
  display: block;
  width: 98%;
  max-width: var(--default-max-width);
  margin: auto;
  p {
    margin: 2em 0 2em 0;
  }
  input {
    padding: 0.5em 1em 0.7em 1em;
    background-color: var(--button-background);
    color: var(--button-text);
    cursor: pointer;
  }
}

article.about {
  display: block;
  width: 98%;
  max-width: var(--default-max-width);
  margin: 1em auto;
  border: solid 2px black;
  background-color: #f5f5f7;
  h1 {
    text-align: center;
    margin: 1em auto 0 auto;
    font-size: 2em;
  }
  .h2 {
    font-size: 0.3em;
    font-style: italic;
    color: blue;
  }
  p {
    text-align: center;
    font-style: italic;
    margin: 1em;
  }
  dl {
    margin-bottom: 1em;
  }
  dl.legal {
    font-size: 0.8em;
  }
  dt {
    margin: 0.6em 0 0.2em 0.5em;
    font-size: inherit;
  }
  dd {
    word-wrap: break-word;
    margin: 0 0 0 2em;
    max-width: calc(100% - 3em);

    font-weight: bold;
    font-size: inherit;
  }
}

article.bonus,
article.combo {
  max-width: var(--default-max-width);
  padding: 2px;
  margin: 0 auto 0 auto;

  fieldset {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    border: none;
    margin: 0 0 1em 0;

    label {
      margin-right: 0.5em;
    }
    input,
    select {
      display: inline-block;
      margin-right: 0.5em;
      padding: 4px;
      border: none;
      background-color: var(--input-background);
      color: var(--input-text);
      border-radius: 12px;
      font-weight: bold;
    }
    .quietcheck {
      display: none;
    }
    .Notes,
    .Waffle {
      width: 98%;
      max-width: 30em;
      padding: 2px;
      background-color: var(--input-background);
      color: var(--input-text);

      font-weight: bold;
    }
    .flag {
      padding: 3px 3px 0 3px;
      margin: 3px 3px 0px 3px;
    }
    .flag img {
      margin: auto;
    }
    .flag.selected {
      border: var(--selected-flag-border);
      border-radius: 6px;
    }
    .BonusList {
      max-width: var(--default-max-width);
      width: 98%;
      text-transform: uppercase;
    }
  }
  #bonuses {
    fieldset {
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
      margin: 0;
    }
    .bid::after {
      content: " =";
    }
    .bname {
      margin: 0 1em 0.5em 0.5em;
      font-style: italic;
    }
  }
}
img.icon {
  width: 36px;
  margin-right: 0.5em;
  cursor: pointer;
}
img.thumbnail {
  width: 222px;
  height: 150px;
  cursor: zoom-in;
}
img.standard {
  width: 600px;
  height: 800px;
}

article.config {
  width: 98%;
  max-width: var(--default-max-width);
  margin: auto;
  button {
    cursor: pointer;
    border: none;
    padding: 0 0.5em 0 0.5em;
    border-radius: 6px;
    background-color: inherit;
  }
  fieldset {
    display: block;
    border: none;
    margin: 0 0 1em 0;
    fieldset {
      margin: 0 0 1em 2em;
    }
  }
  label {
    display: table-cell;
    /*min-width: 10em;*/
    text-align: right;
    margin-right: 1em;
  }
}

.menu {
  display: flex;
  flex-direction: column;
  button {
    width: 98%;
    max-width: 20em;
    margin: 1em auto 0 auto;
    border-radius: 12px;
    padding: 5px;
  }
  button:hover {
    cursor: pointer;
    background: var(--hover-background);
    color: var(--hover-text);
  }
}

.certedit,
.sqlquery,
.rawoptions,
.entrantlist,
.ebclist,
.claimslog,
.rankhead,
.rankings,
.teamnames {
  margin: auto;
  max-width: var(--default-max-width);
}
input.sqlquery {
  width:100%;
}
#rawopts {
  width: 100%;
  height: 40em;
}

.intro,
.intro p {
  margin: 1em;
}
.entrantlist .row {
  margin: 0.2em auto 0.2em auto;
  display: grid;
  grid-template-columns: 1fr 3fr 2fr 3fr 1fr 1fr 1fr 1fr;

  a {
    text-decoration: none;
    color: var(--regular-text);
  }
}
.bonuslist {
  margin: 0.2em auto 0.2em auto;
  display: grid;
  grid-template-columns: 1fr 4fr 1fr 1fr 4fr; /* --widescreen-width */
  grid-template-columns: if(
    media(width > 1200px): 1fr 4fr 1fr 1fr 4fr; else: 1fr 4fr 1fr 1fr
  );
  max-width: var(--default-max-width);
  .cats {
    display: flex;
    display: if(media(width > 1200px): flex; else: none;);
  }
  .cats span {
    margin: 0 1em 0 0;
  }
}
.combos {
  display: flex;
  flex-direction: column;
  max-width: var(--default-max-width);
  margin: auto;
  .BriefDesc {
    font-style: italic;
  }
}

article.timepenalties {
  width: 98%;
  max-width: var(--default-max-width);
  margin: auto;
}

article.timepenalty {
  width: 98%;
  max-width: var(--default-max-width);
  margin: auto;
  fieldset {
    margin: 2em 0 0 0;
    border: none;
  }
  input[type="number"] {
    width: 4em;
  }
}

.error {
  margin: 1em;
  padding: 1em;
  background-color: var(--error-background);
  color: var(--error-text);
  font-weight: bold;
  font-size: 1.2em;
}
.ebclist button,
.claimslog button {
  margin: 1em;
  padding: 5px;
}

h4,
.h4 {
  margin: 0.5em 1em 0.5em 0;
  font-size: 1.5em;
}
.showebc {
  margin: 1em;
}

header {
  position: sticky;
  top: 0;
  background: inherit;
}

.sqlquery {
  p {
    margin: 0 0 .5em 0;
  }
  button {
    margin: .5em 0 .5em 0;
  }
}
.thatsall {
  display: inline-block;
  background-color: var(--hilite-background);
  color: var(--hilite-text);
  font-size: 2em;
  padding: 1em;
  border: 3px solid;
  margin: 1em;
}
.mid {
  text-align: center;
}
.right {
  text-align: right;
}

.bignumber {
  width: 6em;
}

.MinimumTicks {
  width: 3em;
}

.odolist,
.odohdr {
  width: 20em;
  margin: 0 auto 2em auto;
  text-align: center;
  button {
    padding: 0 0.5em 0.2em 0.5em;
    border-radius: 10px;
  }
}
.odorow {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}
.odorow label.name {
  display: inline-block;
  max-width: 20em;
  text-align: left;
  margin-right: 1em;
}
.odorow label.name:hover {
  background-color: var(--hover-background);
  color: var(--hover-text);
}
.oi {
  background-color: yellow;
}

#finetune {
  padding: 0.5em;
  background-color: burlywood;
}
.odo {
  width: 6em;
}

.ClaimTime {
  width: 16em;
}

.EntrantID {
  width: 4em;
}
.evidence {
  font-size: 0.8em;
}

/* Individual claim form */

div.claim {
  display: flex;
  flex-direction: column;
  padding: 0;
  max-width: var(--default-max-width);
  margin: 0 auto;
}

.subject {
  width: 20em;
  max-width: 98vw;
}
.BonusID {
  text-transform: uppercase;
  width: 6em;
}
.ComboID {
  width: 6em;
}
.MaxHours {
  width: 4em;
}
.Points {
  width: 5em;
}
#PointsListArray {
  display: flex;
  flex-direction: column;
  fieldset {
    display: flex;
    flex-direction: row;
    margin: 0;
    span.Points {
      width: 5.5em;
    }
  }
}
.setheads,
.setcats {
  width: 98%;
  max-width: var(--default-max-width);
  margin: auto;
  div {
    text-align: justify;
    margin: 0 0 1em 0;
  }
  fieldset {
    margin: 0 0 0.5em 0;
    border: none;
  }
  label {
    margin: 0 0.5em 0 0;
  }
  .plus {
    margin: 0 0 0.5em 0;
  }
  .minus {
    width: 2em;
  }
}
.RestMinutes {
  width: 3em;
}
.claimfield {
  margin: 1em;
  display: inlin;
  border: none;
  flex-direction: row;
  vertical-align: middle;
}
.claimfield label {
  text-align: right;
  padding-right: 1em;
}

.claimfield input {
  margin-right: 1em;
}

.claimphotos {
  display: flex;
  flex-wrap: wrap;
}
.claimphotos img {
  display: inline-block;

  margin: 3px;
  width: 512px;
  max-width: 100%;
}
.AnswerSupplied {
  margin: 3px;
}
.correctanswer {
  font-style: italic;
}

.topline {
  margin: -1em 0 2em 0;
  font-weight: normal;
  background-color: var(--topline-background);
  padding: 8px 2em 8px 2em;
  display: flex;
  justify-content: space-between;
  fieldset {
    border: none;
    background-color: inherit;
  }
  input[type="button"],
  button {
    padding: 0 0.5em 0.2em 0.5em;
    margin: 3px;
    min-height: 36px;
    border-radius: 6px;
    border: none;
  }
  input[type="button"]:disabled,
  button:disabled {
    padding: 0 0.5em 0 0.5em;
    margin: 3px;
    min-height: 36px;
    background-color: var(--button-back-disabled);
    color: var(--button-disabled-text);
  }
}
.topline.left {
  justify-content: flex-start;
}
.topline span.pushright {
  margin-right: 2em;
}
.scorex {
  margin: auto;
  padding: 1em;
  width: 180mm;
  max-width: 100vw;
  background-color: lightblue;
}

table.sxtable {
  background-color: lightblue;
  margin: 0 auto 0 auto;
  padding: 0 0.5em 0 0.5em;
  caption {
    background-color: lightblue;
    border: solid;
    padding: 0.5em;
    margin: auto auto 0 auto;
  }
  tr {
    height: 1.5em;
  }
  tr:last-of-type td {
    border-top: solid;
  }
  td {
    padding-right: 0.5em;
    vertical-align: top;
  }
}
.sxdescx {
  margin-left: 3px;
  font-style: italic;
  font-size: smaller;
}
td.sxitempoints,
td.sxtotalpoints {
  text-align: right;
}

.resetdb {
  max-width: var(--default-max-width);
  margin: auto;
  h1 {
    text-align: center;
    font-size: 1.2em;
    margin: 1em 0 1em 0;
  }
  p,
  fieldset {
    margin: 0.5em;
  }
  ol {
    list-style-position: inside;
    margin: 0.5em 1em 1em 1em;
  }
  fieldset {
    border: none;
    display: flex;
    flex-wrap: wrap;
  }
  label,
  select {
    margin: 0.5em 0.5em 0.5em 0;
    padding: 5 0.5em 0 0.5em;
  }

  input[type="button"] {
    padding: 0 1em 0 1em;
  }
}

.reviewhdr {
  margin: 0 auto 1em auto;
  display: block;
  max-width: var(--default-max-width);
  button {
    padding: 0 0.5em 0.2em 0.5em;
  }
}
.reviewlist {
  display: flex;
  flex-direction: column;
  max-width: var(--default-max-width);
  margin: auto;
  .row {
    display: grid;
    grid-template-columns: 3em 2fr 1fr 1fr;
    margin-left: 1em;
  }
  .nums {
    display: inline-flex;
    flex-direction: row;
  }
  .nums span {
    text-align: center;
    width: 2em;
  }
  .rejects {
    text-decoration: line-through;

    font-weight: bold;
  }
}
.bigtick {
  font-size: 1.2em;
  font-weight: bold;
  color: blue;
}
.import {
  max-width: var(--default-max-width);
  margin: auto;
  h1 {
    font-size: 2em;
    margin: 1em;
  }
  fieldset {
    border: none;
    margin: 2em;
  }
  hr {
    margin: 1em 0 0.5em 0;
  }
  input[type="submit"] {
    margin: 0 0 0 3em;
    padding: 0.5em;
    width: 20em;
    max-width: calc(90% - 3em);
    cursor: pointer;
  }
  input[type="submit"]:disabled {
    color: darkgray;
    cursor: default;
  }
}

.PenaltyMilesDNF,
.RallyMinMiles {
  width: 6em;
}
.RallyMinPoints,
.RallyQAPoints {
  width: 5em;
}

.RallyPctPenVal {
  width: 3em;
}

.importmap {
  max-width: var(--default-max-width);
  margin: auto;
  .row {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    .dta {
      font-style: italic;
    }
  }
}

.loadlist {
  display: flex;
  flex-direction: column;
  li {
    width: 90%;
    overflow: hidden;
    margin: auto;
    font-size: 0.8em;
  }
}
input.popover {
  display: inline;
  font: inherit;
  background: inherit;
  text-align: inherit;
  cursor: pointer;
}
.popover {
  width: 90%;
  max-width: var(--default-max-width);
  margin: auto;
  padding: 10px;
  height: 90%;
  background: var(--popover-background);
  color: var(--popover-text);
  h1 {
    text-align: center;
  }
  p {
    margin: 0 0 1em 0;
  }
  ol,
  ul {
    margin: 1em;
  }
  li {
    list-style-position: inside;
  }
}

article.teamnames {
  div {
    display: flex;
    flex: row wrap;
    justify-content: flex-start;
    label,
    input,
    button {
      margin: 0.5em;
    }
  }
}
article.teamMembers {
  width: 98%;
  max-width: var(--default-max-width);
  margin: auto;
  fieldset {
    border: none;
    display: flex;
    flex-flow: row wrap;
  }
  * {
    margin: 0.5em;
  }
}

article.classes {
  width: 98%;
  max-width: var(--default-max-width);
  margin: auto;
  div {
    display: grid;
    grid-template-columns: 1.5em 1fr 1fr 1fr 1fr 1fr 1fr;
    grid-template-rows: auto;
    span {
      margin: 0 2px 0 0;
    }
  }
}

article.showclass {
  width: 98%;
  max-width: var(--default-max-width);
  margin: auto;
  input {
    margin: 0 0 0 1em;
  }
  select {
    margin: 0 0 0 1em;
  }
  fieldset {
    border: none;
    margin: 1em;
  }
}
.MinPPM {
  width: 5em;
}
.MinPoints {
  width: 5em;
}
.small {
  width: 4em;
}

article.reportba {
  width:98%;
  max-width: var(--default-max-width);
  margin: auto;
  table {
    margin: 1em;
  }
}

#closebutton.dirty {
    background: var(--hover-background);
  color: var(--hover-text);

}
.hide {
  display: none !important;
}

@media print {
  * {
    background-color: white;
    color: black;
  }
  .noprint {
    display: none;
  }
  .topline {
    display: none;
  }
}
