* {
  box-sizing: border-box;
}
body {
  color: #bbb;
  background: #001;
  font-family: sans-serif;
  min-width: 60em;
}
a {
  color: #99f;
}
a:hover {
  color: #bbf;
  text-shadow: 0 0 5px #bbf;
}
hr {
  margin: 1em 0;
  border: 0;
  border-top: 1px solid #333;
}

header {
  max-width: 50em;
  margin-bottom: 2em;
}
header h1 {
  margin-top: 0;
  margin-bottom: 1em;
}

button {
  background: transparent;
  color: white;
  border: 1px solid #ccd;
  margin: 2px;
  padding: 0px 30px 3px 30px;
  vertical-align: bottom;
  font-size: inherit;
  cursor: pointer;
  font-weight: bold;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}
button:first-child {
  margin-left: 0;
}
button:hover {
  background-color: #224;
}
button:active {
  filter: brightness(0.8);
}
button.danger {
  border-color: #fff;
}
button.danger:hover {
  background-color: #c00;
}
button.danger:active {
  background-color: #900;
}

table {
  border-bottom: 1px solid #333;
  border-right: 1px solid #333;
  border-spacing: 0;
}
table th, table td {
  border-left: 1px solid #333;
  border-top: 1px solid #333;
}
table th {
  background: #113;
}

a.helplink {
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  padding: 0 2px;
  font-size: 70%;
  position: relative;
  top: -0.3em;
}

.banner {
  position: fixed;
  z-index: 10000;
  left: 50vw;
  top: 50vh;
  display: inline-block;
  padding: 1em;
  border: 1px solid #99f;
  background: #112;
  border-radius: 3px;
  transform: translate(-50%, -50%);
}
.banner.error {
  background: #211;
  border-color: #f99;
}

section.bracketgroup {
  position: relative;
  margin: 1em 0 1em 1.3em;
  padding: .5em .5em;
  border-style: none;
  border-left-style: solid;
  border-left-width: 1px;
  min-height: 5em;
  background: rgba(255,255,255,.05);
}
section.bracketgroup::before {
  content: "";
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  height: 0;
  width: 1em;
  border-top: 1px solid transparent;
  border-color: inherit;
}
section.bracketgroup::after {
  content: "";
  display: block;
  position: absolute;
  left: 0;
  bottom: 0;
  height: 0;
  width: 1em;
  border-top: 1px solid transparent;
  border-color: inherit;
}
section.bracketgroup > h1:first-child {
  position: absolute;
  right: 100%;
  bottom: 100%;
  transform-origin: 100% 100%;
  transform: rotate(-90deg);
  margin: 0;
  padding-right: 0;
  padding-bottom: 1px;
  white-space: nowrap;
  font-size: 1em;
  font-weight: normal;
  cursor: default;
}
section.bracketgroup > h1:first-child a { text-decoration-line: none; }
section.bracketgroup > h1:first-child a:hover { text-decoration-line: revert; }
section.bracketgroup > *:nth-child(2) { margin-top: 0; }
section.bracketgroup > *:last-child, section.bracketgroup > *:last-child > *:last-child { margin-bottom: 0; }

.gridform {
  display: grid;
  grid-template-columns: auto 1fr;
}
.gridform-label, .gridform-content {
  margin-bottom: .5em;
}
.gridform-label {
  padding-right: .3em;
  text-align: right;
  padding-top: 6px;
  min-width: 10em;
}

.radiogroup {
  white-space: nowrap;
  padding: 0 2px;
}
.radiogroup:first-child {
  padding-left: 0;
}
.radiogroup:last-child {
  padding-right: 0;
}

.togglebutton input {
  display: none;
}
.togglebutton input ~ span {
  display: inline-block;
  border: 1px solid rgba(255,255,255,.3);
  margin: 2px;
  border-radius: 5px;
  padding: 3px 5px;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}
.togglebutton input:enabled ~ span:hover {
  cursor: pointer;
  background-color: rgba(255,255,255,.2);
}
.togglebutton input:enabled:checked ~ span:hover {
  background-color: #090;
  color: #fff;
}
.togglebutton input:checked ~ span {
  border: 2px solid #cdc;
  margin: 1px;
  background-color: #042;
  color: #cdc;
}
.togglebutton input:disabled ~ span {
  cursor: not-allowed;
  color: #333;
}
.togglebutton input[type="radio"] ~ span {
  border-radius: 0;
  margin: 2px 0 2px 0;
  border-right-style: none;
}
.togglebutton:first-child input[type="radio"] ~ span {
border-radius: 5px 0 0 5px;
}
.togglebutton:last-child input[type="radio"] ~ span {
  border-right-style: solid;
  border-radius: 0 5px 5px 0;
}
.togglebutton input[type="radio"]:checked ~ span {
  border-right-style: solid;
  margin: 1px -2px 1px -1px;
}
.togglebutton:last-child input[type="radio"]:checked ~ span {
  margin-right: -1px;
}

.modal {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background: rgba(32,32,32,.90);
  z-index: 9000;
}
.modal .modal-window {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(100% - 4em);
  height: calc(100% - 4em);
  max-width: 60em;
  background: rgba(0, 0, 0, .8);
  border: 1px solid #444;
  box-shadow: 0 0 20px #000;
  border-radius: 7px;
  color: #cccccc;
  transform: translate(-50%,-50%);
}
.modal .modal-closebtn {
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 20px;
  line-height: 20px;
  color: #ffffff;
  background: #990000;
  text-align: center;
  border-top-right-radius: 7px;
  border-bottom-left-radius: 7px;
  cursor: pointer;
  font-weight: bold;
  user-select: none;
}
@media (pointer: coarse) { .modal .modal-closebtn {
  transform: scale(200%);
  transform-origin: top right;
}}
.modal .modal-closebtn::before {
  content: "\d7";
}
.modal .modal-closebtn:hover {
  background: #ff0000;
}
.modal .modal-content {
  overflow: auto;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.modal-window.narrow {
  max-width: 40em;
}

.help-container {
  margin: 1.5em;
}

.output-grid {
  width: 100%;
  margin-top: 1em;
}
.output-grid th, .output-grid td {
  white-space: nowrap;
}
.output-grid tr:first-of-type th {
  position: sticky;
  top: 0;
  z-index: 1;
}
.output-grid tr th:first-of-type {
  position: sticky;
  left: 0;
  z-index: 1;
}
.output-grid td {
  text-align: center;
  vertical-align: top;
  cursor: pointer;
  height: 6.4em;
}
.output-grid td:hover {
  filter: brightness(1.5);
  background: #112;
}

.output-cell {
  padding-bottom: .3em;
}
.output-cell .price {
  background: #224;
}

.grouped-duplicate .output-cell {
  opacity: .3;
}
.grouped-duplicate:hover .output-cell {
  opacity: .5;
}

.grid-cell-details {
  margin: 1em;
}
.grid-cell-details table th, .grid-cell-details table td {
  padding: 1px 3px;
}
