/* ── Wrapper button ─────────────────────────────────────────────────────────── */
.pt-gd-wrapper {
  margin: 12px 0 16px;
  text-align: left;
}
.pt-gd-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #cc0000;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 11px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: .3px;
  transition: opacity .2s, transform .15s;
  box-shadow: 0 3px 10px rgba(204, 0, 0, 0.35);
}
.pt-gd-open-btn:hover { opacity: .88; transform: translateY(-1px); }
.pt-gd-open-btn:active { transform: translateY(0); }
.pt-gd-wrapper-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: #888;
}

/* ── Overlay ────────────────────────────────────────────────────────────────── */
.pt-gd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
body.pt-gd-open { overflow: hidden; }

/* ── Modal ──────────────────────────────────────────────────────────────────── */
.pt-gd-modal {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 1020px;
  max-height: 92vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  display: flex;
  flex-direction: column;
}
.pt-gd-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: #555;
  cursor: pointer;
  z-index: 10;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.pt-gd-close:hover { color: #cc0000; background: #f5f5f5; }

/* ── Two-column body ────────────────────────────────────────────────────────── */
.pt-gd-modal-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}
.pt-gd-form-col {
  width: 420px;
  min-width: 320px;
  border-right: 1px solid #eee;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pt-gd-result-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow-y: auto;
  padding: 24px;
  background: #fafafa;
}

/* ── Form column heading ────────────────────────────────────────────────────── */
.pt-gd-heading {
  margin: 0;
  padding: 20px 24px 6px;
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
}
.pt-gd-subheading {
  margin: 0 0 10px;
  padding: 0 24px;
  font-size: 13px;
  color: #666;
}
.pt-gd-scrollable {
  flex: 1;
  overflow-y: auto;
  padding: 4px 24px 24px;
}

/* ── Form fields ────────────────────────────────────────────────────────────── */
.pt-gd-field {
  margin-bottom: 13px;
}
.pt-gd-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #444;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.pt-gd-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #999;
  font-size: 11px;
}
.pt-gd-field input[type="text"],
.pt-gd-field input[type="url"],
.pt-gd-field textarea,
.pt-gd-field select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 13px;
  color: #333;
  background: #fff;
  box-sizing: border-box;
  transition: border-color .15s;
  font-family: inherit;
}
.pt-gd-field input:focus,
.pt-gd-field textarea:focus,
.pt-gd-field select:focus {
  outline: none;
  border-color: #cc0000;
  box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.12);
}
.pt-gd-field textarea { resize: vertical; min-height: 56px; }

/* ── Two-column row for colour pickers ─────────────────────────────────────── */
.pt-gd-row-2 {
  display: flex;
  gap: 12px;
}
.pt-gd-row-2 .pt-gd-field { flex: 1; }

/* ── Colour picker ──────────────────────────────────────────────────────────── */
.pt-gd-color-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pt-gd-color-wrap input[type="color"] {
  width: 40px;
  height: 34px;
  padding: 2px;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  background: #fff;
}
.pt-gd-color-hex {
  font-size: 12px;
  font-family: monospace;
  color: #555;
}

/* ── File upload fields ─────────────────────────────────────────────────────── */
.pt-gd-file-hidden { display: none; }
.pt-gd-file-btn {
  display: inline-block;
  padding: 7px 14px;
  background: #f0f0f0;
  border: 1px dashed #bbb;
  border-radius: 5px;
  font-size: 12px;
  color: #555;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.pt-gd-file-btn:hover { background: #e6e6e6; border-color: #cc0000; color: #cc0000; }
.pt-gd-thumb-wrap {
  margin-top: 8px;
  position: relative;
  display: inline-block;
}
.pt-gd-thumb-wrap img {
  max-width: 100%;
  max-height: 80px;
  border-radius: 4px;
  border: 1px solid #ddd;
  display: block;
}
.pt-gd-remove-file {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #cc0000;
  color: #fff;
  border: none;
  font-size: 10px;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  padding: 0;
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.pt-gd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s, transform .12s;
  font-family: inherit;
  white-space: nowrap;
}
.pt-gd-btn:hover { opacity: .87; transform: translateY(-1px); }
.pt-gd-btn:active { transform: translateY(0); }
.pt-gd-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.pt-gd-btn-primary  { background: linear-gradient(135deg,#cc0000,#a30000); color:#fff; width:100%; margin-top:6px; }
.pt-gd-contact-always-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 9px 18px;
  background: none;
  border: 1.5px solid #cc0000;
  border-radius: 6px;
  color: #cc0000;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  transition: background .15s, color .15s;
}
.pt-gd-contact-always-btn:hover { background: #cc0000; color: #fff; }
.pt-gd-btn-secondary { background: #f0f0f0; color: #333; }
.pt-gd-btn-download  { background: #1a73e8; color: #fff; }
.pt-gd-btn-submit    { background: linear-gradient(135deg,#cc0000,#a30000); color: #fff; }

/* ── Result column ──────────────────────────────────────────────────────────── */
.pt-gd-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #ddd;
  border-radius: 10px;
  min-height: 260px;
}
.pt-gd-placeholder-inner { text-align: center; color: #bbb; }
.pt-gd-placeholder-icon { font-size: 48px; margin-bottom: 10px; }
.pt-gd-placeholder-inner p { font-size: 14px; line-height: 1.5; margin: 0; }

/* ── Loading ────────────────────────────────────────────────────────────────── */
.pt-gd-loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  gap: 14px;
}
.pt-gd-spinner {
  width: 48px;
  height: 48px;
  border: 5px solid #eee;
  border-top-color: #cc0000;
  border-radius: 50%;
  animation: pt-gd-spin 0.9s linear infinite;
}
@keyframes pt-gd-spin { to { transform: rotate(360deg); } }
.pt-gd-loading-text { font-size: 15px; font-weight: 600; color: #333; margin: 0; }
.pt-gd-loading-note { font-size: 12px; color: #888; margin: 0; }

/* ── Error box ──────────────────────────────────────────────────────────────── */
.pt-gd-error-box {
  background: #fff3f3;
  border: 1px solid #f5c6cb;
  border-radius: 6px;
  padding: 12px 16px;
  color: #7a0000;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ── Generated result ───────────────────────────────────────────────────────── */
.pt-gd-result { width: 100%; }
.pt-gd-result-label { display: none; }

/* Professional macOS-style design card */
.pt-gd-design-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,.07), 0 10px 36px rgba(0,0,0,.13);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.07);
}

/* Title bar */
.pt-gd-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(90deg,#1a1a1a 0%,#2d2d2d 100%);
}
.pt-gd-card-dots { display: flex; gap: 6px; flex-shrink: 0; }
.pt-gd-dot { width: 12px; height: 12px; border-radius: 50%; }
.pt-gd-dot-r { background: #ff5f57; }
.pt-gd-dot-y { background: #febc2e; }
.pt-gd-dot-g { background: #28c840; }
.pt-gd-card-title {
  flex: 1;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.6);
  letter-spacing: .4px;
}
.pt-gd-card-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #cc0000;
  background: rgba(204,0,0,.12);
  border: 1px solid rgba(204,0,0,.3);
  padding: 2px 8px;
  border-radius: 20px;
  flex-shrink: 0;
}

/* Image area */
.pt-gd-result-img-wrap {
  border-radius: 0;
  overflow: hidden;
  border: none;
  margin-bottom: 0;
  background: #1a1a1a;
  line-height: 0;
}
.pt-gd-result-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

/* Thumbnail strip */
.pt-gd-thumb-strip {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  background: #f3f4f6;
  border-top: 1px solid #e5e7eb;
  overflow-x: auto;
}
.pt-gd-thumb-item {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 5px;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  opacity: .7;
  transition: opacity .15s, border-color .15s;
}
.pt-gd-thumb-item:hover { opacity: 1; }
.pt-gd-thumb-active { border-color: #cc0000 !important; opacity: 1; }

/* Action buttons */
.pt-gd-result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: #f8f9fa;
  border-top: 1px solid #eee;
}

/* ── Edit this design panel ─────────────────────────────────────────────────── */
.pt-gd-edit-box {
  margin-top: 20px;
  padding: 14px 16px 16px;
  background: #f9f9fb;
  border: 1px solid #e2e4ea;
  border-radius: 8px;
}
.pt-gd-edit-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #333;
  margin-bottom: 4px;
  letter-spacing: .2px;
}
.pt-gd-edit-hint {
  margin: 0 0 10px;
  font-size: 12px;
  color: #6b6f78;
  line-height: 1.4;
}
.pt-gd-edit-box textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d4db;
  border-radius: 6px;
  padding: 9px 11px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 56px;
  background: #fff;
  margin-bottom: 10px;
  color: #222;
}
.pt-gd-edit-box textarea:focus {
  outline: none;
  border-color: #cc0000;
  box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.12);
}
.pt-gd-btn-edit {
  background: #1a1a1a;
  color: #fff;
}
.pt-gd-btn-edit:hover { opacity: .88; }
.pt-gd-btn-edit:disabled { opacity: .55; cursor: not-allowed; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .pt-gd-modal-body  { flex-direction: column; overflow-y: auto; }
  .pt-gd-form-col    { width: 100%; border-right: none; border-bottom: 1px solid #eee; max-height: 55vh; }
  .pt-gd-result-col  { padding: 16px; }
  .pt-gd-heading     { font-size: 17px; padding: 16px 16px 4px; }
  .pt-gd-subheading  { padding: 0 16px; }
  .pt-gd-scrollable  { padding: 4px 16px 16px; }
  .pt-gd-result-actions { flex-direction: column; }
  .pt-gd-btn         { width: 100%; }
}

/* ── Usage counter bar ───────────────────────────────────────────────────────── */
.pt-gd-counter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff5f5;
  border: 1px solid #f5c6c6;
  border-radius: 6px;
  padding: 8px 14px;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 600;
  color: #a30000;
  gap: 10px;
}
.pt-gd-reset-timer {
  font-size: 11px;
  font-weight: 500;
  color: #888;
  white-space: nowrap;
}

/* ── Design list wrapper ─────────────────────────────────────────────────────── */
.pt-gd-designs-list { width: 100%; }

/* ── Reference image preview ─────────────────────────────────────────────────── */
.pt-gd-ref-preview-wrap {
  margin: 0 24px 12px;
  padding: 8px 10px;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 6px;
}
.pt-gd-ref-label {
  display: block;
  font-size: 11px;
  color: #888;
  font-weight: 500;
  margin-bottom: 6px;
}
.pt-gd-ref-preview-wrap img {
  width: 100%;
  max-height: 90px;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}

/* ── Selection indicator bar ─────────────────────────────────────────────────── */
.pt-gd-selection-bar {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0 24px 14px;
  padding: 9px 13px;
  background: #fff5f5;
  border-left: 3px solid #cc0000;
  border-radius: 0 7px 7px 0;
  font-size: 12px;
  font-weight: 600;
  color: #7a0000;
  line-height: 1.4;
}
.pt-gd-sel-icon { font-size: 13px; flex-shrink: 0; margin-top: 1px; }

/* ── Contact designer overlay ────────────────────────────────────────────────── */
.pt-gd-contact-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.pt-gd-contact-modal {
  position: relative;
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  padding: 36px 32px 28px;
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
  text-align: center;
}
.pt-gd-contact-icon { font-size: 52px; margin-bottom: 10px; }
.pt-gd-contact-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
}
.pt-gd-contact-intro {
  font-size: 14px;
  color: #555;
  margin: 0 0 20px;
  line-height: 1.5;
}
.pt-gd-contact-phone-btn {
  display: block;
  background: linear-gradient(135deg, #cc0000, #a30000);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  padding: 13px 20px;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  transition: opacity .2s;
}
.pt-gd-contact-phone-btn:hover { opacity: .88; color: #fff; }
.pt-gd-contact-divider {
  font-size: 12px;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: .6px;
  margin: 0 0 16px;
  position: relative;
}
.pt-gd-contact-divider::before,
.pt-gd-contact-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 36%;
  height: 1px;
  background: #e0e0e0;
}
.pt-gd-contact-divider::before { left: 0; }
.pt-gd-contact-divider::after  { right: 0; }
.pt-gd-contact-email-form { text-align: left; }
.pt-gd-contact-attach-note {
  font-size: 12px;
  color: #cc0000;
  font-weight: 600;
  margin: 0 0 10px;
}
.pt-gd-email-status {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}
.pt-gd-email-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.pt-gd-email-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.pt-gd-contact-reset-note {
  margin: 16px 0 0;
  font-size: 12px;
  color: #888;
  text-align: center;
}

@media (max-width: 520px) {
  .pt-gd-contact-modal { padding: 28px 18px 20px; }
  .pt-gd-contact-title { font-size: 18px; }
}

/* ── Custom scrollbars (Chrome/Edge/Safari) ──────────────────────────────────── */
.pt-gd-scrollable::-webkit-scrollbar,
.pt-gd-result-col::-webkit-scrollbar,
.pt-gd-thumb-strip::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
.pt-gd-scrollable::-webkit-scrollbar-track,
.pt-gd-result-col::-webkit-scrollbar-track,
.pt-gd-thumb-strip::-webkit-scrollbar-track {
  background: #f1f1f1;
}
.pt-gd-scrollable::-webkit-scrollbar-thumb,
.pt-gd-result-col::-webkit-scrollbar-thumb,
.pt-gd-thumb-strip::-webkit-scrollbar-thumb {
  background: #cc0000;
  border-radius: 4px;
}
.pt-gd-scrollable::-webkit-scrollbar-thumb:hover,
.pt-gd-result-col::-webkit-scrollbar-thumb:hover {
  background: #a30000;
}
/* Firefox */
.pt-gd-scrollable,
.pt-gd-result-col {
  scrollbar-color: #cc0000 #f1f1f1;
  scrollbar-width: thin;
}
