:root{
  --whd-pink: var(--pink, #ef6eaa);
  --whd-purple: var(--purple, #8f70d9);
  --whd-ink: var(--ink, #332b42);
  --whd-muted: var(--muted, #776d81);
  --whd-cream: var(--cream, #fffbf7);
  --whd-line: var(--line, #f0e6ed);
  --whd-radius: var(--radius, 22px);
}

.whd-portal,
.whd-portal *{box-sizing:border-box}

/* Poppishly Shop page.php limits .entry-content to 850px by default.
   Expand only the template containing the help desk shortcode. */
body:has(.whd-portal) main.standard-content.container{
  width:min(1460px,calc(100% - 48px));
  max-width:none;
  margin-inline:auto;
}
body:has(.whd-portal) main.standard-content .entry-content{
  max-width:none;
  width:100%;
}
body:has(.whd-portal) main.standard-content article{
  width:100%;
  min-width:0;
}
body:has(.whd-portal) main.standard-content article > h1{display:none}
.whd-portal{
  position:static;
  transform:none;
  left:auto;
  width:100%;
  max-width:100%;
  margin:0 auto;
  color:var(--whd-ink);
}

.whd-portal h1,
.whd-portal h2,
.whd-portal h3,
.whd-portal h4{
  font-family:'Fredoka',sans-serif;
  line-height:1.1;
  letter-spacing:-.03em;
  color:#342a43;
  margin:0;
}

.whd-portal p,
.whd-portal label,
.whd-portal input,
.whd-portal textarea,
.whd-portal select,
.whd-portal button,
.whd-portal a,
.whd-portal span,
.whd-portal small,
.whd-portal strong{
  font-family:'DM Sans',sans-serif;
}

.whd-portal a{text-decoration:none}

.whd-portal-hero,
.whd-login-card{
  position:relative;
  overflow:hidden;
  display:grid;
  grid-template-columns:minmax(0,1.4fr) minmax(260px,.9fr);
  gap:24px;
  align-items:end;
  padding:38px;
  margin:0 0 26px;
  background:linear-gradient(115deg,#fff5f6 0%,#fff1f5 55%,#fcecff 100%);
  border:1px solid #f4dce8;
  border-radius:36px;
  box-shadow:0 18px 38px rgba(143,112,217,.08);
}

.whd-login-card{grid-template-columns:1fr;padding:44px;max-width:820px;margin:18px auto}
.whd-login-card p{max-width:580px}

.whd-kicker{
  display:inline-flex;
  align-items:center;
  gap:9px;
  padding:10px 16px;
  border-radius:999px;
  background:#fff;
  color:#a46e9f;
  font-size:11px;
  letter-spacing:.08em;
  text-transform:uppercase;
  font-weight:800;
  box-shadow:0 5px 20px rgba(199,108,156,.08);
  margin-bottom:18px;
}

.whd-kicker::before{
  content:'';
  width:8px;
  height:8px;
  border-radius:999px;
  background:#e68ab9;
}

.whd-portal-hero h1,
.whd-login-card h1{
  font-size:clamp(44px,7vw,72px);
  margin:0 0 14px;
}

.whd-portal-hero p,
.whd-login-card p{
  margin:0;
  font-size:17px;
  line-height:1.8;
  color:#776d81;
}

.whd-portal-stats{
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
}

.whd-stat-card,
.whd-card{
  background:#fff;
  border:1px solid var(--whd-line);
  border-radius:28px;
  box-shadow:0 10px 30px rgba(109,59,112,.06);
}

.whd-stat-card{
  padding:18px 22px;
}

.whd-stat-card span{
  display:block;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.09em;
  font-weight:800;
  color:#8f70d9;
  margin-bottom:7px;
}

.whd-stat-card strong{
  font-family:'Fredoka',sans-serif;
  font-size:34px;
  color:#342a43;
}

.whd-front-notice{
  margin:0 0 22px;
  padding:15px 19px;
  border-radius:18px;
  background:#fff0f7;
  border:1px solid #f3d8e8;
  color:#9b4a75;
  font-weight:700;
}

.whd-home-grid,
.whd-detail-layout{
  display:grid;
  grid-template-columns:minmax(0,1.55fr) minmax(310px,.9fr);
  gap:24px;
  align-items:start;
}

.whd-home-main,
.whd-home-side,
.whd-detail-main,
.whd-detail-side{min-width:0}

.whd-card{padding:28px}

.whd-section-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  margin-bottom:22px;
}

.whd-section-head h2,
.whd-ticket-hero h2,
.whd-list-card h2,
.whd-create-card h2,
.whd-reply-card h3,
.whd-side-card h3,
.whd-thread-head h3{
  font-size:clamp(28px,4vw,42px);
}

.whd-section-head p,
.whd-thread-head p,
.whd-side-note,
.whd-reply-card p,
.whd-side-card p,
.whd-empty-state p,
.whd-ticket-meta,
.whd-breadcrumb a{
  color:var(--whd-muted);
}

.whd-ticket-list{
  display:grid;
  gap:16px;
}

.whd-ticket-card{
  display:block;
  padding:22px 24px;
  border-radius:24px;
  border:1px solid #f0e3ed;
  background:linear-gradient(180deg,#fff 0%,#fff8fb 100%);
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.whd-ticket-card:hover{
  transform:translateY(-2px);
  border-color:#eccfe0;
  box-shadow:0 14px 30px rgba(217,75,118,.09);
}

.whd-ticket-card-top,
.whd-ticket-hero-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:14px;
}

.whd-ticket-number{
  display:inline-flex;
  align-items:center;
  padding:7px 12px;
  border-radius:999px;
  background:#fff1f8;
  color:#ab4e86;
  font-size:12px;
  font-weight:800;
  letter-spacing:.06em;
}

.whd-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  padding:8px 14px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  letter-spacing:.02em;
}

.whd-pill.is-open{background:#eef8f0;color:#34724a}
.whd-pill.is-waiting{background:#fff4db;color:#9b6b00}
.whd-pill.is-closed{background:#f2edf5;color:#695c79}

.whd-ticket-card h3{
  font-size:26px;
  margin:0 0 12px;
}

.whd-ticket-meta{
  display:flex;
  flex-wrap:wrap;
  gap:10px 18px;
  font-size:14px;
  line-height:1.5;
}

.whd-ticket-meta span{
  display:inline-flex;
  align-items:center;
  gap:8px;
}

.whd-ticket-meta span::before{
  content:'';
  width:6px;
  height:6px;
  border-radius:999px;
  background:#e7bfd3;
}

.whd-empty-state{
  text-align:center;
  padding:48px 20px 30px;
}

.whd-empty-icon{
  font-family:'Fredoka',sans-serif;
  font-size:54px;
  color:#ef6eaa;
  line-height:1;
  margin-bottom:14px;
}

.whd-empty-state h3{font-size:30px;margin:0 0 12px}
.whd-empty-state p{max-width:420px;margin:0 auto;line-height:1.8}

.whd-portal input,
.whd-portal textarea,
.whd-portal select{
  display:block;
  width:100%;
  appearance:none;
  border:1px solid #dcced9;
  background:#fff;
  color:var(--whd-ink);
  border-radius:18px;
  padding:16px 18px;
  margin:8px 0 18px;
  font-size:16px;
  line-height:1.5;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9);
}

.whd-portal textarea{resize:vertical;min-height:170px}

.whd-portal input:focus,
.whd-portal textarea:focus,
.whd-portal select:focus{
  outline:none;
  border-color:#ef6eaa;
  box-shadow:0 0 0 4px rgba(239,110,170,.12);
}

.whd-portal label{
  display:block;
  color:#5c506d;
  font-weight:800;
  font-size:13px;
  letter-spacing:.03em;
}

.whd-portal form p{margin:0}

.whd-portal button,
.whd-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  border:0;
  border-radius:999px;
  padding:15px 26px;
  background:var(--whd-pink);
  color:#fff;
  font-size:14px;
  line-height:1.2;
  font-weight:800;
  cursor:pointer;
  transition:transform .18s ease, background .18s ease, box-shadow .18s ease;
  box-shadow:0 8px 20px rgba(217,75,118,.14);
}

.whd-portal button:hover,
.whd-btn:hover{background:#db5393;transform:translateY(-2px);color:#fff}

.whd-btn-secondary{
  background:#fff;
  color:#584763;
  border:2px solid #e9cddc;
  box-shadow:none;
}

.whd-btn-secondary:hover{border-color:var(--whd-pink);background:#fff;color:#584763}

.whd-login-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:28px}

.whd-ticket-hero{
  margin-bottom:24px;
  background:linear-gradient(180deg,#fff 0%,#fff8fc 100%);
}

.whd-breadcrumb{margin-bottom:18px}
.whd-breadcrumb a{font-weight:700}
.whd-breadcrumb a:hover{color:#ab4e86}
.whd-ticket-hero h2{margin:0 0 14px}

.whd-thread-head{margin-bottom:18px}
.whd-thread-front{display:flex;flex-direction:column;gap:16px}

.whd-bubble{
  width:min(88%, 780px);
  padding:18px 20px;
  border-radius:24px;
  max-width:100%;
  border:1px solid #f0e3ed;
}

.whd-bubble.whd-user{
  margin-left:auto;
  background:#fff1f8;
  border-color:#f2c9de;
}

.whd-bubble.whd-agent{
  margin-right:auto;
  background:#fff;
}

.whd-bubble.whd-system{
  width:100%;
  margin-inline:auto;
  max-width:100%;
  background:#f7f2ff;
  border-color:#e5d8ff;
}

.whd-bubble-meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:10px;
}

.whd-bubble-meta strong{
  font-family:'Fredoka',sans-serif;
  font-size:20px;
  color:#342a43;
}

.whd-bubble-meta span{font-size:13px;color:var(--whd-muted)}
.whd-bubble-body{font-size:15px;line-height:1.8;color:#4c425b}

.whd-detail-side{
  position:sticky;
  top:24px;
  align-self:start;
}

.whd-side-card{margin-top:18px}
.whd-side-note{font-size:14px;line-height:1.7;margin-top:14px}

.whd-login-card .whd-kicker,
.whd-portal-hero .whd-kicker{width:max-content}

@media (max-width: 1180px){
  .whd-bubble{width:min(86%, 100%)}
}

@media (max-width: 980px){
  .whd-portal{width:100%;max-width:100%;}
  .whd-portal-hero,
  .whd-home-grid,
  .whd-detail-layout{grid-template-columns:1fr}
  .whd-detail-side{position:static}
  .whd-portal-hero{padding:30px}
  .whd-bubble{width:min(92%, 100%)}
}

@media (max-width: 760px){
  .whd-card{padding:22px}
  .whd-portal-hero,.whd-login-card{padding:24px;border-radius:26px}
  .whd-portal-hero h1,.whd-login-card h1{font-size:clamp(36px,10vw,52px)}
  .whd-section-head h2,.whd-ticket-hero h2,.whd-list-card h2,.whd-create-card h2,.whd-reply-card h3,.whd-side-card h3,.whd-thread-head h3{font-size:32px}
  .whd-ticket-card h3{font-size:22px}
  .whd-bubble{width:100%;max-width:100%}
  .whd-ticket-meta{gap:8px 14px}
  .whd-ticket-card-top,.whd-ticket-hero-top,.whd-bubble-meta{align-items:flex-start}
  .whd-portal input,.whd-portal textarea,.whd-portal select{padding:14px 15px;font-size:15px}
  .whd-portal button,.whd-btn{width:100%}
  .whd-login-actions{display:grid;grid-template-columns:1fr;gap:10px}
}

@media(max-width:760px){body:has(.whd-portal) main.standard-content.container{width:calc(100% - 28px);padding-top:28px;padding-bottom:55px}.whd-bubble{width:100%}}

/* Frontend agent workspace – scoped to protect WooCommerce and theme pages. */
.whd-agent-portal{max-width:100%;margin-inline:auto}
.whd-agent-header{background:linear-gradient(115deg,#fff5f6,#fcecff);border:1px solid #f4dce8;border-radius:32px;padding:34px;margin-bottom:24px;display:flex;justify-content:space-between;align-items:center;gap:20px}
.whd-agent-header h1{font-size:clamp(36px,5vw,58px)}
.whd-agent-header p{color:var(--whd-muted);margin:12px 0 0}
.whd-agent-label{border-radius:40px;background:white;padding:12px 18px;color:#a46e9f;font-weight:800;white-space:nowrap}
.whd-agent-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:0 0 24px}
.whd-agent-stats>div{background:#fff;border:1px solid var(--whd-line);border-radius:22px;padding:20px 25px;display:flex;flex-direction:column;gap:5px}
.whd-agent-stats strong{font:600 36px 'Fredoka',sans-serif;color:var(--whd-ink)}
.whd-agent-stats span{color:var(--whd-muted);font-weight:700}
.whd-agent-filters{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:20px}
.whd-agent-filters a{padding:10px 17px;border-radius:40px;background:#fff1f8;color:#9e4e80;font-weight:800;font-size:13px}
.whd-agent-filters a.active{background:#ef6eaa;color:white}
.whd-agent-search{display:flex;align-items:flex-end;flex-wrap:wrap;gap:12px;margin-bottom:24px}
.whd-agent-search label{width:100%}
.whd-agent-search input[type=search]{flex:1 1 240px;margin:0}
.whd-agent-search button{flex:none}
.whd-agent-ticket-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}
.whd-agent-ticket-list .whd-ticket-card{min-width:0}
.whd-agent-ticket-heading{margin-bottom:20px}
.whd-agent-ticket-heading h2{font-size:clamp(27px,3vw,40px);margin:15px 0}
.whd-agent-ticket-info{color:var(--whd-muted);margin:18px 0 0;overflow-wrap:anywhere}
.whd-agent-panel{margin-bottom:18px}
.whd-agent-panel h3{font-size:clamp(23px,3vw,30px);margin-bottom:17px}
.whd-agent-back{display:inline-block;margin-bottom:12px;color:#9e4e80;font-weight:800}
.whd-agent-portal .whd-bubble{overflow-wrap:anywhere}
@media(max-width:850px){.whd-agent-ticket-list{grid-template-columns:1fr}.whd-agent-header{align-items:flex-start;flex-direction:column}.whd-agent-stats{gap:10px}}
@media(max-width:480px){.whd-agent-header{padding:22px}.whd-agent-stats>div{padding:14px}.whd-agent-stats strong{font-size:28px}.whd-agent-portal .whd-agent-search button{width:100%}}

/* v1.8 compact customer overview: no oversized hero or stacked stats */
.whd-portal:not(.whd-agent-portal) .whd-portal-hero{
  grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);
  align-items:center;gap:24px;padding:23px 30px;margin-bottom:22px;
  border-radius:26px;
}
.whd-portal:not(.whd-agent-portal) .whd-portal-hero h1{font-size:clamp(32px,3.8vw,47px);margin:0 0 6px}
.whd-portal:not(.whd-agent-portal) .whd-portal-hero p{font-size:14px;line-height:1.5}
.whd-portal:not(.whd-agent-portal) .whd-portal-hero .whd-kicker{margin-bottom:10px;padding:7px 12px}
.whd-portal:not(.whd-agent-portal) .whd-portal-stats{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.whd-portal:not(.whd-agent-portal) .whd-stat-card{padding:13px 15px;border-radius:16px;min-width:0}
.whd-portal:not(.whd-agent-portal) .whd-stat-card span{font-size:10px;line-height:1.25;margin-bottom:5px}
.whd-portal:not(.whd-agent-portal) .whd-stat-card strong{font-size:26px;line-height:1.1}
@media(max-width:950px){.whd-portal:not(.whd-agent-portal) .whd-portal-hero{grid-template-columns:1fr}}
@media(max-width:520px){
 .whd-portal:not(.whd-agent-portal) .whd-portal-hero{padding:20px 18px;gap:17px}
 .whd-portal:not(.whd-agent-portal) .whd-stat-card{padding:12px 9px}
 .whd-portal:not(.whd-agent-portal) .whd-stat-card span{font-size:9px;letter-spacing:0}
 .whd-portal:not(.whd-agent-portal) .whd-stat-card strong{font-size:23px}
}
/* Internal timeline: staff-only output, never included in customer shortcode. */
.whd-internal-title{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:9px;margin-bottom:16px}
.whd-internal-title h3{font-size:clamp(24px,3vw,31px);margin:0}
.whd-internal-title span,.whd-staff-tip{color:#8b7197;font-size:12px;font-weight:700}
.whd-internal-entry{border:1px solid #e6d8f2;background:#fbf8ff;border-radius:16px;padding:15px 17px;margin-top:12px;overflow-wrap:anywhere}
.whd-internal-meta{display:flex;flex-wrap:wrap;justify-content:space-between;gap:6px 14px;margin-bottom:8px}
.whd-internal-meta strong{color:#7554a5;font-weight:800}
.whd-internal-meta span,.whd-internal-empty{font-size:13px;color:#85798a}
.whd-internal-body{white-space:normal;line-height:1.65;color:#493b56}
.whd-staff-private{margin-top:20px}
.whd-agent-panel textarea[name=note]{min-height:95px}

/* v1.9: Private ticket photo collections */
.whd-image-upload{margin:16px 0 20px;padding:15px;border:1.5px dashed #e9bed5;border-radius:18px;background:#fff9fc}
.whd-image-upload label{margin-bottom:8px;font-weight:800}
.whd-image-upload input[type=file]{border:0!important;background:transparent!important;padding:5px 0!important;margin:0!important;box-shadow:none!important;font-size:13px!important}
.whd-image-upload small{display:block;line-height:1.5;font-size:12px;color:#786b83;margin-top:6px}
.whd-image-gallery,.whd-upload-previews{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(130px,100%),1fr));gap:12px;margin-top:15px;width:100%}
.whd-image-item{display:block;min-width:0;border-radius:15px;overflow:hidden;background:#fff;border:1px solid #ead8e5;box-shadow:0 4px 12px #4b29400c;text-decoration:none!important;transition:transform .15s ease}
.whd-image-item:hover{transform:translateY(-2px)}
.whd-image-item img{display:block!important;width:100%!important;height:auto!important;aspect-ratio:4/3!important;object-fit:cover!important;max-width:100%!important;border:0!important;border-radius:0!important}
.whd-image-caption{display:block!important;color:#5a4a66;font:700 11px/1.4 'DM Sans',sans-serif;padding:9px 10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.whd-image-caption small{display:block;font:500 11px/1.5 'DM Sans',sans-serif;color:#937d91;margin-top:3px;white-space:normal}
.whd-upload-previews{grid-template-columns:repeat(auto-fill,minmax(85px,1fr))}
.whd-upload-preview img{display:block;width:100%;aspect-ratio:1/1;object-fit:cover;border-radius:12px;border:1px solid #efd6e3}
.whd-upload-preview span{display:block;color:#69596e;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:3px}
.whd-internal-entry .whd-image-gallery{margin-top:10px}
@media(max-width:560px){.whd-image-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}}
.whd-agent-portal .whd-live-tools{display:flex;gap:14px;align-items:center;justify-content:flex-end;flex-wrap:wrap;margin:14px 0}.whd-agent-portal .whd-live-tools span{font-size:13px;color:#756780}.whd-agent-portal .whd-live-tools button{width:auto;padding:10px 18px;font-size:13px}
