/* =============================================================
   Preloved Seller Portal — v1.2.2
   ============================================================= */
:root {
  --psp-green:      #2d4a3e;
  --psp-green-dark: #1e3329;
  --psp-amber:      #d4940a;
  --psp-bg:         #f6f5ef;
  --psp-border:     #deded4;
  --psp-text:       #1f241f;
  --psp-muted:      #6c716b;
  --psp-error:      #b42318;
  --psp-success:    #147a42;
  --psp-radius:     16px;
  --psp-shadow:     0 12px 35px rgba(20,30,25,.10);
}

/* ── Base card / wrapper ── */
.psp-card, .psp-listing, .psp-dashboard {
  max-width: 1080px;
  margin: 24px auto;
  background: #fff;
  border-radius: var(--psp-radius);
  box-shadow: var(--psp-shadow);
  overflow: hidden;
  color: var(--psp-text);
  /* FIX: use inherit so the theme font always wins */
  font-family: inherit;
}
/* FIX: ensure all child elements inherit the theme font */
.psp-card *, .psp-listing *, .psp-dashboard *, .psp-notice * {
  font-family: inherit;
}

.psp-card { display: flex; }

/* ── Sidebar ── */
.psp-side {
  width: 330px;
  background: var(--psp-green);
  color: #fff;
  padding: 38px;
  box-sizing: border-box;
  flex-shrink: 0;
}
.psp-side h2 { font-size: 34px; line-height: 1.1; margin: 18px 0; color: #fff; font-family: inherit; }
.psp-side h2 span { color: var(--psp-amber); }
.psp-side p, .psp-side li { opacity: .9; }
.psp-side ul { padding-left: 18px; }

.psp-logo {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--psp-amber);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 22px;
}

/* ── Main section ── */
.psp-main { flex: 1; padding: 38px; }
.psp-main h3,
.psp-listing h2,
.psp-dashboard h2 { margin: 0 0 18px; font-size: 30px; font-family: inherit; }

/* ── Progress bar ── */
.psp-progress {
  display: flex;
  gap: 8px;
  margin: 0 0 28px;
}
.psp-progress span {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  border-radius: 999px;
  background: var(--psp-bg);
  color: var(--psp-muted);
  font-size: 13px;
  font-weight: 700;
  /* FIX: prevent text from clipping — allow wrapping */
  white-space: normal;
  word-break: break-word;
}
.psp-progress span.active { background: var(--psp-green); color: #fff; }
.psp-progress span.done   { background: var(--psp-green); color: #fff; opacity: .85; }

/* ── Form elements ── */
.psp-form label {
  display: block;
  margin: 16px 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 800;
  color: var(--psp-muted);
}
.psp-form input,
.psp-form select,
.psp-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--psp-border);
  border-radius: 10px;
  padding: 13px 44px 13px 44px; /* left padding for icon, right for select arrow */
  font: inherit;
  background: #fff;
  min-height: 52px;
  /* Icons via background-image */
  background-repeat: no-repeat;
  background-position: 15px center;
  background-size: 17px 17px;
}
.psp-form textarea {
  min-height: 110px;
  padding-top: 14px;
  background-position: 15px 16px;
}
.psp-form select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
}
.psp-form input:focus,
.psp-form select:focus,
.psp-form textarea:focus {
  outline: 2px solid rgba(212,148,10,.2);
  border-color: var(--psp-amber);
}
.psp-form label + input,
.psp-form label + select,
.psp-form label + textarea { margin-bottom: 8px; }

/* Field icons */
.psp-form input[type="email"],
.psp-form input[name*="email"] {
  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' stroke='%23889483' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='20' height='16' x='2' y='4' rx='2'/%3E%3Cpath d='m22 7-10 6L2 7'/%3E%3C/svg%3E");
}
.psp-form input[type="password"],
.psp-form input[name*="password"] {
  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' stroke='%23889483' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
}
.psp-form input[type="tel"],
.psp-form input[name*="phone"] {
  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' stroke='%23889483' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2A19.8 19.8 0 0 1 3.08 5.18 2 2 0 0 1 5.06 3h3a2 2 0 0 1 2 1.72c.12.89.33 1.76.62 2.6a2 2 0 0 1-.45 2.11L9 10.7a16 16 0 0 0 4.3 4.3l1.27-1.23a2 2 0 0 1 2.11-.45c.84.29 1.71.5 2.6.62A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E");
}
.psp-form input[name*="first"],
.psp-form input[name*="last"] {
  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' stroke='%23889483' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21a8 8 0 0 0-16 0'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
}
.psp-form input[name*="store"] {
  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' stroke='%23889483' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21h18'/%3E%3Cpath d='M5 21V7l8-4v18'/%3E%3Cpath d='M19 21V11l-6-4'/%3E%3Cpath d='M9 9v.01'/%3E%3Cpath d='M9 12v.01'/%3E%3Cpath d='M9 15v.01'/%3E%3C/svg%3E");
}
.psp-form input[name*="street"],
.psp-form input[name*="suburb"],
.psp-form input[name*="city"] {
  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' stroke='%23889483' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 6-8 12-8 12S4 16 4 10a8 8 0 1 1 16 0Z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
}
.psp-form input[name*="title"],
.psp-form input[name*="subject"],
.psp-form input[name*="author"],
.psp-form input[name*="isbn"],
.psp-form input[name*="year"],
.psp-form input[name*="edition"],
.psp-form textarea {
  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' stroke='%23889483' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'/%3E%3Cpath d='M4 4.5A2.5 2.5 0 0 1 6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5z'/%3E%3C/svg%3E");
}
.psp-form input[name*="price"] {
  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' stroke='%23889483' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h8a5 5 0 0 1 0 10H6z'/%3E%3Cpath d='M6 13h8l4 8'/%3E%3Cpath d='M6 3v18'/%3E%3C/svg%3E");
}
.psp-form input[name*="stock"] {
  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' stroke='%23889483' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7.5 4.27 9 5.15'/%3E%3Cpath d='M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z'/%3E%3Cpath d='m3.3 7 8.7 5 8.7-5'/%3E%3Cpath d='M12 22V12'/%3E%3C/svg%3E");
}
.psp-form select {
  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' stroke='%23889483' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 6h13'/%3E%3Cpath d='M8 12h13'/%3E%3Cpath d='M8 18h13'/%3E%3Cpath d='M3 6h.01'/%3E%3Cpath d='M3 12h.01'/%3E%3Cpath d='M3 18h.01'/%3E%3C/svg%3E");
}
.psp-form select[name*="province"] {
  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' stroke='%23889483' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 6-8 12-8 12S4 16 4 10a8 8 0 1 1 16 0Z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
}

/* ── Grid helpers ── */
.psp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.psp-row p { margin: 0; }

/* ── Step visibility ── */
.psp-step { display: none; }
.psp-step.active { display: block; }
.psp-step-label { text-transform: uppercase; font-size: 12px; font-weight: 800; color: var(--psp-amber); letter-spacing: .08em; }

/* ── Utility text ── */
.psp-hint { font-size: 13px; color: var(--psp-muted); margin-top: 6px; }
.psp-store-check { display: block; margin-top: 6px; }
.psp-store-check.ok  { color: var(--psp-success); }
.psp-store-check.bad { color: var(--psp-error); }
.psp-error { display: none; margin: 14px 0; font-weight: 700; color: var(--psp-error); }

/* ── Buttons ── */
.psp-btn, .psp-small {
  appearance: none;
  border: 0;
  border-radius: 10px;
  background: var(--psp-green);
  color: #fff !important;
  padding: 13px 22px;
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  line-height: 1.2;
  /* FIX: no margin-top here — controlled by .psp-actions */
}
.psp-btn:hover, .psp-small:hover { background: var(--psp-green-dark); color: #fff; }
.psp-btn:disabled, .psp-small:disabled { opacity: .65; cursor: wait; }
.psp-btn-light {
  background: var(--psp-bg);
  color: var(--psp-text) !important;
  border: 1px solid var(--psp-border);
}
.psp-btn-light:hover { background: #ecebe3; color: var(--psp-text) !important; }

/* ── Actions row ── */
/* FIX: actions always have top spacing; buttons inside never need their own margin-top */
.psp-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 22px;
  flex-wrap: wrap;
}
.psp-actions .psp-btn { margin-top: 0; }
.psp-dashboard-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.psp-dashboard-actions .psp-btn { margin-top: 0; }

/* ── Notices ── */
.psp-success {
  background: #eefaf3;
  border: 1px solid #bfe8cc;
  color: #123b24;
  border-radius: 14px;
  padding: 24px;
  margin-top: 18px;
}
.psp-notice {
  max-width: 900px;
  margin: 18px auto;
  padding: 14px 18px;
  border-radius: 12px;
  background: #eef3f0;
  border: 1px solid var(--psp-border);
}
.psp-notice-error   { background: #fff1f0; }
.psp-notice-warning { background: #fff8e6; }

/* ── Listing wrapper ── */
.psp-listing { padding: 34px; box-sizing: border-box; }

/* ── Condition / size choice cards ── */
.psp-choice-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 8px; }
.psp-size-grid   { grid-template-columns: repeat(5,1fr); }
.psp-choice-list { display: grid; gap: 12px; }
.psp-choice {
  display: block;
  border: 1px solid var(--psp-border);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
  cursor: pointer;
}
.psp-choice input  { display: none; }
.psp-choice strong { display: block; }
.psp-choice small  { display: block; color: var(--psp-muted); margin-top: 4px; }
.psp-choice.selected {
  border-color: var(--psp-green);
  box-shadow: 0 0 0 2px rgba(45,74,62,.12);
  background: #f5faf7;
}

/* ── Commission panel ── */
.psp-commission {
  border-left: 4px solid var(--psp-amber);
  background: #fff8e8;
  padding: 14px;
  border-radius: 10px;
  margin: 14px 0;
}
.psp-commission strong,
.psp-commission small { display: block; }
.psp-commission small { color: var(--psp-muted); margin-top: 4px; }

/* ── Photo upload ── */
.psp-upload {
  border: 2px dashed var(--psp-border);
  border-radius: 14px;
  background: var(--psp-bg);
  padding: 34px;
  text-align: center;
  cursor: pointer;
}
.psp-upload strong,
.psp-upload small { display: block; }
.psp-upload small { color: var(--psp-muted); margin-top: 5px; }
.psp-upload input[type="file"] { display: none; }

.psp-preview {
  display: grid;
  grid-template-columns: repeat(6,1fr);
  gap: 10px;
  margin: 14px 0;
}
.psp-preview-item {
  aspect-ratio: 1;
  border-radius: 10px;
  background: var(--psp-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 12px;
  color: var(--psp-muted);
  text-align: center;
}
.psp-preview-item img   { width: 100%; height: 100%; object-fit: cover; }
.psp-preview-item.error { color: var(--psp-error); padding: 6px; box-sizing: border-box; }

/* ── Summary panel ── */
.psp-summary { background: var(--psp-bg); border-radius: 12px; padding: 16px; margin-top: 16px; }
.psp-summary h4 { margin: 0 0 8px; }
.psp-summary span { display: block; margin: 3px 0; }

/* ── Dashboard ── */
.psp-dashboard { padding: 30px; box-sizing: border-box; }
.psp-dashboard-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.psp-table-wrap { overflow: auto; }
.psp-table { width: 100%; border-collapse: collapse; }
.psp-table th,
.psp-table td { text-align: left; border-bottom: 1px solid var(--psp-border); padding: 12px; vertical-align: middle; }
.psp-table th  { font-size: 12px; text-transform: uppercase; color: var(--psp-muted); }
.psp-thumb     { width: 58px; height: 58px; object-fit: cover; border-radius: 9px; }
.psp-no-thumb  { font-size: 12px; color: var(--psp-muted); background: var(--psp-bg); border-radius: 8px; padding: 10px; text-align: center; }
.psp-small     { font-size: 12px; padding: 8px 12px; margin: 2px; border-radius: 8px; }
.psp-delete    { background: #9b1c1c; }
.psp-status    { display: inline-block; background: var(--psp-bg); border-radius: 999px; padding: 5px 9px; font-size: 12px; }
.psp-empty     { background: var(--psp-bg); padding: 28px; border-radius: 14px; text-align: center; }

/* ── v1.5.1: WooCommerce My Account dashboard widget ── */
.psp-dashboard-widget { margin: 22px 0; max-width: 100%; }
.psp-dashboard-widget-inner {
  background: var(--psp-bg);
  border: 1px solid var(--psp-border);
  border-radius: var(--psp-radius);
  padding: 24px;
  box-sizing: border-box;
  font-family: inherit;
}
.psp-dashboard-widget-inner * { font-family: inherit; }
.psp-dashboard-widget-inner h3 { margin: 0 0 8px; font-size: 20px; color: var(--psp-text); }
.psp-dashboard-widget-inner p  { margin: 0; color: var(--psp-muted); }
.psp-dashboard-widget-inner .psp-actions { margin-top: 16px; }

/* ── Responsive ── */
@media (max-width: 820px) {
  .psp-card        { display: block; }
  .psp-side        { width: auto; padding: 28px; }
  .psp-main,
  .psp-listing,
  .psp-dashboard   { padding: 24px; }
  .psp-row         { grid-template-columns: 1fr; }
  .psp-choice-grid,
  .psp-size-grid   { grid-template-columns: repeat(2,1fr); }
  .psp-preview     { grid-template-columns: repeat(3,1fr); }
  .psp-dashboard-header { display: block; }
  .psp-dashboard-actions { margin-top: 14px; }
  .psp-progress    { overflow: auto; }
  .psp-progress span { min-width: 80px; }
  .psp-side h2     { font-size: 28px; }
}
@media (max-width: 480px) {
  .psp-choice-grid,
  .psp-size-grid   { grid-template-columns: 1fr; }
  .psp-preview     { grid-template-columns: repeat(2,1fr); }
  .psp-actions .psp-btn { width: 100%; text-align: center; }
  .psp-main h3,
  .psp-listing h2,
  .psp-dashboard h2 { font-size: 25px; }
}


/* ── Registration-style listing layout ── */
.psp-listing-wrap.psp-card {
  display: flex;
  padding: 0;
}
.psp-listing-wrap .psp-listing-side {
  min-height: 560px;
}
.psp-listing-wrap .psp-listing-side h2 {
  font-size: 30px;
  line-height: 1.12;
}
.psp-listing-wrap .psp-listing-main {
  padding: 38px;
}
.psp-listing-wrap .psp-progress {
  margin-bottom: 28px;
}
.psp-listing-wrap .psp-choice-grid {
  grid-template-columns: repeat(3, 1fr);
}
.psp-listing-wrap .psp-size-grid {
  grid-template-columns: repeat(5, 1fr);
}
.psp-listing-wrap .psp-choice {
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 12px 14px;
}
.psp-listing-wrap .psp-choice strong {
  font-size: 13px;
}
.psp-listing-wrap .psp-actions .psp-btn:last-child {
  min-width: 180px;
}
.psp-select-search {
  margin-bottom: 0 !important;
}
.psp-select-search + .psp-search-results + select,
.psp-select-search + select {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 1px !important;
  height: 1px !important;
}
.psp-search-results {
  display: none;
  margin-top: 8px;
  margin-bottom: 14px;
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d9dfd8;
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(16, 44, 33, 0.14);
  z-index: 30;
  position: relative;
}
.psp-search-results.open {
  display: block;
}
.psp-search-result {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid #eef1ed;
  background: #fff;
  color: #183c2f;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.psp-search-result:last-child {
  border-bottom: 0;
}
.psp-search-result:hover,
.psp-search-result:focus {
  background: #f4f8f3;
}
.psp-search-result.is-empty {
  color: #7a857d;
  cursor: default;
}

/* ── Add School / University inline UI ── */
.psp-add-item-wrap {
  margin-top: 8px;
}
.psp-add-item-toggle {
  background: none;
  border: none;
  padding: 0;
  color: var(--psp-amber);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.psp-add-item-toggle:hover { color: var(--psp-green); }
.psp-add-item-form {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
}
.psp-add-item-form input[type="text"] {
  flex: 1;
  min-width: 180px;
  border-radius: 8px;
  border: 1px solid var(--psp-border);
  padding: 10px 14px;
  font: inherit;
  background: #fff;
  background-image: none;
  min-height: 44px;
  box-sizing: border-box;
}
.psp-add-item-form input[type="text"]:focus {
  outline: 2px solid rgba(212,148,10,.2);
  border-color: var(--psp-amber);
}
.psp-btn-sm {
  padding: 10px 18px;
  font-size: 14px;
  border-radius: 8px;
  white-space: nowrap;
}
.psp-add-item-msg {
  font-size: 13px;
  font-weight: 700;
}
.psp-add-item-msg.ok  { color: var(--psp-success); }
.psp-add-item-msg.err { color: var(--psp-error); }

@media (max-width: 820px) {
  .psp-listing-wrap.psp-card { display: block; }
  .psp-listing-wrap .psp-listing-side { min-height: 0; }
  .psp-listing-wrap .psp-choice-grid,
  .psp-listing-wrap .psp-size-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .psp-listing-wrap .psp-choice-grid,
  .psp-listing-wrap .psp-size-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   v1.5.0 — Refer & Earn panel + How-it-works modal
   Scoped under .psp-referral / .psp-referral-modal
========================================================= */

.psp-referral {
    background: linear-gradient(135deg, #ffffff 0%, #faf6ef 100%);
    border: 1px solid #e4ddd2;
    border-radius: 16px;
    padding: 24px 26px;
    margin: 0 0 28px;
    box-shadow: 0 2px 12px rgba(73,73,73,.04);
    font-family: 'Source Sans 3', Arial, sans-serif;
    color: #1a1a1a;
    box-sizing: border-box;
}

.psp-referral-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.psp-referral-title { flex: 1; min-width: 0; }

.psp-referral-badge {
    display: inline-block;
    background: #e98f00;
    color: #1a1a1a;
    font-family: 'Outfit', Arial, sans-serif;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.psp-referral-title h3 {
    font-family: 'Outfit', Arial, sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #494949;
    margin: 0 0 6px;
    line-height: 1.25;
}

.psp-referral-title p {
    font-size: 13.5px;
    color: #6b6b6b;
    margin: 0;
    line-height: 1.5;
}

.psp-referral-how {
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 12px;
    border-radius: 999px;
    white-space: nowrap;
    cursor: pointer;
    border: 1.5px solid #8a9489;
    background: transparent;
    color: #6e7a6d;
    font-family: 'Outfit', Arial, sans-serif;
    font-weight: 600;
    transition: background .2s, color .2s;
}
.psp-referral-how:hover { background: #8a9489; color: #fff; }

.psp-referral-link-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: stretch;
}

.psp-referral-link-wrap { flex: 1; min-width: 0; }

.psp-referral-link-input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1.5px solid #e4ddd2;
    border-radius: 999px;
    background: #fff;
    font-family: 'Source Sans 3', Arial, sans-serif;
    font-size: 13px;
    color: #494949;
    box-sizing: border-box;
    outline: none;
    transition: border-color .2s;
    text-overflow: ellipsis;
    -webkit-appearance: none;
    appearance: none;
}
.psp-referral-link-input:focus { border-color: #8a9489; }

.psp-referral-copy {
    flex-shrink: 0;
    padding: 0 22px;
    height: 44px;
    min-width: 110px;
    background: #e98f00;
    color: #1a1a1a;
    font-family: 'Outfit', Arial, sans-serif;
    font-weight: 700;
    font-size: 13px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    transition: background .2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.psp-referral-copy:hover { background: #d18000; }
.psp-referral-copy.psp-referral-copied { background: #8a9489; color: #fff; }

.psp-referral-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.psp-referral-stat {
    background: #fff;
    border: 1px solid #ede6d9;
    border-radius: 12px;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
    min-width: 0;
}

.psp-referral-stat-value {
    font-family: 'Outfit', Arial, sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #494949;
    line-height: 1.1;
    word-break: break-word;
}

.psp-referral-stat-label {
    font-size: 10.5px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
    line-height: 1.2;
}

/* Modal */
.psp-referral-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    font-family: 'Source Sans 3', Arial, sans-serif;
}
.psp-referral-modal.psp-open { display: flex; }

.psp-referral-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(26,26,26,.55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.psp-referral-modal-panel {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 32px 30px 26px;
    max-width: 460px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    box-sizing: border-box;
    max-height: 90vh;
    overflow-y: auto;
    animation: pspRefFadeIn .18s ease-out;
}

@keyframes pspRefFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.psp-referral-modal-close {
    position: absolute;
    top: 10px; right: 14px;
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: #888;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background .15s, color .15s;
}
.psp-referral-modal-close:hover { background: #f5f2ec; color: #1a1a1a; }

.psp-referral-modal-panel h4 {
    font-family: 'Outfit', Arial, sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #494949;
    margin: 0 0 18px;
    padding-right: 30px;
}

.psp-referral-steps {
    margin: 0 0 18px;
    padding: 0 0 0 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.psp-referral-steps li {
    font-size: 14px;
    color: #494949;
    line-height: 1.55;
}

.psp-referral-steps li strong { color: #1a1a1a; font-weight: 700; }

.psp-referral-fineprint {
    font-size: 12px;
    color: #888;
    margin: 0 0 18px;
    line-height: 1.5;
    padding: 12px 14px;
    background: #faf6ef;
    border-radius: 10px;
}

.psp-referral-modal-panel .psp-btn {
    display: block;
    width: 100%;
    padding: 12px 24px;
    border-radius: 999px;
    background: #e98f00;
    color: #1a1a1a;
    font-family: 'Outfit', Arial, sans-serif;
    font-weight: 700;
    font-size: 14px;
    border: none;
    cursor: pointer;
    text-align: center;
    transition: background .2s;
}
.psp-referral-modal-panel .psp-btn:hover { background: #d18000; }

/* Tablet */
@media (max-width: 780px) {
    .psp-referral { padding: 20px; margin-bottom: 22px; }
    .psp-referral-head { flex-direction: column; align-items: stretch; gap: 12px; }
    .psp-referral-how { align-self: flex-start; }
    .psp-referral-title h3 { font-size: 18px; }
    .psp-referral-stats { grid-template-columns: repeat(3, 1fr); }
}

/* Mobile */
@media (max-width: 520px) {
    .psp-referral { padding: 18px; border-radius: 12px; }
    .psp-referral-title h3 { font-size: 17px; }
    .psp-referral-title p { font-size: 13px; }
    .psp-referral-link-row { flex-direction: column; }
    .psp-referral-link-input { height: 42px; font-size: 12px; padding: 0 12px; }
    .psp-referral-copy { width: 100%; min-width: unset; }
    .psp-referral-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .psp-referral-stat-value { font-size: 16px; }
    .psp-referral-stat-label { font-size: 10px; }
    .psp-referral-modal { padding: 12px; }
    .psp-referral-modal-panel { padding: 26px 20px 22px; border-radius: 14px; }
    .psp-referral-modal-panel h4 { font-size: 18px; }
    .psp-referral-steps li { font-size: 13.5px; }
}

/* =========================================================
   v1.3.3 additions
========================================================= */

/* Custom size input */
.psp-custom-size-wrap {
    margin-top: 10px;
}
.psp-custom-size-wrap label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

/* Summary rows — clickable to edit */
#psp-summary-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.psp-summary-row {
    display: flex;
    gap: 6px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 14px;
    transition: background 0.15s;
    border: 1px solid transparent;
}
.psp-summary-row:hover {
    background: #f0f7f2;
    border-color: #c8e6c9;
}
.psp-summary-row em {
    font-style: normal;
    font-weight: 600;
    min-width: 90px;
    color: #555;
}
.psp-summary-hint {
    font-weight: 400;
    color: #888;
    font-size: 12px;
}

/* Image delete button */
.psp-preview-item {
    position: relative;
}
.psp-preview-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s;
}
.psp-preview-delete:hover {
    background: #c0392b;
}
