:root {
  --ps-navy: #002e62;
  --ps-navy-hover: #001f43;
  --ps-radius: 8px;
  --ps-border: #d7dce2;
  --ps-text: #1d2327;
  --ps-muted: #5b6572;
  --ps-bg-soft: #f7f9fc;
  --ps-success-bg: #eefbf2;
  --ps-success-border: #0a7a33;
  --ps-error-bg: #fdecec;
  --ps-error-border: #b42318;
}

.ps-wrap .ps-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 24px;
  margin-top: 20px;
}

.ps-wrap .ps-help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

.ps-wrap .ps-card {
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  padding: 20px;
}

.ps-wrap .ps-card h2 {
  margin-top: 0;
}

.ps-wrap .ps-table {
  margin-top: 16px;
}

.ps-inline-form {
  display: inline-block;
  margin-right: 0;
}

.ps-status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.ps-status-generated,
.ps-status-active {
  background: #e8f7ee;
  color: #0a7a33;
}

.ps-status-processing {
  background: #eef5ff;
  color: #1d4ed8;
}

.ps-status-failed {
  background: #fdecec;
  color: #b42318;
}

.ps-status-skipped,
.ps-status-inactive {
  background: #f5f5f5;
  color: #444;
}

.ps-steps {
  margin: 0;
  padding-left: 20px;
}

.ps-steps li {
  margin-bottom: 14px;
}

.ps-bullets {
  margin: 0;
  padding-left: 18px;
}

.ps-bullets li {
  margin-bottom: 10px;
}

.ps-cache-cell {
  max-width: 280px;
}

.ps-wrap code {
  word-break: break-word;
}

.ps-licensee-dashboard,
.ps-review-screen {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  color: var(--ps-text);
}

.ps-dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.ps-front-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.ps-front-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: #fff;
}

.ps-front-table th,
.ps-front-table td {
  border: 1px solid #ddd;
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
  font-weight: 400;
}

.ps-front-table th {
  background: var(--ps-bg-soft);
  font-weight: 400;
}

.ps-actions-cell {
  white-space: normal;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.ps-front-input,
.ps-front-textarea {
  width: 100%;
  max-width: 100%;
  padding: 12px 14px;
  border: 1px solid #c3c4c7;
  border-radius: 12px;
  box-sizing: border-box;
}

.ps-front-editor-wrap {
  margin: 20px 0;
}

.ps-front-display-group {
  display: grid;
  gap: 18px;
}

.ps-front-display-field {
  background: #fff;
  border: 1px solid var(--ps-border);
  border-radius: 16px;
  padding: 18px;
}

.ps-front-display-field h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

.ps-front-content-view {
  line-height: 1.7;
}

.ps-front-content-view h2,
.ps-front-content-view h3,
.ps-front-content-view h4 {
  margin-top: 1.2em;
  margin-bottom: 0.6em;
}

.ps-front-content-view p:last-child {
  margin-bottom: 0;
}

.ps-front-gallery {
  margin-top: 24px;
}

.ps-front-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 180px));
  gap: 16px;
}

.ps-front-gallery-grid img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.ps-image-help-text {
  margin: 0 0 14px;
  color: var(--ps-muted);
}

.ps-featured-image-thumb img {
  width: 180px;
  max-width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.ps-secondary-status {
  display: inline-block;
  margin-top: 6px;
  color: var(--ps-muted);
}

.ps-gallery-choice {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--ps-border);
  border-radius: 14px;
  padding: 10px;
  cursor: pointer;
}

.ps-gallery-choice__footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.ps-front-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.ps-review-page-actions {
  margin-top: 28px;
}

.ps-version-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 24px;
}

.ps-version-pill {
  display: inline-block;
  padding: 12px 18px;
  border: 1px solid var(--ps-navy);
  border-radius: var(--ps-radius);
  text-decoration: none;
  color: var(--ps-navy);
  background: #fff;
  transition: all 0.2s ease;
  font-weight: 600;
}

.ps-version-pill:hover,
.ps-version-pill:focus {
  background: var(--ps-navy);
  border-color: var(--ps-navy);
  color: #fff;
}

.ps-version-pill-current,
.ps-version-pill-current:hover,
.ps-version-pill-current:focus {
  background: var(--ps-navy);
  color: #fff;
  border-color: var(--ps-navy);
  font-weight: 700;
}

.ps-version-instructions {
  margin: 16px 0 8px;
  font-weight: 600;
}

.ps-front-notice {
  padding: 14px 16px;
  border-left: 4px solid var(--ps-success-border);
  background: var(--ps-success-bg);
  margin: 12px 0;
  transition: opacity 0.5s ease;
  border-radius: 10px;
}

.ps-front-notice-success {
  border-left-color: var(--ps-success-border);
  background: var(--ps-success-bg);
}

.ps-front-notice-error {
  border-left-color: var(--ps-error-border);
  background: var(--ps-error-bg);
}

.ps-front-notice.is-fading {
  opacity: 0;
}

.ps-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  text-align: center;
  padding: 24px;
  border-radius: 18px;
}

.ps-loading-overlay.is-active {
  display: flex;
}

.ps-loading-overlay__content {
  max-width: 420px;
}

.ps-loading-spinner {
  width: 52px;
  height: 52px;
  border: 5px solid #d0d7de;
  border-top-color: var(--ps-navy);
  border-radius: 50%;
  margin: 16px auto;
  animation: psspin 1s linear infinite;
}

.ps-curate-project-button,
.ps-licensee-dashboard .button.ps-button,
.ps-review-screen .button.ps-button,
.ps-pagination a,
.ps-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--ps-radius);
  border: 1px solid var(--ps-navy);
  background: #fff;
  color: var(--ps-navy);
  text-align: center;
  text-decoration: none;
  font-weight: 400;
  line-height: 1.2;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
  box-sizing: border-box;
}

.ps-curate-project-button {
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ps-curate-project-button:hover,
.ps-curate-project-button:focus,
.ps-licensee-dashboard .button.ps-button:hover,
.ps-licensee-dashboard .button.ps-button:focus,
.ps-review-screen .button.ps-button:hover,
.ps-review-screen .button.ps-button:focus,
.ps-pagination a:hover,
.ps-pagination a:focus,
.ps-pagination span:hover,
.ps-pagination span:focus {
  background: var(--ps-navy);
  border-color: var(--ps-navy);
  color: #fff;
  transform: translateY(-1px);
}

.ps-licensee-dashboard .button.ps-button-secondary,
.ps-review-screen .button.ps-button-secondary {
  background: #fff;
  color: var(--ps-navy);
}

.ps-licensee-dashboard .button.ps-button-secondary:hover,
.ps-licensee-dashboard .button.ps-button-secondary:focus,
.ps-review-screen .button.ps-button-secondary:hover,
.ps-review-screen .button.ps-button-secondary:focus {
  background: var(--ps-navy);
  color: #fff;
}

.ps-licensee-dashboard .button.ps-button-green,
.ps-review-screen .button.ps-button-green {
  background: #008ca7;
  border-color: #008ca7;
  color: #fff;
}

.ps-licensee-dashboard .button.ps-button-green:hover,
.ps-licensee-dashboard .button.ps-button-green:focus,
.ps-review-screen .button.ps-button-green:hover,
.ps-review-screen .button.ps-button-green:focus {
  background: #fff;
  border-color: #008ca7;
  color: #008ca7;
}

.ps-licensee-dashboard .button.ps-button-disabled,
.ps-review-screen .button.ps-button-disabled {
  background: #fff;
  border-color: var(--ps-navy);
  color: var(--ps-navy);
  pointer-events: none;
  opacity: 0.8;
}

.ps-pagination {
  margin-top: 20px;
}

.ps-pagination ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.ps-pagination .current {
  background: var(--ps-navy);
  border-color: var(--ps-navy);
  color: #fff;
}

.ps-back-dashboard-wrap {
  margin: 0 0 18px;
}

.ps-back-dashboard-button {
  margin-bottom: 8px;
}

.ps-table-note {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  color: var(--ps-muted);
}

@keyframes psspin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1100px) {
  .ps-wrap .ps-grid,
  .ps-wrap .ps-help-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 782px) {
  .ps-dashboard-header {
    align-items: stretch;
  }

  .ps-dashboard-header .ps-button,
  .ps-dashboard-header .button {
    width: 100%;
  }

  .ps-front-actions {
    flex-direction: column;
  }

  .ps-front-actions .button,
  .ps-front-actions a.button,
  .ps-inline-form,
  .ps-inline-form .button {
    width: 100%;
  }

  .ps-version-links {
    flex-direction: column;
    align-items: stretch;
  }

  .ps-version-pill {
    width: 100%;
    text-align: center;
  }

  .ps-front-table,
  .ps-front-table thead,
  .ps-front-table tbody,
  .ps-front-table tr,
  .ps-front-table th,
  .ps-front-table td {
    display: block;
    width: 100%;
  }

  .ps-front-table thead {
    display: none;
  }

  .ps-front-table tr {
    margin-bottom: 16px;
    border: 1px solid var(--ps-border);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
  }

  .ps-front-table td {
    border: 0;
    border-bottom: 1px solid var(--ps-border);
    padding: 12px 14px;
  }

  .ps-front-table td:last-child {
    border-bottom: 0;
  }

  .ps-front-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--ps-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .ps-actions-cell .button,
  .ps-actions-cell a.button,
  .ps-actions-cell .ps-inline-form {
    width: 100%;
    margin-right: 0;
    margin-bottom: 10px;
  }

  .ps-actions-cell {
    display: block;
  }

  .ps-actions-cell .ps-inline-form:last-child,
  .ps-actions-cell .button:last-child {
    margin-bottom: 0;
  }

  .ps-front-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ps-front-gallery-grid img {
    height: 96px;
  }
}

@media (max-width: 520px) {
  .ps-licensee-dashboard,
  .ps-review-screen {
    font-size: 15px;
  }

  .ps-front-input,
  .ps-front-textarea,
  .ps-curate-project-button,
  .ps-licensee-dashboard .button.ps-button,
  .ps-review-screen .button.ps-button {
    width: 100%;
  }

  .ps-front-gallery-grid {
    grid-template-columns: 1fr;
  }

  .ps-front-gallery-grid img {
    height: 88px;
  }
}
