/* ==========================================================================
   Media Bulk Download: admin app
   ========================================================================== */

/* Inter (variable, self-hosted, SIL Open Font License, see fonts/OFL.txt) */
@font-face {
	font-family: "Inter";
	font-style: normal;
	font-display: swap;
	font-weight: 100 900;
	src: url("fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations"), url("fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "Inter";
	font-style: normal;
	font-display: swap;
	font-weight: 100 900;
	src: url("fonts/inter-latin-wght-normal.woff2") format("woff2-variations"), url("fonts/inter-latin-wght-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- WordPress chrome ---------- */

.tools_page_redate #wpcontent { padding-left: 0; }
.tools_page_redate #wpbody-content { padding-bottom: 0; }
.tools_page_redate #wpfooter { display: none; }
.tools_page_redate .notice:not(.qbpd-notice),
.tools_page_redate .update-nag { margin: 16px 32px 0 272px; }

/* ---------- Tokens ---------- */

.qbpd-app, .qbpd-modal-backdrop, .qbpd-toasts {
	--ms-ink: #364058;
	--ms-ink-2: #4a546c;
	--ms-muted: #6e7689;
	--ms-faint: #a0a6b4;
	--ms-line: #e3e6ec;
	--ms-line-2: #eef0f4;
	--ms-bg: #f5f6f8;
	--ms-panel: #ffffff;
	--ms-accent: #21b68e;
	--ms-accent-600: #1c9c7a;
	--ms-accent-700: #167d62;
	--ms-accent-50: #eaf8f3;
	--ms-accent-100: #c9eee1;
	--ms-ok: #059669;
	--ms-ok-bg: #ecfdf5;
	--ms-warn: #b45309;
	--ms-warn-bg: #fffbeb;
	--ms-err: #dc2626;
	--ms-err-bg: #fef2f2;
	--ms-info: #0369a1;
	--ms-info-bg: #f0f9ff;
	--ms-brand: #364058;
	--ms-radius-sm: 6px;     /* form controls only; containers are square */
}

.qbpd-app {
	display: grid;
	grid-template-columns: 248px minmax(0, 1fr);
	min-height: calc(100vh - 32px);
	background: var(--ms-bg);
	color: var(--ms-ink);
	font-size: 14px;
	line-height: 1.55;
}

.qbpd-app, .qbpd-app input, .qbpd-app select, .qbpd-app textarea, .qbpd-app button,
.qbpd-app h1, .qbpd-app h2, .qbpd-app h3, .qbpd-toast, .qbpd-modal {
	font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-feature-settings: "cv11", "ss01";
}
.qbpd-app { -webkit-font-smoothing: antialiased; }
.qbpd-app *, .qbpd-app *::before, .qbpd-app *::after { box-sizing: border-box; }
.qbpd-app [hidden]{ display: none !important; }
.qbpd-app a{ color: var(--ms-accent-600); }
.qbpd-app a:hover{ color: var(--ms-accent-700); }
.qbpd-app code{ background: #eef0f4; color: var(--ms-ink-2); padding: 1px 6px; border-radius: 0; font-size: 12.5px; }

/* ---------- Navigation rail ---------- */

.qbpd-side {
	position: sticky; top: 32px; height: calc(100vh - 32px); overflow-y: auto;
	display: flex; flex-direction: column;
	background: #fff; color: var(--ms-ink-2); border-right: 1px solid var(--ms-line);
	padding: 20px 14px 16px;
}
.qbpd-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; }
.qbpd-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.qbpd-brand-text strong { color: var(--ms-brand); font-size: 16px; font-weight: 750; letter-spacing: -.01em; }
.qbpd-brand-text span { color: var(--ms-muted); font-size: 12px; }

.qbpd-nav { display: flex; flex-direction: column; gap: 1px; }
.qbpd-nav-group { color: var(--ms-faint); font-size: 11px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; padding: 14px 10px 5px; }
.qbpd-nav-group:first-child { padding-top: 4px; }
.qbpd-app .qbpd-nav a {
	position: relative; display: flex; align-items: center; gap: 11px;
	padding: 7px 10px; border-radius: 8px; color: var(--ms-ink-2); text-decoration: none;
	transition: background .12s, color .12s;
}
.qbpd-nav a .dashicons { font-size: 18px; width: 18px; height: 18px; color: var(--ms-faint); transition: color .12s; }
.qbpd-nav a .qbpd-count { margin-left: auto; font-size: 11px; font-weight: 600; padding: 0 7px; border-radius: 6px; background: var(--ms-accent-50); color: var(--ms-accent-700); line-height: 1.7; }
.qbpd-app .qbpd-nav a:hover { background: var(--ms-bg); color: var(--ms-brand); }
.qbpd-nav a:hover .dashicons { color: var(--ms-brand); }
.qbpd-nav a:focus { outline: 0; box-shadow: none; }
.qbpd-nav a:focus-visible { box-shadow: inset 0 0 0 2px var(--ms-accent); }
.qbpd-app .qbpd-nav a.is-active { background: var(--ms-accent-50); color: var(--ms-accent-700); }
.qbpd-nav a.is-active .dashicons { color: var(--ms-accent); }

.qbpd-side-spacer { flex: 1; }
.qbpd-donate { margin: 18px 0 0; border-radius: 8px; display: flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid #cdeee2; background: #effaf6; color: #14684f; font-size: 12.5px; line-height: 1.35; }
.qbpd-donate > svg { flex: none; transform-origin: 50% 80%; animation: qbpd-wiggle 4s ease-in-out infinite; }
@keyframes qbpd-wiggle { 0%, 80%, 100% { transform: rotate(0); } 84% { transform: rotate(-14deg); } 88% { transform: rotate(12deg); } 92% { transform: rotate(-8deg); } 96% { transform: rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .qbpd-donate > svg { animation: none; } }
.qbpd-donate > span { flex: 1; min-width: 0; }
.qbpd-app .qbpd-donate a { color: #14684f; font-weight: 650; text-decoration: none; }
.qbpd-app .qbpd-donate a:hover { color: var(--ms-brand); }
.qbpd-side-foot { padding: 16px 10px 0; display: flex; flex-wrap: wrap; gap: 4px 10px; justify-content: space-between; font-size: 12px; color: var(--ms-faint); }
.qbpd-app .qbpd-side-foot a { color: var(--ms-muted); text-decoration: none; }
.qbpd-app .qbpd-side-foot a:hover { color: var(--ms-accent-700); }

/* ---------- Header ---------- */

.qbpd-main { min-width: 0; }
.qbpd-topbar {
	position: sticky; top: 32px; z-index: 30;
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
	padding: 18px 36px; background: rgba(245, 246, 248, .92); backdrop-filter: saturate(1.4) blur(8px);
	border-bottom: 1px solid var(--ms-line);
}
.qbpd-topbar h1 { margin: 0; padding: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.3; color: var(--ms-ink); }
.qbpd-topbar-title { flex: 1 1 260px; min-width: 0; }
.qbpd-topbar-title p { margin: 2px 0 0; color: var(--ms-muted); font-size: 13px; }
.qbpd-topbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.qbpd-topbar-actions .qbpd-pill, .qbpd-topbar-actions .qbpd-btn { height: 38px; min-height: 38px; }

.qbpd-pill {
	display: inline-flex; align-items: center; gap: 8px; max-width: 300px;
	padding: 0 16px; border-radius: 999px; background: var(--ms-panel); border: 1px solid var(--ms-line);
	font-size: 12.5px; font-weight: 500; color: var(--ms-ink-2); white-space: nowrap; text-decoration: none;
}
.qbpd-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ms-faint); flex: none; }
.qbpd-pill.is-live { border-color: var(--ms-accent-100); background: var(--ms-accent-50); color: var(--ms-accent-700); }
.qbpd-pill.is-live .qbpd-dot { background: var(--ms-accent); animation: qbpd-ping 1.4s infinite; }
.qbpd-app a.qbpd-pill.is-failed { border-color: #fecaca; background: var(--ms-err-bg); color: var(--ms-err); }
.qbpd-pill.is-failed .qbpd-dot { background: var(--ms-err); }
@keyframes qbpd-ping { 0% { box-shadow: 0 0 0 0 rgba(33, 182, 142, .5); } 70% { box-shadow: 0 0 0 7px rgba(33, 182, 142, 0); } 100% { box-shadow: 0 0 0 0 rgba(33, 182, 142, 0); } }

.qbpd-content { padding: 28px 36px 80px; max-width: 1180px; }

/* ---------- Panels ---------- */

.qbpd-card { background: var(--ms-panel); border: 1px solid var(--ms-line); margin-bottom: 20px; overflow: hidden; }
.qbpd-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px 4px; }
.qbpd-card-head h2 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -.01em; color: var(--ms-ink); }
.qbpd-card-head .qbpd-desc { margin: 4px 0 0; color: var(--ms-muted); font-size: 13px; max-width: 70ch; }
.qbpd-card-body { padding: 8px 24px 20px; }
.qbpd-card-body.qbpd-flush { padding: 12px 0 0; }
.qbpd-head-tools { display: flex; align-items: center; gap: 12px; flex: none; }

/* ---------- Stats ---------- */

.qbpd-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.qbpd-stat { position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 16px 18px; background: var(--ms-panel); border: 1px solid var(--ms-line); }
.qbpd-stat::before { content: ""; position: absolute; left: 18px; top: 0; width: 28px; height: 3px; background: var(--ms-accent); }
.qbpd-stat.is-bad::before { background: var(--ms-err); }
.qbpd-stat-label { font-size: 12px; font-weight: 500; color: var(--ms-muted); }
.qbpd-stat strong { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.qbpd-stat.is-bad strong { color: var(--ms-err); }
.qbpd-stat small { color: var(--ms-muted); font-size: 12px; }


/* ---------- Tables ---------- */

.qbpd-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.qbpd-table th { text-align: left; font-weight: 600; font-size: 12px; color: var(--ms-muted); padding: 10px 16px; background: #f8fafc; border-top: 1px solid var(--ms-line-2); border-bottom: 1px solid var(--ms-line-2); white-space: nowrap; }
.qbpd-table td { padding: 11px 16px; border-bottom: 1px solid var(--ms-line-2); vertical-align: top; overflow-wrap: anywhere; }
.qbpd-table th:first-child, .qbpd-table td:first-child { padding-left: 24px; }
.qbpd-table th:last-child, .qbpd-table td:last-child { padding-right: 24px; }
.qbpd-table tr:last-child td { border-bottom: 0; }
.qbpd-table tbody tr:hover td { background: #fbfcfd; }
.qbpd-table td.qbpd-num { width: 64px; text-align: right; font-weight: 650; color: var(--ms-ink); }
.qbpd-table td.qbpd-empty { text-align: center; color: var(--ms-muted); padding: 28px; }
.qbpd-table td.qbpd-time { white-space: nowrap; }
.qbpd-sub { display: block; color: var(--ms-muted); font-size: 12px; }
.qbpd-link { border: 0; background: none; padding: 0; margin-left: 6px; color: var(--ms-accent-600); cursor: pointer; font-size: 12.5px; font-weight: 600; }
.qbpd-link:hover { color: var(--ms-accent-700); text-decoration: underline; }

.qbpd-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

/* ---------- Filters & pager ---------- */

.qbpd-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 24px 14px; }
.qbpd-app .qbpd-filter .qbpd-input { width: auto; min-width: 170px; }
.qbpd-app .qbpd-filter input[type=search].qbpd-input { min-width: 260px; }
.qbpd-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 24px; border-top: 1px solid var(--ms-line-2); color: var(--ms-muted); font-size: 12.5px; }
.qbpd-pager .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 8px; margin-left: 4px; border: 1px solid var(--ms-line); background: #fff; color: var(--ms-ink-2); text-decoration: none; font-weight: 600; }
.qbpd-pager .page-numbers.current { background: var(--ms-accent); border-color: var(--ms-accent); color: #fff; }
.qbpd-pager .page-numbers.dots { border: 0; background: none; }
.qbpd-app .qbpd-pager a.page-numbers:hover { border-color: var(--ms-accent); color: var(--ms-accent-700); }

/* ---------- Form controls ---------- */

.qbpd-app .qbpd-input {
	width: 100%; max-width: 100%; min-height: 38px; padding: 7px 12px;
	border: 1px solid #cbd5e1; border-radius: var(--ms-radius-sm); background-color: #fff;
	font-size: 13.5px; line-height: 1.4; color: var(--ms-ink); box-shadow: 0 1px 1px rgba(54, 64, 88, .03);
	transition: border-color .12s, box-shadow .12s;
}
.qbpd-app select.qbpd-input { padding-right: 32px; }
.qbpd-app .qbpd-input:hover { border-color: #94a3b8; }
.qbpd-app .qbpd-input:focus { border-color: var(--ms-accent); box-shadow: 0 0 0 3px rgba(33, 182, 142, .18); outline: 0; }

.qbpd-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 44%); gap: 24px; align-items: center; padding: 16px 0; border-top: 1px solid var(--ms-line-2); }
.qbpd-card-body > .qbpd-row:first-child { border-top: 0; }
.qbpd-row-toggle { grid-template-columns: minmax(0, 1fr) auto; }
.qbpd-row-stack { grid-template-columns: 1fr; gap: 10px; }
.qbpd-row-title { display: block; font-weight: 600; font-size: 14px; color: var(--ms-ink); }
.qbpd-help { margin: 3px 0 0; color: var(--ms-muted); font-size: 13px; }

.qbpd-switch { position: relative; display: inline-flex; flex: none; }
.qbpd-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; width: 100%; height: 100%; }
.qbpd-slider { position: relative; width: 42px; height: 24px; border-radius: 999px; background: #cbd5e1; transition: background .15s; }
.qbpd-slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(54, 64, 88, .25); transition: transform .18s cubic-bezier(.3, 1.4, .6, 1); }
.qbpd-switch input:checked + .qbpd-slider { background: var(--ms-accent); }
.qbpd-switch input:checked + .qbpd-slider::after { transform: translateX(18px); }
.qbpd-switch input:focus-visible + .qbpd-slider { box-shadow: 0 0 0 3px rgba(33, 182, 142, .3); }

.qbpd-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.qbpd-chip { position: relative; cursor: pointer; }
.qbpd-chip input { position: absolute; opacity: 0; }
.qbpd-chip span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid #cbd5e1; border-radius: var(--ms-radius-sm); background: #fff; font-size: 13px; font-weight: 500; color: var(--ms-ink-2); transition: all .12s; }
.qbpd-chip span::before { content: ""; width: 14px; height: 14px; border: 2px solid #cbd5e1; border-radius: 4px; background: #fff; }
.qbpd-chip:hover span { border-color: #94a3b8; }
.qbpd-chip input:checked + span { border-color: var(--ms-accent); background: var(--ms-accent-50); color: var(--ms-accent-700); }
.qbpd-chip input:checked + span::before { border-color: var(--ms-accent); background: var(--ms-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.5l4.5-5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px no-repeat; }
.qbpd-chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(33, 182, 142, .3); }

.qbpd-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 4px 0; }
.qbpd-choice { position: relative; cursor: pointer; }
.qbpd-choice input { position: absolute; opacity: 0; }
.qbpd-choice-body { position: relative; display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 16px; border: 1px solid var(--ms-line); background: #fff; transition: border-color .12s, box-shadow .12s, background .12s; }
.qbpd-choice-body .dashicons { width: 36px; height: 36px; font-size: 20px; line-height: 36px; text-align: center; border-radius: 8px; background: #eef0f4; color: var(--ms-muted); margin-bottom: 6px; }
.qbpd-choice-body strong { font-size: 14px; padding-right: 20px; }
.qbpd-choice-body small { color: var(--ms-muted); font-size: 12.5px; line-height: 1.45; }
.qbpd-choice-body::after { content: ""; position: absolute; top: 14px; right: 14px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #cbd5e1; background: #fff; }
.qbpd-choice:hover .qbpd-choice-body { border-color: #94a3b8; }
.qbpd-choice input:checked + .qbpd-choice-body { border-color: var(--ms-accent); box-shadow: 0 0 0 3px rgba(33, 182, 142, .14); background: var(--ms-accent-50); }
.qbpd-choice input:checked + .qbpd-choice-body .dashicons { background: var(--ms-accent); color: #fff; }
.qbpd-choice input:checked + .qbpd-choice-body::after { border-color: var(--ms-accent); background: radial-gradient(circle, var(--ms-accent) 45%, #fff 50%); }
.qbpd-choice input:focus-visible + .qbpd-choice-body { box-shadow: 0 0 0 3px rgba(33, 182, 142, .3); }

/* ---------- Buttons ---------- */

.qbpd-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 7px;
	min-height: 38px; padding: 7px 15px; border-radius: var(--ms-radius-sm); cursor: pointer;
	border: 1px solid #cbd5e1; background: #fff; color: var(--ms-ink);
	font-size: 13.5px; font-weight: 600; text-decoration: none; line-height: 1.2;
	box-shadow: 0 1px 1px rgba(54, 64, 88, .04); transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
}
.qbpd-app a.qbpd-btn{ color: var(--ms-ink); }
.qbpd-btn:hover { border-color: #94a3b8; background: #f8fafc; }
.qbpd-btn:focus { outline: 0; }
.qbpd-btn:focus-visible { box-shadow: 0 0 0 3px rgba(33, 182, 142, .3); }
.qbpd-btn .dashicons { font-size: 16px; width: 16px; height: 16px; }
.qbpd-btn-primary, .qbpd-app a.qbpd-btn-primary{ background: var(--ms-accent); border-color: var(--ms-accent); color: #fff; box-shadow: 0 1px 2px rgba(33, 182, 142, .3); }
.qbpd-btn-primary:hover, .qbpd-app a.qbpd-btn-primary:hover{ background: var(--ms-accent-600); border-color: var(--ms-accent-600); color: #fff; }
.qbpd-btn-danger { color: var(--ms-err); border-color: #fecaca; }
.qbpd-btn-danger:hover { background: var(--ms-err); border-color: var(--ms-err); color: #fff; }
.qbpd-btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ms-ink-2); }
.qbpd-btn-ghost:hover { background: #e9edf2; border-color: transparent; }
.qbpd-btn-sm { min-height: 32px; padding: 5px 12px; font-size: 12.5px; }

/* ---------- Callouts & badges ---------- */

.qbpd-notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin: 0 0 20px; font-size: 13px; border: 1px solid; }
.qbpd-notice > .dashicons { flex: none; font-size: 18px; width: 18px; height: 18px; margin-top: 1px; }
.qbpd-notice-tip { background: var(--ms-accent-50); border-color: var(--ms-accent-100); color: #155c48; }
.qbpd-notice-tip > .dashicons { color: var(--ms-accent); }
.qbpd-notice-info { background: var(--ms-info-bg); border-color: #bae6fd; color: #0c4a6e; }
.qbpd-notice-info > .dashicons { color: var(--ms-info); }
.qbpd-notice-warn { background: var(--ms-warn-bg); border-color: #fde68a; color: #78350f; }
.qbpd-notice-warn > .dashicons { color: #d97706; }
.qbpd-notice form { display: inline; }

.qbpd-badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; line-height: 1.7; white-space: nowrap; vertical-align: 1px; }
.qbpd-badge-ok { background: var(--ms-ok-bg); color: var(--ms-ok); }
.qbpd-badge-live { background: var(--ms-accent-50); color: var(--ms-accent-700); }
.qbpd-badge-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ms-accent); }
.qbpd-badge-warn { background: var(--ms-warn-bg); color: var(--ms-warn); }
.qbpd-badge-err { background: var(--ms-err-bg); color: var(--ms-err); }
.qbpd-badge-info { background: var(--ms-info-bg); color: var(--ms-info); }
.qbpd-badge-muted { background: #f1f5f9; color: var(--ms-muted); }
.qbpd-muted { color: var(--ms-muted); }
.qbpd-faint { color: var(--ms-faint); }

/* ---------- Toasts & dialog ---------- */

.qbpd-toasts { position: fixed; right: 24px; bottom: 24px; z-index: 100000; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.qbpd-toast { display: flex; align-items: center; gap: 10px; background: #fff; color: #364058; padding: 12px 16px 12px 14px; border: 1px solid #e2e8f0; border-left: 4px solid var(--ms-accent); box-shadow: 0 10px 28px rgba(54, 64, 88, .14); max-width: 420px; font-size: 13.5px; font-weight: 500; animation: qbpd-in .2s ease-out; }
.qbpd-toast.is-error { border-left-color: #dc2626; }
@keyframes qbpd-in { from { transform: translateY(12px); opacity: 0; } }

.qbpd-modal-backdrop { position: fixed; inset: 0; z-index: 100001; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(54, 64, 88, .5); backdrop-filter: blur(2px); animation: qbpd-fade .15s ease-out; }
.qbpd-modal { width: 100%; max-width: 440px; background: #fff; color: #364058; box-shadow: 0 30px 70px rgba(0, 0, 0, .3); animation: qbpd-pop .18s ease-out; outline: 0; overflow: hidden; }
.qbpd-modal-body { padding: 24px 24px 6px; display: flex; gap: 16px; }
.qbpd-modal-icon { flex: none; width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #fef2f2; color: #dc2626; }
.qbpd-modal-icon .dashicons { font-size: 22px; width: 22px; height: 22px; }
.qbpd-modal h2 { margin: 2px 0 6px; font-size: 17px; font-weight: 700; line-height: 1.35; letter-spacing: -.01em; }
.qbpd-modal p { margin: 0; color: #475569; font-size: 14px; line-height: 1.55; }
.qbpd-modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 20px 24px; margin-top: 14px; background: #f8fafc; border-top: 1px solid #eef2f6; }
.qbpd-modal .qbpd-btn { min-width: 92px; }
.qbpd-modal .qbpd-btn-primary { background: #dc2626; border-color: #dc2626; box-shadow: none; }
.qbpd-modal .qbpd-btn-primary:hover { background: #b91c1c; border-color: #b91c1c; }
@keyframes qbpd-fade { from { opacity: 0; } }
@keyframes qbpd-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }


/* Overview lists */
.qbpd-list { margin: 0; padding: 0; list-style: none; }
.qbpd-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 10px 24px; border-top: 1px solid var(--ms-line-2); font-size: 13px; }
.qbpd-list li:first-child { border-top: 0; }
.qbpd-list li > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.qbpd-list a { text-decoration: none; font-weight: 600; }
.qbpd-checks { margin: 0; padding: 0; list-style: none; }
.qbpd-checks li { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 10px 0; border-top: 1px solid var(--ms-line-2); }
.qbpd-checks li:first-child { border-top: 0; }
.qbpd-topbar-actions form { margin: 0; }

/* ---------- Size table ---------- */

.qbpd-table a { text-decoration: none; }
.qbpd-sizes th:first-child { width: 72px; }
.qbpd-sizes td { vertical-align: middle; }
.qbpd-sizes label { cursor: pointer; }
.qbpd-sizes tr.is-off td { background: #fbfcfd; }
.qbpd-sizes tr.is-off code { text-decoration: line-through; color: var(--ms-faint); }
.qbpd-table td.qbpd-num-cell { font-variant-numeric: tabular-nums; white-space: nowrap; }
.qbpd-table td.qbpd-actions-cell { white-space: nowrap; text-align: right; }
.qbpd-table td.qbpd-actions-cell .qbpd-btn { margin-left: 6px; }
.qbpd-table td.qbpd-r, .qbpd-table th.qbpd-r { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Run panel ---------- */

.qbpd-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 0 4px; }
.qbpd-btn:disabled, .qbpd-btn:disabled:hover { opacity: .5; cursor: not-allowed; background: #fff; border-color: #cbd5e1; color: var(--ms-muted); }
.qbpd-btn-danger:disabled:hover { color: var(--ms-muted); }
.qbpd-inline-check { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--ms-ink-2); cursor: pointer; }
.qbpd-inline-check input { margin: 0; }
.qbpd-card-body > .qbpd-help { margin-top: 8px; }
.qbpd-card-body > .qbpd-row-toggle + .qbpd-actions { border-top: 1px solid var(--ms-line-2); padding-top: 16px; }

.qbpd-progress { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--ms-line); background: #fbfcfd; }
.qbpd-progress-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 13px; }
.qbpd-progress-status { color: var(--ms-ink-2); font-weight: 500; }
.qbpd-progress-pct { color: var(--ms-muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.qbpd-bar { height: 8px; background: var(--ms-line); overflow: hidden; }
.qbpd-bar span { display: block; height: 100%; width: 0; background: var(--ms-accent); transition: width .3s ease; }
.qbpd-progress.is-running .qbpd-bar span { background-image: linear-gradient(45deg, rgba(255,255,255,.22) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.22) 50%, rgba(255,255,255,.22) 75%, transparent 75%); background-size: 16px 16px; animation: qbpd-stripes .8s linear infinite; }
.qbpd-progress.is-error { border-color: #fecaca; background: var(--ms-err-bg); }
.qbpd-progress.is-error .qbpd-progress-status { color: var(--ms-err); }
.qbpd-progress.is-done .qbpd-progress-status { color: var(--ms-accent-700); }
@keyframes qbpd-stripes { to { background-position: 16px 0; } }

.qbpd-result:empty { display: none; }
.qbpd-result { margin-top: 18px; border: 1px solid var(--ms-line); }
.qbpd-result-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 16px; background: #fbfcfd; border-bottom: 1px solid var(--ms-line-2); }
.qbpd-result-head h3 { margin: 0; font-size: 15px; font-weight: 650; color: var(--ms-ink); }
.qbpd-result-head p { margin: 2px 0 0; color: var(--ms-muted); font-size: 12.5px; }
.qbpd-result .qbpd-table th:first-child, .qbpd-result .qbpd-table td:first-child { padding-left: 16px; }
.qbpd-result .qbpd-table th:last-child, .qbpd-result .qbpd-table td:last-child { padding-right: 16px; }
.qbpd-result-note { margin: 0; padding: 12px 16px; color: var(--ms-muted); font-size: 13px; border-top: 1px solid var(--ms-line-2); }
.qbpd-problems { margin: 0; padding: 12px 16px; border-top: 1px solid var(--ms-line-2); background: var(--ms-warn-bg); }
.qbpd-problems strong { display: block; margin-bottom: 6px; color: var(--ms-warn); font-size: 13px; }
.qbpd-problems pre { margin: 0; max-height: 180px; overflow: auto; font-size: 12px; white-space: pre-wrap; color: #78350f; }
.qbpd-scroll { max-height: 420px; overflow: auto; }

.qbpd-steps { margin: 0; padding: 0; list-style: none; counter-reset: qbpd; }
.qbpd-steps li { position: relative; margin: 0; padding: 10px 0 10px 40px; border-top: 1px solid var(--ms-line-2); font-size: 13.5px; color: var(--ms-ink-2); counter-increment: qbpd; }
.qbpd-steps li:first-child { border-top: 0; }
.qbpd-steps li::before { content: counter(qbpd); position: absolute; left: 0; top: 9px; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--ms-accent-50); color: var(--ms-accent-700); font-size: 12px; font-weight: 700; }
.qbpd-steps strong { color: var(--ms-ink); }
.qbpd-stat.is-warn::before { background: #f59e0b; }
.qbpd-notice > div { min-width: 0; }

/* Typed confirmation in the dialog */
.qbpd-modal-type { margin-top: 14px; }
.qbpd-modal-type label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--ms-ink); }
.qbpd-modal .qbpd-btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.qbpd-modal.is-safe .qbpd-modal-icon { background: var(--ms-accent-50); color: var(--ms-accent); }
.qbpd-modal.is-safe .qbpd-btn-primary { background: var(--ms-accent); border-color: var(--ms-accent); }
.qbpd-modal.is-safe .qbpd-btn-primary:hover { background: var(--ms-accent-600); border-color: var(--ms-accent-600); }

/* ---------- Responsive ---------- */

@media (max-width: 1280px) {
	.qbpd-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
	.qbpd-split, .qbpd-choices { grid-template-columns: 1fr; }
}
@media (max-width: 782px) {
	.qbpd-app { grid-template-columns: 1fr; }
	.qbpd-side { position: static; height: auto; padding: 14px; }
	.qbpd-brand { padding-bottom: 12px; }
	.qbpd-nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 4px; }
	.qbpd-nav-group, .qbpd-side-foot, .qbpd-donate, .qbpd-side-spacer { display: none; }
	.qbpd-app .qbpd-nav a { white-space: nowrap; }
	.qbpd-topbar { position: static; padding: 14px 16px; }
	.qbpd-content { padding: 16px 16px 80px; }
	.qbpd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.qbpd-row { grid-template-columns: 1fr; gap: 10px; }
	.qbpd-row-toggle { grid-template-columns: minmax(0, 1fr) auto; }
	.qbpd-card-body.qbpd-flush, .qbpd-result { overflow-x: auto; }
	.qbpd-list li { padding-left: 16px; padding-right: 16px; }
	.qbpd-table td.qbpd-actions-cell { white-space: normal; }
	.qbpd-toasts { left: 12px; right: 12px; bottom: 12px; align-items: stretch; }
	.tools_page_redate .notice:not(.qbpd-notice) { margin: 12px 16px 0; }
}

/* Dialog input (the dialog sits outside .qbpd-app) */
.qbpd-modal .qbpd-input { width: 100%; min-height: 38px; padding: 7px 12px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; font: 600 14px/1.4 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; letter-spacing: .04em; color: #364058; box-shadow: none; }
.qbpd-modal .qbpd-input:focus { border-color: #21b68e; box-shadow: 0 0 0 3px rgba(33, 182, 142, .18); outline: 0; }

@media (max-width: 782px) {
	.qbpd-card-body.qbpd-flush > .qbpd-table, .qbpd-result > .qbpd-table, .qbpd-scroll > .qbpd-table { min-width: 560px; }
	.qbpd-table code { white-space: nowrap; }
	.qbpd-card-head { flex-wrap: wrap; padding: 16px 16px 4px; }
	.qbpd-card-body { padding: 8px 16px 16px; }
	.qbpd-table th:first-child, .qbpd-table td:first-child { padding-left: 16px; }
	.qbpd-actions .qbpd-btn { flex: 1 1 auto; }
}

/* ---------- Change screen ---------- */

.qbpd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; padding: 16px 0 4px; border-top: 1px solid var(--ms-line-2); }
.qbpd-field { display: flex; flex-direction: column; gap: 6px; }
.qbpd-field > span { font-weight: 600; font-size: 13px; color: var(--ms-ink); }
.qbpd-field-wide { grid-column: 1 / -1; }
.qbpd-card.is-off { display: none; }
.qbpd-card-body > .qbpd-choices + .qbpd-row { margin-top: 12px; }
.qbpd-match { margin: 4px 0 6px; font-size: 13.5px; color: var(--ms-ink-2); }
.qbpd-match strong { color: var(--ms-ink); }
.qbpd-table td.qbpd-actions-cell .qbpd-btn { margin: 2px 0 2px 6px; }
.qbpd-table td.qbpd-num-cell { font-variant-numeric: tabular-nums; }

@media (max-width: 782px) {
	.qbpd-grid { grid-template-columns: 1fr; }
}

.qbpd-choices-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qbpd-panel { margin-top: 14px; border-top: 1px solid var(--ms-line-2); }
.qbpd-panel > .qbpd-help { margin: 12px 0 0; }
.qbpd-panel > .qbpd-row:first-child { border-top: 0; }
.qbpd-panel .qbpd-grid { border-top: 0; }
.qbpd-panel .qbpd-row + .qbpd-grid { padding-top: 4px; }
.qbpd-terms { max-height: 220px; overflow: auto; padding: 2px; }
.qbpd-chip small { color: var(--ms-faint); font-weight: 500; }
.qbpd-schedule-form { margin-top: 14px; padding: 4px 16px 12px; border: 1px solid var(--ms-line); background: #fbfcfd; }
.qbpd-schedule-form .qbpd-grid { border-top: 0; }
.qbpd-result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.qbpd-preview td { vertical-align: top; }
.qbpd-preview td:first-child a { font-weight: 600; }
.qbpd-old { display: block; color: var(--ms-faint); text-decoration: line-through; font-size: 12px; }
.qbpd-new { display: block; color: var(--ms-accent-700); font-weight: 650; }
.qbpd-same { display: block; color: var(--ms-muted); }

@media (max-width: 960px) {
	.qbpd-choices-2 { grid-template-columns: 1fr; }
}
