/* Audited presentation-only overrides for the mirrored public website. */
.kg-mini-dialog-backdrop {
  background: rgba(15, 35, 70, 0.56);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.kg-mini-dialog {
  width: min(420px, 100%);
  overflow: hidden;
  border: 1px solid rgba(73, 126, 210, 0.22);
  border-radius: 16px;
  background: #f8fbff;
  box-shadow: 0 28px 80px rgba(9, 24, 55, 0.3);
  color: #142543;
  padding: 24px;
}

.kg-mini-dialog::before {
  width: 72px;
  height: 3px;
  left: 24px;
  background: #2868cf;
}

.kg-mini-dialog header {
  gap: 18px;
}

.kg-mini-dialog header > div {
  gap: 5px;
}

.kg-mini-dialog header span {
  color: #2868cf;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.kg-mini-dialog h2 {
  color: #142543;
  font-size: 24px;
  font-weight: 750;
  letter-spacing: 0;
}

.kg-mini-dialog header button {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(73, 126, 210, 0.24);
  border-radius: 10px;
  background: #ffffff;
  color: #34547f;
}

.kg-mini-dialog header button:hover {
  border-color: rgba(40, 104, 207, 0.52);
  background: #edf4ff;
  color: #1d58b8;
}

.kg-mini-dialog-code {
  width: min(268px, 100%);
  margin: 22px auto 0;
  border: 1px solid rgba(73, 126, 210, 0.18);
  border-radius: 12px;
  background: #ffffff;
  padding: 10px;
  box-shadow: 0 12px 34px rgba(35, 82, 154, 0.1);
}

.kg-mini-dialog-code img {
  filter: none;
}

.kg-mini-dialog-copy {
  margin-top: 18px;
  border-top: 1px solid rgba(73, 126, 210, 0.16);
  padding-top: 15px;
  color: #526b91;
}

.kg-mini-dialog-copy svg {
  color: #2868cf;
}

.kg-mini-dialog-copy p {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
}

@media (max-width: 560px) {
  .kg-mini-dialog {
    padding: 22px 18px 20px;
  }

  .kg-mini-dialog::before {
    left: 18px;
  }

  .kg-mini-dialog-code {
    width: min(244px, 100%);
    margin-top: 20px;
  }
}

/* Keep template actions attached to the card content instead of floating below it. */
.kg-template-card {
  align-self: start;
}

.kg-template-card .kg-template-body {
  min-height: 0;
  padding-bottom: 10px;
}

.kg-template-card .kg-template-use {
  width: calc(100% - 36px);
  min-height: 40px;
  justify-content: center;
  margin: 0 18px 18px;
  padding: 0 14px;
  border: 1px solid rgba(52, 120, 255, 0.22);
  border-radius: 10px;
  background: #edf4ff;
  color: #2868cf;
  font-size: 13px;
  transition: background 0.18s ease-out, border-color 0.18s ease-out, color 0.18s ease-out;
}

.kg-template-card .kg-template-use:hover {
  gap: 5px;
  border-color: rgba(52, 120, 255, 0.48);
  background: #e2edff;
  color: #174fae;
}

/* Preserve the full template cover in the public detail dialog. */
.kg-template-detail {
  width: min(1160px, calc(100vw - 40px));
  grid-template-columns: minmax(0, 3fr) minmax(360px, 2fr);
}

.kg-template-detail > img {
  align-self: center;
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
  background: #edf3fb;
}

@media (max-width: 720px) {
  .kg-template-detail {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .kg-template-detail > img {
    max-height: 48dvh;
  }
}
