/* Personalization.tools — OrderDesk embed (scoped; load from your app origin only) */
.pt-embed {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  color: #111827;
  text-align: left;
  box-sizing: border-box;
}
.pt-embed *,
.pt-embed *::before,
.pt-embed *::after {
  box-sizing: border-box;
}
.pt-embed a {
  color: #2563eb;
}
/* Minimal line label: PT DB id, appended inside OrderDesk’s last td */
.pt-embed.pt-embed-order-item-id {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  font-variant-numeric: tabular-nums;
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
}
/* Do not style generic table/th/td — OrderDesk’s #order_items must not inherit min-width/layout from us. */
.pt-embed.pt-order-item-card.pt-row:hover {
  background: rgba(239, 246, 255, 0.6);
}
.pt-embed .pt-btn-round {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  border: 2px solid;
  cursor: pointer;
  padding: 0;
  color: #fff;
}
.pt-embed .pt-btn-round:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.pt-embed .pt-btn-approve {
  background: #16a34a;
  border-color: #4ade80;
}
.pt-embed .pt-btn-edit {
  background: #ca8a04;
  border-color: #facc15;
}
.pt-embed .pt-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin-bottom: 8px;
}
.pt-embed .pt-tab {
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px 6px 0 0;
  border: none;
  cursor: pointer;
  background: #e5e7eb;
  color: #4b5563;
}
.pt-embed .pt-tab.pt-active {
  background: #2563eb;
  color: #fff;
}
.pt-embed .pt-thumb-wrap {
  position: relative;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.pt-embed .pt-thumb-wrap img {
  display: block;
  max-height: 240px;
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}
.pt-embed .pt-thumb-wrap.pt-thumb-wrap--busy {
  pointer-events: none;
}
.pt-embed .pt-updating-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 58, 138, 0.55);
  z-index: 10;
}
.pt-embed .pt-updating-overlay-text {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-align: center;
  padding: 0 8px;
}
.pt-embed .pt-row-busy-banner {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #1e3a8a;
  padding: 8px;
  margin-bottom: 6px;
  background: #e0e7ff;
  border-radius: 6px;
}
.pt-embed .pt-placeholder {
  min-height: 160px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  font-size: 14px;
  padding: 12px;
  text-align: center;
}
.pt-embed .pt-badges {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px;
  background: rgba(0, 0, 0, 0.45);
}
.pt-embed .pt-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
}
.pt-embed .pt-badge-appr {
  background: rgba(22, 163, 74, 0.95);
}
.pt-embed .pt-badge-edit {
  background: rgba(202, 138, 4, 0.95);
}
.pt-embed .pt-label-tpl {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #4b5563;
  margin-top: 6px;
}
.pt-embed .pt-select {
  width: 100%;
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  margin-top: 6px;
}
.pt-embed .pt-tpl-combo {
  position: relative;
  width: 100%;
  margin-top: 6px;
}
.pt-embed .pt-tpl-combo-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  min-height: 30px;
}
.pt-embed .pt-tpl-combo-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.pt-embed .pt-tpl-combo-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #111827;
}
.pt-embed .pt-tpl-combo-placeholder {
  color: #6b7280;
}
.pt-embed .pt-tpl-combo-caret {
  flex-shrink: 0;
  font-size: 12px;
  color: #9ca3af;
}
.pt-embed .pt-tpl-combo-panel {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 50;
  margin-top: 4px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  max-height: 220px;
  overflow: hidden;
}
.pt-embed .pt-tpl-combo-filter {
  width: 100%;
  font-size: 13px;
  padding: 8px;
  border: none;
  border-bottom: 1px solid #f3f4f6;
  outline: none;
  box-sizing: border-box;
}
.pt-embed .pt-tpl-combo-filter:focus {
  box-shadow: inset 0 0 0 2px #bfdbfe;
}
.pt-embed .pt-tpl-combo-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  overflow-y: auto;
  max-height: 168px;
}
.pt-embed .pt-tpl-combo-option {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 13px;
  padding: 6px 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #374151;
}
.pt-embed .pt-tpl-combo-option:hover {
  background: #eff6ff;
}
.pt-embed .pt-tpl-combo-option-empty {
  color: #6b7280;
}
.pt-embed .pt-tpl-combo-option-selected {
  background: #dbeafe;
  font-weight: 600;
}
.pt-embed .pt-tpl-combo-empty-msg {
  padding: 10px;
  text-align: center;
  font-size: 13px;
  color: #9ca3af;
}
.pt-embed .pt-match-chips {
  margin-top: 8px;
}
.pt-embed .pt-match-chips-label {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.pt-embed .pt-match-chips-hint {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 2px;
  margin-bottom: 6px;
}
.pt-embed .pt-match-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pt-embed .pt-chip-var .pt-chip-var-label {
  font-weight: 600;
}
.pt-embed .pt-chip-var .pt-chip-var-sep {
  margin: 0 3px;
  opacity: 0.65;
  font-weight: 400;
}
.pt-embed .pt-chip-var .pt-chip-var-value {
  font-weight: 500;
}
.pt-embed .pt-chip-var.pt-chip-on .pt-chip-var-label,
.pt-embed .pt-chip-var.pt-chip-on .pt-chip-var-value {
  color: inherit;
}
.pt-embed .pt-chip {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  font-size: 12px;
  line-height: 1.35;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  background: #fff;
  max-width: 100%;
  text-align: left;
}
.pt-embed .pt-chip:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.pt-embed .pt-chip-code {
  border-color: #93c5fd;
  color: #1d4ed8;
  background: #eff6ff;
}
.pt-embed .pt-chip-code.pt-chip-on {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.pt-embed .pt-chip-code.pt-chip-on .pt-mono {
  background: rgba(255, 255, 255, 0.2);
  color: inherit;
}
.pt-embed .pt-chip-var {
  border-color: #c4b5fd;
  color: #5b21b6;
  background: #f5f3ff;
}
.pt-embed .pt-chip-var.pt-chip-on {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
}
/* Unsaved toggle (API in flight): amber — distinct from saved-on blue/purple */
.pt-embed .pt-chip.pt-chip-pending-on {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.25);
}
.pt-embed .pt-chip-code.pt-chip-pending-on .pt-mono {
  background: rgba(146, 64, 14, 0.12);
  color: inherit;
}
.pt-embed .pt-chip.pt-chip-pending-off {
  background: #fff;
  border-color: #f59e0b;
  border-style: dashed;
  color: #b45309;
  opacity: 0.92;
}
.pt-embed .pt-match-chips-hint:has(+ .pt-match-chips-row .pt-chip-pending) {
  color: #b45309;
}
.pt-embed .pt-copy-btn {
  margin-top: 6px;
  width: 100%;
  font-size: 13px;
  padding: 6px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.pt-embed .pt-history {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px;
  background: #f9fafb;
  font-size: 13px;
}
.pt-embed .pt-history-row {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 6px;
  margin-bottom: 6px;
  background: #fff;
}
.pt-embed .pt-mono {
  font-family: ui-monospace, monospace;
  font-size: 13px;
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
}
.pt-embed .pt-box {
  border-radius: 6px;
  padding: 8px;
  margin-top: 6px;
}
.pt-embed .pt-box-blue {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}
.pt-embed .pt-box-gray {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}
.pt-embed .pt-input {
  width: 100%;
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  margin-top: 2px;
}
.pt-embed .pt-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.pt-embed .pt-nav button {
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #bfdbfe;
  background: #fff;
  cursor: pointer;
}
.pt-embed .pt-nav button:hover {
  background: #eff6ff;
}
.pt-embed .pt-nav button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.pt-embed .pt-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 10px;
}
.pt-embed .pt-loading {
  padding: 20px;
  text-align: center;
  color: #6b7280;
}

.pt-embed.pt-not-submitted {
  text-align: center;
  padding: 24px 16px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #bfdbfe;
  border-radius: 16px;
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.08);
}
.pt-embed .pt-not-submitted-logo {
  display: block;
  margin: 0 auto 20px;
  max-width: 220px;
  height: auto;
}
.pt-embed .pt-not-submitted-text {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: #334155;
  line-height: 1.5;
}

.pt-embed-bootstrap-host {
  min-height: 1px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
/* Fill OrderDesk .well / parent — width comes from host layout */
[data-pt-my-task]:not(.pt-embed-bootstrap-host--empty) {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.pt-embed-bootstrap-host.pt-embed-bootstrap-host--empty {
  min-height: 0;
  padding: 0;
  margin: 0;
  border: none;
  overflow: hidden;
}

.pt-embed.pt-embed-logo-well {
  text-align: center;
  padding: 12px 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.pt-embed.pt-embed-logo-well .pt-embed-well-logo {
  display: block;
  margin: 0 auto;
  max-width: 200px;
  height: auto;
}
.pt-embed.pt-loading-under-logo {
  text-align: center;
  color: #6b7280;
  font-size: 14px;
  margin: 8px 0 0;
}

.pt-embed.pt-embed-order-toolbar {
  margin-bottom: 10px;
  padding: 8px 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.pt-embed.pt-embed-order-toolbar--in-well {
  margin-top: 4px;
}

/* OrderDesk: full-width row under each line in #order_items */
#order_items tbody tr.pt-embed-inject-row td.pt-embed-inject-cell {
  padding: 12px 10px;
  background: #f8fafc;
  vertical-align: top;
  border-top: 1px solid #e2e8f0;
}
#order_items tbody tr.pt-embed-inject-row .pt-embed-inject-inner {
  display: flex;
  justify-content: stretch;
  align-items: stretch;
  flex-wrap: wrap;
}
#order_items tbody tr.pt-embed-inject-row .pt-embed-inject-inner > .pt-embed.pt-order-item-card {
  flex: 1 1 100%;
  width: 100%;
  max-width: 100%;
}

/* Injected into host-page slots (not inside [data-pt-my-task]) */
.pt-embed.pt-order-item-card {
  border: 1px solid #dbeafe;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fff;
  text-align: left;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.pt-embed .pt-card-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 12px;
}
.pt-embed .pt-card-actions-bar {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}
.pt-embed .pt-preview-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}
.pt-embed .pt-update-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}
.pt-embed .pt-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: 2px solid;
  cursor: pointer;
  background: #fff;
  transition: background 0.15s, border-color 0.15s;
}
.pt-embed .pt-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.pt-embed .pt-action-approve {
  border-color: #86efac;
  color: #15803d;
}
.pt-embed .pt-action-approve:not(:disabled):hover {
  background: #f0fdf4;
  border-color: #4ade80;
}
.pt-embed .pt-action-edit {
  border-color: #fde047;
  color: #a16207;
}
.pt-embed .pt-action-edit:not(:disabled):hover {
  background: #fefce8;
  border-color: #facc15;
}
.pt-embed .pt-action-update {
  border-color: #d8b4fe;
  color: #7e22ce;
}
.pt-embed .pt-action-update:not(:disabled):hover {
  background: #faf5ff;
  border-color: #c084fc;
}
.pt-embed .pt-personalization-heading {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #1d4ed8;
  margin-bottom: 8px;
}
.pt-embed .pt-personalization-box label,
.pt-embed .pt-personalization-box .pt-perso-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #2563eb;
  margin-bottom: 4px;
}
.pt-embed .pt-personalization-box .pt-input {
  font-size: 14px;
  padding: 7px 10px;
}
.pt-embed .pt-card-cols {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
}
.pt-embed .pt-card-preview {
  flex: 0 1 280px;
  min-width: 160px;
  max-width: 100%;
}
.pt-embed .pt-card-details {
  flex: 1 1 260px;
  min-width: 220px;
  max-width: 100%;
}
.pt-embed .pt-card-template-block {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}
.pt-embed .pt-card-template-block .pt-tpl-combo {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.pt-embed .pt-card-template-block .pt-label-tpl {
  display: block;
  margin-bottom: 4px;
}
.pt-embed .pt-embed-slot-missing {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  margin-top: 8px;
}
.pt-embed .pt-embed-slot-missing code {
  font-size: 13px;
}
