.footer-grid.has-comments {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.footer-comment-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid rgba(98, 199, 207, 0.68);
  border-radius: 8px;
  background: rgba(98, 199, 207, 0.1);
  color: var(--text);
  padding: 9px 12px;
  font-weight: 900;
  cursor: pointer;
}

.footer-comment-button:hover,
.footer-comment-button:focus-visible {
  border-color: var(--teal-soft);
  background: rgba(98, 199, 207, 0.2);
  outline: none;
}

.comment-dialog {
  width: min(520px, calc(100% - 24px));
  max-height: calc(100vh - 32px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 0;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.64);
}

.comment-dialog::backdrop {
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(4px);
}

.comment-form {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.comment-dialog-head,
.comment-dialog-head > div {
  display: flex;
  align-items: center;
}

.comment-dialog-head {
  justify-content: space-between;
  gap: 16px;
}

.comment-dialog-head > div {
  gap: 10px;
}

.comment-dialog-icon {
  font-size: 1.6rem;
}

.comment-dialog h2 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.15;
}

.comment-close {
  display: grid;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.comment-instruction,
.comment-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.comment-form label {
  font-weight: 900;
}

.comment-form textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink);
  color: var(--text);
  padding: 12px;
  font: inherit;
  line-height: 1.5;
}

.comment-form textarea:focus {
  border-color: var(--teal-soft);
  outline: 3px solid rgba(98, 199, 207, 0.2);
}

.comment-trap {
  position: absolute;
  left: -10000px;
}

.comment-status:not(:empty) {
  min-height: 24px;
  color: var(--teal-soft);
  font-weight: 800;
}

.comment-confirmation {
  padding: 28px 22px 22px;
  text-align: center;
}

.comment-confirmation-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  place-items: center;
  border: 1px solid rgba(53, 196, 111, 0.72);
  border-radius: 50%;
  background: rgba(53, 196, 111, 0.14);
  color: var(--green);
  font-size: 1.65rem;
  font-weight: 900;
}

.comment-confirmation h2 {
  margin: 0;
}

.comment-confirmation p {
  margin: 12px 0 20px;
  color: var(--muted);
}

@media (max-width: 920px) {
  .footer-grid.has-comments {
    grid-template-columns: 1fr;
  }

  .footer-comment-button {
    width: fit-content;
  }
}

@media (max-width: 620px) {
  .comment-form {
    padding: 18px;
  }

  .comment-dialog h2 {
    font-size: 1.35rem;
  }
}
