/* PD_ASSET_VERSION 1.32.0 */
[hidden] { display: none !important; }

/* Partner Desk console  v1.2.0
   Light theme only. --pd-accent is set per partner from their brand, so this
   sheet must never hardcode a brand color outside the fallback below. */

:root {
  --pd-accent: #4F46E5;
  --pd-ink: #111827;
  --pd-muted: #6B7280;
  --pd-line: #E5E7EB;
  --pd-bg: #F9FAFB;
  --pd-card: #FFFFFF;
  --pd-ok: #047857;
  --pd-warn: #B45309;
  --pd-bad: #B91C1C;
  --pd-radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--pd-bg);
  color: var(--pd-ink);
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--pd-accent); }

/* ---------- header ---------- */
.pd-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--pd-card);
  border-bottom: 1px solid var(--pd-line);
}
.pd-bar {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.pd-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--pd-ink); flex: none; }
.pd-brand img { height: 30px; width: auto; display: block; }
.pd-brand-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--pd-accent); display: block; }
.pd-brand-name { font-weight: 650; font-size: 15px; white-space: nowrap; }

.pd-nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.pd-nav a {
  color: var(--pd-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 550;
  padding: 7px 11px;
  border-radius: 8px;
  white-space: nowrap;
}
.pd-nav a:hover { background: var(--pd-bg); color: var(--pd-ink); }
.pd-nav a.is-active { color: var(--pd-accent); background: color-mix(in srgb, var(--pd-accent) 9%, white); }

.pd-bar-right { display: flex; gap: 8px; align-items: center; flex: none; }
.pd-ghost {
  background: none; border: 1px solid var(--pd-line); border-radius: 8px;
  padding: 7px 13px; font-size: 13.5px; font-weight: 550;
  color: var(--pd-muted); cursor: pointer; text-decoration: none;
}
.pd-ghost:hover { color: var(--pd-ink); border-color: var(--pd-muted); }

.pd-burger { display: none; background: none; border: 0; padding: 6px; cursor: pointer; flex: none; }
.pd-burger span { display: block; width: 22px; height: 2px; background: var(--pd-ink); margin: 4px 0; border-radius: 2px; transition: transform .18s, opacity .18s; }
.pd-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.pd-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.pd-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.pd-viewas {
  background: #FEF3C7; color: #92400E; text-align: center;
  padding: 8px 16px; font-size: 13px; font-weight: 600;
}

/* ---------- layout ---------- */
.pd-main { max-width: 1120px; margin: 0 auto; padding: 26px 20px 80px; }
.pd-page-head { margin: 0 0 22px; }
.pd-page-head h1 { font-size: 23px; margin: 0 0 6px; font-weight: 680; }
.pd-page-head p { margin: 0; color: var(--pd-muted); font-size: 14.5px; max-width: 62ch; }

.pd-card { background: var(--pd-card); border: 1px solid var(--pd-line); border-radius: var(--pd-radius); padding: 22px; margin: 0 0 18px; }
.pd-card h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--pd-muted); margin: 0 0 14px; font-weight: 650; }
.pd-card h3 { font-size: 16px; margin: 0 0 8px; font-weight: 640; }
.pd-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ---------- forms ---------- */
label { display: block; font-size: 13.5px; font-weight: 600; margin: 0 0 6px; }
input[type=text], input[type=email], input[type=password], textarea, select {
  width: 100%; padding: 11px 13px; font: inherit; font-size: 14.5px;
  border: 1px solid var(--pd-line); border-radius: 9px; background: #fff; color: var(--pd-ink);
}
input:focus, textarea:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--pd-accent) 40%, white); outline-offset: 1px; border-color: var(--pd-accent); }
textarea { min-height: 108px; resize: vertical; line-height: 1.55; }
.pd-hint { color: var(--pd-muted); font-size: 12.5px; margin: 6px 0 0; }

.pd-pw { position: relative; }
.pd-pw input { padding-right: 62px; }
.pd-pw button {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--pd-muted); font-size: 12.5px;
  font-weight: 650; cursor: pointer; padding: 6px 8px; border-radius: 6px;
}
.pd-pw button:hover { color: var(--pd-accent); background: var(--pd-bg); }

.pd-btn {
  background: var(--pd-accent); color: #fff; border: 0; border-radius: 9px;
  padding: 11px 20px; font-size: 15px; font-weight: 620; cursor: pointer;
  text-decoration: none; display: inline-block;
}
.pd-btn:hover { filter: brightness(1.07); }
.pd-btn[disabled] { opacity: .55; cursor: not-allowed; filter: none; }
.pd-btn-sec { background: #fff; color: var(--pd-ink); border: 1px solid var(--pd-line); }
.pd-btn-sec:hover { border-color: var(--pd-muted); filter: none; }
.pd-btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- notices ---------- */
.pd-note { border-radius: 10px; padding: 13px 15px; font-size: 14px; margin: 0 0 16px; }
.pd-note.good { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.pd-note.warn { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.pd-note.bad  { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.pd-note strong { display: block; margin-bottom: 3px; }
.pd-note ul { margin: 8px 0 0; padding-left: 18px; }

.pd-pill { display: inline-block; font-size: 11.5px; font-weight: 660; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }
.pd-pill.preview  { background: #EEF2FF; color: #3730A3; }
.pd-pill.applied  { background: #ECFDF5; color: #065F46; }
.pd-pill.rejected { background: #FEF2F2; color: #991B1B; }
.pd-pill.reverted { background: #F3F4F6; color: #4B5563; }
.pd-pill.queued, .pd-pill.running { background: #FFFBEB; color: #92400E; }
.pd-pill.failed { background: #FEF2F2; color: #991B1B; }

/* ---------- lists ---------- */
.pd-row { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--pd-line); }
.pd-row:last-child { border-bottom: 0; }
.pd-row-main { flex: 1; min-width: 0; }
.pd-row-main .t { font-weight: 600; font-size: 14.5px; word-break: break-word; }
.pd-row-main .s { color: var(--pd-muted); font-size: 13px; margin-top: 3px; }
.pd-row-side { flex: none; display: flex; gap: 8px; align-items: center; }
.pd-empty { color: var(--pd-muted); font-size: 14px; padding: 10px 0; }

.pd-locked { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.pd-locked span {
  font-size: 12px; background: var(--pd-bg); border: 1px solid var(--pd-line);
  border-radius: 7px; padding: 5px 10px; color: var(--pd-muted);
}

/* ---------- tooltips ---------- */
[data-tip] { position: relative; }
.pd-tip {
  position: fixed; z-index: 90; max-width: 260px;
  background: var(--pd-ink); color: #fff; font-size: 12.5px; line-height: 1.45;
  padding: 8px 11px; border-radius: 8px; pointer-events: none;
  box-shadow: 0 6px 20px rgba(0,0,0,.16);
}

/* ---------- tour ---------- */
.pd-tour-mask { position: fixed; inset: 0; background: rgba(17,24,39,.55); z-index: 80; }
.pd-tour-box {
  position: fixed; z-index: 85; background: #fff; border-radius: 12px; padding: 18px 20px;
  max-width: 340px; box-shadow: 0 18px 44px rgba(0,0,0,.24);
}
.pd-tour-box h4 { margin: 0 0 6px; font-size: 15.5px; }
.pd-tour-box p { margin: 0 0 14px; font-size: 14px; color: var(--pd-muted); }
.pd-tour-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pd-tour-step { font-size: 12.5px; color: var(--pd-muted); }
.pd-spot { position: relative; z-index: 82; box-shadow: 0 0 0 4px color-mix(in srgb, var(--pd-accent) 45%, white); border-radius: 10px; }

/* ---------- toast ---------- */
.pd-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--pd-ink); color: #fff; padding: 12px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 550; z-index: 95; max-width: 90vw;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.pd-toast.bad { background: var(--pd-bad); }

/* ---------- login ---------- */
.pd-login { max-width: 420px; margin: 10vh auto; padding: 0 20px; }
.pd-login .pd-card { padding: 28px; }
.pd-login h1 { font-size: 21px; margin: 0 0 6px; }
.pd-login .sub { color: var(--pd-muted); font-size: 14px; margin: 0 0 22px; }
.pd-login .field { margin-bottom: 16px; }

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  .pd-burger { display: block; order: -1; }
  .pd-bar { flex-wrap: wrap; gap: 12px; padding: 11px 16px; }
  .pd-nav {
    display: none; width: 100%; flex-direction: column; gap: 2px;
    padding: 8px 0 4px; border-top: 1px solid var(--pd-line);
  }
  .pd-nav.is-open { display: flex; }
  .pd-nav a { padding: 11px 12px; font-size: 15px; }
  .pd-bar-right { margin-left: auto; }
  .pd-main { padding: 20px 16px 64px; }
  .pd-card { padding: 18px; }
  .pd-grid-2 { grid-template-columns: 1fr; }
  .pd-row { flex-direction: column; gap: 10px; }
  .pd-row-side { width: 100%; }
  .pd-tour-box { left: 16px !important; right: 16px; max-width: none; width: auto; }
}

/* ---------- v1.4: color pickers, dropzones, progress, copy ---------- */

.pd-color-pair { display: flex; gap: 10px; align-items: center; }
.pd-color-pair input[type=text] { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.pd-color-pair input[type=color] {
  width: 46px; height: 44px; padding: 2px; border: 1px solid var(--pd-line);
  border-radius: 9px; background: #fff; cursor: pointer; flex: none;
}

.pd-dz {
  border: 2px dashed var(--pd-line); border-radius: 11px; padding: 18px;
  text-align: center; cursor: pointer; transition: border-color .14s, background .14s;
  background: var(--pd-bg);
}
.pd-dz:hover { border-color: var(--pd-accent); }
.pd-dz.is-over { border-color: var(--pd-accent); border-style: solid; background: color-mix(in srgb, var(--pd-accent) 7%, white); }
.pd-dz.is-busy { opacity: .6; }
.pd-dz strong { display: block; font-size: 14.5px; margin-bottom: 3px; }
.pd-dz span { color: var(--pd-muted); font-size: 13px; }
.pd-dz [data-dz-preview] { margin-top: 12px; }
.pd-dz [data-dz-preview] img { max-height: 64px; max-width: 100%; border-radius: 7px; }

.pd-copy {
  background: none; border: 1px solid var(--pd-line); border-radius: 7px;
  padding: 5px 11px; font: inherit; font-size: 12.5px; font-weight: 620;
  color: var(--pd-muted); cursor: pointer;
}
.pd-copy:hover { border-color: var(--pd-accent); color: var(--pd-accent); }
.pd-copy.is-copied { border-color: var(--pd-ok); color: var(--pd-ok); }

.pd-progress { position: fixed; inset: 0; z-index: 200; background: rgba(17,24,39,.55); display: flex; align-items: center; justify-content: center; padding: 24px; }
.pd-progress-inner { background: #fff; border-radius: 14px; padding: 28px 30px; max-width: 420px; width: 100%; box-shadow: 0 20px 50px rgba(0,0,0,.28); }
.pd-progress-inner h3 { margin: 0 0 16px; font-size: 17px; }
.pd-progress-bar { height: 8px; background: var(--pd-line); border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.pd-progress-bar span { display: block; height: 100%; width: 8%; background: var(--pd-accent); border-radius: 999px; transition: width .8s ease; }
.pd-progress-inner p { margin: 0; font-size: 14.5px; font-weight: 550; }
.pd-progress-note { margin-top: 8px !important; color: var(--pd-muted); font-weight: 400 !important; font-size: 13px !important; }

.pd-chan-row { display: grid; grid-template-columns: 26px 1fr 130px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--pd-line); }
.pd-chan-row:last-child { border-bottom: 0; }
.pd-chan-row input[type=checkbox] { width: auto; }
.pd-chan-row .name { font-weight: 620; font-size: 14.5px; }
.pd-chan-row .floor { color: var(--pd-muted); font-size: 12.5px; }
.pd-chan-row input[type=text] { padding: 8px 10px; font-size: 14px; }
@media (max-width: 640px) { .pd-chan-row { grid-template-columns: 26px 1fr; } .pd-chan-row input[type=text] { grid-column: 2; } }

/* Optional pictures on offerings */
.pd-offer-img { grid-column: 1 / -1; display: flex; gap: 12px; align-items: center; margin-top: 4px; }
.pd-offer-img img { width: 84px; height: 52px; object-fit: cover; border-radius: 7px; border: 1px solid var(--pd-line); }
.pd-offer-img.is-busy { opacity: .55; }
.pd-offer-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pd-offer-actions .pd-ghost { padding: 5px 10px; font-size: 12.5px; }

/* A channel that is switched off collapses to just its name and the toggle. */
.pd-chan-row.is-off .name { color: var(--pd-muted); font-weight: 550; }
.pd-chan-row.is-off { padding: 8px 0; }

/* Dropzone affordance on every image control */
.pd-offer-img.is-over { outline: 2px dashed var(--pd-accent); outline-offset: 4px; border-radius: 8px; }
.pd-offer-img[data-pct]::after { content: attr(data-pct); font-size: 12.5px; color: var(--pd-accent); font-weight: 640; }
.pd-drop-hint { color: var(--pd-muted); font-size: 12.5px; }

/* Per-image build progress, so a long job never looks stalled */
.pd-buildbar { margin-top: 16px; }
.pd-buildbar-track { height: 8px; background: var(--pd-line); border-radius: 999px; overflow: hidden; }
.pd-buildbar-track span { display: block; height: 100%; width: 0; background: var(--pd-accent); border-radius: 999px; transition: width .3s ease; }
.pd-buildbar p { margin: 10px 0 0; font-size: 14px; font-weight: 550; }

/* Spinner for buttons that are doing something */
.pd-spin {
  display: inline-block; width: 13px; height: 13px; vertical-align: -1px; margin-right: 7px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: pd-spin .7s linear infinite;
}
@keyframes pd-spin { to { transform: rotate(360deg); } }
.pd-btn[disabled], .pd-ghost[disabled] { opacity: .75; cursor: progress; }
