* { box-sizing: border-box; }
body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	margin: 0;
	background: #f0f2f5;
	color: #1d2327;
}
a { color: #2271b1; }
.description { color: #646970; font-size: 13px; }

/* Buttons */
.button {
	display: inline-block;
	padding: 7px 14px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	background: #f6f7f7;
	color: #2c3338;
	cursor: pointer;
	font-size: 13px;
	text-decoration: none;
}
.button:hover { background: #f0f0f1; }
.button-primary {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
}
.button-primary:hover { background: #135e96; }
.button-small { padding: 3px 9px; font-size: 12px; }
.button-link {
	background: none;
	border: none;
	color: #2271b1;
	cursor: pointer;
	padding: 0;
	font-size: 13px;
	text-decoration: underline;
}
button:disabled, .button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Notices */
.pg-notice {
	border-left: 4px solid #d63638;
	background: #fff;
	padding: 10px 14px;
	margin: 14px 0;
	border-radius: 2px;
}
.pg-notice-error { border-left-color: #d63638; }
.pg-notice-success { border-left-color: #00a32a; }

/* Install / login screens */
.pg-install {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
}
.pg-install-box {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 8px;
	padding: 32px 36px;
	width: 440px;
	max-width: 92vw;
	box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.pg-install-box h1 { margin-top: 0; font-size: 20px; }
.pg-install-box label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 13px; }
.pg-install-box input[type=text], .pg-install-box input[type=password] {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #8c8f94;
	border-radius: 4px;
	font-size: 14px;
}
.pg-ok { color: #00a32a; }
.pg-fail { color: #d63638; font-weight: 600; }

/* App shell */
.pg-topbar {
	background: #1d2327;
	color: #fff;
	padding: 10px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.pg-topbar a { color: #fff; text-decoration: none; }
.pg-topbar .pg-brand { font-weight: 700; }
.pg-topbar .pg-crumbs a { color: #a7aaad; margin-right: 6px; }
.pg-topbar .pg-crumbs a:last-child { color: #fff; }
.pg-main {
	max-width: 1200px;
	margin: 24px auto;
	padding: 0 20px 60px;
}
.pg-card {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 8px;
	padding: 20px;
	margin-bottom: 20px;
}
.pg-list { list-style: none; margin: 0; padding: 0; }
.pg-list li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 0;
	border-bottom: 1px solid #f0f0f1;
}
.pg-list li:last-child { border-bottom: none; }
.pg-list .pg-item-actions { display: flex; gap: 10px; align-items: center; }
.pg-inline-form { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.pg-inline-form input[type=text] { flex: 1; padding: 7px 10px; border: 1px solid #8c8f94; border-radius: 4px; }

/* Section builder (mirrors the WordPress plugin UI) */
.pg-toolbar { margin-bottom: 12px; display: flex; gap: 8px; }
.pg-instances-list { margin: 0; padding: 0; list-style: none; }
.pg-instance { background: #fff; border: 1px solid #dcdcde; border-radius: 4px; margin-bottom: 8px; }
.pg-instance-header { display: flex; align-items: center; gap: 10px; padding: 8px 10px; flex-wrap: wrap; }
.pg-drag-handle { cursor: grab; color: #8c8f94; }
.pg-instance-title { flex: 1 1 200px; min-width: 140px; padding: 5px 8px; border: 1px solid #c3c4c7; border-radius: 3px; }
.pg-badge { background: #f0f0f1; border-radius: 3px; padding: 2px 8px; font-size: 11px; color: #50575e; white-space: nowrap; }
.pg-instance-body { border-top: 1px solid #dcdcde; padding: 10px; }
.pg-instance-html, .pg-library-html { width: 100%; }
.pg-preview-wrap { margin-top: 10px; }
.pg-preview-iframe { width: 100%; min-height: 240px; border: 1px solid #dcdcde; background: #fff; }
.pg-preview-iframe-large { min-height: 360px; }
.pg-mode-toggle { margin: 0 0 8px; }
.pg-mode-toggle .pg-mode-btn { opacity: 0.65; }
.pg-mode-toggle .pg-mode-btn.active { opacity: 1; background: #2271b1; border-color: #2271b1; color: #fff; }
.pg-slot-field { margin: 10px 0; }
.pg-slot-field label { display: block; font-weight: 600; font-size: 12px; margin-bottom: 4px; }
.pg-slot-field textarea { width: 100%; }
.pg-library-panel { background: #f6f7f7; border: 1px solid #dcdcde; border-radius: 4px; padding: 14px; margin-top: 12px; }
.pg-library-panel h3 { margin-top: 0; }
.pg-library-results { list-style: none; margin: 0; padding: 0; }
.pg-library-results li { display: flex; align-items: center; justify-content: space-between; padding: 6px 4px; border-bottom: 1px solid #f0f0f1; }
.pg-history-list { margin: 0; padding: 0; list-style: none; }
.pg-history-list li { border-bottom: 1px solid #f0f0f1; padding: 8px 0; }
.pg-history-list li:last-child { border-bottom: none; }
.pg-device-toggle { display: flex; gap: 6px; margin-bottom: 8px; }
.pg-device-toggle button.active { background: #2271b1; color: #fff; border-color: #2271b1; }

/* Belt-and-braces: keep the native hidden attribute reliable regardless of other display rules. */
[hidden] { display: none !important; }
