:root {
  background-color: var(--am-background-color);
  color: var(--am-text-primary);
  font-family: var(--am-font-family);
  font-weight: var(--am-font-weight-regular);
  letter-spacing: .00938em;
  box-sizing: border-box;
  font-size: 1rem;
  line-height: 1.5;
}

html, body {
  width: 100%;
  height: 100%;
}

*, :before, :after {
  box-sizing: inherit;
}

.caption {
  color: var(--am-caption-color);
  letter-spacing: .03333em;
  font-size: .75rem;
  line-height: 1.375rem;
}

h1 {
  font-weight: var(--am-font-weight-light);
  letter-spacing: -.01562em;
  margin: 0 0 .35em;
  font-size: 6rem;
  line-height: 1.167;
}

h2 {
  font-weight: var(--am-font-weight-light);
  letter-spacing: -.00833em;
  margin: 0 0 .35em;
  font-size: 3.75rem;
  line-height: 1.2;
}

h3 {
  font-weight: var(--am-font-weight-regular);
  letter-spacing: 0;
  margin: 0 0 .35em;
  font-size: 3rem;
  line-height: 1.167;
}

h4 {
  font-weight: var(--am-font-weight-regular);
  letter-spacing: .00735em;
  margin: 0 0 .35em;
  font-size: 2.125rem;
  line-height: 1.235;
}

h5 {
  font-weight: var(--am-font-weight-regular);
  letter-spacing: 0;
  margin: 0 0 .35em;
  font-size: 1.5rem;
  line-height: 1.1334;
}

h6 {
  font-weight: var(--am-font-weight-medium);
  letter-spacing: .0075em;
  margin: 0 0 .35em;
  font-size: 1.25rem;
  line-height: 1.6;
}

p {
  margin: 0 0 .35em;
}

.subtitle1 {
  font-weight: var(--am-font-weight-regular);
  letter-spacing: .00938em;
  font-size: 1rem;
  line-height: 1.75;
}

.subtitle2 {
  font-weight: var(--am-font-weight-medium);
  letter-spacing: .00714em;
  font-size: .875rem;
  line-height: 1.57;
}

.body1 {
  font-weight: var(--am-font-weight-regular);
  letter-spacing: .00938em;
  font-size: 1rem;
  line-height: 1.5;
}

.body2 {
  font-weight: var(--am-font-weight-regular);
  letter-spacing: .01071em;
  font-size: .875rem;
  line-height: 1.43;
}

.button {
  font-weight: var(--am-font-weight-medium);
  letter-spacing: .02857em;
  text-transform: uppercase;
  font-size: .875rem;
  line-height: 1.75;
}

.overline {
  font-weight: var(--am-font-weight-regular);
  letter-spacing: .08333em;
  text-transform: uppercase;
  font-size: .75rem;
  line-height: 2.66;
}

.form-error {
  color: var(--am-error-main);
}

.form-error > p {
  white-space: pre-wrap;
}

.form-action {
  justify-content: space-between;
  display: flex;
}

.form-action > * {
  flex-grow: 1;
}

.disabled {
  color: var(--am-action-disabled);
}

strong, b {
  font-weight: var(--am-font-weight-bold);
}

hr {
  border-style: solid;
  border-width: 0 0 thin;
  border-color: var(--am-divider-color);
  width: 100%;
  margin: 0;
}

a, .link {
  color: var(--am-primary-main);
  text-decoration: underline;
}

hgroup {
  margin: 0 0 .35em;
}

hgroup > * {
  margin: 0;
}

hgroup > p {
  color: var(--am-caption-color);
}

.svg-icon {
  background-color: currentColor;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: block;
  -webkit-mask-size: contain;
  mask-size: contain;
}

article, dialog {
  background-color: var(--am-paper-background-color);
  border-radius: var(--am-border-radius);
  box-shadow: var(--am-shadow);
  flex-direction: column;
  gap: 8px;
  min-width: 275px;
  padding: 16px;
  display: flex;
}

article.no-pad {
  padding: 0;
}

article.center {
  align-items: center;
}

article > .actions, dialog > .actions {
  flex-direction: row;
  justify-content: space-around;
  gap: 8px;
  margin-top: 8px;
  display: flex;
}

main {
  flex-direction: column;
  flex-grow: 1;
  align-items: safe center;
  gap: 8px;
  padding: 16px;
  display: flex;
  position: relative;
  overflow: auto;
}

main > * {
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 900px) {
  main {
    padding-left: 0;
    padding-right: 0;
  }
}

form.form {
  flex-direction: column;
  gap: 16px;
  display: flex;
}

table {
  letter-spacing: .01071em;
  border-spacing: 0;
  border-collapse: collapse;
  width: 100%;
  font-size: .875rem;
  line-height: 1.5rem;
  font-weight: var(--am-font-weight-regular);
  text-align: left;
  margin-top: 16px;
}

th {
  font-weight: var(--am-font-weight-medium);
  white-space: nowrap;
}

td, th {
  border-bottom: 1px solid var(--am-divider-color);
  padding: 2px 8px;
}

td.number {
  text-align: right;
}

tbody tr:hover {
  background-color: var(--am-action-hover);
}

input[type="number"] {
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

[data-loading] {
  display: none;
}

.tooltip {
  z-index: 10;
  color: var(--am-text-primary);
  background-color: var(--am-paper-background-color);
  white-space: pre-wrap;
  border: 1px solid #888;
  border-radius: 2px;
  width: -webkit-fit-content;
  width: fit-content;
  padding: 8px;
  display: none;
  position: absolute;
  top: 0;
  left: 0;
}

.data-table {
  table-layout: fixed;
  border-collapse: separate;
}

.data-table thead.sticky {
  position: relative;
}

.data-table thead {
  color: var(--am-caption-color);
  font-size: 12px;
}

.data-table thead.sticky th {
  z-index: 1;
  background-color: var(--am-paper-background-color);
  border-bottom: 3px solid var(--am-divider-color);
  position: -webkit-sticky;
  position: sticky;
  top: -16px;
  overflow: visible;
}

.data-table thead a {
  color: var(--am-caption-color);
  flex-direction: row;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  display: flex;
}

.data-table thead a.active {
  color: var(--am-text-primary);
}

.data-table thead a .show-hover {
  visibility: hidden;
}

.data-table thead a:hover .show-hover {
  visibility: visible;
}

.data-table .filter-rows td > input {
  margin-right: 12px;
  text-overflow: ellipsis;
  background-color: #0000;
  border-width: 0 0 2px;
  outline: 0;
  width: 100%;
  height: 28px;
  margin-top: 4px;
  margin-bottom: 4px;
  padding: 2px 0;
  overflow: clip;
}

.data-table .filter-rows td > input:focus {
  border-bottom-color: var(--am-primary-main);
}

.data-table .filter-rows td > select {
  margin-right: 12px;
  text-overflow: ellipsis;
  background-color: #0000;
  border-width: 0 0 2px;
  outline: 0;
  width: 100%;
  height: 28px;
  margin-top: 4px;
  margin-bottom: 4px;
  padding: 2px 0;
  overflow: clip;
}

.data-table .filter-rows td > select:focus {
  border-bottom-color: var(--am-primary-main);
}

.data-table .data-rows td {
  text-wrap: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.data-table .data-rows td:hover {
  text-wrap: initial;
  text-overflow: initial;
}

.data-table .data-rows td.right {
  text-align: right;
}

.data-table tbody:not(.data-rows) tr:hover {
  background-color: var(--am-paper-background-color);
}

.data-table-header {
  padding-top: 12px;
  justify-content: space-between;
  gap: 8px;
  padding-left: 16px;
  padding-right: 16px;
  display: flex;
}

.data-table-header .actions {
  align-items: baseline;
  gap: 8px;
  display: flex;
}

.data-table-header .htmx-request {
  animation: 1s linear infinite rotate;
}

.button {
  color: inherit;
  background-color: inherit;
  cursor: pointer;
  border: 0;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 8px;
  transition: background-color .25s cubic-bezier(.4, 0, .2, 1);
  display: flex;
  position: relative;
}

.button:disabled {
  box-shadow: none;
  cursor: not-allowed;
  color: var(--am-action-disabled) !important;
}

.button:focus {
  background-color: var(--am-action-focus);
}

.button:hover {
  background-color: var(--am-action-hover);
}

.button.icon.small {
  width: 24px;
  height: 24px;
  padding: 0;
}

.button.icon {
  width: 40px;
  height: 40px;
  color: var(--am-icon-button-color);
  border-radius: 100%;
}

.button.text {
  border-radius: var(--am-border-radius);
  padding: 5px 15px;
  text-decoration: none;
}

.button[type="submit"].loading:before {
  background-image: var(--am-icon-loading);
  content: "";
  vertical-align: -.125em;
  background-repeat: no-repeat;
  background-size: 1em;
  width: 1em;
  height: 1em;
  margin: auto;
  display: inline-block;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

@keyframes rotate {
  0% {
    rotate: none;
  }

  100% {
    rotate: -360deg;
  }
}

dialog {
  font-size: initial;
  line-height: initial;
  box-shadow: var(--am-shadow);
  border: 0;
}

dialog:not([open]) {
  display: none;
}

dialog::backdrop {
  -webkit-backdrop-filter: brightness(50%);
  backdrop-filter: brightness(50%);
}

.dropdown-menu {
  z-index: 1000;
  text-align: left;
  background-color: var(--am-paper-background-color);
  border: 1px solid var(--am-divider-color);
  width: 100%;
  max-height: 310px;
  margin-top: -1px;
  padding: 0;
  list-style: none;
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  overflow-y: auto;
}

.dropdown-menu > li > a {
  clear: both;
  color: var(--am-text-primary);
  white-space: nowrap;
  padding: 6px 8px;
  line-height: 20px;
  text-decoration: none;
  display: block;
}

.dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus, .dropdown-submenu:hover > a, .dropdown-submenu:focus > a {
  color: var(--am-text-primary);
  background-color: var(--am-action-focus);
  cursor: pointer;
  text-decoration: none;
}

.dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:focus {
  color: var(--am-text-primary);
  background-color: var(--am-action-focus);
  cursor: pointer;
  outline: 0;
  text-decoration: none;
}
