/**
 * TPM manage dashboard — form tables & edit screens
 */

.tpm-manage-settings .form-table th {
  width: 220px;
  padding: 12px 10px 12px 0;
  vertical-align: top;
}

.tpm-manage-settings .form-table td {
  padding: 10px 0;
}

.tpm-manage-settings .regular-text,
.tpm-manage-settings .large-text,
.tpm-manage-settings .widefat,
.tpm-manage-settings select {
  max-width: 100%;
}

.tpm-manage-settings .button,
.tpm-manage-settings .button-primary,
.tpm-manage-settings .button-secondary {
  border-radius: 999px;
}

.tpm-me-head {
  margin-bottom: 0.5rem;
}

.tpm-me-head h1 {
  margin: 0.2rem 0 0;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.tpm-me-back {
  color: var(--tpm-accent-deep);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.tpm-me-back:hover {
  color: var(--tpm-accent);
}

.tpm-manage-notice {
  padding: 0.75rem 1rem;
  border-radius: var(--tpm-radius-sm);
  margin-bottom: 1rem;
  background: #fff8e5;
  border: 1px solid #f0e0b8;
}

.tpm-manage-notice--success {
  background: #edfaef;
  border-color: #b8e6c0;
  color: #1e7a32;
}

.tpm-manage-notice--warning {
  background: #fff8e5;
  border-color: #f0e0b8;
  color: #7a5c00;
}

.tpm-manage-notice--error {
  background: #fdecea;
  border-color: #f5c2c0;
  color: #b42318;
}

.tpm-manage-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1rem;
}

.tpm-manage-subnav__link {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--tpm-accent-deep);
  border: 1px solid var(--tpm-line);
  background: var(--tpm-sand);
}

.tpm-manage-subnav__link.is-active,
.tpm-manage-subnav__link:hover {
  background: var(--tpm-accent-soft);
  border-color: #e8cdb0;
}

.tpm-manage-table-wrap {
  overflow-x: auto;
}

.tpm-manage-table {
  width: 100%;
  border-collapse: collapse;
}

.tpm-manage-table th,
.tpm-manage-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--tpm-line);
}

.tpm-manage-table__actions {
  white-space: nowrap;
  text-align: right;
}

.tpm-manage-table__actions a {
  margin-left: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--tpm-accent-deep);
}

.tpm-me-delete {
  color: #b42318 !important;
}

/* ── Products list (compact premium datatable) ── */

.tpm-manage-panel--products {
  padding: 0.65rem 0.75rem 0.75rem;
}

.tpm-manage-panel--products .tpm-manage-panel__head .description {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
}

.tpm-plist__head {
  margin-bottom: 0.5rem !important;
  align-items: flex-start;
}

.tpm-plist__head-copy h1 {
  margin: 0 0 0.15rem;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.tpm-plist__head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.tpm-plist__count {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--tpm-muted);
  padding: 0.2rem 0.55rem;
  background: var(--tpm-sand);
  border: 1px solid var(--tpm-line);
  border-radius: 999px;
  white-space: nowrap;
}

.tpm-manage-panel--products .tpm-manage-subnav {
  margin-bottom: 0.45rem;
  gap: 4px;
}

.tpm-manage-panel--products .tpm-manage-subnav__link {
  padding: 0.22rem 0.55rem;
  font-size: 0.74rem;
  gap: 4px;
  display: inline-flex;
  align-items: center;
}

.tpm-plist__filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  padding: 0 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.4;
  border-radius: 999px;
  background: rgba(26, 43, 54, 0.07);
  color: var(--tpm-muted);
}

.tpm-manage-subnav__link.is-active .tpm-plist__filter-count {
  background: rgba(107, 68, 35, 0.12);
  color: var(--tpm-accent-deep);
}

.tpm-plist__table-wrap {
  margin: 0 -0.15rem;
  border: 1px solid var(--tpm-line);
  border-radius: 8px;
  overflow: auto;
  max-height: calc(100vh - 220px);
  background: var(--tpm-surface);
}

.tpm-plist__table {
  font-size: 0.78rem;
  line-height: 1.3;
}

.tpm-plist__table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.tpm-plist__table th {
  padding: 0.35rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tpm-muted);
  background: #f3f0ec;
  border-bottom: 1px solid var(--tpm-line);
  white-space: nowrap;
}

.tpm-plist__table td {
  padding: 0.3rem 0.45rem;
  border-bottom: 1px solid #ece8e3;
  vertical-align: middle;
}

.tpm-plist__row:last-child td {
  border-bottom: none;
}

.tpm-plist__row:hover td {
  background: #faf8f6;
}

.tpm-plist__col--id {
  width: 2rem;
  text-align: center;
}

.tpm-plist__col--thumb {
  width: 2.5rem;
}

.tpm-plist__col--product {
  min-width: 11rem;
}

.tpm-plist__col--internal-notes {
  min-width: 7.5rem;
  max-width: 10rem;
}

.tpm-plist__col--region {
  min-width: 5.5rem;
}

.tpm-plist__col--category {
  min-width: 5rem;
}

.tpm-plist__col--duration {
  width: 4.5rem;
  white-space: nowrap;
}

.tpm-plist__col--price {
  width: 5.5rem;
  white-space: nowrap;
}

.tpm-plist__col--status {
  width: 5rem;
}

.tpm-plist__col--updated {
  width: 6.5rem;
  white-space: nowrap;
}

.tpm-plist__col--actions {
  width: 1%;
}

.tpm-plist__id {
  font-size: 0.68rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #9aa8b2;
}

.tpm-plist__thumb {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--tpm-sand);
  border: 1px solid var(--tpm-line);
}

.tpm-plist__thumb-img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

.tpm-plist__thumb-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #ece8e3 0%, #f7f5f2 100%);
}

.tpm-plist__title {
  display: block;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--tpm-ink);
  text-decoration: none;
  line-height: 1.25;
  margin-bottom: 1px;
}

.tpm-plist__title:hover {
  color: var(--tpm-accent);
}

.tpm-plist__slug {
  display: block;
  font-size: 0.66rem;
  color: #9aa8b2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 16rem;
}

.tpm-plist__excerpt {
  display: none;
  margin: 0;
}

.tpm-plist__region,
.tpm-plist__category,
.tpm-plist__duration {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 10rem;
  color: var(--tpm-ink);
}

.tpm-plist__region {
  font-weight: 600;
  color: var(--tpm-accent-deep);
}

.tpm-plist__duration {
  font-size: 0.74rem;
  color: var(--tpm-muted);
}

.tpm-plist__price {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--tpm-ink);
}

.tpm-plist__badge {
  display: inline-block;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  background: #eef1f3;
  color: #5a6b76;
}

.tpm-plist__badge--publish {
  background: #e6f4ea;
  color: #1e7a32;
}

.tpm-plist__badge--draft,
.tpm-plist__badge--auto-draft {
  background: #f3f0ec;
  color: #6d7f8c;
}

.tpm-plist__badge--pending {
  background: #fff4e0;
  color: #9a6700;
}

.tpm-plist__badge--private {
  background: #ede8ff;
  color: #5b4db8;
}

.tpm-plist__updated {
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  color: var(--tpm-muted);
}

.tpm-plist__actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  justify-content: flex-end;
}

.tpm-plist__action {
  padding: 0.15rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 650;
  text-decoration: none;
  color: var(--tpm-accent-deep);
  border-radius: 4px;
  white-space: nowrap;
}

.tpm-plist__action:hover {
  background: var(--tpm-accent-soft);
  color: var(--tpm-accent);
}

.tpm-plist__action--danger {
  color: #b42318;
}

.tpm-plist__action--danger:hover {
  background: #fdecea;
  color: #912018;
}

.tpm-plist__empty {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
}

.tpm-plist__inline-hint {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  color: var(--tpm-muted);
}

/* Inline edit cells in products list */
.tpm-plist__table .tpm-meta-inline {
  display: block;
  max-width: 100%;
}

.tpm-plist__table .tpm-meta-inline__text {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0.1rem 0.2rem;
  margin: -0.1rem -0.2rem;
  border-radius: 4px;
  border: 1px dashed transparent;
  cursor: pointer;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  line-height: 1.35;
  transition: border-color 0.12s, background 0.12s;
}

.tpm-plist__table .tpm-meta-inline__text:hover,
.tpm-plist__table .tpm-meta-inline__text:focus {
  border-color: #d4a574;
  background: var(--tpm-accent-soft);
  outline: none;
}

.tpm-plist__table .tpm-meta-inline--title .tpm-meta-inline__text {
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--tpm-ink);
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tpm-plist__table .tpm-meta-inline--region .tpm-meta-inline__text {
  font-weight: 600;
  color: var(--tpm-accent-deep);
}

.tpm-plist__table .tpm-meta-inline--categories .tpm-meta-inline__text {
  font-size: 0.72rem;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tpm-plist__table .tpm-meta-inline--internal-notes .tpm-meta-inline__text {
  font-size: 0.72rem;
  color: #6d7f8c;
  font-style: italic;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tpm-plist__table .tpm-meta-inline--internal-notes .tpm-meta-inline__text:hover,
.tpm-plist__table .tpm-meta-inline--internal-notes .tpm-meta-inline__text:focus {
  color: var(--tpm-accent-deep);
  font-style: normal;
}

.tpm-categories-modal__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(50vh, 320px);
  overflow-y: auto;
  margin-bottom: 10px;
  padding: 2px;
}

.tpm-categories-modal__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--tpm-line, #e2ddd6);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  background: #fff;
}

.tpm-categories-modal__item:hover {
  background: var(--tpm-accent-soft, #faf0e6);
  border-color: #d4a574;
}

.tpm-categories-modal__item input {
  margin: 0;
  flex-shrink: 0;
}

.tpm-categories-modal__empty {
  margin: 0;
  font-size: 0.82rem;
  color: var(--tpm-muted, #6d7f8c);
}

.tpm-region-picker,
.tpm-region-modal__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(42vh, 220px);
  overflow-y: auto;
  margin: 0;
  padding: 2px;
}

.tpm-region-picker__item,
.tpm-region-modal__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--tpm-line, #e2ddd6);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  background: #fff;
}

.tpm-region-picker__item:hover,
.tpm-region-modal__item:hover {
  background: var(--tpm-accent-soft, #faf0e6);
  border-color: #d4a574;
}

.tpm-region-picker__item input,
.tpm-region-modal__item input {
  margin: 0;
  flex-shrink: 0;
}

.tpm-region-modal__empty {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--tpm-muted, #6d7f8c);
}

.tpm-pe-form .tpm-pinfo__block--region .tpm-region-picker {
  max-height: min(36vh, 190px);
}

.tpm-plist__table .tpm-meta-inline--region .tpm-meta-inline__text {
  white-space: normal;
  line-height: 1.35;
}

.tpm-plist__table .tpm-meta-inline--duration .tpm-meta-inline__text {
  color: var(--tpm-muted);
  font-size: 0.74rem;
}

.tpm-plist__table .tpm-meta-inline--price .tpm-meta-inline__text {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tpm-plist__table .tpm-meta-inline--status .tpm-meta-inline__text {
  display: inline-block;
  white-space: nowrap;
  padding: 0.12rem 0.4rem;
  border: none;
  font-size: 0.66rem;
  font-weight: 700;
}

.tpm-plist__table .tpm-meta-inline--status .tpm-meta-inline__text:hover,
.tpm-plist__table .tpm-meta-inline--status .tpm-meta-inline__text:focus {
  filter: brightness(0.97);
}

.tpm-plist__table .tpm-meta-inline__input {
  width: 100%;
  max-width: 100%;
  padding: 0.2rem 0.35rem;
  font-size: 0.74rem;
  border: 1px solid #d4a574;
  border-radius: 4px;
  box-shadow: 0 0 0 2px rgba(196, 122, 44, 0.12);
}

.tpm-plist__table .tpm-meta-inline.is-saving {
  opacity: 0.55;
  pointer-events: none;
}

.tpm-plist__table .tpm-meta-inline.is-saved .tpm-meta-inline__text {
  animation: tpm-inline-pulse 0.6s ease;
}

@media (max-width: 1024px) {
  .tpm-plist__col--duration,
  .tpm-plist__cell--duration {
    display: none;
  }
}

@media (max-width: 900px) {
  .tpm-plist__head {
    flex-direction: column;
    gap: 8px;
  }

  .tpm-plist__head-actions {
    width: 100%;
    justify-content: space-between;
  }

  .tpm-plist__table-wrap {
    max-height: none;
  }

  .tpm-plist__col--category,
  .tpm-plist__cell--category,
  .tpm-plist__col--updated,
  .tpm-plist__cell--updated {
    display: none;
  }
}

.tpm-manage-metabox {
  margin: 1.25rem 0;
  padding: 1rem 1.1rem;
  background: var(--tpm-sand);
  border: 1px solid var(--tpm-line);
  border-radius: var(--tpm-radius-sm);
}

.tpm-manage-metabox h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.tpm-manage-metabox--core {
  background: var(--tpm-surface);
}

/* ── Product edit form (compact premium) ── */

.tpm-manage-panel.tpm-manage-edit {
  padding: 0.55rem 0.7rem 0.7rem;
}

.tpm-pe-form .tpm-manage-metabox,
.tpm-pe-form .tpm-pe-section {
  margin: 0 0 0.45rem;
  padding: 0.55rem 0.65rem 0.6rem;
  background: var(--tpm-surface);
  border: 1px solid var(--tpm-line);
  border-radius: 8px;
}

.tpm-pe-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 0.45rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #ece8e3;
}

.tpm-pe-section__head h2 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tpm-muted);
}

.tpm-pe-grid {
  display: grid;
  gap: 0.45rem 0.65rem;
}

.tpm-pe-grid--core {
  grid-template-columns: minmax(0, 1fr) 200px;
  grid-template-areas:
    "title title"
    "status thumb"
    "categories categories"
    "editor editor"
    "excerpt excerpt";
}

.tpm-pe-field--title { grid-area: title; }
.tpm-pe-field--status { grid-area: status; }
.tpm-pe-field--thumb { grid-area: thumb; }
.tpm-pe-field--categories { grid-area: categories; }
.tpm-pe-field--editor { grid-area: editor; }
.tpm-pe-field--excerpt { grid-area: excerpt; }

.tpm-pe-label {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tpm-muted);
}

.tpm-pe-field__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  margin-bottom: 0.2rem;
}

.tpm-pe-field__label-row .tpm-pe-label {
  margin-bottom: 0;
}

.tpm-pe-ai-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.34rem !important;
  min-height: 1.9rem !important;
  padding: 0.22rem 0.68rem 0.22rem 0.34rem !important;
  border-radius: 999px !important;
  font-size: 0.68rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.01em !important;
  color: #173c8f !important;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, rgba(37, 99, 235, 0.46), rgba(124, 58, 237, 0.42), rgba(196, 122, 44, 0.36)) border-box !important;
  border: 1px solid transparent !important;
  box-shadow:
    0 8px 18px rgba(37, 99, 235, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
  text-shadow: none !important;
}

.tpm-pe-ai-button:hover,
.tpm-pe-ai-button:focus {
  color: #fff !important;
  background: linear-gradient(135deg, #2563eb, #7c3aed) !important;
  border-color: transparent !important;
  box-shadow:
    0 10px 22px rgba(37, 99, 235, 0.18),
    0 0 0 3px rgba(124, 58, 237, 0.10) !important;
}

.tpm-pe-ai-button__icon {
  display: inline-grid;
  place-items: center;
  width: 1.28rem;
  height: 1.28rem;
  border-radius: 999px;
  color: #fff;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.58), transparent 33%),
    linear-gradient(135deg, #7c3aed, #2563eb 52%, var(--tpm-accent));
  font-size: 0.78rem;
  line-height: 1;
  box-shadow: 0 5px 12px rgba(37, 99, 235, 0.18);
}

.tpm-pe-ai-button:hover .tpm-pe-ai-button__icon,
.tpm-pe-ai-button:focus .tpm-pe-ai-button__icon {
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.tpm-pe-input {
  display: block;
  width: 100%;
  padding: 0.35rem 0.5rem;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--tpm-ink);
  background: #fff;
  border: 1px solid var(--tpm-line);
  border-radius: 6px;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tpm-pe-input:focus {
  outline: none;
  border-color: #d4a574;
  box-shadow: 0 0 0 2px rgba(196, 122, 44, 0.15);
}

.tpm-pe-input--title {
  font-size: 0.92rem;
  font-weight: 650;
  padding: 0.4rem 0.55rem;
}

.tpm-pe-input--select {
  padding-right: 1.5rem;
  cursor: pointer;
}

.tpm-pe-hint {
  margin: 0.25rem 0 0;
  font-size: 0.68rem;
  color: var(--tpm-muted);
  line-height: 1.35;
}

.tpm-pe-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tpm-pe-chip {
  display: inline-flex;
  align-items: center;
  margin: 0;
  cursor: pointer;
}

.tpm-pe-chip input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tpm-pe-chip span {
  display: inline-block;
  padding: 0.18rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--tpm-accent-deep);
  background: var(--tpm-sand);
  border: 1px solid var(--tpm-line);
  border-radius: 999px;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.tpm-pe-chip:hover span {
  border-color: #d4a574;
  background: var(--tpm-accent-soft);
}

.tpm-pe-chip:has(input:checked) span {
  color: #fff;
  background: var(--tpm-accent);
  border-color: var(--tpm-accent);
}

.tpm-pe-thumb {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.tpm-pe-thumb__preview {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--tpm-sand);
  border: 1px dashed var(--tpm-line);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tpm-pe-thumb__preview:empty::after {
  content: "";
  width: 24px;
  height: 24px;
  opacity: 0.35;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236d7f8c' stroke-width='1.5'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='8.5' cy='10' r='1.5'/%3E%3Cpath d='M21 16l-5.5-5.5a1 1 0 0 0-1.4 0L9 16'/%3E%3C/svg%3E");
}

.tpm-pe-thumb__preview img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: cover;
  border-radius: 0;
}

.tpm-pe-thumb__actions {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.tpm-pe-btn {
  padding: 0.22rem 0.45rem !important;
  font-size: 0.68rem !important;
  font-weight: 650 !important;
  line-height: 1.3 !important;
  height: auto !important;
  min-height: 0 !important;
  border-radius: 5px !important;
  border: 1px solid var(--tpm-line) !important;
  background: #fff !important;
  color: var(--tpm-accent-deep) !important;
  box-shadow: none !important;
}

.tpm-pe-btn:hover {
  background: var(--tpm-accent-soft) !important;
  border-color: #d4a574 !important;
  color: var(--tpm-accent) !important;
}

.tpm-pe-btn--danger {
  color: #b42318 !important;
}

.tpm-pe-btn--danger:hover {
  background: #fdecea !important;
  border-color: #f5c2c0 !important;
  color: #912018 !important;
}

.tpm-pe-editor .wp-editor-wrap {
  border: 1px solid var(--tpm-line);
  border-radius: 6px;
  overflow: hidden;
}

.tpm-pe-editor .wp-editor-tools {
  padding: 2px 4px;
  background: #f7f5f2;
  border-bottom: 1px solid var(--tpm-line);
}

.tpm-pe-editor .wp-editor-tabs {
  float: none;
  display: flex;
  gap: 2px;
}

.tpm-pe-editor .wp-switch-editor {
  padding: 2px 8px !important;
  font-size: 0.68rem !important;
  height: auto !important;
  line-height: 1.4 !important;
  border-radius: 4px !important;
  margin: 0 !important;
}

.tpm-pe-editor .mce-toolbar-grp,
.tpm-pe-editor .quicktags-toolbar {
  padding: 2px 4px !important;
  min-height: 0 !important;
}

.tpm-pe-editor .mce-btn button,
.tpm-pe-editor .quicktags-toolbar input.button.button-small {
  padding: 2px 5px !important;
  font-size: 0.68rem !important;
  min-height: 0 !important;
  height: auto !important;
}

.tpm-pe-editor .wp-editor-container {
  border: none !important;
}

.tpm-pe-editor .wp-editor-area {
  font-size: 0.8rem !important;
  line-height: 1.45 !important;
  padding: 0.45rem 0.55rem !important;
  min-height: 140px !important;
}

.tpm-pe-editor .mce-edit-area iframe {
  min-height: 140px !important;
}

.tpm-pe-form-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 0.5rem;
  padding: 0.45rem 0.55rem;
  background: #f7f5f2;
  border: 1px solid var(--tpm-line);
  border-radius: 8px;
  position: sticky;
  bottom: 0.35rem;
  z-index: 5;
}

.tpm-pe-form-bar__view {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--tpm-muted);
  text-decoration: none;
}

.tpm-pe-form-bar__view:hover {
  color: var(--tpm-accent);
}

/* Compact legacy form-table inside product edit sections */
.tpm-pe-form .tpm-pinfo {
    display: grid;
    gap: 0.85rem;
}

.tpm-pe-form .tpm-pinfo__block {
    padding: 0.75rem 0;
    border-top: 1px solid #ece8e3;
}

.tpm-pe-form .tpm-pinfo__block:first-child {
    border-top: 0;
    padding-top: 0;
}

.tpm-pe-form .tpm-pinfo__price-grid {
    display: grid;
    gap: 0.65rem;
}

.tpm-pe-form .tpm-pinfo__field-label,
.tpm-pe-form .tpm-pinfo__block-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #64748b;
}

.tpm-pe-form .tpm-pinfo__price-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.15rem;
    font-size: 0.76rem;
    font-weight: 650;
    color: #334155;
}

.tpm-pe-form .tpm-pinfo__input,
.tpm-pe-form .tpm-pinfo__price-row .widefat {
    max-width: 18rem;
}

.tpm-pe-form .tpm-metabox-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.tpm-pe-form .tpm-metabox-table th {
  width: 118px;
  padding: 0.3rem 0.45rem 0.3rem 0;
  vertical-align: top;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--tpm-muted);
  line-height: 1.35;
}

.tpm-pe-form .tpm-metabox-table td {
  padding: 0.25rem 0 0.35rem;
  vertical-align: top;
  font-size: 0.8rem;
}

.tpm-pe-form .tpm-metabox-table tr:last-child th,
.tpm-pe-form .tpm-metabox-table tr:last-child td {
  padding-bottom: 0;
}

.tpm-pe-form .tpm-metabox-table .widefat,
.tpm-pe-form .tpm-metabox-table .regular-text,
.tpm-pe-form .tpm-metabox-table .large-text,
.tpm-pe-form .tpm-metabox-table select,
.tpm-pe-form .tpm-metabox-table textarea,
.tpm-pe-form .tpm-pe-input {
  font-size: 0.8rem;
  padding: 0.32rem 0.48rem;
  border-radius: 6px;
  border: 1px solid var(--tpm-line);
}

.tpm-pe-form .tpm-metabox-table .description,
.tpm-pe-form .description {
  margin: 0.2rem 0 0;
  font-size: 0.68rem;
  color: var(--tpm-muted);
  line-height: 1.35;
}

.tpm-pe-form .button,
.tpm-pe-form .button-secondary {
  padding: 0.28rem 0.55rem !important;
  font-size: 0.72rem !important;
  height: auto !important;
  min-height: 0 !important;
  line-height: 1.35 !important;
  border-radius: 6px !important;
}

.tpm-pe-form .button-primary {
  border-radius: 6px !important;
}

.tpm-pe-form fieldset label {
  font-size: 0.78rem;
  margin-bottom: 0.25rem !important;
}

.tpm-pe-form .tpm-price-tier-table {
  font-size: 0.75rem;
}

.tpm-pe-form .tpm-price-tier-table th,
.tpm-pe-form .tpm-price-tier-table td {
  padding: 0.25rem 0.35rem;
}

/* Repeater rows (Highlights, Includes, …) — single-line premium */
.tpm-pe-form .tpm-repeater__list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.tpm-pe-form .tpm-repeater__row {
  padding: 0.25rem 0.32rem;
  background: #fff;
  border-color: var(--tpm-line, #e2ddd6);
  box-shadow: 0 1px 2px rgba(14, 31, 41, 0.03);
}

.tpm-pe-form .tpm-repeater__row .tpm-repeater__input {
  padding: 0.32rem 0.45rem;
  font-size: 0.8rem;
  border: 1px solid var(--tpm-line, #e2ddd6);
  border-radius: 5px;
  background: #fff;
}

.tpm-pe-form .tpm-repeater__row .tpm-repeater__input:focus {
  outline: none;
  border-color: #d4a574;
  box-shadow: 0 0 0 2px rgba(196, 122, 44, 0.12);
}

.tpm-pe-form .tpm-repeater__row-ai .button-small {
  padding: 0.2rem 0.42rem !important;
  font-size: 0.66rem !important;
  font-weight: 650 !important;
  color: var(--tpm-accent-deep, #9a5a1a) !important;
  background: var(--tpm-sand, #f7f5f2) !important;
  border: 1px solid var(--tpm-line, #e2ddd6) !important;
  box-shadow: none !important;
}

.tpm-pe-form .tpm-repeater__row-ai .button-small:hover,
.tpm-pe-form .tpm-repeater__row-ai .button-small:focus {
  background: var(--tpm-accent-soft, #faf0e6) !important;
  border-color: #d4a574 !important;
  color: var(--tpm-accent, #c47a2c) !important;
}

.tpm-pe-form .tpm-repeater__row .tpm-repeater__remove {
  color: #b42318 !important;
  background: #fff !important;
  border: 1px solid #ece8e3 !important;
  box-shadow: none !important;
}

.tpm-pe-form .tpm-repeater__row .tpm-repeater__remove:hover {
  background: #fdecea !important;
  border-color: #f5c2c0 !important;
}

.tpm-pe-form .tpm-repeater__spell-note {
  flex: 1 0 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.28rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid #f0d5a8;
  border-radius: 7px;
  background: #fff8ec;
  color: #5f3b11;
  font-size: 0.76rem;
  line-height: 1.4;
}

.tpm-pe-form .tpm-repeater__spell-note-text {
  white-space: pre-wrap;
}

.tpm-pe-form .tpm-repeater__spell-apply {
  flex: 0 0 auto;
}

/* Other Information & FAQ */
.tpm-pe-form .tpm-other-faq {
  display: grid;
  gap: 0.55rem;
}

.tpm-pe-form .tpm-other-faq__intro {
  margin: 0 !important;
  padding: 0.42rem 0.55rem;
  border: 1px solid rgba(226, 221, 214, 0.86);
  border-radius: 9px;
  background: rgba(247, 245, 242, 0.72);
}

.tpm-pe-form .tpm-other-faq__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  align-items: start;
}

.tpm-pe-form .tpm-other-faq__card {
  min-width: 0;
  padding: 0.58rem;
  border: 1px solid rgba(226, 221, 214, 0.92);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff 0%, #fbfaf8 100%);
}

.tpm-pe-form .tpm-other-faq__card--faq {
  background:
    radial-gradient(circle at 100% 0, rgba(196, 122, 44, 0.055), transparent 14rem),
    #fff;
}

.tpm-pe-form .tpm-other-faq__card--notes {
  background:
    radial-gradient(circle at 0 100%, rgba(37, 99, 235, 0.045), transparent 13rem),
    #fff;
}

.tpm-pe-form .tpm-other-faq__title {
  display: block;
  margin: 0 0 0.4rem;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #132b3a;
}

.tpm-pe-form .tpm-other-faq__card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  margin-bottom: 0.45rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(226, 221, 214, 0.78);
}

.tpm-pe-form .tpm-other-faq__card-head .tpm-other-faq__title {
  margin: 0;
}

.tpm-pe-form .tpm-other-faq__card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.tpm-pe-form .tpm-faq-generate__status {
  margin: 0 0 0.65rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  font-size: 0.75rem;
  line-height: 1.45;
}

.tpm-pe-form .tpm-faq-generate__status--ok {
  color: #1f5f45;
  background: rgba(34, 120, 84, 0.1);
  border: 1px solid rgba(34, 120, 84, 0.18);
}

.tpm-pe-form .tpm-faq-generate__status--error {
  color: #8b2f2f;
  background: rgba(180, 60, 60, 0.08);
  border: 1px solid rgba(180, 60, 60, 0.18);
}

.tpm-pe-form .tpm-other-faq__textarea {
  width: 100%;
  min-height: 8rem;
  max-height: 16rem;
  resize: vertical;
}

.tpm-pe-form .tpm-other-info-repeater__hidden {
  display: none;
}

.tpm-pe-form .tpm-other-info-repeater__list {
  display: grid;
  gap: 0.45rem;
}

.tpm-pe-form .tpm-other-info-repeater__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.45rem;
  border: 1px solid rgba(226, 221, 214, 0.88);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
}

.tpm-pe-form .tpm-other-info-repeater__input {
  width: 100%;
  min-height: 4.3rem;
  resize: vertical;
  box-sizing: border-box;
}

.tpm-pe-form .tpm-other-info-repeater__remove {
  min-height: 1.85rem !important;
  padding-inline: 0.55rem !important;
  white-space: nowrap;
  color: #b42318 !important;
  background: #fff !important;
  border-color: #f0d2cf !important;
  box-shadow: 0 4px 12px rgba(180, 35, 24, 0.06) !important;
}

.tpm-pe-form .tpm-other-info-repeater__remove:hover {
  background: #fff5f4 !important;
  border-color: #efaaa5 !important;
}

.tpm-pe-form .tpm-faq-repeater__list {
  display: grid;
  gap: 0.45rem;
}

.tpm-pe-form .tpm-faq-repeater__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.36rem 0.5rem;
  align-items: start;
  padding: 0.45rem;
  border: 1px solid rgba(226, 221, 214, 0.88);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
}

.tpm-pe-form .tpm-faq-repeater__q,
.tpm-pe-form .tpm-faq-repeater__a,
.tpm-pe-form .tpm-faq-repeater__actions {
  margin: 0;
}

.tpm-pe-form .tpm-faq-repeater__q,
.tpm-pe-form .tpm-faq-repeater__a {
  grid-column: 1;
  min-width: 0;
}

.tpm-pe-form .tpm-faq-repeater__q label,
.tpm-pe-form .tpm-faq-repeater__a label {
  display: block;
}

.tpm-pe-form .tpm-faq-repeater__q input,
.tpm-pe-form .tpm-faq-repeater__a textarea {
  width: 100%;
  box-sizing: border-box;
}

.tpm-pe-form .tpm-faq-repeater__q input {
  min-height: 1.9rem;
}

.tpm-pe-form .tpm-faq-repeater__a textarea {
  min-height: 3.2rem;
  resize: vertical;
}

.tpm-pe-form .tpm-faq-repeater__actions {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  justify-content: flex-end;
  align-self: center;
}

.tpm-pe-form .tpm-faq-repeater__remove {
  min-height: 1.85rem !important;
  padding-inline: 0.55rem !important;
  white-space: nowrap;
  color: #b42318 !important;
  background: #fff !important;
  border-color: #f0d2cf !important;
  box-shadow: 0 4px 12px rgba(180, 35, 24, 0.06) !important;
}

.tpm-pe-form .tpm-faq-repeater__remove:hover {
  background: #fff5f4 !important;
  border-color: #efaaa5 !important;
}

.tpm-pe-form .tpm-repeater-add {
  margin-top: 0.15rem !important;
  padding: 0.24rem 0.52rem !important;
  font-size: 0.72rem !important;
  font-weight: 650 !important;
  height: auto !important;
  min-height: 0 !important;
  line-height: 1.3 !important;
  border-radius: 6px !important;
}

.tpm-pe-form .tpm-repeater > p {
  margin: 0.35rem 0 0;
}

@media (max-width: 720px) {
  .tpm-pe-form .tpm-repeater__row-main {
    flex-wrap: wrap;
  }

  .tpm-pe-form .tpm-repeater__row .tpm-repeater__input {
    flex: 1 1 100%;
  }

  .tpm-pe-form .tpm-repeater__row-ai {
    flex: 1 1 auto;
  }

  .tpm-pe-form .tpm-other-faq__grid,
  .tpm-pe-form .tpm-other-info-repeater__row,
  .tpm-pe-form .tpm-faq-repeater__row {
    grid-template-columns: 1fr;
  }

  .tpm-pe-form .tpm-other-faq__card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .tpm-pe-form .tpm-other-faq__card-head .tpm-faq-repeater__add {
    width: 100%;
  }

  .tpm-pe-form .tpm-faq-repeater__actions {
    justify-content: stretch;
  }

  .tpm-pe-form .tpm-faq-repeater__remove {
    width: 100%;
  }

  .tpm-pe-form .tpm-other-info-repeater__remove {
    width: 100%;
  }
}

.tpm-manage-form-submit {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--tpm-line);
}

.tpm-manage .tpm-btn--lg {
  padding: 0.75rem 1.35rem;
  font-size: 1rem;
}

.tpm-manage-categories-multi {
  min-height: 6.5rem;
  padding: 6px 8px;
}

.tpm-manage-categories-multi option {
  padding: 4px 6px;
}

.tpm-manage-product-form .description {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--tpm-muted, #6b6560);
}

.tpm-manage-thumb-preview img {
  max-height: 120px;
  width: auto;
  border-radius: 8px;
}

.tpm-manage-product-form .tpm-metabox-table,
.tpm-manage-category-form .tpm-metabox-table {
  background: transparent;
}

.tpm-manage-product-form .inside,
.tpm-manage-metabox .inside {
  margin: 0;
  padding: 0;
}

.tpm-manage-settings hr {
  margin: 1.5rem 0;
  border: 0;
  border-top: 1px solid var(--tpm-line);
}

.tpm-smtp-manage .description {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  color: var(--tpm-muted);
}

.tpm-smtp-manage .form-table th {
  width: 150px;
  padding: 0.35rem 0.5rem 0.35rem 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--tpm-muted);
  vertical-align: top;
}

.tpm-smtp-manage .form-table td {
  padding: 0.3rem 0 0.4rem;
  vertical-align: top;
}

.tpm-smtp-manage .regular-text,
.tpm-smtp-manage .widefat,
.tpm-smtp-manage select {
  font-size: 0.82rem;
  padding: 0.32rem 0.48rem;
  border-radius: 6px;
  border: 1px solid var(--tpm-line);
  max-width: 100%;
}

.tpm-smtp-advanced__title,
.tpm-smtp-test__title {
  margin: 0 0 0.45rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--tpm-ink);
}

.tpm-smtp-divider {
  margin: 1rem 0;
  border: 0;
  border-top: 1px solid var(--tpm-line);
}

.tpm-smtp-settings-form__actions,
.tpm-smtp-test-form__actions {
  margin: 0.5rem 0 0;
}

.tpm-manage-settings .widefat.striped {
  max-width: 100%;
}

@media (max-width: 900px) {
  .tpm-pe-grid--core {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "status"
      "thumb"
      "categories"
      "editor"
      "excerpt";
  }

  .tpm-pe-thumb {
    flex-direction: row;
    align-items: center;
  }

  .tpm-pe-form .tpm-metabox-table th {
    display: table-cell;
    width: 96px;
    padding-bottom: 0.2rem;
  }

  .tpm-pe-form .tpm-metabox-table td {
    display: table-cell;
    padding-bottom: 0.35rem;
  }

  .tpm-manage-settings .form-table th {
    display: block;
    width: auto;
    padding-bottom: 4px;
  }

  .tpm-manage-settings .form-table td {
    display: block;
    padding-bottom: 12px;
  }
}

/* ── RamayaAPI usage (compact premium) ── */

.tpm-usage {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-width: none;
  padding: 0;
  margin: 0;
}

.tpm-manage-panel.tpm-manage-edit .tpm-usage {
  gap: 0.4rem;
}

.tpm-usage__balance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.4rem;
}

.tpm-usage-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.45rem 0.55rem;
  background: var(--tpm-surface, #fff);
  border: 1px solid var(--tpm-line, #e2ddd6);
  border-radius: 8px;
}

.tpm-usage-stat--primary {
  border-color: #d4a574;
  background: linear-gradient(135deg, #fffaf5 0%, #fff 100%);
}

.tpm-usage-stat__label {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--tpm-muted, #6d7f8c);
}

.tpm-usage-stat__value {
  font-size: 1.05rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: var(--tpm-ink, #1a2b33);
  line-height: 1.2;
}

.tpm-usage-stat--primary .tpm-usage-stat__value {
  color: var(--tpm-accent, #c47a2c);
}

.tpm-usage .tpm-manage-notice {
  margin-bottom: 0;
  padding: 0.4rem 0.55rem;
  font-size: 0.78rem;
}

.tpm-usage__notices {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tpm-usage__notices p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
}

.tpm-usage__notices .tpm-usage-btn {
  margin-top: 0.35rem;
}

.tpm-usage-filter {
  padding: 0.45rem 0.55rem;
  background: var(--tpm-surface, #fff);
  border: 1px solid var(--tpm-line, #e2ddd6);
  border-radius: 8px;
}

.tpm-usage-filter__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.45rem 0.65rem;
}

.tpm-usage-filter__presets {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tpm-usage-filter__preset {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 650;
  line-height: 1.3;
  text-decoration: none;
  color: var(--tpm-accent-deep, #9a5a1a);
  background: var(--tpm-sand, #f7f5f2);
  border: 1px solid var(--tpm-line, #e2ddd6);
  border-radius: 999px;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.tpm-usage-filter__preset:hover {
  background: var(--tpm-accent-soft, #faf0e6);
  border-color: #d4a574;
  color: var(--tpm-accent, #c47a2c);
}

.tpm-usage-filter__preset.is-active {
  color: #fff;
  background: var(--tpm-accent, #c47a2c);
  border-color: var(--tpm-accent, #c47a2c);
}

.tpm-usage-filter__dates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
  flex: 1 1 auto;
}

.tpm-usage-filter__field {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.tpm-usage-filter__label {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tpm-muted, #6d7f8c);
}

.tpm-usage-filter__input {
  padding: 0.28rem 0.42rem;
  font-size: 0.76rem;
  line-height: 1.3;
  color: var(--tpm-ink, #1a2b33);
  background: #fff;
  border: 1px solid var(--tpm-line, #e2ddd6);
  border-radius: 6px;
  min-width: 8.5rem;
}

.tpm-usage-filter__input:focus {
  outline: none;
  border-color: #d4a574;
  box-shadow: 0 0 0 2px rgba(196, 122, 44, 0.12);
}

.tpm-usage-filter__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tpm-usage-filter__hint {
  margin: 0.35rem 0 0;
  font-size: 0.66rem;
  color: var(--tpm-muted, #6d7f8c);
  line-height: 1.35;
}

.tpm-usage-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.24rem 0.52rem;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.3;
  text-decoration: none;
  color: var(--tpm-accent-deep, #9a5a1a);
  background: #fff;
  border: 1px solid var(--tpm-line, #e2ddd6);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.tpm-usage-btn:hover {
  background: var(--tpm-accent-soft, #faf0e6);
  border-color: #d4a574;
  color: var(--tpm-accent, #c47a2c);
}

.tpm-usage-btn--primary {
  color: #fff;
  background: var(--tpm-accent, #c47a2c);
  border-color: var(--tpm-accent, #c47a2c);
}

.tpm-usage-btn--primary:hover {
  color: #fff;
  background: var(--tpm-accent-deep, #9a5a1a);
  border-color: var(--tpm-accent-deep, #9a5a1a);
}

.tpm-usage-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.4rem 0.5rem;
  background: #f7f5f2;
  border: 1px solid var(--tpm-line, #e2ddd6);
  border-radius: 8px;
  border-left: 3px solid var(--tpm-accent, #c47a2c);
}

.tpm-usage-summary__item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.tpm-usage-summary__item--accent .tpm-usage-summary__value {
  color: var(--tpm-accent, #c47a2c);
}

.tpm-usage-summary__label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tpm-muted, #6d7f8c);
}

.tpm-usage-summary__value {
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--tpm-ink, #1a2b33);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tpm-usage-history__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 0.5rem;
  margin-bottom: 0.3rem;
}

.tpm-usage-history__title {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tpm-muted, #6d7f8c);
}

.tpm-usage-history__meta {
  font-size: 0.66rem;
  color: var(--tpm-muted, #6d7f8c);
}

.tpm-usage-table-wrap {
  overflow: auto;
  max-height: min(70vh, 640px);
  border: 1px solid var(--tpm-line, #e2ddd6);
  border-radius: 8px;
  background: var(--tpm-surface, #fff);
}

.tpm-usage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
}

.tpm-usage-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7f5f2;
}

.tpm-usage-table th {
  padding: 0.32rem 0.45rem;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  color: var(--tpm-muted, #6d7f8c);
  border-bottom: 1px solid var(--tpm-line, #e2ddd6);
  white-space: nowrap;
}

.tpm-usage-table td {
  padding: 0.28rem 0.45rem;
  vertical-align: top;
  border-bottom: 1px solid #ece8e3;
  color: var(--tpm-ink, #1a2b33);
}

.tpm-usage-table tbody tr:last-child td {
  border-bottom: none;
}

.tpm-usage-table tbody tr:hover td {
  background: #faf8f6;
}

.tpm-usage-table th.tpm-usage-table__col--num,
.tpm-usage-table td.tpm-usage-table__col--num {
  text-align: left;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tpm-usage-table__time {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--tpm-muted, #6d7f8c);
  font-size: 0.72rem;
}

.tpm-usage-table__model {
  display: inline-block;
  padding: 0.08rem 0.3rem;
  font-size: 0.68rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #f3f0ec;
  border-radius: 4px;
  color: #4a5c68;
}

.tpm-usage-table__msg {
  margin-top: 0.15rem;
  font-size: 0.68rem;
  color: var(--tpm-muted, #6d7f8c);
  max-width: 28rem;
  word-break: break-word;
  line-height: 1.35;
}

.tpm-usage-result {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.3;
  border-radius: 999px;
  background: #eef1f3;
  color: #5a6b76;
}

.tpm-usage-result--success {
  background: #e6f4ea;
  color: #1e7a32;
}

.tpm-usage-result--error,
.tpm-usage-result--failed {
  background: #fdecea;
  color: #b42318;
}

@media (max-width: 900px) {
  .tpm-usage-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tpm-usage-filter__row {
    flex-direction: column;
    align-items: stretch;
  }

  .tpm-usage-filter__actions {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .tpm-usage-summary {
    grid-template-columns: 1fr;
  }

  .tpm-usage-table-wrap {
    max-height: none;
  }
}

/* ── RamayaAPI settings (compact premium) ── */

.tpm-ra-settings {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-width: none;
  padding: 0;
  margin: 0;
}

.tpm-manage-panel.tpm-manage-edit .tpm-ra-settings {
  gap: 0.4rem;
}

.tpm-ra-settings__lead {
  margin: 0 0 0.15rem;
  font-size: 0.76rem;
  line-height: 1.4;
  color: var(--tpm-muted, #6d7f8c);
}

.tpm-ra-settings .tpm-manage-notice {
  margin: 0 0 0.15rem;
  padding: 0.4rem 0.55rem;
  font-size: 0.78rem;
}

.tpm-ra-section {
  padding: 0.55rem 0.65rem 0.6rem;
  background: var(--tpm-surface, #fff);
  border: 1px solid var(--tpm-line, #e2ddd6);
  border-radius: 8px;
}

.tpm-ra-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 0.65rem;
}

.tpm-ra-field {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
}

.tpm-ra-field--full {
  grid-column: 1 / -1;
}

.tpm-ra-field--toggle {
  padding-bottom: 0.15rem;
  border-bottom: 1px solid #ece8e3;
  margin-bottom: 0.1rem;
}

.tpm-ra-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tpm-muted, #6d7f8c);
}

.tpm-ra-hint {
  margin: 0;
  font-size: 0.66rem;
  line-height: 1.35;
  color: var(--tpm-muted, #6d7f8c);
}

.tpm-ra-input {
  display: block;
  width: 100%;
  padding: 0.35rem 0.5rem;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--tpm-ink, #1a2b33);
  background: #fff;
  border: 1px solid var(--tpm-line, #e2ddd6);
  border-radius: 6px;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tpm-ra-input:focus {
  outline: none;
  border-color: #d4a574;
  box-shadow: 0 0 0 2px rgba(196, 122, 44, 0.15);
}

.tpm-ra-badge {
  display: inline-block;
  padding: 0.08rem 0.35rem;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 999px;
  line-height: 1.3;
}

.tpm-ra-badge--saved {
  color: #1e7a32;
  background: #e6f4ea;
}

.tpm-ra-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  user-select: none;
}

.tpm-ra-toggle__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tpm-ra-toggle__track {
  position: relative;
  flex-shrink: 0;
  width: 2.05rem;
  height: 1.15rem;
  border-radius: 999px;
  background: #dde3e8;
  transition: background 0.18s ease;
}

.tpm-ra-toggle__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.15rem - 4px);
  height: calc(1.15rem - 4px);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
  transition: transform 0.18s ease;
}

.tpm-ra-toggle__input:checked + .tpm-ra-toggle__track {
  background: var(--tpm-accent, #c47a2c);
}

.tpm-ra-toggle__input:checked + .tpm-ra-toggle__track::after {
  transform: translateX(0.9rem);
}

.tpm-ra-toggle__input:focus-visible + .tpm-ra-toggle__track {
  box-shadow: 0 0 0 2px rgba(196, 122, 44, 0.2);
}

.tpm-ra-toggle__copy {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
}

.tpm-ra-toggle__copy .tpm-ra-label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.8rem;
  color: var(--tpm-ink, #1a2b33);
}

.tpm-ra-token-status {
  margin-top: 0.25rem;
}

.tpm-ra-status {
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  font-size: 0.74rem;
  line-height: 1.35;
}

.tpm-ra-status p {
  margin: 0;
}

.tpm-ra-status__meta {
  margin-top: 0.2rem !important;
  font-size: 0.68rem;
  opacity: 0.92;
}

.tpm-ra-status--success {
  color: #1e7a32;
  background: #e6f4ea;
  border: 1px solid #b8e6c0;
}

.tpm-ra-status--warn {
  color: #7a5c00;
  background: #fff8e5;
  border: 1px solid #f0e0b8;
}

.tpm-ra-status--error {
  color: #b42318;
  background: #fdecea;
  border: 1px solid #f5c2c0;
}

.tpm-ra-form__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 0.35rem;
  padding: 0.4rem 0.5rem;
  background: #f7f5f2;
  border: 1px solid var(--tpm-line, #e2ddd6);
  border-radius: 8px;
}

.tpm-ramayaapi-admin .tpm-ra-section {
  max-width: 720px;
}

.tpm-ramayaapi-admin .tpm-ra-grid {
  grid-template-columns: 1fr;
}

@media (max-width: 720px) {
  .tpm-ra-grid {
    grid-template-columns: 1fr;
  }

  .tpm-ra-grid--3 {
    grid-template-columns: 1fr 1fr;
  }
}

.tpm-ra-section + .tpm-ra-section,
.tpm-ra-form + .tpm-ra-section {
  margin-top: 0.4rem;
}

.tpm-ra-section__title {
  margin: 0 0 0.4rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #ece8e3;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--tpm-muted, #6d7f8c);
}

.tpm-ra-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tpm-ra-field--span2 {
  grid-column: span 2;
}

.tpm-ra-input--xs {
  max-width: 5.5rem;
}

.tpm-ra-input--area {
  min-height: 0;
  resize: vertical;
}

.tpm-ra-subpanel {
  padding: 0.45rem 0.5rem;
  background: #faf8f6;
  border: 1px dashed var(--tpm-line, #e2ddd6);
  border-radius: 6px;
}

.tpm-ra-segment {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tpm-ra-segment--stack {
  flex-direction: column;
  align-items: stretch;
}

.tpm-ra-segment__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.28rem 0.45rem;
  font-size: 0.76rem;
  line-height: 1.3;
  color: var(--tpm-ink, #1a2b33);
  background: #fff;
  border: 1px solid var(--tpm-line, #e2ddd6);
  border-radius: 6px;
  cursor: pointer;
}

.tpm-ra-segment__item:has(input:checked) {
  border-color: #d4a574;
  background: var(--tpm-accent-soft, #faf0e6);
  color: var(--tpm-accent-deep, #9a5a1a);
}

.tpm-ra-segment__item input {
  margin: 0;
  flex-shrink: 0;
}

.tpm-ra-choice-grid {
  display: grid;
  gap: 0.35rem;
}

.tpm-ra-choice-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tpm-ra-choice {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--tpm-line, #e2ddd6);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.tpm-ra-choice:hover {
  border-color: #d4a574;
  background: var(--tpm-accent-soft, #faf0e6);
}

.tpm-ra-choice:has(input:checked) {
  border-color: var(--tpm-accent, #c47a2c);
  background: linear-gradient(135deg, #fffaf5, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tpm-accent, #c47a2c) 25%, transparent);
}

.tpm-ra-choice input {
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.tpm-ra-choice__body {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.tpm-ra-choice__body strong {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--tpm-ink, #1a2b33);
}

.tpm-ra-choice__body small {
  font-size: 0.66rem;
  line-height: 1.35;
  color: var(--tpm-muted, #6d7f8c);
}

/* Sections toggles */
.tpm-sections-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.3rem 0.45rem;
}

.tpm-sections-toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.4rem;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.tpm-sections-toggle:hover {
  background: #faf8f6;
  border-color: var(--tpm-line, #e2ddd6);
}

.tpm-sections-toggle__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tpm-sections-toggle__track {
  position: relative;
  flex-shrink: 0;
  width: 1.85rem;
  height: 1.05rem;
  border-radius: 999px;
  background: #dde3e8;
  transition: background 0.18s ease;
}

.tpm-sections-toggle__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.05rem - 4px);
  height: calc(1.05rem - 4px);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.15);
  transition: transform 0.18s ease;
}

.tpm-sections-toggle__input:checked + .tpm-sections-toggle__track {
  background: var(--tpm-accent, #c47a2c);
}

.tpm-sections-toggle__input:checked + .tpm-sections-toggle__track::after {
  transform: translateX(0.8rem);
}

.tpm-sections-toggle__label {
  font-size: 0.76rem;
  line-height: 1.3;
  color: var(--tpm-ink, #1a2b33);
}

.tpm-sections-toggle__input:checked ~ .tpm-sections-toggle__label {
  font-weight: 600;
  color: var(--tpm-accent-deep, #9a5a1a);
}

/* Shortcode docs */
.tpm-settings-docs__lead {
  margin-bottom: 0.35rem;
}

.tpm-settings-docs__code {
  margin-bottom: 0.45rem;
  padding: 0.35rem 0.5rem;
  background: #f7f5f2;
  border: 1px solid var(--tpm-line, #e2ddd6);
  border-radius: 6px;
}

.tpm-settings-docs__code code {
  font-size: 0.78rem;
}

.tpm-settings-docs__examples {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.tpm-settings-docs__example {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.35rem 0.45rem;
  background: #fff;
  border: 1px solid var(--tpm-line, #e2ddd6);
  border-radius: 6px;
  min-width: 0;
}

.tpm-settings-docs__label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tpm-muted, #6d7f8c);
}

.tpm-settings-docs__example code {
  font-size: 0.68rem;
  word-break: break-all;
}

.tpm-settings-docs__table-wrap {
  overflow: auto;
  border: 1px solid var(--tpm-line, #e2ddd6);
  border-radius: 6px;
}

.tpm-settings-docs__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.74rem;
}

.tpm-settings-docs__table th {
  padding: 0.3rem 0.45rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  color: var(--tpm-muted, #6d7f8c);
  background: #f7f5f2;
  border-bottom: 1px solid var(--tpm-line, #e2ddd6);
}

.tpm-settings-docs__table td {
  padding: 0.28rem 0.45rem;
  vertical-align: top;
  border-bottom: 1px solid #ece8e3;
}

.tpm-settings-docs__table tbody tr:last-child td {
  border-bottom: none;
}

.tpm-product-settings-manage .tpm-ra-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

@media (max-width: 900px) {
  .tpm-ra-choice-grid--2,
  .tpm-sections-grid,
  .tpm-settings-docs__examples {
    grid-template-columns: 1fr;
  }

  .tpm-ra-field--span2 {
    grid-column: auto;
  }

  .tpm-ra-grid--3 {
    grid-template-columns: 1fr;
  }
}

/* Unified premium form controls */
.tpm-manage-edit,
.tpm-pe-form {
  --tpm-control-bg: rgba(255, 255, 255, 0.96);
  --tpm-control-border: rgba(100, 116, 139, 0.28);
  --tpm-control-border-hover: rgba(100, 116, 139, 0.46);
  --tpm-control-focus: rgba(196, 122, 44, 0.34);
  --tpm-control-text: #112b3a;
  --tpm-control-placeholder: #7c8f9d;
  --tpm-control-radius: 10px;
  --tpm-control-height: 2.1rem;
}

.tpm-pe-form :where(
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="url"],
  input[type="tel"],
  select,
  textarea
),
.tpm-manage-edit :where(
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="url"],
  input[type="tel"],
  select,
  textarea
) {
  width: 100%;
  min-height: var(--tpm-control-height);
  padding: 0.42rem 0.62rem;
  border: 1px solid var(--tpm-control-border);
  border-radius: var(--tpm-control-radius);
  background: var(--tpm-control-bg);
  color: var(--tpm-control-text);
  box-shadow:
    inset 0 1px 1px rgba(15, 23, 42, 0.025),
    0 1px 0 rgba(255, 255, 255, 0.75);
  font: inherit;
  font-size: 0.8rem;
  line-height: 1.42;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.tpm-pe-form :where(textarea),
.tpm-manage-edit :where(textarea) {
  min-height: 4.4rem;
  resize: vertical;
}

.tpm-pe-form :where(select),
.tpm-manage-edit :where(select) {
  padding-right: 2rem;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position:
    calc(100% - 0.95rem) calc(50% - 0.12rem),
    calc(100% - 0.72rem) calc(50% - 0.12rem);
  background-size: 0.28rem 0.28rem, 0.28rem 0.28rem;
  background-repeat: no-repeat;
  appearance: none;
}

.tpm-pe-form :where(input[type="text"], input[type="number"], input[type="email"], input[type="url"], input[type="tel"], select, textarea):hover,
.tpm-manage-edit :where(input[type="text"], input[type="number"], input[type="email"], input[type="url"], input[type="tel"], select, textarea):hover {
  border-color: var(--tpm-control-border-hover);
}

.tpm-pe-form :where(input[type="text"], input[type="number"], input[type="email"], input[type="url"], input[type="tel"], select, textarea):focus,
.tpm-manage-edit :where(input[type="text"], input[type="number"], input[type="email"], input[type="url"], input[type="tel"], select, textarea):focus {
  outline: none;
  border-color: color-mix(in srgb, var(--tpm-accent, #c47a2c) 58%, #94a3b8);
  background: #fff;
  box-shadow:
    0 0 0 3px var(--tpm-control-focus),
    inset 0 1px 1px rgba(15, 23, 42, 0.02);
}

.tpm-pe-form :where(input, textarea)::placeholder,
.tpm-manage-edit :where(input, textarea)::placeholder {
  color: var(--tpm-control-placeholder);
  opacity: 0.9;
}

.tpm-pe-form :where(input, select, textarea):disabled,
.tpm-manage-edit :where(input, select, textarea):disabled {
  color: #8393a1;
  background: rgba(241, 245, 249, 0.92);
  border-color: rgba(148, 163, 184, 0.24);
  cursor: not-allowed;
  box-shadow: none;
}

.tpm-pe-form :where(input[type="checkbox"], input[type="radio"]),
.tpm-manage-edit :where(input[type="checkbox"], input[type="radio"]) {
  width: auto;
  min-height: 0;
  padding: 0;
  border-radius: initial;
  box-shadow: none;
}

.tpm-pe-form .tpm-pe-editor .wp-editor-area {
  border: 0;
  border-radius: 0;
  background: #fbfdff;
  box-shadow: none;
}

.tpm-pe-form .tpm-pe-editor .wp-editor-area:focus {
  box-shadow: inset 0 0 0 2px rgba(196, 122, 44, 0.16);
}

.tpm-pe-form .tpm-pinfo__input,
.tpm-pe-form .tpm-pinfo__price-row .widefat,
.tpm-pe-form .tpm-repeater__row .tpm-repeater__input,
.tpm-pe-form .tpm-other-faq__textarea,
.tpm-pe-form .tpm-faq-repeater__q input,
.tpm-pe-form .tpm-faq-repeater__a textarea,
.tpm-ai-collapse .tpm-ai-assistant__textarea {
  border-color: var(--tpm-control-border);
  border-radius: var(--tpm-control-radius);
  background: var(--tpm-control-bg);
}

.tpm-pe-form .tpm-pinfo__input:focus,
.tpm-pe-form .tpm-pinfo__price-row .widefat:focus,
.tpm-pe-form .tpm-repeater__row .tpm-repeater__input:focus,
.tpm-pe-form .tpm-other-faq__textarea:focus,
.tpm-pe-form .tpm-faq-repeater__q input:focus,
.tpm-pe-form .tpm-faq-repeater__a textarea:focus,
.tpm-ai-collapse .tpm-ai-assistant__textarea:focus {
  border-color: color-mix(in srgb, var(--tpm-accent, #c47a2c) 58%, #94a3b8);
  box-shadow: 0 0 0 3px var(--tpm-control-focus);
}

/* Premium compact product editor */
.tpm-manage-panel.tpm-manage-edit {
  padding: clamp(0.55rem, 0.9vw, 0.85rem);
  border-radius: 12px;
}

.tpm-manage-edit .tpm-me-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.5rem;
}

.tpm-manage-edit .tpm-me-head h1 {
  margin: 0;
  font-size: clamp(1rem, 1.35vw, 1.25rem);
  letter-spacing: -0.025em;
}

.tpm-manage-edit .tpm-me-back {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.78rem;
  padding: 0.22rem 0.48rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--tpm-line);
}

.tpm-pe-form {
  display: grid;
  gap: 0.48rem;
}

.tpm-pe-form .tpm-manage-metabox,
.tpm-pe-form .tpm-pe-section {
  margin: 0;
  padding: 0.58rem 0.68rem;
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(252, 250, 247, 0.98));
  border-color: color-mix(in srgb, var(--tpm-line) 82%, #fff);
  box-shadow: 0 8px 22px rgba(26, 43, 54, 0.045);
}

.tpm-pe-form .tpm-manage-metabox--core {
  background: linear-gradient(180deg, #fff 0%, #fbfaf8 100%);
  border-color: color-mix(in srgb, var(--tpm-accent) 16%, var(--tpm-line));
}

.tpm-pe-form .tpm-pe-section--ai {
  padding: 0;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--tpm-accent) 26%, var(--tpm-line));
  background:
    radial-gradient(circle at 0 0, rgba(196, 122, 44, 0.10), transparent 18rem),
    linear-gradient(180deg, #fffdf9 0%, #fff 100%);
}

.tpm-ai-collapse__summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.35rem 0.75rem;
  align-items: center;
  padding: 0.58rem 0.72rem;
  cursor: pointer;
  list-style: none;
}

.tpm-ai-collapse__summary::-webkit-details-marker {
  display: none;
}

.tpm-ai-collapse__summary::after {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  color: var(--tpm-accent-deep);
  background: var(--tpm-accent-soft);
  border: 1px solid color-mix(in srgb, var(--tpm-accent) 24%, var(--tpm-line));
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}

.tpm-ai-collapse__icon {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 12px;
  color: #fff;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.55), transparent 32%),
    linear-gradient(135deg, #7c3aed 0%, #2563eb 48%, var(--tpm-accent) 100%);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.18);
  font-size: 1.05rem;
  font-weight: 900;
}

.tpm-ai-collapse__copy {
  display: grid;
  gap: 0.16rem;
  min-width: 0;
}

.tpm-ai-collapse[open] .tpm-ai-collapse__summary::after {
  content: "–";
}

.tpm-ai-collapse__title {
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  color: var(--tpm-accent-deep);
}

.tpm-ai-collapse__meta {
  display: block;
  font-size: 0.72rem;
  line-height: 1.25;
  color: #637884;
}

.tpm-ai-collapse__body {
  padding: 0.72rem;
  border-top: 1px solid rgba(226, 221, 214, 0.78);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(247, 245, 242, 0.5)),
    rgba(255, 255, 255, 0.78);
}

.tpm-ai-collapse .tpm-ai-assistant {
  display: grid;
  grid-template-columns: minmax(18rem, 1fr) minmax(16rem, 0.72fr);
  grid-template-areas:
    "label guidance"
    "source guidance"
    "source action"
    "status status"
    "preview preview";
  gap: 0.55rem 0.85rem;
  margin: 0;
  align-items: start;
}

.tpm-ai-collapse .tpm-ai-assistant__label {
  grid-area: label;
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: -0.01em;
  color: #132b3a;
}

.tpm-ai-collapse .tpm-ai-assistant__source-wrap {
  grid-area: source;
  margin: 0;
}

.tpm-ai-collapse .tpm-ai-assistant__guidance {
  grid-area: guidance;
  align-self: start;
  display: grid;
  gap: 0.22rem;
  margin: 0;
  padding: 0.68rem 0.75rem;
  border-radius: 12px;
  background:
    radial-gradient(circle at 100% 0, rgba(37, 99, 235, 0.08), transparent 8rem),
    #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.32);
  color: #486274;
  font-size: 0.74rem;
  line-height: 1.45;
}

.tpm-ai-collapse .tpm-ai-assistant__guidance-kicker {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2563eb;
}

.tpm-ai-collapse .tpm-ai-assistant__generate-wrap {
  grid-area: action;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  margin: 0;
}

.tpm-ai-collapse #tpm-ai-generate {
  min-height: 2.15rem !important;
  padding: 0.36rem 0.82rem !important;
  border-radius: 999px !important;
  font-size: 0.76rem !important;
  font-weight: 750 !important;
  box-shadow: 0 8px 18px rgba(196, 122, 44, 0.16) !important;
}

.tpm-ai-collapse .tpm-ai-assistant__textarea {
  width: 100%;
  min-height: 7rem;
  max-height: 13rem;
  padding: 0.7rem 0.78rem;
  border-radius: 12px;
  border-color: rgba(100, 116, 139, 0.38);
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.035);
  font-size: 0.78rem;
  line-height: 1.5;
}

.tpm-ai-collapse .tpm-ai-assistant__status {
  grid-area: status;
  margin: 0;
}

.tpm-ai-collapse .tpm-ai-assistant__preview-wrap {
  grid-area: preview;
  margin-top: 0.15rem;
  padding: 0.72rem;
  border: 1px solid rgba(226, 221, 214, 0.9);
  border-radius: 12px;
  background: #fff;
}

.tpm-ai-collapse .tpm-ai-assistant__preview-heading {
  margin: 0 0 0.28rem;
  font-size: 0.82rem;
  letter-spacing: -0.01em;
}

.tpm-ai-collapse .tpm-ai-assistant__preview-hint {
  margin-bottom: 0.55rem;
}

.tpm-ai-collapse .tpm-ai-assistant__apply-all-wrap {
  margin-top: 0.55rem;
}

.tpm-ai-collapse .tpm-ai-assistant__warnings-wrap {
  margin-top: 0.62rem;
  padding: 0.72rem;
  border-radius: 11px;
}

.tpm-pe-section__head {
  margin-bottom: 0.45rem;
  padding-bottom: 0.34rem;
  border-bottom-color: rgba(26, 43, 54, 0.08);
}

.tpm-pe-section__head h2 {
  font-size: 0.71rem;
  letter-spacing: 0.075em;
  color: #526877;
}

.tpm-pe-grid {
  gap: 0.42rem 0.72rem;
}

.tpm-pe-grid--core {
  grid-template-columns: minmax(0, 1fr) minmax(13rem, 0.35fr);
  grid-template-areas:
    "title title"
    "status thumb"
    "categories thumb"
    "editor editor"
    "excerpt excerpt";
  align-items: start;
}

.tpm-pe-label,
.tpm-pe-form .tpm-pinfo__field-label,
.tpm-pe-form .tpm-pinfo__block-label,
.tpm-pe-form .tpm-metabox-table th {
  margin-bottom: 0.18rem;
  font-size: 0.65rem;
  letter-spacing: 0.055em;
  color: #5f7480;
}

.tpm-pe-input,
.tpm-pe-form .tpm-metabox-table .widefat,
.tpm-pe-form .tpm-metabox-table .regular-text,
.tpm-pe-form .tpm-metabox-table .large-text,
.tpm-pe-form .tpm-metabox-table select,
.tpm-pe-form .tpm-metabox-table textarea {
  min-height: 2rem;
  padding: 0.34rem 0.52rem;
  border-radius: 8px;
  border-color: color-mix(in srgb, var(--tpm-line) 88%, #9aa9b3);
  background: #fff;
  font-size: 0.8rem;
}

.tpm-pe-input--title {
  min-height: 2.05rem;
  font-size: 0.88rem;
}

.tpm-pe-chips {
  gap: 0.25rem;
}

.tpm-pe-chip span {
  padding: 0.18rem 0.48rem;
  font-size: 0.69rem;
}

.tpm-pe-thumb {
  align-items: center;
  justify-content: flex-start;
}

.tpm-pe-thumb__preview {
  width: 58px;
  height: 58px;
  border-radius: 9px;
}

.tpm-pe-thumb__actions {
  gap: 0.22rem;
}

.tpm-pe-btn,
.tpm-pe-form .button,
.tpm-pe-form .button-secondary {
  min-height: 1.75rem !important;
  padding: 0.22rem 0.5rem !important;
  border-radius: 7px !important;
  font-size: 0.7rem !important;
}

.tpm-pe-editor .wp-editor-wrap {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--tpm-line);
}

.tpm-pe-editor .wp-editor-tools {
  padding: 0.26rem 0.36rem 0;
}

.tpm-pe-editor .wp-media-buttons .button,
.tpm-pe-editor .wp-editor-tabs .wp-switch-editor {
  min-height: 1.55rem !important;
  padding: 0.16rem 0.42rem !important;
  font-size: 0.68rem !important;
}

.tpm-pe-editor .quicktags-toolbar {
  padding: 0.28rem 0.36rem !important;
}

.tpm-pe-editor .quicktags-toolbar input.button.button-small {
  min-height: 1.45rem !important;
  padding: 0.12rem 0.34rem !important;
  font-size: 0.66rem !important;
}

.tpm-pe-editor .wp-editor-area {
  min-height: 12rem;
  max-height: 18rem;
  font-size: 0.78rem;
  line-height: 1.52;
}

.tpm-pe-field--excerpt textarea {
  min-height: 3rem;
}

.tpm-pe-form .tpm-pinfo {
  gap: 0.5rem;
}

.tpm-pe-form .tpm-pinfo__block {
  padding: 0.55rem 0 0;
}

.tpm-pe-form .tpm-pinfo__price-grid,
.tpm-pe-form .tpm-repeater__list {
  gap: 0.38rem;
}

.tpm-pe-form .tpm-metabox-table th {
  width: 9.5rem;
  padding: 0.24rem 0.45rem 0.24rem 0;
}

.tpm-pe-form .tpm-metabox-table td {
  padding: 0.18rem 0 0.24rem;
}

.tpm-pe-form .description,
.tpm-pe-hint {
  margin-top: 0.18rem;
  font-size: 0.66rem;
  line-height: 1.28;
}

.tpm-pe-form .tpm-repeater__row {
  padding: 0.26rem;
  border-radius: 9px;
}

.tpm-pe-form .tpm-repeater__row-main {
  gap: 0.35rem;
}

.tpm-pe-form .tpm-repeater__row .tpm-repeater__input {
  min-height: 1.9rem;
  padding: 0.28rem 0.46rem;
  font-size: 0.78rem;
  border-radius: 7px;
}

.tpm-pe-form .tpm-repeater__row-ai .button-small {
  min-height: 1.75rem !important;
  padding: 0.18rem 0.48rem !important;
}

.tpm-pe-form .tpm-repeater__row .tpm-repeater__remove {
  width: 1.8rem;
  min-width: 1.8rem;
  height: 1.8rem;
  border-radius: 7px !important;
}

/* Product Info: compact conversion-focused layout */
.tpm-pe-form .tpm-pinfo {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.55rem;
}

.tpm-pe-form .tpm-pinfo__block {
  min-width: 0;
  padding: 0;
  border-top: 0;
}

.tpm-pe-form .tpm-pinfo__block--pricing {
  grid-column: 1 / -1;
  padding: 0.68rem;
  border: 1px solid rgba(196, 122, 44, 0.20);
  border-radius: 12px;
  background:
    radial-gradient(circle at 0 0, rgba(196, 122, 44, 0.08), transparent 18rem),
    linear-gradient(180deg, #fff 0%, #fffaf4 100%);
}

.tpm-pe-form .tpm-pinfo__block--region,
.tpm-pe-form .tpm-pinfo__block--duration,
.tpm-pe-form .tpm-pinfo__block--location {
  grid-column: span 4;
  padding: 0.52rem;
  border: 1px solid rgba(226, 221, 214, 0.92);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
}

.tpm-pe-form .tpm-pinfo__block--pricing .tpm-pinfo__block-label {
  margin: 0 0 0.45rem;
  color: var(--tpm-accent-deep);
}

.tpm-pe-form .tpm-pinfo__radios {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.45rem;
}

.tpm-pe-form .tpm-pinfo__radio {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.32rem 0.55rem;
  border: 1px solid rgba(226, 221, 214, 0.95);
  border-radius: 999px;
  background: #fff;
  font-size: 0.74rem;
  line-height: 1.2;
}

.tpm-pe-form .tpm-pinfo__radio:has(input:checked) {
  border-color: rgba(196, 122, 44, 0.45);
  background: var(--tpm-accent-soft);
  color: var(--tpm-accent-deep);
}

.tpm-pe-form .tpm-pinfo__block--pricing > .tpm-pinfo__hint {
  display: inline-flex;
  margin: 0 0 0.45rem 0.35rem !important;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(226, 221, 214, 0.82);
  vertical-align: middle;
}

.tpm-pe-form #tpm-price-fixed-wrap {
  margin-top: 0.1rem;
}

.tpm-pe-form .tpm-pinfo__price-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.48rem;
}

.tpm-pe-form .tpm-pinfo__price-row {
  display: grid;
  align-content: start;
  gap: 0.22rem;
  min-width: 0;
  padding: 0.52rem;
  border: 1px solid rgba(226, 221, 214, 0.92);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
}

.tpm-pe-form .tpm-pinfo__price-row:first-child {
  border-color: rgba(196, 122, 44, 0.28);
  background: rgba(255, 251, 246, 0.92);
}

.tpm-pe-form .tpm-pinfo__price-toggle {
  order: 3;
  margin: 0.12rem 0 0;
  font-size: 0.7rem;
  color: #425867;
}

.tpm-pe-form .tpm-pinfo__price-row .tpm-pinfo__field-label {
  margin: 0;
}

.tpm-pe-form .tpm-pinfo__input,
.tpm-pe-form .tpm-pinfo__price-row .widefat {
  max-width: none;
  width: 100%;
  min-height: 2rem;
}

.tpm-pe-form .tpm-pinfo__price-panel > .tpm-pinfo__hint {
  margin: 0.42rem 0 0 !important;
}

.tpm-pe-form #tpm-price-tier-wrap {
  margin-top: 0.1rem;
  padding: 0.58rem;
  border: 1px solid rgba(226, 221, 214, 0.92);
  border-radius: 12px;
  background:
    radial-gradient(circle at 100% 0, rgba(37, 99, 235, 0.055), transparent 14rem),
    rgba(255, 255, 255, 0.88);
}

.tpm-pe-form .tpm-price-tier-table {
  margin: 0;
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
}

.tpm-pe-form .tpm-pinfo__tier-table {
  max-width: none;
}

.tpm-pe-form .tpm-price-tier-table thead,
.tpm-pe-form .tpm-price-tier-table tbody,
.tpm-pe-form .tpm-price-tier-table tr {
  display: block;
  width: 100%;
}

.tpm-pe-form .tpm-price-tier-table thead tr,
.tpm-pe-form .tpm-price-tier-row {
  display: grid;
  grid-template-columns: minmax(5.2rem, 0.55fr) minmax(5.2rem, 0.55fr) minmax(10rem, 1.55fr) 2.2rem;
  gap: 0.42rem;
  align-items: center;
}

.tpm-pe-form .tpm-price-tier-table thead tr {
  padding: 0 0.15rem 0.28rem;
}

.tpm-pe-form .tpm-price-tier-table th,
.tpm-pe-form .tpm-price-tier-table td {
  display: block;
  padding: 0;
  border: 0;
}

.tpm-pe-form .tpm-price-tier-table th {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5f7480;
  background: transparent;
}

.tpm-pe-form .tpm-price-tier-table tbody {
  display: grid;
  gap: 0.38rem;
}

.tpm-pe-form .tpm-price-tier-row {
  padding: 0.42rem;
  border: 1px solid rgba(226, 221, 214, 0.9);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(26, 43, 54, 0.035);
}

.tpm-pe-form .tpm-price-tier-row:hover {
  border-color: rgba(196, 122, 44, 0.28);
  background: #fffdf9;
}

.tpm-pe-form .tpm-price-tier-row input {
  width: 100% !important;
  min-height: 1.9rem;
  padding: 0.28rem 0.45rem;
  border-radius: 7px;
  font-size: 0.76rem;
  box-sizing: border-box;
}

.tpm-pe-form .tpm-price-tier-row .small-text {
  max-width: none;
}

.tpm-pe-form .tpm-price-tier-remove {
  display: inline-grid !important;
  place-items: center;
  width: 1.9rem;
  min-width: 1.9rem;
  height: 1.9rem !important;
  padding: 0 !important;
  border-radius: 8px !important;
  color: #7f1d1d !important;
  background: #fff !important;
  border-color: #f0d2cf !important;
  font-size: 1rem !important;
  line-height: 1 !important;
}

.tpm-pe-form #tpm-price-tier-wrap > p {
  display: flex;
  justify-content: flex-start;
  margin: 0.48rem 0 0;
}

.tpm-pe-form #tpm-price-tier-add {
  border-radius: 999px !important;
  padding-inline: 0.68rem !important;
  font-weight: 750 !important;
}

.tpm-pe-form .tpm-pinfo__block--region .tpm-pinfo__hint {
  margin-top: 0.32rem !important;
}

.tpm-pe-form-bar {
  position: sticky;
  bottom: 0.35rem;
  z-index: 5;
  margin-top: 0.2rem;
  padding: 0.42rem 0.55rem;
  border: 1px solid rgba(226, 221, 214, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 34px rgba(26, 43, 54, 0.12);
  backdrop-filter: blur(10px);
}

@media (min-width: 1180px) {
  .tpm-manage-panel.tpm-manage-edit {
    max-width: 1180px;
    margin-inline: auto;
  }
}

@media (max-width: 900px) {
  .tpm-manage-panel.tpm-manage-edit {
    padding: 0.5rem;
  }

  .tpm-manage-edit .tpm-me-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }

  .tpm-pe-grid--core {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "status"
      "thumb"
      "categories"
      "editor"
      "excerpt";
  }

  .tpm-pe-form .tpm-manage-metabox,
  .tpm-pe-form .tpm-pe-section {
    padding: 0.52rem;
  }

  .tpm-pe-form .tpm-pe-section--ai {
    padding: 0;
  }

  .tpm-ai-collapse__summary {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 0.55rem 0.62rem;
  }

  .tpm-ai-collapse .tpm-ai-assistant {
    grid-template-columns: 1fr;
    grid-template-areas:
      "label"
      "source"
      "guidance"
      "action"
      "status"
      "preview";
  }

  .tpm-ai-collapse__body {
    padding: 0.62rem;
  }

  .tpm-ai-collapse .tpm-ai-assistant__generate-wrap {
    justify-content: stretch;
  }

  .tpm-ai-collapse #tpm-ai-generate {
    width: 100%;
  }

  .tpm-pe-thumb {
    align-items: center;
  }

  .tpm-pe-editor .wp-editor-area {
    min-height: 10rem;
    max-height: 15rem;
  }

  .tpm-pe-form .tpm-metabox-table,
  .tpm-pe-form .tpm-metabox-table tbody,
  .tpm-pe-form .tpm-metabox-table tr,
  .tpm-pe-form .tpm-metabox-table th,
  .tpm-pe-form .tpm-metabox-table td {
    display: block;
    width: 100%;
  }

  .tpm-pe-form .tpm-metabox-table th {
    padding: 0.2rem 0 0.05rem;
  }

  .tpm-pe-form .tpm-pinfo {
    grid-template-columns: 1fr;
  }

  .tpm-pe-form .tpm-pinfo__block--pricing,
  .tpm-pe-form .tpm-pinfo__block--region,
  .tpm-pe-form .tpm-pinfo__block--duration,
  .tpm-pe-form .tpm-pinfo__block--location {
    grid-column: auto;
    padding: 0.52rem;
  }

  .tpm-pe-form .tpm-pinfo__price-grid {
    grid-template-columns: 1fr;
  }

  .tpm-pe-form .tpm-pinfo__block--pricing > .tpm-pinfo__hint {
    display: flex;
    margin: 0 0 0.45rem !important;
    width: fit-content;
    max-width: 100%;
  }

  .tpm-pe-form .tpm-price-tier-table thead {
    display: none;
  }

  .tpm-pe-form .tpm-price-tier-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.42rem;
  }

  .tpm-pe-form .tpm-price-tier-row td:nth-child(3),
  .tpm-pe-form .tpm-price-tier-row td:nth-child(4) {
    grid-column: 1 / -1;
  }

  .tpm-pe-form .tpm-price-tier-row td:nth-child(1)::before,
  .tpm-pe-form .tpm-price-tier-row td:nth-child(2)::before,
  .tpm-pe-form .tpm-price-tier-row td:nth-child(3)::before {
    display: block;
    margin-bottom: 0.18rem;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #5f7480;
  }

  .tpm-pe-form .tpm-price-tier-row td:nth-child(1)::before {
    content: "Min persons";
  }

  .tpm-pe-form .tpm-price-tier-row td:nth-child(2)::before {
    content: "Max persons";
  }

  .tpm-pe-form .tpm-price-tier-row td:nth-child(3)::before {
    content: "Price per person";
  }

  .tpm-pe-form .tpm-price-tier-remove,
  .tpm-pe-form #tpm-price-tier-add {
    width: 100%;
  }

  .tpm-pe-form-bar {
    border-radius: 14px;
    align-items: stretch;
  }
}

/* Cleaner visual hierarchy: reduce nested borders */
.tpm-manage-panel.tpm-manage-edit {
  border-color: rgba(226, 221, 214, 0.55);
  background: rgba(255, 255, 255, 0.82);
}

.tpm-pe-form .tpm-manage-metabox,
.tpm-pe-form .tpm-pe-section {
  border-color: rgba(226, 221, 214, 0.48);
  box-shadow: 0 10px 28px rgba(26, 43, 54, 0.035);
}

.tpm-pe-section__head {
  border-bottom-color: rgba(26, 43, 54, 0.055);
}

.tpm-pe-form .tpm-pinfo__block--pricing,
.tpm-pe-form .tpm-pinfo__block--region,
.tpm-pe-form .tpm-pinfo__block--duration,
.tpm-pe-form .tpm-pinfo__block--location,
.tpm-pe-form .tpm-other-faq__card,
.tpm-pe-form #tpm-price-tier-wrap {
  border-color: transparent;
  box-shadow: none;
  background-color: rgba(255, 255, 255, 0.68);
}

.tpm-pe-form .tpm-pinfo__block--pricing,
.tpm-pe-form #tpm-price-tier-wrap,
.tpm-pe-form .tpm-other-faq__card--faq,
.tpm-pe-form .tpm-other-faq__card--notes {
  background-blend-mode: normal;
}

.tpm-pe-form .tpm-pinfo__price-row,
.tpm-pe-form .tpm-price-tier-row,
.tpm-pe-form .tpm-repeater__row,
.tpm-pe-form .tpm-other-info-repeater__row,
.tpm-pe-form .tpm-faq-repeater__row {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.10);
}

.tpm-pe-form .tpm-pinfo__price-row:hover,
.tpm-pe-form .tpm-price-tier-row:hover,
.tpm-pe-form .tpm-repeater__row:hover,
.tpm-pe-form .tpm-other-info-repeater__row:hover,
.tpm-pe-form .tpm-faq-repeater__row:hover {
  box-shadow: inset 0 0 0 1px rgba(196, 122, 44, 0.18);
  background: rgba(255, 255, 255, 0.92);
}

.tpm-pe-form .tpm-other-faq__intro,
.tpm-pe-form .tpm-pinfo__block--pricing > .tpm-pinfo__hint,
.tpm-ai-collapse .tpm-ai-assistant__guidance {
  border-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.08);
}

.tpm-pe-form .tpm-other-faq__card-head {
  border-bottom-color: rgba(26, 43, 54, 0.055);
}

.tpm-pe-form .tpm-price-tier-table th {
  color: rgba(82, 104, 119, 0.86);
}

/* Gallery preview: remove theme ul indentation in manage editor */
.tpm-pe-form #tpm_gallery_preview.tpm-gallery-preview,
.tpm-pe-form .tpm-gallery-preview {
  margin: 0.55rem 0 0 !important;
  padding: 0 !important;
  list-style: none !important;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.4rem, 1fr));
  gap: 0.58rem;
  align-items: start;
}

.tpm-pe-form #tpm_gallery_preview.tpm-gallery-preview > li,
.tpm-pe-form .tpm-gallery-preview > li {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  min-width: 0;
}

/* Super responsive product editor layout */
.tpm-manage-panel.tpm-manage-edit {
  width: 100%;
  max-width: none !important;
  margin-inline: 0 !important;
  padding: clamp(0.62rem, 0.85vw, 1rem);
  box-sizing: border-box;
}

.tpm-manage-edit .tpm-me-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem 1rem;
}

.tpm-manage-edit .tpm-me-head h1 {
  justify-self: end;
  text-align: right;
}

.tpm-pe-form {
  width: 100%;
  max-width: none;
  min-width: 0;
  gap: clamp(0.5rem, 0.7vw, 0.75rem);
}

.tpm-pe-form,
.tpm-pe-form *,
.tpm-pe-form *::before,
.tpm-pe-form *::after {
  box-sizing: border-box;
}

.tpm-pe-form .tpm-manage-metabox,
.tpm-pe-form .tpm-pe-section {
  width: 100%;
  min-width: 0;
  padding: clamp(0.6rem, 0.8vw, 0.9rem);
}

.tpm-pe-grid {
  min-width: 0;
}

.tpm-pe-grid--core {
  grid-template-columns: minmax(0, 1fr) minmax(12rem, 18rem);
  gap: clamp(0.48rem, 0.7vw, 0.75rem) clamp(0.65rem, 1vw, 1rem);
  align-items: start;
}

.tpm-pe-field,
.tpm-pe-field--editor,
.tpm-pe-editor,
.tpm-pe-editor .wp-editor-wrap,
.tpm-pe-editor .wp-editor-container {
  min-width: 0;
}

.tpm-pe-form :where(input[type="text"], input[type="number"], input[type="email"], input[type="url"], input[type="tel"], select, textarea, .widefat, .regular-text, .large-text) {
  width: 100%;
  max-width: 100%;
}

.tpm-pe-form .tpm-pinfo {
  display: grid;
  grid-template-columns: minmax(18rem, 1.4fr) repeat(3, minmax(11rem, 1fr));
  gap: clamp(0.5rem, 0.7vw, 0.75rem);
  align-items: stretch;
}

.tpm-pe-form .tpm-pinfo__block--pricing {
  grid-column: auto;
}

.tpm-pe-form .tpm-pinfo__price-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tpm-pe-form .tpm-pinfo__input,
.tpm-pe-form .tpm-pinfo__price-row .widefat {
  max-width: 100%;
}

.tpm-ai-collapse .tpm-ai-assistant {
  grid-template-columns: minmax(22rem, 1.25fr) minmax(18rem, 0.75fr);
}

.tpm-pe-form .tpm-repeater__row-main {
  min-width: 0;
}

.tpm-pe-form .tpm-faq-repeater__row {
  grid-template-columns: minmax(13rem, 0.75fr) minmax(18rem, 1fr) auto;
}

.tpm-pe-form-bar {
  width: min(100%, 100%);
}

@media (min-width: 1440px) {
  .tpm-pe-grid--core {
    grid-template-columns: minmax(0, 1fr) minmax(14rem, 20rem);
  }

  .tpm-pe-editor .wp-editor-area {
    min-height: 12rem !important;
  }

  .tpm-pe-form .tpm-pinfo {
    grid-template-columns: minmax(22rem, 1.35fr) repeat(3, minmax(13rem, 1fr));
  }
}

@media (max-width: 1180px) {
  .tpm-pe-form .tpm-pinfo {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tpm-pe-form .tpm-pinfo__block--pricing {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .tpm-manage-panel.tpm-manage-edit {
    padding: 0.5rem;
  }

  .tpm-manage-edit .tpm-me-head {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .tpm-manage-edit .tpm-me-head h1 {
    justify-self: start;
    text-align: left;
  }

  .tpm-pe-grid--core,
  .tpm-ai-collapse .tpm-ai-assistant,
  .tpm-pe-form .tpm-pinfo,
  .tpm-pe-form .tpm-pinfo__price-grid,
  .tpm-pe-form .tpm-faq-repeater__row,
  .tpm-pe-form .tpm-other-info-repeater__row {
    grid-template-columns: 1fr;
  }

  .tpm-pe-grid--core {
    grid-template-areas:
      "title"
      "status"
      "thumb"
      "categories"
      "editor"
      "excerpt";
  }

  .tpm-pe-form .tpm-pinfo__block--pricing {
    grid-column: auto;
  }

  .tpm-pe-form .tpm-faq-repeater__actions,
  .tpm-pe-form .tpm-other-info-repeater__remove {
    width: 100%;
  }

  .tpm-pe-form-bar {
    border-radius: 14px;
  }
}

@media (max-width: 640px) {
  .tpm-pe-form .tpm-manage-metabox,
  .tpm-pe-form .tpm-pe-section {
    padding: 0.52rem;
    border-radius: 10px;
  }

  .tpm-pe-section__head {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }

  .tpm-pe-thumb {
    display: grid;
    grid-template-columns: 4rem minmax(0, 1fr);
    width: 100%;
  }

  .tpm-pe-thumb__actions {
    width: 100%;
  }

  .tpm-pe-thumb__actions .button {
    width: 100%;
  }

  .tpm-ai-collapse__summary {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 0.5rem;
  }

  .tpm-ai-collapse__meta {
    font-size: 0.68rem;
  }

  .tpm-pe-form .tpm-repeater__row,
  .tpm-pe-form .tpm-other-info-repeater__row,
  .tpm-pe-form .tpm-faq-repeater__row {
    padding: 0.42rem;
  }

  .tpm-pe-form-bar {
    align-items: stretch;
    gap: 0.45rem;
  }

  .tpm-pe-form-bar .button,
  .tpm-pe-form-bar__view {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .tpm-pe-form-bar__view {
    margin-left: 0;
  }
}

/* Tiered pricing: compact premium table/card */
.tpm-pe-form #tpm-price-tier-wrap {
  padding: clamp(0.52rem, 0.72vw, 0.75rem);
  border: 0;
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0, rgba(37, 99, 235, 0.075), transparent 14rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.72));
  box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.12);
}

.tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-table {
  display: grid !important;
  gap: 0.36rem;
  width: 100%;
  margin: 0;
  border: 0;
  background: transparent;
}

.tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-table thead,
.tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-table tbody,
.tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-table tr {
  display: grid !important;
  width: 100%;
}

.tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-table thead tr,
.tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-row {
  grid-template-columns: minmax(6.5rem, 0.7fr) minmax(6.5rem, 0.7fr) minmax(12rem, 1.45fr) 2.35rem !important;
  gap: 0.46rem;
  align-items: center;
}

.tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-table thead tr {
  padding: 0 0.5rem 0.12rem;
}

.tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-table tbody {
  gap: 0.42rem;
}

.tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-table th,
.tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-table td {
  display: block !important;
  width: auto !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  min-width: 0;
}

.tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-table th {
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  color: rgba(71, 85, 105, 0.82);
}

.tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-row {
  padding: 0.42rem;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow:
    inset 0 0 0 1px rgba(148, 163, 184, 0.16),
    0 8px 22px rgba(15, 23, 42, 0.035);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-row:hover {
  background: #fff;
  box-shadow:
    inset 0 0 0 1px rgba(196, 122, 44, 0.25),
    0 10px 26px rgba(15, 23, 42, 0.055);
  transform: translateY(-1px);
}

.tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-row input {
  width: 100% !important;
  max-width: none !important;
  min-height: 2rem;
  padding: 0.34rem 0.55rem;
  border-radius: 10px;
  border-color: rgba(148, 163, 184, 0.36);
  background: rgba(248, 250, 252, 0.78);
  font-size: 0.8rem;
  font-weight: 600;
}

.tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-row input:focus {
  background: #fff;
}

.tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-row__actions {
  display: flex !important;
  justify-content: flex-end;
}

.tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-remove {
  width: 2rem !important;
  min-width: 2rem !important;
  height: 2rem !important;
  border-radius: 10px !important;
  color: #991b1b !important;
  background: rgba(254, 242, 242, 0.82) !important;
  border-color: rgba(248, 113, 113, 0.28) !important;
  box-shadow: none !important;
}

.tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-remove:hover {
  color: #fff !important;
  background: #dc2626 !important;
  border-color: #dc2626 !important;
}

.tpm-pe-form #tpm-price-tier-wrap > p {
  margin: 0.55rem 0 0;
}

.tpm-pe-form #tpm-price-tier-add {
  min-height: 2.05rem !important;
  padding: 0.34rem 0.78rem !important;
  border-radius: 999px !important;
  font-size: 0.76rem !important;
  font-weight: 800 !important;
  background: rgba(255, 255, 255, 0.88) !important;
  border-color: rgba(15, 23, 42, 0.18) !important;
}

@media (max-width: 900px) {
  .tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-table thead {
    display: none !important;
  }

  .tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) 2.35rem !important;
    align-items: end;
  }

  .tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-row td::before {
    content: attr(data-label);
    display: block;
    margin: 0 0 0.2rem;
    font-size: 0.62rem;
    font-weight: 850;
    letter-spacing: 0.065em;
    text-transform: uppercase;
    color: rgba(71, 85, 105, 0.82);
  }

  .tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-row td:nth-child(3) {
    grid-column: 1 / 3;
  }

  .tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-row__actions {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: stretch;
    align-items: flex-end;
  }

  .tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-row__actions::before {
    content: "";
    display: none;
  }
}

@media (max-width: 520px) {
  .tpm-pe-form #tpm-price-tier-wrap {
    padding: 0.45rem;
  }

  .tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-row {
    grid-template-columns: 1fr !important;
    gap: 0.38rem;
    padding: 0.48rem;
  }

  .tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-row td:nth-child(3),
  .tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-row__actions {
    grid-column: auto;
    grid-row: auto;
  }

  .tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-row__actions,
  .tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-remove,
  .tpm-pe-form #tpm-price-tier-add {
    width: 100% !important;
  }

  .tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-remove {
    min-width: 0 !important;
  }
}

/* Collapsible editor sections */
.tpm-pe-form .tpm-pe-collapse {
  overflow: hidden;
}

.tpm-pe-form .tpm-pe-collapse__summary {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.75rem;
  margin: calc(clamp(0.6rem, 0.8vw, 0.9rem) * -1);
  margin-bottom: 0;
  padding: 0.7rem clamp(0.68rem, 0.9vw, 0.95rem);
  border-bottom: 0;
  border-radius: inherit;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.tpm-pe-form .tpm-pe-collapse[open] > .tpm-pe-collapse__summary {
  margin-bottom: 0.62rem;
  border-bottom: 1px solid rgba(26, 43, 54, 0.06);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background:
    radial-gradient(circle at 100% 0, rgba(196, 122, 44, 0.16), transparent 16rem),
    linear-gradient(135deg, rgba(255, 248, 239, 0.96), rgba(255, 255, 255, 0.82));
  box-shadow: inset 0 -1px 0 rgba(196, 122, 44, 0.13);
}

.tpm-pe-form .tpm-pe-collapse__summary::-webkit-details-marker {
  display: none;
}

.tpm-pe-form .tpm-pe-collapse__summary::after {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  color: var(--tpm-accent-deep);
  background: rgba(250, 240, 230, 0.9);
  box-shadow: inset 0 0 0 1px rgba(196, 122, 44, 0.22);
  font-size: 1rem;
  font-weight: 850;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.tpm-pe-form .tpm-pe-collapse[open] > .tpm-pe-collapse__summary::after {
  content: "–";
  transform: rotate(180deg);
}

.tpm-pe-form .tpm-pe-collapse__summary:hover::after,
.tpm-pe-form .tpm-pe-collapse__summary:focus-visible::after {
  color: #fff;
  background: var(--tpm-accent);
}

.tpm-pe-form .tpm-pe-collapse.is-active > .tpm-pe-collapse__summary,
.tpm-pe-form .tpm-pe-collapse:focus-within > .tpm-pe-collapse__summary {
  background:
    radial-gradient(circle at 100% 0, rgba(37, 99, 235, 0.11), transparent 15rem),
    linear-gradient(135deg, rgba(255, 248, 239, 0.98), rgba(239, 246, 255, 0.82));
  box-shadow:
    inset 3px 0 0 var(--tpm-accent),
    inset 0 -1px 0 rgba(196, 122, 44, 0.16);
}

.tpm-pe-form .tpm-pe-collapse__summary:focus-visible {
  outline: 3px solid rgba(196, 122, 44, 0.22);
  outline-offset: -3px;
}

.tpm-pe-form .tpm-pe-collapse__copy {
  display: grid;
  gap: 0.14rem;
  min-width: 0;
}

.tpm-pe-form .tpm-pe-collapse__title {
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  color: var(--tpm-accent-deep);
}

.tpm-pe-form .tpm-pe-collapse__meta {
  max-width: 58rem;
  color: #667b88;
  font-size: 0.72rem;
  line-height: 1.35;
}

.tpm-pe-form .tpm-pe-collapse__status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: max-content;
  padding: 0.22rem 0.52rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  line-height: 1.25;
  white-space: nowrap;
}

.tpm-pe-form .tpm-pe-collapse__status[data-state="filled"] {
  color: #166534;
  background: rgba(220, 252, 231, 0.86);
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.22);
}

.tpm-pe-form .tpm-pe-collapse__status[data-state="empty"] {
  color: #9a3412;
  background: rgba(255, 237, 213, 0.92);
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.28);
}

.tpm-pe-form .tpm-pe-collapse.is-empty > .tpm-pe-collapse__summary {
  box-shadow:
    inset 3px 0 0 #f97316,
    inset 0 -1px 0 rgba(249, 115, 22, 0.14);
}

.tpm-pe-form .tpm-pe-collapse:not([open]) {
  padding-bottom: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.7));
}

.tpm-pe-form .tpm-pe-collapse:not([open]) > .tpm-pe-collapse__summary:hover {
  background: rgba(255, 251, 246, 0.72);
}

.tpm-pe-form .tpm-manage-metabox--core.tpm-pe-collapse > .tpm-pe-collapse__summary {
  background:
    radial-gradient(circle at 100% 0, rgba(196, 122, 44, 0.08), transparent 16rem),
    rgba(255, 253, 249, 0.82);
}

@media (max-width: 640px) {
  .tpm-pe-form .tpm-pe-collapse__summary {
    grid-template-columns: minmax(0, 1fr) auto 1.65rem;
    padding: 0.62rem 0.56rem;
    gap: 0.46rem;
  }

  .tpm-pe-form .tpm-pe-collapse__summary::after {
    width: 1.55rem;
    height: 1.55rem;
  }

  .tpm-pe-form .tpm-pe-collapse__title {
    font-size: 0.7rem;
  }

  .tpm-pe-form .tpm-pe-collapse__meta {
    font-size: 0.67rem;
  }

  .tpm-pe-form .tpm-pe-collapse__status {
    padding: 0.18rem 0.42rem;
    font-size: 0.58rem;
  }

  .tpm-pe-field__label-row {
    align-items: stretch;
    flex-direction: column;
    gap: 0.32rem;
  }

  .tpm-pe-ai-button {
    width: 100%;
  }
}

/* Information repeaters: clearer spacing and hierarchy */
.tpm-pe-form .tpm-pe-collapse > .tpm-repeater {
  display: grid;
  gap: 0.48rem;
  margin: 0;
  padding: 0.58rem;
  border-radius: 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(248, 250, 252, 0.58));
  box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.10);
}

.tpm-pe-form .tpm-pe-collapse > .tpm-repeater + .tpm-repeater {
  margin-top: 0.62rem;
}

.tpm-pe-form .tpm-repeater__title {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  margin: 0 !important;
  color: #102a3a;
  font-size: 0.86rem;
  font-weight: 850;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.tpm-pe-form .tpm-repeater__title::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--tpm-accent);
  box-shadow: 0 0 0 4px rgba(196, 122, 44, 0.12);
}

.tpm-pe-form .tpm-repeater__title strong {
  font: inherit;
}

.tpm-pe-form .tpm-repeater__list {
  gap: 0.42rem;
}

.tpm-pe-form .tpm-repeater__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2rem;
  align-items: center;
  gap: 0.42rem;
  margin: 0;
  padding: 0.38rem;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow:
    inset 0 0 0 1px rgba(148, 163, 184, 0.14),
    0 4px 14px rgba(15, 23, 42, 0.025);
}

.tpm-pe-form .tpm-repeater__row:hover {
  background: #fff;
  box-shadow:
    inset 0 0 0 1px rgba(196, 122, 44, 0.18),
    0 6px 18px rgba(15, 23, 42, 0.04);
}

.tpm-pe-form .tpm-repeater__row-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.42rem;
}

.tpm-pe-form .tpm-repeater__row .tpm-repeater__input {
  min-height: 2.05rem;
  padding: 0.36rem 0.58rem;
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.72);
  font-size: 0.8rem;
}

.tpm-pe-form .tpm-repeater__row-ai {
  display: flex;
  justify-content: flex-end;
  min-width: max-content;
}

.tpm-pe-form .tpm-repeater__row-ai .button-small {
  min-height: 2rem !important;
  padding: 0.28rem 0.58rem !important;
  border-radius: 9px !important;
  color: #68411f !important;
  background: rgba(250, 240, 230, 0.72) !important;
}

.tpm-pe-form .tpm-repeater__row .tpm-repeater__remove {
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  border-radius: 10px !important;
  color: #8a2630 !important;
  background: rgba(254, 242, 242, 0.68) !important;
}

.tpm-pe-form .tpm-repeater > p:not(.tpm-repeater__title) {
  margin: 0 !important;
}

.tpm-pe-form .tpm-repeater-add {
  width: fit-content;
  min-height: 2rem !important;
  padding: 0.32rem 0.72rem !important;
  border-radius: 999px !important;
  font-size: 0.74rem !important;
  font-weight: 800 !important;
}

@media (max-width: 720px) {
  .tpm-pe-form .tpm-pe-collapse > .tpm-repeater {
    padding: 0.48rem;
  }

  .tpm-pe-form .tpm-repeater__row,
  .tpm-pe-form .tpm-repeater__row-main {
    grid-template-columns: 1fr;
  }

  .tpm-pe-form .tpm-repeater__row-ai,
  .tpm-pe-form .tpm-repeater__row .tpm-repeater__remove,
  .tpm-pe-form .tpm-repeater-add {
    width: 100%;
  }

  .tpm-pe-form .tpm-repeater__row-ai .button-small {
    width: 100%;
    justify-content: center;
  }
}

/* Product Info pricing: full-width responsive workspace */
.tpm-pe-form .tpm-pinfo {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
  gap: clamp(0.55rem, 0.8vw, 0.85rem);
  align-items: stretch;
}

.tpm-pe-form .tpm-pinfo__block--pricing {
  grid-column: 1 / -1 !important;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.58rem;
  padding: clamp(0.62rem, 0.82vw, 0.9rem);
  overflow: hidden;
}

.tpm-pe-form .tpm-pinfo__block--region,
.tpm-pe-form .tpm-pinfo__block--duration {
  grid-column: span 6 !important;
}

.tpm-pe-form .tpm-pinfo__block--pricing .tpm-pinfo__block-label {
  margin: 0;
}

.tpm-pe-form .tpm-pinfo__radios {
  display: grid;
  grid-template-columns: repeat(2, minmax(10rem, max-content)) minmax(12rem, 1fr);
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.tpm-pe-form .tpm-pinfo__block--pricing > .tpm-pinfo__hint {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin: -0.35rem 0 0 !important;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1.35;
}

.tpm-pe-form #tpm-price-fixed-wrap,
.tpm-pe-form #tpm-price-tier-wrap {
  width: 100%;
  max-width: none;
  margin-top: 0;
}

.tpm-pe-form #tpm-price-fixed-wrap {
  padding: clamp(0.46rem, 0.65vw, 0.68rem);
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0, rgba(196, 122, 44, 0.075), transparent 15rem),
    rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.10);
}

.tpm-pe-form #tpm-price-fixed-wrap .tpm-pinfo__price-grid {
  display: grid;
  grid-template-columns: minmax(13rem, 1.1fr) minmax(12rem, 1fr) minmax(12rem, 1fr);
  gap: 0.58rem;
}

.tpm-pe-form #tpm-price-fixed-wrap .tpm-pinfo__price-row {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 0.42rem;
  min-height: 0;
  padding: 0.62rem;
  border: 0;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow:
    inset 0 0 0 1px rgba(148, 163, 184, 0.16),
    0 8px 22px rgba(15, 23, 42, 0.035);
}

.tpm-pe-form #tpm-price-fixed-wrap .tpm-pinfo__price-row:first-child {
  background:
    radial-gradient(circle at 100% 0, rgba(196, 122, 44, 0.10), transparent 9rem),
    rgba(255, 251, 246, 0.94);
  box-shadow:
    inset 0 0 0 1px rgba(196, 122, 44, 0.22),
    0 8px 22px rgba(15, 23, 42, 0.035);
}

.tpm-pe-form #tpm-price-fixed-wrap .tpm-pinfo__price-row .tpm-pinfo__field-label {
  order: 1;
  margin: 0;
  color: #334155;
}

.tpm-pe-form #tpm-price-fixed-wrap .tpm-pinfo__price-row .tpm-pinfo__input {
  order: 2;
  min-height: 2.25rem;
  border-radius: 11px;
  font-size: 0.82rem;
  font-weight: 650;
}

.tpm-pe-form #tpm-price-fixed-wrap .tpm-pinfo__price-toggle {
  order: 3;
  align-self: end;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.42rem;
  margin: 0;
  padding: 0.45rem 0.52rem;
  border-radius: 11px;
  color: #425466;
  background: rgba(248, 250, 252, 0.76);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.13);
}

.tpm-pe-form #tpm-price-fixed-wrap .tpm-pinfo__price-toggle span {
  line-height: 1.35;
}

.tpm-pe-form #tpm-price-fixed-wrap .tpm-pinfo__price-panel > .tpm-pinfo__hint,
.tpm-pe-form #tpm-price-fixed-wrap > .tpm-pinfo__hint {
  margin: 0.58rem 0 0 !important;
  max-width: 52rem;
  color: #607789;
}

@media (min-width: 1280px) {
  .tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-table thead tr,
  .tpm-pe-form #tpm-price-tier-wrap .tpm-price-tier-row {
    grid-template-columns: minmax(8rem, 0.7fr) minmax(8rem, 0.7fr) minmax(18rem, 1.7fr) 2.35rem !important;
  }
}

@media (max-width: 1100px) {
  .tpm-pe-form #tpm-price-fixed-wrap .tpm-pinfo__price-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .tpm-pe-form #tpm-price-fixed-wrap .tpm-pinfo__price-row {
    grid-template-columns: minmax(8rem, 0.7fr) minmax(10rem, 1fr) minmax(12rem, 1.1fr);
    grid-template-rows: auto;
    align-items: center;
  }

  .tpm-pe-form #tpm-price-fixed-wrap .tpm-pinfo__price-row:first-child {
    grid-template-columns: minmax(8rem, 0.7fr) minmax(10rem, 1fr);
  }
}

@media (max-width: 760px) {
  .tpm-pe-form .tpm-pinfo,
  .tpm-pe-form .tpm-pinfo__block--region,
  .tpm-pe-form .tpm-pinfo__block--duration {
    grid-template-columns: 1fr !important;
    grid-column: 1 / -1 !important;
  }

  .tpm-pe-form .tpm-pinfo__radios {
    grid-template-columns: 1fr;
  }

  .tpm-pe-form .tpm-pinfo__block--pricing > .tpm-pinfo__hint {
    width: 100%;
    border-radius: 12px;
  }

  .tpm-pe-form #tpm-price-fixed-wrap .tpm-pinfo__price-row,
  .tpm-pe-form #tpm-price-fixed-wrap .tpm-pinfo__price-row:first-child {
    grid-template-columns: 1fr;
  }

  .tpm-pe-form #tpm-price-fixed-wrap .tpm-pinfo__price-toggle {
    align-self: stretch;
  }
}

/* Products list mobile: product grid cards (matches frontend tpm-card) */
@media (max-width: 720px) {
  .tpm-manage-panel--products {
    padding: 0.35rem 0.45rem 0.55rem;
    border-radius: 0;
  }

  .tpm-plist__head {
    margin-bottom: 0.35rem !important;
  }

  .tpm-plist__head-copy h1 {
    font-size: 1.05rem;
  }

  .tpm-plist__head-copy .description {
    display: none;
  }

  .tpm-plist__filters {
    display: flex;
    gap: 0.3rem;
    overflow-x: auto;
    margin-bottom: 0.4rem;
    padding: 0.1rem 0;
    scrollbar-width: none;
  }

  .tpm-plist__filters::-webkit-scrollbar {
    display: none;
  }

  .tpm-manage-panel--products .tpm-manage-subnav__link {
    padding: 0.2rem 0.5rem;
    font-size: 0.72rem;
    white-space: nowrap;
  }

  .tpm-plist__inline-hint {
    display: none;
  }

  .tpm-plist__table-wrap {
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    max-height: none;
  }

  .tpm-plist__table,
  .tpm-plist__table thead,
  .tpm-plist__table tbody,
  .tpm-plist__table tr,
  .tpm-plist__table td {
    display: block;
    width: 100%;
  }

  .tpm-plist__table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }

  .tpm-plist__table thead {
    display: none !important;
  }

  .tpm-plist__table tbody {
    display: grid;
    gap: clamp(10px, 2.5vw, 14px);
  }

  .tpm-plist__row--card {
    position: relative;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
    padding: 0;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid color-mix(in srgb, var(--tpm-line) 65%, transparent);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  .tpm-plist__row--card:active {
    transform: translateY(-1px);
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
  }

  .tpm-plist__row:hover td {
    background: transparent !important;
  }

  .tpm-plist__table td {
    padding: 0;
    border: 0;
    background: transparent !important;
  }

  .tpm-plist__cell--id,
  .tpm-plist__cell--updated,
  .tpm-plist__cell--region,
  .tpm-plist__cell--internal-notes,
  .tpm-plist__slug {
    display: none !important;
  }

  .tpm-plist__col--category,
  .tpm-plist__cell--category,
  .tpm-plist__col--duration,
  .tpm-plist__cell--duration {
    display: block !important;
    width: auto !important;
    max-width: none;
  }

  /* Hero media */
  .tpm-plist__cell--thumb {
    grid-row: 1;
    grid-column: 1;
    position: relative;
    aspect-ratio: 16 / 10;
    background: #0b1220;
    overflow: hidden;
  }

  .tpm-plist__cell--thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.55) 100%);
    pointer-events: none;
  }

  .tpm-plist__thumb {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .tpm-plist__thumb-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    transform: scale(1.01);
  }

  .tpm-plist__thumb-placeholder {
    min-height: 100%;
    background: radial-gradient(circle at 30% 20%, rgba(31, 111, 104, 0.35), rgba(11, 18, 32, 1));
  }

  /* Overlays on hero */
  .tpm-plist__cell--status,
  .tpm-plist__cell--category,
  .tpm-plist__cell--price,
  .tpm-plist__cell--duration {
    grid-row: 1;
    grid-column: 1;
    z-index: 2;
    width: auto !important;
    pointer-events: auto;
  }

  .tpm-plist__cell--category {
    display: flex !important;
    align-self: start;
    justify-self: start;
    margin: 10px 12px 0;
    max-width: calc(50% - 1.1rem);
  }

  .tpm-plist__table .tpm-meta-inline--categories .tpm-meta-inline__text {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.6rem;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: rgba(15, 23, 42, 0.82);
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1.2;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .tpm-plist__cell--status {
    display: flex !important;
    align-self: start;
    justify-self: end;
    margin: 10px 12px 0;
    max-width: calc(50% - 1.1rem);
  }

  .tpm-plist__table .tpm-meta-inline--status .tpm-meta-inline__text {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.6rem;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: rgba(15, 23, 42, 0.82);
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1.2;
    white-space: nowrap;
    max-width: 8.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .tpm-plist__cell--price {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    align-self: end;
    justify-self: start;
    gap: 2px;
    margin: 0 0 10px 12px;
    min-width: 0;
    max-width: calc(100% - 7rem);
    color: #fff;
  }

  .tpm-plist__cell--price::before {
    content: "Start From";
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.82);
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
  }

  .tpm-plist__table .tpm-meta-inline--price .tpm-meta-inline__text {
    padding: 0;
    margin: 0;
    border: 0;
    color: #fff;
    font-size: clamp(0.95rem, 4.2vw, 1.12rem);
    font-weight: 950;
    line-height: 1.2;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
  }

  .tpm-plist__cell--duration {
    display: flex !important;
    align-items: flex-end;
    align-self: end;
    justify-self: end;
    margin: 0 12px 10px 0;
  }

  .tpm-plist__table .tpm-meta-inline--duration .tpm-meta-inline__text {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.74rem;
    font-weight: 900;
    line-height: 1.2;
    white-space: nowrap;
    backdrop-filter: blur(6px);
  }

  /* Card body */
  .tpm-plist__table td.tpm-plist__cell--product {
    grid-row: 2;
    grid-column: 1;
    padding: 0.75rem 1rem 0.45rem !important;
    min-width: 0;
  }

  .tpm-plist__table .tpm-meta-inline--title .tpm-meta-inline__text {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    padding: 0;
    margin: 0;
    border: 0;
    color: color-mix(in srgb, var(--tpm-ink) 88%, #64748b);
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.35;
    white-space: normal;
  }

  .tpm-plist__excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0.28rem 0 0;
    padding: 0;
    color: color-mix(in srgb, var(--tpm-muted) 78%, #94a3b8);
    font-size: 0.84rem;
    font-weight: 450;
    line-height: 1.48;
  }

  .tpm-plist__cell--region::before,
  .tpm-plist__cell--category::before,
  .tpm-plist__cell--duration::before,
  .tpm-plist__cell--status::before,
  .tpm-plist__cell--actions::before,
  .tpm-plist__cell--thumb::before,
  .tpm-plist__cell--product::before,
  .tpm-plist__cell--id::before {
    display: none !important;
    content: none !important;
  }

  .tpm-plist__table .tpm-meta-inline--title .tpm-meta-inline__text:hover,
  .tpm-plist__table .tpm-meta-inline--title .tpm-meta-inline__text:focus,
  .tpm-plist__table .tpm-meta-inline--region .tpm-meta-inline__text:hover,
  .tpm-plist__table .tpm-meta-inline--region .tpm-meta-inline__text:focus,
  .tpm-plist__table .tpm-meta-inline--categories .tpm-meta-inline__text:hover,
  .tpm-plist__table .tpm-meta-inline--categories .tpm-meta-inline__text:focus,
  .tpm-plist__table .tpm-meta-inline--duration .tpm-meta-inline__text:hover,
  .tpm-plist__table .tpm-meta-inline--duration .tpm-meta-inline__text:focus,
  .tpm-plist__table .tpm-meta-inline--price .tpm-meta-inline__text:hover,
  .tpm-plist__table .tpm-meta-inline--price .tpm-meta-inline__text:focus {
    background: transparent;
    border-color: transparent;
  }

  /* Card footer */
  .tpm-plist__table td.tpm-plist__cell--actions {
    grid-row: 4;
    grid-column: 1;
    margin-top: 0;
    padding: 0.15rem 1rem 0.65rem !important;
    border-top: 0 !important;
  }

  .tpm-plist__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
  }

  .tpm-plist__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 0.84rem;
    font-weight: 600;
    color: color-mix(in srgb, var(--tpm-accent-deep) 72%, #475569);
  }

  .tpm-plist__action:first-child::after {
    content: " →";
    opacity: 0.75;
    font-weight: 500;
  }

  .tpm-plist__action:hover {
    background: transparent;
    box-shadow: none;
    color: var(--tpm-accent);
  }

  .tpm-plist__action:not(:first-child):not(.tpm-plist__action--danger) {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border-radius: 999px;
    font-size: 0;
    color: color-mix(in srgb, var(--tpm-ink) 48%, #94a3b8);
    background: color-mix(in srgb, var(--tpm-ink) 4%, #f8fafc);
    border: 1px solid color-mix(in srgb, var(--tpm-line) 55%, transparent);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M9 6l6 6-6 6' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
  }

  .tpm-plist__action--danger {
    flex-shrink: 0;
    padding: 0.2rem 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #b42318;
    background: transparent;
    border: 0;
  }

  .tpm-plist__action--danger:hover {
    background: transparent;
    color: #912018;
  }
}
