.failure {
  color: var(--color-failure);
  margin-top: 0.5em;
  font-size: 0.85rem;
}

body {
  padding: 1rem;
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  justify-content: space-between;
}

header {
  svg {
    width: 64px;
    height: 64px;
    color: rgb(19 126 212);
  }
}

code {
  padding: 1em;
  display: block;
  margin: 0.5em 0;
  border: var(--border);
  white-space: break-spaces;
  border-radius: var(--border-radius);
}

@supports (interpolate-size: allow-keywords) {
  ::details-content {
    height: 0;
    overflow: clip;
    transition: height 150ms ease, content-visibility 150ms ease allow-discrete;
  }

  :root {
    interpolate-size: allow-keywords;
  }

  [open]::details-content {
    height: auto;
    overflow: visible;
  }
}

.row {
  column-gap: 1rem;
}

.add-row {
  display: flex;
  column-gap: 0.5rem;
  align-items: center;
}

.column {
  row-gap: 1rem;
}

footer {
  text-align: right;
}

table[data-display="bordered"] {
  border: 0.5px solid var(--grey-300);

  thead {
    border-bottom: 0.5px solid var(--grey-300);
  }

  tfoot {
    border-top: 0.5px solid var(--grey-300);
  }

  td,
  th {
    padding: 0.5em 1.5em 0.5em 0.5em;
  }

  thead {
    background: linear-gradient(to bottom, var(--grey-500), var(--grey-400));
  }

  tr:nth-child(even) {
    background-color: var(--grey-500);
  }

  td a + a {
    margin-left: 1rem;
  }

  tbody tr {
    &:hover {
      background-color: var(--grey-400);
    }
  }
}

table[data-display="sheet"] {
  width: 100%;
  border-collapse: collapse;

  th {
    text-align: center;
    border: var(--border);
    padding: var(--input-padding);
    background-color: var(--grey-500);
  }

  td {
    padding: 0;
    width: 100px;
    vertical-align: top;
    border: var(--border);
  }

  tfoot td {
    padding: var(--input-padding);
  }

  input,
  select,
  textarea {
    border: none;
    border-radius: 0px;
    background-color: unset;
  }

  select {
    min-width: unset;
  }
}

table[data-display="calculation"] {
  margin: 20pt 0;
  line-height: inherit;

  th,
  td {
    vertical-align: baseline;
    padding: 0.3em 0.45em 0.3em 0.5em;
  }

  .result:not(:empty) {
    border-top: var(--border);
  }

  th {
    border-bottom: var(--border);
  }

  .result {
    font-weight: bold;
  }

  th:nth-child(2),
  td:nth-child(2) {
    width: 100%;
  }

  th:first-child,
  td:first-child {
    text-align: center;
  }

  th:last-child,
  td:last-child {
    text-align: right;
    white-space: nowrap;
  }
}
