.grid-container {
  position: relative;
  padding: 32px 16px;
  z-index: 1;
  content-visibility: auto;
  color: var(--foreground);
  background-color: var(--background);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  max-width: 1152px;
  margin: auto;
}

.grid-item {
  display: flex;
  appearance: none;
  background: transparent;
  box-sizing: border-box;
  width: 160px;
  height: 160px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 4px;
  border-radius: 16px;
  -moz-user-select: none;
  -webkit-user-select: none;
  user-select: none;
  cursor: pointer;
}

.grid-item:hover {
  background-color: var(--background-layer);
}

.grid-item:focus-visible {
  outline: none;
  border: 1px solid var(--foreground);
}

.grid-item p {
  font-size: 12px;
  line-height: 16px;
  margin-top: 12px;
  text-align: center;
}

.versioning {
  margin-top: 2px;
  opacity: 0.75;
}

.snippet {
  position: relative;
  width: 100%;
}

.snippet pre {
  text-overflow: ellipsis;
}

.snippet button {
  position: absolute;
  top: -8px;
  right: -8px;
  margin: 0;
  cursor: pointer;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
}

.button-row button {
  background-color: transparent;
  font-size: 16px;
  line-height: 24px;
  margin: 0 48px 0 0;
  padding: 0;
  height: 48px;
  cursor: pointer;
}

.button-row button svg {
  margin-right: 8px;
}

.disabled {
  color: var(--pewter);
  user-select: none;
}

.close-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  text-align: end;
  cursor: pointer;
}

.close-button {
  color: inherit;
  background: transparent;
  height: unset !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 48px !important;
  position: absolute;
  top: -14px;
  right: -18px;
  text-align: end;
  cursor: pointer;
}

.close-button::before {
  content: "";
  background: var(--background);
  position: absolute;
  width: 18px;
  height: 18px;
  top: 5px;
  left: 5px;
  border-radius: 50%;
  z-index: -1;
}

.close-button:active {
  opacity: 0.7;
}

.empty-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  min-height: 80vh;
  max-width: 1120px;
  margin: auto;
}

.empty-list-box p {
  margin-bottom: 0;
}

.empty-list-box {
  max-width: 80%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px;
  border-radius: 8px;
  background-color: var(--background-layer);
}

.beacon {
  position: relative;
  top: -96px;
}

aside.detail-footer {
  position: sticky;
  bottom: 16px;
  margin: auto;
  max-width: 1120px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  padding: 12px 24px;
  height: 146px;
}

figure {
  margin: 0;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 24px;
  align-items: center;
}

figcaption {
  display: flex;
  flex-direction: column;
  font-size: 14px;
}

figcaption > p {
  margin: 0;
}

.detail-preview {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-block: 8px;
}

.detail-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.detail-actions {
  /* display: inline-flex;
  align-items: center;
  justify-content: flex-start; */
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  max-height: 60px;
  /* gap: 6px; */
}

.action-button {
  color: var(--foreground);
  background-color: transparent;
  font-size: 11px;
  padding: 6px;
  border-radius: 4px;
}

.action-button.text {
  padding: 6px 10px 6px 6px;
}

.action-button:hover {
  background-color: var(--background-layer) !important;
}

.detail-actions .action-button svg {
  margin-right: 6px;
}

@media screen and (max-width: 719px) {
  .grid-container {
    padding: 16px 8px;
  }

  .close-button {
    top: 4px;
    right: 12px;
  }

  aside.detail-footer {
    top: 16px;
    bottom: -20px;
    display: flex;
    flex-direction: column;
    height: 440px;
    margin-inline: -10px;
    border-radius: 0;
  }

  .detail-actions {
    display: inline-flex;
  }
}

@media screen and (max-width: 536px) {
  .grid {
    grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  }

  .grid-item {
    width: 108px;
    height: unset;
    padding: 4px 0;
    justify-content: flex-start;
    border: 1px solid transparent;
  }

  .grid-item p {
    padding: 0 4px;
  }
}
