.app-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  width: min(calc(100% - 48px), 1132px);
  max-width: none;
  margin: 0 auto;
  padding: 32px 0 max(44px, env(safe-area-inset-bottom));
  color: var(--muted);
}

.footer-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  width: 100%;
  font-size: 12px;
  line-height: 1.4;
}

.footer-main > span {
  justify-self: start;
}

.footer-main > a {
  justify-self: center;
}

.footer-main > .quiet {
  justify-self: end;
  font-size: 12px;
  text-align: right;
}

.footer-license {
  width: min(100%, 78ch);
  max-width: none;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.72;
  letter-spacing: 0;
  text-wrap: pretty;
  overflow-wrap: break-word;
  hyphens: auto;
}

.footer-license a {
  color: var(--text);
  font-weight: 500;
  text-decoration-thickness: 1px;
}

html[data-theme="light"] .footer-license {
  color: #55555e;
}

@media (max-width: 700px) {
  .app-footer {
    width: calc(100% - 40px);
    margin: 0 20px;
    gap: 20px;
    padding: 26px 0 max(34px, env(safe-area-inset-bottom));
  }

  .footer-main {
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    font-size: 11px;
  }

  .footer-main > .quiet {
    max-width: 126px;
    font-size: 11px;
    line-height: 1.35;
  }

  .footer-license {
    font-size: 12px;
    line-height: 1.68;
  }
}

@media (max-width: 360px) {
  .app-footer {
    width: calc(100% - 36px);
    margin-inline: 18px;
  }

  .footer-main {
    grid-template-columns: 1fr auto;
    gap: 6px 16px;
  }

  .footer-main > span {
    grid-column: 1;
    grid-row: 1;
  }

  .footer-main > a {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .footer-main > .quiet {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
    max-width: none;
    text-align: left;
  }
}
