/**
 * kol-progress-inplace.css  (v20260928-kolprog1)
 * In-place views of the 播主工作进度 list popup (js/kol-progress-inplace.js):
 * 查看稿子 / 查看链接 / 更换博主 + approve / reject / confirm / result steps.
 * Flat rows (no inner white panels), one scroll area, actions bottom-centre.
 */

/* ───────────── popup shell ───────────── */
.vt-alert-root:has(.vt-alert.kpi-popup) { padding: 16px; }
.vt-alert.kpi-popup {
  max-width: 100%;
  max-height: min(92vh, 980px);
  max-height: min(92dvh, 980px);
  padding: 0;
  display: flex;
  flex-direction: column;
  text-align: left;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.98);
  font-size: 0.92rem;
  color: #0f172a;
}
.vt-alert.kpi-popup .vt-alert__spark { display: none; }
.vt-alert.kpi-popup .vt-alert__glow { opacity: 0.18; }
.vt-alert.kpi-popup .vt-alert__title {
  flex: none;
  margin: 0;
  padding: 17px 64px 14px;
  text-align: center;
  font-size: 1.04rem;
  font-weight: 800;
  line-height: 1.35;
  border-bottom: 1px solid #eef2f7;
  position: relative;
  z-index: 1;
}
.vt-alert.kpi-popup .vt-alert__close,
.vt-alert.kpi-popup .vt-alert__back { top: 11px; width: 34px; height: 34px; }
.vt-alert.kpi-popup .vt-alert__close { right: 12px; font-size: 1.45rem; background: #f1f5f9; box-shadow: none; }
.vt-alert.kpi-popup .vt-alert__back { left: 12px; font-size: 1.05rem; box-shadow: none; }
.vt-alert.kpi-popup .vt-alert__back:disabled { opacity: 0.45; cursor: not-allowed; }
.vt-alert.kpi-popup .vt-alert__text:empty { display: none; }
.vt-alert.kpi-popup .vt-alert__html {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  margin: 0;
  padding: 16px 22px 22px;
  position: relative;
  z-index: 1;
  text-align: left;
}
.vt-alert.kpi-popup .vt-alert__validation-msg { flex: none; margin: 0 22px 10px; position: relative; z-index: 1; }
.vt-alert.kpi-popup .vt-alert__actions {
  flex: none;
  margin: 0;
  padding: 12px 22px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #eef2f7;
  background: rgba(255, 255, 255, 0.96);
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  position: relative;
  z-index: 2;
}
.vt-alert.kpi-popup .kpi-action-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 140px; }
.vt-alert.kpi-popup .kpi-action-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; filter: none; }
.vt-alert.kpi-popup .kpi-action-btn.is-busy { opacity: 0.85; cursor: progress; }
.vt-alert.kpi-popup .kpi-btn-danger { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important; box-shadow: 0 8px 20px rgba(239, 68, 68, 0.28) !important; }

/* result (操作成功) step: compact, centred */
.vt-alert.kpi-popup.kpi-popup--result { width: min(100%, 420px) !important; padding: 30px 28px 26px; text-align: center; }
.vt-alert.kpi-popup.kpi-popup--result .vt-alert__title { border: 0; padding: 0; font-size: 1.2rem; }
.vt-alert.kpi-popup.kpi-popup--result .vt-alert__html { padding: 8px 0 0; text-align: center; overflow: visible; }
.kpi-result-sub { display: inline-flex; align-items: center; gap: 8px; color: #64748b; font-size: 0.86rem; }

.kpi-popup .kpi-view, .kpi-popup .kpi-view *, .kpi-popup .kpi-view *::before, .kpi-popup .kpi-view *::after { box-sizing: border-box; }

/* ───────────── shared bits ───────────── */
.kpi-popup .kpi-head { display: flex; align-items: center; gap: 12px; min-width: 0; padding-bottom: 12px; border-bottom: 1px solid #e2e8f0; }
.kpi-popup .kpi-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
}
.kpi-popup .kpi-avatar--fb { display: inline-flex; align-items: center; justify-content: center; background: #e0e7ff; color: #4338ca; font-weight: 800; }
.kpi-popup .kpi-avatar--sm { width: 40px; height: 40px; }
.kpi-popup .kpi-head-text { flex: 1 1 auto; min-width: 0; }
.kpi-popup .kpi-head-name { font-weight: 800; font-size: 1rem; color: #0f172a; line-height: 1.3; word-break: break-word; }
.kpi-popup .kpi-head-sub { margin-top: 2px; font-size: 0.8rem; color: #64748b; line-height: 1.4; word-break: break-word; }
.kpi-popup .kpi-dot { margin: 0 6px; color: #cbd5e1; }
.kpi-popup .kpi-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 750;
  background: #f1f5f9;
  color: #334155;
  white-space: nowrap;
}
.kpi-popup .kpi-chip--ok { background: #dcfce7; color: #166534; }
.kpi-popup .kpi-chip--bad { background: #fee2e2; color: #b91c1c; }
.kpi-popup .kpi-chip--wait { background: #fef3c7; color: #92400e; }

.kpi-popup .kpi-rows { border-bottom: 0; }
.kpi-popup .kpi-row {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #e2e8f0;
}
.kpi-popup .kpi-row-label { flex: 0 0 88px; color: #64748b; font-weight: 700; font-size: 0.82rem; line-height: 1.45; }
.kpi-popup .kpi-row-value { flex: 1 1 auto; min-width: 0; color: #0f172a; font-weight: 600; font-size: 0.88rem; line-height: 1.45; word-break: break-word; }
.kpi-popup .kpi-pre { white-space: pre-wrap; }

.kpi-popup .kpi-sec { padding: 14px 0 12px; border-bottom: 1px solid #e2e8f0; }
.kpi-popup .kpi-sec:last-child { border-bottom: 0; padding-bottom: 0; }
.kpi-popup .kpi-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.kpi-popup .kpi-sec-label { color: #64748b; font-weight: 700; font-size: 0.82rem; }
.kpi-popup .kpi-sec-extra { color: #94a3b8; font-size: 0.78rem; font-weight: 650; }
.kpi-popup .kpi-hint { margin: -2px 0 8px; font-size: 0.78rem; color: #64748b; line-height: 1.5; }
.kpi-popup .kpi-muted { color: #94a3b8; font-size: 0.86rem; }
.kpi-popup .kpi-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 12px 0 0;
  color: #3730a3;
  font-size: 0.8rem;
  line-height: 1.5;
}
.kpi-popup .kpi-note i { margin-top: 1px; color: #4f46e5; }
.kpi-popup .kpi-note--warn { color: #92400e; }
.kpi-popup .kpi-note--warn i { color: #d97706; }
.kpi-popup .kpi-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 26px 8px;
  color: #94a3b8;
  font-size: 0.88rem;
  text-align: center;
}
.kpi-popup .kpi-empty > i { font-size: 1.7rem; opacity: 0.7; }
.kpi-popup .kpi-empty--error { color: #b91c1c; }
.kpi-popup .kpi-loading { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 26px 8px; color: #64748b; font-size: 0.86rem; }
.kpi-popup .kpi-spinner,
.kpi-result-sub .kpi-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(79, 70, 229, 0.25);
  border-top-color: #4f46e5;
  animation: kpiSpin 0.8s linear infinite;
  flex: none;
}
.kpi-popup .kpi-spinner--light { border-color: rgba(255, 255, 255, 0.35); border-top-color: #fff; }
@keyframes kpiSpin { to { transform: rotate(360deg); } }

.kpi-popup .kpi-mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.kpi-popup .kpi-mini-btn:hover { border-color: #a5b4fc; color: #4338ca; background: #f5f7ff; }
.kpi-popup .kpi-mini-btn:focus-visible { outline: 3px solid rgba(99, 102, 241, 0.35); outline-offset: 2px; }
.kpi-popup .kpi-mini-btn.is-copied { border-color: #86efac; color: #166534; background: #f0fdf4; }

/* ───────────── drafts ───────────── */
.kpi-popup .kpi-viewer {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #0f172a;
  outline: none;
}
.kpi-popup .kpi-viewer:focus-visible { box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.45); }
.kpi-popup .kpi-viewer-stage { display: flex; align-items: center; justify-content: center; height: min(52vh, 440px); min-height: 220px; }
.kpi-popup .kpi-stage-link { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; }
.kpi-popup .kpi-stage-media { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }
.kpi-popup video.kpi-stage-media { width: 100%; height: 100%; background: #000; }
.kpi-popup .kpi-viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}
.kpi-popup .kpi-viewer-nav:hover { background: rgba(79, 70, 229, 0.85); }
.kpi-popup .kpi-viewer-nav--prev { left: 10px; }
.kpi-popup .kpi-viewer-nav--next { right: 10px; }
.kpi-popup .kpi-viewer-count {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.6);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  z-index: 2;
}
.kpi-popup .kpi-viewer-open {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #1e293b;
  font-size: 0.74rem;
  font-weight: 750;
  text-decoration: none;
  z-index: 2;
}
.kpi-popup .kpi-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 2px; scrollbar-width: thin; }
.kpi-popup .kpi-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  background: #f1f5f9;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.kpi-popup .kpi-thumb img,
.kpi-popup .kpi-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.kpi-popup .kpi-thumb i { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.3rem; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5); }
.kpi-popup .kpi-thumb.is-active { border-color: #4f46e5; opacity: 1; }
.kpi-popup .kpi-thumb:focus-visible { outline: 3px solid rgba(99, 102, 241, 0.4); outline-offset: 1px; }
.kpi-popup .kpi-copywriting { white-space: pre-wrap; word-break: break-word; color: #0f172a; font-weight: 550; font-size: 0.9rem; line-height: 1.75; }

/* links (uploaded links + merchant preview links): flat rows */
.kpi-popup .kpi-links { border-top: 1px solid #e2e8f0; }
.kpi-popup .kpi-link-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #e2e8f0; min-width: 0; }
.kpi-popup .kpi-link-row:last-child { border-bottom: 0; }
.kpi-popup .kpi-link-icon { flex: none; width: 32px; display: flex; justify-content: center; color: #4f46e5; font-size: 1.15rem; }
.kpi-popup .kpi-link-main { flex: 1 1 auto; min-width: 0; }
.kpi-popup .kpi-link-label { font-weight: 750; color: #0f172a; font-size: 0.86rem; }
.kpi-popup .kpi-link-url { font-size: 0.76rem; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-popup .kpi-link-btns { flex: none; display: flex; gap: 6px; }

/* ───────────── forms (reject) ───────────── */
.kpi-popup .kpi-form .kpi-head { margin-bottom: 14px; }
.kpi-popup .kpi-field { margin-bottom: 12px; min-width: 0; }
.kpi-popup .kpi-label { display: block; margin-bottom: 6px; font-size: 0.8rem; font-weight: 750; color: #334155; }
.kpi-popup .kpi-req { color: #ef4444; }
.kpi-popup .kpi-input {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.kpi-popup textarea.kpi-input { resize: vertical; min-height: 96px; }
.kpi-popup .kpi-input:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18); }
.kpi-popup .kpi-input.is-invalid { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14); }
.kpi-popup .kpi-form-intro { display: flex; align-items: center; gap: 6px; margin: 4px 0 10px; padding-top: 12px; border-top: 1px solid #e2e8f0; color: #475569; font-size: 0.8rem; font-weight: 650; }
.kpi-popup .kpi-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.kpi-popup .kpi-form .kpi-hint { margin: 5px 0 0; }

/* ───────────── confirm steps ───────────── */
.kpi-popup .kpi-view--confirm { text-align: center; }
.kpi-popup .kpi-view--confirm .kpi-head { justify-content: center; border-bottom: 0; text-align: left; }
.kpi-popup .kpi-view--confirm .kpi-head-text { flex: 0 1 auto; }
.kpi-popup .kpi-confirm-text { margin: 8px auto 4px; max-width: 460px; color: #475569; font-size: 0.92rem; line-height: 1.6; }
.kpi-popup .kpi-swap-visual { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 6px 0 10px; }
.kpi-popup .kpi-swap-name { padding: 6px 12px; border-radius: 999px; background: #fee2e2; color: #b91c1c; font-weight: 750; font-size: 0.86rem; word-break: break-word; }
.kpi-popup .kpi-swap-name--to { background: #dcfce7; color: #166534; }
.kpi-popup .kpi-swap-visual i { color: #94a3b8; }

/* ───────────── replace: candidates ───────────── */
.kpi-popup .kpi-cands { border-top: 1px solid #e2e8f0; }
.kpi-popup .kpi-cand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  margin: 0 -8px;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  outline: none;
  transition: background 0.15s ease;
}
.kpi-popup .kpi-cand:hover { background: #f8fafc; }
.kpi-popup .kpi-cand:focus-visible { box-shadow: inset 0 0 0 2px rgba(99, 102, 241, 0.45); }
.kpi-popup .kpi-cand.is-selected { background: #eef2ff; }
.kpi-popup .kpi-cand-main { flex: 1 1 auto; min-width: 0; }
.kpi-popup .kpi-cand-name { font-weight: 750; color: #0f172a; word-break: break-word; }
.kpi-popup .kpi-cand-pick { flex: none; display: inline-flex; align-items: center; gap: 5px; color: #64748b; font-size: 0.8rem; font-weight: 700; }
.kpi-popup .kpi-cand.is-selected .kpi-cand-pick { color: #4338ca; }
.kpi-popup .kpi-cand-pick i { font-size: 1.1rem; }
.kpi-popup .kpi-socials,
.kpi-popup .applicant-social-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.kpi-popup .kpi-social { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: #f1f5f9; color: #334155; text-decoration: none; }

/* ───────────── responsive ───────────── */
@media (max-width: 767.98px) {
  .vt-alert-root:has(.vt-alert.kpi-popup) { padding: 10px; }
  .vt-alert.kpi-popup {
    width: 100% !important;
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: 22px;
  }
  .vt-alert.kpi-popup.kpi-popup--result { width: min(100%, 360px) !important; }
  .vt-alert.kpi-popup .vt-alert__title { padding: 16px 56px 12px; font-size: 1rem; }
  .vt-alert.kpi-popup .vt-alert__html { padding: 14px 14px 18px; }
  .vt-alert.kpi-popup .vt-alert__validation-msg { margin: 0 14px 8px; }
  .vt-alert.kpi-popup .vt-alert__actions { padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px)); gap: 8px; }
  .vt-alert.kpi-popup .vt-alert__actions { flex-wrap: nowrap; }
  .vt-alert.kpi-popup .kpi-action-btn { flex: 1 1 0; max-width: 220px; min-width: 0; padding-left: 12px; padding-right: 12px; }
  .kpi-popup .kpi-viewer-stage { height: min(46vh, 360px); min-height: 200px; }
  .kpi-popup .kpi-grid2 { grid-template-columns: 1fr; }
  .kpi-popup .kpi-link-row { flex-wrap: wrap; }
  .kpi-popup .kpi-link-main { flex: 1 1 calc(100% - 42px); }
  .kpi-popup .kpi-link-btns { width: 100%; justify-content: flex-end; }
  .kpi-popup .kpi-cand-pick span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .kpi-popup .kpi-spinner, .kpi-result-sub .kpi-spinner { animation-duration: 1.6s; }
}

/* ───────────── replace: new blogger's pay (20261005-visit2) ───────────── */
.kpi-popup .kpi-pay { max-width: 460px; margin: 14px auto 2px; padding-top: 12px; border-top: 1px solid #e2e8f0; text-align: left; }
.kpi-popup .kpi-pay-title { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; color: #334155; font-size: 0.84rem; font-weight: 750; }
.kpi-popup .kpi-pay-title i { color: #16a34a; }
.kpi-popup .kpi-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; margin-bottom: 12px; border-radius: 12px; background: #f1f5f9; }
.kpi-popup .kpi-seg-btn { min-height: 38px; border: 0; border-radius: 9px; background: transparent; color: #475569; font: inherit; font-size: 0.86rem; font-weight: 700; cursor: pointer; transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease; }
.kpi-popup .kpi-seg-btn.is-on { background: #fff; color: #4338ca; box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12); }
.kpi-popup .kpi-seg-btn:focus-visible { outline: 2px solid #6366f1; outline-offset: 1px; }
.kpi-popup .kpi-pay-amount[hidden] { display: none; }
