/* WPSTL Bug Reporter - isolated support UI layered on top of builder controls. */
.wpstl-bug-tools {
  margin: 4px 12px 10px;
  padding: 8px 0 0;
  border: 0;
  border-top: 1px solid rgba(127, 127, 127, 0.22);
  border-radius: 0;
  background: transparent;
}

.wpstl-bug-tools__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.wpstl-bug-tools__actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 27px;
  padding: 4px 8px;
  border: 1px solid currentColor;
  border-radius: 5px;
  font: inherit;
  font-size: 11px;
  line-height: 1.15;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.wpstl-bug-tools__report {
  border-color: var(--accent, var(--wpstl-accent, #0ea5e9));
  background: #fff;
  color: #111827;
}

.wpstl-bug-tools__report::before {
  content: "!";
  display: inline-flex;
  width: 13px;
  height: 13px;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 8px;
  line-height: 1;
}

.wpstl-bug-tools__issues {
  border-color: #cbd5e1;
  background: #fff;
  color: #111827;
}

.wpstl-bug-tools__issues[hidden] {
  display: none !important;
}

.wpstl-bug-tools__count {
  display: inline-flex;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(127,127,127,.18);
  font-size: 9px;
  line-height: 15px;
}

.wpstl-bug-tools__count[hidden] { display: none !important; }

html.wpstl-bug-modal-open,
body.wpstl-bug-modal-open {
  overflow: hidden;
}

.wpstl-bug-modal[hidden] {
  display: none !important;
}

.wpstl-bug-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: inherit;
}

.wpstl-bug-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(2px);
}

.wpstl-bug-modal__dialog {
  position: relative;
  width: min(640px, 100%);
  max-height: min(780px, calc(100vh - 40px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  background: #fff;
  color: #111827;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.wpstl-bug-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid #e5e7eb;
}

.wpstl-bug-modal__eyebrow {
  margin-bottom: 4px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.wpstl-bug-modal__title {
  margin: 0;
  color: #111827;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
}

.wpstl-bug-modal__close {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: -6px -6px 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #64748b;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.wpstl-bug-modal__close:hover,
.wpstl-bug-modal__close:focus-visible {
  background: #f1f5f9;
  color: #111827;
}

.wpstl-bug-modal__body {
  overflow-y: auto;
  padding: 20px 22px 22px;
}

.wpstl-bug-modal__intro {
  margin: 0 0 18px;
  color: #475569;
  font-size: 14px;
  line-height: 1.55;
}

.wpstl-bug-form {
  display: grid;
  gap: 15px;
}

.wpstl-bug-form__group {
  display: grid;
  gap: 6px;
  margin: 0;
}

.wpstl-bug-form__label {
  color: #1f2937;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 650;
}

.wpstl-bug-form__control {
  box-sizing: border-box;
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font: inherit;
  font-size: 14px;
  outline: none;
}

.wpstl-bug-form__textarea {
  min-height: 126px;
  resize: vertical;
  line-height: 1.45;
}

.wpstl-bug-form__control:focus {
  border-color: var(--accent, var(--wpstl-accent, #0ea5e9));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, var(--wpstl-accent, #0ea5e9)) 15%, transparent);
}

.wpstl-bug-form__hint,
.wpstl-bug-form__diagnostic-note {
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.wpstl-bug-form__diagnostic-note {
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.wpstl-bug-form__contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.wpstl-bug-follow-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #334155;
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
}

.wpstl-bug-follow-check input {
  margin: 2px 0 0;
  accent-color: var(--accent, var(--wpstl-accent, #0ea5e9));
}

.wpstl-bug-form__actions,
.wpstl-bug-modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 3px;
}

.wpstl-bug-btn {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
}

.wpstl-bug-btn:hover:not(:disabled) {
  background: #f8fafc;
}

.wpstl-bug-btn:disabled {
  opacity: .65;
  cursor: default;
}

.wpstl-bug-btn--primary {
  border-color: var(--accent, var(--wpstl-accent, #0ea5e9));
  background: var(--accent, var(--wpstl-accent, #0ea5e9));
  color: #fff;
}

.wpstl-bug-btn--primary:hover:not(:disabled) {
  filter: brightness(.96);
  background: var(--accent, var(--wpstl-accent, #0ea5e9));
}

.wpstl-bug-btn--small {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.wpstl-bug-btn.is-following {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.wpstl-bug-form__message,
.wpstl-bug-follow-inline__message,
.wpstl-bug-inline-error {
  min-height: 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.4;
}

.wpstl-bug-form__message--error,
.wpstl-bug-inline-error {
  color: #b91c1c;
}

.wpstl-bug-message {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.wpstl-bug-message--error {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.wpstl-bug-success {
  padding: 12px 4px 4px;
  text-align: center;
}

.wpstl-bug-success__mark {
  display: inline-flex;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  border-radius: 50%;
  background: #ecfdf5;
  color: #047857;
  font-size: 24px;
  font-weight: 700;
}

.wpstl-bug-success h3 {
  margin: 0 0 8px;
  color: #111827;
  font-size: 18px;
}

.wpstl-bug-success p {
  margin: 0 auto 12px;
  max-width: 460px;
  color: #475569;
  font-size: 14px;
  line-height: 1.5;
}

.wpstl-bug-success__ref {
  margin: 0 0 18px;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.wpstl-bug-issues {
  display: grid;
  gap: 9px;
}

.wpstl-bug-issue {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}

.wpstl-bug-issue__content {
  min-width: 0;
}

.wpstl-bug-issue__title {
  margin-bottom: 6px;
  color: #1f2937;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 650;
}

.wpstl-bug-issue__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.wpstl-bug-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 10px;
  line-height: 1;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.wpstl-bug-status--in-progress {
  background: #eff6ff;
  color: #1d4ed8;
}

.wpstl-bug-status--confirmed {
  background: #fff7ed;
  color: #c2410c;
}

.wpstl-bug-issue__category {
  color: #64748b;
  font-size: 11px;
  line-height: 1.3;
}

.wpstl-bug-issue__follow {
  flex: 0 0 auto;
  text-align: right;
}

.wpstl-bug-follow-inline {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 7px;
  width: min(330px, 100%);
}

.wpstl-bug-follow-inline[hidden] {
  display: none !important;
}

.wpstl-bug-follow-inline .wpstl-bug-form__control {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 12px;
}

.wpstl-bug-follow-inline__message {
  grid-column: 1 / -1;
  text-align: left;
}

.wpstl-bug-follow-inline.is-complete {
  display: block;
  width: auto;
}

.wpstl-bug-empty {
  padding: 22px 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
  text-align: center;
}

.wpstl-bug-issues__more {
  margin-top: 10px;
  color: #64748b;
  font-size: 11px;
  text-align: center;
}

.wpstl-bug-modal__footer {
  margin-top: 18px;
}

.wpstl-bug-hp {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

@media (max-width: 640px) {
  .wpstl-bug-modal {
    align-items: flex-end;
    padding: 0;
  }

  .wpstl-bug-modal__dialog {
    width: 100%;
    max-height: 92vh;
    border-radius: 14px 14px 0 0;
    border-bottom: 0;
  }

  .wpstl-bug-modal__header,
  .wpstl-bug-modal__body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .wpstl-bug-form__contact-grid {
    grid-template-columns: 1fr;
  }

  .wpstl-bug-issue {
    align-items: flex-start;
    flex-direction: column;
  }

  .wpstl-bug-issue__follow,
  .wpstl-bug-follow-inline {
    width: 100%;
  }

  .wpstl-bug-follow-inline {
    grid-template-columns: 1fr;
  }

  .wpstl-bug-follow-inline__message {
    grid-column: auto;
  }

  .wpstl-bug-form__actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .wpstl-bug-form__actions .wpstl-bug-btn {
    width: 100%;
  }
}
