body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 16px;
}

* {
  transition: .2s all;
  box-sizing: border-box;
}

#root {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  justify-items: center;
  align-items: center;
  padding: 32px;
  min-height: 100dvh;
}


.table {
  display: flex;
  flex-direction: column;
  max-width: 400px;
}

select,
input,
button {
  font: inherit;
  border: 0;
  border-radius: 0;
  background-color: #eeeeee;
  outline: none;
  max-width: auto;
  min-width: 0;
}

select:focus-visible,
input:focus-visible,
button:focus-visible {
  box-shadow: inset 0 0 0 1px #007bff;
}

input.error, .row.error {
  background-color: #f7d6d6;
  --tb-border: #d39c9c;
}

.table input:disabled {
  background-color: #fff;
}

input::placeholder {
  color: #aaa;
}

button:disabled, input:disabled::placeholder {
  color: #ddd;
  background-color: white;
}

button:not(:disabled):hover {
  background: #ddd;
  cursor: pointer;
}

.row,
.headrow {
  display: grid;
  --tb-border: #ccc;
  border-top: 1px solid var(--tb-border);

  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));

  &>* {
    border-left: 1px solid var(--tb-border);
    padding: 8px 12px;
  }

  &>*:last-child {
    border-right: 1px solid var(--tb-border);
  }

  &:last-child {
    border-bottom: 1px solid var(--tb-border);
  }
}

#segmentsTable .row,
#segmentsTable .headrow {
  grid-template-columns: 32px 1fr 1fr 32px;
}

#resultsTable {
  min-width: 200px;
}
#resultsTable .row,
#resultsTable .headrow {
  grid-template-columns: 1fr 1fr;
}
.row .num {
  text-align: right;
}

.headrow {
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  text-align: center;
  font-weight: bold;
  font-size: 14px;
  background-color: #eee;

  & *:first-child {
    border-top-left-radius: 6px;
  }
  & *:last-child {
    border-top-right-radius: 6px;
  }
}

.row button {
  padding: 0;
}

#errorsContainer {
  margin-top: 20px;
  padding: 15px;
  border: 1px solid #c59d9d;
  border-radius: 5px;
  background-color: #f1dddd;
  color: #6d0e0e;
  width: max-content;
}

#errorsContainer.success {
  border: 1px solid #9dc5a4;
  background-color: #ddf1df;
  color: #0e6d1e;
}

*[hidden] {
  display: none!important;
}