.cgc-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 18px;
  padding: 9px 13px;
  border: 1px solid #2457a6;
  border-radius: 5px;
  background: #fff;
  color: #2457a6;
  font-size: 0.96rem;
  font-weight: 800;
  cursor: pointer;
}

.cgc-trigger:hover {
  background: #edf4ff;
}

.cgc-trigger svg,
.cgc-close svg,
.cgc-copy svg {
  width: 18px;
  height: 18px;
}

.cgc-trigger:focus-visible,
.cgc-close:focus-visible,
.cgc-formats button:focus-visible,
.cgc-copy:focus-visible,
.cgc-output textarea:focus {
  outline: 3px solid rgba(36, 87, 166, 0.35);
  outline-offset: 2px;
}

.cgc-dialog {
  width: min(700px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #17212b;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.3);
}

.cgc-dialog::backdrop {
  background: rgba(15, 23, 42, 0.64);
}

.cgc-shell {
  display: grid;
  gap: 17px;
  padding: 22px;
}

.cgc-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 15px;
  border-bottom: 1px solid #d8dee5;
}

.cgc-heading p {
  margin: 0 0 4px;
  color: #0f766e;
  font-size: 0.88rem;
  font-weight: 850;
  text-transform: uppercase;
}

.cgc-heading h2 {
  margin: 0;
  color: #17212b;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.2;
}

.cgc-close {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  border: 1px solid #b8c1cc;
  border-radius: 5px;
  background: #fff;
  color: #475569;
  cursor: pointer;
}

.cgc-formats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #aeb8c6;
  border-radius: 6px;
}

.cgc-formats button {
  min-height: 44px;
  padding: 8px 6px;
  border: 0;
  border-right: 1px solid #aeb8c6;
  background: #fff;
  color: #475569;
  font-size: 0.94rem;
  font-weight: 800;
  cursor: pointer;
}

.cgc-formats button:last-child {
  border-right: 0;
}

.cgc-formats button.active {
  background: #2457a6;
  color: #fff;
}

.cgc-output {
  display: grid;
  gap: 7px;
  color: #334155;
  font-size: 0.94rem;
  font-weight: 800;
}

.cgc-output textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  padding: 13px;
  border: 1px solid #aeb8c6;
  border-radius: 6px;
  background: #f8fafc;
  color: #253047;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.94rem;
  line-height: 1.6;
}

.cgc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cgc-footer p {
  margin: 0;
  color: #52606d;
  font-size: 0.9rem;
}

.cgc-copy {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 9px 14px;
  border: 0;
  border-radius: 5px;
  background: #0f766e;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 850;
  cursor: pointer;
}

@media (max-width: 560px) {
  .cgc-shell {
    padding: 17px;
  }

  .cgc-formats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cgc-formats button:nth-child(2) {
    border-right: 0;
  }

  .cgc-formats button:nth-child(-n + 2) {
    border-bottom: 1px solid #aeb8c6;
  }

  .cgc-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .cgc-copy {
    justify-content: center;
    width: 100%;
  }
}
